@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.
@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.
@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.
@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.
@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 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?
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
@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.
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?
@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).
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.
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] ..
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 ?
@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.
@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.
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...
@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
@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.
I'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...
@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
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.
> 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.
@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.
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.