-
Notifications
You must be signed in to change notification settings - Fork 179
Add boot command to helper library #744
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
base: master
Are you sure you want to change the base?
Conversation
These can be used to disable the debugger, profiler, or hot reload if it is not desired.
It adds an extra dependency for linking
hlmodule.h and opcodes.h are already installed to `.../include/hl` to avoid poluting the root include folder. It is easier to deal with this for `hashlink boot` if the repository matches this structure.
e1f9e34
to
9d40b3d
Compare
be3fcac
to
d8e89a7
Compare
Instead of requiring a libhljit installed locally, why not simply distributing the required files as part of the haxelib projet, then packing them together into a single .c file (with bytecode) that can be compiled with no other dependency than libhl ? |
A single I guess as a middle ground, the source files could be distributed with the haxelib and This would mean we don't have to depend on the stability of |
I don't think so, C is very fast to compile and there's only few files for the JIT. Unless you're looking at something like 100ms optimization ? Give it a try, I'm sure it will be almost unnoticeable. |
I'm compiling haxelib for testing: # Small run.c with libhljit
$ time gcc -o haxelib run.c -O3 -lhljit -lhl -lm -Wl,-rpath -Wl,/usr/local/lib
gcc -o haxelib run.c -O3 -lhljit -lhl -lm -Wl,-rpath -Wl,/usr/local/lib 0.22s user 0.03s system 99% cpu 0.251 total
# Merged run.c
$ time gcc -o haxelib run.c -O3 -lhl -lm -Wl,-rpath -Wl,/usr/local/lib
gcc -o haxelib run.c -O3 -lhl -lm -Wl,-rpath -Wl,/usr/local/lib 3.43s user 0.04s system 98% cpu 3.511 total |
A bit more than I was expecting, I guess O3 has big cost. Given it's nice
to have a single C code for distribution I think it's still worth the 3
extra seconds.
Le sam. 18 janv. 2025, 13:15, tobil4sk ***@***.***> a écrit :
… Give it a try, I'm sure it will be almost unnoticeable.
I'm compiling haxelib for testing:
# Small run.c with libhljit
$ time gcc -o haxelib run.c -O3 -lhljit -lhl -lm -Wl,-rpath -Wl,/usr/local/lib
gcc -o haxelib run.c -O3 -lhljit -lhl -lm -Wl,-rpath -Wl,/usr/local/lib 0.22s user 0.03s system 99% cpu 0.251 total
# Merged run.c
$ time gcc -o haxelib run.c -O3 -lhl -lm -Wl,-rpath -Wl,/usr/local/lib
gcc -o haxelib run.c -O3 -lhl -lm -Wl,-rpath -Wl,/usr/local/lib 3.43s user 0.04s system 98% cpu 3.511 total
—
Reply to this email directly, view it on GitHub
<#744 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQAMVRFRDWW5BMQSYND2LJAWJAVCNFSM6AAAAABVMHSEZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZGY4TGMZXHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'd actually be interested in having both options. |
One nice thing could also be to compile the exe entirely statically as we
do on consoles so we have a single binary with no libhl dependency
Le sam. 18 janv. 2025, 15:09, Simon Krajewski ***@***.***> a
écrit :
… I'd actually be interested in having both options.
—
Reply to this email directly, view it on GitHub
<#744 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQELZYYYKXVZM2ZNLJ32LJOBZAVCNFSM6AAAAABVMHSEZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZG4ZTCMZVGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The goal is to replace I think it's a valid concern to not want Ultimately, the details of haxelib run hashlink boot run.hl Then the tool is free to decide how to deal with the files, whether to combine them into one or to do it separately with intermediate object files. How about the following changes to the PR:
|
I know it is possible to compile everything statically for hlc, but is this possible at all with jit? I tried it but it failed when trying to load std functions, so I assumed that method only works for hlc. If it could work, that would also be useful for quickly making a haxelib binary with no libhl dependency (assuming static libhl and all hdlls are pre-compiled). |
We would need to try to load in the current binary before trying to load the hdll, it should be safe to do so. |
This is based on the
nekotools boot -c
feature from neko. It allows running:Which generate
main.c
, which is just thehl
entry point with the bytecode embedded. It is then possible to compile this file with a simple compilation command:This is a bit like
hlboot.dat
, however it has some advantages:Compared with hlc:
To make this work, I had to add a libhljit static library, which just contains everything in
hl.exe
except main.c.