News for hackers. Stuff that matters.
Re:PicoLisp by crasch4 on Wednesday May 02, 2018 @04:32PM (#16980889)
Neat! How would you differentiate picolisp from say, Clojure (which also interoperates well with Java libraries). When would you use picolisp vs Clojure?
Re:PicoLisp by kbp on Wednesday May 02, 2018 @05:07PM (#16981170)
One thing about PicoLisp that might stick out for people coming from CL, Scheme, or Clojure is that it's dynamically scoped (like most Lisps, historically), so you can't make closures. Compare this Scheme session:

    #;1> (define (make-counter)
           (let ((i 0))
             (lambda () (set! i (+ i 1)) i))))
    #;2> (define counter (make-counter))
    #;3> (counter)
    1
    #;4> (counter)
    2
    #;5> (counter)
    3
To this PicoLisp one:

    ? (de make-counter ()
        (let (i 0)
          '(() (setq i (+ i 1)) i)))
    -> make-counter
    ? (setq counter (make-counter))
    -> (NIL (setq i (+ i 1)) i)
    ? (counter)
    -> NIL
    ? (setq i 10)
    -> 10
    ? (counter)
    -> 11
Using `curry` and patterns, you can do substitutions into a "lambda", which can look like a closure, or not:

    ? (de make-adder (@base)
        (curry (@base) (n) (+ @base n)))
    -> make-adder
    ? (setq add-three (make-adder 3))
    -> ((n) (+ 3 n))
    ? (add-three 5)
    -> 8
    ? (de make-counter ()
        (let (@i 0)
          (curry (@i) () (setq @i (+ @i 1)) @i)))
    -> make-counter
    ? (setq counter (make-counter))
    -> (NIL (setq 0 (+ 0 1)) 0)
    ? (counter)
    !? (setq 0 (+ 0 1))
    0 -- Variable expected ; oops, we're trying to redefine 0
Re:PicoLisp by politips on Wednesday May 02, 2018 @05:42PM (#16981403)
There are 3 flavors of picolisp: the 32-bit version written in gcc-specific C, the "Ersatz" version written in Java, and the 64-bit version written in its own high-level assembly-language that can target x86-64, PPC, ARM64 and "emulation" in C.

The Ersatz version has good Java integration. The 64-bit version has some more recent Java integration:

https://picolisp.com/wiki/?javacode

Re:PicoLisp by gowld on Wednesday May 02, 2018 @04:37PM (#16980931)
Lots of discussion last time:

https://news.ycombinator.com/item?id=12363608

I think Clojure has much tighter Java interop, which you might like or loathe.

Re:PicoLisp by FractalLP on Wednesday May 02, 2018 @07:51PM (#16982166)
Clojure compiles to JVM bytecode, so it should run much much faster than an interpreted picolisp. Clojure works on Windows too, while Picolisp needs Cygwin I think. Picolisp is really simple from a language point of view. It has a small group of core users who think very differently about software. There aren't many picolisp libraries, but you can hook into C & Java libraries when needed. It has an integrated prolog like DB. Clojure runs Walmart during black Friday online sales...I would not recommend that with picolisp.
Re:PicoLisp by jacobush on Thursday May 03, 2018 @03:32AM (#16984038)
"Erzats" PicoLisp runs anywhere Java runs, that was it's original reason for existance - to be used in bootstrapping the compilation of PicoLisp, IIRC.

However, nowadays, I think Erzats PicoLisp, AKA the Java version of PicoLisp, gots too little love. It's an interesting way of accessing the JVM, just like Groovy or Clojure. Also, I don't have benchmarks, but PicoLisp is pretty damn fast owing to minimal datastructures and I would expect that to spill over into the Java implementation.

http://picolisp.com/wiki/?NeedForSpeed

http://picolisp.com/wiki/?ErsatzReflection

Re:PicoLisp by FractalLP on Thursday May 03, 2018 @08:14AM (#16985231)
Alexander has a "Need for Speed" article where he shows it's in the neighborhood of Clisp, but Clisp isn't really all that fast. Comparing to SBCL would be more useful as it is very fast.
Re:PicoLisp by flavio81 on Thursday May 03, 2018 @11:49AM (#16987039)
They are entirely different languages altogether, the only thing in common is the use of s-expressions and the homoiconoicity.