Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rvrb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
rvrb
1y ago
I haven't worked with GTK, but what you are describing here sounds reminiscent of what we have been dealing with trying to build Godot bindings in Zig with a nice API. the project is in mid-flight, but Godot: - has tons of OOP conc
32.
▲
by
rvrb
1y ago
here, I'll copy the first paragraph of TFA for you: > Many software projects take a long time to compile. Sometimes that’s just due to the sheer amount of code, like in the LLVM project. But often a build is slower than it should be
33.
▲
by
rvrb
1y ago
it can narrow the payload: https://zigbin.io/7cb79d I think the post would be more helpful if it had a concrete use case. let's say a contrived bytecode VM: dispatch: switch (instruction) { inline .load, .loa
34.
▲
by
rvrb
1y ago
I did not realize you could inline anything other than an `else` branch! This is a very cool use for that.
35.
▲
Depth=2
(tristanpemble.com)
3 points
by
rvrb
1y ago
|
0 comments
36.
▲
My First Zig Day
(tristanpemble.com)
2 points
by
rvrb
1y ago
|
0 comments
37.
▲
by
rvrb
1y ago
> I think you're misinterpreting OP's excitement here. The technique isn't novel but the ergonomics are. This, of course, but I also consciously made the decision to write for an audience less familiar with the language an
38.
▲
by
rvrb
1y ago
I assure you, I am not the one who appears to be reacting in a hair trigger hypersensitive manner in this thread :)
39.
▲
by
rvrb
1y ago
You have raised a good discussion point or two, but I am not inclined to engage with them due to the tone you've created with the rest of your comment. Would it be productive to jump into a thread on a Ruby article and puff your feathe
40.
▲
by
rvrb
1y ago
oh, man! you made my day with this comment. those days are long behind me. we were young, dumb, and inebriated. if you're looking for the bands we were trying to sound like, there was a resurgence of this surf/girl group sound in
41.
▲
by
rvrb
1y ago
I've entertained further expanding this API to expose a comptime generated struct of pointers. From the Connection use-case detailed in the article, it would look something like this: pub fn getPtrs(self: Self) struct { clien
42.
▲
by
rvrb
1y ago
I think there may be room to expand this implementation to support such a use case. Right now it enforces an `.auto` layout of the struct provided in order to ensure alignment, but its easy to imagine supporting an `extern struct` with a de
43.
▲
by
rvrb
1y ago
I would describe this approach as 'intrusive' - you're storing the lengths of the arrays behind the pointer, enforcing a certain layout of the memory being allocated. Because the solution outlined in the article stores the le
44.
▲
by
rvrb
1y ago
I am the author of this post, let me know if you have any questions or feedback :)
45.
▲
Resizable structs in Zig
(tristanpemble.com)
152 points
by
rvrb
1y ago
|
74 comments
46.
▲
by
rvrb
1y ago
I wrote this in response to other discussions around Hacker News: https://news.ycombinator.com/item?id=44545949 https://news.ycombinator.com/item?id=44551318
47.
▲
The Color Doesn't Matter
(tristanpemble.com)
3 points
by
rvrb
1y ago
|
1 comments