AdeptLanguage / Adept

The Adept Programming Language
GNU General Public License v3.0
120 stars 8 forks source link

Exploring alternative compiler backends #322

Closed ghost closed 6 months ago

ghost commented 6 months ago

This lobste.rs article lists a bunch of alternative compiler backends:

https://lobste.rs/s/ijhl0w/libfirm_compiler_backend

Last but not least, the C backend (compile to C) will always be available as an option.

This is the list of languages that compile to C:

https://github.com/dbohdan/compilers-targeting-c

Some of them even compile to C++.

ghost commented 6 months ago

Maybe related, but I'm unsure: https://github.com/AdeptLanguage/Adept/issues/73

IsaacShelton commented 6 months ago

Yes these backends are definitely worth exploring.

A C backend would be really nice as well. The one bad thing though about a C backend is that compilers like clang and gcc are very very slow on large files in my experience for some reason, so there would have to be something to get around this.

LLVM has been good and has good optimizations, although is overkill sometimes.

Which backend(s) will be supported is something that will need to be considered for sure.

ghost commented 6 months ago

A C backend would be really nice as well. The one bad thing though about a C backend is that compilers like clang and gcc are very very slow on large files in my experience for some reason, so there would have to be something to get around this.

These generated C files crashed my computer. GCC needs too much memory in order to compile them.

https://github.com/gobo-eiffel/gobo/tree/master/tool/gec/bootstrap

ghost commented 6 months ago

Which backend(s) will be supported is something that will need to be considered for sure.

LLVM is still the best. Compiler backends like QBE sounds fancy, but the problem is it doesn't support Windows. Decent Windows support, I can only think of LLVM. This is the reason why I closed this issue.