To increase speed of the engine, I decided to test what would happen if I made certain numbers built-in. Most people don’t need anything more than integer or double. The other types are only for tasks like saving memory (e.g. making bit-flags) or importing data (which will be handled by a different class in Copper anyways). If you want to save memory, generally you don’t use an interpreted language.
That said, what were the results?
Continue reading “Number^Power”
A number of languages support a kind of “public”/”protected”/”private” model. The actual implementation and meaning of this model vary from programming language to programming language, but the basic idea remains the same: preventing code outside of an object from modifying certain things inside of it.
As an interpreted language, Copper doesn’t support such a model.
Continue reading “pub: private”
This feature was implemented a long time ago and is available on every branch of Copper
Creating classes is an interesting paradigm (should be spelled “paradym”, but nobody asked me). Many languages implement such a feature (C++, Ruby, PHP, etc.), some languages make the feature so terse it’s hard to recognize without reading docs, some languages don’t even bother with it, but you can still implement it with some work. There have been a number of arguments about whether closures and classes are essentially the same thing with different names, but I’m on the side that thinks otherwise. It’s a matter of construction, and certainly closures are far easier to create in some languages than in others. I won’t go into a discussion of class versus closure, but I will admit that the line is certainly very blurry, and Copper adds another dimension to it.
Continue reading “i_am~super”
I did some speed profiling… – something I probably should have done a before outright stating my virtual machine is “not improvable” on its blog. Of course, I know better, and that’s why I performed speed profiling.
The profiling narrowed down the bulk of the speed bottleneck to function calls (actually, it was a confirmed educated guess, but I think I know where the other bottlenecks are).
Not to the surprise of any expert, the primary issue turned out to be string comparison. Strings add up to be amazingly expensive. Currently, there are too many function calls that depend on them in the script execution section of the engine.
Continue reading “Type System Revise”
I do love languages, and (as I wrote in my very first post on this blog) Copper has its origins in Goldfish, a language initially intended for AI. In a way, making a language was still on the bucket list, so the things I said in that post are not lie, but there is more to the story.
Continue reading “The Birth of Copper”
Interpreted languages would be useless without extensions or some foreign function interface. Unfortunately, this is a very, very annoying position to be in because we’re effectively going back and forth between “trusted code” and “not-trusted code”. This gives rise to a number of potential problems to solve, and coming up with solutions for them for Copper wasn’t easy because the solutions are custom fits for a language and engine that have never before existed.
Continue reading “FFI = cu.translate(other)”
ATTENTION: This applies to the first two branches of Copper, known as “fn” (original, using “fn” for function start syntax) and “Bobcat” (the version to begin using the square bracket syntax). The task-processing system has been replaced in the new master branch known as “Cheetah”.
Copper is a very simple language. Unsurprisingly, the language requires a number of little quirks on the backside that make the model I’ve chosen for processing tokens to look like gold in hindsight. … Maybe I’ve just done this before and learned from experience. 😉
Continue reading “The Task Processing Model – Branch Bobcat”