Functional Programming at Jane Street

Hardware designs are extremely parallel. To fully test them, we need the ability to run multiple tasks at the same time. This is solved by the [Hardcaml_step_testbench] library, which allows us to write libraries of composable test functions over fully typed interfaces and reuse them across different hardware designs. It's a lot like the monadic threading libraries Async and Lwt—at bind points, rather than switch tasks (like a threading monad would do), we synchronise multiple tasks together, execute a clock cycle of a simulator, then continue running further testbench tasks. We are extremely excited about OCaml5 effect handlers, which will make working with these testbenches even easier!

Read more about Hardcaml here.

Andy R.

Webs is a distributed computation platform that combines the flexibility and usability of spreadsheets with the robustness and composability of functional programming. Built entirely in OCaml, it helps us efficiently perform dynamic computations on rapidly changing data. By using incremental recomputation, it can scale to handle billions of nodes and edges. Formulas in Webs are written in a pure strictly-typed functional DSL, ensuring type safety and enabling powerful abstractions. The computations can be defined and manipulated both via OCaml and via a user-friendly web interface. Users can construct sophisticated tools with strong typing and rich data structures not found in traditional spreadsheets. There's a built-in debugger in the web interface so users can quickly understand and edit complex formulas.

We use Webs for a wide array of applications, from pricing large trades to managing risk and analyzing data. It's a great example of the power of functional programming in real-world, high-stakes environments.

Victor P.

JSQL is an in-house SQL-inspired query language and evaluation engine, aimed at providing a uniform interface for querying both in-memory OCaml data structures and database tables. The in-memory evaluation engine uses Incremental, Jane Street’s library for self-adjusting computation graphs, to efficiently maintain a query’s output as the input data changes. JSQL has been used to build many applications across the firm. We’ve leveraged the incremental evaluation engine to build a number of customizable real-time alerting and monitoring systems, and JSQL has been used to build data visualization tools, trading-system configuration tools, and more.

Ken C.

Mixed-integer linear programming (MILP) is a powerful and versatile optimization technique capable of modeling a wide range of costs encountered in the real world. In fact, any piecewise linear function can be expressed as an MILP problem.

The standard approach for doing this is to introduce additional dimensions to the original problem, such that the augmented, higher-dimensional problem is purely linear. You can then tackle this latter problem using an MILP solver, and finally project back down to your lower-dimensional original problem. However, solving MILPs is NP-hard in general, and adding dimensions is computationally expensive.

We developed a type-safe API to help with constructing MILP problems that are both correct and performant. The API provides defaults to nudge users towards constructing efficient problems where possible while leveraging the type-checker to ensure additional dimensions are introduced when needed.

Aditya S.

Datafetcher is a dependency injection library, similar to Facebook's Haxl, which automatically batches and caches external data requests. Users can write clean, declarative code without needing to worry about any tricky query optimization logic. When debugging, users want to see are written in an OCaml-embedded DSL, which makes it possible to construct the build graph dynamically (parts of the graph are discovered during the build), concurrently (different parts of the graph are constructed concurrently), and incrementally (parts of the graph can change between successive builds). Our most exciting goal in the near term is distributing the execution and caching of this build graph over a pool of build workers. This work involves a number of interesting problems, such as incremental cycle detection, deferred materialisation of build artifacts, compact representation of dense dependency graphs, and efficient isolation of individual build jobs.

Matthew S.

All our Software Engineers have the opportunity to work on problems like these. Candidates with an existing specialty may also be interested in the following roles:

A commitment to cutting-edge research

Trading on the world’s electronic markets is highly competitive, which has led us to pursue innovative research in machine learning, programmable hardware, compiler design, and more. An important part of how we’ve approached this work is by engaging with academic researchers and students. Read more about opportunities to collaborate:

Graduate Research Fellowship (GRF)

The Fellowship supports exceptional doctoral students currently pursuing a PhD in computer science, mathematics, physics, or statistics. If accepted, you’ll receive a year’s worth of tuition and fees, as well as a $50,000 stipend to support you as you continue your research. Fellows will also be invited (but not required) to visit our office to give a talk on any topic of their choosing to Jane Street employees and other Fellowship recipients.

Tools and Compilers (T&C) Internship

The T&C internship gives you a chance to learn how we use OCaml in our day-to-day work, gain exposure to the libraries and tools that are foundational to our internal systems, and apply cutting-edge functional programming features to a large, actively developed production codebase. By the end of the program, each intern will aim to produce publishable research. This internship is best suited for PhD students whose research is already closely aligned with work going on in house.

Visiting Researcher Programs (VRP)

These programs invite both current faculty and recent PhD graduates preparing for a career in academia to spend time with us in person or remotely between three and twenty-four months. The VRP is an opportunity to see how programming language concepts can be put into practice in the hands of a large and expert team of functional programmers. We’re looking for researchers working on programming languages, graph-structured and incremental computation, networking, and more!

The next great idea will come from you!