Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Elm AST #6

Closed
DamianReeves opened this issue Nov 14, 2019 · 4 comments
Closed

Elm AST #6

DamianReeves opened this issue Nov 14, 2019 · 4 comments

Comments

@DamianReeves
Copy link

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.

@wooorm
Copy link
Member

wooorm commented Nov 14, 2019

Awesome, yeah great idea! Want to work on this?

@DamianReeves
Copy link
Author

Would love to. Where/how do I get started?

@wooorm
Copy link
Member

wooorm commented Nov 14, 2019

Something like this?

  1. Do you have a parser? Make sure it has positional info (has info on where things originated from)
  2. Get a syntax tree format going. As in, a clone of mdast, for elm
  3. Write something to convert the result of the parser to your Elm AST ($parsername-to-east)
  4. Figure out how to get that Elm AST into a string (east-to-string)
  5. Create the wrapper of the unified ecosystem (as in, a clone of the rehype project)

@ChristianMurphy
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants