Aluriak / webclingo-example

Example of clingo usage on website as a client-side JS program
https://aluriak.github.io/webclingo-example/
12 stars 3 forks source link

Clingo in WASM

Simple example of how to use clingo into browsers, client-side. The main principle is to compile clingo to WebAssembly, then wrap it into client-side js modules.

Try Clingo in your browser at https://aluriak.github.io/webclingo-example.

This method is working, but probably not the best way to embed clingo in websites.

compile_web.sh

The compile_web.sh script will:

You should probably not use this script as-is, but instead take inspiration from it.

docs

This is a simple website copied and pruned from potassco.org/clingo/run, which should be fully functional after the incorporation of clingo.js and clingo.wasm files (made by compile_web.sh script)

To open the website,

  1. cd docs
  2. python3 serve.py
  3. Then open http://0.0.0.0:8000/

This site is static.