News for hackers. Stuff that matters.
Re:Common Lisp as a Scripting Language, 2015 Edition by mark_l_watson on Wednesday April 15, 2015 @04:51PM (#9384016)
I used Common Lisp from the mid 1980s until about 5 years ago when my customers wanted Clojure, if they wanted Lisp development done. I have never seriously used CL as a scripting language but for a while I was using Gambit-C Scheme for small compiled apps and command line tools. Gambit-C is very good for this purpose.

BTW, Clojure is "out" for command line tools because of the JVM startup time but I have thought about Clojurescript + node.

Re:Common Lisp as a Scripting Language, 2015 Edition by sputnikus on Wednesday April 15, 2015 @05:13PM (#9384182)
Pixie[1] is also worth a look. It's Clojure-like scripting language written in RPython.

[1] https://github.com/pixie-lang/pixie

Re:Common Lisp as a Scripting Language, 2015 Edition by dorfsmay on Wednesday April 15, 2015 @06:11PM (#9384554)
Indeed pretty cool, clojure implemented in rpython!
Re:Common Lisp as a Scripting Language, 2015 Edition by rakoo on Wednesday April 15, 2015 @07:56PM (#9385048)
For even more fun, checkout hy (https://github.com/hylang/hy). It's completely compatible with standard python both ways (ie you can import python from hy and import hy from python), so you can import python-sh and do awesome stuff like:

  (import [sh [cat grep wc]])
  (->
   (cat "/usr/share/dict/words")
   (grep "-E" "^hy")
   (wc "-l"))
Re:Common Lisp as a Scripting Language, 2015 Edition by andrewchambers on Wednesday April 15, 2015 @09:49PM (#9385459)
It isn't clojure compatible, it is like clojure.
Re:Common Lisp as a Scripting Language, 2015 Edition by whateveracct on Wednesday April 15, 2015 @07:56PM (#9385049)
Nitpick, but Clojure's startup time isn't JVM startup time it's clojure.core startup time
Re:Common Lisp as a Scripting Language, 2015 Edition by e12e on Wednesday April 15, 2015 @10:20PM (#9385549)
This appears to be true, eg:

  cat <<eof > Hello.java
  public class Hello {
    public static void main(String[] args) {
      System.out.println("Hello, world!"); }}
  eof

  javac Hello.java
  echo "Main-Class: Hello" > manifest.mf
  jar cvfm hello.jar manifest.mf Hello.class
  time java -jar hello.jar 
  Hello, world!

  real    0m0.153s
  user    0m0.132s
  sys     0m0.020s
vs:

  lein new hello
  cd hello
  # Pesty s-expressions, so hard to work with... ;-)
  cat <<eof|patch -p0
  --- project.clj 2015-04-16 04:13:09.734160136 +0200
  +++ project.clj.patch   2015-04-16 04:09:33.809504079 +0200
  @@ -3,4 +3,5 @@
     :url "http://example.com/FIXME"
     :license {:name "Eclipse Public License"
               :url "http://www.eclipse.org/legal/epl-v10.html"}
  +  :main hello.core
     :dependencies [[org.clojure/clojure "1.6.0"]])
  eof

  cat<<eof > src/hello/core.clj
  (ns hello.core
    (:gen-class))
  (defn -main 
    "I don't do a whole lot."
    []
    (println "Hello, World!"))
  eof

  lein uberjar
  
  time java -jar target/hello-0.1.0-SNAPSHOT-standalone.jar 
Hello, World!

  real    0m1.060s
  user    0m1.400s
  sys     0m0.040s
(Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz, SSD drive)
Re:Common Lisp as a Scripting Language, 2015 Edition by e12e on Wednesday April 15, 2015 @10:55PM (#9385663)
Kawa:

  wget ftp://ftp.gnu.org/pub/gnu/kawa/kawa-2.0.jar
  wget ftp://ftp.gnu.org/pub/gnu/kawa/kawa-2.0.jar.sig
  gpg --recv-key D269E756
  gpg --verify kawa-2.0.jar.sig

  echo '(format #t "Hello, world!\n")' > hello.scm
  # Not sure how to bundle up a scheme script with kawa
  # to a stand-alone jar...
  java -jar kawa-2.0.jar --main -C hello.scm 
  time java -cp kawa-2.0.jar:. hello
  Hello, world!

  real    0m0.284s
  user    0m0.296s
  sys     0m0.020s
Re:Common Lisp as a Scripting Language, 2015 Edition by lispm on Thursday April 16, 2015 @04:59AM (#9386693)
Lisp on my Raspberry Pi is faster:

    pi@raspberrypi ~/lisp/ccl $ time ./armcl -n -Q -e '(progn (princ "hello") (quit))'
    hello

    real	0m0.112s
    user	0m0.020s
    sys	        0m0.080s
And the expression is first compiled to native code...
Re:Common Lisp as a Scripting Language, 2015 Edition by e12e on Thursday April 16, 2015 @05:48AM (#9386813)
How does guile 2.0 do on that hardware?
Re:Common Lisp as a Scripting Language, 2015 Edition by lispm on Thursday April 16, 2015 @06:51AM (#9387015)
Don't know. I don't use it.
Re:Common Lisp as a Scripting Language, 2015 Edition by e12e on Wednesday April 15, 2015 @11:02PM (#9385678)
And, for the record, with the same hello.scm, and guile (2.0.5 as found in Debian stable):

  # First run:
  time guile hello.scm 
  ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
  (...)
  Hello, world!

  real    0m0.066s
  user    0m0.044s
  sys     0m0.020s

  #Ed: with precompiled code under $HOME/.cache/guile (?)
  time guile hello.scm 
  Hello, world!

  real    0m0.040s
  user    0m0.036s
  sys     0m0.004s
Re:Common Lisp as a Scripting Language, 2015 Edition by i_am_so_tired on Wednesday April 15, 2015 @08:43PM (#9385235)
Ah, that is why Kawa Scheme starts up faster then.
Re:Common Lisp as a Scripting Language, 2015 Edition by father_of_two on Wednesday April 15, 2015 @05:28PM (#9384294)
There is also scsh (scheme shell - http://scsh.net/) although not being maintained anymore.
Re:Common Lisp as a Scripting Language, 2015 Edition by kd0amg on Wednesday April 15, 2015 @05:51PM (#9384435)
There's a plan to do some work on it (including trying to port it to 64 bit) this summer.
Re:Common Lisp as a Scripting Language, 2015 Edition by rml on Wednesday April 15, 2015 @10:46PM (#9385633)
An updated version by Roderic Morris can be installed as a library atop the latest version of Scheme 48. It's on github: https://github.com/scheme/scsh

I think it's 64-bit (?). Most of the time it hasn't mattered for me, at least when writing scripts.

You can also just build the "old" version (0.6.7) with the `-m32` GCC flag, and it works fine on 64-bit Linux and OS X. It's very stable in my experience, and works fine.

Re:Common Lisp as a Scripting Language, 2015 Edition by wglb on Wednesday April 15, 2015 @05:25PM (#9384273)
And there is http://scsh.net/
Re:Common Lisp as a Scripting Language, 2015 Edition by i_am_so_tired on Wednesday April 15, 2015 @07:40PM (#9384993)
I use Kawa Scheme on the JVM for scripting on Windows. Powershell is forbidden where I work. For some reason, it seems to start up faster than Clojure.
Re:Common Lisp as a Scripting Language, 2015 Edition by jonnybgood on Wednesday April 15, 2015 @06:10PM (#9384550)
Considered Racket?
Re:Common Lisp as a Scripting Language, 2015 Edition by enupten on Wednesday April 15, 2015 @09:49PM (#9385455)
Is clojure any "better" in real-world use ?