« first day (602 days earlier)      last day (4572 days later) » 

12:01
@Potatoswatter Yeah, I did. It was extremely thin- at best- on the details.
I mean, did you say that the interpreter for lambda calculus byte code is 210 bits?
@DeadMG Yes.
and in what language is that, in what executable file format?
If you want details, you have to read on or follow the link or whatever.
what operating system functions can I call?
Lambda calculus is for pussies.
And it's hot outside.
12:03
@Potatoswatter I did. They didn't really go into the implementation details.
@DeadMG Yes, he did, lots of details. O_o
I don't understand lambda calculus and I'll probably never need it.
@Potatoswatter Oh, the link with the author's name wasn't just a link to his bio or something.
@RadekSlupik It's a pointless exercise, almost.
It's his homepage, which is close enough. And the next link is to the Wikipedia article he wrote.
12:05
would an STL benefit from multi-threaded <algoritm>s?
I can pass functions as arguments to other functions.
@rubenvb Some of them, yes.
If lambda calculus is "exercise," you're doing it wrong.
@RadekSlupik So can I, and I don't need lambda calculus for that
That's my point.
12:06
@Potatoswatter How would I do that in a loop to get all powers of ten up to 50?
@DeadMG so why isn't there any implementation that does this by default?
@FredOverflow What, the Python? Look up an intro to Python… you're missing out…
Ctrl+K y u indent y u no kill line. Stupid overridden shortcuts. Almost as bad as WikiDot.
@rubenvb Because doing so may impose additional requirements, or performance costs for, for example, small ranges.
but if you look at Visual Studio, they do indeed ship algorithms such as parallel_sort.
@DeadMG <--
12:07
@Potatoswatter got it:
[hex(pow(10, i)) for i in range(51)]
Damn it I don't know if the medicine is fucking with my mind or it's just cabin fever, but I can't remember if I just took it or not…
@DeadMG nonstandard at best. Couldn't there be easy tradeoff calculations that win 99% of the time, and be completely standard compliant?
@Potatoswatter His page seems to indicate that his BLC interpreter is written in BLC itself, which I find to be curious. I mean, if you don't have a BLC interpreter, having one written in BLC seems to be somewhat unuseful.
@DeadMG But he does have one.
@rubenvb Eh. There's little difference between swapping std::accumulate for Concurrency::parallel_accumulate, and using some traits to identify your function as being commutative as well as associative- you have to do it manually either way.
@Potatoswatter It's not really described.
12:10
@DeadMG It's 210 bits long, how can it "not be described"? He provides the Haskell source code (his lambda calculus notation is also valid Haskell, IIRC) and the program he used to generate the bits.
@Potatoswatter The 210 bits long is the self-interpreter.
@DeadMG std::accumulate in a N-threaded context: lock container (which should really not be necessary, as it should be accessed in a thread-sage manner), split range in N parts or the maximum possible, take out N global STL threads from the STL thread pool, run in parallel, add the results. Setup of the thread pool is done at c++ Standard Library load time.
@rubenvb You assume that the function given is addition. But your solution only holds if the function is commutative- the Standard accumulate only requires associative.
which is exactly why I used accumulate as an example- the successful operation of the parallel version requires additional non-deducible semantics from the arguments.
@Potatoswatter Count the number of missing pills?
@DeadMG I see. In all honesty, I was talking about [ this std::accumulate](en.cppreference.com/w/cpp/algorithm/accumulate)
x86 mul affects the carry flag? why???
12:15
To troll you.
x64 doesn't ?
I don't know.
hey, my link got de-linked.
@FredOverflow Why not? It detects overflow. Isn't that what you want?
Hey cppreference.com got a new font.
It's fugly now. :(
12:17
@FredOverflow " Instructions such as multiply and divide often leave the flag undefined, or affected by the last partial result. "
@Potatoswatter I already have the high-order bits in edx. What do I need the carry flag for?
@FredOverflow You don't need it. It just happens to affect it so it would seem.
@DeadMG Note that since the source code is identical, the 210-bit self-interpreter is also the bootstrap interpreter in Haskell… so what else is there to describe?
@DeadMG and I really don't see where the BinaryOp is required to be associative only.
@rubenvb That's because the page you linked doesn't even mention that requirement.
in fact, it's not even required, because accumulate is not even guaranteed that way.
for example, look at the example given with std::string
it would be perfectly legal for me to, say, read the std::string and base my decision on it's contents
but when done in parallel, you don't know what value the std::string has
12:21
x86 doesn't seem to have a single sane multiplication operation. Thanks a lot, intel!
@FredOverflow It just so happens it doesn't. Good thing we have SSE :)
@DeadMG In the meantime I looked up std::accumulate in the FDIS: and I don't see that requirement.
@DeadMG it has the value at the point of the algorithm function call.
just like in a non-multithreaded context.
@rubenvb Which is not the same as the value in the single-threaded function call, which is the output from the previous one.
@Potatoswatter Sorry dude, I will get back to you in a minute.
@DeadMG You're not making any sense. What "previous one"?
@rubenvb The previous iteration.
12:23
@DeadMG What previous iteration? I'm calling std::accumulate. One iteration. Period.
Or one iteration split in N sub-iterations.
accumulate is an iterative algorithm, nub
@DeadMG Eh… I should go try the new Indian restaurant down the street. Beat this cabin fever, maybe. See ya in a few.
and you can't split it into N sub-iterations because the lhs value of the function argument is the output from the previous iteration.
@FredOverflow why don't you use intel syntax? g++ supports that
-masm=intel
@DeadMG yet associativity guarantees I can evaluate any sub-interval of a+b+c+d+e+f (with + being a BinaryOp, not just our addition). If I do (a+b+c)+(d+e+f) and then add the two results (calculated in different threads, there's no issue is there?
12:26
@rubenvb Yet the Standard does not require associativity and does not define accumulate that way.
most notably, there is no requirement whatsoever that op(a, b) is valid.
@DeadMG then why did you bring that up at all?
@rubenvb Because, as I said, I made a mistake saying that it was.
accumulate is strictly defined as (((a + b) + c) + d), and it's strictly defined that way because the types do not necessarily match up otherwise
@ScarletAmaranth Now I wrap the MULs with PUSHF and POPF instructions, and it finally works. But it's far from pretty.
whereas commutativity guarantees that they do.
@CheersandhthAlf I have gotten used to AT&T syntax years ago.
12:30
@DeadMG I can't for the life of me come up with a relevant real-life example where that matters. And I'm not saying that isn't my fault.
@rubenvb You may very well argue that, in actual fact, virtually all accumulate functions do involve such operations- and I'm inclined to agree.
C++ is sometimes too general for my feeling.
actually
I believe I have an example right from my own code base
it's in <numeric> for cryin' out loud.
I hate western languages: they easily refer to god for no good reason at all.
for cryin' out loud - better? :P
12:32
@rubenvb Actually, I like it. It reminds me of how trivial invoking it is in Western society now.
@DomagojPandža yes, better. A little redneck-y, but better :)
ooh, sex
lol
here's me, legally accumulateing across, but as you can see, there's no way you can automatically go from that function I provided to a parallelized version
that's finding a minimum using std::accumulate?
you're never adding anything AFAICS
12:35
nobody says the binary function has to be addition or anything like it
that's why it has an overload taking an arbitrary user-defined function :P
there's probably another algorithm that fits better.
those only operate on structure-of-arrays, not array-of-structures
but I'm too sucky to think of the one that matches better.
there is a std::min_element, but that would first require extracting all the x values
you can use some find_minimum kind of thing and pass a lambda comparing the x struct member
12:37
boost has a transform iterator which can do it, I believe
a custom comparator would do the job?
true
but my point is that this use case is fully legal and supported by the existing Standard
so why the hell use std::accumullate?
why should this be allowed anyways
and completely not at all supported by any parallelised implementation
this is IMHO a perfect example of the too-general-ity of C++
So you're writing confusing code.
12:39
@rubenvb But it is existing, well-defined, perfectly legal and non-buggy code which would be broken- wouldn't possibly even type check- with a parallelised accumulate.
std::accumulate for a std::min_element with a bloated lambda implementing the "min" part.
Remind me to never read any of your code (if this is an example of what you write in a day-to-day basis)
actually, it's not
9 mins ago, by DeadMG
I believe I have an example right from my own code base
I think I copied and pasted it from several successive versions, and this particular snippet was written just after the VS2010 beta came out
you lie!
12:40
at which point I'd been writing C++ for a rather short time
in fact, this whole segment is due to be ripped out soon
I hope so.
by the way
I uploaded a new version of my Wide language specification in like, the last couple days
feel free to check it out
I will.
Something I wondered the last couple of days: it is possible to create an array class in C++ that in effect is a combination of a std::array and std::vector depending on the template arguments. Is this possible in Wide?
be more detailed
one class name, two implementations, exactly the same interface.
one array<T> like std::vector<T> and one array<T,1000> that is well, a std::array<T,1000>.
but better (as in: same interface, except for the reserve functionality in the dynamic version).
12:47
well, you can't have the same interface because std::vector<T> offers many more necessary operations than std::array<T, N>.
how is that really different to what we have now?
@rubenvb What would you have the array-like instantiation do when/if you called push_back?
AFAIK, you can do it with template aliases, or a simple partial spec, if you want to select based on the second parameter being passed or not
@JerryCoffin EXCEPT for the reserve and other dynamic allocation functionality.
in Wide you most certainly could, but IDK why you'd want to
@rubenvb How are their interfaces not identical except in that regard?
one less class name to remember.
12:49
Fuck you x86, I don't need your multiplication:
void multiply_by_10(struct bigint * a)
{
    struct bigint b = *a;
    multiply_by_2(a);
    multiply_by_8(&b);
    add(a, &b);
}
rofl
#define SESSION_NAME L"SDK Examples"
@FredOverflow You know you could write a template that would automatically decompose that, right?
is it valid??
@ErBnAcharya why wouldn't it be?
12:50
That's 5 + 9 + 10 = 24 instructions for the "hack" vs. 29 instructions for true multiplication by 10.
@rubenvb i dont know what L here does..
@DeadMG I only need multiplication by 10.
@ErBnAcharya I have no idea what the L means.
@ErBnAcharya makes it a wide character string.
@FredOverflow Fair enough. Just always makes me feel nervous to see magic numbers abound :P
I assume people understand 2 + 8 = 10 better than template metaprogramming ;)
12:51
@FredOverflow wrong.
@FredOverflow Probably a fair conclusion.
What is difference betn wide character and a character???
@ErBnAcharya the L"blabla" is a ´wchar_t[]` literal.
@ErBnAcharya A wide character is wider than a character.
oh.. i got that..
12:52
@ErBnAcharya they are different types. One is mostly 8 bits wide, the other is wider (mostly either 16 or 32 bits).
@FredOverflow Eh, I'd rather the template metaprogrammed version myself. It would hardly be complex.
@ErBnAcharya A wide character can generally represent a wider range of values (but exact details vary -- e.g., on Windows wchar_t = short, but on Linux wchar_t = long, with the most common compilers on each).
@DeadMG go ahead and write it
My teacher didnt taught about WideCharacter . So i didnt knew(lol).. I got it..
@JerryCoffin wchar_t is not long on 64-bit Linux. Stop saying wrong things people.
12:55
@rubenvb Where is the love?
Oh wait, this uses only one instruction more, but it doesn't require multiply_by_8:
void multiply_by_10(struct bigint * a)
{
    multiply_by_2(a);
    struct bigint b = *a;
    multiply_by_2(&b);
    multiply_by_2(&b);
    add(a, &b);
}
aaargh, fuckfails, no function partial specialization
@StackedCrooked love is for people who say correct things. Especially when it comes to unicode and wchar_t.
Can't you just overload?
@DeadMG does Wide have that?
12:57
@rubenvb Most assuredly.
@FredOverflow Yeah, I can.
Another problem solved.
it's just irking, because I've spent the last two days programming in Wide where you can do that
@DeadMG how does overload resolution work?
oh wait, here comes link to spec
@rubenvb Specialization does not actually exist in Wide.
partial specialization and explicit specialization is more of a side effect
lol //... shit goes here
12:59
@FredOverflow Actually, no, I can't.
oh right: everything's generally-types or however you want to put it.
oh well
I llike that idea.
Does Wide have export template?
@StackedCrooked it doesn't have templates
13:01
@StackedCrooked export having to exist is predicated on headers. I don't have headers.
I de-Cified the interface to make it easier for me to write, but you get the gist
@DeadMG u program windows?? Or do u know WFP ??
also I assumed that shift_by has a specialization for 0 which is a noop
@ErBnAcharya Tip 1: Try learning to spell. Tip 2: This is not your personal help channel. Harassing me is only going to make me less likely to help you.
@DeadMG btw: "elision" is written with one "l".
of course, the performance benefits of decomposition tend to dry up after a certain point, IIRC
but that's not the point
@rubenvb le whatever :P
How can it not be a personal help channel. I mean how can a problem is gurenteed to occours for many users.. and First thing WFP is Windows Filtering Platform [ perhaps a ghost for normal user] ..
13:08
People that type "u" instead of "you" are not worthy of help.
Sorry to disappear like that, but I was just checking. On the 64-bit Linux I have handy, wchar_t is the same as long. The fact that it may not be on other builds/distributions reinforces, rather than contradicting, what I said.
Should I use std::array even if I'm 100% sure noone will ever be passing the array around and I just need a local array that will stay there and hold some values ?
@ScarletAmaranth Yes.
I sometimes use this chat to get help though.
@DeadMG ta
13:09
std::array offers a decent Standard-compatible interface and bounds checking in debug mode.
there's no reason to use T[] except in the most throwaway of variables.
oo, interesting, thanks
@ScarletAmaranth Are you afraid of some overhead?
@FredOverflow Yeah although I guess it doesn't matter.
May 30 at 1:54, by Xeo
If you are new here, please read the newbie hints and keep the acronym list under your pillow. Thank you.
@ScarletAmaranth Either way will work there. Using a native array can save you an extra pair of braces if using literals.
13:11
@ScarletAmaranth There is no overhead. Unless you count the beneficial boundary checks in debug mode. Which are good.
@FredOverflow There is no spoon.
I've been thinking
in debug mode, hoist all local variable allocations to a per-thread memory arena?
because guarantee no H/W stack corruption and always a usable stack trace
@DeadMG do you have function-local static?
Mhm, absolutely no overhead in release mode, at all ?
Okay, I'm down to 32 instructions to multiply a 160 bit number by 10. I guess that's good enough, considering I only use ancient x86 opcodes :)
13:12
@rubenvb Don't recall. I may have BANHAMMERED THOSE EVIL GLOBAL MOTHERFUCKERS but I might not.
@ScarletAmaranth Nope. Welcome to classes.
@ScarletAmaranth Nope, none. std::array has neither memory nor instruction overhead.
@DeadMG cause those would screw with that plan
@rubenvb Why? They aren't local variable allocations.
@DeadMG I'm stupid so don't mind me. But don't threads have their own stack?
Holy black elder on a tree, that's neat, thanks ;)
13:13
@StackedCrooked Which is why it would be a per-thread memory arena.
@DeadMG hmm, whatever. I'll shut up and work now.
@ScarletAmaranth I only use C arrays when I'm bored and in a playing-with-fire mood.
then if you get stack smash or stack corruption, guarantee useful stack trace.
because you can't smash a stack you have no pointers to, as it were
@FredOverflow Did you see my template impl?
@DeadMG Does it use C arrays?
@FredOverflow No?
13:15
@FredOverflow I defaulted to std::array a while ago but haven't really given it a thought whether they incur any overhead or not, it's nice to hear they don't.
I use C-style arrays if I need to store some binary data in my executable.
@ScarletAmaranth In release mode, they don't.
@ScarletAmaranth If they did, you'd find out as soon as you hit a bottleneck and profiled.
@DeadMG does you language have fundamental types or did you kick those out too?
@rubenvb Define "fundamental".
13:17
@DeadMG like C's int char long etc...
basic building blocks for everything else really.
... right, but what exact property of them makes them fundamental?
C++ calls them built-in types.
Oki doke, thanks then. Visual studio HO again.
@FredOverflow ...with the obligatory, "at least in any sane implementation." Somebody who wanted to badly enough could almost undoubtedly write a conforming implementation that added arbitrary overhead if they wanted to badly enough.
yeah, built-in-ness I guess.
13:17
my type system does not differentiate between them and any other type
nor does the grammar
or the semantics of the type manipulation facilities I provide
In computer science, primitive data type is either of the following: * a basic type is a data type provided by a programming language as a basic building block. Most languages allow more complicated composite types to be recursively constructed starting from basic types. * a built-in type is a data type for which the programming language provides built-in support. In most programming languages, all basic data types are built-in. In addition, many languages also provide a set of composite data types. Opinions vary as to whether a built-in type that is not basic should be considered "prim...
@DeadMG So (assuming you provide inheritance at all) you can derive from the "built in" types?
@JerryCoffin My language allows for the sealing of user-defined types, so this is not a special property of them.
@DeadMG not really what I was after; I was more talking about: are they system-dependent sizes or are they bound to x86 CPU types?
also, I might have specified that you actually can do that
haven't written the spec on int, etc, yet.
@rubenvb They're definitely independent. The C#-Java style works fine here.
13:20
@DeadMG so they suck to be implemented on non-32-or-64-bit hardware?
DeadMG said something good about Java!
@FredOverflow Java's import statement is also non-suck, IMO.
There's a lot bad about Java that's not in the core language.
Whoah. Where is this conversation heading to?
@rubenvb If you have that kind of hardware, then you probably have so many other problems that the sizes of the integral types is hardly going to rank highly amongst them.
Java and C# are both architecture-independent but get away fine with their well-defined sizes
13:21
@DeadMG I'm thinking DSP boards which I believe often have crazy integer type sizes.
the truth is that hardware which is not in that range is in such the vast minority that I'm not concerned about targetting them
@rubenvb Also toasters! People are surely gonna want Wide Toasters!
@FredOverflow The all-new Wide Toaster! It can toast twice as many slices of bread in the same time with the same power as the Java Toaster, because Wide is plain faster than Java.
@DeadMG oh noes, you're already comparing performance of something you didn't write an implementation for yet.
@DeadMG Java needs more resources, ergo the hardware gets hotter, ergo it toasts better. You lose!
13:23
kek
@FredOverflow I doubt the heat of the CPU can contribute towards toasting the actual bread :P
@DeadMG I thought that would require twice as many slots. You can rush the toast itself.
@rubenvb Let's face it. 1: Java has a cock slow implementation and language semantics. 2: I have LLVM.
@DeadMG Don't be so sure ;)
I think that std::tuple<int> is a way of inheriting from int. You "inherit" operators. Although, I don't think you get ++ and --.
@FredOverflow ROFL
13:25
@DeadMG Java has VMKit and J3: vmkit.llvm.org/get_started.html
@rubenvb Yeah, that's totally going to save them from "MUST INDIRECT ALL THE THINGS" language semantics.
@StackedCrooked a std::tuple<int> is not an int in any useful sense.
You're no fun.
:p
Why would you want to inherit from int, anyway? By the way, you could call it "intheritance". Which sounds stupid. So it's probably a bad idea.
I haven't figured that part out yet.
13:28
@FredOverflow I'd like to inherit from unsigned char to be able to std::cout a numerical byte for example.
@FredOverflow overloads and templates.
If you inherit from unsigned char, the output will be a character, right?
@FredOverflow yeah, so uint8_t is never a number.
If you add an overload for that Uchar type (distinct from unsigned char), you can modify cout's behavior.
just use printf instead of cout ;)
0
Q: Related questions dialog is way too big

DeadMG I believe this accurately represents my problem. Happens on SO proper as well (not sure about other SE sites).

what would have been ironic is if the image had been oneboxed and it was massive in the chat
@DeadMG A valid self-referencing question. Nice!
13:32
@FredOverflow no thanks.
@StackedCrooked I'm the skilled.
also, I just wrote this tiny gem:
0
Q: To what extent does SSA form allow types with non-trivial copying?

DeadMGI've been looking into IR code which is specified using SSA- especially, generating LLVM IR in this form. However, I'm confused about whether or not this can be effective when presented with a type which has non-trivial copy semantics. For example, void f() { std::string s = "Too long for yo...

@DeadMG bahaha you got duped on the meta question.
lol
I always thought FLT_MIN would be the smallest floating point number, but on my system, it's only the smallest normalized floating point number.
13:47
FLT_MIN = 2^-126 but smallest float = 2^-149
@FredOverflow same with numeric_limits<float>::min(). Denormalized numbers are optional in IEEE 754. If you want you can divide it by two and see what happens :P
Optional? Really? I've never heard that before. Source?
@StackedCrooked "The Web Will Die When OOP Dies" sounds really stupid, but I'll give it a try.
I don't really feel like digging through my copy of 754 right now, it's not fulltext-searchable.
But remember the popular version of the standard is from 1985, and denormalizing is expensive in circuitry.
lol everyone is asking for XP targetting support for VS2012. Not going to happen: 1) money, 2) C++ multithreading is sucky to implement on pre-vista, 3) money, 4) ...money.
@rubenvb I have no idea WTF you're talking about. Vista's threading API isn't significantly better than XP's. Their existing PPL library targets XP just fine.
13:51
> But even when denormal values are entirely computed in hardware, the speed of computation is significantly reduced on most modern processors; in extreme cases, instructions involving denormal operands may run as much as 100 times slower.
interesting
Anyway, you can use std::numeric_limits<float>::min() / ( 1 << std::numeric_limits<float>::digits - 1 ) (ideone.com/uO7B0)
@Potatoswatter Or I can just bitcast 1 to float ;)
@DeadMG There's new kernel-mode primitives, it's not the API I'm talking about.
hmmm
@FredOverflow Well, you can copy the bytes from an int to float and hope that the endianness is the same between them, and the format is IEEE…
13:53
@rubenvb Visual Studio does not have to know or care about those.
@DeadMG C++ does (the library implementation)
@Potatoswatter Which I'm pretty sure it is on my system. It's not like anybody else is interested in my programs ;)
this would seem to indicate that SSA does not actually work for non-trivially-copyable types.
@rubenvb The implementation of all their PPL threading libraries worked fine on XP in VS2010.
@DeadMG I'm not talking about PPL. I'm talking about Standard C++ concurrency stuff.
@rubenvb Which, if I recall, is less demanding, not more.
13:55
@DeadMG yet less performant without the new stuff
in fact, half the reason a lot of that stuff is specified the way it is is so that Microsoft could implement it directly on top of their PPL.
@rubenvb How, exactly?
@DeadMG I can't recall the details, but there is speed increase to be gained from using the condition_variable and whatnot over emulating them with XP API.
@rubenvb And that stops them from gracefully degrading... how?
especially since that would appear to be one tiny, tiny piece of code in one single library.
@DeadMG see my other three reasons for them dropping XP support.
@rubenvb Right. So basically, all of your reasons are that Microsoft are cynical money-grabbers who are trying to push people off XP this way.
13:57
@DeadMG well, duh.
I don't think there's anything wrong in pushing people off XP.
then why on earth did you write anything about C++ and multithreading in the first place?
@FredOverflow Me neither, actually. I just don't see the need for it to happen today, instead of when XP is EOLd in like, two years or whatever it is, in time for the next version of VS.

« first day (602 days earlier)      last day (4572 days later) »