Skip to content

Commit d46116e

Browse files
committed
remove version flag
1 parent f296e3c commit d46116e

8 files changed

Lines changed: 4306 additions & 4361 deletions

File tree

BOOTSTRAP/cli.c

Lines changed: 4293 additions & 4299 deletions
Large diffs are not rendered by default.

BOOTSTRAP/monolithic.lsts

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3755,10 +3755,6 @@ let ast-parsed-program = mk-eof();
37553755
let parse-suffixes = [] : List<(CString,Type)>;
37563756
non-zero(parse-suffixes); # TODO remove
37573757

3758-
let config-v3 = true;
3759-
let config-v1 = false;
3760-
let config-v0 = false;
3761-
37623758
let .skey(t: Token): String = intern(t.key);
37633759
type AST implements DefaultFormattable;
37643760

@@ -5362,12 +5358,10 @@ let $"||"(lctx: Maybe<TypeContext>, rctx: Maybe<TypeContext>): Maybe<TypeContext
53625358

53635359
let .phi-append(tctx-primary: TypeContext?, tctx-secondary: TypeContext?): TypeContext? = (
53645360
tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,false) )
5365-
#tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,false).prune-moved )
53665361
);
53675362

53685363
let .phi-append-dead-on-arrival(tctx-primary: TypeContext?, tctx-secondary: TypeContext?): TypeContext? = (
53695364
tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,true) )
5370-
# tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,true).prune-moved )
53715365
);
53725366

53735367
let .phi-append(tctx-primary: PBTree<U64,PhiContextRow>, tctx-secondary: PBTree<U64,PhiContextRow>, dead-on-arrival: Bool): PBTree<U64,PhiContextRow> = (
@@ -7752,9 +7746,7 @@ let std-infer-call-arg(tctx: TypeContext?, term: AST, function-name: CString, hi
77527746
}} else if function-name==c"map::cons" { match term {
77537747
App{k=left, m=right} => (
77547748
(tctx, let new-k) = std-infer-expr(tctx, k, false, Call(function-name), ta);
7755-
let direct-hint = if config-v3 or config-v23
7756-
then t2(c"Hashtable",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2) && t0(c"ReturnHint")
7757-
else t2(c"HashtableEq",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2);
7749+
let direct-hint = t2(c"Hashtable",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2) && t0(c"ReturnHint");
77587750
(tctx, let new-m) = std-infer-expr(tctx, m, false, Used(), direct-hint);
77597751
if not(is(k,new-k)) or not(is(m,new-m)) then { k = new-k; m = new-m; term = mk-cons(k, m); };
77607752
tctx = tctx.ascript(term, t2(c"Cons",typeof-term(k),typeof-term(m)));
@@ -9168,7 +9160,6 @@ let ast-typed-count = 0_sz;
91689160
let config-print-ast = false;
91699161

91709162
let main(argc: C_int, argv: CString[]): Nil = (
9171-
config-v23 = false;
91729163
let argi = 1_sz;
91739164
let input = [] : List<CString>;
91749165
let highlight = false;
@@ -9181,11 +9172,6 @@ let main(argc: C_int, argv: CString[]): Nil = (
91819172
c"--parse" => config-mode = ModeParse();
91829173
c"--preprocess" => config-mode = ModePreprocess();
91839174
c"--compile" => config-mode = ModeCompile();
9184-
c"--v0" => (config-v3 = false; config-v0 = true;);
9185-
c"--v1" => (config-v3 = false; config-v1 = true;);
9186-
c"--v2" => config-v3 = false;
9187-
c"--v23" => (config-v3 = false; config-v23 = true;);
9188-
c"--v3" => config-v3 = true;
91899175
c"--highlight" => (
91909176
config-mode = ModeTokenize();
91919177
highlight = true;
@@ -13609,7 +13595,6 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
1360913595
lsts-parse-expect(c"[Type Tag]", tokens);
1361013596
};
1361113597
let base = lsts-substitute-type-aliases(lsts-parse-head(tokens)); tokens = tail(tokens);
13612-
if not(config-v3) and not(config-v23) and base==c"Hashtable" then base = c"HashtableEq";
1361313598
while non-zero(tokens) and lsts-parse-head(tokens)==c":" and lsts-parse-head(tail(tokens))==c":" {
1361413599
lsts-parse-expect(c":", tokens); tokens = tail(tokens);
1361513600
lsts-parse-expect(c":", tokens); tokens = tail(tokens);
@@ -13633,11 +13618,7 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
1363313618
};
1363413619
lsts-parse-expect(c">", tokens); tokens = tail(tokens);
1363513620
};
13636-
if not(config-v3) and not(config-v23) and base==c"OwnedData" and args.length==1 {
13637-
head(args);
13638-
} else if base==c"CompatOwnedData" and args.length==1 {
13639-
t1(c"OwnedData",head(args));
13640-
} else ts( base, args );
13621+
ts( base, args );
1364113622
};
1364213623
while lsts-parse-head(tokens) == c"[" or lsts-parse-head(tokens)==c"?" {
1364313624
if lsts-parse-head(tokens)==c"[" {
@@ -13949,9 +13930,7 @@ let lsts-parse-mul(tokens: List<Token>): Tuple<AST,List<Token>> = (
1394913930

1395013931
let lsts-parse-map(tokens: List<Token>): Tuple<AST,List<Token>> = (
1395113932
lsts-parse-expect(c"{", tokens); let loc = head(tokens).location; tokens = tail(tokens);
13952-
let term = if config-v3 or config-v23
13953-
then mk-app( Var( c"mk-hashtable", with-location(mk-token("mk-hashtable"),loc) ), mk-nil() )
13954-
else Lit( c"HashtableEqEOF", with-location(mk-token("HashtableEqEOF"),loc) );
13933+
let term = mk-app( Var( c"mk-hashtable", with-location(mk-token("mk-hashtable"),loc) ), mk-nil() );
1395513934
if lsts-parse-head(tokens)==c"for" {
1395613935
fail("TODO map comprehension at \{loc}\n")
1395713936
} else {
@@ -14202,15 +14181,11 @@ let lsts-parse-typedef(tokens: List<Token>): (AST, List<Token>) = (
1420214181
lsts-parse-expect(c"implies", tokens); tokens = tail(tokens);
1420314182
(let i, tokens) = lsts-parse-type(tokens);
1420414183
if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
14205-
else if config-v23 and i.is-t(c"MustRelease",0) then ()
14206-
else if config-v23 and i.is-t(c"MustRetain",0) then ()
1420714184
else infers = infers.push(i);
1420814185
while lsts-parse-head(tokens)==c"," {
1420914186
lsts-parse-expect(c",", tokens); tokens = tail(tokens);
1421014187
(i, tokens) = lsts-parse-type(tokens);
1421114188
if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
14212-
else if config-v23 and i.is-t(c"MustRelease",0) then ()
14213-
else if config-v23 and i.is-t(c"MustRetain",0) then ()
1421414189
else infers = infers.push(i);
1421514190
}
1421614191
};

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ LSTSFLAGS = MALLOC_CHECK_=3
88
# recommendation: ulimit -s unlimited
99

1010
dev: install-production
11-
lm --v3 --print-ast tests/promises/lm-ast/constructor.lsts > out.txt
11+
lm --print-ast tests/promises/lm-ast/constructor.lsts > out.txt
1212
gcc tmp.c
1313
./a.out
1414

1515
build: compile-production
16-
time env $(LSTSFLAGS) ./production --v3 -o deploy1.c SRC/index.lsts
16+
time env $(LSTSFLAGS) ./production -o deploy1.c SRC/index.lsts
1717
$(CC) $(CFLAGS) deploy1.c -o deploy1
18-
time env $(LSTSFLAGS) ./deploy1 --v3 -o deploy2.c SRC/index.lsts
18+
time env $(LSTSFLAGS) ./deploy1 -o deploy2.c SRC/index.lsts
1919
diff deploy1.c deploy2.c
2020
mv deploy1.c BOOTSTRAP/cli.c
2121
rm -f deploy1 deploy1.c deploy2.c
2222
cargo test regression_tests
2323

2424
gperf: install-bootstrap
25-
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libprofiler.so CPUPROFILE=out.prof lm --v3 SRC/index.lsts
25+
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libprofiler.so CPUPROFILE=out.prof lm SRC/index.lsts
2626
google-pprof --text /home/andrew/.local/bin/lm out.prof > profile_results.txt
2727

2828
deploy: build smoke-test
@@ -36,7 +36,7 @@ gprofng-view:
3636
nano gprofng.view
3737

3838
valgrind: install-production
39-
valgrind --tool=callgrind lm --v3 SRC/index.lsts
39+
valgrind --tool=callgrind lm SRC/index.lsts
4040

4141
valgrind-view:
4242
callgrind_annotate callgrind.out.18778
@@ -52,7 +52,7 @@ gprof-view-call-graph:
5252
gprof -q bootstrap.exe gmon.out
5353

5454
profile: install-bootstrap
55-
perf record lm --v2 SRC/index.lsts
55+
perf record lm SRC/index.lsts
5656
./report.sh
5757

5858
compile-bootstrap:
@@ -62,7 +62,7 @@ compile-bootstrap:
6262

6363
compile-production: compile-bootstrap
6464
rm -f production
65-
$(LSTSFLAGS) time ./bootstrap.exe --v3 -o production.c SRC/index.lsts
65+
$(LSTSFLAGS) time ./bootstrap.exe -o production.c SRC/index.lsts
6666
$(CC) $(CFLAGS) -o production production.c
6767
rm -f production.c
6868

PLUGINS/FRONTEND/LSTS/lsts-parse.lsts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
355355
lsts-parse-expect(c"[Type Tag]", tokens);
356356
};
357357
let base = lsts-substitute-type-aliases(lsts-parse-head(tokens)); tokens = tail(tokens);
358-
if not(config-v3) and not(config-v23) and base==c"Hashtable" then base = c"HashtableEq";
359358
while non-zero(tokens) and lsts-parse-head(tokens)==c":" and lsts-parse-head(tail(tokens))==c":" {
360359
lsts-parse-expect(c":", tokens); tokens = tail(tokens);
361360
lsts-parse-expect(c":", tokens); tokens = tail(tokens);
@@ -379,11 +378,7 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
379378
};
380379
lsts-parse-expect(c">", tokens); tokens = tail(tokens);
381380
};
382-
if not(config-v3) and not(config-v23) and base==c"OwnedData" and args.length==1 {
383-
head(args);
384-
} else if base==c"CompatOwnedData" and args.length==1 {
385-
t1(c"OwnedData",head(args));
386-
} else ts( base, args );
381+
ts( base, args );
387382
};
388383
while lsts-parse-head(tokens) == c"[" or lsts-parse-head(tokens)==c"?" {
389384
if lsts-parse-head(tokens)==c"[" {
@@ -695,9 +690,7 @@ let lsts-parse-mul(tokens: List<Token>): Tuple<AST,List<Token>> = (
695690

696691
let lsts-parse-map(tokens: List<Token>): Tuple<AST,List<Token>> = (
697692
lsts-parse-expect(c"{", tokens); let loc = head(tokens).location; tokens = tail(tokens);
698-
let term = if config-v3 or config-v23
699-
then mk-app( Var( c"mk-hashtable", with-location(mk-token("mk-hashtable"),loc) ), mk-nil() )
700-
else Lit( c"HashtableEqEOF", with-location(mk-token("HashtableEqEOF"),loc) );
693+
let term = mk-app( Var( c"mk-hashtable", with-location(mk-token("mk-hashtable"),loc) ), mk-nil() );
701694
if lsts-parse-head(tokens)==c"for" {
702695
fail("TODO map comprehension at \{loc}\n")
703696
} else {
@@ -948,15 +941,11 @@ let lsts-parse-typedef(tokens: List<Token>): (AST, List<Token>) = (
948941
lsts-parse-expect(c"implies", tokens); tokens = tail(tokens);
949942
(let i, tokens) = lsts-parse-type(tokens);
950943
if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
951-
else if config-v23 and i.is-t(c"MustRelease",0) then ()
952-
else if config-v23 and i.is-t(c"MustRetain",0) then ()
953944
else infers = infers.push(i);
954945
while lsts-parse-head(tokens)==c"," {
955946
lsts-parse-expect(c",", tokens); tokens = tail(tokens);
956947
(i, tokens) = lsts-parse-type(tokens);
957948
if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
958-
else if config-v23 and i.is-t(c"MustRelease",0) then ()
959-
else if config-v23 and i.is-t(c"MustRetain",0) then ()
960949
else infers = infers.push(i);
961950
}
962951
};

SRC/ast-misc-globals.lsts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,3 @@ let ast-parsed-program = mk-eof();
2828

2929
let parse-suffixes = [] : List<(CString,Type)>;
3030
non-zero(parse-suffixes); # TODO remove
31-
32-
let config-v3 = true;
33-
let config-v1 = false;
34-
let config-v0 = false;

SRC/typecheck-infer-expr.lsts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,7 @@ let std-infer-call-arg(tctx: TypeContext?, term: AST, function-name: CString, hi
542542
}} else if function-name==c"map::cons" { match term {
543543
App{k=left, m=right} => (
544544
(tctx, let new-k) = std-infer-expr(tctx, k, false, Call(function-name), ta);
545-
let direct-hint = if config-v3 or config-v23
546-
then t2(c"Hashtable",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2) && t0(c"ReturnHint")
547-
else t2(c"HashtableEq",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2);
545+
let direct-hint = t2(c"Hashtable",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2) && t0(c"ReturnHint");
548546
(tctx, let new-m) = std-infer-expr(tctx, m, false, Used(), direct-hint);
549547
if not(is(k,new-k)) or not(is(m,new-m)) then { k = new-k; m = new-m; term = mk-cons(k, m); };
550548
tctx = tctx.ascript(term, t2(c"Cons",typeof-term(k),typeof-term(m)));

SRC/unit-main-core.lsts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ let ast-typed-count = 0_sz;
3737
let config-print-ast = false;
3838

3939
let main(argc: C_int, argv: CString[]): Nil = (
40-
config-v23 = false;
4140
let argi = 1_sz;
4241
let input = [] : List<CString>;
4342
let highlight = false;
@@ -50,11 +49,6 @@ let main(argc: C_int, argv: CString[]): Nil = (
5049
c"--parse" => config-mode = ModeParse();
5150
c"--preprocess" => config-mode = ModePreprocess();
5251
c"--compile" => config-mode = ModeCompile();
53-
c"--v0" => (config-v3 = false; config-v0 = true;);
54-
c"--v1" => (config-v3 = false; config-v1 = true;);
55-
c"--v2" => config-v3 = false;
56-
c"--v23" => (config-v3 = false; config-v23 = true;);
57-
c"--v3" => config-v3 = true;
5852
c"--highlight" => (
5953
config-mode = ModeTokenize();
6054
highlight = true;

tests/regress.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ fn run_bootstrap(target: &str, leave_tmp: bool, is_v3: bool) -> String {
3838
let exit = Command::new("./bootstrap.exe")
3939
.stdout(std::process::Stdio::piped())
4040
.stderr(std::process::Stdio::piped())
41-
.arg("--v3")
4241
.arg("-o")
4342
.arg("tmp.c")
4443
.arg(target)

0 commit comments

Comments
 (0)