The first feature that originated in this fork to be upstreamed is labeled tuples, which will be in OCaml 5.4: https://github.com/ocaml/ocaml/pull/13498 https://discuss.ocaml.org/t/first-alpha-release-of-ocaml-5-4...
> Because sum:int * product:int is a different type from product:int * sum:int, the use of a labeled tuple in this example prevents us from accidentally returning the pair in the wrong order, or mixing up the order of the initial values. Hmm, I think I like F#'s anonymous records better than this. For example, {| product = 6; sum = 5 |}. The order of the fields doesn't matter, since the value is not a tuple.
OxCaml - a set of extensions to the OCaml programming language.
41–50 of 128 posts
Re: OxCaml - a set of extensions to the OCaml programming language.
#42The first feature that originated in this fork to be upstreamed is labeled tuples, which will be in OCaml 5.4: https://github.com/ocaml/ocaml/pull/13498 https://discuss.ocaml.org/t/first-alpha-release-of-ocaml-5-4...
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}
(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 distinguish the named fields from the positional ones. I don't love the syntax, but it's consistent with function parameter lists where the curly braces delimit the named parameters.Re: OxCaml - a set of extensions to the OCaml programming language.
#43Re: OxCaml - a set of extensions to the OCaml programming language.
#44So this is "oxidized" because it tries to achieve the same features as Rust (e.g. "fearless concurrency" is mentioned, and avoiding GC)... Not because it actually uses Rust in any way right? Slightly confusing.
Re: OxCaml - a set of extensions to the OCaml programming language.
#45Earlier quoted context omitted.
> Because sum:int * product:int is a different type from product:int * sum:int, the use of a labeled tuple in this example prevents us from accidentally returning the pair in the wrong order, or mixing up the order of the initial values. Hmm, I think I like F#'s anonymous records better than this. For example, {| product = 6; sum = 5 |}. The order of the fields doesn't matter, since the value is not a tuple.
Isn't that just the same as the ordinary OCaml { product = 6; sum = 5 } (with a very slightly different syntax)?
Re: OxCaml - a set of extensions to the OCaml programming language.
#46Re: OxCaml - a set of extensions to the OCaml programming language.
#47Re: OxCaml - a set of extensions to the OCaml programming language.
#48Earlier quoted context omitted.
Yeah, this would be great! Currently only 128-bit SSE/NEON is working but AVX is coming very soon. There's also nothing blocking Windows, but it will require some work. (I added the SIMD support in OxCaml)
Cool to hear there aren't any technical blockers to add Windows support! You just convinced me into giving OxCaml a try for a hobby project. 128-bit SSE is likely to be enough for my use case and target specs.
Re: OxCaml - a set of extensions to the OCaml programming language.
#49Re: OxCaml - a set of extensions to the OCaml programming language.
#50Earlier quoted context omitted.
Is that really a viable solution for a timeframe of 6+ hours?
Sure, if you know how much you allocate per minute (and don’t exceed your budget) you just buy enough RAM and it’s fine.