Skip to main content
GameDev.net gamedev.net
🔒 Locked

I'm a Scheme user

Started by Alpha_ProgDes May 8, 2006 at 2:48 PM 17 replies 2.4k views
Original Post
Alpha_ProgDes
Alpha_ProgDes
....now what? [Edited by - Run_The_Shadows on May 8, 2006 4:04:05 PM]
Beginner in Game Development?  Read here. And read here.  
TheTroll
TheTroll
I think we need a little more information..

theTroll
Alpha_ProgDes
Alpha_ProgDes
[grin]

Good point. Well I just downloaded the Scheme interpreter and wanted to know where should I start as far as learning to program in Scheme? Should I try to emulate some program I made in C, C++, or Java? Should I start from scratch with a tutorial and "Hello World"? Or should I go a different route altogether?
Beginner in Game Development?  Read here. And read here.  
TheTroll
TheTroll
Start with Hello world and work up from there...

theTroll
CTar
CTar
Quote:
Original post by Alpha_ProgDes
[grin]

Good point. Well I just downloaded the Scheme interpreter and wanted to know where should I start as far as learning to program in Scheme? Should I try to emulate some program I made in C, C++, or Java? Should I start from scratch with a tutorial and "Hello World"? Or should I go a different route altogether?


Oh, so this isn't a drunk post (I actually thought it was), not because of spelling (which is good enough) it just sounded like you wanted to tell us you are a Scheme user for no apparent reason. Anyway you should try to do simple programs you have done before, stuff like calculating Fibonacci numbers (in a recursive/iterative way of course, don't use Binet's formula). When you start getting to the somewhat more advanced concepts you should try using them in a little larger project. Also if the resource you are learning from have any examples try them out.
Roboguy
Roboguy
Quote:
Original post by Alpha_ProgDes
[grin]

Good point. Well I just downloaded the Scheme interpreter and wanted to know where should I start as far as learning to program in Scheme? Should I try to emulate some program I made in C, C++, or Java? Should I start from scratch with a tutorial and "Hello World"? Or should I go a different route altogether?


It would help to know the interpreter you got. The Scheme standard library is very small, so many interpreters have non-standard extensions.

But anyway. You might want to learn about the functional paradigm (as it applies to dynamically typed languages), it's pretty important in Scheme. The SICP (pronounced "sick-pea" in case you were wondering) book and Abelson and Sussman video lectures are classics which may help.
chollida1
chollida1
the little schemer is a good book. There is also Structure and Interpretation of computer programs if you want a heavier read. http://mitpress.mit.edu/sicp/

If you want something more indepth start here:)
http://www.swiss.csail.mit.edu/projects/scheme/

I'm not sure if your sold on scheme or if you just want to learn functional programming. If its the latter, may I recommend lisp?? Google lisp-in-a-box. Peter Siebel has open sourced an excelled book called practical common lisp if your interested.

Cheers
Chris
CheersChris
Roboguy
Roboguy
Quote:
Original post by chollida1
the little schemer is a good book. There is also Structure and Interpretation of computer programs if you want a heavier read. http://mitpress.mit.edu/sicp/

If you want something more indepth start here:)
http://www.swiss.csail.mit.edu/projects/scheme/

I'm not sure if your sold on scheme or if you just want to learn functional programming. If its the latter, may I recommend lisp?? Google lisp-in-a-box. Peter Siebel has open sourced an excelled book called practical common lisp if your interedted.

Cheers
Chris


I will assume you mean Common Lisp by "lisp." In my opinion, Scheme encourages functional programming more than Common Lisp. It is also generally used more in Scheme. I recommend you learn both though. Common Lisp has more powerful metaprogramming features than the Scheme standard (however, non-standard extensions by some interpreters/compilers have made it just as powerful) while Scheme (as I said) is used more for functional programming. Both metalinguistic programming and functional programming are good to know about.
chollida1
chollida1
Quote:
Original post by Roboguy
Quote:
Original post by chollida1
the little schemer is a good book. There is also Structure and Interpretation of computer programs if you want a heavier read. http://mitpress.mit.edu/sicp/

If you want something more indepth start here:)
http://www.swiss.csail.mit.edu/projects/scheme/

I'm not sure if your sold on scheme or if you just want to learn functional programming. If its the latter, may I recommend lisp?? Google lisp-in-a-box. Peter Siebel has open sourced an excelled book called practical common lisp if your interedted.

Cheers
Chris


I will assume you mean Common Lisp by "lisp." In my opinion, Scheme encourages functional programming more than Common Lisp. It is also generally used more in Scheme. I recommend you learn both though. Common Lisp has more powerful metaprogramming features than the Scheme standard (however, non-standard extensions by some interpreters/compilers have made it just as powerful) while Scheme (as I said) is used more for functional programming. Both metalinguistic programming and functional programming are good to know about.


I agree that scheme promotes a more functional programming approach. I just find lisp(common lisp) to be the more practical of the 2 languages due to the larger number of libraries available for it:)


Cheers
Chris
CheersChris
Roboguy
Roboguy
Quote:
Original post by chollida1
Quote:
Original post by Roboguy
Quote:
Original post by chollida1
the little schemer is a good book. There is also Structure and Interpretation of computer programs if you want a heavier read. http://mitpress.mit.edu/sicp/

If you want something more indepth start here:)
http://www.swiss.csail.mit.edu/projects/scheme/

I'm not sure if your sold on scheme or if you just want to learn functional programming. If its the latter, may I recommend lisp?? Google lisp-in-a-box. Peter Siebel has open sourced an excelled book called practical common lisp if your interedted.

Cheers
Chris


I will assume you mean Common Lisp by "lisp." In my opinion, Scheme encourages functional programming more than Common Lisp. It is also generally used more in Scheme. I recommend you learn both though. Common Lisp has more powerful metaprogramming features than the Scheme standard (however, non-standard extensions by some interpreters/compilers have made it just as powerful) while Scheme (as I said) is used more for functional programming. Both metalinguistic programming and functional programming are good to know about.


I agree that scheme promotes a more functional programming approach. I just find lisp(common lisp) to be the more practical of the 2 languages due to the larger number of libraries available for it:)


Cheers
Chris


PLT Scheme has a large extension to R5RS. That helps some.
Alpha_ProgDes
Alpha_ProgDes
No, I'm not drunk [smile]

Ok! I'm already confused and haven't even coded yet. But for starters, I got the interpreter off the MIT website and bookmarked the SICP text site.

Now I thought Lisp and Scheme pretty much did the same thing. So now... lemme get this as straight as possible. Lisp does metaprogramming (templates) and Scheme does functional programming. But I thought they both were functional languages?

Anyone got a plain as day explanation?
Beginner in Game Development?  Read here. And read here.  
Monder
Monder
As far as I understand it, Scheme is basically LISP lite. They're really multiparadigm languages, though they have the look and feel of a functional language (and indeed were based on Lambda calculus originally).

Quote:
Lisp does metaprogramming (templates)

While I haven't been learning LISP for long, AFAIK it's metaprogramming facilities aren't really like C++'s templates, code in LISP is basically loads of lists, and thus metaprogramming involves creating lists which represent code using LISP code. This is done using the macro system.
Rebooted
Rebooted
Quote:
Original post by Alpha_ProgDes
No, I'm not drunk [smile]

Ok! I'm already confused and haven't even coded yet. But for starters, I got the interpreter off the MIT website and bookmarked the SICP text site.

Now I thought Lisp and Scheme pretty much did the same thing. So now... lemme get this as straight as possible. Lisp does metaprogramming (templates) and Scheme does functional programming. But I thought they both were functional languages?

Anyone got a plain as day explanation?
Lisp isn't really a functional language. If you want to learn functional programming, Haskell or SML would be better choices than Common Lisp. Learn Lisp because it's Lisp.

Scheme is a dialect of Lisp which encourages a functional style. Features like assignment are available to the programmer, but their overuse is not encouraged. At its heart, Scheme is just a different dialect of Lisp, with a different outlook on things, different libraries, etc.

Scheme can do metaprogramming just like CL, but it sacrifices a little power in return for a hygienic macro system. This was a choice made by the designers, exchanging a little power for added safety.

I'd recommend learning scheme, as well as looking into common lisp, and then maybe learning a language like Haskell or ML.
Roboguy
Roboguy
Okay. First of all, to reduce confusion, let's refer to Common Lisp as Common Lisp, Scheme as Scheme and the Lisp family of languages (to which both Scheme and Common Lisp belong) as "Lisp." It can confuse things a lot when people use "Lisp" to refer specifically to Scheme, Common Lisp or some other language.

Quote:

Ok! I'm already confused and haven't even coded yet. But for starters, I got the interpreter off the MIT website and bookmarked the SICP text site.

Might want to bookmark the video site too.

Quote:

Now I thought Lisp and Scheme pretty much did the same thing. So now... lemme get this as straight as possible. Lisp does metaprogramming (templates) and Scheme does functional programming.


They are both functional languages. The both support metaprogramming, but Common Lisp has a more powerful metaprogramming system than the one defined in the Scheme standard (however, like I said, some Scheme interpreters/compilers have a system as powerful as Common Lisp's). Also, metaprogramming definitely does not mean templates. C++ supports metaprogramming through templates, but that is a very ugly and annoying way to do metaprogramming when compared to how you could do it in a Lisp language. Templates wouldn't make much sense in a dynamically typed language anyway.

Also, Scheme and Common Lisp are actually quite different, because of their standard libraries and a few other things such as a separate namespace for functions.

Quote:

But I thought they both were functional languages?


They are (by some definitions of the phrase, anyway). But Scheme encourages functional style more than Common Lisp. Neither, though, are purely functional (meaning they both have side effects and can be directly used for imperative programming (sequentialy execution of instructions)).
Colin Jeanne
Colin Jeanne
When I was taking a class that used Scheme we had a number of large-ish projects that maybe you could work up to. The ones I remember are

Various variations on Scheme interpreters (in Scheme of course)
-First one had functions and variables all in the global environment
-Second made functions have a local environment
-Third allowed for macros (if I recall correctly)

An Enigma-style encoder/decoder

Some system which given a list of votes would perform an instant-runoff election

A Scheme source cross-referencer (which symbols are used in what functions, which symbols are in some function F, etc.)

With the possible exception of some of the evaluators I should have all the related source for this and more. If you're interested I could figure out what my homework assignments were. Just PM me or something.
Xai
Xai
if you go to a langauge website, and see a lamda picture, its a (primarily or originally) functional programming langauge.

the original lisp is primarily a functional programming langauge (but many of the features you are used to in C++ / Java / Smalltalk originally came from LISP.

LISP can refer to any langauge / dialect that derives from the original LISP article, or almost any language which uses the same principles to define its core rules.

LISP has many many dialects, because different people want to do things with the language, and the article only specifies the semantic core requirements and minimum interface of the language - so people invent their own REAL lisp when the want to ... of which there have been DOZENS of dialects. Common Lisp was one attempt to standardize on a modern lisp in the last few decades - with features such as the Common Lisp object system (CLOS). Scheme was an attempt to make a very "pure" LISP dialect with almost nothing but pure functional features. There is also Haskell, and a few other psuedo-popular ones.

The different LISP dirivatives are almost as varied as the different C implemented scripting lanaguges (PERL, Python, ruby), but they also have as much in common.
Roboguy
Roboguy
Quote:
Original post by Xai
Scheme was an attempt to make a very "pure" LISP dialect with almost nothing but pure functional features.


Scheme was an attempt to make a very small Lisp dialect, not necessarily a very pure one (by the definition of "pure" you're using). It is impure, but some elements of purely functional programming are commonly used in it.

Quote:

There is also Haskell, and a few other psuedo-popular ones.


Haskell is not a Lisp.

Quote:

The different LISP dirivatives are almost as varied as the different C implemented scripting lanaguges (PERL, Python, ruby), but they also have as much in common.


That seems contradictory, first of all. Secondly, Lisp languages can be extremely varied and two Lisp languages can have almost nothing in common, other than both being programming languages with the same basic syntax ideas (it is theoretically possible to have a statically typed, purely functional Lisp, for example).
Xai
Xai
Quote:
Original post by Roboguy
Quote:
Original post by Xai
The different LISP dirivatives are almost as varied as the different C implemented scripting lanaguges (PERL, Python, ruby), but they also have as much in common.


That seems contradictory, first of all. Secondly, Lisp languages can be extremely varied and two Lisp languages can have almost nothing in common, other than both being programming languages with the same basic syntax ideas (it is theoretically possible to have a statically typed, purely functional Lisp, for example).


I was trying to say that, each lisp compared to each other may be as different as say Python compared to ruby ... and while those languages seem largely different, they really derive from nearly identical core assumptions. And the idea of Lisp is the very few core rules it derives from. It isn't strictly semantics, as many new ones can be defined. It isn't syntax, as S expressions, P expressions, M expressions, etc can be used. It is more of a starting point, or a 0th law of robotics, on which everything else is placed that makes it a lisp (so it seems to me).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.