Live data from Hacker News

How to write Common Lisp in 2017 – an initiation manual

articulate-lisp.com

141–150 of 271 posts

Re: How to write Common Lisp in 2017 – an initiation manual

#141
post #138
post #115

Earlier quoted context omitted.

It baffles me that this notion of Lisp as an interpreted language still persists. Common Lisp is a compiled language for all non toy implementations, and in general Lisps have had compilers for decades.

Having a good REPL is important, though.

Having a REPL does not necessitate interpreting http://www.sbcl.org/manual/#Compiler_002donly-Implementation

Re: How to write Common Lisp in 2017 – an initiation manual

#142
post #138
post #115

Earlier quoted context omitted.

It baffles me that this notion of Lisp as an interpreted language still persists. Common Lisp is a compiled language for all non toy implementations, and in general Lisps have had compilers for decades.

Having a good REPL is important, though.

REPL and interpretation are orthogonal concepts.

SBCL (most common CL implementation) don't have interpreter at all. It complies into machine code before execution even in REPL.

Re: How to write Common Lisp in 2017 – an initiation manual

#143

Earlier quoted context omitted.

I mentioned elsewhere I'm learning Common Lisp. I'm also learning Python by translating some Common Lisp code into Python and part of that is to make sure I understand what the Common Lisp is doing. As an understatement, that's meant building some very unPythonic abstractions (yay, me). Anyway, I think there is a fundamental design difference between Common Lisp and other 'first class' programming languages: Common L…

I have a couple REPLs for specific projects that I routinely keep running for months at a time. The idea that user = programmer was part of the MIT AI Lab culture before there were Lisp Machines. For example, the top level of ITS, the PDP-10 OS they used, was the debugger. Imagine if the default Linux shell was GDB!

The idea that it is an artifact of Media Lab culture makes sense. One of the analogies I saw is to Emacs Lisp as a language for editing text (and Stallman is listed in the acknowledgements of Steele's book).

Re: How to write Common Lisp in 2017 – an initiation manual

#144

Earlier quoted context omitted.

I mentioned elsewhere I'm learning Common Lisp. I'm also learning Python by translating some Common Lisp code into Python and part of that is to make sure I understand what the Common Lisp is doing. As an understatement, that's meant building some very unPythonic abstractions (yay, me). Anyway, I think there is a fundamental design difference between Common Lisp and other 'first class' programming languages: Common L…

I have a couple REPLs for specific projects that I routinely keep running for months at a time. The idea that user = programmer was part of the MIT AI Lab culture before there were Lisp Machines. For example, the top level of ITS, the PDP-10 OS they used, was the debugger. Imagine if the default Linux shell was GDB!

The idea that it is an artifact of Media Lab culture makes sense. One of the analogies I saw is to Emacs Lisp as a language for editing text (and Stallman is listed in the acknowledgements of Steele's book).

Re: How to write Common Lisp in 2017 – an initiation manual

#145

I started a big project at work using Common Lisp in 2017 and could not be happier. Sure, most nice features have trickled down to other languages, but they are rarely as nicely integrated. And Lisp still has many advantages that are not found elsewhere: Unmatched stability, on-demand performance, tunable compiler, CLOS, condition system, and Macros to name a few. It has its warts too but which language does not? I f…

Curious over why CL vs Clojure? Any comments.

Not speaking for hydandata, a few key points of CL as opposed to Clojure (which might be advantages or disadvantages depending on context and preference) include:

- Defined by a standard (the text of the standard is available for free online as the Common Lisp HyperSpec [1]), not by a reference implementation led by a BDFL

- Multiple mature implementations, both free and proprietary

- Wholeheartedly multi-paradigm; has FP features, but also provides plenty of tools for imperative (notably including a powerful macro for loops) and (meta)object-oriented approaches

- "Lisp-2" rather than "Lisp-1"; functions and variables are in different namespaces, which reduces name clashes but requires disambiguation in some places

- Designed for implementation in a wide variety of environments, including being embedded as an extension/scripting language in C or C++ applications (see ECL [2])

[1] http://www.lispworks.com/documentation/HyperSpec/Front/index...

[2] https://common-lisp.net/project/ecl/

Re: How to write Common Lisp in 2017 – an initiation manual

#146

Earlier quoted context omitted.

That's kind of how my old MSX was, essentially a MS Basic shell that you could program on. If you wanted to run a compiled program (a game, who are we kidding?), you used Basic to bootstrap the load and replace itself with whatever the tape had. Good times.

That was pretty much how most 8-bit computers worked -- the user interface upon bootup was the Basic interpreter.

Some vestiges of that persisted for much longer. For example, QBasic, and even VB for DOS, still had the FILES command. Which, as you'd expect, produced the list of files in the current directory - except it didn't return it, but simply printed it out to the console. So it was something rather useless in an application, but handy in a shell.

Less obvious things were having a variety of filesystem-related functionality as built-in statements with special syntax, rather than functions. For example, renaming a file: NAME "foo" AS "bar".

Re: How to write Common Lisp in 2017 – an initiation manual

#147
post #36

If somebody is not comfortable to use emacs (I am), there is a atom plugin for use with CL: https://atom.io/packages/atom-slime It doesn't replace emacs, but it works as a first Lisp ide.

Hmm, this just gave me an idea: Visual Studio Code Common Lisp plugin might also be a good way to expose the language to people unfamiliar to the language.

Every time I tried to get into CL, having to use Emacs/SLIME (which, let's face it, is the development environment for it for all practical purposes) has been a huge turn-off.

So, yes. Please?

Re: How to write Common Lisp in 2017 – an initiation manual

#148

I started a big project at work using Common Lisp in 2017 and could not be happier. Sure, most nice features have trickled down to other languages, but they are rarely as nicely integrated. And Lisp still has many advantages that are not found elsewhere: Unmatched stability, on-demand performance, tunable compiler, CLOS, condition system, and Macros to name a few. It has its warts too but which language does not? I f…

How do you sneak something like lisp in to work?

You build trust with stakeholders, usually by solving important problems until you reach a point at which having you solve a new problem is more important to them than what you solve it with. It helps if whatever tech you are introducing actually helps you in the task of solving more problems, increasing quality of solutions or reducing cost, in that particular order.

Re: How to write Common Lisp in 2017 – an initiation manual

#149
post #32
post #8

Earlier quoted context omitted.

I have dabbled in Common Lisp over the years and am quite comfortable with it. I know nothing about Clojure. What are the problems with Clojure? I am just curious. Thanks!

In addition to the other problems described, Clojure just breaks the value of Lisp's syntax. Common Lisp does have its irregularities but code littered with Java imports and square brackets might as well just use C formatting and be done with it.

How do square brackets break the syntax? Aren't they just syntactic sugar for (vector ...), exactly the same as ' is syntactic sugar for (quote ...)?

And imports, obviously, are just special forms. It's not like Lisp doesn't have others. It's still an S-expression, so why is it problematic?

Re: How to write Common Lisp in 2017 – an initiation manual

#150
post #54

Earlier quoted context omitted.

If you know Common Lisp reasonably, you'll probably have some insight into Clojure, e.g. Leiningen is a system definition facility; seq is an extension of sequences; and multimethods are generics much like methods. I'd say Clojure stands on the shoulders of giants. There are some Lispy things that Clojure does out of the box that are more Lispy than than Common Lisp does out of the box, e.g. lists and other seq's as…

> lists and other seq's as functions in the function position of an x-expression. Makes code more difficult to read. I consider this a language design error. I had that on the Lisp Machine 30 years ago (example callable arrays, ... - maybe even Maclisp in the 70s had it), few people used it and it did not make it into Common Lisp. Common Lisp was designed such that for the programmer and for the compiler the first el…

Arrays are functions, by definition. They relate inputs to outputs.
Post reply on HN