onsclom

Joined 5 years ago

Karma
214
Submissions
49
Member since
Oct 21
onsclom.net
View on Hacker News

Recent submissions

Comment · 4 months ago
Ooh interesting. What is your machine and browser? On chrome with my m1 macbook it takes less than 1ms to compute and render each frame, but I am noticing some things I can optimize from the performance flame graph! I will say, I find chrome to be way more efficient for ctx2d things than firefox or safari.
Comment · 4 months ago
I made my own WASM demo @ https://microui-wasm.vercel.app/ and it's only 14.6 kB compressed!

Will share source code if someone is interested, but key bits:

- had a small JS glue layer using CanvasRenderingContext2D to render

- made a `wasm32-freestanding` build to lower the wasm bundle size, which meant shimming the bits of the libc microui uses

Comment · 7 months ago
I don't necessarily hate Lua, but I prefer C and Raylib for game dev. Lua is garbage collected, dynamically typed, strays far from standard syntax patterns, and has less existing tooling than C.

I see why people might hate Lua. Especially for game dev!

Comment · 9 months ago
Comment · 9 months ago
this is the way to go!

making a move should automatically copy the new url to your clipboard. you can still keep the ascii charm by server side rendering the ascii chess board as an og description.

Comment · 2 years ago
`const foo = function() {}`
Comment · 2 years ago
I'm guessing you don't consider VSCode an IDE? I'm curious, what features do you use in IDEs that are missing in VSCode?
Comment · 3 years ago
These are great points! Thanks for the super thoughtful reply. I'm actually sold.

1. It's really nice that it's so easy to make a `createSignal`

2. I didn't realize that in Solid you had to update all the usage sites too, so now I'd rather stick to the Svelte usage. Nested reactivity is not as effortless as I thought in Solid.

  get done() { return done },
  set done(value) { done = value },
  get text() { return text },
  set text(value) { text = value }
Looks a bit boilerplate-y maybe, but keeping your preoptimized call sites is totally worth it.

This might be common enough that some syntax sugar might be worth it?

The short hand for:

  todos = [...todos, {
    get done() { return done },
    set done(value) { done = value },
    get text() { return text },
    set text(value) { text = value }
  }];
Could be:

  todos = [...todos, {
    $done,
    $set
  }];
Comment · 3 years ago
Whoops, I missed that. Good catch! I'm not sure how tln's problem is happening then.
Comment · 3 years ago
Implicit reactive `let` statements make the code harder to understand for humans AND the compiler. This new explicit state pattern even simplifies designing. Now reactive state can work outside of components and across files as you would expect. It was tricky in all three ways.
Comment · 3 years ago
Comment · 3 years ago
Instead of finding reactive dependencies at compile time, `$effect` and `$derived` automatically track dependencies at runtime. This might feel like it would result in a performance decrease, but it is what SolidJS has been doing. And SolidJS is #1 in most performance benchmarks!
Comment · 3 years ago
Fair points, though React has hugely complex runtime magic. SolidJS's compiler magic is just as simple while also having much a simpler runtime.
Comment · 3 years ago
To be fair, assignments to variables still update the state of your component. `count += 1` will still update the state of your component. I think what you meant is that you now need to explicitly declare `count` as state. Personally, I think the magic of Svelte is that assignment part. And now the magic of Svelte works across files and even inside regular `.ts` and `.js` files!
Comment · 3 years ago
> The $effect runes makes people think we are going down the React useEffect route... but I didn't see a dependency array attached there waiting to obliterate performance?

This is exactly what SolidJS already does, and SolidJS is #1 in almost all performance benchmarks.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton