Tuesday, January 13, 2009

Potion: Installing and Running

New to the computer language scene is Potion. This language is the work of Why (or Why the luck stiff if you like typing) a guy who created a wonderful guide to learning the Ruby programming language.

Potion is a very 'small' language in both terms of lines of code to implement and the tools and API of the language itself. Batteries are not included as they are in well established languages such as Python. NO SWEAT, this of course is why you are interested.

First things first you'll need to have Git installed. Git is source control software. I am on Ubuntu and so I just typed in the command 'sudo apt-get install git-core'. That should do it... oh not on Ubuntu well then go here and figure it out.

Second you are going to need Ragel. Ragel is a state machine compiler. Potion uses it to create the source code tokenizer. Again I used apt-get: 'sudo apt-get install ragel' and voila I had myself some Ragel. You might need to go here and download it or something.

Lastly you need the Potion source. Using Git you will download this. You should be able to type
git clone git://github.com/why/potion.git potion
and you'll now have the folder 'potion' containing the sources.

Now you'll want to change to the 'potion' folder. Type 'make' to start the process of building Potion.

Once finished copy the potion executable create in the make step into your local bin folder. For me that is '/home/rob/bin'. Make sure this folder is on the path. Now you can run potion anywhere. test it out using the command 'potion examples/fib.pn'. This will run the simple fibonacci app in the example folder.

Now you are ready to build a great program!

No comments: