Lisp links thread

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Re: Lisp links thread

Post by teamonkey »

Firefox wrote:Shame it's somewhat spoiled by the crappy VNC connection (why is he doing it over VNC?) and other technical problems, but it still gets across the magic of interactively changing a program while it's still running. That's something a lot of programmers can't see what the fuss is about until they actually experience it for themselves.
Being able to change things on the fly is so utterly, utterly valuable for game systems programming too, especially for prototyping and in the early stages of design.
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Lisp links thread

Post by GoatFoam »

Not strictly lisp

but I have been having a play with OCaml recently. I can't say it has my favourite syntax, but unlike most functional languages it seems quick enough for number crunching.

My first bit of code - a runge kutta integrator. If you think it looks nasty then it is as nothing compared to my C version...

Code: Select all

let rk4_slope(f, t, y, h) =
    let k1 = f(t, y) in
    let h2 = h *. 0.5 in
    let k2 = f((t +. h2), (y +. (h2 *. k1))) in
    let k3 = f((t +. h2), (y +. (h2 *. k2))) in
    let k4 = f((t +. h),  (y +. (h *. k3))) in
    let slope = (((k1 +. k4) +. (2.0 *. (k2 +. k3))) /. 6.0) in
    slope;;

(* f = dy/dt,  h = step size *)
let rk4(f, t, y, h) =
    let slope = rk4_slope(f, t, y, h) in
    y +. (slope *. h);;
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Re: Lisp links thread

Post by teamonkey »

GoatFoam wrote:If you think it looks nasty then it is as nothing compared to my C version...
Lovely and clean, it's practically the maths written straight down. You should see the integrators I had to do in F90. 8O
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Lisp links thread

Post by GoatFoam »

The less said about f90 the better '-)

Since posting that I have written a vector version, which is a bit uglier but still considerably nicer than my old code. Goes almost as fast too :)
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Re: Lisp links thread

Post by adam »

http://schemepy.thousandparsec.net/

embedding a scheme interpreter in a python program
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Re: Lisp links thread

Post by adam »

one of nebogos things... looks interesting, visual programming for scheme http://www.pawfal.org/index.php?page=SchemeBricks
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Re: Lisp links thread

Post by teamonkey »

http://www.ventonegro.org/2009/10/schem ... app-store/

Iphone app store game written (mostly) in Gambit Scheme.
User avatar
failrate
Baaaaaa!
Baaaaaa!
Posts: 2354
Joined: Sun May 23, 2004 6:54 am 0
Location: Sandy Eggo
Contact:

Re: Lisp links thread

Post by failrate »

Yeah, Gambit's got that Scheme-to-C compiler, innit? I always find that funny, since LISP is already so incredibly close to being a parse-tree that it seems to me that converting it to C is a step backwards. I've tried nosing around with gcc to see how hard it is to write a language front-end... and, well, it's really hard. Maybe that's the allure?
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Re: Lisp links thread

Post by teamonkey »

C is a portable assembler :)
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Re: Lisp links thread

Post by GoatFoam »

Exactly.

Every platform worth targeting already has an ANSI C compiler, and many of them have very good ones.

Why waste time maintaining dozens of platforms when other people have already done the hard work?
User avatar
failrate
Baaaaaa!
Baaaaaa!
Posts: 2354
Joined: Sun May 23, 2004 6:54 am 0
Location: Sandy Eggo
Contact:

Re: Lisp links thread

Post by failrate »

Anyone fluent in Japanese?

LISP Manga
http://lambda.bugyo.tk/cdr/mwl/
User avatar
Narrengoat
Baa!
Baa!
Posts: 32
Joined: Sun Aug 30, 2009 11:07 pm 0
Location: Manchester, UK

Re: Lisp links thread

Post by Narrengoat »

JScheme (http://jscheme.sourceforge.net/)is worth mentioning. Used it inside a java-based neural network simulator I wrote for a (massively unsuccessful) MSc project. It was useful for quickly generating variations on different network topologies and for interactive debugging and exploring. Just having a repl I could use to pootle about with java objects was invaluable.
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Re: Lisp links thread

Post by teamonkey »

Another iphone game (WIP) in Gambit Scheme.

http://jlongster.com/blog/2010/02/03/ip ... me-update/


:cow:
User avatar
failrate
Baaaaaa!
Baaaaaa!
Posts: 2354
Joined: Sun May 23, 2004 6:54 am 0
Location: Sandy Eggo
Contact:

Re: Lisp links thread

Post by failrate »

Arc Scheme interpreter in JavaScript: http://jonathan.tang.name/files/arclite/
User avatar
teamonkey
Sheepie Whore
Sheepie Whore
Posts: 12082
Joined: Thu Jun 13, 2002 1:07 am 0
XBL Gamertag: itsthetaste
PSN: teamonkey_ca
Contact:

Re: Lisp links thread

Post by teamonkey »

Post Reply