News for hackers. Stuff that matters.
Re:C0, an Imperative Programming Language for Novice Compute... by lmm on Wednesday October 18, 2017 @11:38AM (#15500031)
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)
Re:C0, an Imperative Programming Language for Novice Compute... by instruction-ptr on Wednesday October 18, 2017 @11:41AM (#15500056)
The 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

Re:C0, an Imperative Programming Language for Novice Compute... by murph-almighty on Wednesday October 18, 2017 @09:43PM (#15504821)
I 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. ¯\_(ツ)_/¯

Re:C0, an Imperative Programming Language for Novice Compute... by instruction-ptr on Wednesday October 18, 2017 @11:42AM (#15500068)
Also - we don’t break complete compatibility with C. We just restrict the amount of C things they are allowed to use
Re:C0, an Imperative Programming Language for Novice Compute... by jcoffland on Wednesday October 18, 2017 @11:55AM (#15500209)
Is every C0 program a valid C program?
Re:C0, an Imperative Programming Language for Novice Compute... by sigjuice on Wednesday October 18, 2017 @12:20PM (#15500432)
Doesn'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.

Re:C0, an Imperative Programming Language for Novice Compute... by grayhatter on Wednesday October 18, 2017 @12:24PM (#15500468)
> the array semantics proved impossible to resolve.

...that's quitter talk.

Re:C0, an Imperative Programming Language for Novice Compute... by tyingq on Wednesday October 18, 2017 @03:16PM (#15502067)
That seems impossible given that they introduce new types, like string. Maybe there's a src/src translator or set of macros though?
Re:C0, an Imperative Programming Language for Novice Compute... by dymk on Wednesday October 18, 2017 @12:16PM (#15500403)
That’s what he’s implying by “restricted C”