4 ms·
Do you think device drivers or servers like Nginx could ever have been written in Pascal?
by solidsnack9000 10y ago
Do you think device drivers or servers like Nginx could ever have been written in Pascal?
- mamcx 10y agoOf course. And the "limitations" of pascal is a larger-than-life myth! Is like judge C from how it was at the first release. By the time of TurboPascal the things was great. The peak was around Dephi 3 and it was possible to circle around C/C++ all day long, barring, obviously that the market share and ecosystem was bigger for C/C++ so that answer why you "cant'" do some stuff. Because was not implementation or library for it, NOT BECAUSE THE LANGUAGE.
- pjmlp 10y agoOf course. In CP/M, MS-DOS and a few other home systems, Pascal used to have more compiler variants available than C. Pascal dialects like Turbo Pascal had all the features of C, plus modules, OOP, type safe enumerations and many other features. If it wasn't for the rise of FOSS in the late 90's, widespreading the UNIX culture and thus C, Pascal derived languages might have been kept around.
- int_19h 10y agoLet me give you just one example adding to the other comments. In Turbo/Borland Pascal, you could declare global variables (including arrays) allocated at a specific memory address, e.g.: var video: array[0..4000] of byte absolute $B800:0000; It also had a special modifier for functions, that made them work as interrupt handlers. And inline assembler with nice, readable syntax that allowed addressing variables directly. Consequently, it was actually easier to do most low-level DOS hackery in Pascal rather than C. So yes, I'd expect it do just fine for drivers, as well.
- SyneRyder 10y ago"Consequently, it was actually easier to do most low-level DOS hackery in Pascal rather than C." I remember downloading source code in the mid 90s of various DOS graphics effects from the demoscene, and being surprised how much of it was in Pascal. And also frustrated, because I'd gone with Turbo C++ instead & had to try porting the code across myself.
- Rabidgremlin 10y agoSure... somewhere I have book that covered writing a full blown multi-threading "OS" in Turbo Pascal. In the late 80's I wrote a framework that allowed multi-user games (via dial-up) to be created. Included 256 color graphics, mouse input etc... had fun fighting IRQ conflicts etc. Good times :)
- leledumbo 10y agojust a single reference to open your eyes: https://ultibo.org/ https://ultibo.org/ web servers are just network programming, it's even easier. FPC even ships a HTTP server library with examples in only a few lines of Pascal.