DataTypeTool #
Describe datatypes in one or more ".type" file, then create appropriate datatypes for (eventually) any language.
Still a work-in-progress, but there's (very early) results! This is open to collaboration, so if you would like to see {{insert_language+version_here}} faster than I can get around to it, feel free to take a swing at it. Once we get to a more feature-complete state and actually make this open to distribution, I'll keep track of actual changes with a CHANGELOG.md and versioning.
Inside exampleProject/ (an example project root directory), there's a datatypetool.toml file. There are also test .type files inside exampleProject/types/. Some basic language scripts are there to do basic testing on types generated from exampleProject/types/Test_File.type, based on the JSON in exampleProject/test.json
There's also some basic (and hopefully undestandable) documentation in docs/.
More languages and functionality to come soon!
What you need to use this, at the moment: #
- Nix is probably a good idea, then you can use what's in the nix-shell.
- Just is optional, but very helpful. Also in the nix-shell if you get in there.
- I will be referencing this project's
justcommands here, so if you omit this, you may need to look inside thejustfileto run each command-suite individually.
- I will be referencing this project's
- If non-nix, GHC: 9.8.2, HLS: 2.7.0.0, cabal 3.10.2.1 from GHCup is what I have locally. Cabal will fetch the dependencies when it builds.
- Do regular git-clone+cd stuff, then:
just shell(akanix-shell --pure --show-trace)just run --toml exampleProject/datatypetool.toml(to generate files based on whats inexampleProject/types/)just format(to format files for keeping things tidy)justwith no arguments orjust helpwill list the available commands. Right now there's only 4, and this runs one of them. The other three are listed above.- Language based stuff (Toml configs, language writers, etc.) are found in
app/Lang/. Just follow whats there, keep things organized. *.typefile parser stuff is found inapp/Parsing/datatypetool.tomlparser stuff is found inapp/Config, except dedicated language settings, which are found inapp/Lang/**/{{Config / Toml}}.hsapp/Cli.hshas the command line parser (as one might expect)app/Instances.hsis for doing funky Haskell instance declarations on special cases.app/Common/is for general-purpose functions that could be used anywhere. Files in this directory should try to not import files outside of here, to prevent import loops.