Feels like VHDL, with different clock domains
Re:Synchronous languages
by vanderZwan on Friday October 05, 2018 @10:01AM
(#18148165)
Tangent: I have never used VHDL, but conceptually I find it mind-blowing that we have programming languages for automatic hardware design. I wonder if anything can be learned from it when designing "regular" programming languages.
I did some VHDL in school when I was doing a computer engineering degree. We came at it from underneath, as it were -- we'd done a fair number of classes on digital logic and VLSI design. So the way we wrote it felt like describing hardware (hence the name, Hardware Description Language) rather than writing software. That being said, it had a lot of affordances we didn't use, that would have made it feel a lot more like a programming language. Unlike a programming language, though, you're acutely aware of the cost. Every line costs you surface area / FPGA gates, and if your HDL is too big, it won't fit in the IC you want to program.
What I also find fascinating about it is that it has almost no memory overhead per trail - a handful of bytes IIRC. Compare that to the kilobytes required for green thread solutions elsewhere. OTOH, computationally the concurrency doesn't really scale with large numbers of trails - I think you could compare it to insertion sort: unbeatable for small arrays due to low overhead, but then that O(n^2) takes over.
One might envision having many small Céu programs with only a handful of trails each, asynchronously running in their own threads and interacting with each other. From what I gather, programming in this model is called using the GALS principle: Globally Asynchronous, Locally Synchronous. For the intended environment for Céu (embedded programming), you kind of "naturally" get this: asynchronicity just kind of "happens" due to separate pieces of hardware interacting.
Anyway, it kind of feels like the "missing element" in reactive and concurrent programming paradigms to me. I hope more languages will start picking it up eventually.
[0] http://ceu-lang.org/
[1] https://www.reddit.com/r/arduino/comments/5qzv12/c%C3%A9uard...