A Toy Programming Language written in Python
Project description
mio is a minimalistic IO programming language written in the Python Programming Language based on MIo (a port from Ruby to Python) in the book How To Create Your Own Freaking Awesome Programming Language by Marc-Andre Cournoye.
This project is being developed for educational purposes only and should serve as a teaching tool for others wanting to learn how to implement your own programming language (albeit in the style of Smalltalk, Io, etc). Many thanks go to Marc-Andre Cournoye and his wonderful book which was a great refresher and overview of the overall processing and techniques involved in programming language design and implementation. Thanks also go to the guys in the #io channel on the FreeNode IRC Network specifically jer nad locks for their many valuable tips and help.
The overall goal for this project is to create a fully useable and working programming language implementation of a langauge quite similar to Io with heavy influence from Python (because Python is awesome!). This has already largely been achived in the current version. See the RoadMap for what might be coming up next.
Examples
Factorial:
Number set("!", method( (self < 2) ifTrue(return self) return (self * ((self - 1) !)) ))
Hello World:
World = Object clone World hello = method("Hello World!" println) World hello
Features
Homoiconic
Message Passing
Higher Order Messages
Higher Order Functions
Full support for Traits
Object Orienated Language
Written in an easy to understand language
Supports Imperative, Functional, Object Oriented and Behavior Driven Development styles.
Installation
The simplest and recommended way to install mio is with pip. You may install the latest stable release from PyPI with pip:
> pip install mio
If you do not have pip, you may use easy_install:
> easy_install mio
Alternatively, you may download the source package from the PyPI Page or the Downloads page on the Project Website; extract it and install using:
> python setup.py install
You can also install the latest-development version by using pip or easy_install:
> pip install mio==dev
or:
> easy_install mio==dev
For further information see the mio documentation.
Change Log
mio 0.0.3
Improved test coverage
Improved the Range object
Fixed the scoping of block (s).
Fixed the write and writeln methods of Object to not join arguments by a single space.
Don’t display None results in the REPL.
Improved the __repr__ of the File object.
Added open and with builtins to the mio standard library.
Implemented a basic import system in the mio standard library.
mio 0.0.2
Include lib as package data
Allow mio modules to be loaded from anywhere so mio can be more usefully run from anywhere
Added bool type converion
Improved the documentation and added docs for the grammar
Changed Lobby object to be called Root
Added an -S option (don’t load system libraries).
Added unit test around testing for last value with return
Refactored Message.eval to be non-recursive
Set _ in the context as the last valeu
Implemented Blocks and Methods
Fixed return/state issue by implementing Object evalArg and Object evalArgAndReturnSelf in Python (not sure why this doesn’t work in mio itself)
Implemented Object evalArgAndReturnNone
mio 0.0.1
Initial Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.