@@ -32,6 +32,7 @@ <h1>FusionScript</h1>
3232
3333< h2 > Contents</ h2 >
3434< ul >
35+ < li > < a href ="#What_is_FusionScript_ "> What is FusionScript? </ a > </ li >
3536< li > < a href ="#Commands "> Commands </ a > </ li >
3637< li > < a href ="#Examples "> Examples </ a > </ li >
3738</ ul >
@@ -67,10 +68,71 @@ <h2>Programs</h2>
6768< h1 > FusionScript < a href ="https://travis-ci.org/RyanSquared/fusionscript "> < img src ="https://travis-ci.org/RyanSquared/fusionscript.svg?branch=master " alt ="Build Status "/> </ a > </ h1 >
6869< p > The programming language of ultimate dankliness</ p >
6970
70- < p > < strong > Warning:</ strong > This project is very recently released and possibly has many bugs.
71- If your code does not compile, it is < em > very</ em > likely a problem in the compiler
72- instead of your code. Please feel free to add an issue if any errors arise that
73- you believe were caused by the compiler.</ p >
71+ < p > < strong > Warning:</ strong > This project is very unstable and possibly has many bugs. If your
72+ code does not compile, it is < em > very</ em > likely a problem in the compiler or a
73+ change in the language instead of your code. Please feel free to add an issue
74+ if any errors arise that you believe were caused by the compiler.</ p >
75+
76+ < p > < a name ="What_is_FusionScript_ "> </ a > </ p >
77+ < h2 > What is FusionScript?</ h2 >
78+
79+ < p > FusionScript is a language that runs on the Lua runtime (currently, by
80+ transpiling to Lua and then using a Lua interpreter) inspired by C++, Python,
81+ and Lua. Eventually, FusionScript will compile to a modified Lua 5.3 bytecode
82+ and run on a modified Lua VM.</ p >
83+
84+ < p > FusionScript offers an improved runtime type checking system (that
85+ checks between both native Lua types, as well as instances of a class) by using
86+ the < a href ="/RyanSquared/stdlib "> standard library</ a > 's < code > assert.is()</ code > method. Eventually,
87+ runtime type checking may be implemented using syntax similar to Pythonic type
88+ hints and checked using bytecode instructions.</ p >
89+
90+ < p > FusionScript also has a class system, with the ability to inherit values from a
91+ superclass as well as an "interface" system that when used (see below) will
92+ ensure that classes implement certain methods. Below is an example that closely
93+ mirrors the standard library's scope module:</ p >
94+
95+
96+ < pre >
97+ interface IScope { descope; with; }
98+ class Scope {
99+ with(fn)=> {
100+ fn(self);
101+ }
102+ }
103+
104+ < span class ="comment "> -- Example:
105+ </ span >
106+ < span class ="keyword "> local</ span > lfs = < span class ="global "> require</ span > (< span class ="string "> "lfs"</ span > );
107+
108+ class UseDir extends Scope implements IScope {
109+ descope()=> lfs.chdir(@old_dir);
110+ __init(directory)=> {
111+ @old_dir = lfs.currentdir();
112+ @dir = directory;
113+ lfs.chdir(directory);
114+ }
115+ }
116+
117+ UseDir(< span class ="string "> "/tmp"</ span > ):with(\=> {
118+ File(< span class ="string "> "thing.txt"</ span > ):with(\file-> {
119+ file:write(< span class ="string "> "Hello World!\n"</ span > );
120+ });
121+ });
122+ </ pre >
123+
124+
125+ < p > There is also implemented an easier way to use generators / iterators using the
126+ < code > async</ code > and < code > yield</ code > functions:</ p >
127+
128+ < pre > < code > async gen_numbers(low = 1, high)->
129+ for (i=low, high)
130+ yield i;
131+
132+ for (number in gen_numbers(1, 10))
133+ print(number);
134+ </ code > </ pre >
135+
74136
75137< p > < a name ="Commands "> </ a > </ p >
76138< h2 > Commands</ h2 >
@@ -250,7 +312,7 @@ <h3>Building</h3>
250312</ div > <!-- id="main" -->
251313< div id ="about ">
252314< i > generated by < a href ="http://github.com/stevedonovan/LDoc "> LDoc 1.4.6</ a > </ i >
253- < i style ="float:right; "> Last updated 2017-05-08 19:58:29 </ i >
315+ < i style ="float:right; "> Last updated 2017-05-09 20:46:56 </ i >
254316</ div > <!-- id="about" -->
255317</ div > <!-- id="container" -->
256318</ body >
0 commit comments