HNHacker News
TopNewBestAskShowJobs

smitherfield

1,770 karma · joined March 26, 2015

submissionscomments
smitherfield··on An $814M Mystery Near the Heart of the Biggest Bitcoin Exchange
Thanks!
smitherfield··on Linux on an 8-bit microcontroller
Computers are still universal Turing machines because an infinite-tape computation[1] can be subdivided into an infinite sequence of finite-tape computations.

[1] Meaning a computation using an arbitrarily-long tape, since by definition a computation is finite or its result is undefined.

smitherfield··on Microsoft Has It All—Almost (1985)
I can think of several companies that produced similarly "diverse" software portfolios in the 70's and 80's (Bell Labs, Xerox PARC, Commodore, Apple ...), although certainly none were anywhere near as commercially-successful as Microsoft.
smitherfield··on Tesla Roadster
> But, alas, 200k, I want it to be perfect forever. Even used in 5 years @ 130-150k.

The good/bad thing about electric cars is that they're sort of like computers right now (they're getting twice as good every 1-2 years), so I expect they'll depreciate more along the lines of used smartphones than (the existing market in) used cars.

smitherfield··on Tesla Roadster
>But isn't performing such acceleration on a daily basis close to the limit of harming one's health?

Yes, and also the health of nearby drivers, bystanders and inanimate objects.

smitherfield··on Science and Tech of the Byzantine Empire
> Byzantium was never actually Greek, many emperors didn't even speak the language.

Huh? I'll admit I'm not that well-read about Byzantine history, but I had always been under the impression that from the reign of Heraclius (mid-7th-century) onwards[1] the court language was always or virtually always Greek.

[1] Which is also as good a dividing line as any between the "Roman" and "Byzantine" periods.

smitherfield··on Don’t use C++ auto? Restricting auto is not the best decision
> is x an iterator (Collection is std::map) or a number (Collection is std::string)? Here it is better to write out the iterator type if that's what you mean.

The reader would be able to infer this from context (as is the compiler, so it's still type-safe).

> `first` has type T except when T is bool. Gross. Better to write out the type T.

That's a preexisting problem with `vector<bool>` much more than it is with `auto`.

smitherfield··on The Booming Japanese Rent-A-Friend Business
> We generally think it's ethically acceptable not to tell a child that they were adopted for a long while (possibly into adulthood), or not to tell a child that their biological father wasn't their mother's husband.

I would strongly favor honesty in both those situations once the child is mature enough to understand, except, in the latter case, when it's clearly in the child's best interest not to have a relationship with her biological father.

> We also find it ethically acceptable for a couple not to ask who fathered their own child.

That sounds to me like an extremely toxic relationship.

> We also generally find it ethically acceptable to form and especially continue relationships based on factors other than true love, including stability of a family environment and economic stability.

Those are at least real emotions and real decisions made honestly, not elaborate and unthinkably cruel deceptions.

Imagine you learned the person you thought was your parent, or sibling, or spouse, was really another person entirely. They never loved you, they never wanted to spend time with you, and all your memories with them were a lie. They were just a hired actor the real part of your family paid $50 an hour to deceive you.

It's hard to imagine anything that could be more painful. It's far worse than a death in the family. It'd be on par with learning your loved one were a murderer or rapist. It's like a particularly unsettling Twilight Zone or Black Mirror plot—I'm aghast that it's a real thing.

smitherfield··on Work on SQLite4 has concluded
> You consider the fact that there is no spec other than "how the current implementation works", so no way to know if the code than works on version n will continue to work on version n+1, and no way to produce an alternate implementation, is a "complete nonsense reason"?

Yes. Sqlite is among the most stable and mature software in existence. I challenge you to name a single browser technology or API that has been anywhere remotely as stable as Sqlite, especially as implemented. As mentioned elsewhere ITT, Hwaci has contractual commitments to support backwards-compatible Sqlite3 for at least the next 35 years.

At that point, if I had to guess, "web browsers" won't be around any more, the web itself will be a dying or dead legacy technology, and companies yet to be founded will lead the tech sector, while Apple, Google, Microsoft and most likely of all Mozilla will be IBM-style dead letters or Digital[1]-style dead.

Sqlite was primarily written by one person and is maintained by three people.[2] If for some reason Mozilla had to fork or take over maintenance of Sqlite, it wouldn't even be worth noticing in their budget. It would, in fact, likely cost considerably less developer time than they spent designing, implementing and lobbying for IndexedDB.

More likely, if Sqlite3 were no longer being suitably maintained, all the browser vendors, plus the hundreds of other major tech companies that use it, would jointly endow a Sqlite Foundation to take over maintainence, which might cost Mozilla 5 grand or so a year, ye gods.

Even if Mozilla felt compelled for some reason (avoiding dependencies?) to rewrite Sqlite from scratch, Sqlite is 125k lines[3] of ANSI C compared to Firefox's 18 million lines[4] of C++, so Sqlite represents roughly one month of Firefox development time.

Firefox, Chrome, IE/Edge and Safari all make very extensive use of Sqlite internally, including to implement IndexedDB, so, obviously, Mozilla does not actually consider dependency on Sqlite and its API to present a meaningful risk.

Further, as things stand (and as they stood in 2010), Sqlite's massive footprint in the Firefox codebase means Mozilla already must rely on Sqlite remaining maintained, just the same as if WebSQL had been standardized.

> I also believe that it wasn't just Mozilla, but also Microsoft that scuttled this. Mozilla was the louder voice, but Microsoft never supported it either.

MS, especially at the time, ordinarily tried to slow or stall the standardization process for web technologies in general, so IE wouldn't fall too far behind. I expect better of Mozilla.

Mozilla was also by far the loudest (really the only) voice against WebSQL; MS barely participated in the conversation and was mostly noncommittal when it did. It's unlikely MS would've objected at all if Mozilla hadn't given them the opening.

[1] https://en.wikipedia.org/wiki/Digital_Equipment_Corporation

[2] https://sqlite.org/crew.html

[3] https://sqlite.org/testing.html

[4] https://www.openhub.net/p/firefox/analyses/latest/languages_...

smitherfield··on Work on SQLite4 has concluded
No, it was Mozilla who killed it[1] over Apple and Google's strong objections.

[1] For pretty much complete nonsense NIH and standards-lawyering reasons.

smitherfield··on Apple at Its Best
Well, for mouse ergonomics Steve wasn't your guy; he's the one who insisted on the "hockey puck" design[1] for the original iMac's mouse.

[1] http://cdn.cultofmac.com/wp-content/uploads/2014/03/hockeypu...

smitherfield··on The Lost Art of C Structure Packing
You're thinking of `#pragma pack`. `-Wpadded` just warns about non-optimal layout.
smitherfield··on Colliding neutron stars falsify some theories of gravity
I am almost certainly just talking nonsense, but it seems to me if the light-emitting universe is on one side of a flat plane and dark matter is on the other, the physical distance between the light-emitting universe and dark matter could be 0.
smitherfield··on Colliding neutron stars falsify some theories of gravity
We're at the very edge of the event horizon and so is dark matter, just on the other side.
smitherfield··on Colliding neutron stars falsify some theories of gravity
Clickbait title, but interesting article.

I Am Not a Physicist, so I need a real one to explain why I'm wrong, but I've thought for a while the cleanest explanation for dark matter is

1. The universe is inside a black hole.

2. Dark matter is matter which is outside the black hole, which explains why it has mass but no other observable properties.

smitherfield··on Dynamic Progamming: First Principles
NB: Although the ES6 spec requires TCO, it turned out to present significant implementation challenges, so it's only implemented in WebKit (Safari), and is, IIRC, marked WONTFIX in V8 (Chrome, Node), SpiderMonkey (Firefox) and Chakra (Edge). There's a good chance it'll get removed from a later edition of the standard.
smitherfield··on Anti-aging stem cell treatment proves successful in early human trials
Heads of state tend to have staffs watching them all day, so they don't fall and break their hips, and drivers so they don't get into car accidents, and they get immediately rushed to the hospital every time they have even so much as a cold. That's why (US) ex-presidents are now routinely living into their 90's (and longer?).
smitherfield··on C++17 Is Here: Interview with Herb Sutter
Faster[1] than Java (glacial, albeit with warmer weather recently) or C (continental drift), slower than Swift, PHP (which truly has become a "kitchen sink" language equal to C++'s reputation for the same) or Python, about the same as Javascript.[2]

[1] By which I mean the languages themselves and minimally-conforming standard libraries rather than ecosystems or quasi-standard libraries like J2SE (Java), Cocoa (Swift) or the browser DOM (Javascript). C++ has a fairly slow-moving (but mature) ecosystem and its "quasi-standard" libraries (Boost, common compiler extensions, Windows and POSIX APIs) aren't as tightly-coupled to the language as the previous three examples.

[2] Both hindered by standards-body bureaucracy and the need to keep backwards compatibility with mistakes, but both popular enough that bigcorps are incentivized to keep things moving along; Javascript is more popular but that's offset by C++'s more efficient de facto process for standards-tracking library improvements (get them into Boost first).

Javascript actually probably moves a bit faster but Internet Explorer compatibility (still likely to be relevant for another 5 years or so) is an even bigger drag on adopting bleeding-edge features than waiting for (your company adopting) new Visual Studio/CentOS GCC/[Some embedded architecture] GCC versions is for C++.

smitherfield··on C++17 Is Here: Interview with Herb Sutter
Another reason to prefer `new`/`delete` over `[std::]malloc`/`[std::]free` (and `std::vector` over `[std::]realloc`) is that `malloc`/`realloc`/`free` don't call constructors and destructors, which means using them with non-POD types is UB (more concretely, you'll get bugs if the constructors or destructors manage some resource like a mutex, heap allocation or file handle).

As for outdated stuff in the standard library, that's something that affects every language as it ages. `map`/`set` aren't, IMO, the worst offenders; they were misleadingly-named (like `std::endl` and `std::move`), but RB-trees are a useful data structure, and while they are slower than hash tables (`unordered_map`/`unordered_set`) for the typical map/set use case, it's not like they're buggy.

The one that IMO most cries out for replacement is `[std::]rand` (inherited from the C standard library), whose RNG is abysmally low quality/predictable, very slow, and thread-unsafe. C++11 did introduce a new RNG API[1], but it's quite cumbersome and verbose to use, when they really need to introduce a simple API like BSD/Mac `arc4random_uniform`[2] so people will stop using `rand`.

Edit: I see that this is being addressed, although it didn't make it into C++17.[3]

While not buggy, iostreams are also getting a bit long in the tooth and could stand to be replaced with a more modern API, the iterator APIs (in the <algorithm> and <numeric> headers, etc) should also be methods on STL types, and `std::string` isn't quite deprecation-worthy, but it would be nice if the STL were augmented with a state-of-the-art encoding-aware string implementation like Swift's. And it would be nice if the STL acknowledged the existence of the internet (with high-level libcurl-like functionality in addition to the very low-level Networking TS).

[1] http://en.cppreference.com/w/cpp/numeric/random

[2] https://www.unix.com/man-page/freebsd/3/arc4random_uniform

[3] http://en.cppreference.com/w/cpp/experimental/randint

smitherfield··on C++17 Is Here: Interview with Herb Sutter
I'd pretty strongly disagree with the notion that stack or static-allocated arrays (especially `std::array`) aren't idiomatic C++; rather it's (unnecessarily) allocating everything on the heap that's the anti-pattern, since it defeats the whole purpose (fast, fine-grained, deterministic memory model) of using C++ in the first place. (And implies lots of memory leaks and global state).

Also, `new`/`delete` aren't unidiomatic when strictly adhering to RAII and

- Writing exception-safe code (with the `new (std::nothrow) T` form).

- Writing custom smart pointers or data structures, or high-performance containers (especially with C++17 aligned `new`/`delete` and C++14 sized `delete`).

- Using memory pools (with placement `new`/`delete`).

`[std::]malloc`/`[std::]free` aren't necessarily unidiomatic either, such as

- When using a C API (or one in pre-standard C++ or a third language) which is incompatible with `new`/`delete`.

- When you need `[std::]realloc`, and for whatever reason a `std::vector` isn't an acceptable substitute.

- In embedded or other environments that don't provide a STL.

smitherfield··on Tesla Strikes Deal With Shanghai to Build Factory in China
They don't as of yet, at least not in any real sense.

[1]: > Around the three-minute mark someone asks how many automakers have taken Tesla up on the offer to use its patents, and Musk notes:

>>> Musk: We actually don't require any formal discussions. So they can just go ahead and use them.

>>> Reporter: Is there a licensing process?

>>> Musk: No. You just use them. Which I think is better because then we don't need to get into any kind of discussions or whatever. So we don't know. I think you'll see it in the cars that come out, should they choose to use them.

Sounds nice, but no legal department on Earth is ever going to approve of deliberately using another company's patents without an explicit licensing agreement, no matter what non-legally-binding statements that company's CEO has made. As a sophisticated businessman, Musk is well aware of this fact.

[1] https://www.techdirt.com/articles/20150217/06182930052/elon-...

smitherfield··on HolyJit: A New Hope
This is a good point, despite the downvotes. (Although, on the subject of avoiding offensive terminology, I'd perhaps have avoided the "people also have a right to be idiots" part).

I've recently been reading Ogilvy on Advertising[1] by David Ogilvy, one of the most successful 20th-century figures in the industry, and while it's a bit dated (it was written 30 years ago) and, obviously, the subject matter is advertising, it's filled with excellent advice that's just as useful in all professional and personal contexts.

One aside that jumped out at me was "While we are on the subject of taste, I deplore the current fashion of using clergymen, monks and angels as comic figures in advertising. It may amuse you, but it shocks a lot of people."

I had honestly never really thought of it that way, but it's true. Religious people (that is, most people) find it hurtful and disturbing when you mock their religious faith. That might not be your intent, but it's kind of like 10 or 20 years ago when people used to explain that "by f-- I don't mean gay, just stupid." Just because you don't think or don't know what you're saying is hurtful does not mean that others aren't hurt by it.[2]

If Mozilla had used terminology in their software that was offensive to women, or gay people, or non-Western religions, I'm sure they would alter it, and rightly so. If they called a copy-on-write library HolyCOW, and Hindus said they were offended by this name because it mocks their religion, I'm sure Mozilla would, rightly, change it. And they probably know enough not to use such a name in the first place.

Of course, "holy" is not a specifically-Christian term, but a concept shared by all religions, Western and non-Western alike. A devout Catholic, Muslim, Buddhist or Jew is equally likely to feel hurt and excluded when they see you comparing their beliefs to shit.[3]

As for the other half of the name, the profanity ship has sailed in the broader culture and especially hacker culture, but it's also true that many people don't feel the same way, and nearly all of these people are deeply religious. I think it's reasonable to expect that religious people in the open-source community ought to accept that you or I will sometimes say "shit" for humor or emphasis, but it's also reasonable for them to expect we'll meet them halfway by not making them the butt of our jokes.

There are plenty of equally-funny "JIT" puns that don't come at anyone's expense; "GoodJIT," "JITHappens," "JIT'sTheBomb," and so on. I recommend using one of those.

I'm not a prude. I wouldn't scold you for saying "holy shit" (or "holy cow") in a conversation with me. I haven't scrubbed those phrases from my own casual vocabulary either. But, if someone told me I'd offended them, I would apologize and probably feel bad the rest of the day, just as I imagine almost any of us would. When you're participating in the open-source community, your audience is mainly strangers, with many different beliefs and backgrounds, whose first impression of you[4] is formed by what you've written on the internet. So it doesn't hurt to be a little more careful.

[1] https://smile.amazon.com/gp/product/039472903X/

[2] Hearing that speech a few hundred times, and maybe even giving it a couple, certainly didn't make high school easy for closeted me.

[3] Not that we shouldn't try our best to avoid needlessly causing offense whether it's to one group or many.

[4] And not only you, but the organizations, projects and communities you are involved with.

smitherfield··on The Soviet Union’s Flawed Rival to Concorde
The last one might be a pun.
smitherfield··on An Interview with the Creator of Ruby (2001)
> However, I don't think i'd feel comfortable with a language that only allows object-oriented programming

Ruby is multi-paradigm; in particular it's easily the most "functional"-feeling of the major scripting languages.

> and moreover OOP of the old way (a method must be tied to only one object. This is what prevents me from going to Smalltalk, btw.)

I'm unsure what you mean by this. Ruby has one of the most flexible OOP systems in existence, a good deal more flexible than Python's, and lets you create more or less any conceivable relationship between methods and objects. (Which is why Ruby is slow).

> Additionally, the MRI is perhaps the slowest implementation of a dynamic language out there (besides "R"). I know there are alternative implementations; is there any implementation that is significantly faster (at least as fast as Google V8 for ECMAScript) and that supports the full Ruby language without compatibility issues?

Ruby's not fast, but it's improved quite a bit from the 1.8 days. It's comparable to Python.

As for high-performance alternative implementations, there's TruffleRuby,[1] but it still has compatibility issues and isn't ready for production use. There's also Crystal,[2] which is a very similar (but incompatible) compiled language with performance on par with Go/Java/Swift. It's also still in beta but they plan to have a 1.0 release by the end of the year.

[1] https://github.com/graalvm/truffleruby

[2] https://crystal-lang.org

smitherfield··on Killing the C++ Modules Technical Specification
Right. I haven't written any Java in a while so it slipped my mind.
smitherfield··on Killing the C++ Modules Technical Specification
Yes, but to get a reasonable string implementation you need

  {-# LANGUAGE OverloadedStrings #-}
plus lots of other ceremony.

(There's only one form of string literal in C++ too; the "s" and "sv" suffixes shown above are operators, not part of the literal).

smitherfield··on Killing the C++ Modules Technical Specification
> The fact that pointers automatically coerce into bools makes some sense in C but is an aberration for modern C++. It's just an example of a legacy "feature" pointing its ugly head to sabotage a modern C++ construct.

This is a rather odd complaint; I can't think of any programming language which has first-class support for nullable types, and where they aren't truthy/falsy, at least in conditional contexts. It's a pretty straightforward boilerplate-reducing idiom.

Did you mean to say builtin arrays coercing to pointers? (I'd agree that's probably the biggest problem with C and, by extension, C++).

Or did you mean `NULL` being an `intptr_t` in C++? That's the very rare C++ misfeature that doesn't come from C (where it's a `void*`), but at least C++11 `nullptr` fixes that.

smitherfield··on Killing the C++ Modules Technical Specification
> Do you know many languages where literal strings come with a big warning sign saying "probably not what you want, use this (rather opaque) alternative syntax instead"?

Haskell? Python 2?

(Also, C/C++ string literals are perfectly safe to use — they're guaranteed-null-terminated immutable arrays that implicitly convert to `string` and `string_view`; it's more that its safer in modern C++ for function parameters to be `string_view`/`string`/`const char(&)[N]` instead of `const char*`).

smitherfield··on Microsoft gives up on Windows 10 Mobile
iOS Safari has always supported Javascript and was never "reduced" in any meaningful way (that's the point of Jobs' demo) except that (as now) it didn't support Flash, and deliberately ignored onmouseover, :hover and other such features that don't work well with a touchscreen interface.
smitherfield··on Microsoft gives up on Windows 10 Mobile
I mean full-featured in the sense of end user experience. If you have any example prior to 2007 of a mobile browser rendering the full New York Times website perfectly,[1] I'm all ears. But as I remember the below link was, for good reason, the biggest "wow" moment of any demo Steve Jobs ever gave.

[1] https://youtu.be/RIRQg8AJxuw?t=41m24s

← PreviousPage 5 of 25Next →