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.

Hamster - Efficient, Immutable, Thread-Safe Collection classes for Ruby

39 pointsby justinweissalmost 13 years ago

6 comments

exDM69almost 13 years ago
Is it just me or is anyone else annoyed about Ruby people calling their hash table based dictionaries a "hash"? As a non-Ruby programmer, I always get confused when people talk about hashes and you can never be quite sure if it's a dictionary or an integer hash value.
评论 #4207934 未加载
评论 #4207595 未加载
评论 #4207534 未加载
josteinkalmost 13 years ago
Not to be a pedant, but wouldn't thread-safe automatically follow immutable?<p>If a structure is immutable, how would you be able to fuck it up, even if you abuse it via threading? I would argue the relation is so strong, that something which <i>isn't</i> thread-safe cannot be immutable. But there may ofcourse be something which I'm missing.<p>Different languages and platforms handling different key concepts differently etc.<p>Is there some properties of Ruby which makes this possible, or gives you a need for a double-guarantee, or is the declaration here simply redundant?
评论 #4206800 未加载
评论 #4206950 未加载
评论 #4207599 未加载
kristianpalmost 13 years ago
Hmm, I assumed this would have to be written in C so that it could use multiple threads in parallel in MRI, but it seems not. Then I remembered concurrent != parallel.
评论 #4207553 未加载
sircluelessalmost 13 years ago
<p><pre><code> def dup self end </code></pre> Weehee, immutability is great at some things.
alttabalmost 13 years ago
How many people do multi threading in ruby? I'm assuming this is mostly for jruby?
评论 #4206242 未加载
评论 #4206592 未加载
评论 #4206751 未加载
评论 #4210492 未加载
评论 #4206325 未加载
评论 #4206647 未加载
mitchellhalmost 13 years ago
As of git HEAD at the time of this comment (5edce74):<p>1499 lines of Ruby code.<p>19 lines of comments.<p>Nope, nope, nope. I would never touch this library.<p>Good amount of tests, but the moment this library doesn't work as expected and you need to jump into the code, you're completely screwed.<p>Not usable.
评论 #4206616 未加载
评论 #4206612 未加载
评论 #4206613 未加载
评论 #4207403 未加载