
OCaml All the Way Down – How Jane Street Builds FPGA Designs [video] - snaky
https://www.janestreet.com/tech-talks/ocaml-all-the-way-down/
======
faitswulff
This is a talk. In case you just want the youtube link, it's here:
[https://www.youtube.com/watch?v=X1cgRXhpQLY](https://www.youtube.com/watch?v=X1cgRXhpQLY)

------
archgoon
I do appreciate the presenters sense of humor.

"I know what you're thinking. I know what you're thinking. That's like ten
lines of Verilog, right? Naaaah. That's not how I roll. That's more like two
hundred... thousand... lines of Ocaml."

------
supahfly_remix
How does Jane St. use FPGAs to make money trading? My impression was that
unless the application demands real speed (i.e., microseconds), write it as
software that run in a general purpose processor, not in an FPGA. x86s always
get the latest semiconductor processes, while FPGAs always lag.

~~~
logicchains
High-frequency trading in a developed market demands response times on the
order of nanoseconds, whereas anything in software is unlikely to get under a
microsecond. If you're too slow, all the obvious efficiencies in the market
have already been corrected by faster firms, so you miss out on a bunch of
easy trades.

~~~
supahfly_remix
Where does this nanosecond number come from for HFT? 1 ns is the time light
takes to travel 30 cm in a vacuum. Are these firms only trading with firms
that are a few meters away? How about round trip times? I believe only 10s of
microseconds are significant, not nanoseconds.

~~~
jonnii
That is exactly what is happening in high frequency trading. Firms are paying
crazy money to be colocated in the same data centers as the exchanges.

~~~
gcb0
And we as a society know that and think it is normal. Crazy.

~~~
hazz99
I don't think it's a bad thing - theyre business model relies upon low
latency, and so they do everything they can to reduce it

~~~
gcb0
[https://www.smbc-comics.com/comic/trading](https://www.smbc-
comics.com/comic/trading)

------
3rdAccount
Can anyone who watched the video summarize? I'm interested in the subject, but
don't have the time/concentration for long videos when an article often
suffices.

~~~
janco
my notes:

* HardCaml - DSP for FPGA/ASIC, * embedded SW in OCaml (running on Xilinx MicroBlaze), * HardCaml example: AXI interface, GPIO, SPI, cordic, * FPGA: LUTs and regs, BRAM, DSP,

skip to 9:40 if you are familiar with FPGA, skip to 17:50 if you know HDLs, go
to 37:10 for a demo

* HardCaml datatypes: __registers, __wires (can be used before they are assigned), __memory, __...

* API: __arithmetic, __logic, __`pipeline`, `reg`, __bit selects, __`width` -- > useful for HW generation, __`inst` - use VHDL and Verilog in HardCaml

* signed and unsigned types: checks at compilation, * `bits` = non-synthesizable, `signal`= synthesizable, * `Always` ~ Verilog `always` - used mainly for FSM

* built-in cycle-accurate simulator: __supports multiple process, __MicroBlaze simulator (instruction set simulator)

* terminal-based waveform viewer and VCD export

* formal verification: __SAT solvers - boolean function -- > SAT/UNSAT

* software: __Ocaml - > bytecode -> Ocaml interpreter for MB, __C-stubs in Ocaml library, __no signals, no threads, no Unix

* code for HardCaml available on Jane Street GitHub

------
seta35
actually, we don't care how jane street does this and that with ocaml. it's
such hype bullshit that makes me wanna vomit. Stop giving it publicity it
doesnt deserve.

------
rudolph9
What are some good resources for HardCaml?

~~~
ptrott2017
Github:
[https://github.com/janestreet/hardcaml](https://github.com/janestreet/hardcaml)

And Andy Ray and co's stuff:

Blogs: [http://www.ujamjar.com/](http://www.ujamjar.com/)

Getting started overview and tutorials:
[http://www.ujamjar.com/hardcaml/](http://www.ujamjar.com/hardcaml/)

Running OCAML Bytecode in hardware: [https://github.com/ujamjar/hardcaml-
zinc](https://github.com/ujamjar/hardcaml-zinc)

------
Vekz
Any mention of what vendor Jane Street is buying FPGAS from?

maybe: Arty A7 hobbyist FPGA board from Xilinx

