I am looking for a language that mixes data description (a la YAML or JSON) with basic scripting capabilities (e.g. variables, conditional expressions, callback functions). Something that describes a hierarchical structure of lists & maps like YAML, but where the leaf values are functions rather than literal data.
Up until now I've been approaching this by adding expression logic on top of YAML. This lets me build on existing parsers, but it also leads to really awkward syntax and I have to implement the compiler/interpreter aspect of it myself. I don't think I'm competent to do that.
An alternative is to adopt some subset of an existing language so that I can build off a real compiler. Sadly I'm not well versed in any functional programming languages. I honestly don't know where to start with this.
Can anyone suggest a functional language that has some or all of these properties:
compact syntax for expressing hierarchical lists and maps
pure functional
lexical scoping
no OOP (using maps rather than static compound types)
first class functions (primary data structures will be lists/maps of functions)
type inference
compilable from an AST (if I have to write my own parser)
compilable to JVM bytecode (it would make my life a lot easier)
Scala is an obvious choice since it targets the JVM, but for all I know there might be something out there closer to what I need. Any suggestions?
Clojure is the best fit.
I think it is a better fit than Scala for these reasons:
This is an interesting use case. It sounds a bit like Common Workflow Language which is described in YAML and is used to construct computation graphs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With