tshort / StaticCompiler.jl

Compiles Julia code to a standalone library (experimental)
Other
488 stars 31 forks source link

Cleanup and more support for arrays of functions (reland) #122

Closed MasonProtter closed 1 year ago

MasonProtter commented 1 year ago

This separates the generate_obj that compile uses from the generate_obj that all the standalone functions use, and rearranges stuff for a bit less code repetition.

Also, I mocked up support for the request in https://github.com/tshort/StaticCompiler.jl/issues/93, but I still am not really convinced that it makes any sense to have multiple functions going into compile_executable.

MasonProtter commented 1 year ago

Hm that's so weird that the WASM tests now fail with this. They pass locally for me, and if anything this should have fixed potential problems with the WASM stuff because the old version was unintentionally calling the wrong generate_obj.

MasonProtter commented 1 year ago

Okay I see now, the version of generate_obj that was being used for compile actually did have specific wasm hooks in it. So it's actually compile_wasm(funcs::Array) that is using the wrong generate_obj because the one it hits doesn't do the address space stuff that the compile_wasm(f, types) does as far as I can tell.

brenhinkeller commented 1 year ago

Ah yeah, I remember thinking when I commented on that issue that there was some case where this could be nice to have -- maybe something about making the asm a bit nicer then having everything in one big function with everything inlined (not that i'm looking at the asm so often) -- not critical but if you've got it implemented why not I suppose!