Wednesday, September 17, 2008

RE: [BLUG] scheme programming

My classmates had similar concerns with scheme, but I really liked it.  I had previous programmed in BASIC, PACAL, c, c++, assembly, and whatever language is used on calculators. 

 

When learning how to use an hp-48G calculator, I read that “Using reverse-polish-notation causes more focus to be put on the data and less on the function.”  Polish-notation (scheme notation) therefore causes more focus to be put on the function and less on the data.  Keeping that in mind helped me understand when scheme would be useful.  IE. when the algorithm is more important than the data.  In an entry level course, this is definitely true.

 

I like the structure of scheme.  I liked the fact that everything is “do-something  to-this  to-that  to-something-else …”.  Each line is a separate activity.  You can live in the now with scheme.  Everything happens in real time.  If you are defining a lambda, and a function is not yet defined, go ahead and call it anyway.  As long as you define the required function before you execute, everything will be fine. 

 

I like the lack of overhead.  I like the fact that you can pass anything (including functions) to a command.    (cons car cdr)  : )  I like the fact that ALL loops are different forms of recursion.  (You must first understand recursion to properly understand this definition of recursion.)

 

That being said, I only used scheme in three other classes.  I used it in “Analysis of Algorithms” to verify that my project idea would work.  I converted the algorithm then to c, to gain speed.  Now I program in c, c++, (c#,) python, and perl.  I don’t have much time for scheme. 

 

Food for thought:

 

http://xkcd.com/297/

 

http://xkcd.com/224/

 

http://xkcd.com/323/

 

--

Jeffery Williams

Software Test Engineer

IU Cyclotron Facility

jefjewil@indiana.edu

Work (812) 856-1165

Home (812) 219-5061

 

From: blug-bounces@cs.indiana.edu [mailto:blug-bounces@cs.indiana.edu] On Behalf Of Ben Shewmaker
Sent: Wednesday, September 17, 2008 9:35 AM
To: blug@cs.indiana.edu
Subject: [BLUG] scheme programming

 

I'm taking the intro to computer science course at IU and we are learning to program with Scheme.  I have no experience in programming (well, if you don't count playing around with Basic in high school) and was wondering what languages anyone on this list starting learning on.  I know it isn't the specific language you learn but the fundamentals that matter, but I'm also wondering if Scheme is used often in specific applications or where is it used in the wild?

Oh, and another thing I've been thinking about on this class.  There is a strict no sharing your code policy with anyone.  Our first assignment is really basic so I can see where sharing something like

;least compares 2 numbers and prints the smallest
(define least
  (lambda (x y)
    (min x y)))

would make it easy to cheat.  But as we will get more complicated I think that sharing code is a good way to learn how others solve the same problem.  Maybe because I'm really into the open source community that I feel that a University would surely want to encourage a more open approach to coding?  And we also use an implementation called Chez Scheme, which is proprietary.  Aren't there some good open source implementations?  What do you all think?

Ben

No comments: