weblisp

Started by xytroxon, November 06, 2008, 07:10:00 AM

Previous topic - Next topic

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/">//http://weblisp.net/



And for Weblisp's efforts, the requisite reddit Lisp/Scheme naysayers ;)

http://www.reddit.com/r/programming/comments/7bpbn/weblispnet_an_online_interpreter_for_the_weblisp/">//http://www.reddit.com/r/programming/comments/7bpbn/weblispnet_an_online_interpreter_for_the_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

#1
Great.



Here is one program for Weblisp.


(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.
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

cormullion

#2
great work! It's really clever.



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

Kazimir Majorinc

#3
Two interesting canvases.



1.http://www.instprog.com/canvas.png">2.http://www.instprog.com/canvas2.png">




(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)


(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)
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

unixtechie

#4
Oh, that's nice.

newdep

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

cormullion

#6
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/contextfreejs-algorithm-ink-making-art-with-javascript/">//http://www.azarask.in/blog/post/contextfreejs-algorithm-ink-making-art-with-javascript/

Kazimir Majorinc

#7
xytroxon,



where is it evaluated, on your server on on my client, I missed that piece of information.
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

Kazimir Majorinc

#8
Thanx cormullion, amazing site on the link you posted (for those who didn't noticed, follow the first link in that blog. )
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

Lutz

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



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



also linked from: http://www.newlisp.org/index.cgi?Art">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 http://www.azarask.in">www.azarask.in site:



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



and here the source:



http://www.newlisp.org/syntax.cgi?postscript/recursion-lsp.txt">http://www.newlisp.org/syntax.cgi?posts ... on-lsp.txt">http://www.newlisp.org/syntax.cgi?postscript/recursion-lsp.txt

xytroxon

#10
Quote from: "Kazimir Majorinc"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:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/2bf2433339a8a0dc/2fd4137bb353b315?lnk=raot">An Interpreter running inside the Browser using GWT
Quote
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">http://weblisp.net



Enjoy,

Christoph


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



----



And for others interest, http://kazimirmajorinc.blogspot.com/2008/11/two-canvases-in-weblisp.html">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

#11
Although I use PostScript (and newLISP) a lot (eg http://unbalanced-parentheses.nfshost.com/downloads/moon-calendar-en.pdf">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!