A language for building concurrent software with confidence
Inko 是一种旨在构建高可靠并发软件的语言,它简化了并发编程,避免了性能问题、运行时错误和竞争条件。Inko 具有确定性内存管理、移动语义、静态类型等特性,并使用 LLVM 编译为机器代码。文章提供了简单的示例代码,展示了 Inko 的基本用法,并提供了安装、许可证和相关资源的链接,包括官方网站、文档和 Discord 服务器。
用于构建高可靠并发软件的 Inko 语言
Inko 是一种用于构建高可靠并发软件的语言。Inko 让构建并发软件变得容易,无需担心不可预测的性能、意外的运行时错误或竞争条件。
Inko 具有确定性的自动内存管理、移动语义、静态类型、类型安全的并发、高效的错误处理等等。Inko 源代码使用 LLVM 编译为机器代码。
有关更多信息,请参阅 Inko website 或 the 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
License
MPL-2.0 license Activity Custom properties
Stars
Watchers
Forks
Releases
Sponsor this project
Sponsor Learn more about GitHub Sponsors
Packages 0
Contributors 21
Languages
- Rust 99.6%
- Other 0.4%