Coffeehouse Post

Single Post Permalink

View Thread: The New vs Evolving the Now
  • User profile image

    1) I'd like to state exactly WHY functional programming is far easier parallelized, it's not because of immutability per-se, and immutability helps, but something slightly more subtle.  C++ and other compilable languages get assembled into assembly instructions, that linear form is actually the problem. The instructions depend on instructions above other than the branch/jumps to find the final momentary code execution path.  Functional languages on the other hand use LAMBDAS, which are self-contained packages of instructions which are independent of other lambdas.  The ability for one lambda/anonymous function to not rely on the others in the program other than possible data dependency's is why you can run a lambda function independent of the processor. Thus a lambda function's instructions are at a coarse enough grain that they aren't tied together by a built-in per-CPU hardware program counter.


    2) The other thing I've not understood is WHY today we are limited to a single main function!!!  To me, if code entry execution point and exit points could be refrenced or indexed like a fucntion table at the beginning of the file, the binary could/should be able to run different functions at the same time, instead of the one large main which must start at one point in code/binary and end at specified exit/exception points. This is an alternate way in my head I've been wondering could be a different approach to the "thread".