Skip to content

Commit

Permalink
final touches in the MOP (#1170)
Browse files Browse the repository at this point in the history
The t::t type, system and shadow classes, and generics based on classes
instead of type ids.

**Everything has classes now!**

TODO:
- [x] define system classes
- [x] define meta types for system and known shadow classes in prelude
- [x] bootstrap
- [x] update std/generic to use the new infrastructure
- [x] tests
  • Loading branch information
vyzo authored Mar 17, 2024
1 parent 1f70691 commit 1cdb87d
Show file tree
Hide file tree
Showing 156 changed files with 130,731 additions and 117,661 deletions.
25 changes: 9 additions & 16 deletions doc/reference/dev/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,47 +191,40 @@ core, the simple recompilation approach outlined above is
insufficient. What you want to do in this case is a recursive
bootstrap recompilation.

- First build the base bootstrap, using your extant gxc (either latest master or previous recursive bootstrap in your branch), without generating the cross module optimization meta modules:
- First build the base bootstrap, using your extant gxc -- either latest master or previous recursive bootstrap in your branch:
```
$ cd src
$ rm -rf bootstrap/*
$ gxc -no-ssxi -O -d bootstrap -s -S gerbil/core/{runtime,expander,sugar,mop,macro-object,match,more-sugar,more-syntax-sugar,module-sugar}.ss gerbil/core.ss gerbil/runtime/{gambit,util,table,control,system,c3,mop,error,interface,hash,thread,syntax,eval,repl,loader,init}.ss gerbil/runtime.ss gerbil/expander/{common,stx,core,top,module,compile,root,stxcase}.ss gerbil/expander.ss gerbil/compiler/{base,method,compile,optimize-base,optimize-xform,optimize-top,optimize-spec,optimize-ann,optimize-call,optimize,driver,ssxi}.ss gerbil/compiler.ss gerbil/gambit.ss
$ ./src/bootstrap.sh
```

If you have made changes in the compiler optimizer meta and the extant
compiler does not accept your code (or generates broken code), you may
compiler does not accept your code (or generates broken code), you will
want to try without optimizations:

```
$ gxc -d bootstrap -s -S gerbil/core/{runtime,expander,sugar,mop,macro-object,match,more-sugar,more-syntax-sugar,module-sugar}.ss gerbil/core.ss gerbil/runtime/{gambit,util,table,control,system,c3,mop,error,interface,hash,thread,syntax,eval,repl,loader,init}.ss gerbil/runtime.ss gerbil/expander/{common,stx,core,top,module,compile,root,stxcase}.ss gerbil/expander.ss gerbil/compiler/{base,method,compile,optimize-base,optimize-xform,optimize-top,optimize-spec,optimize-ann,optimize-call,optimize,driver,ssxi}.ss gerbil/compiler.ss gerbil/gambit.ss
$ GERBIL_BUILD_NOOPT=t ./src/bootstrap.sh
```

Otherwise, you are likely violating some of the bootstrap strictures; see below.

Once you have compiled the base bootstrap, you can proceed to build stage1:

```
$ ../build.sh stage0
$ ./build.sh stage0
...
$ ../build.sh stage1
$ ./build.sh stage1
...
```

If you compiled the base bootstrap without optimization, you will also have to set `GERBIL_BUILD_NOOPT` during the stage1 build:
```
$ GERBIL_BUILD_NOOPT=t ../build.sh stage1
$ GERBIL_BUILD_NOOPT=t ./build.sh stage1
```

After you have built stage1, you can use it to build the recursive
bootstrap, generating the cross module optimization meta modules this
time.
bootstrap:

```
$ cd src
$ rm -rf bootstrap/*
$ mkdir -p bootstrap/gerbil
$ cp gerbil/builtin.ssxi.ss bootstrap/gerbil
$ ../build.sh env gxc -O -d bootstrap -s -S gerbil/core/{runtime,expander,sugar,mop,macro-object,match,more-sugar,more-syntax-sugar,module-sugar}.ss gerbil/core.ss gerbil/runtime/{gambit,util,table,control,system,c3,mop,error,interface,hash,thread,syntax,eval,repl,loader,init}.ss gerbil/runtime.ss gerbil/expander/{common,stx,core,top,module,compile,root,stxcase}.ss gerbil/expander.ss gerbil/compiler/{base,method,compile,optimize-base,optimize-xform,optimize-top,optimize-spec,optimize-ann,optimize-call,optimize,driver,ssxi}.ss gerbil/compiler.ss gerbil/gambit.ss
$ ./build.sh env ./bootstrap.sh
```

And you have a brand new recursive bootstrap you can use. From here
Expand Down
13 changes: 13 additions & 0 deletions src/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e

gerbil_opt="-O"
if [ ! -z "$GERBIL_BUILD_NOOPT" ]; then
gerbil_opt=""
fi

rm -rf bootstrap/*
mkdir -p bootstrap/gerbil
cp gerbil/builtin.ssxi.ss bootstrap/gerbil
gxc $gerbil_opt -d bootstrap -s -S gerbil/core/{runtime,expander,sugar,mop,macro-object,match,more-sugar,more-syntax-sugar,module-sugar}.ss gerbil/core.ss gerbil/runtime/{gambit,util,table,control,system,c3,mop,mop-system-classes,error,interface,hash,thread,syntax,eval,repl,loader,init}.ss gerbil/runtime.ss gerbil/expander/{common,stx,core,top,module,compile,root,stxcase}.ss gerbil/expander.ss gerbil/compiler/{base,method,compile,optimize-base,optimize-xform,optimize-top,optimize-spec,optimize-ann,optimize-call,optimize,driver,ssxi}.ss gerbil/compiler.ss gerbil/gambit.ss
1 change: 1 addition & 0 deletions src/bootstrap/gerbil/compiler/base.ssxi.ss

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

116 changes: 58 additions & 58 deletions src/bootstrap/gerbil/compiler/base__0.scm

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

Loading

0 comments on commit 1cdb87d

Please sign in to comment.