Tensegritics / ClojureDart

Clojure dialect for Flutter and Dart
1.41k stars 90 forks source link

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

Open cgrand opened 10 months ago

cgrand commented 10 months 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.