Giter VIP home page Giter VIP logo

jinkies's Introduction

Jink

The Jink programming language

GitHub Actions Workflow Status GitHub last commit GitHub contributors Discord License GitHub Repo stars

About

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.

Status

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.

Goal Checklist / TODOs

Here are a list of goals that scope out the Jink project and repository, not in or by any particular order or specification.

General
  • 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
Compiler
  • 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
Lexer
  • Lex string interpolation
Parser
  • 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

Examples

Hello World
print("Hello, World!"); // Hello, World!
Variables
const name = "Jacob";
let age;
age = 1 + 100 / 4;

print(name); // Jacob
print(age); // 26
Functions
// 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
Modules
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
}
Classes
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

Installation

Prerequisites

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.

Running

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

Contributing

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.

License

This project is distributed under the GPLv3 License - see the license file for details.

Copyright © 2024 Jacob Noah, jink-lang contributors

jinkies's People

Contributors

jacob-noah avatar imposd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.