Shield language var0.1

Shield language var 0.1

This language is a self-made language that incorporates what I think is good about Python, C #, Kotlin, and v. It is highly extensible and has the same speed as Java. It does not use much memory like Jit and parallelization is not difficult.

ex.shie


using Sys
using Os <-Os.ptr,Os.Pointer.Nullptr,Os.Pointer.thisptr,Os.Pointer.ID,Os.Pointer.Out,Os.Environment.Exit etc.
using Collection #<- class Enumerable,class Range,class Array,class List(Default),class Dict,class...
from Sys using static Console
from Sys using Environment <-Exit,
from Sys using static Math
delegate file as files //Function alias

static class ex():
    def do_File() ():
        opt var t = 1
        opt f float = Null
        lst = new int [[1,2,3],[6,7,2,4],[7,10,24,66,13]] #list
        lst1 = new int [10,30]
        lst2 = new [[val = for(x in Range(10)) if(x == 4 and y == 6) break] for(y in Range(10))]
        itg := 1 #Immutable ERROR itg= 3
        string := "VVAN.png "
        opt fstring str = Os.File.Is_Pass(string) #If there is no pass None Unit
        if (not fstring):
            return #Automatically None Unit
        else:
            WriteLine(string+"Is" + fstring"Exists in")
            return 

    pub def Main(Matual_Girls str):
        WriteLine(ex.do_File()) #Static object reference is the object name.Access with. Normally this.Access out with->None
        ex.mycls = cls() 
        ex.mycls.show()

struct stl:
    pub def _init():
        pub self.x = 500
        pub self.y = 400
        pub self.z = 0

class cls():
    pub def _init():
        get set del this.mylist = [for(i in Range(10)) if(i%3 is _Nothing()) 1 elif(i%2 is _Nothing()) 2 else Null] //Null for else
    
    pub def show():
        WriteLine(for(l in this.mylist))
        get set del opt this.stl_s stl = Null

if(_name == "__main__"):
    ex.Main()

(*
Variable is optional variable name type=variable
Member object access is self.~,this.~
Unit type(C++Nullptr_t type)はNoneとNullのみ。普通のメソッドはNoneを返す。ジェネリクス等でWhere selfと書くと値型で非staticなものWhere struct と書くと全ての値型が取り出される。Unit typeは特殊で、Unit classと書くとNoneのみUnit struct と書くとNullのみ。Where t is false と書くと_Nothing()The value is chosen.
Jump instruction is break(##<T>),continue(##<T>),return,yield,yield break,There is yield continue.
*)

How the shield language works

Ahead-of-time (static link)-> jcp file generation (file running in container)-> container (absorbing singularity between dynamic link / GC / platform)-> Jit compilation-> CPU / compared to language VM running in execution It is good because the memory usage is small. ** Speed is about * Java * ability ** I want to put it out so I don't regret it, right? Shall I answer ** yes ** even if I am told **?

Recommended Posts

Shield language var0.1
Proposal of a new language shield language framework
Difference between using and import on shield language