Announcing development of a Nim language implementation

I’ve begun work on an implementation of Dhall in the Nim langauge. Nim is an imperative language that compiles to C and a few other C-like languages. I would say the implementation is half-complete, or at least complete enough that anyone interesting in Nim should wait rather than start their own implementation.

https://git.sr.ht/~ehmry/dhall-nim/tree/staging

There purpose of creating a new implementation rather than use an existing one is to hopefully support performant functional-reactive-configuration. As far as I can tell the current bottleneck is backtracking in the PEG parser, but I should avoid focusing on optimization until I can fulfill the spec.

I looked at dhall-go quite a bit in the early stages, so thanks again to @philandstuff for providing an easy to read implementation.

I will announce again when the implementation is at least β-conformant.

7 Likes

Awesome work! I’m still new to Nim, but would this allow us to create C or JavaScript bindings for Dhall?

1 Like

I haven’t used C bindings to Nim before, but if you are okay with bringing the garbage collector along, it should work. Though one would need to write some sort of native C interface to the library.

Compiling to JavaScript fails at the moment because of the HTTP client library used for imports, but I think that could be fixed by disabling imports or re-implementating them for JS.

2 Likes