5 ms·
> Writing an OS (and the rest) in Pascal (I'm thinking of Oberon specifically) is no harder than to write it in C. You can't because it is impossible to escape
by randomNumber7 6y ago
> Writing an OS (and the rest) in Pascal (I'm thinking of Oberon specifically) is no harder than to write it in C.
You can't because it is impossible to escape the type system. Without the ability to cast pointers you can't write a memory allocator. You can't write a function like dlopen()...
- loup-vaillant 6y agoThe "impossible" has been done: http://www.projectoberon.com/ http://www.projectoberon.com/ Not sure about the memory allocator, Oberon may have avoided the problem by having a GC.
- randomNumber7 6y agoThis is a nice article about the shortcomings of pascal. I don't know oberon so maybe it changed a bit. http://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pascal.html http://www.cs.virginia.edu/~evans/cs655/readings/bwk-on-pasc...
- loup-vaillant 6y agoThanks for the link, I'll go take a look. I'm pretty sure Oberon addressed some of the pitfalls cited there, if only so Wirth could write an OS with it. Not every language is OS worthy, after all.
- int_19h 6y agoThis article talks about Wirth's Pascal as originally defined. But various language dialects evolved way beyond that, and some of them became effectively dominant. Here's what low-level programming in Pascal looked like on DOS: http://www.retroarchive.org/swag/TSR/0022.PAS.html http://www.retroarchive.org/swag/TSR/0022.PAS.html