Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


There 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/crate...), so it shouldn't be too hard to add.


Thank you. Looks very clean, I will try poking at it soon!


Are 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


That was me who ported it :) Currently there’s no support for networking and stuff, would love to fix that.


I 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?


That'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 And perhaps Ciao's paper could offer some hints? 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.


HN Comment of the Day!


Haha oops!

Great job btw.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: