HNHacker News
TopNewBestAskShowJobs

electrograv

2,952 karma · joined May 3, 2012

submissionscomments
electrograv··on M-16: A Bureaucratic Horror Story (1981)
It’s really hard to improve DI systems without compromise, and harder still (probably impossible) to do so without also breaking compatibility with other parts like chamber lugs pattern.

The KAC SR15 solves the bolt longevity issues, but now it’s bolt and barrel extension interface are not compatible with standard bolts.

The LMT MRP platform solves most of the other problems, but not as much the bolt issues. But similarly, the LMT MRP monolithic upper cannot be compatible with standard rails, because that’s exactly the point: to move way from the old brittle way of connecting the hand guard to the upper receiver.

KAC SR15 will last upwards of 50,000 rounds without needing replacement parts, but externally it’s no more physically durable than a standard AR.

LMT MRP is among the most solid and sturdy AR out there, with virtually no way you’re going to break it if you throw it around, drop it, and otherwise abuse it. But internally, it will only last marginally longer than a standard AR before needing replacement parts to keep running reliably.

electrograv··on M-16: A Bureaucratic Horror Story (1981)
> Of course, you could easily make a rifle based on the Stoner action that has none of these problems - there are more exotic AR variants and accessories that solve one or the other, you'd just need to combine all those solutions. But I don't think it would count as an AR at that point.

I suppose that’s fair to say, but my mental taxonomy still considers the Knights Armament SR15 and LMT Monolithic Rail Platform to be AR’s. It seems like one could make a pretty strong argument for the SR15 at least, since I believe it was partly designed by Eugene Stoner. Then again, it is also the least compatible out there given the completely proprietary bolt design.

But that SR15’s proprietary bolt design by all accounts solves the bolt longevity issues, and the LMT MRP solves the rail and interfacing fragility issues. But you’re right that I don’t think there’s any single AR that solves both simultaneously. LMT’s BCG is improved but I don’t know that it solves the problem as well as the SR15.

I’m not sure it’s fair to hold the stock mortaring situation against the AR, since this same issue appears in virtually every collapsible polymer stock design. It only is not a problem with fixed stock designs, independent of whether they’re an AR or not. I believe the FN Scar for example received a lot of criticism for its stock being considerably more fragile than even standard M4 stocks.

Also, I’ve never heard of dust in the magwell being an issue as long as standard practices like keeping a mag in place in dusty/dirty environments are used. In fact, more often I’ve heard of issues with polymer AK mags breaking, since the AK mag design essentially offloads the rigidity and durability problems to the mag rather than the rifle. This could be a good or bad thing in some ways, but I think everyone agrees it increases weight too much when you need steel mags. Example: All modern designs use enclosed magwells and polymer mags.

In any case, I’d be inclined to concede to you that ARs don’t last as long as other designs (without replacement parts every 5-10k rounds or so). And it certainly makes sense too when just dry running the action: compare the locking/unlocking cam action on an AR, vs a modern piston design like a Steyr AUG, FN Scar, CZ Bren, etc. and it’s so obvious how much less violent the forces are on the bolt as it locks/unlocks considerably slower and smoother on these more modern designs.

P.S. Fun fact for interested readers: All these “more modern” designs I mentioned are all descendants of Eugene Stoner’s AR18 design (which is itself a descendent if others though, of course). The influence of Stoner’s design in modern rifles is impressively prolific. If you want to learn more fascinating trivia, I recommend the YouTube channel “Forgotten Weapons” which is incredibly educational.

electrograv··on M-16: A Bureaucratic Horror Story (1981)
It depends how you define “best”; by most definitions, it very much is the best, simultaneously across a wide range of categories (I cover its one caveat below too):

Modern variants of Stoner’s design happen to be the lightest weight, smoothest recoiling, most accurate (by a factor of 2-10x), most upgradeable and customizable, and arguably most ergonomic rifles in the the world right now — with no exceptions that I know of. (Incidentally, this is why the AR15 is the single most popular owned firearm in America.) Please feel free to provide any counterexamples in these categories; I don’t really know of any, and I’ve studied this quite a bit.

Most of its excellent performance is due to the direct impingement operating system, which as others have described keep the recoiling mass inline with the barrel (which means the recoil is pretty much entirely linear without any torque, which is virtually impossible to achieve with durable piston designs).

This unique gas operating system design also minimizes the overall weight, because the DI’s compact design eliminates the need for a separate piston / op rod assembly (which in piston operated military designs, must be fairly heavy duty, or else they will break rather rapidly from the violent forces involved). Some say it also explains the extremely high accuracy of the design, by avoiding a heavy reciprocating mass from moving alongside the barrel with each shot, as in a gas piston design.

Thus, this inherently light weight design permits you to choose either (1) a lightweight barrel yielding an overall weight significantly less than any of its competitors, or (2) use heavier and longer barrel which, despite yielding an overall weight matching the “lightweight” version of competitors, far, far exceeds their accuracy capabilities.

It really is a remarkably well engineered system, when you realize that most of the early reliability issues were due to feeding it the wrong ammo (which it was not designed for) and other easily avoidable embarrassing mistakes of mismanagement.

The only real disadvantage again comes from the direct impingement system, which causes the operating mechanism to get dirty and fouled up with burnt powder residue really really fast, whereas gas piston designs (used by virtually all other guns) pretty much stay clean and smoothly running even if you abuse them by never cleaning or maintaining them. There is something to be said for that, especially for military purposes: that is for example one reason why the AK was so successful; it just works. You can and should maintain it, yet if you don’t, it will still work reliably.

So this is just about the only area in which other guns beat out the M16/M4/AR15; while it’s reliability is pretty much on par with any competitor, this remains true only as long as it’s kept cleaned and oiled etc. fairly regularly, especially if it’s used in dirt dusty environments.

That said, the difference may not be as extreme as pop culture makes it out to be: A quality built M16/M4/AR15 will keep functioning for probably at least 5k rounds without any cleaning, before it starts jamming, and some extremely high quality civilian models have been known to go far longer than this in extreme “torture tests”.

electrograv··on DeepMind and Google: the battle to control artificial intelligence
Apologies in advance for the meta-comment (feel free to disregard) about this:

> [Opening Paragraph of Article:] One afternoon in August 2010, in a conference hall perched on the edge of San Francisco Bay, a 34-year-old Londoner called Demis Hassabis took to the stage. Walking to the podium with the deliberate gait of a man trying to control his nerves, he pursed his lips into a brief smile and began to speak: [...]

Am I in the minority, when seeing this writing style (for articles covering this kind of content) becomes an instant turn-off?

When an article covers a technical subject or company, I don’t really care whether a founder had an awkward nervous walking gate, or that the conference hall was “perched” on the edge of the SF bay.

In fact, I’d prefer not to focus on such superficial things about people (or places), at least until I exhaust learning about the facts with substance!

So when I read about something like AI (or an AI company), I tend to want to see fact-oriented, event-oriented, concise writing up front (even if it doesn’t have the scope to dive into technical details), so as to grab my attention and reassure me that reading these 10-20 pages of prose will be worth the reading time (in a world of overwhelming information overload).

When I read science fiction (and I do love this too!), I enjoy the paragraphs setting the scene, verbally illustrating mental images, etc. So, it’s not that I don’t enjoy the writing style in general; just that I don’t understand why it’s applied here.

I am still reading this article and I still have no clue if it’s going to contain any useful information content other than textual descriptions of the Deep Mind founders’ superficial walking gate style and speech mannerisms, and perched-ness of various building locations.

electrograv··on Firefox Send: Free encrypted file transfer service
The conspiracy theorist in me wonders if Google simply wants to maximize the use of their servers here (independent of what users want/need):

1. P2P doesn’t give Google all that juicy mineable data that they get when everything you do makes round trips through their servers.

2. This would also implicitly encourage Android users to rely more on services like Google Drive/Docs for all files, which is good for them.

Edit: Apparently it is disputed that iOS has superior P2P file transfer support vs Android (see reply below), so perhaps all this is a moot point. I was assuming the truth of the parent post, and didn’t realize it was contentious; and since I’m not an Android or iOS expert, I can’t really argue that topic either way.

electrograv··on Nadella: Microsoft will sell war tech to democracies to “protect freedoms”
I don’t perceive anyone here to be claiming that war is good.

Rather, we simply don’t know of any viable alternate to the existence of defensive militaries, right now: So long as human aggression exists, those unable or unwilling to defend themselves against forceful attacks will inevitably be stomped out of existence.

This is why to sustain a peace-loving society, that society need to be capable of exerting physical force defensively if need be, even if that capability is never actually used (in fact, to have the capability but never use it is the ideal goal).

Pure pacifism only exists in a bubble of ignorance to the existence of the military and police that are already there defending it, or by pure chance that no aggressor has yet stomped over it. As such, it’s certainly not real pacifism, unless you also make sure to move to a part of the world where there’s no police or military defense forces. These are hard to find, because where and when they exist, they do not exist for very long except for extreme good luck (like geographic isolation).

Maybe some day, humanity’s groups will figure out a better solution to aggressive behavior than everyone holding metaphorical guns to each other’s heads, but it doesn’t look like we’re anywhere near there yet. Remember — all it takes is one aggressor to stomp all over a world of pacifists, so local solutions here do not work, or if they appear to work, it will only be momentary.

electrograv··on SIMD Instructions Considered Harmful (2017)
For those who don’t get the title reference: ”[Programming Pattern] Considered Harmful” is a title meme that began in 1968 — over fifty years ago — and still going strong today!

It all started with the famous Edsger Dijkstra paper titled “Go To Statement Considered Harmful” [1], which lead to an endless series of subsequent papers later patterned after its title [2].

I agree with the sentiment that this title pattern is overused currently, to the point of being cliche — with perhaps a bit of presumptuousness as well, due to the implicit suggestion that the author’s claim of “Considered Harmful” will withstand the test of time as well as Dijkstra’s paper (though perhaps I’m reading too much into it, in this case).

[1] https://dl.acm.org/citation.cfm?doid=362929.362947

[2] https://en.m.wikipedia.org/wiki/Considered_harmful

electrograv··on California will not complete $77B high-speed rail project: governor
> There is no law of the universe that says a multiplier must be greater than 1.0. It is entirely possible, and indeed, easy to build a piece of infrastructure that will never pay back.

Just because there’s no law of the universe that prevents you from throwing money down the drain, doesn’t mean you ought to do so.

electrograv··on US shutdown: Flight delays caused by staff shortages
Does this mean the airports experiencing a crippling loss of federal personnel could simply hire them onto their own payroll (the same people, even)? In such a case, all airports could keep functioning independent of government aid -- theoretically, anyway.
electrograv··on Nim in 2018: A short recap
> Caveat: for reference types, immutability is shallow (you cannot change the reference but you can mutate the reference content).

“Shallow immutability” is not just a “caveat” — it’s a complete abuse of the word “immutability”.

If you can in-place modify the interior of a so-called immutable value in any way (possibly excepting code within some kind of “unsafe” blocks), it is by definition not immutable. Immutability is a pure, all or nothing kind of thing.

That you are trying to present immutability as synonymous with C++ style “const”ness perhaps reinforces the parents’ post that Nim is not friendly or even aware of the functional paradigm of programming.

But unlike others, I think it’s okay that it doesn’t support immutable variables. It certainly doesn’t outright condemn the language. However, let’s not pretend it’s something that it’s not.

electrograv··on Rust 2019 and beyond: limits to some growth
I completely agree that complexity of edge cases, undefined behavior, and high combinatoric complexity between language features is a FAR more damaging kind of complexity (due to its nonlinear cost) than simple language feature count.

However, I disagree that simple language feature count has no cost: Assuming “linear cognitive complexity”, even such linear features do have a cost: Sure, you may not need to learn what a “const fn” is until you need it if you’re working only on your own project, but if you’re working on a team and/or with external libraries, the chances that you can get by without knowing the ENTIRE LANGUAGE diminish rather quickly with project size.

This is why even the least costly kinds of language complexity can still end up costing a lot in a large project containing a lot of code, dependencies, and developers.

electrograv··on Rust 2019 and beyond: limits to some growth
One can generate an informal spec from a formal spec.

One can NOT generate a formal spec from an informal spec (or else that “informal” spec would actually be formal, after all).

So, a formal spec is strictly better than an informal one — it enables all the benefits of an informal spec, via the ability to generate any number of informal specs from it in many human languages, cultures, levels of detail, etc., and of course enables things like compiler reproducibility (which you cannot do at all without a formal spec).

That being said, any spec is probably better than no spec.

electrograv··on Glitter bomb tricks parcel thieves
I know "theft traps" are not legal (even ultimately harmless ones, like the paintball idea mentioned above), but for some reason it feels bizarrely backwards (or ironic?) that a proportionately harmless response to a thief (caught in the act) would be more likely to see prosecution than the act of theft itself.
electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
If you use a language designed from the start not to need exceptions, this problem is solved: The code in fact looks very much like code that uses checked exceptions (in fact, another commenter even mentioned Rust’s type system is isomorphic to checked exceptions).

I have no problem with checked exceptions. Unchecked exceptions is another story, and forces you to “catch all” everywhere (most libraries don’t document every single possible exception of every single method).

In retrospect I don’t even know why everyone responded to my original post about focusing on software error handling as if I was attacking exceptions. I think unchecked exceptions and unchecked null pointers are bad, but that’s about it; and that’s not even what my top post was about.

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
And that’s how you get a culture where severe private data breaches and crashy code are the status quo :/

We can do better. Why don’t we? I guess the economical argument explains most of it. I think if more governments would start fining SEVERELY for data breaches (with no excuses tolerated), we’d see a lot more people suddenly start caring about code quality :)

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
Yep, that was pretty much my point :). I think it’s a dangerous precedent to follow (bad practice), but I’ve certainly been guilty of it on occasion.
electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
Designing out pitfalls is precisely what I’m talking about and arguing for — and that takes time (in an application of any sophistication), either because you’re using a language (like Rust) whose compiler nitpicks your code in ways that 99% other languages would just accept without complaint, or because you’re being equivalently paranoid in your design of every single core data type, interface, platform service, etc.

There may also be some disconnect here in the type of code we’re talking about. I’m talking about work on code that millions of people are relying on to be 100% rock solid. I don’t care if you’re junior or senior: when writing code at this standard of quality, caution and rigor are always part of the process (both by the author, and the review and testing process).

If you can write absolutely rock solid, 99.9999% bug-free code that handles every possible error case gracefully, while spending more than 50% of your total coding time spent typing new code (which apparently has no error handling) literally as fast as you can type, well... WOW!! Consider me impressed; It seems we all have a lot to learn from you. If so, I genuinely would love to learn more of this seemingly-magical process where you can write perfect code at maximum speed, while also not having to think about edge cases or other errors.

Anyways, back to reality:

The fact that so much of this caution associated with writing bug-free code is loaded onto human judgement right now is exactly why I’m such a strong advocate for languages like Rust and Zig that aim to move much of this cognitive burden into the compiler.

For example, let’s talk about designing out pitfalls: say I create an immutable data structure in C++ with a really efficient implementation (zero-cost copies, automatic memory sharing) that is virtually foolproof when accessed from multiple threads, used in computations, etc. No matter how foolproof I make this C++ class, I still can’t stop your “junior dev” from stomping over the end of another array into my class data, or using dangling pointers, etc. etc. etc.

We can enforce “safe” classes wherever possible, but that also runs up against the wall of reality when interoperating with other C++ code that has a different idea of what constitutes that “ideal C++ subset”.

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
> Good luck trying to find an unchecked return code.

We're talking about alternate programming languages that handle errors vs exceptions differently, so it's only fair if we consider a language designed from the start not to need exceptions.

So let's take Rust, for example: In Rust, it's not a matter of luck at all: You declare whether your return code may be ignored; if not, it's a compile error not to use it.

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
My argument: 'Exceptions should be exceptional', because exceptions are really just errors, that happen to be exceptional (rare)!

The reason exceptions tend to be overused is because the line between error and exception is blurry -- and it's blurry precisely because an 'exception' is really just a subset of errors. Unfortunately, most languages do not treat exceptions as a subset of an error, but as a completely disjoint/orthogonal thing, and that's the problem!

If we transitioned to languages that handle these concepts in a unified way (and ones that don't allow unchecked exceptions), this isn't a problem at all, and we can all happily write much more inherently reliable software.

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
> I disagree with your case, this is clearly an error because it should never get to dividing by 0. You MUST validate user input and user input validation failures are a class of errors not exceptions.

This is bizarre: it sounds like you're disagreeing with me, by agreeing with me (that this is an error, not an exception)! For the confused (myself included), please realize that lost953's argument is considered "begging the question" (a logical fallacy [1]): You're using your a-priori assumption that 'divide by zero' is an exception, to argue that what we really should be doing here is add an if-guard before the "actual divide" occurs, so we can return an error, instead of an exception!

Otherwise, thank you for conceding that exceptions are just a category of error :)

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

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
> Clarification please--are you suggesting the programmer can anticipate all reasonably likely error conditions and implement handlers for each?

Absolutely, insofar as it is possible for a programmer to write their application in one of the several existing programming languages that can guarantee at compile time that there is no undefined behavior / exceptions / crashes / memory corruption. This concept is sometimes referred to as a "total function": a function that is defined for all possible input values, and in a language for which there is no way to invoke that function on an input not in its statically-declared domain.

Now, I'm not saying this is possible for all programs, particularly for certain kinds of I/O, but with a reasonable amount of error handling code and robust interfaces between that I/O device and your code, it's usually possible to get pretty close to perfection there too.

I'm also not saying it's easy. But I think this is precisely the kind of "hard" the software engineering industry needs more of right now; and languages like Rust and Zig and even Spark (Ada verifier) are a wonderfully refreshing move in that direction. Note: Not all of these languages I mention are 100% perfectionist either! What's important is they move significantly closer to perfection, and away from this 'cowboy coding' mentality of not really caring about errors/exceptions until they bite you.

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
I don't think this alleged distinction between exceptions and errors is as clear-cut as you imply. I think this distinction is purely a convenience; a line we draw to make our lives easier because we don't really want to accept that extremely rare error cases do exist and should be reasoned about despite their rarity.

For example, you listed as some examples of exceptions that are not error: Divide by zero, failures of memory allocation.

Let's say you write a calculator GUI and I try to divide by zero in it. Exception or error?

If I applied your advise, I would have to deem this an exception, and just "just note down what happened" or "die quickly" (your words)! That is quite obviously wrong, in this example.

The correct answer would be to feed some kind of error code to the calculator's output data path, which would eventually be displayed on the screen.

Sure, I'm sure you'll come back and say now "well it depends then, and whether you consider it an exception or an error depends on the application". If you say that, you are ceding my point, because that is precisely what an 'error' (not an exception) is: a condition that may in some cases be fatal to the application, and in some cases be a part of ordinary runtime behavior.

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
I'd agree that it's totally reasonable to 'hack together' a quick prototype with 'duct-tape and cardboard' solutions -- not just for startups, but even in full-scale engineering projects as the first pass, assuming you intend to throw it all away and rewrite once your proof-of-concept does its job.

The problem is that these hacky unstable unreliable solutions sometimes never get thrown out, and sometimes even end up more reliable (via the testing and incremental improvement methods you mention) than a complete rewrite would be -- not only because writing reliable software is hard and takes time (beware the sunken costs fallacy here!), but because sometimes even the bugs become relied upon by other libraries/applications (in which case you have painted yourself into a REALLY bad corner).

It's a balance, of course. You can't always have engineering perfection top-to-bottom (though I would argue that for platform code, it has to be pretty close, depending on how many people depend on your platform); if you shoot too high, you may never get anything done. But if you shoot too low, you may never be able to stop drowning from bugs, crashes, instability, and general customer unhappiness no matter how many problem-solver contractors you may try to hire to fix your dumpster fire of code.

So again: Yes, it's a balance. But I tend to think our industry needs movement in the "more reliability" direction, not vice versa.

electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
If you're interested in alternate languages along the lines of 'C with metaprogramming' (and without the bad stuff C++ forces you to deal with in some cases), you may enjoy taking a look at Zig (https://ziglang.org/) or Rust (+ RAII).
electrograv··on Why should I have written ZeroMQ in C, not C++ (2012)
It seems all too often we (coders) are encouraged to think of errors as these exceptional things that happen rarely; deserving only of a few cursory preventative treatments to the code -- or worse, treated as something only to be fixed lazily, as bugs and crashes surface during testing. Indeed -- this philosophy is ingrained into a significant percentage (if not the majority) of the programming languages we use!

On the contrary, I believe we should expect to spend the majority of software engineering time writing and thinking through error-handling code, before even your first test[1].

I'd even go so far as to say: If you're not spending at least half your time on so-called 'error handling', you're probably doing something wrong, like using a language feature (like exceptions) to defer that technical debt to later -- and you'll regret it, if your project matures, I assure you.

This is why I so greatly appreciate languages like Rust and Zig[2] which remove exceptions and unchecked null pointers from the language entirely (with few edge-case exceptions), and provide a powerful and robust type system that allows us to express and handle error conditions naturally, safely, and elegantly.

[1] To be clear, by no means am I downplaying the importance of test code, or even manual testing; rather, I'm arguing that purely "test driven development" is not sufficient to yield extremely robust software of significant sophistication.

[2] These aren't the only examples, but they're among the only that aim to be C++ (Rust) and C (Zig) replacements, that also made the "right" design choices (IMO) in removing both exceptions and unchecked null references.

electrograv··on Google transferred ownership of Duck.com to DuckDuckGo
The most important thing for a brand name like this to be is:

  1. Simple to remember and easy to pronounce.
  2. Unique and stands out from other generic names.
  3. Aesthetically sounds/looks good.
Under this criteria: "Google" works. "Bing" works. "DuckDuckGo" does not work.
electrograv··on Google transferred ownership of Duck.com to DuckDuckGo
Oh, I'm fully familiar with the game it's referring to. I just don't understand the connection between a serious search engine and a silly child's game.

Is it some kind of inside joke? I just don't get it. I have nothing against the child's game; it just makes no sense to anyone that they named it after that, and it's not an easy name to pronounce or type. Bottom line: It sounds, feels, and looks bad on them.

electrograv··on Google transferred ownership of Duck.com to DuckDuckGo
I love DuckDuckGo and use it on all my devices, but, WOW what a horrible name/branding. What were they thinking?

Every time I mention/recommend it to someone the response is always a blank stare followed by something along the lines of “I would never use that if only to avoid that horrible name / brand URL”. And I can’t say I blame them.

electrograv··on Google transferred ownership of Duck.com to DuckDuckGo
Also, rather than saying “Google it” maybe we can now say “Duck it”.
electrograv··on Amazon’s Chips Threaten Intel
> It's hard to see Amazon transitioning their AWS machines to Amazon built chips

As a strategic move, this makes a lot of sense for Amazon. Moreover, Amazon is a company known for excellence in a diverse set of disciplines, and TSMC has an excellent reputation for delivering state-of-the-art CPUs at scale — yet you are here to doubt they can pull it off, despite providing no evidence or rationale for your position?

The burden of proof is on you to justify your pessimism. If you have evidence for your claim that Amazon + TSMC will have problems scaling, please provide it.

← PreviousPage 5 of 13Next →