Hot answers tagged

43

Is LISP still practiced/used in todays world, or is it a legacy language Yes, it is, but you have to know where to look. People who use LISP don't tend to shout too loudly about it but there's a handful of examples of a few high-profile startups having used it to great effect over the last 20 years. It is also very popular with small companies in Europe. ...


41

Well, BASIC had LET for assignment as part of the syntax from the start in 1964, so that would predate the use of let in Lisp, which as Chris Jester-Young points out didn't appear until the 1970s according to Evolution of Lisp. I don't believe COBOL, Fortran, or ALGOL have LET in their syntax either. So I'm going to go with BASIC.


38

It is very much like learning math will improve your analytic skills and learning latin/classic literature will improve your writing skills. People who designed those languages have thought hard about what does writing a program means. And those languages are the results of those researches. That said, learning Java will also make you a better programmer. ...


36

Top-down is a great way to describe things you know, or to re-build things that you've already built. Top-down biggest problem is that quite often simply there is no "top". You will change your mind about what the system should do while developing the system and while exploring the domain. How can be your starting point something that you don't know (i.e. ...


30

I'd like to add a theoretical point of view: In classical lambda calculi, let is just syntactic sugar. For example let x = N in M can be rewritten simply as (λx.M)N So its first appearance in early (functional) languages isn't that interesting. However, it become very important with the invention of Hindley-Milner type system and its type inference ...


29

Many Lispers will tell you that what makes Lisp special is homoiconicity, which means that the code's syntax is represented using the same data structures as other data. For example, here's a simple function (using Scheme syntax) for calculating the hypotenuse of a right-angled triangle with the given side lengths: (define (hypot x y) (sqrt (+ (square x) (...


28

A canonical reference for this type of question is Paul Graham's What Made Lisp Different. The two remaining key features of Lisp that are not widely available, according to this article at the time of its writing, are: 8. A notation for code using trees of symbols. 9. The whole language always available. There is no real distinction between read-...


25

It depends on your specific needs, and the strenghts and weaknesses of the particular implementations. That said, here is what first comes to my mind when thinking about different implementations: SBCL is pretty fast, and good at number crunching. So, if you depend on heavy numerical computation, that might be the right implementation for you. Also, it has ...


23

The AI course I participated in online, taught at Stanford, recommended that Python be used for the homework. I believe Georgia Tech still uses LISP. The fallacy here is "new" is "good". AI research is one of the oldest computing research disciplines. It keeps calving off subfields as people realize that techniques from it can be used elsewhere. Language ...


23

A dissenting opinion: Lisp's homoiconicity is far less of a useful thing than most Lisp fans would have you believe. To understand syntactic macros, it's important to understand compilers. The job of a compiler is to turn human-readable code into executable code. From a very high-level perspective, this has two overall phases: parsing and code generation....


22

I feel your pain, I would love to do more coding in functional programming (Haskell looks so fun!). I feel like I have only just scratched the surface because I have yet to use it in a business context. I would strongly suggest against doing it though. If you program in a language only you know then only you will be able to support it. Unless you want to ...


22

Dan Weinreb (unfortunately he passed away last year) wrote an overview: Lisp Survey There are many differences between the CL implementations. It is not possible to cover all different needs (speed, size, license, price, compatibility, operating system support, ...) of users for a Lisp system in one implementation. One has to find a local optimum by using ...


22

Lisp is the oldest language of these having LET now. But BASIC was the first that got it, for Lisp had obtained it much later. In Ada Lovelace Analytical Engine (1843) - no LET, a program looks as: N0 6 N1 1 N2 1 × L1 L0 S1 L0 L2 S0 L2 L0 CB?11 ' In Plankalkül of Zuse (1943-45) the program looks: P1 max3 (V0[:8.0],V1[:8.0],V2[:8.0]) → R0[:8.0] max(V0[:8....


19

Scala makes this possible too (in fact it was consciously designed to support the definition of new language constructs and even complete DSLs). Apart from higher-order functions, lambdas and currying, which are common in functional languages, there are some special language features here to enable this*: no operators - everything is a function, but ...


19

The simple answer to your question is to try Lisp, preferably in conjunction with SICP. Then you will be enlightened. That said... Code is Data Most languages make a sharp distinction between code and data; Lisp does not. This makes it possible to, for example, trivially write a Lisp parser in Lisp, and to manipulate Lisp code within Lisp. The best ...


18

I mostly use macros for adding time-saving new language constructs, that would otherwise require a bunch of boilerplate code. For example, I recently found myself wanting an imperative for-loop similar to C++/Java. However, being a functional language, Clojure didn't come with one out of the box. So I just implemented it as a macro: (defmacro for-loop [[...


18

It's difficult to assess technologies when you don't have deep experience of them, but of course that's exactly when you have to make your decisions, so there's no simple answer to that dilemma. You cite two concerns: performance and usability. I'll try to address both below. Firstly, performance. Performance of course depends not only on the language but ...


17

I'm sure if I leave the team, --not saying I'm leaving. :)-- no one would maintain it. Possibly False. If the program has value, and management sees the value, they will task someone with learning Clojure and maintaining it. Happens all the time. This program will be destroyed and some will develop with other language. Always true. So why worry about ...


17

At the risk of giving a "me too" answer, if you try it you'll see... If you study computer languages, you're likely to get the impression that it's at least half about parsing. If you learn Lisp, you'll realize parsing the surface syntax is nothing more than a convenience for people (like most of us) who don't like Lots of Irritating Single Parentheses. ...


16

A decorator is basically just a function. Example in Common Lisp: (defun attributes (keywords function) (loop for (key value) in keywords do (setf (get function key) value)) function) In above the function is a symbol (which would be returned by DEFUN) and we put the attributes on the symbol's property list. Now we can write it around a ...


15

The statement is hyperbole. But there are obvious signs of Lisp envy in other languages. Look at C# and how it is becoming more functional in nature. Look at the various Business Process Management, workflow, and EAI frameworks that go out of their way to make it possible to program the system without changing the program. There's a book on Domain Specific ...


15

A Lisp list is not really terminated with an empty list -- it's terminated with a special value, traditionally called nil. As it happens, that also traditionally evaluates as false -- which makes it about as close to C's null pointer as you can get (in C, a null pointer constant is an integer constant equal to zero, which also evaluates to false). An empty ...


15

I think there are few examples because of lack of motivation. Normally when you implement a compiler or an interpreter the point is raising the level of abstraction. It makes a lot of sense to implement an assembler writing in machine code, then a C compiler using the assembler, then a Python interpreter using the C compiler... Staying on the same level or ...


15

In the context of the paper you linked, the words "micro-coded machine" would almost certainly refer to a Lisp Machine. At the time Lisp was beginning to get a foothold, it was hoped that it would be run (in the general case) on machines that were designed specifically to execute Lisp instructions, rather than computers with a more general instruction set ...


15

The question is a difficult one to answer, as someone would have to know all languages in order to know that no other has a particular feature available in Lisp, so the following is based on the languages I have experience with. Off the top of my head, conditions are something that I haven't seen in any other language. Think 'exceptions', but where the ...


15

tl;dr Learning new stuff can only make you a better programmer, but being a better programmer is not about the languages you can write code in. What are the advantages of using LISP and Haskell? LISP: Homoiconic code. This allows structured self-modifying code. Syntax-aware macros. They allow rewriting of boilerplate code. Pragmatism. CL is ...


14

It's been a while since I've worked in LISP, but as I recall, the basic non-atomic structure is a list. Everything else is based on that. So you could have a list of atoms where each atom is a node followed by a list of edges that connect the node to other nodes. I'm sure there's other ways to do it too. Maybe something like this: ( (a (b c)), (b (a c))...


14

Well, between those three, Lisp definitely had it first. Haskell came about in the 80s, and Clojure in the 00s, and let had been around long before either of those dates. :-) As to whether Lisp was the language to have invented it, I can't vouch for that yet, but I'll do some research and see. :-) Update: According to Evolution of Lisp (see page 46), it ...


13

Haskell Haskell has "Template Haskell" as well as "Quasiquotation": http://www.haskell.org/haskellwiki/Template_Haskell http://www.haskell.org/haskellwiki/Quasiquotation These features allow users to dramatically add to the syntax of the language outside of normal means. These are resolved at compile time as well, which I think is a big must (for ...


Only top voted, non community-wiki answers of a minimum length are eligible