GLP // GLANG

empower your code with GLANG

Documentation

All functions and guides can be found here

Running GLP

Quick // Easy Start

Download the GLANG I/O latest release and open the command line

Advanced Start

Fork the GLP repo, customize the std-raw.js (if you want to expand the standard library), type node main.js and start running code

Build GLP

Fork the GLP repo, and run "pkg main"

Philosophy

How to call functions

Type functional commands in the form of:

(function-name (arg) ... (arg))

which calls function-name passing all following if any:

(arg) ... (arg)

Standard Library

To modify/add functions to the standard library, change std-raw.js to your liking

Fundamental Standard Library Functions

Function Definition

(makeFunction function-name (body) (return) (arg) ... (arg));

defines a function named function-name of process returning (return) with args (arg) ... (arg))

Variables

(create variableName);

creates a variable named variableName

(create variableName (arg));

creates and initializes variable named variableName with (arg) value

(set variableName (arg));

initializes variable variableName with (arg)) value

If Statements

(if (arg) ... (arg));
(ifelse (arg) ... (arg)):

Performs conditional branching where first (arg) is a condition,
second an action third is alternative action: (arg)(arg) Both if and
ifelse do the same but distinction is recommended for semantic purposes.

For/While Loops

(for (arg) (arg) (condition) (arg));

runs a for loop for variable (arg) of initial value (arg) when (condition) executing (arg)

(while (condition) (arg));

runs a while loop when (condition) executing (arg)

Arithmetics

(add (arg) ... (arg));

Adds two numbers with args: (arg) ... (arg)

(subtract (arg) ... (arg));

Subtracts two numbers with args: (arg) ... (arg)

(multiply (arg) ... (arg));

Multiplies two numbers

(divide (arg) (arg));

Divides two numbers

(exp (arg) (arg));

Returns exp: (arg)^ (arg)

I/O

(print (arg) ... (arg));

Prints the value of (arg)

Coming soon: (input (arg));

Returns value of (arg) after it being typed by user

Comparison

(more (arg) (arg));

Checks if the first (arg) is more than the second (arg)

(less (arg) (arg));

Checks if the first (arg) is less than the second (arg)

Consequential Calls

(actions (arg) ... (arg));

Consequently, calls each (arg) function

Comments

(comment (arg) ... (arg));

Returns ()

Comments

(comment (arg) ... (arg));

Returns ()

Special non-GLP Commands

Use those commands on the GLP command prompt

exit

exits the GLP console the program

file inputfilename.glp

set console input to GLP/filename.g (read file) (example file in GLP/g.g)

out filename.js

set output to be copyed to filename.js (write file) (example file in GLP/out.js)

GLP // GLANG

empower your code with GLANG

made by Gerassimos

gerassimosm@gmail.com

Copyright © Gerassimos Moutafis 2024

GLP GLANG LOGO