Live data from Hacker News

How to write Common Lisp in 2017 – an initiation manual

articulate-lisp.com

131–140 of 271 posts

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

#131

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.

Obviously highly opinionated and personal statement coming, but Common Lisp is to Clojure what Meccano is to LEGO, and I have never been a LEGO person.

If I work on a project where functional programming with emphasis on purity is required I will much rather go to ML family, which I think offers more natural way to express ideas in functional paradigm with beauty and integrity not even Lisp can match.

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

#132

Earlier quoted context omitted.

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!

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.

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

#133
Probably the worst implementation of the 5-puzzle problem you can write.

Artificial Intelligence Assignment 1

Problem 09: Write GET-NEW-STATES to implement all possible movements of the empty tile for a given state.

CG-USER(151): (defun get-new-states (state) (setf new-states '()) (cond ((= 0 (first state)) (setf new-states (list (list (second state) 0 (third state) (fourth state) (fifth state) (sixth state)) (list (fourth state) (second state) (third state) 0 (fifth state) (sixth state))))) ((= 0 (second state)) (setf new-states (list (list (first state) (fifth state) (third state) (fourth state) 0 (sixth state)) (list 0 (first state) (third state) (fourth state) (fifth state) (sixth state)) (list (first state) (third state) 0 (fourth state) (fifth state) (sixth state))))) ((= 0 (third state)) (setf new-states (list (list (first state) 0 (second state) (fourth state) (fifth state) (sixth state)) (list (first state) (second state) (sixth state) (fourth state) (fifth state) 0)))) ((= 0 (fourth state)) (setf new-states (list (list 0 (second state) (third state) (first state) (fifth state) (sixth state)) (list (first state) (second state) (third state) (fifth state) 0 (sixth state))))) ((= 0 (fifth state)) (setf new-states (list (list (first state) 0 (third state) (fourth state) (second state) (sixth state)) (list (first state) (second state) (third state) 0 (fourth state) (sixth state)) (list (first state) (second state) (third state) (fourth state) (sixth state) 0)))) ((= 0 (sixth state)) (setf new-states (list (list (first state) (second state) 0 (fourth state) (fifth state) (third state)) (list (first state) (second state) (third state) (fourth state) 0 (fifth state)))))))

GET-NEW-STATES

CG-USER(152): (get-new-states '(1 2 3 4 5 0))

((1 2 0 4 5 3) (1 2 3 4 0 5))

CG-USER(153): (get-new-states '(1 2 3 4 0 5))

((1 0 3 4 2 5) (1 2 3 0 4 5) (1 2 3 4 5 0))

CG-USER(154): (get-new-states '(1 2 3 0 4 5))

((0 2 3 1 4 5) (1 2 3 4 0 5))

CG-USER(155): (get-new-states '(1 2 0 3 4 5))

((1 0 2 3 4 5) (1 2 5 3 4 0))

CG-USER(156): (get-new-states '(1 0 2 3 4 5))

((1 4 2 3 0 5) (0 1 2 3 4 5) (1 2 0 3 4 5))

CG-USER(157): (get-new-states '(0 1 2 3 4 5))

((1 0 2 3 4 5) (3 1 2 0 4 5))

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

#134
Wondering if anyone has any experience using lisp for machine learning? I'm aware of mgl[0], but it seems to be abandoned. The lack any wrappers for tensor flow or caffe is also a bit surprising to me. The cliki page [1] is also unhelpful and out of date. Is machine learning on lisp dead or are there projects out there that I'm just not aware of?

[0] https://github.com/melisgl/mgl

[1] http://www.cliki.net/machine%20learning

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

#135
post #105
post #51

Earlier quoted context omitted.

It's a seamless dynamic programming language, which can, with care, be given excellent performance and a high level of abstraction. In my opinion, it's miles better than the other dynamic languages out there, by nearly every factor. It rewards investment and development very well; it's a tool for mastery, not for quick and easy starting. If you're looking for statically typed languages, it's not going to win there. B…

Do you prefer it over Clojure? If yes why? I'm a bit versed with Clojure but sometimes I feel that it is not a true lisp.

Yes.

Clojure often feels like a skin over Java; an ergonomic library. Most visibly this is manifested in stack traces.

Clojure also wants to compile files, rather than read them.

There are good ideas in Clojure, but they lie around the parallelism abstractions, not around the implementation.

Socially, of course, the JVM has a huge mindshare.

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

#136
post #81
post #51

Earlier quoted context omitted.

It's a seamless dynamic programming language, which can, with care, be given excellent performance and a high level of abstraction. In my opinion, it's miles better than the other dynamic languages out there, by nearly every factor. It rewards investment and development very well; it's a tool for mastery, not for quick and easy starting. If you're looking for statically typed languages, it's not going to win there. B…

The Common Lisp library ecosystem isn't as polished as it is in Python from what I know. Nor is the documentation for many libraries up to scratch, even the stellar ones. Some libraries merely document the functions provided and don't go into how to use the library. Even stellar libraries such as Hunchentoot do this, which I find rather annoying after using Python libraries which seem to make it an important point to…

The CL community tends to expect you to read the source. You're not just a user, you're a programmer too - and quite possibly of the library you want to use.

It's an interesting dynamic, very alien to modern computing modalities.

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

#137
post #49

Hi, HN! I made this! Ask me any questions you like. I'll try to respond as the workday progresses and I wait for deploys to complete! paul@nathan.house if you want to email me instead. (or @p_nathan on Twitter, if that's your thing).

Also, the ASDF information is somewhat dated. It will work, but the central-registry has been deprecated for years. I'm not even sure how it might work on windows. If you're recommending quicklisp, there's the local-projects approach, otherwise there's $HOME/common-lisp/

Yeah, I need to examine a bit more of the situation with local-projects. I reject ~/common-lisp because I have my own directory structure, thanks. If I can symlink farm under ~/common-lisp, then what's the difference? :)

(and it's not even a hidden directory, so it clutters up ~).

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

#138
post #115
post #98

Earlier quoted context omitted.

which lisp interpreter did you use ?

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.

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

#139

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?

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

#140
post #31

If emacs is an obstacle to Common Lisp in 2017, maybe what's needed is a Lisp-interaction plugin for vi(m) (or whatever it is that vim uses in lieu of emacs modes). I don't get the hype for modal editing but you can't argue with the data clearly showing emacs users are in the minority.

I wrote a new CL plugin for Vim, which only depends on +channel and supports most SLIME features: https://github.com/l04m33/vlime

It's quite new, and I'd be grateful if you could try it out and provide some feedback.

Post reply on HN