Dynamic languages like Erlang, Clojure, JavaScript, and E adopted data-race freedom by design. To enforce data-race freedom, these languages either deep copy objects during actor (thread) communication or proxy back to their owning thread. We present Dala, a simple programming model that ensures data-race freedom while supporting efficient inter-thread communication. Dala is a dynamic, concurrent, capability-based language that relies on three core capabilities: immutable values can be shared freely; isolated mutable objects can be transferred between threads but not aliased; local objects can be aliased within their owning thread but not dereferenced by other threads. Objects with capabilities can co-exist with unsafe objects, that are unchecked and may suffer data races, without compromising the safety of safe objects. We present a formal model of Dala, prove data race-freedom and state and prove a dynamic gradual guarantee. These theorems guarantee data race-freedom when using safe capabilities and show that the addition of capabilities is semantics preserving modulo permission and cast errors.
翻译:Errang, Clojure, JavaScript 和 E 等动态语言,例如 Errang, Clojure, Clojure, JavaScript 和 E 采用数据-竞赛自由。为了实施数据-竞赛自由,这些语言要么在演员(轨迹)通信中或将对象复制到他们自己的线条上,要么在演员(轨迹)通信中深度复制对象,要么将对象复制回到他们自己的线条上。我们展示Dala,这是一个简单的编程模型,既能确保数据-竞赛自由,又能支持高效的轨迹间通信。Dala是一种动态的、同时的、基于能力的语言,依赖三种核心能力:不可改变的价值可以自由分享;孤立的可移动物体可以在线索之间转移,但不能用别名;本地物体可以在它们自己的线条内化,但不能被其他线线条割除。 具有能力的物体可以与不安全的物体同时存在,这些物体不受限制,并可能遭受数据竞赛,同时不损害安全物体的安全。我们展示一个正式的Dala 模式,证明数据- 种族- 自由和状态和状态,并证明一个动态渐进的保证。这些符号在使用安全能力时可以保证数据- 并且显示数据- 种族- 并且表明能力的增加能力是保存 Mour 和错误。