Extending OCaml programs with Lua (soupault got plugin support)
CRANK

Published: Sat 10 August 2019In Programming languages.tags: ocamlMost of the time, when people make extensible programs in typed functional languages, they make a DSL, not least because it's much easier to make a DSL in a language with algebraic types and pattern matching than in one without.Some use cases really require a general-purpose language though. That's where things get more interesting. Commonly used embeddable interpreters such as Lua, Guile, or Chicken are written in C. It's possible to make OCaml or Haskell bindings for them and such bindings do exist, but that's two high level languages communicating through a low level one.It would be much better to be able to expose native types to the embedded language in a type-safe and more or less convenient fashion. Here's my take at it.The use case: soupault website generatorSoupault is a website generator based on HTML rewriting instead of template processing. I made it for my own website out of conceptual disagreement with the…

blog.baturin.org
Related Topics: Lua OCaml Access analysis