4 ms·
Ask HN: Is Pascal any good for modern programming?
Hello HN community! I know to program in languages like C, C++, Python, etc. I want to create small but robust programs and I think C gets in the way of that unless I write every line of code like a paranoid.
I know Rust offers a lot of safety features but I don't like the ergonomics of it. Python has good ergonomics but is slow as hell. So here is what I am looking for in a programming language I can use for my small and robust programs:
- The language should have implementations that are popular and available for almost all popular architectures and operating systems.
- The language should have implementations that compile to machine code.
- The language should have been around for >= 10 years.
- The language should have good ergonomics. It should not make me reinvent the wheel for simple things like file IO, substring search, etc.
- The language should not perform outright dangerous things silently. If I try to read beyond the end of an array the program should crash immediately.
- The language or its implementations should not have garbage collector.
After searching through many available languages I think Pascal might be it but I don't know enough Pascal to make a call. So I am drawing upon the wisdom of HN community to find out if Pascal is a good fit here or if you have other suggestions for me.
- pfoof 4y agoAs a hobby: go for it, FLStudio, early Skype, Dev-C++ were all made in Pascal/Delphi. Check out also Hedgewars: https://github.com/hedgewars/hw https://github.com/hedgewars/hw For a job: no way.
- simonblack 4y agoI see Pascal as not really very different from C, except a bit more wordy. It's fallen out of general favour since the 1980s. IIRC, there were several Pascal-to-C translators around that didn't seem to do a great deal more than 'search-and-replace'. (As in something like '{' instead of 'begin' and '}' instead of 'end', etc.) Get a hold of Wirth's book on Pascal and have a rummage through it. See if it catches your fancy. There are quite a few Pascals out there on the Web. Grab one and play with it if you want to go any further. http://libgen.rs/search.php?req=pascal+wirth&open=0&res=25&view=simple&phrase=1&column=def http://libgen.rs/search.php?req=pascal+wirth&open=0&res=25&v...