Hacker News new | ask | show | jobs
by chongli 1090 days ago
They used it improperly then. Racket is used for the first year intro CS courses at my school. They do not use the full language! They use the beginning student [1] and intermediate student [2] versions of the language.

These are highly restricted teaching versions of Racket which do not include the vast majority of the language features. They also use beginner friendly names such as first and rest instead of the cryptic car and cdr. These languages allow students to learn functional programming and basic concepts such as recursion, linked lists, association lists, higher order functions, trees, and graphs without worrying about programming language details such as side effects, fixed size numeric types, memory allocation, pointers, macros, compilers, etc.

For that purpose, Racket seems pretty hard to beat! For the professors, it also has the (nice) side effect that many students with previous programming experience are less likely to have learned Racket (or any functional language for that matter). This has been argued to put the students with and without programming experience on a more equal footing.

[1] https://docs.racket-lang.org/htdp-langs/beginner.html

[2] https://docs.racket-lang.org/htdp-langs/intermediate.html

2 comments

For those thinking "you can do that in any language, just teach a subset of the language": no you can't! The Beginning Student Language (BSL) and Intermediate Student Language (ISL) are subsets of Racket in the sense that you can take any BSL or ISL program and run it in Racket and get the same result. If the program does not error. But if it errors, BSL and ISL will sometimes give better error messages, which they can do because the're simpler languages.

For example, consider the program `((+) 1 2 3)`. Racket gives a runtime error "application: not a procedure" because (+) evaluates to 0, which is then applied to "1 2 3", which errors because 0 is not a procedure. But BSL can give a (helpful) syntax error, because it doesn't have higher-order functions.

(I feel like someone's going to tell me that BSL or ISL isn't a subset of Racket for some obscure reason. They're at least essentially subsets.)

> They use the beginning student [1] and intermediate student [2] versions of the language.

To elaborate, one of the further benefits of multiple student languages like these is that concepts are taught incrementally. For instance, in the beginning student language, lists are explicitly shown as `(cons a (cons b '()))` before they are shown as `(list a b)` in intermediate student language.