6,773 karma · joined August 21, 2008
I was struggling a bit to come up with good use cases for it. Their examples are all around combining them with existing data structures and they show that the space complexity is smaller, but it wasn't completely clear to me how feasible this would actually be in practice.
I’m totally cool with people using this as an initial draft and then manually tweaking it though.
Yes, and this means that for me to trust that the code is memory safe I need to trust the people who develop the standard library (or validate the unsafe usage myself). Rust has a good track record and a very good review process to ensure correctness of their "unsafe" block.
This library however? Do they know how to write "unsafe" blocks? I don't know! Maybe? If there were zero uses of "unsafe" in this library I would be able to adopt it without worrying about memory safety at all. In addition, I'm not that good at knowing whether an "unsafe" block is safe myself. It's not like I can review this cases myself and be confident.
(Memory safety is of course not everything, but bugs related to memory safety are much more annoying than other types of bugs.)
If you have a server-side rendered Ruby application with complicated view logic I can 100% recommend this approach (either Tubby, HTML_slice or Phlex). It's a super powerful way of structuring logic. You can create standalone classes which represents concepts (e.g. I've created a "ResourceCalendar" which renders a calendar view showing which resources are available for a given day), add methods which act on these, and finally make them renderable. It's heavily composable. It's very similar to React components, but here you also have the power of defining separate methods instead of having everything be hooks (with weird limitations) at the top of the component.
I also wrote a longer article here describing the different types of components you can build using Tubby: https://github.com/judofyr/timeless/blob/master/posts/compos.... I think this would also apply to HTML_slice and Phlex.
But yea, he’s been acting far from perfect the last few years.
This is taken a bit out of context. Day 1 is a qualification phase. Only the top 8 after that ends up playing on day 2. Saying «I will play two more days» would be more arrogant since it would imply he thinks he would easily be top 8.
EDIT: It could however be considered a subtle criticism of the format. Previously there were two days with 10-11 games per day. With the new qualification system you’re suddenly more dependent on having a good first day. Many players have expressed that they thought it was more fair to have more games over two days.
The reason is (according to Carlsen) of course that FIDE is driven by a strict adherence of «rules» which are defined by a small set of people in power. Whenever something happens they always say «oh, but these are the rules», but the process for changing the rules is very one-sided and power driven. This was the straw that broke the camel’s back. Yet another example of a silly unnecessary rule.
[1]: In an earlier WC he got stuck in traffic and arrived in ski clothing, but changed after the first round.
1. The biggest one is probably that there is already so much interest and depth in regular chess. "Everyone" focuses on it, so that's what your friends know and where you can find competitions and community. This leads to a chicken-egg problem where it hard to kick it off. It's basically like another board game.
2. Some opening positions in Fischer chess are quite awkward: The pieces are on squares where it takes a while for them to come into proper play. This can make the opening phase quite unsatisfying to play. You need to make a lot of extra moves before you actually get into the interesting parts. It's not necessarily more "fun" to play this way than regular chess. There's also some positions which are much better for white (although it's on average more balanced I believe)
3. IMO, regular chess is easier for lower-rated players. The choice of openings don't matter so much (either way the game is decided by someone hanging a piece), and it's a lot easier to follow existing games. In Fischer chess it can be even harder to know "okay, what do I do?", while in regular chess there's both general principles and systems to follow. This means that most newer players keep being exposed to regular chess instead of Fischer chess.
> Wouldn't Fischer chess take the game to a whole new level, making it so that all the opening books are useless and the midgame requires much more improv?
Magnus Carlsen is promoting and advocating for Freestyle Chess (same game as Fischer chess, but with different name): https://www.freestyle-chess.com/. Maybe it'll take off.
To me it seems rather arbitrary that appending to a slice concurrently in two different goroutines causes the garbage collector's sweep-phase to internally think another allocation has occurred.
runtime: pointer 0xc00379ac60 to unused region of span span.base()=0xc001794000 span.limit=0xc001795e00 span.state=1
fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)
runtime: nelems=8 nalloc=5 previous allocCount=4 nfreed=65535
fatal error: sweep increased allocation count> > If 0/0 = 0 then lim_(x -> 0) sin(x) / x = sin(0) / 0 = 0, but by L’Hospitals’ Rule lim_(x -> 0) sin(x) / x = lim_(x -> 0) cos(x) / 1 = 1. So we have 0 = 1.
> This was a really clever one. The issue is that the counterargument assumes that if the limit exists and f(0) is defined, then lim_(x -> 0) f(x) = f(0). This isn’t always true: take a continuous function and add a point discontinuity. The limit of sin(x) / x is not sin(0) / 0, because sin(x) / x is discontinuous at 0. For the unextended division it’s because sin(0) / 0 is undefined, while for our extended division it’s a point discontinuity. Funnily enough if we instead picked x/0 = 1 then sin(x) / x would be continuous everywhere.
Similar examples can be constructed for any regular function which is discontinuous (e.g. Heaviside step function).
(4 nested BaseExceptionGroup: Exceptions from Trio nursery (1 sub-exception), and then:
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/nix/store/5cdw4sa0n0lwym47rd99a1q6b4dj7nr9-python3.12-shrinkray-0.0.0/lib/python3.12/site-packages/shrinkray/work.py", line 221, in parallel_map
| yield receive_out_values
| File "/nix/store/5cdw4sa0n0lwym47rd99a1q6b4dj7nr9-python3.12-shrinkray-0.0.0/lib/python3.12/site-packages/shrinkray/work.py", line 71, in map
| yield v
| GeneratorExit
+------------------------------------
Not sure if this is a known issue? Note that I ended up not respecting all of the version requirements in the pyproject.toml since I tried to run it all in Nix and there the Poetry support is currently quite lacking.It took some time to get RustPython to run, but it seems to work fine: https://gist.github.com/judofyr/82d2255c92ebb0c6b3a6882ac9fd...
Also, after running it for 5 minutes it was now able of reducing it to a much smaller case:
class a:
def b() : c
def h(d) :
while d:
break
else:
return
d.b()
def j(e) :
f = a()
if f.h () :
g
i = ""
j(i)Okay fine, let's see for ourselves:
# Setup
git clone git@github.com:RustPython/RustPython.git && cd RustPython && cargo build --release
git clone git@github.com:tekknolagi/scrapscript.git && cp scrapscript/scrapscript.py .
# Download interesting.sh, replace the path to RustPython
chmod +x interesting.sh
# Command in article:
nix run nixpkgs#creduce -- --not-c interesting.sh scrapscript.py
Niiice: (93.2 %, 13717 bytes)
(93.2 %, 13683 bytes)
(93.3 %, 13614 bytes)
(93.3 %, 13592 bytes)
(93.3 %, 13571 bytes)
(93.3 %, 13517 bytes)
(93.3 %, 13449 bytes)
(93.4 %, 13412 bytes)
(93.4 %, 13365 bytes)
(93.4 %, 13333 bytes)
(93.4 %, 13313 bytes)
It seems to have stopped at "(96.4 %, 7347 bytes)" with the following output: https://gist.github.com/judofyr/47cba8a20cb2cd5798943ef975d0...Okay sure you're technically correct here, but only because these expressions generate a subset of a regular language. The LLM can only be invoked on a substring that can expressed as a regular expression, and then it's only used to remove strings from the language. Their results are based heavily on how regular expressions work. A "semantic context-free grammar" would have different type of characteristics and behavior.
Maybe throwing in the word "extended" or "augmented" would be a bit more clear, but as I reader I definitely would expect "regular expression" to be part of the name.
As for outside of the computer science sphere (which I find is quite consistent in their terminology): I do agree that it seems like it’s a lost cause and «regex» is now synonymous for «pattern matching using this one specific syntax» :(
(The etymology of a word can be quite different from its current meaning today.)
Oooooh, now I see what's going on here. The good ol' "the reason no one listens to us because we're too smart for them".
Unfortunately, the fact that some smart people was ignored by their peers doesn't mean that "being ignored" suddenly becomes evidence for your thoughts being "beyond the median". It could also be that it's just not that groundbreaking.
(Disclaimer: I've only read a few LessWrong articles over years and I don't have that strong opinion of their community. Mostly basing this comment on just this post.)
There might be some fairness concerns here? Since we're polling the lock (instead of adding ourselves to a queue) it could be the case that some requests are constantly "too late" to acquire it? Could be interesting to see the min/max/median/P99 of the requests themselves. It seems that Bustle only reports the average latency[1] which honestly doesn't tell us much more than the throughputs.
[1]: https://docs.rs/bustle/latest/bustle/struct.Measurement.html
It would be good to see a benchmark where it only touches a _single_ key. If Whirlwind is still fast than the others I would be far more convinced to use it unconditionally.
EDIT: I also see that you're benchmarking on a M3 Max. Note that this has 6 performance cores and 6 efficiency cores. This means that if you're running at <6 cores it will most likely start out running it at the efficiency core. From my experience it's quite important to do warmup phases in order to get stable results at low thread count. And even then I find it hard to reason about the results since you're running in mixed set of cores…
> Private Cloud Compute hardware security starts at manufacturing, where we inventory and perform high-resolution imaging of the components of the PCC node before each server is sealed and its tamper switch is activated. When they arrive in the data center, we perform extensive revalidation before the servers are allowed to be provisioned for PCC. The process involves multiple Apple teams that cross-check data from independent sources, and the process is further monitored by a third-party observer not affiliated with Apple. At the end, a certificate is issued for keys rooted in the Secure Enclave UID for each PCC node. The user’s device will not send data to any PCC nodes if it cannot validate their certificates.
This is a good point as well! When reading it I was reflecting on how internet compares to 1980s television. Yes, it has much more dopamine-fueled content, but it's way less of a monoculture. It gives a lot of opportunity for people to seek out what they're interested in and there's hundreds (thousands?) of communities with very different set of thoughts.
Are you talking about this comic (i.e. a few sentences from the book) or the whole book?
I read the book a few years back and it's entirely focused on culture as a whole and less about the individual choices. He's not making a point of "television makes you dumb" (or "dumb people watches television"), but rather he makes the distinction between an "oral"-, "press"- and "television"-based culture. He claims that it's bad when television becomes the main platform that a society centers its communication around.
He's also honest that there's probably far more junk (in absolute terms) in printing than in television: "Television is not old enough to have matched printing's output of junk." It's not about the amount of "junk" – it's about something more fundamental about the medium.
I found the book quite interesting and would highly recommend reading it!
> They'd be boozing (more than they already are) if there wasn't such variety of cheap and available entertainment, the author doesn't seem to realize?
That's an extremely pessimistic view of the world: Categorizing a set of human beings as "stupid" and saying that it doesn't matter how society is structured?
And "smart people" are also influenced by how our society is structured, no?
CRDTs take an editor event such as "insert at position X" and turns it into something a concrete operation like "insert to the right of node Y created by client C" which is then sent. This makes it super easy to apply concurrent operations since they have a direct reference to where they're located. However, it also means that you know have to keep track of these nodes. All of the nodes that has ever existed is present at all times, and deletion is handled as a state flag which marks it as hidden.
OTs take an editor event such as "insert at position X" and keeps it like that. Whenever a concurrent event is received it then tries to "rebase" it (i.e. patch that event) so that it makes sense on top of the current events. However, this (1) can be quite finicky to get right and (2) it is based on there being One True Order of Events (i.e. a server).
This approach takes an editor event such as "insert at position X" and keeps it like that. When applied, it can be inserted into an "ever-growing list of atoms with state flag". However, in this algorithm the data structure is actually capable of representing two different versions at the same time: A current version and a final version. This is handled by there being two state flags instead of one: Every node has a "current state = exists/deleted" and "final state = exists/deleted".
This gives us the power of doing a "soft undo" (which is called "retreat" in the paper): We can take our own latest event which we've applied, revert the effect on the current version, while still keeping the final version the same. We're handling this very similar to CRDTs: We keep all the nodes at all time, we're just using state flags to keep track of whether it exists or not.
This is useful when we observe a concurrent event. This event have references to positions which are valid in the context of its parent. If we "retreat" of all of our events until we reach the parent, we then have a data structure which represents the text at that point. We can now apply the "insert at position Y"-events which we received by interpreting "Y" in terms of the current version. After we've applied all of those events we can then look at the final version and this now actually contains the combined result of both changes!
And here comes the nice part: Since the events themselves are always on the form "insert at position X" it means that we can choose another representation of applying them. For instance, if we know that there are no concurrent events that are happening, we might as well apply them directly on a string without bothering with the whole "current/final dual data structure".
A similar tool for this would be VCR (originally built in Ruby, but ported to other languages since): https://vcrpy.readthedocs.io/en/latest/. This injects itself into the request pipeline, records the result in a local file which can then also be replayed later in tests. It's a quite nice approach when you want to write tests (or just explore) a highly complicated HTTP API without actually hitting it all the time.