-
Notifications
You must be signed in to change notification settings - Fork 22
/
README
110 lines (81 loc) · 3.65 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
The Fancy Programming Language
(C) 2010 Christopher Bertels <chris@fancy-lang.org>
http://www.fancy-lang.org
----------------------------------------------------------------------
Fancy is a dynamic, object-oriented programming language heavily
inspired by Smalltalk, Ruby and Erlang. It will support dynamic code
evaluation (as in Ruby & Smalltalk), concurrency via the actor-model
and many more features yet to be implemented.
----------------------------------------------------------------------
It’s still in development, the implementation consisting of an
interpreter written in C++.
For some example code (that can be successfully executed), have a look
at the examples/ directory.
There's also lots of test coverage code. Have a look at the tests/
directory for these. The tests are written in FancySpec, a simple
testing library (somewhat similar to Ruby's RSpec). FancySpec's
implementation can be viewed in lib/fancy_spec.fnc.
----------------------------------------------------------------------
Compiling / Installing from source:
------------------------------------
Fancy is currently built using flex & bison for parsing and uses the
BoehmGC for garbage collection. You'll need the following
libraries/programms in order to build the sources:
- GNU Make
- Bison ( version 2.4 and higher )
- Flex
- libgc ( BoehmGC - It's included in the vendor/ directory
but you can also get it here:
http://www.hpl.hp.com/personal/Hans_Boehm/gc/ )
For example, to build on Ubuntu Linux, run:
$ cd <fancy_source_path>
$ sudo apt-get install g++ make bison flex
$ make && make test
I've successfully built Fancy on Debian & Ubuntu, OpenSuSE and Mac OS
X 10.5. Given the tools & libraries mentioned above, it _should_ build
on most Unix compatible platforms. If you find a system it doesn't
compile on, let me know.
----------------------------
Some technical information:
----------------------------
What's already working?
------------------------
- Class definitions
(including nested classes that work like modules / namespaces)
- Instance & class method definitions
- String, Integer, Float, Array, Hash (HashMap) & Block literals
- Method & Operator calls
- Instance & class variable access
- Dynamic getter and setter method definitions (similar to Ruby's attr_acessor)
- Loops
- Support for closures (it works but there's definately room for
performance improvements)
- File reading and writing
- Class-Mixins (including methods of one class into another)
- Exception handling
What's still missing?
----------------------
- Pattern matching
- Concurrency stuff (Actor-model based concurrency features as in
Erlang)
- Some more advanced stuff, e.g. runtime inspection of method calls
via MethodContext etc. (advanced stuff - saved for later)
- Rubinius VM bytecode compiler
How is it implemented?
-----------------------
- Currently, theres a quite simple interpreter written in
non-idiomatic C++.
Sorry, I'm not a big C++ programmer. It should be fairly easy to
read though.
- It uses the BoehmGC for garbage collection.
- Currently the lexer & parser are built with flex & bison.
- I'm planning to add a bytecode compiler soon, written in the
language itself. I'm planning on bootstrapping and targeting the
language for the Rubinius VM.
----------------------------------------------------------------------
Copyright:
-----------
vendor/gc: GC Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
For more information see the vendor/gc directory.
Fancy is licensed under the terms of the GNU LGPL v3. For more
information on licensing issues have a look at the LICENSE file.