Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Optimizations #76

Merged
merged 149 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
2a24203
add a restorative optimization for "all"
countvajhula Sep 16, 2022
7ba3ff1
simple cases of "deforestation" for values
countvajhula Sep 16, 2022
86dc145
basic optimization loop
countvajhula Sep 16, 2022
8696cf2
merge amps in sequence
countvajhula Sep 16, 2022
098e716
flatten nested compositions (associative law)
countvajhula Sep 16, 2022
f540e03
eliminate superfluous identity flows
countvajhula Sep 16, 2022
98559a5
incorporate various identities as optimizations
countvajhula Sep 16, 2022
2a4b4bd
add some comments
countvajhula Sep 16, 2022
d2a5bfd
merge `pass` filters in sequence by conjoining the predicates
countvajhula Sep 16, 2022
c6fbe1e
note a todo
countvajhula Sep 16, 2022
ea17feb
more comments
countvajhula Sep 16, 2022
71d7ec4
collapse deterministic conditionals
countvajhula Sep 16, 2022
d4a9651
note about optimizing "active" components of optimized expansions
countvajhula Sep 16, 2022
e452a8d
use core language words instead of symbols in optimizations
countvajhula Sep 28, 2022
1080bc9
don't optimize prisms where it expects a list input specifically
countvajhula Sep 29, 2022
83f28c9
rudimentary deforestation
countvajhula Sep 30, 2022
06c2d7a
remove invalid deforestation optimization (noted in CR)
countvajhula Oct 5, 2022
0c5b680
remove invalid optimization (CR)
countvajhula Oct 12, 2022
b29884a
add tests to check known counterexamples to seeming equivalences
countvajhula Oct 12, 2022
60be2a8
collapse singleton threading form
countvajhula Mar 1, 2023
ab173b2
Commit wip from today's meeting
countvajhula Aug 4, 2023
f948395
wip from today's meeting (ignition!)
countvajhula Aug 11, 2023
c698e26
implement filter-map using multiple values instead of allocated data
countvajhula Aug 11, 2023
b19783d
add version from ben with partially evaluated match, for completeness
countvajhula Aug 12, 2023
0351c39
add the hand-coded iteration (upper bound on performance)
countvajhula Aug 15, 2023
90ae5cc
add `range-map-sum` benchmark (used in St-Amour's writeup)
countvajhula Aug 18, 2023
191346c
minimally incorporate stream fusion into the compiler
countvajhula Aug 18, 2023
1b63193
restore restorative optimization that was accidentally dropped
countvajhula Aug 24, 2023
847fce1
test for the `filter-map` functional pipeline
countvajhula Aug 26, 2023
2240de1
use `racket -y` in running all tests to recompile if needed
countvajhula Aug 26, 2023
cb86eaa
fix stream fusion (from today's qi meeting)
countvajhula Aug 26, 2023
fdcd094
tidy - remove deforestation wip from benchmarking module
countvajhula Sep 1, 2023
ca94178
WIP from today's meeting
countvajhula Sep 2, 2023
91f2b46
use the much-anticipated syntax-spec-v1 from the package index :)
countvajhula Sep 2, 2023
8eb3dad
a couple more nonlocal testcases, using folds
countvajhula Sep 15, 2023
161bd26
add starter tests to validate compiler rewrite rules
countvajhula Sep 15, 2023
be0e6ed
benchmark for functional pipeline using foldr
countvajhula Sep 15, 2023
253e5fe
foldr fusable stream terminator
countvajhula Sep 16, 2023
7265eb9
WIP from today's meeting
countvajhula Sep 22, 2023
8fc8424
remove old unused deforestation code
countvajhula Sep 29, 2023
17c3bc5
Implement `foldl` as a stream
countvajhula Sep 30, 2023
7f67806
fix compiler tests by adding chirality
countvajhula Oct 1, 2023
9298580
consistent naming in rewrite rules
countvajhula Oct 5, 2023
f78af67
add a benchmark using `foldl`
countvajhula Oct 6, 2023
5a8785a
rename stream-related syntax classes for clarity
countvajhula Oct 7, 2023
6d2d258
Use macro-debugger-emit to see the process-bindings expansion step in…
dzoep Oct 7, 2023
15df450
Merge remote-tracking branch 'refs/remotes/origin-old/first-optimizat…
dzoep Oct 7, 2023
afd1f5f
Make fix procedure compatible with syntax-parse rules following the f…
dzoep Oct 7, 2023
60a81e7
Merge pull request #111 from dzoep/first-optimizations
countvajhula Oct 13, 2023
31f34bb
macros for emitting expansion events for the macro stepper
countvajhula Oct 14, 2023
4bb5622
Merge pull request #1 from drym-org/first-optimizations
dzoep Oct 20, 2023
577d415
Fix nonlocal tests (use right threading) for deforestation optimizati…
dzoep Oct 20, 2023
a12340d
Revert "Fix nonlocal tests (use right threading) for deforestation op…
dzoep Nov 5, 2023
f935c44
Fix the tests again.
dzoep Nov 5, 2023
c325624
Remove redundant inlining hint.
dzoep Nov 5, 2023
8f036e1
Preliminary fusion for no-argument range, supporting 1 or 2 values.
dzoep Nov 5, 2023
47c23cd
Support for multiple arguments to curry in producer syntax class.
dzoep Nov 5, 2023
f1925d7
Full support for range fusion.
dzoep Nov 5, 2023
3eb9e74
Finish stream fusion for producers, transformers, consumers and all t…
dzoep Nov 6, 2023
6e3b681
Merge pull request #112 from dzoep/first-optimizations
countvajhula Nov 10, 2023
9488686
Move the current deforestation (both syntax and implementation parts)…
dzoep Nov 11, 2023
bb59629
Fix missing requires (for ~literal matching), streamline procedures n…
dzoep Nov 11, 2023
6531cb5
Cleanup unused pattern variable, implement car deforestation.
dzoep Nov 11, 2023
9f0f940
Re-add begin-encourage-inline based on the benchmarks.
dzoep Nov 17, 2023
e5feb6f
Merge pull request #114 from dzoep/first-optimizations
countvajhula Nov 17, 2023
3378f0e
add `range-map` benchmark
countvajhula Nov 17, 2023
25ef195
fix compiler tests
countvajhula Nov 17, 2023
fc674ec
add a (failing) test for deforestation in nested positions
countvajhula Nov 17, 2023
e73be41
remove testing-related nesting in qi deforestation benchmark
countvajhula Nov 17, 2023
bb503de
validate that `range` deforestation doesn't harm performance
countvajhula Nov 17, 2023
4a7cd20
fix (most) compiler tests again
countvajhula Nov 17, 2023
5fc615b
remove outdated compiler rewrite rule
countvajhula Nov 18, 2023
693ebab
normalization rule to collapse `values` inside a threading form
countvajhula Nov 18, 2023
317173f
Add initial tests for the normalization pass
countvajhula Nov 18, 2023
429f93b
improve `range-map-sum` benchmark
countvajhula Nov 20, 2023
8fd4e2f
add a "long functional pipeline" benchmark
countvajhula Nov 20, 2023
e6db41c
remove unused code
countvajhula Nov 20, 2023
e3231ff
Replace `range-map` benchmark with `range-map-car`
countvajhula Nov 20, 2023
7b6f04e
failing unit test for range-map-car
countvajhula Nov 20, 2023
8b1c15e
Partial implementation of producer prepare contract.
dzoep Nov 20, 2023
2b347fa
Refactor normalize pass into its own module
countvajhula Nov 20, 2023
51faf39
note a todo for normalization, and remove an outdated comment
countvajhula Nov 20, 2023
708b29d
Fix car stream consumer, generate all possible contracts for range va…
dzoep Nov 21, 2023
44bf495
Merge pull request #115 from countvajhula/benchmarks-and-tests
countvajhula Nov 21, 2023
7e6370d
Merge branch 'drym-org:first-optimizations' into first-optimizations
dzoep Nov 22, 2023
cd0f855
Deforestation producers - currying prepare in the right order, contra…
dzoep Nov 22, 2023
7b24304
Preliminary implementation of consumer contracts with car as an example.
dzoep Nov 22, 2023
20bd38e
Unified range producer syntax class + currying contracted pipeline.
dzoep Nov 23, 2023
ac8ba9e
fusable-stream-producer: limit the number of arguments to range to 1 …
dzoep Nov 24, 2023
f938cb4
Merge pull request #117 from dzoep/first-optimizations
countvajhula Nov 24, 2023
fce8d11
move a simplification from the code generation step to normalization
countvajhula Nov 22, 2023
5988648
Simplify deforestation tests to high level assertions
countvajhula Nov 22, 2023
7a3ddbb
Handle a simplified host expression in the compiler
countvajhula Nov 26, 2023
8c64170
failing compiler tests for deforesting templates
countvajhula Nov 29, 2023
15b339d
Rewrite partial application to a use of a blanket template
countvajhula Nov 29, 2023
f07620f
A test to validate pre-supplying keyword arguments
countvajhula Nov 29, 2023
6efd559
remove unused import
countvajhula Nov 29, 2023
801f510
match blanket templates in transformers and consumers
countvajhula Nov 29, 2023
5609e15
Merge pull request #121 from countvajhula/reduce-chirality-to-templates
countvajhula Nov 29, 2023
b568e01
add a failing test to show an issue with bindings and currying
countvajhula Nov 29, 2023
47e3374
Add support for #%fine-template in deforested consumers.
dzoep Nov 25, 2023
a705fef
Add missing literal.
dzoep Nov 25, 2023
376372c
Matching _ as ~datum.
dzoep Nov 25, 2023
21050c1
deforestation range producer: fix currying with 3 arguments
dzoep Nov 26, 2023
914d5f6
deforestation error reporting: implement partial de-expander for flows
dzoep Nov 26, 2023
8898934
Currying for #%fine-template deforested producers.
dzoep Nov 27, 2023
d911906
Work on simplifying deforestation pass.
dzoep Nov 29, 2023
d359987
deforestation: simplify consumer syntax patterns
dzoep Nov 29, 2023
5043b2b
add a few compiler tests for deforestation
countvajhula Nov 29, 2023
7b57a6f
deforestation: fix blanket template with all arguments, expand transf…
dzoep Nov 29, 2023
861f6a8
reorganize compiler tests along producer, transformer, etc.
countvajhula Nov 29, 2023
5938228
combinatorial deforestation tests for producers using templates
countvajhula Nov 29, 2023
389bed9
Simplify compiler tests
countvajhula Nov 30, 2023
2f8a127
fix invalid test
countvajhula Nov 30, 2023
eed1581
Fix "anaphoric references" issue (resolves failing test)
countvajhula Nov 30, 2023
870d8c1
tests for keyword arguments in templates
countvajhula Nov 30, 2023
2d5a602
Merge pull request #122 from countvajhula/more-compiler-tests
dzoep Nov 30, 2023
23338b9
deforestation: fix blanket template currying
dzoep Nov 30, 2023
f4a5d41
deforestation: report too many arguments for blanket templates in syn…
dzoep Nov 30, 2023
b1fa395
deforestation: preliminary support for argument count limits in synta…
dzoep Nov 30, 2023
8e5024e
deforestation: update prettify-flow-syntax de-expander to reflect lat…
dzoep Nov 30, 2023
1119032
deforestation: unify range producer syntax patterns into one
dzoep Nov 30, 2023
7263863
deforestation: do not duplicate producer name for contracts and error…
dzoep Nov 30, 2023
9c2de48
deforestation: unified producer curry maker
dzoep Nov 30, 2023
e64a12b
deforestation: fix new producer curry semantics for implicit list->cs…
dzoep Nov 30, 2023
1f30957
deforestation: more patterns unification
dzoep Nov 30, 2023
df753ec
deforestation: improve invalid argument count error messages for stat…
dzoep Nov 30, 2023
7937725
Merge branch 'drym-org:first-optimizations' into first-optimizations
dzoep Nov 30, 2023
ba1a4ee
deforestation: fix error message
dzoep Nov 30, 2023
8bd4e21
deforestation: full blame information at runtime
dzoep Nov 30, 2023
a126d41
deforestation: add range producer semantic tests
dzoep Nov 30, 2023
89b2ae7
deforestation: fix support for #%fine-template in fusable-stream-tran…
dzoep Nov 30, 2023
679f44a
Merge pull request #123 from dzoep/first-optimizations
countvajhula Nov 30, 2023
26f4657
include the new producer tests in the deforestation test suite
countvajhula Nov 30, 2023
ecd896a
add a couple more tests for kwargs in a blanket template
countvajhula Nov 30, 2023
9f3e9dd
reorganize compiler tests into a dedicated folder (collection)
countvajhula Nov 30, 2023
0c683d5
avoid division by zero in comparing benchmark results
countvajhula Nov 30, 2023
77da7c0
Make higher benchmark threshold the same ratio as lower one
countvajhula Nov 30, 2023
d2fec40
Normalization tests and improvements
countvajhula Dec 1, 2023
3c6225a
remove old comment which I think has been addressed
countvajhula Dec 1, 2023
53b428e
Merge pull request #124 from countvajhula/reorganize-compiler-tests
countvajhula Dec 1, 2023
6959f2f
add a basic threading test
countvajhula Dec 6, 2023
e313717
remove outdated todo (again?)
countvajhula Dec 6, 2023
f9cbff1
fix "not currently expanding" issue
countvajhula Dec 6, 2023
989f294
move general and debugging-related functions into their own modules
countvajhula Dec 6, 2023
efd1095
simplify definitions and imports across phases
countvajhula Dec 6, 2023
806f267
fix literal `range` in tests
countvajhula Dec 6, 2023
4a2b8f6
declare macro-debugger dependency
countvajhula Dec 7, 2023
37eabcb
Merge pull request #127 from countvajhula/phase-shifting
countvajhula Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,25 @@ test:
raco test -exp $(PACKAGE-NAME)-{lib,test,doc,probe}

test-flow:
racket $(PACKAGE-NAME)-test/tests/flow.rkt
racket -y $(PACKAGE-NAME)-test/tests/flow.rkt

test-on:
racket $(PACKAGE-NAME)-test/tests/on.rkt
racket -y $(PACKAGE-NAME)-test/tests/on.rkt

test-threading:
racket $(PACKAGE-NAME)-test/tests/threading.rkt
racket -y $(PACKAGE-NAME)-test/tests/threading.rkt

test-switch:
racket $(PACKAGE-NAME)-test/tests/switch.rkt
racket -y $(PACKAGE-NAME)-test/tests/switch.rkt

test-definitions:
racket $(PACKAGE-NAME)-test/tests/definitions.rkt
racket -y $(PACKAGE-NAME)-test/tests/definitions.rkt

test-macro:
racket $(PACKAGE-NAME)-test/tests/macro.rkt
racket -y $(PACKAGE-NAME)-test/tests/macro.rkt

test-util:
racket $(PACKAGE-NAME)-test/tests/util.rkt
racket -y $(PACKAGE-NAME)-test/tests/util.rkt

test-probe:
raco test -exp $(PACKAGE-NAME)-probe
Expand Down
2 changes: 1 addition & 1 deletion qi-lib/flow.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(all-from-out "flow/extended/expander.rkt")
(all-from-out "flow/extended/forms.rkt"))

(require syntax-spec
(require syntax-spec-v1
(for-syntax racket/base
syntax/parse
(only-in "private/util.rkt"
Expand Down
176 changes: 174 additions & 2 deletions qi-lib/flow/core/compiler.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#lang racket/base

(provide (for-syntax compile-flow))
(provide (for-syntax compile-flow
;; TODO: only used in unit tests, maybe try
;; using a submodule to avoid providing these usually
deforest-rewrite))

(require (for-syntax racket/base
syntax/parse
Expand All @@ -14,14 +17,183 @@
racket/undefined
(prefix-in fancy: fancy-app))

;; "Composes" higher-order functions inline by directly applying them
;; to the result of each subsequent application, with the last argument
;; being passed to the penultimate application as a (single) argument.
;; This is specialized to our implementation of stream fusion in the
;; arguments it expects and how it uses them.
(define-syntax inline-compose1
(syntax-rules ()
[(_ f) f]
[(_ [op f] rest ...) (op f (inline-compose1 rest ...))]))

(begin-for-syntax
;; note: this does not return compiled code but instead,
;; syntax whose expansion compiles the code
(define (compile-flow stx)
(process-bindings (optimize-flow stx)))

(define-syntax-class fusable-list-operation
#:attributes (f next)
#:datum-literals (#%host-expression #%partial-application)
(pattern (#%partial-application
((#%host-expression (~literal map))
(#%host-expression f)))
#:attr next #'map-cstream-next)
(pattern (#%partial-application
((#%host-expression (~literal filter))
(#%host-expression f)))
#:attr next #'filter-cstream-next))

(define-syntax-class fusable-fold-operation
#:attributes (op init end)
#:datum-literals (#%host-expression #%partial-application)
(pattern (#%partial-application
((#%host-expression (~literal foldr))
(#%host-expression op)
(#%host-expression init)))
#:attr end #'(foldr-cstream op init)))

(define-syntax-class non-fusable
(pattern (~not _:fusable-list-operation)))

(define (generate-fused-operation ops)
(syntax-parse (reverse ops)
[(g:fusable-fold-operation op:fusable-list-operation ...)
#`(esc (λ (lst)
((#,@#'g.end
(inline-compose1 [op.next op.f] ...
list->cstream-next))
lst)))]
[(op:fusable-list-operation ...)
#'(esc (λ (lst)
((cstream->list
(inline-compose1 [op.next op.f] ...
list->cstream-next))
lst)))]))

(define (normalize-rewrites 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 thread) ((~datum amp) onex) (~datum AND))
#`(esc (give (curry andmap #,(compile-flow #'onex))))]
;; "deforestation" for values
;; (~> (pass f) (>< g)) → (>< (if f g ⏚))
[((~datum thread) _0 ... ((~datum pass) f) ((~datum amp) g) _1 ...)
#'(thread _0 ... (amp (if f g ground)) _1 ...)]
;; merge amps in sequence
[((~datum thread) _0 ... ((~datum amp) f) ((~datum amp) g) _1 ...)
#`(thread _0 ... #,(normalize-rewrites #'(amp (thread f g))) _1 ...)]
;; merge pass filters in sequence
[((~datum thread) _0 ... ((~datum pass) f) ((~datum pass) g) _1 ...)
#'(thread _0 ... (pass (and f g)) _1 ...)]
;; collapse deterministic conditionals
[((~datum if) (~datum #t) f g) #'f]
[((~datum if) (~datum #f) f g) #'g]
;; trivial threading form
[((~datum thread) f)
#'f]
;; associative laws for ~>
[((~datum thread) _0 ... ((~datum thread) f ...) _1 ...) ; note: greedy matching
#'(thread _0 ... f ... _1 ...)]
;; left and right identity for ~>
[((~datum thread) _0 ... (~datum _) _1 ...)
#'(thread _0 ... _1 ...)]
;; composition of identity flows is the identity flow
[((~datum thread) (~datum _) ...)
#'_]
;; identity flows composed using a relay
[((~datum relay) (~datum _) ...)
#'_]
;; amp and identity
[((~datum amp) (~datum _))
#'_]
;; trivial tee junction
[((~datum tee) f)
#'f]
;; merge adjacent gens
[((~datum tee) _0 ... ((~datum gen) a ...) ((~datum gen) b ...) _1 ...)
#'(tee _0 ... (gen a ... b ...) _1 ...)]
;; prism identities
;; Note: (~> ... △ ▽ ...) can't be rewritten to `values` since that's
;; only valid if the input is in fact a list, and is an error otherwise,
;; and we can only know this at runtime.
[((~datum thread) _0 ... (~datum collect) (~datum sep) _1 ...)
#'(thread _0 ... _1 ...)]
;; Deforestation for lists
;; TODO: propagate the syntax property instead
;; (~> (filter f) (map g)) → (~> (foldr [f+g] ...)))
[((~datum thread) _0 ...
((~datum #%partial-application) ((~literal filter) g))
((~datum #%partial-application) ((~literal map) f))
_1 ...)
#'(thread _0 ...
(#%fine-template
(foldr (λ (v vs)
(if (g v)
(cons (f v) vs)
vs))
null
_))
_1 ...)]
;; (~> (map f) (filter g)) → (~> (foldr [f+g] ...)))
[((~datum thread) _0 ...
((~datum #%partial-application) ((~literal map) f))
((~datum #%partial-application) ((~literal filter) g))
_1 ...)
#'(thread _0 ...
(#%fine-template
(foldr (λ (v vs)
(let ([result (f v)])
(if (g result)
(cons result vs)
vs)))
null
_))
_1 ...)]
;; return syntax unchanged if there are no known optimizations
[_ stx]))

;; 0. "Qi-normal form"
;; 1. deforestation pass
;; 2. other passes ...
;; e.g.:
;; changing internal representation to lists from values - may affect passes
;; passes as distinct stages is safe and interesting, a conservative start
;; one challenge: traversing the syntax tree
(define (deforest-rewrite stx)
(syntax-parse stx
[((~datum thread) _0:non-fusable ...
f:fusable-list-operation ...+
g:fusable-fold-operation
_1 ...)
#:with fused (generate-fused-operation (syntax->list #'(f ... g)))
#'(thread _0 ... fused _1 ...)]
[((~datum thread) _0:non-fusable ... f:fusable-list-operation ...+ _1 ...)
#:with fused (generate-fused-operation (attribute f))
#'(thread _0 ... fused _1 ...)]
[_ this-syntax]))

(define ((fix f) init-val)
(let ([new-val (f init-val)])
(if (eq? new-val init-val)
new-val
((fix f) new-val))))

(define (deforest-pass stx)
(find-and-map/qi (fix deforest-rewrite)
stx))

(define (normalize-pass stx)
(find-and-map/qi (fix normalize-rewrites)
stx))

(define (optimize-flow stx)
stx))
;; (deforest-pass (normalize-pass stx))
(deforest-pass (normalize-pass stx))))

;; Transformation rules for the `as` binding form:
;;
Expand Down
53 changes: 51 additions & 2 deletions qi-lib/flow/core/impl.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
values->list
feedback-times
feedback-while
kw-helper)
kw-helper
cstream->list
list->cstream-next
map-cstream-next
filter-cstream-next
foldr-cstream)

(require racket/match
(only-in racket/function
Expand All @@ -29,7 +34,8 @@
racket/list
racket/format
syntax/parse/define
(for-syntax racket/base))
(for-syntax racket/base)
racket/performance-hint)

(define-syntax-parse-rule (values->list body:expr ...+)
(call-with-values (λ () body ...) list))
Expand Down Expand Up @@ -121,6 +127,8 @@
[(cons v vs) (append (values->list (f v))
(~map f vs))]))

;; Note: can probably get rid of implicit packing to args, and the
;; final apply values
(define (map-values f . args)
(apply values (~map f args)))

Expand Down Expand Up @@ -235,3 +243,44 @@
(loop (values->list
(apply f args)))
(apply then-f args)))))

;; Stream fusion
(begin-encourage-inline
(define-inline (cstream->list next)
(λ (state)
(let loop ([state state])
((next (λ () null)
(λ (state) (loop state))
(λ (value state)
(cons value (loop state))))
state))))

(define-inline (foldr-cstream op init next)
(λ (state)
(let loop ([state state])
((next (λ () init)
(λ (state) (loop state))
(λ (value state)
(op value (loop state))))
state))))

(define-inline (list->cstream-next done skip yield)
(λ (state)
(cond [(null? state) (done)]
[else (yield (car state) (cdr state))])))

(define-inline (map-cstream-next f next)
(λ (done skip yield)
(next done
skip
(λ (value state)
(yield (f value) state)))))

(define-inline (filter-cstream-next f next)
(λ (done skip yield)
(next done
skip
(λ (value state)
(if (f value)
(yield value state)
(skip state)))))))
2 changes: 1 addition & 1 deletion qi-lib/flow/extended/expander.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[sep △]
[collect ▽])))

(require syntax-spec
(require syntax-spec-v1
(for-syntax "../aux-syntax.rkt"
"syntax.rkt"
racket/base
Expand Down
4 changes: 1 addition & 3 deletions qi-lib/info.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
(define collection "qi")
(define deps '("base"
("fancy-app" #:version "1.1")
;; this git URL should be changed to a named package spec
;; once syntax-spec is on the package index
"git://github.com/michaelballantyne/syntax-spec.git#main"))
"syntax-spec-v1"))
(define build-deps '())
(define clean '("compiled" "private/compiled"))
(define pkg-authors '(countvajhula))
4 changes: 3 additions & 1 deletion qi-sdk/profile/nonlocal/intrinsic.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#:when (member (bm-name spec) benchmarks-to-run))
(let ([name (bm-name spec)]
[exerciser (bm-exerciser spec)]
[f (eval (read (open-input-string (bm-name spec))) namespace)]
[f (eval
;; the first datum in the benchmark name needs to be a function name
(read (open-input-string (bm-name spec))) namespace)]
[n-times (bm-times spec)])
(run-nonlocal-benchmark name exerciser f n-times)))))
Loading