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…
1y ago·view thread
comment
I saw what you wrote about the enums, anything else? And feel free to add issues for things that feel off.
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
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”?
1y ago·view thread
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.…
1y ago·view thread
comment
Yes, I am quite aware. But it doesn’t make D any less a C++ alternative.
1y ago·view thread
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, …
1y ago·view thread
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…
1y ago·view thread
comment
What does the AI detection sites say?
1y ago·view thread
comment
Isn't all sorts of stuff metaprogramming in Zig? Generic types, vtable interfaces, printf. All use comptime to generate code.
1y ago·view thread
comment
D was never a C alternative, it was a C++ alternative.
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
comment
BTW decimal fixed point or binary fixed point?
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
comment
Not a C fan then ;)
1y ago·view thread
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…
1y ago·view thread
comment
Yes both are implemented as attributes `@weak` and `@init` respectively.
1y ago·view thread
comment
Well, you're free to revive this issue: https://github.com/c3lang/c3c/issues/1451 . I'd need a more solid proposal.…
1y ago·view thread
comment
That one was missing a comma: "I know, it's hard". I'll do my best.
1y ago·view thread
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…
1y ago·view thread
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…
1y ago·view thread
comment
You could still do it as a userland feature and implement add/sub/mult/div as methods on the type.
1y ago·view thread
comment
I tried to answer that here: https://c3.handmade.network/blog/p/8886-why_does_c3_use_%252... …
1y ago·view thread