Sunday, March 22, 2015

Introduction to Fuzuli : JFuzuli REPL


JFuzuli is the JVM implementation of our programming language Fuzuli which is based on LISP syntax and Algol family programming logic. Fuzuli is a modern collaboration of these two separate family of languages.

Let's try JFuzuli:




1. Download the Jar 

The current compiled jar of JFuzuli interpreter is release candidate 1.0. You can download it using the link https://github.com/jbytecode/fuzuli/releases/tag/v1.0_release_candidate. You can always find the newest releases in site JFuzuli Releases.

2. Open the Command Prompt

After downloading the jar file, open your operation system's command prompt and locate the jar file by using cd (change directory) command.

3. Start trying it!

In command prompt, type

java -jar JFuzuli.jar

to start. You will see the options:

Usage:
java -jar JFuzuli.jar fzlfile
java -jar JFuzuli.jar --repl
java -jar JFuzuli.jar --editor


You can specify a fuzuli source file to run. The option --repl opens a command shell.  The last option --editor opens the GUI.  Let's try the command shell. 

java -jar JFuzuli.jar --repl
F: 

The prompt F: waits for a convenient Fuzuli expression. Now we can try some basic commands:

F: (+ 2 7)
9.0
F: (- 7 10)
-3.0
F: (require "lang.nfl")
0.0
F: (let mylist '(1 2 3))
[1.0, 2.0, 3.0]
F: (first mylist)
1.0
F: (last mylist)
3.0
F: (length mylist)
3
F: (nth mylist 0)
1.0
F: (nth mylist 1)
2.0


Well, we introduce some basic operators, data types and commands here but not all of them. We always put an operator or command after an opening parenthesis, arguments follow this operator and a closing parenthesis takes place. This is the well-known syntax of LISP and Scheme. So what is the language properties, what are the commands, how to try more Fuzuli codes in JFuzuli??

Fuzuli Language home page: http://fuzuliproject.org/
Have a nice read!


No comments:

Post a Comment

Thanks