HACKER Q&A
📣 keepamovin

Is Pascal a good choice for cross-platform development?


Is Pascal a good choice for cross-platform development?


  👤 Rochus Accepted Answer ✓
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/).

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


👤 neximo64
No. It would be its worst use case for cross platform development. I doubt you can easily make an iOS or Android app with it.

If you're hell bent on Pascal then consider having it transpile to javascript


👤 orionblastar
https://www.freepascal.org/

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.


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


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

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

Don't fight the JS beast. Just join it!


👤 6R1M0R4CL3
once it's compiled into executable code, who will know ? :>