The Janet Street folks, who created this, also did an interesting episode[0] of their podcast where they discuss performance considerations when working with OCaml. What I was curious about was applying a GC language to a use case that must have extremely low latency. It seems like an important consideration, as a GC pause in the middle of high-frequency trading could be problematic. [0] https://signalsandthreads.com…
Haven't looked at the link, but I think for a scenario like trading where there are market open and close times, you can just disable the GC, and restart the program after market close.
OxCaml - a set of extensions to the OCaml programming language.
51–60 of 128 posts
Re: OxCaml - a set of extensions to the OCaml programming language.
#52Re: OxCaml - a set of extensions to the OCaml programming language.
#53Earlier quoted context omitted.
You just let the garbage accumulate and collect it whenever markets are closed. In most cases, whenever you need ultra low latency in trading, you usually have very well defined time constraints (market open/close). Maybe it's different for markets that are always open (crypto?) but most HFT happens during regular market hours.
Is that really a viable solution for a timeframe of 6+ hours?
Re: OxCaml - a set of extensions to the OCaml programming language.
#54Re: OxCaml - a set of extensions to the OCaml programming language.
#55Earlier quoted context omitted.
Isn't that just the same as the ordinary OCaml { product = 6; sum = 5 } (with a very slightly different syntax)?
The difference between { … } and {| … |} is that the latter’s type is anonymous, so it doesn’t have to be declared ahead of time.
Re: OxCaml - a set of extensions to the OCaml programming language.
#56The sunk cost fallacy at Jane Street is strong.
Re: OxCaml - a set of extensions to the OCaml programming language.
#57Re: OxCaml - a set of extensions to the OCaml programming language.
#58Earlier quoted context omitted.
Is that really a viable solution for a timeframe of 6+ hours?
Yes. It is a very common design pattern within banks for systems that only need to run during market hours.
Re: OxCaml - a set of extensions to the OCaml programming language.
#59The sunk cost fallacy at Jane Street is strong.
Re: OxCaml - a set of extensions to the OCaml programming language.
#60Earlier quoted context omitted.
Anonymous labeled structs and enums are some of my top wished-for features in programming languages! For instance, in Rust you can define labelled and unlabelled (i.e. tuple) structs struct Foo(i32, i32); struct Bar{sum: i32, product: i32} But you can only e.g. return from functions an anonymous tuple, not an anonymous labelled struct fn can() -> (i32, i32) fn cant() -> {sum: i32, product: i32}
In Dart, we merged tuples and records into a single construct. A record can have positional fields, named fields, or both. A record type can appear anywhere a type annotation is allowed. So in Dart these are both fine: (int, int) can() => (1, 2); ({int sum, int product}) alsoCan() => (sum: 1, product: 2); (int, {int remainder}) evenThis() => (1, remainder: 2); The curly braces in the record type annotation distinguis…
Like how do you write the type of (1, {sum:2}) ? Is it different from (1 , sum :2)?