Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

compute intensive scheme
I have frequently seen references to Scheme's usage as an embedded scripting
language.  Although there are plenty of tasks that do require this sort of
thing, it is of little personal interest to me.  I'm mainly interested in
compute intensive uses of a language, such as heavy lifting for 3D graphics
or AI.  Can anyone point me at open source examples of compute intensive
uses of Scheme?  Something that really breaks a computer.

As far as implementations, I've been interested in Bigloo Scheme for
performance reasons.  However, the archive of software pointed at by Bigloo
is very small.  Then there's Stalin, which doesn't appear to even have a
webpage, just a FTP site.

--
Cheers,                     www.indiegamedesign.com
Brandon Van Every           Seattle, WA

"The pioneer is the one with the arrows in his back."
- anonymous entrepreneur



Report this thread to moderator Post Follow-up to this message
Old Post
Brandon J. Van Every
11-19-04 01:58 AM


Re: compute intensive scheme
Brandon J. Van Every wrote:
> Can anyone point me at open
> source examples of compute intensive uses of Scheme?  Something that
> really breaks a computer.

So I suppose there isn't anything then.

--
Cheers,                          www.indiegamedesign.com
Brandon Van Every                Seattle, WA

Brandon's Law (after Godwin's Law):
"As a Usenet discussion grows longer, the probability of
a person being called a troll approaches one RAPIDLY."


Report this thread to moderator Post Follow-up to this message
Old Post
Brandon J. Van Every
11-21-04 08:58 AM


Re: compute intensive scheme
On Sat, 20 Nov 2004 22:31:28 -0800, Brandon J. Van Every wrote:

I suppose This isn't what you are looking for,
but it *does* take a heavy burden on your computer in terms
of CPU usage and memory usage. E.g. using bigloo with
BIGLOOHEAP=200.

(module test
(main main))

(define (f1 n)
(do
((i 0 (+ i 1))
(c 0))
((>= i n) c)
(set! c (+ c 1))))

(define ff2
(lambda args
(+ (car args) (cadr args))))

(define (f2 n)
(do
((i 0 (+ i 1))
(c 0))
((>= i n) c)
(set! c (ff2 c 1))))

(define (ff3 . args)
(+ (car args) (cadr args)))

(define (f3 n)
(do
((i 0 (+ i 1))
(c 0))
((>= i n) c)
(set! c (ff3 c 1))))

(define (ff4 . args)
(apply + args))

(define (f4 n)
(do
((i 0 (+ i 1))
(c 0))
((>= i n) c)
(set! c (ff4 c 1))))

(define (f5 n)
(do
((i 0 (+ i 1))
(c 0))
((>= i n) c)
(set! c (apply + (list c 1)))))

(define (f7 n)
(do
((i 0 (+ i 1))
(c 0)
(f +))
((>= i n) c)
(set! c (f c 1)))

(define (main argv)
(set! argv (cdr argv))
(cond
((string=? (car argv) "1")
(print "f1:" (f1 (string->number (cadr argv)))))
((string=? (car argv) "2")
(print "f2:" (f2 (string->number (cadr argv)))))
((string=? (car argv) "3")
(print "f3:" (f3 (string->number (cadr argv)))))
((string=? (car argv) "4")
(print "f4:" (f4 (string->number (cadr argv)))))
((string=? (car argv) "5")
(print "f5:" (f5 (string->number (cadr argv)))))
((string=? (car argv) "7")
(print "f7:" (f7 (string->number (cadr argv))))))
0)


Report this thread to moderator Post Follow-up to this message
Old Post
Hans Oesterholt-Dijkema
11-21-04 08:58 PM


Re: compute intensive scheme
The impression I get is that Jeff Siskind wrote Stalin specifically so
he would be enabled to write high-performance light-pattern-processing
(sorry, I'm totally clueless about the right terms in that field)
applications his research is mainly on in Scheme, so you could probably
find some, ah, fairly high-performance Scheme applications in his
software lists.

Report this thread to moderator Post Follow-up to this message
Old Post
Taylor Campbell
11-21-04 08:58 PM


Re: compute intensive scheme
Taylor Campbell wrote:
> The impression I get is that Jeff Siskind wrote Stalin specifically so
> he would be enabled to write high-performance light-pattern-processing
> (sorry, I'm totally clueless about the right terms in that field)
> applications his research is mainly on in Scheme, so you could
> probably find some, ah, fairly high-performance Scheme applications
> in his software lists.

Thanks for the pointer.  I'll take a dig at it and see how far I get.

--
Cheers,                     www.indiegamedesign.com
Brandon Van Every           Seattle, WA

Taking risk where others will not.




Report this thread to moderator Post Follow-up to this message
Old Post
Brandon J. Van Every
11-21-04 08:58 PM


Re: compute intensive scheme
"Brandon J. Van Every" <try_vanevery_at_mycompanyname@yahoo.com> writes:

> I have frequently seen references to Scheme's usage as an embedded
> scripting language.  Although there are plenty of tasks that do
> require this sort of thing, it is of little personal interest to me.
> I'm mainly interested in compute intensive uses of a language, such as
> heavy lifting for 3D graphics or AI.  Can anyone point me at open
> source examples of compute intensive uses of Scheme?  Something that
> really breaks a computer.

Download a computer algebra system like
http://swiss.csail.mit.edu/~jaffer/JACAL

Now try to find the intersection of two arbitrary ellipses.  The
calculation is double-exponential in the number of variables.  Here is a
pared-down version of the problem (axis-aligned ellipses) which takes a
few seconds:

eliminate([(x*s2-a2)^2+(y-c2)^2=r2^2, (x*s1)^2+(y-c1)^2=r1^2], y);

Adding one more variable takes 3 minutes:

eliminate([(x*s2-a2)^2+(y-c2)^2=r2^2, (x*s1-a1)^2+(y-c1)^2=r1^2], y);

Adding another tries my patience:

eliminate([(x*s2-a2)^2+(y-c2)^2=r2^2, (x*s1-a1)^2+(y*t1-c1)^2=r1^2], y);

This is an uncontrived problem domain where a factor of 10 in speed
makes little difference; it wouldn't handle the complexity of even one
additional variable!

-=-=-=-=-

Here is how to set up the general intersection of two ellipses; each
ellipse being those points whose sum of the distances to the two centers
is a constant (d1, d3).  Please post if you find a solution.

bash-2.05b$ jacal
scm -ip1 -l /usr/local/lib/jacal/go
.............
JACAL version 1b4, Copyright 1989-2002 Aubrey Jaffer
JACAL comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `(terms)' for details.
;;; Type (math) to begin.
type qed; to return to scheme, type help; for help.
e0 : l1^2 = (x-a1)^2+(y-c1)^2;

2     2     2             2             2
e0: 0 = a1  + c1  - l1  - 2 a1 x + x  - 2 c1 y + y

e1 : l2^2 = (x-a2)^2+(y-c2)^2;

2     2     2             2             2
e1: 0 = a2  + c2  - l2  - 2 a2 x + x  - 2 c2 y + y

e2 : eliminate([e0, e1, l1+l2=d1], [l1, l2]);

4       2   2     4          2       2    2     4        2
e2:   0 = - a1  + 2 a1  a2  - a2  + (- 2 a1  + 2 a2 ) c1  - c1  + (2 a1  -

2       2    2     4        2       2       2       2    2     4
2 a2  + 2 c1 ) c2  - c2  + (2 a1  + 2 a2  + 2 c1  + 2 c2 ) d1  - d1  +

3       2             2       3                   2
(4 a1  - 4 a1  a2 - 4 a1 a2  + 4 a2  + (4 a1 - 4 a2) c1  + (- 4 a1 +

2                     2             2                 2
4 a2) c2  + (- 4 a1 - 4 a2) d1 ) x + (- 4 a1  + 8 a1 a2 - 4 a2  +

2   2         2       2           3          2       2       2
4 d1 ) x  + ((4 a1  - 4 a2 ) c1 + 4 c1  + (- 4 a1  + 4 a2  - 4 c1 ) c2 -

2       3                     2
4 c1 c2  + 4 c2  + (- 4 c1 - 4 c2) d1  + ((- 8 a1 + 8 a2) c1 + (8 a1 -

2                 2       2   2
8 a2) c2) x) y + (- 4 c1  + 8 c1 c2 - 4 c2  + 4 d1 ) y

e3 : l3^2 = (x-a3)^2+(y-c3)^2;

2     2     2             2             2
e3: 0 = a3  + c3  - l3  - 2 a3 x + x  - 2 c3 y + y

e4 : l4^2 = (x-a4)^2+(y-c4)^2;

2     2     2             2             2
e4: 0 = a4  + c4  - l4  - 2 a4 x + x  - 2 c4 y + y

e5 : eliminate([e3, e4, l3+l4=d3], [l3, l4]);

4       2   2     4          2       2    2     4        2
e5:   0 = - a3  + 2 a3  a4  - a4  + (- 2 a3  + 2 a4 ) c3  - c3  + (2 a3  -

2       2    2     4        2       2       2       2    2     4
2 a4  + 2 c3 ) c4  - c4  + (2 a3  + 2 a4  + 2 c3  + 2 c4 ) d3  - d3  +

3       2             2       3                   2
(4 a3  - 4 a3  a4 - 4 a3 a4  + 4 a4  + (4 a3 - 4 a4) c3  + (- 4 a3 +

2                     2             2                 2
4 a4) c4  + (- 4 a3 - 4 a4) d3 ) x + (- 4 a3  + 8 a3 a4 - 4 a4  +

2   2         2       2           3          2       2       2
4 d3 ) x  + ((4 a3  - 4 a4 ) c3 + 4 c3  + (- 4 a3  + 4 a4  - 4 c3 ) c4 -

2       3                     2
4 c3 c4  + 4 c4  + (- 4 c3 - 4 c4) d3  + ((- 8 a3 + 8 a4) c3 + (8 a3 -

2                 2       2   2
8 a4) c4) x) y + (- 4 c3  + 8 c3 c4 - 4 c4  + 4 d3 ) y

e6 : eliminate([e2, e5], y);

Report this thread to moderator Post Follow-up to this message
Old Post
Aubrey Jaffer
12-02-04 08:57 AM


Re: compute intensive scheme
[url]http://www.ardice.com/Games/Video_Games/Computer_Platforms/Windows/3D_Graphics[/ur
l]

Report this thread to moderator Post Follow-up to this message
Old Post
parker
12-03-04 12:09 PM


Re: compute intensive scheme
parker wrote:
>
http://www.ardice.com/Games/Video_G...egamedesign.com
Brandon Van Every           Seattle, WA

Taking risk where others will not.


Report this thread to moderator Post Follow-up to this message
Old Post
Brandon J. Van Every
12-03-04 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:29 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.