Rendered at 11:47:55 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
brabel 26 minutes ago [-]
I just upgraded some code to Zig 0.16.0 and I am actually really happy with the results. It impacted A LOT of things, but the changes were actually very good and seems to have set the language for a bright future, especially with the new IO mechanism which allows supper efficient code that looks good whether it's implemented single-threaded, multi-threaded or just via an event loop!
If you haven't tried Zig since 0.16.0 was released, I highly recommend having a look. The release notes for this release were huge!!
After having used Zig for a couple of months now I am convinced it is a fantastic tool language. You just pick it up to hack some idea together freely. Every time I hit a wall, I find the creators have thought of it already and offers comfort. But nothing gets in your face how to use the programming language "correctly".
For me it is now the go-to "tinker in my garage" language.
ACCount37 1 hours ago [-]
Is it really that good?
My go-to "tinker in my garage" language is Python - lightweight syntax that stays out of your face, batteries included, packages for everything that's not included. What's Zig's edge?
dmit 39 minutes ago [-]
Have you ever thought "Ugh, this bit of Python code is running much slower than I expected on my computer. Wonder if anyone has written a native library for this"? That's probably the closest use case for someone who matches your description -- a language that is much more ergonomic, much more 'modern' feeling (in all the good ways), while still extremely compatible with C.
As for the language itself, it's going to be more verbose than your Python code. Cons: you'll have to spell out a lot of things that you thought were obvious assumptions. Pros: you will be able to look at a page of code and know with a great degree of certainty that there are no hidden gotchas. No monkey patching, no __init__. Basically, it just does what it says on the tin.
And finally, about the std lib and batteries: there's HTTP(S), compression algorithms, hash algorithms, RNG, I/O, the basic data structures you'd expect, JSON. Third-party libraries, if you choose not to vendor, are handled by including the repository url in a file (also automated by a CLI command), and then adding it to the build script (not automated). The `zig` command handles fetching and ensuring sanity, but otherwise assume a bit of elbow grease will need to be involved.
ACCount37 31 minutes ago [-]
Rarely. Most tinkering tasks just don't have enough heavy duty computation in them to as much as strain a modern CPU. And most of the rest are covered by packages like numpy or pytorch.
For the rare exceptions, I make a C lib and call into it to get my numbers crunched. I get that Zig is a viable replacement for C there. But I don't see it replacing Python.
p-e-w 15 minutes ago [-]
Not to mention that where heavy computation is required, Python often has libraries that are much, much faster than anything you can quickly hack together in C or Zig.
maleldil 2 minutes ago [-]
As long as you can express everything you need on the library's terms. As soon as you write a Python loop, your performance plummets.
norman784 55 minutes ago [-]
Zig is low level, so it will certainly not replace your python usage, it is more like a modern C than anything else. There’s a video of a recent interview with Andrew Kelley, if you want to watch it to understand better what Zig is for, it’s on Jetbrains YouTube channel.
ACCount37 48 minutes ago [-]
No, I get that, but Zig being low level is kind of why I don't get why it would be a good tinkering language?
When I want to tinker, I just want my logic to work, first of all. In 9 cases out of 10 that means going for high level. Even if the resulting code works with low level things like binary structures.
brabel 9 minutes ago [-]
Tinkering means different things to different people! Want to tinker with your hardware, as bare metal as possible? Or extract every inch of performance out of your CPU? Zig is great for that.
mcdonje 17 minutes ago [-]
You have a weirdly restrictive definition of "tinker"
andyferris 24 minutes ago [-]
Low-level programming gets a bad name because C has many footguns and the spec leaves much behavior undefined - a fact that implementers use almost adversarially (which I'd support, if the goal was to refine the spec...).
C++ adds more high-level conveniences without actually removing the footguns and undefined behavior (much C code compiles in a C++ compiler).
Zig tries to keep the low-level C philosophy but have things more well factored and well defined. The result is you _can_ tinker in high-level code, yet "drop down" into low-level code as you desire.
(Compared to rust, you get fewer compiler-enforced guarantees, but unlike C the language isn't trying to make high-level code adversarial).
pjmlp 8 minutes ago [-]
Basically what the world has lost by ignoring Modula-2 and Object Pascal.
38 minutes ago [-]
portly 31 minutes ago [-]
I like that you have more freedom. You can play around with some idea but once you want to do something "serious" you can break into it directly. I start simple but sometimes blip into some performance obsession and I find Zig allows that.
asibahi 47 minutes ago [-]
It’s definitely a great tinkering language but .. eh .. the Zig team and community are extremely opinionated about how to use the language correctly.
0x696C6961 2 minutes ago [-]
This has not been my experience.
mcdonje 16 minutes ago [-]
Not really
epolanski 2 hours ago [-]
This sounds like great news, Zig's compilation times are already terrific and this is going to only make them better.
pjmlp 6 minutes ago [-]
Yes, compilation speeds of the 90's are slowly making a return, thankfully.
dmit 1 hours ago [-]
> Zig's compilation times are already terrific
In my experience, this (for now) is mostly aspirational. It's obviously a major goal, and there are clear milestones outlined on how to achieve it, but in practice the initial compile of an empty project or the excruciating pause when you `direnv allow` and ZLS needs to be (re)built are not what I'd describe as "terrific".
schaefer 1 hours ago [-]
>(re)built are not what I'd describe as "terrific".
It sounds like you are a strong candidate to try out the new improvements mentioned in this devlog and see what benefits you can get for yourself.
epolanski 1 hours ago [-]
Maybe you're right, but how many other system programming languages toolchains give you sub 50ms recompilations across millions of LoC?
dmit 1 hours ago [-]
I foresee a pjmlp comment in your near future. :)
epolanski 51 minutes ago [-]
Yeah, let's add a sprinkle of toxicity to my Saturday morning!
steveharing1 30 minutes ago [-]
So i checked the license of this project, can anyone pls clarify what is (Expat) after MIT License
papercrane 2 minutes ago [-]
There are a number of licenses that are named MIT that are all similar, but not identical.
The "Expat" here is the MIT license variant. It is referring to the Expat XML parsing library that first used this license.
Usually when projects these days use an MIT license this is the version they use.
abhayji 1 hours ago [-]
[flagged]
baskduf 3 hours ago [-]
[flagged]
abhayji 2 hours ago [-]
[flagged]
lerp-io 2 hours ago [-]
[flagged]
KingMob 1 hours ago [-]
[flagged]
alkyon 30 minutes ago [-]
Carpentry would have been ideal career. Building real things, artisanal or not, and nobody insisting yet that the chest of drawers you're building include AI
KingMob 24 minutes ago [-]
Of course, the flip side is, modern construction isn't done with artisanal woodworking techniques.
I'm not even thinking of AI, but Rust. I guess I'm just uninterested in a "modern C".
If you haven't tried Zig since 0.16.0 was released, I highly recommend having a look. The release notes for this release were huge!!
https://ziglang.org/download/0.16.0/release-notes.html
For me it is now the go-to "tinker in my garage" language.
My go-to "tinker in my garage" language is Python - lightweight syntax that stays out of your face, batteries included, packages for everything that's not included. What's Zig's edge?
As for the language itself, it's going to be more verbose than your Python code. Cons: you'll have to spell out a lot of things that you thought were obvious assumptions. Pros: you will be able to look at a page of code and know with a great degree of certainty that there are no hidden gotchas. No monkey patching, no __init__. Basically, it just does what it says on the tin.
And finally, about the std lib and batteries: there's HTTP(S), compression algorithms, hash algorithms, RNG, I/O, the basic data structures you'd expect, JSON. Third-party libraries, if you choose not to vendor, are handled by including the repository url in a file (also automated by a CLI command), and then adding it to the build script (not automated). The `zig` command handles fetching and ensuring sanity, but otherwise assume a bit of elbow grease will need to be involved.
For the rare exceptions, I make a C lib and call into it to get my numbers crunched. I get that Zig is a viable replacement for C there. But I don't see it replacing Python.
When I want to tinker, I just want my logic to work, first of all. In 9 cases out of 10 that means going for high level. Even if the resulting code works with low level things like binary structures.
C++ adds more high-level conveniences without actually removing the footguns and undefined behavior (much C code compiles in a C++ compiler).
Zig tries to keep the low-level C philosophy but have things more well factored and well defined. The result is you _can_ tinker in high-level code, yet "drop down" into low-level code as you desire.
(Compared to rust, you get fewer compiler-enforced guarantees, but unlike C the language isn't trying to make high-level code adversarial).
In my experience, this (for now) is mostly aspirational. It's obviously a major goal, and there are clear milestones outlined on how to achieve it, but in practice the initial compile of an empty project or the excruciating pause when you `direnv allow` and ZLS needs to be (re)built are not what I'd describe as "terrific".
It sounds like you are a strong candidate to try out the new improvements mentioned in this devlog and see what benefits you can get for yourself.
The "Expat" here is the MIT license variant. It is referring to the Expat XML parsing library that first used this license.
Usually when projects these days use an MIT license this is the version they use.
I'm not even thinking of AI, but Rust. I guess I'm just uninterested in a "modern C".