Finally the code-base for the first Copper language interpreter has been published on Github!
The core code is almost completely functional. What it lacks – besides its old callback system – are the features you expect standard with most languages. This interpreter has been deliberately designed to exclude certain features so as to allow users to pick their own. On the bright side, the core code is a paltry ~260kb – compared to 2Mb for AngelScript. Needless to say, this Copper interpreter is an ideal choice if you want one that is very small but powerful.
What remains to be done is modifying the clock time extension and completing a couple more simple numeric extensions and adding a string extension for handling Unicode. I wanted to handle Unicode correctly, but since Unicode isn’t needed for every project, it made little sense incorporating the entire ICU library. I also wanted the option to use large numbers with short function names (like +(), -(), *(), /() ) but not incorporate the GNU MPC and MPFR, which would penalize users who only needed built-in basic primitives.
I have not yet implemented the code for callbacks. This is a very necessary feature and the last one that will complete the core code API.
I suspect there are bugs lurking in the shadows. The simplicity of the Copper language syntax makes testing and debugging easier, but something may still have slipped through the cracks. I tested out the core functionality before publishing, and I have tested the extensions for the most part, but adding other extensions is always likely to create bugs. The FFI is simple enough to limit the source of error, but it too creates a slight annoyance in the form of replicates of a warning from GCC about an unused variable that flood the terminal. I could eliminate that warning while making the code more verbose and error-prone. Interesting trade-off, no?
Finally, there is more to do than just tinker with the code-base. For one thing, the interpreter needs a project where it would be suitable. Given how Copper works, I think it would be ideal for creating structures and layouts, perhaps database management or 3D scene setups. The latter of those two I may try out soon. My experience tells me bugs, quirks, and points of failure show up when you start using something for serious work.
On the bright side, the code is finally out there and perhaps someone else can use it, enjoy it, and build on it… or tell me what a quack I am for not doing x-y-z, but that’s programmers for you. X)
Other notes: The latest master is branch 4: Dolphin. The docs are hosted on Github.