I wrote a full-fledged programming language in GDScript!

That’s so sick :flushed_face::tada:. I need to learn DinoSource now

1 Like

That’s also what I immediately thought it could be used for, and in my opinion it’s the best use case.

You can give a player the ability to write simple scripts that run inside of your safe sandbox without risking them compromising the game itself (which could be the case if you gave them full gdscript access for example).

Good job

Added the ability to inherit classes.
Example:

class Human {
string name = “Unknown”;
int age = 0;
}

class Player : Human {
string getName() {
return this.name;
}

void setInfo(string n, int a) {
	this.name = n;
	this.age = a;
}

}
Player hero = new Player();
hero.setInfo(“Dima”, 25);

// Accessing inherited fields
print("Name: " + hero.getName());   //  Dima
print("Age: " + str(hero.age)); //  25

// Polymorphism
Human baseRef = new Player();
print("Type: " + type(baseRef));    //  Player
  • Add helper functions for the String type.
  • Added the ability to fill out a class constructor when inheriting it.

string text = “Dino”;
print(text.size()) // 4
print(text.to_upper()); // DINO
print(text.to_lower()); // dino
print(text.get(0)); // D
print(text.set(0,“S”)); // Sino
print(text.find(“no”)); // 2
print(text.has(“no”)); // true
print(text.substr(2)); // no
print(text.replace(“Di”,“Gi”)); // Gino

1 Like

Add DSNC System.

DinoSource Node Component (DSNC) - is a specialized system for processing DinoSource code across multiple nodes, storing its data and methods individually and creating a bridge between other objects for communication.

How to use DSNC:

  1. Enable DinoCompiler.gd for autoload in your project settings.
  2. Create the required entity objects with the DinoComponent.gd script, then add the path to your DinoSource script in the Script Path parameter.

To change or get a variable of another object, use:

set_obj_var("Path/To/Node", "name_var", value)
get_obj_var("Path/To/Node", "name_var")

To call a function of another object:
call_obj("Path/To/Node", "function_name", arg1, arg2...)

Challenge: rewrite Romeo and Juliet in that programming language

1 Like

MAkE A SONIC ENGINE WITH IT

2 Likes

SyntaxForge is in development!
This is a plugin for developing your own programming language within the Godot Engine. Currently, the following programming languages ​​have been processed and successfully tested:

  • C++
  • Python
  • Pascal
  • Assembler
  • As well as a fictional language with the following syntax:
    print[#2 ^ #3, <<hello world>>]
    x[#10 + #5 * #2]