Tensegritics / ClojureDart

Clojure dialect for Flutter and Dart
1.44k stars 91 forks source link

Add a "nano pass" to the compiler to perform statements lifting #288

Open cgrand opened 1 year ago

cgrand commented 1 year ago

Lifting statements out of expressions is a concern through all the compiler emit-* functions.

I propose we extract that concern into a distinct pass.

Currently we have

text -(reader)-> clj forms -(emit)-> dart-sexp -(write)-> dart text

where dart-sexp is our internal representation of the subset of dart we target.

With this proposal we would have

text -(reader)-> clj forms -(emit)-> dart-sexp -(lift)-> dart-sexp -(write)-> dart text

After lift the dart sexp representation would be guaranteed to be properly lifted and thus writeable.