but then you've just imported all of std into your own namespace. (probably not using the correct terminology here).
At any rate the const indicates you're not changing, and the std is the name given to the root of the hierarchy for importing "std" into.
Sure go lets you do this too, but has shorthand.
import "fmt"
can also be done as
import fmt "fmt"
but why would you do that?
The go equivalent of zig's "use" is
import . "fmt"
"." means "the current working directory" on unix so it's familiar to folks in that sense perhaps. Principle of least surprise is nice when the syntax is terse.
Still, I think I like zig. I feel like I want to try to write something non-trivial with it when I look at the features.
I've already done that a few times with Go, and I enjoy that too.
but then you've just imported all of std into your own namespace. (probably not using the correct terminology here).
At any rate the const indicates you're not changing, and the std is the name given to the root of the hierarchy for importing "std" into.
Sure go lets you do this too, but has shorthand.
can also be done as but why would you do that?The go equivalent of zig's "use" is
"." means "the current working directory" on unix so it's familiar to folks in that sense perhaps. Principle of least surprise is nice when the syntax is terse.Still, I think I like zig. I feel like I want to try to write something non-trivial with it when I look at the features.
I've already done that a few times with Go, and I enjoy that too.