Allocate Little, Gain Much

Currently, I’ve been working on bindings for Copper with Irrlicht – a project I’ll probably write about later. I started to consider how much memory I was using by creating wrappings for every little thing. Naturally, I wanted things both small yet convenient. (It’s true that it would be better just to write a native GUI for Copper, but that’s asking alot out of myself.) I wanted the easiest way to have maximum control, but Irrlicht bindings send everything through a tunnel – i.e. when you want an attribute of something, you get all of the attributes. I could dump the ones I didn’t want, but what’s the point? Isn’t it faster to just load all of them into a Copper function?

That got me thinking… how much memory are Copper function-objects actually using?

Continue reading “Allocate Little, Gain Much”


Solving the Shortcut Dilemma

Pointers are always a pain. I have found the only safe ways to work with them that both avoids memory leaks and segfaults. Unfortunately, there are some things lost that even ruin some expectations in Copper.

Continue reading “Solving the Shortcut Dilemma”

Program exit

In Copper, to end the program, you simply have to enter the word “exit”. In a way, that’s exactly what I’m doing now. I intend to write a few more articles about using Copper, especially some of the cool tricks you can do with it, but as far as I’m concerned, the language is essentially done and the virtual machine is in a stable state. The new documentation is now available on Github.

Continue reading “Program exit”

docs = new Docs()

My old documentation was hand-coded in HTML. I thought that would be the right way to go at first because, after all, the language was “simple”. Then again, how can anything be simple when it’s over 6000 lines of code? Having become tired of coding documentation, I decided to switch to markup, and with a shiny new logo and a nice docs generator, I now have more professional-looking documentation on Github.

Continue reading “docs = new Docs()”

Progress Report #7

Back at it again, this time I’ve made some important bug fixes that have laid hidden since branch Cheetah. Uh oh. Sometimes a bug can be simply reference counting too much, in which case, we call it a memory leak. The major issue, however, was a parsing bug that duplicated variable address names. Hard to believe I missed something as important as that, but it required a certain state of the parser, so I don’t feel quite as bad about missing it. In any case, those are done.

Continue reading “Progress Report #7”