Skip to content

Repository files navigation

Wi

Wi is a small, fast, prototype-based scripting language.

GitHub release GitHub last commit GitHub License Docs Code size Platform CodeQL Advanced

var obj_person = object {
    name = "";
    greet = function(self) {
        print("Hello, " .. self.name .. "!");
    };
};

var slava = new obj_person {
    name = "Slava";
};

slava->greet(); // Hello, Slava!
  • Wi is small. The entire implementation takes less than 10k lines of code.
  • Wi is fast. Check out benchmarks.
  • Wi is purely prototype-based. Many languages use classes - Wi uses objects. You clone these objects and create whatever you want.
  • Wi is simple. You can learn its syntax in less than a week using its documentation.
  • Wi is extendable. You can easily extend Wi using its Foreign Function Interface and load your extensions via load_foreign.

Building

Requires gcc and xmake. Then simply:

xmake

Wi uses GNU99 as its C standard. Any compiler supporting GNU99 will comply too.
Wi has zero dependencies.

Inspiration

Around three years ago, I was looking through interpreted programming languages (not many, of course) and realized that I didn't like any of them. Any. So then, in that very moment I decided - I will make my own simple and fast programming language. That day, the first Wi prototype was born (it wasn't even called Wi back then - it was something along the lines of "Weasel").

Current project status

This programming language was created by me, and only me - a single person. It's in beta and I'm working on it almost every day. The standard library isn't finished yet, but it's already quite useful. Other than the API, everything is completely uncommented. I really, really have never commented my code in my entire life. Sure, this is a terrible practice, but it's hard for me since I'm not a native English speaker. That doesn't mean I shouldn't comment my code, so... I'll try to comment it when I can.

Of course, some parts of the code may contain bad practices, and I'm very open to suggestions - if you have one, open an issue!

No AI was used in the creation of this project - only me, my horrid laptop, my favorite book (Crafting Interpreters), Googling, and stuff.

About

The Wi programming language

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages