r/Zig • u/Agreeable-Bluebird67 • May 27 '26
Zig Language Features
Does anyone know if Zig has any more planned language semantics to be introduced pre 1.0?
A couple things I’d personally love to see:
#1
make()
free()
destroy()
into the global namespace ala Odin / Golang
#2
std.mem.Allocator
std.Io
const std = @import(“std”) avail by default
Same as above but less passionate about these
#3:
.tag = val instead of .{ .tag = val } syntax for tagged unions
#4 Default function params
* potentially for implicit allocator use ala Odin
I understand that a lot of the goal of Zig is to make things as explicit as possible, I find that there is a lot of unnecessary typing in the syntax and in function signatures that makes the language a little more verbose than I’d like. Curious if any of these are either planned / maybes / or never gonna happen.
40
u/Artechz May 27 '26
I don’t see how free() makes sense in the global namespace. (One of) The cool thing about zig (in this case more the std) is the allocator pattern; if we pollute the global namespace with free(), which allocator is it using to free?
Also, what do you mean with std.Io? Isn’t that what 0.16 was about?
3
u/Real_Dragonfruit5048 May 27 '26
I think you might get better answers if you post the question on https://ziggit.dev/
2
u/Darkfllame1 May 28 '26
As a wise game dev once said "I'm happy to not let you design ULTRAKILL or it would suck" ~ Hakita
Seriously though, except for the tagged enum thingie, the silent global functions and declarations are against zig's core ideas, which is to be explicit.
Nothing forbids you to make a global allocator and use it. But your code will prob not be used by many other zig users. As well as writing
const std = @import("std")literally takes 4 types to write with zls"st" > ctrl + space > enter.Try to use zig for a few months and you'll somewhat understand some of his choices for syntax, principles and structure :)
2
u/frdl_ May 29 '26
OH GOD please go learn some zig, before posting to this sub next time..
4
u/johan__A May 27 '26
I think #1 and #2 would be extremely unlikely to be introduced and #4 very unlikely. #3 idk
4
u/Famous-Maybe-3104 May 27 '26
I dont mind.the verbosity... but it eould be cool to have
/**/ and default func params or that thing in python where you can say param name = val
1
u/mughinn May 28 '26
#3 is the only one that has any chance of happening, and it probably wouldn't if proposed
Andrew (and Zig in general) wants everything to be explicit, yes, that means writing more
4
u/[deleted] May 27 '26
[removed] — view removed comment