The themes from this year mirrored those from the past: 1) pedagogy, 2) types and contracts, 3) static analysis and tooling.
Spend less time defining the test cases for a verifiable problem and more on creating the set of likely areas of teachable or recoverable failure that could be indicated by the tests.
Contract systems (PyContracts, typing, django.core.validators, GraphQL Scalars, ts-code-contracts
, or clojure.spec) may underspecify the contraints in cases like monotonic increasing values (e.g., time as increasing?
) or total order (sort-by predicate violations of the transitive rule (sort((a, b) => false)
) and can be difficult to define with current contract systems.
Automated PR feedback from static analysis tools (e.g., Black, Pettier, ESLint, SonarQube) still hinges heavily on defining the cultural expectations of a team rather than of the tools.
Code examples associated with some of the sessions are available at src/main.scm.
Videos from this year and past should be available at the following:
- https://github.com/titzer/wizard-engine
- static compilation
- 2017 turbofan
- wasm code
- side table for conditions
- simple value table for refs and numberics
https://github.com/titzer/virgil
- delta ip is used for the conditional flow for the fallthrough
- delta xip
- vals
- pop (number of values)
side table is 30% of original bytecode
check the benchmarks looking for
- bicg mvt atax symm 2mm adi jacobi-2d
- side table design
- leanprover.github.io
- http://leanprover.github.io/talks/RacketCon2022.pdf
- https://dblp.org/pid/76/3968-2.html
- https://leanprover.github.io/
- https://github.com/leanprover/doc-gen4 uses the new macro infrastructure for html / jsx
- https://github.com/dwrensha/lean4-maze
- TSyntax
- Coercion for the types
- https://github.com/racket/typed-racket/actions
- https://github.com/racket/typed-racket
- https://cs.brown.edu/people/bgreenma/sitemap.html
- Typed Racket:
#lang typed/racket
#lang typed/racket/shallow
and#lang typed/racket/optional
- shallow can be things like
[str]
- when looking at the shape check like list and
car
orcdr
(: says-moo? (-> Listof Symbol)
Boolean))
- run through deep, shallow, optional
- examples for calls based on nthe lang
(-> String)
- 8.7 PLDI 22 moving between the types
- https://plt.cs.northwestern.edu/snapshots/current/pdf-doc/ts-guide.pdf
- https://plt.cs.northwestern.edu/snapshots/current/doc/index.html
- https://cs.brown.edu/people/sk/Publications/Papers/Published/lgmvpk-static-python/
- Linter tools for standard PR feedback
- https://github.com/jackfirth/resyntax
- https://github.com/jackfirth/resyntax/blob/master/default-recommendations.rkt
test: "lambda variable definition with no arguments to function definition"
------------------------------
(define f
(λ ()
1))
------------------------------
------------------------------
(define (f)
1)
------------------------------
- Example: alien game
- Template:
define
the objects,check-expect
- Use functoinal composition for OO style interfaces
- https://con.racket-lang.org/htdp.org
- https://github.com/ralsei/bingus
- Uses the design recipe
(define-struct date (year month day))
- Example: depth that takes a Tree
(define (depth tree))
- https://www.cis.upenn.edu/~stevez/papers/OZ15.pdf
- This seems similar to https://github.com/webyrd/Barliman
- https://github.com/LeifAndersen
- https://github.com/LeifAndersen/visr-deps
- https://github.com/LeifAndersen/interactive-syntax-clojure
- https://dl.acm.org/doi/10.1145/3428290
- Model the game of tic tac toe
- Constraint solving system
- indices, players, rules
- https://people.csail.mit.edu/aleks/website/papers/mit-tr14-hola.pdf
- https://cs.brown.edu/research/pubs/theses/ugrad/2022/chen.qianfan.pdf
#lang http/asl
(define (f x) x)
- stacks and linking
- https://cs.brown.edu/~sk/Publications/Papers/Published/fffkbmt-programmable-prog-lang/paper.pdf
- Comes back to providing good examples
- Implement:
middle
- Implement:
median
- Implement:
sum
- Implement:
append
- Implement:
mode
- Implement:
overlap
(docdiff)
(define (overlap l1 l2))
- https://cs.brown.edu/courses/csci0190/2020/docdiff.html
- See also https://github.com/webyrd/Barliman
- Look at creating tests as “buggies” that are the counter examples
- Should should the meta for students to understand how things will break when in the course
- left median error
- there are the set up issues that come up for student solutions
- write counter examples as an expert for the system under development
- https://papl.cs.brown.edu/2020/
- https://github.com/camoy
- https://github.com/camoy/trace-contract
- client vs. server contract violations with fish
- use the contract to be independent of the implementation
- sort must require:
- comparator (function consuming two arguments)
- input and output list is same length
- input and output have same elements (permutation)
- look at docs for warnings about flow (
start-doc
,set-stipple
, hashstring-set!
mutability - define contract for
increasing?
- full vs. comparator
- contract is as accumulator vs. comparator
- total order, total, reflexive, antisymmetry, transitivity
- total order: transitive violated is the
(lambda (a b) #f)
(leq? 1 2)
(leq? 3 2)
- options contracts
- https://github.com/sorawee/fmt
- not refactoring
- contrast AST as a code visualization
- see LSP
- https://emacs-lsp.github.io/lsp-mode/page/lsp-racket-langserver/
- aowens-2/racket-formatting
- https://github.com/lassik/emacs-format-all-the-code
- https://github.com/lassik/emacs-format-all-the-code/blob/master/format-all.el#L74