My interest in making games is only topped by my interest in reinventing the wheel in order to learn how it works, and potentially being able to improve it. This does mean, that none of my game projects outside of jams where ever actually finished, but since I enjoy engine development just as much, its actually fine. Writing my own language is an offspring of that. Since (to my knowledge) nobody actually uses any of my Beef code I might aswell just write my own programming language and then write my code in that. In doing that I get to improve my programming skills, improve on my problems with the beef language and might actually make my code more compatible.
How would making your own nieche language serve to make your code more compatible ??Simple really. Beef compiles using llvm and while it can call C code and be called from other languages its far from a seamless experience. The language im making would mainly compile to C code. This results in free interop with c/c++, easy interop with most other languages, support for alot of platforms and it allows me to offload parts of the optimization process to the C compiler, which reduces the amount of work that I need to do. Also it could be compiled and ran like a scripting language using tinycc.
example.ts
import System;
import System.Collections;
import [ Console, List ] from System.Collections;
namespace SpaceGame;
class Thing {
a : Result[void];
struct thing {}
}
fn Thing->Add(a: void, b: void) {
const c: Engine = scope .();
const thing = new Thing();
thing.Add();
}
#![entrypoint]
pub fn main(): List[int][] {
}Currently im experiementing with something like this. It does actually do quite a few things differently than C# and Beef, but alot of the underlying concepts are similar and being able to write code should translate rather well. Types being declared like that is a thing alot of newer languages do, and I think it looks neat, so im taking it. Any of this is still subject to change though, since my progress currently is rather slow.