weblisp

For the Compleat Fan
Locked
xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

weblisp

Post by xytroxon »

In the effort to design "hands on" newLISP web demonstrations, here's "WebLisp.net - An Online Interpreter for the WebLisp Programming Language"
http://weblisp.net/

And for Weblisp's efforts, the requisite reddit Lisp/Scheme naysayers ;)
http://www.reddit.com/r/programming/com ... e_weblisp/

The interesting thing with the Weblisp demo, is the "canvas" tab...

Highlight the left edit area and delete. Click the "canvas" tab, scroll down and copy the code (below e.g.) over to the left edit area and click "run program".

-- xytroxon
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Post by Kazimir Majorinc »

Great.

Here is one program for Weblisp.

Code: Select all

(gfx-reset)

(define (P a b r)
        (gfx-line a b r r)
        (gfx-line a b r (- 100 r))  
        (gfx-line a b (- 100 r) r)
        (gfx-line a b (- 100 r) (- 100 r)))  

(define (Q r)
        (P 0 0 r)
        (P 0 100 r)
        (P 100 0 r)
        (P 100 100 r))

(define (drawy r)
        (if (> r 0)
            (begin (Q r)
                   (drawy (- r 2)))))
                   
(drawy 50)
The result is on canvas.
Last edited by Kazimir Majorinc on Thu Nov 06, 2008 6:23 pm, edited 1 time in total.

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

great work! It's really clever.

Looks like newLISP has got some serious competition... :)

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Post by Kazimir Majorinc »

Two interesting canvases.

1.Image2.Image

Code: Select all

(gfx-reset)

(define (P a b r)
        (gfx-line a b r r)
        (gfx-line a b r (- 100 r)) 
        (gfx-line a b (- 100 r) r)
        (gfx-line a b (- 100 r) (- 100 r))) 

(define (Q r)
        (P 0 0 r)
        (P 0 5000 r)
        (P 100 0 r)
        (P 100 5000 r))

(define (drawy r)
        (if (> r 0)
            (begin (Q r)
                   (drawy (- r 1.01)))))
                   
(drawy 50)

Code: Select all

(gfx-reset)

(define (P a b r)
        (gfx-line a b r r)
        (gfx-line a b r (- 100 r)) 
        (gfx-line a b (- 100 r) r)
        (gfx-line a b (- 100 r) (- 100 r))) 

(define (Q r)
        (P 0 0 r)
        (P 0 5000 r)
        (P 5000 0 r)
        (P 5000 5000 r))

(define (drawy r)
        (if (> r 0)
            (begin (Q r)
                   (drawy (- r 1.33333)))))
                   
(drawy 50)

unixtechie
Posts: 65
Joined: Sat Sep 06, 2008 6:30 am

Post by unixtechie »

Oh, that's nice.

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Thats a quick canas weblisp is using... nice...
-- (define? (Cornflakes))

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Nice pictures, Kazimir! I love this algorithmic-drawing stuff - there's a lot of good stuff out there too: http://www.azarask.in/blog/post/context ... avascript/

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Post by Kazimir Majorinc »

xytroxon,

where is it evaluated, on your server on on my client, I missed that piece of information.

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Post by Kazimir Majorinc »

Thanx cormullion, amazing site on the link you posted (for those who didn't noticed, follow the first link in that blog. )

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Everybody interested to make Art in newLISP should also go here:

http://www.newlisp.org/index.cgi?Postscript

also linked from: http://www.newlisp.org/index.cgi?Art

The advantage of the Postscript approach is, that graphics and files created are scalable vector graphics.

On Mac OS X you are ready to go with the postscript module. On Win32 or Linux, you also have to install a postscript viewer, i.e. Ghostscript.

Here is one of the pictures similar to the stuff at the www.azarask.in site:

http://www.newlisp.org/postscript/recursion.gif

and here the source:

http://www.newlisp.org/syntax.cgi?posts ... on-lsp.txt

xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

Kazimir Majorinc wrote:xytroxon,

where is it evaluated, on your server on on my client, I missed that piece of information.
Here is Christoph Dietze's post on his weblisp at Google Web Tools:
An Interpreter running inside the Browser using GWT
Hello,

I just put the first version of a project online. Since it heavily
relies on GWT and uses it to do some advanced stuff, I thought it is
worth to put up a post about it here.

It is an interpreter that runs completely inside the browser. The
language that it interprets is a new LISP dialect that I created for
it, called WebLisp. It is a functional and imperative programming
language. There is also some documentation about it on the site.

If you're interested, you can find it here:

http://weblisp.net

Enjoy,
Christoph
So it is a "new LISP" and not "newLISP" :(

----

And for others interest, Kazimir's weblisp post...

-- xytroxon
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Although I use PostScript (and newLISP) a lot (eg here ), I'm still fascinated by the idea of higher-level (more coordinate-free...) type of computer art, where you just sort of set a few things up and watch what unfolds. The algorithmic art procedures are short and simple - and interactive too - one day there will be a newLISP one, perhaps, but not just yet!

Locked