User loginNavigation |
Yearning for a practical schemeI have spent the last year learning Common Lisp and then Scheme. Especially after watching most of the SICP videos, I am completely enamored with Scheme. It was a godsend for my natural language course last semester in which I needed my only constraint to be my imagination rather than my programming language. I am addicted. But I am also in crisis, because Scheme feels both a blessing and a curse. It's a blessing for the obvious reasons, but it's a curse because it doesn't feel like Scheme is everything I want it to be and I don't exactly know why. It feels impractical. I have some (questions about / comments on) on my experience. First, my Scheme code feels sloppy, much more so than the mind-numbing Java I write for my research job. Is it just all of Java's boilerplateism that's giving it the illusion of better organization? Sure there's more code, but I never have to think twice about where to put that code. Maybe it's Java's rigid design that's forcing me to be more organized when I use it. In imperative languages, the creation of new procedures often feels very arbitrary. It took experience for me to learn when to excise a handful of imperative operations and move them to their own procedure. In Scheme this feels more natural... every procedure seems to map well to the conceptual operation it performs. I think this has a lot to do with functional programming's emphasis on the "computation as calculation" perspective. Because imperative languages highlight the computer's role as a storage device for program state, perhaps they don't lend well to the conceptual breakdown of code into procedures. But is there something about the view of computation as "manipulation of storage" that lends to a better conceptual breakdown when it comes to collections of related procedures? In my Java programs I always feel like there's a place for everything and everything is in its place. My Scheme programs (though I haven't written THAT many full blown programs) always end up being huge listings of procedures grouped into a single massive file... This probably has as much to do with inexperience as it does with language properties, but it also seems true that in Java I have to think about this sort of thing less. What are good organization techniques? Does anyone have advice / guidelines on breaking Scheme programs into compilation units? Coming from the static world of C++ and Java, one of the most seductive parts of Lisp early-on was its complete type dynamism. Having the straitjacket removed felt wonderful, but as I gain more experience, I'm starting to miss the straitjacket. I know that Haskell and Ocaml are statically typed, and I've ventured a little into Haskell, but I still really like Lisp. It feels more "low-level". I like being able to use assignment if I feel like it... it seems to me that it's convenient for the human mind to model "computational objects" as little pools of shared mutable state. It's a shorthand we use also use in dealing with the real world. Even though everything is interconnected, at least at the atomic level, meaning there is no such thing as truly isolated state, we nevertheless think of the world in terms of objects. Without assignment, it seems harder to section off abstractions from each another. I guess the Haskell crowd could achieve this with monads. I'd be interested in hearing people's thoughts. Maybe this will change as I learn more about Haskell, but I still don't like it as much as I like Scheme... I don't completely know why, but I think Scheme's lack of syntax has a lot to do with it. Scheme programs look pretty and nested on the page, while Haskell looks more like a math textbook... cool in its own right, but I prefer the former as of yet... So here is my question: would it be possible to give Scheme static typing while maintaining its appeal? Has this already been done? If not, why? I haven't thought about it at length, and maybe Scheme's elegant syntax would be crushed by type annotations, but I still wonder. Why not? Lastly, what do people think about implementations? I keep shopping around for one that I like, and I keep coming up empty. PLT falls short because it depends too much on DrScheme, and I want to use Emacs. I don't think I should have to abandon Emacs just to gain access to the stepper and interactive debugging. MzScheme's text mode debugging support seems paltry. I understand the appeal of Scheme's minimal definition, but when I'm using it for practical purposes, I don't want the API to feel tacked on. I don't want to import an object system. I want it to be there and feel like it's built-in. I don't want to load a SRFI number, I want the Scheme equivalent of saying import java.util.foo with a name that maps to functionality. I guess what I want is a Scheme that reminds me of Common Lisp while not being as ugly as Common Lisp is. I need a full-fledged toolbox, and I need it to feel seamlessly integrated. Does anyone have suggestions? If not, why doesn't such a Scheme exist? If you read this far, thanks for your advice / comments. I have been reading and learning from this community for a long time and now I am finally a member. By Nathan Sobo at 2005-08-29 22:00 | LtU Forum | previous forum topic | next forum topic | other blogs | 40156 reads
|
Browse archives
Active forum topics |
Recent comments
19 weeks 5 days ago
19 weeks 5 days ago
19 weeks 5 days ago
41 weeks 6 days ago
46 weeks 1 day ago
47 weeks 5 days ago
47 weeks 5 days ago
50 weeks 3 days ago
1 year 2 weeks ago
1 year 2 weeks ago