任何语言中的直观并发编程
Intuitive concurrent programming in any language

原始链接: https://www.lf-lang.org/

Lingua Franca 是一种面向反应器的协调语言,用于组合反应式组件。它通过构造防止竞态条件,支持精确的定时行为,并避免手动同步。例如,它可以强制石头剪刀布中的同时出招,并检测无效的因果循环。它不是完整的编程语言;开发者继续使用 C、C++、Python、TypeScript 或 Rust 编写反应器逻辑,而 Lingua Franca 负责协调。

这篇 Hacker News 帖子讨论了 Lingua Franca,它被描述为一种用于直观并发编程的协调语言,支持多种宿主语言,包括 C、C++、Python、TypeScript 和 Rust。它使用 reactor 和数据流风格的端口来连接组件。评论者指出它与基于流的编程和命名端口的相似之处,并争论它是否通过逻辑时间提高了相对于 Erlang 的确定性。其他人批评了落地页的电梯演讲、命名、示例设计和有限的语言支持,同时要求更清晰的比较、Python 示例和优势证据。其他评论提到了机器人替代方案如 copper-rs、动态改变 actor 结构的限制以及更广泛的异步业务逻辑挑战。总体而言,该帖子显示了对确定性数据流并发的兴趣,但呼吁更好的文档和理由。
相关文章

原文

A New Programming Paradigm

Lingua Franca is the first reactor-oriented coordination language. It allows you to specify reactive components and compose them. Lingua Franca eliminates race conditions by construction, makes it easy to specify timed behavior, and removes the need to perform manual synchronization.

Consider a game of "rock paper scissors" where two players need to reveal their choice simultaneously. In Lingua Franca, "at the same time" has a clear and precise meaning. This makes the implementation simple and intuitive, and guarantees it to be fair. If the Player class were to observe the other's choice before revealing its own, Lingua Franca's causality analysis would find a causality loop and tell you that the program is invalid.

Not a New Programming Language

With Lingua Franca, you forget about thread libraries or message passing middlewares, but you continue using the languages you like. The bodies of reactive code that make up the functionality of reactors are written in the programming language of your choice. We currently support C, C++, Python, TypeScript, and Rust.
联系我们 contact @ memedata.com