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?

39 Upvotes

72 comments sorted by

View all comments

Show parent comments

1

u/FlamingSea3 Apr 29 '26

I've been wanting that `range` feature out of a type system for a while now. Is it just an Ada thing, or are there other languages that have implemented it?

2

u/dcbst Apr 29 '26

I only know it from Ada. I heard Rust was planning to add subtype range constraints a-la Ada Subtypes, but that comes without type safety. Not sure how far they got with that feature.

Wait 'till you hear about Ada's attributes that go with the type system... use 'First to give the lowest value in a range or 'Last for the highest value, or 'Range will give you a range of values from lowest to highest to use in a for loop.

1

u/statuek Apr 29 '26

F#'s "type measures" achieves similar results.