Author Topic: Rob's Lisp Adventures  (Read 15131 times)

0 Members and 3 Guests are viewing this topic.

RobbeK

  • Guest
Rob's Lisp Adventures
« on: January 25, 2015, 07:46:41 AM »
having so much fun.  :)

yes certainly , thanks John ...

While tk/tcl may (at this moment) have a kind of aura of obsoleteness (because - i read - very popular in the '90s on UNIX systems) - i find it very usable.  On top you get another scripting language that completely can be mixed with other scripts.  I did try it together with the gigantesque Common Lisp compilers -- but I do not like it this way .  As you mentioned the speed difference between compiled and interpreted lisp is not that huge IMHO , a script with JIT compiling and/or DLL/so 's combined with OpenGL scripts is the optimum ...
As I found the tk canvas related functions are rather slow , i wrote some functions myself  for pixel graphics , based (if wished) on buffered graphics (both choices are possible - buffered and unbuffered ).  these are about 10x faster than tk/tcl (system memory is used , no hardware)

the newLISP code itself runs on Win / Linux / Wine without any change  -- the code detects the OStype..  (only under Linux the *.so file has to be copied -- but probably it must be possible with a script to use it from the location of the executable ?)

All calculations are done in the script -- given the fact that this is about 21.000 complex prime numbers, i don't think it is slow..

;-------------------------------code

(silent

(if (= ostype "Linux") (setq DLL "libscreen.so") (setq DLL "libscreen.dll"))
(if (= ostype "Linux") (setq PATH "/usr/bin/wish") (setq PATH  "c:/Tcl/bin/wish.exe"))

(dolist (i (list  "SETSCREEN" "PIXEL" "ENDSCREEN" "SCRLOCK" "SCRUNLOCK" "SCRCLR"))  (import DLL i))

(define XY (array 400 400 '(0)))

(map set '(myin tcout) (pipe))
(map set '(tcin myout) (pipe))
(process PATH tcin tcout)

(define (tk)
  (write-line myout (append "if { [catch { puts ["
              (apply string (args)) "] }] } { "
              [text] tk_messageBox -message $errorInfo; exit }
    [/text]))

  (let (str "")
    (while (starts-with (setq str (read-line myin)) "newLISP:")
      (eval-string ((length "newLISP: ") -1 str)))
    str))

(global 'tk)

;; this is for compatibility with newlisp-tk
;; for new programs just use 'puts' without the 'Newlisp' wrapper
(tk "proc Newlisp { command } { puts $command }") 

;; exit when main window is closed
(tk "bind . <Destroy> {puts {(exit)}}")


(define (prime? x)
 (= 1 (length (factor x))))

(define (sq x) (* x x))

(define (gaussprime? x y)
    (prime? (+ (sq x) (sq y))))

(define (zeven? x y)
  (even? (+ (sq x) (sq y))))

(define (zodd? x y)
   (not (zeven? x y)))

(define (setup-XY)                                                        ;; preprocessor
 (setq nr 0)
  (dotimes (i 400)
   (dotimes (j 400)
   (let ((p (+ (sq (- i 200)) (sq (- j 200)))))
    (when (prime? p) (setf (XY i j) 1) (++ nr) )))))

(define (zodd-zeven)
  (SCRLOCK)
  (for (i -200 200)
   (for (j -200 200)
     (if (zeven? i j)
       (PIXEL (+ 200 i) (+ 200 j) 0 200 0)
       (PIXEL (+ 200 i) (+ 200 j)  200 0 0) )))
   (SCRUNLOCK))

(define (info s)
  (tk (append ".lb config -text " s )))

(define (main)
 (SCRLOCK)
  (dotimes (i 400)
   (dotimes (j 400)
   (when (> (XY i j) 0) (PIXEL i j 0 222 0))))
(info (append  "#primes=" (string nr)) )
  (SCRUNLOCK) 
  )
 
 (define (stars)
 (let ((pixel (lambda(x y) (PIXEL x y 200 200 0))))
  (for (i 1 398)
   (for (j 1 398)
     (when (zero? (XY i j))
      (when (> (XY (+ i 1) j) 0)
       (when (> (XY (- i 1) j) 0)
        (when (> (XY i (+ j 1)) 0)
         (when (> (XY i (- j 1)) 0)
          (pixel i (+ j 1)) (pixel i (- j 1)) (pixel (+ i 1) j) (pixel (- i 1) j)  )))))))
))

 (define (twins)
 (let ((pixel (lambda(x y) (PIXEL x y 255 0 0))))
 (SCRLOCK)
  (for (i 1 398)
   (for (j 1 398)
     (when (zero? (XY i j))
      (when (> (XY (+ i 1) j) 0)
       (when (> (XY (- i 1) j) 0)
            (pixel (+ i 1) j) (pixel (- i 1) j)) )
        (when (> (XY i (+ j 1)) 0)
         (when (> (XY i (- j 1)) 0)
          (pixel i (+ j 1)) (pixel i (- j 1))))))))
 (SCRUNLOCK) )

(define (dens)
 (SCRLOCK)
 (let ( (acc  (lambda (x y d) (+ (XY (- x d) y) (XY (+ x d) y) (XY x (+ y d)) (XY x (- y d))
                                      (XY (- x d) (+ y d)) (XY (+ x d) (+ y d))
                                      (XY (- x d) (- y d)) (XY (+ x d) (- y d)) ))))
 
    (for (i 2 396)
     (for (j 2 396)
     (PIXEL i j 80 0 (* 120 (acc i j 1)) ))))
(SCRUNLOCK)
  )




(define (run )
 (tk "frame .fr -relief sunken  ")
 (tk "wm title . Gaussprimes")
 (tk "wm geometry . 200x220+30+30")
 (tk "label .lb -text {info} -width 20 -pady 5 -bg {gray80} ")
 (tk "button .b -text {Gaussprimes*} -command {Newlisp {(main)}} -width 15")
 (tk "button .b2 -text {CLR Scr} -command {Newlisp {(SCRCLR)}} -width 15 -bg {gray60} -relief sunken")
 (tk "button .b3 -text {zodd & zeven} -command {Newlisp {(zodd-zeven)}} -width 15")
 (tk "button .b4 -text {StarS} -command {Newlisp {(stars)}} -width 15")
 (tk "button .b5 -text {TwinS} -command {Newlisp {(twins)}} -width 15")
 (tk "button .b6 -text {Density} -command {Newlisp {(dens)}} -width 15")
 (tk "pack .b4 -in .fr -side bottom")
 (tk "pack .b -in .fr -side bottom ")
 (tk "pack .b6 -in .fr -side bottom ")
 (tk "pack .b5 -in .fr -side bottom")
 (tk "pack .b3 -in .fr -side bottom")
 (tk "pack .b2 -in .fr -side bottom")

 (tk "pack .lb -in .fr -side bottom ")
 

 (tk "pack .fr")
  (setup-XY)
  (SETSCREEN 400 400 350 30)
   )

(run)

(while (read-line myin)
    (eval-string (current-line)))


)


 8)   best , Rob    (attached, both the Linux and Win executables)

of course OpenGL , can be used for this .. but for some quick and fast progs this is very easy and usable -- one graphic screen of any size can be set up



.
« Last Edit: January 25, 2015, 08:10:10 AM by RobbeK »

JRS

  • Guest
Re: Rob's Lisp Adventures
« Reply #1 on: January 25, 2015, 12:59:40 PM »
Hi Rob,

I'm having problems running your 32 bit examples on my 64 bit Ubuntu Linux. I have 32 bit support installed but that isn't saying much. It's the old which nut shell is libc hiding/missing under. I'm getting circular dependencies trying make it work. Can you provide source ?

John

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #2 on: January 26, 2015, 06:15:33 AM »
Yes, sure John

I added the "obligeous" Mandelbrot (generated by the script - should be there in a sec ).
The *.so is compiled with a 32 bit compiler, but a 64 bit newLISP distribution can be downloaded here :

http://www.newlisp.org/downloads/newlisp_10.6.2-1_amd64.deb  (very fresh, less than a week old)
in the terminal use newlisp-edit to start it up (the editor is JAVA dependent however)

On my Ubuntu, the Software Center said the package was not conform the regulations , but I overruled this and just installed it.

best   Rob

now to do ,   poking directly into the frame's back buffer ..  should be even faster ...  8)

.
« Last Edit: January 26, 2015, 07:52:48 AM by RobbeK »

JRS

  • Guest
Re: Rob's Lisp Adventures
« Reply #3 on: January 26, 2015, 12:07:45 PM »
Rob,

I split the Gauche Scheme thread as it was going off topic. This new thread seems more appropriate. My interests are in Scheme only and was hoping Gauche was enough to convert you to a Scheme centric programmer. Oh well.  :-[

John
« Last Edit: January 26, 2015, 02:22:42 PM by John »

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #4 on: January 26, 2015, 04:02:21 PM »
..   oops , i was drifting again .. 

Yes, but newLISP is a kind of oldLISP , something from before the schism between Scheme and Common Lisp ,imho at first sight it is closer to Scheme than to Common Lisp , and Gauche borrows a lot from Common Lisp - certainly not Scheme standard.

But there's something more important between the old lisp and the newer CL and Scheme , the difference between dynamic (the old) and lexical binding (the newer) , but newLISP does dynamic binding inside of static isolated namespaces.

copying something from Lutz Müller :
"Personally I find dynamic binding more natural. I believe the current trend towards static binding is more a reflection of today's CS curriculum, than of the realities of programming in the real world of applications outside academia. I see static binding more as a fashion than something which is superior to dynamic binding. Both have their advantages and disadvantages.

For most users the fact of dynamic binding in newLISP is not an issue. But dynamic binding dictates a different programming style, avoiding non-local variables. In an example as yours it is still Ok, if you know how dynamic bindng behaves, because the functions involved are close to each other.

Bigger newLISP programs are typically organized in smaller modules inside contexts/namespaces. The overhead of the namespace mechanism is minimal and there is no speed disadvantage. Namespaces isolates modules from each other and can have state.
"

..

Gauche is next on the list, it has everything what I like - (this newLISP stuff is something I had to do -- some old code needed a new jacket )

best Rob     (poking and peeking the frame backbuffer works perfectly in the mean time) 



RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #5 on: February 01, 2015, 02:57:01 AM »
Facts and Numbers --  Recursion 10.000.000 "deep"   on several Lisps

GCL (GNU Common Lisp) 
-> C -> GCC -> native code
2.6.10 CLtL1    Apr  2 2014 14:19:37
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL READLINE UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/

>(defun tst (a max)
   (if (= a max) a
     (tst (1+ a) max)))

TST

>(compile 'tst)

Compiling /tmp/gazonk_7894_0.lsp.
End of Pass 1. 

;; Note: Tail-recursive call of TST was replaced by iteration.
End of Pass 2. 
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
Finished compiling /tmp/gazonk_7894_0.lsp.
Loading /tmp/gazonk_7894_0.o
start address -T 0x8a3640 Finished loading /tmp/gazonk_7894_0.o
#<compiled-function TST>
NIL
NIL

>(time (tst 0 10000000))

real time       :      0.109 secs
run-gbc time    :      0.090 secs
child run time  :      0.000 secs
gbc time        :      0.000 secs
10000000


>(by)
gerd@gerd-HP-Pavilion-dv4000-EK987EA-UUG:~$ clisp  -- bytecode
  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
  I I I I I I I      8     8   8           8     8     o  8    8
  I  \ `+' /  I      8         8           8     8        8    8
   \  `-+-'  /       8         8           8      ooooo   8oooo
    `-__|__-'        8         8           8           8  8
        |            8     o   8           8     o     8  8
  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010

Type :h and hit Enter for context help.

;; Loading file /home/gerd/.clisprc.lisp ...
;;  Loading file /home/gerd/quicklisp/setup.lisp ...
;;  Loaded file /home/gerd/quicklisp/setup.lisp
;; Loaded file /home/gerd/.clisprc.lisp
[1]> (defun tst (a max)
      (if (= a max) a
        (tst (1+ a) max)))
TST
[2]> (compile 'tst)
TST ;
NIL ;
NIL
[3]> (time (tst 0 10000000))
Real time: 0.947063 sec.
Run time: 0.904 sec.
Space: 0 Bytes
10000000

[4]> (bye)
Bye.
gerd@gerd-HP-Pavilion-dv4000-EK987EA-UUG:~$ racket bytecode + JIT
Welcome to Racket v5.3.6.
> (define (tst a max)
    (if (= a max) a
     (tst (add1 a) max)))
> (time (tst 0 10000000))
cpu time: 196 real time: 211 gc time: 0  in mSec
10000000

>
gerd@gerd-HP-Pavilion-dv4000-EK987EA-UUG:~$ gosh
gosh> (define (tst a max)

        (if (= a max) a
          (tst (+ a 1) max)))
tst
gosh> (time (tst 0 10000000))
;(time (tst 0 10000000))
; real   1.003
; user   0.970
; sys    0.000
10000000

gosh> gerd@gerd-HP-Pavilion-dv4000-EK987EA-UUG:~$ sbcl  Steel bank Common Lisp
This is SBCL 1.1.14.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (defun tst (a max)
    (if (= a max) a (tst (1+ a) max)))

TST
* (time (tst 0 10000000))

Evaluation took:
  0.134 seconds of real time
  0.120000 seconds of total run time (0.120000 user, 0.000000 system)
  89.55% CPU
  225,237,609 processor cycles
  0 bytes consed

 
10000000
 
gerd@gerd-HP-Pavilion-dv4000-EK987EA-UUG:~$ ecl
ECL (Embeddable Common-Lisp) 13.5.1 (git:UNKNOWN)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help. 
Top level in: #<process TOP-LEVEL>.
> (defun tst (a max)
    (if (= a max) a
     (tst (1+ a) max)))

TST
> (compile 'tst)

;;; Loading #P"/usr/lib/ecl-13.5.1/cmp.fas"
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
TST
NIL
NIL
> (time (tst 0 10000000))

real time : 0.327 secs
run time  : 0.296 secs
gc count  : 1 times
consed    : 21796736 bytes
10000000

>

Ikarus Scheme version 0.0.4-rc1+ (revision 1870, build 2015-01-30)  ;; highly optimazing Scheme
Copyright (c) 2006-2009 Abdulaziz Ghuloum

> (define (tst a max)
     (if (= a  max) a
      (tst (+ a 1) max)))
> (time (tst 0 10000000))
running stats for (tst 0 10000000):
    no collections
    96 ms elapsed cpu time, including 0 ms collecting
    104 ms elapsed real time, including 0 ms collecting
    0 bytes allocated
10000000

>


best Rob -- Ikarus (0.0.4) comes with gl glut and an FFI (the project seems abandoned and on the homepage 0.0.3 is the most recent version, comes with documentation for the ...4  , except openGL are empty pages ....
« Last Edit: February 01, 2015, 03:12:06 AM by RobbeK »

jack

  • Guest
Re: Rob's Lisp Adventures
« Reply #6 on: February 01, 2015, 06:44:17 PM »
hello Robbek
my timing of DrRacket on my Mac
from the IDE
Code: [Select]
(define (tst a max)
    (if (= a max) a
     (tst (add1 a) max)))
(time (tst 0 10000000))
time in miliseconds
cpu time: 304 real time: 304 gc time: 0

compiled to exe
cpu time: 32 real time: 31 gc time: 0

from my experiments, sbcl is usually very fast.

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #7 on: February 03, 2015, 05:59:31 AM »
thanks, Jack


Rob

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #8 on: February 26, 2015, 06:42:03 AM »
Hi all,

Connected tk/tcl to CLISP and Steel Bank CL under windows too ,,   works fine.
Also gl/glu/glut under windows using cl-glop (an example attached --  huge file (a Steel Bank CL image around 50Mb  :-\  )
use  mouse hold left/right and mousewheel to have a look at the plot.  (code came from a Russian website - there are no manuals for glop I can find, i use this and the source as documentation --  wrote the Gauss prime plot with it (clip) )

best Rob
(if someone needs the bindings for tik/tcl and CL , just ask -- have both for Win and Linux (incl. callbacks from tcl to Lisp ))



.

Mike Lobanovsky

  • Guest
Re: Rob's Lisp Adventures
« Reply #9 on: February 26, 2015, 07:45:41 AM »
Hi Rob,

Also gl/glu/glut under windows using cl-glop

Looks like 100% CPU load, doesn't it? Also, there's doesn't seem to be any 50MB example attached...

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #10 on: February 26, 2015, 08:32:49 AM »
Hi Mike,

100%, yes -- that's the original Russian product -- i put a sleep into the idle loop (runs around 40% cpu usage)

best Rob

I'll try to attach again  -- nope doesn't work (file is a 7zip around 10Mb)

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #11 on: February 26, 2015, 12:28:54 PM »
OK , put it in my DropBox :   here's the link

https://www.dropbox.com/s/6xldd4dhdji8ocv/SBCL3Dplot.7z?dl=0


best, Rob
(of course , it should be run in the REPL , you can change the formula interactively (while running) :  in Lisp there is no real distinction between read-time, compile-time, and runtime. You can compile or run code while reading, read or run code while compiling, and read or compile code at runtime.
« Last Edit: February 26, 2015, 01:07:49 PM by RobbeK »

Mike Lobanovsky

  • Guest
Re: Rob's Lisp Adventures
« Reply #12 on: February 26, 2015, 02:02:18 PM »
OK , put it in my DropBox :   here's the link

Thanks, it worked for me this time. This forum has a limitation on the size of attachments to forum posts, which is about 5MB lower than the 15/20MB claimed in the message editor.

100%, yes -- that's the original Russian product

Hehe yes, Russians are hard to beat when it comes to playing on your nerves.

Quote
i put a sleep into the idle loop (runs around 40% cpu usage)

It's as low as 11% only on my quadcore. You must be referring to some low-end CPU, evidently a single-core make.

Quote
(file is a 7zip around 10Mb)

9MB zipped, 50MB unzipped, and ridiculous 350MB when loaded in memory, to be precise. This "in memory footprint" approach to making "executables" certainly takes its toll.

Quote
in Lisp there is no real distinction between read-time, compile-time, and runtime. You can compile or run code while reading, read or run code while compiling, and read or compile code at runtime.

You can run out of memory easily when doing all this stuff at once on a really large program (see my preceding note).


Thanks again for responding, Rob.

RobbeK

  • Guest
Re: Rob's Lisp Adventures
« Reply #13 on: February 27, 2015, 01:56:54 PM »
Hi Mike,

.....are hard to beat when it comes to playing on your nerves...........    the gl_list is also present in system-memory , because it's static it should be in hardware memory  as glNewList (id, GL_COMPILE)  etc ... (not ?)

yes, still low-end for the moment (but awaiting , the new machine should arrive any day now).

There're some problems with these CL's under Linux in the way that it doesn't accept the lib's I wrote (they give segmentation faults) -- they run fine under Racket Scheme and newLISP under Linux -- I tried cdecl , std , std-call , pascal protocol but nothing is accepted.  This is very problematic (under Win everything works).  I need my own libs , those that come with tk/tcl , Racket Scheme etc..  are too slow at pixel level (tk/tcl even can not draw a pixel  -- execpt when switching into a "photo" object - then it's even slower  :(

If i can't solve that problem with CL under Linux, I definitely switch to Racket Scheme and newLISP , the FFI is easy -- it's "only" bytecode with JIT (with a jump tail inside) , but nevertheless  ...  added a test (gaussprimes, that's easy -- checking a 500² grid of numbers , and plotting them -- more than fast enough (the primes are memoized of course  ;) 

in fact, it's very easy coding :

------------------------------------------

#lang racket
 (require ffi/unsafe   ffi/unsafe/define)
 (require racket/gui/base )
 
 (define-ffi-definer mylib-define (ffi-lib "screen2win.dll"))
 (mylib-define pixel (_fun _int _int _int _int _int  -> _void ))
 (mylib-define endscreen (_fun -> _void))
 (mylib-define setscreen (_fun _int _int _int _int -> _ulong ))
 (mylib-define scrclr (_fun -> _void))
 (mylib-define scrlock (_fun -> _void))
 (mylib-define scrunlock (_fun -> _void))
 (mylib-define scr (_fun _int -> _void))
 (mylib-define scrsleep (_fun -> _void))
 (mylib-define pokebyte (_fun _ulong _ubyte -> _void))
 
 
 

(define *z* 0)
(define lim (* 3 250 250))
(define primes (list->vector (range (+ 3 lim))))

(define (make-primes)
  (do ((i 2 (+ i 1)))
    ((> i (/ lim 2.0)))
    (when (> (vector-ref primes i) 0)
      (do ((j 2 (+ j 1)))
        ((> (* i j) lim))
        (vector-set! primes (* i j) 0)))))

(define (prime? x)
  (not (zero? (vector-ref primes x))))

(define (gaussprime? x y z)
  (prime? (+ (* x x) (* y y) (* z z))))

(define (plot-primes)
  (scrlock) (scrclr)
  (for* ((x (in-range -250 250)) (y (in-range -250 250)))
    (when (gaussprime? x y *z*) (pixel (+ 250 x) (+ 250 y) 222 222 0))) (scrunlock) (message) )

(define (message)
  (send ed1 set-value (string-append "Level# : "(number->string *z*))))
                       
(define frame (new frame% [label ""]
                   (x 20)
                   (y 20)
                   (style (list 'no-caption))
                   (spacing 10)
                   (border 30)
                   (width 200)
                   (height 200)))

(new button% (parent frame)
             (label "Incr level")
             (min-width 100)
             (callback (lambda (button event)
                         (set! *z* (+ 1 *z*))
                         (plot-primes)
                         )))

(new button% (parent frame)
     (label "Decr Level")
     (min-width 100)
     (callback (lambda (button event)
                (set! *z* (- *z* 1))
                         (plot-primes)
        )))

(define exitbutton (new button% (parent frame)
     (label "Close graphics and die")
     (min-width 160)
     (callback (lambda (button event) (scr 0)
                 (when (send frame can-close?) (send frame on-close) (send frame show #f))
))))

(define ed1 (new text-field% (label "Info ") (parent frame) (init-value " ") ))
 

(let ((bck (make-object color% 220 220 180)))
       (send ed1 set-field-background bck)
  )

(make-primes)
(setscreen 500 500 350 50)
(plot-primes)

(send frame show #t)

-----------------------------
imho , rather compact for what it does (?)

best, Rob
(still a huge file -- it shows kind of patterns in prime numbers -- nothing special, but a good test for a programming language)

.
« Last Edit: February 27, 2015, 03:01:28 PM by RobbeK »

Mike Lobanovsky

  • Guest
Re: Rob's Lisp Adventures
« Reply #14 on: February 28, 2015, 12:26:44 PM »
Quote from: Rob
the gl_list is also present in system-memory , because it's static it should be in hardware memory

Hardly. There's only one way to channel your OpenGL data to the hardware memory on your GPU, which is to utilize VBOs (vertex buffer objects). glNewList(GL_COMPILE) and the like are OpenGL's immediate mode instruments that are very old, have nothing to do with VBOs, and are constantly on the verge of being totally deprecated but somehow are still kept there presumably owing to the tremendous educational value of immediate mode and its existing code base for the newbies.

OpenGL draw list data is compiled into conventional memory. If we assume that those particular "executables" are nothing else but memory footprints, then much of their fat is due to the 5002 * 4 * 3 vertex data bytes precomputed by the compiler before dumping the "executable" onto the hard disk.

Quote
There're some problems with these CL's under Linux ...

Why don't you try and address the CL dev team with some incompatibility samples from your libs? Of course the outcome will depend largely on general friendliness (or bitchyness) of the particular community, but there's still a slim chance that you might get your (or their) issues solved one way or the other.