Skip to content
项目

关于

🔮 A modern multi-paradigm compiled programming language for the JVM platform. website: https://ixionlang.ru/

编程语言与运行时

这些数字如何统计

实测星标增长

24小时
0
7天
+4
15天
+4
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Multi-paradigm compiled programming language for the jvm platform.

Specification: Русский · English

Docs: Русский

Build from source

Install JDK 21 and make sure java -version reports version 21. The repository includes the Gradle Wrapper, which downloads Gradle and the project dependencies on the first build.

Clone the repository and open its root directory.

git clone https://github.com/ixionlang/ixion.git
cd ixion

On macOS or Linux, run:

./gradlew build

On Windows, run this in PowerShell:

.\gradlew.bat build

The build runs the tests and writes the compiler JAR to build/libs/.

Examples

tree:

use <std>

type Tree[T] = enum {
  Leaf(value: T),
  Node(left: Tree[T], right: Tree[T]),
}

def mapTree[A, B](tree: Tree[A], f: (A) => B): Tree[B] {
  return case tree {
    Tree::Leaf(value) => Tree::Leaf(f(value)),
    Tree::Node(left, right) => Tree::Node(mapTree(left, f), mapTree(right, f)),
  }
}

def main() {
  let tree = Tree::Node(Tree::Leaf(-1), Tree::Leaf(7))
  std::println(mapTree(tree, lambda (n) { return n > 0 }))
}

Result:

use <std>

def mapResult[A, B, E](result: Result[A, E], f: (A) => B): Result[B, E] {
    return case result {
        Result::Ok(value) => Result::Ok(f(value)),
        Result::Err(error) => Result::Err(error),
    }
}

def main() {
    let success: Result[int, string] = Result::Ok(21)
    let failure: Result[int, string] = Result::Err("offline")

    std::println(mapResult(success, lambda (n) { return n >= 18 }))
    // Ok(true)

    std::println(mapResult(failure, lambda (n) { return n >= 18 }))
    // Err(offline)
}

Contributions

We will review and help with all reasonable pull requests as long as the guidelines below are met.

  • The license header must be applied to all java source code files.
  • IDE or system-related files should be added to the .gitignore, never committed in pull requests.
  • In general, check existing code to make sure your code matches relatively close to the code already in the project.
  • Favour readability over compactness.
  • If you need help, check out the Google Java Style Guide for a reference.

探索相关项目

加载中…