3 ms·
(I'm interested in programming languages, my comment is asking questions because I'm curious, I'm not questioning the project) You mention a focus on backend d
by jraph 3y ago
(I'm interested in programming languages, my comment is asking questions because I'm curious, I'm not questioning the project)
You mention a focus on backend development. Why suffer having to compile to JS if you are not restricted by the runtime environment? (in the backend, surely you can run anything). In my understanding, compiling to JS is only interesting when you want to run in the browser, but outside this constraint, JS seems like a less than ideal compilation target (though probably way better than before thanks to the presence of typed arrays).
Is it interoperability with the JS ecosystem? Wouldn't the no null/undefined criterion be a barrier to this? Or will you take any result from a call to a JS function as optional? Or have interfaces saying "I promise, I will never return null/undefined"?
Or you still want your language to be able to run in browsers? In this case, will you provide a standard library (with the cost of having to transfer it every time it's used), or only a thin wrapper around native JS functions?
You say Rust-inspired. For me, one of the most interesting features of Rust is the explicit management of the lifetime of objects. How do you intend to handle this aspect, with JS not having anything like this?
- taosx 3y agoInteroperability: I believe we can do interoperability by selectively wrapping the necessary imports in 'unsafe'. From there, it's up to the implementer to decide whether to handle it as a 'Result' or an 'Option'. Browser, Std lib: Yes, the language should still be able to run in the browser and will provide a std but will not transfer each time, the benefit of writing a compiler would be that we can do dead-code-elimination and target native javascript methods instead of something like wasm. Lifetimes: Honestly, currently I'm only working on the simplest transpiler but I would like to explore using typed arrays as the stack, heap.