239 points · by kuwze · 8y ago · 318 comments
I do think Lisp kind of missed the boat when a wave of dynamic languages (Perl, Python, Ruby) went mainstream. Today the most exciting developments in language design seem to be around static type systems, type inference etc.
In my view the former is much more valuable because ultimately we want to know that the code is doing what was intended, and static typing doesn't appear to be an effective tool for encoding intent.
Static typing is about as effective at encoding intent as intention revealing names. That is to say, if you are diligent and clever in how you structure and name things, a system can be very intention revealing.
HN user jerf has a method of revealing intent through types in golang, which he calls something like microtyping. Basically, everything has its own type, based on its domain semantics. So if you're using a float64 to store time deltas, you don't just use the float64. Instead, you base a TimeDelta type on float64.
type TimeDelta float64
Then golang allows you to attach methods to that type, which can then provide more opportunities for intention revealing. Also, this prevents a programmer from mistakenly using a float64 representing width and shoving it into a time calculation. Is this as ironclad as Eiffel Design by Contract or Haskell typing? No. However, I've been using it myself, and I can affirm that yes, the compiler will warn you about some semantic errors if you do it this way.The big problem with the Intention Revealing Names pattern, is that there is no enforcement and that it is subjective. For this reason, it's likely to fall apart in a large enough project that lives long enough.
>type TimeDelta float64
>Then golang allows you to attach methods to that type, which can then provide more opportunities for intention revealing. Also, this prevents a programmer from mistakenly using a float64 representing width and shoving it into a time calculation.IIRC, this technique, or something similar, is shown in The Go Programming Language book.
F# also allows you to do similar stuff, I think.
For example, consider a sort function. The types can tell me that I passed in a collection of a particular type and I got a collection of the same type back. However, what I really want to know is that the collection contains the same elements, and that they’re in order. This is difficult to express using most type systems out there. Even when the type system is powerful enough to encode such semantics, it's both difficult to figure out how to express and understand the resulting specification.
In fact, it's often at odds with understanding the intent of the code because you're limited to a set of statements that can be verified by the type checker. This can make it harder for the human reader to understand what the code is meant to be doing.
For example, it takes nearly 300 lines of code to encode insertion sort using types in Idris https://github.com/davidfstr/idris-insertion-sort/blob/maste...
A human reader has to be able to read that and understand that the types are encoding the intent correctly. I don't know about you, but I have a much easier time knowing whether the dynamically typed version in Python is correct or not:
def insertionSort(lst):
for index in range(1, len(lst)):
currentvalue = lst[index]
position = index
while position > 0 and lst[position - 1] > currentvalue:
lst[position] = lst[position - 1]
position = position - 1
lst[position] = currentvalue
Complex type definitions effectively become their own meta-programs that the compiler uses to verify your program, but now you've just pushed the problem back a step since somebody still has to read and understand the meta-program to know that it's verifying the correct thing.I'm sure I'm not the only guy who started learning Lisp after reading Paul Graham's essays, and I'm going to keep using Lisp for several reasons, but the momentum just isn't there.
"Robert and I both knew Lisp well, and we couldn't see any reason not to trust our instincts and go with Lisp. We knew that everyone else was writing their software in C++ or Perl. But we also knew that that didn't mean anything. If you chose technology that way, you'd be running Windows. When you choose technology, you have to ignore what other people are doing, and consider only what will work the best."
"This is especially true in a startup. In a big company, you can do what all the other big companies are doing. But a startup can't do what all the other startups do. I don't think a lot of people realize this, even in startups."
[...]
"If other companies didn't want to use Lisp, so much the better. It might give us a technological edge, and we needed all the help we could get."
Seems like a lot of startups do do what the others do tech wise and use Ruby which seems to work out ok.
I have optimism for lisp.
It is one of the most active implementation of Common Lisp (other being Clozure CL) and one of the fastest thanks to its support of optional type hinting (which it had long, long before gradual typing become in vogue recently). With some type hinting, it is possible to generate a code that's almost as fast as C (in certain cases, of course, but still much better than other implementations).
>Nobody seems to have done any serious work in SBCL in over a decade.
Could you please elaborate on what you mean by this?
SBCL releases a new version that contains both enhancements and bugfixes every couple of months, with the latest version (version 1.4.9, released on June 28, 2018, ~5 days ago) came one just one month after the previous version, 1.4.8, so I really don't understand what you mean when you said that no one "seems to have done any serious work in SBCL in over a decade".
You can also see all previous releases and their changlog here: http://www.sbcl.org/all-news.html.
Or did you meant to say that no one use SBCL to do serious work? Well, with some googling, I'm sure you'll be able to find that, while not many, there are companies that use SBCL (and other Common Lisp implementations) in production and other non-trivial works (not to mention various freelancers who use SBCL to put foods on the table). Some of those companies are also involves with the development of SBCL as well.
>Basic things are either completely missing or broken.
Care to list them? One of the strength of SBCL is that the devs are very responsive, especially to bug reports, so I'm sure they would be more than happy to fix the problems that you encountered.
EDIT: always in SBCL and CCL
What are those things? Name them.
The commodification of programming and proliferation of languages like Javascript and Python means not only that the "masses" lack fundamental understanding of Computer Science but that they have been conditioned to go after superficial ease-of-use rather than actual value. Anything that requires upfront effort to reveal its secrets is rejected for what is fundamentally broken but covered in a veneer of user friendliness.
Python is the new Perl (Go is already gearing up to replace it where reliability is at stake) and in a couple of years the masses will look at it as a colossal and obvious failure, but they will make the same mistakes again and again when the next shiny thing comes along because the entire domain is rigged in multiple ways.
I suggest reading Richard Gabriel's essays, they are very depressing but also illuminating. In many ways he predicted what is taking place now, the rise of commodification and the obliteration of the field by companies like Google.
Before Perl, Tcl was supposed to be the Lisp replacement. As far as I know this "language X is an adequate/better replacement for Lisp" argument goes back to Ted Nelson ranting against Lisp while advocating TRAC in the 1974 book Computer Lib. So far all of the language Xs have disappeared, and the only thing to replace Lisp has been other Lisps.
Don't get me wrong: I love Clojure, and it's currently the language that pays my bills. But I'd never consider using it to build an app for end users (except possibly a ClojureScript React Native app for mobile devices).
The module system has also turned me away from Scheme; the point where different Schemes all implement say R6RS but they have different module systems, or even different ways of converting an integer to a string, varying support for SRFIs (the regex SRFI is nearly four years old and the only Scheme to implement that is Chibi) and the completely variable module system, where nothing at all is consistent, none of the modules work in another Scheme, even if you were to extract the code. You want something from Chicken to use in Guile? Too bad, you have to manually do all the work yourself, despite the fact that both modules are supposedly written in standard Scheme.
The module situation eventually pushed me to write my own Lisp, but I realised that unless I were to go ahead and implement all the things I wanted, everything I would miss, I'd be in just the same place, reminded of that xkcd comic in which "there are now 15 competing standards". So I gave up on doing just that, and now I'm literally writing a Lisp compiler and then operating system with a friend, because for me it's a lot less frustrating to say "that doesn't work on my operating system" than it is to say "that doesn't work in this guy's Scheme". It wasn't supposed to make sense.
If you use SBCL, which is by far the best CL implementation, it's in the manual under "Generating Executables" [1].
It directs you to this [2] which is basically a single function that you call:
Function: save-lisp-and-die [sb-ext] core-file-name &key
toplevel executable save-runtime-options purify root-
structures environment-name compression
Save a "core image", i.e. enough information to restart a
Lisp process later in the same state, in the file of the
specified name. Only global state is preserved: the stack
is unwound in the process.
<more, detailed, documentation snipped>
What is hard about this? It's literally 10 seconds of work.I am not picking on you, since others run into similar issues, that are completely and utterly trivial, which makes me wonder if they have been conditioned not to bother looking things up in a manual anymore and want things to simply fall in line with their expectations.
I am also a Smalltalk user and I frequently observe the same behavior in that domain. New users run into trivial problems that take less than a minute to solve (for the absolute beginner) and give up immediately. I'm almost convinced that there is some sort of psychological effect that comes into play when the task at hand is very dissimilar to what one is used to.
Image-based languages like Common Lisp and Smalltalk offer tremendous productivity gains but they're also totally unlike anything else out there in many ways. So they require upfront effort, before one truly "gets it", that includes someone willing to suspend their preconceptions and look at things with 'zen mind, beginners mind'. I think it's fair to say that most programmers today are incapable of doing that. Maybe they're just wired for immediate rewards and/or the overall dumbing down of the domain is also making them dumber. Cybernetic feedback loops are like that ..
[1] http://www.sbcl.org/manual/#Generating-Executables
[2] http://www.sbcl.org/manual/#Function-sb_002dext_003asave_002...
Yet, it's a very niche language, an almost forgotten artifact of time.
Sort of but not really.
Even though this mantra is repeated often, the greatest "cogs" actually have deep domain knowledge. That's how most mainstream programmers "level up". They become experts in the application they're developing and what it does functionally. Or in the domain in which the application operates (after having worked on several applications in the same field, for various companies).
HackerNews folks don't work in this kind of field, but in that domain Lisp is a liability. You want a plain and simple programming language, no meta programming, dumb albeit repeated code that does just what it needs to do. The rest of the brain cycles are needed to understand the often convoluted business logic ("due to this regulation the employee needs to be X", "the account is Y because our partner Zs", etc.).
My view is that Clojure has enough critical mass now that it's not going anywhere. There is a large community that's very active and enthusiastic about the language. There are many companies building their businesses around Clojure, and it's only going to continue to get better.
I don't think Clojure is ever going to become a mainstream language like JavaScript or Python, but that's very different from saying that it's dying.
I don't mean it's unsuited to them. My company has a developer with one year of Javascript programming experience productively working in Clojure. But, I think often about how hostile FP's vocabulary is to non-experts. (Personally, the baggage I brought from OO made FP incomprehensible for quite some time). Clojure documentation, and most tutorials aimed at it, for example, take for granted newcomers' comprehension. If we could measure the average number of languages a programmer brings to the table when he learns Clojure, I'd be willing to bet it's more than two.
Ruby and Python on the other hand are languages where beginners thrive! Not only are many of the language concepts self-evident, the communities are often driven by recently graduated beginners spawning beginner-level documentation, beginner-level sympatico, etc.
I think the best we're ever going to see is mainstream languages like Kotlin, Swift, Ruby and Python which mix functional features with OOP. In fact Scala really falls into this category so it seems OOP is here to stay.
I wouldn't measure Clojure's success with those kind of numbers. The number of applications running Clojure code would come close to a real metric.
The whole point of Java and Python is to provide VPs with massive departments to bloat their egos with head counts. Clojure or Lisp don't aim for such goals.
And third, abstractions have costs. There is no wide-spread popular LISP, and people should really ask themselves why. We have lots of code generation, and depend on it more and more. But it’s “simple” (or “primitive”). It’s usually one step. You can read the input, and you can read the output.
I’m starting to get a sense that macros are like currying. Elegant, beautiful, powerful. But net negative if your concern is to get lots of people to create software together.
I've seen a fair number of metrics that show it's losing market share on a proportional basis, but holding steady on an absolute basis. Have you seen anything to contradict this?
In JS in particular, activity is often used as a proxy for the "maintainedness" of a library. I think this is because JS is (currently) a moving target.
Clojure is one of those languages where, occasionally, problems get solved and don't require any significant further development.
Whenever Graal is mentioned, a host of reservations towards Oracle usually appears though.
Arguably, the s-expr syntax is what enables the rich code-as-data metaprogramming that you find in Lisps. Working with full macros in a sexpr language is already complex enough, the an extra layer of complexity that non-sexpr language add really breaks that camel in half. The point is, you really need code == AST parity to make a powerful macro system workable. You don't necessarily need the parans, but complaining about parens is really missing the point.
Of course, s-expressions have a big advantage: homoiconicity. Homoiconicity enables the metaprogramming that is such a powerful and relatively unique capability of the Lisp family. But it's possible to add additional abbreviations to s-expressions to make the notation much easier to read by most software developers. Indeed, the original Lisp didn't have "quote", but no one would be happy today if you had to write (quote a) instead of 'a. (See the "LISP 1.5 Programmer's Manual" by McCarthy et al. of 1962 at http://www.softwarepreservation.org/projects/LISP/book/LISP%... ... and note that it has only QUOTE.) I think adding a few more abbreviations to the s-expression reader can make a big difference in the readability (and acceptability) of Lisps. E.g., "{a + b}" as an abbreviation for "(+ a b)" retains homoiconicity, while making code significantly easier to read for most people. For more information, see: https://readable.sourceforge.io/
Superfluous parens: Do not assume that the parentheses are superfluous, they are an excellent way to write down and communicate a tree-like structures. Code happens to be such a structure.
With regard to the readability, this probably reveals an initial training in an Algol-syntax language. It is really not self-evident that s-expr are harder to read, and find it hard to believe that is true. Most likely, if it is the case for you, it more likely means it is not leveraging years of brain-training on Algol/C style notation. Do not mistake this for anything intrinsic about s-expr.
To grab to personal experience: I have thought both Lispy and Alogly languages to complete programming virgins and have anecdotally seen less syntax-related mistakes in the former. The benefit of pre-learned infix semantics from mathematics courses is vanishingly small compared to the complexity of learning how to program. Unless your domain is actual mathematics (R, Matlab, ...), only a very small set of expressions in any program actually leverage that familiarity. The benefit in teaching/learning S-expr syntax is that is comparably uniform: whitespace breaks with paren ends. Infix languages introduce a set of context-dependent symbols. For example, a good portion of the errors I saw first timers make in class is mixing commas versus semicolon breaks. Even Python does this in the form of complex line breaking rules mixed with symbol-breaks (semicolon expression seperators, colon in conditionals, etc). It isn't hard when you are already familiar, but you definitely notice the complexity when holding the hand of a first-timer.
In short, the 'not seeing parens' is akin to not 'seeing commas, semicolons, colons, braces, parens, backspaces, ...' in Algol-syntax languages.
But honestly, things that are different should look different. Leveraging familiarity is a vital tool when designing a consumer-facing interface, but avoiding faulty preconceptions and ambiguities is more important for the professional tool that is a serious programming language. I personally think in C when handling low-level memory, Lisp when doing metaprogramming, Prolog when doing logic programming and something APL-like when doing linear algebra.
It is, and infix notations have been added many times, going back at least to Vaughan Pratt's CGOL in the 1970s. Yet none of these notations have ever caught on very much among Lisp programmers.
I understand that the syntax is a barrier to newcomers, but there's no point in arguing that it should be changed, because one really does get used to it, and even to like it. You might as well tell the Mexicans (or Indians, or Thai, or Chinese, etc.) not to make their food so spicy. Yes, it takes some getting used to, but to change it would be to ruin it.
I feel like this helped me understand the power of "everything is/as a function" to the point of wanting to go back and try lisp again.
Sibling post suggest making Python-esq DSL on top of lisp, and I really like that idea.
Julia-lang: Hold my beer. [1]
[1] https://docs.julialang.org/en/latest/devdocs/ast/#Surface-sy...
I think the paper would be much stronger if it focused on that BioLisp aspect, talking about:
* What is BioLisp? A mere web portal pointing to various resources across various languages? An attempt to create a curated installation of version-compatible libraries for a specific LFL? An attempt to develop a fully-integrated framework for that LFL??
(I think Sage for Python might be a useful model here, but if you were trying to build that, you'd have to start by picking your LFL, which the authors at present seem unwilling to advocate. That in itself demonstrates one of the main liabilities at present in adopting LISP--the community is fractured between Racket, Scheme, Clojure, and various implementations of Common LISP--often to the extent that they argue over whether their respective opponent languages even _deserve_ to be called LISPs. And, of course, in this forum we even have Arc fanatics to add to the lot. ;-) )
* What challenges face biologists attempting to use LISP in their work? How does BioLisp help to address those? ("Your language lacks macros" is not an argument at a sufficiently detailed level, I'm afraid. Rather, actually show them a DSL built in LISP that they will desperately want!)
* For that matter, what challenges face biologists attempting to use R/Python/Julia/etc for their work? How does BioLisp help to address those?
* What promising pieces could BioLisp be built upon? What pieces are missing? What pieces need modernization?
By all means, I encourage scientists and LISP enthusiasts to make the case that biologists should/could be using LISP--but make sure you actually make the case!
EDIT: I will add that although I enjoy using Lisp languages, and have written a few Lisp books, that I don’t like to talk anyone into using any particular programming language or technology stack. There is a difference in enjoying our own choices to telling other people what choices they should make.
I always thought of linked lists as a special kind of graph, where each node except the head and tail had exactly one incoming edge and one outgoing edge. What's a better way to think of this in terms of LISP?
Or rather, there is a structure called a cons cell which consists of two pointers, "left" and "right"; a cons cell in which the right pointer is NIL is a list; and a cons cell in which the right pointer points to a list is also a list. The values in the list are whatever is pointed to by the left pointers.
If you diagram this out, you'll find that your mental image is basically accurate already. It seems difficult to describe lists of this form as a "generalization" of graphs.
I got mad when I finally learned Lisp and realized how much time and effort has been wasted over the years because we're too lazy, ignorant, or foolish to use it.
(As a tangent, it's simply incredible how deliberately ignorant programmers can be. I've worked with guys getting paid to write software who didn't know who Alan Kay is, or had never heard of Prolog. What's worse is they're not ashamed of their ignorance. Can you imagine a physicist who had never heard of Newton?)
I don't use Lisp, but I have the grace to admit that that's a personal failing. (I joke that Python's only major problem is that it ruins you for other languages... I just can't quit that sweet syntax. Although Python 3 is a train wreck IMHO. Don't get me started.)
I would switch to Lisp, but I found something even better, which brings me to my actual, non-ranty, point:
There's a language even better than Lisp.
It's called Joy and it combines all the best parts of Lisp with the best parts of Forth to make an enormously simple system for describing software. It's a purely functional, stack-based, "concatinative" language that turns out to be good for "Categorical" programming: programs in Joy can be "instantiated" over different categories to generate different kinds of computations. I only have one good reference for "Categorical" programming right now: a paper and talk by Conal Elliott "Compiling to Categories" February 2017 http://conal.net/papers/compiling-to-categories/ He's working in Haskell, not Joy, but he's describing the idea: from one piece of code you can get calculations, dataflow diagrams, circuit descriptions, type signatures (inference), derivatives, etc., by implementations of the categories for each kind.
Separately I think each lisp has an individual fundamental flaw that makes it unusable for production, eg clojure having terrible error handling, common lisp being case insensitive, scheme having a minimal standard library, racket being fairly slow, etc.
Would C be ruined if people could type:
If ( expression ) { effect };
I'm also becoming unsold on file system case sensitivity as well. Should "Income Report 2018Q1" really be different than "Income report 2018Q1"? How often is this a desirable feature?
The only reason I have now for maintaining case sensitivity is that in the Unicode world casefolding is an absolute nightmare and no language or file system built today can afford to not use Unicode.
Also, Common Lisp is case sensitive.
Any books / papers / articles that one should definitely read on these topics?
In my undergraduate days (oh so many decades ago), I was introduced to Lisp. For some of the problems we were solving, it was the perfect tool. For others, a different language could be used.
The pros of Lisp (in all its varieties) are in many ways the cons of Lisp.
The macro system is both beneficial and antagonistic to the development of sane programs. Used judiciously, macros may life writing code much easier. However, it is not uncommon for Lisp programmers to write macros without consideration for those who come after them. This is, of course, true for any language.
There are some major systems out there that are written in Lisp and when trying to change them (in a maintenance way), it is just as painful as in pretty much any other language.
The competent and talented Lisp programmers is imbued with the same arrogance that C++ competent and talented programmers have. Tricky programming is fine if it is fully documented and the reasoning for the tricks is fully explained.
Lisp and its variations have much to offer the programming community. But the way programs are written quickly diminishes the effectiveness of the language for the larger community.
Each language has features that can be of use to each of us. they are tools we can use to solve the problems we are facing. No one language is suitable for all problems. If you have that attitude then you only see hammers and nails.
To me, learning lisp and Emacs at the same time seems like a tall order
I have limited personal experience with it, but it seems good and I have read good things about it, written by free users.
You really don't need to start programming macros before you need them. Just focus on learning lisp. Much simpler.
Knowing that certain powerful features of programming languages can be used to create unmaintanable code, do we ban those features or do we try to harness them by using a disciplined approach to software design?
Specifically with regard to meta programming, I think we have seen all that can happen several times over.
If you have those features within the programming language they tend to get overused. If you don't have them within the programming language, they get tacked on in some inconsistent, half-assed way as soon as the need for frameworks, DSLs or sophisiticated configuration arises.
can confirm, if you can't metaprogram in the language, you will at some point write external code generators and such... Metaprogramming is just the most common programming "task", avoiding repetition, applied to itself.
Discipline never works unless it's enforced. So the only hope is to figure out "less powerful" versions of those features that cover all their important use cases without permitting unmaintainable code. Fortunately, modern programming language design has gotten pretty good at that: 95% of the killer use cases you'd see as macro examples in Lisp advocacy 20 years ago are now ordinary, standard-ish programming language features.
> If you have those features within the programming language they tend to get overused. If you don't have them within the programming language, they get tacked on in some inconsistent, half-assed way as soon as the need for frameworks, DSLs or sophisiticated configuration arises.
That's a possible failure mode, but we've been pretty good at moving away from it IME. The best modern languages do manage to walk the fine line between a language that's too constrained to do anything in without some magic addon and a language that's unmaintainably flexible in the language proper.
I don't have any example were the disciplined approached worked so I would agree with the first option. People overused every single bad feature, here it's Lisp but it's the same in Php, Perl, Javascript or Python.
[1] https://www.cise.ufl.edu/~manuel/obfuscate/obfuscate.html
I don't know if it is fair to say that Lisp meta-programming is more core to the language than CPP is to C.
Only a smart programmer can write Lisp. The popularity is proportional to how much cognitive capability requirements of the language. The story is the same with Haskell.
The bigger problem here is the number of programmers have increased disproportionately over the years. For that alone reason technologies had to be dumbed down to a point where anybody could use it.
If programming kept its original ethos, it would suffer the same problems one suffers taking a subject like Math mainstream.
But the real problem here is just starting now. You now have a whole generation full of masses of programmers who only do XML/JSON parsing, talking to HTTP interfaces and doing HTML and doing nothing more. This is like people doing basic algebra whole life. Eventually you won't get much out of this sort of practice.
At some point in time, to not max out the value generated by a system you have to up the level of the game, and that would come at a painful task of having to retrain entire generations of programmers which neither will be easy, and in many people's case it won't be possible.
Already languages like Java have shown their limits. To build anything meaningful you need large frameworks, with crazy dependency graphs, to manage which you need one another framework(DI). And with all that you barely get to do the ordinary stuff.
So eventually you would have only delayed the use of something like FP, not entirely eliminated it.
>>There is little demand for programming languages that are hard to maintain.
Java applications with 100 classes to post to REST interfaces will eventually suffer the same fate.
'Maintainability' is a very subjective term.
>>A working program lasts decades
Not true anymore. This was true pre dot com days. Thanks to all this agile processes and 'fail fast' culture. Code bases have very little life these days.
>>LISP is dead-end technology that will forever keep being brought up as its temptations are irresistible to some.
The success of Clojure means this is totally false.
The lisp community refused, and has a serious elitist taste that you can even feel in the comments.
I'm ok with it, but you must accept the price of this is peopme leaving, or not comming in the first place.
To me it seems an acceptable deal. Plus you can't have your cake eat it.
The thing with languages like Python. They will lower the bar for entry, but they will keep you at the beginner stage all along the stay.
That's OK. Programming isn't a monolith, we already have several layers of programmers based on the complexity of the task they solve. So Lisp will have its own place, so will languages like Haskell and F#. Its also upto the programmer to decide at which layers they like to work.
A humongous percentage of developers are paid a lot to paint houses reliably: https://www.joelonsoftware.com/2002/05/06/five-worlds/ (internal software, consultingware)
In the software world, you either level up your tech skills or you level up your domain knowledge skills. Both are lucrative career paths. The second one can be easily covered with Java and it will continue to be so for the foreseeable future.
But If learned programming, using C based languages, and that journey was done, I might as well go an extra mile and explore further.
Nothing bad ever happened by gaining more knowledge.
Have you ever seen so-called academic code? If your developers are PhDs without a programming background, you're bound to get programs that reflect the complexity of their own throught process plus the subject they are dealing with. I don't think encouraging that through something as unbound as Lisp is a good idea, as much as I love how unbound Lisp is.
Python probably hits a sweet spot in this regard.
It's possible to write horrible python code. But it's way harder
Even without an editor, you are forced to indent. You can't use macro or make huge anonymous functions. The whole language is designed around readability.
Being able to apply the resulting work to the real world is very hard, because for a programmer - you have to package it up in a way that's easily digestible to people who don't want to have to go through the process of reinventing the wheel from scratch in order to understand it (or just don't have the time to).
Lisp doesn't have to be complicated with a billion bells and whistles to be good lisp code. If you approach learning it from there, you build your own, don't have to compare it to PhD level research. It might one day get to that point, where no one can understand or wants to understand what you've created, but that's the other side - the isolation that comes with being an academic.
Like in Python, we have context managers (with statements), they're cool but we can't do much inside them. I wanted to use them to add logs to a list and automatically return it from my api. I couldn't, I had to do that manually everywhere.
Now enters a new developer. In Python he would learn the base style, function names, the use of our custom context manager plus the need to manually feed and return the list of logs. In Lisp he would learn that our context manager (a macro) handles the logs.
---
This thread gets comparisons to Python, so let's enlarge the comparison spectrum: Lisp has a better REPL (enjoy ipython ? You'll love a Lisp REPL !), better type inference, it is a compiled language, making it a breeze to build an executable of your web app and deploy it to your server, a better object system (method combination, polymorphism, methods not bound to classes,…), Lisp is stable,…
and
>>Python probably hits a sweet spot in this regard.
Willing to learn more on how Python magically converts PhD level quantum mechanics, and related Math to easily understandable stuff.
Also Im all ears, please explain to me how the crappiest and the most competent programmers all become same by the mere use of Python.
Well yeah but guns make it much easier.
The guys says he just wants a language where he and his team can be productive. This. 1000x this. Ranters gonna rant, haters gonna hate, but productive people will use whatever floats their boat. For me it's clojure lately. I don't need to convince anyone that 'X' is better than 'Y'. If a new paradigm comes along (actors) that proves valuable, I hope that my language can assimilate it (quasar/pulsar). Otherwise I'm happy.
Besides, in today's startup economy, we're lucky if a company lasts months, nevermind about decades.
As a manager I would not want such orchids as we call em in German. What if this "rock star" leaves the team? What if we want to bring in more team members? Who pays for the development of these dev tools? After all we are not payed to write code but to solve problems- a fact devs like to forget. Do they really pay for themselves in therms of savings as suggested by the dev?
I don't claim that this questions were not raised and answered, but that from a strategic point of view not the coolest and shiniest toys and concepts may make the most sense.
To "just" be productive you need a huge library/tool ecosystem that, realistically, only a handful of languages are ever going to have at any point in time. Particularly if you want your language to make use of the possibilities that GUIs offer. I love Scala and find its IDE support to be one of its great strengths, but even so it's noticeably behind what you get in Java or C#. And that's a top-20 language.
As for clojure, I have yet to find an environment as good as emacs+cider+nrepl.
I agree in general, but it's not just whatever floats their boat. Every real project has its yak-shaving aspects. Productive people pick languages (plus libraries and ecosystems) that will handle for them as much of the yak-shaving as possible, leaving them free to work on the problem they're actually trying to solve.
Edit: Actually, I seem to remember that this was how I learned about reader macros and I went on to over-enthusiastically (ab)use them myself....
Methinks that lisp value is exploratory, when you want to go crazy deep, you use it to mold every bit of the language as you want and try paradigms/principles.
ML or Haskell are also used a lot there but I think it requires a bit more apriori planning (separate grammar / semantics, typing, denotational mindset). Whereas lisp is more hack it until you make it.
[1] and if you look Dave Beazley fantastic video talks about "abusing" python metalevel, and compare it to CLOS you will find the difference to be more hard to discern.
- http://lisp-lang.org/success/ (pgloader was rewritten from python)
- https://github.com/azzamsa/awesome-lisp-companies
Besides what's call Lisp in the Tiobe index(https://www.tiobe.com/tiobe-index/) is ranked 27, before D, Clojure, Lua, Erlang, Rust, Julia…
And I find Lisp programs great to maintain: the language is stable, the ecosystem too. Python programs on the contrary are a chore to maintain, even after only 2 years.
But with some continuity and a carefully crafted own little world, everybody on the team soon chooses voluntarily to speak in the terms of that world, because it is a world well suited to the problem at hand.
Also they don't apply to online open source projects and tutorials.
> This is why after 50 years it is still a niche language
where "This" is either the REPL or macros, which they do not specify.
It's just as easy for me to speculate that Lisp isn't popular because money talks:
- You have an idea for a piece of software and create a start-up.
-You hire competent Lisp programmers to write that software. Since they're rare, they're expensive.
-The start-up grows because the idea was good and the software works, and somewhere along the line someone sees that more money can be made by cutting expenses on development.
- They shop around and find some outsourcing party that claims to write Lisp cheaper.
- They outsource development, but the software goes down the drain. "Lisp" is now the problem, according to the new developers. But costs are down, growth is still continuing, and they got rid of the weird people who made fun of their Gucci tie.
- People cash out, and on advice of the new developers stuff gets rewritten in the popular language of the day.
- Stuff muddles on for some time, until everything comes crashing down. The cycle starts anew, except now it's clear for everyone involved: don't bother with the software, focus on growth, and in case of doubt:
Blame Lisp!
So yeah, that's my "Why isn't Lisp more popular?" hypothesis: modern software for start-ups is about enabling growth, not quality.
And without further substantiating it's just as valid as blaming it on the "ability to self-modify."
> It makes lisp a terrible experience for beginers.
That might be true.
Gucci ties will always try to outsource, and it will often lead to this, lisp or not.
> a terrible experience for beginers.
Start with your own stuff ;)
Lisp makes it easy to shape a sub-language to fit your own head well. The problem is, few others can figure out YOUR head. Communication conventions are not always pretty or efficient, but they work because they are conventions. If you place parsimony (compact abstractions) above inter-human communication, then all you get is isolated parsimony.
The better embedded languages in Lisp often follow conventions: see for example CLOS and the various conventions it follows from naming to integration.
The actual problem is that defining sublanguages for most developers is not something they have learned. The result is a multitude of languages for similar tasks with their own infrastructure. For many programmers it is normal to wait for new language constructs for several years - while they work around this by combining language built-in constructs (extreme: creating lots of bloat - see Java), by using preprocessors (upto transpilers of different languages - see Java and Javascript for languages transpiling to those).
There is some complexity in Lisp providing features for embedding languages.
But there is also complexity in working around that with languages not very good in embedding. See for example Clojure, a language which provides functional programming idioms on top of Java - the integration is great - but many developers are not satisfied about the integration when it comes to debugging - see the complexity for example of stack traces in a layered language design.
I would say that the operator voodoo of Haskell is worse, and that is coming from someone that uses Haskell on a daily basis.
Modern Vanilla JS written in 2018 has the same backwards compatibility guarantees, it's extremely likely that you'll be able to run it in 2038.
Once you add Babel, React & co, all bets are off...
That's simply not true. I think the only reason that Lisp is unpopular is the syntax, which is unfortunate because it's the syntax which is the source of all its power. As for why the syntax itself is so unpopular, sometimes I wonder if irregular syntax really does help comprehension (i.e., that having {}*&^%$#@! helps as a kind of visual shorthand), but most of the time I think it's really just unfamiliarity.
Can you point me to some lisp code that's completely bonkers and which most people are incapable of understanding?
To say that library support for bioinformatics is on the early stages is quite a misunderstanding. Lisp was one if not the first language to be used in everything, including bioinformatics. If it is not used anymore is because people have abandoned it.
People have abandoned it once its flaws became evident. The main flaw of Lisp is using linear data for everything. It is obsolete, it was designed for linear memory like tapes or punched cards, not random access to memory like we have today.
Languages like Clojure has not this limitation but they have others, like forcing you to use the java virtual machine, good if optional, terrible if mandatory.
In current systems with huge amount of RAM, when you could have 128GBs on a developer system having to use a system that shoehorns everything to Lists is going backwards.
It also maximizes verbosity as everything uses the same thing, pattern differentiation is hard for actual humans to read and understand. This was a serious flaw that even Lisp creators quickly identified and tried to solve, remember Lisp was considered a temporary solution while the good solution was(never) found.
Not to talk about the absence of privileged instructions, everybody on the team changing whatever it wants, even basic instructions.
Don't get me wrong, I love Lisp, it is one of the more interesting languages in the world. I am actually working on porting some of the features it has(introspection) to other languages.
But from my point of view it is not that good for production for most projects. I have drunk the kool Aid myself before and have the scar tissue from that.
Huh? Which Lisp are you talking about? That seems like a serious misconception! Certainly any Lisp after 1960 has great support for arrays, trees, graphs, hash tables, you name it.
This is just utter ignorance. Good example of not knowing that you don't know and interpolating from too little data.
The name "Lisp" comes from List Processing, but Lisp programming has not been about list processing since 50's. All the old Lisps like Common Lisp and Scheme had full set of data structures, including vectors and arrays.
You could not be more wrong.
So everytime you get on board on a project you hit your toes on the DSL du jour, of course badly documented and tested. It's like learning a new language everytime, except a beta version one with no resources.
Wouldn't it be better to actually inform yourselves first, by learning Lisp, rather than regurgitating somebody else's opinions?
It seems to me that 'drunk the kool aid of Lisp' is just a rude way to say, 'I reject their experiences because they differ from my beliefs.'
Whether that's a valid claim in this case or not, I will not comment on. But that's what the expression means.