Mi lenguaje de programacion lima

en lima se pueden hacer cosas como estas

# MKF7.lima

# abstract:
#   because cant conect the debugger with the code this emulates it

# and because that "if dont have the tools of MKF7 make it by youself"

# please execute this before make anything in the uefi , basically its the uefi base

# save the code to the 0 segment (generally the lima base)

org
0
org
1
# for restore uefi and dont lose nothing

sendmw uefi_prototypes()

sendmw uefi_boot()

sendmw uefi_shutdown()

__endprog__


### !
### ! A NEW SECTION WILL BE START SOON
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

######!
######!
######!
######!
######!
######!
######! MKF7 variables convertion
######!
######!
######!
######!
######!
######!

[intersegmental]
message uefi_prototypes()

[globalize]
var
    _returned
       =
    prototype

[globalize]
var
    _action
       =
    prototype

[globalize]
var
    _data1
        =
    prototype

[globalize]
var
    _data2
        =
    prototype

[globalize]
var
    exit from boot services?
       =
    0

[globalize]
var
    uefi recover segment number
       =
    1

[globalize]
var
    _@zip.current_archive
        =
    "Z"

[endmsg]

### !
### ! A NEW SECTION WILL BE START SOON
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

######!
######!
######!
######!
######!
######!
######! prototypes
######!
######!
######!
######!
######!
######!

# prototype for uefi_fs
[prototype]
message uefi_fs() 

    prototype

[endmsg]

# prototype for uefi_arr
[prototype]
message uefi_arr()

    prototype

[endmsg]


# prototype for efishell
[prototype]
message efishell()

    prototype

[endmsg]

# prototype for uefi_boot
[prototype]
message uefi_boot()

    prototype

[endmsg]

# prototype for uefi_shutdown
[prototype]
message uefi_shutdown()

    prototype

[endmsg]

# prototype for uefi_reset
[prototype]
message uefi_reset()

    prototype

[endmsg]

# prototype for uefi_exit_boot_services
[prototype]
message uefi_exit_boot_services()

    prototype

[endmsg]

### !
### ! A NEW SECTION WILL BE START SOON
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

### !
### !
### !
### !

######!
######!
######!
######!
######!
######!
######! built-in MKF7 messages but implemented here
######!
######!
######!
######!
######!
######!

# intersegmental for make it a global message

###! shell commands
[intersegmental]
message shell_command()

.

#jt
#    do_echo

if
(
    @ScratchVar(_action)
    ==
    "ls"
)
{
section
do_ls
    #
    # setuping
    #

    var
        i
        =
        0

    #
    # get the array of the files
    #

    echo "in ls"

    mov
        @eax
        "/glob -gtv -array_startswith"

    mov
        @bx
        "Z>"
    
    %^"!p"

    var
        list
        =
        @ScratchVar(_returned)

    echo list

__endprog__
}

__endprog__

section
do_echo
    #echo "in echo"
    var
        msg
        =
        @ScratchVar(_action)

    var
        msg
        +=
        5

    #echo msg
__endprog__

[endmsg]

###! uefi misc functions
[intersegmental]
message uefi_arr()
    if
    (
        @ScratchVar(_action)
            ==
        "0x0"
    )
    {
        var
            gx
            =
            Console.SizeX

        var
            gx
            -=
            4
        
        var
            gx
            /=
            2

        var
            gy
            =
            Console.SizeY

        var
            gy
            /=
            2

        #gotoxy gx gy

        cecho "MKF8"

        button_echo "the best know firmware solution builded in lima"
    }
[endmsg]

###! net
[intersegmental]
message uefi_net()

    section
    Main

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x01")

    jt
        .recive

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x02")

    jt
        .send

    __endprog__

    # recive
    # 
    # Summary:
    # 	recive a content from a url
    # 
    # Params:
    # 	@_data1: the url
    #   @returned: the return value
    # 
    # Registers used:
    #   @eax: for the commands
    #   @bx: the data send
    # 
    section
    .recive

        mov
            @eax
            "/get-url"

        mov
            @bx
            @ScratchVar(_data1)

        #!
        %^"!p"
            # <- esto devuelve automaticamente el _returned

        if
        (
            @ScratchVar(@ax)
            ==
            "unsupported"
        )
        {
            mov
                _returned
                "falied to fetch"
        }

    __endprog__

    # MyFunction
    # 
    # Summary:
    # 	send a data from a server
    # 
    # Params:
    # 	@_data1: the url
    #   @_data2: the data to send
    #   @returned: the return value
    #
    # Registers used:
    #   @eax: for the commands
    #   @bx: the data send
    # 
    section
    .send

        mov
            @eax
            "/send-set-url"

        mov
            @bx
            @ScratchVar(_data1)

        %^"!p"

        mov
            @eax
            "/send-url"

        mov
            @bx
            @ScratchVar(_data2)

        %^"!p"

        if
        (
            @ScratchVar(@ax)
            ==
            "unsupported"
        )
        {

        }

    __endprog__

[endmsg]

###! diskload actions
[intersegmental]
message load_files()

    echo "loading files..."

    jump
    Main
    # only vfat12 , the subdirs cant be load

    # this loads the files of your real pc in the path where is the uefi executable and coppy it to the
    # Z hard disk

    # Main
    # 
    # Summary:
    # 	the copy main
    # 
    # Params:
    # 	@(your files in the fd dir): for coppy to the virtual disk
    #   @(obiusly your personal files if you want): but is necesary for can put your files in the uefi
    # 
    section
    Main
        # note: all changes maked to the files cant affect to the real file because this loads a
        # coppy and not the real files, and lima only allows read but not write files and directorys
        .
        var
            file_to_load
            =
            0

        #
        # get files count in the dir
        #

        mov
            @eax
            "/dir countf"

        %^"!p"

        var
            max_files
            =
            @ScratchVar(_returned)

        var
            max_files
            -=
            1

        jump
        load

    __endprog__

    # load
    # 
    # Summary:
    # 	loads the files to the disk
    # 
    # Params:
    # 	@max_files: max files number
    #   @file_to_load: the start point of the files array to load
    # 
    section
    load

        #
        # declare vars
        #

        var
            name
            =
            prototype

        var
            content
            =
            prototype

        #
        # get file information
        #

        # file name

        mov
            @eax
            "/file_gName"

        mov
            @bx
            file_to_load

        %^"!p"

        var
            name
            =
            @ScratchVar(_returned)

        # file content
        
        mov
            @eax
            "/file_gContent"

        mov
            @bx
            file_to_load

        %^"!p"

        var
            content
            =
            @ScratchVar(_returned)

        #
        # create file
        #

        mov
            "Z->"(..)name
            content

        echo  "file "(..)name(..)" has been loaded."

        var
            .cnd
            =
            (file_to_load==max_files)

        var
            file_to_load
            +=
            1

        jf
            load
            # next file

    __endprog__
[endmsg]

###! fs actions
[intersegmental]
message uefi_fs()

    section
    main

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x01")

    jt
        .uefi_current_fs_letter

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x02")

    jt
        .uefi_file_write

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x03")

    jt
        .uefi_file_rename

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x04")

    jt
        .uefi_file_coppy

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x05")

    jt
        .uefi_file_get

    echo "invalid file action"
    __endprog__

    # uefi_current_fs_letter
    # 
    # Summary:
    # 	gets the letter of the fs driver
    # 
    # Params:
    # 	nah
    # 
    section
    .uefi_current_fs_letter
        mov
            _returned
            @ScratchVar(_@zip.current_archive)
    __endprog__

    # uefi_file_write
    # 
    # Summary:
    # 	writes a file
    # 
    # Params:
    # 	@_data1: file name (including path)
    #   @_data2: file content
    # 
    section
    .uefi_file_write
        mov
            @ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data1)
            @ScratchVar(_data2)
    __endprog__

    # uefi_file_rename
    # 
    # Summary:
    # 	renames a file
    # 
    # Params:
    # 	@_data1: file name
    #   @_data2: new name
    # 
    section
    .uefi_file_rename
        mov
            @ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data2)
            @ScratchVar(@ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data1))

        mov
            @ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data1)
            ""
    __endprog__

    # uefi_file_coppy
    # 
    # Summary:
    # 	coppy a file
    # 
    # Params:
    # 	@_data1: file name
    #   @_data2: file dest name
    # 
    section
    .uefi_file_coppy
        mov
            get{@ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data2)}
            @ScratchVar(@ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data1))
    __endprog__

    # uefi_delete_file
    # 
    # Summary:
    # 	deletes a file
    # 
    # Params:
    # 	@_data1 : the file name with path and extension
    # 
    section
    .uefi_delete_file
        mov
            get{@ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data1)}
            ""
    __endprog__

    # uefi_file_get
    # 
    # Summary:
    # 	get a file
    # 
    # Params:
    # 	@_data1: file full name
    # 
    section
    .uefi_file_get
        mov
            _returned
            @ScratchVar(get{@ScratchVar(_@zip.current_archive)(..)">"(..)@ScratchVar(_data1)})
    __endprog__

[endmsg]

###! loads a segment from the uefi
[intersegmental]
message uefi_load()
    
[endmsg]

# shutdowns the system
[intersegmental]
message uefi_shutdown()
    __endprog__
[endmsg]

# reset the system
[intersegmental]
message uefi_reset()
    sendmw uefi_boot()
    sendmw uefi_segment_setup()
[endmsg]

# exit from bootservices
[intersegmental]
message uefi_exit_boot_services()
    mov
        exit from boot services?
        1

    org
    0
    # because the messages execute it as a independence code so , kill the orgiinal uefi segment (0) but
    # dont worry a security coppy its mounted in the segment 1 for this cases
[endmsg]

###! the uefi shell
[intersegmental]
message efishell()

    jump
    loop
    section
    loop
    writel "Shell> "
    var
        command
        =
        ReadLine

    var
        .cnd
        =
        (command=="exit")

    jt
        .exit

    mov
        _action
        command

    sendmw shell_command()

    jump
    loop

    section
    .exit
    __endprog__
[endmsg]

###! the uefi routine
[intersegmental]
message uefi_boot()

    mov
        _action
        "0x0"
    sendmw uefi_arr()

    sleep 1

    sendmw load_files()

    jump
        main
    section
    main
        mov
            exit from boot services?
            0

    jump
    loop

    section
    loop
    
    writel "Boot From: "

    var
        prompt
        =
        ReadLine
    
    if
    (
        prompt
        ==
        "blk-1"
    )
    {
        # the blk -1
        sendmw efishell()
    }

    jump
    loop

[endmsg]

que les parece mi lenguaje, pronto subire el codigo de una herramienta con interprete y compilador a github

3 Me gusta

yo aun no manejo bien la programación, de hecho estoy ahorita mismo estudiando pascal con un libro que me encontre por ahi, desde luego me parece interezante tu proyecto.

¿cuales son tus intenciones con este lenguaje?

¿que capacidades o para que esta diseñado?

es un lenguaje como js, pero con algunas cosas , este es el codigo del lenguaje

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LimaInterpreter
{
    class Lima // literary the "lima" objet , is very portable , no?
    {
        // apenas puse esto aqui por que olvide que en lima son globales estos diccionarios
        public Dictionary<string, string>
         lima_variables // the variable "lima variables" in turbowarp
         =
        new Dictionary<string, string>();

        public graphichsMode gop = new graphichsMode();

        public bool trueflag = false;

        public Dictionary<string, string>
         globvars
         =
        new Dictionary<string, string>();

        public int Line_to_execute = 0; // literary the name says all
                                        // there variable too exist in the lima objet

        public Dictionary<int, int> popback = new Dictionary<int, int>();

        public Dictionary<int, string> segments = new Dictionary<int, string>();

        public string[] blocks_to_execute;       // other lima turbowarp reference

        public struct Lima_Ex_Affected
        {
            public int type;
            public string id;
            public string new_value;
        }

        public struct LimaExeption
        {
            public bool CloseProgram;
            public int line;

            public bool FromVariable;

            // from variable if true params
            public string varname;

            public int from_mem_direction;
            public int to_mem_direction;

            public Dictionary<int, Lima_Ex_Affected> affected_zones;

            public void ShowExecption()
            {
                int scroll = 0;

                while (true)
                {
                    string line_sep = ""; // for the "---------------------"

                    for (int i = 0; i < Console.BufferWidth; i++)
                    {
                        line_sep = line_sep + "-";
                    }

                    Console.Clear();

                    Console.WriteLine("line: " + line.ToString());
                    Console.Write(line_sep);

                    for (int i = scroll; i < (scroll + Console.BufferHeight) - 5; i++)
                    {
                        if (affected_zones.ContainsKey(i))
                        {
                            Console.WriteLine("type:" + affected_zones[i].type.ToString() + " @" + affected_zones[i].id + "\t->\t" + affected_zones[i].new_value);
                        }
                        else
                        {
                            Console.WriteLine("");
                        }
                    }
                    Console.WriteLine("if you dont know what is this , is just a Lima Exepction Development tool");

                    ConsoleKeyInfo Key = Console.ReadKey(true);

                    if (
                        Key.Key == ConsoleKey.UpArrow
                        )
                    {
                        scroll--;
                    }

                    if (
                         Key.Key == ConsoleKey.DownArrow
                     )
                    {
                        scroll++;
                    }

                }
            }
        }

        public string
            AskForMessageIntoSegment
            (
                string msg
            )
        {
            for (int i = 0; i < segments.Count; i++)
            {
                if (
                    segments[i].Contains("[intersegmental]\nmessage " + msg)
                    )
                {
                    string[] sr = segments[i].Split("[intersegmental]\nmessage " + msg);

                    string[] ara_ara = sr[1].Split("\n[endmsg]");

                    return ara_ara[0];
                }
            }

            return "";
        }

        public string
        LimaSyntax
        (
        string e,
        bool debug
        )
        {
            if (
                    e.Contains("(..)")
                    )
            {
                string[] split = e.Split("(..)");

                string syntax = "";

                foreach (var item in split)
                {
                    syntax += LimaSyntax(item, debug);
                }
                return syntax;
            }
            else if (
                e.StartsWith("(") && e.EndsWith(")")
                )
            {
                string ifcond = e.Substring(1, e.Length - 2);

                if (
                    ifcond.Contains("==")
                    )
                {
                    string[] split = ifcond.Split("==");

                    if (
                        LimaSyntax(split[0], debug) == LimaSyntax(split[1], debug)
                        )
                    {
                        return "true";
                    }
                    else
                    {
                        return "false";
                    }
                }

                if (
                    ifcond.Contains("!=")
                    )
                {
                    string[] split = ifcond.Split("!=");

                    if (
                        LimaSyntax(split[0], debug) != LimaSyntax(split[1], debug)
                        )
                    {
                        return "true";
                    }
                    else
                    {
                        return "false";
                    }
                }

                return "false";
            }
            else if (
                    e.StartsWith("\"") && e.EndsWith("\"")
                    )
            {
                return e.Substring(1, e.Length - 2);
            }
            else if (
                lima_variables.ContainsKey(e)
                )
            {
                return lima_variables[e];
            }
            else if (
                e.StartsWith('&')
                    )
            {
                return e.Substring(1);
            }
            else if (
                e == "Scratch.GetYear"
                )
            {
                return (DateTime.Now.Year).ToString();
            }
            else if (
                e == "Scratch.GetMonth"
                )
            {
                return (DateTime.Now.Month).ToString();
            }
            else if (
                e == "Scratch.GetDay"
            )
            {
                return (DateTime.Now.Day).ToString();
            }
            else if (
                e == "Scratch.GetHour"
                )
            {
                return (DateTime.Now.Hour).ToString();
            }
            else if (
                e == "Scratch.GetMinute"
                )
            {
                return (DateTime.Now.Minute).ToString();
            }
            else if (
                e.StartsWith("@ScratchVar(")
            )
            {
                string er = e.Substring(12, e.Length - 13);

                if (
                globvars.ContainsKey(er)
                )
                    return globvars[er];

                return "";
            }
            else if (
                  e == "Scratch.GetSecond"
                )
            {
                return (DateTime.Now.Second).ToString();
            }
            else if (e == "nullptr")
            {
                return "";
            }
            else if (e == "NULL")
            {
                return "";
            }
            else if (
                e == "@debug"
                )
            {
                return debug.ToString();
            }
            else if (
                e == "ReadKeyWait"
                )
            {
                return Console.ReadKey(true).KeyChar.ToString();
            }
            else if (
                e == "ReadLine"
                )
            {
                string em = Console.ReadLine();
                return em == null ? "" : em;
            }
            else if
    (
        e.Contains("(->)")
    )
            {
                string[] split = e.Split("(->)");

                if (
                    split[1].StartsWith("[") &&
                    split[1].EndsWith("]")
                    )
                {
                    string item = split[1].Replace("[", "");
                    item = item.Replace("]", "");

                    string[] array = lima_variables[split[0]].Replace("\r", "").Split("\n");

                    if (array.Length < Convert.ToInt32(lima_variables[item]))
                        return array[Convert.ToInt32(lima_variables[item])];
                    return "undefined";
                }
            }
            return e;
        }

        public async void
            Execute
            (
            string e,
            bool debug
            )
        {
            if (e.StartsWith("echo "))
            {
                Console.WriteLine(LimaSyntax(e.Substring(5, e.Length - 5), debug));
            }
            if (e.StartsWith("cecho "))
            {
                string texto = LimaSyntax(e.Substring(6, e.Length - 6), debug);
                int x = (Console.WindowWidth - texto.Length) / 2; // Calcula la posición horizontal
                int y = Console.WindowHeight / 2; // Calcula la posición vertical

                int oldx = Console.CursorLeft;
                int oldy = Console.CursorTop;

                Console.SetCursorPosition(x, y); // Mueve el cursor al centro
                Console.WriteLine(texto);

                Console.CursorLeft = oldx;
                Console.CursorTop = oldy;
            }
            if (e.StartsWith("button_echo "))
            {
                string texto = LimaSyntax(e.Substring(12, e.Length - 12), debug);
                int x = (Console.WindowWidth - texto.Length) / 2; // Calcula la posición horizontal
                int y = Console.WindowHeight - 1; // Calcula la posición vertical

                int oldx = Console.CursorLeft;
                int oldy = Console.CursorTop;

                Console.SetCursorPosition(x, y); // Mueve el cursor al centro
                Console.WriteLine(texto);

                Console.CursorLeft = oldx;
                Console.CursorTop = oldy;
            }
            else if (e == "%^\"!p\"")
            {
                if (
                   globvars["@eax"] == "/file_gName"
                    )
                {
                    IEnumerable<string> names = Directory.EnumerateFiles(globvars["@dircurrent"]);

                    string[] nrt = names.ToArray();

                    globvars["_returned"] = Path.GetFileName(nrt[Convert.ToInt32(globvars["@bx"])]);
                }
                else if (
                    globvars["@eax"] == "/glob -gtv -array_startswith"
                    )
                {
                    string array = "";
                    foreach (var item in globvars.ToArray())
                    {
                        if (item.Key.StartsWith(globvars["@bx"])) array += item + "\n";
                    }
                    globvars["_returned"] = array;
                }
                else if (
                    globvars["@eax"] == "/dir countf"
                    )
                {
                    IEnumerable<string> names = Directory.EnumerateFiles(globvars["@dircurrent"]);

                    string[] nrt = names.ToArray();

                    globvars["_returned"] = nrt.Length.ToString();
                }
                else if (
                   globvars["@eax"] == "/file_gContent"
                    )
                {
                    IEnumerable<string> names = Directory.EnumerateFiles(globvars["@dircurrent"]);

                    string[] nrt = names.ToArray();

                    globvars["_returned"] = File.ReadAllText(nrt[Convert.ToInt32(globvars["@bx"])]);
                }
                else if (
                    globvars["@eax"] == "/get-url"
                    )
                {
                    string url = globvars["@bx"];

                    using (HttpClient client = new HttpClient())
                    {
                        try
                        {
                            // Enviar una solicitud GET y obtener la respuesta
                            HttpResponseMessage response = await client.GetAsync(url);

                            // Asegurarse de que la solicitud fue exitosa
                            response.EnsureSuccessStatusCode();

                            // Leer el contenido de la respuesta como una cadena
                            string content = await response.Content.ReadAsStringAsync();

                            globvars["_returned"] = content;
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }

            }
            else if (e.StartsWith("writel "))
            {
                Console.Write(LimaSyntax(e.Substring(7, e.Length - 7), debug));
            }
            else if (e.StartsWith("color "))
            {
                string er = e.Substring(6, e.Length - 6);

                string[] colors = er.Split(" ");

                string foreground = LimaSyntax(colors[0], debug);

                string background = LimaSyntax(colors[1], debug);

                Console.BackgroundColor = ConsoleColor.Black;
                Console.BackgroundColor += int.Parse(background);

                Console.ForegroundColor = ConsoleColor.Black;
                Console.ForegroundColor += int.Parse(foreground);

            }
            else if (
                e.StartsWith("sendmw ")
                )
            {
                int line_to = Line_to_execute;
                Dictionary<int, int> recover_popback = popback;

                //Console.WriteLine(e);

                Line_to_execute = 0;
                ExecuteLimaScript(AskForMessageIntoSegment(e.Substring(7, e.Length - 7)), debug);

                Line_to_execute = line_to + 1;

                popback = recover_popback;
            }
            else if (
                e == "cls"
                )
            {
                Console.Clear();
            }
            else if (
                e.StartsWith("sleep ")
                )
            {
                Thread.Sleep(int.Parse(LimaSyntax(e.Substring(6, e.Length - 6), debug)) * 1000);
            }

            return;
        }

        public string
            Operate_With
            (
                string operator1,
                string a,
                string operator2

            )
        {
            if (a == "=") return operator2; // the equal simbol
            if (a == "+=") // the sum simbol
            {
                if (
                    int.TryParse(operator1, out int value1) == false // if the operator1 is a text
                    )
                {
                    if (
                        int.TryParse(operator2, out int value2) // if the operator2 is a number
                    )
                    {
                        return operator1.Substring(int.Parse(operator2), operator1.Length - int.Parse(operator2)); // desplaze it
                    }
                    else
                    {
                        return operator1 + operator2; // if not a number join the texts
                    }
                }
                else
                {
                    return (int.Parse(operator1) + int.Parse(operator2)).ToString(); // if a number the two sum it
                }
            }
            if (a == "-=") // the sub simbol
            {
                if (
                    int.TryParse(operator1, out int value1) == false // if the operator1 is a text
                    )
                {
                    if (
                        int.TryParse(operator2, out int value2) // if the operator2 is a number
                    )
                    {
                        return operator1.Substring(0, operator1.Length - int.Parse(operator2)); // desplaze it
                    }
                    else
                    {
                        return operator2; // if not a number return the operator 2
                    }
                }
                else
                {
                    return (int.Parse(operator1) - int.Parse(operator2)).ToString(); // if a number the two sum it
                }
            }
            if (a == "*=")
            {
                return (int.Parse(operator1) * int.Parse(operator2)).ToString();
            }
            return operator2;
        }

        public async void
        ExecuteLimaScript
        (
            string lscript,
            bool debug
        )
        {
            bool in_struct;

            string script = lscript.Replace("\r", "");

            string[] lines = script.Split(new[] { '\n' });

            while (
                Line_to_execute < lines.Length
                )
            {
                //Console.WriteLine(Line_to_execute.ToString() + ": " + lines[Line_to_execute]);

                if (
                    lines[Line_to_execute].Trim() == "@structure"
                    )
                {
                    in_struct = true;

                    string structuredefinition = "";

                    while (
                        lines[Line_to_execute].Trim() != "}"
                        )
                    {
                        if (
                            lines[Line_to_execute].Trim() == "prototype"
                            )
                        {
                            if (lines[Line_to_execute + 2].Trim() == "var")
                                structuredefinition = structuredefinition + lines[Line_to_execute + 1].Trim() + "|" + lines[Line_to_execute + 3].Trim() + "\n";
                            else
                            {
                                structuredefinition = structuredefinition + (
                                    lima_variables[lines[Line_to_execute + 1].Trim()]
                                    ).
                                    Replace("|", "|" + lines[Line_to_execute + 3].Trim(
                                    ) + "->"
                                    )
                                    ;
                            }
                        }
                        Line_to_execute++;
                    }

                    Line_to_execute++;

                    lima_variables[lines[Line_to_execute].Trim()] = structuredefinition;

                    in_struct = false;
                    //Console.WriteLine(structuredefinition);
                }
                else if (
                    (lines[Line_to_execute]).Trim() == "mov"
                )
                {
                    //Console.WriteLine(Line_to_execute + 1.ToString() + ": " + lines[Line_to_execute + 1]);

                    globvars[(lines[Line_to_execute + 1]).Trim()] = LimaSyntax((lines[Line_to_execute + 2]).Trim(), debug);
                }
                else if (
                        (lines[Line_to_execute]).Trim() == "ustruct"
                    )
                {
                }
                else if (
                    (lines[Line_to_execute]).Trim() == "org"
                    )
                {
                    segments[int.Parse((lines[Line_to_execute + 1]).Trim())] = script;
                }
                else if (
                    (lines[Line_to_execute]).Trim() == "if"
                    )
                {
                    //Console.WriteLine("in if");
                    string if_condition;

                    if_condition =
                        (lines[Line_to_execute + 1]).Trim() + // (
                        (lines[Line_to_execute + 2]).Trim() + // ...
                        (lines[Line_to_execute + 3]).Trim() + // operator
                        (lines[Line_to_execute + 4]).Trim() + // ...
                        (lines[Line_to_execute + 5]).Trim() // )
                        ;

                    Line_to_execute += 6;

                    //Console.WriteLine(if_condition);

                    //Console.WriteLine(LimaSyntax(if_condition, debug));

                    if (
                        LimaSyntax(if_condition, debug) != "false"
                        )
                    {
                        //Console.WriteLine("xd");
                        string popcode = lscript;

                        Dictionary<int, int> ppopback = popback;

                        string code = "";

                        int ele = 0;
                        while (
                                lines[Line_to_execute].Trim() != "}" && ele != 0
                            )
                        {
                            code += lines[Line_to_execute] + "\n";

                            Line_to_execute++;

                            if (
                                lines[Line_to_execute].Trim() == "{"
                                )
                            {
                                ele++;
                            }

                            if (
                                lines[Line_to_execute].Trim() == "}"
                                )
                            {
                                ele--;
                            }
                        }

                        if (
                                                    LimaSyntax(if_condition, debug) != "false"
                                                    )
                        {
                            int popline = Line_to_execute;

                            popback.Clear();

                            Line_to_execute = 0;

                            ExecuteLimaScript(code, debug);

                            Line_to_execute = popline;

                            popback = ppopback;
                        }
                    }
                    else
                    {
                        //Console.WriteLine("yo");
                        int ele = 0;

                        while (
                            true
                            )
                        {
                            //Console.WriteLine(Line_to_execute);
                            Line_to_execute++;

                            if (
                                lines[Line_to_execute].Trim() == "{"
                                )
                            {
                                ele++;
                            }

                            if (
                                lines[Line_to_execute].Trim() == "}"
                                )
                            {
                                if
                                    (
                                    ele == 0
                                    )
                                {
                                    break;
                                }
                                else
                                    ele--;
                            }
                        }

                    }
                }
                else if (
                    (lines[Line_to_execute]).Trim() == "var"
                    )
                {
                    string name = (lines[Line_to_execute + 1]).Trim();
                    string op = (lines[Line_to_execute + 2]).Trim();
                    string value = (lines[Line_to_execute + 3]).Trim();

                    if (
                        (lines[Line_to_execute - 1]).Trim() == "[globalize]"
                        )
                    {
                        globvars[name] = Operate_With(
                            globvars.ContainsKey(name) ? globvars[name] : "",
                            op,
                            LimaSyntax(value, debug)
                            );
                    }
                    else
                    {
                        lima_variables[name] = Operate_With(
                            lima_variables.ContainsKey(name) ? lima_variables[name] : "",
                            op,
                            LimaSyntax(value, debug)
                            );
                    }
                }
                else if (
                    (lines[Line_to_execute]).Trim() == "jump" ||
                    (lines[Line_to_execute]).Trim() == "jt" ||
                    (lines[Line_to_execute]).Trim() == "jf"

                    )
                {
                    int section_search;

                    for (section_search = 0; section_search < lines.Length; section_search++)
                    {
                        if (
                            lines[section_search].Trim() == "section"
                            )
                        {
                            if (
                                lines[section_search + 1].Trim() == lines[Line_to_execute + 1].Trim()
                                )
                            {
                                if (
                                    (lines[Line_to_execute]).Trim() == "jf"
                                    )
                                {
                                    if (lima_variables[".cnd"] == "false")
                                    {
                                        popback.Add(popback.Count + 1, Line_to_execute + 1);
                                        Line_to_execute = section_search;
                                    }
                                }
                                else if
                                    (
                                     (lines[Line_to_execute]).Trim() == "jt"
                                    )
                                {
                                    if (lima_variables[".cnd"] != "false")
                                    {
                                        popback.Add(popback.Count + 1, Line_to_execute + 1);
                                        Line_to_execute = section_search;
                                    }
                                }
                                else
                                {
                                    popback.Add(popback.Count + 1, Line_to_execute + 1);
                                    Line_to_execute = section_search;
                                }
                            }
                        }
                    }
                }
                else if (
                    lines[Line_to_execute] == "popback"
                    )
                {
                    if (popback.Count != 0)
                    {
                        Line_to_execute = popback[popback.Count];
                        popback.Remove(popback.Count);
                    }
                    else
                    {
                        Line_to_execute = 0;
                    }
                }
                else if (
                    lines[Line_to_execute] == "__endprog__"
                    )
                {
                    return;
                }
                else
                {
                    Execute(lines[Line_to_execute].Trim(), debug);
                }

                Line_to_execute++;

            }
            return;
        }
    }

}

¿te refieres a javascript? ¿Esta programado en python no? no manejo python, pero por lo que veo me parece a eso.

pero me sigo preguntando ¿cual es el objetivo del lenguaje? ¿hacer algo funcional? ¿o por solo entretenimiento? ¿a que esta destinado? ¿un lenguaje que soporte cualquier sistema? ¿que sea rapido y eficiente? o esa, ese tipo de cosas…

es que estoy interezado en lenguajes que me puedan correr hasta en windows 98… jaja, por eso ando preguntado.

si fuera por mi yo el lenguaje lo haria con la sagrada lengua castellana, digo, ya hubo mucho ingles, ahora nos toca a nosotros. pero bueno, si prefieres que sea adoptado, pues, si esa es tu intención pues haces bien por que es a lo que la gente se acostumbro

no es que el lenguaje esta hecho en C# puedes ver el codigo en ErickStudios/Lim22: the opensource version of lima

1 me gusta

a chis… que bruto, ponganme cero.

no tampoco eso,pero si esta muy avanzado estoy implementando la funcion para hacer lo de las estructuras

1 me gusta

apenas estoy aprendiendo los condicionales. no se que es una estructura

            if (
                lines[Line_to_execute].Trim() == "@structure"
                )
            {
                in_struct = true;

                string structuredefinition = "";

                while (
                    lines[Line_to_execute].Trim() != "}"
                    )
                {
                    if (
                        lines[Line_to_execute].Trim() == "prototype"
                        )
                    {
                        if (lines[Line_to_execute + 2].Trim() == "var")
                            structuredefinition = structuredefinition + lines[Line_to_execute + 1].Trim() + "|" + lines[Line_to_execute + 3].Trim() + "\n";
                        else
                        {
                            structuredefinition = structuredefinition + (
                                lima_variables[lines[Line_to_execute + 1].Trim()]
                                ).
                                Replace("|", "|" + lines[Line_to_execute + 3].Trim(
                                ) + "->"
                                )
                                ;
                        }
                    }
                    Line_to_execute++;
                }

                Line_to_execute++;

                lima_variables[lines[Line_to_execute].Trim()] = structuredefinition;

                in_struct = false;
                //Console.WriteLine(structuredefinition);
            } 

este codigo crea una estructura en mi lenguaje
y este codigo la usa

            else if (
                    (lines[Line_to_execute]).Trim() == "ustruct"
                )
            {
                string var_set = lines[Line_to_execute + 1].Trim();
                string structure = lines[Line_to_execute + 2].Trim();

                string[] struct_use = lima_variables[structure].Split("\n");

                foreach (var item in struct_use)
                {
                    if (
                        item.Contains("|")
                        )
                    {
                        string[] value_key = item.Split("|");

                        lima_variables[var_set + "->" + value_key[1]] = value_key[0];
                    }
                }
            }

respectivamente una estructura es una forma de organizar variables
por ejemplo :
en C/C++

struct Persona {
         CHAR16 Nombre[20];
         int Edad;
        void* trabajo;
};

y en mi lenguaje es

@structure
{
        prototype
        string
        var
             Nombre

        prototype
        int
        var
             Edad

        prototype
        void
        var
             Trabajo
}
Persona
;
1 me gusta

¿que busca ser tu lenguaje? ¿busca ser sencillo de aprender o de utilizar? supongo que sera compatible para toda plataforma que tenga un compilador de c# ¿o es independiende de este?

es en C# y es un lenguaje muy facil de aprender ,pero cuando quieres comunicar tu programa con el interprete tienes que usar mov , “@eax” y “@bx” algo asi, un ejemplo es esta funcion intersegmental que controla funciones de el internet como obtener el contenido de una pagina o enviar algo a un servidor

###! net
[intersegmental]
message uefi_net()

    section
    Main

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x01")

    jt
        .recive

    var
        .cnd
        =
        (@ScratchVar(_action)=="0x02")

    jt
        .send

    __endprog__

    # recive
    # 
    # Summary:
    # 	recive a content from a url
    # 
    # Params:
    # 	@_data1: the url
    #   @returned: the return value
    # 
    # Registers used:
    #   @eax: for the commands
    #   @bx: the data send
    # 
    section
    .recive

        mov
            @eax
            "/get-url"

        mov
            @bx
            @ScratchVar(_data1)

        #!
        %^"!p"
            # <- esto devuelve automaticamente el _returned

        if
        (
            @ScratchVar(@ax)
            ==
            "unsupported"
        )
        {
            mov
                _returned
                "falied to fetch"
        }

    __endprog__

    # MyFunction
    # 
    # Summary:
    # 	send a data from a server
    # 
    # Params:
    # 	@_data1: the url
    #   @_data2: the data to send
    #   @returned: the return value
    #
    # Registers used:
    #   @eax: for the commands
    #   @bx: the data send
    # 
    section
    .send

        mov
            @eax
            "/send-set-url"

        mov
            @bx
            @ScratchVar(_data1)

        %^"!p"

        mov
            @eax
            "/send-url"

        mov
            @bx
            @ScratchVar(_data2)

        %^"!p"

        if
        (
            @ScratchVar(@ax)
            ==
            "unsupported"
        )
        {

        }

    __endprog__

[endmsg]
1 me gusta

Bueno, bueno, estare pendiente al proyecto. Pero de momento, no entiendo nada. Apenas estoy entendiendo pascal :sweat_smile:

le puse comentarios por ti , para que pudieras entender que hace (xd estan en ingles los comentarios)

###! net
[intersegmental]
message uefi_net()

    # the main section of the message
    section
    Main

    # set the condicional var for execute the section recive if you want to recive
    var
        .cnd
        =
        (@ScratchVar(_action)=="0x01")

    # jump if the condition is true
    jt
        .recive

    # set the condicional var for execute the section send if you want to send data to a server
    var
        .cnd
        =
        (@ScratchVar(_action)=="0x02")

    # jump if the condition is true
    jt
        .send

    # if nothing is true finish the function
    __endprog__

    # recive
    # 
    # Summary:
    # 	recive a content from a url
    # 
    # Params:
    # 	@_data1: the url
    #   @returned: the return value
    # 
    # Registers used:
    #   @eax: for the commands
    #   @bx: the data send
    # 
    section
    .recive

        # set the action for make
        mov
            @eax
            "/get-url"

        # set the url to request (in this case the _data1)
        mov
            @bx
            @ScratchVar(_data1)

        #!
        %^"!p"
            # <- esto devuelve automaticamente el _returned

        # check if the interpreter can make the action
        if
        (
            @ScratchVar(@ax)
            ==
            "unsupported"
        )
        {
            # if not , set the return value
            mov
                _returned
                "falied to fetch"
        }

    # end the message
    __endprog__

    # MyFunction
    # 
    # Summary:
    # 	send a data from a server
    # 
    # Params:
    # 	@_data1: the url
    #   @_data2: the data to send
    #   @returned: the return value
    #
    # Registers used:
    #   @eax: for the commands
    #   @bx: the data send
    # 
    section
    .send

        # set the action to make (set the url)
        mov
            @eax
            "/send-set-url"

        # set the data to send to the url
        mov
            @bx
            @ScratchVar(_data1)

        # send the action to the interpreter
        %^"!p"

        # action for send the data
        mov
            @eax
            "/send-url"

        # now the data to send
        mov
            @bx
            @ScratchVar(_data2)

        # action!!!
        %^"!p"

        # if can make it
        if
        (
            @ScratchVar(@ax)
            ==
            "unsupported"
        )
        {
            # ya puedes dejar de enviar datos, ya perdimos ;(

            # set the return value
            mov
                _returned
                "0"
        }

    # the functions has been finished
    __endprog__

[endmsg]

Io no spiko inglis, yo puro español o esperanto