worker-prolog

serverless Prolog for Cloudflare Workers (by guregu)

Worker-prolog Alternatives

Similar projects and alternatives to worker-prolog

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better worker-prolog alternative or higher similarity.

worker-prolog reviews and mentions

Posts with mentions or reviews of worker-prolog. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-01-07.
  • PHP: Prolog Home Page
    10 projects | news.ycombinator.com | 7 Jan 2023
    Hey, this is mine. Thanks for submitting it. I'll answer some questions.

    > Why?

    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 fun! 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.

    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.

    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.

    > Is it a joke?

    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.

    > Can you use Prolog for web services?

    Yes! For example, SWI has a mature HTTP package: https://www.swi-prolog.org/pldoc/doc_for?object=section(%27p.... It's used to power SWISH, an online Prolog code sharing thing: https://swish.swi-prolog.org/

    > Next steps?

    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.

    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.

    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.

    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]!

    [1]: https://github.com/guregu/trealla-js

    [2]: https://github.com/trealla-prolog/go

    [3]: https://www.swi-prolog.org/pldoc/man?predicate=assertz/1

    [4]: https://github.com/guregu/worker-prolog

    [5]: https://justine.lol/cosmopolitan/

    [6]: https://github.com/trealla-prolog/trealla/issues/53

  • Serverless Prolog for Cloudflare Workers
    1 project | news.ycombinator.com | 27 Jun 2022
  • Rust advocacy at a medium-sized startup
    2 projects | news.ycombinator.com | 19 Jun 2022
    Sorry, just saw this now. Mostly for fun! But I have some slightly crazy ambitions. Prolog lets you easily write complex queries, so it works quite well sitting on top of some in-memory data. I think that you could use Prolog's unification as a GraphQL-like "universal API", all that's missing is a quick and easy way to store Prolog data durably. I wrote some more here, but I plan on writing a proper article sometime soon: https://github.com/guregu/worker-prolog
  • Announcing Praxis - Visual programming in Prolog [WIP]
    1 project | /r/prolog | 19 Jun 2022
    I've made progress towards implementing something like this with worker-prolog. Maybe we should join forces? I implemented the Pengines API so that might be a good place to start, it's relatively simple and provides JSON- and Prolog-format results. You can persist data with the usual suspects like assertz/1 and retractall/1. It's a bit unstable now as I'm hammering out the persistence implementation, I'll write something about it soon. Would be super awesome to be able to embed a visual editor in the future!
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 2 May 2024
    Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality. Learn more →

Stats

Basic worker-prolog repo stats
4
12
2.6
almost 2 years ago

guregu/worker-prolog is an open source project licensed under BSD 2-clause "Simplified" License which is an OSI approved license.

The primary programming language of worker-prolog is TypeScript.


Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com