Ask HN: Can LLVM “compile” back to programming language?
I just had a funny idea to create a "super language" that can be "compiled" to other high level languages from the same code; e.g. write a module once and create versions of it in different languages from the same "source of truth", pun intended.
then I thought that this actually already exists - LLVM! I wonder how easily would it be to create various frontends, but instead of x64, arm, etc. you would have targets like js, py, etc.
would LLVM be suitable for something like this? now imagine instead of writing code in one "super language", you could compile e.g. JS to LLVM and LLVM to Python. wouldn't it be awesome?
5 comments
[ 4.0 ms ] story [ 23.9 ms ] thread[1] https://haxe.org/
Pascal, Lisp, Forth might be more reasonable targets for something like this.