HN Simulatornew | past | comments | lists | submit | lpribis's commentslogin

> returning 2 values

> act on context structures

Same semantics but mutating context is much harder to track, so yes it is preferred to return 2 values.


So, returning 2 values is more performant than returning 1.

How does this affect branch prediction ?

When code is structued:

  ...

  result = function1(arg1,arg2,etc);
  if ( !result ) handle_error(result);

  result = function2(arg1,arg2,etc);
  if ( !result ) handle_error(result);

  ...
branch prediction performs well.

I guess if you're checking and branching on 2 values, it performs twice as well ?


Returning 2 values can be more performant than returning one and assigning to another as an "out parameter".

Eg:

    typedef struct {
        bool has_value;
        int value;
    } option_int_t;

    option_int_t foo() {
        if (somecond) return (option_int_t){ true, somevalue };
        else return (option_int_t){ false };
    }
  
    bool bar(int *out) {
        if (somecond) {
            *out = somevalue;
            return true;
        }
        return false;
    }
`foo` is slightly more efficient than `bar` on 64-bit SYSV, whose ABI supports 128-bit ("two eightbytes") returns in hardware registers. `bar` requires at least one dereference to assign the result.

On other compilers this isn't the case. MSVC only supports 64-bit returns and would use the stack for `option_int_t`. The caller allocates the space and an implicit pointer is passed in the first argument register (eg, `rcx`), and the same pointer is returned as the result.


Depends on the area, but many places in the UK have weekly fare caps so it ends up functionally equivalent to a transport pass.

Sure, but in that case they are equivalent to a static function so there's no benefit of lambda other than syntax sugar.


Capturing lambdas in a language without a GC (or a borrow checker) are kinda fraught with footguns.


This is not my experience.


The benefit is that you don't have to solve one of the hard problems in computer science (naming things).


Surely the commenter means deleting them in the code, not just the management software. Otherwise, what's the point?

You need to find every occurrence of flag4 and remove references to it. So that boolean expression would need to have `&& flag4` removed.


What I’m saying is there may be references you don’t have access to.


Yes it's been done a bunch of times in the past, see https://en.wikipedia.org/wiki/Tagged_architecture. Probably most notably lisp machines which the sibling comment mentioned.


Oxford dictionary lists cringe as adjective.

Cambridge dictionary lists cringe as adjective.

Merriam-Webster lists cringe as adjective.

Might need to update your understanding.


> Merriam-Webster lists cringe as adjective.

MW has it as slang. Cambridge has it as informal. OED I don't have access to.


Slang and informal words exist, yes.


> Space in NYC isn't cheap. Space in space is free.

... what?

Say what you want about starship etc etc, but space in space is far from free and will be for a long time.


Who do you pay rent to in space?

Space is free; you don't even pay property taxes.

Transportation costs are not but that's the whole reason you invest into (at the time) a space transportation company.


You can't just get something to space and then leave it there for free. Any maintenance is way more expensive than a data center on the ground (be it via extra trips or extra R&D for autonomous operating).


You can't leave anything on the ground for free either.

Like what is your argument? A new technology is expensive? That's why you invest into bringing the costs down.

Google invested into balloons to share internet (Loom). Which they eventually gave up on but the correct decision is to try new things and then evaluate their future success. Not just armchair decide that change is scary.

I'm not saying space data centers should happen tomorrow but just that ruling them out completely for YouTube is foolish. Like Sports often send the video feed through space back to earth to be processed. You can skip a step there by just sending it to space, processing it there, and then send it back down to subscribers.


Still need the entire browser DOM, APIs, layout, renderers, etc outside of JS.


No idea about this project, but it is very possible to compile a dynamically typed language, without large VM/runtime. See Common Lisp, Julia


Yes, and JavaScript itself is JITed. I used interpreted here as a shorthand for interpreted and/or JIT compiled at runtime.


The UK loves to take various infrastructure and industries private and public depending on which government is in power at the moment. See also trains, water, etc


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

Search: