koi-lang 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +18 -14
- data/VERSION +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
= Koi
|
2
2
|
|
3
|
-
Koi is a small programming language that is designed to be easy to use, easy to understand and easy to implement.
|
3
|
+
Koi is a small programming language that is designed to be easy to use, easy to understand and easy to implement.
|
4
|
+
|
5
|
+
Koi is an imperative, dynamic, weakly-typed language with first-class functions. Koi's syntax and features were influenced by JavaScript, Lua and Ruby. Koi makes a point of working very hard to be unambiguous in it's syntax so that it is easy to write parsers for.
|
6
|
+
|
7
|
+
Koi's main goal is to be a useful language that teaches the basics of language implementation. The project was started because I wanted to learn more about how languages work 'under the hood' and Koi is my way of sharing what I've learnt with as many people as possible.
|
4
8
|
|
5
9
|
=== Example
|
6
10
|
|
@@ -24,7 +28,7 @@ This is an old-school 'Blast Off!' program written in Koi:
|
|
24
28
|
|
25
29
|
=== Installation
|
26
30
|
|
27
|
-
For ease of
|
31
|
+
For ease of use the default installation of Koi is packaged as a RubyGem. Providing you already have Ruby and RubyGems installing Koi is as easy as entering the following command in a terminal:
|
28
32
|
|
29
33
|
gem install koi-lang
|
30
34
|
|
@@ -55,22 +59,22 @@ Koi features a full set of basic and compound data types including:
|
|
55
59
|
Koi currently only implements a minimal set of flow control operators:
|
56
60
|
|
57
61
|
if( expression )
|
58
|
-
|
59
|
-
|
62
|
+
do_work
|
63
|
+
end
|
60
64
|
|
61
65
|
unless( expression )
|
62
|
-
|
63
|
-
|
66
|
+
do_other_work
|
67
|
+
end
|
64
68
|
|
65
69
|
=== Built-in functions
|
66
70
|
|
67
|
-
print( string )
|
68
|
-
gets()
|
69
|
-
call( identifier [, parameter])
|
70
|
-
tailcall( identifier[, parameter])
|
71
|
-
return(
|
72
|
-
to_string( value
|
73
|
-
type_of( value )
|
71
|
+
[print( string )] Writes a string to STDOUT.
|
72
|
+
[gets()] Fetches a newline delimited string from STDIN.
|
73
|
+
[call( identifier [, parameter])] Calls the function that is stored in 'identifier'.
|
74
|
+
[tailcall( identifier [, parameter])] Performs a 'tailcall' to the function stored in 'identifier'. This type of call is used when recursing heavily to improve performance and to facilitate the use of functions as iterators. {More information on tailcalls.}[http://en.wikipedia.org/wiki/Tail_call]
|
75
|
+
[return([ value ])] Return a value from a function.
|
76
|
+
[to_string( value )] Converts the given value to a representative string.
|
77
|
+
[type_of( value )] Returns a string representing the type of the value given, eg: "integer".
|
74
78
|
|
75
79
|
=== Reserved words
|
76
80
|
|
@@ -84,7 +88,7 @@ The default installation of Koi consists of the following discrete components:
|
|
84
88
|
* The reference compiler: {koi-reference-compiler}[http://github.com/aarongough/koi-reference-compiler]
|
85
89
|
* The standard Virtual Machine: {koi-vm-ruby}[http://github.com/aarongough/koi-vm-ruby]
|
86
90
|
|
87
|
-
Each of these components are completely stand-alone and are specifically designed to be as simple as possible. I strongly encourage pulling them apart to see how they tick, and changing them if you see fit! Just make sure
|
91
|
+
Each of these components are completely stand-alone and are specifically designed to be as simple as possible. I strongly encourage pulling them apart to see how they tick, and changing them if you see fit! Just make sure to contribute any improvements back to the main repository!
|
88
92
|
|
89
93
|
==== Hope you enjoy Koi!
|
90
94
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Aaron Gough
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-09-01 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|