HNHacker News
TopNewBestAskShowJobs

jy14898

333 karma · joined August 23, 2020

submissionscomments
jy14898··on Run TypeScript code without worrying about configuration
example:

  type FireNuke = boolean;
  type DontFireNuke = boolean;
  function perhapsFireNuke(action: FireNuke);
you wouldn't want to call perhapsFireNuke with DontFireNuke, even though the types are compatible
jy14898··on Imagine a drive where every file exists as all file types all of the time
Now make it an HTTP API where content negotiation always succeeds
jy14898··on Hyper Typing
I think I take the attitude that you parse/validate data as soon as possible (ie when reading a file/coming from an API), so that the rest of the code can rely on typechecks alone.

That said, I come from a background where the language doesn't let you consider that the type of a value might be wrong (Haskell, for example), so perhaps I have more trust than typescript deserves.

jy14898··on Hyper Typing
> An API call, reading a file, calling less well-behaved libraries or making some system calls can all result in objects that pass compile-time checks but will cause a runtime exception or unexpected behavior.

Seems crazy to me to have this attitude, the whole point of typescript (and indeed many other languages with type checkers) is that we can leave out unecessary checks if proven by the compiler. The burden of compatibility is on the caller to ensure they supply correct values

jy14898··on Critical CSS
unsafe-hashes is a decent alternative
jy14898··on Show HN: I built a hardware processor that runs Python
Sounds similar to something one of my classmates worked on at uni https://www.bristol.ac.uk/research/groups/trustworthy-system...
jy14898··on Herb: Powerful and seamless HTML-aware ERB parsing and tooling
ERB: https://en.wikipedia.org/wiki/ERuby
jy14898··on Show HN: Fermi – A Wordle-style game for order-of-magnitude thinking
> You think the sliders ought to be a wider range?

Perhaps, or just no sliders (or something else). To illustrate, setting all the sliders to the min gets the correct order of magnitude, setting all the sliders to the middle gets the correct answer, and max is only off by 1 order.

Maybe the slider just picking the order of magnitude would make it more fun (1e-9 to 1e9 for example, 20 ish steps), not sure. Perhaps the rough range of magnitudes could be a hint provided if the user has no idea?

jy14898··on React for Two Computers
Tiktok has rotted my brain for this length of article
jy14898··on Show HN: Fermi – A Wordle-style game for order-of-magnitude thinking
Some feedback:

1. Why are factors reorderable? axb = bxa

2. Why are factors pickable? Is it coincidence that all of todays choices are useful (or did I mess it up)

3. The ranges/sliders ruin it for me IMO, they pick the order of magnitude for you

jy14898··on I-cant-believe-its-not-webusb: Hacking around lack of WebUSB support in Firefox
Another way (I think) is to emulate a USB headset and play/listen to data encoded in audio
jy14898··on WASM Wayland Web (WWW)
I was thinking the same until they mentioned "WASI components" for using HTML. I'd still prefer HTML first though
jy14898··on Cross Views
It's interesting how the difference appears, a strange artifact. Very fun to feel like a pro clicking through the differences quickly
jy14898··on Hyperspace
If it saved 8.1GB, by your measure it'd also not be a big win?
jy14898··on Python 3.14 Getting New Interpreter
> This is not to be confused with tail call optimization of Python functions, which is currently not implemented in CPython.

> This new interpreter type is an internal implementation detail of the CPython interpreter. It doesn’t change the visible behavior of Python programs at all. It can improve their performance, but doesn’t change anything else.

jy14898··on Chrome 133 Supports DOM State-Preserving Move with moveBefore()
https://reparent.jarhar.com/. Perhaps a good example is popping out a form when the user wants to navigate elsewhere to answer the questions.
jy14898··on Chrome 133 Supports DOM State-Preserving Move with moveBefore()
> I could imagine doing a bunch of weird stuff where you don't know exactly what box you're typing in to.

What stops malicious JavaScript that would have used moveBefore() to just add key event listeners?

jy14898··on Show HN: TinyJs React like framework in 35 lines of code
Maybe I'm missing something, but there isn't any global state attached to window? They attach a constructor for state to the window, but that isn't the state itself - it just returns a smart state object.
jy14898··on Every HTML Element
They're talking about the post itself and its structure
jy14898··on My Struggle with Doom Scrolling
Does everyone really mean doom scrolling when they talk about these issues? For me personally, it's definitely about dopamine and not about negative emotions, yet everyone uses the phrase doom scrolling - am I the odd one out?

For example, if I'm feeling stressed/anxious, I'll scroll/browse/distract myself to avoid the negative feelings. I'm not seeking them like doom scrolling says.

jy14898··on Fidget
You might be interested in http://omrelli.ug/g9/gallery/ too
jy14898··on All clocks are 30 seconds late
By this logic, a broken 24 hour clock stuck at mid day has 0 error.
jy14898··on Vercel/fun: ƒun – Local serverless function λ development runtime
A function doesn't need to be impure to communicate with a db. It can describe the actions without executing them, returning the actions to let some other impure process execute the effects.
jy14898··on Show HN: We open-sourced our compost monitoring tech
To monitor the compost
jy14898··on Ping Rate Clock
You need to add a second clock in your cameras background which quickly spins so that when your video freezes for others, they can see you've disconnected and you're not stoically ignoring them
jy14898··on URAvatar: Universal Relightable Gaussian Codec Avatars
Interesting that under the "URAvatar from Phone Scan" section, the first example shows a lady with blush/flush, which only appears in the center video when viewed straight on - the other angles remove this
jy14898··on Show HN: I built an app to use a QR code as my doorbell
> QR codes can contain a limited set of data. There's no possibility of a buffer-overflow or malicious program.

Source?

jy14898··on Show HN: Which animal shares your body fat percentage?
Now they know I'm 100% body fat
jy14898··on OOP is not that bad
> However, unlike our OOP example, existing code that uses the Logger type and log function cannot work with this new type. There needs to be some refactoring, and how the user code will need to be refactored depends on how we want to expose this new type to the users.

This is odd to me. There are solutions to make data types extensible in haskell, but for example in purescript you'd just use a record. But more importantly, why would you want existing functions to use the new type? Why not just pass the _logger from FileLogger in? The existing functions can't use the _flush ability anyway (in both OOP and FP cases)

jy14898··on Adding row polymorphism to Damas-Hindley-Milner
The tools typescript provides are a little pointless if it allows you to do stuff like this (imo):

const r1: { a: number; b: number } = { a: 10, b: 20 };

const r2: { a: number } = r1;

const r3: { a: number; b: string } = { b: "hello", ...r2 };

console.log(r3.b) // typescript thinks it's a string, but actually it's a number

← PreviousPage 2 of 3Next →