4 ms·
Thanks for your feedback and encouragement! I'll try to shine some light on Cx. This comment has become a bit of a rant as a consequence, I hope you'll forgive
by MootWoop 12y ago
Thanks for your feedback and encouragement! I'll try to shine some light on Cx. This comment has become a bit of a rant as a consequence, I hope you'll forgive me :)
Cx is not so much C-based as C-like, and the difference is subtle but real. It's a dedicated language looking like C (and yes, a bit like Java) rather than something based on C, because bending an existing language backwards and using a small subset of it just doesn't feel right. Same reason why not SystemC: SystemC is your typical design-by-committee/the-enterprise horror, it's verbose, and it's just a tiny, weird subset of C++ with a lot of templates. How do you know what you're supposed to use to get something "synthesizable"? Another big problem with SystemC, just like any HDL, almost all of them are mainly simulation languages.
We created something C-like to have something that most people would find easy to start using; the C-like "curly" syntax is familiar to any developer (even JavaScript uses that). Same reason to go with imperative rather than functional: it's the paradigm that most people are comfortable using (not to mention that functional programming is not really a good metaphor for what happens in hardware - after all, a state machine is a sequence of things that modify state). The article you linked shows an interesting approach, but I believe it will remain a niche, kind of like functional programming in software (possibly even more so given the large difference in abstraction level).
Yes the "new" may seem surprising at first, yet it has the same meaning it has in other languages: it creates a new instance of an object, it's just that instances are created and connected at compile time rather than at runtime. We could have done without it, but I've found myself confused about what goes first in VHDL and Verilog enough times that I felt it was needed :-)
I think I will write a blog post on this, and link it on Hacker News one of these days! And if you want to have a chat, just send me an email or a PM on our forum.