Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One wonders where we would be if Pascal or one of it's offspring like Oberon had actually caught on and challenged C. It would be nice to have a alternative system programming language. C sometimes feels like a local maximum instead of a global one.

From the PDF:

"The clean solution given in Oberon [6] is the concept of type extension, in object-oriented languages called inheritance. Now it became possible to declare a pointer as referencing a given type, and it would be able to point to any type which was an extension of the given type. This made it possible to construct inhomogeneous data structures, and to use them with the security of a reliable type checking system. An implementation must check at run-time, if and only if it is not possible to check at compile-time,.

Programs expressed in languages of the 1960s were full of loopholes. They made these programs utterly error-prone. But there was no alternative. The fact that a language like Oberon lets you program entire systems from scratch without use of loopholes (except in the storage manager and device drivers) marks the most significant progress in language design over 40 years."



Pascal was the primary high-level language used for development in the Apple Lisa, and in the early years of the Mac. Microsoft assumed Pascal would become the dominant application programming language, so the early Windows ABI used the Pascal calling conventions. That's why we're stuck with Windows' PASCAL/WINAPI/stdcall and cdecl ABI mess today.


IIRC the first (unusable) Windows version was written in Pascal.

I remember reading somewhere that Pascal calling convention was more efficient. Return from a function and cleaning the parameters from the stack could be done with a single RET N instruction, while C calls needed both a RET and a separate stack realignment, because C allows variable number of params.

I don't know if it's still the case with recent processors.


C requires that variable-argument-list fuctions be called with a correct prototype in scope, so it is perfectly feasible to use a "callee-cleans-up" ("Pascal") calling convention for regular C functions and a "caller cleans up" ("cdecl") convention for varargs functions.

The point is moot though, because just because an operation can be represented using a single assembler mnemonic doesn't mean that it's any faster than an alternative that uses several. A case in point is the "REP MOVS" style string functions, that until very recently were actually slower than opencoding the equivalents, since they trapped to microcode.


<quote> One wonders where we would be if Pascal or one of it's offspring like Oberon had actually caught on and challenged C. It would be nice to have a alternative system programming language. C sometimes feels like a local maximum instead of a global one. </quote>

I think we would be using safer systems where buffer overruns and pointer exploits would be almost non existent.

The hegemony of C has cost the industry millions of euros/dollars in software correctness.


Much of it is due to C's Biggest Mistake:

http://drdobbs.com/blogs/architecture-and-design/228701625


I believe that the single most damaging thing was strings:

http://www.joelonsoftware.com/articles/fog0000000319.html


what surprises me is that none of the c-plus-safety languages like cyclone and single assignment c have gained much traction




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: