Register and share your invite link to earn from video plays and referrals.

Search results for ocaml
ocaml community
One keyword maps to one global community path.
Create community
People
Not Found
Tweets including ocaml
I’ve built HFT/exchange systems in three languages that sit at very different points on the safety/performance/ergonomics spectrum: OCaml, C++, and Rust. Observations and a practical comparison from production use: OCaml • Strong static typing and algebraic data types make illegal states almost impossible to represent. Protocol parsers, order book models, and risk checks are self-documented by types and function signatures. • The default garbage collector is a non-starter for predictable tail latencies. There are workarounds using disciplined zero-allocation techniques: custom core libraries, careful use of the [@ inline] and [@ unboxed] attributes, and a culture that treats any heap allocation in the hot loop as a bug. • Functional programming forces strategy writers to think in pure transformations of market data to fair values to orders. This style enables multiple forms of unit testing and makes offline model training pipelines easier to implement without major code changes. • The ecosystem for kernel-bypass networking and FPGA offload is thin; performant OCaml requires writing a fair amount of C interop or custom FFI. Compile times and binary size can also become painful at scale. • Engineering effort on type safety is a replacement for future engineering effort on debugging. We used to half-joke, “if it compiles, it works.” C++ • The most commonly used language in HFT because it offers maximum control. The writer can pinpoint every cache line, allocation, and branch. When the last microseconds matter, few languages can compete. • Industry standard for exchange connectivity, FPGA drivers, and shared-memory IPC. Virtually every low-latency NIC vendor’s API is written for it. • The cost is constant vigilance. Use-after-free, data races, and subtle ABI mismatches are permanent time sinks. Even with modern C++ features such as concepts, spans, and std::atomic memory orders, the cognitive load stays high. • Template metaprogramming offers some of the type-level guarantees of OCaml or Rust, but the error messages and compile times can be inscrutable. • Most of the “C++ is faster” advantage narrows when factoring in the engineering time spent hunting undefined behavior. Rust • Ownership and borrowing give the memory-safety guarantees of a garbage-collected language with the performance profile of C++. Zero-cost abstractions allow HFT system authors to write zero-allocation, lock-free, cache-aware code and the compiler will refuse to allow introduction of data races. • Excellent for the modern low-latency stack: DPDK/AF_XDP bindings, io_uring, shared-memory rings, and safe wrappers around exchange binary protocols. • The type system is expressive enough to encode many of the same invariants of OCaml, such as phantom types, newtypes, and state machines, without the garbage-collection tax. • The borrow checker still occasionally forces awkward redesigns of hot-path data structures, async/await is not yet as mature for ultra-low-latency work as plain threads/ busy-polling, and the ecosystem for certain HFT-specific libraries lags C++. • It takes time for the ownership model to click, after which mental bandwidth can be dedicated to strategy and latency. It’s much more difficult to build a high-frequency trading system that retains correctness and readability as it scales than it is to build one that’s fast. Good taste and developer culture can coalesce around a particular language, but the best teams possess these qualities independently, and can adapt freely and agilely to new technologies as they become available.
Show more
Another week, another eval suite. This is a very special week since we are beginning work on our first language-specific eval suite. And the first language we'll be focusing on is OCaml 🐫 We picked OCaml because it's a language that doesn't get a lot of attention in coding benchmarks. It's time to give this amazing programming language the attention that it deserves. Coming soon 🖖
Show more
In 2015 I formed a small group of engineers at Jane Street to rebuild the firm’s core trading system from the ground up, and we ended up cutting latency by two orders of magnitude. Some of the techniques we used, relevant for algorithmic trading systems and exchanges today: Zero allocation: Whenever a program allocates memory for an object on the heap, the runtime pays a steep penalty in latency. The simplest solution is to avoid memory allocation entirely. Jane Street famously uses OCaml, a strongly typed programming language that by default produces garbage collected by a dynamic collector. Most other firms use languages with manual memory management, but it was a strict part of Jane Street’s tech culture that all risk-sensitive code had to be written in OCaml. It took a collaborative effort across multiple groups within Jane Street’s technology org to create zero-allocation core libraries, combining the type safety of a functional programming language with the memory profile of a language like C. We built the new main trading loop in this hybrid OCaml/C-style, producing zero new allocations in the critical path from tick to trade. In modern languages like Rust, it is substantially easier to achieve precise memory management while still benefiting from type safety and compile-time guarantees. Kernel bypass: A primary goal of a low-latency trading system or exchange is to pull a network packet containing market data or order flow through the network card’s interface and into the program’s memory space as fast as possible. The standard Linux OS kernel uses slow abstractions to support a wide variety of network drivers, at the expense of the entire system’s end-to-end latency. When we started with an empty program that contained no business logic and only forwarded packets through when received, the end-to-end latency was already too slow. To fix this issue, we employed a standard practice in the HFT industry in which we bypassed the OS’s kernel stack entirely by leveraging our network card vendors’ proprietary APIs to DMA packets straight from the NIC into memory. This technique brought our empty-packet-forwarding baseline into the latency regime we needed in order to build out the rest of the trading, risk, and protocol code. Local IPC: Kernel bypass is necessary when reading routed packets off a network from a third party such as another exchange or client connection. When communicating between internal instead of external processes, the fastest transports avoid network stacks entirely. Processes within the same box can transfer messages using shared memory or Unix domain sockets. This allowed us to continue with our familiar process boundaries for separable components without sacrificing significant performance. We had to write custom logic to emulate many of the features of network- and transport-layer protocols, with the result of creating a reusable, zero-overhead IPC mechanism. Working on this problem was one of the most intellectually rewarding experiences of my early career. The above latency optimization techniques are fairly commonplace in the HFT trade but hard to learn outside the industry setting. Half of our team at Architect comes from Jane Street and other trading firms, and we value using our domain knowledge to build exchanges for the public rather than trading software that never leaves an HFT’s walls.
Show more
0
148
6K
351
Forward to community
Don't learn formal methods. Writing proofs by hand is what kept formal methods niche for over 75 years. seL4 took about 20 person-years to prove 8,700 lines of C. Agents take that part now. What's left for you is the spec, and knowing which language fits the job. That's why the history matters. Formal methods means stating what a program or system must do in precise math, then using a tool to check that the code or design meets it. Here's how we got here, what each language is good for, and where I'd start. FOUNDATIONS (1947 to 1979) 1947: Goldstine and von Neumann annotate program flow diagrams with "assertion boxes" stating what holds at each point. 1949: Alan Turing's "Checking a Large Routine" proves a short program correct using assertions. The idea mostly sits unused for over a decade. 1962: Carl Adam Petri's dissertation introduces Petri nets for modeling concurrent systems. 1963: John McCarthy, "A Basis for a Mathematical Theory of Computation". 1966-67: Peter Naur and Robert Floyd independently show how to prove programs with assertions attached to points in the code. 1967: N. G. de Bruijn starts Automath, the first language for computer-checked mathematical proofs. 1969: Tony Hoare publishes Hoare logic, {P} C {Q}. Nearly every contract language since builds on it. 1972: Robin Milner's Stanford LCF. Its Edinburgh successor (1979) introduces ML as its scripting language, the ancestor of Standard ML, OCaml and F#. 1973: Mizar starts in Poland. Formalized math that reads close to a textbook. 1975: Dijkstra's guarded commands and weakest preconditions. 1977: Amir Pnueli brings temporal logic to programs. Patrick and Radhia Cousot publish abstract interpretation, the theory behind sound static analyzers. 1978: Hoare's CSP for concurrent processes. Milner's CCS (1980) and the pi-calculus (1992) follow. 1970s: VDM at IBM's Vienna lab. Jean-Raymond Abrial proposes Z, later developed at Oxford. Boyer and Moore build their theorem prover. TOOLS PEOPLE USED (1980 to 1999) 1981-82: Model checking, invented independently by Clarke and Emerson and by Queille and Sifakis. Turing Award in 2007. 1980s: Synchronous languages Esterel and Lustre in France. Lustre becomes SCADE, which Airbus uses to design flight control software. 1984: Nuprl at Cornell. 1985: Coquand and Huet's Calculus of Constructions, the logic under Coq. 1986: Isabelle (Larry Paulson). Late 1980s: SPARK, a provable subset of Ada. 1988: HOL (Mike Gordon). 1989: Coq's first public release. Renamed Rocq in 2025. 1990: Symbolic model checking with BDDs handles 10^20 states. McMillan's SMV follows. 1991: SPIN model checker goes public (Gerard Holzmann, Bell Labs). 1992: PVS at SRI. Oxford and IBM win the Queen's Award for using Z on IBM's CICS transaction system. 1993: Metamath, a proof language simple enough to check with a few hundred lines of code. 1994: Lamport's TLA. TLA+ follows in 1999. 1994-95: Intel's Pentium division bug costs it $475 million. AMD uses ACL2, Kaufmann and Moore's successor to the Boyer-Moore prover, to prove its K5 floating-point division correct. Intel hires John Harrison in 1998 and uses his HOL Light to verify floating-point algorithms. 1996: Abrial's B-Book. 1997: Alloy (Daniel Jackson, MIT). 1998: Paris Metro line 14 opens driverless, with safety software built in the B method. The KeY project for Java verification starts. 1999: Agda (Catarina Coquand). JML, a contract language for Java. VERIFIERS MEET REAL CODE (2000 to 2019) 2000: Microsoft's SLAM project starts. It ships as the Static Driver Verifier in the Windows driver kit. 2001-02: Separation logic (Reynolds, O'Hearn, Yang) makes pointer-heavy code provable. 2002: ESC/Java. Spec# (2004) and the Boogie verifier (2005) follow at Microsoft Research. 2003: Astrée proves the Airbus A340's primary flight control software free of run-time errors. 2004: CBMC, bounded model checking for C. 2005: Georges Gonthier finishes a Coq proof of the four color theorem. 2006: CompCert, a C compiler proved correct in Coq (Xavier Leroy). Event-B gets its Rodin toolset around the same time. 2007: Agda 2. Idris first appears (Edwin Brady). 2008: Z3 SMT solver (Microsoft Research). Frama-C. VeriFast. 2009: Dafny (Rustan Leino). seL4, the first general-purpose OS kernel with a machine-checked proof that its C code matches its spec. 2010: Why3. 2011: F*. 2012: A Coq proof of the Feit-Thompson odd order theorem is completed. 2013: Lean (Leonardo de Moura, Microsoft Research). P language at Microsoft. 2014: CakeML, a verified ML compiler. Liquid Haskell. Flyspeck finishes a formal proof of the Kepler conjecture. 2014-15: AWS reports TLA+ found bugs in S3 and DynamoDB that testing missed. IronFleet proves distributed systems correct in Dafny. 2015: Iris, a separation logic framework in Coq. Facebook open-sources Infer. 2016: Project Everest starts, aiming for a verified HTTPS stack. Viper. 2017: HACL*, verified crypto written in F*, ships in Firefox 57. Lean's mathlib starts. 2018: AWS Zelkova checks IAM and S3 policies with SMT solvers. 2019: Fiat Cryptography's Coq-generated code lands in BoringSSL, used by Chrome. Prusti for Rust. LLMS MEET PROOF CHECKERS (2020 to 2025) 2020: OpenAI's GPT-f finds shorter Metamath proofs that get accepted into the main library, a first for deep learning. 2021: Lean 4. 2022: Kani (AWS) and Creusot for Rust. Aeneas translates Rust into Lean. The Liquid Tensor Experiment finishes the Lean proof Peter Scholze asked for. 2023: Verus for Rust. AWS releases Cedar, a policy language built with proofs in Dafny and later Lean. LeanDojo gives models a programmatic interface to Lean. Terence Tao's team formalizes the PFR conjecture proof in Lean in three weeks. July 2024: DeepMind's AlphaProof reaches IMO silver-medal standard with proofs in Lean. Sept 2024: Quint 1.0, TLA+ ideas with ordinary programming syntax. Mar 2025: Imandra launches CodeLogician, an agent that turns code into its IML logic and checks it. Apr 2025: AWS publishes how it rewrote its authorization engine, called a billion times per second, in Dafny with proofs. July 2025: Harmonic's Aristotle reaches IMO gold-medal level with formal Lean proofs. Sept 2025: The vericoding benchmark tests LLMs writing verified code from 12,504 specs. Off-the-shelf models pass 82% in Dafny, 44% in Verus, 27% in Lean. LANGUAGES BUILT FOR AGENTS (2026) Feb 22, 2026: Vera. "A programming language designed for LLMs to write, not humans." Feb 25, 2026: Vow. "A Programming Language for Agentic Coding." Mar 9, 2026: Kōdo. "Designed for AI agents to write." Z3-checked contracts, JSON errors with patches. Sept 17, 2026: Bend 2. Dependent types and Lean-style proofs, C-like speed, CPU and GPU parallelism, Python-like syntax. WHAT EACH LANGUAGE IS GOOD FOR Specs and models Z: precise requirements docs. Little tooling today. VDM, B, Event-B: refining a spec step by step into code. Railways and safety-critical control. CSP (with the FDR checker): concurrent protocols. Petri nets: workflows and concurrent processes. TLA+ and Quint: distributed system designs, consensus, race conditions before you write code. Checks the design, not the code. Alloy: fast counterexamples in data models and access rules. Bounded, so finding no counterexample isn't a proof. P: modeling and testing event-driven distributed services at AWS and Microsoft. Model checkers SPIN: concurrency protocols, as abstract models. NuSMV and other SMV descendants: hardware and finite-state control logic. CBMC: bounded checking of C code. Kani: bounded checking of Rust, including unsafe code. Static analysis Astrée: proving embedded C has no run-time errors. Avionics. Static Driver Verifier: Windows drivers using kernel APIs correctly. Infer: memory and null bugs across large codebases. Proof assistants ACL2: hardware and microcode. HOL4, HOL Light: hardware and floating-point proofs. Isabelle/HOL: seL4-scale systems proofs, strong automation. Rocq: verified compilers (CompCert), crypto (Fiat), big math proofs. Slow and hard to learn. PVS: aerospace, much of NASA's formal methods work. Agda: type theory research and teaching. Lean 4: math (mathlib) and AI theorem proving. Hardest of the big three for LLMs off the shelf (27%). Mizar, Metamath: large formal math libraries with simple checkers. Verifying real code SPARK: avionics, defense, rail. Dafny: verified business logic, compiles to C#, Java, Go, Python, JS. AWS uses it for its authorization engine. Easiest for LLMs off the shelf (82%). F*: verified crypto (HACL*, in Firefox and the Linux kernel). Frama-C, Why3: C in safety-critical settings. KeY, JML: Java. VeriFast, Viper: separation-logic proofs about heap-heavy code. Liquid Haskell: proofs added to existing Haskell. Idris: general-purpose programming with dependent types. Verus, Prusti, Creusot, Aeneas: proofs about Rust code. WHY IT NEVER SCALED Formal methods worked. They didn't scale, because a person had to write every proof. Back to seL4. Its 8,700 lines of C needed roughly 200,000 lines of Isabelle proof, more than 20 lines of proof per line of code. IronFleet's verified distributed systems took 3.7 person-years, including inventing the method. So formal methods stayed where a bug costs more than the proof: flight control, railways, crypto, kernels, cloud authorization. Agents change that math. The proof is the tedious part, and an agent will grind on it all night. You also don't have to trust the agent, because the verifier accepts the proof or rejects it. What stays human is the spec. A green proof of the wrong spec is still wrong, so that's where your review time goes. WHERE I'D START I would start with the Verus formal language. The agent is the new part, so I'd pair it with a verifier that isn't. For agents writing verified code. It checks ordinary Rust against specs and proofs written in Rust, then erases them before compiling, so what you prove is what ships. It has peer-reviewed results since 2023, real systems built on it (Kubernetes controllers, OS kernel, etc), and use at Microsoft and Amazon. For other jobs: - Checking a distributed design: TLA+ - Math: Lean - Bend 2, Vera, Vow and Kōdo: worth watching, still very early though. Follow me for more on verification and agentic engineering.
Show more
How to become a quant from 0 to $650k/year (PLAYBOOK): by the end, you'll know how to: - build the exact math foundation top firms actually test - ship real projects that separate you from every other applicant - land your first credential and use it to climb the staircase - crack interviews at Citadel, Jane Street and prop shops btw i was quantitative backend developer at Liquid Hedge Fund based in Dubai for almost a year, building systematic trading strategies across perp dexes and prediction markets (right now on a break, working on my own projects) everything below is what actually got me here, in the order it actually worked here's the full 5-stage roadmap: --------------- Stage 1 (year 0): build the math foundation in the correct order the biggest mistake is starting with finance textbooks or trading blogs you don't need to know markets. you need to know math that markets run on how to build it: > probability first - Blitzstein & Hwang, free PDF from Harvard. chapters 1 to 6. conditional thinking is the entire skill > statistics second - Wasserman, All of Statistics. how to tell signal from noise > linear algebra third - Strang MIT 18.06, free at > OpenCourseWare. eigenvalues reveal what actually matters > convex optimization fourth - Boyd & Vandenberghe, free from Stanford. every portfolio problem reduces to this > stochastic calculus last - Shreve Vol 1 and 2. this is where Black-Scholes comes from your first year should feel painful, slow, non-linear most people quit here. that's why the field pays what it pays metric to watch: can you derive Ito's Lemma from scratch on a whiteboard? mistake to avoid: skipping layers because they feel abstract --------------- Stage 2 (year 1): read the papers and implement each one from scratch this is where I separated from every other backend developer trying to get in the 5 papers that shaped every quant desk on Wall Street: > Avellaneda & Stoikov 2008 (market making) > Engle & Granger 1987 (cointegration) > Heston 1993 (stochastic volatility) > Fama & French 2015 (five-factor model) > Cohen, Malloy, Pomorski 2012 (insider clusters) read all five. twice. then implement each from scratch in Python. no frameworks language stack that actually ships: > Python for research, backtesting and 90% of quant work. pandas, polars, pytorch, cvxpy, statsmodels > Rust for new systematic infrastructure. this is what Hyperliquid, prediction market engines, and next-gen HFT stacks are built in > Go for execution infrastructure. broker connectivity, microservices, low-latency APIs > C++ only if you're targeting elite HFT engineering. Jane Street uses OCaml specifically for their trading stack the mistake most self-taught quants make is picking one language and defending it, real desks run POLYGOT. Python for research, Rust or Go for execution what this gave me: 1: real understanding of how each model breaks 2: code on GitHub that recruiters actually respected 3: the ability to explain any of these in an interview without notes Heston was the one that changed my thinking. once I understood why volatility itself follows a stochastic process, options started making sense metric to watch: can you code Heston from a blank file in under 4 hours? mistake to avoid: reading 20 papers superficially instead of 5 deeply (VERY IMP) --------------- Stage 3 (year 2): ship 6 real projects with working backtests this is where most aspiring quants die silently the 6 projects that will land your first interview: > pairs trading bot on 5 cointegrated equity pairs > options pricing engine with Heston implementation > Fama-French factor decomposition scanner > insider cluster detector using SEC EDGAR > mean reversion scanner for S&P 500 > cross-exchange arbitrage scanner for perp DEXs every project needed: - clean GitHub repo with a proper README - working backtest with real historical data - honest documentation of what failed and why - one paragraph explaining the math in plain English the honest documentation is what actually got me noticed. I wrote a section called "what broke" in every README. two recruiters told me later that was the reason they DM'd me metric to watch: how many recruiters DM you after posting these mistake to avoid: hiding the projects where the math didn't work --------------- Stage 4 (year 3): first credential and the interview grind credential path (what worked for me): > cold emailed 40 PhD students. 3 responded. 1 took me on > TA'd a quantitative finance course at a local university > contributed to open-source quant libraries on GitHub > the title didn't matter. having real technical work to talk about mattered interview prep: - the Green Book (Xinfeng Zhou). 200 real interview problems. spend 15 minutes attempting each before looking at hints - QuantGuide(dot)io for probability puzzles at interview difficulty - Brainstellar for brain teasers - Zetamac for mental math. target 50+ correct per minute before applying - LeetCode Blind 75 with focus on dynamic programming the interview is a filter. it's not testing your knowledge, it's testing how you think under pressure with incomplete information metric to watch: how quickly you can solve fresh problems out loud mistake to avoid: memorizing solutions instead of understanding patterns --------------- Stage 5 (year 3-4): compete publicly and climb the staircase organic applications alone hit a ceiling. now you layer public competitions: > Jane Street Kaggle ($100K prize + direct recruiter visibility) > WorldQuant BRAIN (paid alpha signals + institutional pipeline) > Citadel Datathon (winners fast-tracked to interview rounds) the staircase (this is the part nobody tells you): 1: research lab or startup first 2: mid-tier prop shop second 3: elite fund like Citadel, Jane Street, or Two Sigma third nobody jumps directly from zero to Jane Street. everyone climbs attempting the vertical jump and failing doesn't mean the field is closed. it means you tried to skip stairs metric to watch: interview conversion rate at each tier mistake to avoid: applying to elite firms first, getting rejected and giving up --------------- CONCLUSION most aspiring quants die between the math foundation and the first credential because they think they need one more course, one more book, one more year the truth is: the first 3 stages are slow, painful and non-linear but they build the foundation that makes stages 4 and 5 feel like gravity start with probability. read the 5 papers. ship 6 projects. then apply no MIT. no Stanford. no finance degree required Citadel entry level pays $336K to $642K. Jane Street average $1.4M. 5-year top prop $800K to $1.2M the information asymmetry keeping most people out isn't intelligence. it's not knowing what the path looks like. COMPLETE SUMMARY BELOW:
Show more
A new Supercharger is coming soon to Ocala, Florida!! Site plan permits have been filed for a 16-stall V4 PSU station at the Cracker Barrel on SW 17th Ct, located directly off Interstate 75 at the exit for SW Hwy 484. The site will include 1 pull-through trailer stall.
Show more
A new EVIO Supercharger station is coming soon to Ocala, Florida. Permits were recently filed for an 8-stall V4 station at Six Gun Plaza on Silver Springs Blvd. The site is located on the east side of the city, near the unincorporated community of Silver Springs.
Show more
Introducing the Four Horsemen of the Digital Credit-ocalypse: 1⃣ srUSDat for those on the fence 2⃣ USDat for point maxis 3⃣ sUSDat for $STRC maxis 4⃣ jrUSDat for leveraged $STRC maxis Choose your fighter 😋 @saturn_credit @strata_markets
Show more
Love, blooming in a sunflower field.