We probably want a second transformation step after "normalization" (where macros are run), where we translate the AST into something easier to code-gen. Alternatively, code-gen can call the appropriate compile[type] sub- command for things expected to be arrays. ^ This might work well because we'd ideally like to have array literals be arrays as well, so that compile-time constant array literals can be accessed/returned by macros. -------------- I think we should get rid of the rewrite step, since it only affects variables, and interleave it with the codegen step, since it's basically translating aletheia symbols into javascript symbols. if not, we should move comparison translations: "==" -> "===" into the rewrite step (not a bad idea) We need to figure out how to handle macros. I.e. #if false [ #console.log "hi" ] We need to make sure things inside lambdas aren't? evaluated at compile time until the macro returns. This is sort of weird, because in #if #testvar == 5 [ #console.log "hi" ] We need to evaluate #testvar before #if, but `#console.log "hi"` after #if, only if #if returns that (or such a lambda).