Pascal is a language from a different era and for a different era. JS/TS has already won the war as the cross-platform language and many tools and frameworks exist to help you ship your app on any platform.
I'm definitely fascinated by programming languages and I know several -- like many HN'ers. But from a purely practical standpoint, I cannot think of anything that cannot be done w/ JS/TS -- especially functional programming in a gradual way where we can use functional when it benefits us and use imperative/procedural when functional isn't practical or is too much work.
I know for LLMs and neural networks, a language that specializes in vector operations is best (and that's not JS nor Pascal), but outside of that I think JS/TS wins.
Depends on your variables. Does it need to run fast? Does it need to be robust? or Error tolerant? What are the consequences for an error occuring (frustration/money/injury/life)? Is it going to need to be updated frequently? Does Pascal have the libraries you need?
As someone says elsewhere Javascript is good cross-platform, but AFAIK it's an interpreted language, and may not run as fast as a compiled language.
You need to look at the pros and cons, and your use-cases.
I haven't used Pascal for about 30 years, so, not for a while. I'd hesitate to make any pronouncements, beyond that it is strongly typed (which reduces some categories of error) and compiled (usually fast).
Free Pascal and Lazarus are FOSS development tools to cross compile Pascal code. It is semi-Delphi compatible.
In 1985 I discovered Turbo Pascal for DOS in High School on IBM PC-XT systems. Pascal has a large library of code you can borrow from or use in your code. I think it is a good language for cross compiling.
I worked with Delphi for 3 years. It was trapped in the job. No-one would look at my CV, past the Delphi. I ended up spending a year working late on open source just to get out from under the language.
Recruiters would say "Oh.. okay" and then ghost me.
Learning Rails and JS, and head hunters are calling me. (back in 2010's)
Delphi is a career death sentence, I assume Pascal would be the same.
Not in Europe where they use Delphi and Free Pascal. I don't know why it is shunned but Pascal is a good programming language taught in high schools in the 1980s and in most Comp Sci courses.
What is it you want to build? How long does it need to be supported? Will people be harmed if it fails? Will people be jailed if it fails? (Like the Postal system in England)
Pascal is fast in terms of compilation and runtime. It has good error handling. You can threads, do generics, etc.
Unlike Python or C, a Pascal program you write now will likely compile correctly without modifications a decade from now.
What do you mean unlike C? I've a c body of code that I wrote in 98, and it still compiles and runs without issue. I poke at it now and again, because it has some interesting bits. Still works.
I've always avoided C, but there was an implementation of the STOIC language in C[1], that pushed me over the edge and nerd-sniped me[2]. It took quite a while to finally figure out that I'd need use Debian 3 to get it to compile at all.[3]
It was only after a generous amount of time from HN that I was able to get a fork working with modern compilers (barely).[4]
Experience taught me that C changed radically in the past 2 decades, what was once the popular style of code just isn't acceptable any more. Throw in the change from 32 to 64 bit CPUs, and everything just broke. Not to mention changes to AutoConf, etc.
I still love the idea of the language, but every time I think of even touching it, I still find myself wishing I could just re-write it in Pascal or Assembler.
I've had similar issues with Python, thanks to WikidPad[5], which still runs as a decade old Windows binary, but fails because of breaking changes to WxPython.
Anyone who has to work on it in a year. The only time code stops needing changes is when it's dead.
Pascal will be a nightmare to hire for. No way a dev wants to become an expert in this lang, getting their next job will be super hard. Devs I know who can code in it, keep that bit off their CV's.
Yes, definitely. The FreePascal compiler can generate code for about any architecture around and it is well capable of cross-compiling, see e.g. https://wiki.freepascal.org/Cross_compiling. There are also development tools available on different platforms, and even an extensive user interface framework (see https://www.lazarus-ide.org/).
Definitely for desktop development. I have been looking into Lazarus/Freepascal for some internal utilities. Pros: Small binaries with minimal dependencies, type safe language, great GUI builder/IDE, Looks much better than tkinter or Swing. Cons: Pascal not as popular, Mobile development seems (again based on initial research - maybe I am wrong) a second class citizen compared to desktop.
21 comments
[ 8.7 ms ] story [ 160 ms ] threadIf you're hell bent on Pascal then consider having it transpile to javascript
https://www.embarcadero.com/products/delphi
Free Pascal compiles to Windows, Linux, MacOS, iOS, BSD, DOS , OS/2, AIX, Android, Haiku, Nintendo GBA/DS/Wii, AmigaOS, MorphOS, AROS, Atari TOS, and embedded platforms:
https://www.freepascal.org/
If you're building something for yourself, sure dabble. I know devs who write assembly in their free time.
Delphi on a resume is a path to retirement. No-one (out side USSR) will look at your resume. Head hunters will ghost you.
Don't fight the JS beast. Just join it!
0: https://github.com/BrowserBox/BrowserBox and https://github.com/00000o1
I know for LLMs and neural networks, a language that specializes in vector operations is best (and that's not JS nor Pascal), but outside of that I think JS/TS wins.
As someone says elsewhere Javascript is good cross-platform, but AFAIK it's an interpreted language, and may not run as fast as a compiled language.
You need to look at the pros and cons, and your use-cases.
https://www.lazarus-ide.org/
Free Pascal and Lazarus are FOSS development tools to cross compile Pascal code. It is semi-Delphi compatible.
In 1985 I discovered Turbo Pascal for DOS in High School on IBM PC-XT systems. Pascal has a large library of code you can borrow from or use in your code. I think it is a good language for cross compiling.
Recruiters would say "Oh.. okay" and then ghost me.
Learning Rails and JS, and head hunters are calling me. (back in 2010's)
Delphi is a career death sentence, I assume Pascal would be the same.
Pascal is fast in terms of compilation and runtime. It has good error handling. You can threads, do generics, etc.
Unlike Python or C, a Pascal program you write now will likely compile correctly without modifications a decade from now.
It was only after a generous amount of time from HN that I was able to get a fork working with modern compilers (barely).[4]
Experience taught me that C changed radically in the past 2 decades, what was once the popular style of code just isn't acceptable any more. Throw in the change from 32 to 64 bit CPUs, and everything just broke. Not to mention changes to AutoConf, etc.
I still love the idea of the language, but every time I think of even touching it, I still find myself wishing I could just re-write it in Pascal or Assembler.
I've had similar issues with Python, thanks to WikidPad[5], which still runs as a decade old Windows binary, but fails because of breaking changes to WxPython.
[1] https://stoical.sourceforge.net/documentation.php
[2] https://xkcd.com/356/
[3] https://news.ycombinator.com/item?id=30957273
[4] https://github.com/mikewarot/mstoical
[5] https://wikidpad.sourceforge.net/
Pascal will be a nightmare to hire for. No way a dev wants to become an expert in this lang, getting their next job will be super hard. Devs I know who can code in it, keep that bit off their CV's.