Live data from Hacker News

Zig 0.4.0 Released

ziglang.org

81–90 of 141 posts

Re: Zig 0.4.0 Released

#81
post #70

Earlier quoted context omitted.

All of those are very subjective. - RAII: Only useful with 'smart' data which must run code for initialization, destruction or copying. It's entirely valid to work with 'dumb' data only which is zero-initialized, and can be copied and deleted without any additional custom actions. - Exceptions: too brittle and complex, modern languages have switched mostly to option-return values, which contain both an error code and…

Well you learn to appreciate the value of RAII and exception working on high-availability software. It's almost impossible to have correct error paths and deinitialization without. I'm very doubtful the new crop of languages without exceptions and RAII actually care about correctness in the wild. Better than template without uniform representation? template is just copy-paste you don't _have_ to use it. Same remark f…

> Well you learn to appreciate the value of RAII and exception working on high-availability software.

Alternatively, you'll learn to not appreciate the value of exceptions working on high-availability software. Not personal experience, but AFAIK Google (definitely lots of highly-available software) disallows using exceptions in C++.

Re: Zig 0.4.0 Released

#82
post #64

Earlier quoted context omitted.

Have you got an example of a C replacement that was actually better than C, got as far as Zig and is now abandoned? I can't think of one. I've been look for a better C for 15 years and Zig is the best candidate I've found. I don't think DasbetterC counts, since it is a side effort to the greater goals of D.

Turbo Pascal, Object Pascal and Modula-2 would be such examples. Their sin was not being bundled with an OS, originally distributed with source code by a symbolic price.

Wirth didn't produce anything usable before Oberon (which is garbage collected, so outside of the C niche.)

Re: Zig 0.4.0 Released

#83
post #64

Earlier quoted context omitted.

Have you got an example of a C replacement that was actually better than C, got as far as Zig and is now abandoned? I can't think of one. I've been look for a better C for 15 years and Zig is the best candidate I've found. I don't think DasbetterC counts, since it is a side effort to the greater goals of D.

Turbo Pascal, Object Pascal and Modula-2 would be such examples. Their sin was not being bundled with an OS, originally distributed with source code by a symbolic price.

Interesting choices. They're all very old. I feel we must have learned something since the 1970s that could be used to improve a systems programming language.

I don't really want to restart a flame war that was extinguished decades ago but Kernighan's critique of Pascal (http://www.lysator.liu.se/c/bwk-on-pascal.html) is an interesting read today - if only because it reminds me how much simpler things were back then - no mention of memory safety or multi-threading.

I have no knowledge of Object Pascal and Modula-2, so won't comment.

Re: Zig 0.4.0 Released

#84
post #71

Earlier quoted context omitted.

I feel much of the negativity that you like to express towards C is unwarranted. Fact is, it's both very easy and efficient to interface with "C" or more specifically, platforms' standard ABIs.

On platforms written in C. As for the negativity, Morris worm is now 30 years old and the CVE database gets C derived exploits every month.

You can interface with Object Pascal (which you frequently advertise) just fine.

(That doesn't make Object Pascal a practical language, though).

https://www.quora.com/Why-is-the-JVM-so-riddled-with-securit...

Another fact is, startup times alone make JVM impractical for many endeavours. For each task an appropriate tool I'll say.

Re: Zig 0.4.0 Released

#85
Hm, a one-liner turnoff:

    const std = @import("std");
* pointless semicolon

* pointless "@"

* seemingly pointless "const" (can you define a mutable import?)

* unnecessary verbosity defining an identifier for the import when there's almost never a need for naming it differently (i.e. it should default to "const std" if you just type "import 'std'"...

I like Go because it avoids pointless verbosity most of the time.

Re: Zig 0.4.0 Released

#86

Hm, a one-liner turnoff: const std = @import("std"); * pointless semicolon * pointless "@" * seemingly pointless "const" (can you define a mutable import?) * unnecessary verbosity defining an identifier for the import when there's almost never a need for naming it differently (i.e. it should default to "const std" if you just type "import 'std'"... I like Go because it avoids pointless verbosity most of the time.

I'd avoid picking on a language just by one line – it's not a language for writing one-liners, in which case the critic would be valid.

There might be very good reasons for each of those things, but it's hard to say without delving into it some more.

Re: Zig 0.4.0 Released

#87
I'm surprised nobody is pointing out the similarities with Nim in terms of features: multiple targets (binary, js...), C interoperability, easy cross-compilation, metaprogramming, targeting many architectures, artifact caching.

Re: Zig 0.4.0 Released

#88
post #64

Earlier quoted context omitted.

Turbo Pascal, Object Pascal and Modula-2 would be such examples. Their sin was not being bundled with an OS, originally distributed with source code by a symbolic price.

Wirth didn't produce anything usable before Oberon (which is garbage collected, so outside of the C niche.)

Modula-2 was quite usable and Mac OS/Lisa Object Pascal was designed with collaboration from Wirth.

As for Oberon, Astrobe is still in business.

Re: Zig 0.4.0 Released

#89
post #71

Earlier quoted context omitted.

On platforms written in C. As for the negativity, Morris worm is now 30 years old and the CVE database gets C derived exploits every month.

You can interface with Object Pascal (which you frequently advertise) just fine. (That doesn't make Object Pascal a practical language, though). https://www.quora.com/Why-is-the-JVM-so-riddled-with-securit... Another fact is, startup times alone make JVM impractical for many endeavours. For each task an appropriate tool I'll say.

JVM startup times are only an issue for those that don't want to buy a commercial JDK with AOT compiler support.

Good news, now OpenJDK and GraalVM offer it for free, gratis.

Object Pascal/Delphi is quite pratical on Windows.

Re: Zig 0.4.0 Released

#90
post #64

Earlier quoted context omitted.

Turbo Pascal, Object Pascal and Modula-2 would be such examples. Their sin was not being bundled with an OS, originally distributed with source code by a symbolic price.

Interesting choices. They're all very old. I feel we must have learned something since the 1970s that could be used to improve a systems programming language. I don't really want to restart a flame war that was extinguished decades ago but Kernighan's critique of Pascal ( http://www.lysator.liu.se/c/bwk-on-pascal.html ) is an interesting read today - if only because it reminds me how much simpler things were back the…

Kernighan's critique was very biased and he focused on plain ISO Pascal on purpose to get his point across.

Cleverly not mentioning that many issues were fixed on ISO Extended Pascal and other dialects.

Also that back then outside Bell Labs, most C compilers were actually dialects of the real thing, like Small C and RatC. So it was not like C wasn't without its portability issues outside UNIX.

As for memory safety and multi-threading, check Concurrent Pascal and Solo OS from Per Brinch Hansen.

Post reply on HN