Live data from Hacker News

Why Lisp is now an acceptable scripting language

fare.tunes.org

91–100 of 138 posts

Re: Why Lisp is now an acceptable scripting language

#91
post #59

Well, you can use LISP/Scheme as a procedural language with a little "code obfuscation" ... (define (return x) x) (define (! a b c) (not (b a c))) (define (-- a) (- a 1)) (define (cout junk thing) (display thing)) (define

Wait, so now what determines whether a language is “procedural” is its surface syntax rather than its semantics?

What other kind of syntax is there? But yes, I've seen a lot of procedural code in every paradigm I can think of. Lots of cargo-cult programming results in it.

Re: Why Lisp is now an acceptable scripting language

#92

Lisp is an acceptable language for a variety of things, not just "scripting". I work on many projects written in Guile Scheme that range from game engines to static site generators to dynamic web applications to package managers, and I write one-off scripting tasks with it, too. There's a lot of mystique around Lisp and Scheme, and people tend to write it off as a relic of academia, but I use it for practical needs e…

Well, if it was just the REPL then perl, python, ruby etc could be pointed to. It is more than that. Although I do have a deep love for python via ipython and ipython notebooks.

Re: Why Lisp is now an acceptable scripting language

#94
If someone wanted to get started into Lisp programming, what REPL and resources would you recommend? I began working through SICP a while back, but found it difficult to know what dialect of Lisp to use. As a complete newbie to Lisp, it was near impossible to debug why the code I wrote from SICP didn't work at all.

Re: Why Lisp is now an acceptable scripting language

#96

If someone wanted to get started into Lisp programming, what REPL and resources would you recommend? I began working through SICP a while back, but found it difficult to know what dialect of Lisp to use. As a complete newbie to Lisp, it was near impossible to debug why the code I wrote from SICP didn't work at all.

SICP is written for Scheme, not Common Lisp, so that might've been your issue. They're not at all the same, despite both being Lisps.

Just use Common Lisp. I use SBCL. Read Practical Common Lisp [1] &/ ANSI Common Lisp [2]. Skim the CLQR [3].

If you're just starting out, you can get away with just using the REPL. You might get that ^]]A crap when you up-arrow to previous expressions, so install rlwrap and run 'rlwrap sbcl' instead of just 'sbcl'.

Once you get tired of that and want to use an editor, get Emacs (on OS X: see [4], on Ubuntu: apt-get install emacs24). Install SLIME [5] through package-install to send expressions down from a .lisp file to the REPL (with C-x C-e).

If you get stuck, try looking for youtube videos (or add an email to your HN about).

[1] http://www.gigamonkeys.com/book/

[2] http://www.paulgraham.com/acl.html

[3] http://clqr.boundp.org/download.html

[4] https://emacsformacosx.com/

[5] https://github.com/slime/slime

Re: Why Lisp is now an acceptable scripting language

#98
post #78
post #75

Earlier quoted context omitted.

>> Lisps enable a type of development via live coding that I have yet to see a non-Lisp match. How does it compare to using python for live coding?

If you want to compare Lisp Live Coding and you know Python, then let me compare it like this: How much faster can you get things done using something like ipython vs. a compiled static language like C(++/#) or Java? I don't want to go into a flamewar against the other languages, of course. Yet, if you favor an ipython repl against the compile/build/test cycle, then Lisp gives you just about the same order of magnitu…

To me, the live loading of code and repl is a two edged sword, and I'm not sure which side is sharper.

It sounds great to say "live coding" and whatnot, but it turns out that you very quickly get the repl into an unknown state where you aren't sure what version of what has been eval'd, and what temporary cruft is lying around changing how your program behaves.

A number of times I would find out that a bug I thought I squashed was actually still there, just hidden by some temporary "what-if" I had eval'd. The only way to know is to clean the workspace and reload everything.

This was recognized as problematic by the clojure community and "Component" methodologies were developed, along with namespace refreshing. It would be far less useable if not for this.

However, in a live production system, a blanket reload of anything kind of defeats the purpose of keeping it running. I don't think I'd ever try loading code on a live production system unless all the alternatives were worse than possibly messing up the state of the system.

It's nice to have the repl for investigating what's going on in production, for inspection. But I avoid any code reloading in a live system.

Re: Why Lisp is now an acceptable scripting language

#99

Earlier quoted context omitted.

Wait, so now what determines whether a language is “procedural” is its surface syntax rather than its semantics?

What other kind of syntax is there? But yes, I've seen a lot of procedural code in every paradigm I can think of. Lots of cargo-cult programming results in it.

Sit down dear child and hear of languages long ago...

Back I. The days of vacuum tube and electromechanical switches, when punch tape rules the world p, there were two languages: The Algorithmic Language, and the List Processor. The List Process, or LISP, to its friends was built around s-expressions. The other, also known as ALGOL, was built around a strange and unholy hybrid of text and formulae that only an insane mathematician would love, for almost every statement was a special case.

ALGOL syntax went on to rule the world.

Seriously kid. There are only two syntaxes, and procedural, structural, object oriented, aspect, imperative, and all the rest are immaterial to the syntax, for they refer to how programs are organized, not what keys you press on the keyboard. Don't they teach programming languages anymore?

Re: Why Lisp is now an acceptable scripting language

#100

Lisp is an acceptable language for a variety of things, not just "scripting". I work on many projects written in Guile Scheme that range from game engines to static site generators to dynamic web applications to package managers, and I write one-off scripting tasks with it, too. There's a lot of mystique around Lisp and Scheme, and people tend to write it off as a relic of academia, but I use it for practical needs e…

> I've used it for customizing an X11 window manager in the past, too.

always glad to find another old Sawfish user. :)

Post reply on HN