News for hackers. Stuff that matters.
Re:The Bipolar Lisp Programmer (2007) by 0wl3x on Tuesday January 24, 2017 @09:14AM (#13471401)
excuse my ignorance, but other than emacs, what are the uses of LISP?
Re:The Bipolar Lisp Programmer (2007) by DonaldFisk on Tuesday January 24, 2017 @11:20AM (#13472636)
Others have already pointed out that this very forum's implemented in Arc, a Lisp dialect. Some large projects implemented in Lisp:

Operating systems

https://en.wikipedia.org/wiki/Genera_(operating_system)

Travel industry software

https://en.wikipedia.org/wiki/ITA_Software

Computer games

https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp

https://en.wikipedia.org/wiki/Crash_Bandicoot

Common sense reasoning

https://en.wikipedia.org/wiki/Cyc

and plenty more

http://franz.com/success/

I'm using Lisp to implement a visual dataflow programming language

http://web.onetel.com/~hibou/fmj/FMJ.html

Re:The Bipolar Lisp Programmer (2007) by zengid on Tuesday January 24, 2017 @09:31AM (#13471544)
I'm an amateur LISP hacker and not an expert, and I hope this thread doesn't turn into a flame war, but I can say that LISP is excellent for symbolic computations (a la lambda calculus, which Turing proved was equivalent to a Turing Machine) [1].

If you're more familiar with C languages, I like to think of LISP as the C of symbolic languages. It has practically no syntax, and LISP (as it exists today) has the neat feature that it's data structures are the same as its programs. Writing LISP code that modifies and generates other LISP code is relatively simple compared to doing the same in a syntax-rich language.

LISP does all of this at its lowest level, just like how C manipulates the fundamental elements of a CPU (pointers, contiguous memory blocks, basic arithmetic / logic operations, etc). The way CPU's are designed revolves around the Von Neumann Architecture [2], and C exploits this design very well. Unfortunately, LISP doesn't quite match this architecture, so it has traditionally performed poorly compared to C. But CPU's could certainly be designed to operate around a LISP-like model[3], so the Von Neumann paradigm isn't the only way.

[1] https://en.wikipedia.org/wiki/Lisp_(programming_language)

[2] https://en.wikipedia.org/wiki/Von_Neumann_architecture

[3] https://en.wikipedia.org/wiki/Lisp_machine

Re:The Bipolar Lisp Programmer (2007) by steinuil on Tuesday January 24, 2017 @11:40AM (#13472880)
> Unfortunately, LISP doesn't quite match [the Von Neumann] architecture, so it has traditionally performed poorly compared to C.

Exactly. It has traditionally performed poorly compared to C, but this hasn't been the case for a lot of time. There's a number of misconceptions about what is and what is not a lisp.

First of all, a lisp doesn't have to be interpreted or run in a virtual machine. While this is true for a lot of lisps, Common Lisp performs what you could call just-in-time compilation: you can even inspect the compiled code of a function by calling the `disassemble' macro on it, and optimize it based on the disassembly.

A lisp doesn't have to be dynamically typed. There are many examples of statically typed lisps (Shen, Dylan, Typed Racket, Lux), and in other dynamically typed lisps such as Common Lisp you can add type annotations as needed to optimize functions.

A lisp doesn't have to be garbage collected. It certainly is more convenient to have GC when you have such a dynamic language or want to program in a functional style; however, this is not required. Carp and GOAL[0] do not use garbage collection, and in Common Lisp you can generally give hints to the garbage collector to to make it run where you need it to.

A lisp doesn't have to be functional! While lisps usually advocate a functional style to varying degrees (mutation in Scheme is usually marked with a ! in the name of the function (set!) but normally discouraged, Clojure is immutable by default IIRC), but very few are purely functional (only Lux comes to mind) and most are in fact very procedural (Common Lisp).

Finally, Common Lisp has been designed to also be used as a systems language, and thus benefits from many optimizations targeting the Von Neumann architecture that can make it just as fast, if not faster, than C.

This is a good post detailing some of the optimizations that you can perform in Common Lisp:

https://chriskohlhepp.wordpress.com/advanced-c-lisp/converge...

To answer 0wl3x's question, lisps can be used for just about anything; it's just a family of homoiconic languages that generally make heavy use of macros as fundamental abstractions.

[0] http://www.codersnotes.com/notes/disassembling-jak/

Re:The Bipolar Lisp Programmer (2007) by lispm on Tuesday January 24, 2017 @01:40PM (#13474173)
> Common Lisp performs what you could call just-in-time compilation

Actually almost all Common Lisp implementation use AOT, ahead of time, compilation.

Re:The Bipolar Lisp Programmer (2007) by progman on Tuesday January 24, 2017 @02:21PM (#13474572)
Some Lisp's are really fast, SBCL for instance.

http://benchmarksgame.alioth.debian.org/u64q/lisp.html

Re:The Bipolar Lisp Programmer (2007) by TeMPOraL on Tuesday January 24, 2017 @09:20AM (#13471466)
All of them, it's a family of general-purpose programming languages :).

From older uses, you have Lisp in Gimp, Audacity, several AAA video games by Naughty Dog, in AutoCAD and few other recognizable places. Reddit was originally written in Common Lisp, later rewritten to Python. More recently, Clojure (a Lisp for JVM and CLR) is gaining popularity in the Java world, and a lot of startups are using it.

Hacker News itself is written in Lisp, BTW.

Re:The Bipolar Lisp Programmer (2007) by joncampbelldev on Tuesday January 24, 2017 @09:24AM (#13471498)
Java dev here, just to add that coding in clojure is bringing joy back to my daily working life. I've introduced it into a couple of projects, the simplicity and flexibility are an amazing productivity boost.

Some of that comes from clojure specifically, but the lisp syntax and macros are a big part of it.

Re:The Bipolar Lisp Programmer (2007) by malcolmstill on Tuesday January 24, 2017 @10:34AM (#13472118)
I'm writing a Wayland compositor in Common Lisp: https://github.com/malcolmstill/ulubis
Re:The Bipolar Lisp Programmer (2007) by zeveb on Tuesday January 24, 2017 @02:54PM (#13474863)
I'm really, really excited by that, BTW. Gonna wait a few months before I try to use it for real, but it'll be fun to have a new Common Lisp environment.

As long as there's a tiling mode, I'm there:-)

Re:The Bipolar Lisp Programmer (2007) by gkya on Tuesday January 24, 2017 @09:27AM (#13471516)
There are companies selling Common Lisp interpreters and IDEs. So certainly there are lots of users out there.

Many major Lisps (CL, Clojure, Scheme, Racket) are general purpose languages, and in common they excell at metaprogramming, interactive programming and control flow/debugging (see CL restarts).

Re:The Bipolar Lisp Programmer (2007) by eschaton on Tuesday January 24, 2017 @12:24PM (#13473376)
Don't say "interpreter" if you don't mean it. In the vast majority of cases, Common Lisp is a compiled language.
Re:The Bipolar Lisp Programmer (2007) by gkya on Wednesday January 25, 2017 @12:57AM (#13479011)
It's an interpreted one in the sense that one can continually interact with it during the life time of a program. Many of the popular interpreted languages nowadays do some compilation somewhere (Python, Perl, etc).
Re:The Bipolar Lisp Programmer (2007) by blablabla123 on Tuesday January 24, 2017 @09:25AM (#13471499)
I think this forum is written in some LISP dialect^^
Re:The Bipolar Lisp Programmer (2007) by pkd on Tuesday January 24, 2017 @10:15AM (#13471930)
Yes, made by Paul Graham. Called Arc. http://arclanguage.org/
Re:The Bipolar Lisp Programmer (2007) by openfuture on Tuesday January 24, 2017 @10:59AM (#13472379)
Run guixSD with stumpwm and emacs. Guix (the package manager) is in guile lisp, Shepherd (the init system) is in guile as well iirc, stumpwm (window manager) is common lisp and emacs is elisp.
Re:The Bipolar Lisp Programmer (2007) by imgabe on Tuesday January 24, 2017 @11:04AM (#13472423)
Much of ITA's matrix software, which controlled airline ticket pricing, was written in Common Lisp.

I don't know if that's still the case since Google bought it, but I imagine it would be pretty difficult to port a codebase that large and complex to a different language.

Re:The Bipolar Lisp Programmer (2007) by kelvin0 on Tuesday January 24, 2017 @02:57PM (#13474887)
You should ask Paul Graham, and his (first?) successful startup he sold to Yahoo: http://paulgraham.com/avg.html

So, pretty useful IMHO.

Re:The Bipolar Lisp Programmer (2007) by crispytx on Tuesday January 24, 2017 @02:08PM (#13474445)
Hacker News is written in LISP.
Re:The Bipolar Lisp Programmer (2007) by parfe on Tuesday January 24, 2017 @10:20AM (#13471987)
Lisps can do anything other general purpose language can accomplish. People still overwhelmingly choose other languages.
Re:The Bipolar Lisp Programmer (2007) by progman on Tuesday January 24, 2017 @12:40PM (#13473542)
When C++ and Java (the current industry standards) have adopted the last feature of Lisp then the world will realize that it actually wanted Lisp after all :-)
Re:The Bipolar Lisp Programmer (2007) by Retric on Tuesday January 24, 2017 @10:28AM (#13472059)
Lisps != lisp programs. Lisp lets programmers treat their code as data to be edited at runtime. Which is a different model than say Java.

The advantage is individual programmers can be more productive, but it becomes really hard to share code as every program evolves into it's own language.