compiler image
// c++ ruby and rust like I don't know
import@[<std>,<std_interface>,"some.ch","some.ci"]//<std>, coolheader,coolimpl
// class view, class needs end and fn and decl data needs end
cls Some
pub Some()
end [default]// no with is ok as well when 1 provided
pub Some(name:string):name{name}//pre decl type for constructor
//this.name = name;
end
pub Some(Some &&rval)// not support not post decl for constructor
// core_move(rval);
%%notimpl
end
self Some(Some &rhs) // private constructor
// not impl
end with [delete,deprecate] //if more than 1 attribute use with
pub fn say:()->() //
print("some obj calls")
end fn
self fn say_helper:()->()
print()// fn call
end fn
decl data // decl data is keywork that work for cls data section
self name:str // self is private or None pre decl is ok as well
pub id:int with[get] // pub is pub
pub(self) p_addr with[get]// pub(self) is protected that means this data can be inherited
end decl
end cls
// include , import, attribute can have [...]
cls Derive(include [Some,Cloneable,Printable])// support for derive 1 cls and more than 1 able
pub fn debug_print :(Derive &)->()
%%notimpl //%% is say that this func will deprecate when compile
end fn
end cls
// cls can have range (enum) (struct) (c/c++have)
cls(enum) What
end cls
// usage of cls
// when in fn main, needs ;
fn main:()->int
if __name__ == "main" {
print("ok")
}
// decl a obj
Some s{}
Some s{Some{}} //use Some(Some &&rhs)
s.say()
print(s.id)
Derive d{}
d.say()
print(d.p_addr)
end fn
// decl a interface
interface Cloneable
%%notimpl// when some end code have %%notimpl that code will not compile
pub fn clone:()->()
%%notimpl
end fn
end interface
// I dont knoe how to design a language
// dynamic momory management
Some ds{core_new(Some{})}// let core_new be a fn in core,when Some impl Dropable no need for delete
core_delete(s); // when you have to explictlly delete
// generic type
- GT for CLS // pre decl class HCLS is generic class
- T:Cloneable,U:Countable// this sectino says what is GT,and you can make it more spec
cls CLS
%%notimpl
end cls
// ctrl flow is rust like pass
// functional programming yet should be include
// comment is // and /**/
// std and std_interface or std_math or some lib like c++ have
// link to c or c++ should be include
// builtin design pattern should be include
// tool chain I think that is not needed
// project structure
/*
cheader/**.ch
cimpl/**.ci
main.ci
scripts/{**.bat,**.sh}
*/