Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lerno
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
18 ms
·
241.
▲
by
lerno
3y ago
If you aren’t looking for languages that have more fancy memory management things (ref counting, borrowing or similar) then the active ones I know of are in alphabetical order: C3, Hare, Jai (might be slightly more of a C++ alternative), Od
242.
▲
by
lerno
3y ago
Such binaries will not be able to use anything but the special C-compatible types and calls, which is quite the limitation. Image if C++ static libraries could only use C compatible POD structs and none of the C++ parameter types for exampl
243.
▲
by
lerno
3y ago
I would argue that Zig’s inability to produce static or dynamic libraries that use Zig features in its API is a much bigger problem that Odin’s lack of a package manager. Neither Odin nor C3 has any problems with this, and it simply follows
244.
▲
by
lerno
3y ago
Well, `Stack.push()` is because it's a method. But ok, why `fn void push() { ... }`? It's actually a long story. Originally C3 was merely an extension of C2 - which was largely a streamlined C syntax + modules + struct methods. BU
245.
▲
by
lerno
3y ago
Well, I tried to design languages years ago (10+ years ago). They never amounted to anything or even got further than writing a lexer. C3 wouldn't have happened if I didn't have the design of C2 (and of course the C language) to l
246.
▲
Show HN: The C3 programming language reaches feature-stabiliy
5 points
by
lerno
3y ago
|
7 comments
247.
▲
by
lerno
3y ago
Sigh. Please don’t refer to the rather exceptional nature of Zig’s self hosting. There has been an insane amount of work put into the Zig compiler by various contributors. Probably easily eclipsing the effort to write two separate compilers
248.
▲
by
lerno
3y ago
I’ve written about this at some length, but long story short: type modeling and semantic checking is intimately connected to the language semantics, so aside from very simple “look at the properties of the underlying nodes, derive propertie
249.
▲
by
lerno
3y ago
I was originally pursuing a career in theoretical physics. My master thesis was going to be a literature study on string theory. The more I read, the more I went “what the heck, this theory can’t possibly be true, it’s so ad hoc with rules
250.
▲
by
lerno
3y ago
”When you can”, is nothing I disagree with, but also bad advice in that it doesn’t give any criteria. For example: if you are writing the parser for a compiler you will spend years on, then a handwritten parser is great! You can tweak error
251.
▲
Compile-time and short-circuit evaluation
(c3.handmade.network)
27 points
by
lerno
3y ago
|
12 comments
252.
▲
Small joys of programming in Odin
(zannzen.com)
144 points
by
lerno
3y ago
|
61 comments
253.
▲
by
lerno
3y ago
What do you think about C3 then? https://c3-lang.org
254.
▲
by
lerno
3y ago
This isn't about Zig, but I found that I prefer something similar to concepts over traits/interfaces, as the former are somewhat limited as to what they express. /** * @checked x & 1 "The input parameter m
255.
▲
by
lerno
3y ago
As a counterpoint, see this blog post on why wrapping-overflow-is-UB is bad for safety and correctness: https://c3.handmade.network/blog/p/7640-on_arithmetics_and_o... The gist of it is that (a + b) - c becomes di
256.
▲
by
lerno
3y ago
It’s hard to push down conditional compilation too far without compromising its value, but one can still stop at a much later point than Zig does. (In fact, the fundamental choices of Zig in regards to compile time necessarily makes it hard
257.
▲
Some language design lessons learned
(c3.handmade.network)
1 points
by
lerno
4y ago
|
0 comments
258.
▲
by
lerno
4y ago
This claim just killed me: "Apart from [Zig] not having crazy UB like in unsafe Rust". Zig has more UB than even C. Yes, Zig has safety checks you can turn on, but then it's not fast anymore. The claim saying Zig has no UB is
259.
▲
The case against a C alternative
(c3.handmade.network)
217 points
by
lerno
4y ago
|
379 comments
260.
▲
by
lerno
4y ago
Regarding the name, I am not in love with it, but people like my other names even less… Suggestions are always appreciated.
261.
▲
by
lerno
4y ago
There is a dependency relationship defined in C3 for libraries, but there is not (yet anyway) any package manager to actually pull those from a remote repository. It just ensures they are present when using it. The standard library is far f
262.
▲
by
lerno
4y ago
Thank you!
263.
▲
by
lerno
4y ago
Vector types are built in, which you can do operations on, e.g. float[<4>] y = { 1, 2, 3, 4 }; float[<4>] z = { 2, 2, 2, -100 }; float[<4>] w = y + z; It's not completely fleshed out with builtins yet
264.
▲
by
lerno
4y ago
Do you wonder about how type promotion rules work in C3? If so then I can explain them as they differ somewhat from C. The reason for not using bitsize numbered types is readability e.g. `for (i8 i = 8; i > 0; i--)`
265.
▲
by
lerno
4y ago
BetterC is very nice. I'd like to imagine BetterC lifted out of the D compiler with its own spec and separate evolution... That would have been ideal for me. But with BetterC as part of the D compiler it will always feel more like a ga
266.
▲
by
lerno
4y ago
C++ compile times would like to have a word with you ;) The biggest drawback of C++ are the atrocious compile times.
267.
▲
by
lerno
4y ago
I actually tried to look for substdio but I failed to get anything good by googling (just that qmail uses it)
268.
▲
by
lerno
4y ago
There isn't much of a reason to use anything beyond UTF8 today except for interfacing with code and documents that use UTF16.
269.
▲
by
lerno
4y ago
C is a great language. Actually it's not that small, it's just that modern languages often are very big (easy if you compare yourself to C++). The feature bloat is a fairly recent trend.
270.
▲
by
lerno
4y ago
D's betterC is very nice. Very much worth looking at.
More ›