Skip to content

Khayyam is a programming language with goals to improve coding and thinking style!

License

Notifications You must be signed in to change notification settings

GeniusesGroup/Khayyam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Khayyam Programming Language

This language is ideal for developers that want a clean spoken code that can write most performance library and application with it!

File extension

We choose .kh for files that have Khayyam language codes!

Top Level Keyword

type -> data-types

Khayyam force you naming a type with one of below type as type {Name} {Type}

  • Digital computing
    • ptr as Pointer to point specific memory location. Size depend on CPU architecture(32||64||...bit)! e.g. type buf ptr
    • bool to work on any boolean logical! Usually 1 octet(byte-8bit) size! It can hold value 1 or 0 as true or false. e.g. type ok bool
  • Numerical indicate by [x]NS e.g. type testNum [3]N
    • x can be
      • fixed size of number in octet||byte! Can be any natural number (x>0)!
      • "x" itself just in function argument to indicate it can get any number size. Can't use in structure type
    • NS can any Number systems:
  • Array indicate by this syntax [x][x]...T and it is fixed size! e.g. type testArray [256][1]N
  • structure indicate by struct{...} that has some other types inside themself!

const -> Constant

const, unlike other languages, is not very hard immutable data! Dev can change in runtime but unlike var, it will change binary code and don't need to get it by memory call! Compiler and runtime just let to change the value with the same memory size!

var -> Variable

Like other programming languages, var keyword uses to store data in any mutable device. But unlike other, vars declare inside a function store

func -> Function

Two type function supported:

  • func name(args) (returns) >> pure standalone function
  • func (type receiver) name(args) (returns) >> method function

Runtime

We offer very simple but with some unique logic!

Change logic in runtime!

You can write code to change binary code in runtime!

Rules

  • The function body can omit in write code and add by compiler plugins as know code generation!
  • Public of the first-class keyword indicates by a capital letter of identifier word and vice versa! Khayyam doesn't offer any specific keyword for this purpose like Go language!

Not implement features!!?

In this part, we say why not choose something that be real in some other programming languages!

Packaging

We can't decide yet to offer any package some files code!

GC (Garbage Collection)

Interface

We can't decide yet that Khayyam must support interface type!!

Tuples

Tuples are implemented by two dynamic and static type languages!

  • In a dynamic language, tuples implement unsafe structures that allocate by the runtime and have a performance penalty for the app because we use runtime for developing or compiling phase!!
  • In a static language, tuples implement safe structures that just don't have internal names! But it is duplicate work, more learning curve and adds more confusing situation just lazy developer to not indicate names!!

Type Inference

Khayyam don't support type inference and also you can't assign to var before you decare it!

var x = 41      >> var x [1]W = 41
var y = 3.14    >> var y [32]Q = 3.14

Loop

We think loop can implement easily by goto instead of while, for, do, ...!!

Dependency Management

We don't offer any version control for your codes, So we must not offer any dependency management too!

Keyword in a glance

type Logical *********** *********** ***********
ptr if
bool else if
struct else
const true
var false
func goto

Inspired of

Languages

These languages inspirations don't mean just about get good idea but mean drop bad idea from these and not implement them!

Articles

Khayyam word meaning

Omar Khayyam was a Persian mathematician, astronomer, philosopher, and poet.

About

Khayyam is a programming language with goals to improve coding and thinking style!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published