4 ms·
I'm finding myself using Pascal for fun these days due to resource constraints. The old release of Borland's Turbo Pascal, version 3.00A, runs under CP/M and p
by stevekemp 3y ago
I'm finding myself using Pascal for fun these days due to resource constraints.
The old release of Borland's Turbo Pascal, version 3.00A, runs under CP/M and provides an editor, compiler, and libraries all under 64k.
It's fast enough to use interactively, and produces code that is good-enough to implement low-level utilities, simple games, and other random hacks.
I've not used Pascal on anything larger, or more modern, but I have to say that my recent experience has been rewarding enough that I wouldn't rule it out!
- netule 3y agoTurbo Pascal and later Delphi were the first time when a programming language really spoke to me. Eventually, I went the C and C++ route, but I’ve always had a desire to return to more expressive languages. I had no idea that there was still a modern Pascal implementation, so I may just have to get reacquainted with my first love.
- bluetomcat 3y agoI’ve also a had an early acquaintance with Borland TP 7.0 at the time C99 was already around, and Pascal felt rather clumsy in comparison. The strong typing, the lack of a preprocessor, the verbosity in data declarations, the small set of available libraries just made my early programming self consider C superior.
- baq 3y agoNowadays you look at pascal and see go without braces.
- fuzztester 3y agoCheck 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 to C, when I did a quick test of it on Windows, some time ago. Under 50 or 60 KB for a simple hello world program.
- stevekemp 3y agoSadly 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!
- fuzztester 3y agoOh 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.
- badsectoracula 3y agoFree Pascal has support for Z80 which might work with some CP/M systems (AFAIK Z80 is backwards compatible with 8080 and some CP/M systems used Z80). You need to compile the compiler from source but it apparently can target the ZX Spectrum, so with some modification it might be able to target CP/M too.
- mrlonglong 3y agoUse optimisation to get the binary down to 1k. I did just that yesterday.
- kragen 3y ago'under 60 kb' for a cp/m machine is like 'under 60 gb' for the laptop you're probably using
- brightsize 3y agoOh Pascal!, oh the nostalgia. I saved up the princely sum of $80-$100 back in TRS-80 Model III days to buy the Pascal 80 package, the New Classics version, which was basically a proto-IDE, and a pretty sweet one at the time. http://www.trs-80.org/pascal-80/ http://www.trs-80.org/pascal-80/ I recall it being a huge step up from the M-III BASIC dev environment and the games and utilities I wrote ran well enough in the 48K of RAM that was available. I wonder what became of the Pascal-80 codebase? Not that it would be any better than the modern tools available for retro hardware, probably far worse. Oh yeah, "Oh Pascal!" was the book from which I learned the language, and I doubt there were many other options, as this predated Pascal's commercial use by quite a few years.
- alwillis 3y agoAnyone can check out Oh! Pascal! [1] just like a library book. Even now, it's one of the best introductory programming books for any programming language. [1]: https://archive.org/details/ohpascal0000coop/mode/2up https://archive.org/details/ohpascal0000coop/mode/2up
- vram22 3y agoI was interested to revisit the book, but when I tried, it says: DOWNLOAD OPTIONS download 1 file ENCRYPTED ADOBE PDF download High Quality Page Images In order to access your downloaded book you will need LCP-compliant or Adobe-compliant software on your device. The Internet Archive will administer this loan, but Adobe may also collect some information. That's a turnoff.
- 3y ago