Marblepunk

From Esolang
Jump to navigation Jump to search

MarblePunk

MarblePunk is a fictional, educational programming language based on the idea of coding with marbles. It is defined by a fictional universe, in which, due to the natural laws of the universe, programs can be “build” with marble runs.

Etymology

The name is derived from the term steampunk, which describes a genre, in which key technical advancements happen much earlier than in actual history. In the case of steampunk, these are often digital devices like computers powered by steam engines. MarblePunk now does this with magic marbles. It is defined by a fictional world, in which marble have special properties and are therefore used in a mediaeval setting to build special devices. Such a world would naturally result in a setting, in which the digital revolution happens much earlier and with marbles, hence the name: Marblepunk.

Overview

The language puts an emphasis on the flow of programs, which are represented by the marble run. Regarding data representation, the complete program state is saved inside the marble and can be therefore be accessed over it, which means that various kinds of data structures and operations are possible.

While this is good if teaching is focused on the flow-sequence (which is the case in many introductory courses to programming), it is also one of the major flaws of the language, because it isn’t suited for teaching more complex concepts about data structures.

Idea

MarblePunk is a fictional programming language. The idea behind it was something like this: we don’t live in the best possible world to teach programming. Such a world would be a world, in which programming can be experienced and therefore, be taught like a craft rather than a science. Fictional universes allow us, to think about how such a world could look like. And virtual, immersive devices allow us to experience those worlds. The combination of those two could one day make a new kind of teaching possible, which I call alternate-world-based-education.

Until then, the goal behind the creation of fictional programming languages is to find those best worlds, in which people could teach programming like a craft, how these programming languages would look like, and then apply them for actual class through digital, immersive devices. This puts the creation of fictional universes at the intersection between world-building and programming language design.

Because of this, fictional programming languages are not defined by a meta model, but through the natural laws of the fictional universe, in which they live in. That could be one of the advantages over traditional languages. Because in the world, in which they exist, they are a natural part of the universe, they lose their abstract nature. By exploring the world and its properties, the programming language could be used along on the go.

Another advantage of fictional programming languages could be that they can be easily adapted for any form of media. This could make the integration of immersive devices in schools easier, because, as long as they are part of the same fictional universe, they can be dynamically used in class. Research on them could also be more lasting and rewarding because they are less prone to change than typical digital creations.

The disadvantages are that they are harder to implement because in most cases, virtual worlds are necessary to be able to experience them to a satisfactory degree.

MarblePunk is not the first fictional programming language. In fact, there are probably many of such languages in fiction and computer games, but which aren’t attributed as such (or could only become ones by extending them). But to make them scientifically observable, they should be described in documentations, which would serve as the implicit language specification of the language. And I think fictional universes are best suited to capture those kinds of languages.

The Pinocchioverse

MarblePunk is defined by the documentation of the Pinocchioverse, a fictional universe, in which marbles have special properties so that they can be used to automate mechanical devices with them like Geppetto did with Pinocchio in this alternative version of the story.

Language Description

In the following, the sections of the Pinocchioverse are described from bottom to top, because the first section is the one, which directly describes MarblePunk, however, the others are just as integral for its definition.

Language constructs

Help Pinocchio through the maze
Bubble-Sort with Marblepunk (it has to be run multiple times in a row)

Basic marble track components are track pieces and seals. The marble runs are built with track pieces, through which the marble will later run. There exist simple linear pieces, and curves, but also loops and branches. However, the marble runs only became calculation machines with marble seals.


Marble seals can be pasted on the track pieces. If the marble runs over them, different things can happen. With action seals, an action is triggered. For example, Pinocchio makes a move.


Another type of seal are sensor seals. If the marble runs over them, conditions are checked, for example, if Pinocchio just ran into a wall.

Apart from those basic track components, advanced track components are possible, which include complex seals. These enable complex operations on the values in marbles, as well as checking those values. In general, marbles can save any form of data, if it is scratched onto them. Those values can then simply be used in the marble run, for example to increment variables, check conditions, and so on. With this, marble runs are also able to perform calculations of any kind.

Marble Symbols

Different ways to activate marbles (in every example, the left marble would move)

This section explores, why marbles can trigger actions when they roll over marble seals. This is explained with marble symbols.

In general, marbles in the Pinocchioverse have access to an infinite amount of power inside of them. If they touch, this power is activated and they start to rotate. However, this activation can also happen if they don’t touch – through symbols. If the same symbol is written on two or more marbles, the marbles are also connected and start to rotate.

So, what in marble runs actually happens, is, that the marble rolls over a symbol, which then triggers a marble somewhere else with the same symbol, which then for example powers gears with its rotation, triggering some kind of action.

The power within marbles is also responsible for being able to store values in variables in them, as well as access them and do calculations on them.

The Marble Ore

All marbles are connected by a giant cosmic network, called the “marble ore collective” or “marble mycel”, which enables the global search for matching marble symbols required for evaluating whether they are activated or not.

Practical application

MarblePunk has not been sufficiently applied in any practical context yet. It was neither tried out in educational research, nor has it been digitally adapted. It has been adapted in two free, open-source exercise books: the Pinocchio Exercise book, which emphasizes the fictional world behind MarblePunk and MarblePunk 2042, an exercise book, which puts more focus on the programming language.

Related Languages

Other fictional languages: Minecraft’s Redstone

Semi-physical languages: RifL, Src:card, Shuffle, etc...

Marble-based programming languages: Marbelous

Flow-focused programming languages: Flowgorithm

Education-focused programming languages: Scratch, etc.