1. 22
  1.  

  2. 3

    This was quite and interesting reading!

    It would be interesting to see also an example that deals with more complex ocaml structures, like records containing strings, bytes, and (why not) arrays or lists. Or maybe a GADT. Although I think it would just make the plumbing More complex but be not much more than what you do writing the usual C bindings

    1. 5

      I would love to see a language like OCaml (or another ML like dialect) to be able to make use of Rust’s emerging ecosystem, but I’m afraid we’re still a long way from seeing that happen. Also check out Gluon http://gluon-lang.org/ for an ML like language embedded in Rust (personally I’d prefer a standalone language that works with Rust though).

      1. 2

        I’m a little confused. Outside of being developed in Rust what makes gluon “embedded in Rust” vs a “standalone language”? It appears that while gluon is heavily influenced by Rust it can, and does, function as a standalone language as well if you wanted it to. Which, as they point out, is similar to lua.

        I feel like embedded in the context of gluon only applies to their goal of being easy to embed as opposed to being embedded itself.

        1. 2

          I agree that it ‘can’ function as a standalone language as well. But I am not sure if I agree it currently does, AFAIK you can’t create a gluon ‘script’ that runs with #!/usr/bin/env gluon and neither can you compile a gluon source to a binary without embedding it first in a Rust application. I am also unsure whether you can write a gluon module using rust and then import it from your ‘standalone’ gluon program.

          So I disagree that embedded in the context of gluon only applies to their goal of being easy to embed as opposed to being embedded itself.

          But I do realize my criticism might be easily solved (although I have some doubts about the ‘write a gluon module using rust and then import it from your standalone gluon program’ part).

          Please correct me where I am wrong, I’m fairly new to both Rust and Gluon.

          1. 1

            I’m fairly new to both Rust and Gluon.

            Ditto. Thanks for clarification.

    2. 2

      interesting! i have a (backburnered) project trying to write libraries in ocaml and call them from racket; this should be very helpful.