Live data from Hacker News

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

news.ycombinator.com

41–50 of 58 posts

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

#42

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…

Last time I checked, NativeAOT was only for console apps, i.e. didn't support any GUI frameworks.

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

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

An important reason against Pascal is the tiny community. It's so easy to cobble things together because there's a huge package base, or even just projects on Git forges. Also, to the extent people put their Pascal packages up, I have found them often dated, and written in outdated Pascal styles (a lot of manual Freeing for instance, another project's functions never return anything but ask for an output structure as last function parameter). Kinda hard to see what a nice and modern codebase looks like.

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

#44
post #42

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…

Last time I checked, NativeAOT was only for console apps, i.e. didn't support any GUI frameworks.

Avalonia and Uno both support NativeAOT:

https://avaloniaui.net/

https://platform.uno/

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

#45

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…

You can get very low-level in C# but at the point you start using unsafe the nature of the language changes very suddenly. Unsafe C# is the most unsafe language I've ever worked with. Really terrifying stuff.

Fortunately, there have been a lot of improvements to low-level C# since v7 that make unsafe unnecessary in a lot of situations. E.g. ref structs, ref local variables, ref returns, stackalloc improvements etc.

There's an interesting comparison of these C# features with Rust: https://em-tg.github.io/csborrow/

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

#46
post #44
post #42

Earlier quoted context omitted.

Last time I checked, NativeAOT was only for console apps, i.e. didn't support any GUI frameworks.

Avalonia and Uno both support NativeAOT: https://avaloniaui.net/ https://platform.uno/

I was even able to statically link native dependencies during NativeAOT compilation of Avalonia app to produce a single binary. It's not the default mode for AOT compiled Avalonia, but it's possible.

ImGui.Forms is another one that supports NativeAOT.

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

#47
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

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

#48
Ada is more serious than Pascal. There is Ada-to-C(++) translator called AdaMagic. It is limited to Ada 95, but Ada was ahead of time and so 95 is fine. On most platforms GCC is available, and Ada is the most interesting language in GCC, but just in case there is AdaMagic.

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

#49
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…

Also corrected in Ada: https://annexi-strayline.com/blog/posts/1

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

#50

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…

Patriots of Pascal language family are expected to prefer Oxygene over C#
Post reply on HN