Each week I have been taking on an unusual programming language and seeing what it is like to code in.
This week was supposed to be Malbolge. I know that all these programming languages have had a degree of difficulty, that is almost a requirement of esoteric programming languages, but Malbolge was just a different level of difficulty. After many hours of studying it, I had to admit defeat and change the language for this final part.
You can have a go with this language yourself if you fancy a a challenge. Here are some links to get you started:
I actually picked these 5 languages when I planned to do this series all those years ago and had the original draft saved all of this time.
Now I am changing this last one (regretfully to be honest), I decided to go with something to go with the spooky theme as it was Halloween on Tuesday - hence I have chosen Zombie.
Zombie is an acronym that stands for Zombie-Oriented Machine-Being Interface Engine and is designed for evil necromancers to do evil things.
One important aspect is that it runs a multithreaded environment. This means multiple entities can run at the same time and in parallel.
Entities are structural units of code. They have different types such as zombies, ghosts, vampires and demons (and many more).
Each type has a slightly different behaviour and have slightly different commands to use them. We will only focus on the most basic type which is zombie.
Zombies are very straightforward: they run each task sequentially and don't start the next one until the previous one has finished.
Another example is Ghosts. These run tasks whenever they feel like it. They will eventually run all the tasks but there is an undetermined amount of time between them.
Full details of the different types and the commands that can be run can be found here. It is fairly straight forward to follow and so I don't want to just regurgitate what is written.
Installing and Running
I am using this interpreter that is written in Python. I am not sure how closely it follows the language specification, but was very easy to use.
Simply copy the code into a new
.py. Then in the terminal, run:
python nameOfYourInterpreter.py zombieCodeFile.zom
I am not sure the
.zom extension is actually needed, I just added that myself.
That is it. The code compiles and runs. Obviously, you will need to install Python on whatever machine you are working on. I will leave you to work that part out yourself.
Building "Hello, World!"
First we declare our zombie and give it name:
HelloWorld is a zombie
This is creating a zombie entity that will be run. Valid programs must declare at least one of these.
After declaring it, I then have to give it some "tasks". These are just like functions in normal programing languages.
The tasks are written inside a summon/animate pair:
summon //tasks go here animate
Summon and animate mark the beginning and end of an entities task list.
It also sets the current entity as being active if it is a zombie.
We will have one task for printing Hello, World! to the screen:
task SayHello say "Hello, World!" animate
As you can see, you have to use the task keyword follow by the name of the task to start it off. The end of the task is marked again with animate.
The actual code:
say "Hello, World!" is pretty self explanatory and makes this very straightforward.
I have barely scratched the surface with what you can do with this language (mostly because I ran out of time as I wasted quite a lot trying Malbolge). As I said before, more details of what can be done and what is allowed can be found here. It is fairly high level compared to some of the others I have played with and so you can probably create some decent programs.
That brings the end to this little mini-series. I am sorry for the sort of rushed ending but this series has been in drafts for a bout 4 years and so to have finally completed and published it is a great feeling. I hope that you enjoyed it as much as I did trying out these languages.
They have inspired me a little bit to perhaps have a go at creating my own...