Open-sourcing Sorbet: a fast, powerful type checker for Ruby - <AUTHOR> https://sorbet.org/blog/2019/06/20/open-sourcing-sorbet <comment><USER2> It's been funny to watch how more and more static type systems are getting bolted on to dynamically typed languages in recent years.

Typescript (with stellar adoption), native type annotation support in Python, Sorbet, PHP 7, Elixir + Dialyzer, ...

I wonder why there isn't a popular gradually typed language that natively allows writing both dynamic and type-safe code, allowing quick prototyping and then gradual refactor to type safety.

I guess in part because it's a big challenge to come up with a coherent type system that allows this, the bifurcation in the ecosystem, and often a somewhat leaky abstraction. Eg in Typescript you will often still run into bugs caused by malformed JSON that doesn't fit the type declaration, badly or insufficiently typed third party libraries, ....

Google's Dart is the only recent, somewhat popular language (only due to Flutter) that allows this natively - that I can think of right now.

I do think such a language would be very beneficial for the current landscape though, and projects like this show there is a clear need.

Edit: just remembered another option: Crystal. Also Julia, as pointed out below.

<comment><USER3> For whatever it's worth and without wanting to start a language war (I like Python just fine), I think Python/Ruby-style typing is a false economy for prototyping. There are a lot of things that make Go slower to write than Ruby, but mandatory typing isn't one of them. Rather, Ruby's total lack of typing makes it _harder_ to write: you effectively end up having to write unit tests just to catch typos.

I wonder whether the perception that type safety slows down Ruby (or ES6) development comes from the fact that the type systems are bolted on after the fact.

<comment><USER4> I've never quite understood the notion that languages like Python and Ruby are amenable to fast prototyping. Ultimately, you wind up just having to carry complicated type information in your head rather than write it all down in your code, all whilst the compiler utterly fails to help you in any way in case your memory ain't what it used to be.

I'm sure those languages and their ilk have advantages for prototyping, but I agree, mandatory typing in other languages isn't a burden. If you already have to reason about what arguments are acceptable in functions, what objects can receive what messages and what those messages should contain, you already have typing — just inefficiently stored in short term memory.

Those who are the biggest proponents of these languages as useful for prototyping are also _not_ the ones who rewrite their code in type-safe languages, so being able to add type annotations for the sake of their colleagues who eventually have to turn these prototypes into code upon which a team can collaborate can only be a useful thing.

<comment><USER5> > _I 've never quite understood the notion that languages like Python and Ruby > are amenable to fast prototyping._

I've thought about this for a while and I think the "fast prototyping" reputation is an accidental feature that sticks because of history.

Python and Ruby were just better languages than Java 1.4, C++, Perl and PHP were at the time. They were so much better for not only prototyping, but writing - it was easier to get something working and iterate in Python than it was in Java. And not only were they better, they were better at the _right time_ when the internet exploded.

Now, it largely feels like languages like Java and newer languages like Go have caught up, but Python and friends still enjoy the feature of "fast prototyping." Now I think this is because since they had gotten so popular, they now have a massive ecosystem of libraries and idioms that makes it so easy build applications.

<comment><USER6> Java and Go today are much better to work with than Java was in, say, the early 2000s, but to realize the productivity boost of a dynamic language within a statically typechecked language, you need type inference and a REPL.

You still don't get this with Java or Go, but you certainly do with ML-like languages (Haskell, SML, OCaml, F# etc.)

A lot of Haskell developers will tell you that writing Haskell feels a lot like a functional Python, and they use Haskell for scripting as well as application development.

<comment><USER7> Until Java gets data classes it will make you miserable. Lambdas are clunky in Java at best. "Much better to work with" than Java 1.3 is setting a pretty low bar.

<comment><USER8> > Until Java gets data classes it will make you miserable.

[https://projectlombok.org/features/Data](https://projectlombok.org/features/Data)

</comment></comment></comment></comment></comment></comment></comment><comment><USER9> A fascinating part about Sorbet is it did not have to introduce any additional syntax to Ruby (unlike TypeScript, for example). This really speaks to the expressiveness of Ruby. Very cool.

<comment><USER10> Was that additional syntax in TypeScript actually _neccessary_ for type inferrence? Or is it rather to avoid API hazards when you change some internal code and suddenly the API of your library breaks because the inferred type has changed.

<comment><USER11> You can use TypeScript in a mode that only uses type inference and doesn't require type annotations or definitions. It works surprisingly well.

<comment><USER12> Additionally, TypeScript will parse JSDoc comments into type annotations: [https://www.typescriptlang.org/docs/handbook/type- checking-j...](https://www.typescriptlang.org/docs/handbook/type-checking- javascript-files.html#jsdoc-types-are-used-for-type-information)

</comment></comment></comment></comment><comment><USER13> Coincidentally, I announced the beta version of a Ruby type checker in Solargraph two days ago: [https://github.com/castwide/solargraph/issues/192](https://github.com/castwide/solargraph/issues/192)

It has a few overlapping features with Sorbet, with one major difference being that Solargraph type checking relies on YARD documentation instead of annotations.

<comment><USER14> Love the work you're doing on Solargraph! Thx for it.

</comment></comment><comment><USER15> > To enable static checking with srb, add this line (called a sigil) to the > top of your Ruby file:

> # typed: true

Isn't this called a directive/pragma? A sigil is a symbol on a name.

Either way, I'm excited to see this finally out after seeing the past presentations on it.

<comment><USER16> Thanks for pointing that out. It can be called all of those. We liked sigil from its connotation:

> Google defines sigil as, "an inscribed or painted symbol considered to have > magical power," and we like to think of types as pretty magical

[https://sorbet.org/docs/static#fn1](https://sorbet.org/docs/static#fn1)

<comment><USER17> That's a pretty unintuitive use, since "sigil" is more commonly used (in programming languages) as a single _symbol_ , as in a non-alphanumeric character that's used as some kind of syntax.

[https://en.wikipedia.org/wiki/Sigil_(computer_programming)](https://en.wikipedia.org/wiki/Sigil_\(computer_programming\))

<comment><USER18> Right so the $ in PHP or @ in Perl would be a sigil, (and even the $ and % in QBasic, am I dating myself?) and the # in this example and all C code and some Swift code would be a pragma. Seems pretty cut and dry.

<comment><USER19> And the $ and @ in _ruby_...

</comment></comment></comment></comment></comment><comment><USER20> Awesome work.

        sig {params(person: Person).returns(Integer)}
        def name_length(person)

Not sure if I dig the syntax. Furthermore arguments seems to be the official names for method arguments, not parameters. eg, `ArgumentError`. `params` also feels like it's linked to Rails `params` variable in controllers. It can be confusing.

Something like this will also feel more Rubyist:

        def name_length person: Person, return: Integer

But it probably requires a deeper hack or a change in MRI.

<comment><USER16> Thanks for the idea.

We used `params` because Method#parameters was what they called it in the standard library. I actually had it as `args` originally until someone pointed this out. [https://ruby-doc.org/core-2.6.3/Method.html#method-i- paramet...](https://ruby-doc.org/core-2.6.3/Method.html#method-i-parameters)

As for the syntax change, we are actually on our 8th iteration of the syntax. We really wanted this to NOT be a fork of Ruby so finding something compatible was very important. For example that's why it has the weird `sig {` syntax too, we didn't want to have to cause load-time and cyclic dependencies from adding type signatures.

<comment><USER20> > We used `params` because Method#parameters was what they called it in the > standard library

Super interesting. We should probably have being consistent for naming parameters vs. arguments in stdlib. It's too late though!

<comment><USER21> On a super pedantic level, "parameters" are the names that you write in the function definition, and "arguments" are the values you pass as parameters.

      def name_length(person)

      steve = Person.new
      name_length(steve)

Here, 'person' is a parameter, and 'steve' is an argument.

Most programmers use them interchangeably.

<comment><USER22> We called those 2 terms "formal parameters", and "actual parameters" if I remember my programming language concepts class from college correctly.

<comment><USER18> I've never been to programming college but in 10 years I have always heard them as def(parameters) and call(arguments). Probably a lot of that was when reading about how VMs and compilers work, though.

</comment></comment></comment></comment></comment></comment><comment><USER23> I've never understood the so called advantages of dynamic typing. To me it looks like a land mine in one's project waiting to blow at run time. And what for? Do developers code so fast that the time spent on typing something like "int i" will provide any real savings? Now vendors are trying to patch those with bolted on top syntax extensions/derived languages that need to be transpiled. What a mess.

<comment><USER24> When you're consuming JSON that has deep nesting, arrays that contain multiple types, etc. Something that may be two lines of code in a dynamic language could be as much as 100 lines in some static typed languages.

<comment><USER25> Sure, you could write one line of code to read it in as maps and arrays, but at some point you need to validate your input from the outside world to convert it you your domain objects. Using a dymically typed language doesn't magically make that problem go away.

</comment></comment></comment><comment><USER26> Related, Square wrote a great article: "RubyKaigi and the Path to Ruby 3"[0]. The section titled "Static Analysis" high level compares Sorbet to Steep

[0] [https://developer.squareup.com/blog/rubykaigi-and-the- path-t...](https://developer.squareup.com/blog/rubykaigi-and-the-path-to- ruby-3/)

<comment><USER27> It's my understanding that the Sorbet team is involved with bringing types to Ruby 3. I'm unclear on whether it will be Sorbet itself or if it's elements of it. Can't dig up the source right now, maybe someone can corroborate this?

<comment><USER28> This is true, we're part of a single working group that's working on types for Ruby3. [https://twitter.com/darkdimius/status/1119130004313350144](https://twitter.com/darkdimius/status/1119130004313350144) has some detail

</comment></comment></comment><comment><USER29> Though I haven't yet used it for anything in production, I think if I were starting something greenfield and wanted "Ruby with static types" I would go with Crystal. I really enjoy writing it and the performance you can get is quite a significant boost over Ruby.

<comment><USER27> I'd still go Ruby. A language's ecosystem and community are as much factors in why someone should choose or avoid it as its syntax. Both of those things are fantastic for Ruby — I'd argue that they're some of its best features, in fact. Crystal? Not so much.

<comment><USER29> I'm a long time veteran of Ruby and someone who deployed production Rails apps in EARLY v1. I absolutely love and adore it and it's by far my favorite language to work with. That being said, when I can write in a very stunningly similar language and get 10 to 100x performance with very little extra effort I am going to strongly consider it when deciding on my stack. Also the ecosystem for crystal is not terrible at all. I think it's a great project and shouldn't be ignored because "the ecosystem"

<comment><USER27> I also think Crystal is a great project that shouldn't be ignored because of its smaller ecosystem. The performance boost is nothing to sneeze at and I wasn't suggesting that Crystal's ecosystem is terrible, but it's nowhere near Ruby's.

EVERY problem has been solved in Ruby. (Edit: Every problem that isn't hamstrung by Ruby's technical limitations. It's certainly not the right tool for every job.) There's a gem or a blog post or a service for everything and it will probably work very well. The language is stable and predictable. It won't be as fast as we might want it to be but it'll probably work with minimal effort out of the box. You'll be able to put it into production with little to no fuss and it'll just work. If it doesn't just work, you'll have no problem finding resources to get it resolved. I don't think you can say any of that about Crystal.

Maybe that stuff doesn't matter for every individual or every project but for me, they're significant enough that I think they should come up whenever anyone tries to compare the two.

<comment><USER30> I'd agree with this. It comes down to the project and scope. For tasks where correctness is paramount it's hard to argue against Crystal, but for most apps, most of the time, Ruby and Rails are sufficient.

</comment></comment></comment></comment></comment><comment><USER31> I have mixed feelings about adding type annotations to an existing project. IDEs become easier to use, you can avoid certain bugs, refactoring becomes a bit less error-prone. But this comes at a cost: you need a very high type coverage, which means you need to rewrite a lot of code to deal with the different style of polymorphism. It's very likely that you end up with code that looks as if it were written in a statically typed language but without any of the performance benefits of such a language.

</comment><comment><USER32> Thanks for this. Major contribution to the Ruby community!!

<comment><USER16> Thank you! Ruby has been kind to us, we'd like to be kind back.

</comment></comment><comment><USER33> I'm interested in whether `.rbi` files are going to be the only official route for typing in Ruby, and if so, how that would end up impacting Sorbet?

<comment><USER34> It'd be nice to have an option to put that data inline.

<comment><USER16> Sorbet supports both formats. You can see the inline syntax on [https://sorbet.run/](https://sorbet.run/)

</comment></comment></comment><comment><USER35> Does anyone know what Matz thinks of Sorbet? He has previously been opposed to adding type annotations to Ruby [1].

This is in sharp contrast to Python, where Guido has overwhelmingly embraced type annotations.

[1] [https://bugs.ruby-lang.org/issues/9999#note-13](https://bugs.ruby- lang.org/issues/9999#note-13)

<comment><USER36> I saw some news saying that ruby 3 would have types built in.

</comment></comment><comment><USER37> I wonder what the reason for not supporting structural typing is. It seems like a very natural fit for Ruby.

<comment><USER16> We believe that the main goal of a typechecker is to give you nice error messages. We've found giving names to things makes it easier for folks to reason about their errors, and introducing names for interfaces isn't that onerous at Stripe or with our beta testers.

We aren't opposed to eventually support it, but we'd like to see how it goes with the current form first.

</comment></comment><comment><USER38> The "Getting Started" link at the bottom of the page is broke

[https://sorbet.org/blog/2019/06/20/docs/adopting](https://sorbet.org/blog/2019/06/20/docs/adopting)

<comment><USER16> Great find! Fixing now, thanks.

</comment></comment><comment><USER39> I've used contracts any time this type of thing was necessary. [https://github.com/egonSchiele/contracts.ruby](https://github.com/egonSchiele/contracts.ruby)

<comment><USER40> We use Contracts too and are in the process of transitioning to Sorbet. In addition to the same runtime type checking as Contracts, Sorbet offers static type checking (and will re-use your runtime signatures in its static analysis).

</comment></comment><comment><USER41> Excellent work! I wonder if somebody already tried to run it against Rails codebase.

<comment><USER42> Both Shopify and Kickstarter are on Rails.

I wonder why Github didn't join the private Beta?

<comment><USER43> Maybe their forked version of Ruby had something to do with it.

<comment><USER44> IIRC last time I poked at their enterprise image and dumped the code there were bits of custom type annotations. That was around 2-3 years ago.

<comment><USER16> The parser for Sorbet was actually entirely given to us by GitHub. They were fabulous partners early on in the project and we're grateful for their contributions.

<comment><USER43> Understated, but awesome! Thanks for the insight!

</comment></comment></comment></comment></comment></comment><comment><USER39> The dependency on bazel is very off-putting to me. After having tried it for other projects and watched as rapid breaking backwards incompatible changes were made to the tool, I'm opting out of anything requiring it.

<comment><USER28> We only use it at build time, as for a user, it should be invisible for you

</comment></comment><comment><USER45> I'm having trouble finding the implementation of `sig` - could someone please point me to the right file? Thanks. I'm very curious how they pulled this off.

<comment><USER46> Here it is:

[https://github.com/sorbet/sorbet/blob/master/gems/sorbet- run...](https://github.com/sorbet/sorbet/blob/master/gems/sorbet- runtime/lib/types/sig.rb)

As you'll notice, `sig` doesn't actually do anything.

<comment><USER45> So....then....how does Sorbet use the type signature provided to sig?

<comment><USER47> Sorbet has two components, broadly speaking: the typechecker, which is a standalone application, and the runtime, which is a Ruby gem. The typechecker can parse Ruby code and find the _sig_ blocks in the code to extract type information from them, and it then can use this type information to perform type-checking without ever loading a Ruby interpreter, to say nothing of the actual Ruby code in question. This is intended to happen in a CI pass or a pre-processing step, but it is entirely offline.

On the other hand, when you run your code, the _sig_ blocks may or may not be used. There's a lot of machinery in [https://github.com/sorbet/sorbet/blob/master/gems/sorbet- run...](https://github.com/sorbet/sorbet/blob/master/gems/sorbet- runtime/lib/types/private/methods/_methods.rb) that handles understanding what a _sig_ means and installing a wrapped version of a method that does type- checking on entry and exit. The intention is that the standalone _sorbet_ executable should be used during development, but it can't catch every error, so the runtime system will double-check types at runtime, which is especially helpful when some parts of your code are typed and other parts are untyped, and control flow passes back and forth between those sections: the runtime will ensure that you don't accidentally pass an object with an unintended runtime type into code with static type expectations.

</comment></comment></comment></comment><comment><USER48> I still wonder what problem exactly static typing fixes. Is is only me that I'm too used to dynamic tech without correctness issues?

<comment><USER49> Well one thing: when you work on enough code for long enough you start to forget what's/what. Static typing let's you jump in and immediately know the shape of your data at any point in the code, without having to re-trace execution manually

<comment><USER48> I know what you mean. I code in ways that compensate for that problem. Actually minimizing my need to remember anything but intentions. Smalltalk rewards that style vehemently for example. And I use Smalltalk and JavaScript in that style and I don't feel any less productive or particularly vulnerable to correctness issues. While in a TypeScript project I'm working I do feel a productivity hit (not in the good sense) and I (and my teammates) keep asking ourselves "what TS is helping us with, really"? So far the only thing I can say is that TypeScript is a fantastic solution for all the problems that it creates itself.

<comment><USER49> I'm genuinely curious how you code in such a way that compensates for the problem. I'm unfamiliar with Smalltalk but very familiar with JS/Typescript.

I'm sure that if tight-knit group held strongly to certain naming conventions, then you could convey structure through the semantics. My experience though has been that anything that relies heavily on "holding strongly to convention and form" falls quickly to business speed, forgetfulness, and laziness.

As a personal example, a couple of coworkers and I were working on a codebase in JS, and there was some function that helped manipulate user objects. There were however two types of user objects, that were _very_ structurally similar, but with slight variances. Because of the similarities, people started calling user functions with one type that were meant for the other type, and it would work. Future modifications would inevitably cause failures, as unexpected parameters were being passed in.

<comment><USER48> In point 10 here I've wrote about that [https://www.quora.com/What-is-your- review-of-Smalltalk-progr...](https://www.quora.com/What-is-your-review-of- Smalltalk-programming-language/answer/Sebastian-Sastre)

About the problem of "falls quickly to business speed, forgetfulness, and laziness" are you guys using peer-reviews with 4 eyes principle?

</comment></comment></comment></comment></comment><comment><USER50> Very cool stuff!

</comment><comment><USER51> !remindme in 1 month to check out Sorbet case study posts

</comment><comment><USER52> I really don't like the current movement of introducing static typing in dynamic typed languages. Why did we create dynamic typed languages after all? Because we know the pain of having to type everything and especially the pain of converting one type into another.

In C you mainly need static types because you cannot put 32 bits into a 16 bit CPU register, or you cannot do pointer arithmetic on values of different types, etc.. But that is not the reason why we want types in dynamically typed languages. We just want to prevent passing incompatible types as argument to a receiving method for example. And by adding static typing to dynamically typed languages we actually invalidate these languages entirely, full circle. First we create a dynamically typed language, then we change that into a statically typed language that transpiles back to a dynamically typed language, which is terribly inefficient, why would you want that? I have never been able to convince the proponents, they appear to be in some kind of higher state, having found the holy grail.

Almost all the benefits of static typing added to dynamic languages can be achieved by a better and smarter IDE. All these new 'typed' languages with all their own issues are only temporal I expect. We keep changing and rewriting while thinking we're doing it 'the right way' now.. Like Typescript, how long will that live? Flow is deprecated already. The very best thing of the C language is that it is still C, and that is fucking awesome for C developers, after all those years they can still write in the language they master.

<comment><USER53> > Almost all the benefits of static typing added to dynamic languages can be > achieved by a better and smarter IDE.

That does what? Typecheck things? You'd probably want a tool or library to do that, so it's pretty fortunate that Stripe bothered to provide those to us.

> We keep changing and rewriting while thinking we're doing it 'the right way' > now..

Humanity has yet to rescue type inference from the forges fire on Mount Olympus. After Milner tricked Hindley in a lunchtime debate about tabs versus spaces and code quality, Hindley punished us mere mortals by placing type inference in the fires of heavily recursive forges mortals dare not touch.</comment></comment>


World's First High-Performance Dress. No Wrinkles, No Stains, Extremely Durable - <AUTHOR> https://www.indiegogo.com/projects/main-first-high-performance-dress/x/20395365#/ <comment><USER2> I'm not sure that you can really see from the video what it looks like. I would consider buying this for my wife but the price is a bit high of she hates the design or look when she puts it on. I assume there is no return policy as it is indogogo.

<comment><AUTHOR> You can see more photos in section below on Indiegogo.

Also, we prepared secret -42% offer for you and your wife: [https://www.indiegogo.com/projects/2467160/x/20395365?secret...](https://www.indiegogo.com/projects/2467160/x/20395365?secret_perk_token=2b1f5cc1)

Thank you. Main() team</comment></comment>


Show HN: Programming in non-English languages - <AUTHOR> http://thesage21.github.io/pytongue/ <comment><USER3> I'm not native English speaker, but I wish people would just accept that English is Latin of computers.

I still have to come to servers installed in German or French and guess by memory where stuff are.

<comment><USER4> If you were curious about learning the guitar, would you first purchase the best 10,000$ guitar you could find at your local shop? No; you'd find some cheap guitar to play on initially to see if you could actually make a habit out of practising the guitar. Now if it turned out that you didn't like it, you have minimized your financial losses.

Similarly, some people don't know English. Maybe they're curious about programming. Should they have to learn a whole new _language_ first? Or be distracted by the fact that the foreign programming language they have to write is also written in a foreign natural language?

I'm not sure I even agree with your premise. It's a bit premature to worry about having to interact with code written by people that are just learning programming, isn't it? Like anything, when you empower people to learn things like this you have to trust them to have the decency to write programs in English in settings where there might be other people who don't speak their language that have to deal with their programs. Or trust that they wouldn't be hired for such jobs in the first place.

> I'm not native English speaker,

And? Does that give your argument more weight?

<comment> j-pb > And? Does that give your argument more weight? Yes because he is potentially > one from the target audience of this.

If somebody isn't willing to put in the tiny bit of effort to learn the tiny bit of english required for programming, they're not willing to put in the huge amount of effort that is required to learn programming anyways.

We have enough horribly documented code that needs maintenance, there is no need to add horrible documentation in hundreds of languages.

<comment><USER4> > Yes because he is potentially one from the target audience of this.

No, because he already knows English.

The proclamation "We should tax the rich less" is a self-serving sentence whether it comes from someone who was born into wealth, or it comes from someone who became rich later in life.

> If somebody isn't willing to put in the tiny bit of effort to learn the tiny > bit of english required for programming, they're not willing to put in the > huge amount of effort that is required to learn programming anyways.

I think you're coming from the viewpoint of "what would I do to learn programming if I had started from scratch today". But like I've argued, this is not a good view of the process of learning to program! It's more like you are vaguely interested in some discipline or skill, or might need it for something, and so you want to dip your toes in it. You have _no idea_ whether you will like it or not, or how far you will take it. To put up all these demands -- what they should learn and focus in order to in time become your ideal programming colleague -- is just _too much_ to demand of someone who is just exploring a new world to them and don't know where it will take them, if anywhere. How about they learn to actually put things like for-loops, if- statements and such together, before you demand that they should embody all the skills to write great documentation, use _best practices_ , and whatever else?

Just think of all the different things that are "bad practices" that even experienced developers can manage to do with a clear conscience. You can't pick one aspect and demand that a green programmer should have the personality and disposition to know beforehand that such things are "bad practices". People can learn and change.

But why even bother. These topics just devolve into downvote/upvote battles.

<comment> j-pb > No, because he already knows English.

And he didn't have to learn it at some point?

My english was pretty much nonexistent until I picked up programming.

Like I said below, nobody is arguing against beginner languages/tools like scratch and logo that could essentially be programmed in emoji, for what it's worth.

But people are arguing against "real" programming languages being translated, because that's a waste of everyones time.

</comment></comment></comment></comment></comment><comment><USER5> Fundamentally I think that the effort is flawed. Languages don't really map to each other on a word to word basis.

At school in France they introduced algorithms with a form of french pseudo-C which was very frustrating, because it felt stilted and unnatural.

Expressing the same algorithms in natural french would already be a much better exercise, because you don't have to force yourself through a fake translated language. Ultimately I think this would be a much better first approach to programming, (with more focus on design than implementation).

In the end if you really have to implement code, you will have to learn the english version anyway if you want access to documentation and outside help.

</comment><comment><USER6> Pfft - Hasn't PHP had error messages in languages other than English for years?

\---

Seriously though, I'm a bit surprised that people are so dismissive here of the need for having programming languages that use function/method/statement names that aren't in English.

Learning a foreign language _and_ a programming language is something that's pretty incredible as far as I'm concerned. I'm pretty lucky that English is my first language and that function, method and statement names are pretty descriptive given they are almost always written in my native language. If I had to spend a lot of time trying to memorise another language whilst also learning a programing language, I highly doubt I would have been able to do even 20% of what I can do today.

I mean, nobody speaks any language remotely like assembly - higher level languages exist because they're easier to understand and use, at least in part because they use a lot of English word to describe what's going on. I can't see any problem with more work being done on making more tools (transpilers perhaps?) for people who speak languages other than English. Heck, we've done some pretty awesome things transpiling to/from JavaScript lately, why not start transpiling from a variant of JavaScript that uses Arabic or Mandarin to the English variant of JavaScript?

</comment><comment><USER7> A few examples (perhaps HelloWord and Fibonacci) in other languages would be nice. From an informal statistic I propose German and French. (and I'd like to add Spanish, because I speak Spanish.)

<comment><AUTHOR> I added a sample example file and an example maker. Thank you for the feedback.

<comment><USER8> It would be good to have those examples also on the linked page, that presents the project, and not only buried in a folder, contained in the repo, stored on github.

<comment><AUTHOR> My mistake, corrected. Thank you.

</comment></comment></comment></comment><comment><USER9> Well it's not as easy as some of the posts here suggest, like all you need from English is "if", "for", "while" and little more. Don't forget about the libraries coming with each language. You'll also have to map "memcpy" to "memory" and "copy" and know those words, or understand what a "TreeViewItemCollection" is for, just to give two examples out of tens of thousands.

Said that, I think trying to localize programming just isn't going to work. If you want to program, you'd better get along with the English language.

</comment><comment><USER10> Nice, just one suggestion:

The languages are just dictionnaries: You should store them in an human- readable language instead of pickle. So it's easier for people to correct errors (json, yaml,..). For example, `FR_example.py` have "else" instead of "sinon" but to correct it I would have to open the pickle file and modify it in my terminal.

</comment><comment><USER11> Hey, that looks awesome! The implementation approach is really simple and that's cool for a prototype, however in order to work well for libraries and the standard library, we need to use the ast. If you want, I can make a pull request with an ast-based translation(I have a lot of experience playing with python's ast) ?

<comment><AUTHOR> Sure, would love that. Pull away!

</comment></comment><comment><USER12> Attaining a level of proficiency in "English" required for programming (keywors, mostly) is incredibly simple, if required at all. Just accept the fact that 'for' loops in some way. In mathematics, you will also have to learn what the uppercase sigma means, hell, they even use the greek alphabet!

</comment><comment><USER13> My database publishing system's programming language is both English and German. While programmers usually prefer the English interface, a rather large percentage of my users prefer the German one. (en: [https://speedata.github.io/publisher/manual/index.html](https://speedata.github.io/publisher/manual/index.html), de: [https://speedata.github.io/publisher/manual/index- de.html](https://speedata.github.io/publisher/manual/index-de.html))

There is also for example ConTeXt ([http://wiki.contextgarden.net](http://wiki.contextgarden.net)) - <USER2> typesetting language similar to LaTeX, which supports commands in English, Dutch and German.

</comment><comment> j-pb I don't really see the point of adapting the programming language to the learner, which seems to be the smallest language hurdle, when they'll have to ask for help in english on forums, in IRC, or on SO, anyways.

<comment><AUTHOR> Think third world. The kids in my village have a single computer without Internet. Sure they will need to learn English since almost the entire literature is in English, but they may yet taste the joy of programming first. It makes little sense for them to think in one language and write in another. But, I do see your point.

</comment></comment><comment><USER14> Related: [http://www.wikiwand.com/en/Non-English- based_programming_lan...](http://www.wikiwand.com/en/Non-English- based_programming_languages)

I was actually really fascinated by the idea of a Chinese C++ in all Chinese: [http://baike.baidu.com/view/1718420.htm](http://baike.baidu.com/view/1718420.htm)

</comment><comment><USER15> This is a good idea. There are tiny differences even between en-GB and en-US. 'Colour' is the most common one, with documentation calling '#' the "pound symbol" instead of £. The first programming languages I encountered were on the Sinclair Spectrum and BBC Micro, which being British used the British spelling of COLOUR in BASIC.

</comment><comment><USER16> This is pretty neat. I've not taken a close look at the implementation but I'll definitely do that (if it isn't a whole lot of effort could you please describe/document the design and approach taken ?)

I've had thoughts about solving this problem previously but never acted on it. My thoughts on this however were along the lines of providing the ability to re-define the keywords and builtins as part of the interpreter itself in such a way that even the prompt could accept non-english input.

Thinking about this is natural when one is Indian[1] and ends up working with some really talented people who have weak English skills simply because their primary education was conducted entirely in a non-English medium.

A lot of words used to express programming ideas are difficult for non-native English speakers to remember even if the ideas themselves are not (think abstraction, encapsulation, introspection, reentrant, idempotent ...etc) and the effort required to remember and use them correctly when communicating with other devs is higher (IMHO) for non-native English developers. Of course this is non an India specific issue, and of course English is the lingua franca of technology but that shouldn't be the barrier to entry for learning programming.

kudos on the effort once again !

[1] one country, and a multitude (22 according to [http://en.wikipedia.org/wiki/List_of_languages_by_number_of_...](http://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers_in_India) ) of 'official languages'

</comment><comment><USER17> As a Hindi and Gujarati speaker, the use of word 'chapp' for print is highly amusing.

<comment><AUTHOR> This was indeed intended.

</comment></comment><comment><USER18> The language itself isn't really the problem its the documentation and public resources surrounding it.

Having learned some japanese, I could see myself learning programming just the same so long as stack overflow and the various docs websites were English.

</comment><comment><USER19> English will always be a barrier to non-speakers when it comes to computing. This is great.

On a side note: is there any idiom-agnostic programming language? I only know that APL is.

<comment><USER20> I coded in a Brazilian Portuguese version of Logo at school. I remember there was also a Portuguese Portuguese version of the same toolkit. Both were called Megalogo.

On a related note, "idiom" in English does not mean the same as "idioma" in Portuguese ;-)

<comment><USER19> I meant idiom-agnostic as format-agnostic, collective, universal: like math, music, etc...

<comment><USER15> Music is not universal (different scales are in use), and maths uses Roman & Greek lettering with the Arabic number system.

</comment></comment></comment></comment><comment> mrfoo-de Nice idea - but I prefer english, even it is not my mother tounge.

But cool project - may be I can adapt it to another thing. :)

</comment><comment><USER21> Yay! Python in parseltongue!

<comment><USER22> All I see is a blank page - what am I doing wrong ? ;-)</comment></comment>


Magic Leap has lost another high-profile executive - <AUTHOR> http://www.recode.net/2016/12/14/13957478/magic-leap-andy-fouche-andy-rubin <comment><USER2> >And videos the company had distributed, which suggested they were made with the Magic Leap tech, were actually produced by a special effects studio.

Wow. They were claiming it was filmed through "Magic Leap Technology," but if it was really just CGI, that's grounds for a lawsuit.

<comment><USER3> But the CGI was Magic Leap Technology.</comment></comment>


Platform/Forum to gather feedback from Beta Users - <AUTHOR>

A couple of weeks ago I was looking at a platform designed for capturing feedback and feature requests for beta testers. It was essentially a forum but devoted to product feedback. I think they offered a free version and I just can't remember the name of it. Has anyone come across something like this? <comment><AUTHOR> I'll answer my own question! Its called uservoice and I found it cos the stack overflow guys were using it for their beta!</comment>


How the Freightliner Reveal Was Projected onto the Hoover Dam - <AUTHOR> http://www.ct-group.com/na/en/posts/hoover-dam-projection

<comment><USER2> 60 projectors at 26,000 watts each were synchronized to create a single seamless image with a resolution of 4592 x 2048 pixels on a 420,000 square foot surface. Wow.

<comment><USER3> 1.56MW to run the projectors; 1,560,000W

"Presently, Hoover Dam can produce over 2,000 megawatts of capacity and a yearly average generation of 4.5 billion kilowatt hours"

2,000,000,000W capacity, but if the annual production is 4,500,000,000,000W then it's far short of the 17,520,000,000,000W max if it produced at peak for 365 days.

So really, the Hoover Dam averages 513,698,630W (arbitrary precision).

1,560,000W / 513,698,630W = 0.3% of the Hoover Dam typical production to power the projectors.

Well, that answers that question.

[http://www.powerauthority.org/hoover- dam/](http://www.powerauthority.org/hoover-dam/)

<comment><USER4> Lumens are not watts.

A Christie Roadster 4k projector lamped for 29k lumens burns a 4.5kW lamp.

(4.5kW/projector)(60 projectors) = 270kW = 0.27MW (not mW, thanks)

<comment><USER5> And mW != MW

</comment></comment></comment></comment><comment><USER6> Video link:

[http://on.aol.com/video/daimler-trucks-freightliner-event- at...](http://on.aol.com/video/daimler-trucks-freightliner-event-at-the- hoover-dam--nv-518811624)

<comment><USER7> Promo video of the truck: [https://www.youtube.com/watch?v=uhKmKug7DXM](https://www.youtube.com/watch?v=uhKmKug7DXM)

</comment></comment><comment><USER8> I love the technical execution, but it's still tacky. They've created a very large billboard. Nice job?

<comment><USER6> I think the effects in the intro were pretty cool. E.g. seemlessly projecting the texture of the dam and then having blocks of concrete move out of the way to reveal the inner "gears" of the dam.

<comment><USER9> Those effects have been perfected for a while. With high lumen HD projectors coming into their own at the same time it has created some amazing effects. I guess I'm just trying to say that if this interests you, there are a lot of videos out there that I think are a lot cooler.

This [1] is the first company I saw doing it. This [2] is their 10 year anniversary showcase. Now just about every NBA and NHL team incorporates them into their pre-game shows. [3] [4]

[1] [https://www.youtube.com/watch?v=Bu2e9uulMPA](https://www.youtube.com/watch?v=Bu2e9uulMPA)

[2] [https://www.youtube.com/watch?v=_cuqbYbvYYM](https://www.youtube.com/watch?v=_cuqbYbvYYM)

[3] [https://www.youtube.com/watch?v=17soGNnYyuk](https://www.youtube.com/watch?v=17soGNnYyuk)

[4] [https://www.youtube.com/watch?v=FsZrywjPIb0](https://www.youtube.com/watch?v=FsZrywjPIb0)

<comment><USER6> [1] is definitely cool, and similar, though done at a much smaller scale. The Hoover Dam looks to be about 10 times as wide and ~5 times as high as that building. So you're talking about 50 times the surface area to project on. Projecting onto a perfectly flat and perfectly rectangular basketball court is hardly the same challenge though.

Whether the technology is revolutionary or not, my point was that it's rather dismissive to call this "a very large billboard". There's definitely some cool artistic features to the presentation that are not in any way representative of a billboard.

<comment><USER9> Oh yeah, I agree. I was mentioning them since your comment only mentioned the effects and not the practical aspects of the display. I just figured you might be interested in some other examples like the one you mentioned.

[Edit: This one was one of my favorites: [https://www.youtube.com/watch?v=ZleDZP0FKWo](https://www.youtube.com/watch?v=ZleDZP0FKWo) ]

<comment><USER6> Ok, that one is awesome! Maybe a slightly blander surface, but integrated to a wonderful effect.

</comment></comment></comment></comment></comment></comment><comment><USER10> Amazing bit of projection design work.

Also: robot semi-truck = a milestone in the twin, linked curves of heightened production and heightened unemployment.

Note to self: fix capitalism soon.

</comment><comment><USER11> For the Grand Coulee Dam's laser light show, they use 4 large frame Coherent Sabre Lasers - 2 red 12-watt Krypton lasers, and blue and green 30-watt argon lasers. That would probably be too complex to set up for this one publicity stunt.

[http://en.wikipedia.org/wiki/Laser_light_show_%28Grand_Coule...](http://en.wikipedia.org/wiki/Laser_light_show_%28Grand_Coulee_Dam%29)

<comment><USER12> Companies like Image Engineering out of Baltimore have 50 watt solid state laser projectors that can run on fairly nimble power sources without water cooling like the Sabres and other large frame ion lasers.

Laser projectors are good for beam effects and vector art but won't be able to touch Christie and Barco projectors if one managed to scan a raster image with them. (Yes, some Christie and other projectors use lasers an an illumination source but it's much different.)

</comment></comment><comment><USER13> I'm surprised they didn't get any pushback from the Hoover Dam people about creating the illusion that the dam was falling apart.

</comment><comment><USER14> Off-topic question: Why do people insist on calling The Hoover Dam "one of the top engineering marvels".

Surely, a dam that doesn't even make it into the top-25 tallest dams in the world, and is 57th in the world in power generation is not that impressive? [http://en.wikipedia.org/wiki/List_of_tallest_dams_in_the_wor...](http://en.wikipedia.org/wiki/List_of_tallest_dams_in_the_world) [http://en.wikipedia.org/wiki/List_of_largest_hydroelectric_p...](http://en.wikipedia.org/wiki/List_of_largest_hydroelectric_power_stations)

<comment><USER15> There's always a critic.

I think it's important when considering lists like the ones you've linked to examine the dates these structures were built. For its time, the Hoover Dam was the largest in the world, but isn't simply the dam itself that represents an impressive feat of engineering. The work that went into diverting the Colorado River was (and still is) probably one of the most remarkable efforts undertaken, with the likely exception of the Three Gorges Dam. Either way, it's important to remember that this was a structure started in the 1930s. The age, materials available, the _material science known at that time_ , and so forth are the reasons structures remain important samples of architectural engineering long after they've been eclipsed by more modern developments. Hence why it's difficult to tell if you're genuinely curious or simply levying unwarranted criticism against categorizing the Hoover Dam as a "marvel."

In other words, it's in our nature, for whatever reason, to continue building structures that grow ever larger, require greater understanding of materials-- better materials, too--and shadow efforts of the past with new, more impressive, modern designs. However, that doesn't supplant those past efforts simply because they've been outdone. Otherwise, we wouldn't still consider the Great Wall of China one of the world's wonders (which in spite of our present technology still remains an incredible structure mostly unsurpassed by modern efforts).

You could also examine other answers to this same question if you don't find my response convincing [1].

[1] [https://www.google.com/search?q=why+is+hoove+dam+an+engineer...](https://www.google.com/search?q=why+is+hoove+dam+an+engineering+marvel&ie=utf-8&oe=utf-8)</comment></comment>


Welcome to Operation Dixie, the most ambitious unionization attempt in the U.S. - <AUTHOR> https://timeline.com/operation-dixie-was-a-quixotic-attempt-to-unionize-the-south-61fdd7dd0810 <comment><USER2> I grew up in a place where unions weren't popular, so I didn't know what to think about them.

In early 30s I moved to Indiana, where unions were somewhat popular. I had an electrician friend who belonged to a union, he liked a lot of the benefits they provided.

Later, I made another friend who grew up in mining company. His dad worked in management at a mine that underwent a strike. He described how their home was harassed at night with rocks coming through windows and threats of violence.

I still don't know what to think about unions.</comment>


80 Years Later, Polar Explorer's Sunken Ship Floats Again - <AUTHOR> https://www.scientificamerican.com/article/80-years-later-polar-explorer-s-sunken-ship-floats-again/ <comment><USER2> Rise again, rise again. That her name not be lost to the knowledge of man.

<comment><USER3> It's hard to argue against a Stan Rogers reference on the internet. This is a great time to be a fan of exploration. The raising of the Maud, the discovery of the Terror and Erebus. I never thought I'd be alive for such momentous events.

</comment></comment><comment><USER4> Kraken let go its prey.

<comment><USER5> Please comment civilly and substantively on HN or not at all.

<comment><USER4> Ok. I thought the joke was appropriate.</comment></comment></comment>


Why the nation needs a US Cyber Force - <AUTHOR> http://www.bostonglobe.com/opinion/2013/09/29/why-nation-needs-cyber-force/quM4WWdJOh0FoSyE7rmxJI/story.html <comment><USER2> > we do not have functional equivalents for... a Transportation Security > Administration.

So we'd have to get groped by the government before we can get on the net?

I'm only half kidding but I wonder if the admiral isn't.</comment>


Analysis of USB fan given to journalists at North Korea-Singapore Summit [pdf] - <AUTHOR> http://www.cl.cam.ac.uk/~sps32/usb_fan_report.pdf <comment><USER2> _"VCONN pin is connected to VBUS via a resistor. There are also diodes on the board"_

A truly paranoid analyst would check that these things that look like a resistor or diode actually are resistors and diodes. That may not be easy, as they could contain a tiny cpu and a few bits of flash memory that change the behavior from "resistor" to something else after x power ups or, using an on- board real-time clock, at a given date, or that run in parallel to the resistor or diode. A simple RFID chip already could be somewhat of use to spies.

Even simpler, that "resistor" could contain a tiny microphone and a radio transmitter (getting reasonable audio quality and reasonable radio range likely would be a challenge, but that's what big budgets are for).

<comment><USER3> I used to think things like these were fun conspiracy theories for a slow afternoon. I remember seeing a guy who got Linux running on a spare ARM CPU on his SATA hard drive, thinking "that'd be a great place for a rootkit".

But didn't think much further of it as that can be a dark rabbithole to go down. Then Snowden leaks came out, and it turned out technology was an active, hostile and full scale warzone.

These are not unreasonable thoughts to have now. Even if you prove one of these fans is safe, it does not prove that an individual has not been targeted with a fan with a payload.

Also, don't discount the entire circuit being the bug. [https://en.wikipedia.org/wiki/The_Thing_%28listening_device%...](https://en.wikipedia.org/wiki/The_Thing_%28listening_device%29)

<comment><USER4> Exactly. That's a fantastic tactic. Give out a thousand fans and have only 9 or 10 of them be compromised. A safe fan gets torn down by security researchers and declared vanilla, and those 9 or 10 targets believe their fans are safe to use.

<comment><USER5> Or even just fake the analysis outright. North Korea having someone at Cambridge, or at least being able to feed them a benign variant via an unnamed journalist, is not out of the question.

<comment> brian-armstrong We can probably rule this out since the paper doesn't conclude that North Korea is #1 and Bless Dear Leader

<comment><USER4> The workers' effort of dismantling the fan promoted the mass line consciousness and building of a vigorous cadre feeling in the whole army.

</comment></comment></comment></comment></comment></comment><comment><USER6> How about we go full meta and suspect the linked PDF is the malicious payload vector?

<comment><USER7> I'm glad someone is going full Hari Seldon on this.

<comment><USER8> It's not necessarily science fiction.

</comment></comment></comment><comment><USER9> The going theory at the time was that they only bugged some percent of them in the hopes that someone would publish an analysis exactly like this and then everyone else would plug them in freely.

<comment><USER10> The idea that somebody has been waiting around to plug in a $0.50 fan until a security researcher did a tear down is absolutly absurd.

<comment><USER9> They weren't waiting around, but the idea is that they would just hear it through the rumor mill and then decide, "oh hey I guess I can plug this in".

Having done security for many years, especially user security, I can say with certainty that some people are this dumb.

</comment></comment></comment><comment><USER11> I'm surprised they didn't disassemble the fan proper- while it's not useful as a USB spy device, if we're going to go full paranoia, those lines could still be powering something in the fan chassis itself.

<comment><USER12> Did you look at the picture? The lines are not connected at all.

<comment><USER13> You could fit an entire array of mics, sensors and radios inside the fan that are powered by the USB port. No need to connect to the laptop to record and broadcast info.

Pretty unlikely though.

<comment><USER14> Not really. There was a microphone inside a gift that was in the oval office given by the Soviets, which broadcasted info for many years. They called it "the thing".

<comment><USER15> And the microphone was just the diaphragm that a microwave beam was bounced off of. The device itself was entirely passive.

</comment></comment></comment></comment></comment><comment><USER16> Nice, an analysis from the future :)

Jokes aside. My guess would be that it is highly unlikely a half decent secret service would use such a method to spread a virus or a trojan. On the other hand, I would also guess that no serious journalist will contemplate using a free device provided by a rogue nation just in case.

<comment><USER17> > On the other hand, I would also guess that no serious journalist will > contemplate using a free device provided by a rogue nation just in case.

I disagree. While tech-minded journalists may be aware of the risks of untrusted USB devices, the same cannot be expected of everyone; even if they know that USB drives are potentially dangerous (already a crapshoot, even in some tech-related jobs), people unfamiliar with computers may not realize that the same risks apply to all USB-powered devices.

</comment></comment><comment><USER18> There's a lot of hysteria surrounding these freebie swag items, enough that you have to wonder if either exactly this sort of reaction was expected, and their laughing at exactly the expected level of fear and paranoia produced at the mere sight of a USB jack... or... they could only but roll their eyes, as they dropped a USB device into the mix out of curiosity to see if there would be any reaction at all, expecting possibly a muted, cool brush off, unconcerned about exploits, and instead caught ten or one hundred times the wave of hysteria, for something they might have internally estimated would be rated as being perceived as a mild security hazard.

Seriously, this has all the alarmist fear mongering of the Cuban embassy sonic weapon mystery, but none of the smoking gun who-dunnit clues.

People are going to be chasing their tails on this one, wondering if the fan rotors spin at resonating speeds to give off infra-sonic beam-forming geolocation signals, and that's after they sample scrapings from 1000 different components in a gas chromatograph mass spectrometer only to find that they were some standard chinese USB components, purchased in bulk orders months ago, but had arrived too late for Olympics swag and were basically left-overs.

It's funny, but I think the volume of this knee-jerk reaction caused more damage than an actual attack could have.

If North Korea was going to try and swindle it's way onto targeted USB interfaces, I'd have to imagine that they'd attempt a level of indirection (at least one), and launder the swag through a secondary shell entity, like some shady third-world press corps gadfly to the event.

If they hadn't thought of that before (even though I'm sure they already do think that way), this hair-on-fire reaction has certainly taught them to do so, unconditionally, going forward.

</comment><comment><AUTHOR> Context here: [https://www.zdnet.com/article/usb-fan-given-out-at-trump- kim...](https://www.zdnet.com/article/usb-fan-given-out-at-trump-kim-summit- deemed-safe/)

</comment><comment><USER19> Before clicking the link I took a moment to think about how I'd design such a device for nefarious purposes, hoping that the author ought to be able to defeat whatever a mere hobbyist could come up with.

It would appear I'd make a better spy than the author would make a security analyst.

Penn Jilette has given interviews on what mindset is needed to trick people. One basic rule is that people will gravely underestimate the lengths he is willing to go to in order to trick the audience.

I'm not saying this is a spying device. I am merely pointing out that the author shed no light on whether it is.

For your entertainment: [https://youtu.be/WvXKSSmItls](https://youtu.be/WvXKSSmItls)

<comment><USER20> Your comment doesn't explain how you tricked the analyst so I downvoted you.

</comment></comment><comment><USER21> Perhaps the bug can only be activated by an external source, e.g. Theremin's bug :

[https://hackaday.com/2015/12/08/theremins- bug/](https://hackaday.com/2015/12/08/theremins-bug/)

The moving fan motor could act a simple microphone.

</comment><comment><USER22> A malicious chip inside the USB-C connector with pass through power to the fan seems reasonable.

<comment><USER23> This. There's plenty of space to overmold a chip embedded in the USB-C connector itself, and such a device would naturally open-circuit the data pins when powered off (defeating the multimeter test).

This "analysis" is so superficial that I thought it was a joke at first. At the very least the device should be completely disassembled and/or X-rayed.

</comment></comment><comment><USER24> These usb cables with data switches need to become more commonplace. [https://www.adafruit.com/product/3438](https://www.adafruit.com/product/3438)

<comment><USER25> That only helps if the spy equipment needs more than power from the USB port. It doesn't need a data connection if it's picking up RF noise from the laptop and audio from people to transmit to nearby agents.

It was done in the '80s with much less advanced technology: [http://www.cryptomuseum.com/covert/bugs/selectric/](http://www.cryptomuseum.com/covert/bugs/selectric/)

</comment></comment><comment><USER26> Surprised to see USB-C connector. Has it gone mainstream all the way in place of Type-A?

<comment><USER27> Not yet, but we're going there.

</comment></comment><comment><USER28> Just for the sake of curiosity, wouldn't it be possible to embed some sort of self-contained microdevice inside the motor? A USB "rubber-ducky" type device is kind of expected, piggybacking something else off the USB would be kind of interesting. Cheap throwaways like this wouldn't make sense target-wise, but it's fun to think about.

<comment><USER29> That is the reason you have an X-ray to vet electronics before allowing them into secure areas (with potentially secret sound and generic em-waves (from 200nm to 300000km aka 300Mm)). If you don't have that already, you don't have that much physical security...

</comment></comment><comment><USER30> Just curious why would a nation secret service organisation spy on journalists? They are not delegates of the summit.

<comment><USER31> Journalists have sources that the spy organization would very much like to learn the name of. If you're going to come down hard on leaking, bugging journalists or compromising their phones is the most logical thing to do. The reporter that gave up the fan for analysis was absolutely right to be paranoid here.

</comment></comment><comment><USER15> Each device emits a specific RF signature when turned on. Nothing more. The Red Team then knows which journalists are susceptible to these kinds of attacks and will use this information later.

</comment><comment><USER12> The meme of infected usb sticks in the parking lot is so old and known by everybody and their grandma, that only a prankster would really do it, with a parody screensaver virus.

A serious secret service would use more up to date methods.

<comment><USER32> Take something super banal (a mobile fan), give it a blindingly obvious hacker-y feature (USB connectivity), and distribute them among visitors from an adversarial country (the U.S.), and you're going to be hard-pressed to find someone who isn't at least the tiniest bit suspicious, This is so entirely Spy Device 101 that the payload is likely just entertainment for DPRK officials– watching everyone stress out and tear it apart looking for something malicious. And that, in and of itself, is pretty damn twisted.

<comment><USER17> I'm not sure I would call it twisted - it's humorous to watch, but not particularly malicious, and if there are truly no devices in _any_ of the fans it could even be construed as a gesture of good faith.

I, for one, appreciate the show.

</comment></comment></comment><comment><USER33> What a quick read..

</comment><comment><USER34> Whoa! That had all the suspense of a Geraldo Rivera special. /s

</comment><comment><USER35> Flagged because not worthy of the frontpage.

What about inside PCB, motor stator, USB connector, etc. Must be some example of Cambridge on how to NOT to do anything..

</comment><comment><USER36> Someone should do an analysis of that pdf to see if anything is embedded in that.</comment>


Ask HN: How do you feel about ad blockers? - <AUTHOR> Are they an valid form of consumer protectionism? Or are we experiencing a textbook example of the tragedy of the commons? Something in between? <comment><USER3> I only realized very recently what makes me uneasy with web advertising. (This week from a HN comment)

If you see a billboard in the street or an ad in paper journal, you are exposed to the brand name for a few seconds and that's it.

If you are exposed to a web ad, you are exposed to the brand name for a few seconds AND your actions, the fact you have visited the page, from which IP at which time of the day, with which browser is recorded in a database for later use (and is certainly going to be sold or replicated by multiple entities).

So it is not so much the advertising part that his annoying but rather the "tracking". The fact that advertising network (or social buttons) are pervasive through many sites makes the matter worse.

The biggest lie is to still call that "advertising", this has nothing to do with old school advertising.

<comment><USER4> I have a different view, I might be a very special case but that type of tracking doesn't bother me much, actually if it helps me suggest better ads that suit me, I almost welcome it.

What bothers me, borrowing from your example of the billboard, is that they don't block your content and make you wait in line. Ads on a video, popups, interstitial, they all slow me down and annoy me.

<comment><USER5> What about when it was revealed that facebook was using their like buttons as a way to build dossiers on people?

You could have never have even visited facebook.com and have never had a profile, but still this company was using its cookies to build a profile of you on the internet. All of the articles you read on the internet, the sites you visit, all being collected and tallied by some faceless internet behemoth.

That sort of thing doesn't bother you?

<comment><USER6> > That sort of thing doesn't bother you? He just said that this doesn't bother > _him_. The key element here is _the choice_. The choice to be tracked, or > not to.

The systematic tacking and profiling of all users of the web is disturbing and I am against it, but honestly, I still prefer Google at the commands rather that any government I can think of. Not that it justify in any way the tracking. It's a dangerous weapon.

<comment><USER7> With every Snowden leak that has come out, you don't think the Government has access to ALL of google's tracking data? Even if they didn't, all it would take is the mere _thought_ that you might doing something wrong, and they'll subpoena it/get a warrant.

</comment></comment></comment></comment></comment><comment><USER8> My device, my rendering rules. Without adblock things are hard to read and sites load even more slowly. Plus I despise the constant attention grabs and view that as bad for my health. (Same reason I won't sit in a restaurant with a TV visible.)

Even Google is out there making it worse. On mobile I get flashing yellow ads telling me I have a virus or need to clean or speed my phone.

</comment><comment><USER9> A future web with unavoidable, ubiquitous advertising is a grotesque thing that I want no part of. Advertising and marketing represents the _worst_ of what capitalism has to offer.

The point is that we must stop the momentum associated with the advertising- fueled web _now_ , because it's too late.

We -- the technologists behind it -- need to stop taking it for granted what the future of the web is going to look like, and to think of other ways to obtain that revenue.

I do and will forever use adblockers (until they are circumvented) for these reasons.

</comment><comment><USER10> We're definitely experiencing a textbook tragedy of the commons - <USER2> advertisers make pennies by causing significant damage to everybody's reasoning and psyche.

Installing an ad blocker is similar to any other vaccination - reduce the spread of intellectual disease and hopefully create a herd immunity.

</comment><comment><USER11> I think they symptomatic of an immature system. That's to say one which isn't well regulated.

They are the result of site owners trying to make their sites sustaining or profitable and we have some trying very annoying ways of monetizing, and on the other hand we have users wanting free access to everything.

The result is site operators getting more desperate using more invasive techniques driving more users to use ad blockers and siding by default with people who want everything free.

In the end, the piper needs to get paid. Will micropayments be the answer or will only businesses for whom the www is essentially branding and marketing survive? I don't know. Certainly hope it's not public radio donation style funding.

That said, paid content masquerading as journalism is the worst.

<comment><USER12> I couldn't agree more. Major media outlets are more and more using invasive ads that completely detract from the user experience in general. I can't count the number of times I have quickly closed a tab because a video ad started autoplaying, or the times when I am a 1/3 of the way into an article and suddenly the javascript loads and the page drops down or an interstatial popups up.

It's a catch-22. Media outlets see they can make money off ads so they use more invasive techniques, viewers leave the site because of these techniques causing a drop in revenue, the media outlet steps it up a notch to more profitable, more invasive ads because of lost viewers from the first round of ads.

</comment></comment><comment><USER13> I love ad blockers. In the rare cases where the site is useful _AND_ the ads aren't distraction or evil, I exempt them (duckduckgo.com being one example).

</comment><comment><USER14> I recently moved most of my sites to a tip jar only and removed the ads. I have always done better via tips or donations than via ad money.

This is only a tragedy of the commons if we find no other means to fund things we value and expect to have access to online. The Internet is here to stay. You are only an asshole if you hate ads, use adblocker and are _also_ unwilling to fund the sites you use via some other means. There is nothing inherently evil about hating ads and choosing to block them. But if you expect to get all online content and services for free, then you de facto desire to treat someone, somewhere as your slave in some sense.

So if you use ad blockers and want services you value to stick around, please, out of enlightened self interest, support and promote alternate funding models that you find more palatable. And if your answer really boils down to "I expect everything for free!" then, yeah, go die in a fire.

</comment><comment><USER15> I don't run one because I choose to support the free content I receive (be it articles, videos, or similar). Without ads either they would have to charge, the quality would go down, or the content simply would stop existing.

That being said, I understand why others do. Adverts remain a source of privacy violations, legitimate security issues, and slow down a lot of websites.

I do run Flash click-to-play, and have EFF's HTTPS Everywhere installed. Those both negatively impact ads, but it is inadvertent and unavoidable. Both are set to improve security, if ads require an insecure connection or flash then more fool them.

</comment><comment><USER16> I wish I could ad-block YouTube ads that don't let me "skip" in 5 seconds (that seems to be a good measure of my tolerance). The ads I do remember, and maybe the most effective, are the ones that only run for 5 seconds. "Tropicana" ran a 5 seconds ad for it's juice: very effective; I still remember it, I like their juice. There is a lot of content I'll not even bother to watch because I can't stand the pre-advertisement.

I love YouTube for catching up on the late night talk shows, checking out the latest Cyanide and Happiness shorts, or watching cool documentary; I used to spend hours watching content. Lately, however, I can't stand to stay for one or two videos, because the ads are so offensive. I'll close the app/website and find something else to do.

A few years ago I cut my satellite service, and now I refuse to subscribe to cable/satellite again. I have local, over-the-air channels, but I don't watch them anymore either. After being a few years without that kind of TV advertising, I realise how obnoxious advertising really is. It's a total assault on the senses! Advertising on the Internet is heading this way, and I'm equally disgusted.

Anyway... You asked how I feel. Yay ad-blockers!

</comment><comment><USER17> In reality it does not matter if it is right or wrong; people will do it anyway.

In my opinion, a billboard does not make my car move slower, and I don't have to pay to pay to see it.

</comment><comment><USER18> Once, years ago, I did not see a bug on the site of the company I worked for, because the ad blocker I was using with my browser masked the bug. Further, I reasoned that since we made part of our money from ads, I should not use an ad blocker and I stopped. Plus I thought I should see the web "as it really is".

Now I think those are really dumb ideas, plus I don't work for a company that makes money from ads. It's basically an arms race now, websites do insane things because their stupid fucking A/B tests ticked up .001 percent. Then the rest of them throw up modals (and whatever other garbage) because everyone else is doing it.

The real, actual web, as it really is, it's a disaster now. Sometimes I open a web page and forget about it, then minutes later it just begins blaring audio for some video ad that I can't even see because it's been scrolled offscreen. Toilet world.

</comment><comment><USER19> I have not seen web advertisement in years, and I am happy to have it that way. Why? Because I don't want any of your flashing javascript animations in my face, neither your code running on my computer.

If I would run for a mayor's position, I would do similar as they did in Sao Paulo and clean up the city. [https://en.wikipedia.org/wiki/Cidade_Limpa](https://en.wikipedia.org/wiki/Cidade_Limpa)

I find it troubling that companies get to tell me how incomplete I am on the streets every day and try to sell me workout pants and whatnot. It is utterly unethical, and we should rally to remove demeaning advertisement such as half- naked women on trucks selling refrigerators.

Have forums for these kind of things, much alike porn magazines and porn sites.

</comment><comment><USER20> I am upset my free riding will come to an end. I hate ads on the internet and run an ad blocker, but I also really want free content.

It'll be interesting to see how the internet evolves. If ad blockers are used by a lot of people, but not all, I expect to see the quality of content continue to fall lower and lower. The Buzzfeed crowd will be the last to adopt ad blockers.

I think it would be better if browsers just turned on ad blocking as a default. Force the web to find a new model sooner rather than later.

I wonder if Google and facebook have contingency plans for such an event.

If Microsoft wasn't so afraid of antitrust laws, I'd suggest they just introduce an adblocker built into windows and turned on as default. They could KO google in a quarter or two.

</comment><comment><USER21> I've been using ad blockers for years.

I currently do webcomics, an area whose most effective business model has historically been founded on ads.

I don't run ads on my comic. I used to but I decided to make 'no ads' as a goal on Patreon; I reached it and now my stuff is ad-free. A prominent cartoonist offered to sponsor my entry into a profitable collective and its ad network, and I'm not entirely sure I want to take this offer. Because then I'd be going back to ads.

On the other hand, part of how I grew the audience that lets me make enough money off of my comic to turn off ads is by running ads elsewhere. Not having them on my comic feels kind of hypocritical. I dunno.

</comment><comment><USER22> _> Or are we experiencing a textbook example of the tragedy of the commons?_

We sure are. But advertising, not ad-blocking, is precipitating this tragedy:

1\. The commons in this case is a healthy marketplace where the users are the customers and thus vote with their dollars. _The invisible hand_ depends on this.

2\. But then a competitor comes in and offers something for "free". This is a trick, a lie. The other important principle of the free market is that _there is no free lunch._ [1] The advertisers pay the website with money that is added to the cost of the products they are selling. Guess who buys those?

3\. Here's where the tragedy comes in: Consumers are fooled by this. You've undercut the straight up competitors that charge for their product by fooling consumers into thinking you're offering what the other guy is offering, but for free. Come on, who could turn down that? The straight-up businesses that want to compete the honest way can't. They either have to cave and switch to ads, or die.

4\. The tragedy continues: Since we are now the products not the customers, businesses don't compete for a dollars by producing a product we are willing to pay for. Instead, they compete for our clicks (what they're selling to the advertisers). Competing for clicks, as most of us see every day, yields horrible products for us.[2] But of course, we are not the customer.

5\. And like every tragedy of the commons, what we are left with is a misused and polluted[3] precious resource, the web.

I haven't even got into the harm advertising itself cause to society, nor how it distorts the free market, suppressing innovation and true competition.

-

[1] [https://news.ycombinator.com/item?id=8585237](https://news.ycombinator.com/item?id=8585237)

[2] [https://news.ycombinator.com/item?id=10049494](https://news.ycombinator.com/item?id=10049494)

[3] [https://news.ycombinator.com/item?id=10047706](https://news.ycombinator.com/item?id=10047706)

<comment><USER23> Let me get this straight.

Your contention is that if companies did not have to buy advertising to sell their products, they would subtract the advertising cost from their sales price?

You have a very unusual definition of being "fooled". Paying for something you can get for free is what most people would recognize as being a fool.

That companies decide to choose a different business model to offer for free what their competitors make you pay for is just innovation. It has zilch to do with being "honest" or "straight up".

Here's an interesting question: how come people buy bottled water when they could just drink tap water? I mean, shouldn't people be "fooled" by all the "free" water? How come the "straight up", "honest" water bottle company that sells its product at a price manages not to die? (Hint: it's not because they're not advertising).

</comment></comment><comment><USER24> Necessity for users because of over-reaching sites and security issues, reasonable site owners get punished as a bad side-effect. Difficult to predict what the way out is going to be.

<comment><USER25> Security issues is the number one reason to have adblocker installed. You shouldn't have to worry about a malicious site inserting some cryptolocker variant into a malicious ad.

</comment></comment><comment><USER26> Ditto with not wanting to be tracked by "targeted advertising." It's like, the one thing the Snapchat CEO believes that I agree with - it's just plain creepy.

</comment><comment><USER27> Depends on what context. ISPs should not block ads, unless they are offering it as an extra service (i.e. optional that a customer must opt into). ISPs need to treat any and all traffic exactly the same by default. Home users and business have the right to block any content they don't want to receive(either by plugin or proxy server).

</comment><comment><USER28> Advertisers are assholes [0] and by extension anyone willing to do business with assholes is, themselves, an asshole. Find a better business model - because I don't do business with assholes.

[0] [https://www.youtube.com/watch?v=Re5DgTJE0S4](https://www.youtube.com/watch?v=Re5DgTJE0S4)

</comment><comment><USER29> I feel that they're useful. Neither modern advertising methods nor the circumvention thereof fall cleanly into "moral" v. "immoral", so I prefer to judge such things based on their utility and effectiveness - things which adblockers achieve better than modern advertisements, at least in the web space.

</comment><comment><USER30> I use adblockers. The next annoying thing to tackle is doing away with the emotional manipulations: "We detected that you're using an ad blocker; we understand that, we don't like ads either! but we need money etc etc".

We now need a guilt-trip blocker. If you need money from your visitors, charge them.

</comment><comment><USER31> Only time I get frustrated enough to care is the youtube advertisements that keep playing no matter how often I press skip. If I have pressed skip on this ad the last 10 videos, show me something else for gods sake.

Other than that, I've turned my ad blockers off since quite a while.

</comment><comment><USER32> I like ad blockers simply because the format of most ads are horrible. Popups and modals make the site horrible for the mobile platform.

I would prefer some inline ad served by the site that is part of the page and has some sponsored by type feel to it.

</comment><comment><USER33> I think blocking JavaScript trackers is pretty uncontroversial (almost necessary).

</comment><comment><USER34> Even when I'm not using ad block, I pay attention to pretty much no advertisement. They probably need a better way to appeal to this sort of crowd regardless.

</comment><comment><USER35> They're not ad blockers, they are HTML firewalls.

</comment><comment><USER36> A god send. A glorious boon to privacy and a security necessity.

</comment><comment><USER37> The deluge of invasive advertising in web content (along with tracking and various shades of borderline-malware) is symptomatic of late capitalism optimizing for profit: the web is almost unusable without ad-blockers, and yet alternative monetization models are not being seriously persued, because Google has no reason to optimize for anything other than ads even though they are never being seen. People pay for advertising despite it being almost completely ineffective (advertising, as far as we can tell, is slightly more effective than priming -- in other words, it is effective only in the highly suggestible, and then only slightly and only when it's well-targeted), and middle-men build infrastructure for distributing advertising content that at best will clog up the tubes and be ignored but that in the average case will be explicitly blocked (before or after loading). No party involved has a really good reason to move to something effective -- those doing the advertising are not doing it because they believe it to be effective but because they are expected to, and sites that display the ads do so because they have nothing to lose and a few cents to gain per page-load on whichever users happen to not be running adblock.

There are real alternatives. Micropayments based on reuse (much like publishing royalties), for instance, could simultaneously produce a good income source for creatives and an incentive to invert the chilling effects on transformative reuse created by the automatic conservative enforcement of DMCA safe-harbor policies; a nuanced model for this kind of system is described in several places as 'transcopyright'. Schneier's street-artist model has been adapted into the model used by Patreon, but is remarkably rare in practice for an idea by a major thinker that was published 20 years ago. And, of course, there's stuff like crowdfunding and selling t-shirts -- both of which have issues of their own (kickstarter-style crowdfunding is more sensitive to bad actors than either the street-artist model or Patreon's hybrid version that turns crowdfunding into a subscription model; hawking merch can turn off certain communities and may not be useful outside of communities with a strong and coherent identity with symbol-sets that uniquely identify it).

Advertising was jumped on as a monetization model because it's, at small- scale, low-effort. Google makes their money by keeping the effort the same for the other two parties (the ad-seller and the ad-buyer) while improving targeting. However, the targeting hasn't really scaled well, despite the amount of tracking going up. And, we've hit the point where the tracking intended to improve the targeting has gotten so resource-heavy that end-users would rather cut it off entirely than benefit from well-targeted ads -- we've hit a scaling limit. The effort of targeting the advertising has been pushed off to Google and to the end user in terms of bandwidth. So, unless everybody gets fiber and significantly faster computers suddenly, we have time to back- track and find something that doesn't clog the pipes with surreptitiously- collected data worth on the order of one cent per megabyte.</comment>


"Holographic Algorithms" method threatens collapse of complexity classes (P could = NP!)  - <AUTHOR> http://pages.cs.wisc.edu/~jyc/papers/HA-survey.pdf Very Interesting! <comment><USER2> For those who don't want to read the whole thing, here's the part I found most interesting (though I didn't get through it all either...):

In this article, we will survey the new algorithm design method called holographic algorithms. This method uses perfect matching as a basic coding technique to encode computations, and then the FKT-algorithm to carry out the final computation. A particularly innovative idea is to choose a set of linear basis vectors to express and interpret a desired computation. In effect the algorithm is designed to manipulate sums of perfect matchings in superpositions, while the speed up is achieved by cancellations among such "holographic mixes". These holographic algorithms are quite unlike anything before, except perhaps quantum algorithms. At the heart of the computation is a process of introducing and then canceling exponentially many computational fragments. But unlike quantum algorithms, these holographic algorithms produce classical polynomial time algorithms. So far this method has produced some exotic algorithms for problems which were not known to be in P previously, and minor variations of which are known to be NP-complete or NP-hard.

The most intriguing question is whether this new theory can lead to any collapse of complexity classes. We contend that our belief of NP != P is based on the sense and experience that the usual algorithmic paradigms are insufficient for NP-hard problems (we don't have strong lower bounds for general models of computation). But does our erstwhile experience apply to these new exotic algorithms? If the answer is no, then it is conceivable that the new methodology may lead to a radically revised conception of P vs. NP. Of course it is quite possible that the theory of holographic algorithms does not in the end lead to any collapse of complexity classes. But even in this eventuality, as Valiant suggested in [54], "any proof of P != NP may need to explain, and not only to imply, the unsolvability" of NP-hard problems using this approach.

<comment><USER3> Two things leap out at me:

"So far this method has produced some exotic algorithms for ... minor variations of [problems] which are known to be NP-complete or NP-hard."

Well, I guess all they have to show is that those "minor" variations don't take the problems out of NP-complete or NP-hard .... that should be pretty easy, right?

"'any proof of P != NP may need to explain, and not only to imply, the unsolvability' of NP-hard problems using this approach."

Uhm - so, when and if someone gets around to the Turing-award winning business of proving P != NP, that proof _may_ need to specifically address this technique? And that makes the technique important?

At first blush, I think there's a snake around here somewhere that's a quart low. The authors might be on to something, but they look bad in this extract. They might have found something ("exotic algorithms for problems which were not known to be in P previously") interesting, but P == NP seems like overselling it, and that casts doubt on the value of the whole enterprise.

<comment><USER4> Welcome to theoretical computer science.

<comment><USER2> Q: How many theoretical computer scientists does it take to change a light bulb?

<comment><USER5> A: <http://www.cl.cam.ac.uk/~tjr22/whiteboard-2007-07-18.jpg>

</comment></comment></comment></comment></comment><comment><USER6> Take this with a grain of salt, because I'll admit I didn't read it very thoroughly. My understanding of holographic algorithms is that they make a primitive out of a matching algorithms that could be executed in constant physical time with holographic storage. While thats great, I think it only fair to include the complexity of the matching in the overall algorithms complexity, because although it happens in constant time this only because of massively parallel interactions in the storage.

Still I think when the author says that P != NP proofs will have to address this I think he's right that that _is_ important. It means that this is at the crux of the issue, either way it goes.

<comment><USER4> _My understanding of holographic algorithms is that they make a primitive out of a matching algorithms that could be executed in constant physical time with holographic storage._

Actually, from what I understand, that's not the point at all! What is "holographic storage" btw?

<comment><USER6> <http://en.wikipedia.org/wiki/Holographic_data_storage>

The whole point being that the reference signal can be projected into the storage and match found in a single pulse. Holographic algorithms deal generally with algorithms based on interference, so they might not directly relate to a physical storage device but the principles are similar.

<comment><USER4> The point is that this paper is about algorithms for classical (e.g., not quantum or anything special) computers. That's why it is so interesting -- it's kind of like quantum algorithms but will work with standard computers.</comment></comment></comment></comment>


Ask HN: iPhone X Tear Down - <AUTHOR> If I want to destroy my iphone and take the drive. Where is the hard disk? <comment><USER2> There is no hard disk, as in spinning magnetic storage.

The step-by-step teardown at [https://www.ifixit.com/Teardown/iPhone+X+Teardown/98975](https://www.ifixit.com/Teardown/iPhone+X+Teardown/98975) shows that the Toshiba TSB3234X68354TWNA1 64 GB flash memory is on the outside of the logic board sandwich; step 12.

</comment><comment><USER3> iFixit is the place for tear-downs; here's their video on the iPhone X: [https://www.youtube.com/watch?v=3oz-Q3tn70k](https://www.youtube.com/watch?v=3oz-Q3tn70k)

Though I think you'll be disappointed, that stuff is probably soldered on and can't be removed.</comment>