-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we need a #lang
?
#130
Comments
I've thought about this too and yeah, I also think it'd be a good move. Unneeded Racket featuresOverall, I think this is great, and is one of the most compelling factors here. If we do this, it prevents a lot of headaches that we encounter regularly where students have a hard time understanding Racket's functionality. We can choose to just expose a really good, fundamental subset of Racket instead of everything. The biggest downside of this is that we will become responsible for the documentation. We can no longer just link to Racket's very thorough documentation on whatever thing a student is struggling with. This also is a good skill for students to build: they'll have to learn how to read documentation throughout their careers, so practicing it here is useful. Taking custody of the documentation could be a blessing in disguise, though. Racket's documentation is often too thorough and technical, which means students frequently don't understand it. We could simplify things and explain exposed functionality in a way that is more approachable to our students. I wonder whether it might be worth having a "passthrough" mode, like a submodule of our Style enforcementThis would be a huge advantage to us. Although it seems silly and superficial, one of my least favorite things is when a student comes to office hours for help with their code and it's just... absolutely abysmal. It's syntactically correct but they've got unintuitive indentation and weird parentheses and whatnot. I also like the idea of requiring some notion of intent, but I'm curious what you think that should look like. Like, a type signature is easy and straightforward, but I wonder about other forms of purpose. Maybe expectations of pre-/post-conditions? Type systemI'm 100% on-board with a type system, but I wonder how advanced of a system we would want. Typed Racket is cool and useful (and already exists), but it's also so expressive that it might be too easy for students to write weird-but-correct types? I wonder if we should restrict to something like Hindley-Milner, where top-level type declarations are required and such. TruthinessAlthough it's a bit "surprising" to students, I actually think we should retain Scheme-style truthiness. I like the idea of forcing students to adapt to a new (to them) way of thinking. This also works well with the first compiler assignment where students have to implement I do wonder about the type system implementation with regard to truthiness though. Do all types subtype Other thoughts
|
On the issue of type systems, a potential solution is the use of contracts. The language forces you to use contracts and the contracts are checked at run-time. When grading solutions, we can check that the contracts are the intended ones. IME random testing and contracts get you 98% of the early error detection that a type system gets you. And we can still have complex types like "integer in (0,256]." For self-hosting, I think it will actually be the same story. The last language of the class will just be the I agree on the truthiness bit. I like that students have to implement things that are different than they might expect. I think what I mean is more like: suppose we want to explore a semantics different from Racket's. We can't really do that, except through interpretation. I think there might be some opportunities for making this easier to do with a One thought I had was to implement the So e.g.:
Becomes:
The source code for |
Elaborating into |
Here are some loose thoughts on a potential redesign of the 430 materials to deal with some long standing issues I see.
The bigger issues:
for
,quasiquote
, fancymatch
patterns, stuff in libraries, etc. Not necessarily bad, but I'd prefer students worked within the small subset that's needed and try to really master that subset. This isn't a class on Racket.Some smaller issues:
#:prefab
etc.There are other issues (the source language and meta language being the same causes confusion, etc.), but a way of dealing with the above issues is creating our own
#lang
language. That gives us control over much of this stuff.The text was updated successfully, but these errors were encountered: