Live data from Hacker News

Why Learn Prolog in 2021?

dstrohmaier.com

81–90 of 171 posts

Re: Why Learn Prolog in 2021?

#81
post #76
post #69

Earlier quoted context omitted.

> 4-5 years ago there was a reasonable strong enthusiasm for Scala and functional programmers in general. No, I've been looking to change jobs for the past year and absolutely nothing has popped up. I think businesses have weighted the power/capability of scala against the relative lack of easily hireable programmer for them. If a business makes themself dependent on one (or a few) key scala programmers, they are mor…

Why did they adopt Scala in the first place? I remember around 2012-2014 it was the hawtness. My guess is that there are languages that give you much of the power of Scala without the complexity - Kotlin, and modern Java, having caught up.

> Why did they adopt Scala in the first place?

I think in the case of Scala many companies became invested in Spark and Scala came along for the ride. Then as time went on, it turned out you could do advanced FP in Scala, despite its warts, with principled libraries like Cats and the Typelevel stack (see https://typelevel.org/cats/). Companies could then use Scala as a "better Java" or squint-and-it's-almost-Haskell. Or like you said they could just ditch Scala and use something less powerful but easier to learn and work with.

Re: Why Learn Prolog in 2021?

#82
post #76
post #69

Earlier quoted context omitted.

> 4-5 years ago there was a reasonable strong enthusiasm for Scala and functional programmers in general. No, I've been looking to change jobs for the past year and absolutely nothing has popped up. I think businesses have weighted the power/capability of scala against the relative lack of easily hireable programmer for them. If a business makes themself dependent on one (or a few) key scala programmers, they are mor…

Why did they adopt Scala in the first place? I remember around 2012-2014 it was the hawtness. My guess is that there are languages that give you much of the power of Scala without the complexity - Kotlin, and modern Java, having caught up.

Scala got huge because of Spark.

I'm a Scala programmer due to Spark. I love it.

Re: Why Learn Prolog in 2021?

#83

I was surprised to learn prolog is used in inductive automation's ignition SCADA product when it barfed out a prolog error after I entered an invalid expression. https://inductiveautomation.com/

With a name like "inductive", it kind of makes sense :) I wonder if it's used for their alarming logic.

> I wonder if it's used for their alarming logic.

If you need easily verifiable rules for your rules engine, it's hard to go wrong with Prolog.

Re: Why Learn Prolog in 2021?

#84
post #76
post #69

Earlier quoted context omitted.

> 4-5 years ago there was a reasonable strong enthusiasm for Scala and functional programmers in general. No, I've been looking to change jobs for the past year and absolutely nothing has popped up. I think businesses have weighted the power/capability of scala against the relative lack of easily hireable programmer for them. If a business makes themself dependent on one (or a few) key scala programmers, they are mor…

Why did they adopt Scala in the first place? I remember around 2012-2014 it was the hawtness. My guess is that there are languages that give you much of the power of Scala without the complexity - Kotlin, and modern Java, having caught up.

I worked at a Scala shop in 2011. It was pure hell. Slow compiles, bad tooling (the Scala plugin for Eclipse was a slow as molasses, IntelliJ's was a bit better though), inexperienced developers. I asked why they chose Scala... It was obviously immature at the time. "Joe thought it was good." (Joe was the architect.)

I'd never touch it again.

Re: Why Learn Prolog in 2021?

#86
post #76
post #69

Earlier quoted context omitted.

> 4-5 years ago there was a reasonable strong enthusiasm for Scala and functional programmers in general. No, I've been looking to change jobs for the past year and absolutely nothing has popped up. I think businesses have weighted the power/capability of scala against the relative lack of easily hireable programmer for them. If a business makes themself dependent on one (or a few) key scala programmers, they are mor…

Why did they adopt Scala in the first place? I remember around 2012-2014 it was the hawtness. My guess is that there are languages that give you much of the power of Scala without the complexity - Kotlin, and modern Java, having caught up.

My theory is that Scala was adopted because Java stagnated. Java isn't stagnant anymore (even if its behind other languages) and a lot of people I know that advocated Scala are just fine with Java now.

Re: Why Learn Prolog in 2021?

#88
I'm not convinced there's great utility in smart contracts, but if there is, I think there's a huge utility in contracts being declarative and statically typed, to avoid many of the problems we've seen with existing contracts. In that case, a statically typed Prolog dialect would be a good starting point. The contract would be a set of declarative rules describing acceptable next states of the contract. To make the contracts verifiable in linear time, the submitter would submit the next state of the contract, plus a compact binary representation of the path taken through the rules set, so no backtracking would occur in the verifier. You could allow recursion, as verification time would still be linear in the size of the submitted compact path representation, just not linear in the size of the contract. If you disallow recursion, then verification would also be linear in the size of the contract.

Granted, many of the problems with Ethereum Solidity contracts are more to do with all of its use of implicit behavior (in a misguided attempt to hide the complexity of contracts) rather than directly consequences of Solidity being imperative.

Here's a quick plug for Mercury[0], a statically typed dialect of Prolog with an optimizing native code compiler. Supposedly it's 5 to 10 times faster than commercial Prolog compilers or available interpreters.

[0] https://github.com/Mercury-Language/mercury

Re: Why Learn Prolog in 2021?

#89
post #79
post #28

Earlier quoted context omitted.

I am learning Prolog because I think I have an idea that I believe might actually be easily solved by Prolog instead of hacking it in some other language. I personally believe in learning paradigms of programming as far more important than languages. Prolog presents the very unique logic programming paradigm. Learning new paradigms always feels a bit mind-bending to me. Edit: Actually, my last statement may be only i…

If you're interested in learning many paradigms, the Oz[0] language, Mozart system, and accompanying textbook[1] were designed as a teaching tool to teach most of the major paradigms in a single language. I have not sat down with them, but they have been on a far back burner for years. [0] https://en.wikipedia.org/wiki/Oz_%28programming_language%29 [1] https://en.wikipedia.org/wiki/Concepts,_Techniques,_and_Mode...

Definitely! It's been on my backburner for years as well. I have the book and started to take the edX course a couple of years ago, but got sidetracked with work. I e-mailed Peter Van Roy back in May, asking if the edX course would be resumed. He stated that the local university course got removed from the engineering curriculum, so that's why the edX course isn't running anymore. Hopefully it comes back. He mentioned that he had recorded some lectures on his YouTube channel.

https://www.edx.org/course/paradigms-of-computer-programming...

https://www.edx.org/course/paradigms-of-computer-programming...

https://www.youtube.com/user/PeterVanRoy

Post reply on HN