HNHacker News
TopNewBestAskShowJobs

preseinger

615 karma · joined October 11, 2021

submissionscomments
preseinger··on Shrinking a shared library
where do debug symbols exist, if not "interleaved" with the code?
preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
can you point me to any meaningful use of the clr in the browser? i'm not aware of any
preseinger··on Gopher Wrangling: Effective error handling in Go
not really

do you not do code review?

preseinger··on Go 1.21 Release Candidate
if you pass a logger to a foo as a parameter to the foo constructor, then missing a logger is a compile-time error

if you pass a logger to a foo as a parameter in the request context, then missing a logger is a run-time error

preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
your link describes a very narrowly scoped benchmark, not something that is generally applicable
preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
wasm has properties that are unique versus other existing bytecode systems

those properties are important

preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
nobody is deploying clr applications anywhere where wasm applies
preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
well, that, and performance

and mindshare

preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
it started there but that's not like the only goal of the thing

and like there's plenty of people doing wasm on the server where performance is measured in microseconds

preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
containers are FAR slower than regular processes, by almost all performance metrics

wasm is orders of magnitude faster -- actually comparable to native execution, at least on the server

preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
wasm compiles to "native" code, for whatever "native" means in your execution environment

if you're deploying wasm to the browser, then native means your JS engine

if you're deploying wasm to the server, then native means actual machine code

the competitive advantage versus java is (at a very high level) the language design -- java is much higher-level than wasm, which limits its potential

preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
wasm doesn't give you a vm, it gives you a process
preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
wasm is not bound to javascript in any meaningful sense
preseinger··on “WebAssembly runtimes will replace container-based runtimes by 2030”
they're indeed very similar

the main difference distills down to execution/implementation

java applets were slow, wasm is fast

that distinction makes a categorical difference

preseinger··on Gopher Wrangling: Effective error handling in Go
bad:

    first()?.second()?.third()?
good:

    a = first()
    if a failed, handle that error
    b = second(a)
    if b failed, handle that error
    c = third(b)
    if c failed, handle that error
    yield c
preseinger··on Go 1.21 Release Candidate
huh? there's no dogma involved here, it's just an observation of the properties of the type

a context is created with each request, and destroyed at the end of it

and values stored in a context are accessible only through un-typed, runtime-fallible methods -- not something you want to lean on, if you can avoid it

preseinger··on Go 1.21 Release Candidate
yes, in general

the context stores request-scoped data, whether or not the logger is a request-scoped value is a grey area

and to reply to sibling comment, opentelemetry is basically a house of antipatterns, definitely do not look to it for guidance

preseinger··on Gopher Wrangling: Effective error handling in Go
that person was wrong
preseinger··on Gopher Wrangling: Effective error handling in Go
"the language level" is not only what is defined and enforced by the compiler

but i'm sure i won't convince you of anything here, so good luck to you

preseinger··on Gopher Wrangling: Effective error handling in Go
the question is: does it matter if a given expression fails?

if so, get the error and evaluate it -- like if json.Marshal fails in your http.Handler

if not, (shrug) -- like (maybe) if your fmt.Printf fails

panics are for core assertion violations, not an ersatz error reporting mechanism

preseinger··on Gopher Wrangling: Effective error handling in Go
chaining means combining a sequence of expressions that each take the same input as they give as output

; doesn't do this, afaict

when you're writing imperative code it's important that control flow (return) is explicitly visible

preseinger··on Gopher Wrangling: Effective error handling in Go
nah

go error messages are clear to users without being cryptic

preseinger··on Gopher Wrangling: Effective error handling in Go
you know i looked into it and it turns out that there is no actual consensus on what "the _right_ way" to treat errors is! huh! how about that
preseinger··on Gopher Wrangling: Effective error handling in Go
some keywords are types, but not all types are keywords, right?

like, it's not as if the go type `float64` is also a go keyword

but i guess the java type `byte` is a java keyword? according to https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_k...

preseinger··on Gopher Wrangling: Effective error handling in Go
true! of course.
preseinger··on My First Impressions of Nix
supercharged!!!

how much faster are your development workflows now, versus before? like 100x?

how complex were your previous development workflows? what did that complexity manifest as? how has nix made it less complex?

i'm excited to learn more

preseinger··on Gopher Wrangling: Effective error handling in Go
if we say a language "addresses" a given concern, is it necessary that this is accomplished in the compiler, and that the rules for that concern, whatever they are, are enforced at compile-time?

(spoiler: no)

preseinger··on Gopher Wrangling: Effective error handling in Go
yeah it is literally a non-issue in practice, and yet
preseinger··on Gopher Wrangling: Effective error handling in Go
> The goto pattern in particular is found all over the stdlib.

in generated code, sure -- that's why it exists, to support codegen

it's sometimes abused to manage for loop control flow

but the stdlib is definitely not some platonic ideal -- it's a decade+ old code base which has suffered all of the indignities of organic growth

it's full of bad code and terrible anti-patterns

(good stuff, too!)

preseinger··on Gopher Wrangling: Effective error handling in Go
it is my very clear experience that rust programs are more brittle than go programs, precisely because rust makes it possible (even encourages) error "bubbling" via `?`

in practice, go code bases that are subject to even minimal code review have basically no ignored errors

← PreviousPage 3 of 26Next →