top | item 11573531

(no title)

rohwer | 9 years ago

Dybvig's compiler course was exemplary. Say what you may about Scheme, you learned so much more in those classes. His Scheme Programming Language book is highly recommended. Especially check out his extended examples chapter: http://www.scheme.com/tspl4/examples.html#./examples:h0

discuss

order

dman|9 years ago

I thought scheme was like the beatles - people universally only had good things to say about it.

chubot|9 years ago

I might not be getting a reference here, but FWIW, I had a recent experience with Scheme that was interesting.

I did SICP nearly 19 years ago as a freshman, in 1997. And then a few months ago, I ported the metacircular-evaluator -- the "crown" of the course -- to femtolisp (the Lisp implementation underlying Julia).

My thoughts were:

1) It sure is awkward to represent struct fields 1 2 3 as (cdr struct), (cadr struct), (caddr), ... Yes this is nice to show that car and cdr are all you need as axiomatic primitives, but for practical purposes it's annoying. You end up with lots of little functions with long names.

2) Scheme code is very imperative! Even the metacircular evaluator uses set-cdr! and so forth. I don't like imperative code with the Lisp syntax.

3) It is awkward to represent environments with assoc lists. I feel that having a language which is really bootstrapped requires some kind of hash table/dictionary. Because you need that to implement scopes with O(1) access rather than O(n). I believe there are experimental lisps that try to fix this.

4) Macros also seem to have a needlessly different syntax than regular functions. There are Lisps with f-exprs rather than s-exprs that try to fix this: https://en.wikipedia.org/wiki/Fexpr

I was surprised by #3 and #4 -- it some sense Scheme is less "meta" and foundational than it could be. #2 is also a fundamental issue... at least if you want to call it the "foundation" of computing and build Lisp machines; I think this is evidence that this idea is a fundamentally flawed. #1 just makes it pale into languages like Python or even JavaScript.

mwfunk|9 years ago

If it's being used as a teaching language, it depends on the students. Some students will rail against the idea of learning a tool, any tool, that they don't think they would use professionally, even if the purpose of using the tool is to give them a different perspective on programming.

Also, some people just really hate the parentheses (not me).

Also, some people really hate the Beatles (not me). More so in the '60s as contemporary artists, less so now when they're more likely to be referred to in a historical context. But still. The White Album had no shortage of devastating reviews when it came out.

I'd imagine Scheme as a teaching language would be less controversial in schools where the CS students are more likely to already know some programming when they start, and/or don't have as much of a trade school mentality.

piyush_soni|9 years ago

I newly joined this company, and they have 20 years old codebase which is mix of C and Scheme code. The only way they debug the massive Scheme part is using print statements. And I only have bad things to say about that. :( If there's a better way all of them have been missing, I'd love to hear that. I've learned that they have adapted the MIT Scheme implementation to add Object Oriented features, and it "kind of" works like an object oriented language, except when it doesn't - which happens a lot. It's a mess.

smrq|9 years ago

I was fortunate enough to take both his compiler course as well as a follow-up course involving optimization and hygienic macros. Brilliant man, fantastic teacher, and of course, he wrote a great compiler :)

aalhour|9 years ago

Thanks for referencing Dybvig's compiler course, can you point me to the course materials online, or share them with us here, if it's not an issue of copyrights of course?

I tried looking the course materials online but the Indiana University website gave me a 404 error page when I tried to access the course from Dybvig's website.

Thanks.