9 ms·
A simple C++ interpreter is an oxymoron.
by mulle_nat 8y ago
A simple C++ interpreter is an oxymoron.
- tntn 8y agoIt's c++ without the "object-oriented features," so that could be fairly simple.
- userbinator 8y agoThat's called C.
- amelius 8y agoIt could still support e.g. function templates (not sure if it actually does).
- hellofunk 8y agoC is C++ minus object-oriented features, increased type-safety, template meta-programming, lambdas, and many more features.
- gray_-_wolf 8y agoNot true, C has features missing from C++.
- k__ 8y agoWhich?
- FartyMcFarter 8y agohttps://www.quora.com/What-features-are-present-in-C-but-not-available-in-C++/answer/Sergey-Zubkov-1 https://www.quora.com/What-features-are-present-in-C-but-not...
- makapuf 8y agoThere is a more complete answer with a link but quickly : restrict, designated initializers, generic macros...
- madeuptempacct 8y agoSo, are there situations where one would use C over C++? I don't know C++, and only learned C while catching up on my fundamentals.
- hossbeast 8y agoRight, the useless cruft that makes your program impossible to read, let alone reason about
- hellofunk 8y agoHa! The lambdas and tools surrounding them in C++11 and later have vastly improved the ability to make programs much easier to read and reason about.
- jcelerier 8y agoyes, I guess all those C++ programs don't exist and C++ programmers don't actually read or write any programs.
- maccard 8y agoHardly. Compare std sort to qsort and tell me that it's superior.
- goatlover 8y agoIs this the cruft that gets reinvented in C whenever the project grows complex enough? Something like: any sufficiently complicated C program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of C++'s features.
- tntn 8y agoI didn't write the README.
- dosshell 8y agoStrictly speaking, C++ is not anymore a superset of C. Mostly syntatic sugar but still, some C code can not be parsed by C++. But yeah, i know what you mean, i guess this is a bastard of C and C++?
- favorited 8y agoC++ was never a superset of C. The same keywords mean different things, character literals are different types, void pointer assignment works differently, etc.
- archgoon 8y agoNo, this isn't C either. The following doesn't work: struct Bob { int a; }; int main() { int a; struct Bob x; x.a = 3; return 0; } So when they say "without object oriented features" they seem to mean: "No extendable type system". Which does make this a lot simpler of a language.
- josefx 8y agoThe example uses the iostreams header instead of cstdio. Not sure how this would work without object-oriented features.
- Andoryuuta 8y agoIt seems like some of the C++ library features are special-cased. From the Q&A section of the readme: "Which notable features are not implemented yet? > Object-oriented features" "Which libraries are supported? > iostream (only cin and cout and endl)"
- andrewprock 8y agoThis appears to be a proof of concept, for the purposes of learning and exploration. From the README: "Currently, it is mainly for educational uses for a MOOC course I am running (and fun)." "Which features are implemented? (Most) operators"
- nutjob2 8y agoC++ is an oxymoron.