Compilation to web assembly and/or native code
Opened this issue · 0 comments
This would be really cool!
Questions
LLVM?
Would we target WASM and then compile that to native?
Or use something like LLVM that can do both?
Using LLVM may be more challenging to develop and maintain, and may result in a slower compiler, but may be result in faster code. WASM is currently limited in terms of multi-core and OS API access too.
How does one learn to use LLVM?
libgccjit
Same as above!
https://gcc.gnu.org/onlinedocs/jit/index.html
https://github.com/antoyo/rustc_codegen_gcc
https://github.com/antoyo/gccjit.rs/tree/feature/rustc
References
TinyGo implementation details
https://tinygo.org/compiler-internals/datatypes/
Nim's reference counting
Nim has an interesting memory management strategy of non-atomic (single threaded) reference counting with data owned by a thread (so no atomics) and a cycle collector in the background to handle loops not handled by the RCs. Requires the programmer to manage ownership to some degree.
https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
https://nim-lang.org/araq/ownedrefs.html
https://forum.nim-lang.org/t/5734
https://archive.fosdem.org/2020/schedule/event/nimmovesemantics/
Pony's GC
https://github.com/ponylang/pony-tutorial/blob/main/docs/appendices/garbage-collection.md
https://www.ponylang.io/media/papers/orca_gc_and_type_system_co-design_for_actor_languages.pdf
Lean4's GC
https://www.microsoft.com/en-us/research/uploads/prod/2020/11/perceus-tr-v1.pdf
Koka's RC
https://www.microsoft.com/en-us/research/uploads/prod/2020/11/perceus-tr-v1.pdf