Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uryga
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
1.
▲
by
uryga
3y ago
> AFAIK there's no magic to React.memo. It's basically a shorthand for useMemo that takes the props as the dependency. Pedantic note: this isn't quite true. memo() also allows a second `arePropsEqual` argument that useMemo
2.
▲
by
uryga
3y ago
how exactly is there "money to be made" here for the React team?
3.
▲
by
uryga
3y ago
> Why did they not include other companies AFAIK: the initial stages of the project involved Vercel and Shopify [edit: and Gatsby]. these companies maintain frameworks and hosting solutions for them, which makes them good partners to wor
4.
▲
by
uryga
3y ago
> But their routing things locks you into NextJS as a framework. I'm confused by this -- how is a framework supposed to offer routing in a way that doesn't "lock you in"? are you "locked into" React Router
5.
▲
by
uryga
3y ago
> I would like to write a component, not have to think about where it is running in most cases you can keep doing this, just put "use client" in the file, Next will SSR them just like it used to. (SSR is an "emulated clien
6.
▲
by
uryga
3y ago
> zero functionality has been removed from class components yes, exactly! > They use them because they are idiomatic React right, and do you think it'd be easy for a feature to become idiomatic if it wasn't an improvement ov
7.
▲
by
uryga
3y ago
have you seen https://vite-plugin-ssr.com/ ? i've only browsed their docs, but AFAICT the pitch is that it's a more DIY approach to a framework, where you keep a lot of control over how things are wired together.
8.
▲
by
uryga
3y ago
> Apps (as in, mobile apps) cannot be rendered on the sever yes and no. sure, you can't do standard SSR like for websites. but i've seen a number of spins[1] on "Server-driven UI", meaning "server defines the app
9.
▲
by
uryga
4y ago
> TypeScript is a little unique in that its core type system is much more structural than nominal ( even more so than Haskell ) I'm a bit confused by the point about Haskell here -- IME Haskell's type system is pretty strictly
10.
▲
by
uryga
4y ago
thats what the rack is for duh
11.
▲
by
uryga
4y ago
good luck! it's quite fun :) another term that might be useful is "GADT" - it's kinda like a weaker form of DT, more easily expressible in, uh, normal languages. the C# one i linked is really more like a GADT, bc it all
12.
▲
by
uryga
4y ago
i haven't used scala, but from the looks of it, yeah, "path-dependent types" are a narrow subset of full dependent types, intended for stuff like this exact use case :D there's things you can do to track list length at t
13.
▲
by
uryga
4y ago
while you probably can do this with dependent types, i'd imagine GP means something along the lines of typescript's structural typing, i.e. const post = { id: 123, content: "...", published: true, }
14.
▲
by
uryga
4y ago
they allow as many operations as you need, just pass in a "method name" :) const p = Point(3, 5) p('getX') // 3 p('up', 11)('toString') // "Point(3, 16)" cons
15.
▲
by
uryga
4y ago
> 'useSyncExternalStore()' -- Gack! > Now...that "little" it's-not-a-framework-it's-a-library whose scope is supposed to be confined to just the "view" part of MVC (by which I mean: "React&
16.
▲
by
uryga
5y ago
are there any languages that do this? Rust's `?` is similar but the propagation is explicit
17.
▲
by
uryga
5y ago
> But where they really shine, like in the mapping example, isn't possible in Go. oh yeah, definitely! Go's version of EaV with multiple returns is pretty lackluster compared to a proper Result type. afaict it's kind of &q
18.
▲
by
uryga
5y ago
> But I also don't know any languages where errors _aren't_ values (look, i know you understand how exceptions work, please bear with me) yes, Exception objects are technically values, but you don't return them to the call
19.
▲
by
uryga
5y ago
https://en.m.wikibooks.org/wiki/Haskell/do_notation rough analogy: `await` replaces `.then()`, do-notation replaces `.flatMap()`
20.
▲
by
uryga
5y ago
distinguishing `Some(null)` and `None` is often considered a feature of Optional ;) to use a tired example: when getting a value out of a map via some `myMap.get(key)`, you may want to distinguish "not present" = `None` and &quo
21.
▲
by
uryga
5y ago
that's fair, i was in a spicy mood. there's "esoteric" as in fundamentally complicated, and """esoteric""" as in syntax that's unfamiliar but easily explained w/ a quick web search
22.
▲
by
uryga
5y ago
"programming shouldn't evolve, it should look like what i learned N years ago"? ;)
23.
▲
by
uryga
5y ago
that's GP's (and the linked paper's) point :) "paradigmatically can't understand" = "can't figure out using current methods", so pretty much what you're saying
24.
▲
by
uryga
5y ago
yeah, that's not really explained in the article, and it's not explained in the `ast` docs either [1]. for reference, the full list of assignment targets is: -- the following expression can appear in assignment context
25.
▲
by
uryga
5y ago
> [React] requires compilation technically, but not in the same way e.g. Svelte does. the syntax used by React, JSX, is simple local syntactic sugar: <Foo x={a} y={b}>...</Foo> // ↓ createElement(Foo, {
26.
▲
by
uryga
5y ago
IME, code on prod rarely ships with a sourcemap. and as far as i can tell, GP is talking about other people's minified code, not something where they control the build process
27.
▲
by
uryga
5y ago
y %>% f(x, ., z) === f(x, y, z) R lets you do macro-ish things at at runtime [1], and `.` is a valid variable name [2]. so %>% can just evaluate the AST of its right argument in an environment with `. = a`. (it's probab
28.
▲
by
uryga
5y ago
>>> x = [0] >>> for x in xs: ... print(x) ... xs.append(x+1)
29.
▲
by
uryga
5y ago
> TypeScript [...] adds to the bundle size. tbh i haven't checked, but isn't the transpilation step for typescript just stripping out the type annotations? TSC is build-time only, so it won't factor into your bundle size,
30.
▲
by
uryga
5y ago
yeah, the intersection of lazy evaluation and side-effects (incl. errors/exceptions) gets confusing, you definitely have to be there to help the student out of a jam. but i think it's useful to start out pretending R follows stric
More ›