f



From python to scheme, but which scheme?

I've learned python over the past few years and like it very much.
However it's too slow, and I've recently been re-invigorated
intellectually with a reading of SICP.  This is mostly for hobby/fun
purposes; I'm not a professional programmer.

I have a specific small program I'd like to translate to scheme (event
driven simulator for battery operated devices), but I'm not sure where
to go from here.  I've narrowed my choices down to PLT scheme and
Gambit-C.  PLT because it looks like it's designed for learning and
has the HTDP book associated with it, and Gambit-C because it seems to
have the potential for embedding scheme into a non-OS driven CPU or
microcontroller... and today I discovered a seemingly dead (?)
language Dylan which appears to be scheme with a different syntax.

I would not have understood what's going with SICP had I not already
had a pretty decent understanding of Python, however going through
that book showed me some weaknesses in some of python's semantics when
you try to view it as a funtional language.  There are other recent
posts here showing differences in those languages.  I'd like to learn
more about functional programming, but haskell seems crazy and python
seems limited in even the first few things I tried, whic hI think has
to do with where variables are bound, scope, and that sort of thing
(eg SICP models state with lambdas, ["static" variables in C], but in
python you have to use a mutable list for the same thing, even for a
single variable, which seems kind of dirty).

I was unable to find in SICP a direct translation for some of the
pythonic idioms and features I've come to like: classes (including
heirarchy and stuff), iterators, list comprehensions, modules, step-by-
step debugging, profiling, etc.  I have come to understand these
things must be built up from atomic scheme things, and exist in
various modules and stuff.

I have come across meroon for classes, but I'm not sure where else to
go from here.  It seems there are plenty of libraries and modules I
could use for various things, but I'm overwhelmed with the options,
and I'm not sure how portable and compatible these libraries and
modules are for different flavors of scheme.  Can I run the exact same
source code on both PLT and gambit, including libraries and modules?
I really don't know at this point.  What about step-by-step
debugging?  Profiling?  THis is mostly on Windows platform.

Can someone please provide wise guidance in where to go from here?
PLT, Gambit, or Dylan?

thanks
michael
0
5lvqbwl02 (39)
11/30/2008 5:02:11 AM
comp.lang.scheme 4781 articles. 0 followers. Post Follow

25 Replies
10655 Views

Similar Articles

[PageSpeed] 1

On Nov 30, 6:02=A0am, 5lvqbw...@sneakemail.com wrote:
>=A0This is mostly for hobby/fun
> purposes; I'm not a professional programmer.

Ok.

> I have a specific small program I'd like to translate to scheme (event
> driven simulator for battery operated devices), but I'm not sure where
> to go from here.

Does that mean that you need a good interface with C?

> I was unable to find in SICP a direct translation for some of the
> pythonic idioms and features I've come to like: classes (including
> heirarchy and stuff), iterators, list comprehensions, modules, step-by-
> step debugging, profiling, etc. =A0I have come to understand these
> things must be built up from atomic scheme things, and exist in
> various modules and stuff.

All those things exist but they are
very much implementation-dependent.

> I have come across meroon for classes, but I'm not sure where else to
> go from here. =A0

Probably the most used object system in Scheme is some variant
of (Tiny)CLOS, not Meroon. If the implementation you choose
prefers a particular object system use that one. You can do
a lot without using any object system (this is the option I
would suggest, especially at the beginning).

> It seems there are plenty of libraries and modules I
> could use for various things, but I'm overwhelmed with the options,
> and I'm not sure how portable and compatible these libraries and
> modules are for different flavors of scheme. =A0Can I run the exact same
> source code on both PLT and gambit, including libraries and modules?
> I really don't know at this point.

Certainly there is a portability issue. You must choose
an implementation and stick with it.

>=A0What about step-by-step
> debugging? =A0Profiling? =A0

As I said, all that is implementation specific.

> THis is mostly on Windows platform.

Do you need a Scheme running on .NET?

> Can someone please provide wise guidance in where to go from here?
> PLT, Gambit, or Dylan?
>

AFAIK Dylan is dead. Moreover, the point of learning Scheme is having
s-expressions, isn't it? I would leave it out of your list and I would
consider Chicken instead.
For some reason, all the Pythonistas I know like Chicken.
You can find a guide aimed to people coming from Python
in the Chicken wiki:

http://chicken.wiki.br/chicken-for-python-programmers

Hans Nowak also wrote a lot of posts discussing the transition Python-
>Chicken in his blog

http://4.flowsnake.org/archives/date/2007/12

I wrote myself a series of articles about Scheme from a
Python point of view:
http://www.artima.com/weblogs/index.jsp?blogger=3Dmicheles

In my articles I use Ikarus, not Chicken, because I am interested in
R6RS, however I would not recommend Ikarus if
you want to interface with C libraries on a Windows
platform (Aziz can say more on this point, but I gather
than Ikarus is developed on a Mac and requires a Unix-like
platform like Cygwin to run on Windows). Also, Ikarus is a pretty
young implementation (we are currently at release 0.0.3).
0
11/30/2008 6:23:17 AM
5lvqbwl02@sneakemail.com writes:
....
> I would not have understood what's going with SICP had I not already
> had a pretty decent understanding of Python, however going through
> that book showed me some weaknesses in some of python's semantics ...
> to do with where variables are bound, scope, and that sort of thing
> (eg SICP models state with lambdas, ["static" variables in C], but in
> python you have to use a mutable list for the same thing, even for a
> single variable, which seems kind of dirty).

If you are talking about the same Python weakness I'm thinking of,
this particular limitation of Python is lifted in version 3.0,
scheduled to be relased real soon now.  By using the keyword
"nonlocal", an inner procedure will now be able to assign a new value
to a variable bound in an outer procedure.  -max
0
max9354 (139)
11/30/2008 12:13:04 PM
On Sat, 29 Nov 2008 22:23:17 -0800, Michele Simionato wrote:

> For some reason, all the Pythonistas I know like Chicken.

I don't know about that.  I switched from Python to PLT.  PLT has most of 
the "batteries included" flavour of Python, and works across the main 
plaforms that I care about (Windows, MacOS, varous flavours of Unix).  
Performance is better than Python, particularly since I moved to a 
plaform supported by the JIT.  Frankly, Python's object syntax and 
semantics are another big reason for me leaving it behind (and the lack 
of elegance of either).  With PLT I'm happy in the knowledge that there 
are at least two "native" object systems available, at least one other in 
the contributed collection, and I've not yet found a need for any of 
them: first order functions and closures have been doing it for me, so 
far.

About the only thing that I miss is NumPy/SciPy, which was giving Matlab 
a serious run for its money...  Maybe there's something in PLaneT that I 
haven't discovered yet.

Not that I have anything against gambit: I have it installed on all my 
machines, and I follow the mailing lists.  But my scheme projects 
currently run under PLT.

Cheers,

-- 
Andrew
0
11/30/2008 12:46:42 PM
5lvqbwl02@sneakemail.com wrote:

> I've narrowed my choices down to PLT scheme and
> Gambit-C.  PLT because it looks like it's designed for learning and
> has the HTDP book associated with it, 

It is a misperception (unfortunately not uncommon among non-schemers)
that PLT is for learning only.

~ and Gambit-C because it seems to
> have the potential for embedding scheme into a non-OS driven CPU or
> microcontroller... and today I discovered a seemingly dead (?)
> language Dylan which appears to be scheme with a different syntax.

> Can someone please provide wise guidance in where to go from here?
> PLT, Gambit, or Dylan?

I suggest you try both PLT Scheme (and in particular DrScheme) and
Gambit for, say, a week each and see which one appeals to you the
most.

Also, join the mailing lists for PLT Scheme and Gambit - there
will always be small things that you need help for. If something
from Pythin is missing in either implementation odds are that
the concept is simply called a different name in Scheme.

   http://list.cs.brown.edu/mailman/listinfo/plt-scheme/
   https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list

-- 
Jens Axel S�gaard
0
11/30/2008 12:48:47 PM
On Nov 29, 11:02=A0pm, 5lvqbw...@sneakemail.com wrote:
> Can someone please provide wise guidance in where to go from here?
> PLT, Gambit, or Dylan?

Hi Michael,

Find out which distribution makes you the happiest and stick with it
for a while before you start worrying about portability. "Happy" is
defined by you in this case.

I like PLT.

Best wishes,

Grant Rettke
0
grettke (458)
11/30/2008 5:18:29 PM
michael wrote:
> Can I run the exact same source code on both PLT and
> gambit,

Yes, provided you write portable R5RS code and are careful
to avoid implementation-dependent extensions.

> including libraries and modules?

Probably not.  So far as I know, Gambit does not yet
support R6RS/ERR5RS libraries, which are the only portable
form of libraries that PLT supports.

> What about step-by-step debugging?  Profiling?

Those are implementation-dependent, but they don't affect
your source code so the implementation dependence doesn't
reduce portability.

> This is mostly on Windows platform.

You might want to consider Larceny as well as Gambit and
PLT.  Both Larceny and PLT give you the option of writing
R5RS or R6RS code; in addition, Larceny provides an ERR5RS
mode, which amounts to an interactive read/eval/print loop
that lets you mix R5RS and R6RS code.  Gambit is R5RS-only
with implementation-specific extensions.

All three (Gambit, PLT, Larceny) have decent interfaces to
C, but your interface code will be implementation-specific.

Some more detailed comments regarding portability of other
features you mentioned:

classes:  Meroon and TinyCLOS are just two of many class
systems you could use.  I believe Meroon has been written
in mostly R5RS-portable code [1].  For portability, you'll
need to ignore implementation-specific class systems.

iterators:  The Iterator design pattern is trivial to
implement in Scheme, but I would recommend you try to
use the Functional Visitor pattern instead, which is more
idiomatic in Scheme and has some support from the standard
R5RS and R6RS libraries (e.g. for-each, fold/reduce, map,
vector-map).

list comprehensions:  Again, this is easy to implement
in Scheme.  See e.g. SRFI 42 [2].

modules:  R6RS/ERR5RS libraries are the only portable way
to go, and they are seldom available outside of R6RS and
ERR5RS systems.  For portability, you'll need to avoid the
many implementation-specific module systems.

Will

[1] http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/Meroon.html
[2] http://srfi.schemers.org/srfi-42/
0
cesura17 (520)
11/30/2008 5:22:38 PM
On Nov 30, 1:23=A0am, Michele Simionato <michele.simion...@gmail.com>
wrote:

> In my articles I use Ikarus, not Chicken, because I am interested in
> R6RS, however I would not recommend Ikarus if
> you want to interface with C libraries on a Windows
> platform (Aziz can say more on this point, but I gather
> than Ikarus is developed on a Mac and requires a Unix-like
> platform like Cygwin to run on Windows).

That's all correct.  Ikarus requires Cygwin under Windows, and I do
develop it under Mac OS but I make sure it works equally well on all
Posix systems.


> Also, Ikarus is a pretty
> young implementation (we are currently at release 0.0.3).

Yes, it's younger than most of the 100 other implementations out
there.  I don't know what conclusions one can infer from that fact
alone.

Aziz,,,
0
aghuloum1 (171)
11/30/2008 6:31:26 PM
On Sun, 30 Nov 2008 12:46:42 +0000, Andrew Reilly wrote:

> On Sat, 29 Nov 2008 22:23:17 -0800, Michele Simionato wrote:
> 
>> For some reason, all the Pythonistas I know like Chicken.
> 
> I don't know about that.  I switched from Python to PLT.

I second that. Well, I did not really switch but rather use both and 
having quite a lot of fun. While Scheme does not deliver so many modules 
as Python has, PLT is pretty usable for many things.

regards,
Marek
0
marek1 (135)
11/30/2008 8:17:49 PM
> > I have a specific small program I'd like to translate to scheme (event
> > driven simulator for battery operated devices), but I'm not sure where
> > to go from here.
>
> Does that mean that you need a good interface with C?

Actually no, not yet.  If it turns out I like this language for
playing around, I may try to use it in an embedde environment where
I'll need to interface it to some lower level C functions.

My main motivation is that Python was slow and it felt like it was
trying too hard to be dynamic with everything, when really the program
itself was written without using a whole lot of python's dynamic
features.  In fact I wrote this little state simulator in the middle
of reading SICP and made it easy to try to use tail calls to jump from
one state to another.  I just need to comment out a few lines and it
should be tail-callable.  I think all the function jumping around,
heirarchy lookups, and [].appending to log the 100k-or-so state
transitions and voltage/current diagrams was slowing it down
considerably, even with psyco, which as i understand greatly speeds up
local computations.

>
> > I was unable to find in SICP a direct translation for some of the
> > pythonic idioms and features I've come to like: classes (including
> > heirarchy and stuff), iterators, list comprehensions, modules, step-by-
> > step debugging, profiling, etc. =A0I have come to understand these
> > things must be built up from atomic scheme things, and exist in
> > various modules and stuff.
>
> All those things exist but they are
> very much implementation-dependent.

Yes that's what I've been able to gather.


> > I have come across meroon for classes, but I'm not sure where else to
> > go from here. =A0
>
> Certainly there is a portability issue. You must choose
> an implementation and stick with it.

Ok, that's also the response I'm getting back in this thread.

>
> > THis is mostly on Windows platform.
> Do you need a Scheme running on .NET?

Atually no.  Even though this is for fun/hobby, I'm doing much of this
at work and/or on my work laptop because it's convenient, and the work
environment is most definitely 100% windows to the bone.  I don't
need .net for this.  For that actually ironpython looks interesting,
sort of, but I think for .net learning I should probably learn C# in
its "native" environment.


> > Can someone please provide wise guidance in where to go from here?

> consider Chicken instead.
> For some reason, all the Pythonistas I know like Chicken.
> http://chicken.wiki.br/chicken-for-python-programmers
....
I will check out these links.


Thanks
michael
0
5lvqbwl02 (39)
12/1/2008 9:28:52 PM
On Nov 30, 4:13=A0am, Max Hailperin <m...@gustavus.edu> wrote:
> 5lvqbw...@sneakemail.com writes:
>
> ...
>
> > I would not have understood what's going with SICP had I not already
> > had a pretty decent understanding of Python, however going through
> > that book showed me some weaknesses in some of python's semantics ...
> > to do with where variables are bound, scope, and that sort of thing
> > (eg SICP models state with lambdas, ["static" variables in C], but in
> > python you have to use a mutable list for the same thing, even for a
> > single variable, which seems kind of dirty).
>
> If you are talking about the same Python weakness I'm thinking of,
> this particular limitation of Python is lifted in version 3.0,
> scheduled to be relased real soon now. =A0By using the keyword
> "nonlocal", an inner procedure will now be able to assign a new value
> to a variable bound in an outer procedure. =A0-max

Yes, that is the weakness.  I think I remember reading that about 3.0,
but not *all* of the stuff I usually use with python is available in
3.0 (pyVisa, matplotlib and its dependencies, wxWidgets), so I've
stayed away until things catch up.


0
5lvqbwl02 (39)
12/1/2008 9:30:38 PM
On Nov 30, 4:48=A0am, Jens Axel Soegaard
<findrealaddresswithgoo...@soegaard.net> wrote:
> 5lvqbw...@sneakemail.com wrote:
> > I've narrowed my choices down to PLT scheme and
> > Gambit-C. =A0PLT because it looks like it's designed for learning and
> > has the HTDP book associated with it,
>
> It is a misperception (unfortunately not uncommon among non-schemers)
> that PLT is for learning only.

Well, my ideas/programs won't ever leave the confines of my laptop,
and it's mostly for fun/learning anyway, so for instance I found the
little graphical squares thing in one of the tutorials fun to do.
Very integrated.  I'm eager to read this HTDP and compare it to SICP,
and see how my brain absorbs that with existing python knowledge.

>
> I suggest you try both PLT Scheme (and in particular DrScheme) and
> Gambit for, say, a week each and see which one appeals to you the
> most.
>
> Also, join the mailing lists for PLT Scheme and Gambit - there
> will always be small things that you need help for. If something
> from Pythin is missing in either implementation odds are that
> the concept is simply called a different name in Scheme.
>
> =A0 =A0http://list.cs.brown.edu/mailman/listinfo/plt-scheme/
> =A0 =A0https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>

Thanks for the reply.

0
5lvqbwl02 (39)
12/1/2008 9:32:33 PM
On Nov 30, 9:22=A0am, William D Clinger <cesur...@yahoo.com> wrote:
> michael wrote:
> > Can I run the exact same source code on both PLT and
> > gambit,
>
> Yes, provided you write portable R5RS code and are careful
> to avoid implementation-dependent extensions.
>
> > including libraries and modules?
>
> Probably not. =A0So far as I know, Gambit does not yet
> support R6RS/ERR5RS libraries, which are the only portable
> form of libraries that PLT supports.
>
> > What about step-by-step debugging? =A0Profiling?
>
> Those are implementation-dependent, but they don't affect
> your source code so the implementation dependence doesn't
> reduce portability.
>
> > This is mostly on Windows platform.
>
> You might want to consider Larceny as well as Gambit and
> PLT. =A0Both Larceny and PLT give you the option of writing
> R5RS or R6RS code; in addition, Larceny provides an ERR5RS
> mode, which amounts to an interactive read/eval/print loop
> that lets you mix R5RS and R6RS code. =A0Gambit is R5RS-only
> with implementation-specific extensions.
>
> All three (Gambit, PLT, Larceny) have decent interfaces to
> C, but your interface code will be implementation-specific.
>
> Some more detailed comments regarding portability of other
> features you mentioned:
>
> classes: =A0Meroon and TinyCLOS are just two of many class
> systems you could use. =A0I believe Meroon has been written
> in mostly R5RS-portable code [1]. =A0For portability, you'll
> need to ignore implementation-specific class systems.
>
> iterators: =A0The Iterator design pattern is trivial to
> implement in Scheme, but I would recommend you try to
> use the Functional Visitor pattern instead, which is more
> idiomatic in Scheme and has some support from the standard
> R5RS and R6RS libraries (e.g. for-each, fold/reduce, map,
> vector-map).
>
> list comprehensions: =A0Again, this is easy to implement
> in Scheme. =A0See e.g. SRFI 42 [2].
>
> modules: =A0R6RS/ERR5RS libraries are the only portable way
> to go, and they are seldom available outside of R6RS and
> ERR5RS systems. =A0For portability, you'll need to avoid the
> many implementation-specific module systems.
>
> Will
>
> [1]http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/Meroon.html
> [2]http://srfi.schemers.org/srfi-42/

Thanks for the reply.  I'll have to go and figure out the differences
with r5rs, r6rs, and err5rs...At this point I think I'm still at the
"very basics" stage with getting used to the syntax and basic idioms
with scheme.  Perhaps I'll concern myself with portability later.

Fortunately I can run both PLT and Gambit directly from my text editor
so it's easy to check if things work.

Michael
0
5lvqbwl02 (39)
12/1/2008 9:34:47 PM
On Nov 30, 12:17=A0pm, Marek Kubica <ma...@xivilization.net> wrote:
> On Sun, 30 Nov 2008 12:46:42 +0000, Andrew Reilly wrote:
> > On Sat, 29 Nov 2008 22:23:17 -0800, Michele Simionato wrote:
>
> >> For some reason, all the Pythonistas I know like Chicken.
>
> > I don't know about that. =A0I switched from Python to PLT.
>
> I second that. Well, I did not really switch but rather use both and
> having quite a lot of fun. While Scheme does not deliver so many modules
> as Python has, PLT is pretty usable for many things.
>
> regards,
> Marek

Thanks to all who responded.  Sounds like PLT is a good choice.

How easy/possible is it to generate PLT->C code to run on a CPU
without an OS (ie a cheap embedded micro with ~10s of MB memory?)
More of a curiosity question than anything I need at this exact
moment.

thanks
Michael
0
5lvqbwl02 (39)
12/1/2008 9:44:29 PM
5lvqbwl02@sneakemail.com wrote:

> How easy/possible is it to generate PLT->C code to run on a CPU
> without an OS (ie a cheap embedded micro with ~10s of MB memory?)
> More of a curiosity question than anything I need at this exact
> moment.

Not easily, but if you know what you are doing (and Flatt belongs
to that group) it is possible:

Scroll down to Flatt's message from 19 Dec 1998.

http://lists.tunes.org/archives/lispos/1998-December/002514.html

Note: This was a long time ago, so the OS Kit is no longer
       supported.

These days other (smaller) implementations are better choices
for this sort of thing.

For a more serious answer look for PIC papers on readscheme.org.

http://library.readscheme.org/servlets/search.ss?kwd=pic&en=Enter

-- 
Jens Axel S�gaard
0
12/1/2008 10:24:32 PM
On Dec 1, 1:44=A0pm, 5lvqbw...@sneakemail.com wrote:
> Thanks to all who responded. =A0Sounds like PLT is a good choice.

If you're finding that Python doesn't have enough support for some of
the "functional" things you want to do (for example, you mentioned
needing tail calls in a complex state machine), PLT Scheme is a good
choice.  PLT Scheme definitely lacks some things that you're probably
used to from Python.  For example, PLT Scheme doesn't have native
support for extensible vectors (what Python calls "lists"), and
doesn't have convenient syntax for Python-like generators.  Some of
these things are available as libraries, or as you get more
experienced with Scheme, you can customize it all you want and make
your own Python-like libraries (that's what I did).

But I notice you did say that a big part of your reason to switch was
Python's performance.  PLT Scheme is a bit faster than Python, but not
much faster.

For these reasons, you may want to look at Clojure, a new dialect of
lisp.  Clojure has built-in data structures that correspond to
Python's (extensible vector (like Python's lists), hash map (like
Python's dictionary), sets (like Python's sets), lazy sequences (can
be used like Python's generators)), and it's fast.
0
12/2/2008 8:53:18 PM
On Tue, 02 Dec 2008 12:53:18 -0800, puzzler wrote:

> PLT Scheme definitely lacks some things that you're probably
> used to from Python.  For example, PLT Scheme doesn't have native
> support for extensible vectors (what Python calls "lists"), and doesn't
> have convenient syntax for Python-like generators.  Some of these things
> are available as libraries, or as you get more experienced with Scheme,
> you can customize it all you want and make your own Python-like
> libraries (that's what I did).

The question is whether it is useful to have mutable lists. If you want 
to program Python in Scheme, sure, but if you want to program in Scheme 
like a Schemer would, probably not so much.

Not to mention that PLT has a dialect called Lazy Scheme where you can 
probably get something similar to generators on a much bigger level. I 
have only tried it once so don't ask me for experience with that.

regards,
Marek
0
marek1 (135)
12/2/2008 10:17:57 PM
On Mon, 01 Dec 2008 13:28:52 -0800, 5lvqbwl02 wrote:

> My main motivation is that Python was slow

Scheme implementations are not really famous for being, uhm, fast. There 
is Stalin which compiles a subset of current Scheme (R4RS afair) to fast 
code, but usually Scheme programs are not really about speed.

> For that actually ironpython looks interesting, sort of,
> but I think for .net learning I should probably learn C# in its "native"
> environment.

Or learn Nemerle. Although the .NET CLR was designed with multiple 
languages most of the really interesting languages are running on the 
JVM. At least, the most interesting to me.

regards,
Marek
0
marek1 (135)
12/2/2008 10:21:57 PM
Marek Kubica wrote:
> On Mon, 01 Dec 2008 13:28:52 -0800, 5lvqbwl02 wrote:
> 
>> My main motivation is that Python was slow
> 
> Scheme implementations are not really famous for being, uhm, fast.

Opinions differ here but are in a spectrum spanning two extrema:

   1. Speed doesn't matter for anything we do.
   2. Features/conveniences don't matter for anything we do.

Scheme implementors, being Scheme users themselves, have opinions
that fall somewhere in that range.  The implementations of Scheme
then, naturally, vary along the same spectrum to serve the varying
needs.

Scheme implementations are famous for being everything: very fast,
easy to learn, full-featured, very small and embeddable, solid and
monolithic, customizable, interpret, evaluate, and compile your code
incrementally, or as whole program, to produce native machine code,
C code, Java, .Net, or assembly for your intel, powerpc, sparc, arm,
and motorola processor, et cetera et cetera.

Except that no implementation would have *all* of that of course.

Aziz,,,
0
aghuloum4132 (311)
12/3/2008 2:24:50 AM
On Dec 2, 2:17=A0pm, Marek Kubica <ma...@xivilization.net> wrote:
> On Tue, 02 Dec 2008 12:53:18 -0800, puzzler wrote:
> > PLT Scheme definitely lacks some things that you're probably
> > used to from Python. =A0For example, PLT Scheme doesn't have native
> > support for extensible vectors (what Python calls "lists"),
> The question is whether it is useful to have mutable lists. If you want
> to program Python in Scheme, sure, but if you want to program in Scheme
> like a Schemer would, probably not so much.

I agree that immutability is preferable.  But it is useful in *any*
language to have growable collections with fast access to any
particular element.  Scheme doesn't have this (built-in).  Vectors are
fixed in size, and require mutation to manipulate.  So if you want to
convert a function from working on lists to working on vectors, it
requires a major overhaul.  Vectors are not pleasant to work with in
Scheme.  And lets face it, you can't do *everything* with lists.
That's one of the reasons I've been working more with Clojure.  It has
a very useful range of data structures (like Python), all immutable
(like Scheme's lists), and all obeying the same kind of collection
interface, so you can manipulate vectors using first and rest, for
example, just like lists.  Quite slick.  Check it out.

(And really, I'm not trying to knock PLT Scheme here.  I use PLT
Scheme on an almost daily basis, and it is a very important tool in my
toolbox of programming languages.  But I really think Clojure might be
a better fit for the original poster's needs.)
0
12/3/2008 2:28:37 AM

On Tue, 2 Dec 2008, Marek Kubica wrote:

> On Mon, 01 Dec 2008 13:28:52 -0800, 5lvqbwl02 wrote:
>
>> My main motivation is that Python was slow
>
> Scheme implementations are not really famous for being, uhm, fast.

Actually, they are. There are a number of Schemes which are
more or less extremely fast, such as bigloo, chez, gambit,
larcency, mit-scheme, and stalin.

0
12/3/2008 2:27:09 PM

On Wed, 3 Dec 2008, Kjetil S. Matheussen wrote:

>
>
> On Tue, 2 Dec 2008, Marek Kubica wrote:
>
>> On Mon, 01 Dec 2008 13:28:52 -0800, 5lvqbwl02 wrote:
>> 
>>> My main motivation is that Python was slow
>> 
>> Scheme implementations are not really famous for being, uhm, fast.
>
> Actually, they are. There are a number of Schemes which are
> more or less extremely fast, such as bigloo, chez, gambit,
> larcency, mit-scheme, and stalin.
>

And of course ikarus. I probably forgot others too.

0
12/3/2008 2:29:26 PM
On 3 dez, 12:29, "Kjetil S. Matheussen" <k.s.matheus...@notam02.no>
wrote:
> On Wed, 3 Dec 2008, Kjetil S. Matheussen wrote:
>
> > On Tue, 2 Dec 2008, Marek Kubica wrote:
>
> >> On Mon, 01 Dec 2008 13:28:52 -0800, 5lvqbwl02 wrote:
>
> >>> My main motivation is that Python was slow
>
> >> Scheme implementations are not really famous for being, uhm, fast.
>
> > Actually, they are. There are a number of Schemes which are
> > more or less extremely fast, such as bigloo, chez, gambit,
> > larcency, mit-scheme, and stalin.
>
> And of course ikarus. I probably forgot others too.

I tried Bigloo, Gambit, and Stalin. However, I am curious about
larceny, ikarus, and chez. In general, Bigloo and Stalin generate code
that is almost as fast as C code, sometimes faster. I do most of my
homeworks in Scheme, and so does Junia (she is a grad student, I am an
undergrad). Our programs are always faster than the programs written
in C, Java, or Pascal by our classmates.

I wonder whether Larceny, Chez and Ikarus are as fast as Bigloo and
Stalin. Unhappily I cannot experiment with Ikarus and Chez myself for
the following reasons:

1 --- Chez is not free,  and I have other plans for my money, like
travelling to China to improve my Mandarin, or to Thailand to train
Muay Thai.

2 --- For the time being, there is no Ikarus port to MinGW.

I would appreciate if someone could tell me how fast are Ikarus and
Chez, as compared with Stalin, Bigloo, and C. The benchmark could be a
program to solve linear systems:

;; Compile: bigloo -Obench -farithmetic -O3 matb.scm -o matb.exe

(module example
   (main main)
   (option (set! *genericity* #f))
   (extern
          (macro printf::int (::string ::double) "printf")
          (clock::int () "clock") ))

(define iii 0)

(define-macro ($ v i j)
   `(f64vector-ref (vector-ref ,v ,i) ,j))

(define-macro ($! v i j val)
   `(f64vector-set! (vector-ref ,v ,i) ,j ,val))

(define (prt m r c)
   (do ( (i 0 (+ i 1)) ) ( (>= i r) )
      (newline)
      (do ((j 0 (+ j 1)) )  ( (>= j c) )
         (printf " %4.3f " ($ m i j) ) )))


(define (make-system r)
  (let* ( (c (+ r 1))
          (m (make-vector r) )
          (xx 0.0)
          (s 0.0) )

    (do ( (i 0 (+ i 1))  ) ( (>= i r) m)
       (vector-set! m i (make-f64vector c) )
       (set! s 0.0)
       (do ((j 0 (+ j 1) ) ) ( (>= j r) ($! m i j  s) )
          (set! xx (fixnum->flonum (random 3873)))
          (set! s (+fl s xx))
          ($! m i j xx )) )  ))


(define-macro (!= x y)
   `(not (= ,x ,y)))


(define (swapit m k l)
  (set! iii (+ iii 1))
  (let ((t (vector-ref m k)))
    (vector-set! m k (vector-ref m l))
    (vector-set! m l t)))

(define (find-max m c k i)
    (do ( (l (+fx k 1) (+fx l 1)) )
        ( (>=fx l (-fx c 1)) (when (!= i k)  (swapit m k i )) )
      (when (>fl (abs ($ m l k)) (abs ($ m i k)) )
            (set! i l) )  ))

(define (solvit m r)
   (let ( (c (+fx r 1))
           (rat 0.0)
           (mkk 0.0))

      (do ( (k 0 (+fx k 1)) ) ( (>= k (- r 1)))
        (find-max m c k k)
        (set! mkk ($ m  k k) )
        (let ( (mk (vector-ref m k)) )
          (do ( ( i (+ k 1)(+ i 1)) ) ( (>= i r))
             (set! rat (/fl  ($ m i k) mkk  ))
             (let ((mi (vector-ref m i)))
               (do ( (j  k  (+ j 1))) ( (>= j c) )
                 (f64vector-set! mi j (-fl (f64vector-ref mi j)
                                         (*fl rat (f64vector-ref mk
j ) ) ) )
               )
             )
          )
        )
       )

     (do ( (i (- r 1) (- i 1) ) ) ((< i 0) m)
       (let ( (mi (vector-ref m i)))
        (do ( (j (+ i 1) (+ j 1))
              (tx 0.0 (-fl tx (*fl (f64vector-ref mi j)
                               ($ m j r    )) )) )
            ( (>= j r)
              (f64vector-set! mi r
                 (/fl (+fl (f64vector-ref mi r ) tx)
                       (f64vector-ref mi i)) ) ) )
       )
     )
   )
)


(define (main argv)
   (let* ( (r 2000) (c 2001) (m (solvit (make-system r) r) ) )
      (do ( (i 0 (+ i 1))) ( (>= i 10) )
          (printf " %4.3f " ($ m i r) )  )
   (newline) (display "Bigloo time= ") (display (clock))
   (newline) (print "Number of swaps= " iii)) )


Here is the C program:

#include <stdio.h>
#include <math.h>
#include <time.h>

double** makearray(int row,int col) {
  double **v;
  int i,j;
  v=(double **)malloc(row*sizeof(double *));
  for(i=0;i<row;i++){
    *(v+i)=(double *)malloc(col*sizeof(double));
  }

  for(i=0;i<row;i++){
	  for(j=0;j<col;j++)
      v[i][j]=0;}
  return(v);
}

double **make_system(int r) {
	double **m;
	double s;
	int i, j;
	int c= r+1;
	m= makearray(r, c);
	for (i=0; i<r;i++){
		for (j=0;j<c;j++) {
			m[i][j]= (double)rand();
		}
	}
	for (i=0;i<r;i++) {
		s= (double) 0.0;
		for (j=0;j<r;j++) {
			s= s+m[i][j];
		}
		m[i][j]= s;
	}
	return(m);
}

void prt(double **m, int r) {
	int c= r+1;
	int i, j;
	for (i=0; i<r; i++) {
		printf("\n");
		for(j=0; j<c; j++){
			printf(" %4.3f ", m[i][j]);
		}
	}
}


void prt_sol(double **m, int r, int p) {
	int c= r+1;
	int i, j;
	for (i=0; i<p; i++) {
			printf(" %4.3f ", m[i][r]);
		}
}

int iii=0;

void swapit(double **m, int c, int k, int l) {
	double t;
	int j;
	iii= iii+1;
	for (j=0; j<c; j++) {
	   t= m[k][j];
	   m[k][j]= m[l][j];
	   m[l][j]= t;
	}
}

void find_max(double **m, int c, int k, int i) {
	int l;
	for (l=k+1; l < c-1; l++) {
	   if (abs(m[l][k]) > abs(m[i][k]) ) {
	      i= l;
	   }
	}
	if (i != k) swapit(m, c, k, i);
}



double **solvit(double **m, int r) {
	int c= r+1;
	int k, i, j, l;
	double rat, tx;

	for (k=0; k< r - 1; k++) {
	  find_max(m, c, k, k);
	  for (i=k+1; i<r;i++){
	    rat= m[i][k]/m[k][k];
	    for(j=k;j<c;j++){
		   m[i][j]= m[i][j]- rat*m[k][j];
		}
	  }
	}

	for(i=r-1;i>=0;i--){
	tx = (double)0.0;
	   for(j=i+1;j<r;j++){
	     tx= tx-m[i][j]*m[j][r];
	   }
	   m[i][r]= (m[i][r] + tx)/m[i][i];
	}
	return(m);
}



int main() {
	double **m;
        m= make_system(2000);
        prt_sol(solvit(m, 2000), 2000, 10);
	//prt(m, 3);
	printf("\n\ngcc CPU-Time=%ld\nNumber of swaps=%d\n", clock(), iii);
    return 0;

}



0
phi500ac (129)
12/4/2008 4:08:34 AM
On Dec 2, 12:53=A0pm, puzzler <mark.engelb...@gmail.com> wrote:
> On Dec 1, 1:44=A0pm, 5lvqbw...@sneakemail.com wrote:
>
> > Thanks to all who responded. =A0Sounds like PLT is a good choice.
>
> If you're finding that Python doesn't have enough support for some of
> the "functional" things you want to do (for example, you mentioned
> needing tail calls in a complex state machine), PLT Scheme is a good
> choice. =A0PLT Scheme definitely lacks some things that you're probably
> used to from Python. =A0For example, PLT Scheme doesn't have native
> support for extensible vectors (what Python calls "lists"), and
> doesn't have convenient syntax for Python-like generators. =A0Some of
> these things are available as libraries, or as you get more
> experienced with Scheme, you can customize it all you want and make
> your own Python-like libraries (that's what I did).
>
> But I notice you did say that a big part of your reason to switch was
> Python's performance. =A0PLT Scheme is a bit faster than Python, but not
> much faster.
>
> For these reasons, you may want to look at Clojure, a new dialect of
> lisp. =A0Clojure has built-in data structures that correspond to
> Python's (extensible vector (like Python's lists), hash map (like
> Python's dictionary), sets (like Python's sets), lazy sequences (can
> be used like Python's generators)), and it's fast.

Hi, this sounds like something good to look into.  I just posted a
question concerning arrays and lists for exactly this reason.

My choice to move to scheme for performance is more the fact that
there are fast and c-compilable versions out there (elk, gambit,
stalin, etc), whereas there is pretty much only one python.
0
5lvqbwl02 (39)
12/7/2008 12:09:50 AM
On Dec 6, 4:09=A0pm, 5lvqbw...@sneakemail.com wrote:

> My choice to move to scheme for performance is more the fact that
> there are fast and c-compilable versions out there (elk, gambit,
> stalin, etc), whereas there is pretty much only one python.

Unfortunately, it's very hard to write cross-compatible Scheme code.
In practice, you'll probably find that most people pick one Scheme and
stick with it.  PLT Scheme, as others have pointed out, is one of the
most "complete" and friendly Schemes, but if you take advantage of all
its features, you won't be able to turn around and use the same code
on a c-compilable version.  It's speed is good, but not dramatically
better than Python's, IMO.

I tend to use Python for all my code with an imperative flavor,
because its convenient syntax for "lists" (really extensible vectors),
"dicts", slices, etc. are usually a big win.  I use PLT Scheme when I
need to do something with a more functional flavor.  Unfortunately, I
haven't yet found a "high-performance" language I like programming in
(usually I end up just using C++), although I'm currently trying out
Clojure and it seems very promising.
0
12/7/2008 1:20:18 AM
phi50 wrote:
> I would appreciate if someone could tell me how fast are Ikarus and
> Chez, as compared with Stalin, Bigloo, and C. The benchmark could be a
> program to solve linear systems:

You're more likely to get information if you post
a portable benchmark instead of using so many
Bigloo-specific features.

There is no simple answer to the question "how fast
are X and Y as compared with A, B, and C."  Your
linear systems benchmark, for example, is likely
to give you a good idea of a system's performance
on floating-point arithmetic.  That's great if
your intended uses of Scheme make heavy use of
floating-point arithmetic.  If not, then your
benchmark won't tell you anything useful.

Bigloo, Gambit, and Stalin have good floating
point performance, as measured by more portable
benchmarks such as nucleic and fft.  Ikarus and
Chez aren't as fast on floating	point benchmarks,
but they're faster than	Larceny.  I would expect
all six	to be faster than PLT Scheme on	that kind
of benchmark.

On other kinds of benchmarks, those ratings might
be reversed.  You can get some idea of the issues
from looking at	some of the benchmark results that
have been posted online	[1,2].	You won't find a
simple answer to your question,	however.

Will

[1] http://www.ccs.neu.edu/home/will/Twobit/benchmarks.html
[2] http://www.iro.umontreal.ca/~gambit/bench.html
0
cesura17 (520)
12/7/2008 3:45:11 PM
Reply:

Similar Artilces:

to Scheme or not to Scheme..
I go through SICP book trying to do it's exercises. Some people recommend to use Scheme for that, so at first I started using Scheme. After a week of frustration I switched back to Common Lisp and I enjoy it and make better progress. I guess I don't have to do the exercises by the letter, but I need to learn general principles. What do you think? Bigos <ruby.object@googlemail.com> writes: > I guess I don't have to do the exercises by the letter, but I need to > learn general principles. What do you think? Generally speaking, that is true, though some e...

Scheme reader (in Scheme)?
Hi, does anyone know of a Scheme reader in Scheme (for the purpose of bootstrapping an implementation, of course)? I.e. something that would build on read-char and perhaps peek-char to provide read ? I know it's not that hard to write the reader, but who knows, maybe I'm overlooking some great piece of work that even has support for the various reader extension SRFI's... Thanks, Dan Muresan vqgdiee02@sneakemail.com wrote: > Hi, does anyone know of a Scheme reader in Scheme (for the purpose of > bootstrapping an implementation, of course)? I.e. something that would > build on read-char and perhaps peek-char to provide read ? From Scheme48: scheme/rts/read.scm vqgdiee02@sneakemail.com skrev: > Hi, does anyone know of a Scheme reader in Scheme (for the purpose of > bootstrapping an implementation, of course)? I.e. something that would > build on read-char and perhaps peek-char to provide read ? > > I know it's not that hard to write the reader, but who knows, maybe > I'm overlooking some great piece of work that even has support for the > various reader extension SRFI's... Here is a start: <http://www.cs.indiana.edu/eip/compile/scanparse.html> -- Jens Axel S�gaard Dan Muresan wrote: > Hi, does anyone know of a Scheme reader in Scheme (for the purpose of > bootstrapping an implementation, of course)? I.e. something that would > build on read-char and perhaps peek-char to provide read ? Most of the...

scheme implementation written in scheme
Hello. I'd like to study/cannibalize an existing scheme implementation written in scheme. I can't determine from the scheme wiki which ones if any are written in scheme. Does anyone know of any, preferrably with a no-restrictions license? At the moment I'm primarily interested in the macro expander - I'm looking for scheme code that just expands a darn R5RS-compliant macro into the equivalent scheme code s-expression, no extensions, no weird symbols in the s-exp, just the exact equivalent of cl's expandmacro-1, that could then be further macro-expanded or compiled into working scheme code. I didn't find alexpander sufficient. - Jake The only implementation I am aware of is Scheme48: http://www.s48.org/index.html jake skrev: > Hello. I'd like to study/cannibalize an existing scheme > implementation written in scheme. I can't determine from the scheme > wiki which ones if any are written in scheme. Does anyone know of > any, preferrably with a no-restrictions license? <http://www.cs.indiana.edu/eip/compile/> Also get "Lisp in Small Pieces" either at the library or a bookstore. -- Jens Axel S�gaard On 2007-08-02 09:10:25 -0500, jake <jacob.miles@gmail.com> said: > At the moment I'm primarily interested in the macro expander - I'm > looking for scheme code that just expands a darn R5RS-compliant macro > into the equivalent scheme code s-expression, no extensions, no weird > sy...

why not the scheme implementation written in scheme?
Hi. why are almost all of implementatin of scheme written in c? is it possible to write a not very slow scheme compiler & intepreter in scheme-- not toy, but a real implementation? I'm writing a scheme->llvm compiler in scheme as a toy. I don't know whether it is possible to make it as a real compiler. -- Thanks & Regards Changying Li There are various reasons. In case of Gauche, it's because one of my goal was interoperability with C, specifically that I wanted to use core part of Gauche as "convenient list processing library" from C. It is certainly possible to write a real implementation in Scheme. Take a look at Scheme48, for example. (Its core part is written in subset of Scheme which can be compiled to native code via C. Other things are built on top of it.) --shiro On 3$B7n(B24$BF|(B, $B8a8e(B4:36, Changying Li <lchangy...@gmail.com> wrote: > Hi. > why are almost all of implementatin of scheme written in c? > is it possible to write a not very slow scheme compiler & intepreter in > scheme-- not toy, but a real implementation? > > I'm writing a scheme->llvm compiler in scheme as a toy. I don't know whether it > is possible to make it as a real compiler. > > -- > > Thanks & Regards > > Changying Li Changying Li <lchangying@gmail.com> writes: > why are almost all of implementatin of scheme written in c? > is it possible to write a not ve...

Learning Scheme with PLT Scheme
What is the best book to use when learning Scheme with the latest PLT download? Robert On Fri, 31 Jul 2009 15:21:23 -0400, Robert Hicks <sigzero@gmail.com> wrote: > What is the best book to use when learning Scheme with the latest PLT > download? Us whatever book fits your needs, and PLT will likely work for you. SICP, TSPL, The Little Schemer, HtDP, &c. are all good books, and you can use PLT Scheme with each of them. Aaron W. Hsu -- Of all tyrannies, a tyranny sincerely exercised for the good of its victims may be the most oppressive. -- C. S. Lewis On Jul 31, 3:13=A0pm, "Aaron W. Hsu" <arcf...@sacrideo.us> wrote: > On Fri, 31 Jul 2009 15:21:23 -0400, Robert Hicks <sigz...@gmail.com> wrot= e: > > What is the best book to use when learning Scheme with the latest PLT > > download? > > Us whatever book fits your needs, and PLT will likely work for you. SICP,= =A0 > TSPL, The Little Schemer, HtDP, &c. are all good books, and you can use = =A0 > PLT Scheme with each of them. It is true. Each book has a different style, you should find the one that you like best. Robert Hicks <sigzero@gmail.com> writes: > What is the best book to use when learning Scheme with the latest > PLT download? Besides the books that you got recommendation for, note that PLT comes with several documents that are intended for learning how to use the system. These are the first block of entries on the docum...

Scheme interpreter written in Scheme
Hi all! I'm looking for the sources of a scheme interpreter with a small core written, for example, in C and a library written in Scheme itself to provide r5rs compliance. In particular, I am interested in adding r5rs functionalities to an interpreter that doesn't have it. For example, it cannot accept more than one list for (map) and I think I can solve this problem simply using the (map) implementation from this library. Thank you in advance, Ignazio >>>>> "Ignazio" == neclepsio <neclepsio@hotmail.com> writes: Ignazio> I'm looking for the sources of a scheme interpreter with a small core Ignazio> written, for example, in C and a library written in Scheme itself to provide Ignazio> r5rs compliance. That isn't really the same as what you're saying in the Subject: header. The core of Scheme 48 is written in a subset of Scheme (with small parts---the OS interface and bignum arithmetic---in C), and almost all of the standard library is implemented in regular Scheme as well. Albeit, it already has almost full R5RS compliance. -- Cheers =8-} Mike Friede, V�lkerverst�ndigung und �berhaupt blabla "Michael Sperber" <sperber@informatik.uni-tuebingen.de> ha scritto nel messaggio news:y9l8yc3hsof.fsf@sams.informatik.uni-tuebingen.de... > That isn't really the same as what you're saying in the Subject: > header. The core of Scheme 48 is written in a subset of Scheme (with > small pa...

Needed: mergesort (disk-to-disk) in scheme; statical scheme code analyzer; scheme profiler
I am developing a code for symbolical computations (not general purpose) with quadratic surds and rationals, some thousand - thousand- a-half lines of GNU-MIT scheme, and I am encountering from time to time memory related errors as "Out of memory" and "Maximum recursion depth exceeded". An important part of my code deals with merging two sorted files, each line beeing a scheme object, into a unique sorted file. I am using no ready-made libraries. Maybe someone can help me in finding a library, defining a function that takes two input files, one output file and a predicate for comparing two elements, and manages the work by itself? Some other questions: Is there a way to extract a dependency graph from my rather spaghetti code? Is there a way to decide statically wheter my functions do really always behave as tail-recursive (as I intended)? Is there a way of profiling my scheme code, so that I can select the data on which my code behaves badly? Thanks in advance Alex ...

New Wraith Scheme, Pixie Scheme II, and Pixie Scheme III, and source available now.
Today I released version 2.14 of Wraith Scheme and version 1.01 of Pixie Scheme II. Today also, version 1.00 of Pixie Scheme III was released to the App Store. Wraith Scheme 2.14 is a shareware and open-source full R5 Scheme implementation for the Apple Macintosh, with enhancements for parallel processing, by which I mean multiple copies of the Wraith Scheme application (separate Unix processes) all running at once, sharing Scheme main memory. Wraith Scheme 2.14 is a full 64-bit Macintosh application, that only runs on Macintoshes with Intel processors that can execute 64-bit code, and that are running at least MacOS 10.6 (Snow Leopard). Wraith Scheme 2.14 fixes a few minor bugs and adds a few new utility procedures. See the "What's New" section of the Wraith Scheme Help File (available from the Help Menu within the application) for additional information. Pixie Scheme II 1.01 is a shareware and open-source Scheme implementation for the Apple Macintosh, which is almost R5: It is in great part a design prototype for a possible iPad implementation of Scheme, and since the iPad generally hides its underlying Unix file system from users, Pixie Scheme II does not have any of the R5 procedures for access to files. Pixie Scheme II does have many of the enhancements that Wraith Scheme has. Pixie Scheme II has a rather different graphical user interface than does Wraith Scheme, which is both more iPad-like and more like the graphical user interface of the origina...

New Wraith Scheme, Pixie Scheme II, and Pixie Scheme III, and source available now. #2
Today I released version 2.14 of Wraith Scheme and version 1.01 of Pixie Scheme II. Today also, version 1.00 of Pixie Scheme III was released to the App Store. Wraith Scheme 2.14 is a shareware and open-source full R5 Scheme implementation for the Apple Macintosh, with enhancements for parallel processing, by which I mean multiple copies of the Wraith Scheme application (separate Unix processes) all running at once, sharing Scheme main memory. Wraith Scheme 2.14 is a full 64-bit Macintosh application, that only runs on Macintoshes with Intel processors that can execute 64-bit code, and that are running at least MacOS 10.6 (Snow Leopard). Wraith Scheme 2.14 fixes a few minor bugs and adds a few new utility procedures. See the "What's New" section of the Wraith Scheme Help File (available from the Help Menu within the application) for additional information. Pixie Scheme II 1.01 is a shareware and open-source Scheme implementation for the Apple Macintosh, which is almost R5: It is in great part a design prototype for a possible iPad implementation of Scheme, and since the iPad generally hides its underlying Unix file system from users, Pixie Scheme II does not have any of the R5 procedures for access to files. Pixie Scheme II does have many of the enhancements that Wraith Scheme has. Pixie Scheme II has a rather different graphical user interface than does Wraith Scheme, which is both more iPad-like and more like the graphical user interface of the origina...

Scheme in Basic, Scheme-2-Basic
I'm looking for a scheme interpreter written in BASIC, preferable Visual Basic --- and most preferably Visual Basic for Applications. A Scheme to BASIC translator would also be great. I'm in an environment where I need to write some software and the only development environment I have is Microsoft Office Visual Basic for Applications. (The security 'droids have conclued that because MS Office is "standard," VBA must be "safe.") If you can help me please respond with a copy to pcolsen@comcast.net Engineer wrote: > I'm in an environment where I need to write some software and the only > development environment I have is Microsoft Office Visual Basic for > Applications. (The security 'droids have conclued that because MS > Office is "standard," VBA must be "safe.") Not exactly what you are asking for, but here is a way to call Scheme from VBA among other: <http://www.plt-scheme.org/software/mzcom/> --=20 Jens Axel S=F8gaard Thanks for the pointer. Unfortunately the only programming language to which I have access is VBA for Microsoft Office. Organization policy forbids "development" on my machine. Luckily the security 'droids don't consider writing VBA macros as "development." Anything I do must be bootstrapped from VBA. "Engineer" <pcolsen@comcast.net> writes: > Unfortunately the only programming language to which I have access is &...

Do scheme programmers *read* scheme programs?
Of course they do, but what I mean is the following: when I read a book, I internally "vocalize" the words as I read them, and to a large extent this is what I mean by "reading". When I read say a C program it is (for the most part) much of the same. When I see for(i=0;i<100;i++); I mentally vocalize "for eye equals zero, eye less than 100, eye plus plus" On the other hand, I find that even though I can read and even (sometimes) write short scheme programs I do so more as a problem in pattern recognition/understanding without (much) internal vocalization. As an experiment, I wrote a short VBScript program that takes any text file you feed it and reads it out loud line by line using a text-to-speech engine. When I feed it a short C program I can to some extend listen along and have at least some idea of the meaning of the code as I hear it. When I feed it a short scheme program the result strikes me as surreal- almost like a schizophrenic word salad. So my main question is: are experienced Scheme programmers just so much more fluent in the language that they get to the point that they can "read" it in close to the traditional sense, or are they engaged in a different sort of cognitive activity. This second possibility doesn't strike me as absurd: at one time "reading" meant reading out loud or at least with your lips moving, and the advent of silent reading seemed like a radical deperture. Maybe scheme programmers h...

Python and Scheme
A few folks I know (or know of) who like Scheme seem to really like Python, and vice versa. For folks who fall into either category, why is that the case? Grant Rettke escreveu: > A few folks I know (or know of) who like Scheme seem to really like > Python, and vice versa. A lot of folks I know who like Python seem to not really like many parentheses at all. :P > For folks who fall into either category, why is that the case? I like both. It's hard to come up with simpler, clearer and more straightforward syntax than Python's without getting cryptic like Perl or Ruby. OTOH, as many, I feel it to be like a simplified Lisp and you don't really get much in terms of applicative programming style, proper and convenient lexical scoping and lambdas, nor syntatic abstraction. Plus, those with a proper editor like Emacs, DrScheme or even vi come to enjoy very much the ease of hierachical/parenthetical editing and navigation of source code, while their whitespace-significant peers cry over their clumsy tools support for indenting... -- a game sig: http://tinyurl.com/d3rxz9 On Apr 22, 6:01=A0pm, Grant Rettke <gret...@gmail.com> wrote: > A few folks I know (or know of) who like Scheme seem to really like > Python, and vice versa. > > For folks who fall into either category, why is that the case? Scheme and Python are two languages with *very different* communities and philosophies. They have very little in common and I believe tha...

SchemEd
The author of SymLibEd, part of the circuit editor program SchemEd, says that to enable the program to be run on the Iyonix the Castle Toolbox Module should be replaced with the RO Toolbox. My Iyonix is stable and I find the thought of making this change unattractive. Are there any alternatives or am I worrying unneccessarily. Malcolm Smith -- T M Smith in North Yorkshire, England Using an Iyonix and RiscOS 5.11.3 In article <ff14ec124e.tmsmith@tmsmith.freeuk.com>, Malcolm Smith <tmsmith@freeuk.com> wrote: > The author of SymLibEd, part of the circuit editor program SchemEd, > says that to enable the program to be run on the Iyonix the Castle > Toolbox Module should be replaced with the RO Toolbox. > My Iyonix is stable and I find the thought of making this change > unattractive. > Are there any alternatives or am I worrying unneccessarily. You are worrying unnecessarily. John -- John Williams, Wirral, Merseyside, UK - no attachments to these addresses! Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject for reliable contact! Who is John Williams? http://www.picindex.info/author/ In article <ff14ec124e.tmsmith@tmsmith.freeuk.com>, Malcolm Smith <tmsmith@freeuk.com> wrote: > The author of SymLibEd, part of the circuit editor program SchemEd, > says that to enable the program to be run on the Iyonix the Castle > Toolbox Module should be replaced with the RO Toolbox. > ...

[Ann] dot-scheme: a PLT Scheme interface to .NET
Hi there, I have been working on a FFI for PLT Scheme and the .NET framework and I have reached a point were I think the code might be useful for others. If you are interested take a look at: http://www.rivendell.ws/dot-scheme Appended below is a MS SqlServer OLE-DB interface built on top of dot-scheme. This should give an idea of how dot-scheme can be used. Criticisms or insights are quite welcome. -pp ; dot-db provides access to OLE-DB databases through scheme ; use: ; `open-connection' to well, open a connection ; `close-connection' to close it ; `execute-sql' to execute queries against an open connection (module dot-db mzscheme (provide open-connection close-connection execute-sql) (require (lib "etc.ss") (lib "system.data.ss" "dot-net") (lib "dot-utils.ss" "dot-scheme")) (define-struct connection (obj)) ; (database server) -> connection ; opens a ole-db connection to `database' on `server' using integrated ; NT security. returns the ; opened connection object. (define (open-connection database server) ; ::ole-db-connection is a dot-scheme object that represents the ; OleDbConnection .NET data type. new is a procedure that invokes ; the .NET construtor for the specified type. Note that scheme ; strings are automatically transalated to their .NET counterparts. (let ((c (new ::ole-db-conne...

Interacting Scheme and Fortran; what is in store for Scheme in terms of scripting
Hia all Is there any reason why no one posts code showing how to use Scheme for scripting? I have never done any serious Unix scripting. However, recently a colleague shared his Fortran code with me. The Fortran program got all its input from a .sh script. For example: == .... while ( $MONTHCOUNT <= $NMONTH ) ../FORTAN_PROGRAM.out << EOF $YEARS[$YEARCOUNT] $MONTH[$MONTHCOUNT] $MONTHTAG[$MONTHCOUNT] $GOME $MODEL $OUT $LONMIN $LONMAX $LATMIN $LATMAX $HARDYEAR $FILE_TYPE EOF @ MONTHCOUNT ++ .... == How would that look like in Scheme? Is Bigloo capable of doing this? Or which Scheme might be a good .sh replacement? Thanks, Schneewittchen frankenstein <klohmuschel@yahoo.de> writes: > Hia all > > Is there any reason why no one posts code showing how to use Scheme > for scripting? > > I have never done any serious Unix scripting. However, recently a > colleague shared his Fortran code with me. The Fortran program got all > its input from a .sh script. > > > For example: > while ( $MONTHCOUNT <= $NMONTH ) > ./FORTAN_PROGRAM.out << EOF > $YEARS[$YEARCOUNT] > $MONTH[$MONTHCOUNT] > $MONTHTAG[$MONTHCOUNT] > $GOME > $MODEL > $OUT > $LONMIN > $LONMAX > $LATMIN > $LATMAX > $HARDYEAR > $FILE_TYPE > EOF > @ MONTHCOUNT ++ This is not a fortran script. This is a shell script. (csh I assume). > How would that look like in Scheme? Is Bigloo capable of doing this? > O...

Pixie Scheme III -- Scheme on the iPad (*NOT* a release notice...)
I gave a talk about my iPad Scheme implementation, Pixie Scheme III, locally in the San Francisco area a few weeks ago, and happened to see a little interest in it on the Internet, so thought I had better post something here: I *do* have an R5 Scheme running under iOS on the iPad. It includes all required features of R5 Scheme except for file-system access (since the iPad pretty much doesn't allow user access to the underlying Unix file system), plus numerous enhancements. Pixie Scheme III much resembles my Macintosh Scheme application, Wraith Scheme, though with more of an iPad style user interface. For further information about Wraith Scheme, see the Software page of my web site, whose home page is http://web.mac.com/Jay_Reynolds_Freeman Pixie Scheme III is *not* in the App Store at the moment. I am still chasing a few bugs and tweaking the user interface. I will quite likely submit it for approval within the next month or two, and if Apple accepts it, I will post here. If Apple does not accept it, it is possible that I will release source code anyway, so that Schemers who are also Xcode/iOS developers can install it themselves and have it to play with. Time will tell. Anyone who has specific questions is welcome to send me EMail. ...

getting set up to learn some scheme with mit scheme and sicp
I guess this si the most straightforward way to learn scheme I tried plt scheme, it was cool, scsh i could not make head nor tail of docs wise; but I heard that sicp is the best book for learning programming... gavino wrote: > I guess this si the most straightforward way to learn scheme > > I tried plt scheme, it was cool, scsh i could not make head nor tail of > docs wise; but I heard that sicp is the best book for learning > programming... How to Design Programs/PLT Scheme is a good combo as well. I got to ch4, and eyes glazed over. Was fun though. Scheme seems to make everything little chains of computations, kinda cool, and easy to define new procs..... sicp has been around longer no? gavino wrote: > I got to ch4, and eyes glazed over. > Was fun though. > Scheme seems to make everything little chains of computations, kinda > cool, and easy to define new procs..... > > sicp has been around longer no? > Yah, SICP has been around since early-80's I think. It's a much "heavier" book in terms of theory and technique. Bear Ray Dillinger <bear@sonic.net> writes: > gavino wrote: > > I got to ch4, and eyes glazed over. > > Was fun though. > > Scheme seems to make everything little chains of computations, kinda > > cool, and easy to define new procs..... > > sicp has been around longer no? > > > > Yah, SICP has been around since early-80's I think. >...

R5 release of Wraith Scheme (shareware scheme for Macintosh)
I have a new R5 release of Wraith Scheme, which is a shareware Scheme implementation for the Apple Macintosh, available for download from the "software" page of my personal web site: http://web.mac.com/Jay_Reynolds_Freeman What follows are portions of the "README" file for the current distribution. This "README" file accompanies the fourth release of Wraith Scheme, version 1.20, release date 8 June, 2007. Wraith Scheme is an implementation of the "R5" version of the Scheme programming language for the Apple Macintosh (trademark). Wraith Scheme was written by me, Jay Reynolds Freeman, and is copyright Jay Reynolds Freeman, 2007. Wraith Scheme is shareware: You are welcome to use Wraith Scheme for free, forever, and to pass out free copies of it to anybody else. If you would like to make a shareware donation for it, that's fine, and there is information in the program about how to go about it, but in no sense do I request, insist, or expect that you do so. [...] System Requirements: Wraith Scheme requires an Apple Macintosh running OS X 10.4 or later. The application takes up about 2.3 MByte of storage on disk, and can run usefully in as little as 10 MByte of memory. Wraith Scheme is Universal Binary (trademark), and should run equally well on Macintoshes using Intel microprocessors and on Macintoshes using PowerPC (t...

how to run script with umb-scheme and have scheme exit afterwards?
I am brand new to scheme. How to I run a file, call it temp.scm, and have umb-scheme not leave me at a umb-scheme prompt? jani@persian.com (Jani Yusef) wrote in message news:<d3be1825.0407191806.74bb860b@posting.google.com>... > I am brand new to scheme. How to I run a file, call it temp.scm, and > have umb-scheme not leave me at a umb-scheme prompt? I can't answer your question, but .... Have you considered using another implementation? My impression is that umb-scheme is a toy Scheme and is not widely used (although, for some unfathomable reason, it often comes with Linux distributions). For newbies, DrScheme (http://www.drscheme.org/) is usually a good recommendation. -- G. ...

Wraith Scheme 2.15 released, also Pixie Schemes ...
Today I released version 2.15 of Wraith Scheme and version 1.02 of Pixie Scheme II. Today also, version 1.01 of Pixie Scheme III was released to the App Store. Wraith Scheme 2.15 is a shareware and open-source full R5 Scheme implementation for the Apple Macintosh, with enhancements for parallel processing, by which I mean multiple copies of the Wraith Scheme application (separate Unix processes) all running at once, sharing Scheme main memory. Wraith Scheme 2.15 is a full 64-bit Macintosh application, that only runs on Macintoshes with Intel processors that can execute 64-bit code, and that are running at least MacOS 10.6 (Snow Leopard). Wraith Scheme 2.15 contains enhancements that provide a number of pushbuttons, sliders, sense switches, and level indicators, for user-programmable input/output. Pixie Scheme II 1.02 is a shareware and open-source Scheme implementation for the Apple Macintosh, which is almost R5: It is in great part a design prototype for a possible iPad implementation of Scheme, and since the iPad generally hides its underlying Unix file system from users, Pixie Scheme II does not have any of the R5 procedures for access to files. Pixie Scheme II does have many of the enhancements that Wraith Scheme has. Pixie Scheme II has a rather different graphical user interface than does Wraith Scheme, which is both more iPad-like and more like the graphical user interface of the original Pixie Scheme, more than twenty years ago. I think it is rather cute. Pix...

"The Scheme Programming Language", 3rd ed.
I'm thinking of buying Dybvig's TSPL, 3rd edition. Before doing so I want to confirm this edition is based on R5RS. I would expect that to be the case based on the publication date, but the book's page at MIT press mentions only the "revised report" without saying if it is R5 or R4 (like the second edition.) Thanks, Roberto Waltman [ Please reply to the group, return address is invalid ] Roberto Waltman wrote: > I'm thinking of buying Dybvig's TSPL, 3rd edition. > Before doing so I want to confirm this edition is based on R5RS. > I would expect that to be the case based on the publication date, but > the book's page at MIT press mentions only the "revised report" > without saying if it is R5 or R4 (like the second edition.) The book is based on R5RS and is freely available on the net at: http://www.scheme.com/tspl3 You can look before you buy. Aziz,,, Abdulaziz Ghuloum wrote: >The book is based on R5RS and is freely available on the net at: > http://www.scheme.com/tspl3 Thank you, Roberto Waltman [ Please reply to the group, return address is invalid ] ...

scheme code from "exploring computer science with scheme"
does anyone have or know of a link where the code from the book "exploring computer science with scheme" can be downloaded? The link given in the book no longer exists. kelly "Gary Kelly" <garykelly@earthlink.net> writes: >does anyone have or know of a link where the code from the book "exploring >computer science with scheme" can be downloaded? The link given in the book >no longer exists. I don't know if this is all the code from the book, but look here: http://inst/~instcd/inst-cd/classes/cs3s/index.html for the support files needed to use the book. bh@abbenay.CS.Berkeley.EDU (Brian Harvey) writes: > I don't know if this is all the code from the book, but look here: > > http://inst/~instcd/inst-cd/classes/cs3s/index.html > > for the support files needed to use the book. I wouldn't be surprised if that URL worked for Brian, given his e-mail address, but for the rest of us, it's: http://www-inst.eecs.berkeley.edu/~instcd/inst-cd/classes/cs3s/index.html -- Prabhakar Ragde, Professor plragde at uwaterloo dot ca Cheriton School of Computer Science http://www.cs.uwaterloo.ca/~plragde Faculty of Mathematics DC 1314, (519)888-4567,x4660 University of Waterloo Waterloo, Ontario CANADA N2L 3G1 Prabhakar Ragde <plragde@uwaterloo.removethis.ca> writes: >http://www-inst.eecs.berkeley.edu/~instcd/inst-cd/classes/cs3s/ind...

Wraith Scheme and Pixie Scheme III have new web site.
I am the developer and supporter of Wraith Scheme (for the Macintosh) and of Pixie Scheme III (for the iPad). As of today, with Apple phasing out support for web sites, they have new homes on my new web site: Main Web Site: http://JayReynoldsFreeman.com Software Page (with links to apps I support): http://JayReynoldsFreeman.com/My/Software.html Sorry for the inconvenience. -- Jay Reynolds Freeman --------------------- Jay_Reynolds_Freeman@mac.com http://JayReynoldsFreeman.com (personal web site) ...

Any special support for SICP in GNU/MIT Scheme or PLT Scheme?
Is there support for any Scheme quirks in "Structure and Interpretation of Computer Programs"? Is there support for restricting students to only the subset of the language that they need (No set! before chapter 3)? I seem to recall some older version of DrScheme documentation mentioning a SICP "language" but I don't see anything in PLT version 203 (except Michael Sperber's implementation of the picture language). The documentation for MIT Scheme 7.7.1 has the phrase "`6.001' is the SICP compatibility package" in the user guide http://www.gnu.org/software/mit-scheme/documentation/user_3.html#SEC9 but I do not find any code that is less than a decade old for supporting SICP. http://www-2.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/scheme/impl/mit_scm/sicp/ has a tarball made in 1995 out of files with 1993 dates but I assume that this is significantly out of date. (A Google search of groups did turn up a 1997 or 1998 revision ftp.swiss.ai.mit.edu/pub/users/ziggy/SICP/) Some of the web pages at http://sicp.ai.mit.edu/ use the terms "6.001 Scheme" and "MIT Scheme" in ways that make me think there is a difference. There is mention on the web of a Scheme 48 library for SICP but the latest version of the Scheme 48 documentation does not mention it in the libraries section. http://s48.org/0.57/manual/s48manual.html Thanks in advance for any help. -- Allyn Dimock dimock dot cs dot uml dot edu Allyn Dimo...

Web resources about - From python to scheme, but which scheme? - comp.lang.scheme

High-resolution scheme - Wikipedia, the free encyclopedia
Harten, A. (1983), High Resolution Schemes for Hyperbolic Conservation Laws. J. Comput. Phys ., 49 :357–393. Hirsch, C. (1990), Numerical Computation ...

Turnbull government accused of ineptitude as refugee visa scheme stumbles
One of the few paths to a life in Australia for asylum seekers appears to have been blocked amid claims the federal government has approved just ...

Turnbull government accused of ineptitude as refugee visa scheme stumbles
One of the few paths to a life in Australia for asylum seekers appears to have been blocked amid claims the federal government has approved just ...

Government may act as Grattan Institute urges reining in of 'overly generous' student loans scheme
Forcing higher education&nbsp;graduates to pay back their debts sooner would rake in half a billion dollars a year, easing the pressure on the ...

Government may act as Grattan Institute urges reining in of 'overly generous' student loans scheme
Forcing higher education graduates to pay back their debts sooner would rake in half a billion dollars a year, easing the pressure on the federal ...

High-Flying Harvard Law Grad Charged With $95 Million Fraud Scheme
His family has quite the thing for Harvard Law: his father and three brothers are all HLS alums.

Apple iPad scheme seeks to reclaim the tablet market and win the post-PC wars
Something surely seems missing from this week's Apple Event. A year ago this month, Apple introduced the svelte, 12-inch MacBook . That makes ...

MOST TRANSPARENT, EVAH! Obama EPA Used Secret Email Accounts to Scheme with Lobbyists and Climatards
By Ethan Barton There is new evidence senior Environmental Protection Agency (EPA) officials routinely use private email accounts to conduct ...

NY man arrested in alleged fraud scheme
Prosecutors allege the financial services firm partner engaged in a $95 million scheme to defraud investors.

Kentucky's AG sues Volkswagen for emissions-rigging scheme
... Ky. (AP) — Kentucky Attorney General Andy Beshear sued Volkswagen on Tuesday, claiming the German automaker's diesel emissions cheating scheme ...

Resources last updated: 3/29/2016 7:57:44 PM