Live data from Hacker News

Why use Pascal?

castle-engine.io

21–30 of 516 posts

Re: Why use Pascal?

#21

first word they use to justify using Pascal is that it's "modern". Gave a glimpse at the code source screenshot. No, that syntax is very much the past.

Why? I mostly write Ruby and the code in the screenshot doesn't offend me at all.

Re: Why use Pascal?

#22
post #11

Earlier quoted context omitted.

What makes syntax "modern"? Power matters more than style.

All imperative languages are essentially descended from ALGOL, but in the case of Pascal, it also kept its original syntax. Others have moved on.

Yes they have "moved on".

Which is why Alsol was "a language so far ahead of its time, that it was not only an improvement on its predecessors, but also on nearly all its successors.” — Tony Hoare.

Re: Why use Pascal?

#23

Earlier quoted context omitted.

Check out Free Pascal (FP) if you haven't already. It supports many platforms. You can check on their site if it supports CP/M if you need that. I would not be surprised if it did. The TUI IDE is very similar to Turbo Pascal, and lightning fast. The language has a lot more (advanced) features than Turbo Pascal, but you don't have to use them if you don't want to. The generated binaries were also very small, similar t…

Sadly it seems not to be available for such systems. Though for reference compiling my sample "Hello World" script on TP gives me a "hello.com" file which is 8320 bytes. 64k is as much memory as I have on the machine, so if it were 50-60k I'd be worried there would be no space left for anything else!

Oh yeah, I realised that just after hitting submit. Had worked on almost as low powered machines a while, much earlier, as a hobby. Sorry for leading you down the wrong track.

It looks like the broad cross-platform capabilities of FP are mainly for modern machines and platforms, even if low powered like the RPi.

Re: Why use Pascal?

#26
post #18
post #9

I disagree with some of their reasons. Modern: Object Pascal isn't a modern language. It was modern in 1998, maybe, but it hasn't evolved much since then. Latest big change was the addition of generics, behind almost any other language. Fast: FPC doesn't generate particularly fast code, and the nature of OP objects doesn't help with locality. It's faster than scripting languages, but generally slower than AOT compile…

the greatest difference btw Pascal and C++ is developer experience. Pascal uses a single-pass LL(1) compiler, which allows you to compile in milliseconds. Pascal enables REPL-like experience where you can Edit->Compile->Run in less than a second. C/C++ with macros and slower compilation times is worse developer experience, at least it was the reason for me to learn Pascal instead of C and Delphi instead of C++

Just to add more context: Niklaus Wirth's foresight was to design Pascal's syntax to allow a single-pass compile. But it took more than 15 years until we actually had a blazingly fast single-pass compiler and that is totally Anders Hejlsberg's merit.

Re: Why use Pascal?

#27
Many people using Delphi back in the day will probably already know Lazarus, which is essentially an Open Source recreation which runs and compiles natively pretty much everywhere, Raspberry PI and similar ARM boards included. Installing libraries however can be tedious, therefore FpcUp and later FpcUpDeluxe were created to automate the task of installing the IDE along with other modules and some quite interesting addons.

https://wiki.freepascal.org/fpcupdeluxe

Here's a quick&dirty instrument panel widgets demo I just put together using some free widgets available with FpcUpDeluxe.

https://ibb.co/9bchx7T

FpcUpDeluxe does work also under Alpine Linux (get the musl version on the releases page), which opens possibilities for adding instrumentation panels to very small systems. All code is compiled native on various platforms, and runs fast: no interpreters, no web browsers etc.

Re: Why use Pascal?

#28
post #22

Earlier quoted context omitted.

All imperative languages are essentially descended from ALGOL, but in the case of Pascal, it also kept its original syntax. Others have moved on.

Yes they have "moved on". Which is why Alsol was "a language so far ahead of its time, that it was not only an improvement on its predecessors, but also on nearly all its successors.” — Tony Hoare.

Too good quote :)

Re: Why use Pascal?

#29
post #22

Earlier quoted context omitted.

All imperative languages are essentially descended from ALGOL, but in the case of Pascal, it also kept its original syntax. Others have moved on.

Yes they have "moved on". Which is why Alsol was "a language so far ahead of its time, that it was not only an improvement on its predecessors, but also on nearly all its successors.” — Tony Hoare.

- no struct/record type

- call by name instead of call by reference

- no bitwise operators

- probably a lot more, I'm not too familiar with the language

The quote may have been closer to the truth at some point, but certainly not today. And while begin/end syntax may be a matter of taste I don't think it's coincidence it's not very common anymore.

Re: Why use Pascal?

#30
My first project as a freshman in university was an elevator simulator (with text graphics) in Pascal. I enjoyed the language, there's something elegant about it when compared to C-like languages. This is the reason I'm enjoying Nim nowadays, which afaik is inspired by Wirthian languages (Pascal, Modula 3, Oberon, Delphi), in addition to Ada and Python.
Post reply on HN