Author Topic: The buddhabrot (challenging ?)  (Read 26075 times)

0 Members and 3 Guests are viewing this topic.

RobbeK

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #15 on: December 14, 2014, 11:34:27 AM »
Hi John,

" You need to wean yourself off the JAPI / Java direction. IMHO"  - yes I agree ...  (i even think Java reached a certain degree of ridicoulesness at this moment , and from a math./logical viewpoint the OO-java concept is almost discutable) ; but the alternatives ?   what to do ; japi is very simple -- i've been looking at IUP , GL , Ltk and other (quick)Lisp packages --  it's not all sunshine either ( i really don't know   -- OpenJava running under *nix is a disaster (it seems far from stable)).

Recapitulating :   i don't know  ::)     
(and I certainly do not like the Racket / LPT Scheme way turning (about graphics) points, colours and other primitives into objects - besides a loss of processing/coding time  it seems someone is building a system for the sole reason of having a system (ok it is used for teaching, but nevertheless it starts to look like that MS Small Basic that while it likes to give a clever impression, it is completely retarded, almost an insult ).

(except the slow starting up time (typical Java) the Japi GUI is rather fast imo )

but yes , I 100% agree  --  ;)

what do you think about Ltk ?   (the main problem (my viewpoint) is , can you ask someone    "you can run my code if you install this and that .. from Java you can reasonably expect it's on almost any computer "

best Rob   

JRS

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #16 on: December 14, 2014, 12:30:05 PM »
Continue on with your migration to SDL(_gfx). I think Charles has SDL examples in the O2 build. SB (BASM soon) supports SDL_gfx as well. Before taking the leap, I would ask Mike what he recommends for a graphics direction.

Mike Lobanovsky

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #17 on: December 14, 2014, 08:56:03 PM »
I'm not sure if I understand the question.

I think Rob is trying to use one of the existing GUI implementations available for the LISP dialects that are solid enough to provide him with the language functionality he needs for his applications. If there are no ready made LISP-to-SDL interface implementations suitable for his needs, then how is he supposed to migrate to SDL? Rob doesn't seem to be a language developer. He looks more like a LISP programmer to me. :)

JRS

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #18 on: December 14, 2014, 09:05:26 PM »
I think the TinyScheme and SDL_gfx extension modules in Script BASIC might be worth a try. The big question is can Rob adapt to TinyScheme?


Mike Lobanovsky

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #19 on: December 14, 2014, 10:36:01 PM »
Yeah, LISP is not Scheme. It's like Python and BASIC; conceptually similar but annoyingly different in minute details for a non-committed user.

RobbeK

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #20 on: December 15, 2014, 02:48:26 AM »
Hi,

Yes, Common Lisp is not Scheme and somehow you have to make a choice -- my love goes to CL (while Scheme remains very interesting ).
Scheme seems more puristic imho but taking Racket for example when one of the basic Scheme concepts was (among them) that iteration is something that always can be expressed as a recursive construction, suddenly they come with a heap of mechanisms    for     for/list    for/product    for/sum    for/array   for/vector   for/bit-vector and the nested for*/xxxxx   family -- it is not pure iteration yet because it works as  :      (for ((i L)) ...   ) where L is list (p.e.     (for ((i '( 1 2 3)) --  but this is identical with the CL    (dolist (i L)   ...   )  ,   then the index is fabricated as (range 1 10)      (for ((i (range 1 10)))  ...   index 0..9   looks like iteration but in fact isn't  .. then came the big step    (in-range x y) , now the list is gone, it's a stream (and imho we can call this iteration now and we can expand it into the infinite   (in-naturals)  , this works now because being a stream and intercepted the lazy way.  So I think there is an evolution into iterative contructions in some Schemes.

But this is not the only reason :  in CL , when one defines :

(defun double (x) (+ x x))    (p.e.     (double 2/3) ->  4/3

just like in a full numeric tower Scheme this works for fixnumbers , bignumbers , fractions , floats and complex numbers. It is understandable that such code will be slower than something as written in C.   However CL can speed things up !!

(defun double (x)
  (declare (fixnum x))
   (+ x x))

(don't know how to do it in Scheme, except in Bigloo and that Racket has a switch called "typed Racket" )  , also lists when big are extremely slow to address (it's a connection of pointers) so when giving up the variadic nature in working with vectors , arrays etc... things will speed up remarkable.

http://www.iaeng.org/IJCS/issues_v32/issue_4/IJCS_32_4_19.pdf

However (and rather logical imho) , if your lisp code is tuned to reach the speed of C , it starts looking as C and some things lisp is famous for, vanishes.
STALIN is fast, very fast , but imho it is a strpped down Scheme version (no complex numbers , no fractions (a slow thing) etc..)

So probably i will stay a CL devotee for ever  8)   not meaning I don't like it very much to code in Scheme, Forth , Basic etc ... 

OK, I'll have a look on the SDL packages available for CL.

Working on a fractal now representing a ships graveyard  8)

(written in Clozure Common Lisp :   -- these are the only lines of code needed to do the maths.

(defun the-ship (i x y cx cy maxit orb)
   (if (or (= i maxit) (> orb 3)) i
      (the-ship (1+ i) (- (* x x) (* y y) cx) (- (abs (* 2 x y)) cy) cx cy maxit (abs (* x y)))))

 :)   easy as sunday morning

best Rob   (image is just a start, checking the formula works , the artistic side comes later , but will be completely CAD )

.
« Last Edit: December 15, 2014, 02:59:02 AM by RobbeK »

JRS

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #21 on: December 15, 2014, 02:56:26 AM »
Quote
Working on a fractal now representing a ships graveyard.
(see attached - assuming SDL)

You forgot to Photoshop out the Java/JAPI icon in the upper left corner.  ;D

RobbeK

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #22 on: December 15, 2014, 03:12:51 AM »
Hi John,

No sdl yet, (started the code yesterday )

but

http://cl-sdl.sourceforge.net/screenshots/index.html

let's c there something for windows ...
lispbuilder-sdl  ?    ; https://www.youtube.com/watch?v=XLkUI89fgRI

best Rob

JRS

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #23 on: December 15, 2014, 03:21:13 AM »
Quote from: Rob
but

Now you're talking. NICE!

While you're playing around with that, could you make a list of SDL calls (make-alien sdl::event) for example. TinyScheme allow embedding similar API calls into the language.

RobbeK

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #24 on: December 15, 2014, 03:55:24 AM »
I'll be damned,

working right out of the box   (under Win32 available for CLISP and the Steel Bank )

thanks John,  is there a good SDL tutorial somewhere you know about ??


best Rob

.

JRS

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #25 on: December 15, 2014, 10:51:19 AM »
Quote
working right out of the box

Is it faster than JAPI?


RobbeK

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #26 on: December 15, 2014, 12:01:45 PM »
Hi John,

It has blitting , so it should be as fast as the JAVA's  "drawimagesource"  (which uses 3 x int32 / pixel !!! ).
SDL_GFX and SDL_TTF is working too for the moment.
Now some widgets (a button should be easy, but a textbox? ), in CL most  widget packages are written using CLX  (which is strictly Linux)  , I once got Cocotron in action , but I need a very lightweight thing.  I can write these myself , but another idea may be running scripts within the Lisp. 
(Ltk works fine, but how many have tcl/tk installed on a windows system ? )

best Rob

JRS

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #27 on: December 15, 2014, 12:20:31 PM »
Would changing the name of Script BASIC to something else get you to try it?  :)

The SB direction offers the following.
  • TinyScheme as a shared object ext. module for SB
  • SDL_gfx (SDL + draw primitives) as a shared object ext. module for SB
  • IUP (forms GUI)  as a shared object ext. module for SB
  • DLLC (FFI + on steroids) as a shared object ext. module for SB (Windows / 32 bit only at this time)
  • FREE / open source / cross platform / 32 & 64 bit

Let me know if you find something comparable.

Charles Pegge

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #28 on: December 16, 2014, 02:02:18 PM »
The Buddha of recursive algorithms ;D



http://www.subblue.com/projects/mandelbulb

JRS

  • Guest
Re: The buddhabrot (challenging ?)
« Reply #29 on: December 17, 2014, 12:53:19 AM »
I was able to get the IUP.h converted to a IUP.inc file for BASM. Next on the agenda is SDL_gfx.