3 ms·
Haskell used to be compiled to C. (not sure if they still use this backend, I think main GHC backend compiles to LLVM). "Doesn't have garbage collector" is not
by gnulinux 6y ago
Haskell used to be compiled to C. (not sure if they still use this backend, I think main GHC backend compiles to LLVM). "Doesn't have garbage collector" is not a good reason not to be able to compile to C, surely garbage collection can be implemented in C.
- iso8859-1 6y agoJust because it is possible doesn't mean it's easy. If you implement garbage collection in C, you are using your own garbage collector, the C ecosystem doesn't support you in any way. When people make the argument of preferring a compilation target because it has a specific feature, they are not saying "target is not Turing complete, you can't implement this feature". They say "not natively supported and I would rather not implement this myself". And no, -fllvm exists, but it is not the default: https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_gui...
- pjmlp 6y agoGHC uses its own backend with C-- as intermediate language. The LLVM is just yet another one.