用于构建高可靠并发软件的 Inko 语言

Inko 是一种用于构建高可靠并发软件的语言。Inko 让构建并发软件变得容易,无需担心不可预测的性能、意外的运行时错误或竞争条件。

Inko 具有确定性的自动内存管理、移动语义、静态类型、类型安全的并发、高效的错误处理等等。Inko 源代码使用 LLVM 编译为机器代码。

有关更多信息,请参阅 Inko websitethe documentation。如果您想关注 Inko 的开发,请考虑加入 our Discord server

示例

Hello world:

import std.stdio (Stdout)
type async Main {
 fn async main {
  Stdout.new.print('Hello, world!')
 }
}

一个简单的并发程序:

import std.sync (Future, Promise)
type async Calculator {
 fn async fact(size: Int, output: uni Promise[Int]) {
  let result = 1.to(size).iter.reduce(1, fn (product, val) { product * val })
  output.set(result)
 }
}
type async Main {
 fn async main {
  let calc = Calculator()
  match Future.new {
   case (future, promise) -> {
    # This calculates the factorial of 15 in the background, then we wait
    # for the result to be sent back to us.
    calc.fact(15, promise)
    future.get # => 1307674368000
   }
  }
 }
}

更多示例,请参阅 website

安装

有关如何安装 Inko 及其要求的详细信息,请参阅 Inko 手册中的 "Installing Inko" 指南。

许可证

除非另有说明,否则本存储库中的所有源代码均根据 Mozilla Public License version 2.0 获得许可。该许可证的副本可以在文件“LICENSE”中找到。

关于

A language for building concurrent software with confidence inko-lang.org

Topics

programming-language rust compiler llvm inko

Resources

Readme

License

MPL-2.0 license Activity Custom properties

Stars

1.1k stars

Watchers

12 watching

Forks

49 forks Report repository

Releases

29 tags

Sponsor this project

Sponsor Learn more about GitHub Sponsors

Packages 0

Contributors 21

+ 7 contributors

Languages