Live data from Hacker News

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

news.ycombinator.com

21–30 of 58 posts

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

#21
post #2

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…

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

That was not an FP invention, though. Delphi already did it - they kept the Apple's Object Pascal constructs from Turbo Pascal, and then bolted a whole new object system in parallel. FP inherited that mess and has to maintain it for backwards compatibility reasons. That said, given that the two systems are completely orthogonal, you can simply ignore the older one.

The biggest thing going in favor of FP is that it has been around for almost 30 years now, so it's very mature.

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

#23
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.)

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

#25
The paper "C is not a low level language as we are not programming a PDP11" (something like that anyway) made a good point that C is only fast on a multi core machine because c fans work hard at keeping the laurel. What does a low level language look like when you have 8 cores? Conversely what would a high level language look like for (low level) verilog and FPGAs?

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

#26

The paper "C is not a low level language as we are not programming a PDP11" (something like that anyway) made a good point that C is only fast on a multi core machine because c fans work hard at keeping the laurel. What does a low level language look like when you have 8 cores? Conversely what would a high level language look like for (low level) verilog and FPGAs?

The referred paper C isn't a low level language - your computer isn't a fast PDP11[1] was not really addressing multicore parallelism. It was discussing instruction-level parallelism, which is done within an execution thread and is achieved by speculative and out-of-order execution of instructions that do not have sequential dependency on previous instructions.

[1] https://queue.acm.org/detail.cfm?id=3212479

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

#28
post #23

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

I was so disappointed with Go. Pascal, Delphi and Ada are the roads not taken.

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

#29
Not as my primary language, but I wrote two or three small command-line tools for my own use in recent years. Cross-compilation and platform support is excellent, so it is convenient for writing something once to run on multiple systems as just a static binary without having to mess with installing any dependencies on the target systems.

Sticking to very basic, procedural, non-OO, Pascal though. At its core Free Pascal, like early Turbo Pascal, is very small and simple, even compared to C, and there is value in that, especially since it is also a whole lot safer than C (but still has things like pointers and inline ASM when you need that).

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

#30
Interesting fact: lately I've been benchmarking few things around and I have found out that the same algorithms in JavaScript tend to outperform C in O0.

Why does that relate to your post? Because if you're going lower level for performance you may actually find your assumptions to not hold true unless a good compiler optimization phase is involved.

Post reply on HN