Live data from Hacker News

OxCaml - a set of extensions to the OCaml programming language.

oxcaml.org

1–10 of 128 posts

Re: OxCaml - a set of extensions to the OCaml programming language.

#5
If anyone's trying out the new opam switch, I found it helpful to use:

env OCAMLPARAM="alert=-unsafe_multidomain,_," opam install cohttp-lwt-unix

Because alerts are promoted to errors, they break existing package installs unnecessarily. The OCAMLPARAM environment variable just forces that alert to be disabled and allows the package installation to continue.

Re: OxCaml - a set of extensions to the OCaml programming language.

#6
post #3

So 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.

Correct, Jane Street has been publishing a series of blog posts titled "Oxidizing OCaml" for a while.

Re: OxCaml - a set of extensions to the OCaml programming language.

#7
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/performance-engineering-on-har...

Re: OxCaml - a set of extensions to the OCaml programming language.

#8

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...

Immutable arrays were ported from this fork as well, and merged for 5.4; although with different syntax I think.

Re: OxCaml - a set of extensions to the OCaml programming language.

#9

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...

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}

Re: OxCaml - a set of extensions to the OCaml programming language.

#10
post #9

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...

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}

Hmm. Let me first check that I've understood what you care about

    struct First(this: i8, that: i64)
    struct Second(this: i8, that: i8)
    struct Third(that: i64, this: i8)
    struct Fourth(this: i8, that: i64)
    struct Fifth(some: i8, other: i64)
You want First and Fourth as the same type, but Second and Third are different - how about Fifth?

I see that this is different from Rust's existing product types, in which First and Fourth are always different types.

Second though, can you give me some examples where I'd want this? I can't say I have ever wished I had this, but that might be a different experience.

Post reply on HN