HNHacker News
TopNewBestAskShowJobs

christiaanb

26 karma · joined May 9, 2015

submissionscomments
christiaanb··on Selling 'Ghost in the Shell'
Ah, did that know that! That makes the voice acting and script even better then.
christiaanb··on Selling 'Ghost in the Shell'
Perhaps the only anime where the voice actor for one of the Dutch characters actually speaks proper Dutch (as opposed to e.g. German or very broken Dutch). Although they picked a weird translation for the concept of boss/chief/ranking officer, and they chose “opperhoofd”; which as a Dutch person is something you associate as a person that is the head of a tribe, not ranking officer.
christiaanb··on Clash: A Functional Hardware Description Language
As described in my other comment, Clash is not like Chisel in that Clash compiles Haskell source code directly, while Chisel is an EDSL (in Scala)

Since you’re more familiar with Haskell, perhaps have a look at Blarney: https://github.com/blarney-lang/blarney/blob/master/Doc/ByEx... It’s an actively maintained EDSL for circuit design using Haskell as its host language.

christiaanb··on Clash: A Functional Hardware Description Language
One of the original authors of Clash here.

I was always torn on how to describe Clash to an audience whose background I don’t know up front: is it a hardware description ‘language’, or, is it a set of tools, libraries and scaffolding to use Haskell as a method for circuit description?

So yes, Clash is just Haskell. Although it is Haskell with certain GHC language extensions enabled by default plus a type-checking plugin for reasoning about type-level natural numbers.

That’s because the Clash compiler can only translate a semantic subset of Haskell to circuits. We use types to determine how big the circuit will become (fixed-length lists, fixed-depth trees, fixed-width numerics, etc.). So the semantic subset part means that Clash will not translate Haskell programs where the recursion depth is unknown at compile time, nor things like mutation (whether it’s ST or IO) or other I/O like actions.

Finally, why we’ve kept the “Clash is a functional hardware description language” is that unlike approaches such as nMigen, Chisel, Spinal, the Clash compiler translates the actual Haskell source code to VHDL/(System)Verilog. It uses the GHC Haskell compiler to do all the parsing, type-checking and “desugaring”. This means that with Clash you can use all of Haskell’s syntax to describe how the circuit operates, including if-expressions, case-expressions, etc. In the other approaches I mentioned you usually have to use some sort of ‘when’-function to describe run-time choice. So those approaches to me feel more like a “use-language-X-as-a-tool-for-circuit-description”, while Clash, again to me, does really feel more like a hardware description ‘language’.