HN user

greysphere

407 karma
Posts0
Comments131
View on HN
No posts found.

It's pretty hard for someone to make something worth a billion dollars then sell it, because someone else could make the same thing and undercut you. We even have a word for the way around this: 'moat.' In the 2000s 'network effects' were the most common moat, and they seemed a little crappy but not outrightly evil. Now the most common scheme seems to be breaking law until your big enough for the rules to not apply. That's why people see it as cheating.

Thanks, yes I think we had some confusion on the foo() vs parse() and I was referring to foo().

But even for the parse() example, the issue is the aliasing rules (and not the alignment - though that could still be an issue depending on input!) Aliasing isn't even mentioned in the article. Instead the example presents this thing 'people do all the time' and identifies it 'UB' without even identifying the actual issue.

On its own I could forgive the former, making a precise example is tricky (particularly with alignment issues). But this is repeated: milliseconds() is characterized 'UB' because it's inputs could be outside the representable range. Again the function is not UB, the inputs can potentially trigger UB.

Then the function pointer example obfuscates the assignment (fine) with the call (ub). Despite the red herring statement 'NULL compares unequal to any object or function' as the example assigns a function _pointer_ which can be NULL. The honest example of the statement is:

    void foo() = NULL;
which won't even compile because it violates the thing that was just said (among other reasons). The UB is the call below and has nothing to do with equality with NULL.

The repeated pattern of say one thing, show an example that's 'reasonable' and implies that it's related to what was just said, and from that invalid relation conclude that everything is UB in C feels dishonest (particularly when it's so easy to talk about UB in C honestly because there is so much to be legitimately concerned about!)

I appreciate your and your advocacy about UB in C, and I think I agree with most of your points about it and they worth discussing. That's why the article itself is frustrating to me, we don't need to be tricksy when talking about UB, it's already tricky enough!

Maybe I'm misunderstanding. Here is what I'm trying to say.

"Accessing an object which is not correctly aligned" - this is UB

"As an example of this, take this code: ..." - this (code) is not UB.

Is this incorrect somehow?

You could interpret the second sentence as 'under the assumption of an unaligned pointer, let's look at what this seemingly innocuous (and correct) code does.'

But that's not what they did. They presented that code as if it's incorrect (following the whole premise of the article 'Everything in c is UB'). That's what the whole article does, they take a topic with real concerns, then present 'normal' code, and then imply the code is the issue (and therefore the language), not the premise.

You know what would be better, show an example that clearly shows the complete path for the premise to the issue. Ie show some code that generates an unaligned pointer and then uses it. Why did the author not do that? Surprise, because it's actually pretty hard to write code that's 'guaranteed' unaligned behavior.

    int foo[10];
    int *bar = (int *)(((int)&foo) + 1);
Is this unaligned access? You don't know because you don't know the size of int. (Not to mention it looks ridiculous. By only showing 'reasonable' code as the example, the article suppresses the common 'uh just don't do that' criticism.)

And in fact the ambiguity of alignments and sizes is the whole point - they are given the privilege/footgun of being undefined in c so that compilers are easier to write. It's very debatable if this was/is a good idea, but that's where the debate should be, not illusorily ascribed to derefing pointers.

If I'm misunderstanding, please let me know. Specifically, if you're claiming (1) either the literal code in the first box of the article is UB, or (2) please write some literal code that is UB in the vein of the first claim of the article. I think that would help me bridge the gap that we seem to be having.

The first example is dereferencing an integer pointer. That is a valid operation. Now if that pointer isn't valid (and being unaligned is one of many reasons it could be invalid) then calling the function with that invalid pointer will be UB.

An honest discussion would be something more like 'dereferencing pointers can lead to UB on invalid pointers. Here are N examples of that. Maybe avoid using pointers. Maybe consider how other languages avoid pointers. Maybe these shouldn't be UB and instead some other class of error.' And then even more honest discussion would present the upsides of having pointers and the upsides of having these errors be UB.

Instead, the article (and your comment) take this valid operation and presents it as invalid. Imagine you're a new programmer, you are just starting to wrap your head around pointers and you stumble across this article. You see the first example and it looks exactly what you would expect a dereference to look like. But the article claims it's wrong, and now you're confused. So you dig into the article more closely and are exposed to all these terms like UB, alignment, type coercion etc and come away more confused and scared and disinclined to understand pointers. This is classic FUD. This is a technique to manipulate, not educate.

Pointers have pros and cons. UB has pros and cons. Let's try to educate people about them.

The examples aren't really undefined behavior. They are examples that could become UB based on input/circumstances. Which if you are going to be that generous, every function call is UB because it could exceed stack space. Which is basically true in any language (up to the equivalent def of UB in that language). I feel like c has enough actual rough edges that deserve attention that sensationalism like this muddies folks attention (particularly novices) and can end up doing more harm than good.

1) Because the people who contributed to the development of those other processes received fair market value for their work (for the most part). The vast majority of contributors to the process that made this logo have not been compensated for their work. This differential can lead to an ethical judgement about the process, which can transitively be applied to the logo made with the process, and the restaurant as a whole.

2) Some automated processes lower the quality of outcomes. Microwaving food might be a faster/cheaper way to cook, but customers might criticize the results.

3) Some processes can be viewed as having lower value compared to others, independent of result quality. This is particularly common in the art and service industries, for which the logo of a restaurant is very much at the intersection.

With the old way of doing things you could spend energy to reduce errors, and balance that against the entropy of you environment/new features/whatever at a rate appropriate for your problem.

It's not obvious if that's the case with llm based development. Of course you could 'use llms until things get crazy then stop' but that doesn't seem part of the zeitgeist.

Another interesting thing about the steam engine is much of science in the 1800s was dedicated to figuring out how steam engines actually worked to improve their efficiency. That may be similar for AI, or it may not!

We made an AlphaGo like implementation for the card game Dominion. Certainly not the same number of cards but similar complexity. I have high confidence the same techniques would work for mtg. In fact possibly better as mtg doesn't lend to large search depths. Though possibly worse as there is more hidden information (though that depends on if the format has open deck lists and/or how much of the meta is provided to or trained by the nn)

  (1712) Newcomen Engine
  (1776) Watt Engine
  (1807) Atomic theory of Gasses (Dalton)
  (1807) Concept of Energy (Young)
  (1824) Carnot Cycle
  (1834) Ideal Gas Law (Clayperon)
  (1845) Relationship between work and heat (Joule)
  (1840-60s) Laws of Thermodynamics (Carnot, Clausius, Kelvin)
For over a century, there were a group of people working on building, maintaining, repairing, refining and improving engines, called 'engineers', who had a very incomplete picture of the physical laws surrounding them. I would assume there were many explosions and other accidents along the way (as there continue to be).

The investment in the science of thermodynamics and the chemistry of fuels was largely motivated by the value of the steam engine, and the attempts to improve efficiencies allowing miniaturization, enabling locomotives and the railroad boom, and eventually automobiles and powered flight.

I think the era from say 1950..2020 has been a relatively unique period in history where science has been ahead of praxis (though folks in medicine or other fields might not have had that luxury). Recent advancements in AI preceding strong theoretical foundations might be a reversion to the mean.

And in fact, the first engines were developed without a robust understanding of the physics behind them. So, the original version of 'engineering' is more closely to the current practices surrounding AI than the modern reinterpretation the root comment demands.

I don't understand how inflation and risk wouldn't/aren't priced in. You have $1000. You can: put it in your mattress, put it in 'safe' treasury bonds at inflation +a few percent, or yolo it in NVIDIA. Yes if bonds are returning less than inflation you don't buy them and that makes financing more expensive but it's not somehow unfair vs the other things you could do with capital.

Seems like return is roughly proportional to risk(1-tax)investment so changing tax should affect everything proportionally (barring cheating/avoiding the system in some way).

The similarity between divine right of kings and inheritance is that an unearned is transferred via circumstances of birth.

Your statements seem to extend that further: If you rent an apartment, you the property is owned by an landlord (lord is literally in the title!) and passed down by their wishes. Similarly if you work for Walmart for life, the company is owned and passed down by the Waltons. In these cases the property rights extend beyond life and are transferred via circumstances of birth, while the rights of labor end.

Interesting that IP rights are ended by death (or death+n years) as well. This line of reasoning suggests maybe that should apply to all property.

There's no inherent right to anything, really. The statements in whatever declaration or philosophy are just arbitrary lines. Physical property rights are just as arbitrary as the divine right if kings (and incredibly closely related when that property is inherited!)

The argument really isn't based on rights, it's based on the rules of the game have been that people that make things get to decide what folks get to do with those things via licensing agreements, except for a very small set of carve outs that everyone knew about when they made the thing. The argument is consent. The counter argument is one/all of ai training falls under one of those carve outs, and/or it's undefined so it should default to whatever anyone wants, and/or we should pass laws that change the rules. Most of these are just as logical as if someone invented resurrection tomorrow, then murder would no longer be a crime.

For all the phone developers out there:

5. Fixing a bug means you have to go through a re review of your marketing assets that haven't changed in 3+ years and there's a non zero chance each time your review could result in _your app being removed from the storefront_ and losing _days_ of revenue after you appease whatever whimsical issue wasn't an issue the hundreds of times you've submitted previously and wait for the next review slot.

In a classical view of 2 particles accelerating towards each other v x r will always be 0 so B will always be 0 even if the particles are accelerating towards each other. I believe all this holds under QFT [1].

Looking further a redefinition E is necessary when including the \beta factor [2]. So that was a mistake on my part - relativity does change the rhs of Coulomb's law.

Admittedly the problem as stated (two particles falling towards each other) constrains things in such a way that there is no off-axis contribution. Or to put it another way, 1d electromagnetism doesn't have magnetism.

[1] https://physics.stackexchange.com/questions/142159/deriving-...

[2] https://en.wikipedia.org/wiki/Coulomb%27s_law#In_relativity

You can't just plug numbers into Coulomb's Law for this case, because Coulomb's Law by itself is not relativistically correct.

Sorry if this is a bit pedantic, but as someone trying to study this at the moment, I don't see this the same way and I'd like to validate my interpretation: You can just plug numbers into Coulomb's law, that part is correct. But then the problem of infinite velocities comes from interpreting the 'F' side of the equation, assuming Newton's law (F=ma), rather than using its relativistic counterpart.

Coulomb's law: F = qq'/r^2

Lorentz force law: F = q(E + mu x B)

For the 2 particle case, both of these say the same thing (substitute into the Lorentz eq E = q'/r^2, B = 0 and you get the same thing).

The promotion from non-relativistic to relativistic mechanics is a change of what 'F' means.

nonrelativistically: F = p' = m v' = m x'' = m a

relativistically: F = p' = \gamma m v' = \gamma m x'' = \gamma m a

where \gamma is the Lorentz factor.

Interpreted this way, infinite velocities are avoided.

But, as r->0 we still have an infinity problem - namely infinite energy! This necessitates a quantum mechanical correction to both the Coloumb and Lorentz laws.

TLDR: relativity is necessary when things start to move 'very fast', qm is necessary when things are 'very small'

Appreciate your engagement.

I think it very much depends on your situation. I personally look to her as a role model who's demonstrated the value of strikes and collective action in influencing climate legislation.

Others might take inspiration in her criticisms of air transportation (something that seems to be growing in popularity these days) but I'm not able to give up seeing my aging parents across the country a few more times so that point hasn't reached me quite yet.

Her wikipedia page is worth 5 minutes if you can spare them and maybe go from there.

Her credentials are her ability to rally support/interest in climate issues. What credentials would satisfy you? Folks with PhDs and political accolades have been speaking the same points for years, and clearly they haven't bread success.

Frankly a question to ask is why you feel a person like her isn't encouraged to speak out on these issues, and isn't worth listening to? Is she saying things that aren't true? If so it seems like the thing to do would be to speak to those misstatements.

Much more likely though, systemic sexism and ageism make it difficult for folks to accept young women in leadership roles, particularly when their message asks for change from the status quo.

So the reasons you should care about what this person is saying are 1) she is speaking truths about climate change 2) the truths are about existential threats to humanity and she is able to communicate the seriousness of those threats 3) she is able to rally groups of like minded people with a common vision of those threats and their seriousness 4) paying attention to her and uplifting her leadership role helps erode systemic sexism and ageism.

Yeah, if you could input data set X with quality Q(X) and output data set Y of the same size with Q(Y) > Q(X), you'd really be on to something. But I don't think such a system exists yet, or even close. Inputting the internet, outputting a sea of garbage with a handful of diamonds that people have to spelunk through the garbage for seems the best so far. Madlibs is a pretty equivalent activity, and while fun, certainly not anything one would consider AGI. We need a revolutionary improvement on automated spelunking to get anywhere. Maybe we'll get a good spam filter as a side effect!

But even if you had a system, there's still the resource cost to run the algorithm (needs to be bounded or else you've just made a finite jump) and the gains you make need to not decay (or again you've just made a finite jump).

And all this needs to be compared against investing in humans - which seem pretty clearly to have AGI properties (but with some really bad constant factors. 20 year training time - ridiculous!)

To me it seems things are a long way off and least a couple of major innovations away. But at least there's some ideas of the problems to tackle, which is a big step up!

A chaotic grid would be macroscopically observable because random + random != 2 random, it's equal to 'bell curve'. Everything would be smeared as a function of distance, which we don't see.

This characteristic is observable for metals as well. Steel becomes less flexible as it's worked because it's grains become smaller and more chaotic - A microscopic property with a macroscopic effect.

Imagine there was a grid for space. For simplicity consider a regular grid of size 1unit in one direction and 1unit in a perpendicular direction. If such a grid existed, using one unit of ?something? would move you 1 unit along the axes of the grid, but you'd need 2 units of ?something? to move root2 units 45deg to the grid. Any discrete grid of any shape or size or pattern would have something like this, some sort of preferred alignment, but as far as we can tell there no such preference. Physics in free space is rotationally invariant and thus not on a grid thus continuous.

Sane C++ Libraries 2 years ago

Last I checked bubble sort was the fastest sort for small counts of small objects. That was 10 years ago though so thing might have changed potentially something that might take better advantage of vector ops.

It's also often the correct choice for something like a collision partition for a physics sim where elements are most likely in the same sort position each frame.

If they're super motivated by the 3dness, Id suggest try Spore with the Galactic Adventures. Spore is a great 3d editing program for someone to get introduced to and Galactic Adventures let's you put all the stuff you create together in a world, with basic scripting and ai, all in a very player friendly way. (Disclaimer, I worked on these)