An experiment: A duck-typed, object-oriented, syntax-driven (and potentially awesome) programming language.
Switch branches/tags
Pull request Compare This branch is even with develop.


An interpreted awesome programming language

Magnet is an object-oriented programming language, that is prototype-based to the point of real types being absent in favor of duck types.
E.g. every object providing a read method that returns a readable, is considered "readable" (meaning it can represent a string). Since this causes a recursion, there must be some "primal" readable to end that: Such primal readable is also known as a String Object in Magnet.

Furthermore, Magnet is syntax driven. This means: Everything that can be done to reduce code, retain simplicity and to amaze the developer, IS done!


5 * {puts '5 times'}

Displays '5 times' five times.

'Hello':split.each({char :: puts char})

Displays 'Hello', with each character on a new line.

Learn more about Magnet in the docs.


If you have npm, just do: npm install -g magnet

That's it! Now try magnet, after copying the test file to

Installing from source

  1. Download Magnet (stable or bleeding edge (recommended)), or grab the repo using git clone git://
  2. Run make.

Now try $ ./bin/magnet sample/
or > node bin/magnet sample/ on windows


Copyright (c) 2012 by Marcel Klehr
MIT License (see LICENSE)

Third-party software

This software uses a slightly modified version of JS/CC - A LALR(1) Parser Generator written in JavaScript (contained in /jscc)
Copyright (c) 2007, 2008 by J.M.K S.F. Software Technologies, Jan Max Meyer jscc!AT!,
3-clause BSD License (see jscc/jscc.js for more information)