Sign in to follow this  

Official SICP/Scheme Study Group Registration (up. 1/26)

This topic is 3900 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After discussing it for a little while, we will really be starting soon. This thread is to let people know this and to get a general feeling of who will be involved. We will be studying the online book Structure and Interpretation of Computer Programs (SICP), which uses a dialect of Lisp called Scheme. If you are interested please reply with your information below. Update: see this post for up-to-date info about the group. We are still alive! Please feel free to join. To current members, lets keep it up! Here are some links for SICP: SICP (book) Lectures Lecture Notes (thanks Reindeer Effect) (Following is old) The general format will be this (and this may change over the course of the study, this is to just get things started): - Every week there will be a thread that outlines the current week's lesson and what to do. Students/mentors will reply to this thread with answers and questions. - We will have an IRC channel where informal meetings can take place but in general be a place where hopefully a couple people will constantly be. Still kind of fleshing out how this will work. Edit: if any mod is reading this, I'd like to have an OK that we'll have an offical thread every week? Is it possible to make the thread for the current week a sticky? (end old stuff) We will start next week with Chapter 1, "Building Abstractions with Procedures". We'll probably then take Thanksgiving week off and then continue after that. Please reply with the following: Name: I am interested in joining the group as a: Student | Mentor | Somewhat both My experience with Scheme is: My experience with general programming is: Timezone: I will be updating this list as people reply. This from the thread before this. This list is just for our own sake, to make sure we got enough people to make this work. People are free to still join once the group has started. Me: Name: Okonomiyaki I am interested in joining the group as a: Student My experience with Scheme is: Little, writing square root solver My experience with general programming is: Experienced, long time working with C++ with some Perl, Python, and other scripting Timezone: US Eastern (GMT -5) -- Study group members: Rebooted (possible mentor/leader) thebolt00 (possible mentor/leader) Roboguy (possible mentor/leader) chollida1 (possible mentor/leader) some Anonymous Poster (possible mentor/leader) SamLowry (possible mentor/leader) Muhammad Haggag (possible mentor/leader) The Reindeer Effect mentor Alpha_ProgDes GPX DeadXorAlive Ezbez Tynnhammar Okonomiyaki joanusdmentia XXX_Andrew_XXX Telastyn visage Xloner12 CTar samv David Tynnhammar Ceoddyn DaBookshah programwizard Daerax @root lXciD Diodor codingdaemon kevtimc EmrldDrgn GameDev Doctor aceofspaceman [Edited by - okonomiyaki on January 26, 2007 4:50:14 PM]

Share this post


Link to post
Share on other sites
Name: XXX_Andrew_XX
I am interested in joining the group as a: Student
My experience with Scheme is: I've watched the SICP lectures and done a little porting of AI lisp code to python.
My experience with general programming is: high, C/C++/Python/Ada for a wide range of projects
Timezone: Eastern Summer Time Australia (GMT +10)

Share this post


Link to post
Share on other sites
Just a thought, but perhaps the lessons should be extended to two weeks? Even the C++ workshop seemed to move too fast for many and now that most of the students will be full time students or professionals instead of teens off for the summer, more time might be nice.

Telastyn
part-time/non-dedicated student
I downloaded a compiler once and have the briefest of introductions to functional programming.
~10 years, mostly informal.
Central US

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think it might be a good idea to write a short conceptual introduction to what functional programming entails and how it is different from imperative style. Failure to grasp this (there are OTHER ways of writing programs than as sequences of assignments) leads to pain, as Alpha_ProgDes and others have illustrated in the past when they tried to tackle SICP.

Presumably, many students will have prior programming experience with imperative languages only, which is annoying for them because they'll try to write C-style scheme and do worse than the absolute beginners.

So I'll try to whip up a short primer on the conceptual underpinnings of FP and imperative style tomorrow, with plenty of examples, and submit it for comment and review. Forewarned is forearmed, and much frustration may be avoided I think if we can get students to understand this early on.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I think it might be a good idea to write a short conceptual introduction to what functional programming entails and how it is different from imperative style. Failure to grasp this (there are OTHER ways of writing programs than as sequences of assignments) leads to pain, as Alpha_ProgDes and others have illustrated in the past when they tried to tackle SICP.

It's good to know you haven't forgotten about me [lol]

Quote:
Presumably, many students will have prior programming experience with imperative languages only, which is annoying for them because they'll try to write C-style scheme and do worse than the absolute beginners.

So true. As said above, I learned that the hard way.

Quote:
So I'll try to whip up a short primer on the conceptual underpinnings of FP and imperative style tomorrow, with plenty of examples, and submit it for comment and review. Forewarned is forearmed, and much frustration may be avoided I think if we can get students to understand this early on.

(Agreed)2

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I think it might be a good idea to write a short conceptual introduction to what functional programming entails and how it is different from imperative style. Failure to grasp this (there are OTHER ways of writing programs than as sequences of assignments) leads to pain, as Alpha_ProgDes and others have illustrated in the past when they tried to tackle SICP.

Presumably, many students will have prior programming experience with imperative languages only, which is annoying for them because they'll try to write C-style scheme and do worse than the absolute beginners.

So I'll try to whip up a short primer on the conceptual underpinnings of FP and imperative style tomorrow, with plenty of examples, and submit it for comment and review. Forewarned is forearmed, and much frustration may be avoided I think if we can get students to understand this early on.


That's a good point, which is why I suggested that people start out by reading The little Schemer first.

It's nice that someone would take time out of their day to write a tutorial on functional programming but the little schemer is about 200 hundred pages and they had 2 follow up books because they couldn't properly describe the gist of functional programming in that space.

Cheers
Chris

Share this post


Link to post
Share on other sites
Hopefully I can participate...


I am interested in joining the group as a: Student
My experience with Scheme is: None
My experience with general programming is: C/C++/Java/Ruby/SML
Timezone: EST (GMT -5)

Share this post


Link to post
Share on other sites
Quote:
Original post by chollida1
Quote:
Original post by Anonymous Poster
I think it might be a good idea to write a short conceptual introduction to what functional programming entails and how it is different from imperative style. Failure to grasp this (there are OTHER ways of writing programs than as sequences of assignments) leads to pain, as Alpha_ProgDes and others have illustrated in the past when they tried to tackle SICP.

Presumably, many students will have prior programming experience with imperative languages only, which is annoying for them because they'll try to write C-style scheme and do worse than the absolute beginners.

So I'll try to whip up a short primer on the conceptual underpinnings of FP and imperative style tomorrow, with plenty of examples, and submit it for comment and review. Forewarned is forearmed, and much frustration may be avoided I think if we can get students to understand this early on.


That's a good point, which is why I suggested that people start out by reading The little Schemer first.

It's nice that someone would take time out of their day to write a tutorial on functional programming but the little schemer is about 200 hundred pages and they had 2 follow up books because they couldn't properly describe the gist of functional programming in that space.

Cheers
Chris

Is the The Little Schemer free and online? Right now, I'm broke...

Share this post


Link to post
Share on other sites
I'm looking forward to this, I hope I can follow.

Name: Lutger.
I am interested in joining the group as a: Student.
My experience with Scheme is: A little from my first attempt at SICP before I got distracted
My experience with general programming is: novice. C++, D and a little python.
Timezone: GMT+1

Okonomiyaki, do you mean one week for Chapter 1? That might be a bit much, it's pretty dense stuff. From the preface I gathered that the first 3 or 4 chapter's are worth a full semester course. Will we be doing the whole thing?

Share this post


Link to post
Share on other sites
Quote:
Original post by Alpha_ProgDes
Quote:
Original post by chollida1
Quote:
Original post by Anonymous Poster
I think it might be a good idea to write a short conceptual introduction to what functional programming entails and how it is different from imperative style. Failure to grasp this (there are OTHER ways of writing programs than as sequences of assignments) leads to pain, as Alpha_ProgDes and others have illustrated in the past when they tried to tackle SICP.

Presumably, many students will have prior programming experience with imperative languages only, which is annoying for them because they'll try to write C-style scheme and do worse than the absolute beginners.

So I'll try to whip up a short primer on the conceptual underpinnings of FP and imperative style tomorrow, with plenty of examples, and submit it for comment and review. Forewarned is forearmed, and much frustration may be avoided I think if we can get students to understand this early on.


That's a good point, which is why I suggested that people start out by reading The little Schemer first.

It's nice that someone would take time out of their day to write a tutorial on functional programming but the little schemer is about 200 hundred pages and they had 2 follow up books because they couldn't properly describe the gist of functional programming in that space.

Cheers
Chris

Is the The Little Schemer free and online? Right now, I'm broke...


Yeah, and we're not talking about a full in-depth tutorial either. I just read Chapter 1 to SICP and I feel like it's pretty good introduction, but I agree with AP. A short, succint, ~5 paragraph intro to functional programming would be really nice for people who've never done it before. It could especially outline what to watch out for if you are used to imperitave programming. Just something quick.

AP, thanks for doing that!! Post it here when you are finished I guess. We can include it in the first thread.

Telastyn: you may be right. The chapters were a little bit longer than I thought because there's a LOT on each page. We could push it to a chapter each 2 weeks, any nayers?

Quote:
by DeadXorAlive
Okonomiyaki, do you mean one week for Chapter 1? That might be a bit much, it's pretty dense stuff. From the preface I gathered that the first 3 or 4 chapter's are worth a full semester course. Will we be doing the whole thing?


So it's seconded. We'll need to find a good pace because some people are going to get hooked and read sections in advance, but there will be others who take it slower. Personally I think I'm going to fall in love with it and advance through it pretty quickly, but if others want to take it slower that's fine with me.

We can have variable time lengths. Reading through the first chapter was quick for me because I felt like I was reading the same boilerplate again. But I'd definitely want to spend more time on chapters 4 and 5.

How does 2 weeks for the first chapter sound then?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I think it might be a good idea to write a short conceptual introduction to what functional programming entails and how it is different from imperative style. Failure to grasp this (there are OTHER ways of writing programs than as sequences of assignments) leads to pain, as Alpha_ProgDes and others have illustrated in the past when they tried to tackle SICP.

Presumably, many students will have prior programming experience with imperative languages only, which is annoying for them because they'll try to write C-style scheme and do worse than the absolute beginners.

So I'll try to whip up a short primer on the conceptual underpinnings of FP and imperative style tomorrow, with plenty of examples, and submit it for comment and review. Forewarned is forearmed, and much frustration may be avoided I think if we can get students to understand this early on.
Good idea. I'll take a look at that and see if I can contribute.

Before we start we need to wait for word from Muhammad Haggag on whether a workshop forum can go ahead now that we have a decent line up. Hopefully we can still aim to interest total beginners to join the group too.

I am interested in joining the group as a: Mentor
Experience: C++, functional languages
Timezone: GMT

Share this post


Link to post
Share on other sites
Quote:
Original post by Rebooted
Before we start we need to wait for word from Muhammad Haggag on whether a workshop forum can go ahead now that we have a decent line up.


That'd be great. If nothing happens soon, I'd hate for us to lose momentum, so I'd like to start it as a thread here. Or, maybe we should wait so that all the threads can be in the right forum. I guess there's no real hurry, but I want to make sure actually do this :D We'll wait until we at least here from Muhammad.

Quote:

Hopefully we can still aim to interest total beginners to join the group too.


Any ideas on how to make sure we don't aim for anything more than beginners, besides finding the right pace?

Share this post


Link to post
Share on other sites
Name: Joanus.
I am interested in joining the group as a: Student.
My experience with Scheme is: Did a bit with Prolog (same family of languages, I think) along with some Haskell (functional, but not even remotely similar to Scheme)
My experience with general programming is: Experienced (at least, I like to think so [smile]). Professional software engineer, mostly C++ and C# but have used quite a few different languages from across the spectrum.
Timezone: GMT+10

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:

It's nice that someone would take time out of their day to write a tutorial on functional programming but the little schemer is about 200 hundred pages and they had 2 follow up books because they couldn't properly describe the gist of functional programming in that space.


Are you the next James Joyce?

Does "a short conceptual introduction to what functional programming entails and how it is different from imperative style" mean "a tutorial on functional programming" in your world?

Does "the gist of functional programming" mean "learning the Scheme programming language and loads of scheme techniques in addition to functional programming techniques and everything else in TLS" in your world?

The gist of functional programming is the evaluation rule in the lambda calculus: substitution as computation (and hence referential transparency) instead of mutation of the contents of a variable.

Functional programming techniques are another matter, but the gist of functional programming is so simple that schoolchildren use it in math class all the time. Only when their minds are corrupted by basic does functional programming look weird.

So: I'll ask the students to skim a few paragraphs we'll collaboratively write that'll hopefully save them trouble when tackling the real thing (SICP).

You ask them to buy and read a few books before starting on another book. In a week.

Let's see what approach wins out. ;)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Here's a rough draft. Have at it, especially if you can think of ways to make it shorter and clearer. I chose python as an example language because its syntax is familiar to imperative programmers and because it's dynamic like scheme:

If you have programming experience, it's possible you've only used imperative style until now.

What is imperative style?

You're probably used to thinking about your computer as a processor attached to some memory. Variables are like buckets that can hold values, and our program can change the values these buckets hold.

An imperative style program is just (roughly) a sequence of changes to the contents of the program variables. Computation proceeds by explicitly changing the values in the variable buckets. If you've only ever programmed in imperative style, this is as natural as breathing.

For example, let's make a program that adds 4 to a number and then multiplies the result by 2. An imperative way of expressing this (in python) would be:


def example1(n):
x = n + 4
x = x * 2
return x



We create a variable, x, and then modify its contents in a sequence of steps until it holds the result we're looking for.

What is functional style?

Functional style means viewing computation as evaluation of functions. There are NO variables in functional code in the sense we described above: that is, there are no variables that represent memory locations whose contents can change. There are NAMES bound to VALUES (you can bind x to 4, sure) but these don't stand for mutable memory locations. They're just synonyms for the value they're bound to.

So there's no hidden state you can modify in purely functional code; there's nothing like

x = x + 4

because x doesn't stand for a memory location whose contents can change. Expressions (the right hand side of the statement x = x + 4) can be evaluated, but their result can only be returned from a function or bound to a name: it cannot be assigned to any variable.

State can only be passed around the program explicitly as parameters in a function call, or returned as the result of function evaluation. This is the take-home message.

The above example would look like this:


def example2(n):
return (n + 4) * 2



A name, n, is bound to a value (whatever the function example2 is called with). Functions are called (in this case, the built-in functions + and *). A value is returned: the result of evaluating (n + 4) * 2.

But NO assignment is taking place: no variables are being modified.

A less trivial, canonical example: the factorial function

n! = n * (n - 1) * (n - 2) * ... * 1

We might write this imperatively as a loop, which counts from 2 to n and uses a variable i for iteration and a variable accum to multiply all the i's together:


def fact1(n):
accum = 1
for i in range(2, n+ 1):
accum = accum * i
return accum



Assignment is taking place both for i (it changes every iteration) and accum.

How could we write this in a functional style? You're probably familiar with the concept of recursion:


def fact2(n):
if n < 2:
return 1
else:
return n * fact2(n - 1)



Notice no assignment is taking place: within fact2, n is bound to whatever the fact2 is called with, and functions are called and values returned, but no variables are changed.

Functional programs are like math equations. The "x" in a quadratic equation doesn't stand for a memory location that holds a particular number at a particular time, which changes during program execution. Neither does the x in a functional program.

Bear this in mind when you're starting out, and take a deep breath whenever you feel the urge to assign values to variables. Scheme does permit assignment (it's a multiparadigm language, not purely functional), but we'll do without it first.

If you want to pass state around, you'll have to return it as the result of a function: no assigning to a variable is permitted. You'll get the picture when you start working on the examples, but at least you're forewarned: do NOT try to write scheme as you would write C++.

Share this post


Link to post
Share on other sites
Name:Nitage
I am interested in joining the group as a: Student
My experience with Scheme is:1st year university course (5 years ago) taught using scheme. No experience of scheme, lisp or any other functional language since then.
My experience with general programming is:Expert C++, Python. Professional Software Developer.
Timezone:GMT

Share this post


Link to post
Share on other sites
I had to explain The Functional Way a few times too, and I did it the same way as you. Whether this means your explanation is good or not I don't know, perhaps I should ask the people I tried to enlighten. Maybe you should register so that it's possible for you to edit your posts should it be necessary.

What might be missing are advantages and disadvantages: that purely functional programs don't know the dimension of time and hence are easier to reason about, persistent vs ephemeral data structures, possible problems with modularity/encapsulation, but that's perhaps a little too much for an introduction. Anyway, I like to point out these (dis)advantages as they come, so that the imperative programmer doesn't feel like his hands are tied up by seemingly arbitrary limitations.

I'd also like to mention Why Functional Programming Matters, but their view of what "functional programming" is is a bit different from what was explained here (stateless vs higher-order).

Share this post


Link to post
Share on other sites
Well, some may be aware of this, others may not, so, figured I would chime in with a link to MIT:

SICP

From there you can pretty much download the course materials and such. Just a heads up to the originator for an extra source for information.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
SamLowry:

My experience is that students with an imperative background have the most trouble with the concept of statelessness, because it's seldom mentioned explictly (or at least explicitly enough, it seems). They stumble on the initial examples in SICP and elsewhere because they try to write them imperatively.

As to how clear the explanation is... probably not very, I admit. Help me fix it; the text I posted is meant as discussion fodder.

I actually intend this as more of a cautionary note for imperative programmers than a real introduction: that's what SICP is for. So I think it should be as short as possible so people actually bother to read it (shorter than it is now).

Maybe another cautionary explanation should be given about binding vs. assignment.

Ah, and I love the Why FP paper, it's one of the things that keeps me warm during the functional winter. It should go in the links section. You're right that it's skewed more toward more pure languages than scheme; it'll still be very relevant when we get to SICP's lazy evaluator. And it's very motivational.

Share this post


Link to post
Share on other sites
Name: Xloner12
I am interested in joining the group as a: Student
My experience with Scheme is: None
My experience with general programming is: C, Pascal, VB 6
Timezone: GMT -5

Share this post


Link to post
Share on other sites
Quote:
Original post by Alpha_ProgDes
Quote:
Original post by chollida1
Quote:
Original post by Anonymous Poster
I think it might be a good idea to write a short conceptual introduction to what functional programming entails and how it is different from imperative style. Failure to grasp this (there are OTHER ways of writing programs than as sequences of assignments) leads to pain, as Alpha_ProgDes and others have illustrated in the past when they tried to tackle SICP.

Presumably, many students will have prior programming experience with imperative languages only, which is annoying for them because they'll try to write C-style scheme and do worse than the absolute beginners.

So I'll try to whip up a short primer on the conceptual underpinnings of FP and imperative style tomorrow, with plenty of examples, and submit it for comment and review. Forewarned is forearmed, and much frustration may be avoided I think if we can get students to understand this early on.


That's a good point, which is why I suggested that people start out by reading The little Schemer first.

It's nice that someone would take time out of their day to write a tutorial on functional programming but the little schemer is about 200 hundred pages and they had 2 follow up books because they couldn't properly describe the gist of functional programming in that space.

Cheers
Chris

Is the The Little Schemer free and online? Right now, I'm broke...


No its not:(, To bad as its a great book:)

Cheers
Chris

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Quote:

It's nice that someone would take time out of their day to write a tutorial on functional programming but the little schemer is about 200 hundred pages and they had 2 follow up books because they couldn't properly describe the gist of functional programming in that space.


Are you the next James Joyce?

Does "a short conceptual introduction to what functional programming entails and how it is different from imperative style" mean "a tutorial on functional programming" in your world?

Does "the gist of functional programming" mean "learning the Scheme programming language and loads of scheme techniques in addition to functional programming techniques and everything else in TLS" in your world?

The gist of functional programming is the evaluation rule in the lambda calculus: substitution as computation (and hence referential transparency) instead of mutation of the contents of a variable.

Functional programming techniques are another matter, but the gist of functional programming is so simple that schoolchildren use it in math class all the time. Only when their minds are corrupted by basic does functional programming look weird.

So: I'll ask the students to skim a few paragraphs we'll collaboratively write that'll hopefully save them trouble when tackling the real thing (SICP).

You ask them to buy and read a few books before starting on another book. In a week.

Let's see what approach wins out. ;)


Wow, bitter much??

I was just trying to help others by using my experience. And my experience in learning functional programming was that until I read the little Schemer I just couldn't get the gist of functional programming from tutorials:)

I read your tutorial by the way, its good! Thanks for helping!

Cheers
Chris

Share this post


Link to post
Share on other sites
This is what I'd try to point out in our little introduction:

  • Imperative languages like C++ and C# are based upon execution of statements and change of state. Programming is like writing a recipe - do this, then this, then this. As programs progress, mutable variables are altered to keep the state of the program.

  • Scheme is a functional language based upon the lambda calculus, a formalism for describing computable mathematical functions. In this model, programs are not based upon execution of statements and changing state like in imperative languages. Instead they are based upon the evaluation of expressions. A function consists of parameters and a function body, which is an expression. Functions are applied to values. When a function is applied, the body is evaluated with the applied values substituted in place of the parameters.
    Give some simple example - ie f(x) = x + 1, so f(4) = 4 + 1 = 5

  • In functional languages, = denotes equality. If x = 5 then everywhere x appears, 5 is substituted. To say x = x + 1 is nonsensical. C++ and C#, etc use = to denote assignment, which is a different concept. Some languages more reasonably use another symbol, for example := or <-, to denote assignment.

  • Almost all functional languages have support for imperative features - statements and mutable state - to be used when appropriate, but these are not their main model of programming.
Recursion, higher order functions, and other features common in functional languages can be left to the book, they aren't underlying conceptual differences that lead to confusion.

Quote:
Original post by joanusdmentia
My experience with Scheme is: Did a bit with Prolog (same family of languages, I think) along with some Haskell (functional, but not even remotely similar to Scheme)
Actually, Scheme and Haskell are closer than you think. Scheme is an untyped call-by-value lambda calculus and Haskell is a typed call-by-name lambda calculus. Prolog is a logic programming language and is quite different from both. If you have some experience with Haskell, you shouldn't have a problem with Scheme.

Share this post


Link to post
Share on other sites
Name: Marten Svanfeldt
I am interested in joining the group as a: Mentor
My experience with Scheme is: uni course taught with SICP, currently writing a raytracer in it as well as a small R5RS-compatible interpreter for scripting in game engine (written in c++ though :)
My experience with general programming is: many years of c++, assembly, c# as well as some coding in functional languages such as erlang and scheme.
Timezone: GMT+1

I think one thing to consider before starting is still the scope. SICP goes quite far, and the later chapters (or at least chapter 5) is more of theoretical comp.sci. intrest than "useful" for coding. Also one should remeber that SICP only covers a subset of what you can do in Scheme (for example it does not show any IO other than through the REPL, that is the interpreter). Maybe a slight alteration to include such parts would be of good use?

-Marten

Share this post


Link to post
Share on other sites

This topic is 3900 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this