TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Learn TLA+

350 pointsby MindGodsalmost 3 years ago

20 comments

tra3almost 3 years ago
My mind works best with examples, I was about to ask here when I stumbled upon it on the TLA site [0].<p>The example starts out with a simple piece of code that exposes a bug, then the bug gets fixed and the following question is asked:<p>&gt; Does the issue go away because we’ve solved it, or because we’ve made it rarer? Without being able to explore the actual consequences of the designs, we can’t guarantee we’ve solved anything<p>&gt; The purpose of TLA+, then, is to programmatically explore these design issues. We want to give the tooling a system and a requirements and it can tell us whether or not we can break the requirement. If it can, then we know to change our design. If it can’t, we can be more confident that we’re correct.<p>[0]: <a href="https:&#x2F;&#x2F;www.learntla.com&#x2F;intro&#x2F;conceptual-overview.html" rel="nofollow">https:&#x2F;&#x2F;www.learntla.com&#x2F;intro&#x2F;conceptual-overview.html</a>
评论 #31954461 未加载
评论 #31955486 未加载
metadatalmost 3 years ago
I wonder if it&#x27;s possible to model how fucked up the Golang concurrency model is with TLA+?<p>As a TLA non-SME I couldn&#x27;t say, but would definitely find it useful and probably impressive. Maybe Brad Fitzpatrick could team up with Aphyr and use it to make golang v2 a bit less crap.<p>Note: I write this with love, as someone who&#x27;s written hundreds of thousands of lines of Go, and am now turned off and afraid of the behavior at the sketchy edge boundaries. I&#x27;ve now shifted to learning Rust, albeit slowly and finding it saddeningly challenging compared to what I can pump out with the Go.<p>For reference, see &quot;Data Race Patterns in Go&quot;, posted 21 days ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31698503" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31698503</a>
评论 #31956060 未加载
rotiferalmost 3 years ago
I just started reading the book a couple of days ago. Sigh... :-)<p>One thing that I wish websites did is to make it easy to report simple typos and grammatical errors without having to go through GitHub. For example, on <a href="https:&#x2F;&#x2F;www.learntla.com&#x2F;intro&#x2F;faq.html" rel="nofollow">https:&#x2F;&#x2F;www.learntla.com&#x2F;intro&#x2F;faq.html</a> &quot;losting&quot; should be &quot;losing&quot;. It would be great to simply and quickly report them without having to context switch and go through the overhead of opening an issue or creating a PR. (In any case, I don&#x27;t even have a GitHub account.)
评论 #31953167 未加载
评论 #31954693 未加载
drekipusalmost 3 years ago
Genuine question: how does this compare versus something like modelling in primitive python? what benefits are there, or is it just a case of age and that this is language &#x2F; system agnostic?<p>I&#x27;m just finishing cosmic python[0], which talks about making a primitive model of your system first, that you can run business logic tests on, then all the other code depends upon that (domain driven design &#x2F; onion layers, etc). To me it seems like this is the same thing. The only aspect that stuck out was the &quot;two transfers at the same time&quot; which to me, seems like it would depend on how you&#x27;re implementing the model, rather than the model itself?<p>For instance, the example in [1] could also be done in primitive python, (arguably easier to read in my opinion but I&#x27;m not used to TLA syntax :)<p><pre><code> @dataclass class Person: balance: int def wire(a: Person, b: Person, amount: int): if a.balance &gt;= amount: a.balance -= amount b.balance += amount @pytest.mark.parametrize( &quot;a_amount, b_amount, transfer, a_remaining, b_remaining&quot;, [ (10, 10, 10, 0, 20), # matching amount (6, 10, 10, 6, 10), # has less (0, 10, 10, 0, 10), # has nothing (10, 0, 10, 0, 10), # to empty account ], ) def test_wire(a_amount, b_amount, transfer, a_remaining, b_remaining): a = Person(balance=a_amount) b = Person(balance=b_amount) wire(a, b, transfer) assert a.balance == a_remaining assert b.balance == b_remaining </code></pre> The author did mention &quot;... could be done in python&quot; as well, so I doubt it&#x27;s a case of not knowing about python, but perhaps my question is &quot;why TLA over python?&quot;<p>[0]<a href="https:&#x2F;&#x2F;www.cosmicpython.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.cosmicpython.com&#x2F;</a> [1]<a href="https:&#x2F;&#x2F;www.learntla.com&#x2F;intro&#x2F;conceptual-overview.html" rel="nofollow">https:&#x2F;&#x2F;www.learntla.com&#x2F;intro&#x2F;conceptual-overview.html</a>
评论 #31954734 未加载
评论 #31954673 未加载
评论 #31954725 未加载
评论 #31954901 未加载
评论 #31956789 未加载
im3w1lalmost 3 years ago
So can it spit out C or something? Or something to actually perform the algorithm? Or are you expected to manually translate back and forth between your model specification and your code?
评论 #31953801 未加载
评论 #31954174 未加载
评论 #31955237 未加载
anonymousDanalmost 3 years ago
Several people I know with a formal methods and distributed systems background aren&#x27;t that impressed with TLA+. I&#x27;m not exactly sure why or what else they prefer (Isabel? Coq?). Anyone with a formal methods background care to comment?
评论 #31953334 未加载
评论 #31954122 未加载
评论 #31953368 未加载
评论 #31953269 未加载
评论 #31954317 未加载
评论 #31959631 未加载
评论 #31953503 未加载
RicoElectricoalmost 3 years ago
Ah, the HN&#x27;s favourite language Three Letter Acronym +<p>I ctrl+f&#x27;d the page and the expansion of that acronym, Temporal Logic of Actions is nowhere to be found.
评论 #31956041 未加载
评论 #31957635 未加载
radicalriddleralmost 3 years ago
I wish sites like these were keyboard operable. You have a link down the bottom of the page, if I scroll to the bottom of the page (with space or down key or page down), it would be nice that it gets to the bottom, and then goes to the next page on the next keydown event.<p>We implemented this in medical software for reading patient documents at one of my last jobs, and it&#x27;s a feature I wish more sites that were focused on reading material had (docs, book replacements, etc.)<p>Edit: just want to point out this is in no way a critique of this site specifically, so maybe off topic.
elcapitanalmost 3 years ago
Really liked the paper book, looking forward to the new version of the website!<p>Nice to see some new posts on TLA every once in a while. A few days ago someone posted this series of very real-world examples: <a href="https:&#x2F;&#x2F;elliotswart.github.io&#x2F;pragmaticformalmodeling&#x2F;" rel="nofollow">https:&#x2F;&#x2F;elliotswart.github.io&#x2F;pragmaticformalmodeling&#x2F;</a> It&#x27;s also quite good.
dimalalmost 3 years ago
This looks like it could be really useful. I tend to write out my specs in pseudocode before coding anyway, so being able to easily translate that human gobbledygook into a form that can be checked for correctness, seems like it could help the creative process of coming to a solution. Just try out ideas and see if they help solve it. Keep honing them down until you get it.
oggyalmost 3 years ago
Thanks for your work, Hilel! I&#x27;ve been using TLA extensively in my job the last few months (I work at a blockchain company), and it&#x27;s been a good run - we found a bunch of issues in several designs and even implemented code (some fairly critical). My secret hope is to get some co-workers to start using TLA themselves (so I can go off to do code-level verification instead hehe), I&#x27;ve organized a couple of internal tutorials but no takers so far - hopefully this free learning resource will help advance that goal :)<p>On a related topic, does anyone know of a comparison to Alloy 6? I&#x27;ve been meaning to take a day or two to look at it (I tried Alloy out a while ago while I was still in my PhD, but have forgotten most of it), I&#x27;m curious to see how it stacks up.
rramadassalmost 3 years ago
Also relevant: <a href="https:&#x2F;&#x2F;pron.github.io&#x2F;tlaplus" rel="nofollow">https:&#x2F;&#x2F;pron.github.io&#x2F;tlaplus</a>
wespiser_2018almost 3 years ago
Congrats Hillel, great work. A teammate used TLA+ at work to help diagnosis a deadlock bug due to a lock issue in postgres, and since then I&#x27;ve been mesmerized by its simplicity and power to prove simple invariants over complex specs. Looking forward to reading more!
an_d_rewalmost 3 years ago
Awesome, thank you, Hillel!<p>Bought the book, FWIW, and love it - but this will help me evangelize TLA+ with my employer and other groups!
sriram_malharalmost 3 years ago
This is good stuff, Hillel. Thank you.<p>The images don&#x27;t render correctly on macOS safari (v 13.1.3). They are squished horizontally.
bediger4000almost 3 years ago
How does TLA compare to Spin?
评论 #31956049 未加载
评论 #31957275 未加载
Pr0ject217almost 3 years ago
This is very interesting and practical. Thank you.
dqpbalmost 3 years ago
I wish this wasn&#x27;t so focused on PlusCal
评论 #31953181 未加载
评论 #31953194 未加载
evnixalmost 3 years ago
any examples of where TLA+ is being used? do any open source projects use this?
评论 #31957613 未加载
jacoblambdaalmost 3 years ago
This looks awesome. I&#x27;m hoping to start working through it starting some time in the next few weeks.