Live data from Hacker News

Lisp Prolog and Evolution

blog.samibadawi.com

31–40 of 40 posts

Re: Lisp Prolog and Evolution

#31
post #6

Earlier quoted context omitted.

"you need to spend some time learning the syntax" But Lisp has rather less syntax than most other programming languages - and that's possibly a weakness rather than a strength when it comes to anyone new to the language. I suspect there is a sweet spot when it comes to the syntactic complexity of programming languages - too little and people get lost in the generality and abstractions, too much and its difficult to r…

> Lisp has rather less syntax than most other programming languages - and that's possibly a weakness Yup: it's like saying that binary is easier than decimal because it has less digits - the average Joe would still find it easier to do his maths in base ten :)

The comparison is not really valid. The point was that one has to spend "less" time to learn Lisp's syntax.

Thus, learning binary syntax vs. decimal syntax is indeed easier, as it is easier to learn Lisp's syntax when compared to other languages like, say, Java or C++.

Re: Lisp Prolog and Evolution

#32
post #3

I absolutely love programming in Prolog. I've never needed to write anything large in it at all (which is where most prolog interpreters fail), but when it comes together so beautifully at the end, its quite amazing. I thoroughly recommend "The Art of Prolog" which is an engaging and fun read.

At university we had to learn prolog and for me (C/perl) it was mind blowing experience. Fact that you are writing program as bunch of logical predicates was kind strange at first, but when you get used to it, it's such a great and powerful tool. Also, learning things like unification was just wooow. So, I'd recommend prolog to every programmer, especially today when most people use yet another standard language. On the other hand prolog is sooo out of the box.

Re: Lisp Prolog and Evolution

#33

The following shows a common misconception: "There is no reason why you cannot combine strong types or optional types with LISP, in fact, there are already LISP dialects out there that did this." Common Lisp already has strong, dynamic, optional types. "Strong" means: there is no implicit type conversion. "Dynamic" means: runtime things (objects) have a type, not necessarily the (static) variables that hold them. Thi…

> "There is no reason why you cannot combine strong types or optional types with LISP, in fact, there are already LISP dialects out there that did this."

> Common Lisp already has strong, dynamic, optional types.

Isn't that what he said? Common Lisp is a dialect of Lisp.

Re: Lisp Prolog and Evolution

#34
post #14

I find Prolog a marvel in "look what I can do!" Writing stupidly fun code in it is almost a no-brainer, compared to other languages (I have a half-assed English grammar parser in 60-odd lines, with a few comments!) But getting into prolog needs a complete rewire of how you think about programming: if you are used to imperative (or functional, or list-based, or almost whatever else) prolog feels very foreign. I'm also…

Back when I was at the university, Prolog and Lisp were the forbiden languages to write compilers on our compiler courses, because the teachers saw them as making the whole exercise too easy.

You should have written a tiny Lisp in whatever language they did allow and then go from there.

Re: Lisp Prolog and Evolution

#35

Dunno if the author's around, but Haskell does not descend from Lisps in the way that he thinks; it is much more closely related to the ML family.

It isn't descended from Prolog either -- I presumed the author was making a point about conceptually similar flavours of type systems, semantics etc. and Haskell's position as a typed Lambda calculus.

Re: Lisp Prolog and Evolution

#37
post #14

Earlier quoted context omitted.

Back when I was at the university, Prolog and Lisp were the forbiden languages to write compilers on our compiler courses, because the teachers saw them as making the whole exercise too easy.

You should have written a tiny Lisp in whatever language they did allow and then go from there.

We got to use Java with JavaCC, this was back in 1998 and everyone wanted to use it, sounds familiar?

Re: Lisp Prolog and Evolution

#38
"Haskell and LISP both have minimal syntax compared to C++, C# and Java". I agree that LISP does but I can't really say the same thing for Haskell, especially when you get into the whole monad stuff...

Re: Lisp Prolog and Evolution

#39

On the subject of why amazingly-powerful, ahead-of-their-time languages don't catch on.. I'd be interested to know if a study has ever been done on the "accessibility" of a language and its popularity. By which I mean: A total novice, even a non-programmer, can be given a simple bit of PHP/Javascript, and work out what it does and how to make minor changes to it. But something like Lisp & Haskell, you just can't do t…

This doesn't match my experience at all. People with literally no programming experience do not magically understand what a for-loop does. In fact--at least among the people I've tried teaching myself--they don't even understand what a mutable variable is! (And it's not like I used that term: I try to explain it in a simple way.) Learning the syntax for Php or JavaScript isn't that easy.

On the other hand, anybody with some math experience already knows and understands what a function is. At least to these people, Haskell syntax is clearer because it more closely matches something they're already familiar with: defining functions by cases. Sure, if you use some weird operators from odd libraries, people won't be able to follow. But that's true of using odd libraries in any language: people won't inherently understand AbstractBeanFactories or __magic_names__ either!

Now, if you already have some programming experience and little math, it's a completely different story. Once you've seen one imperative language with loops, statements and variables, you've seen them all. But this says more about how similar they are them about how easy they are to understand without background.

The usual experience people have with teaching Haskell and Scheme is that it's actually easier for people without prior programming experience! Colleges starting with either of these languages use them partly to level the playing field, and it seems to have worked reasonably well.

Besides, C and especially C++ are both very difficult to pick up. This hadn't stopped them from being people's first languages and becoming extremely popular. There's definitely much more to the equation, and I think the perceived difficulty of learning is both less important and less pronounced many people believe.

Re: Lisp Prolog and Evolution

#40

On the subject of why amazingly-powerful, ahead-of-their-time languages don't catch on.. I'd be interested to know if a study has ever been done on the "accessibility" of a language and its popularity. By which I mean: A total novice, even a non-programmer, can be given a simple bit of PHP/Javascript, and work out what it does and how to make minor changes to it. But something like Lisp & Haskell, you just can't do t…

For a few years I got to watch a lot of novices and young programmers come to grips with various topics/programs together while I was helping out with a CS summer camp for prospective students at university. One year I was involved we used Pascal, another year we used JavaScript, but for a number of years, we used... Prolog!

This was done partly because prospective CS students often already knew Pascal, JS, or both -- putting the curriculum in a lesser-known language provided some extra incentive for those looking to stretch themselves.

The other thing, though, is that it seemed to put our smart but novice students on more equal footing with our students who already knew how to program. That is, though Prolog was arguably "harder", our novices seemed to keep up.

I suspect that Prolog isn't really harder, it just requires some thinking on an orthogonal axis to more common languages. Most of us don't get much practice on that axis, so writing programs in it is difficult.

The same thing may well be true of Haskell and Lisp.

Post reply on HN