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

20220629 typed language #33

Open
wants to merge 168 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
5e0f6b0
All needed code transcribed from haskell implementation ... first we'…
prozacchiwawa Jun 30, 2022
4580b16
Ensure theory is represented
prozacchiwawa Jun 30, 2022
e336aa3
mod
prozacchiwawa Jun 30, 2022
22448ba
ported haskell implementation of 'Jana Dunfield and Neelakantan R. Kr…
prozacchiwawa Jun 30, 2022
385d5b4
Cradle for testing type theory
prozacchiwawa Jul 1, 2022
53b64bd
Start nailing down typed expressions
prozacchiwawa Jul 2, 2022
4564294
More tests
prozacchiwawa Jul 2, 2022
7347f85
More
prozacchiwawa Jul 2, 2022
0a80f01
More
prozacchiwawa Jul 2, 2022
e802e4b
more
prozacchiwawa Jul 2, 2022
1f6a9bb
Start unwinding type inf
prozacchiwawa Jul 6, 2022
0a5d2aa
Fix up guard i missed in TExists cases in subtype
prozacchiwawa Jul 9, 2022
dd1bd46
Add test
prozacchiwawa Jul 9, 2022
c50903d
WIP more type checking ... i think i'm understanding more of the comp…
prozacchiwawa Jul 10, 2022
ea3d747
Make drop and break more monadic, separate hypothesis from evolution …
prozacchiwawa Jul 10, 2022
0e6f202
More type resolution at the endpoints
prozacchiwawa Jul 11, 2022
e03c883
more working typings
prozacchiwawa Jul 12, 2022
c3b9e77
enough is functioning that we can describe functions by variable name…
prozacchiwawa Jul 12, 2022
3be61a1
We typecheck apply, but maybe not synthesize properly from it yet
prozacchiwawa Jul 12, 2022
35979b9
All type checking
prozacchiwawa Jul 14, 2022
c044b42
some is not a special expr anymore either, just a type signature
prozacchiwawa Jul 14, 2022
f81c367
More well formed assertions
prozacchiwawa Jul 14, 2022
4d6d35e
More well formed assertions
prozacchiwawa Jul 14, 2022
bc9aa92
Well formed assertions
prozacchiwawa Jul 14, 2022
9b5c53c
preliminary support for type applications and named polymorphic types…
prozacchiwawa Jul 15, 2022
cc102f3
Add typeable tests for list with annotation
prozacchiwawa Jul 15, 2022
f0cad78
Add a way to accumulate helper functions in typetest
prozacchiwawa Jul 15, 2022
3a0dd49
WIP checkpoint
prozacchiwawa Jul 15, 2022
1183751
All tests passing again, i have pretty good confidence after wringing…
prozacchiwawa Jul 18, 2022
8be25c5
Start adding types in the chialisp language itself
prozacchiwawa Jul 18, 2022
f4cfd75
Block out type checking chialisp programs
prozacchiwawa Jul 18, 2022
7b682cb
More tests
prozacchiwawa Jul 19, 2022
c6d7a7e
Enough to do basic args
prozacchiwawa Jul 19, 2022
a81ef36
We have the first working type annotation of a chialisp program
prozacchiwawa Jul 19, 2022
3f1585d
Simple argument destructuring type smoke test
prozacchiwawa Jul 19, 2022
971b49e
Test of 'c' operator type
prozacchiwawa Jul 19, 2022
f544a32
sha256 yields atom32
prozacchiwawa Jul 19, 2022
3d8ec07
Show that Atom doesn't subtype (Atom 32)
prozacchiwawa Jul 19, 2022
448c37b
Added a more ergonomic syntax for typing
prozacchiwawa Jul 20, 2022
c37dd3c
Fixing more stuff, formalizing into chialisp rather than abstract in …
prozacchiwawa Jul 20, 2022
dd83b50
More checks
prozacchiwawa Jul 20, 2022
bffc77f
Add more typing tests; move onto 'if'
prozacchiwawa Jul 21, 2022
59c3fc9
macros involving apply should be well formed now
prozacchiwawa Jul 21, 2022
f341a40
Fixed a bunch of things (turns out solve was something adding things …
prozacchiwawa Jul 21, 2022
2037cd3
Abstract deftype routed
prozacchiwawa Jul 22, 2022
71fc51a
Provide struct and helpers
prozacchiwawa Jul 25, 2022
37acfe9
add failing struct member type test
prozacchiwawa Jul 25, 2022
4548adb
Last feature of structs: construction
prozacchiwawa Jul 25, 2022
9ecccea
WIP: almost done with untype
prozacchiwawa Jul 26, 2022
3b5d8f6
type stripping functions and type generated inlines working
prozacchiwawa Jul 26, 2022
1a6ddbe
Add prims
prozacchiwawa Jul 26, 2022
5d25f43
Add typecheck command line argument
prozacchiwawa Jul 26, 2022
5d4791f
We can do structs with type variables
prozacchiwawa Jul 27, 2022
6559b13
Member access in structs with variables
prozacchiwawa Jul 27, 2022
d9f385c
test of bless
prozacchiwawa Jul 27, 2022
c19bfaf
Final bits: ensure let is well typed
prozacchiwawa Jul 27, 2022
6335eec
Todos neutralized so we won't panic unexpectedly
prozacchiwawa Jul 27, 2022
8a072b9
Fix some clippy traffic
prozacchiwawa Jul 27, 2022
a222657
Add doc
prozacchiwawa Jul 27, 2022
7dce442
Missing
prozacchiwawa Jul 27, 2022
226cea9
fmt
prozacchiwawa Jul 27, 2022
c79a720
fmt
prozacchiwawa Jul 27, 2022
506ae09
Move quotes to stop fmt spiral
prozacchiwawa Jul 27, 2022
34b5a72
fix strong clippy warning
prozacchiwawa Jul 27, 2022
7ebdd26
Loosen f and r on lists
prozacchiwawa Jul 27, 2022
8722796
fmt
prozacchiwawa Jul 27, 2022
d04a551
ensure that List and other TApps synthesize their representation for …
prozacchiwawa Jul 27, 2022
ad22f3c
fmt
prozacchiwawa Jul 27, 2022
1b9ea84
Ensure the repl can use the new type generated helpers
prozacchiwawa Jul 27, 2022
8cd9700
fmt
prozacchiwawa Jul 27, 2022
5aadc18
Change (Atom 32) to Atom32
prozacchiwawa Jul 28, 2022
cc559a7
fmt
prozacchiwawa Jul 28, 2022
a4df5b1
More stuff, changed type application order and added FixedList
prozacchiwawa Jul 29, 2022
1373625
Fmt
prozacchiwawa Jul 29, 2022
93d2d23
Some more fixes, new test, write types.md
prozacchiwawa Jul 29, 2022
a5f65ac
fmt
prozacchiwawa Jul 29, 2022
a9de3a0
Last additions
prozacchiwawa Jul 29, 2022
d338b6d
fix
prozacchiwawa Jul 29, 2022
73aa729
fix doc
prozacchiwawa Jul 29, 2022
c0ae901
clean up prose
prozacchiwawa Jul 29, 2022
0e6c1ce
Fix
prozacchiwawa Jul 29, 2022
0f01621
File removed
prozacchiwawa Jul 30, 2022
2583a0e
Add tests for examples in types.md and more tests that differing stru…
prozacchiwawa Jul 31, 2022
32b9122
fmt
prozacchiwawa Jul 31, 2022
83d2504
forgotten tag
prozacchiwawa Jul 31, 2022
bc00628
Tweak reify, fix issues in context and other places. De-recurse appl…
prozacchiwawa Aug 20, 2022
7b8e38f
Some additional tests that pin things down
prozacchiwawa Aug 20, 2022
002330c
fmt
prozacchiwawa Aug 20, 2022
db25a58
Merge branch 'base' into 20220629-typed-language
prozacchiwawa Aug 20, 2022
d643f87
Update cargo.lock
prozacchiwawa Aug 20, 2022
2645846
bring in base after big clippy merged and purify
prozacchiwawa Sep 15, 2022
2b76409
fmt
prozacchiwawa Sep 15, 2022
55ffa43
clippy
prozacchiwawa Sep 15, 2022
17a30ab
mirror removed artifacts
prozacchiwawa Sep 15, 2022
1ecb9b1
Update to current base
prozacchiwawa Oct 27, 2022
3d1d114
pull in base
prozacchiwawa Oct 31, 2022
782e6cd
Merge up base
prozacchiwawa Nov 9, 2022
6d91994
fmt + clippy
prozacchiwawa Nov 9, 2022
9fcbb3b
clippy
prozacchiwawa Nov 9, 2022
1f44130
fmt
prozacchiwawa Nov 9, 2022
cff4037
Pull in base
prozacchiwawa Dec 4, 2022
e00810e
Merge up
prozacchiwawa Dec 16, 2022
4c9a9d9
Merge up
prozacchiwawa Dec 16, 2022
bbcbd7a
Merge up
prozacchiwawa Jan 12, 2023
2d48a83
Merge up
prozacchiwawa Feb 1, 2023
d46bd94
fmt + clippy + merge
prozacchiwawa Feb 1, 2023
282b65a
Merge up
prozacchiwawa Feb 5, 2023
b667d14
fmt + clippy
prozacchiwawa Feb 5, 2023
beb655a
Lower stack limit for the moment. Will add a trampoline to evaluate
prozacchiwawa Feb 5, 2023
5fd4d59
Merge up
prozacchiwawa Mar 16, 2023
0239d3e
fmt
prozacchiwawa Mar 16, 2023
cca4617
Merge up
prozacchiwawa Apr 6, 2023
e76ce50
fmt + clippy
prozacchiwawa Apr 6, 2023
4d7874a
Merge remote-tracking branch 'chia/base' into 20220629-typed-language
prozacchiwawa Apr 19, 2023
f7f15e4
Merge remote-tracking branch 'chia/base' into 20220629-typed-language
prozacchiwawa May 15, 2023
429f107
Add coverage
prozacchiwawa May 15, 2023
92cea6f
fmt
prozacchiwawa May 15, 2023
45e1891
More coverage
prozacchiwawa May 15, 2023
08d59de
fmt
prozacchiwawa May 15, 2023
18b96df
Test that subtype recognizes that an existential tv subtypes itself w…
prozacchiwawa May 15, 2023
7580f51
fmt
prozacchiwawa May 15, 2023
7bc1dff
More coverage
prozacchiwawa May 15, 2023
66b4b03
More coverage
prozacchiwawa May 16, 2023
1d5f473
more coverage
prozacchiwawa May 16, 2023
c53ed3f
More coverage
prozacchiwawa May 16, 2023
15476b3
Tighten up theory a bit
prozacchiwawa May 16, 2023
7f7176f
Merge rest args with types
prozacchiwawa Aug 2, 2023
5e3cc15
fmt
prozacchiwawa Aug 2, 2023
e98c841
Merge up
prozacchiwawa Aug 3, 2023
e6a9c6f
Merge up base
prozacchiwawa Aug 8, 2023
4fc31c3
Merge up
prozacchiwawa Sep 8, 2023
9ca0d9b
fmt + clippy
prozacchiwawa Sep 8, 2023
5156b7e
Merge up
prozacchiwawa Sep 13, 2023
5038f8b
Merge up
prozacchiwawa Sep 14, 2023
70a4ada
Merge up
prozacchiwawa Sep 14, 2023
50c475f
Merge up
prozacchiwawa Sep 19, 2023
d818611
Remove unused
prozacchiwawa Sep 26, 2023
b68405a
Almost working (WIP)
prozacchiwawa Mar 6, 2024
1b4d3c0
Merge rebuild of types onto this merge branch
prozacchiwawa Mar 6, 2024
59cc99e
fmt
prozacchiwawa Mar 6, 2024
654d11a
Some dependency updates
prozacchiwawa Mar 6, 2024
db74763
Cargo lock update
prozacchiwawa Mar 6, 2024
b990cea
Add types tests
prozacchiwawa Mar 6, 2024
a09c814
Ensure log init is done everywhere needed
prozacchiwawa Mar 6, 2024
18accee
Add an initializer to the tests for logging
prozacchiwawa Mar 6, 2024
b1b10c3
Temporary change to verify what's happening in the coverage step
prozacchiwawa Mar 6, 2024
46d069c
Temporary change to verify what's happening in the coverage step
prozacchiwawa Mar 6, 2024
51d6f8a
Merge pull request #70 from Chia-Network/20240305-update-types
prozacchiwawa Mar 6, 2024
4ef94e4
Do a merge step to fix file heritage
prozacchiwawa Mar 6, 2024
7c27408
Upgrade env_logger
prozacchiwawa Mar 6, 2024
7aec906
Remove dependency on anstream for older/alternate builds
prozacchiwawa Mar 6, 2024
ed37a37
Remove dependency on anstream for older/alternate builds
prozacchiwawa Mar 6, 2024
0da8797
Compiler upgrade for most recent version of env_logger
prozacchiwawa Mar 6, 2024
a602aee
Try specifying rustc version via env
prozacchiwawa Mar 6, 2024
035d7a0
Set env_filter version
prozacchiwawa Mar 6, 2024
7d2577b
Try specifying 1.71
prozacchiwawa Mar 6, 2024
18a26b4
Try upgrading maturin image
prozacchiwawa Mar 6, 2024
89ef972
Same change in extensive tests
prozacchiwawa Mar 6, 2024
552e800
Update lock files
prozacchiwawa Mar 6, 2024
b4a03e7
Try going back one maturin rev
prozacchiwawa Mar 7, 2024
13273af
Try another version ago
prozacchiwawa Mar 7, 2024
1c55fdb
Reset to baseline
prozacchiwawa Mar 7, 2024
81b1b75
Try without log
prozacchiwawa Mar 7, 2024
8a73d77
One update, refresh lock files
prozacchiwawa Mar 7, 2024
2a7d0bc
fmt + clippy
prozacchiwawa Mar 7, 2024
7aa40d4
Merge pull request #72 from Chia-Network/20240306-try-without-log
prozacchiwawa Mar 7, 2024
a9c2806
Merge up
prozacchiwawa Apr 22, 2024
84801f1
Merge up
prozacchiwawa Apr 22, 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
104 changes: 47 additions & 57 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ indoc = "1.0"
do-notation = "0.1.3"
serde_json = "1.0"
sha2 = "0.9.5"
tempfile = "3.3.0"
tempfile = "3.10.1"
clvmr = { version = "0.3.2", features = ["pre-eval"] }
binascii = "0.1.4"
yaml-rust = "0.4"
Expand All @@ -51,6 +51,7 @@ optional = true
rand = "0.8.5"
rand_chacha = "0.3.1"
lfsr = "0.3.0"
ctor = "0.2.7"

[lib]
name = "clvm_tools_rs"
Expand Down
8 changes: 8 additions & 0 deletions resources/tests/strict/typesmoke-lambda-anno.clsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(mod ((X : Atom) (Y : Atom)) -> Atom
(include *standard-cl-23*)
(defun plus-n ((N : Atom)) -> (Exec ((Pair Atom Unit) -> Atom))
(lambda ((& N) Y) (+ N Y))
)

(a (plus-n X) (list Y))
)
9 changes: 9 additions & 0 deletions resources/tests/strict/typesmoke-lambda.clsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(mod ((X : (Pair Atom Unit))) -> (Pair Atom Any)
(include *standard-cl-23*)
(deftype T (x))
(assign
x_of_t (get_T_x (new_T X))
lam (a (lambda (Y) (+ Y 1)) (list x_of_t))
(c x_of_t lam)
)
)
5 changes: 5 additions & 0 deletions resources/tests/strict/typesmoke.clsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(mod ((X : (Pair Atom Unit))) -> Atom
(include *standard-cl-23*)
(deftype T (x))
(get_T_x (new_T X))
)
1 change: 0 additions & 1 deletion src/classic/bins/repl.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extern crate clvmr as clvm_rs;

use std::io::{self, BufRead, Write};

use std::rc::Rc;

use clvm_rs::allocator::Allocator;
Expand Down
4 changes: 3 additions & 1 deletion src/classic/clvm_tools/clvmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::compiler::dialect::detect_modern;
use crate::compiler::optimize::maybe_finalize_program_via_classic_optimizer;
use crate::compiler::runtypes::RunFailure;
use crate::compiler::srcloc::Srcloc;
use crate::compiler::untype::untype_code;
use crate::util::gentle_overwrite;

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -92,6 +93,7 @@ pub fn compile_clvm_text_maybe_opt(
) -> Result<NodePtr, CompileError> {
let ir_src = read_ir(text).map_err(|s| EvalErr(allocator.null(), s.to_string()))?;
let assembled_sexp = assemble_from_ir(allocator, Rc::new(ir_src))?;
let untyped_sexp = untype_code(allocator, Srcloc::start(input_path), assembled_sexp)?;

let dialect = detect_modern(allocator, assembled_sexp);
// Now the stepping is optional (None for classic) but we may communicate
Expand All @@ -118,7 +120,7 @@ pub fn compile_clvm_text_maybe_opt(
Ok(convert_to_clvm_rs(allocator, res)?)
} else {
let compile_invoke_code = run(allocator);
let input_sexp = allocator.new_pair(assembled_sexp, allocator.null())?;
let input_sexp = allocator.new_pair(untyped_sexp, allocator.null())?;
let run_program = run_program_for_search_paths(input_path, &opts.get_search_paths(), false);
if classic_with_opts {
run_program.set_compiler_opts(Some(opts));
Expand Down
Loading
Loading