Skip to content
This repository was archived by the owner on Aug 29, 2022. It is now read-only.
This repository was archived by the owner on Aug 29, 2022. It is now read-only.

Figure out how to provide programmatic usage from JavaScript #1

@rla

Description

@rla

Current Prolog WebAssembly examples use the SWI-Prolog Foreign Language Interface through the Emscripten cwrap function.

This has been separatedly done in each project. For example, in the prolog-vdom project:
https://github.com/rla/prolog-vdom/blob/23f85a6dbccefd189f4cff179106180e2f12234a/js/prolog.js

This code should probably be distributed together with the SWI WebAssembly version and with the source code. The list of functions used by this JavaScript bridge depend on the list of exported functions, specified during build process of the SWI WebAssembly version. Reference:
https://github.com/SWI-Prolog/swipl-devel/blob/7002bca038b5f20bbb42bb58ffccf4872060cb37/src/wasm/exports.json

There should be a small layer between cwrap'd C functions and actual SWI JavaScript API as some of the functions require C-style memory allocation through Emscripten before use. This layer is present in the prolog-vdom project.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions