3 ms·
The repo of the original interpreter: https://github.com/felixhao28/JSCPP https://github.com/felixhao28/JSCPP Which notable features are not implemented yet?
by goalexboxer 8y ago
The repo of the original interpreter: https://github.com/felixhao28/JSCPP https://github.com/felixhao28/JSCPP
Which notable features are not implemented yet?
Goto statements
Object-oriented features
Namespaces
Multiple files support
The target audience would consists in students trying simple algorithms. By the end of the high school, students are only using very basic C-syntax: variables, arrays, functions, and a couple of functions from the standard library.
Some partial implementations:
iostream (only cin and cout and endl)
cmath
cctype
cstring
cstdio (partial)
cstdlib (partial)
Other includes could be added too.
What I am trying to highlight is if there is any possibility to increase the visual feedback for students heading first to programming.
Something more like an interpretor would be more suitable in this case, but the wasm compilation doesn't seem too slow though. Thanks for this demo!
- SamReidHughes 8y agoAs far as I can tell, this interpreter doesn't even have std::string, and you can't define your own datatypes or allocate. The interpreter also doesn't handle pointers into arrays properly. I'm not familiar with other countries' curricula, but we had vectors and strings very early on when I learned C++. I like the general idea of the debugging interface, that could help a lot of people. But I think you should upgrade the interpreter. I don't know if that's possible while retaining the debugging interface, unfortunately.
- goalexboxer 8y agoThese are the main downsides indeed. As a matter of fact, in the current curricula the only option is cstring, and it's been that way in the last 20 years. I am looking forward to put in balance the upsides and downsides in using such an interpreter. Thank you for feedback!
- leetcrew 8y ago> By the end of the high school, students are only using very basic C-syntax: variables, arrays, functions, and a couple of functions from the standard library. if the goal is to have them writing C-style C++ code, why not just use C? or if the goal is to teach C++, why start with only the features available in C? I've been a TA for classes in both C and C++, and I think we ultimately do a disservice to these students by not treating these languages more separately.
- goalexboxer 8y agoI agree. However, the goal of the computer science classes is to teach basic algorithms and data structures, and not focusing on the language particularly. For instance, in the national exam (written) you may use any printing function (printf / cout), but you are limited to use C-style string functions. No vectors, no additional containers C++. Pointers are being studied too, but there are no exercises which involve coding in exams for memory allocations, so you never get to choose between new/malloc. I don't like this situation but this is the problem I am trying to address, any idea is well appreciated!
- userbinator 8y agoIf it has no object-oriented features, then I don't think it deserves to be called a C++ interpreter at all, since that's basically the one feature everyone thinks of when they're asked to compare C and C++; from the description it looks more like a C-subset interpreter.
- goalexboxer 8y agoFrom the point of end user yes, but the original JSCPP project allows custom classes and members to be available via include.