Elm AST
DamianReeves opened this issue · 4 comments
Subject of the feature
Elm is a wonderful functional programming language.
We have found that Elm is a wonderful way to model business domains, in the spirit of Domain Modeling Made Functional.
I propose the addition of an Elm AST to unist.
This would allow to develop macros and transpilation to other languages (i.e. F# or OCaml).
Expected behaviour
Using something like elm-syntax we should get a unist style elm syntax tree.
This means we don't need a parser.
Alternatives
I've undergone this process outside of the unified ecosystem, but the unified ecosystem offloads many concerns that would otherwise need to be addressed.
Awesome, yeah great idea! Want to work on this?
Would love to. Where/how do I get started?
Something like this?
- Do you have a parser? Make sure it has positional info (has info on where things originated from)
- Get a syntax tree format going. As in, a clone of mdast, for elm
- Write something to convert the result of the parser to your Elm AST ($parsername-to-east)
- Figure out how to get that Elm AST into a string (east-to-string)
- Create the wrapper of the unified ecosystem (as in, a clone of the rehype project)
Thanks for starting the discussion @DamianReeves!
We're in the process unifying ideas in with discussions unifiedjs/collective#44
If you'd like to continue this thread, or start a new one https://github.com/unifiedjs/unified/discussions will be the home for ideas going forward.