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

Add js_eval/2 for wasm32 #2173

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Add js_eval/2 for wasm32 #2173

merged 1 commit into from
Nov 22, 2023

Conversation

aarroyoc
Copy link
Contributor

@aarroyoc aarroyoc commented Nov 20, 2023

Adds a js_eval/2 predicate for wasm32. It's the most simple way of achieving FFI on WASM. It takes a JavaScript snippet that gets executed in the platform eval function. Whatever gets evaluated gets returned to the Prolog side. Mapping right now is only supported with strings, numbers, booleans and the special values null and undefined.

imagen
imagen

@aarroyoc aarroyoc marked this pull request as ready for review November 20, 2023 21:28
@triska
Copy link
Contributor

triska commented Nov 21, 2023

Wow! Awesome! Thank you a lot!

@mthom
Copy link
Owner

mthom commented Nov 21, 2023

Thanks @aarroyoc ! Can you please fix the outstanding style failures? You can check what they are with cargo fmt --check

@mthom mthom merged commit 2e114df into mthom:master Nov 22, 2023
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.

3 participants