Skip to content

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 24, 2025

We can then use this mechanism to replace the hacky way to we map things like memory -> wasmMemory and __indirect_function_table => wasmTable.

@sbc100 sbc100 force-pushed the native_alias_support branch 3 times, most recently from ba4a633 to 055b225 Compare September 26, 2025 01:45
@sbc100 sbc100 requested a review from dschuff September 26, 2025 01:45
@sbc100 sbc100 force-pushed the native_alias_support branch from 055b225 to a548beb Compare September 26, 2025 18:58
@dschuff
Copy link
Member

dschuff commented Sep 26, 2025

What happens if we ever want to try to remove the leading underscore from native functions? Will this start causing clashes?

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 26, 2025

What happens if we ever want to try to remove the leading underscore from native functions? Will this start causing clashes?

I don't think it makes the situation WRT removing underscores any worse. Already if you declare $foo as a JS library function it would be called foo in the generated code which would conflict with the native foo if were were not prefix the native one with an underscore.

@sbc100 sbc100 force-pushed the native_alias_support branch 3 times, most recently from 8e26776 to 4fc13c5 Compare September 26, 2025 20:46
@sbc100 sbc100 force-pushed the native_alias_support branch 2 times, most recently from e02290a to ad368c1 Compare September 26, 2025 22:15
Copy link
Member

@dschuff dschuff left a comment

Choose a reason for hiding this comment

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

It looks OK? TBH I'm not sure I really understand the JS linking system deeply enough to know whether this is really a good idea though.

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 26, 2025

This idea is that this allows us to have JS names that don't match the native symbol names.

In particular this simplifies the memory and table export handling. I think this is needed for my ongoing work on dynamic linking, but it actually might not me. I can can hold off landing this and circle back parhaps if it proves truely necessary.

@dschuff
Copy link
Member

dschuff commented Sep 26, 2025

If this is really an improvement on its own, then I think it's fine to add it. I just don't have a high confidence in my review.

We can then use this mechanism to replace the hacky way to we map things
like `memory` -> `wasmMemory` and `__indirect_function_table` =>
`wasmTable`.
@sbc100 sbc100 force-pushed the native_alias_support branch from ad368c1 to 11bdf33 Compare September 29, 2025 23:03
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.

2 participants