Live data from Hacker News

Why I haven't jumped ship from Common Lisp to Racket just yet

fare.livejournal.com

31–40 of 101 posts

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#31
post #30

> trivial utilities for interactive use from the shell command-line with an "instantaneous" feel Last time I checked CL images were huge though. Something like 24MB for a "hello world" executable, even bigger with some compilers.

You are correct, but why is this a problem in the case mentioned by the author?

    $ cat > hello-world.lisp
    (defun main () (format t "Hello, World!~%"))
    $ sbcl 
    * (load "hello-world.lisp")
    T
    * (save-lisp-and-die "hello-world" :toplevel #'main :executable t)
    [undoing binding stack and other enclosing state... done]
    [defragmenting immobile space... 1110+19908+28500+22601 objects... done]
    [saving current Lisp image into hello-world:
    writing 4816 bytes from the read-only space at 0x20000000
    writing 2320 bytes from the static space at 0x20100000
    writing 2383872 bytes from the immobile space at 0x20300000
    writing 15190112 bytes from the immobile space at 0x21b00000
    writing 39911424 bytes from the dynamic space at 0x1000000000
    done]
    $ ./hello-world 
    Hello, World!
    $ ls -lh hello-world
    -rwxr-xr-x 1 user user 56M Aug 23 10:23 hello-world

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#32
post #31
post #30

> trivial utilities for interactive use from the shell command-line with an "instantaneous" feel Last time I checked CL images were huge though. Something like 24MB for a "hello world" executable, even bigger with some compilers.

You are correct, but why is this a problem in the case mentioned by the author? $ cat > hello-world.lisp (defun main () (format t "Hello, World!~%")) $ sbcl * (load "hello-world.lisp") T * (save-lisp-and-die "hello-world" :toplevel #'main :executable t) [undoing binding stack and other enclosing state... done] [defragmenting immobile space... 1110+19908+28500+22601 objects... done] [saving current Lisp image into hel…

It's not necessarily a problem, but personally for small utilities I much prefer something that supports #!-style scripts, like Guile or Racket, or that can be compiled into small, efficient executables. Let's say it's a matter of personal preference.

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#33
post #32
post #31

Earlier quoted context omitted.

You are correct, but why is this a problem in the case mentioned by the author? $ cat > hello-world.lisp (defun main () (format t "Hello, World!~%")) $ sbcl * (load "hello-world.lisp") T * (save-lisp-and-die "hello-world" :toplevel #'main :executable t) [undoing binding stack and other enclosing state... done] [defragmenting immobile space... 1110+19908+28500+22601 objects... done] [saving current Lisp image into hel…

It's not necessarily a problem, but personally for small utilities I much prefer something that supports #!-style scripts, like Guile or Racket, or that can be compiled into small, efficient executables. Let's say it's a matter of personal preference.

You can use CL for #!-scripts too. SBCL has a `--script` option for running scripts. You'll probably want to create a core with whatever libraries you need for scrips, so that the start-up time will be fast. The core will be big, but it can be shared for all scripts, so that's not much of a problem.

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#34
post #30

> trivial utilities for interactive use from the shell command-line with an "instantaneous" feel Last time I checked CL images were huge though. Something like 24MB for a "hello world" executable, even bigger with some compilers.

With SBCL and Linux kernels with binfmt_misc support enabled (module or compiled) you can execute FASL file from command line, using the same SBCL core for all the executables and, I would add, with an "instantaneous" feel. ^__^

With Debian it should work out of the box, on other distributions it probably needs to register a wrapper/trampoline with the binfmt_misc infrastructure.

FWIK running instances don't share the same core in RAM though.

  $ cat hello-world.lisp                                                     /tmp
  (print "Hello. World!")
  $ sbcl --noinform                                                          /tmp
  * (compile-file "hello-world.lisp" :output-file "hello-world")
  ; compiling file "/tmp/hello-world.lisp" (written 23 AUG 2017 11:09:24 AM):
  ; compiling (PRINT "Hello. World!")
  ; /tmp/hello-world.fasl written
  ; compilation finished in 0:00:00.001
  #P"/tmp/hello-world.fasl"
  NIL
  NIL
  * %                                                         
  $ chmod +x ./hello-world.fasl                                              /tmp
  $ ls -lh hello-world.fasl                                                  /tmp
  -rwxr-xr-x 1 user user 330 Aug 23 11:17 hello-world.fasl*
  $ time ./hello-world.fasl                                                  /tmp

  "Hello. World!" ./hello-world.fasl  0.00s user 0.00s system 44% cpu 0.009 total
  $                                                                          /tmp
Edit for clarifications and fixing formatting

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#35

The author, a famous and well-liked lisper, is not consider ing portability features. CL is an ANSI standard and code often runs with no changes in many distinct CL implementations/compilers/interpreters. Also, related to that point: There are many different CL implementations out there that satisfy different use cases, like for example JVM deployment (ABCL), embedded systems (ECL), speed(SBCL), fast compile times (C…

The biggest issue I see with Common Lisp is that the standard is stuck in time, lacking stuff like database providers, a common FFI or threading.

It needs a review of the CL environments that survived to modern days and adopt the common extensions.

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#36
post #35

The author, a famous and well-liked lisper, is not consider ing portability features. CL is an ANSI standard and code often runs with no changes in many distinct CL implementations/compilers/interpreters. Also, related to that point: There are many different CL implementations out there that satisfy different use cases, like for example JVM deployment (ABCL), embedded systems (ECL), speed(SBCL), fast compile times (C…

The biggest issue I see with Common Lisp is that the standard is stuck in time, lacking stuff like database providers, a common FFI or threading. It needs a review of the CL environments that survived to modern days and adopt the common extensions.

I think it is a pretty shallow view at standard. CL implementations grow and have agreed interfaces (or portability layers). A few examples:

- sockets via usocket

- threading via bordeaux-threads

- metaobject protocol via closer-mop

- foreign function interface via cffi

all these are not mentioned in the standard at all, but are implemented and used in production environment.

Having base standard and extensions which may be used portably (via portability layers) is better situation than having no standard (for instance python or ruby) and a reference implementation.

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#37
post #30

> trivial utilities for interactive use from the shell command-line with an "instantaneous" feel Last time I checked CL images were huge though. Something like 24MB for a "hello world" executable, even bigger with some compilers.

With SBCL and Linux kernels with binfmt_misc support enabled (module or compiled) you can execute FASL file from command line, using the same SBCL core for all the executables and, I would add, with an "instantaneous" feel. ^__^ With Debian it should work out of the box, on other distributions it probably needs to register a wrapper/trampoline with the binfmt_misc infrastructure. FWIK running instances don't share th…

Didn't know that.

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#38
post #22

Anyone using Racket in the wild? (Besides the Racket team)

I believe some games companys use it. Naughty Dog of Uncharted and The Last of Us fame, being the most famous. I think they used it to create some game logic DSL or something of that sort.

More info here - https://www.reddit.com/r/Racket/comments/5g8xse/are_there_an...

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#39
post #35

Earlier quoted context omitted.

The biggest issue I see with Common Lisp is that the standard is stuck in time, lacking stuff like database providers, a common FFI or threading. It needs a review of the CL environments that survived to modern days and adopt the common extensions.

I think it is a pretty shallow view at standard. CL implementations grow and have agreed interfaces (or portability layers). A few examples: - sockets via usocket - threading via bordeaux-threads - metaobject protocol via closer-mop - foreign function interface via cffi all these are not mentioned in the standard at all, but are implemented and used in production environment. Having base standard and extensions which…

Which usually is what leads to feature expressions spaghetti.

Also, it means that a Lisp newbie won't be aware of what are the best libraries that are portable across Lisps for such features.

EDIT: typo correction (missing are)

Re: Why I haven't jumped ship from Common Lisp to Racket just yet

#40
post #32
post #31

Earlier quoted context omitted.

You are correct, but why is this a problem in the case mentioned by the author? $ cat > hello-world.lisp (defun main () (format t "Hello, World!~%")) $ sbcl * (load "hello-world.lisp") T * (save-lisp-and-die "hello-world" :toplevel #'main :executable t) [undoing binding stack and other enclosing state... done] [defragmenting immobile space... 1110+19908+28500+22601 objects... done] [saving current Lisp image into hel…

It's not necessarily a problem, but personally for small utilities I much prefer something that supports #!-style scripts, like Guile or Racket, or that can be compiled into small, efficient executables. Let's say it's a matter of personal preference.

I wrote cl-launch so you can use #!/usr/bin/cl with lots of options and write scripts that are either portable or implementation-specific (and trivially switch from one implementation to the other).
Post reply on HN