Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

DinoSource - Programming language

An asset by JekSun
The page banner background of a mountain and forest
DinoSource - Programming language hero image

Quick Information

0 ratings
DinoSource - Programming language icon image
JekSun
DinoSource - Programming language

DinoSource - is a full-fledged, open-source, interpreted programming language developed for the Godot Engine.This language is useful for supporting modding in games, implementation in gameplay where programming is required, the syntax is easily modified, which allows you to easily create your own language syntax, or copy other popular languages, program tools where the programming language is used as a design tool.✅ GDScript → DinoSource: Registering native functions and variables to call GDScript inside DinoSource✅ DinoSource → GDScript: Calling functions and accessing DinoSource data within GDScript✅ Cross-platform: Works everywhere Godot Engine works (Windows, Linux, macOS, Web, Mobile)✅ FeaturesBasic Types and OperatorsFunctions and ScopeClasses with Constructors/DestructorsArrays and Index AccessDinoSource is written entirely in GDScript!You can learn more about the language's capabilities and syntax here - https://github.com/JekSun97/DinoSource/discussions/1

Supported Engine Version
4.5
Version String
0.8
License Version
MIT
Support Level
community
Modified Date
9 hours ago
Git URL
Issue URL

DinoSource

DinoSource logo

README Godot Engine README Ko-Fi

DinoSource - is a full-fledged, open-source, interpreted programming language developed for the Godot Engine.

This language is useful for supporting modding in games, implementation in gameplay where programming is required, the syntax is easily modified, which allows you to easily create your own language syntax, or copy other popular languages, program tools where the programming language is used as a design tool.


📋 Table of contents


✅ Features

  • Basic Types and Operators
  • Functions and Scope
  • Classes with Constructors/Destructors
  • Arrays and Index Access

🔤 Language

Category Support
Comments // one-line, /* */ multi-line
Data types int, float, bool, string, var (dynamic), void
Constants const type NAME = value
Arrays One-dimensional [1,2,3] and multidimensional [[1,2][3,4]]
Operators + - * / % (arithmetic), && || ! (logics)
Enum Named constants enum Status { Idle, Running = 32, Jump = 4 }
Functions With return types, parameters, recursion
Classes Fields, methods, constructors ClassName(), destructors ~ClassName()
Conditions if/else, switch/case/default
Cycles for, while, repeat(n), jump/POINT
Control return, break, continue, delete
Library include Path/SourceCode

🔧 Integration

  • GDScript → DinoSource: Registering native functions and variables to call GDScript inside DinoSource
  • DinoSource → GDScript: Calling functions and accessing DinoSource data within GDScript
  • Cross-platform: Works everywhere Godot Engine works (Windows, Linux, macOS, Web, Mobile)

🚀 Quick start

1. Clone the repository

git clone https://github.com/JekSun97/DinoSource.git
cd DinoSource

2. Open in Godot

  • Launch Godot 4.x
  • Open the IDE.tscn scene

3. Write your first script

// 🦖 Hello DinoSource!
print("Hello World!");

int x = 10;
float y = 3.14;
string msg = "DinoSource is working!";

print(msg + " x=" + str(x) + ", y=" + str(y));

4. Launch! 🎮

  • Click Run in the interface
  • See the console output

📚 Code examples

🔁 Cycles and conditions

for (int i = 0; i < 5; i++) {
    if (i % 2 == 0) {
        print("Even: " + str(i));
    } else {
        print("Odd: " + str(i));
    }
}

🏗️ Classes with a constructor and destructor

class Player {
    string name;
    int health = 100;
    
    // Constructor
    void Player(string n) {
        this.name = n;
        print("Player " + this.name + " created!");
    }
    
    // Destructor
    void ~Player() {
        print("Player " + this.name + " deleted");
    }
    
    void takeDamage(int dmg) {
        this.health = this.health - dmg;
        if (this.health <= 0) {
            print(this.name + " died!");
        }
    }
}

// Usage
Player hero = new Player("Artyom");
hero.takeDamage(30);
delete hero;  // The destructor will be called!

📦 Arrays and functions

var array = [10, 20, "Hi!", false];

string check(var _arr) {
    string _text = "\n";
    for (int i = 0; i < _arr.size(); i++) {
        _text = _text + "arr[" + str(i) + "] = " + str(_arr[i]) + "\n";
    }
    return _text;
}

print("arr: " + check(array));

📃 Here you can find a large snippet of DinoSource code for study - Test Сode.


🔌 Integration with Godot

Registering a native function (GDScript → DinoSource)

func _ready():
    var interpreter = DSInterpreter.new()
    
    # Register the "godot_log" function to be called from DinoSource
    interpreter.registerNativeFunc("godot_log", _godot_log)

func _godot_log(args: Array):
    if args.size() > 0:
        print("[DinoSource] " + str(args[0]))
    return null
// In the DinoSource code:
godot_log("Greetings from DinoSource!");  // Calls a GDScript function

Calling the DinoSource script from GDScript

# Running the code
var ast = parser.parse(lexer.LexerRun("int nmb = 16; print('Hello'); int DinoFunc(int a, int b) {return a+b;}"))
interpreter.run(ast)

# Getting a variable
var nmb = interpreter.getGlobalVar("nmb")

# Function call
interpreter.callFunc("DinoFunc", [4, 1])

🤝 Participation in development

Any contributions are welcome! 🙌

🐛 Found a bug?

  1. Check it out Issues
  2. If not, create a new one with:
    • 📋 Steps to reproduce
    • 💻 Godot version
    • 🧪 Minimal code example

💬 Have an idea? Open Issue or Discussion!


💖 Support the project

Developing DinoSource is a hobby project, and your support is greatly appreciated! 🙏

README Ko-Fi


⚠️ Use at your own risk, the language may have hidden problems that I may not have yet discovered, you can create a topic in the problems section, or contribute a fix. Here you can see a list of upcoming improvements and their priority.

The language was originally developed for a gaming project where most of the gameplay - is programming 💻.

DinoSource - is a full-fledged, open-source, interpreted programming language developed for the Godot Engine.

This language is useful for supporting modding in games, implementation in gameplay where programming is required, the syntax is easily modified, which allows you to easily create your own language syntax, or copy other popular languages, program tools where the programming language is used as a design tool.

✅ GDScript → DinoSource: Registering native functions and variables to call GDScript inside DinoSource
✅ DinoSource → GDScript: Calling functions and accessing DinoSource data within GDScript
✅ Cross-platform: Works everywhere Godot Engine works (Windows, Linux, macOS, Web, Mobile)

✅ Features
Basic Types and Operators
Functions and Scope
Classes with Constructors/Destructors
Arrays and Index Access

DinoSource is written entirely in GDScript!

You can learn more about the language's capabilities and syntax here - https://github.com/JekSun97/DinoSource/discussions/1

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
DinoSource - Programming language icon image
JekSun
DinoSource - Programming language

DinoSource - is a full-fledged, open-source, interpreted programming language developed for the Godot Engine.This language is useful for supporting modding in games, implementation in gameplay where programming is required, the syntax is easily modified, which allows you to easily create your own language syntax, or copy other popular languages, program tools where the programming language is used as a design tool.✅ GDScript → DinoSource: Registering native functions and variables to call GDScript inside DinoSource✅ DinoSource → GDScript: Calling functions and accessing DinoSource data within GDScript✅ Cross-platform: Works everywhere Godot Engine works (Windows, Linux, macOS, Web, Mobile)✅ FeaturesBasic Types and OperatorsFunctions and ScopeClasses with Constructors/DestructorsArrays and Index AccessDinoSource is written entirely in GDScript!You can learn more about the language's capabilities and syntax here - https://github.com/JekSun97/DinoSource/discussions/1

Supported Engine Version
4.5
Version String
0.8
License Version
MIT
Support Level
community
Modified Date
9 hours ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers