Hey, this is mine. Thanks for submitting it. I'll answer some questions.<p>> Why?<p>I ported Trealla Prolog to WASM (WASI) and I was looking for something useful to test it against. I found Spin, which can run WASM+CGI, and landed on this. Making this project exposed a number of bugs in my port that have now been fixed, so consumers of more useful projects[1][2] benefit as well. Also, PHP style templates are just <i>fun</i>! There's something valuable to just being able to shove a little bit of code inside some HTML and get it up on the internet.<p>I started my webdev journey with PHP many many years ago, and it's nice to revisit it from a different perspective. I don't use the real (elephant) PHP anymore, but I've gained a newfound appreciation for how fun its quick & dirty development style is.<p>I hope this project can serve as an example of how to use Prolog for fun things. It does showcase some of the cooler dynamic aspects of the language, and the PHP parsing code is like 10 lines of DCG.<p>> Is it a joke?<p>Yes and no. The name is certainly a joke. I was pondering what 'Prolog on Rails' might be and thought calling it PHP would be funny. This led to the PHP-style templates which were quick to implement and pretty powerful. Despite the humorous presentation, it does actually work.<p>> Can you use Prolog for web services?<p>Yes! For example, SWI has a mature HTTP package: <a href="https://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/http.html%27)" rel="nofollow">https://www.swi-prolog.org/pldoc/doc_for?object=section(%27p...</a>. It's used to power SWISH, an online Prolog code sharing thing: <a href="https://swish.swi-prolog.org/" rel="nofollow">https://swish.swi-prolog.org/</a><p>> Next steps?<p>I would like to support persistence somehow. I think it'd be really cool if you could use Prolog's dynamic database[3] as a persistent store. Spin has components for Postgres and Redis so it shouldn't be too hard to implement, but I lose the WASI compatibility if I do that... which means I can't use the binary from WAPM, etc.<p>I would also like to experiment with running Trealla on Cloudflare Workers. I have another project, worker-prolog[4], which uses Tau Prolog (a Prolog written in Javascript) on Workers.<p>On a somewhat related note, I've also been playing around with Cosmopolitan libc[5]. I got Trealla to compile to an APE executable but there's some issues with the embedded Prolog libraries getting garbled, so I need to improve my GDB skills and figure out what's going on there.<p>Finally, I'd like to say thanks to Andrew Davison (@infradig on GitHub), the author of Trealla Prolog, for letting me add WASM support to his project and helping me with lots of things. For example, PHP led to Andrew implementing improvements for using DCGs to parse Prolog terms, which is now super fast[6]!<p>[1]: <a href="https://github.com/guregu/trealla-js">https://github.com/guregu/trealla-js</a><p>[2]: <a href="https://github.com/trealla-prolog/go">https://github.com/trealla-prolog/go</a><p>[3]: <a href="https://www.swi-prolog.org/pldoc/man?predicate=assertz/1" rel="nofollow">https://www.swi-prolog.org/pldoc/man?predicate=assertz/1</a><p>[4]: <a href="https://github.com/guregu/worker-prolog">https://github.com/guregu/worker-prolog</a><p>[5]: <a href="https://justine.lol/cosmopolitan/" rel="nofollow">https://justine.lol/cosmopolitan/</a><p>[6]: <a href="https://github.com/trealla-prolog/trealla/issues/53">https://github.com/trealla-prolog/trealla/issues/53</a>