g-script

0.0.1-stable.patch3 • Public • Published

G-Lang

G-Lang (G-Script) is a programming langauge written fully in JavaScript.


language

⚡ Setup

G-Lang is still in development, but you can still test it out.

There is a npm package, namely g-script, that you can download.

$ npm i -g g-script // install the package using the -g arugment!

After that, you now have access to the glang command. Command Usage;

$ glang <options> < run | shell > <filename>
  • <options>: verbose verbose;dev:true dev:true verbose;line line
  • <run | shell>: run <filename.g>: runs a file | shell: runs a interactive shell.

Docs

Variables

A variable is a method of storage, you can store data in a variable, and later access it. There are two types of variables, constant ones and non-constant ones.

  • Constant Variables are variables that cant be changed, after they are defined their value will stay the same, and never change.
  • Non-constant Varivales on the other hand, they can be redefined at any time!

Variables are assigned to a data type, which you can find in the section below.

var hello = "Hello!" // This is a Non-constant variable
const hello = "Hello!" // This is a constant variable

You can access the variables by the variable name, like so, hello.

To redefine a variable, run,

var hello = "Hello 2!"
Data types

These are the currently supported data types in G-Lang;

  • Int (Number)
  • Str (String)
  • Bool (Boolean) true false
  • Obj (Object) {"Test": "hello!"}

You can call all traditional JavaScript functions on your variables, for example, you can run string.substring(0,6) in G-Lang, it will automatically run the JavaScript function for you.

Package Sidebar

Install

npm i g-script

Weekly Downloads

0

Version

0.0.1-stable.patch3

License

MIT

Unpacked Size

27.7 kB

Total Files

25

Last publish

Collaborators

  • glaukio