News for hackers. Stuff that matters.
Re:Tsoding livestreams trying out C3 (programming language) ... by ReleaseCandidat on Monday July 29, 2024 @05:59AM (#41099253)
Somehow strange that the whole video is about FFI with C (Raylib). I'd prefer seeing something about C3's special features like ML (no, not THAT ML) style modules, contracts, (real, as in "not CPP") macros, error handling, ...

And a LSP exists, but isn't the most stable: https://github.com/pherrymason/c3-lsp

Re:Tsoding livestreams trying out C3 (programming language) ... by self_awareness on Tuesday July 30, 2024 @03:49AM (#41106952)
Interoperability with C is one of their main points, so it's logical they want to focus on that. Even more, the success of today's language is also being measured how well it behaves with existing codebase. It will be more true in the future, because the existing source code only grows.

Well, maybe the last bit isn't true for webdev, where if the code rots it's simply being deleted. Web applications, if they're taken off production, they're nowhere to be seen, most people never realizing they ever existed, but even if they knew those applications existed at some point in time, they would never be able to even see how they looked like.

Re:Tsoding livestreams trying out C3 (programming language) ... by ReleaseCandidat on Monday July 29, 2024 @06:41AM (#41099385)
Re:Tsoding livestreams trying out C3 (programming language) ... by stefanos82 on Monday July 29, 2024 @07:03AM (#41099467)
I watch his livestreams on Twitch; last night he continued his C3 journey with incredible results!

https://www.twitch.tv/videos/2209655398

Re:Tsoding livestreams trying out C3 (programming language) ... by ReleaseCandidat on Monday July 29, 2024 @07:06AM (#41099481)
> he continued his C3 journey with incredible results!

And you wouldn't believe what happened next!

But seriously: what results?

Re:Tsoding livestreams trying out C3 (programming language) ... by stefanos82 on Monday July 29, 2024 @07:40AM (#41099632)
...what he accomplished to achieve in 48 minutes with a newly learnt programming language?
Re:Tsoding livestreams trying out C3 (programming language) ... by ReleaseCandidat on Monday July 29, 2024 @07:45AM (#41099659)
Please tell me what he did so I don't have to watch a 2 hour video.
Re:Tsoding livestreams trying out C3 (programming language) ... by arghwhat on Monday July 29, 2024 @07:47AM (#41099667)
... and what did he achieve? With just 48 minutes, I greatly doubt anything news-worthy.
Re:Tsoding livestreams trying out C3 (programming language) ... by jacknews on Monday July 29, 2024 @07:07AM (#41099490)
Difficult to take him seriously with such a childishly condescending attitude.
Re:Tsoding livestreams trying out C3 (programming language) ... by trwhite on Monday July 29, 2024 @07:15AM (#41099523)
I agree. I find myself disengaged as soon as someone makes fun of the hard work of others. Intelligent people don't typically do this.
Re:Tsoding livestreams trying out C3 (programming language) ... by JonChesterfield on Monday July 29, 2024 @07:33AM (#41099594)
The rationale for removing goto is:

> Rationale: It is very difficult to make goto work well with defer and implicit unwrapping of optional results. It is not just making the compiler harder to write, but the code is harder to understand as well.

That seems to fit your heuristic. Goto being difficult to implement in the compiler doesn't match expected reality.

Re:Tsoding livestreams trying out C3 (programming language) ... by rob74 on Monday July 29, 2024 @11:13AM (#41101070)
It's not difficult to implement goto as such, it's just a JMP instruction, but (I'm not a compiler developer, but I can imagine) implementing goto without introducing strange bugs or crashes is a bit more difficult.
Re:Tsoding livestreams trying out C3 (programming language) ... by JonChesterfield on Monday July 29, 2024 @08:17PM (#41104942)
Compilers really like canonical forms. There's a good chance that if, for, while, goto, break and so forth all turn into an edge between basic blocks (anything that doesn't have a branch or branch target in it). In a rather literal sense it's usually all sugar over goto, unless you're doing something niche like carefully preserving structure because your target language doesn't have branches.

So seeing someone say that their compiler struggles to represent goto throws some doubt on how the thing is implemented. Goto should generally be the easiest possible control flow to translate into your IR.

Re:Tsoding livestreams trying out C3 (programming language) ... by lerno on Friday August 02, 2024 @08:37PM (#41143858)
`goto` is trivial to implement. `goto` doing the right thing jumping over `defer` and implicitly unwrapping optionals (flow-typing) is less nice as you suddenly need to track much more things in the front end.

And you might say "so what, the compiler can be complicated, just make the language easy to use". However, one design constraint is to not make the language hard to reimplement.

And you might not agree with that constraint, but some people feel that this is indeed important. Important enough to not include `goto` as long as the use cases of `goto` are all covered.

Re:Tsoding livestreams trying out C3 (programming language) ... by rob74 on Monday July 29, 2024 @07:10AM (#41099498)
Oh no, another would-be C replacement. I wonder if there is a list somewhere?
Re:Tsoding livestreams trying out C3 (programming language) ... by ReleaseCandidat on Monday July 29, 2024 @07:50AM (#41099685)
Hmm, let me try and ignore anything up to and including ADA and all "C++ replacements" (so no Rust, Carbon, ...): C3, Zig, Austral, Hare, Vale, V, Odin, Jai.
Re:Tsoding livestreams trying out C3 (programming language) ... by memsom on Monday July 29, 2024 @11:35AM (#41101240)
I would put Carbon in the list on the right. Zig is more worthy of being on the left, but even then I'm not 100% sure of that statement.
Re:Tsoding livestreams trying out C3 (programming language) ... by hailruda on Monday July 29, 2024 @07:16AM (#41099528)
How does it compare to Zig? Does it inherit C macros?
Re:Tsoding livestreams trying out C3 (programming language) ... by ReleaseCandidat on Monday July 29, 2024 @07:31AM (#41099585)
Re:Tsoding livestreams trying out C3 (programming language) ... by JonChesterfield on Monday July 29, 2024 @07:28AM (#41099576)
"The old C macro system is replaced by a new C3 macro system."