30 ms·
This project seems really promising, but I got one concern. Lisp's syntax have been one of its strength for beginners. Easy to learn, easy to solve common error
by klrr 13y ago
This project seems really promising, but I got one concern. Lisp's syntax have been one of its strength for beginners. Easy to learn, easy to solve common errors. I don't see the point of having Python-like syntax really, the user could learn other syntax after they've understood programming.
- andybak 13y agoMy jaw dropped slightly to see someone suggest Lisp syntax would be a better starting place for beginners than Python's syntax. Is it just me or is that a fairly unorthodox point of view?
- f7t7ft7 13y agoMIT used to teach intro to CS using Scheme, I thought. It's significantly simpler than Python.
- dagw 13y agoHow many people taking intro to CS at MIT do you think are beginners who have never programmed before?
- geofft 13y agoQuite a few, actually, which is why the Scheme class ended up being awful in practice -- you'd get a bimodal distribution of students where some are already familiar with multiple languages (usually more mainstream than Lisp) and some aren't familiar with any, and the class, by necessity, targeted the trough right between those. So it was too fast for the students who never programmed before, and either too slow or too _different_ for the students who had, and served neither group very well. The new (Python-based) classes handle this a little bit better, from what I hear.
- f7t7ft7 13y agoI've seen an MIT Scheme class video, and it was painfully slow and the guy seemed to explain everything in painstaking detail. I've heard about the bimodal distribution, which I believe I witnessed among fellow students when I was taking classes. But I'm having trouble seeing how Scheme made it any worse or how the class was too fast. And, Pyret looks like a terrible beginner language! I like PltScheme, but I can't see how anyone would ever want to use that.
- marincounty 13y agoI don't know about this class in particular, but the speed of a course does matter. I guess programming is one of the harder courses to teach?
- geofft 13y agoScheme makes it worse, I think, because the way in which you usefully teach Scheme to someone who's never programmed before is different from the way you teach Scheme to someone who already knows C++ or Java or something pretty well.
- skrishnamurthi 13y agoScheme makes it difficult because it more quickly gets you to teaching difficult ideas. This is an issue about SICP that most people simply never grok. Most courses don't cover a third of the concepts (if that) of SICP in the same amount of time. That's the book, not the language (and the only "fault" of the language is that it lets the book get that far that soon).
- geofft 13y agoYeah, 6.001 never covered the bulk of what the book covers. Still, I think Scheme is sufficiently different from mainstream programming languages that it's... like teaching git to a crowd composed half of SVN power users and half of people who have never copied a folder to folder.old in their life. You're balancing teaching "oh, here's how Scheme's different" from "oh, here's how you should have thought about it all along". In particular I remember the OO system being pretty confusing at first, since my background, from high school, was C++. It makes a lot of sense that Scheme gets out of your way and lets you implement a nifty OO system using just closures, but to someone who expects a language to treat objects as first-class and lambdas not, you're inevitably going to be trying to learn the SICP OO system by comparison to the C++ or Java one. All that said, I'm not blaming the language at all. I think the quickest fix would have been for MIT to offer either a placement exam or voluntary registration for two classes, one for students who were more-or-less new to programming and one for students with a strong background in something like C++ or Java. Both classes could have used SICP as a text and worked fine.
- adrusi 13y agoNo that's fairly normal. It's the whole reason the scheme language, the second most popular lisp, was created. it's lost favor to python and java and c++ because those languages have more of a foothold outside of academia and might be more useful to students who only take a couple cs courses.
- klrr 13y agoLisp syntax is (<operator> <args...>) with a few special forms (def, if, cond etc.). This is really easy to understand and allows the user to go straight forward and learn about the semantics and general programming practice immediately.
- skrishnamurthi 13y agoThat same regularity also means there are few guideposts as a student programs, and this makes it much harder to recover from mistakes. We've looked at a lot data on this (and have taught Racket at every level for decades).
- ufo 13y agoThis reminds me a bit about a similar problem in Haskell. The syntax is very whitespacey so lots of things that would usually be syntax errors in other languages end up being interpreted as invalid function applications, leading to complex type-errors.
- skrishnamurthi 13y agoAbsolutely. For instance, if you leave off an argument in a recursive call, Haskell will quietly think you meant to curry the called function, which can manifest itself as a type error in some entirely different place.
- chongli 13y agoIf you need guideposts, use an editor with paredit support and rainbow delimiters. This makes Lisp feel far more intuitive and tree-like than normal.
- skrishnamurthi 13y agoYou seem to be under the impression I haven't programmed in Lispy languages. And our data are from students using DrRacket, which very much has paredit support. These are just inconvenient truths.
- chongli 13y agoThe key word is beginners. The people who have the most trouble with Lisp syntax are those already accustomed to other languages. Beginners pick it up with no trouble at all.
- skrishnamurthi 13y agoThis claim has rarely been formally studied, and what data we do have does not entirely bear this out. I have taught Lisp syntax for 24 years, and it was my experience with doing so that led me to design Pyret.
- sparkie 13y agoI'd say the real trouble is teaching any syntax at all to beginners, because their first language really taints them for life. Most people will think of successive languages in terms of their first, until they learn many and are able to think more generally. Lisp has the advantage that it really teaches the general semantics of programming languages, because it's syntax is just the syntax tree, and it basically only has one form, which is function application. There's some "special forms" built into the implementation of a lisp to make it useful, but those shouldn't be confused with syntax. In fact, the parenthesis and space between function and arguments shouldn't be considered the lisp syntax either - it's just one way to represent a tree structure in linear text. I think the real issue is the confusion in teaching is between Computer Science and Computing as a vocation. Nobody teaches the former any more, because it's less useful in the real world. As a result, we have languages which try to make a distinction between "programmer" and "programming language implementer", where the programmer generally knows less about what he is doing because someone has imposed a specific, narrow set of ideas on him.
- skrishnamurthi 13y agoI've programmed in and taught Lisp syntax for 24 years, much of it exclusively in that syntax. I've also extensively researched errors in parenthetical languages. The simplicity of parens is widely regarded as a strength, but I believe it is also a weakness. There is too much regularity in the syntax, resulting in numerous errors. Programmers, especially beginning programmers, need more "guideposts" in their programs. Additionally, parsers also benefit from this when producing errors. The developers of Pyret are drenched in Lisp syntax; we know it profoundly well. Pyret is a conscious attempt to fix what we regard as flaws with that syntax.
- omaranto 13y agoI disagree about Lisp's syntax being "just the syntax tree", it is instead as you say a little later on, one specific way of writing linear strings of characters that correspond to syntax trees. Of course any other unambiguous grammar is also just one specific way of doing that. Lisp's syntax is not special because it somehow magically corresponds to parse trees where other syntaxes do not; rather in the case of Lisp the correspondence is simpler than for other languages. You make it sounds like Lisp does not need to be parsed, which is clearly false, it's just easier than most (but not all) other languages.
- mageofmath 13y agoAt Brown (the place this research is coming from) one of the main CS intro courses is taught in Racket. It's worked really well and people enjoy the simplicity in getting programs running quickly. People with previous programming experience have more trouble than true beginners at that point in the course. The course later moves into 3 other languages (OCaml, Scala, and Java) to try and get the beginners not focused on any particular language, though there is some debate on whether that effectively teaches the beginners any language particularly well. Pyret would definitely be a candidate for replacing OCaml in that sequence as anything with better error messages would be very welcome.
- skrishnamurthi 13y agoI am not a fan of that sequence of languages, and the fact that it seems to keep changing every so often shows that the course(pair) hasn't yet found a canonical, good answer. However, I don't see any reason why Pyret needs to be the _second_ language. OCaml is brought in to introduce types (amongst other things) because Racket doesn't have them. Pyret eliminates that need. There are other reasons, too. But this sounds like a debate we should be having in a hallway, not on the Web. (-:
- ek 13y agoLike it or not, universities have started to move away from teaching Scheme to introductory CS students. You may remember that much was made of MIT and Berkeley switching away from Scheme for Python. I think Pyret comes out of a precedent of Python as the new standard, so in that light, it's certainly an improvement.
- stass 13y agoThat's because they stopped teaching CS, it's not that they replaced Scheme with Python in CS courses. How can you possible teach metacircular interpreters, constraint propagation languages, ambiguous computation and similar constructs using Python when you need to be able to easily define a completely different language semantics using language at hand? In that sense, Pyret will allow them to teach a bit more CS than possible using ordinary Python but still is in no way fit for something on the level of SICP.
- skrishnamurthi 13y agoThe textbook that accompanies Pyret (http://papl.cs.brown.edu/2013/ http://papl.cs.brown.edu/2013/) covers many of these topics: the second half of this book is a full-blown programming languages text (formerly a stand-alone book known to some as PLAI). I fully agree that you can't cover these things well in Python, and most Python textbooks don't, because of the poverty of datatypes and the difficulty of creating new structured ones. However, while I think SICP is the greatest computer science book ever written, it has its own share of blind spots (for a simple example, see [the lack of] types or pervasive specification and testing). So the above book takes a somewhat different take on these issues. But it hews closer to SICP than any Python book I've seen.
- pjmlp 13y agoThe university where I graduated from in 1999, still has lots of CS lectures, including lots of compiler design lectures. We never used Lisp based languages on our lectures, rather Caml Light (nowadays OCaml) and Prolog.
- jpolitz 13y agoSyntax is tricky and contentious, and our team members do love our Schemes. Members of the Pyret team have actually done some research on the issue of parenthetical expressions in introductory programming, and seen that parens aren't necessarily the best: http://cs.brown.edu/~sk/Publications/Papers/Published/mfk-val-grow-tree-expr-integ-fp/ http://cs.brown.edu/~sk/Publications/Papers/Published/mfk-va... One issue is that it's too regular: since open-paren means so many different things (start of a "defun", start of a function application, start of an argument list in a "defun", start of a syntactic form like "cond" or "if", start of a clause of "code", the list goes on), a typo can easily and drastically change the kind of error message you get. More closely matching syntactic forms to the type of behavior the expression has will hopefully let us improve error messages and grokkability of the difference between concepts. We're collecting data about common syntax errors and actively asking what we can do better in syntax design based on what we observe about Pyret's use.
- e12e 13y agoDid you ever do any research/tests/courses with Smalltalk as the first language?
- skrishnamurthi 13y agoNope. Virtually nobody uses Smalltalk as the first language any longer anyway, to the best of my knowledge.
- e12e 13y agoWell, I'm guessing not that many are using Pyret as a first language (yet) either... (Actually, I think a few people are still using Squeak to teach kids programming, so that's not even true)? Anyway, I was more curious if you'd done such a study because a) It's a very concise and consistent syntax, and b) with all the great work that appears to go into Pharo Smalltalk it would seem to be viable option (again). And yes, I do mean for computer science (not "just" programming): http://www.lukas-renggli.ch/blog/petitparser-1 http://www.lukas-renggli.ch/blog/petitparser-1 http://www.squeaksource.com/OMeta/ http://www.squeaksource.com/OMeta/ (This in addition to the nice design of Smalltalk-80 - and no, of course it isn't perfect -- is any language)
- skrishnamurthi 13y agoI've programmed in and taught Lisp syntax for 24 years, much of it exclusively in that syntax. I've also extensively researched errors in parenthetical languages. The simplicity of parens is widely regarded as a strength, but I believe it is also a weakness. There is too much regularity in the syntax, resulting in numerous errors. Programmers, especially beginning programmers, need more "guideposts" in their programs. Additionally, parsers also benefit from this when producing errors.