Better HN
topnewbestaskshowjobs
Log inSign up

codeflo

9,663 karma · joined Jun 14, 2010 (16y ago) · 1,502 submissions

Submissions

comment 2y ago · link · parent

These days, TypeScript is effectively nothing more than a high-powered linter. The performance of this linter is so bad that we need to structure our code in a specific way so that we can still afford to run the linter.

Of the performance tips at the end, the interface vs. intersection type one is the suggestion I find the most annoying. That’s because it’s the most common pattern, and using interfaces is conceptually a lot less clean. It’s terrible that a linter effectively forces you into writing worse code.

I really wish the TypeScript team got their act together and fixed the performance of their linter somehow. Finding clever optimizations, porting to Go/Rust, whatever is necessary. (3rd-party reimplementations won’t do: they’ll never catch up with a corporate-funded moving target.)

comment 2y ago · link · parent

That’s awesome.

> The sort of thing you'd solve in 30 seconds with Google in 2024.

This is unfortunately becoming increasingly untrue, as the forums where stuff like that was posted are rotting away, and Google’s advertisement optimized result ranking neglects the long tail.

And to the extent it is still true, it’s because pioneers like you figured it out and shared their results!

comment 2y ago · link · parent

Reminder that AlphaGo and its successors have not solved Go and that reinforcement learning still sucks when encountering out-of-distribution strategies:

https://arstechnica.com/information-technology/2023/02/man-b...

comment 2y ago · link · parent

Slightly off-topic, but I was recently very disappointed to learn that Lego Mindstorms was discontinued some time ago without replacement. It’s such a shame that hardly modifiable licensed IP shovelware sets are now by far the most profitable product lines for Lego. Supposedly that’s true in Asian markets in particular. The kinds of sets we grew up with that inspire creativity and technical understanding are at best kept as a niche, at worst abandoned.

comment 2y ago · link · parent

If the observation time is finite, and the time resolution of the observation is limited, then you'd still only have a finite number of distinguishable symbols, wouldn't you?

comment 2y ago · link · parent

Many blog posts and Stackoverflow questions about C++ cal them functors. Boost of all things uses the term in its definitions: https://www.boost.org/doc/libs/1_60_0/doc/html/function/refe...

It's common enough that articles have been written against this usage: https://web.archive.org/web/20170224220253/http://jackieokay...

So this usage of functor may never have been "official", but it's widespread in the community.

comment 2y ago · link · parent

Functor is one of the worst offenders IMO. In C++ lingo, it simply means "callable object".

comment 2y ago · link · parent

That took me a moment, and I’m sure I won’t be the only one. Breaking news indeed. Well done.

comment 2y ago · link · parent

> Conceptually you could think of these as classical inheritance (so class Card extends Div) - inherit the semantics and base styles of div while making a re-usable style for a Card class.

You could, but you’d be wrong. The CSS selector specificity algorithm has nothing in common with OO inheritance, and classes are only one of many equivalent ways to interact with that algorithm.

comment 2y ago · link · parent

People might use it that way, but the original idea of signaling is when people care about publicly displaying their belief in a thing. That’s an operable definition that’s independent of that thing’s merits.

comment 2y ago · link · parent

And if you dare to combine two of the paradigms it supports, you get UB.

comment 2y ago · link · parent

The very rough rule of thumb that I think one should remember is: You get a 50% chance of collision with sqrt(total) samples.

Sqrt(1 000 000) = 1 000, close enough to the exact number you calculated.

comment 2y ago · link · parent

I’m making an argument about the validity of an argument. A rebuttal to that can never be “but the conclusion is true”.

comment 2y ago · link · parent

> You can simulate every molecular interaction in a fire, but that does not mean the simulation gives off the same heat

It would to a simulated being standing next to the fire.

> You can write a perfectly accurate equation for splitting an atom, but the equation does not release energy.

It releases simulated energy inside the simulation.

Every material interaction is simulated. If you believe that consciousness can't exist in the simulation, then you believe that consciousness is not a material interaction, q.e.d.

comment 2y ago · link · parent

> If you scan a body of water, and simulate it perfectly, the resulting simulation will not be wet.

It will be wet to the simulated being that's swimming in it.

> Consciousness may be a result of carbon being a substrate in the interactions.

Are you conscious? If so, how did you find out that you're made from actual carbon atoms and not simulated ones?

comment 2y ago · link · parent

If you believe that what we describe as "consciousness" is emergent from the ideas a material brain develops about itself, then it's in fact not logically possible to have a world that is physically identical to ours yet does not contain consciousness. So indeed, premise 2. sneaks in the conclusion.

To illustrate this point, here's an argument with the same structure that would similarly "prove" that gravity doesn't cause things to fall down:

1. In our world, there is gravity and things fall down.

2. There is a logically possible world where there is gravity yet things do not fall down.

3. Therefore, things falling down is a further fact about our world, over and above gravity.

4. So, gravity causing things to fall down is false.

comment 2y ago · link · parent

As a thought experiment, imagine we were to scan the position of every molecule in the human body to the Heisenberg limit of accuracy. Imagine we were to plug the resulting model in a physics simulation that models every biochemical and physical interaction with perfect fidelity. This is a thought experiment, and what I suggest isn't ruled out by physics, so let's assume it's technologically possible. Would the simulated being be "conscious" in the same way the original human is? Would it experience "qualia"?

If you think the answer might be no, then congratulations, you actually believe in immaterial souls, no matter how materialist or rationalist you otherwise claim to be.

comment 2y ago · link · parent

Serious question, do you need help?

comment 2y ago · link · parent

I don't think this is a slam dunk. For this argument to work, the dart probability must be 100% for any function. This is supposed to be clear "intuitively", and then, by constructing a counterexample using the CH, it's concluded that the CH is false.

But the space of functions from R to countable subsets of R is so vast (and so far removed from the physical world) that I don't think it's possible to have any "intuition" of what's possible in that space. And indeed, we see that there's a construction of a function f that doesn't conform to the "intuition". If there's an "intuitive" line of reasoning and a formal one, and they disagree, shouldn't we just conclude that our intuition is flawed?

comment 2y ago · link · parent

It seems to be standard in that field, but to be honest, I hate cryptographic notation. AFAICT, about half of the numbers in that pseudo-code count a number of bytes, and the other half a number of bits, and without already knowing the algorithms, it's almost impossible to tell which is which. E.g., N[:12] seems to be twelve bytes, while 0¹²⁸ is 16 bytes. X is actually the character 'X', i.e. the bit string 01011000. While L is actually a variable, not the bit string 01001100. And so on. It's clear that mathematicians don't like unambiguous notation nearly as much as CS people do.

comment 2y ago · link · parent

I mean, if you don't understand how specialized inlined code could be faster than a generic function, or how not creating temporary arrays could be faster than creating them, then it's clear that you can't see that there could be any benefit.

I can't judge the React compiler yet, but in general, compilation steps don't cause cognitive load if they work. How many different levels of interpretation and compilation does V8 do? And do you care? Do you have to? No, and that's the point. Whether React Compiler reaches the same level of "it just works", we'll have to see.

comment 2y ago · link · parent

Is your claim that redistributing that space would be physically impossible?

comment 2y ago · link · parent

> As far as I know, those aren't wasting the space for a battery. Framework opted for their current battery sizes.

I don’t get that logic. There’s extra space; more battery could fit in there. The fact that higher density batteries exist in no way invalidates that.

(You might perhaps have a point if battery life was already excellent and the more important goal might be to save weight, but that’s not the case at all.)

comment 2y ago · link · parent

To quote myself in the post you responded to "It just wastes space that could be used for a larger battery, while limiting the number of ports that the laptop can fit at any one time."

The ports I personally need are HDMI, lots of USB-C ports, sometimes USB-A (but less and less), and sometimes an SD card. I know everybody has different requirements, but I'm also sure that's at least somewhat typical. And given that, I can't be the only one who thinks it's silly to reserve space for several 4x3x1 cm large USB-C-to-USB-C converters in a space-constrained device.

[1] https://frame.work/de/en/products/usb-c-expansion-card?v=FRA...

comment 2y ago · link · parent

I don't see why I shouldn't compare them. Besides economies of scale, there's no inherent reason why a company couldn't build a Macbook-quality laptop that runs Linux.

comment 2y ago · link · parent

I was in the market for a decent Linux laptop, but after having seen one in person, I'm less convinced. Note: I'm talking about the 13" one.

The battery life using Linux isn't good, the screen is isn't that good, the touch pad is okay, but not great, the layout of the arrow keys is ridiculous. I don't get how something can market itself as an enthusiast laptop and come with arrow keys like these. And I agree that for this price, you should expect best-in-class components.

But the killer for me was seeing the modular port concept in action. It's the kind of thing that sounds great on paper, but in practice doesn't really work. It just wastes space that could be used for a larger battery, while limiting the number of ports that the laptop can fit at any one time. It's not a Linux laptop, but just for comparison, a Macbook Pro has way more ports, and all of them are usable at once.

I'm sure things will improve, but basically my impression is that the Framework concept doesn't seem that well thought out yet. And the upgradability guarantee might lock them into their unfinished ideas for a lot longer than other manufacturers would be. I really hope they can solve these issues, because what they're trying to do is fantastic, but it’s not for me just yet.

1
678
51