rise-lang / shine

The Shine compiler for the RISE language
https://rise-lang.org
MIT License
73 stars 8 forks source link

[FEATURE REQUEST] Grammar for the "internal representation" and other tips and tricks for targetting RISE #239

Open Mikolaj opened 7 months ago

Mikolaj commented 7 months ago

Hi! I'd like to translate expressions from https://github.com/Mikolaj/horde-ad to RISE, simplify them and translate them back.

  1. Is it a good idea to translate to a text representation of the "internal representation of the high-level program" from the https://rise-lang.org/doc/tutorial?
  2. If so, is there a grammar for the language, e.g., is Fig 3 and 4 from https://michel.steuwer.info/files/publications/2017/arXiv-2017.pdf close enough?
  3. Would you have any other tips and tricks for the translation?
  4. How to call a RISE parser and type-checker on the text of the translated code?
  5. For a start, is there a default optimization strategy I can use before I start writing my own?
  6. Is toExpr the right way to pretty-print an optimized program so that I can parse it back into my library?
  7. Any tips for running RISE just as a tool (without an IDE)?

Thank you in advance!