4 ms·
I really would like to see a Modula-2/Oberon/Component Pascal frontend for LLVM.
by wirrbel 6y ago
I really would like to see a Modula-2/Oberon/Component Pascal frontend for LLVM.
- pjmlp 6y agoDepends how long you would be willing to wait for builds I guess.
- sien 6y agoFree Pascal has some support. https://wiki.freepascal.org/LLVM https://wiki.freepascal.org/LLVM There are other some other attempts around too.
- wirrbel 6y agoYeah, but its not a Wirthian dialect.
- pjmlp 6y agoActually it kind of is. Many seem to be unaware that Object Pascal started at Apple offices, not Borland. Not only that, it was developed by Apple in collaboration with Niklaus Wirth. https://en.wikipedia.org/wiki/Object_Pascal https://en.wikipedia.org/wiki/Object_Pascal
- wirrbel 6y agoIts not at all bad (I learned programming using FreePascal, true story). But its unit system is from UCSD pascal (via TurboPascal, etc). I'd say Wirth has a certain 'signature style' and I don't think that ObjectPascal's additions really match that. Also, IIRC, Modula-2 and Oberon feature GC, etc. and personally while I liked Pascal back then, for most stuff I do, not having a GC is pretty-much a regression.
- pjmlp 6y agoModula-2 doesn't have a GC, it is just like Pascal in that regard. Modula-2+, which was developed by the same group that did Mesa/Cedar, does have GC. However Modula-2+ was short lived and eventually grew into Modula-3, also by the same group of researchers. As for Oberon, while it was a very nice system for 1992, it doesn't make sense in 2021, specially given its limitations for low level programming. There are a couple of ETHZ papers that talk about its GC limitations. From the Oberon linage, Active Oberon is the best one, which adopts the same concepts as Modula-3 for low level control of the GC, with safe pointers under GC control and unsafe ones used for C like tricks like DMA transfers. This kind of language features were already present in Mesa/Cedar, but Wirth didn't want to complicate his Oberon design. So in Oberon you are left with explicit calls to dispose resources or hope that the callbacks registered to the finallizer actually happen to run some day. By the way, there were some Modula-2 extensions that did add support for GC, but I am not aware of any major compiler, specially given Modula-3's existence. https://adtmag.com/articles/2001/11/01/extensions-to-the-modula2-language.aspx https://adtmag.com/articles/2001/11/01/extensions-to-the-mod...
- deleted 6y ago[deleted]
- csb6 6y agoThere is a Modula-2 frontend [1] (out-of-tree) written by an LLVM contributor. I haven’t used it, but it seems pretty far along. [1] https://github.com/redstar/m2lang https://github.com/redstar/m2lang