Making my own language, help appreciated

| Published Jun 01, 2026
javascript Snippet
import['lemon.citrus', 'randomFunction.citrus']
/*comments can be outside objects*/
coolStuff = {
    import = 'inside objects import is just a key, but outside it imports all the variables from citrus file'
    definition = 'there can be multiple topline objects'
}
intro = {
    number1 = 2
    number2 = 3
    number3 = number1 + number2
    /*multiple mathematical operators*/
    number5 = ∞
    number = 5/3
    /*numbers can accepts special symbols and decimal numbers*/
    hexcode = 0xD36C
    string1 = 'Hello'
    string2 = 'World'
    string3 = string1 + ' ' + string1
    /*comment, string 3 outputs 'Hello World'*/
    string1 = 'Whatsapp'
    /*reassigns the value*/
    object = {
        stringReference = string1
        /*outputs the value of 'Hello'*/
        § string4 = 'constant variable starts with § and cannot be reassigned afterwards'
        objectsCanNestInEachOther = {
            § string4 = 'cool right? also this is wont actually overwrite string 4, just throw console note'
            stringReference = stringReference
        }
    }
    object.stringReference = string2
    /*stringReference is not a variable, you have to include the rest of the object, also you mention the place where it was first assigned,
    you don't have to do this with modules, that's the big difference*/
    noSpacesAllowedInVariables = null
    array = ['hello', 'hi', 'whatsapp', 'you are you doing?']
    /*accepts boolean, if value is null check skips it*/
    check(string1 = 'Hello') = {
        boolean = true
    }
    check(string1 != 'Hello') = {
        boolean = false
    }
    /*if there is no if else check, you have to add ! to another check*/

    /*accepts numbers*/
    number4 = 4
    repeat(number3) = {
        number4 number4 + 1
        check(number4 >= 100){
            return
            skip
        }
    }
    /*skip skips the whole lime.citrus but return only skips the current object/logic*/
    intValue = 0
    every(value1)in(array) = {
        value1 = intValue
        newArray[intValue] = value1
        intValue = intValue + 1
    }
    function(smartFunction)[smartValue](smartArray) = {
        intValue = 0
        smartArray = []
        repeat(random[null, smartValue]) = {
            smartArray[intValue] = intValue + 1
            intValue = intValue + 1
        }
    }
    /*this is a function, the parenthesis is the name of the function and array are variables for the function and the last parenthesis are for return,
    this is a simple function that outputs random amount of numbers in an array*/
    every(key1)in(objectsCanNestInEachOther) = {
        smartFunction[key1]
    }
    /*this every(key)in(value(array)) function will produce newArray of value = [0, 1, 2, 3]*/
}

I wanted to make my own game, and for extensive modding I wanted users to be able to create additional data in the form of JSON. A lot of games do that, and Minecraft's datapacks are incredibly popular. However I realized that JSON is sub optimal since it's just data and once you want something more complex you will have a hard time. That's why I want to create the citrus language (compact instruction tree referencing unit syntax), a middle step between JavaScript and JSON. It is simple and intuitive like JSON but offers better readability and basic logic. I believe that this is the golden spot where intuitiveness and control meet, a perfect level for community modding and creativity to develop. If anyone found interest in my project please message me. I would gladly ask questions and am open to collabs!!


Community Discussion

0 Comments
Loading comments...

Related Posts

3D VIEWER Initializing...
Controls
W / S   Accelerate / Brake
A / D   Steer left / right
Q / E   Rotate forward axis 90°
R   Flip forward direction
⚠️ Car drives wrong way?
Press Q or E to rotate the forward axis until the car moves correctly. Press R if it goes backward.
Drag to orbit camera • Scroll to zoom
Interactive 3D Viewer

WASD to drive • Q/E rotate axis • R flip • H for help

0 KM/H
RPM
N
GEAR