Better HN
topnewbestaskshowjobs
Log inSign up

mcronce

1,005 karma · joined Mar 31, 2020 (6y ago) · 374 submissions

Submissions

comment 4y ago · link · parent

I'd choose Node or PHP over Go for a greenfield project. (Although I can't think of a case where I'd choose them over Python.) All of those languages at least give me an FFI escape hatch in case I need it that isn't absolutely horrendous, both from a dev experience standpoint and a performance standpoint.

comment 4y ago · link · parent

> runtime costs of the overuse of Interface{} (prior to Generics at least)

Generics aren't going to improve this situation - at least not the current iteration of generics :(

comment 4y ago · link · parent

> auto-bubbles up if not handled

I'm guessing you already know this, but for anybody else reading - this isn't entirely accurate; Result::Err doesn't auto bubble up like an exception, you have to manually bubble it up. The "special sauce" comes from (A) the compiler forcing you to notice this and do something about it, and (B) the `?` syntactic sugar to make that super easy.

It does occur to me as I'm typing this that you might be talking about panics, though, in which case yeah that's entirely accurate.

comment 4y ago · link · parent

> every mainstream language with easy FFI still has significant FFI overhead (so much so that many programs actually run slower with FFI). This isn't really true for Rust

This isn't true for almost any language to the extent it's true for Go, and for many compiled languages it isn't really true at all.

> Try building a significant Python project on anything except a recent version of RHEL, Debian, MacOS, or Windows. For example, try getting your Python project running on something like a scratch Docker container. Or try packaging a Python package (which depends even transitively on a C library, especially one which isn't already packaged for Nix) with Nix.

While these are legitimate theoretical problems, none of them are really problems in practice. Containers don't need to be scratch, and if you're building a Python project, you're already not running a scratch container, so the addition of FFI doesn't change that. Nix is not an environment I've ever seen a requirement to support, let alone had a requirement.

It really seems to me that you like Go and you like Go's design decisions, but "I like this" is not the same as "this is better than that". I'm not particularly interested in rehashing the same conversation over and over again.

comment 4y ago · link · parent

I'm not talking about an actual static binary, I'm talking about a typical "mostly static" binary with the handful of common dynamic dependencies.

comment 4y ago · link · parent

And as a bonus, be statically linked with all the benefits that brings.

comment 4y ago · link · parent

That would be great if Go provided better performance. With its awful FFI, you have no recourse when you hit its limits other than to rewrite the entire codebase in something else.

As with many things, there's nothing stopping you from just sticking with pure Go if you don't like C toolchains. While C build issues are a valid theoretical concern, in practice I've never had any Python package fail to install because of a C dependency problem that wasn't trivially resolved, nor any Rust project fail to compile because of a C dependency problem at all.

comment 4y ago · link · parent

Serializing a request structure, making an IPC/network call, deserializing the request structure, serializing the response structure, sending it back, and deserializing it ... isn't really a solution when the purpose of an FFI call is typically to fix some performance issue.

Lots of garbage-collected languages make FFI not only easy but plenty fast. Go does neither.

comment 4y ago · link · parent

> Go is a language that gets out of your way, encourages you to solve your problem

Maybe I'm just too dumb for Go, but this is not consistent with my experience at all. Go's insistence on pretending that complexity doesn't exist would get in my way all the time. Go's extreme hostility toward FFI calls got in my way several times.

comment 4y ago · link · parent

> In my experience, people can't actually read everything on the screen at one time anyway, and the more dense/terse things are the harder it is to read (otherwise we would minify everything).

Whether or not you can read everything on the screen at one time is missing the point entirely. The point is that context matters, and the more frequently you have to scroll to find it is more cognitive burden.

> It's not likely that it will continue with corrupt data because you can't use the return value without explicitly ignoring the error.

It is far too easy to accidentally do the wrong thing with an error in Go. In Rust, for example, no matter what you want to do with the result of a fallible call, you have to do it explicitly. If you want to crash on error, you `.unwrap()`; if you want to bubble it up, you `?`; if you want to continue with a default value, you `.unwrap_or()` or one of its variants.

> in practice, Go seems to have fewer error handling bugs than exception-based languages

This is based on?

comment 4y ago · link · parent

Screen real estate is limited, especially vertical real estate. Compared to languages with saner error handling, I can read approximately 25% as much Go code at once. That's a real cognitive burden when maintaining code or learning your way around a new codebase, which seems especially egregious from a language whose community consistently proselytizes about how the lack of language features is great for maintainability and onboarding.

I'd take exceptions any day of the week over Go's solution. I'd much rather the program crash by default than attempt to continue with corrupt data by default. I'd rather have concise, explicit, compiler-required error handling than exceptions, though.

comment 4y ago · link · parent

It requires several additional lines of code just to bubble up an error, for starters, and there's nothing stopping you from ignoring errors and continuing with what could easily be corrupt data.

comment 4y ago · link · parent

"Bubbling up" is common parlance for "exit this function early and return the error we got from our callee" (or "wrap the error we got from our callee and return that")

In Go, this looks like

   thing, err := call()
   if err != nil {
       return nil, er
   }
In Rust, this looks like

   let thing = call()?;

comment 4y ago · link · parent

I guess it's better than, like, burning something specifically for the purpose of capturing CO2 to put in a tank on the railways...but has anybody ever actually proposed that?

comment 4y ago · link · parent

In this case, yes, obviously. But as far as "it's likely easier for them to contribute scraping than write a bunch of code to integrate with your API", that presupposes no existing integration.

comment 4y ago · link · parent

It wasn't the only reason, but -O0 was a contributing factor. -O2 alone improves things, but doesn't bring the frame rate in DDD up to 30

comment 4y ago · link · parent

Writing a scraper for a webpage is typically far more development effort than writing an API wrapper

comment 4y ago · link · parent

I usually use `thiserror` for errors, but all that is is a shortcut macro for `impl Error` and `impl Display`

comment 4y ago · link · parent

Demand would be a lot higher if the leaded alternative weren't allowed.

comment 4y ago · link · parent

This is only the case* when there is actually something to be gained by specializing the implementation of a data type or function for a given type. In my experience that isn't particularly common.

* Excluding Go's implementation of generics, which are frequently less performant than even vtable dispatch, let alone manually copied implementations.

comment 4y ago · link · parent

Transphobia, much like homophobia, refers to an ideology, not an actual fear. Nice try getting on your prescriptivist high horse, though.

comment 4y ago · link · parent

In addition to not being the same as getting through the night, it's far from the same as getting through several cloudy days in a row.

Energy sources that work when they want to will never replace energy sources that work when you tell them to. Lobbying against nuclear is just lobbying for coal and gas.

comment 4y ago · link · parent

> This is a commonly made point, but is misleading. The historical usage is for a hypothetical or unknown referent not a specific, known person.

This seems less like a material distinction and more like something that transphobic people would bring up to support their ideology.

> Furthermore, generic he has also been around for hundreds of years. So we should keep using that too, right?

My point was that it isn't new or somehow "a gen Z thing", not "all old things are good"

comment 4y ago · link · parent

How is this a gen Z thing? Singular "they" has been around as a gender-neutral pronoun for, literally, hundreds of years.

comment 4y ago · link · parent

You have every right to think whatever you want. You, again, don't get to decide for them who/what they are.

comment 4y ago · link · parent

Yes, it does. You don't get to decide for other people who or what they are.

comment 4y ago · link · parent

> It's very expensive to get regulatory approval for new engines and even more so to then get approvals to retrofit them to legacy or historical aircraft.

"The problems caused by rules we oppose upon ourselves are so bad that we can't solve the real biochemical issues caused by airborne lead" may not be the compelling argument you think it is.

> Unfortunately if you put regular pump gasoline in an aircraft you are going to have serious problems. Not least because of the bioethanol mixed in which will degrade the pipes.

There are plenty of fueling options other than driving down to Shell and picking up some E10. There are also readily available fuel lines that aren't degraded by ethanol.

comment 4y ago · link · parent

Uncle and Auntie won't understand that they aren't part of my library, and will complain when something goes wrong with them despite the fact that they're beyond my control.

As the person who owns and operates the service, I should have the control to set default configuration for my users. Just like I should be able to shut off all the ads for everybody, I should be able to set the default quality setting to max.

I can't do either.

comment 4y ago · link · parent

Fusion research has not received anything even remotely resembling "all the $Billions in the world"
1
910111213