I have questions about scheme. 
Author Message
 I have questions about scheme.

Hi,
        I am currently attending a Scheme course. Hoever, even though I have
already studied Scheme for about 7 weeks, I still don't see how Scheme is
better than other programming language, for example, C, except that we can use
procedure call as data. Could you plese tell me the advantages of Scheme and
how it can relate to Artificial Intelligence? Thanks for your time!

Philip Lee



Thu, 15 Apr 1999 02:00:00 GMT  
 I have questions about scheme.


Quote:

>Hi,
>    I am currently attending a Scheme course. Hoever, even though I have
>already studied Scheme for about 7 weeks, I still don't see how Scheme is
>better than other programming language, for example, C, except that we can use
>procedure call as data. Could you plese tell me the advantages of Scheme and
>how it can relate to Artificial Intelligence? Thanks for your time!

>Philip Lee

Philip,

     You must also consider the concept of "continuations" (the encapsulation
of the future of the computation) captured by call/cc construct. Extremely
powerful!! You can implement threads, co-routines, etc. Cruise Net looking
for continuation.

Vasili N. Galchin



Fri, 16 Apr 1999 03:00:00 GMT  
 I have questions about scheme.

Quote:

> Hi,
>    I am currently attending a Scheme course. Hoever, even though I have
> already studied Scheme for about 7 weeks, I still don't see how Scheme is
> better than other programming language, for example, C, except that we can use
> procedure call as data. Could you plese tell me the advantages of Scheme and
> how it can relate to Artificial Intelligence? Thanks for your time!

> Philip Lee

IMHO, Scheme is an easier language than C to use.

1.  Scheme has a garbage collector, so the heap is managed automatically.
    In C, you have to manage the allocation and freeing up of memory.  As a
    consequence, you have to worry about dangling references and uncollected
    data.  It is easier to manipulate lists, trees, and graphs in Scheme.
2.  Scheme strings are more high-level than C char arrays.  Overall, C is
    more low-level, it requires that you know alot about the underlying
    von Neuman architecture.
3.  Since Scheme is not strongly typed, it makes it easier to rapid prototype.
    This is useful in A.I., where software designs are often unclear.
4.  On average, the Scheme intrepreters are more flexible for a developer to
    use than the C de{*filter*}s.

I'm doing an A.I. project.  I think it would have taken me longer to build
the software in C.  I a using MacGambit, which has a really useful exact
arithmetic built-in.

I think Scheme is a better "teaching language" than C, because C is more
low-level.  Many beginners will be turned off by the field of Computer
Science, because there first language was C.  However, C is a better
language for systems programming.

I hope this helps.

Earl Harris Jr.

p.s. I am sad that many feel that C and C++ should be the ONLY languages.
Each language has its strengths.



Fri, 16 Apr 1999 03:00:00 GMT  
 I have questions about scheme.



Quote:
>Hi,
>    I am currently attending a Scheme course. Hoever, even though I have
>already studied Scheme for about 7 weeks, I still don't see how Scheme is
>better than other programming language, for example, C, except that we can use
>procedure call as data. Could you plese tell me the advantages of Scheme and
>how it can relate to Artificial Intelligence? Thanks for your time!

In doing a distributed system, I find it much more convenient for the
various parties to send their agents (programs) to a central place to
interact, rather than trying to set up fixed protocols, or to
coordinate by pairwise communication between the parties.  This allows
me to build "servers" without having to define beforehand what the
"services" will be.  Programs as data is essential to this paradigm.
Could not be done with C, doubtful with Java, straightforward with
Scheme.


Sat, 17 Apr 1999 03:00:00 GMT  
 I have questions about scheme.

This is perhaps just nit-picking, but here goes anyway.


Quote:
> 3.  Since Scheme is not strongly typed, it makes it easier to rapid
>     prototype.  This is useful in A.I., where software designs are
>     often unclear.

This is a false assertion.  What is true is that there is no single
strong type system specified for Scheme.  However, this doesn't
prevent you or me or anyone else from coming up with one.  (Indeed,
this is where one of Scheme's greatly under-exploited strengths lies.)
For instance, at least two real type systems have been designed for
Scheme (Andrew Wright's and Cormac Flanagan's).  [Also, as every ML
fan will tell you, Scheme is trivially typable using a standard
datatype definition.]

Rapid prototyping is a fairly different issue.  It does, however,
overlap a little with typing when you ask whether your type systems
will _reject_ programs, as opposed to flag possible inconsistencies.
"Soft" typing (Fagan, Wright) does just this.

Quote:
> I think Scheme is a better "teaching language" than C, because C is more
> low-level.  Many beginners will be turned off by the field of Computer
> Science, because there first language was C.  However, C is a better
> language for systems programming.

No, I think you mean to say that in our world, it is usually easier to
write systems programs in C.  However, systems programs are still
_programs_, and all the usual concerns that programmers have to deal
with still exist.  So all your arguments could be repeated here.

There's more, and that's where a trade-off lies: in some pathological
cases, memory management can be better done by hand (and the memory
performance of systems software is especially important), but in
return, you want your systems software to be more robust than your
typical application program.  Remember this?

  IRIX went up from 4.8 megabytes to 8.1 megabytes, and has a memory
  leak that causes it to grow.  Within a week, my newly-booted 5.1
  IRIX was larger than 13.8 megabytes -- a big chunk of a 16 megabyte
  system. It's wrong to require our users to reboot every week.

(Now at http://bigbang.stanford.edu/~parkb/computers/sgi-story .)

The Fox project (in ML) has demonstrated some of the benefits of using
an advanced language for writing systems code.  LispM users knew some
of that for a long time, too.  And don't forget Olin Shivers and
friends, who've done stellar work on Scsh.  Someday, perhaps, every
script you write will begin with

  #!/bin/scsh

(-:

(Of course, if Scsh has made it all the way to /bin/, please tell me
 we'd have gotten rid of the #! silliness.)

'shriram



Thu, 22 Apr 1999 03:00:00 GMT  
 I have questions about scheme.

Quote:

> This is perhaps just nit-picking, but here goes anyway.

let's go for meta-nit-picking...

Quote:

> > 3.  Since Scheme is not strongly typed, it makes it easier to rapid
> This is a false assertion.  What is true is that there is no single

You're right/wrong: Scheme *is* strongly typed. It is not statically typed, tho
(even though, like any other dynamically typed language, you can add some kind
of static type system to it, transparently (just for purposes of code
optimisation, as is done in all (hopefully) common-lisp compilers) or not).

        Stefan



Thu, 22 Apr 1999 03:00:00 GMT  
 I have questions about scheme.


    >> This is perhaps just nit-picking, but here goes anyway.

    Stefan> let's go for meta-nit-picking...


    >> strongly typed, it makes it easier to rapid This is a false
    >> assertion.  What is true is that there is no single

    Stefan> You're right/wrong: Scheme *is* strongly typed. It is not
    Stefan> statically typed, tho (even though, like any other dynamically
    Stefan> typed language, you can add some kind of static type system to
    Stefan> it, transparently (just for purposes of code optimisation, as is
    Stefan> done in all (hopefully) common-lisp compilers) or not).

I'd wish there could be some agreed upon nomenclature for this kind of
thing. I don't mind it if people want to say Scheme is dynamically checked
to avoid untrapped errors, but to say it is strongly typed seems to confuse
the meaning of "type" and "typed language". I ran across an interesting
discussion that tries to tease out some of the issues, which also happens to
be a chapter in the _CRC_Handbook_of_Computer_Science_and_Engineering_.

http://www.research.digital.com/SRC/personal/Luca_Cardelli/Papers/Typ...



Fri, 23 Apr 1999 03:00:00 GMT  
 I have questions about scheme.

+---------------
| Remember this?
|
|   IRIX went up from 4.8 megabytes to 8.1 megabytes, and has a memory
|   leak that causes it to grow.  Within a week, my newly-booted 5.1
|   IRIX was larger than 13.8 megabytes -- a big chunk of a 16 megabyte
|   system. It's wrong to require our users to reboot every week.
|
| (Now at http://bigbang.stanford.edu/~parkb/computers/sgi-story .)
+---------------

Just for the record: That was indeed an *internal* memo that leaked out
*without* the author's intention or permission, and it is so far out of
date at this point that continuing to publish it verges on the libelous.

I run Irix 5.3 on my desktop system, and it's up for several months at
a time (well, for however it is between power outages!) with no signs
of leakage...

-Rob

-----

Silicon Graphics, Inc.          http://reality.sgi.com/rpw3/
2011 N. Shoreline Blvd.         Phone: 415-933-1673  FAX: 415-933-0979
Mountain View, CA  94043        PP-ASEL-IA



Sat, 24 Apr 1999 03:00:00 GMT  
 I have questions about scheme.

Quote:

> Just for the record: That was indeed an *internal* memo that leaked out
> *without* the author's intention or permission, and it is so far out of
> date at this point that continuing to publish it verges on the libelous.

Actually, the author has long since been aware of the leakage.  The
version I pointed to includes addenda from him clarifying things for
the random outsider who stumbles on his message.

I'm not trying to criticize Irix, Rob.  I've used Irix 5.3 for months
and had no real problems with it either.  I was merely trying to make
an illustrative point about the need for robustness in a kernel,
especially in things like memory management.  I think the SGI document
is a classic reminder to the s/w community at large -- it's
unfortunate that an SGI product had to be named internally, but you
honestly believe there are s/w engineers out there who look at the
memo and DON'T find it hauntingly familiar?

Anyway, no offense meant to SGI.

'shriram



Sat, 24 Apr 1999 03:00:00 GMT  
 I have questions about scheme.


Quote:
>    Stefan> You're right/wrong: Scheme *is* strongly typed. It is not
>    Stefan> statically typed, tho (even though, like any other dynamically
>    Stefan> typed language, you can add some kind of static type system to
>    Stefan> it, transparently (just for purposes of code optimisation, as is
>    Stefan> done in all (hopefully) common-lisp compilers) or not).

>I'd wish there could be some agreed upon nomenclature for this kind of
>thing. I don't mind it if people want to say Scheme is dynamically checked
>to avoid untrapped errors, but to say it is strongly typed seems to confuse
>the meaning of "type" and "typed language". I ran across an interesting
>discussion that tries to tease out some of the issues, which also happens to
>be a chapter in the _CRC_Handbook_of_Computer_Science_and_Engineering_.

There _is_ an agreed upon nomenclature. There are untyped languages
(e.g. tcl and /bin/sh), weakly typed (old C compilers where you can
assign different types around without so much as a warning), strongly
typed languages (C++, Scheme, Smalltalk) and statically typed
languages (Eiffel, C++, Ada)

--

Chris Bitmead ----------------------------------- Ph:  +(612) 299-4622
Technical Manager ------------------------------- Fax: +(612) 299-4696
Asia Pacific Region --------------------------- Suite 803A, 32 York St
Versant Object Technology --------------------- Sydney, Australia 2000
The Database for Objects! --------------------- http://www.versant.com



Sun, 25 Apr 1999 03:00:00 GMT  
 I have questions about scheme.


   >    Stefan> You're right/wrong: Scheme *is* strongly typed. It is not
   >    Stefan> statically typed, tho (even though, like any other dynamically
   >    Stefan> typed language, you can add some kind of static type system to
   >    Stefan> it, transparently (just for purposes of code optimisation, as is
   >    Stefan> done in all (hopefully) common-lisp compilers) or not).
   >
   >I'd wish there could be some agreed upon nomenclature for this kind of
   >thing. I don't mind it if people want to say Scheme is dynamically checked
   >to avoid untrapped errors, but to say it is strongly typed seems to confuse
   >the meaning of "type" and "typed language". I ran across an interesting
   >discussion that tries to tease out some of the issues, which also happens to
   >be a chapter in the _CRC_Handbook_of_Computer_Science_and_Engineering_.

   There _is_ an agreed upon nomenclature. [ ... ]

Agreed upon by who?

--
-Matthias



Sun, 25 Apr 1999 03:00:00 GMT  
 I have questions about scheme.

   There _is_ an agreed upon nomenclature. There are untyped languages
   (e.g. tcl and /bin/sh), weakly typed (old C compilers where you can
   assign different types around without so much as a warning), strongly
   typed languages (C++, Scheme, Smalltalk) and statically typed

I'm missing something here..

Doesn't set! assign different types around without so much as a
warning?

Ajit



Mon, 26 Apr 1999 03:00:00 GMT  
 I have questions about scheme.


Quote:


>   There _is_ an agreed upon nomenclature. There are untyped languages
>   (e.g. tcl and /bin/sh), weakly typed (old C compilers where you can
>   assign different types around without so much as a warning), strongly
>   typed languages (C++, Scheme, Smalltalk) and statically typed

>I'm missing something here..

>Doesn't set! assign different types around without so much as a
>warning?

Yes, but without implicit type conversion, since values are typed, not
variables.  In the old C you can put a value of one type into a
variable of another type, causing the value to be implicitly
"converted" to the new type, where this conversion may or may not be
meaningful, may or may not cause your program to crash when you try to
use the "converted" value, etc.
--



Mon, 26 Apr 1999 03:00:00 GMT  
 I have questions about scheme.


Quote:


>   There _is_ an agreed upon nomenclature. [ ... ]
>   strongly typed languages (C++, Scheme, Smalltalk) [ ... ]

>I'm missing something here..

>Doesn't set! assign different types around without so much as a
>warning?

Indeed it does.  Unfortunately, there is NOT an agreed-upon
nomenclature.  I really wish I know of a mostly-agreed-upon
nomenclature, but some common uses certainly make no sense.

This is annoying when teachng a programming languages course,
because you have to preface a lot of definitions with "for
the purposes of this course."

My own slant, with no claims to authority whatsoever:

  1. "untyped" should mean things like most assembly languages
     and FORTH, where the language doesn't enforce a type discipline
     at all.  (e.g., you have a bit pattern in a register.  Use at
     as a pointer if you want to, but try to ensure that it is
     a valid address, and is one you want to dereference...)

     It should not included languages like Perl where
     everything is a string or a table, and the language implementation
     does a fair amount of work fiddling with type info.  Maybe it
     should include TCL or shell languages where everything is
     a string.  Maybe not.  I could go either way.

  2. "dynamically typed" should mean things like Scheme and Smalltalk,
     where the type of an object is exactly a type of an object,
     not a type of a variable that holds a pointer to an object
     of that type.  (This is sometimes called "latently typed".
     That strikes me as less ambiguous, but more obscure.)

     It's not clear whether this should include the parts of other
     languages where types are not known entirely from the types
     of variables.  For example, in C++ you can have a pointer
     of a given type which points to an instance of a subtype of
     that type.  C++ virtual functions strike me as a limited form
     of dynamic typing.  The type of an expression depends partly
     on its runtime value, not just its static declaration.

  3. "statically typed" should mean that types of expressions are
     known statically, i.e., at compile time---whatever that means
     in your context :-).  C is statically typed, but there are
     holes in the type system.  Pascal is almost entirely statically
     typed.  ML's type system is, too but much more expressive
     than Pascal's, due to parametric polymorphism.

     This is sometimes called "manifest typing" (as opposed to
     "latent").  That made sense for Pascal, but is less intuitive
     for a parametrically polymorphic language like ML, where
     types are reliably inferred, but not obviously "manifest"
     in the source code.

  4. "strongly typed" should mean that a program is statically
     type-checkable to ensure that no runtime type errors can occur.
     Such a system might be statically typed, but it might have
     dynamic dispatch like C++, where generally you can ensure
     that the object being operated on WILL handle the operation
     in question, even if you can't tell its exact type at compile
     time.  That is, "strongly typed" is a larger category than
     "statically typed", but generally more constrainted than
     full dynamic typing.  The time system enforces compile-time
     constraints to ensure that no runtime type errors occur at
     dynamic dispatches.  C++ is strongly typed for the most
     part, but has holes in the type system, some of them inherited
     from C and others invented fresh.  Ada 95 and Cecil are closer.
     Eiffel sort of is and sort of isn't.  It has covariant typing,
     like Java, which introduces holes in the type system, but
     it has required whole-program analysis to make sure that locally
     ambiguous types can't cause type errors.  (Some people think
     this is cheating.  You ought to be able to typecheck modules
     in isolation.)

One term I tend to use is "safe".  I call Scheme a "safe" language
in that type errors don't violate the abstractions of the language
and crash the system.  (Usually that is, at least if you don't
use a compiler flag that turns off type checking.)  I'm sure this
would be objectionable to many people because it sounds too much
like "type-safe", which they take to mean what I call "strongly typed."

Fun, eh?  It gets worse when you start talking about "polymorphism"
and "genericity".  The usage I'd prefer for polymorphism would
include dynamic typing, but that doesn't seem to be the way it's
usually meant.  (It includes parametric, inclusion, and ad-hoc
polymorphism, but nothing dynamic.)

I'm sure we could quibble about these things endlessly without
getting anywhere. (As I said, this is just my own personal
vocabulary---my "idiolect".)  On the other hand, if there are
programming language experts out there who have a better feel
for what the "most standard" terminogy is, I might revise my
idiolect if the terms aren't too counter-intuitive.

--

| Papers on memory allocators, garbage collection, memory hierarchies,
| persistence and  Scheme interpreters and compilers available via ftp from
| ftp.cs.utexas.edu, in pub/garbage (or http://www.cs.utexas.edu/users/wilson/)      



Mon, 26 Apr 1999 03:00:00 GMT  
 I have questions about scheme.





    >>
    >> There _is_ an agreed upon nomenclature. There are untyped languages
    >> (e.g. tcl and /bin/sh), weakly typed (old C compilers where you can
    >> assign different types around without so much as a warning), strongly
    >> typed languages (C++, Scheme, Smalltalk) and statically typed
    >>
    >> I'm missing something here..
    >>
    >> Doesn't set! assign different types around without so much as a
    >> warning?

    Seth> Yes, but without implicit type conversion, since values are typed,
    Seth> not variables.

This is exactly why the calling Scheme a typed language bothers me. In
Scheme variables don't have types. Scheme values just carry "type"
information. In my view a language is typed iff the variables have an
assignable type. (i.e. types are static properties... ) There is a big
difference between languages that give you typed values versus type
variables. I just wish there was some nomenclature that didn't utterly
confuse these issues.



Mon, 26 Apr 1999 03:00:00 GMT  
 
 [ 27 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Applications of Scheme/Questions about Scheme

2. VCS question: Ramifications of having multiple projects in a single subdirectory

3. Having a small prob. (newbie question) (1)

4. Having a small prob. (newbie question)

5. A question about the garbage collector - Scheme

6. couple of questions on scheme arithmetic

7. question about Thomas and Scheme->C

8. FAQ: Scheme Frequently Asked Questions 1/2 [Monthly posting]

9. Simple scheme question?

10. FAQ: Scheme Frequently Asked Questions 1/2 [Monthly posting]

11. MIT Scheme question !

12. FAQ: Scheme Frequently Asked Questions 1/2 [Monthly posting]

 

 
Powered by phpBB® Forum Software