The Jink programming language
Jink is a functional, object-oriented programming language designed with programmer familiarity in mind. Inspired by JavaScript, C++, Python and Go, Jink aims to offer a streamlined, modern and flexible but familiar syntax with enough power behind it to leave more room and time for actually writing good software.
This is a WIP and any contributions are welcome. Read more in the Contributing section below.
There is a Discord server that hosts the project where you can ask questions, get help, and chat with other contributors. And another broader community from contributors to this project where we chat about projects in general. Jink repo updates are posted in both.
Jink is in its early stages and being actively developed. If you have familiarity with compilers and/or LLVM, your expertise would be greatly appreciated.
We have begun implementing the first stage compiler in Rust. There are a number of issues and features that need to be addressed before we can move on to the next stage.
Here are a list of goals that scope out the Jink project and repository, not in or by any particular order or specification.
- Design standard for modules
- Start writing standard library
- Start writing self-hosted compiler
- Add examples
- Add documentation / tutorials
- Add issue templates
- Add pull request templates
- Standardize type inference
- Build dynamic array type
- Build heterogenous array type
- Build nested arrays
- Build structs/types
- Build nested structs
- Build struct indexing
- Build nested struct indexing
- Build break and continue in loops
- Build classes
- Build class inheritance
- Build enums
- Build external statements
- Build del statements
- Build module/import system
- Validate module imports
- Handle named module indexing
- Build string interpolation
- Write struct tests
- Write function tests
- Write module tests
- Lex string interpolation
- Parse enum definitions
- Parse objects
- Parse self keyword in classes
- Parse self keyword in class methods
- Parse module imports
- Validate against circularly imported modules
- Parse string interpolation
- Parse indexing (arrays)
- Parse recursive indexing (arrays)
- Parse indexing (object properties and methods)
- Parse recursive indexing (object properties and methods)
- Parse del statements
- Parse while loops
- Parse for loops
- Parse break and continue for loops
- Parse public statements
- Parse external statements
print("Hello, World!"); // Hello, World!
const name = "Jacob";
let age;
age = 1 + 100 / 4;
print(name); // Jacob
print(age); // 26
// Inline
fun inline(let abc) return abc;
fun inline_newline(let def)
return def;
// Typed params & return types
fun add(int a, int b) -> int {
return a + b;
}
// Recursion (Fibonacci sequencer)
fun fib(let number) {
if (number <= 1) return number
return fib(number - 2) + fib(number - 1)
}
print(fib(10)) // 55
// Dynamic defaults
fun test(let a: 5) {
print(a);
}
test() // 5
import module
import module as hi
import module.*
import module.abc.*
import module.abc.def
import module.abc.def as xyz
import from module.abc { def as xyz, mno, ghi as jkl }
import from module.abc.def {
ghi as jkl,
mno,
pqr as stu
}
type address = {
street: string,
city: string,
state: string,
zip: int
};
pub cls Business = {
fun new(string name, address addr) -> self {
self.name = name;
self.address = addr;
};
pub fun get_address() -> address {
return self.address;
};
};
const business = Business("Jink", {
street: "1234 Jink St.",
city: "Jinkville",
state: "Jinkland",
zip: 12345
});
print(business.get_address().city); // Jinkville
You will need to have Rust installed on your machine. You can follow the instructions on the Rust website to install it.
You will also need (at least) LLVM 16.0.0 installed on your machine. You can follow the instructions on the LLVM website to install it.
To run the project, you can run the following command:
cargo run ./path/to/file.jk
To run the compiler in verbose mode, you can run the following command:
cargo run ./path/to/file.jk -v
This will help you see the output of the parser and IR builder and debug any issues you may have.
To run the interpreter, you can run the following command:
cargo run ./path/to/file.jk -i
Contributions are very welcome. Please read the CONTRIBUTING.md file to get acquainted with the process and guidelines. If you have any questions, feel free to ask in Jacob's project Discord server.
This project is distributed under the GPLv3 License - see the license file for details.
Copyright © 2024 Jacob Noah, jink-lang contributors