Description
While exploring new places where I can go with programming. I realized I'm writing a lot of code but it's defined by someone else. I wanna try writing in a language where I've decided everything.
Defining features
- less small tokens such as ;{}()
- built in Option type to use instead of null handling
- self compiled -> (original compiler was built in rust)
- simple generics
- string formatting like c# $"some text {variable_name}"
- compiled language
- can work together with c/c++ since it transpiles to it
- compiles using gcc
- it's own build tool that can help compile & run and more.
Inspiration
- c++ (the code is basically c++ but with another face)
- c# (really like the way string formatting works, and how you implement generics)
- python (Really enjoy prototyping in a language with less mandatory tokens)
- rust (syntax order for some specifics such as fn <function name>(<args>) -> return_value)
Sample of syntax
definately not everything
//inc => vector (include c++ headers)
get => print, option
get => library/[module, othermodule]
class Parent
protected
    int age = 0
private
    string name = ""
    Parent => do return
pub
    fn as_str => string doremi $"{name} - {age}"
;
class SomeClass<T> => Parent
    T generic_value
    SomeClass string name, int age, T generic_value =>
        this->name = name
        this->age = age
        this->generic_value = generic_value
    ;
pub
    fn get_age => int doremi name
    fn get_generic<T> T
         return generic_value
    ;
;
fn main =>
    println($"Arguments count: {argc}")
    for i until 100
        println(i)
    ;
    let elements = {1,2,3,4,5,6,7}
    foreach i,e in elements
        println($"{i + e}")
    ;
    let a = rand() % 2 == 0 ? Some("hello world!") : None<string>()
    select hello from a
        println(hello)
    ;
    if a.is_none()
        println("a is nothing")
    ;
    elif a.is_some()
        println("a is something")
    ;
    else
        println("this shouldn't happen")
    ;
    if a.is_none() doremi 0
    elif a.is_some() doremi 1
    else do println("this shouldn't happen")
;
 
     
                                
Comments (0)