Going Fishin’ for Koi

Here is the start of my journey to writing my own programming language and it’s counterpart compiler.  Since I’ve already spent considerable amount of time dedicated to it before starting this blog, my immediate goal is to document my current standings here so that as time progresses, it doesn’t appear to be jarred or difficult to follow.

What is the purpose of KoiFish?  KoiFish aims to be a general purpose programming language that is object-orientated and has an inferred type system with a emphasis on syntax readability based not on verbosity but rather the programmer’s familiarity with symbols and language associated with meta-programming techniques (such as UML and pseudo-code generation) and lingo.

Phew! What a mouth full.  All marketing aside, it’s an experiment into the depths of one of my favorite subjects of computer science!

All languages start with some grammar, and presently, here is the most updated version of KoiFish’s grammar:

<definition> := koi <access_modifier> <identifier> <function>+ | def <access_modifier> <identifier>
<function> := fn <access_modifier> <indentifier> {:<identifier> }+ begin
<statement>
{return <expression>}
end;
<access_modifier> := + | – | #
<statement> := def <identifier> = <expression>
| <identifier> = <expression>
| for <identifier> = <expression> to <expression> begin <statement> end
| if <boolean_expression> then <statement> end
| if <boolean_expression> then <statement> else <statement> end
| readi <identifier>
| readf <identifier>
| puts <expression>
| return <expression>
| call <identifier>{@<identifier>} {:<identifier> }+;
| <statement> ; <statement>
<expression> := <string>
| <float>
| <int>
| <bool>
| <array>
| call <identifier>{@<identifier>} {:<identifier> }+;
| <allocation_expression>
| <binary_expression>
| <concat_expression>
| <identifier>
| nil
<concat_expression> := <expression> . <expression>
<allocation_expression> := alloc <identifier>;
<boolean_expression> := <expression> <equality_operator> <expression>
<equality_operator> := > | >= | < | <= | == | !=
<binary_expression> := <expression> <binary_operator> <expression>
<binary_operator> := + | – | * | /
<identifier> := <char> <identifier_rest>+
<identifier_rest> := <char> | <digit>
<array> := [] | [{<float>|<int>|<bool>|<string>,}+]
<bool> := TRUE | FALSE
<float> := <int>.<int> | .<int>f
<int> := <digit>+
<digit> := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<string> := ” <string_element>+ ”
<string_element> := <any char other than “>
Advertisements
This entry was posted in KoiFish and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s