Compiling to LLVM?
by Colin Adams (modified: 2014 May 12)
Are there any plans anywhere for compiling Eiffel to LLVM? Apart from the optimization opportunities this might give, it also implies we could write Eiffel o be run in browsers via emscripten.
We have been studying LLVM for a while now. Recently we updated the LLVM library made by Coline Lemahieu to work against the very latest LLVM (see https://svn.eiffel.com/viewvc/eiffelstudio/trunk/Src/framework/eiffel_llvm/).
However LLVM has some serious shortcomings with portability especially Windows support is not good. Eventually, the library will improve but we cannot change our code generation if not everything we currently have is properly supported.
I wasn't thinking of replacing the C/C++ backend with LLVM, but of adding another backend.
Once you have the LLVM backend, it seems to me that we have possibly a much better/flexible backend than the C/C++ backend. At least for finalized code. For workbench code, if we can remove the issues I've raised then we can remove the C/C++ backend, if the LLVM backend proves to be better.
This is a very interesting idea - I just checked out the LLVM page. Surely however the other thing you mentioned cannot execute all possible LLVM structures in js? If it can, it must be voluminous code (i.e. for Eiffel source). But I guess you are thinking of short chunks of Eiffel code, so it may work just fine...
You can read the limitations for yourself (basically only single-threaded applications or MT with no shared state)
WebAssembly
They are going further now:
https://github.com/WebAssembly/design/blob/master/README.md