yaml / yamlscript

Programming in YAML
MIT License
358 stars 31 forks source link

Macro system for YAMLScript (defys) #134

Open ingydotnet opened 2 weeks ago

ingydotnet commented 2 weeks ago

The YAMLScript compiler currently does a lot of special things mixed in with its core set of transformations.

The proposed defys system allows these special things to be plain hooks into a given compilation stage.

We want to expose the defys system to users who want to make their own localized sub-DSLs in YS.

This fits the Lisp concept of Macros. Things that let you make your code look more the way you want, when the basic syntax feels clumsy.

But this happens in the YS compiler transformation from YAML to Clojure.

The Clojure defmacro system is, of course, still supported. It's just at another level.