jaredramirez / border-types

A tool to keep you types in syncs across your stack
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Overall "How will this work" #3

Open jaredramirez opened 6 years ago

jaredramirez commented 6 years ago

I need to do more learning about how to generate the types in Elm and the host languages, and what approaches exist. I'm assuming we'd use ASTs. To my understanding, it is basically a parser and programmatic representation of a programming language data.

Elm ASTs:

Typescript ASTs:

Reason ASTs:

jaredramirez commented 6 years ago

Another thing to consider is what tooling already exists to parse the config file that we will use (assuming we use a config file, see https://github.com/jaredramirez/border-types/issues/2). My preference is to use a JSON config file, for this reason. Regardless, I did some quick searching to see what libraries I could find, and here are the results:

JSON parsing:

YAML parsing:

jaredramirez commented 6 years ago

Since I have decided on using Haskell for this project (see https://github.com/jaredramirez/border-types/issues/1), we will most likely use the existing elm AST and have to write our own for both Reason & Typescript.

Additionally, I will go with JSON Schema for the config file (we are generating types from a config file, see https://github.com/jaredramirez/border-types/issues/2) since the target audience is people coming from JS/TS/Reason, all of which use JSON as config files through the tooling in each ecosystem.

That being said, the first milestones of this project will be: