Skip to content

Commit 7000927

Browse files
committed
update
1 parent 07ad274 commit 7000927

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

Main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ fs.readFile(userArgs[1], 'utf-8', function (err, data) {
1515
else if(userArgs[0] === '-e')console.log(eval(transcompiled));
1616
else throw "Error mode flag not recognized";
1717
});
18+
19+
20+
//exports main compiler function.
21+
exports.Compile = cmp.Compile;

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,40 @@
11
#RoyalScript
22

3+
4+
[Playground](https://jweinst1.github.io/Royalscript/playground)
5+
6+
[REPL](https://jweinst1.github.io/Royalscript/repl)
7+
8+
9+
310
##Intro
411

512
RoyalScript is a functional programming languag that aims to combine the utility of popular functional programming languages with the mutable data structures found in object oriented languages. The language is also quickly compiled to compressed JavaScript, so it can be run in the browser, without having to download anything on your computer. Lastly, RoyalScript is also inter-operable with javascript functions. You can call native javascript functions from RoyalScirpt as well!
613

714
RoyalScript is a both a compiled or interpreted language, this depends on the javascript environment that RoyalScript is run in.
815

16+
17+
18+
##Installation and Setup
19+
20+
To install RoyalScript, you can use npm by typing the command:
21+
22+
```
23+
$ npm install -g pike
24+
```
25+
RoyalScript, when run natively uses `.royal` files. To compile a RoyalScrpt file to javascript, use
26+
27+
```
28+
royalscript -j path/to/royalscriptfile
29+
```
30+
This will output the transcompiled, compressed javascript in your terminal. To compile and run a royalscript file, you can use
31+
32+
```
33+
royalscript -e path/to/royalscriptfile
34+
```
35+
36+
You can also use the `Main.Compile` function in your node programs.
37+
938
##Computational Functions
1039

1140
The major difference between RoyalScript and other functional languags lik Scheme is that RoyalScript functions do not *always* evaluate to some resulting value. They do not always return a value. Some functions, such as the `for` function loops over some list of values. Another example is the

0 commit comments

Comments
 (0)