(Context: Jane Street held a one-day workshop to introduce OCaml to people who already know how to program. It was announced in this blog post; the workshop materials are posted online.)
Hello workshop attendees!
We know that one day is not nearly enough to get comfortable with OCaml and the ecosystem of tools around it, so we want to make sure there’s a place for you to ask questions that come up as you continue your exploration. The mentors from the workshop and other Jane Street developers will be watching this thread.
I had a great time! I had frogger partly working at the end. It was my first time using Ocaml and i thought the pace was pretty good.
I’m curious about a number of things wrt working with numerical data:
a.) you have any best practices docs re: doing numerical work in Ocaml that you can share
b.) if you have any good examples of using the type system for making investment logic safe® (ie log change vs pct change, dollars vs shares, etc)
c.) if there are tools to handle labeled nd-arrays (like xarray for python: https://xarray.pydata.org/en/stable/)
d.) incremental looks very interesting for reactive data processing. ive seen libraries like this for clojure. how widely is it used at JS?
Just coming here to say that this was extremely well run. The ratio of Jane St. devs to attendees was high enough that I think you could have upped the number of people attending to 60 or 80. It was probably the best workshop I’ve been to in the last five years.
Glad you liked the event! I’ll try to answer some of your questions below.
I don’t have anything especially wise to say on this subject, other than the perhaps obvious one of minting abstract types. You can do something like:
module Symbol : Identifiable.S = String
if you want an abstract symbol type that can’t be confused with other strings. You can do similar things with module types other than identifiable. Abstract types are a simple thing, but they take you a long way.
This doesn’t solve all the problems, but Owl is a promising numerical library you might want to look at.
We use Incremental a lot! I highly recommend checking it out.
I’m not aware of anything. Owl has only bare unlabeled nd-arrays, but I know the author was looking into adding some form of dataframes. If you have a good use-case and insight about the best api for (nd) dataframes, I’m sure a feature request on Owl would be noticed. Would you say it’s best to skip the equivalent of pandas and instead directly implement something like xarray?
Sorry for the late response (notification got tucked away somewhere). Yeah I would think if you had an abstraction for array computation that jumping straight to something like xarray sounds right over something like pandas.
Where the purely tabular abstractions shine is in presentation and as part of interactive feedback loops… and there i think R’s dplyr/tidyverse libraries have a more consistent design and better semantics (but lacks awareness of coordinates/values).