back
user profile
lerno
1,422karma·409submissions·April 1, 2014
recent activity (409 total)
comment
And if the idea is to extend C in some direction, that is what the language I’m working on does: C3 ( http://www.c3-lang.org )
comment
Well, except for Zig has the dubious distinction of actually having more UB than C.
comment
What I mean by saying "it's a binding" is that it is a property of the variable (or return channel of a function) rather than a real sum type. Consequently it does not participate in an…
comment
No I'm quite aware of this. It's a restricted, implicit variant of it. But not also that it's not the type but the binding, which makes it slightly different from using a `Result`.
comment
I'm experimenting with a solution in C3 that has this behaviour. I don't have a sum type as such, but the binding acts as one. I call the binding a "failable". int! a = getMa…
comment
BTW there's a discord for people working on low level programming languages: https://discord.gg/tgmUz9cFyv Maybe you find it interesting?…
comment
Regarding dynamic arrays. Right now it looks like I have a way to do nicely namespaced (macro based!) operator overloading for types (it was unclear whether it would be possible with the feature set o…
comment
To me this says that C got a lot of things right. I've noticed that even things people complain about, like the somewhat arcane promotion rules to "int" makes perfect sense given the co…
comment
A "module system" should be something beyond a name spacing scheme. So that's the difference. Re: strings I had a stronger idea of that initially but I wasn't sure, so I kept postp…
comment
I would say C3 is closer to Odin than Zig. Given that C3 isn't done yet, I'd personally recommend using Odin over Zig. So there is a clear philosophical difference between the two. Aside of …
comment
I deliberately removed the "static" methods, so that above would not be allowed. Why I found that to be a good idea is a longer discussion. The main motivation why it is nice to have it this…
comment
No, that's probably not a good description. I'm not saying you will appreciate the language, but it is basically C. - "Failables" (which is somewhat like Result) offers an alternat…
comment
Some things are hard to get rid of due to LLVM, but I'm doing my best to reduce them.
comment
- Format strings, are you thinking about string interpolation or? - A module isn't a file in C3 but that's a deep subject to get into. - Automatic C header file import is something Zig is al…
comment
`ptr = array` vs `ptr = &array` (no [0] needed) is also part of being able to capture array sizes during compile time for macros, and also being able to copy arrays by value in an easy way. I don&…
comment
For the docs, have a look here: http://www.c3-lang.org
With a primer for C programmers: http://www.c3-lang.org/primer/ It should compile fine on MacOS and Linux. Ther…
comment
Agreed, haven’t heard of that until I read about it (I’m 48, living and working in Sweden)
comment
Could another approach be taken, where local variables are considered implicitly “register”? In that case this simple example has no problem whatsoever. It does arise unnecessarily if the address of a…
comment
There are many ways to approach macros. Zig’s approach with compile time evaluation handles many of them. Esp since types can be created on the fly.
Another approach, which is strongly inspired by the…
comment
It should be noted that Zig’s int promotion rules are currently broken though.
comment
On the other hand, leave out “pub” and Zig won’t compile it…
comment
So, consider passing a struct A stored in the global variable “foo” to the function “bar” in the parameter “baz”. This function makes a modification to the global “foo”. The compiler cannot know this …
comment
UML died because while people were buying UML to live the dream that programming could now be reduced to charting classes, real programming doesn’t work like that. All it added was some meaningless do…
comment
Would have liked comparisons with Nim, Crystal, Odin, D.
comment
No, I'm aware of it. GCC also has a similar feature as a C extension. I picked those languages because they very clearly use the same keyword.
comment
If I may venture a guess, it is because this way there is no limit in regard to jumps within or out of a function. Since Go retains `goto`, function based is easier to implement. In addition, non-loca…