Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The premise of the title is a bit odd, because technically anything a lisp can do assembly language can do. The bar on being able to do 'anything' is so low that many things accidentally become Turing complete.

Can lisp programmers still feel smug about using lisp? No, because it never was and never will be productive to feel smug.

Is lisp still the best language for expressing a programmers thoughts? Yes, because it has basically no syntax, so any program will be a direct representation of a programmer's mental model for how their program works. No language with syntax will do that, but the average programmer is probably best actively discouraged from utilising this freedom because they probably have flawed mental models of what is going on.



It's rather jarring to read "Can lisp programmers still feel smug about using lisp? No" followed by "the average programmer is probably best actively discouraged from utilizing this freedom because they probably have flawed mental models".


> Yes, because it has basically no syntax

That's a myth. Lisp has lots of syntax. It just works different from what one might expect. It even has user-level mechanism to implement custom syntax: Macros.

Lisp usually has a two-level syntax: s-expressions as a data-level syntax and on top of that Lisp program syntax: function calls, built-in special operators (block, catch, if, let, progn, tagbody, quote, function, ...) and macros (lots of macros).

The myth that Lisp has no syntax, comes mostly from computer science education where students learn a very simplified pure Lisp as an educational tool. Telling them Lisp has no syntax, then is the usual trick to get the students of the mental hurdle of a different - Lisp on top of s-expressions - syntax. This Lisp is then just enough to write recursive list processing functions - but has nothing to do with real programming in Lisp. Even slightly more advanced (with respect to Lisp usage) texts like SICP mostly don't use macros for syntactic extension and don't explain them.


>> because it has basically no syntax, so any program will be a direct representation of a programmer's mental model for how their program works

That's actually a problem with Lisp, because every programmer would have different mental model and without some syntax rule imposing at least basic structure most of Lisp programs would be PITA to maintain by the unlucky next programmer. It also seriously limits the scale of teams of Lisp programmers (is that even a thing?), because every one of them will have their own "right way" of doing things.


This is a criticism that just feels fabricated. Worse, it is all assertion, but no evidence.

By and large, what you are doing is going to dictate large parts of your tool chain. And, by and large, most people have not built tool chains in lisp. I would caution against reading any technical meaning into either of those facts.


Really? You think it's bad for a team of people to have a common understanding of what's what (the syntax)? You can't be serious.


This assumes that lisp leads to that. Which is why the criticism feels fabricated.


From an engineering perspective, you're right, lisp really does give you too much power.

From a linguistic perspective, isn't this the same as accents and dialects developing in isolated groups of people? We don't fault Australians for having unique vocabulary and accent, it's just a different way of speaking. Maybe the beauty of lisp is that each person gets to solve problems in the particular way they feel is most obvious, even if it's not universally accepted as being so.


Imagine it more like everybody is free to make their own dialect without ever having the need to actually talk that dialect with someone else. And then require that a team all with different dialect start to communicate effectively together.


The team should be working in a shared domain-specific language. The good thing about Lisp is that creating a DSL isn't a painful ordeal.


Across my Java career, I've done raw servlets, struts, Spring, Stripe, and back to Spring. The vast majority of my Java knowledge transferred seamlessly from one environment to another with only minor changes ("oh, that's how its done in Stripe").

I could probably switch to another team that uses something else with a different version of Java and become a contributor within a day or two of getting the environment up and running.

If each LISP team is using their own DSL, how much of that LISP knowledge transfers from one shop to another? While the overall structure of the language is the same, how much of the DSL is the same? Is it similarity of Spring to Struts (a few different annotations, all of the data structures are the same)? or is it similarity of Java to C# (different annotations, different data structures, similar syntax, a number of the Patterns shift implementation)?


> If each LISP team is using their own DSL

Lisp already comes with several different 'DSL' built-in:

  * object-system CLOS
  * format strings with control structures
  * LOOP
If one programs in a language with flexible syntax, then a programmer has to learn how to deal with that:

  * what a the basic language extension patterns?
  * how can one debug it?
  * what a typical pitfalls?
  * what is good design?
  * how to document them?
  * how to present syntax errors to the user?
Language extension suddenly is a developer activity and not a language designer activity.

Much of the stuff in the Java-world, which has used DSLs with different syntax (like being based on XML), can be done directly in Lisp.

A Lisp team will need to learn how to deal with that. There are Lisp code-bases which have been maintained for decades. Even the SBCL compiler, which is written in Lisp, has its roots in code from the 80s (the Python compiler of CMUCL - unrelated to the later language Python).

Macros make things more complex, but the fear that macros make team programming or development of long-living code impossible is just wrong.


I call bullshit. The transition you cite easily went through XML configuration to annotation based magic to modern config libraries, where largely people just stopped caring about the magic.

In all, the hard part was internalizing the various life cycles. Not the silly syntactic or configuration tricks to make them happen.


>>If each LISP team is using their own DSL

Think of it more like each team is using their own class naming and method naming schemes.

The remaining software development methodology is same, its just Lisp allows you to create very powerful abstractions and features(Syntactical by default and very definition). Anything you define for the application becomes a part of the language by default because you are writing the program as AST. And there is no syntax.

This enables you to not write things like AbstractClassFactoryFactoryAdapterMySQLDispatcherFacade. Once you have powerful enough features to express your abstractions you don't have to do boilerplate plate work writing tens(hundreds?) of classes to heavy lift simple meta-programming tasks.

A few other features that might interest you.

* Lisp ecosystem encourages you to write incremental code(Bottom up programming). Like you think about something, then go ahead and write it, often prototype in the REPL and test. So you sort of unit test by default.

* Features like Closures, Macros and higher order programming eliminate largely the need for design patterns and boiler plate heavy code.

* Code comes out short, succinct and represents the problem that is being solved. There won't be code which will be solving meta problems. Like you won't be doing opening stream, then buffers, then byte read etc for simply reading a file. In Lisp when you want to read a file, you read a file.

* As mentioned before you will write less boiler plate code for meta-programming, so no need to write hundreds of classes. At that point in time in Java you are busy solving meta problem using things like Dependency injection and frameworks for simply managing configs. In Lisp you will spend more time thinking about problems you are solving, and not meta problems you have to solve in the language, to solve application problems.

* Hot code swapping. You get great debugging facilities, where you can actually pause, introspect buggy code, swap the fix and test. You can't do this in Java.

* Given all these advantages you don't need large teams of programmers, so you communicate and build efficiently. You build big software with smaller teams. Think 10x reduction in team sizes. And that much reduction in Project management overhead, and other associated people operations.

In short If I have to tell you. In Java you think a lot of meta problems trying to work around limitations in the language using DI, annotations, frameworks etc. In Lisp you think only about the application problem.

This is the biggest development methodology change.


Yeah. As a branch from rowang's points, humans are primed from birth to grok complex syntax and specifically leverage that syntax to ingest information streams.

In programming, this is most clearly illustrated by contrasting Lisp and their ilk with Ruby. General considerations of the languages aside, Ruby's syntax is notoriously complex - yet, the language is famous for being one of, if not the most, easiest to read languages currently in use.


Ruby is famous for it's advocates claiming it is the easiest to read language. I have yet to see evidence of said claim.

Sadly, I have seen the opposite. I, and most of my team, dread dealing with the Ruby package at work. Notorious for obscure tricks and terrible callback based system, where it is ridiculously easy to mess things up.


Can you point to some examples with the properties you suggest make Ruby unreadable?


This implies I think it is unreadable as an intrinsic property of the language. A claim I do not understand, and I am not making.

I could point to dense poetry as an example of hard to read English. Or light prose as examples of the opposite. In reality, I'd likely just be picking examples I like. Largely pivoted in the skill of the writer. Not any intrinsic feature of English.

And, ironically, it likely takes training and experience to appreciate either. Programming and writing.


Can you point to some specific examples with the properties you suggest make Ruby unreadable?


I think this criticism of lisp is overblown. It’s never idiomatic to introduce a macro unless you really need one. In the clojure community at least, macros are used pretty sparsely. The base language is is expressive enough.


Clojure is a different language - it borrows stuff from Lisp, but it can't run any non-trivial Lisp code from the past decades without more or less rewriting it. Even primitive stuff like math operators work differently - because Clojure mostly uses the math stack of the host language.


Macros are only tangentally related to mamon's point.


Really? Because apart from macros, Lisp has less syntax and little complexity compared to most languages. The issue mamon was talking about is about different programmers using different mental models or features. If macros aren't overused, this isn't nearly as big of a deal as it is for C++ or Scala.

I should except common lisp here. That is indeed a complex language. But Clojure and Scheme aren't/


No need to except Common Lisp here. I typically find it quite easy to understand other programmers' Common Lisp. It's not a difficult-to-understand language, and neither are macros, properly used (and they are indeed rarely improperly used).


Why do you think that syntax has anything to do with expressing mental models? If anything, that would seem to inhibit recognition of similar processes.




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

Search: