Hacker Newsnew | past | comments | ask | show | jobs | submit | zemptime's commentslogin

Can't believe this only got a couple of upvotes!


There is one. Don't destroy the means of error correction. Without that, no further means of moral development can occur. So, that becomes the highest moral imperative.

(It's possible this could be wrong, but I've yet to hear an example of it.)

This idea is from, and is explored more, in a book called The Beginning of Infinity.


We just have to define what an "error" is first, good luck with that.


The reason I dislike the twitter argument is, even if ruby was the root cause, the choice of ruby still launched the business and got them to that first success disaster.

The deeper reason I think it's a bad argument is because twitter ran into a problem native and new to them - massive fan out (celebrity tweet -> millions of followers). that's not the kind of thing any language typically does while responding to a web request.

Lastly - heavy survivorship bias here. We will never hear about all the startups which were "scalable from day 1" on java or whatever and fizzled out.

Looking at https://www.wired.com/author/sheon-han/, this author's whole strategy seems to be bear poking. The writer is skilled but at least in this ruby one they are definitely hate-farming. I'm a little sad to see content of this quality in Wired.

Anyway, I'm off. Returning to be part of the usually silent majority who is happily using ruby to ship useful software!


> The reason I dislike the twitter argument is, even if ruby was the root cause, the choice of ruby still launched the business and got them to that first success disaster.

This only works if there was no better language to launch a similar business in, which would've avoided the disaster


Was there one at the time? My impression is that back then you could either have a language/framework combo that's easy to work with _or_ one that solved all these technical problems, but not both.


appreciate you for adding this context


Countless time has passed since then, ruby isn't the same.


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 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 ;-)


You can do that in Racket, with the Racklog library¹. There's also Datalog² and MiniKanren and probably some other logic languages available.

[1] https://docs.racket-lang.org/racklog/index.html

[2] https://docs.racket-lang.org/datalog/index.html


While usually using native syntax rather than strings, somethign like that exists for most languages of any popularity (and many obscure ones), in the form of miniKanren implementations.

https://minikanren.org/


If you really want something that takes Prolog strings instead (and want the full power of prolog), then there are bindings to prolog interpreters from many languages, and also SWI-Prolog specifically provides a fairly straightforward JSON-based server mode "Machine Query Interface" that should be fairly simple to interface with any language.

https://www.swi-prolog.org/pldoc/man?section=mqi-overview


There are a bunch of libraries that will do this - here's one example of a python one: https://github.com/yuce/pyswip - and a ruby one: https://github.com/preston/ruby-prolog


Thanks for the reference! `pyswip` is the closest I've seen so far:

    pl.consult("some-facts.pl")
    pl.assertz("new(fact)")
    while pl.Query(...).nextSolution():
        print( X.value )
...will definitely keep it in my back pocket!


pyswip is a one-way python-to-SWI-prolog interface; there's also a first-party (maintained as part of SWI-prolog), two-way one called janus-swi.

https://pypi.org/project/janus-swi/

https://www.swi-prolog.org/pldoc/man?section=janus-call-prol...


You might be interested in Flix:

https://play.flix.dev/?q=PQgECUFMBcFcCcB2BnUBDUBjA9gG15JtAJb...

is an embedded Datalog DB and query in a general-purpose programming language.

More examples on https://flix.dev/


You could try picat

[0] https://picat-lang.org/


What you mean is not "regex for Prolog" but an embedded PROLOG interpreter, which exists.

Ironically, the most common way I have seen people do this is use an embedded LISP interpreter, in which a small PROLOG is easily implemented.

https://www.metalevel.at/lisprolog/ suggests Lisprolog (Here are some embedded LISPs: ECL, PicoLisp, tulisp)

SWI-Prolog can also be linked against C/C++ code: https://stackoverflow.com/questions/65118493/is-there-any-re... https://sourceforge.net/p/gprolog/code/ci/457f7b447c2b9e90a0...

Racklog is an embedded PROLOG for Racket (Scheme): https://docs.racket-lang.org/racklog/


I've wished for the same kind of 'embed prolog in my ruby' for enumerating all possible cases, all invalid cases, etc in test suites. Interesting to know it's not just me!


Maybe try a Ruby Kanren implementation:

https://minikanren.org/

uKanren is conceptually small and simple, here's a Ruby implementation: https://github.com/jsl/ruby_ukanren


There are a bunch of libraries that will do this - here's one example of a python one: https://github.com/yuce/pyswip - and a ruby one: https://github.com/preston/ruby-prolog


I did try ruby-prolog. The deeper issue is that its just not prolog. Writing in actual prolog affords a lot of clarity and concision which would be quite noisy in ruby-prolog. To me, the difference was stark enough it wasn't worth any convenience already being in ruby was worth.


Porolog might be more to your liking.

https://www.rubydoc.info/gems/porolog#porolog-wiki


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.


One theory I've heard for this, and sorry I don't remember the source, is that Napoleon suspected if he truly did take down the Russian royalty then he expected the rest of European royalty to unite and attack attack him.


As I remember, after French revolution, there were coalitions of foreign monarchies with the goal of punishing France [1].

Also what surprises me, after years of several revolutions and chaos in France, how could Napoleon gather such a large army.

[1] https://en.wikipedia.org/wiki/War_of_the_First_Coalition


> Also what surprises me, after years of several revolutions and chaos in France, how could Napoleon gather such a large army.

Conscription + France was basically the China of Europe at that point: it was almost as populated as the rest of Europe combined.

France then had a very, very, early demographic transition which dramatically limited its population. Had France followed the demographic path of England or Germany, France would have around 250M inhabitants today.


> France was basically the China of Europe at that point: it was almost as populated as the rest of Europe combined.

That doesn't seem to be correct. From Wikipedia: "During the Middle Ages, more than one-quarter of Europe's total population was French;[8] by the seventeenth century, this had decreased slightly to one-fifth. By the beginning of the nineteenth century, other European countries, such as Germany and Russia, had caught up with France and overtaken it in number of people." https://en.wikipedia.org/wiki/Demographics_of_France


he essentially invented the modern concept of conscription. there were press gangs and conscription-like things all through history but for the most part soldiers were professionals


He didn't invent it, the revolutionary government did and Bonaparte then inherited a massive experimented army after the French Republic having been at war for a decade when he took power.


Regardless of what you might think of Snowden, he has a good quip on this: "Arguing that you don't care about the right to privacy because you have nothing to hide is no different than saying you don't care about free speech because you have nothing to say."


Also, I invite anyone who thinks they have "nothing to hide" to put a publicly accessible webcam in their home bathroom. Everyone has things they'd prefer to hide, and that doesn't imply anything nefarious is going on.


I wonder if the point might be better made as "things you'd prefer not to share" - e.g. I don't think of myself as "hiding" when I'm in the bathroom.


This made me curious. Having never read the gitlab code before, and on mobile, took all of about 30 seconds to find https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/ro...

Those are some pretty clean routes!


Perfectly illustrating the problem! Now try to imagine finding that if you are unfamiliar with Ruby routing.


Suspect 6 minutes being increment has more to do with being 1/10 of an hour (easy to calculate rate) & and as fine-grained as you can get without being so obnoxious you can't track.


If the cost of providing this research is high, who would fund this peer-reviewed research which wouldn't make them any money?

For example, who would fund more studies on ginger? https://nutritionfacts.org/video/ginger-for-migraines/


I love Kung Fu Panda! It secretly became my favorite movie. Secretly, because it wasn't until years after I'd seen it that I realized how much I liked it compared to... every other movie.


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

Search: