Hacker News new | past | comments | ask | show | jobs | submit login
What Is miniKanren? (minikanren.org)
235 points by Bluestein 29 days ago | hide | past | favorite | 135 comments



Minikanren was the subject of a phenomenal talk by Matt Might for it's applications in medicine

[0] https://www.janestreet.com/tech-talks/algorithm-for-precisio...


A couple years ago, I tried to wrap my poor little non-developer head around how to use this, because I have a handful of things going on medically that seem (to me) to be connected, but I can't manage to get any doctors to care enough to help me figure out, but I was hopelessly out of my depth.

Normally I can at least figure out how to use something, even if I don't understand how it works under the hood, but with this, I couldn't even figure out the next step.


Sorry about that.

mediKanren's source code is under MIT license, and is on GitHub. Alas, the knowledge graphs we use for mediKanren aren't produced by us, and often have very complex licenses (one KG might include knowledge from 80 or 100 databases, each with a different license). As a result, we can't just release the KGs that are needed to actually use mediKanren. Also, creating high-quality queries that take into account all the nuances and quirks of the KGs is tricky, and changes as the KGs and the Biolink standard evolve. As a result, mediKanren requires some expertise to use effectively, along with access to the KGs.

An application that uses mediKanren as a back-end (along with other reasoners) is the NIH NCATS Biomedical Data Translator:

https://ui.transltr.io/

Please keep in mind that both Translator and mediKanren are designed for researchers and for biomedical research, not for patient care or treatment recommendations.


It's surprisingly reassuring to realize it wasn't actually my fault that I couldn't figure it out. Thanks for explaining! I'll look into Translator and see if I can get anywhere that way.


Have you read their document [0] on how to navigate the process?

[0] https://bertrand.might.net/articles/algorithm-for-precision-...


You might have better luck if you try today using Claude as support?


Alas, you'd still need the knowledge graphs. I hope the licensing issues for at least some of the KGs will be resolved soon. It's a tricky issue. Even some of the ontologies and controlled vocabularies in biomedicine can't be released publicly due to copyright restrictions (for example, full SemMedDB uses UMLS which uses SNOMED).


Makes me wonder if LLMs can be used to generate useful KGs (possibly from the right source material).


Discussed a bit on HN:

The Algorithm for Precision Medicine, talk by Matthew Might [video] - https://news.ycombinator.com/item?id=37814662 - Oct 2023 (14 comments)

The Algorithm for Precision Medicine - https://news.ycombinator.com/item?id=29483549 - Dec 2021 (1 comment)


thank you for posting this... and this is a common enough pattern (looking up previous HN threads on the same or related article) that I wonder if it's worthwhile to automate this.


That was an incredible read, a real-life Dr. House episode. And very exciting technology, too. Thanks for sharing.


... wherein:

"It will demonstrate progress to date, including the now-routine use of relational programming in miniKanren to identify personalized treatments for patients with some of the rarest and most challenging diseases in the world."

... wherefrom I cannot help but be amazed at how personalization through data optimization apparently actually helps solve such things and can be an approach.-


fantastic talk, thanks for sharing.


Humble brag:

This brought back shades of 20 years ago to me. I went back to school to add a credential after my name to make myself employable. My experience running the back office for a long-distance reseller (FoxPro 2.6 database: application support, running customer service, billing, reporting, and being the networking yeoman) didn't look impressive on my resume without some additional alphabet soup.

This was my programming languages -- interpreters class. Dr Daniel Friedman ran a teach-along that culminated in implementing miniKanren in scheme. First day of class, the front row was empty. I was ten years older than every other student in the room (with the exception of Will Byrd). I sheepishly shrugged and took one of the offered seats in the row. For the next hour, the sheer force of scheme being written on the whiteboard blew my mind open. That continued for 16 weeks, three days a week. I highly recommend the experience.

I (probably) still have a pre-press copy of The Reasoned Schemer in a box in my attic. It was one of the goodies handed out on the last day of class.


I wrote some FoxPro thing for a long-distance reselling operation circa 1994. It had to handle agent commissions on a multi-level scheme and whatnot, import call detail records from telco equipment and such.


This gives me an idea. I'm going to create a super complex and unintuitive programming language where the only error message you get is "no", and call it miniKaren. :-P


> unintuitive programming language where the only error message you get is "no",

You know. "Consent" is everything these days.- :)

PS. Preferably in written form ...


Hi! I'm one of the miniKanren peeps. Happy to talk miniKanren and relational programming!


I have a feature request for the https://minikanren.org/ website: just one prominent block of example code on that homepage (as early as possible) would be REALLY useful for helping understand at a glance what kind of language this is.

I even clicked through quite a few of those prominent early links and didn't find a code example!


On top of that: some examples of the kinds of problems miniKanren can solve, based on real world examples rather than purely abstract concepts (e.g. "given a set of available air flights with origins, destinations, and prices, find me the cheapest way to get from Seattle to London")


Is that even possible for something like this? You've got a pretty long list of implementations, each having its own language specific syntax, e.g. https://github.com/pythological/kanren for one python version - and there are several Python versions linked on the homepage.


In that case an example box with tabs at the top - "miniKanren in Python / Go / Ruby" or whatever - would really help illustrate that point.


Thank you for the feedback!

We are working on a new version of the website, with HTTPS, and with better examples and a better layout.

I love your blog posts on LLMs, BTW! We've been experimenting with combining LLMs and miniKanren in various ways.


Hey! Thanks for all of the work you do. I love reading your stuff.

Lately, I've been playing a lot with the code from Neural Guided Constraint Logic Programming for Program Synthesis [1]. I want to apply it to searching for neural network architectures. Something like:

    (define-relation (layero layer in out) ;; [2]
      (conde
      ((== layer `(Linear ,in ,out)))
      ((== layer `(Relu ,in ,out))
        (== in out))
      ((fresh (percent)
          (== layer `(Dropout ,in ,out ,percent))
          (== in out)
          (countero percent)
          (<o '(1) percent)
          (<o percent '(0 0 1 0 0 1 1))))))

And a `layerso` that is just a sequence of `layers`. And then use some metric that captures how effective the training run was and use that metric for teaching the search network.

I'm sure there's better ways to do it than the way I'm going about it. But it's a fun way to learn a bunch of cool new stuff.

Thanks for getting me started down this path!

[1] https://arxiv.org/abs/1809.02840

[2] https://github.com/eihli/reason/blob/523920773b7040325c8098a...


Hello!

miniKanren was my introduction to relational programming (SQL aside!), and I had hours of trying to wrap my head around the Reasoned Schemer.

Were you aware a miniKanren-inspired language was the foundation of a large chunk of Amazon's retail data aggregation stack? I'm no longer there, but it might be one of the larger deployments out there. We spent many many hours trying to figure out the best way to run the relational engine at scale and with acceptable performance.


No, but I would so love to hear someone from the team give a talk about it. That's so darn awesome


Hi! Sorry to be late to the party. I don't really understand how relational programming relates to discrete optimization and constraint programming.

I did several MOOCs on discrete optimization and I understand how a constraint solver works, and how local search works, for example. I also understand how a SAT solver works.

I just do not understand what logic/relational programming does. Is that a constraint solver solving just one kind of constraint, ie logic equations, a bit like a SAT solver?

[Edit] on my side I was really impressed by a paper using Minikanren to generate an algorithm, a sorting function if I remember well. It was about 8 years ago. Tried to fully understand the paper but gave up at some point.


I'm interested in a miniKanren port, or something like it, to TXR Lisp. I would possibly make it a part of the standard library of the language, so programs could rely on it just being there.


Love your talks! The enthusiasm is infectious.


I wonder if this might be able to help make LLM output compliant to a schema you can reverse engineer from an API endpoint like NEMSIS.


A while back I was trying to understand the guts of miniKanren. I Did a careful reading of the paper and wrote up my notes along with the code here: https://codeberg.org/ashton314/microKanren

Hope that helps someone. :) It’s a fantastic little gem of a program.

Don’t forget: https://aphyr.com/posts/354-unifying-the-technical-interview


Related. Others?

Differences Between miniKanren and Prolog - https://news.ycombinator.com/item?id=39088018 - Jan 2024 (29 comments)

William Byrd on logic and relational programming, miniKanren (2014) - https://news.ycombinator.com/item?id=27359963 - June 2021 (28 comments)

Making a “MiniKanren” using Z3Py - https://news.ycombinator.com/item?id=27247386 - May 2021 (5 comments)

MiniKanren as a Tool for Symbolic Computation in Python - https://news.ycombinator.com/item?id=24828498 - Oct 2020 (1 comment)

UKanren in J: Embedding in an Array Language with Rank-Polymorphic Unification [pdf] - https://news.ycombinator.com/item?id=24298292 - Aug 2020 (1 comment)

Minikanren – An embedded DSL for logic programming - https://news.ycombinator.com/item?id=18698718 - Dec 2018 (44 comments)

Reazon – miniKanren for Emacs - https://news.ycombinator.com/item?id=17947087 - Sept 2018 (21 comments)

MiniKanren – An embedded DSL for logic programming - https://news.ycombinator.com/item?id=8395079 - Oct 2014 (22 comments)

Relational Programming in miniKanren - https://news.ycombinator.com/item?id=4734592 - Nov 2012 (1 comment)


Implementing and using a miniKanren was fun and enlightening. And it helped me appreciate how incredibly optimized and fast SWI-Prolog is for relational/logical programming. If someone knows of a miniKanren/language combination that outperforms SWI-Prolog and has good developer ergonomics for relational/logical programming, I’d love to hear about it.


IIRC SWI-Prolog can be embedded in Python if that's your thing. Interfacing with Scryer Prolog might be require a bit more but ought to be doable, and if they haven't surpassed SWI in some performance metrics yet I'd be surprised.

I'm kind of a lisper but I find it easier to get things done in a proper Prolog than the kanrens.


It hasn't been merged into the main branch yet, but you can embed Scryer in Python now[1], and it's quite enjoyable. I've also embedded in Java, Clojure, and elisp[2] :)

The Clojure one is bundled up into a library called libscryer-clj, which I haven't released yet, but it operates the same way as libpython-clj[3], libjulia-clj[4], and libapl-clj[5].

As an aside, Scryer is hella ergonomic. clpz+reif is an amazing and amazingly powerful combination, and Scryer's DCG philsophy over double quoted strings is chefs kiss -- it really delivers on the original mission of Prolog. Ediprolog[6] is a fantastic REPL for Emacs.

And honestly if you haven't seen Marcus Triska's work[7], by God you are missing out on one of the true joys of life.

[1]: https://github.com/jjtolton/scryer-prolog/blob/ISSUE-2464/sc...

[2]: https://github.com/mthom/scryer-prolog/discussions/2687

[3]: https://github.com/clj-python/libpython-clj

[4]: https://github.com/cnuernber/libjulia-clj

[5]: https://github.com/jjtolton/libapl-clj

[6]: https://www.metalevel.at/ediprolog/

[7]: https://www.youtube.com/@ThePowerOfProlog


I was going to mention how cool JJs work is. Upvote to all those links.


Nah dude YOU are awesome! I'm just embedding the work other smart people did haha.


Ah, nice!

Yeah, I really like Scryer, it's been my goto Prolog for quite some time.

You wouldn't know a way to get it working under Termux on Android? I tried to build it a while back but got inscrutable compiler errors and didn't follow through. Maybe building Trealla would be easier, since it's implemented in C.

I'm also enjoying http://tau-prolog.org/.


Trealla and Tau are both wonderful. Very close cousins of Scryer.

I've never tried compiling on rust before but open an issue or a discussion on the Scryer board and maybe we can figure it out!

https://github.com/mthom/scryer-prolog


*clarification-- it's written in rust, never tried compiling rust for android before


> if they haven't surpassed SWI in some performance metrics yet I'd be surprised

I was/am also anticipating performance gains from Scryer. Which is why I made a point to request up to date Scryer benchmarks in the SWI forums. Still, for free/open Prolog, SWI-Prolog is hard to beat: https://swi-prolog.discourse.group/t/porting-the-swi-prolog-...


Might be worth looking into Flix [0].

[0] https://en.wikipedia.org/wiki/Flix_(programming_language)


For folks that want to engage / learn more, there's been an annual miniKanren workshop and also a monthly miniKanren hangout online. Interested folk should totally come to either both!


The website describes the online hangouts as weekly and doesn't list any future dates:

http://minikanren.org/#hangouts

Is there more information somewhere?


I haven't held any hangouts online for years, although I'd consider restarting them if there is interest.

We do have a monthly call of miniKanren/OCanren researchers from around the world, where someone presents on their research. If you are interested, please send me an email!


Personally, I wasn't a fan of The Reasoned Schemer's format, https://io.livecode.ch/learn/webyrd/webmk worked better as my introduction.

See also: µKanren (http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf) and various ports like CL (https://github.com/rgc69/si-kanren) or Clojure (https://github.com/clojure/core.logic)


Here's another miniKanren-related livecode you might enjoy (both are thanks to Nada Amin's cool livecode.io tech!):

https://io.livecode.ch/learn/gregr/icfp2017-artifact-auas7pp


Thanks. Personally, I'd love to see more like https://alex-hhh.github.io/2021/08/fish-puzzle.html

When I was in university, the usual Prolog example was solving a game of Cluedo.


Is using miniKanren the only way to solve the fish-puzzle? If no, which language will be most ergonomic and accessible to solve it?


Pascal and Common Lisp were employed in the old benchmark assessment [0]. So just about anything should be able to.

But I'd expect many solver languages to be able to make it easier, like Prolog, datalog, mercury.

[0] http://cse.unl.edu/~choueiry/Documents/Hybrid-Prosser.pdf


I think there'll be all manner of constraint and constraint-logic programming approaches that'd be amenable. I wish I had a great answer for you as "the best".

IMO, these "zebra puzzle"/"einstein puzzle" style problems are like a "hello world" for many related techniques. What's more, there are many languages that combine several of these techniques together so that you can easily pick and choose where appropriate.

If you were just wanting to compare against another related style, answer-set programming is one thing that comes to mind.


Like most things in programming, there is no "only way" to solve something, and certainly no one language (or DSL) to solve anything. You could solve it programmatically in C writing your own backtracker or state enumerator and a validation function for the rules (or block of code if you are like an old coworker that liked 10k SLOC C functions).

miniKanren, Prolog, and others let you write the rules more concisely (almost always) and clearly (most of the time, not everyone will write clear code and clarity is subjective) than that, though.


Shoutout to the illustrator of the Reasoned Schemer, Duane Bibby! Familiar to TeX fans and detractors alike.

https://www.tug.org/interviews/bibby.html


Yes! Great artwork.


I wish I was smart enough to understand this. I printed out the paper and tried real hard to understand but felt hopelessly out of my depth.


The paper on microKanren [1] is imho the most approachable piece outside the "reasoned schemer" [2]. The thesis on which it is based is also interesting but is a thicker beast. Looking at stuff from the clojure world (clojure.core.logic and this talk [3]) is also interesting imho, especially from a dev perspective. From this point of view I found this talk [4] to be especially enlightening in how to build a database / query engine and concrete applications of MiniKanren / datalog.

[1] https://github.com/jasonhemann/microKanren

[2] https://mitpress.mit.edu/books/reasoned-schemer-second-editi...

[3] https://www.youtube.com/watch?v=irjP8BO1B8Y&ab_channel=Cloju...

[4] https://www.youtube.com/watch?v=y1bVJOAfhKY&t=10s&ab_channel...


If you are struggling to learn the language, you may have better luck learning Prolog first. So you don't deal with the added complexity of it being embedded in a completely unrelated language.

And remember this language for when, after you know Prolog, you start to see how it applies nicely to parts of everything you write, but it completely unsuitable for solving the entirety of almost any problem.


Hi! Which paper were you trying to read?

I'd be happy to try to explain anything you found confusing.

Perhaps this online tutorial would be a helpful start:

https://io.livecode.ch/learn/webyrd/webmk


The main problem is likely that many programmers aren’t familiar with Scheme, or any kind of Lisp. So the material is presented in the context of a host language that itself requires substantial effort to really get used to.

Personally, while I did some Lisp back in university and was reasonably conversant in it at the time, nowadays whenever something nontrivial is presented in Lisp, it’s just too much mental overhead to get back into it, in addition to trying to understand the thing that is being presented.

Terminology like “logic variable” also needs to be explained, if you want to address an audience that isn’t already familiar with logic programming.


One of the hopes is that you can drop in your favorite host language's syntax and get a working implementation. What's your usual language stack these days?


I think the initial surface look makes scheme give a bit of an 'oh crap' response. But since minikanren is actually a small program and scheme doesn't really have syntax the language should be less of a problem than initial concerns might make one think. Grokking the actual logic in any language is going to be the bigger challenge. I guess I am trying to encourage just rolling with lisp if you can, but I totally get the initial reactions toward scheme though.


That's somewhat comforting! But on the other hand, it means also that some of the folk who would be perfectly able to understand the big idea are getting gatekept by just the look of the parentheses, even though host's concrete syntax is of little importance. Which is a darn shame.


Yes, I agree, and understand the point better. Totally a great thing if this can be made accessible to a wider audience and not expect them to do all the work to grok it, especially if there are easy/easier ways to bring it to a wider audience. The parentheses don't usually remain a problem after the initial bump, I had the same issue when I started clojure but after a short while it doesn't continue to be jarring. I think after about 90 minutes it just started to be "natural" perhaps that the wrong word, it was just something that was like ok after a bit and didn't notice too much.


Thanks Will! I think it was the microkanren paper (it's a few years ago now so i'm not 100% sure but seeing it seems familiar). I think I will try the tutorial and see if it helps make it 'click'.


Emails are definitely welcome too! Wherever you get stuck is a failure on the part of the authors.


I found sokuza-kanren [0] to be a wonderful introduction. It starts with the absolute basics and builds into a minimal logic system through a series of well-documented steps.

[0] https://github.com/miniKanren/sokuza-kanren


but one need to learn lisp to read it?..


What's your preferred PL? I suspect we could do a similar build-it-up in that lang too.


I personally code in c++, java and python.

I think python is the most common and simple language with majority of devs would understand for concepts learning, but it is likely too slow for practical applications.


One of the things miniKanren has going for it is that tons of folk have built little embedded implementations in the whatever your favorite host language is. For instance, here's https://web.archive.org/web/20211205175513id_/https://erik-j... a walkthrough of how you'd implement the basics in Python. Comes with an explanation.


I looked at the tutorial and choked at the first step.

First it says "== unifies two terms". Then the first example says "(== x z) (== 3 y)" associates x with z and y with 3. Are "unify" and "associate" the same thing? Why use different words? Why does the association reverse for x and z vs 3 and y? Is it commutative?


Unification is reflexive:

    (== x x) = x for all x
It is commutative:

    (== x y) = (== y x) for all x and y
It is idempotent:

    (== x (== x y)) = (== x y) for all x and y
And it is associative:

    (== x (== y z)) = (== (== x y) z)
It's not transitive, e.g. if we unify pairs (using made up syntax [a, b]) then

    (== [x, 1] [2, y]) = [2, 1]
    (== [2, y] [z, 3]) = [2, 3]
    (== [x, 1] [z, 3]) does not unify (since 1 does not unify with 3)


Thanks for the follow-ups but my comment wasn't really asking what unify and associate mean, I'm questioning the redundant complexity in what is supposed to be the introductory tutorial to the language.

From the submitted page, "The core language, using Scheme as the host language, is described in this short, interactive tutorial."


I think these are great points. Everything should be smooth as butter for an interested reader, and the tutorial should be so approachable and such a page-turner that the curious are hooked on page one and can't put it down.

Really---anything short of that is sub-optimal performance. I think some of it comes from new eyes reading and pointing out room for improvement. The other half is someone having the time to figure out the fix and implement it.


Unification in the context of logic programming is basically like "use these questions and solve for all the unknowns" in algebra, except it's done with logical statements instead of algebraic equations. Searching for something like "unification prolog" (Prolog being the most well-known logic programming language) will probably give helpful material.

For example you could start with two facts like "Fedora is red." and "Cat is green." Then if you ask the system "X is red." it'll tell you "X = fedora". If you ask it to list all the solutions of "X and Y are not the same color." it'll list "X = fedora, Y = cat" and "X = cat, Y = fedora". This process of binding variables to values (or other variables during simplification) is unification.


They are commutative. As to whether unification and association are the same thing... yes, kinda. Unifying two terms kinda means associating them with each other in a database. Though I will say that it would have been better to say 'unifies x and z, as well as y and 3'.


You totally absolutely are smart enough to understand this. Possibly overly so! Happy to jump on a call and answer questions, if useful!


The Reasoned Schemer. Might take a few reads but it's very good. Although you might need some prereqs (e.g. The Little Schemer)


i don't know, but their website doesn't support https at least


Why does it need to?


To protect the users of the site from receiving pages that have been tampered with?


What was the last time that you got served tampered webpage over http?


Happened to my startup back in ~2012.

We had built an iPhone app that retrieved HTML pages from a server, but then scanned for extra metadata that was embedded in HTML comments for things like what navigation options should be displayed to accompany that page.

We got a bug report from a user that the app broke when they used it on the free WiFi on the London Underground.

It turned out there was some weird proxy running on that WiFi network that stripped HTML comments and injected extra tracking code into pages!

Switching to https fixed the bug. I haven't shipped anything that uses plaintext HTTP since then.


Thank you all for your comments! We are working on a new version of the website, with a new layout, better examples up front, and HTTPS.


Not sure if you heard, but recently more net neutrality rules were struck down and that is expected to continue -- so ISPs (who have already done this) are allowed to inject / replace ads with their own ads, as an example. (https://thenextweb.com/news/comcast-continues-to-inject-its-... was the first article I hit in the googles)


I believe I'm being served tampered content every single time I access HTTP, so the last time that happened coincides with the last time I used a HTTP URL.

Here are two hurdles:

1. Can you prove me wrong?

2. Next, given 1, can you rationally justify not rolling out HTTPS everywhere.

In other words, is it actually a valid argument that "often, nothing bad happens when you use HTTP, so it is okay".

Tampering of content has nothing to do with your privacy; it's a security matter. A nefarious man-in-the-middle could insert content which attacks your browser or redirects it to a malicious site, etc.

That attacker could be on a network close to you, or a network close to the site. It's not a matter of trusting or not trusting the original site that serves the HTTP.

Therefore it doesn't matter that you're just accessing the site as an anonymous visitor without an authenticated account, just viewing public content.


I just mostly mourn all the caching and sharing potential along the way gone in the world where everyone totally needs a private secure tunnel to the very server containing most mundane, public and irrelevant information.


Thanks. We're working on an improved site with HTTPS. Coming very soon, I hope!


> Tampering of content has nothing to do with your privacy; it's a security matter. A nefarious man-in-the-middle could insert content which attacks your browser or redirects it to a malicious site, etc.

Curious, why that doesn't happen when I access https://verybadguy.tld/this_page_absolutely_doesnt_have_harm... for the first time? Isn't it the browser's job to handle harmful content?


Browsers are indeed supposed to make it safe to connect to anything; it is their job. They have not had a perfect track record, though.


My caching proxy disagrees with that. My threat models are bad 4g connections and greedy telcos.


Fair enough. All depends on your threat model and risk appetite


bit of a trap question - clearly it doesn't need to, plenty of people accessed it in this thread fine and it works. even if it didn't, and there was a prevalent internet standard mandating it these days, you could just handwave it away, claiming that people don't need to respect standards or something.

"why do you expect it to?" i think would have been lot less of a trick question, and that's simple: it's trivial to set up and offers security benefits people - i think reasonably - take for granted these days.


Question:

I want to try miniKanren in my favourite game engine Godot Engine, how would I embed it?

The typical options are c++ and porting python to gdscript, but wanted to ask.


A while ago I stumbled across this post: https://tomstu.art/hello-declarative-world

It walks you through implementing microkanren in Ruby. You might find it easier to implement all of that in gdscript.


Neat.

> The six simple building blocks: variables, states, and the four kinds of goal — make two values equal, provide local variables to an existing goal, pursue two existing goals separately, and pursue two existing goals together.

> The only data structure is a pair. We can create lists using pairs.

I'll play with it more.

I have a port of https://github.com/dananau/GTPyhop and planner systems feel related to relation programming


Interesting fact, there's a neat connection between Micro-Planner and the genesis of Prolog. So I think you could be on to something.


Is there a specific definition of Micro-Planner? Curious.


What I was thinking of was this one: https://en.wikipedia.org/wiki/Planner_(programming_language)... . I don't imagine there's any more formal a specification beyond what-they-implemented (but I haven't actually read the paper!)


Mini Karen, on the other hand...


Haha my dyslexic ass read the title as “MiniKaren”… I was half-expecting to see some miniaturized version of someone complaining at a grocery store or something


Imagine it being 2024 and you don't know how to make your website HTTPS.


Does it matter for an informational site? HTTP is quicker and doesn't expire certs etc.

Of course, agree, it's totally needed for anything with a login or downloads etc, but serious question, what's the risk/benefit tradeoff here?


The risk is that HTTPS is something you have to manage. Either your hosting provider auto-renews certs for you (which might cost) or you set up your own automation (which can fail, and I've seen enough properties with expired LE-issued certs to know that email reminders can be missed and certbot is not a silver bullet). That said, usually an expired cert fails open, ie users can still visit your website if they accept the scary "this is unsafe" warning. This is not an option if your website uses HSTS or is on a TLD with implicit HSTS (eg .dev), but in that case you're opting in to the responsibility of renewing your certs reliably.

The benefit is that you can be sure that nothing modifies the traffic between your server and the client, so the client sees your content without any modification.

The counter-points to the benefit are that a) the traffic can still be *blocked* by any party in the middle (eg a state-level firewall), b) that traffic can absolutely be modified if the client has accepted an alternative CA for whatever reason (legal, corporate, etc) and that CA is used to MITM the connection to your server, and c) you as a website operator don't necessarily care about the MITM situation of every client's network (ie them having a MITM is their problem, not yours).

There's another benefit that browsers restrict some JS API to only run on https pages, which matters if you wanted to use those API. https://developer.mozilla.org/en-US/docs/Web/Security/Secure...


If you use HTTP you can have middlemen hijacking your content or inserting malicious things and nobody would know. There's all kinds of weird actors out there.


Yes, that's enough reason to upgrade.

We're working on it! Should have a new version of the site up within a few days.

Thanks!


The important thing is to realize how much programming has been wasted solving problems that can be easily expressed as logic programming and/or integer programming. If you need to solve logic and combinatorial based problems, learning these techniques will save you hundreds of hours.


Sounds interesting. Could you give a specific example?

Say, in a SaaS web app that provides a comments widget (a Disqus clone), what behavior (user facing or behind the scenes) would be a good candidate to implement with logic/integer programming?


AWS uses a SAT solver (Z3) to resolve permissions.

I can see miniKanren (or some other logic programming language) being helpful in the realm of authorization.


There could be library of UI primitives and backend in logical language, then you would write declaration of what you want exactly:

- I want window of these size, with such controls

- when this button is clicked, text from this control appears in that DB column

and system figures out all details making it cross platform, fault tollerant, etc if all infra is coded on that platform


I have a vague recollection about that kind of a declarative UI framework, but I can't remember a single detail. But it's definitely an interesting idea and I know there are other folk out there also interested in your idea.


I have a hunch this might be about the difference between "programming" and "coding". Web stuff, Hardware, and other things that don't get to just communicate with other programmers or programmers have a tendency of piling layers upon layers with custom glue and pipes everywhere.


Request: I'd love to learn more logic programming, SAT solvers, and equation solvers, but in a language I'm familiar with. Maybe python? But where to start?

I played with some Scala mini Karen implementations before, but the ones I tried were all half-baked or non-working.


You might find Chris Mungall's py-typedlogic interesting:

https://py-typedlogic.github.io/


Thanks! And thanks for miniKanren and reasoned schemer!


If you're interested in SMT solvers, the Z3 bindings for Python are very easy to use.


Hillel Wayne is working on a Logic for Programmers book [0] that might be what you're looking for.

[0] https://leanpub.com/logic


The chapters on both constraint solvers and logic programming are pretty short overviews, we're talking less than 15 pages. I wouldn't recommend it if that's what you're specifically interested in.

For SAT/SMT in Python, I've heard this book is pretty good: https://theory.stanford.edu/~nikolaj/programmingz3.html. Google OR-tools has a Python frontend and they have interactive tutorials (https://developers.google.com/optimization/examples). I don't know about logic programming in Python. Note that while there's some overlap between logic programming and constraint solving ([1] [2]), the communities are pretty independent from each other. Different histories, tools, techniques, etc.

[1]: https://www.swi-prolog.org/pldoc/man?section=clpfd

[2]: http://picat-lang.org/picatbook2015.html


[flagged]


What would be the benefit of having https for such site?


Even if you don't care about privacy, every single page using bare HTTP can have HTML or JS injected into it by a third-party.

Certain ISPs, hotels and airlines do it to their clients, and the script kiddies messing around the poorly firewalled subnet of their college's AP do it too.


It would prevent one’s ISP from injecting advertisements in the HTML as has happened commonly in the past with US ISPs. I presume that has mostly fallen out of practice but one could well blame that on the near-ubiquity of HTTPS.


Don't enter your credit card number. Sorted.


[flagged]


The name pre-dates the Karen stereotype, but IMO the naming clash is beneficial. I won't be surprised if miniKanren implementation for some new language is actually called Karen.


"Kraken" here, at first. But just me I acknowledge ...


the 'n' is where the logic comes from


Sadly you're not alone


[flagged]


I expected some sort of mini academic computer network: https://www.kanren.org/about (KAnsas REgents Network)


That's actually related to how the name came about, IIRC!


Really?

The word 'kanren' means 'relation' in Japanese, and was proposed by Oleg.

Is there a naming connection to the Kansas thing?


IIRC, Dan told me that a million years ago, when they were choosing a name for the Kanren sourceforge repo, they had to use a name with a word that was sufficiently prominent on the internet. Kanren worked because there were enough hits for KanREN.


[flagged]


You've posted in the wrong thread.


Thanks!


It's a small computer language that wants to "talk to the manager"


I don't care about something I don't and didn't care, neither have time for. I've only visited submitted page to check if it's original title is indeed "What Is miniKanren" (doubting it) and _it isn't_ - what for that.. bait ? - nothing I wanted to know about and nothing interesting there - I guess - as I read only the first sentence of this unplanned interruption:

"miniKanren is a family of Domain Specific Languages for logic programming", whatever..

- shall the title of this submission better be it ?? - with respect and to not waste people's time and efforts (now just forgetting that few minutes of my life to write about it.. but not others forced labour to explain it - when there is no title: Ask HN, what's that ?).

(The Algorithm for Precision Medicine would catch my interest, wouldn't read it today.)


"What is miniKanren?" it's NOT a title of that page.

It's a first line that happen to be there, of quite a lot. The one only short explanation what it is that was there, I've cited in the parent.

The title of a submission shall not be edited - right ? - but here, it's obviously hallucinated (there is no title). And I seem to be downvoted by bots with context buffer size of 1 line and a submitter ? who did read no more - but who exploited me and others instead - all paid in reverse.

Dang: title of this submission breaks HN guidelines (and I'm dovnvoted for being exploited and saying it, there shall be a warning - but it's up side down, not for me only - coltea .., - or leave: * suck karma exploiting others, my no thanks, sorry).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: