-
Notifications
You must be signed in to change notification settings - Fork 0
Home
MaisaMilena edited this page Jul 2, 2019
·
7 revisions
Let's take a look into Formality Core making some simple exercises. A more deep explanation about the language can be found in Formality Core Wiki.
- You must have
npm
installed - On Terminal run
npm i -g formality-core
- Check its installation running
fmc
FormalityCore functions can be accessed by any other .fmc
file in the same folder, it works like every file import
the others. Despite this, only 1 def main
will be executed and it'll be the last one found by the compiler. If you want different executions on main
, separate the files on different folders.
- On Terminal, go to the directory where Formality file is.
- To see other running options, open the Terminal and type
fmc
. You should be able to see a lot of options. - For now, to simply run the code, only use
fmc main
. Also, sometimes you will need to check your code on the interpreter and interaction nets (more details about this will be provided later):
- use interaction nets:
fmc -l main
- use an interpreter boxed:
fmc -b main
The first one, shows the code output, the data about usage of Interaction Combinators Network (inet), as the number of rewrites. Inet removes boxed values on runtime (we will talk about this later), so sometimes it may fail, showing a wrong value.