Indeed using compile the time reduced to 6s.
So one has to be careful before drawing conclusions.
Indeed using compile the time reduced to 6s.
So one has to be careful before drawing conclusions.
For me the availability of libraries is more important.
Even the size of the executable is not important.
Thanks for answering/solving this problem. It was not obvious for me.
Now i have another question would it be possible to do something similar using sbcl or ccl. I.e. creating a compiled library and calling it from a main.lisp file.
No it works with kawa scheme like i specified.
Program below does not work with ccl.
load "~/quicklisp/setup.lisp")
(ql:quickload "ltk")
(in-package :ltk-user)
(declaim (optimize (speed 3) (safety 3)))
(defun main()
(with-ltk ()
(let ((b (make-instance 'button
:master nil
:text "Press Me"
:command (lambda ()
(format t "Hello World!~&")))))
(pack b))))
(main)
I use also kawa (a scheme). It has better documentation. https://www.gnu.org/software/kawa/pt01.html
Program below works fine with sbcl & ccl.
For abcl i get alot of warnings, not errors,
(load "~/quicklisp/setup.lisp")
(declaim (optimize (speed 3) (safety 3)))
(ql:quickload "serapeum")
(defpackage alain
(:use :cl :serapeum)
(:export main));defpackage
(in-package :alain)
(declaim (type (integer) *anint*))
(defparameter *anint* 2)
(-> addtwo ( integer ) integer )
(defun addtwo (x)
( + *anint* x ))
(defun main ()
(print (addtwo 3)));main
(in-package :cl)
(defun main ()
(alain::main))
(main)
; Compilation unit finished ; Caught 22 WARNING conditions ; Caught 10 STYLE-WARNING conditions
I just tried ccl on freebsd. I had only to download two files an executable fx86cl64 and an fx86cl64.image. It works nice.
I tried hy-lisp. The idea is good but it lacks features.
The first library i tried was serapeum.
https://github.com/ruricolist/serapeum
But abcl was spitting out alot of errors.
Aah , i see to the right. But aren’t the books “OLD ?”
After analyzing i will focus on racket & sbcl & haskell.
Why ? Many libraries & descend books.
My favorite scheme/lisp implementations are sbcl/racket/chicken.
Not because of speed or portability but mainly because of available libraries.
Stating the obvious.
Program :
(module-name MyTest) (module-compile-options main: #t) (define (main) (define ar ::java.util.ArrayList[symbol] (java.util.ArrayList)) (ar:add 'a) (ar:size) (ar:add 1)) (main)
Error:
(compiling ./MyTest.scm to MyTest) ./MyTest.scm:9:13: warning - type integer is incompatible with required type symbol ./MyTest.scm:9:5: warning - cannot convert literal (of type gnu.math.IntNum) to ClassType gnu.mapping.Symbol 0,32 real 0,53 user 0,07 sys java.lang.ClassCastException: class gnu.math.IntNum cannot be cast to class gnu.mapping.Symbol (gnu.math.IntNum and gnu.mapping.Symbol are in unnamed module of loader 'app') at MyTest.main(MyTest.scm:9) at MyTest.run(MyTest.scm:5)
µ