Ask HN: Anyone else use freepascal as their low level language?
6•rlawson•2h ago
Like most devs I have a couple high level languages (Java/Python/PHP) but my low level language was always C/C++. However after 25 years I was still shooting myself in the foot on the regular. I evaluate Go, Rust and fpc. I'm too dumb for Rust, Go's was close but lack of exceptions and classes made it not for me. Fpc hit the sweet spot. The syntax is a little clunky but I have classes when I need them, exception handling, memory management - both auto and manual and cross platform support. Plus I can fit in my head - unlike C++
Comments
Rochus•1h ago
FP is an interesting language. In my opinion, it is somewhat problematic that different language concepts (Delphi, etc.) have been more or less merged into FP, resulting in redundant object models, for example. Pascal as a language also has various historical legacy issues (dangling else, block overhead, global namespace, etc.), which Wirth corrected in Modula and Oberon. The compiler is huge and apparently difficult to maintain (see e.g. https://github.com/rochus-keller/freepascal/). The resulting, optimized x86 code achieves about 70% of GCC compiled C code (see e.g. https://forum.lazarus.freepascal.org/index.php?topic=64261.0), and it turned out that desctructors and some built-in data structures are extremely slow. So I went on to implement my own Pascal/Oberon descendant (see https://github.com/rochus-keller/micron/, work in progress).
Rochus•1h ago
rlawson•1h ago