Skip to main content

Scheme!

I had a buddy ask me about learning the Scheme programming language... so I figured I'd write a blog post about it!

First a very short history.
A long time ago (in 1958) there was born a language called Lisp.  Lisp is actually the second oldest high level language but that's a different post.  Lisp split into two main branches Common Lisp and Scheme.
Common Lisp is quite large and has lots of features including a full OO system.  Scheme on the other hand is as stripped down as is practical.  For comparison the Common Lisp spec has ~1100 pages while the Scheme R5RS spec has 50 pages.

That being said Scheme has low level primitives which allow you to build high level primitives.
There are lots of great resources out there for learning Scheme and I'm going to list a few here.

Textbooks:



Free textbooks:

Websites:
As for implementations (of which there are many) I think I must recommend either racket or guile.  Racket is a very full featured Scheme including many libraries and a GUI environment where as guile is a smaller scheme used in the Gnome project.

As always the best way to learn a language is to use it.  Scheme is quite a bit different than your standard imperative languages but once your learn it you will have yet another tool in your programming toolbox.

Comments

Popular posts from this blog

Duck typing considered harmful.

I've had a chance to work on a fairly large chunk of Python at this point and have decided that Python (like Perl) is completely untenable at scale.  <rant><rave><drool>  but wait!  I have reasons! Programmers spend most of their time reading code.  We read massive amounts of code.  After we read massive amounts of code we write one... or change one... To make a change to a piece of code you first have to understand what it does and how it interacts with the system around it.  Then we start reading massive amounts of code again.  Anything you can do to minimize the amount of code a programmer has to understand to make a change becomes a huge gain in productivity. Duck typing causes the amount of code you need to read to make a change to grow very large. For example lets look at two functions, one in C++ and one in Python. First in C++ int function(type1 arg1, type2 arg2) {   return arg1->method(arg2); } In this fun...

Types of arrays

Arrays are one of the earliest data structures.  They are essentially just a block of memory which is accessed by offset.  Despite their simplicity there are still several broad categories each with their own sets of algorithms. Is the array a fixed size or can it grow as you add elements to it? A fixed size array is called a static array and one that can grow is called a dynamic array. Are the element all of the same type or can they be different? If they must all be the same type then the array are called homogeneous.  Otherwise it is a heterogeneous array. Finally, how many dimensions (subscripts) does the array have? For example, a 2 dimensioned array is a matrix. The number of dimensions doesn't change the structure of the array but changes the way elements are accessed. 

A Prime Vacation

I like to do small programming exercises to keep my skills sharp.  Unfortunately I sometimes get a little carried away with them. Problem: generate a list of primes numbers. Sounds simple right?  Well lets start to look at this.  First lets define what prime numbers are.  A prime number  is a number which is divisible by only itself and one.  A simple way to test if a number if prime is by  trial division .  To test to see if a number is prime you check whether it is division by any prime less then the square root of that number. The general algorithm for finding the list of primes by trial division is therefore the following. list of primes = {2, 3} for each number begining at 4   check to see if it is divisible by any prime less then the square root of number   if number is prime then append it to list of primes Well go through a sample implementation then see what we can do to improve it.