2 ms·
I think you've misunderstood what they're proposing here. Especially this: > Clojure requires all STM activity to happen within the dosync block. In python, th
by masklinn 15y ago
I think you've misunderstood what they're proposing here. Especially this:
> Clojure requires all STM activity to happen within the dosync block. In python, that would be like requiring the magic to happen within a "with transaction(): ...".
Under the proposal, all Python code would run under STM, only C-API and OS-level codes would run outside STM.
Edit: to clarify, the most common issue with implementing a viable STM (in just about every language apart from haskell) is the interaction between STM-managed objects and non-stm-managed objects. Under Pypy's proposal, there would be no such thing as all objects would be STM-managed.
- arohner 15y agoI do understand that aspect of their proposal. My point is that causes unnecessary amounts of work. In typical Clojure, there's a very high ratio of pure functional code to STM code. i.e. you'll probably make 10 or 100 pure functional calls between each STM interaction. Under the current pypy proposal, they're going to STM-ize every function call, regardless of whether it needs to do STM work. If the language had been built with STM in mind, with an explicit STM call, more user and library level code would adapt to that, and use STM sparingly.