Juliar Overview

February 9, 2017 | Views: 2792

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

Intro

Juliar.Future is the latest iteration of Juliar Programming Language. The compiler is built on top of JAVA, so everywhere JAVA can run, the compiler can run. 
This is a huge step we’ve taken to eliminate having to build a compiler for each version.

Download
First thing first, you’ll need to download the latest version of Juliar.Future at: https://www.juliar.org/downloads.ju
You should get JuliarCompiler.jar

Compile

JuliarCompiler.jar works on all platforms that have JAVA installed. So it is system independent!
Run it in CommandPrompt/Console using the following command: 

`java -jar JuliarCompiler.jar something.jrl output`

Where something.jrl is Juliar script and output is output name.
Because Juliar compiles directly into JAVA bytecode, Juliar programs can run anywhere JAVA is installed.

Why?
You might be wondering, why should you use Juliar instead of JAVA? The reason is that Juliar is less imperative and more functional. It can; however, be used as an Object Oriented programming language. Juliar’s aim is to provide the same features of any modern imperative language such as C++ and JAVA and put a twist by adding functional components. Juliar is an easy, fast, and fun language to use.

Creating Juliar File
Create a text file called “something.jrl”. jrl is the extension juliar uses for its files! You can name it anything you want as long as it has an extension of .jrl. 
First you need a main function,

`
function main() = {


}
`

The main function is the entry point of the code. If you do not have a main function, that means the code cannot be run directly. The point of having the main function is so that when code runs directly, it will perform some action. You might not need to perform that action if the code is included in.  Please keep in mind that if you have a main function in an included script, it won’t run unless you explicitly call the main function in that included script.

Creating and calling a custom function
Creating a custom function is very simple:

`function foo() = {

}
`

Where foo is the function name. You might be wondering why is there an equal sign? The reason is that ‘=’ sign copies the content of {} into a callable function.
Juliar is also partly a functional language and if you do not include ‘=’. Juliar would think that you are getting back an object from foo() call and applying {}  on it. So potentially you can have something like function foo(x){3,2} = { return x+$} which will return x+3,x+2 as an object array.

Calling a function is very simple:
`
functionToCall(x,y);
`

Where x and y are variables. You can call custom functions the same way.

Hoisting
Juliar supports function hoisting. Unlike C/C++, functions can be declared in any order (even if they are declared after a functional call).

Dynamic or Static Casting

Juliar supports both static and dynamic casting. It is, however, recommended that you static type variables (i.e. declare their type such as int, float, double, etc)
and dynamic cast the function so that you don’t need to create a template.

Function Overloading


Juliar currently doesn’t support overloading. However, this may change in the future. Let us know how you feel.

Variable Declaration
Variables are declared using one of the following declarations: int, double, float, string, obj. Please note, if you are not sure what type is going to be, you can let the compiler
decide by using var instead.

Printing to Screen

Juliar has lots of options for printing to the screen. If you just want to print, use printLine(“something”). If you know the type or want to cast it to a different type, consider using printInt(64), printFloat(2.3), printDouble(.312321).

Writing/Opening Files
Juliar uses “Open Format” standard for opening and storing files. Hence, it should potentially work on all Operating Systems. To Open a file just do
`
fileOpen(“filename”)
`

Prefix Notation

Juliar allows prefix notation. That means you can arithmetic functions such as +,-,/,* and % before each operation and it will apply to everything after it.
For example, you can do:
`
int x = + 3 2 5 10;
`
which is equivalent of doing
`
int x = 3 + 2 + 5 + 10;
`

This is useful to do when you have a huge file.

Share with Friends
FacebookTwitterLinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterLinkedInEmail
Ready to share your knowledge and expertise?
3 Comments
  1. Ratter have +10 cybytes on me! Have a beer! lol

    ATB…

  2. Useful Post… 😀 +5CB…

Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Cybrary On The Go

Get the Cybrary app for Android for online and offline viewing of our lessons.

Get it on Google Play
 

Support Cybrary

Donate Here to Get This Month's Donor Badge

 
Skip to toolbar

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel