Skip to content

Commit

Permalink
note about optimizing "active" components of optimized expansions
Browse files Browse the repository at this point in the history
  • Loading branch information
countvajhula committed Sep 16, 2022
1 parent 580ce17 commit 98222a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qi-lib/flow/core/compiler.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#`(qi0->racket #,(optimize-flow stx)))

(define (optimization-pass stx)
;; TODO: the "active" components of the expansions should be
;; optimized, i.e. they should be wrapped with a recursive
;; call to the optimizer
(syntax-parse stx
;; restorative optimization for "all"
[((~datum ~>) ((~datum ><) onex) (~datum AND))
Expand All @@ -30,7 +33,7 @@
#'(~> _0 ... (>< (~> g (if f _ ⏚))) _1 ...)]
;; merge amps in sequence
[((~datum ~>) _0 ... ((~datum ><) f) ((~datum ><) g) _1 ...)
#'(~> _0 ... (>< (~> f g)) _1 ...)] ; TODO: optimizing the inner flow?
#`(~> _0 ... #,(optimization-pass #'(>< (~> f g))) _1 ...)]
;; merge pass filters in sequence
[((~datum ~>) _0 ... ((~datum pass) f) ((~datum pass) g) _1 ...)
#'(~> _0 ... (pass (and f g)) _1 ...)]
Expand Down

0 comments on commit 98222a5

Please sign in to comment.