2 ms·
My recommendation is not to develop a compiler at all! Well, not really, but just emit C or C++ structured the same as your hand-built library routines -- do t
by gumby 3y ago
My recommendation is not to develop a compiler at all!
Well, not really, but just emit C or C++ structured the same as your hand-built library routines -- do the least amount of work possible -- and just call gcc. You may not be able to persuade the normal runtime linker to do what you want but the mods should be relatively straightforward.
But let them do all the hard work.
- chubot 3y agoI agree with you, and did exactly that by generating C++ from typed Python -- https://www.oilshell.org/blog/2022/05/mycpp.html https://www.oilshell.org/blog/2022/05/mycpp.html However the usual counter-argument is that you're inheriting horrible C/C++ semantics, which often but not always true. That was for the implementation language of Oils, not the shell language we're exposing. So I'd say it's a very useful and fast technique for tools, but not for future-facing languages that you want people to use :)