3 ms·
Recently I have been working on porting a Prolog interpreter to WASI (Trealla). I’ve been searching for a way to get these kinds of useful I/O features in WASI
by grose 4y ago
Recently I have been working on porting a Prolog interpreter to WASI (Trealla). I’ve been searching for a way to get these kinds of useful I/O features in WASI and this looks like a great solution. Is there a C API? I’d love to take a shot at supporting it.
- epilys 4y agoAre you aware trealla can already target WASI as a target? (Just fyi in case you weren't) https://github.com/trealla-prolog/trealla#webassembly-wasi https://github.com/trealla-prolog/trealla#webassembly-wasi
- grose 4y agoThat was me who ported it :) Currently there’s no support for networking and stuff, would love to fix that.
- kitd 4y agoHN Comment of the Day!
- epilys 4y agoHaha oops! Great job btw.
- epilys 4y agoI happen to be writing a prolog implementation for fun. I've been following the book "The implementation of Prolog" (1993, Princeton University Press). Do you have any suggestions on implementation reading material?
- grose 4y agoThat's super cool. I'm definitely not an expert on the subject but this paper about dif/2 intrigues me: https://arxiv.org/abs/1607.01590 https://arxiv.org/abs/1607.01590 And perhaps Ciao's paper could offer some hints? http://cliplab.org/papers/hermenegildo11:ciao-design-tplp.pdf http://cliplab.org/papers/hermenegildo11:ciao-design-tplp.pd... You're probably already aware of it but Scryer Prolog seems like an interesting place to borrow ideas from. Both Scryer and Trealla have efficient string (list of characters) representations.
- bkolobara 4y agoThere is no C API, but it would be a great addition. I assume that it would be just a thin wrapper around the host functions and the host functions are fairly good documented (e.g. https://github.com/lunatic-solutions/lunatic/blob/main/crates/lunatic-networking-api/src/tcp.rs#L62 https://github.com/lunatic-solutions/lunatic/blob/main/crate...), so it shouldn't be too hard to add.
- grose 4y agoThank you. Looks very clean, I will try poking at it soon!