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.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.
Lisp links thread
- teamonkey
- Sheepie Whore

- Posts: 12082
- Joined: Thu Jun 13, 2002 1:07 am 0
- XBL Gamertag: itsthetaste
- PSN: teamonkey_ca
- Contact:
Re: Lisp links thread
Re: Lisp links thread
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...
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);;
- teamonkey
- Sheepie Whore

- Posts: 12082
- Joined: Thu Jun 13, 2002 1:07 am 0
- XBL Gamertag: itsthetaste
- PSN: teamonkey_ca
- Contact:
Re: Lisp links thread
Lovely and clean, it's practically the maths written straight down. You should see the integrators I had to do in F90.GoatFoam wrote:If you think it looks nasty then it is as nothing compared to my C version...
Re: Lisp links thread
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
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
Re: Lisp links thread
one of nebogos things... looks interesting, visual programming for scheme http://www.pawfal.org/index.php?page=SchemeBricks
- teamonkey
- Sheepie Whore

- Posts: 12082
- Joined: Thu Jun 13, 2002 1:07 am 0
- XBL Gamertag: itsthetaste
- PSN: teamonkey_ca
- Contact:
Re: Lisp links thread
http://www.ventonegro.org/2009/10/schem ... app-store/
Iphone app store game written (mostly) in Gambit Scheme.
Iphone app store game written (mostly) in Gambit Scheme.
Re: Lisp links thread
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?
- teamonkey
- Sheepie Whore

- Posts: 12082
- Joined: Thu Jun 13, 2002 1:07 am 0
- XBL Gamertag: itsthetaste
- PSN: teamonkey_ca
- Contact:
Re: Lisp links thread
C is a portable assembler 
Re: Lisp links thread
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?
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?
- Narrengoat
- Baa!

- Posts: 32
- Joined: Sun Aug 30, 2009 11:07 pm 0
- Location: Manchester, UK
Re: Lisp links thread
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.
Re: Lisp links thread
Arc Scheme interpreter in JavaScript: http://jonathan.tang.name/files/arclite/


