-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: "Text-TT" textual s-expression format for compiled expressions #286
base: master
Are you sure you want to change the base?
Conversation
cc @edwinb |
This looks very interesting, thanks! I was wondering if the named should refer to TT more than idris, especially as you are going from TT rather than Idris. |
Oh, I see what you're saying, that is probably the better way to go! If you have an alternative name that references TT instead of Idris, feel free to suggest it and I'll change it in the source. (I was thinking of it as "Idris Core" by analogy to GHC Core.) |
Funnily enough that is the correct analogy you are going for, and fortunately for Idris the core already has a name: TT. I am not one for catchy names, so I would tend to go for informative ones to denote that it is TT but expressed using s-expression. Some examples: Textual-TT and TT-SExpr. These would be sufficient IMHO. TT-sExpressed if you want something interesting. |
Thanks for the suggestions, I'll keep them in mind! (Text-TT sounds funnily similar to |
This has to be cleaned up a bit before it's ready for merging. I'm open to any and all bikeshedding about the "Coredris" name or the actual sexp syntax (like the
^
sigil, or any naming for the^foo
forms or the:tags
in them).I am however convinced that the tag-based format is going to make it parser-friendly for anyone consuming the Coredris format, especially since every tag should correspond to a field of a record/struct in the consumer's AST format.
Questions
is the type information I obtained manually actually of any use considering all any backend using this will do is simply pass around some kind of Any type (edit: types removedIdrisVal
etc) and cast to expected types at primop application sites?Output examples
Here's a simple primop wrapper:
and here is a slightly more involved example, with linebreaks manually inserted: