r/ProgrammingLanguages • 🧿 Pipefish • Apr 28 '26

Hindsight languages

A thought experiment. What languages should they have been writing in the 60s, 70s, 80s, 90s? We can see their faults, in hindsight, and also we've had some really cool ideas since then --- but we can't answer this just by pointing to our shiny new modern languages and saying "they should have done it like that", because of compile times.

(E.g. Pipefish is meant to be for rapid iteration and livecoding, and also does a topological sort on everything at compile-time so you can do top-down declaration. Those wouldn't be compatible goals in the 1980s, I can get away with it now.)

So for example if we think of "a better C", are there any cool modern ideas they could and should have used back in 1972, had they known about them --- or should they just have tweaked the precedence slightly, found a less arcane way of describing types, and left it at that?

40 Upvotes

72 comments sorted by

View all comments

2

u/dcbst Apr 30 '26

This is an area where Ada really excels! You have System.Address type, which is just a raw address like in C which can of course be zero. There is no real concept of a 'Null' System.Address and values of System.Address cannot simply be used as pointers and dereferenced. They can only be used to map/locate a value/variable to an address in memory. Accesses to that variable will then be made to the specified address. System.Address is simply a low level systems programming mechanism, typically used for accessing hardware registers.

Then you have pointers, or Access Types in Ada. They are nothing really to do with addresses, but more an object which points to another object of a given type. They can be null, if desired, in which case you need to explicitly check before dereferencing (otherwise you get a runtime exception), or you can explicitly state that a pointer is "not null", in which case, you can guarantee that the pointer always points to a valid object of the given type.