Live data from Hacker News

Ask HN: Anyone else use FreePascal as their low level language?

news.ycombinator.com

11–20 of 58 posts

Re: Ask HN: Anyone else use FreePascal as their low level language?

#11

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 )…

In what way is the OO part a bit odd?

The way you express it is different from most other languages I’ve come across. It doesn’t make it bad in any way ( I’ve written Ada professionally), just unusual. Basically Ada already provides natively substantial capabilities relative to encapsulation, modularities, generics etc but in a procedural context. The designers bolted on OO facilities on top of said existing mechanisms.

While it may look reasonably clean in the link below, I’ve always found it integrates badly with an existing codebase, the primary problem being that the ‘boundaries’ of the objects are not clearly visible.

https://learn.adacore.com/courses/Ada_For_The_CPP_Java_Devel...

I will add that the existing non oo features are excellent and I would even argue that in many cases you don’t need OO.

Re: Ask HN: Anyone else use FreePascal as their low level language?

#12
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.

Re: Ask HN: Anyone else use FreePascal as their low level language?

#13

Earlier quoted context omitted.

In what way is the OO part a bit odd?

The way you express it is different from most other languages I’ve come across. It doesn’t make it bad in any way ( I’ve written Ada professionally), just unusual. Basically Ada already provides natively substantial capabilities relative to encapsulation, modularities, generics etc but in a procedural context. The designers bolted on OO facilities on top of said existing mechanisms. While it may look reasonably clean…

Thanks.

>I will add that the existing non oo features are excellent and I would even argue that in many cases you don’t need OO.

Somewhat the same in Python, because of the built-in data structures such as lists, dicts and sets, and the ability to compose them.

Re: Ask HN: Anyone else use FreePascal as their low level language?

#14
post #8

Out of curiosity, where were your pain points with Go regarding lack of classes? Go offers types, methods & interfaces, that gets you pretty far while avoiding inheritance. I found it pretty reasonable and not limiting (coming from a background with C/C++/Java then years of python).

After so many years as a Java dev my brain thinks in classes so not having classes or exceptions made it a constant struggle. Nothing against Go, more about me.

Re: Ask HN: Anyone else use FreePascal as their low level language?

#16

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 )…

> Pascal is not a low level language - quite the opposite.

Why do you say that?

Back in the 80s and early 90s it was the primary competitor to C, and in an alternate universe we might have ended up using Pascal decedents instead of C decedents.

For example the original Mac Toolbox was first written in Pascal: https://apple.fandom.com/wiki/Macintosh_Toolbox

The original Mac API were all native Pascal: https://wiki.freepascal.org/Basic_Pascal_Tutorial/History

Re: Ask HN: Anyone else use FreePascal as their low level language?

#17
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.

Re: Ask HN: Anyone else use FreePascal as their low level language?

#18

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 )…

You are wrong, Pascal has always allowed pure raw pointer and data manipulation as well as self memory management, the strong type enforcement and auto management for some types (strings, dynamic arrays) is just on the surface so you don't shoot yourself in the foot but it never stops you from doing any low level programming.

Re: Ask HN: Anyone else use FreePascal as their low level language?

#20

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 )…

The problem with Ada is tooling other than the compiler. Last I checked, GnatStudio still doesn't work well on Apple Silicon, for example, and VSCode support was decidedly meh.

With Free Pascal, though, you get a TUI IDE working basically everywhere, plus Lazarus across all major desktop platforms.

Post reply on HN