Skip to content
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

fix: remove old/duplicate Haskell runtime initialization code #154

Merged
merged 1 commit into from
Dec 11, 2022

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Dec 11, 2022

No description provided.

@zshipko zshipko changed the title fix: remove old Haskell runtime initialization code fix: remove old/duplicate Haskell runtime initialization code Dec 11, 2022
Copy link
Member

@nilslice nilslice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhelx wasnt there some mono / c# runtime code that needs to be started upon plugin initialization? wondering if this is applicable there.

@zshipko
Copy link
Contributor Author

zshipko commented Dec 11, 2022

We should use the new Runtime enum for that. This is code that was supposed to be removed after adding the nicer runtime initialization interface.

@nilslice
Copy link
Member

Definitely agree - mostly leaving this as a note to connect some dots between here and convos on Discord.

But I also didn't realize this code was so specific to Haskell on first glance 😆

@zshipko zshipko merged commit a68823e into main Dec 11, 2022
@zshipko zshipko deleted the remove-old-runtime-init branch December 11, 2022 04:10
@bhelx
Copy link
Contributor

bhelx commented Dec 11, 2022

Yeah, the Csharp PDK will be based on mono. It needs _start to be called to initialize everything or else it crashes. I'm a bit confused why the runtime doesn't do it when you enable wasi. Will follow back up when we get further along with development. It could be a quirk with that one PDK.

@zshipko
Copy link
Contributor Author

zshipko commented Dec 11, 2022

I don't think WASI will really initialize language specific runtimes - to initialize Haskell hs_init is called in _start before the user-defined main function is executed. I was able to re-export that function by passing --export=hs_init to wasm-ld during compilation. Then calling hs_init lets us call other functions without going through _start - maybe there is something similar for mono?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants