back
user profile

lerno

1,422karma·409submissions·April 1, 2014
recent activity (409 total)
comment
C++ is just slow to compile. With the standard library it is much worse. The problem is that with C++ you're not getting as much encapsulation as you would in C unless you do extra work that also…
1y ago·view thread
comment
Jai has operator overloading yes.
1y ago·view thread
comment
Hasn't this been done already? C with classes I mean. eC and others.
1y ago·view thread
comment
It's very simple, the latter describes an `if-else` chain. No more complicated than that. Can you explain what your concern is?
1y ago·view thread
comment
C3 has case ranges, like case 'a'..'z': It's from the GCC C extension (except GCC uses ...)
1y ago·view thread
comment
It was the minimal change from C. It's fairly easy regex out the types, so while not as nice as Odin, it should be straightforward. Named parameters are already in the language. Regarding concurr…
1y ago·view thread
comment
No, it's not a problem. If you think it's a problem, write a C compiler in C and come back to me and show me your code that doesn't have that. :)
1y ago·view thread
comment
This could make sense for a from-scratch language, but C3 is trying to be an evolution of C, and such constraints would make it so much of a different language that it would be way out of scope. I thi…
1y ago·view thread
comment
I was talking about function overloading. Sorry for being unclear.
1y ago·view thread
comment
I based the LLVM-IR output on what Clang outputs for C. And so they should be identical. C3 has a single module option for maximum interfunctional optimizations, but Clang can give you LTO for the sam…
1y ago·view thread
comment
Yes, just a sponsorship. No other relationship with the project.
1y ago·view thread
comment
You have both in C3: switch (x) { case 0: ... case 1 + 1: ... } This will behave in the normal way. But you can also have: switch { case foo(…
1y ago·view thread
comment
"case X, Y" works for 3-4 values, but for something longer problems accumulate: case SOME_BAD_THING, SOME_OTHER_CONDITION, HERE_IS_NUMBER_THREE: foo(); int y = baz(); …
1y ago·view thread
comment
I can only speak for myself: 1. It is so big. 2. It still largely depends on GC (less important actually) It keeps adding features, but adding features isn't what makes a language worth using. In…
1y ago·view thread
comment
C3 error handling is fairly novel though. It tries to find a sweet spot between composability, explicitness and C compatibility. The try-catch has nice composability: try { int x = foo_m…
1y ago·view thread
comment
It might be interesting to note that none of the C alternatives: C3, Zig, Odin, Hare, Jai use ownership nor RAII. Overloading is also generally missing from today's breed of C alternatives. There…
1y ago·view thread
comment
Yeah, you will need to pry `for` from my dead cold hands.
1y ago·view thread
comment
All macros are hygienic. However, you can pass in a lazy expression which then is evaluated in its original context. The macro cannot insert variables into the caller scope, nor cause the function to …
1y ago·view thread
comment
Rust is a C++ competitor with all the semantic complexity that comes with it. And similar compile times. C3 is more complex than C (because of a net increase of features), but it's miles from C++…
1y ago·view thread
comment
The downside of QBE is that it then requires an assembler and a linker. And QBE's only input and output is still text. Plus the "frontend -> QBE -> assembler -> binary" process…
1y ago·view thread
comment
Every time
1y ago·view thread
comment
Yes, C3 started as a variant of C2.
1y ago·view thread
comment
Yes, and I was too slow to getting back and trying to edit it. Sorry about that.
1y ago·view thread
comment
I don't quite see what you mean. As an example, let's say you use ZII and allocate 100 objects in a single allocation. These are now zero initialized and so either invalid (which should not …
1y ago·view thread
comment
I'm unable to edit this now... that should teach me not to comment and then go to kendo practice... It should say '*' and '&' and 'int&' and 'int*'
1y ago·view thread
comment
It isn't possible. Use `for` instead. `foreach` isn't trying to be a one-stop-shop, but rather help the common case of looping over an array or list. Because it handles caching the length an…
1y ago·view thread
comment
Some other links links on C3 that might be interesting: Interviews: - https://www.youtube.com/watch?v=UC8VDRJqXfc - https://www.youtube.com/watch?v=9rS8MVZH-vA Here i…
1y ago·view thread
comment
It uses operator overloading of [] &[] and "len" to create a straight for loop. Normal C for loops are there of course.
1y ago·view thread
comment
It's an interesting problem. Originally I experimented with both having ` ` and `&` syntax, so `int&` being a ref (non null) and `int ` being a pointer. The thing you notice then are two …
1y ago·view thread