Advent of Code 2018

absolutely #REKT

neet confirmed

I have some bad news about the continued development of LuaJIT, user.

wordsandbuttons.online/fortran_is_still_a_thing.html
which one of you wrote this?

I wrote it :)

isn't mercury just prolog with more constraints that help performance? for example, you can do the same bounded_increment in prolog using clpfd:
limit(clpfd,500).bounded_increment_clpfd(A,B) :- limit(clpfd,L), A #< L, B #= A + 1.
where the biggest difference is that you don't have to declare the inputs and outputs or the determinism. Another neat thing is that you can even write
bounded_increment_clpfd(N,A,B) :- limit(L), A #< L, B #= A + N.
which will also work in all directions.

Sure. It's like dynamic vs. static types, but in logic. In Prolog you can intend to write a deterministic predicate (never fails, always one result), accidentally write a semideterministic one (can fail, one or zero results) and nothing will tell you except a bug and then troubleshooting. In Mercury all of that's explicit and the compiler checks it for you.

Since you seem knowledgeable about this stuff, I have a question: Under what circumstances would it be better to use a logic language like Mercury or Prolog as opposed to something like C? From my point of view it seems like it would only be useful for database lookups, but I’m sure I’m missing something.

Nah, I rarely use it. One thing I like about logic programming though is that you can express a relationship once and then use it repeatedly in different ways. It's not something you'd notice yourself missing in a normal language: if you were writing a unit converter, you'd normally just write e.g. celsius_to_fahrenheit() and also fahrenheit_to_celsius(), where each function separately encodes the relationship between those two units. That's a bad example because with non-toy units you'd pull them from a database and have a common base unit or something, but you're always duplicating something. Want to append a "\n" to a string? Use this thing (an operator). Want to strip a "\n" from a string? Use this other thing (a function). With logic those could use the same thing.
With Mercury vs. C you're also getting a Haskell-tier type system and purity, and 'programming in the large' benefits, so there's a lot of non-logical stuff to talk about. And Mercury interfaces extremely well with C because it's a transpiling memelang--that also targets Java and Erlang, but not JS somehow

REPENT SINNER