Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lerno
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
181.
▲
by
lerno
2y ago
You could do faultdef FOO, // comment BAR, // comment QUX; // comment There are third party tools to generate docs. You can also get some json output from the c3 compiler itself
182.
▲
by
lerno
2y ago
Odin isn’t as well known as Zig, true. But what you seemed to argue was that this was a deliberate choice by the Odin community: to look for hype on Hacker News rather than doing the leg work of getting a Wikipedia article about the languag
183.
▲
by
lerno
2y ago
What works for Rust works for Rust. My intent is to make code feel similar to C namespacing. What works and what doesn’t is fairly contextual, depending other language semantics as well.
184.
▲
by
lerno
2y ago
Destructors and Ownership implies RAII and all the design and architecture that are assumed with such things. This is far from C semantics, and so out of scope for C3. Any RAII language will be considered a C++ competitor, not a C alternati
185.
▲
by
lerno
2y ago
I asked and got Bas's[1] permission to use C3 as a name when I first started out. [1] Bas van den Berg, the author of C2.
186.
▲
by
lerno
2y ago
It is possible to use a single-header library as part of C3 libraries or your project. However, it must be noted that this will inhibit the ability to cross compile, as the compilation of the header is outsourced to the natively installed C
187.
▲
by
lerno
2y ago
C3 allows arbitrary extensions of any types, so things like `vec1.dot(vec2)` is actually implemented as a generic method macro over all vector types added by the math module. Given Zig's preference for closed modules, I don't expe
188.
▲
by
lerno
2y ago
Back in the day when C's closest competitor was Pascal, C wasn't particularly hard to use. Pascal was easier for manipulating strings and C better at doing low level data manipulation. But at the time there was little need for hig
189.
▲
by
lerno
2y ago
No, they are the same.
190.
▲
by
lerno
2y ago
Ah, that is indeed true. However, the plan is to have the language fixed at 1.0, only updating stdlib and tooling after that.
191.
▲
by
lerno
2y ago
If you want to have your own Base32 where giving a padding = 0xFF instead returns an error, it's commonplace to have a wrapper that will explicitly do the check and return an error if it fails, and otherwise call the function: ma
192.
▲
by
lerno
2y ago
For grabbing the CPU features, there is some rudimentary implementation for x86 here: https://github.com/c3lang/c3c/blob/master/lib/std/core/priva... but not properly tested (which is to s
193.
▲
by
lerno
2y ago
Yes: https://c3.handmade.network/blog/p/8486-the_case_against_a_c...
194.
▲
by
lerno
2y ago
The hard thing is staying with the project. Lots of interesting C-like projects have died over time, such as https://www.kitlang.org
195.
▲
by
lerno
2y ago
I tried Zig in 2017-2018 span (and as part of research I've read quite a bit of Zig over the years). To me the language had some details not previously tried out: special operators for wrapping ops, error value based error returns and
196.
▲
by
lerno
2y ago
There is an overlap between module and class namespacing through static members and functions. Zig sees this and says "let's only have the latter" (on structs), which means among other things that in Zig a file is a structure
197.
▲
by
lerno
2y ago
I don't like to say "never", because other things make change that invalidates previous conclusions. For example, let's say that for some reason macros were removed (this is very unlikely to happen, but as a thought ex
198.
▲
by
lerno
2y ago
Now I'm confused, what do you mean? What grammar changes?
199.
▲
by
lerno
2y ago
It's a good language, you should try it out as well.
200.
▲
by
lerno
2y ago
(Funny story, I seem to have a bout of visual migraine at the moment and misread your comment until just now and had to remove what I wrote). I didn't mean to give the impression that I'm putting down Zig. It's more that I&#x
201.
▲
by
lerno
2y ago
If I would have liked, I could have done something like `import std::io::file as file;` but I noticed that we keep getting this issue that we’re renaming things all of the time, and usually in the same way. This is why path shortening is th
202.
▲
by
lerno
2y ago
Did you know that Wikipedia editors will aggressively remove Wiki entries about less known languages. There are already several wiki articles on Odin by various authors that have been removed over the years. Talking about GitHub numbers, we
203.
▲
by
lerno
2y ago
Blake2 and other hashes are most welcome. As for HashMap you are completely correct: there are many different types of maps that are needed. Concurrent maps, insertion ordered maps etc. And even variations of the small things: are keys copi
204.
▲
by
lerno
2y ago
This is not that novel. It is inspired by the similar feature in the Odin language.
205.
▲
by
lerno
2y ago
Also, `fn` is used to make type inference for lambdas syntactically simple. But I would lie if I said I haven’t been considering removing `fn` many times. But there are good reasons for keeping it, despite the break with C.
206.
▲
by
lerno
2y ago
Isn’t it a somewhat unfair characterization that ”C3 promotes itself more” and ”is pushed on HN and other social media” and that because of this C2 for some reason experiences harm? C2 is over 11 years now. C3’s recent breakthrough this las
207.
▲
by
lerno
2y ago
The difference here is that a preprocessor runs before parsing and semantic analysis. In C3 compile time if runs in the analysis step, so after parsing. So the macros and compile time execution occurs after parsing in C3, but in C everythin
208.
▲
by
lerno
2y ago
Yes, this is a very real problem that I've also written about: https://c3.handmade.network/blog/p/8486-the_case_against_a_c...
209.
▲
by
lerno
2y ago
Oh, I think you missed something then: There is both `$if` and `$switch` compile time statements for this: https://c3-lang.org/generic-programming/compiletime/#if-and-... At the top level and `@if` attribute is us
210.
▲
by
lerno
2y ago
But you have to. Ambiguities hint at lack of redundancies that also affects code reading. When you quickly scan something like `file.open` vs `file::open` the former is also more unclear to a reader without more context.
More ›