Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
b084859
Sketch operator overloading for checked arithmetic
samestep Dec 9, 2025
5d5dc4c
Add missing type equality constraints
samestep Dec 9, 2025
3f410f4
Add `with_int32_unchecked`
samestep Dec 10, 2025
24a39ee
Add `Int64` and `with_int64_unchecked`
samestep Dec 10, 2025
c283c7d
Fix typo in `neg_unchecked` body for `Int64`
samestep Dec 10, 2025
d7a0f00
Sketch out functions to convert literals to values
samestep Dec 11, 2025
e4296f5
Separate coercions for `Int` vs `Uint`
samestep Dec 11, 2025
7c6835b
Merge branch 'main' into ops
samestep Dec 16, 2025
54a9392
Rewrite all `examples` to `assume Std;`
samestep Dec 16, 2025
ac81a18
Add an example for unchecked integer overflow
samestep Dec 16, 2025
a826e03
Parse `assume` statements
samestep Dec 16, 2025
e127136
Fix top-level parse error message
samestep Dec 16, 2025
60baea8
Sketch syntax for returning existential contexts
samestep Dec 18, 2025
91117e9
Copy `lib` directory into Nix builds
samestep Dec 22, 2025
6acffd8
Declare all primitive types in standard library
samestep Dec 22, 2025
bafe603
Use `io` instead of `include_str!` for the stdlib
samestep Dec 22, 2025
3332c4b
Write a comment about resolving symlinks
samestep Dec 22, 2025
67dd043
Start on automatic `import` handling in the stdlib
samestep Dec 22, 2025
568ae3a
Handle imports when loading the prelude
samestep Dec 22, 2025
02e9a9e
Add remaining operators to the lexer
samestep Dec 27, 2025
61d4026
Update parsing for specs and type definitions
samestep Dec 27, 2025
886bc31
Rework IR base types
samestep Dec 29, 2025
b91452f
Redefined `Instr`, `IR`, and `Names`
samestep Dec 29, 2025
0678525
Parse all three kinds of functions
samestep Dec 29, 2025
a21c31e
Redefine the `Lower` type
samestep Dec 29, 2025
05339e3
Parse the new method import syntax
samestep Dec 29, 2025
0ef53b6
Lower the new style of imports
samestep Dec 29, 2025
680d4f6
Process top-level declaration names
samestep Dec 30, 2025
49b4b82
Start trying to lower context specs and bindings
samestep Dec 30, 2025
78e73f8
Finish a first draft for lowering context bindings
samestep Dec 30, 2025
050460a
Finish drafting lowering for contextual needs
samestep Dec 30, 2025
4d7c4db
Lower all three kinds of type declarations
samestep Dec 30, 2025
4d29488
Lower all three kinds of function declarations
samestep Dec 30, 2025
0edcd04
Finish lowering declarations
samestep Dec 30, 2025
acefe55
Rework scaffolding around function body lowering
samestep Dec 30, 2025
ace3cd9
Remove unnecessary keywords
samestep Dec 30, 2025
3e51a58
Parse integer literals and nominal type literals
samestep Dec 30, 2025
09b16ca
Start updating expression lowering
samestep Jan 4, 2026
7726d9c
Fix all type errors in `lower.rs`
samestep Jan 5, 2026
7e4643d
Fix type errors in computing expression ranges
samestep Jan 8, 2026
91dc3a9
Fix type errors in Wasm codegen
samestep Jan 8, 2026
154a40a
Try to update Wasm and WASI in the stdlib
samestep Jan 8, 2026
9d82be0
Tweak Wasm memory types
samestep Jan 8, 2026
b8f2652
Start defining the `Std` context
samestep Jan 12, 2026
ac78d5e
Start writing the mapping from `Wasi` to `Std`
samestep Jan 12, 2026
39f25b0
Use `saturating_sub` in `IdRange::len`
samestep Jan 13, 2026
ceb760e
Start on the new "context fill" system for codegen
samestep Jan 13, 2026
e59acf8
Try to do more stuff
samestep Jan 13, 2026
fd7e9c0
Write a helper for getting a `Named` in codegen
samestep Jan 14, 2026
0ad34f3
Construct a `Fill` for the `Wasm` context
samestep Jan 14, 2026
01844d1
Flesh out more of the magic WASI context fill
samestep Jan 15, 2026
639d8df
Move `MemIdx` to the `assume` list for Wasm
samestep Jan 15, 2026
73b9fc4
Tweak types for Wasm immediates
samestep Jan 15, 2026
c837b74
Fix the rest of the generated boilerplate
samestep Jan 16, 2026
9b4a9b1
Fix the rest of the type errors in `Wasm::program`
samestep Jan 16, 2026
a0e9d5e
Start on new Wasm type layout
samestep Jan 20, 2026
8fe3589
Thread fills through local/tuple/record ops
samestep Jan 20, 2026
a28eb15
Draft the new `Wasm::instrs`
samestep Jan 20, 2026
5389c49
Fix `cargo check`
samestep Jan 20, 2026
31ecaaa
Allow dotted method names when parsing `Spec`
samestep Jan 20, 2026
1896cab
Fix detached method name binding
samestep Jan 20, 2026
caad206
Fix detached method name resolution
samestep Jan 20, 2026
70143cb
Identify all literal processing functions up front
samestep Jan 20, 2026
1bc969f
Collect type/literal declarations into a `Base`
samestep Jan 20, 2026
340a82b
Correctly parse `(I32, I32)` in the `Wasi` context
samestep Jan 21, 2026
30ec91d
Patch tagged expression parsing to ignore `RBrace`
samestep Jan 21, 2026
3a572ef
Parse `bind` in function return signature
samestep Jan 21, 2026
ea37f37
Parse `bind` expressions
samestep Jan 21, 2026
b269c7a
Remove unnecessary `return`
samestep Jan 21, 2026
1c3743e
Broaden the syntax for `assume`
samestep Jan 21, 2026
c00d312
Lower tuple type literals
samestep Jan 22, 2026
61ccb5f
Add `LowerError::Todo` for easier debugging
samestep Jan 22, 2026
b252d8e
Lower `bind` types
samestep Jan 22, 2026
d3d04b6
Fix imports in `lib/wasi.moss`
samestep Jan 22, 2026
41e968b
Parse integer literals
samestep Jan 22, 2026
25c06a9
Lower integer literals
samestep Jan 22, 2026
09a5db0
Correct Wasm names for division and remainder
samestep Jan 22, 2026
cd2750e
Start processing bindings in function bodies
samestep Jan 27, 2026
71e2644
Start implementing a divide-and-conquer algorithm
samestep Jan 28, 2026
54e6b6c
Implement divide-and-conquer
samestep Jan 29, 2026
409e377
Don't crash when item is missing in top context
samestep Jan 29, 2026
4904278
Document the various ID types in lowering
samestep Feb 6, 2026
d2fe8c3
Start sketching out a new static IR
samestep Feb 6, 2026
5afa9b2
Merge branch 'main' into ops
samestep Feb 9, 2026
784d965
Start using the new static IR
samestep Feb 9, 2026
c09fc00
Document the AST index types
samestep Feb 10, 2026
5884cfa
Lower simple context pieces
samestep Feb 10, 2026
8cf19da
Construct a context from needs
samestep Feb 10, 2026
7384e1b
Migrate extraction function signatures
samestep Feb 10, 2026
4ca0f14
Start handling need/provide distinction
samestep Feb 10, 2026
ad5e2eb
Don't emit needs in intermediate bindings
samestep Feb 10, 2026
3ee2dfd
Think about partial specs
samestep Feb 11, 2026
703e0f8
Tidy up a bit
samestep Feb 11, 2026
79aa0ab
Flesh out the static IR type a bit more
samestep Feb 11, 2026
a2e3a86
Merge branch 'main' into ops
samestep Feb 12, 2026
00d03e4
Write the rest of the `needs` processing function
samestep Feb 12, 2026
598fb48
Process binds that use punning
samestep Feb 12, 2026
04cafab
Mostly process binds that don't use punning
samestep Feb 12, 2026
06dc46e
Make special instructions to bind defined things
samestep Feb 12, 2026
ecb42f1
Mostly lower nominal types and type aliases
samestep Feb 12, 2026
53059c3
Lower function declarations
samestep Feb 13, 2026
10934d2
Process `val` and `context` declarations
samestep Feb 13, 2026
dc54e42
Clean up in preparation for lowering `fn` bodies
samestep Feb 13, 2026
73caf7a
Start refactoring function body lowering
samestep Feb 13, 2026
16831df
Merge the old and new IR instruction types
samestep Feb 13, 2026
9a5385d
Refactor statement-emitting code
samestep Feb 16, 2026
1cc55c4
Write the extraction/binding logic for literals
samestep Feb 16, 2026
5431670
Bundle as `Typed` more throughout `LowerBody`
samestep Feb 16, 2026
3ed8ffd
Use the actual literal itself when lowering
samestep Feb 16, 2026
f39372a
Lower contextual value accesses
samestep Feb 16, 2026
35b7ce4
Process nominally typed value literals
samestep Feb 16, 2026
51fa06a
Lower record literals
samestep Feb 16, 2026
c60d87c
Lower record field accesses
samestep Feb 16, 2026
d8f90b6
Note bug in nominal literal typechecking
samestep Feb 17, 2026
62865e0
Lower function calls
samestep Feb 17, 2026
e9bdd2e
Distinguish between functions and signatures
samestep Feb 17, 2026
3fb9dca
Process method calls
samestep Feb 17, 2026
ceb2e6e
Remove an unused `use`
samestep Feb 17, 2026
ea7e469
Lower `if`/`else`
samestep Feb 18, 2026
da71577
Finish fixing lowering type errors
samestep Feb 18, 2026
bafa5e4
Start refactoring codegen to use the new IR
samestep Feb 18, 2026
0a61bb8
Simplify representations in codegen
samestep Feb 18, 2026
10ffcf2
Stub out an interpreter for function body IR
samestep Feb 18, 2026
62bafda
Implement interpreter for some static instructions
samestep Feb 20, 2026
25fd002
Flesh out more of the interpreter
samestep Feb 20, 2026
fc5a552
Fix code to get tuple elements and record fields
samestep Feb 20, 2026
0fa11b9
Get the project to at least build again
samestep Feb 23, 2026
05c01c6
Restructure the static IR using lambdas
samestep Feb 23, 2026
b87ec9c
Start refactoring decl lowering
samestep Feb 23, 2026
7866444
Process contextual needs using lambdas
samestep Feb 23, 2026
0710ac0
Process pun binds and literal binds
samestep Feb 23, 2026
3969c51
Start refactoring how "invoke" and "extract" work
samestep Feb 24, 2026
da35c6b
Fix typo
samestep Feb 24, 2026
b08c94e
Refactor the general case for binds
samestep Feb 24, 2026
d8b089b
Finish refactoring decl processing
samestep Feb 24, 2026
8e57ded
Fix type errors in codegen
samestep Feb 24, 2026
055c383
Refactor function and method call processing
samestep Feb 24, 2026
3b3437b
Fix remaining type errors
samestep Feb 24, 2026
7475d5d
Start implementing a human-readable IR dump
samestep Feb 25, 2026
0edf474
Make dump output nicer and more deterministic
samestep Feb 25, 2026
e4fdd6b
Print unfinished instruction bodies at the end
samestep Feb 25, 2026
e5afe84
Implement more instruction dumping
samestep Feb 25, 2026
acaf884
Dump more stuff
samestep Feb 25, 2026
4115280
Comment the different fields of the `IR` struct
samestep Mar 5, 2026
62e205e
Start function body IR with function signature IR
samestep Mar 5, 2026
42f0786
Use the `todo` method more consistently
samestep Mar 6, 2026
0cc6b95
Implement a "base case" for "invoke" and "extract"
samestep Mar 10, 2026
306d3ad
Factor out a query to compare lambda domains
samestep Mar 11, 2026
6dd21c5
Implement a method to duplicate instructions
samestep Mar 11, 2026
7d76a9f
Use `duplicate` for lambda domain comparison
samestep Mar 11, 2026
a892ea8
Handle duplicating closed-over values
samestep Mar 12, 2026
e376947
Use `duplicate` to implement `invoke` too
samestep Mar 12, 2026
03a2414
Fix off-by-one error for duplicating lambda bodies
samestep Mar 12, 2026
57ad011
Implement `duplicate` for most static instructions
samestep Mar 12, 2026
5e13ead
Sketch out a graph IR
samestep Mar 18, 2026
2f159ba
Start refactoring to use the new graph structure
samestep Mar 19, 2026
98a458c
Fix the `bind` method in lowering
samestep Mar 20, 2026
b7928cf
Refactor the rest of decl handling
samestep Mar 20, 2026
88f42c4
Fix a couple other type errors
samestep Mar 20, 2026
b92b5cf
Start migrating body lowering too
samestep Mar 20, 2026
b34a85e
Don't think about the non-graph-IR during lowering
samestep Mar 20, 2026
2e362c4
Get it to at least compile again
samestep Mar 20, 2026
0a8e1a3
Distinguish between lambda parameters and scope
samestep Mar 23, 2026
5ed55cd
Implement basic node constructor methods
samestep Mar 23, 2026
11317df
Start on a rudimentary new `dump` for the graph IR
samestep Mar 23, 2026
28656d2
Write out the basic query implementation structure
samestep Mar 24, 2026
ad05662
Dump top-level definitions in order
samestep Mar 24, 2026
0b1ffd0
Dump the whole graph IR
samestep Mar 24, 2026
35d1d86
Implement a `raise` utility method
samestep Mar 24, 2026
ce6b3f9
Factor out more general "extract" query form
samestep Mar 25, 2026
7049b5a
Declare a method to synthesize lambdas
samestep Mar 26, 2026
4830508
Correctly bail from TODO
samestep Mar 26, 2026
f3a5285
Implement a trivial base case for `synthesize`
samestep Mar 26, 2026
ab0db57
Implement the rest of `raise`
samestep Mar 26, 2026
5b1aeb5
Implement `invoke_need` using `extract_ty_lambda`
samestep Mar 26, 2026
fb2a5b2
Start on helpers to explode and substitute nodes
samestep Mar 27, 2026
8c0971d
Finish `substitute` via a new general `transform`
samestep Mar 27, 2026
c9f7e94
Merge branch 'main' into ops
samestep Mar 30, 2026
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ anyhow = "1"
clap = "4"
crossbeam-channel = "0.5"
enumset = "1"
im-rc = "15"
index_vec = "0.1"
indexmap = "2"
itertools = "0.14"
Expand Down
7 changes: 4 additions & 3 deletions crates/moss-cli/src/bin/moss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ fn compile(script: &str) -> anyhow::Result<Vec<u8>> {
let tree = parse(&tokens).map_err(|err| match err {
ParseError::Expected { id, tokens: _ } => compiler.error(starts[id], &err.message()),
})?;
let (mut ir, mut names, lib) = prelude();
let (mut ir, mut names, base, lib) = prelude();
let module = lower(
&source,
&starts,
&tree,
&mut ir,
&mut names,
Some(base),
lib.prelude,
&[],
)
Expand All @@ -69,8 +70,8 @@ fn compile(script: &str) -> anyhow::Result<Vec<u8>> {
};
compiler.error(start, &message)
})?;
let start = names.fndefs[&(module, ir.strings.get_id("main").unwrap())];
let bytes = wasm(&ir, &names, lib, start);
let start = names.names[&(module, ir.strings.get_id("main").unwrap())].fndef();
let bytes = wasm(&mut ir, &names, lib, start);
Ok(bytes)
}

Expand Down
1 change: 0 additions & 1 deletion crates/moss-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition.workspace = true

[dependencies]
enumset = { workspace = true }
im-rc = { workspace = true }
index_vec = { workspace = true }
indexmap = { workspace = true }
itertools = { workspace = true }
Expand Down
Loading
Loading