Ask HN: Is there a programming language that has this?
Imagine a compiler like chrome v8 engine which analyzes code on runtime and figures out which code path are more resource intensive and manage them. So what if same way compiler notices that certain code path executions take longer and start spreading them on other threads/cores/machines like kubernetes and orchestrating all of it behind the scene.
So you as a developer don't worry about that.
Let's take javascript
suppose every promised function had potential to be it's own serverless function, depending on resources usage, compiler can either run it on main thread or delegate to cluster.
let data = await getData();// compiler sees getData takes time and is put its own serverless function or something.
I feel this could be ground breaking. Automatic app scaling based on runtime analysis of code paths.
We could have do this right now, with external a library in js using something like this...
let data = await SF(getData(123)); //SF spawns new serverless function based on body of SF...
but it'd be better if it was implemented at language level. I'd like it if chrome team did it.