Hacker News new | past | comments | ask | show | jobs | submit login
Tsoding livestreams trying out C3 (programming language) [video] (youtube.com)
48 points by lerno 6 months ago | hide | past | favorite | 20 comments



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


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.


I watch his livestreams on Twitch; last night he continued his C3 journey with incredible results!

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


> he continued his C3 journey with incredible results!

And you wouldn't believe what happened next!

But seriously: what results?


...what he accomplished to achieve in 48 minutes with a newly learnt programming language?


Please tell me what he did so I don't have to watch a 2 hour video.


... and what did he achieve? With just 48 minutes, I greatly doubt anything news-worthy.



How does it compare to Zig? Does it inherit C macros?



"The old C macro system is replaced by a new C3 macro system."


Oh no, another would-be C replacement. I wonder if there is a list somewhere?


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.


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.


Difficult to take him seriously with such a childishly condescending attitude.


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.


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.


`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.


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.


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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: