Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
340 commits
Select commit Hold shift + click to select a range
ffc60be
formatting..
countvajhula Dec 10, 2022
81c2278
support prefab literals
countvajhula Dec 12, 2022
6a2139f
more tests for bindings
countvajhula Dec 13, 2022
a204f9b
minor cleanup and notes
countvajhula Dec 13, 2022
195e03a
lint and reorder some subforms
countvajhula Dec 14, 2022
fe3c24a
remove rule restricting bindings to ~> directly
countvajhula Dec 15, 2022
880aeca
formatting
countvajhula Dec 15, 2022
9402730
add descriptions to a couple of tests
countvajhula Dec 15, 2022
ef053f3
fix bindings tests
countvajhula Dec 15, 2022
a71c71b
Fix feedback implementation to be able to use a binding
countvajhula Dec 15, 2022
2314265
reorder nonterminals in order of fallbacks
countvajhula Dec 15, 2022
f575f30
allow bindings to escape tee junctions
countvajhula Dec 15, 2022
7cc3baa
allow bindings to escape relays
countvajhula Dec 15, 2022
e89b499
add another test
countvajhula Dec 15, 2022
ee8d405
use new syntax-spec racket-expr feature
michaelballantyne Jan 4, 2023
a066ab9
script to measure form performance regressions
countvajhula Dec 29, 2022
d0ddab3
define threshold values as constants
countvajhula Dec 29, 2022
b67d40a
put performance regression script in profile folder
countvajhula Dec 29, 2022
5294572
fix SDK makefile targets
countvajhula Dec 29, 2022
812ebb5
improvements in performance regression script
countvajhula Jan 3, 2023
620632c
rename a makefile target for clarity
countvajhula Jan 7, 2023
fa76571
make some scripts locally executable
countvajhula Jan 7, 2023
00bde75
add help text for the performance scripts
countvajhula Jan 7, 2023
c5b6e68
support csv output format in form performance report
countvajhula Jan 7, 2023
7791922
address todo re: try-order
countvajhula Jan 7, 2023
83760e9
remove commented code
countvajhula Jan 7, 2023
5ac618d
improve error on unrecognized format
countvajhula Jan 7, 2023
006c0d1
use PACKAGE-NAME variable in makefile targets
countvajhula Jan 7, 2023
3418505
update help message
countvajhula Jan 7, 2023
dafb6a0
update references to makefile target
countvajhula Jan 7, 2023
25b67ae
improve amp performance
countvajhula Jan 12, 2023
24648e6
try restoring original amp implementation
countvajhula Jan 12, 2023
2cc0186
add a test for loop with multi-valued map flow
countvajhula Jan 12, 2023
5c19cfe
restore `not` implementation
countvajhula Jan 13, 2023
7b4bf31
remove extraneous threading forms in some tests
countvajhula Jan 13, 2023
86ed0dc
incorporate regression checking into form performance report
countvajhula Jan 26, 2023
0e73441
regression module doesn't need to be executable anymore
countvajhula Jan 26, 2023
a25fa51
macro to create value definitions in the qi binding space (pairing..)
countvajhula Jan 26, 2023
1bec00b
Prioritize qi functions over racket functions in the expander
countvajhula Jan 26, 2023
c5266cc
define `count` and `live?` as qi functions
countvajhula Jan 26, 2023
22d2cee
define `all?` and `AND` as qi functions
countvajhula Jan 26, 2023
b96d595
remove unused import
countvajhula Jan 26, 2023
ce28ff8
put define-for-qi in a separate module for binding space provisions
countvajhula Jan 26, 2023
8156eb0
restore OR and any?
countvajhula Jan 27, 2023
c0531e7
restore none?
countvajhula Jan 27, 2023
013a14a
add an explanatory comment re: bindings in qi space
countvajhula Feb 24, 2023
0f615c5
reinstate `all` and `any` as core forms
countvajhula Feb 24, 2023
59986c8
restore original `pass` implementation
countvajhula Feb 24, 2023
c991c4d
reinstate `fanout` as a core form, for now
countvajhula Feb 24, 2023
d2a117d
reinstate `partition` as core for now
countvajhula Feb 24, 2023
7b15600
remove extraneous wrapping thread in `partition`
countvajhula Mar 1, 2023
6a72886
make thresholds configurable in regression report
countvajhula Mar 1, 2023
ace9c92
improve performance of `feedback`
Mar 3, 2023
6399e18
document SDK makefile targets
countvajhula Mar 7, 2023
2c064a8
makefile target for performance regression report
countvajhula Mar 7, 2023
a38c2dc
Refactor benchmarks to unify form-related ones
countvajhula Mar 8, 2023
80aba31
start to separate form benchmarks from other benchmarks
countvajhula Mar 8, 2023
3c0ebcf
Organize scripts to generate performance reports
countvajhula Mar 8, 2023
021993f
Use require-latency library instead of measuring load time locally
countvajhula Mar 8, 2023
065f41c
move competitive benchmarks into a separate folder
countvajhula Mar 8, 2023
ac10e20
update phonies in makefile
countvajhula Mar 8, 2023
40e406a
merge some require forms
countvajhula Mar 8, 2023
cac0d35
categorize performance modules into intrinsic vs competitive
countvajhula Mar 8, 2023
612f4a3
rename a file for uniformity
countvajhula Mar 8, 2023
febb2b2
begin refactor of competitive benchmarks for uniformity/tractability
countvajhula Mar 15, 2023
a33d567
label a todo so it doesn't get lost
countvajhula Mar 15, 2023
db301e1
standardize nonlocal benchmark names for use via CLI
countvajhula Mar 15, 2023
4f56603
support selecting specific nonlocal benchmarks to run via CLI
countvajhula Mar 15, 2023
295f397
standardize flag conventions
countvajhula Mar 15, 2023
deb651e
reorganize benchmarks as local and nonlocal
countvajhula Mar 15, 2023
8d0fdaf
continue reorganizing benchmarks..
countvajhula Mar 15, 2023
91d35bf
run nonlocal benchmarks for racket or qi via CLI
countvajhula Mar 15, 2023
65eccaf
use regression logic to implement competitive benchmarks
countvajhula Mar 15, 2023
cc3fa88
respect CLI flags in performance regression reporting
countvajhula Mar 15, 2023
9403cf5
check regression wrt the "after" data to respect narrowed selection
countvajhula Mar 15, 2023
191d76f
update makefile targets and name things consistently
countvajhula Mar 15, 2023
62fbab8
improve live output in competitive report
countvajhula Mar 15, 2023
9279d83
cleanup, remove unused imports
countvajhula Mar 15, 2023
102481b
use "local" instead of "forms"
countvajhula Mar 15, 2023
5bfc8e7
add back needed import
countvajhula Mar 15, 2023
e689c96
add nonlocal benchmarks to the performance report
countvajhula Mar 22, 2023
1f98205
contain load path parameter to eval where it's needed
countvajhula Mar 23, 2023
56e7906
Simplify syntax-spec grammar
countvajhula May 4, 2023
32cdecf
add a restorative optimization for "all"
countvajhula Sep 16, 2022
377f231
simple cases of "deforestation" for values
countvajhula Sep 16, 2022
a13b492
basic optimization loop
countvajhula Sep 16, 2022
e945a4c
merge amps in sequence
countvajhula Sep 16, 2022
e88a846
flatten nested compositions (associative law)
countvajhula Sep 16, 2022
edb6ca4
eliminate superfluous identity flows
countvajhula Sep 16, 2022
886c257
incorporate various identities as optimizations
countvajhula Sep 16, 2022
e880bce
add some comments
countvajhula Sep 16, 2022
df7ce49
merge `pass` filters in sequence by conjoining the predicates
countvajhula Sep 16, 2022
e54dc4e
note a todo
countvajhula Sep 16, 2022
2618d71
more comments
countvajhula Sep 16, 2022
b06e88d
collapse deterministic conditionals
countvajhula Sep 16, 2022
47f3866
note about optimizing "active" components of optimized expansions
countvajhula Sep 16, 2022
dacdc68
use core language words instead of symbols in optimizations
countvajhula Sep 28, 2022
59502ea
don't optimize prisms where it expects a list input specifically
countvajhula Sep 29, 2022
257eebe
rudimentary deforestation
countvajhula Sep 30, 2022
4893078
remove invalid deforestation optimization (noted in CR)
countvajhula Oct 5, 2022
e3dc00f
remove invalid optimization (CR)
countvajhula Oct 12, 2022
0e60aa9
add tests to check known counterexamples to seeming equivalences
countvajhula Oct 12, 2022
0822aa1
collapse singleton threading form
countvajhula Mar 1, 2023
3c8d6c7
Commit wip from today's meeting
countvajhula Aug 4, 2023
f7052e2
wip from today's meeting (ignition!)
countvajhula Aug 11, 2023
7725222
implement filter-map using multiple values instead of allocated data
countvajhula Aug 11, 2023
6af0d31
add version from ben with partially evaluated match, for completeness
countvajhula Aug 12, 2023
7d7b8f0
add the hand-coded iteration (upper bound on performance)
countvajhula Aug 15, 2023
2b8483d
add `range-map-sum` benchmark (used in St-Amour's writeup)
countvajhula Aug 18, 2023
7014300
minimally incorporate stream fusion into the compiler
countvajhula Aug 18, 2023
f693e08
restore restorative optimization that was accidentally dropped
countvajhula Aug 24, 2023
6c7f2e7
test for the `filter-map` functional pipeline
countvajhula Aug 26, 2023
e3037de
use `racket -y` in running all tests to recompile if needed
countvajhula Aug 26, 2023
efb8f65
fix stream fusion (from today's qi meeting)
countvajhula Aug 26, 2023
8ce3a88
tidy - remove deforestation wip from benchmarking module
countvajhula Sep 1, 2023
0b2d62f
WIP from today's meeting
countvajhula Sep 2, 2023
e9298cb
use the much-anticipated syntax-spec-v1 from the package index :)
countvajhula Sep 2, 2023
a75c790
a couple more nonlocal testcases, using folds
countvajhula Sep 15, 2023
69fc6f7
add starter tests to validate compiler rewrite rules
countvajhula Sep 15, 2023
047ca98
benchmark for functional pipeline using foldr
countvajhula Sep 15, 2023
7d04b07
foldr fusable stream terminator
countvajhula Sep 16, 2023
ca8ff12
WIP from today's meeting
countvajhula Sep 22, 2023
02a5b5c
remove old unused deforestation code
countvajhula Sep 29, 2023
25b4b68
Implement `foldl` as a stream
countvajhula Sep 30, 2023
28b9301
fix compiler tests by adding chirality
countvajhula Oct 1, 2023
8367503
consistent naming in rewrite rules
countvajhula Oct 5, 2023
a70f882
add a benchmark using `foldl`
countvajhula Oct 6, 2023
c767e57
rename stream-related syntax classes for clarity
countvajhula Oct 7, 2023
b254c6e
Use macro-debugger-emit to see the process-bindings expansion step in…
dzoep Oct 7, 2023
2631c6c
Make fix procedure compatible with syntax-parse rules following the f…
dzoep Oct 7, 2023
8e96107
macros for emitting expansion events for the macro stepper
countvajhula Oct 14, 2023
3c413e7
Fix nonlocal tests (use right threading) for deforestation optimizati…
dzoep Oct 20, 2023
df78d98
Revert "Fix nonlocal tests (use right threading) for deforestation op…
dzoep Nov 5, 2023
5ec858e
Fix the tests again.
dzoep Nov 5, 2023
c296c17
Remove redundant inlining hint.
dzoep Nov 5, 2023
4930478
Preliminary fusion for no-argument range, supporting 1 or 2 values.
dzoep Nov 5, 2023
cb23109
Support for multiple arguments to curry in producer syntax class.
dzoep Nov 5, 2023
313bb3f
Full support for range fusion.
dzoep Nov 5, 2023
0a4b506
Finish stream fusion for producers, transformers, consumers and all t…
dzoep Nov 6, 2023
c5f7677
Move the current deforestation (both syntax and implementation parts)…
dzoep Nov 11, 2023
7e7e41f
Fix missing requires (for ~literal matching), streamline procedures n…
dzoep Nov 11, 2023
c1e9ce0
Cleanup unused pattern variable, implement car deforestation.
dzoep Nov 11, 2023
6eae078
Re-add begin-encourage-inline based on the benchmarks.
dzoep Nov 17, 2023
1f800af
add `range-map` benchmark
countvajhula Nov 17, 2023
b6f2ac5
fix compiler tests
countvajhula Nov 17, 2023
cbda30c
add a (failing) test for deforestation in nested positions
countvajhula Nov 17, 2023
39dd1e3
remove testing-related nesting in qi deforestation benchmark
countvajhula Nov 17, 2023
fef36b3
validate that `range` deforestation doesn't harm performance
countvajhula Nov 17, 2023
3b83b54
fix (most) compiler tests again
countvajhula Nov 17, 2023
791692c
remove outdated compiler rewrite rule
countvajhula Nov 18, 2023
cbd6b2b
normalization rule to collapse `values` inside a threading form
countvajhula Nov 18, 2023
cacdbad
Add initial tests for the normalization pass
countvajhula Nov 18, 2023
40c0737
improve `range-map-sum` benchmark
countvajhula Nov 20, 2023
1bac5b4
add a "long functional pipeline" benchmark
countvajhula Nov 20, 2023
2fd5275
remove unused code
countvajhula Nov 20, 2023
6ada896
Replace `range-map` benchmark with `range-map-car`
countvajhula Nov 20, 2023
94969e5
failing unit test for range-map-car
countvajhula Nov 20, 2023
b3dd07e
Partial implementation of producer prepare contract.
dzoep Nov 20, 2023
0d3b197
Refactor normalize pass into its own module
countvajhula Nov 20, 2023
84b85e0
note a todo for normalization, and remove an outdated comment
countvajhula Nov 20, 2023
0bc343b
Fix car stream consumer, generate all possible contracts for range va…
dzoep Nov 21, 2023
e3b1521
Deforestation producers - currying prepare in the right order, contra…
dzoep Nov 22, 2023
ad72a8d
Preliminary implementation of consumer contracts with car as an example.
dzoep Nov 22, 2023
414c2ee
Unified range producer syntax class + currying contracted pipeline.
dzoep Nov 23, 2023
7bad400
fusable-stream-producer: limit the number of arguments to range to 1 …
dzoep Nov 24, 2023
5c85b2d
move a simplification from the code generation step to normalization
countvajhula Nov 22, 2023
c4a4995
Simplify deforestation tests to high level assertions
countvajhula Nov 22, 2023
1b0c618
Handle a simplified host expression in the compiler
countvajhula Nov 26, 2023
9857e65
failing compiler tests for deforesting templates
countvajhula Nov 29, 2023
d50e5e9
Rewrite partial application to a use of a blanket template
countvajhula Nov 29, 2023
342fe96
A test to validate pre-supplying keyword arguments
countvajhula Nov 29, 2023
a53dca3
remove unused import
countvajhula Nov 29, 2023
8c4bf63
match blanket templates in transformers and consumers
countvajhula Nov 29, 2023
71c31e6
add a failing test to show an issue with bindings and currying
countvajhula Nov 29, 2023
0cb4993
Add support for #%fine-template in deforested consumers.
dzoep Nov 25, 2023
38d48d6
Add missing literal.
dzoep Nov 25, 2023
8c95d62
Matching _ as ~datum.
dzoep Nov 25, 2023
1d7cd1d
deforestation error reporting: implement partial de-expander for flows
dzoep Nov 26, 2023
368380c
Currying for #%fine-template deforested producers.
dzoep Nov 27, 2023
9478c1b
Work on simplifying deforestation pass.
dzoep Nov 29, 2023
4f3a217
deforestation: simplify consumer syntax patterns
dzoep Nov 29, 2023
5d87af2
add a few compiler tests for deforestation
countvajhula Nov 29, 2023
8c6e5b3
deforestation: fix blanket template with all arguments, expand transf…
dzoep Nov 29, 2023
1978020
reorganize compiler tests along producer, transformer, etc.
countvajhula Nov 29, 2023
097c968
combinatorial deforestation tests for producers using templates
countvajhula Nov 29, 2023
becec47
Simplify compiler tests
countvajhula Nov 30, 2023
f60de73
fix invalid test
countvajhula Nov 30, 2023
633c151
Fix "anaphoric references" issue (resolves failing test)
countvajhula Nov 30, 2023
e55174a
tests for keyword arguments in templates
countvajhula Nov 30, 2023
aa83cf8
deforestation: fix blanket template currying
dzoep Nov 30, 2023
ab879c8
deforestation: report too many arguments for blanket templates in syn…
dzoep Nov 30, 2023
25c781e
deforestation: preliminary support for argument count limits in synta…
dzoep Nov 30, 2023
19ad843
deforestation: update prettify-flow-syntax de-expander to reflect lat…
dzoep Nov 30, 2023
d283221
deforestation: unify range producer syntax patterns into one
dzoep Nov 30, 2023
0b58fd6
deforestation: do not duplicate producer name for contracts and error…
dzoep Nov 30, 2023
6f77820
deforestation: unified producer curry maker
dzoep Nov 30, 2023
121edbe
deforestation: fix new producer curry semantics for implicit list->cs…
dzoep Nov 30, 2023
7473a89
deforestation: more patterns unification
dzoep Nov 30, 2023
62a70cb
deforestation: improve invalid argument count error messages for stat…
dzoep Nov 30, 2023
98b1fe7
deforestation: fix error message
dzoep Nov 30, 2023
0cb82dc
deforestation: full blame information at runtime
dzoep Nov 30, 2023
7e59b41
deforestation: add range producer semantic tests
dzoep Nov 30, 2023
f41b32a
deforestation: fix support for #%fine-template in fusable-stream-tran…
dzoep Nov 30, 2023
b518b17
include the new producer tests in the deforestation test suite
countvajhula Nov 30, 2023
6798a61
add a couple more tests for kwargs in a blanket template
countvajhula Nov 30, 2023
20da837
reorganize compiler tests into a dedicated folder (collection)
countvajhula Nov 30, 2023
87251e6
avoid division by zero in comparing benchmark results
countvajhula Nov 30, 2023
d7a8085
Make higher benchmark threshold the same ratio as lower one
countvajhula Nov 30, 2023
217c086
Normalization tests and improvements
countvajhula Dec 1, 2023
e84b8dd
remove old comment which I think has been addressed
countvajhula Dec 1, 2023
6ed69a4
add a basic threading test
countvajhula Dec 6, 2023
c6c724f
remove outdated todo (again?)
countvajhula Dec 6, 2023
a4051ef
move general and debugging-related functions into their own modules
countvajhula Dec 6, 2023
0254fbf
simplify definitions and imports across phases
countvajhula Dec 6, 2023
ccb7563
fix literal `range` in tests
countvajhula Dec 6, 2023
d9082bd
declare macro-debugger dependency
countvajhula Dec 7, 2023
3900217
use test-equal? in test-normalize
countvajhula Dec 10, 2023
56d3a2e
unit tests for `find-and-map/qi`
countvajhula Dec 10, 2023
be03431
organize high level compilation sequence more clearly
countvajhula Dec 10, 2023
cda184e
"fix" bad test
countvajhula Dec 10, 2023
ee1de0a
simplify some definitions
countvajhula Dec 11, 2023
a27bc75
Fix collapsing `values` in normalization
countvajhula Dec 11, 2023
fabfbf8
clean up normalization rules by declaring datum literals
countvajhula Dec 11, 2023
00f840d
revert phase changes to deforest.rkt for now
countvajhula Dec 11, 2023
d4df8b9
Comment out failing test
countvajhula Dec 11, 2023
e34f5ae
deforest: format some brackets
benknoble Dec 12, 2023
f08ef3e
fix tests not being run on `make test`
countvajhula Dec 14, 2023
6ccb0fc
Add more counterexamples found by Ben
countvajhula Dec 13, 2023
33629ce
counterexamples...
countvajhula Dec 14, 2023
95b2249
don't duplicate left and right identity rule
countvajhula Dec 14, 2023
9d5290e
remove unsound normalization rules
countvajhula Dec 14, 2023
30f4236
remove failing compiler tests for the unsound rules
countvajhula Dec 14, 2023
45c52fa
Merge pull request #133 from countvajhula/correct-normalization
countvajhula Dec 14, 2023
1688a43
define qi functions in a uniform way
countvajhula Feb 24, 2023
849d95d
fix "not currently expanding" issue
countvajhula Dec 14, 2023
e322e1e
Make error pattern in ~> more specific to avoid bad error message
countvajhula Dec 15, 2023
491b107
Remove invalid (yet passing on main) test
countvajhula Dec 15, 2023
5f1774d
reorder some tests
countvajhula Dec 15, 2023
41683bc
failing unit tests for desired binding behavior with `switch`
countvajhula Dec 15, 2023
37533ae
add binding spec for `if` (inherited by `switch`)
countvajhula Dec 15, 2023
45577c5
don't look for fixed point in deforestation as it's unnecessary
countvajhula Dec 15, 2023
d20a5a6
starter tests for the expander
countvajhula Dec 15, 2023
2b23e17
a few more tests for the expander
countvajhula Dec 15, 2023
58c3609
declare missing build dependency on syntax-spec
countvajhula Dec 15, 2023
0503bb6
clarify a comment
countvajhula Dec 15, 2023
ac5ba6d
Use de-expander to fix (in a temporary way) #134
countvajhula Dec 16, 2023
4b44be2
commit missing moved de-expander
countvajhula Dec 16, 2023
bf581a4
expand de-expander to full core language (except feedback)
countvajhula Dec 16, 2023
4fa02e2
Merge pull request #136 from countvajhula/bind-and-switch
countvajhula Dec 16, 2023
1cef2c1
local benchmark for the `as` binding form
countvajhula Dec 18, 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
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: make install-sdk
- name: Run benchmark
shell: 'bash --noprofile --norc -eo pipefail {0}'
run: make report-benchmarks | tee benchmarks.txt
run: make performance-report | tee benchmarks.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: true
matrix:
racket-variant: ['BC', 'CS']
racket-version: ['8.3', 'stable']
racket-version: ['8.5', 'stable']
experimental: [false]
include:
- racket-version: 'current'
Expand Down
64 changes: 45 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ DEPS-FLAGS=--check-pkg-deps --unused-pkg-deps

help:
@echo "install - install package along with dependencies"
@echo "install-sdk - install the SDK which includes developer tools"
@echo "remove - remove package"
@echo "remove-sdk - remove SDK; this will not remove SDK dependencies"
@echo "build - Compile libraries"
@echo "build-docs - Build docs"
@echo "build-standalone-docs - Build self-contained docs that could be hosted somewhere"
@echo "build-all - Compile libraries, build docs, and check dependencies"
@echo "clean - remove all build artifacts"
@echo "clean-sdk - remove all build artifacts in SDK paths"
@echo "check-deps - check dependencies"
@echo "test - run tests"
@echo "test-with-errortrace - run tests with error tracing"
Expand All @@ -27,6 +30,8 @@ help:
@echo " definitions"
@echo " macro"
@echo " util"
@echo " expander"
@echo " compiler"
@echo " probe"
@echo " Note: As probe is not in qi-lib, it isn't part of"
@echo " the tests run in the 'test' target."
Expand All @@ -37,9 +42,14 @@ help:
@echo "docs - view docs in a browser"
@echo "profile - Run comprehensive performance benchmarks"
@echo "profile-competitive - Run competitive benchmarks"
@echo "profile-forms - Run benchmarks for individual Qi forms"
@echo "profile-local - Run benchmarks for individual Qi forms"
@echo "profile-nonlocal - Run nonlocal benchmarks exercising many components at once"
@echo "profile-selected-forms - Run benchmarks for Qi forms by name (command only)"
@echo "report-benchmarks - Run benchmarks for Qi forms and produce results for use in CI"
@echo "performance-report - Run benchmarks for Qi forms and produce results for use in CI and for measuring regression"
@echo " For use in regression: make performance-report > /path/to/before.json"
@echo "performance-regression-report - Run benchmarks for Qi forms against a reference report."
@echo " make performance-regression-report REF=/path/to/before.json"


# Primarily for use by CI.
# Installs dependencies as well as linking this as a package.
Expand Down Expand Up @@ -82,6 +92,9 @@ build-standalone-docs:
clean:
raco setup --fast-clean --pkgs $(PACKAGE-NAME)-{lib,test,doc,probe}

clean-sdk:
raco setup --fast-clean --pkgs $(PACKAGE-NAME)-sdk

# Primarily for use by CI, after make install -- since that already
# does the equivalent of make setup, this tries to do as little as
# possible except checking deps.
Expand All @@ -93,25 +106,31 @@ 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-expander:
racket -y $(PACKAGE-NAME)-test/tests/expander.rkt

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

test-probe:
raco test -exp $(PACKAGE-NAME)-probe
Expand Down Expand Up @@ -159,20 +178,27 @@ cover: coverage-check coverage-report
cover-coveralls:
raco cover -b -f coveralls -p $(PACKAGE-NAME)-{lib,test}

profile-forms:
echo "Profiling forms..."
racket $(PACKAGE-NAME)-sdk/profile/forms.rkt
profile-local:
racket $(PACKAGE-NAME)-sdk/profile/local/report.rkt

profile-loading:
racket $(PACKAGE-NAME)-sdk/profile/loading/report.rkt

profile-selected-forms:
@echo "Use 'racket profile/forms.rkt' directly, with -f form-name for each form."
@echo "Use 'racket $(PACKAGE-NAME)-sdk/profile/local/report.rkt' directly, with -s form-name for each form."

profile-competitive:
echo "Running competitive benchmarks..."
racket $(PACKAGE-NAME)-sdk/profile/competitive.rkt
cd $(PACKAGE-NAME)-sdk/profile/nonlocal; racket report-competitive.rkt

profile-nonlocal:
cd $(PACKAGE-NAME)-sdk/profile/nonlocal; racket report-intrinsic.rkt -l qi

profile: profile-local profile-nonlocal profile-loading

profile: profile-competitive profile-forms
performance-report:
@racket $(PACKAGE-NAME)-sdk/profile/report.rkt -f json

report-benchmarks:
@racket $(PACKAGE-NAME)-sdk/profile/report.rkt
performance-regression-report:
@racket $(PACKAGE-NAME)-sdk/profile/report.rkt -r $(REF)

.PHONY: help install remove build build-docs build-all clean check-deps test test-flow test-on test-threading test-switch test-definitions test-macro test-util test-probe test-with-errortrace errortrace errortrace-flow errortrace-on errortrace-threading errortrace-switch errortrace-definitions errortrace-macro errortrace-util errortrace-probe docs cover coverage-check coverage-report cover-coveralls profile-forms profile-selected-forms profile-competitive profile report-benchmarks
.PHONY: help install remove build build-docs build-all clean check-deps test test-flow test-on test-threading test-switch test-definitions test-macro test-util test-expander test-compiler test-probe test-with-errortrace errortrace errortrace-flow errortrace-on errortrace-threading errortrace-switch errortrace-definitions errortrace-macro errortrace-util errortrace-probe docs cover coverage-check coverage-report cover-coveralls profile-local profile-loading profile-selected-forms profile-competitive profile-nonlocal profile performance-report performance-regression-report
31 changes: 19 additions & 12 deletions qi-doc/scribblings/field-guide.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@
racket]]

@(define eval-for-docs
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
qi/probe
(only-in racket/list range)
racket/string
(for-syntax syntax/parse
racket/base))
'(define (sqr x)
(* x x)))))
;; The "trusted" sandbox configuration is needed possibly
;; because of the interaction of binding spaces with
;; sandbox evaluator. For more context, see the Qi wiki
;; "Qi Compiler Sync Sept 2 2022."
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
qi/probe
(only-in racket/list range)
racket/string
(for-syntax syntax/parse
racket/base))
'(define (sqr x)
(* x x)))))))

@title{Field Guide}

Expand Down Expand Up @@ -336,6 +342,7 @@ Another way to do it is to simply promote the expression out of the nest:
(~> (3) (get-f 1))
]

@;{TODO: Update this to reflect new partial application behavior}
Now, you might, once again, expect this to be treated as a partial application template, so that this would be equivalent to @racket[(get-f 3 1)] and would raise an error. But in fact, since the expression @racket[(get-f 1)] happens to be fully qualified with all the arguments it needs, the currying employed under the hood to implement partial application in this case @seclink["Using_Racket_to_Define_Flows"]{evaluates to a function result right away}. This then receives the value @racket[3], and consequently, this expression produces the correct result.

So in sum, it's perhaps best to rely on @racket[esc] in such cases to be as explicit as possible about what you mean, rather than rely on quirks of the implementation that are revealed at this boundary between two languages.
Expand Down
31 changes: 22 additions & 9 deletions qi-doc/scribblings/forms.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
racket]]

@(define eval-for-docs
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range first rest)
racket/string)
'(define (sqr x)
(* x x)))))
;; The "trusted" sandbox configuration is needed possibly
;; because of the interaction of binding spaces with
;; sandbox evaluator. For more context, see the Qi wiki
;; "Qi Compiler Sync Sept 2 2022."
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range first rest)
racket/string)
'(define (sqr x)
(* x x)))))))

@(define diagram-eval (make-base-eval))
@(diagram-eval '(require metapict))
Expand Down Expand Up @@ -346,11 +352,15 @@ Note that the symbol form uses Unicode @code{0x2225} corresponding to LaTeX's @c
@deftogether[(
@defform[(== flo ...)]
@defform[(relay flo ...)]
@defidform[#:link-target? #f ==]
@defidform[#:link-target? #f relay]
)]{
Compose flows in parallel, so that inputs are passed through the corresponding @racket[flo]'s individually. The number of @racket[flo]s must be the same as the number of runtime inputs.

In the common case of @code{1 × 1} @racket[flo]s (i.e. where the flows each accept one input and produce one output), the number of outputs will be the same as the number of inputs, but as @seclink["What_is_a_Flow_"]{flows can be nonlinear}, this is not necessarily the case in general.

When used in identifier form simply as @racket[==], it behaves identically to @racket[><].

See also the field guide entry on the @seclink["Bindings_are_an_Alternative_to_Nonlinearity"]{relationship between bindings and nonlinearity}.

@examples[
Expand Down Expand Up @@ -568,11 +578,14 @@ A form of generalized @racket[sieve], passing all the inputs that satisfy each
(loop condition-flo map-flo)]
@defform[#:link-target? #f
(loop map-flo)]
@defidform[#:link-target? #f loop]
)]{
A simple loop for structural recursion on the input values, this applies @racket[map-flo] to the first input on each successive iteration and recurses on the remaining inputs, combining these using @racket[combine-flo] to yield the result as long as the inputs satisfy @racket[condition-flo]. When the inputs do not satisfy @racket[condition-flo], @racket[return-flo] is applied to the inputs to yield the result at that terminating step. If the condition is satisfied and there are no further values, the loop terminates naturally.

If unspecified, @racket[condition-flo] defaults to @racket[#t], @racket[combine-flo] defaults to @racket[_], and @racket[return-flo] defaults to @racket[⏚].

When used in identifier form simply as @racket[loop], this behaves the same as the fully qualified version, except that the flows parametrizing the loop are expected as the initial four inputs (in the same order), and the data inputs being acted upon are expected to follow.

@examples[
#:eval eval-for-docs
((☯ (loop (* 2))) 1 2 3)
Expand Down
39 changes: 16 additions & 23 deletions qi-doc/scribblings/interface.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@
syntax/parse/define]]

@(define eval-for-docs
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range)
racket/string)
'(define ->string number->string)
'(define (sqr x)
(* x x)))))
;; The "trusted" sandbox configuration is needed possibly
;; because of the interaction of binding spaces with
;; sandbox evaluator. For more context, see the Qi wiki
;; "Qi Compiler Sync Sept 2 2022."
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range)
racket/string)
'(define ->string number->string)
'(define (sqr x)
(* x x)))))))

@title{Language Interface}

Expand Down Expand Up @@ -354,19 +360,6 @@ The second way is if you want to describe a flow using the host language instead
(~> (3 5) add-two)
]

Finally, note that the following case works:

@examples[
#:eval eval-for-docs
(define (get-flow v)
(☯ (~> sqr (+ v))))
(~> (5) (get-flow 3))
]

You might expect here that the expression @racket[(get-flow 3)] would be treated as a @seclink["Templates_and_Partial_Application"]{partial application template}, so that the value @racket[5] would be provided to it as @racket[(get-flow 5 3)], resulting in an error. The reason this isn't what happens is that the partial application behavior in Qi when no argument positions have been indicated is implemented using currying rather than as a template application, and Racket's @racket[curry] and @racket[curryr] functions happen to evaluate to a result immediately if the maximum expected arguments have been provided. Thus, in this case, the @racket[(get-flow 3)] expression is first evaluated to produce a resulting flow which then receives the value @racket[5].

So, function applications where all of the arguments are provided syntactically, and which produce functions as their result, may be used as if they were simple function identifiers, and @racket[esc] may be left out.

@subsection{Using Racket Macros as Flows}

Flows are expected to be @seclink["What_is_a_Flow_"]{functions}, and so you cannot naively use a macro as a flow. But there are many ways in which you can. If you'd just like to use such a macro in a one-off manner, see @secref["Converting_a_Macro_to_a_Flow"] for an ad hoc way to do this. But a simpler and more complete way in many cases is to first register the macro (or any number of such macros) using @racket[define-qi-foreign-syntaxes] prior to use.
Expand Down
24 changes: 15 additions & 9 deletions qi-doc/scribblings/intro.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
racket]]

@(define eval-for-docs
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range)
racket/string)
'(define (sqr x)
(* x x)))))
;; The "trusted" sandbox configuration is needed possibly
;; because of the interaction of binding spaces with
;; sandbox evaluator. For more context, see the Qi wiki
;; "Qi Compiler Sync Sept 2 2022."
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range)
racket/string)
'(define (sqr x)
(* x x)))))))

@title{Introduction and Usage}

Expand Down
26 changes: 16 additions & 10 deletions qi-doc/scribblings/macros.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@
syntax/parse/define]]

@(define eval-for-docs
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range first rest)
(for-syntax syntax/parse racket/base)
racket/string)
'(define (sqr x)
(* x x)))))
;; The "trusted" sandbox configuration is needed possibly
;; because of the interaction of binding spaces with
;; sandbox evaluator. For more context, see the Qi wiki
;; "Qi Compiler Sync Sept 2 2022."
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit #f])
(make-evaluator 'racket/base
'(require qi
(only-in racket/list range first rest)
(for-syntax syntax/parse racket/base)
racket/string)
'(define (sqr x)
(* x x)))))))

@title[#:tag "Qi_Macros"]{Qi Macros}

Expand Down
Loading