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

> Converting C++ to Java is still trivial unless there's pointer craziness. Generally copy paste the C++ and change naming conventions.

What? You've obviously never seen actual C++ code to make such a ridiculous statement.

comment 5y ago · link · parent

The Facebook competitor is "not using Facebook".

I haven't used it for ten years, can't say I miss it.

comment 5y ago · link · parent

Iterator invalidation is a kind of use-after-free.

Mutating aliased objects is, of course, usually the desired outcome and not a bug. It becomes a bug when your program's concurrency logic is not thought through, and there are no easy solutions here.

comment 5y ago · link · parent

> can simulate a universe

That's a pretty huge and unfounded assumption.

comment 5y ago · link · parent

> people were convinced it was the new normal and that businesses got insane valuations preproduct even

How is that any different from today?

comment 5y ago · link · parent

Use-after-free is

a) probably the least important class of bugs for this sort of thing

b) adequately solved with the existing C++ language features anyways.

So what would be the point of rewriting in Rust?

(Assume the people writing it aready have the C++ knowledge and tooling ready.)

comment 5y ago · link · parent

Three points:

a) 'Simula style' isn't at all like the Smalltalk-derived programming patterns we call 'OOP'. (Simula was about actor-oriented programming anyways, hence the name.)

b) The unique differentiator for C++ was the STL, and not the OOP features that were done better and cleaner in other languages.

c) The killer feature for early C++ adoption was operator overloading, not inheritance. (Pretty much nobody liked using inheritance in C++ even back in the day.)

comment 5y ago · link · parent

Yeah, finding a decent Javascript or C++ developer is actually very difficult - everyone thinks they know C++ and Javascript when in fact only a small minority actually do.

comment 5y ago · link · parent

Yes, C++ is not an "object-oriented language" and never was.

The OO features were added because at the time it was the raging fad and people thought that every language simply must have "OOP".

But "OOP" was never a foundational principle for C++, more like a tacked-on sidecar.

comment 5y ago · link · parent

Monetary compensation is only part of the equation.

Having "the guy who made PowerBI" on your resume can be worth more than some stock options.

comment 5y ago · link · parent

> Cloud-native

I read those two words as "bullshit". It's the new "blockchain" in my mental space.

Also, after reading the entirety of that page I still have no idea what this is or what it does. Simply terrible, who is this marketed to?

comment 5y ago · link · parent

"Aren't really" means "cannot commit to 100 percent static typing all the way".

comment 5y ago · link · parent

> C++ is not complex? The C++ complexity is not accidental? C++ is like Haskell or OCaml?

C++ doesn't compete with Java or Go, C++ competes in the "polymorphism via static typing" niche along with Haskell, Ocaml, etc.

If you look at what Haskell at al. need to do to get static polymorphism right then C++ doesn't look at all that complex or strange.

> Dude, C++ can still compile C code, right?

No, wrong.

> And how are C++ templates anything like Haskell or OCaml?

C++ templates are a purely functional Lisp-like DSL.

> Aren't they just some fancy text-based code generator thing, at the end of the day?

So is Haskell.

> I'm really curious about this as everything I've seen so far contradicts your perspective.

You just don't know C++. People think they do because they learned a bit of C back in college, but they don't.

> Or are you talking just about modern C++ (post C++ 11)?

C++11 was a decade ago; hardly "modern".

> That doesn't work as C++ of all kinds is out there in the wild and you'll run into it, at least from external dependencies.

There's lots of legacy crap out there in the wild, including legacy COBOL and legacy Haskell. I fail to see your point; "modern" C++ isn't some wild departure from the original idea of C++. Ever since STL it has been in a pretty specific and well-defined trajectory.

comment 5y ago · link · parent

C++ is the language that is changing the fastest of the three. In 5-10 years it will be the most modern choice; D is already legacy.

comment 5y ago · link · parent

No, not at all.

C++ is much closer to something like OCaml than to C or Java.

The "complexity" is not accidental, and it only seems complex because people are not used to languages with static typing systems. C++ is not complex if you mastered something like the Haskell type system.

(C and Java aren't really statically typed; they rely on run-time typing for polymorphism.)

comment 5y ago · link · parent

> Tesla is a car manufacturer!

That's what you think.

comment 5y ago · link · parent

> ...because doing so would be far more painful than anything that happened in Python 3.0

Is this really true? I don't think lack of block scope is ever used for anything but causing bugs.

comment 5y ago · link · parent

> Python is a beginner friendly language

Not really, no. It hasn't been beginner-friendly for a decade or so now.

comment 5y ago · link · parent

Lockdowns didn't do squat to prevent those deaths. Maybe slowed down the timeline by two months, if that.

There's no way you're going to put this genie back into the bottle, Covid is already endemic.

What should have been done instead is to figure out what factors cause Covid complications, because for the vast majority of people Covid is harmless. One year in and we still haven't even started...

(We spent so much time and effort on vaccines instead, even though there are several strains of Covid in the wild and people routinely get it twice...)

comment 5y ago · link · parent

Two points:

a) Age is just a confounding variable. Covid seems to be a "cardiovascular" viral disease rather than a "respiratory" one. For the vast majority of people Covid is unpleasant but not at all dangerous. Figuring out the real factors that make Covid dangerous should have been top priority, but unfortunately it isn't.

b) Flu and "common cold" is, in fact, very dangerous and deadly. We just classify those deaths differently, e.g., as deaths from stroke even though strokes can be caused directly by the "common cold".

comment 5y ago · link · parent

There's no point in sending people with Covid to the hospital. We can't cure viral infections anyways, all it does is just facilitate spread.

Eventually we'll just figure out prophylactic measures for those groups most at risk and leave it at that. It's what we do already with the "common cold", even though the cold can be very dangerous and deadly to some people.

comment 5y ago · link · parent

> The way to eliminate it...

Why? Let's just get this over with already. All these "cures" are turning out to be worse than the disease.

comment 5y ago · link · parent

Because unit tests are usually worthless, except in some specific circumstances.

comment 5y ago · link · parent

I think you just proved my point.

IMO replication is a core feature of a DBMS (like transactions or SQL support), the fact that you need to install obscure third-party tools to bring Postgres into the modern age is bonkers.

comment 5y ago · link · parent

Where do you draw the line?

Ants are very intelligent. Is it okay to destroy their societies just because they don't look pretty and we can't emphasize with arthropods?

comment 5y ago · link · parent

Postgres doesn't have a great solution for any replication, not just master-master.

Lots of things are just half-baked and very clumsy in Postgres compared to MySQL (MariaDB).

comment 5y ago · link · parent

> Then why is it that IO-heavy benchmarks such as the Techempower web benchmark are dominated by async frameworks?

Probably because they forgot to enable realtime priority for threads in the synchronous frameworks.

Failing to do that means Linux will starve your web request handling threads in favor of various system tasks you don't care about.

comment 5y ago · link · parent

Yes, the point of "async" isn't to save CPU cycles, it's to customize the scheduler so that you can prioritize resource use properly.

(E.g., don't switch to the systemd or sshd thread if a customer's web request is timing out.)

That said, doing this right is out of reach of the average programmer, and it's doubtful that the compiler has enough domain-specific knowledge to do this automatically.

"Async" of the Python and node.js fame is yet another thing, a hack to get around their interpreters' inability to use kernel multitasking features because of global locks.

comment 5y ago · link · parent

I don't see your point.

"Linux thread context switch time" is a meaningless metric, since Linux will switch thread context regardless of what you choose to run on your computer.

Any "async" switches are additional overhead; you don't get to not have kernel preemption just because your Rust thread is now switching contexts "asyncly".

There are benefits to having an additional user-mode scheduling mechanism inside your kernel thread, but saving CPU cycles isn't one of them.

comment 5y ago · link · parent

A meaningless comparison. Linux, being a preemptively multitasking OS, switches thread contexts regardless of what you're running.

So the Rust async context switch is on top of the regular Linux context switch, not instead.

1
117118119
135