-
Notifications
You must be signed in to change notification settings - Fork 381
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
Racket bytecode #1992
Racket bytecode #1992
Conversation
FWIW, these two will have loads of conflict: #1990 |
Not really. Sure, #1990 will drop my bootstrap change. I kept changes to Makefile minimal to reduce merging effort (most merge conflicts are deletes / pick yours). I'm happy to help with 1990 btw, though it looks like you have it under control. Note: |
There is also a conflict with #1749. I'm not sure of the implications memory wise, but I can update my code if 1749 gets accepted. |
df34489
to
a6ea807
Compare
The change to bytecode allows us to execute FYI: GitHub are upgrading the This PR also fixes path quoting issues and closes #1244. But if anyone is passing options via |
Faster to compile or to run? |
.github/workflows/ci-idris2.yml
Outdated
- name: Install test dependencies | ||
run: | | ||
brew install minimal-racket | ||
raco pkg install --auto compiler-lib r6rs-lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we installing racket for the chezscheme test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was more to prove that the Racket backend tests work on the CI (there are no Racket tests enabled otherwise — currently the windows build is the only use of Racket).
Seemed like a good idea at the time. With ubuntu-bootstrap-racket
disabled, I'd say it still is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be tidier to have a separate job. The test prefix makes things a bit awkward, or can it just run make -C tests only=racket
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this workflow change.
Compile. The bytecode ought to be equivalent, so no difference at runtime. |
mkdir -p ${PREFIX}/lib/ | ||
install support/c/${IDRIS2_SUPPORT} ${PREFIX}/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gallais I'm rebasing, but saw this. This file/dir appears unused, removing it didn't break anything.
Regardless, shouldn't it be: install ${TARGET}_app/${IDRIS2_SUPPORT} ${PREFIX}/lib
? (i.e. the same file it was compiled against, otherwise it could differ from the one in bin/idris2_app)
edit: it's support/c/Makefile that should be changed, not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, shouldn't it be compiling bytecode against the freshly built lib instead of the previous version's copy? We can use IDRIS2_LIBS
to make that happen.
a6ea807
to
02aefb7
Compare
@gallais This is now waiting on you. Unless you want me to add a ubuntu-test-racket-codegen job? |
02aefb7
to
9322dac
Compare
@gallais I'd like to also reinstate Racket bootstrap to the CI, but that needs #2279. How about adding another Ubuntu job to build Racket from previous-version (Chez), then self-host from it? I'm tidying up the Windows shell using msys2 as the default, so all the CI work could go together in another PR. |
Sorry I don't have the headspace for that atm, I'm trying to get #1990 mergd first. |
20718fd
to
2c9bf24
Compare
Raco's make command produces bytecode and is faster than `raco exe`.
- separate build directory - standalone stage 2 script - reduced stage 1 libs double processing (`--build` -> `--install`)
9322dac
to
7ca9360
Compare
With the closure of #1990, what does the status of this become? Should it still be considered for merging (possibly with some changes), or should it be closed? |
Given that this was labelled |
raco exe
vs.raco make
I reckon the Racket backend should use
raco make
instead ofraco exe
: https://docs.racket-lang.org/raco/make.htmlPros:
(1) produces bytecode (more consistent with the Chez backend)
- much smaller than wrapping the bytecode around Racket's binary
- slightly simpler (avoids idris2 vs. idris2.exe)
(2) faster! — saves 15-20% for idris2.rkt / 75-85% for hello.rkt (ymmv)
(3) skips compilation if the source didn't change (SHA-1)
Cons:
(4) programs die after upgrading Racket
- error message:
loading code: version mismatch expected: "8.2" found: "8.0"
- the user must
rm -rf compiled; raco make *.rkt
Other:
(5) you can easily run
make exe
later (bonus: it uses the bytecode)(6?) fixes the M1 macOS / support dylib issue (speculation — tested on 10.15)
So if someone can confirm (6), this is a double win.
You can try it out, like so:
raco make bootstrap/idris2_app/idris2.rkt LD_LIBRARY_PATH=$PWD/support/c racket bootstrap/idris2_app/idris2.rkt --version
Other improvements
system
on windows/usr/bin/env
--build
step for libs (still does--install
)./bootstrap-stage2.sh
directly* I chose parameter separater
;
since it doesn't conflict with PowerShell. It even works with goto labels... It's the closest thing to whitespace that isn't whitespace.