From: Nicolas Neuss on 23 Apr 2010 05:09 Tamas K Papp <tkpapp(a)gmail.com> writes: > The prof put up a factorial on the blackboard. Then a recursive function > for the Fibonacci series. These we analyzed. I recently found my notes > from that course when I was moving: the factorial wasn't even tail- > recursive! And naively done recursion is probably the dumbest way to > calculate Fibonacci. OTOH, if not done naively, it is mathematically beautiful and the best way (via fast exponentiation of a matrix). > This was the last CS course I ever took. I left it with the feeling > that Lisp has no point, it is a toy language for teaching > recursion. It took me about 8 years to look at Lisp again. I think > that the vast majority of students feel this way. There should even > be a T-shirt: "I put up with all those silly parenthesis, and all I > got was theoretical CS toys." :-) I am guilty of liking these toys as well. But at least, I don't avoid syntax transformations and OO in my (currently running) programming class. Nicolas
From: Tamas K Papp on 23 Apr 2010 06:33 On Fri, 23 Apr 2010 11:09:43 +0200, Nicolas Neuss wrote: > Tamas K Papp <tkpapp(a)gmail.com> writes: > >> The prof put up a factorial on the blackboard. Then a recursive >> function for the Fibonacci series. These we analyzed. I recently >> found my notes from that course when I was moving: the factorial wasn't >> even tail- recursive! And naively done recursion is probably the >> dumbest way to calculate Fibonacci. > > OTOH, if not done naively, it is mathematically beautiful and the best > way (via fast exponentiation of a matrix). Indeed - but that's a topic for a different course. One that uses something like Concrete Mathematics as a textbook :-) >> This was the last CS course I ever took. I left it with the feeling >> that Lisp has no point, it is a toy language for teaching recursion. It >> took me about 8 years to look at Lisp again. I think that the vast >> majority of students feel this way. There should even be a T-shirt: "I >> put up with all those silly parenthesis, and all I got was theoretical >> CS toys." > > :-) I am guilty of liking these toys as well. But at least, I don't > avoid syntax transformations and OO in my (currently running) > programming class. Then you are probably not typical. BTW, do you have online notes for your course? I am just curious. If I had the resources, would love to conduct the following survey: among undergrads exposed to some form Lisp, what fraction knows that - Lisp has strings? - ... and arrays? - ... and macros? - there are editors/IDEs that make working with Lisp extremely easy? - Common Lisp exists? - ... and has a lot of library function for List Manipulation 101? - ... has loop and iterate? - (tail) recursion doesn't come up very often for the average CL'er? - CLOS exists? - CLOS is far more advanced than the OO framework of some languages that position themselves as object-oriented? - that MOP exists (no need to know the details or use it, just what it is)? My prior would be that the percentage of people who answer "yes" to these questions would be decreasing from 10% to 1e-5, in the order of the questions above. If my prior is more or less correct, I would not be surprised to learn that most people who have been exposed to it dislike Lisp -- they haven't been shown the good stuff. It's like giving a bicycle to a kid, with the condition that he has to rebuild the wheel before each ride. Wishful thinking: the situation might improve if more intro courses switch to Python or similar. Best, Tamas
From: Peter Keller on 21 Apr 2010 02:02 Alessio Stalla <alessiostalla(a)gmail.com> wrote: > with-output-to-string (str) { > print #\c str; > if (> foo 45) { > progn { print 3; print 4; } > print 5; > } > } After really studying this piece of code. I would say that you should not use it for newbies, or really at all. Here is my reasoning: In Bourne shell: if [ x -gt y ]; then echo "hi" else echo "bye" fi In C: if (x > y) { printf("hi\n"); } else { printf("bye\n"); } In perl if (x > y) { print "hi\n"; } else { print "bye\n"; } In python: if x > y: print("hi\n"); else: print("bye\n"); in your dialect: if (> x y) { format t "hi~%"; format t "bye~%"; } That would be the source of so many conceptual and concrete errors in a piece of code as to make someone axe their computer into pieces and regret the day they ever started programming. You'd be lucky if they don't hunt you down with a dull sledgehammer to teach you a lesson. :) Don't suggest a conventional meaning with your grouping symbols which is totally inconsistent with the actual meaning in many other popular languages. Later, -pete
From: Pillsy on 23 Apr 2010 07:31 On Apr 23, 3:27 am, Tamas K Papp <tkp...(a)gmail.com> wrote: > On Thu, 22 Apr 2010 14:17:41 -0700, Pillsy wrote: > > On Apr 22, 11:45 am, His kennyness <kentil...(a)gmail.com> wrote: [...] > >> What makes you think most other programmers would not have the > >> same result as yourself, viz. discover they like it almost > >> immediately? > > If that were the case, wouldn't we see Lispy syntaxes everywhere? > > Lots of people are exposed to Lisp through intro CS courses or > > editing Emacs configuration files, and writing a Lisp reader is > > pretty damned easy. Even if people hate the dynamic typing or > > garbage collection, they could still give their new languages all > > the parentheses you could ever want. > The good old argument of relying on the rationality of people. If X > is so good, why doesn't everyone use it? But the question wasn't whether X is good, the question is whether people would *like* X more than Y if they had a chance to use X. My answer is that people who have had a chance to use X usually still keep on using Y with a great deal of enthusiasm. [...] > The fact that Lisp is taught in intro CS courses is a serious handicap > for it IMO. AFAIK the vast majority of these courses use Scheme, and > use it to introduce some particular style of programming or a constructs > which are interesting to theoretical CS people. That's another possibility, but even people who love the theoretical bits seem to be looking for ways to abandon the parentheses in favor of preposterous piles of syntactic sugar. Ever look at Haskell? I dunno. I didn't even take CS courses; I mostly heard them described second-hand by friends. I took some applied math classes and ended up kinda liking Fortran, though. Cheers, Pillsy
From: Pillsy on 23 Apr 2010 09:37
On Apr 22, 5:44 am, Nick Keighley <nick_keighley_nos...(a)hotmail.com> wrote: > On 21 Apr, 15:51, Tamas K Papp <tkp...(a)gmail.com> wrote: [...] > > Speculations on how fundamental > > the SEXP syntax is to Lisp (and why Dylan failed etc) aside, > > no one has demonstrated the existence of an equally powerful > > Lisp with a more "conventional" syntax, so what the > > experiment/counterfactual would be is not clear. > is it even possible to do something like Lisp's macros without > SEXPs? Yes. The Dylan macro system[1] was a lot like the pattern-matching, hygienic syntax-rules macro system for Scheme. [...] > > Agreed. I almost gave up on Lisp because I started with books on > > Scheme. It was years later when I learned that there are people who > > write practical programs in (heavily extended dialects of) Scheme. > I'm still plodding the stoney scheme road... > CL always looked a bit of monster to me... CL looks a lot bigger than it is; a lot of the size is stuff that might be in another language's "standard library", and some of the rest is language constructs that provide more convenient (or familiar) alternatives to relying on recursion or call/cc for everything. Cheers, Pillsy [1] http://www.opendylan.org/books/dpg/db_329.html |