-
Notifications
You must be signed in to change notification settings - Fork 1
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 implementation for foreign-object #13
Conversation
CI fails in a strange way:
These modules are supposed to be there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using an alist in a box
for the Object
? That way you can approximate a mutable object but still be faster than hashtable.
I tried the alist but without the box and had issues with the mutability, didn't try wrapping in a box. Are hashtables really that slow? I'll try this out |
You need to have a lot of entries (like ~hundreds) until hashtables are faster than alists, so in that sense they are slow. |
@anttih moved to alist in a box, it's much faster now. |
CI is stuck because the latest Spago is broken, see purescript/spago#1242 |
This PR adds FFI for foreign-object using a symbol-hashtable together with a list to keep track of insertion order, which is an invariant of the JS implementation.
It's not strictly needed for Scheme, but it's good to have for compatibility with existing JS-backend code.
There is one slow test that I need to look more into, but the patch passes all tests otherwise.