back
user profile
lerno
1,422karma·409submissions·April 1, 2014
recent activity (409 total)
comment
Amusingly enough, I found that the compiler also accepted MyEnum.len (completely undocumented!). That was an easter egg! But I'm trying to update the docs for types now. It's reasonable to j…
comment
I saw what you wrote about the enums, anything else? And feel free to add issues for things that feel off.
comment
Oh `.elements` would you believe that this is a remnant of C2's builtin function `elemsof`? Its used so rarely (I think two uses in the entire stdlib), so it hasn't come up. I opened an issu…
comment
I always find this opinion intriguing, where it's apparently fine that globals are initialized to zero, but you are INSANE to suggest it's the default for locals. What kind of programs are y…
comment
Out of C3, Odin and Zig, Zig is actually the language with the worst SIMD support. Odin has SIMD vectors, array programming and built in matrix types while C3 has built in SIMD vector types and operat…
comment
C gives either, I think that is the true with Odin as well, it certainly is for C3. I was assuming Zig allowed both. Is this another one of Zig being strict with ”only one way”?
comment
The ease of using Odin over Zig for Raylib was an interesting contrast that I hadn’t reflected on myself. I tried to do things well with C3, but it might be hard to beat Odin on that particular point.…
comment
Yes, I am quite aware. But it doesn’t make D any less a C++ alternative.
comment
It was introduced in 2017, and not part of the original direction of D (it’s neither in 1.0 nor the 2.0 revision of the language) That D exposes a curated subset of D doesn’t make it a C alternative, …
comment
In any case this seems to be part of some series on Zig, so the title is misleading: it sounds like it’s a blog post talking about memory safety in zig, but it’s just about features in Zig that can ma…
comment
What does the AI detection sites say?
comment
Isn't all sorts of stuff metaprogramming in Zig? Generic types, vtable interfaces, printf. All use comptime to generate code.
comment
D was never a C alternative, it was a C++ alternative.
comment
I think the Zig community should worry more about when Jai is released. Esp given that Zig isn’t anywhere near 1.0 yet, and feature wise it’s a rather sparse language that has first mover advantage ov…
comment
A stack allocator is an allocator that aside from allocate, has a push and a pop function. Image an arena allocator (aka bump allocator), where ”push” stores the current start of free memory, and ”pop…
comment
No, not alloca , I mean a stack allocator as you push / pop memory scopes. The trailing body macro is something I think you should try out before dismissing it. It's similar to how Ruby can…
comment
BTW decimal fixed point or binary fixed point?
comment
In C casting a pointer to an int and back again used to be fine. Except later people want to track the pointer to do optimizations and things went... poorly. I feel that this is a mess better addresse…
comment
I haven't used Nim enough to write a good comparison. I am not mentioning Crystal either. If someone wants to contribute a comparison I'd be happy to feature it. It is supposed to be fair an…
comment
I think that one is a bit wrong, I must have written it many years ago. There are machines where pointers do have different address spaces, like the Arduino obviously, but that support isn't in t…
comment
Well, it's not that difficult to get into the Jai beta if you are building something with Jai I think? I seem to recall that Jon just asked beta testers that they actually have a project that the…
comment
Not a C fan then ;)
comment
The temp allocator is a stack allocator, so it's a bit more flexible than that and can be used for return values or even more long lived allocations. It doesn't use the standard heap allocat…
comment
Yes both are implemented as attributes `@weak` and `@init` respectively.
comment
Well, you're free to revive this issue: https://github.com/c3lang/c3c/issues/1451 . I'd need a more solid proposal.…
comment
That one was missing a comma: "I know, it's hard". I'll do my best.
comment
I don't have any particularly strong stance on provenance. But I've yet to see a strong argument for it in C. There is not much of a guide I'm afraid. I translated some of the raylib ex…
comment
Personally I think it is reasonable that a C alternative is an alternative to C, and not a C++ alternative. C3 uses a temp allocator that removes a large number of cases where C++ would need RAII to m…
comment
You could still do it as a userland feature and implement add/sub/mult/div as methods on the type.
comment
I tried to answer that here: https://c3.handmade.network/blog/p/8886-why_does_c3_use_%252... …