* * *

Author Topic: Curious (old?) comment about Pascal for systems programming  (Read 1072 times)

dtoffe

  • New member
  • *
  • Posts: 10
    So I read about Ultibo project and just out of curiosity started a search for operating systems written in Pascal or Wirthian languages, Oberon System for example. This page called my attention:

http://wiki.c2.com/?WirthLanguages

Quote:
      "it is worth noting that Pascal was intended for systems programming and not just for education. And it was, somehow, used for systems programming here and there, but it is worth pointing out that, on platforms where C was also available, Pascal was not used for systems programming. Pascal forced a great deal more use of assembly language to get around language restrictions."

     I assume this comment refers to "old" (pre Turbo era) Pascal.

     I'm not experienced in systems (kernel, drivers) development, and in fact I haven't used Pascal for many years now.
     What could those "language restrictions" be, compared to C ??

Thanks,

Daniel

Phil

  • Hero Member
  • *****
  • Posts: 2749
Re: Curious (old?) comment about Pascal for systems programming
« Reply #1 on: May 28, 2018, 02:36:10 am »
What could those "language restrictions" be, compared to C ??

Was there ever a "platform" where C was not available?

Have no idea what's being referenced here. I'm not even sure what a "systems programming" language is. Note that's one of the claims for Swift too, that you could write an entire OS in it.

https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/index.html


jamie

  • Hero Member
  • *****
  • Posts: 786
Re: Curious (old?) comment about Pascal for systems programming
« Reply #2 on: May 28, 2018, 03:11:06 am »
back in the days of TP I could write a device driver for DOS, a TSR etc...
to do so I had to do something that would not link in the System unit and thus only the
*.bin file was present.

 Using the CONST feature, I could place header info at the start of the file and it worked like a charm.


Ultibo

  • New member
  • *
  • Posts: 36
    • Ultibo.org
Re: Curious (old?) comment about Pascal for systems programming
« Reply #3 on: May 28, 2018, 12:44:19 pm »
     I assume this comment refers to "old" (pre Turbo era) Pascal.

     I'm not experienced in systems (kernel, drivers) development, and in fact I haven't used Pascal for many years now.
     What could those "language restrictions" be, compared to C ??
As the author of Ultibo I can say with certainty that most (if not all) of those restrictions are long gone.

I suspect what they are referring to relates to things like pointers, inline asm and interoperability with other languages, all things FPC does easily now.

There are even things that make FPC potentially more useful for systems programming than others, for example classes make implementing modular subsystems like the filesystem much easier.

We've recently been porting the Ultibo API to C/C++ so more people can take advantage of it, except for higher level constructs like strings, classes and dynamic arrays there is almost a one to one correlation between FPC and C/C++ for most things.


Ultibo.org | Make something amazing
https://ultibo.org

Threads, multi-core, OpenGL, Camera, FAT, NTFS, TCP/IP, USB and more in 3MB with 2 second boot!

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6403
Re: Curious (old?) comment about Pascal for systems programming
« Reply #4 on: May 28, 2018, 12:53:08 pm »
Afaik older Pascals were pretty safe, and didn't allow certain casts. Things like @ (& in C) didn't exist etc. TP was already more relaxed, but had 16-bit real mode problems (just like 16-bits C that also had all kinds of limitations).

This is all very old hat, and contrary to what those revisionist posts state, C was not a picknick in the seventies and eighties either. I can remember people in the same room at the uni cursing about old K&R codebases. Only with ansi C the situation improved and the walls hindering porting non trivial code between compilers/unices disappeared somewhat.

if only because everybody started using GCC, and even commercial unices allowed to develop using gcc. (even if they had a proprietary C system compiler) and the older, original Unix derived compilers with their quirks and limitations died out.

dtoffe

  • New member
  • *
  • Posts: 10
Re: Curious (old?) comment about Pascal for systems programming
« Reply #5 on: May 30, 2018, 08:31:27 am »
Thanks you all for your answers, it is good to confirm what I suspected. I feel there is an undeserved bias against Pascal being "old" or something.

As the author of Ultibo I can say with certainty that most (if not all) of those restrictions are long gone.

Your project looks wonderful, hope I can take a deeper look soon.

Thanks,

Daniel

garlar27

  • Hero Member
  • *****
  • Posts: 504
Re: Curious (old?) comment about Pascal for systems programming
« Reply #6 on: May 30, 2018, 05:38:27 pm »
Thanks you all for your answers, it is good to confirm what I suspected. I feel there is an undeserved bias against Pascal being "old" or something.

Maybe you don't know but FPC was built using FPC. I don't know if there are other language's compiler built with it self...

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus