itskarudo / ore

🪙 The Ore Programming Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ore Language Specification

Variables

a = 5
global b = 6

Comments

-- This is comment

Primitive data types

num, str, bool

Data structures

array = [1, "sloopie", false]
array[0] = 1

map = {a: 5, b: true}

map.a = function (x) {
    print("x is " .. x) -- "x is 5"
  }

map.a(5)

Modules

time = import("time")
pages = import("./pages")

export a = 5
b = 7
c = false

export {
    b,
    c
}

Control flow

while i > 5 {
  i += 1
}

for i in (1, 5, 2) {
  print(i)
}

do {
  print(i)
  i += 1
} while i > 5

if pp > dd {

} else if pp < dd {

} else {

}

switch a {
  1: {
      
  }
  2,3,4: {

  }
  default: {

  }
}

Functions

a = function(a, b, x = 5) {
  print(a,b,x)
}

function b(a, ...) { -- varargs
  print(a, ...)
}

Operators

Arithmatic

  -- Addition: +
  -- Subtraction: -
  -- Multiplication: *
  -- Division: /
  -- Integer division: //
  -- Exponentiation: **
  -- Modulus: %

Assignment

  a += b
  a -= b
  ...

Logical

a = true and false
a = true or false
a = true xor false
a = not true

Bitwise

a = 1 & 2 -- and
a = 1 | 2 -- or
a = ~1    -- not
a = 1 ^ 2 -- xor
a = 1 << 2 -- shift left
a = 1 >> 2 -- shift right
a = <4    -- MSB
a = >4    -- LSB

String operations

a = "zoubi " .. "zou" -- concatenation
strlen = #a
t = [1,2,3]
tblen = #t

About

🪙 The Ore Programming Language

License:GNU General Public License v3.0


Languages

Language:C++ 97.9%Language:CMake 2.1%