4 ms·
Hello, I have been working on this project for a while now and would love to take any questions anyone may have.
by jfecher 9y ago
Hello, I have been working on this project for a while now and would love to take any questions anyone may have.
- ivanbakel 9y agoWhat checking is done on code generated by the compiler extensions? Do you manually have to build the code out of well-typed components, or does the compiler check again after each pass? As an aside, it's very cool to see this implemented, though it does give me the depressing thought that none of my ideas are original anymore. Hopefully more languages follow suit and allow for this kind of utility.
- jfecher 9y agoThe Ante code to generate each portion of llvm-ir is checked as normal but there is no checking done on the llvm-ir that is generated. It is expected for each extension producing ir to generate valid output. That being said, one of the cool things about Ante (imo) is that if you dont like this, you can write an extension that does check for validity.
- swsieber 9y agoIt looks like you use LLVM as a backend - it seems to be the norm these days. What drove you to use it, and what has been your experience with it?
- jfecher 9y agoI decided to use it largely because of its proven track record, optimization passes, and its ability to act as a JIT compiler. LLVM is very competitive with other compiler's backends in terms of speed (see clang and gcc), and it is well established so there is plenty of help and documentation available. The builtin optimization passes means I can spend more time on the language itself rather than the IR, and the JIT, while not the fastest, is usable as is, and is extensible should I need it. Compared to using C as an intermediate language I would say there is a slight learning curve, but overall I found llvm easy to learn. One of the only disadvantages is that because llvm is so large it requires some odd build steps that can be a pain to setup, especially on windows. The llvm-config tool however, manages many of required flags for you. Also, because there are so many libraries, compilation of the compiler itself can be rather slow.