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

Deforest within the core language #2

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
451e032
List-ref and cad*r deforestation
dzoep Mar 11, 2024
e1682d5
Deforestation of length, empty?, and null?.
dzoep Mar 23, 2024
fdcf153
Deforest filter-map.
dzoep Mar 23, 2024
be2c5e3
Pass deforested operation name in cad*r-cstream-next.
dzoep Apr 6, 2024
ff12d36
Fix failing car-deforested? test.
dzoep Apr 28, 2024
860beeb
Cleaner syntax matching and production separation.
dzoep Apr 30, 2024
ffb8892
Split compiler passes into separate modules.
dzoep May 5, 2024
8fdc35e
Move deforestation infrastructure into passes subdirectory.
dzoep May 5, 2024
a62e930
Finish fixing all the things broken by the rebase.
dzoep May 5, 2024
54e32fc
Improve directory and module naming
dzoep May 24, 2024
a009e67
Deforest take with boxes.
dzoep May 31, 2024
b44d971
Implement proper state cons-ing for take.
dzoep May 31, 2024
967313d
Add source syntax context to transformer composition.
dzoep May 31, 2024
5ca9dab
New qi/list bindings and their literal matching, stateful transformer…
dzoep Jun 14, 2024
600c1e6
Deforestation: rename all fusable stream syntax classes to fs[PTC]-sy…
dzoep Jun 15, 2024
f7bcfc1
Fix tests of qi/list - use the new bindings.
dzoep Jun 15, 2024
de25f55
Split bindings module and add appropriate scribblings.
dzoep Jun 14, 2024
2f3085b
Update PR#175 with all the changes agreed upon at the weekly Qi compi…
dzoep Jun 27, 2024
5edcb46
Fix phase shifting for fusion.rkt module.
dzoep Jun 28, 2024
82e13fc
Add attach-form-property to both places needed by current deforestati…
dzoep Jun 28, 2024
ca711e5
Remove unused `require`
countvajhula Aug 3, 2024
4ab74b5
Introduce a `#%deforestable` core form
countvajhula Jun 29, 2024
e377b31
support basic cases of filter, map, foldl, foldr and range
countvajhula Jun 29, 2024
41dc2a8
a couple more tests for `range`
countvajhula Jul 2, 2024
7aae49f
formatting..
countvajhula Jul 10, 2024
983f008
temporarily comment out some tests
countvajhula Jul 11, 2024
bad2f56
register deforestation pass in core
countvajhula Jul 11, 2024
aa02873
Simplify #%deforestable syntax initially
countvajhula Jul 11, 2024
a4f6d48
modify benchmarks and tests to work with simplified `range` syntax
countvajhula Jul 11, 2024
bffe957
Match `#%deforestable` in deforesting `map` and `filter`
countvajhula Jul 11, 2024
549159a
Remove tests that ensure only right-threading is deforested
countvajhula Jul 11, 2024
9242413
Match `#%deforestable` in `foldl` and `foldr`
countvajhula Jul 11, 2024
56b06d8
Match `#%deforestable` in deforesting `car`
countvajhula Jul 11, 2024
488a283
Use `#%deforestable` in `cadr`, `caddr`, `cadddr`
countvajhula Jul 11, 2024
7205bf3
Use `#%deforestable` in `list-ref`
countvajhula Jul 11, 2024
0613ab5
Use `#%deforestable` in `length`
countvajhula Jul 11, 2024
2cb4bd3
Use `#%deforestable` in `empty?` and `null?`
countvajhula Jul 11, 2024
7dafd63
Write `filter-map` as a macro expanding to `#%deforestable`
countvajhula Jul 11, 2024
f1b90ff
Match `#%deforestable` in deforesting take instead of a host expression
countvajhula Jul 11, 2024
44e10e0
simplify `range` syntax matching for now
countvajhula Jul 11, 2024
26dfee6
mysterious fix for test errors
countvajhula Jul 11, 2024
862c42a
lint..
countvajhula Jul 12, 2024
a6078b8
A few basic tests for deforested forms
countvajhula Jul 12, 2024
dc6c29b
Codegen floe positions in #%deforestable
countvajhula Aug 2, 2024
fe81b7f
New syntax for `#%deforestable` distinguishing `floe` positions
countvajhula Aug 2, 2024
958fe14
Use the new `#%deforestable` syntax
countvajhula Aug 2, 2024
6efff74
Compile higher-order `floe` positions in deforestation pass
countvajhula Aug 2, 2024
d43d0e0
Surface tests for `qi/list` forms
countvajhula Aug 8, 2024
d2c3bc2
Incorporate deforestation semantics tests into surface qi/list tests
countvajhula Aug 8, 2024
90c0cb8
remove copypasta test
countvajhula Aug 8, 2024
64a2c70
Test list forms using higher-order Qi syntax
countvajhula Aug 8, 2024
75ebf77
Remove unused module providing bindings for deforestation
countvajhula Aug 8, 2024
493f121
Fix syntax error in benchmarks
countvajhula Aug 8, 2024
6155859
test the expansion of `#%deforestable`
countvajhula Aug 9, 2024
6b497de
Test syntax error using `range` with no arguments
countvajhula Aug 9, 2024
e699f41
Tests for `list-ref`
countvajhula Aug 9, 2024
04a71dd
Add a test for a syntax error utility
countvajhula Aug 9, 2024
625cda8
Modify a `range` test to use syntax with an explicit bound argument
countvajhula Aug 9, 2024
716a68a
Update deforestation rules tests
countvajhula Aug 9, 2024
2bd0f6e
Add a commented-out failing test for a case of desired deforestation
countvajhula Aug 11, 2024
85d29b8
refile the failing test (it now passes)
countvajhula Aug 11, 2024
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
118 changes: 118 additions & 0 deletions qi-doc/scribblings/list-operations.scrbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#lang scribble/doc
@require[scribble/manual
(for-label racket/list
racket/base)]

@title{List Operations}

@defmodule[qi/list]

This module defines bindings that can leverage stream fusion /
deforestation optimization when found in succession within a
flow. When not part of optimized flow, their behavior is identical to
the bindings of the same name from @racketmodname[racket/base] and
@racketmodname[racket/list].

The bindings are categorized based on their intended usage inside the
deforested pipeline.

@section{Producers}

@defproc*[(((range (end real?)) list?)
((range (start real?) (end real?) (step real? 1)) list?))]{

Deforestable version of @racket[range] from @racketmodname[racket/list].

}

@section{Transformers}

@defproc[(filter (pred procedure?) (lst list?)) list?]{

Deforestable version of @racket[filter] from @racketmodname[racket/base].

}

@defproc[(map (proc procedure?) (lst list?) ...+) list?]{

Deforestable version of @racket[map] from @racketmodname[racket/base].

}

@defproc[(filter-map (proc procedure?) (lst list?) ...+) list?]{

Deforestable version of @racket[filter-map] from @racketmodname[racket/list].

}

@defproc*[(((take (lst list?) (pos exact-nonnegative-integer?)) list?)
((take (lst any/c) (pos exact-nonnegative-integer?)) list?))]{

Deforestable version of @racket[take] from @racketmodname[racket/list].

}

@section{Consumers}

@defproc[(foldl (proc procedure?) (init any/c) (lst list?) ...+) any/c]{

Deforestable version of @racket[foldl] from @racketmodname[racket/base].

}

@defproc[(foldr (proc procedure?) (init any/c) (lst list?) ...+) any/c]{

Deforestable version of @racket[foldr] from @racketmodname[racket/base].

}

@defproc[(car (p pair?)) any/c]{

Deforestable version of @racket[car] from @racketmodname[racket/base].

}

@defproc[(cadr (v (cons/c any/c pair?))) any/c]{

Deforestable version of @racket[cadr] from @racketmodname[racket/base].

}

@defproc[(caddr (v (cons/c any/c (cons/c any/c pair?)))) any/c]{

Deforestable version of @racket[caddr] from @racketmodname[racket/base].

}

@defproc[(cadddr (v (cons/c any/c (cons/c any/c (cons/c any/c pair?))))) any/c]{

Deforestable version of @racket[cadddr] from @racketmodname[racket/base].

}

@defproc*[(((list-ref (lst list?) (pos exact-nonnegative-integer?)) any/c)
((list-ref (lst pair?) (pos exact-nonnegative-integer?)) any/c))]{

Deforestable version of @racket[list-ref] from @racketmodname[racket/base].

}

@defproc[(length (lst list?)) exact-nonnegative-integer?]{

Deforestable version of @racket[length] from @racketmodname[racket/base].

}

@defproc[(empty? (v any/c)) boolean?]{

Deforestable version of @racket[empty?] from @racketmodname[racket/list].

}

@defproc[(null? (v any/c)) boolean?]{

Deforestable version of @racket[null?] from @racketmodname[racket/base].

}


1 change: 1 addition & 0 deletions qi-doc/scribblings/qi.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This site hosts @emph{user} documentation. If you are interested in contributing
@include-section["tutorial.scrbl"]
@include-section["interface.scrbl"]
@include-section["forms.scrbl"]
@include-section["list-operations.scrbl"]
@include-section["macros.scrbl"]
@include-section["field-guide.scrbl"]
@include-section["principles.scrbl"]
Expand Down
Loading