Live data from Hacker News

Zig 0.4.0 Released

ziglang.org

71–80 of 141 posts

Re: Zig 0.4.0 Released

#71
post #62

Earlier quoted context omitted.

C also has a runtime, that is what takes care of calling main() , handling VLAs, floating point emulation, constructor/destructors (GCC C extensions), ... Besides there are plenty of OSes written in type safe system languages to learn from, including surviving mainframe OSes.

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.

Re: Zig 0.4.0 Released

#72
post #68
post #61

Earlier quoted context omitted.

On Windows we just use COM/UWP or .NET libraries most of the time, no need to be stuck with C ABI. Same applies on Android, where using a Java based library, even if stuck on their Java 6 - 8 world is much more desireable than having to deal with NDK and JNI boilerplate. Likewise IBM and Unisys mainframes make use of their language environments instead of C based ABIs.

> COM/UWP Assuming with COM/UWP you mean "UWP's flavor of COM" instead of "COM and/or UWP", is anyone actually using that outside of mobile trash and game engine backends for XB1? All the Windows software i use and see people make are either Win32 or (much more often) built on top of Win32 (well, UWP is technically also built on top of Win32, but you are supposed to ignore that and act as if it isn't the case).

Yes they are, UWP is the future of Windows APIs since Windows 8, like it or not.

Win32 is slowly being migrated into sandbox model with each Windows 10 release and hasn't seen any big update since Vista. All major APIs introduced since then are based on COM.

Re: Zig 0.4.0 Released

#74
post #72
post #68

Earlier quoted context omitted.

> COM/UWP Assuming with COM/UWP you mean "UWP's flavor of COM" instead of "COM and/or UWP", is anyone actually using that outside of mobile trash and game engine backends for XB1? All the Windows software i use and see people make are either Win32 or (much more often) built on top of Win32 (well, UWP is technically also built on top of Win32, but you are supposed to ignore that and act as if it isn't the case).

Yes they are, UWP is the future of Windows APIs since Windows 8, like it or not. Win32 is slowly being migrated into sandbox model with each Windows 10 release and hasn't seen any big update since Vista. All major APIs introduced since then are based on COM.

I believe Windows will sooner become completely irrelevant than UWP becoming the dominant API to write Windows applications. Also seeing how MS is switching the system browser to Chromium, and kills the UWP version of MS Office, it looks like most people in Microsoft have lost faith in UWP too.

Re: Zig 0.4.0 Released

#75
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…

I've been writing C++ code since around '98, and have only recently moved back to mostly C. To be honest, features in C++ that I thought are a "must have" are actually a variant of Stockholm Syndrome, after a little while (a few weeks to months) one realizes that the world would keep turning without C++ ;)

Re: Zig 0.4.0 Released

#76
post #72

Earlier quoted context omitted.

Yes they are, UWP is the future of Windows APIs since Windows 8, like it or not. Win32 is slowly being migrated into sandbox model with each Windows 10 release and hasn't seen any big update since Vista. All major APIs introduced since then are based on COM.

I believe Windows will sooner become completely irrelevant than UWP becoming the dominant API to write Windows applications. Also seeing how MS is switching the system browser to Chromium, and kills the UWP version of MS Office, it looks like most people in Microsoft have lost faith in UWP too.

What?!? Office was the team driving the new UWP Fluent components and happy early adopters of the new C++/WinRT framework and XAML Islands on Win32.

The year of desktop Linux is just around the corner. /s

Re: Zig 0.4.0 Released

#77
Beyond zig as a language, these release notes are a treat for anyone interested in toolchains and environments for system languages.

- "zig is also a C compiler" . Flag-compatible with clang, and with integration with zig's buildsystem you get cached build artifacts.

- Cross compile for a boatload of architectures + musl or glibc - in a ~30Mb compressed package

Re: Zig 0.4.0 Released

#78
Andy, if you have the time I think it would be interesting to read a retrospective from time to time. If you were to start over with the knowledge you have gained, what would you do differently? What would you rather have postponed? What would you have started earlier?

Re: Zig 0.4.0 Released

#79
post #63

Earlier quoted context omitted.

Here are some things that make C++ better than C - RAII - exceptions - classes and objects - inheritance - templates - the STL C++ is strictly better than C when wielded correctly.

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…

> All of those are very subjective.

They're not. People vastly more experienced and more intelligent than you came up with them. Learn why they exist before dismissing them.

You won't get anywhere trying to replace C with a "let's go shopping instead" mentality.

Re: Zig 0.4.0 Released

#80
post #55

Earlier quoted context omitted.

> All these languages are potentially-better systems languages than C/C++ No they are not. C++ has spent decades building "a better C/C++". Any language that ignores those lessons and takes the stance of "learning C++ is too hard, let's go shopping" is doomed to fail.

Which of these languages do you think hasn’t learned the lessons of C++? Rust, for instance, has liberally encoded “modern C++” whilst plan not providing a lot of the features that make C++ problematic.

Rust is the better choice, but they're still learning about the real world of error handling, generic library code and performance optimization.
Post reply on HN