← Back to context

Comment by zemptime

7 hours ago

I've recently started modeling some of my domains/potential code designs in Prolog. I'm not that advanced. I don't really know Prolog that well. But even just using a couple basic prolog patterns to implement a working spec in the 'prolog way' is *unbelievably* useful for shipping really clean code designs to replace hoary old chestnut code. (prolog -> ruby)

I wonder if there's examples of whole product architectures done in Prolog, seems like an elegant solution if done right. I've been looking for a concise way to model full architectures of my various projects, without relying on having a typical markdown file.

Which is separate from the actual types in the code.

Which is separate from the deployment section of the docs.

I keep wishing for "regex for prolog", ie: being able to (in an arbitrary language) express some functional bits in "prolog-ish", and then be able to ask/query against it.

    let prologBlob = new ProLog()
    prologBlob.add( "a => b" ).add( "b => c" )
    prologBlob.query( "a == c?" ) == True

(not exactly that, but hopefully you get the gist)

There's so much stuff regarding constraints, access control, relationship queries that could be expressed "simply" in prolog and being able to extract out those interior buts for further use in your more traditional programming language would be really helpful! (...at least in my imagination ;-)