User:Ray49/Fancy (programming language)
Fancy is a pure object oriented language, inspired by Ruby, Smalltalk, and Erlang that is under development.[1]
History
The creator Christopher Bertels is a student at the University of Osnabrück, Germany, studying Computer Science and Philosophy. His main interests lie in the advancement of Free Software, programming language implementations and virtual machine technology.[2] Fancy was created to be a pure object oriented programming language, which would be reasonably fast, dynamically typed and completely object oriented whilst still being easy to understand and portable. The first official release was v0.1.0, released on May 28th 2010; the most recent stable release being v2.0.0, from July 14th 2010 and more features are to be added in the future.[3]
Goals
The language was designed to fulfill the following goals:
- Provide a simple, easy to understand and extensible implementation for a dynamic, pure object-oriented (Smalltalk inspired), concurrency-focused programming language
- Good documentation of the implementation supplied to both the developer and the userbase
- Providing a standard library which has the power to solve most common programming problems
- Providing simple and consistant symantics and syntax
- Allow a single task to be completed several distinct ways
- By running on a cross-platform virtual machine, 'embrace unix system users'
- Be open to criticism, discussion and improvement[4]
Features
Fancy's current revision includes:
- Class definitions that, when nested, work like submodules
- Instance and class instance calling, and method calling
- Loop-, Iterator- & common Collection methods
- Anonymous functions / Closures (Blocks)
- A simple package management system, similar to RubyGems
- Simple pattern matching
- Easy reflection (as in Ruby)
- Literal support for Regular Expressions, Arrays, Tuples, Hashes (Dictionaries), Blocks, Integers, Floats, Symbols, (Multiline) Strings and more
- Exception Handling[5]
- A bootstrapped (self-hosted, completely in fancy written compiler for generating Rubinius bytecode)
- Easy integration with Ruby: Calling out to any Ruby libraries that run on Rubinius, including most C-extensions
Implementation
The implementation of the current release is a runtime using the Rubinius virtual machine, meaning that the language is running the same runtime as Ruby, and is accompanied by a self-hosted (bootstrapped compiler) that generated Rubinius bytecode. To allow more simple cross-platform development, nearly all of the standard library is written in Fancy itself (with a few smal peaces that currently are implemented in Ruby).
Examples
Description | Syntax |
---|---|
Simple print | "hello world!" println |
Looped print 5 times | 5 times: { "hello world!" println} |
Calling methods | var method1: param1 . method2 |
Calling Ruby methods | var.ruby_method1(param1).ruby_method2() |
Class Definitions |
class Person { read_write_slots: ['name, 'age, 'country] "Creates a new Person instance with the given name, age and country." p = Person new p name: name p age: age p country: country p } |
Nested classes |
class Outer { class Inner { class InnerMost { def football { "football" } } } } instance = Outer Inner InnerMost new instance football println |
Future Plans
Bernels plans on doing a number of things to enhance Fancy. This is including improving the standard library and adding first-class support for concurrency semanctics and privimites besides just locks and condition variables, like Actors and Futures.[6]
External links
- The official language website
- OSCON Schedule detailing talk by author.
- An open-source manual for the language, written by the author.
- Rosetta Code page with many examples.
References
- ^ http://www.fancy-lang.org/about-fancy/
- ^ http://www.adztec-independent.de/impressum/
- ^ https://github.com/bakkdoor/fancy/downloads
- ^ https://github.com/bakkdoor/fancy/wiki/Goals
- ^ https://github.com/bakkdoor/fancy/blob/master/README
- ^ http://groups.google.com/group/fancy-lang/browse_thread/thread/9be9dafec67a1b63