Daily Thought - 2024-07-30
< back to listCaterpillar will be a purely functional language, which means everything you really need to know about a piece of code, you can see by looking at it. If that code calls a function, you can be sure that the function doesn't implicitly update some global state. Everything that function can do, is encoded in its parameters and results.
A side effect of that, is that it should be quite easy for the compiler to parallelize code automatically. Take any piece of code and exploit its inherent concurrency by compiling to machine code that runs on multiple threads. But if the compiler does that, it gets harder for the developer to understand the runtime behavior of their application.
But what if auto-parallelization happens in the pre-compilation step that produces the canonical representation? Then the already parallelized code will be stored in the code database. The developer sees exactly how the code will run, can tweak the auto-parallelization parameters to influence the result, or overrule a decision outright.