Software Alternatives & Reviews

Simple JSON parser in c++, rust, ocaml, standard ml

Poly/ML OCaml MLton
  1. The Poly/ML implementation of Standard ML – full multiprocessor support in the thread library and garbage collector, interactive debugger, fast compiler.
    Pricing:
    • Open Source
    Once I got the parser ready in OCaml, I thought I port it to Standard ML, since it belong to the same ML language family. I was also curious on how well mlton could optimise it. The language lacks custom let bindings, so I resorted to use Result.bind manually. This makes code much less readable and more verbose. The standard library also lacks result type, so I had to come up with my own simple implementation. There's also a lack of any hash map in the standard library, so I just used a list of key-value pairs. This isn't correct, but it's the closest I could get without inventing my own hash map. MLton's compile times are slow. It also lacks interactive REPL. Because of that I used alternative Standard ML implementation for interactive usage: PolyML. Debugging MLton binaries is also pretty hard. Gdb doesn't work and there's no bundled debugger. I had to resort to debugging facilities built into PolyML. Valgrind doesn't work with mlton binaries, as it doesn't report any memory allocations. Looks like mlton uses mmap for allocation memory. Surprisingly, performance is not the best. This might be due to heavy usage of my custom Result type and bind calls. Exceptions seem to be a more natural choice for error reporting in Standard ML. I tried to make such a change, but this didn't improve the performance much.

    #Programming Language #OOP #Generic Programming Language 2 social mentions

  2. 2
    (* Binary tree with leaves carrying an integer.
    Pricing:
    • Open Source

    #Programming Language #OOP #Generic Programming Language 30 social mentions

  3. 3
    MLton is an open-source, whole-program, optimizing Standard ML compiler
    Pricing:
    • Open Source
    Once I got the parser ready in OCaml, I thought I port it to Standard ML, since it belong to the same ML language family. I was also curious on how well mlton could optimise it. The language lacks custom let bindings, so I resorted to use Result.bind manually. This makes code much less readable and more verbose. The standard library also lacks result type, so I had to come up with my own simple implementation. There's also a lack of any hash map in the standard library, so I just used a list of key-value pairs. This isn't correct, but it's the closest I could get without inventing my own hash map. MLton's compile times are slow. It also lacks interactive REPL. Because of that I used alternative Standard ML implementation for interactive usage: PolyML. Debugging MLton binaries is also pretty hard. Gdb doesn't work and there's no bundled debugger. I had to resort to debugging facilities built into PolyML. Valgrind doesn't work with mlton binaries, as it doesn't report any memory allocations. Looks like mlton uses mmap for allocation memory. Surprisingly, performance is not the best. This might be due to heavy usage of my custom Result type and bind calls. Exceptions seem to be a more natural choice for error reporting in Standard ML. I tried to make such a change, but this didn't improve the performance much.

    #Programming Language #OOP #Generic Programming Language 5 social mentions

Discuss: Simple JSON parser in c++, rust, ocaml, standard ml

Log in or Post with