Better HN
topnewbestaskshowjobs
Log inSign up

codeflo

9,664 karma · joined Jun 14, 2010 (16y ago) · 1,504 submissions

Submissions

comment 4y ago · link · parent

I thought I did well until the bit-shifting questions. Who in their right mind designs a language where shifting the bits of a u16 silently converts into an i32? Doubly so since that fact alone directly causes UB — keeping the u16 would have been perfectly fine.

(Edit, since some respondents seem to miss this, explanations about efficiency or ISAs might justify promoting to u32 (though even that's debatable), but not i32. A design that auto-promotes an unsigned type, where every operation is nicely defined and total, into a signed type, where you run into all kinds of undefined behavior on overflow, is simply crazy.)

comment 4y ago · link · parent

Even many founders find it hard to turn around the ship that they built, the forces of institutional inertia work against them as well. I wonder if he simply ignored most of the existing organization and management, and more or less stealth-founded a new startup inside the old one. Even that is not easy.

comment 4y ago · link · parent

That might be, and before the iPhone reveal, the vision was supposedly to target Nokia-style button phones.

The difference could be that the technical foundation was more sound, and also, Google is institutionally capable of large refactorings in a way that I think few other companies are.

People forget this, and it’s solved now, but it took Android several years and quite a few iterations of the rendering layer to get smooth scrolling working to the level of the iPhone 1. Look up “Project Butter” if you’re interested.

Smooth scrolling is hard, but important for touch to feel perfectly right. I’m convinced that this is one of the places where it mattered that touch screens were an afterthought in the original architecture.

comment 4y ago · link · parent

Are you talking about individuals or the organization? I’m sure some employees in management “won” financially, there are very few failed companies where that isn’t the case.

comment 4y ago · link · parent

> When Netflix made the decision to move from mail-based rental to streaming, they did not allow leaders involved in rental business to any meetings involving the company future planning.

I wonder, who was the “they” that successfully made such a decision? In most places, there wouldn’t be any senior leadership that isn’t “tainted”, so to speak, by the previous business model. Even a freshly appointed CEO is ineffective if not supported by the bulk of the organization. I wonder how Netflix managed to solve this.

comment 4y ago · link · parent

I'm the OP. That was exactly my question, great explanation. I've been confused by similar apparent paradoxes before, where I didn't clearly distinguish something being true inside the theory and outside of it.

comment 4y ago · link · parent

I'm interested in that as well. On the other hand, all of that can only account for constant factors (in the limit, I can use some extra states to encode a lambda calculus interpreter in my Turing machine). Even for Turing machines, two symbols tapes might not be the most efficient in terms of BB steps per encoded machine bit.

Having said all that, your encoding is a bit wasteful, so let's optimize. ;)

First, there's really no need for the encoded states to end on bit boundaries. To give an example, to encode 9 numbers between 0 and 9 (inclusive), you don't need 9*ceil(log2(10))=36 bits, you only need ceil(9*log2(10))=30 bits by treating the digits as a large decimal number and converting that to binary.

Second, if you're going to halt anyway, there's no need (at least for the BB problem) to write a symbol and move the tape on the last transition, so we can simply treat that as an alternative to encoding a transition.

Armed with both of those, the size of an encoded machine goes down to ceil(2 * 6 * log2(2 * 2 * 6 + 1)) = 56 bits. (In general for n states and k symbols, ceil(k * n * log2(2 * k * n + 1)). The 2 is for the directions, the + 1 is the halting transition.)

comment 4y ago · link · parent

The Busy Beaver function is fascinating. Seemingly so easy to define: Of all possible turing machines with N states that eventually halt, what's the number of steps that the longest-running one takes?

It's not "just" that this is uncomputable, given the halting problem. Lots of things in mathematics are uncomputable. What's special about this function is that it will eventually blast through the limits of what any given formalization of mathematics can prove at all, no matter how powerful -- like ZFC + CH + whatever other axioms you come up with.[1]

To be honest, I can't fully wrap my head around what this means. Given that some of these powerful set theoretic axioms are independent from each other, I'm not sure whether ZFC+CH could have a different idea about BB(8000) than ZFC+notCH would. That wouldn't make much sense to me at least, because a Turing machine halting or not halting feels like a concrete fact that shouldn't depend on assumptions about weird infinite sets. But I don't know.

[1] Also from Scott Aaronson's blog, BB(8000) and above are independent from ZFC: https://scottaaronson.blog/?p=2725

comment 4y ago · link · parent

Wouldn’t it be reasonable for their backend to only accept (write) requests from whatever the anti-spam proxy is? Otherwise, there’s little point.

comment 4y ago · link · parent

> Those messages are considered speech from a Constitutional perspective.

I have no reason to doubt that your credentials as a constitutional lawyer are impeccable.

> The further a block gets away from the initial block, then the less imminent the illegal action becomes.

This very plausible legal theory inspires incredible confidence.

comment 4y ago · link · parent

As Tony Hoare already wrote in the 80s: “There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.”

comment 4y ago · link · parent

I’ve seen many instances where a low-skill programming place either lives with a bug, or alternatively, adopts a solution that involves meticulously copy&pasting a workaround into 300 places.

Having said that, I know great, intelligent programmers, sone of who worked on compilers, who are simply bad in a whiteboard setting. Having a filter is necessary, I’m just not convinced a Google-style interview filters exactly the right thing.

comment 4y ago · link · parent

What the actual fuck… I only got two pages down and already found several red flags that I would never accept in any code review. Not the least of which is that when querying an edgeless graph for the shortest path from node A to node Z, “the empty path of length 0” is the exact opposite of a correct answer.

So thanks for the link, I guess. I’ll keep this as ammunition for the next time someone quotes Uncle Bob.

comment 4y ago · link · parent

There seems to be a LAMBDA ... } syntax as well that works as an expression. Along with the upper case keywords, I'm convinced this language is meant as a joke, but it's very, very subtle. For example, the "Inspiration" page lists as one of the things it intends to borrow from Java, "use of design patterns": http://www.zimbu.org/design/inspiration Like the one thing people love about Java are all the AbstractFactoryFactoryFactories.

comment 4y ago · link · parent

Yeah, something like that. I don't remember the full steps I took, but it involved pacman-static from the AUR, which is a pacman build that works without a working libc. I think I used the USB boot method you mention, but with pacman-static, I was able to go forward and do a full system upgrade.

comment 4y ago · link · parent

> Almost always, it's been surprisingly straightforward to un-screw the few screw-ups I've made.

That's been my experience as well. With Arch, everything is exposed. There are usually no wrappers or layers of abstraction or weird modifications added to the upstream components it ships. That makes problems so much more straightforward to troubleshoot and fix.

comment 4y ago · link · parent

The keyring issue that other commenters mention has to be the dumbest misfeature ever, because upgrading is guaranteed to fail, yet nobody fixes it. To make things worse, one of the top Google suggestions is a pacman command that can cause libc to be upgraded without a full system upgrade, which will make your system unusable immediately. No process will launch after that. I had to do very desperate recovery steps when that happened to me. To be honest, I'm still not entirely sure how to safely fix the keyring issue when it happens.

Other than that, and this may sound very strange given the last paragraph, Arch is fantastic. It's the most usable and useful system for general software development I've ever owned. Basically, you follow the wiki, and everything just works, sound, graphics, wifi. I never had that with Linux, not with Ubuntu, not with SuSE.

comment 4y ago · link · parent

Maybe real life works like D&D after all, where maxing out charisma and a few lucky rolls allow you to convince anyone of anything.

comment 4y ago · link · parent

So the entire freighter journey is shown in real time, to show how “crushing” (a word used in the article) capitalism is? Because before capitalism, there were no freight ships, or what?

comment 4y ago · link · parent

I’m not sure what gives you the confidence to make absolute statements like this. It might be unlikely, but code golfers, demo sceners and the like regularly do crazy stuff with ridiculously little code.

comment 4y ago · link · parent

I don’t want to take anything away from the achievement, because this looks very useful, but the headline misled me a bit. I’m note sure whether it’s my affinity for code golf, but when I see someone bragging about about line count, I don’t expect the use of multi million line nonstandard libraries. :) For anyone wondering, most of the 284 lines are (of course, some might say) calls into Tensorflow. Still, I think this is really nice, just not what I expected from the title.

comment 4y ago · link · parent

I’m getting increasingly frustrated by the puzzle quality. Puzzle difficulty is determined algorithmically using an Elo system (where essentially puzzles play against players). That sounds great in theory. The problem is that there’s no penalty for guessing, in fact, the UI forces you to make a guess. This means the rating partly measures guessability instead of solvability. At my low-ish rating, I get a mixture of puzzles I can realistically solve, and extremely hard puzzles where the obvious dumb guess happens to also be the correct solution. I’m not sure if anybody else is annoyed by that as much as I am.

comment 4y ago · link · parent

You’re reading someone’s summary of Huxley’s synopsis. I think it’s safe to assume that the full screenplay would have given more context.

comment 4y ago · link · parent

>> ASCII: it’s okay to only support ASCII for the whitespace handling and lowercase operation

That's a somewhat specific list -- at least I didn't read that as a general "the program can assume that the input is only ASCII".

But then, the author seems to have accepted solutions that crash on non-UTF8 sequences and ones that byte-compare them, so probably either behavior was meant to be fine. I just don't get that from this rule.

comment 4y ago · link · parent

Very nice. That’s in fact really clean, and (at least to me) indeed surprising.

As rejection reasons go, “I wanted to name-drop person X” is interesting. But as you said, that’s the maintainer’s decision to make.

comment 4y ago · link · parent

For those curious about Rust optimization, the “optimized” version makes three changes compared to the “idiomatic” version:

* It uses byte strings instead of UTF-8 strings. In my opinion, that’s not an optimization, that’s changing the problem. Depending on the question you’re asking, only one of the two can be correct.

* It uses a faster hash algorithm. It’s not the first time this came up in a benchmark article. Rust’s decision to use a DOS-safe hash by default (and not provide a fast algorithm in the std, like other languages do) really seems to hurt it in that kind of microbenchmark.

* It uses get_mut+insert instead of the more convenient HashMap::entry method, because the latter would require redundantly allocating the key even in the repeat case. I’ve hit this problem in the past as well. Maybe the upcoming HashMap::raw_entry_mut will make this kind of optimization cleaner.

comment 4y ago · link · parent

That’s my favorite way to think about this as well, but it’s very geometric and maybe not so intuitive to explain in a video that targets a non-mathematical audience. That physicists aren’t aware of this interpretation might be a bit of a stretch, that’s at least not been my experience.

comment 4y ago · link · parent

The sceptic arguments I read focus on accidental decoherence during the computation. If that goes well, and classical computers only "catch up" during measurement, wouldn't this mean that the time cost of measurement has to scale super-polynomially? Is that plausible?

comment 4y ago · link · parent

So there seem to be three separate issues with the concept of "species" as used in (pop?) biology, speaking as a non-biologist CS type of person:

* The "interbreeds with" relation isn't transitive: population A may interbreed with B, B with C, but A not with C. Examples are observed in nature today, and must have existed many many times historically. This makes any attempt at building tree arrangement of species inherently logically suspect, purely from a data structure point of view.

* There are some cultural expectations around the term "species" that seem to thwart attempts at coming up with a clear definition. For example, we really seem to want to classify dogs as a species distinct from wolves, whether that logically make sense or not. This seems similar to people really wanting to classify Europe as a continent, regardless of plate tectonics or land masses or any other objective criterion. For a counter-example, the physics community at some point went "fuck historical precedent, we need a precise definition of 'planet'" and excluded Pluto.

* We also want to use the term "species" for organisms that don't sexually breed at all, necessitating different definitions for these cases.

All of this leads to Wikipedia defining the word "species" in this hilarious way: "A species is often defined as the largest group of organisms in which any two individuals of the appropriate sexes or mating types can produce fertile offspring, typically by sexual reproduction. Other ways of defining species include their karyotype, DNA sequence, morphology, behaviour or ecological niche. In addition, paleontologists use the concept of the chronospecies since fossil reproduction cannot be examined."

That's all fine, but with definitions like that, apparent contradictions shouldn't be a surprise, and formulations like "breaking the tree of life" are clear hyperbole.

PS: I'd love for actual biologists to correct any misunderstandings I might have!

comment 4y ago · link · parent

As a general principle, I think low-level APIs shouldn’t provide abstractions that are both expensive and have no clear “best” design: in those cases, you want your applications to have the ability to make different trade-offs, rather than being locked in to a design that might be suboptimal for your usecase. I think sibling comments explain nicely how that’s the case for transactions; I just wanted to point out why that matters in the big picture. Similar arguments can be made for other higher-level features that someone might wish their OS provided, like (tracing) GC.
1
232425
51