Better HN
topnewbestaskshowjobs
Log inSign up

otabdeveloper4

3,226 karma · joined Jun 14, 2019 (7y ago) · 4,043 submissions

Submissions

comment 5y ago · link · parent

> we want to move from AWS to GCP

Out of the frying pan and into the fire.

comment 5y ago · link · parent

Autonomous driving will never happen. It's a pipe dream like the flying car. (The problems aren't technical, they're socal and legal, and will never be solved.)

comment 5y ago · link · parent

Yeah, each project has its own default.nix that might look something like this:

    {
      pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/cd63096.tar.gz") { }
    } :
    with pkgs;
    let
      mypackage = callPackage ./mypackage.nix { stdenv = stdenv; python = python3; };
    in
    dockerTools.buildImage {
      contents = [ mypackage ];
    }
You then write a package definition in mypackage.nix, following the template of packaging things in nixpkgs.

(Dev environments work in a similar fashion except with mkShell instead of dockerTools.buildImage.)

I haven't used Nix flakes but I think it develops this simple idea further.

comment 5y ago · link · parent

At the moment the happy path for Nix is using it in the same space that Docker is used now - for providing reproducible dev/prod environments for server backends. (And in fact Docker and Nix complement and play nice with each other.)

You could theoretically use Nix for managing user apps too, but that's a niche use case and (as you found out) not in a working state.

comment 5y ago · link · parent

LuaJIT is extremely impressive engineering, but also a giant pile of hacks and shortcuts. I'm not surprised.

comment 5y ago · link · parent

The walrus operator is not the point; the existing constructs should be expanded, that way things make sense and are composable.

E.g., pattern matching of this sort

    for ["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"] in list_of_get_commads:
        ...
IMO should have "just worked".

But now we have two different and incompatible versions of pattern matching in Python.

comment 5y ago · link · parent

> Nix is not a build tool designed to work with arbitrary or latest development versions of libraries, for example.

No, that's exactly what it's designed for and exactly how we use it. And it's not a build tool (it just calls your existing build tools under the hood), it's a system for keeping different versions of dependencies installed at the same time without errors.

> because there is no force in the world that would get all projects in all languages to use it.

You can write your own wrappers for the projects that are missing. It's a simple and idiomatic process.

comment 5y ago · link · parent

I stated a fact. C and C++ are different (and incompatible) languages.

comment 5y ago · link · parent

> C/C++

No such thing.

comment 5y ago · link · parent

The problem is more or less solved - see Nix.

It'll take some decades for the ideas to percolate, but language-specific package managers are definitely not the future.

comment 5y ago · link · parent

> ...in 20 years

Refactor that estimate by an order of magnitude.

Most are already legacy next year. (Sadly I'm in that situation too, migrating off an expensive AWS cluster to a single Jenkins machine...)

comment 5y ago · link · parent

Python doesn't need a special keyword to distinguish functions that 'yield' from those that don't. Why should async functions be different?

comment 5y ago · link · parent

Yes. The second version is "pythonic" and follows the principle of least surprise.

The first version is certainly cleaner, but introduces, effectively, a new DSL sublanguage.

comment 5y ago · link · parent

Python already has (limited) pattern matching. Example:

    for foo, (bar, baz) in nested_tuple_list:
        ...
This works as expected. The current 3.10 implementation is just half-baked. They should have expanded the existing pattern matching facilities (added support for data structure destructuring).

Presumably then you could just have used the existing walrus operator inside the already existing if-else constructs.

That would have been the obvious path of least surprise. What we got instead seems inadequate.

comment 5y ago · link · parent

> The philosophy of python is there should be only one pythonic way of doing things.

That ship has sailed more than a decade ago.

(And if we're on a crusade to make Python pythonic again, let's start with the bigger fish - like the sync/async function distinction. Somehow Python managed to fall into the red/blue function trap the hardest.)

comment 5y ago · link · parent

Mars is not the Mojave Desert; it's far away from the sun and always dark and cold. I'd think anybody going to Mars for the aesthetics would be disappointed.

comment 5y ago · link · parent

You don't need to land on Venus' surface; airships in the atmosphere are the closest thing to Earth in the Solar System.

The problem is that there is nothing useful on Mars and its location sucks. Any other planetary body makes more economic sense.

comment 5y ago · link · parent

> It doesn't matter till we'll be actually able to settle down on Mars permanently

Mars is the least useful planetary body in the Solar System for human colonization, so that time may well be "never".

comment 5y ago · link · parent

I haven't seen a 'new' or 'delete' in C++ in 15 years. (And I have worked on teams writing custom malloc implementations and lots of other low-level things.)

I guess there are lots of demented and broken codebases out there, but starting students with the broken dysfunctional case as the default seems wrong. They can learn bad habits on their own later.

comment 5y ago · link · parent

I've been using Python since it was version 1.4.

Back then the main draw of Python was supposed to be the "one way of doing things" - Python originally started as a teaching language.

And look at Python today - there's what, five different "standard" ways of packaging libraries? (And why is "packaging libraries" even a thing?) Instead of "batteries included" we get at least four different ways of doing every common task: the stdlib Python 2 way, the stdlib Python 3 way, the "standard" community third-party synchronous library and the "standard" community async one.

This is just how it always is. Every language starts with the goal of being small, easy to understand and beautifully composeable.

The cruft builds over time because people eventually want it and because none of it ever really goes away due to backwards compatibility.

I think it's best to make peace with this fact, learn to live with the cruft and accept existing languages rather than switching your entire stack every three years trying to chase an unobtainable dragon.

comment 5y ago · link · parent

Never used this Bebop thing, but I'd have definitely preferred it to FlatBuffers back when I was shopping for serialization libraries.

comment 5y ago · link · parent

They do get priority when you're primarily coding in C++, obviously. Not everything is Javascript-first. Different requirements for different folks.

comment 5y ago · link · parent

FlatBuffers creates its own demented and completely incompatible data structures when deserializing into C++. Which means you then need to copy the FlatBuffers structures into normal ones, defeating the entire point of "zero-copy" in the first place.

This thing it looks like uses normal C++ structures under the hood, and if so that's a huge plus.

comment 5y ago · link · parent

Not true. Rust fanboys certainly do. They're always ready to tell me how and when I should immediately rewrite all my code into Rust.

comment 5y ago · link · parent

Octave has strings and they are checked at runtime:

    octave> strtrim("  hello world  ")
    ans = hello world
    octave> strtrim([1,2,3,4])
    error: strtrim: S argument must be a string or cellstring
    error: called from
        strtrim at line 79 column 5

comment 5y ago · link · parent

You're just delegating the type checking to an ad-hoc runtime.

It's always better to check types rigorously and as soon as possible.

comment 5y ago · link · parent

I've sold every ISP-provided TP-Link I've had. The cheap "normal" routers crash all the time. Their firmware quality is worse than abysmal.

Also, does your shoebox apartment have reinforced concrete walls? That would make everything much more difficult.

comment 5y ago · link · parent

> It's probably going to take a couple of weeks to get it unstuck.

You're an optimist, that's for sure.

comment 5y ago · link · parent

Out of the box it doesn't, but it's 99% of the way there.

comment 5y ago · link · parent

IMO you vastly overestimate the corporate use case.

In my experience in places where Slack was settled on as a corporate messaging solution the three questions asked (in order of importance) were

  * "Does it support custom animated emoji"?
  * "Does it have website and document previews"?
  * "Can I send my notifications to it"?
(It's silly but that's how it is.)
1
113114115
135