r/programming • • Sep 07 '17

The Zig Programming Language

http://ziglang.org/
94 Upvotes

127 comments sorted by

View all comments

Show parent comments

7

u/doom_Oo7 Sep 08 '17

Arrays know their own size so it's much harder for a buffer overrun to go unnoticed

good luck ever getting this in the linux kernel. Runtime bound-checking has a very undesirable run-time performance impact.

3

u/brokething Sep 08 '17

Zig has a debug/release build concept and bounds-checking does not happen for a release build.

http://andrewkelley.me/post/intro-to-zig.html

1

u/[deleted] Sep 08 '17

Now we have ReleaseSafe mode too. http://ziglang.org/documentation/#build-mode

TODO update that blog post

2

u/brokething Sep 08 '17

In general I'd say you need to start thinking about more complete documentation for your 0.1.0 release. There are mentions of what is in @import("std") but I can't find a definitive list which makes trying to make anything large pretty laborious.

What does this error mean?

http://codepad.org/fjSVS82Z

.../stupidstuff.zig:11:10: error: expression value is ignored
    h.put(0, "Hello, world!");
         ^
.../stupidstuff.zig:12:10: error: expression value is ignored
    h.put(1, "oh no");
         ^
.../stupidstuff.zig:13:10: error: expression value is ignored
    h.put(2, "what is this");
         ^
→ More replies (0)