Skip to content

Commit

Permalink
Cleanups post C3 (#1116)
Browse files Browse the repository at this point in the history
Co-authored-by: vyzo <[email protected]>
  • Loading branch information
fare and vyzo authored Feb 10, 2024
1 parent bbefba4 commit ce62603
Show file tree
Hide file tree
Showing 87 changed files with 85,883 additions and 86,107 deletions.
12 changes: 5 additions & 7 deletions doc/reference/dev/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,20 @@ bootstrap recompilation.
$ cd src
$ rm -rf bootstrap/*
$ gxc -no-ssxi -O -d bootstrap -s -S gerbil/prelude/core.ss gerbil/runtime/{gambit,util,system,loader,control,c3,mop,error,thread,syntax,eval,repl,init}.ss gerbil/runtime.ss gerbil/expander/{common,stx,core,top,module,compile,root,stxcase}.ss gerbil/expander.ss gerbil/compiler/{base,compile,optimize-base,optimize-xform,optimize-top,optimize-spec,optimize-ann,optimize-call,optimize,driver,ssxi}.ss gerbil/compiler.ss gerbil/prelude/gambit.ss
$ cd ..
$ ./build.sh stage0
$ ../build.sh stage0
...
$ ./build.sh stage1
$ ../build.sh stage1
...
```

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

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

And you have a brand new recursive bootstrap.
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/gerbil/builtin.ssxi.ss
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ package: gerbil
method-ref direct-method-ref bound-method-ref
checked-method-ref checked-bound-method-ref
find-method
struct-subtype? class-subtype?
substruct? subclass?
with-unwind-protect
with-catch
file-newer?)
Expand Down
110 changes: 55 additions & 55 deletions src/bootstrap/gerbil/compiler/base__0.scm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(declare (block) (standard-bindings) (extended-bindings))
(begin
(define gerbil/compiler/base::timestamp 1707423041)
(define gerbil/compiler/base::timestamp 1707565661)
(begin
(define gxc#current-compile-symbol-table (make-parameter '#f))
(define gxc#current-compile-runtime-sections (make-parameter '#f))
Expand All @@ -18,26 +18,26 @@
(define gxc#current-compile-decls (make-parameter '#f))
(define gxc#current-compile-context (make-parameter '#f))
(define gxc#symbol-table::t
(let ((__tmp185795
(let ((__tmp185796
(let ((__tmp185725
(let ((__tmp185726
(let () (declare (not safe)) (cons 'struct: '#t))))
(declare (not safe))
(cons __tmp185796 '()))))
(cons __tmp185726 '()))))
(declare (not safe))
(make-struct-type*
(make-struct-type
'gxc#symbol-table::t
'symbol-table
'#f
'(gensyms bindings)
__tmp185795
__tmp185725
':init!)))
(define gxc#symbol-table?
(let ()
(declare (not safe))
(make-struct-predicate gxc#symbol-table::t)))
(define gxc#make-symbol-table
(lambda _$args181554_
(apply make-struct-instance gxc#symbol-table::t _$args181554_)))
(lambda _$args181484_
(apply make-struct-instance gxc#symbol-table::t _$args181484_)))
(define gxc#symbol-table-gensyms
(let ()
(declare (not safe))
Expand Down Expand Up @@ -71,90 +71,90 @@
(declare (not safe))
(make-struct-slot-unchecked-mutator gxc#symbol-table::t 'bindings)))
(define gxc#symbol-table:::init!
(lambda (_self181552_)
(if (let ((__tmp185801
(lambda (_self181482_)
(if (let ((__tmp185731
(let ()
(declare (not safe))
(##structure-length _self181552_))))
(##structure-length _self181482_))))
(declare (not safe))
(##fx< '2 __tmp185801))
(##fx< '2 __tmp185731))
(begin
(let ((__tmp185798
(let ((__tmp185728
(let () (declare (not safe)) (make-table 'test: eq?)))
(__tmp185797
(__tmp185727
(let ()
(declare (not safe))
(##structure-type _self181552_))))
(##structure-type _self181482_))))
(declare (not safe))
(##unchecked-structure-set!
_self181552_
__tmp185798
_self181482_
__tmp185728
'1
__tmp185797
__tmp185727
'#f))
(let ((__tmp185800
(let ((__tmp185730
(let () (declare (not safe)) (make-table 'test: eq?)))
(__tmp185799
(__tmp185729
(let ()
(declare (not safe))
(##structure-type _self181552_))))
(##structure-type _self181482_))))
(declare (not safe))
(##unchecked-structure-set!
_self181552_
__tmp185800
_self181482_
__tmp185730
'2
__tmp185799
__tmp185729
'#f)))
(error '"struct-instance-init!: too many arguments for struct"
_self181552_
_self181482_
'2
(let ()
(declare (not safe))
(##vector-length _self181552_))))))
(##vector-length _self181482_))))))
(let ()
(declare (not safe))
(bind-method! gxc#symbol-table::t ':init! gxc#symbol-table:::init! '#f))
(define gxc#raise-compile-error
(lambda (_message181421_ _stx181422_ . _details181423_)
(let ((_ctx181428_
(let ((_$e181425_ (gxc#current-compile-context)))
(if _$e181425_ _$e181425_ 'compile))))
(lambda (_message181351_ _stx181352_ . _details181353_)
(let ((_ctx181358_
(let ((_$e181355_ (gxc#current-compile-context)))
(if _$e181355_ _$e181355_ 'compile))))
(apply gx#raise-syntax-error
_ctx181428_
_message181421_
_stx181422_
_details181423_))))
_ctx181358_
_message181351_
_stx181352_
_details181353_))))
(define gxc#verbose
(lambda _args181418_
(lambda _args181348_
(if (gxc#current-compile-verbose)
(let ((__tmp185802 (lambda () (apply displayln _args181418_))))
(let ((__tmp185732 (lambda () (apply displayln _args181348_))))
(declare (not safe))
(with-lock gxc#+verbose-mutex+ __tmp185802))
(with-lock gxc#+verbose-mutex+ __tmp185732))
'#!void)))
(define gxc#+verbose-mutex+ (make-mutex 'compiler/driver))
(define gxc#module-path-reserved-chars '":#<>&!?*;()[]{}|'`\"\\")
(define gxc#module-id->path-string
(lambda (_id181400_)
(let* ((_str181402_
(if (let () (declare (not safe)) (symbol? _id181400_))
(symbol->string _id181400_)
_id181400_))
(_len181404_ (string-length _str181402_))
(_res181406_ (make-string _len181404_)))
(let _lp181409_ ((_i181411_ '0))
(if (fx< _i181411_ _len181404_)
(let* ((_char181413_ (string-ref _str181402_ _i181411_))
(_xchar181415_
(lambda (_id181330_)
(let* ((_str181332_
(if (let () (declare (not safe)) (symbol? _id181330_))
(symbol->string _id181330_)
_id181330_))
(_len181334_ (string-length _str181332_))
(_res181336_ (make-string _len181334_)))
(let _lp181339_ ((_i181341_ '0))
(if (fx< _i181341_ _len181334_)
(let* ((_char181343_ (string-ref _str181332_ _i181341_))
(_xchar181345_
(if (let ()
(declare (not safe))
(string-index
gxc#module-path-reserved-chars
_char181413_))
_char181343_))
'#\_
_char181413_)))
(string-set! _res181406_ _i181411_ _xchar181415_)
(let ((__tmp185803
(let () (declare (not safe)) (fx+ _i181411_ '1))))
_char181343_)))
(string-set! _res181336_ _i181341_ _xchar181345_)
(let ((__tmp185733
(let () (declare (not safe)) (fx+ _i181341_ '1))))
(declare (not safe))
(_lp181409_ __tmp185803)))
_res181406_)))))))
(_lp181339_ __tmp185733)))
_res181336_)))))))
Loading

0 comments on commit ce62603

Please sign in to comment.