HN user

wtfrmyinitials

188 karma
Posts2
Comments65
View on HN

I first started tracking time many years ago explicitly with the goal of more intentionality and focus on a single task. If I recall correctly the tip came from CGP Grey (of old-YouTube fame) on one of the podcasts he was doing at the time.

It also doubles as a (very silly) rice cooker! Add a program to bring the pan to 230 F on slow intensity followed by a 2 minute timer. This will slowly simmer the water then stop cooking right after the water is all evaporated, which is exactly the process of dedicated rice cookers.

    > import foo from 'foo';
    > await foo.bar();
You only have to `await foo.bar()` if foo.bar was an async function already, the module system is irrelevant. You would still need to await it even if it was `require()`'d in.
    import baz from 'baz';
    baz.foo();
Works just fine, no `await` necessary.
      > await Promise.all([
      >   import('other'),
      >   import('stuff'),
      > ]);
Of course these have to be awaited, at this point you're explicitly trying to load new code while the program is running. It's no different than any other kind of async IO.
    > import yet from 'more-stuff';
I assume this is included to imply that loading `yet` is blocked by the `await Promise.all` above it to show that import statements can run after module resolution. If this was your intent you are mistaken, that import statement is still resolved before execution begins.
    // main.js
    console.log('a')
    await new Promise(res => setTimeout(res, 1000))
    console.log('b')
    import { foo } from "./foo.js";
    // foo.js
    export function foo() {
    }
    console.log('c')
Results in
    c
    a
    [one second pause]
    b
> Yes, an import statement is [semantically] blocking. But even so it’s important to know that it’s performing async I/O.

No, it really isn't. From the POV of the application code it's irrelevant. This is trivially proven by the existence of module bundlers which convert non-dynamic `import` statements into one big file that doesn't do anything asynchronous to initialize.

(edit: fighting with formatting)

This is inaccurate, or at least misleading. Your code doesn’t begin executing until all of the modules are loaded so it doesn’t “make the call stack async” just because of the import system. Module loading that’s async from the point of view of user code is also supported, but it’s use is rare.

I was trying to write a program using midi last year and was surprised by the lack of any libraries to work with it. Then I looked up the spec and was able to get all the functionality I needed with 10 lines of code interacting with /dev/midi. Incredible how powerful such a simple interface is.

Valve Steam Deck 5 years ago

Since it runs Linux I don’t see any reason you couldn’t put your entire library on an NFS server in the other room. If I get one I’ll certainly be doing that

Clubhouse Payments 5 years ago

It may in part be because if they kept a percentage Apple would require these payments go through their in-app purchase system, subjecting ClubHouse to the 30% app store fee.

If I recall correctly, Moxie Marlinspike did a great talk about this idea years ago. How things like having a cell phone are theoretically “optional” yet to be normally integrated into today’s society entirely requires it. This is especially true in these covid-times.

I thought this was a pretty decent article until the very end when the author asserts:

...nobody could be bothered to develop a nationwide program to test people for infection and trace their contacts if they were positive, or to adequately support a pause of economic activity...

As for nationwide program to test people, of course nothing was built yet; it's a novel virus and therefore novel tests are needed. If a government had built out contact tracing pre-covid, they would be (rightly) criticized for taking steps in an authoritarian direction. Apple and Google have stepped in and built contact tracing, so to say this hasn't been developed is also factually inaccurate. Finally the comment about the ability to "adequately support a pause of economic activity" is kind of silly. To pause economic activity is to pause everyone's lives. What does it mean to adequately support people when they're no longer allowed to do the things they enjoy?

It was a breath of fresh air to read an article that admitted that this is a difficult trade off, not some kind of easy decision that's being ruined by the other guy. It was disappointing that it was concluded with a similar tone.