titzer / virgil

A fast and lightweight native programming language
1.24k stars 48 forks source link

Can it compile to a dll/so? #97

Closed Zireael07 closed 1 year ago

Zireael07 commented 1 year ago

Title.

titzer commented 1 year ago

Currently no. The Virgil compiler always produces a statically linked executable. Would your use case need linking a .so?

Zireael07 commented 1 year ago

Yes (it's for a preexisting game engine that can use external dll's for scripting languages support. No hurry though, as I don't expect their docs/API to be finalized in a couple months from now

titzer commented 1 year ago

I don't have the bandwidth on that atm, but off the top of my head, it would require emitting an additional section for the dynamic linker and some internal compiler work to deal with addresses that aren't fixed.