Learning C3
31–40 of 163 posts
Re: Learning C3
#32C3 looks promising, but any language that supports nulls needs null-restricted types, not whatever those contract comments are. If I wanted to have to null-check everything, or YOLO it, I would just write Java... and even Java is seeking to fix this: https://openjdk.org/jeps/8303099
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 things: 1. You want almost all pointer parameters non null. 2. Non-null variables is very hard to fit in a language without constructors. Approaches to avoid constructors/destructors such as ZII play very poorly with ref values as we…
I don't see that as a problem; don't separate declaration from assignment and it will never be unassigned. Then a ZII non-null pointer is always a compile-time error.
Re: Learning C3
#33Earlier quoted context omitted.
Rust is way more complex to say the least, in fact it's the sole reason why it still has the same market share as COBOL( https://www.tiobe.com/tiobe-index/ ). Rust 1.0 was released 10 years ago by the way.
Tiobe really?
Re: Learning C3
#34Re: Learning C3
#35C3 looks promising, but any language that supports nulls needs null-restricted types, not whatever those contract comments are. If I wanted to have to null-check everything, or YOLO it, I would just write Java... and even Java is seeking to fix this: https://openjdk.org/jeps/8303099
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 things: 1. You want almost all pointer parameters non null. 2. Non-null variables is very hard to fit in a language without constructors. Approaches to avoid constructors/destructors such as ZII play very poorly with ref values as we…
Re: Learning C3
#36Re: Learning C3
#37Has anyone tried both C3 and Hare[1]. How do they fare? There seems to be quite the overlap between the two. [1] https://harelang.org/
Problem with Hare is that it is (or at least was last time I checked) Linux/Unix only and so by design. That kinda makes it DOA for many.
And yet out all these newer C-like languages, it looks like Hare probably takes the crown for simplicity. Among other things, Hare uses QBE[1] as a backend compiler, which is about 10% the complexity of LLVM.
Re: Learning C3
#38Earlier quoted context omitted.
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 things: 1. You want almost all pointer parameters non null. 2. Non-null variables is very hard to fit in a language without constructors. Approaches to avoid constructors/destructors such as ZII play very poorly with ref values as we…
the hacker news markdown parser seems to have swallowed your asterisks, which are essential to understanding your comment.
5 \* 2 \* 1 = 10Re: Learning C3
#39Earlier quoted context omitted.
Problem with Hare is that it is (or at least was last time I checked) Linux/Unix only and so by design. That kinda makes it DOA for many.
Indeed. There’s a port for macOS though. And yet out all these newer C-like languages, it looks like Hare probably takes the crown for simplicity. Among other things, Hare uses QBE[1] as a backend compiler, which is about 10% the complexity of LLVM. [1] https://c9x.me/compile/
Re: Learning C3
#40After using Rust on a couple of projects, I understand the appeal of simpler languages like C3, Zig, and Odin. As one commenter very aptly put on the Zig subreddit ... "I used Zig for (internal tool) because I wanted to quickly write my tool and debug it, and not spend all my time debugging my knowledge of Rust."
Is Zig really that common at this point that you'd feel comfortable using it for a work project? Its not just going to piss off the next person and have them need to rewrite it? I guess Rust has the same problem to some extent but there is a lot of resources for writing Rust out there now