HNHacker News
TopNewBestAskShowJobs

jshxr

17 karma · joined April 22, 2022

submissionscomments
jshxr··on Use Your Type System
Unfortunately, this can be somewhat awkward to implement in certain structural typed languages like TypeScript. I often find myself writing something along the lines of

  type UserID = string & { readonly __tag: unique symbol }
which always feels a bit hacky.
jshxr··on Use Your Type System
I've seen it being referred to as "New Type Pattern" or "New Type Idiom" in quite some places. For example in the rust-by-example book [1].

[1] https://doc.rust-lang.org/rust-by-example/generics/new_types...

jshxr··on Show HN: Hyvector – A fast and modern SVG editor
Very cool! A few notes:

- I really like the level of fine-grained control, even for changes that don't visibly affect the output, like reversing a path. For that case, some visual feedback would help, since it's hard to tell if it worked

- Copying a selection to the clipboard seems to include all fonts used in the scene (even if not selected) as base64 in the SVG, leading to a bloated output

Do you plan to keep the strict 1:1 mapping with SVG, or are you open to some abstractions? I still use Figma for creating SVGs because of one killer feature I can't work without anymore: Vector Networks [1]. They'd need some internal conversion to valid path data, but it's an abstraction that could add real value.

On the technical side, I'm surprised the editor uses SVG for rendering. Although of course it makes sense, I half expected it to use canvas under the hood. Lately I've been experimenting with rendering simple 3D objects using SVG and ran into performance issues pretty quickly, though I'm not yet sure what exactly' is causing them.

Did you do any stress testing yet, especially on older devices?

[1] https://www.figma.com/blog/introducing-vector-networks/