Anyone else use FreePascal as their low level language?

Anyone else use FreePascal as their low level language?

67 pointsby rlawson53 comments

Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • I do!

    I love it so much, it has a great balance between: readability, fast write/compile/debug cycle and great performance.

    On tip: LLM is God send for it. So many times I find what I was looking for written in some other language and the LLM does the conversion.

  • Not me personally, but I just finished playing a retro FPS set in 1980s Czechoslovakia whose game engine is written in Pascal: https://store.steampowered.com/app/824600/HROT/
  • If you like go, modern pascal is basically that with less curly braces. The other way around is true, too.

    There’s zero technical reasons to not use pascal. Popularity, library availability, programmer availability and LLM quality of responses may be, but the technical foundation is there and has been for at least a decade (if not since turbo pascal from early nineties.)

    by baq
  • Pascal is not a low level language - quite the opposite. That being said, various implementations provide low level facilities, including turbo pascal back in the days , and free pascal which I did use in the early 2000s.

    If I were you, if you like fpc, I’d actually look into Ada ( the OO part is a bit odd granted but works ). You’ll get extremely high control over low level stuff ( it’s used in the embedded world ) along with high expressivity and excellent performance.

  • I see Free Pascal mentioned quite often on HN, so I suspect many are. I recently attended a Delphi conference where several people were using Free Pascal, including one session presenter.

    I've also been using Oxygene, which is a different Object Pascal dialect. (This started because I have begun working with RemObjects - I have to admit, I have wondered why I never used it earlier.) It had design decisions to evolve it more like newer languages (eg it has inbuilt async/await and did on .Net before C#, tuples, nullables etc) and sanitised the syntax somewhat. I like it a lot. https://www.remobjects.com/elements/oxygene/language

  • I've been using it for a while. The string handling is magic compared to that of C/C++ with pointers and nulls and the constant need to allocate and free memory to get things done.

    The only downside is the documentation. Listing the parameters of a function and not explaining the purpose of the function, or what those parameters actually mean, is not proper documentation.

    Borland set a fairly high bar with the Turbo Pascal 3 manual.

  • If you consider Go as a low level language, you might want to try C# which can be as low level as Go while having a lot of high level features. NativeAOT compiler allows you to statically link native libraries or create native shared libraries (.dll/.dylib/.so) that can be consumed from other languages. It's kind of 2-in-1 language, but the ecosystem is primarily focused on the high level part, so you can only depend on small portion of it.

    If you are OK with less popular languages you can check any of these: Nim, Hylo (formely Val), Vale, D, or Zig.

    I haven't tried any of these yet, but they all have piqued my interest. Nim is probably the easiest one.

  • 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).

Explore Birbla archives