• Stars
    star
    262
  • Rank 152,832 (Top 4 %)
  • Language Fancy
  • License
    BSD 3-Clause "New...
  • Created over 14 years ago
  • Updated almost 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fancy is a dynamic, object-oriented programming language inspired by Smalltalk, Ruby, Io and Erlang that runs on the Rubinius VM.

Logo

The Fancy Programming Language

Build Status


Fancy is a dynamic, object-oriented programming language heavily inspired by Smalltalk, Ruby, Io and Erlang. It supports dynamic code evaluation (as in Ruby & Smalltalk), class-based mixins, (simple) pattern matching, runtime introspection & reflection, "monkey patching" and much more. It runs on Rubinius, the Ruby VM, and thus has first-class integration with Ruby's core library and any additional Ruby libraries that run on Rubinius, including most C-extensions.

It supports concurrency via the actor-model, including first-class futures and async message send semantics built into the language, similar to Io.

For a quick feature overview, have a look at doc/features.md There's also a work-in-progress tutorial/book on Fancy here: https://github.com/fancy-lang/infancy A GitBook version (with PDF, ePub & Mobi formats) is available here: https://www.gitbook.io/book/kary/infancy

Related links

Compiling / Installing from source:

Dependencies:

  • Rubinius. You'll need at least version 2.0.0 for Fancy to work as expected. See http://rubini.us/downloads/ for more information. If you want to take advantage of the latest VM improvements, we suggest using rvm and installing rbx-head. See http://rvm.beginrescueend.com/ for more information.
  • Rake.
  • GNU Bison ( version 2.4 and higher otherwise you will get a Segmentation fault ).
  • GNU Flex.

Given the tools & libraries mentioned above, Fancy should build without problems on most *nix systems. We successfully have built Fancy on Debian & Ubuntu, OpenSuSE and Mac OS X 10.5, 10.6 & 10.7.

Standard building procedure:

Building Fancy is just that easy:

$ cd <fancy_source_path>
$ rake

This should go pretty fast. It actually compiles Fancy's standard library and compiler several times. Once via the bootstrap compiler written in Ruby (see boot/rbx-compiler/), and then via the self-hosted compiler (see lib/compiler/) itself.

Once the bootstrapping process is done, you can run the hello world example:

$ ./bin/fancy examples/hello_world.fy

Build commands

While working on the Fancy core and standard library (files in boot/ and lib/), changes should be automatically picked up by Rake. This means running rake will recompile just those changed files.

Modifying the compiler

If you're working on the Fancy language compiler (lib/compiler/ and boot/rbx-compiler/), you should run rake clean before running rake. This will rebuild the compiler so you can test your changes.

Modifying the parser

If you're working on the Fancy language parser (lib/parser and boot/rbx-compiler/parser), you will need to run rake clean_all before running rake. This will clean all the parser and compiler stuff.

Some technical information:

As the language is running on the Rubinius VM, Fancy shares the same runtime with Ruby. All of Fancy is built upon Ruby objects, so for example when you open the String class in Fancy, it's just Ruby's String class.

Because of this, and because in Fancy's standard library (lib/*.fy) we can define methods with the same name as they're defined in Ruby (but taking no arguments), we have decided not to overwrite the Ruby methods. This ensures that all Ruby libraries for example can use Ruby's Kernel#print or any other method in Ruby's kernel and work seamlessly.

Here's an example:

class Object {
  def print {
    "Print itself to the Console."
    Console print: self
  }
}

To meet this goal, the Fancy compiler renames Fancy methods taking no arguments (like the previous "print" example) to a method named ":print". Using explicit parens syntax will allow you to invoke any Ruby method.

someObject print    # Will actually invoke the Fancy ":print" method.
someObject print()  # With explicit parens invokes the Ruby method.

Ruby method invocation supports passing a block variable to Ruby as a proc.

class Something {
  def open: block {
    someRubyMethod(arg0, arg1, &block)
  }
}
Something new open: |s| { s work }

# with this syntax, calling ruby's inject is just as easy.
# This example will print the number 6
[1, 2, 3] inject(0) |sum, num| { sum + num } println

Copyright:

(C) 2010-2014 Christopher Bertels [email protected]

Fancy is licensed under the terms of the BSD license. For more information on licensing issues have a look at the LICENSE file.

More Repositories

1

rswing

swing wrapper for ruby / jruby
Ruby
15
star
2

defpage

Web development with Common Lisp and hunchentoot
Common Lisp
11
star
3

gumbo-d

D bindings for Google's Gumbo HTML5 parser library
D
10
star
4

efreetpd

Free FTP daemon written in Erlang.
Erlang
7
star
5

blocktalk

Blocktalk - A simple dynamic object-oriented programming language with a taste of Ruby and Smalltalk.
Ruby
7
star
6

ircbod

Simple IRC bot library for the D programming language
D
6
star
7

rogato

A functional, declarative query-oriented programming language with an integrated graph database.
Rust
6
star
8

redis.fy

A Fancy client library for Redis, the open source, advanced key-value store.
Fancy
5
star
9

stackd

A Factor-like simple Stack language implemented in Ruby
Ruby
5
star
10

v-unit

Video rental management software
Java
4
star
11

srxml

SRXML - Simple Ruby XML
Ruby
4
star
12

shorte.d

Simple link shortener service written in D using vibe.d
D
3
star
13

fancy_irc

Simple & stupid irc client written in fancy
Fancy
3
star
14

stupidvm

simple & stupid virtual machine written in c. this is just a little experiment and for hackings sake ;)
C
3
star
15

generica

generica - a simple lisp-like language
C
3
star
16

yarps

Yet Another Ruby Project Management System - A web-based project-management system written with the web-framework Ruby on Rails
Ruby
3
star
17

tinns

TinNS (Neocron MMORPG Server Emulator)
C++
3
star
18

projectmanager

Simple web-based project management system written with Ruby On Rails.
Ruby
3
star
19

fsm.fy

Finite State Machine library for Fancy
Fancy
2
star
20

Thrift.tmbundle

Thrift textmate bundle with union support
2
star
21

rechnernetze

Ãœbungsaufgaben der Rechnernetze Vorlesung SS 2012/13
C
2
star
22

hackalicious

Simple Lisp on Rubinius
Ruby
2
star
23

amorphic

Amorphic Fancy GUI library
Fancy
2
star
24

wuby_tunes

A very lightweight iTunes-Controller-Webapp running on the micro webserver Wuby
Ruby
2
star
25

e_q

Erlang Queue for Elixir
Elixir
2
star
26

lisp-helpers

Some Lisp helper functions
Common Lisp
2
star
27

msgpack.fy

Fancy wrapper for MessagePack serialization/rpc library
Fancy
2
star
28

shortefy

Simple link shortener written in Fancy using sinatra.fy
Fancy
2
star
29

wood

Wood - Tree manipulation library for Ruby
Ruby
2
star
30

ripple.fy

Fancy wrapper for Ripple, Ruby's rich modeling layer for Riak.
Fancy
2
star
31

fancywiki

Wiki in Fancy.
Fancy
1
star
32

hurricane

Fancy DSL for Storm - The distributed and fault-tolerant realtime computation system used at Twitter.
Ruby
1
star
33

fancy-snippets

Code snippets for Fancy's emacs-mode using yasnippet.
1
star
34

SubFancy

Sublime Text 2 Plugin for Fancy
Python
1
star
35

fancy-bot

A simple IRC bot for Fancy written in Ruby with Cinch
Ruby
1
star
36

BlueprintMCPlugin

Minecraft Bukkit server plugin for creating blueprints
Java
1
star
37

bakkdoor.github.com

My blog on things related to Fancy
CSS
1
star
38

fyzmq

FyZMQ - Fancy wrapper for ZeroMQ
Fancy
1
star
39

allochron

Allochron - a pure async actor language
1
star
40

farex

farex is a Ruby framework for agent based modeling, using the FAMOJA Java framework as a backend
Ruby
1
star
41

mineserver

Custom Minecraft Alpha server software written in C++ for Windows and Linux
C++
1
star