3 ms·
If you're willing to break compatibility with C, why not make a clean break and use a language that better supports the things you want? The authors go on (corr
by lmm 9y ago
If you're willing to break compatibility with C, why not make a clean break and use a language that better supports the things you want? The authors go on (correctly) at great length about the difficulty of union types in C compared to an ML-family language; why not use an ML-family language? (My university used Standard ML for their first programming course and I see it as a good choice)
- instruction-ptr 9y agoThe course that uses C0 goes on later to C, and is literally titled “Principles Of Imperative Computation”. We use Standard ML for “Introduction to Functional Programming”. - source: I’m a TA for this course
- murph-almighty 9y agoI was an ECE and now regret not taking Intro To Functional Programming (I almost typed 150 by instinct). I was put off by the horror stories, and perhaps also by a lab I saw once that was basically a longform story about "pleasing Senpai". My iteration of Principles of Imperative Computation was... something. I liked the course but the professors who ran it that semester were really unpleasant. They accused a friend of mine for cheating when she pointed out an obvious mistake in someone's code during office hours when the line for TA help was basically on two whiteboards. She became a TA the following semester. ¯\_(ツ)_/¯
- instruction-ptr 9y agoAlso - we don’t break complete compatibility with C. We just restrict the amount of C things they are allowed to use
- jcoffland 9y agoIs every C0 program a valid C program?
- dymk 9y agoThat’s what he’s implying by “restricted C”
- sigjuice 9y agoDoesn't look like it. Page 18 says C0 is almost but not quite a subset of C. Though we strived to stay as close to C as possible, the array semantics proved impossible to resolve. However, it is still quite easy to convert a C0 program to C such that the meaning of the C0 program is one of the possible meanings of its C version.
- grayhatter 9y ago> the array semantics proved impossible to resolve. ...that's quitter talk.
- tyingq 9y agoThat seems impossible given that they introduce new types, like string. Maybe there's a src/src translator or set of macros though?