Hacker Newsnew | past | comments | ask | show | jobs | submit | njharman's commentslogin

Clout. Monetization.


Journalists report, they don't analyze.

The error is consumers believing journalist news is anything but uninformed, hot take heresy; spun in the most sensationalistic way.

They are hired to get eyeballs for advertisers. Not to be accurate, thorough truthful, or unbiased.


Seems perfectly tailored to the product being sold and the customers paying for it

Product being search users. Customers being advertisers.


Putting tldr; at the bottom defeats purpose of tldr.

Guessing this is BPF https://en.wikipedia.org/wiki/Berkeley_Packet_Filter But, reader shouldn't have to guess. That is the link that should be in your Introduction. Just after tldr;


Not the original BPF, but its successor in the Linux kernel called eBPF [1]. eBPF's virtual machine has additional registers, and crucially, eBPF programs can make some syscalls, which BPF programs can't.

[1]: https://lwn.net/Articles/740157/


18 years? Filthy casual, jk ;)

I can't remember how long, but I started when you had to make a stack of 3.5 floppies to install... More than 30years ago.

Long before that, I was using 4DOS to create best "shell" possible on Microsoft. ~14 yr old.


I've never understood peoples confusion about function defaults.

They are part of function definition, they aren't in the function body. You should expect them to be "executed" when the function is defined.


Or they could have been part of the function call, and run when the function is called without that argument.


You want Python to be how much slower now?


This isn't about what I want, just noting that the other way around could sound just as intuitive. Anyway, it's awfully slow already, how much can it hurt ;-)


This is a terrible excuse. Quickly doing the wrong thing isn't optimization.


The language spec isn't wrong, you just don't like it.


The language spec isn't right you just like it.

Sure, there are a lot of subjective aesthetics that go into the spec, but in this case, there are objective reasons for not liking this. It's a well-known footgun that causes bugs. And it's almost never what you want, so you end up doing something like this:

    def f(xs = None):
        # Are these two lines actually faster than the
        # interpreter creating defaults at call time?
        if xs is None:
            xs = []

        ...
Do you have any reasons at all for defending this decision?


>

   # Are these two lines actually faster than the
   # interpreter creating defaults at call time?
You're proposing that the interpreter add a check for every default parameter in every function signature; that it should optionally fire off arbitrary code for each and every one. And when you consider that high-performance Python involves writing C extensions, your proposal would be to move that check out of the compiled code and into the slow interpreted space is, yes, a major performance hit.


> You're proposing that the interpreter add a check for every default parameter in every function signature

No, that's not what I'm proposing. Why would it check anything? Just evaluate the given default expression at call time. If you don't want the overhead of an expression, don't put a default.

You can also do defaults like:

    LIST_OF_X = []

    def foo(xs = LIST_OF_X):
        ...
...if you want the other behavior. This does add a variable lookup (oh no!).


Your list there is mutable. Isn't that what you meant to solve with this?


Ugh. You're just ignoring my entire post except the one part where you (wrongly) think you can correct me?

The code I posted is showing how you can explicitly get the mutable behavior if you want it when the default expressions are evaluated at call time.

That is to say, if you evaluate default expressions at call time, you can get either behavior by being explicit with minimal loss in performance:

    def foo(xs = []):
        xs.append(1)
        print(xs) # always prints [1]

    DEFAULT = []
    def bar(xs = DEFAULT):
        xs.append(1)
        print(xs) # prints [1], [1,1], [1,1,1], etc.
To reiterate, the above code is what would happen if default expressions were evaluated at function call time.

You're clearly not as knowledgeable as you think you are on this and you're just cherry picking things you don't understand to feel smart.


> It's managed!

Your cellular isn't? Maybe switch providers, T-Mobile doesn't make me go maintain cell towers.


100%


> off way back machine.

+1 for practical paranoia!


wayback machine? why not the regular official website? sorry, I don't understand.


Sure, anyone can do anything. It would be up to you (and hopefully a lawyer) to then sue them and let judge/jury decide. Or, convince authorities that some criminal law was violated and they should investigate.

Both of which are hard and/or expensive. So most rely on public shame. Out them on social media and foment outrage.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: