You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.
It should be tried to make this lazy so that a potentially large term is not converted into an object tree at once. Support for cyclic terms needs some research.
Support for dicts should be provided. They could be mapped directly to objects. Tag can be represented using a Symbol (not a normal property). FLI lacks dict support right now and dicts cannot be directly accessed.
Support for blobs should be provided. They could be converted into Typed Arrays or a similar thing that is backed directly by WebAssembly memory.
Atoms and strings must support unicode. wchar_t should be converted into UCS-2/UTF16 directly without going through UTF8. wchar_t is a compiler-specific 4-byte character type.
The text was updated successfully, but these errors were encountered:
I have looked at the JPL term representation and it has excessive (imho) wrapping of atoms and numbers, possibly as a requirement by the Java type system to represent term arguments (cannot mix Java primitives and objects) inside a same array.
I am not convinced that we need such wrapping in JavaScript.
Other API examples (Python and other JS libs, more suited for a dynamic language):
I did not find information on term representation of YieldProlog.
I like PySwip representation of logical variables (reassign on next answer). Prolog-in-JS implementations seem to use the term structures as a part of internal implementation and contain otherwise unnecessary properties.
This representation provides higher-level interface than C functions in the SWI-Prolog Foreign Language Interface (FLI).
All currently created demos use FLI.
JPL is an language bridge between SWI-Prolog and Java. It uses Java objects to represent terms. Link to code: https://github.com/SWI-Prolog/packages-jpl/tree/master/src/java/org/jpl7. The representation of terms can be modelled by it.
It should be tried to make this lazy so that a potentially large term is not converted into an object tree at once. Support for cyclic terms needs some research.
Another JavaScript interface is used by Node-SWI bridge, it already has JPL-like interface:
https://github.com/rla/node-swipl#output-term-representation but has some questionable choices like string "[]" for empty lists.
Support for dicts should be provided. They could be mapped directly to objects. Tag can be represented using a Symbol (not a normal property). FLI lacks dict support right now and dicts cannot be directly accessed.
Support for blobs should be provided. They could be converted into Typed Arrays or a similar thing that is backed directly by WebAssembly memory.
Atoms and strings must support unicode.
wchar_t
should be converted into UCS-2/UTF16 directly without going through UTF8.wchar_t
is a compiler-specific 4-byte character type.The text was updated successfully, but these errors were encountered: