flâneur

janestreet/hardcaml: Hardcaml is an OCaml library for designing hardware. ·

github.com · saved by 1 readers

Hardcaml is an OCaml library for designing and testing hardware designs. Hardcaml includes a simulation backend as well as support for compiling down to RTL, so an entire hardware project, from designing the hardware to validating the design to synthesizing it for an FPGA, can be done in OCaml. Hardcaml allows you to: To get the advantages of implementing software algorithms in hardware, you usually have to "unroll" iterative or sequential operations into a hardware pipeline that can compute many things in parallel. Traditional Hardware Description Languages offer only very primitive generation features, so this unrolling becomes unwieldy, and tends to result in code that's hard to read and to reuse across projects. Hardcaml's strong type system and expressive metaprogramming capabilities allow you to implement highly flexible circuits concisely using OCaml. This also eliminates the risk of type-confusion bugs (in hardware, everything's just a wire, but we can assign semantic meanings

saved by