Hacker News new | ask | show | jobs
by pjmlp 1703 days ago
Ada, Modula-2 and Object Pascal, minus compile time execution that they lack, and you have Zig almost 40 years ago.

Sad that we have to go in circles to keep programming fashion going, instead of adopting best practices from the get go.

2 comments

A language isn't just a compiler and a spec. I don't know the full history of all these projects, but IIRC Ada's compiler wasn't free for a long time.

How you structure the financials and the community around the language has also a gigantic impact on the final result, and this is an area where Zig bringing to the table something completely new.

https://ziglang.org/zsf/

Although most people associate Object Pascal to Borland due to the Turbo Pascal branding done by them, the language was originally created to write Lisa OS (Clascal), and then when the project got replaced by Mac OS, with the help of Niklaus Wirth input, Clascal became Object Pascal and was the main language until the C++ rewrite that took place in the early 90's.

Outside Apple computers, the dialects created by Borland gained such following, specially in Europe, that Turbo Pascal became the official Pascal dialect, even though Extended Pascal fixed most of the original design flaws.

Naturally they going enterpreisy lost the crowd to VB and VC++ folks (later .NET).

Modula-2 did have some nice offerings, specially on Amiga, but on the PC and Mac, Turbo/Object Pascal made it irrelevant as it offered all the improvements Modula-2 brought to the table (no one cared about co-routines on home computers back then).

Ada was the only one from those that yeah, actually quite expensive, and I think only SGI and SUN had UNIX compilers for them, with HP having BASIC and Pascal compilers for their OSes.

Then there was the Amsterdam Compiler Kit, the "LLVM" for the 1980's, which had support for C, Pascal, Modula-2, Occam, and BASIC.

Looking forward to see how Zig evolves, specially regarding issues like #2301.

You say "minus compile time execution"... but when you take comptime away from Zig, you lose both generics and compile-time reflection. The remaining language is C without a preprocessor. So, yeah. Strip out the most useful and innovative feature from the language, and it looks primitive.
The languages I mentioned all got generics during their lifetime, so yeah they were all more powerful than C.

C won due to UNIX, had UNIX not been a kind of free beer that companies could build their workstations with and universities avoid paying for commercial OSes like VMS, history would have taken a different path.

What about compile-time type reflection?

Also, lisp has pretty much always been more powerful than C. But what zig brings to the table is an extremely simple language which is also very powerful. Much of the power results from the entire language being available at compile time. You seem so ready to throw that away in favor of could-have-been nostalgia, I wonder if you've taken the time to understand what you're criticizing.

I was quite clear that compile-time type reflection was the only thing missing.

Zig isn't the only AOT compiled language with compile-time type reflection in 2021, and exactly because of could-have-been nostalgia, we don't need newer systems programming languages that don't have an answer for use-after-free in safe code.

https://github.com/ziglang/zig/issues/2301

https://github.com/ziglang/zig/issues/1966

Naturally I have taken the time, and did not come out impressed, given my background and programming language beliefs.

However as I say in another thread, other people seem to be happy with such shortcomings.