4 ms·
Ask HN: Is Pascal a good choice for cross-platform development?
- neximo64 3y agoNo. 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
- keepamovin 3y agoReally? But it's marketed as targeting those mobile systems. What makes you say that?
- netcruiser 3y agoDelphi compiles the same code and UI to iOS, Android, OSX, Windows, Linux, etc.
- clouddrover 3y agoDelphi compiles to Windows, MacOS, iOS, Android, and Linux: https://www.embarcadero.com/products/delphi 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/ https://www.freepascal.org/
- john_the_writer 3y agoDelphi is just evil. Stay away. 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.
- dtagames 3y agoPascal 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!
- keepamovin 3y agoHahah! Well, I am already on the JS train. Deep on it^0 but I was thinking of switching. Seems you think that would be ill advised! Hahaha! :) 0: https://github.com/BrowserBox/BrowserBox https://github.com/BrowserBox/BrowserBox and https://github.com/00000o1 https://github.com/00000o1
- dtagames 3y agoI'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.
- MrVandemar 3y agoDepends 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.
- keepamovin 3y agoCool, yeah. Do you have experience with Pascal? Does it hold up well in those cats you mention (fast/robust/error tolerant?)
- MrVandemar 3y agoI 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).
- orionblastar 3y agohttps://www.freepascal.org/ https://www.freepascal.org/ https://www.lazarus-ide.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.
- john_the_writer 3y agoI 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.
- orionblastar 3y agoNot 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.
- mikewarot 3y agoWhat 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.
- john_the_writer 3y agoWhat 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.
- mikewarot 3y agoI'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. [1] https://stoical.sourceforge.net/documentation.php https://stoical.sourceforge.net/documentation.php [2] https://xkcd.com/356/ https://xkcd.com/356/ [3] https://news.ycombinator.com/item?id=30957273 https://news.ycombinator.com/item?id=30957273 [4] https://github.com/mikewarot/mstoical https://github.com/mikewarot/mstoical [5] https://wikidpad.sourceforge.net/ https://wikidpad.sourceforge.net/
- 6R1M0R4CL3 3y agoonce it's compiled into executable code, who will know ? :>
- john_the_writer 3y agoAnyone 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.
- Rochus 3y agoYes, 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 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/ https://www.lazarus-ide.org/).
- rlawson 3y agoDefinitely 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.