Why are programmers afraid of not using semicolons in JavaScript? - <AUTHOR> http://programmers.stackexchange.com/questions/99195/why-are-programmers-afraid-of-not-using-semicolons-in-javascript-but-dont-care-i

<comment><USER2> There are some caveats. This, for example, would not work as expected:

      foo()
      [1,2,3].forEach(bar)

Automatic semicolon insertion wouldn't work here, because the bracket could be a continuation of the last line. The same goes for parentheses at the beginning of a line.

Source: [http://blog.izs.me/post/2353458699/an-open-letter-to- javascr...](http://blog.izs.me/post/2353458699/an-open-letter-to-javascript- leaders-regarding)

<comment><USER3> The informal and single easy rule is to prefix lines that begin with punctuation with a semi. In practice only [ and ( crop up, almost nobody begins lines with a prefix increment or decrement. If you use += 1 and -= 1 instead you sidestep that case.

<comment><USER4> Or, you could just add a semicolon. KISS at work.

<comment><AUTHOR> Yes, you could just add a semicolon in front of lines that start with punctuation (tiny percentage of all lines) or you could just stick them at the end of every single line...

<comment><AUTHOR> @eropple: So you put semicolons after every line? Even after block statements {} ? Why not, if the goal is to be consistent?

<comment><USER5> You should use the reply button.

<comment><AUTHOR> It wasn't visible for me on that one comment. I don't know why, I thought it was too deply nested or something, but now I see it. Weird.

<comment><USER3> The Reply link doesn't show up for a minute or two. I guess it's supposed to force you to think instead of firing off a hasty response. Kind of pointless for one liners but hey...

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER6> "...but you have to be aware of some edge cases"

There's the reason.

<comment><AUTHOR> But isn't that part of learning any language? There are plenty of weird edge cases in other languages but we get used to them. Basically this boils down to:

"When you have a single statement, that stretches out over more than one line, but those lines are legal statements on their own, then it won't work like you want it to"

I would guess that the number of statements that stretch out over many lines are a very small part of the overall number of statements for most code.

But it just seems like most developers think that javascript might insert semicolons all over the place. Which it won't, the rules are clear once you learn them.

<comment><USER4> Or, just add a semicolon and keep it simple. Why risk it? KISS at work.

<comment><AUTHOR> There are two possibilities:

1\. Prefix lines that start with punctuation, specifically [(-+/ with a ;. Then omit them everywhere else. Lines that start with punctuation are a tiny subset of all lines generally.

2\. Postfix every line with a ;, "just in case"

I can't see how nr. 1 is harder. And in case 2 you don't actually put ; at the end of every line, you don't put them after {} blocks for example, so it's not like it's somehow easier to remember.

"Because we're used to doing it that way" is a reason I guess, but not a great one in my opinion.

</comment></comment></comment></comment><comment><USER7> Google's JavaScript style guide requires explicit semicolons; rationale: [http://google- styleguide.googlecode.com/svn/trunk/javascript...](http://google- styleguide.googlecode.com/svn/trunk/javascriptguide.xml#Semicolons)

<comment><USER8> The examples being put forth in defense of requiring semicolons are really weak.

      // 1.
      MyClass.prototype.myMethod = function() {
        return 42;
      }  // No semicolon here.

      (function() {
        // Some initialization code wrapped in a function to create a scope for locals.
      })();

There are at least two potential solutions here: 1) put a semicolon after every function declaration, and 2) put a semicolon _before_ every self- executing function. Both work fine. Either way, you have to remember to put a semicolon somewhere, right? No difference in cognitive load. And if you say that #1 is easier to remember because it's more C-like, you've just blown your cover. You don't actually write C at your day job, do you? Because otherwise you'd realize that C does not require semicolons after functions.

      [normalVersion, ffVersion][isIE]();

Same thing. Just put a semicolon before lines that start with arrays like this. Also this code is crap.

      -1 == resultOfOperation() || die();

OK hold up, who really writes this stuff? Is this what code looks like at Google? Forget semicolons for a second and let's work on basic code readability. Explain the line aloud. "If resultOfOperation returns negative one, then die." Now write it.

      if (resultOfOperation() == -1) die();

Sweet, now people can read our code without juggling operator precedence rules in their head. Minor side effect: the semicolon issue goes away.

      return
      { foo: bar }

Really? Why oh why would you write such a thing and expect it to return the object?

<comment><AUTHOR> Exactly! The semicolon prefix can be put even more simply: Prefix any line that starts with punctuation with a ;

There, you've just fixed all the cases that are likely to go wrong.

</comment></comment></comment><comment> cam- When compressing javascript down, missing a semi-colon can cause broken js, especially in older IE browsers. Trailing commas on js object literals would also freeze an entire page in IE. When that happened it would often take several days in jslint trying to work out where the broken js was from.

<comment><USER8> If that's the case, then the compression tool isn't parsing the Javascript correctly.

<comment><USER3> Watch out or all the nutjobs who uses Crockford's broken compressor will come out of the woodwork to defend it.

</comment></comment></comment><comment><USER9> my biggest concerns - why people want to _not_ use semicolons? Does it improve load speed may be? or make code more readable or help with something else?

<comment><USER8> Readability. Python, Ruby, and CoffeeScript are more readable for their parsimonious approach to punctuation, aren't they? We like those languages, right?

<comment><USER9> I am not in your "we".

Also, JS was not designed from start as semicolon-less language. If you prefer semicolon-less JS - use Coffee Script. Otherwise it is very hard to debug such code for someone who do not expect semicolon-less JS code.

</comment></comment></comment><comment><USER10> If memory serves, IBM's PL1 used to insert missing punctuation that it (the compiler) felt was missing. This wasn't particularly well thought out and often caused problems that were very difficult to debug. I used to think of it as 'doing me a favor that I hadn't asked for' and grew to hate both the feature and the language (the language for other reasons). In the years since then I've tried to be consistent in avoiding any such feature. I find it much easier to go ahead and use what ever the language needs. If I use semi-colons, then I don't have to guess there after...

<comment><USER11> In several years of PL/I programming, the compiler correctly inserted a semi- colon exactly once and then aborted the compile. I remember because it was such a surprise.

</comment></comment><comment><USER12> Haven't seen mentioned yet that .html files and legacy tools have an extremely lax historical attitude towards whitespace. People of a certain age came to the web understanding that a space is the same as a tab is the same as a line feed, as far as browsers are concerned.

The (increasingly common) practice on minifying is just one offspring of that history, which is, to the main point, not shared with Python.

</comment><comment><USER13> In general, DWIM (Do What I Mean) is evil. We're better off being forced to say exactly what we mean than having the machine try to figure it out for us. This lesson has been learned repeatedly over the years by programming language designers -- though clearly, alas, not by everyone.

</comment><comment><USER14> This is probably furthest down on my list of worries when writing JS... Sometimes I use semicolons, sometimes I don't (I try to be consistent in the same file), and when I'm in somebody else's house I follow their style. The examples given for why I should always use semicolons (e.g. the return + value on different line) are things that just don't come up for me and usually look ugly enough I'd avoid them anyway. (Also they're fairly simple to discover if you're actually testing your code.) The last time I did a return and value on the next line was in Java...

</comment><comment><USER15> You should always endeavour to make your code easy to read. Since most people aren't aware semi colons are optional, omitting them can cause unexpected behaviour in certain cases, and having them there does no harm, it's surely best to stick to the standards (i.e. using semi colons). The only time to debate whether to omit them is when there's a good reason to leave them out. Also, I suspect (untested theory) that it puts more strain on the parser, though makes negligible difference to the download speed, so will be a hit on performance.

</comment><comment><USER16> I got into the habit of using ;s to avoid having "my feelings hurt" by JSLint:

        Problem at line 1 character 10: Expected ';' and instead saw '(end)'.

<comment><USER17> Dropping semicolons also breaks a good deal of minifiers.

<comment><USER3> No, it really does not. Try it on any minifier that actually parses the JS and not some subset of the language.

</comment></comment></comment><comment><USER18> All this discussion just makes me wonder: Why are some other programmers afraid of using them? It's just a semicolon.

</comment><comment><USER3> Reason #1: Every time it comes up everyone who uses semicolons but doesn't really know why pipes up with their misguided and misinformed views on why dragons will eat your heart if you leave them out. Just look at the comments here.

<comment><USER19> My feelings exactly :3

</comment></comment><comment><USER20> Force of habit and clarity. Sometimes it's necessary, like "return i++" is ambiguous.

<comment><AUTHOR> return i++ is not ambigous. It will return the current value of i, e.g. if i was 2 it will return 2, not 3. But that's just how the post increment operator works (in every language that I know of), that has nothing to do with semicolon insertion.

<comment><USER21> "return i++" is not ambiguous, on that you are correct--but it _is_ terrible practice because it lends itself to being misconstrued.

Writing clear code is superior to writing "cute" code, and "return i++" is a case of the latter. In any case where the increment actually matters you are directly affecting a shared state and such changes should be made contextually obvious to the state of the object--one's neck would need to be very, very beard to think that this is immediately obvious and apparent in a contextually valid way.

Similarly, for many programmers, myself included, a semicolon is read as a period is in English--the end of the statement. (You keep saying that "but people don't get annoyed at Python when it does it," and guess what? I _certainly_ get annoyed at it--Python consistently frustrates me because I find it considerably less readable.) Omitting semicolons is less immediately clear than including them and, again, _can be misconstrued_. Only it can be misconstrued by the program interpreter, too. (Oops.)

<comment><AUTHOR> Well, at least we agree that 'return i++' is terrible practice (although it has nothing to do with semicolons) :)

But when you write Python code, do you then end every line with a ; ? To make it more readable for yourself?

<comment><USER21> I prefer to avoid Python entirely, but there are cases where I have to fiddle with preexisting code or the nature of the problem makes more sense to use it, i.e. a library already exists that doesn't elsewhere. In those cases, I write idiomatic Python, without semicolons, because That's The Way You Write Python.

Consistency is important, and the Python community has essentially said "don't use semicolons." The JavaScript community has essentially said "use semicolons aggressively". I write code according to those idioms so other people are able to more easily use it.

</comment></comment></comment></comment></comment><comment><USER22> That's a stupid question to ask. More appropriate would be: who on earth thinks that omitting semi-colons makes anything better?

<comment><USER8> Yukihiro Matsumoto and Guido van Rossum come to mind.

<comment><USER23> It's pretty obvious from the context that the OP was referring to omitting semicolons in Javascript, not in other languages.

<comment><USER8> Yes it is. My point is that when those guys created their respective languages, they omitted semicolons. One would surmise that they thought it made things better.

<comment><USER5> This discussion is explicitly about javascript. How _javascript_ benefits from including or excluding semicolons.</comment></comment></comment></comment></comment>


Interactive Go REPL - <AUTHOR> https://github.com/d4l3k/go-pry <comment><USER2> I love this! I really think the title could use the project name in it; I almost didn't click because there are tons of other go REPLs out there for explanatory programming; but nothing that gives you this drop-to-repl in a program.

</comment><comment><USER3> Wow this is a HACK. In the old-school getting-things-done-I-dont-care-if-its- ugly-but-it-has-a-certain-elegance-to-it sort of way. Well done.

</comment><comment><USER4> Does anybody know if this is finally a real full-blown REPL? Does it allow starting new goroutines and communicating with them over channels? Does it support FFI, i.e. package syscall + unsafe? on Windows and Linux?

Or is it again a "recompile and rerun everything after each new line is added and pretend to be a REPL"? Or is it maybe something inbetween?

<comment><USER5> Author here.

It's something inbetween. Pretty much the way it works is it dynamically inserts references to all objects/packages/functions in scope at compile time. It then has an in Go interpreter that uses reflection to be able to interact with those references in a transparent way.

The compiled part is just go so that part interacts the same way. The Go interpreter is only partially complete so there may be a few things that don't work as expected, but should be easy enough to add.

I'm also thinking about adding go1.8 plugin support so you can import new packages during the run instead of specifying them on the command line.

<comment><USER6> Oh wow. You're interpreting right from go/ast? Very cool!

<comment><USER5> Yup!

</comment></comment></comment></comment><comment><USER7> How'd they miss the name "gobar"? :D

<comment><USER8> It is good that they missed it. Google "gobar" and you will see why.

<comment><USER9> I'm a little afraid to do that - is it safe for work?

<comment><USER10> [https://en.wiktionary.org/wiki/gobar](https://en.wiktionary.org/wiki/gobar)

<comment><USER7> Wow. Guess I learned something new today.

</comment></comment></comment></comment></comment><comment><USER11> As someone who just started learning Go, what are the other popular Go REPLs in addition to this one?

<comment><USER12> The one that has seemed reasonable last I checked, was gore [1]. Then, you might want to check out the Golang Jupyter kernel as well (gophernotes [2]), which mentions gore as an inspiration.

[1] [https://github.com/motemen/gore](https://github.com/motemen/gore)

[2] [https://github.com/gopherdata/gophernotes](https://github.com/gopherdata/gophernotes)

<comment><USER13> Unfortunately, gore seems to be abandonware (last commit was a year ago).

</comment></comment></comment><comment><USER14> Wow, in my tests everything seems to run fine, fast and bug free, congratulations for that!

</comment><comment><USER15> repl.it's Go REPL is quite good: [https://repl.it/languages/go](https://repl.it/languages/go)

<comment><USER2> I find repl.it's go REPL to be totally unsatisfactory. I don't want to have to type `package main` at the top of my REPL before being able to evaluate any expression [0]. Avoiding that sort of boilerplate is a REPL's raison d'être.

In contrast, [gore]([https://github.com/motemen/gore](https://github.com/motemen/gore)) lets you start evaluating expressions right away [1], and provides nice REPL short-hand for importing packages [2].

[0]: [https://monosnap.com/file/OIO9dwR3n85xSNIdJIapGrBhbqWS4J.png](https://monosnap.com/file/OIO9dwR3n85xSNIdJIapGrBhbqWS4J.png)

[1]: [https://monosnap.com/file/AzuB6JsqRSN5f07H1ydB5t74Qh9pSA.png](https://monosnap.com/file/AzuB6JsqRSN5f07H1ydB5t74Qh9pSA.png)

[2]: [https://monosnap.com/file/J3llCwPTwAcchYJWZpVG7wdB8fFXZ1.png](https://monosnap.com/file/J3llCwPTwAcchYJWZpVG7wdB8fFXZ1.png)

</comment></comment><comment><USER16> Another VIM ? How to exit that damn thing ? :)

</comment><comment><USER17> This is the first real Go REPL!

</comment><comment><USER18> How does this compare to gore?

</comment><comment><USER19> Thank you for this

</comment><comment><USER20> it's funny coming from python i missed the repl for the first few weeks but go's insane compilation speed almost completely obviates the need for one.

<comment><USER21> Fast compilation and restarts doesn't at all address the style of programming where you evolve an in-memory program in an exploratory way.

<comment><USER20> yes it does? unless you're unable to write a single line without interactivity. i do literally the same thing in go as i did in python (when i needed to): write a little and hit compile to watch what happens (except i add a fmt.Println(fmt.Sprintf("%#v",x)) or something like that). often the entire thing happens faster than it would take python to just interpret a similar line and execute.

<comment><USER21> Find a screencast along the lines of someone livecoding something from scratch in a single editor-connected REPL session. Maybe using Clojure (or similar), and you'll appreciate the fundamental difference vs booting up fresh processes that start from line 1 of 'main' again and again.

<comment><USER20> [https://www.youtube.com/watch?v=a9xAKttWgP4](https://www.youtube.com/watch?v=a9xAKttWgP4)

that's a trick though - no one uses interpreters like that. for most people they're for experimentation, which is exactly what i was saying i'm able to do with go.

<comment><USER21> The style I'm talking about, code isn't typed directly into the REPL/interpreter!!

You work in your real text editor and it has a connection to a persistent session of the language runtime, over which you can send fragments, lines or whole files into. And receive data back if you wish. You can refine or replace as little or as much of the program as you want, while it is running.

Say there's a power cut and your computer turns off. No big deal because you were working in your real text editor and saving source files to disk (but not necessarily sending all of their content into the session).

It's not trivial or a novelty. I get that a traditional line-at-a-time interpreter inside a terminal à la /usr/bin/python isn't super compelling. That's not what I'm talking about.

(I am also a happy user of Go FWIW. It's the C style of programming in a super-refined form (not surprising considering who 2 of its creators are!))

<comment><USER20> >You work in your real text editor and it has a connection to a persistent session of the language runtime, over which you can send fragments, lines or whole files into. And receive data back if you wish. You can refine or replace as little or as much of the program as you want, while it is running.

...that's even closer to the style that fast compilation lends itself to

<comment><USER21> Alright, I get it. You're not interested in the subject I brought up.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER22> This makes Go much more accessible to coders who prefer this style of development.

Can't wait to give it a shot!</comment>


Generate ASCII RFC-like header diagrams for your own custom protocols - <AUTHOR> http://www.luismg.com/protocol/ <comment><USER2> If you prefer, you could also draw ASCII diagrams manually with asciiflow. I find this tool pretty handy from time to time.

[http://asciiflow.com/](http://asciiflow.com/)

</comment><comment><USER3> This looks useful. I really like the nwdiag python package. This has and packagediag which might be nice to get integrated with protocol.

[http://blockdiag.com/en/nwdiag/index.html](http://blockdiag.com/en/nwdiag/index.html)

</comment><comment><USER4> Nice, I thought for a moment I could do SoC register diagrams with it as well but not so much: ./protocol "reserved:2,PLLSAI_RDY:1,PLLSAI_ON:1,PLI2S_RDY:1,PLL_RDY:1,PLL_ON:1,Reserved:4,CSS_ON:1,HSE_BYP:1,HSE_RDY:1,HSE_ON:1,HSICAL:8,HSITRIM:5,Reserved:1,HSI_RDY:1,HSI_ON:1"

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |re.|P|P|P|P|P|Reserv.|C|H|H|H| HSICAL | HSITRIM |R|H|H| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

<comment><USER5> You should indent text by two (or more spaces) to make HN preserve whitespace: [https://news.ycombinator.com/formatdoc](https://news.ycombinator.com/formatdoc)

Let me fix it:

      $ protocol "reserved:2,PLLSAI_RDY:1,PLLSAI_ON:1,PLI2S_RDY:1,PLL_RDY:1,PLL_ON:1,Reserved:4,CSS_ON:1,HSE_BYP:1,HSE_RDY:1,HSE_ON:1,HSICAL:8,HSITRIM:5,Reserved:1,HSI_RDY:1,HSI_ON:1"
       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |re.|P|P|P|P|P|Reserv.|C|H|H|H|     HSICAL    | HSITRIM |R|H|H|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

</comment></comment><comment><USER6> Cute output but terrible code. Unmaintained.

It would be a lot better if it could read from an established, broad, well maintained database like Wireshark (formerly ethereal).

</comment><comment><USER7> Be careful when setting custom line widths, in the past i've run into situations where the last row of fields gets cutoff, depending on the line width.

</comment><comment><USER8> Looks like a nice reference, in addition to supporting custom protocols.

<comment><USER9> It would be cool if it could also generate code to marshal and unmarshal a protocol.

<comment><USER10> As far as I can tell, it only deals with fixed width fields, and nothing of the detail inside them. No, notion, for example, of whether a field is big/little endian, protocols with delimited fields, variable length protocols with "length" followed by "field", etc.

</comment></comment></comment><comment><USER11> Looks neat. Now this needs to become a plugin for ST3!

<comment><USER12> > ST3

I'll take it that's not Scream Tracker 3 (1994), Seattle's Sound Transit 3 ballot measure, or the New Jersey tax form, right?

<comment><USER13> Probably Sublime Text 3.

<comment><USER12> Makes sense, thanks!

</comment></comment></comment></comment><comment><USER14> This information belongs in manual pages on the system. On GNU/Linux operating systems, that's section 7; on illumos and SVR4 based systems, that'd be section 5.

<comment><USER5> What do you mean by "this information"?

<comment><USER14> The information which the program presents.

</comment></comment></comment><comment><USER15> Honest question: Is there an audience for this besides network engineers?

For anything else, I'd prefer either a human-readable text-based protocol or something like Protobuf that generates (de)serializing code from a schema definition.

<comment><USER16> Absolutely. I've had to implement protocols from a spec using various guides that had really bad diagrams of how the data is laid out. This tool could have made them a lot better. And as others have pointed out its extremely useful for binary file type diagrams.</comment></comment>


Fast Vue SSR with Rust and QuickJS - <AUTHOR> https://github.com/galvez/fast-vue-ssr <comment><USER2> QuickJS is a simple interpreter, no JIT, so performance obviously won't be competitive with V8.

The appeal is that it supports most of ES2019 while being a easy to build, light weight dependency that can be embedded into Rust applications. [1]

Would I use something like this for a production service with a high traffic volume? It would be nice to see benchmarks, but most likely not.

But if you have a Rust backend and want a simple way to do SSR without having to operate a separate Node service or linking v8, this might be a neat approach.

ps: It would be nice to run QuickJS in a WASM runtime, while still offering the same convenient API surface for Rust. This would provide sandboxing for the QuickJS C code. It's is in my backlog, I might get to it eventually. [2]

[1] [https://github.com/theduke/quickjs- rs](https://github.com/theduke/quickjs-rs)

[2] [https://github.com/theduke/quickjs- rs/issues/11](https://github.com/theduke/quickjs-rs/issues/11)

<comment><USER3> Personally I think it's a huge waste to re-write everything (badly) in Rust. Why not link against an existing JS compiler/interpreter written in another language?

<comment><AUTHOR> That is precisely what this is doing.

</comment></comment></comment><comment><USER4> So, how is it "Fast", without any performance benchmarks? Are we just assuming that it is fast just because it is written in Rust?

<comment><AUTHOR> Haven't had time to do proper benchmarks yet, but it does perform way faster than a single Node process serving the same Vue.js app via Nuxt.js, using fewer memory. This is likely to vary for large, complex apps for sure. And yes, Node will beat QuickJS in benchmarks by a wide margin, but then again, I don't think you can run 64 tiny threads with V8 like I do with this thing :)

<comment><AUTHOR> On my computer, single process Node vs single process Rust:

\- Rust: 20k requests in 10.04s

\- Node: 4k requests in 10.11s

Tested with `autocannon [http://localhost:3030`](http://localhost:3030`).

Running multiple Node processes will beat it for sure.

But then you're using a lot more memory and CPU, I think.

<comment><USER5> I'm curious about the latency since that's generally the point of SSR.

Also, a single process can consume just as much CPU as multiple processes, so the efficiency isn't obvious unless you measure user time.

</comment></comment></comment></comment><comment><USER6> It seems that there is a JS context per worker and the workers are shared among different requests. Further, the requests are handled by simple string formatting and eval in the JS context. This means that it should be trivial to inject arbitrary js codes in the server and initiate a XSS attack.

<comment><AUTHOR> Each thread runs the renderer sequentially, which means we can share a VueRouter instance between them as well. At least so far haven't seen any issues with it.

This is highly experimental, just a proof-of-concept so far. Security issues need to be reviewed and addressed for sure.

<comment><USER7> Client side code can assume a single-user context. It could write user- specific values to globals, use them in modules, etc., and it would be fine on the client side. But run in a multi-user environment it would be relatively easy to leak data from one user to another. SSR should run each request, or at least session, in a fresh context.

<comment><AUTHOR> That would be the case in a typical Node setting, but in this case, each thread runs the renderer no more than once at a time. So we just have to provide a fresh state.

</comment></comment></comment></comment><comment><USER8> If memory is the concern, node V8 Engine has the mode "lite" mode: [https://v8.dev/blog/v8-lite](https://v8.dev/blog/v8-lite)

with that perhaps you could spawn node to all threads and do even better in terms performance/memory?

<comment><USER9> V8-lite offers a ~25% reduction in memory usage at best, which is still one or two orders of magnitude more than engines like QuickJS. And you still have to deal with the massively slow and complex build.

</comment></comment><comment><USER10> Be aware about a couple of issues in the implementation:

\- The Warp handlers are blocked by the use of thread-blocking synchronization primitives (locks, channels) - which might harm performance and can even lead to deadlocks.

\- The architecture with "passing work off to a threadpool via a chnanel and waiting for it to complete" is not very resilient, and prone to behave badly under high load. The reason is basically the inifinite queuing - if new requests come in faster than previous ones can be processed the queue length (and thereby the memory footprint of the app) will grow and grow. At some point the application will just be busy serving old queued up requests, which might already have timed out on the client side and potentially even being retried. That's a vicious circle, and you can only get out ot it by shutting down the app. One way to fix this is to limit the queue/channel size and perform load-shedding on requests which can not be enqueued.

<comment><AUTHOR> Still it could be used reliably with the help of a load balancer and health checks. I can see Kubernetes spawning pods running this server a lot quicker than it does for Node ones.

</comment></comment><comment><USER11> I'll definitely use this once Fabrice Bellard gets around to writing TinyRust.

</comment><comment><USER12> I understand that Rust Hyper and/or Warp provide a very fast httpd engine but I would have thought that invoking JavaScript via Deno/V8, instead of QuickJS, was the natural integration.

Maybe Deno is hard to invoke from Rust Code.

<comment><USER13> The Deno core is _easy_ to embed in Rust (or so they say; I haven't tried it). [https://deno.land/manual/embedding_deno](https://deno.land/manual/embedding_deno). Note that this is the core and doesn't include TypeScript support. Also note that the rusty_v8 bindings will by default download a prebuilt version of V8 from GitHub, because otherwise it can be a mild pain to set up and takes a long time to build. See [https://github.com/denoland/rusty_v8](https://github.com/denoland/rusty_v8).

I can easily see why one would go with QuickJS: it'll be much quicker to get going.

</comment></comment><comment><USER14> I think you should post about this project to reddit: [https://www.reddit.com/r/rust](https://www.reddit.com/r/rust)

</comment><comment><USER15> It's been a observation for quite sometime add Rust to any heading and most likely will end up on top of HN.

Didn't expect such a trivial thing to be in front of HN, but probably Rust marketing and evangelist are all on HN waiting to move them to top.

Stil waiting for good library in rust not dependent on C or unsafe code. Looking at most of the cargo libraries most good one's are a wrapper around C or C++ library or use unsafe code.

<comment> Avi-D-coder There will always be unsafe and often be C dependencies.

There is no community goal or plan to do away with unsafe. Until we have an easy to use fully dependent and linearly typed language, there will be some degree of unsafety. Even if Idris 3 and ATS 4 come out with magical proof inference, we will assert many more complicated proofs.

<comment><USER15> Rust community has been very vocal placing Rust as C replacement and based on your statement it is not. So it's better for systems programmer to first focus on C/C++ to be closer to hardware and when needs some higher level work look at Rust for writing higher level libraries not dealing directly with hardware.

<comment><USER16> The grandparent didn't say anything about why C dependencies will often exist: in almost all cases, it is not because they _must_ exist due to missing functionality in Rust, but because it is easier to use a C library than rewrite/translate into Rust. Once someone has done that process (or implemented something equivalent), using a pure Rust dependency is nicer for many reasons, but reimplementing a complicated library is always hard, no matter the language used.

<comment><USER15> > it is not because they must exist due to missing functionality in Rust

This is the precise reason, Rust is a decade or two away from being a useful replacement for C/C++ like other contending systems programming language like go and Swift which are at present more popular than Rust for writing systems program for networking, servers and controlling Apple hardware directly.

<comment> Avi-D-coder Zig, Nim, Crystal, Go and Swift all use C libraries extensively. Nim and Zig even make lower boiler plate C inter-op a key selling point.

Mozilla, Microsoft, Amazon, Apple and other's investments in Rust, clearly demonstrate the value of writing new systems software in Rust, alongside and inside existing C/C++ code bases. Rust is clearly monetarily useful, despite not being a systems programing panacea.

<comment><USER15> The difference is most of those language don't proclaim to replace C and are explicit in support of C.

Rust evangelist promote Rust as replacement for C and frown upon anyone who has a contrary view including direct attack on those opinion.

Rust has a value like other programming languages and not a panacea As you said, it's just not a C replacement for another decade or two or may be never.

<comment> Avi-D-coder Zig is attempts to be a C replacement candidate, like Rust. What would make Rust or Zig a valid replacement in your opinion?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER17> Using JS to do SSR? How the turntables.

<comment><USER18> It wasn't well liked, but Netscape Livewire did JS SSR in the 90's.

</comment></comment><comment><USER19> I hate post titles containing TLAs I don't recognise.

(Three letter acronyms before anyone accuses me of hypocrisy)

<comment><USER20> SSR - Server Side Rendering</comment></comment>


Bugs, TDD and Functional Programming - <AUTHOR> http://dcsobral.blogspot.com/2012/09/bugs-tdd-and-functional-programming.html <comment><USER2> The author seems like a proponent of functional programming, not necessarily TDD. The input->output testability seems to vary much more than the author describes depending on system size. I love TDD, but even the most adherent acceptance testing fails to cover the case where you're laying the final brick in the arched bridge, to use his analogy.

It was a great article, and the author made very good points.</comment>


Any good api to scrape HN other than this? - <AUTHOR> https://github.com/karan/HackerNewsAPI how to scrape HN other then https://github.com/karan/HackerNewsAPI . any good premade library in python ? <comment><USER2> The robots.txt from news.ycombinator.com reads as follows:

        User-Agent: *
        Disallow: /x?
        Disallow: /vote?
        Disallow: /reply?
        Disallow: /submitted?
        Disallow: /submitlink?
        Disallow: /threads?
        Crawl-delay: 30

So nominally you should feel free to set up a scraper that crawls one non- disallowed resource every 30 seconds.

<comment><USER3> I see that submitted and threads are also not allowed.

What is a safe limit to crawl this data, if I have to absolutely need that data? 30 mins between users? 1 hour between users?

<comment><AUTHOR> i am following hnsearch api for long and found that they crawl user submission url and user details urls every 2-4 hours or so .

</comment></comment></comment><comment><USER4> Just use [https://www.hnsearch.com](https://www.hnsearch.com), along with [https://www.hnsearch.com/rss](https://www.hnsearch.com/rss) and [https://www.hnsearch.com/bigrss](https://www.hnsearch.com/bigrss) if you want to mimic the front page.

There is rarely a need to scrape HN directly, but if you do make sure your bot is polite (especially with respect to rate limits).

<comment><AUTHOR> I am trying to fetch all posts,comments plus all user data . I will ty hnsearch .

</comment></comment><comment><USER5> Yahoo pipes would work really well if you're willing to write a few HTML regexes or dom element selectors.

[http://pipes.yahoo.com/pipes/](http://pipes.yahoo.com/pipes/)

</comment><comment><USER6> Not a full featured api, but a way to scrape all of HN: [http://jcla1.com/blog/2013/05/13/crawling- hackernews/](http://jcla1.com/blog/2013/05/13/crawling-hackernews/)

Disclaimer: It's my own blog

edit: Uses HNSearch, so it doesn't violate the robots.txt and can be crawled faster

<comment><USER7> Did you manage to download the whole database that way? Edit: Also, why didn't you use the "start" (offset) parameter?

<comment><USER6> No, not tried to download it yet. Regarding your question, if you try to use a start > 999 you get this error: "Validation error: max limit is 100, max start+limit is 1000", which is why I avoided that parameter.

</comment></comment></comment><comment><USER8> You don't even need an api, all you need is an rss reader and read - [https://news.ycombinator.com/rss](https://news.ycombinator.com/rss)

</comment><comment><USER9> I wrote an alright one in Python for use in my HN app for BlackBerry 10. Not sure how good it is, but check it out here: [https://github.com/krruzic/Reader- YC/tree/master/app](https://github.com/krruzic/Reader-YC/tree/master/app)

I'm not sure what you're trying to do though. I used beautifulsoup because I couldn't get lxml working on BB10, but if it was switched to using lxml it would be much faster.

</comment><comment><USER10> [http://hnapp.com/](http://hnapp.com/) \-- This is the best HN Scraped site.. returns data in JSON / RSS format.

</comment><comment><USER11> Depending on what you're trying to do with the data, you may find [http://diffbot.com/products/automatic/](http://diffbot.com/products/automatic/) helpful for getting the clean article text and categorization in JSON format. It can be used as a complement/augmentation to the great suggestions here for getting the links.

Disclosure: Founder of Diffbot here.

</comment><comment><USER12> I wrote a Python wrapper for the iHackerNews API, if that helps.

[https://github.com/dmpayton/python- ihackernews](https://github.com/dmpayton/python-ihackernews)

<comment><AUTHOR> i saw your github repo . Wonderful work but saw your api was not working getting some errors when i tried the link [http://api.ihackernews.com/by/kaushikfrnd](http://api.ihackernews.com/by/kaushikfrnd). Can you confirm it will work if i run it on my own server .

<comment><USER12> Ah, looks like there's an issue with the iHackerNews API itself, which I don't have a hand in. You'll want to hit up @ronnieroller on Twitter. Sorry I can't be of more help. :/

</comment></comment></comment><comment><USER13> There's a twitter feed based on HN - [https://twitter.com/newsycombinator](https://twitter.com/newsycombinator)

You can use the twitter API and read from there

</comment><comment><USER14> There is hundred of data sets out there why it must always be HN?

<comment><USER7> Because quality datasets are hard to get. E.g. on reddit you would just get cats and memes.

</comment></comment><comment><USER15> I have a ScraPy-based crawler project available at [http://github.com/mvanveen/hncrawl](http://github.com/mvanveen/hncrawl)

</comment><comment><USER16> I built [https://github.com/cheeaun/node- hnapi](https://github.com/cheeaun/node-hnapi)

</comment><comment><AUTHOR> can anyone say me how to get [https://news.ycombinator.com/news](https://news.ycombinator.com/news) through hnsearch api . I want the api link -> [[http://api.thriftdb.com/api.hnsearch.com/](http://api.thriftdb.com/api.hnsearch.com/)] !!

</comment><comment><USER17> [https://www.hnsearch.com/api](https://www.hnsearch.com/api)

</comment><comment><USER18> Out of curiosity, Why does HN not release an official API?

<comment><USER19> My impression is that pg wants to encourage the hacker spirit by providing a bare bones service which could easily have a 'hacked' api built upon it.

<comment><USER20> _My_ impression is that HN's link and comment data is too valuable for pg to give away.

Certainly, if I have had access to it I know I could do some pretty useful sociology on HN's audience (= the pool of startup hire material).

<comment><USER19> I don't believe that HN restricts or discourages the scraping of HN content in any way... Other than the restrictions here: [https://news.ycombinator.com/robots.txt](https://news.ycombinator.com/robots.txt)

If you have a fabulous idea for how to use the data contained on this site, I'm sure everyone will be impressed and interested to see it.

</comment></comment></comment></comment><comment><USER21> other than this

</comment><comment><USER22> I wrote [http://scrape.it](http://scrape.it) and [http://scrape.ly](http://scrape.ly) to do this.

</comment><comment><USER23> try these

\- [https://www.mashape.com/scrape/scrape- it#!documentation](https://www.mashape.com/scrape/scrape-it#!documentation)

\- [https://www.mashape.com/karangoel/hnify#!documentation](https://www.mashape.com/karangoel/hnify#!documentation)

<comment><USER22> haha good to see someone link it! I am the author of Scrape.it currently on mashape. I also wrote [http://scrape.ly](http://scrape.ly) for crawling web pages and extracting data.</comment></comment>


Ask HN: Any startup jobs for person with PHD in CE but no wedbev experience? - <AUTHOR>

I'm currently living in Belgium and am in the final year of a Phd program in Computing Engineering.  I also have a masters in Supply Chain Management and Computing Sciences.
My area of expertise is Reinforcement Learning (Machine Learning), I know Java, C++ and Python.
I want to work for a startup in the USA but have no experience in web development, my interest is in algorithms and AI. Do startups need guys like me or are they more interested in people with webdev and front end experience? <comment><USER2> As a guy who's worked in several startups i'd have to say that yes, I think they do need guys like you but there is a catch. I've worked with lots of developers from tons of different backgrounds on three continents, but the one thing they all had in common was experience. Do you have experience in other disciplines? I don't mean do you know C++ but can you program your own AI for a Game Engine? Have you already done this? Can you apply your machine learning knowledge on an Open Source Web Analytics tool? Your definately backend (as am I) so I'd say just program something, open source it, and let that be your gateway in. Just as a curiousity what's your Doctoral work on?

</comment><comment><USER3> Hi! I'm a recruiter. It's always tough to get a web coding job w/ no web coding experience. One reason is that you may try it and find out you don't like it. Another reason is that it's trivial to get started in web development, so you should be able ti build something that shows off what you can do. Employers typically have very little imagination or ability to train new coders, so show them you can do it on your own.

</comment><comment><USER4> First rule of frontend wedbev: proofread :)

Sounds like you got backend skills. Build something small and useful, it will open other doors. Usually us frontend devs are lower on the totem poll than backend

<comment><USER5> I thought I was the only one who noticed</comment></comment>


Gestures + Reveal.JS - <AUTHOR> http://www.chromeexperiments.com/detail/gesture-based-revealjs/ <comment><USER2> Two things I don't like:

* multiple directional scrolling * hijacking my back button

At least they're trying. I would think you'd need something more sensitive than a normal webcam for gesture detection, so that's a feat in itself.

<comment><AUTHOR> I really think that it was a cool hack by William Walter Wu. When I first saw it I was expecting it to use Leap Motion[1], which made into HN's first page a few days ago[2].

Getting Leap Motion integrated with Chrome would be amazing, because, you are right, the webcam alone does not seem to be precise enough, as the author said:

 _It took me a while to write and fine tune the detection algorithms. Even then, the algorithms are only about 80% accurate_

[1] <https://www.leapmotion.com/>

[2] <http://news.ycombinator.com/item?id=5179335> and was not the first time:

<http://news.ycombinator.com/item?id=4250536>

<http://news.ycombinator.com/item?id=4170446>

</comment></comment><comment><USER3> the accuracy does not seem to have reached the level where it would be really usable yet. 80% accuracy means every 5th slide the transition goes wrong. but i suspect pouring some machine learning magic dust on this could get it there.

</comment><comment><USER4> super cool. can't wait to scare the pants off people at office >:)

</comment><comment><USER5> good experiment but accuarcy more like 10% than 80% , but again cool stuff , can make its effect during a talk in a conference.

<comment><USER6> spend half an hour you will get good accuracy.</comment></comment>


Legal analysis of the personhood granted to corporations - <AUTHOR> http://www.scotusblog.com/2010/01/analysis-the-personhood-of-corporations/#more-15376

<comment><USER2> It is hardly a radical idea in modern western society to treat a corporation as a so-called "legal person."

Only real people can think and act as individuals but there are all sorts of situations when they want to associate with one another, form groups, and act in some coordinated fashion through the group. All sorts of business associations fit within this category: corporations, LLCs, partnerships, limited partnerships, business trusts, trade associations, etc.

All sorts of other entities are not directly business-related but otherwise constitute groups formed for various important associational purposes: labor unions, non-profit organizations, political organizations, etc.

With respect to all such entities, somewhere in the law books one will always find some form of formal authorization recognizing that the entity can be established under law and that it has legal rights and responsibilities. It can take certain prescribed organizational forms. It can admit or exclude real persons as owners, principals, or beneficiaries of the entity. It can appoint real persons to manage its affairs within the rules and confines of what the law prescribes it can do. It can enter into contracts. It can sue. It can be sued. It has certain compliance responsibilities necessary to meet minimum requirements to begin and to continue its status as the particular type of entity that it is.

In giving these entities the power to act in this manner, the law effectively recognizes them as fictional "persons" for legal purposes only. This is short- hand way of saying that they have the same rights as individuals would have in a like situation. For example, if my corporation sells you a product and you refuse to pay, "it" (as a legal "person" acting through its lawfully recognized representatives) can file suit in a court of law to get a judgment against you and can exercise all available legal rights to enforce that judgment and collect its money. Similarly, "it" can go to a bank and open an account in "its" name. Or it can file "its" charter document giving it birth as an entity. Or file "its" dissolution papers signifying its legal death. In all such cases, "it" can only act through real individuals who do these things in some manner that the law recognizes as being in a proper representative capacity. They act as its agents and bind it legally in its affairs.

Can such entities commit torts or crimes? Absolutely. In such cases, the entity itself may be hit with money judgments or fines and its authorized agents who participated in the actions constituting the tort or crime may have direct liabilities of their own for their conduct, or even face criminal sanctions, including imprisonment.

Corporations are "persons" in the sense just described. As readily appears from this analysis, though, there is nothing at all strange about recognizing them as such. They are "persons" in the same way as, e.g., labor unions are "persons" - that is, the law recognizes their power to act lawfully as entities in the society and to do the things they are allowed to do under the charter and statutes authorizing them to be formed in the first place.

Against this background, a few observations about this piece:

1\. It is hardly correct to suggest that the Supreme Court does not know what it is doing by recognizing the "personhood" of corporations because, given this logic, the next step is to give General Motors a right to vote. Throughout decades if not centuries of experience in the law's dealings with entities, it has always been clear that the legal rights given to entities must be appropriate to the form of entity involved and need not extend to all rights held by living individuals. It is perfectly sensible to say that a corporation (or a labor union, for that matter) has protectable free speech rights but does not have things such as a right to vote. A vote represents the suffrage rights of the citizenry and inherently applies to individuals only. Speech can be done by real individuals acting as individuals or by entities acting through their authorized representatives advocating on behalf of the entity.

2\. All sorts of corporations have been routinely accorded free speech rights in an unbroken chain right up through this recent decision - they are called the "press," and everywhere we look we find the New York Times, the Wall Street Journal, and myriad other corporations exercising unquestioned free speech rights as organizations. What the Supreme Court did 20 years ago, and what was reversed in the recent decision, was to say that any corporation not acting as part of the press did not have protectable speech rights.

3\. The above constitutes a legitimate debate about the proper scope of the First Amendment. But the recent decision does nothing radical in this respect. It pretty much restores the politics of American issue-advocacy to the state it has always been in prior to the last decade or so.

4\. Nothing radical has been decreed with respect to the "personhood" of corporations. This is a long-established and non-controversial legal concept that has now been applied to a particular question of constitutional law over which various factions have vigorously fought. The application of the concept might be disputed, as it was in this case and by the majority and dissenting justices, but the concept itself can hardly be disputed unless we are to strip all entities of their power to function in our modern society.

<comment><USER3> * Throughout decades if not centuries of experience in the law's dealings with entities, it has always been clear that the legal rights given to entities must be appropriate to the form of entity involved* I think the point of the article is to argue this has just been tossed out.

</comment></comment><comment><USER4> I think it is kind of rediculous. Who's going to jail, if a corporation as a "person" robs, steals, beats or even kills? A Personhood is not only constituted by its acts, but also by it's intentions, the way it's intentions are created and least but not last: The way it suffers / can be punished.

<comment><USER5> I think it's a useful concept. Let me try to convince you of that: nearly everything we do requires corporations. A human alone cannot possibly get his opinions heard without help from other humans. In the end we really need corporations. We might to often have that wrong picture in our minds when thinking of freedom of speech, of the noble thinker, alone in his room, writing down his opinion and the government anxious to shut him down. That's probably not how it ever worked.

You need a publisher, you need an ISP. The government might very well grant you freedom of speech. If they can limit the rights of corporations however they damn well please that freedom of speech is not worth very much.

Corporations are how humans do stuff. Corporations are important. Corporations have to be protected from the government.

<comment><USER4> You're right. I have to agree with you on that. And I may haven't been clear enough, about what my problem is with awarding personhood to corporations.

I think that you can't judge corporations the way you can judge humans. You have to apply a different "personhood" to a company, since corporations are not natural. They don't consist of what a human being consists, but of what human beings contributed to that consistence.

<comment><USER5> Yes, I think they are different. Personhood is a useful concept but – I guess I'll have to agree with you – only to a point. I would argue that corporations should have rights, yet not necessarily always the same ones persons have. It's quite obviously complicated :)

<comment><USER6> If only we had a descriptive word for _corporations_ to help us distinguish them from persons...

</comment></comment></comment></comment></comment><comment><USER4> After reading the posts on HN a while, I've came across a lot of articles, that where about the ineffectiveness of interactions between people (e.g. 'the 10 startup-mistakes to avoid'). Just because more people working on something or investing more money on an issue, doesn't make their aim more intelligent. Neither their way of approaching it.

Considering a society, we allready have an entity that has to be maneuvered in the least stupid way possible. Adding new entities to that process doen't help if it creates new layers of hierachy. It's a matter o preferences I think: Is it for the 'greater good' (thing at the top of hierarchy) or is the greater good to serve the smallest entity (i.e. a human being).

Equating corporations with humans could deprive humans of their liberties, since corporations can speak, cry and lie louder. If the law is there to protect our liberties, I don't see how this aim is archieved more effectively by putting additional entities/hierarchies (i.e. corporations) in between.

</comment><comment><USER7> Interesting article. I was always under the impression that corporations weren't "persons" but "entities".

I have seen several references to "natural persons" as opposed to corporation or other entities, in various legal documents.

So I suppose that if corporations are "persons", then at the least they are (by inference) "unnatural" persons :)

<comment><AUTHOR> The funny thing with personhood conferral is that it was an obiter dictum (sort of non-binding comment made by the judges that is not part of the official decision) that was interpreted by the court stenographer in the 19th century Santa Clara County v. Southern Pacific Railroad (whose case was ruled in favor of Southern Pacific on a technicality rather than any explicit ruling on the personhood of corporations). So now with Thursday's Citizens United ruling, it will be interesting to see whether corporations will have to be federally chartered and thereby be revoked of constitutionally protected status or whether this case opens the door to potentially unfettered powers granted to corporations, now that campaign finance is protected "free" speech under the 1st Amendment.

<comment><USER8> NO NO NO! The _Citizens United_ case has had absolutely no change to "campaign finance", and the law and case law about campaign finance "reform" has always recognized its status as political speech.

What _Citizens United_ has done is to return to "corporations" (including the non-profit Citizens United that successfully sued the FEC) the rights to free speech and freedom of association they enjoyed prior to _Austin v. Michigan Chamber of Commerce_ and McCain-Feingold. No longer can governments censor (in the real meaning of the world) their speech in elections.

In both these examples, campaign finance and election period speech, there are still "reasonable" regulations, like various sorts of disclosure (although Thomas disagreed, based on the nasty retaliation that's been seen lately against people making small contributions to causes that many don't like; I expect this will be revisited after the first murder that comes from this disturbing trend).

For those who think this is a _bad thing_ , I say that the answer to speech you don't like is more speech, not government censorship of the speech you don't like. (Need I mention the slippery slope the latter presents?)

<comment><AUTHOR> You're right to say that Citizen United does not change how we view campaign finance as protected speech for humans. I definitely was wrong and unclear on that point, but I respectfully disagree about the implications of the Citizens United ruling: my point is that this ruling sets the stage for allowing undue power to corporations, both non-profit and for-profit. Corporations are not living beings with unalienable rights, so we should not have worried that limiting their speech would have implications for us human beings. For Scalia being such a conservative reader of the law, he certainly took a highly judicial activist position in this ruling.

excerpted from the article: In vivid contrast, the majority overruled a 19-year-old precedent (Austin v. Michigan Chamber of Commerce) that had lambasted the corporation, when it entered the political arena, because of "the corrosive and distorting effects of immense aggregations of wealth that are accumulated with the help of the corporate form and that have little or no correlation to the public's suport for the corporation's political ideas."

The problem with treating corporations as if they have a "right" to free speech and freedom of association is that they have a disproportionate amount of influence arising from their sheer size and aggregated wealth. We have other mechanisms to ensure that size and wealth do not override the voices of the small and poor in elections (look at how the Senate is constructed versus the House or how we have the electoral college to ensure that wealthier coastal states do not decide presidential elections).

And also, the fact that we grant any rights to corporations at all arises from a court stenographer's foot-note that later opened up loopholes for clever (although might I add shortsighted) lawyers in subsequent cases that eventually snowballed into granting rights to this nebulous entity. As Justice Stevens noted in his dissent to the Citizens United ruling, "A corporation is an artificial being, invisible, intangible, and existing only in contemplation of law. Being the mere creature of law, it possesses only those properties which the charter of its creation confers upon it." And yet, we worried that limiting the financial power of corporations will potentially infringe upon OUR (human) 1st Amendment rights. That is the problem for me. We created the corporate entity like a machine to serve our purposes; it does not exist with unalienable rights as we human beings do.

Who donates the most to campaigns, 501(3)(c) non-profits and charities or Fortune 1000 corporations whose explicit purpose is to generate profits for stakeholders?

<comment><USER8> You might be right as a matter of policy (I don't think so, but it's a debatable point), but as a Constitutional issue it's pretty clear to me and the majority of the Supremes that the right of groups of people who happen to speak through a corporation is strongly protected by the First Amendment.

Or, let's say, take your position to an extreme: that would entail forbidding the New York Times Corporation from publishing on politics. I'll note that they are the plaintiffs in two important First Amendment cases, _New York Times Co. v. Sullivan_ (<http://en.wikipedia.org/wiki/New_York_Times_Co._v._Sullivan>) and _New York Times Co. v. United States_ ([http://en.wikipedia.org/wiki/New_York_Times_Co._v._United_St...](http://en.wikipedia.org/wiki/New_York_Times_Co._v._United_States)), the first defined modern era libel case law and the second was WRT the Pentagon Papers.

Or does the provision for freedom of the press somehow carve out an exception for these "immense aggregations of wealth" (well, before the decline and fall of the MSM really got started).

As for donations, both 501 (c) (3) non-profits and companies are explicitly forbidden from donating to campaigns, they have to have individuals do it through a PAC.

<comment><AUTHOR> "As a Constitutional issue it's pretty clear to me and the majority of the Supremes" - that depends upon what kind of philosophy you take on approaching the role of the Supreme Court, activism to change policy versus narrow interpretation of the Constitution.

It's simplistic to say that Citizens United ruling is simply a matter of suppression vs. free speech, as Buckley v. Valeo has nuanced to what extent "money" constitutes speech. As Justice Stevens writes in his dissent, "At bottom, the Court's opinion is thus a rejection of the common sense of the American people, who have recognized a need to prevent corporations from undermining self government since the founding, and who have fought against the distinctive corrupting potential of corporate electioneering since the days of Theodore Roosevelt. It is a strange time to repudiate that common sense. While American democracy is imperfect, few outside the majority of this Court would have thought its flaws included a dearth of corporate money in politics."

Several people have cited examples of free speech and the press. The Citizens United ruling lifts restrictions of corporate spending in political ads during election campaigns with in-house corporate treasury funds, i.e. unfettered free speech at any time. Rather than looking at NYT Co v. Sullivan, look Austin v. Michigan Chamber of Commerce's interpretation. [http://www.moresoftmoneyhardlaw.com/updates/the_supreme_cour...](http://www.moresoftmoneyhardlaw.com/updates/the_supreme_court.html?AID=1457)

Excerpted: "Austin's critics aspire to dissolve all this complexity into a simplistic choice between speech and suppression. In attacking the "political support" language of Austin, they take it to be something strange, an import into the jurisprudence of a notion at odds with core First Amendment values. What they miss is its surprising ordinariness. The Austin case was getting at something important, even—one could say—basic to the mechanisms within the campaign finance laws for isolating the corruptive threat of aggregated group or associational spending."

I'm not arguing that corporations be denied their political speech via spending, which was outside of the case ruling anyway.

Free speech is controlled in very specific cases because of its potential injurious impacts - libel, safety, individuals versus entities, etc. What I take issue with is the extent of power given to special interest groups and lobbyists that override the interests of individual citizens. Is there a difference between groups of people coming together and pooling their money to form a PAC and group of people expressing political views of an entire corporation using corporation treasury funds?

And if you want to go into fringe, extreme positions: what about tax-paying subsidiaries in the US headed by groups of American citizens, but owned by foreign corporations? Should they not then be entitled to equal free speech in our elections?

In any case, it will be interesting to see what comes of the ruling, and thanks for highlighting those two cases.

<comment><USER8> Hmmm; let me only pose the question, was _Austin_ or _Citizens United_ the judicial activism? ( _Citizens United_ explicitly reversed _Austin_.)

As for the foreign corporations, yes, that's an interesting question not touched up on in _Citizens United_. As a matter of policy, those US citizens working for a "foreign master" (to put it in the worst way) are nonetheless affected by legislation, and I find it hard to justify completely excluding such a corporation from the arena of politics ... especially since full disclosure in this case is not as problematic for a company.

Pat Buchanan had an interesting/amusing proposal for dealing with foreign influences that I like, except that I don't see how to put it into practice: outlaw (in whatever method needed) lobbying by them unless done by foreign nationals.

<comment><AUTHOR> I don't know the answer to your question, and it's not a particularly useful exercise to make a blanket judgement on whether judicial activism is undesirable in every case.

What I wanted to refute was your initial statement that a majority of Supreme Court justice leads to a clear interpretation of the law. What I meant by bringing up judicial activism is to say that one's opinion on judicial activism can influence how one views Supreme Court decisions. Dred Scott v. Sanford is an example of a majority Supreme Court decision, that in my opinion, was undesirable, despite its "fair" albeit narrow reading of the law.

I can't help add, and this will be the last rebuttal I make since we're not going to sway each other's opinion, and I do feel like I messed up by adding something political to HN:

As for foreign corporations, again, I want to emphasize, as I did previously, that free speech is not black/white of merely include them carte blanche or else our rights will be infringed upon. Free speech is not that simplistic although it is sacrosanct.

Why not overturn Morse v. Frederick then, which I believe had such free-speech loving justices as Alito and Scalia from the Citizens United ruling also in the majority of that case. In Morse v. Frederick, free speech could be limited by "important—indeed, perhaps compelling interests" (taken from Justice Roberts writing the decision for the majority). Granted, it limits only illegal drug-promoting student speech, but it is again another example where the justices limited free speech and justified it on grounds of public interest that did not include immediate violence. The kid could still hang his "bong hits 4 Jesus" sign on his private residence or yell it on the streets. Corporations before Citizens United could still runs ads, as could PACs and the corporate executives _individually_ donating them. They just couldn't use corporate treasury funds nor could they run the ads a certain number of days before the date of the election.

Therein, lies the question of what one considers best for public interest. Blue-collar wages of workers have remained stagnant over the last 30 years while white-collar and executive salaries have seen a nice rate of growth. The Chicago School of Economics elegant theories towards markets have not been substantiated by the uglier, noisier empirical evidence. Having studied psychological/behavioral economics and interned for a government official as well as interned with a non-profit lobbying group, I have a more skeptical view of the "well-informed" voter and the "public" servant. So this largely explains why I think differently than you do.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> Some very sensible reforms are:

If you cannot become eligible to vote, you cannot donate to any campaign.

All donations must be reported online with 24 hours.

<comment> brown9-2 This is exactly what this article speculates on - if they have free speech, are they not entitled also to vote? Voting is a form of speech.

<comment><USER10> The answer is simple: corporations only have the rights they are granted by their owners.

I have the right to free speech and and I can use my possessions to exercise this right. I can criticize Obama verbally, in a document on my computer or I can publish that document to my website. Why can't I use my corporation to pursue the same goal?

I also have the right to vote. I don't get a second vote for my computer, however. Similarly, my corporation doesn't give me another vote.

Corporations don't have free speech. Their owners have free speech, and they can use their corporation to exercise those free speech rights.

<comment><USER11> Agreed. This does seem like an over-complicating of something very simple.

Five guys sit in a room and decide to use their poker profits to run a political commercial. It's all fine.

Same five guys sit in a board room and vote to use company money to run a political commercial. It's all bad.

I must be missing something.

<comment><USER10> What you are missing is that the people pushing regulations also want to prevent 5 guys spending their poker profits on political speech.

Some history: Back in 2000, a bunch of guys decided to use their money to run political commercials. These commercials persuaded people vote against McCain in the Republican primary. 2 years later, McCain pushes a law which tries to prevent this.

The goal of political speech limitations is to prevent anyone besides certain elites (and not other elites) from affecting an election. Since spending money is necessary to get a message out, they try to restrict spending money on political speech.

<comment><USER8> Bingo. Look at how Washington State persecuted the DeFoley8 people or in California the people who waged a campaign against Roberti and Roos.

With any luck this ruling will eventually result in an environment where people like the above who are merely expressing their dislike of powerful politicians will find it easy to follow a straightforward set of disclosure rules (and only that) and therefore the establishment won't be able to then ruin their lives.

</comment></comment></comment></comment></comment></comment><comment><USER12> Every time I hear one side or another of this argument, I think of Accelerando. First corporations gain status as individuals, then they become self-aware computers and ultimately convert all the mass in the solar system into a giant computer to run their simulations, expelling humans in the process. Maybe I'm just taking it too far...

</comment><comment><USER6> Sounds like the cyberpunk dystopia of corporations = the state is one step closer.

</comment><comment><USER13> What happens when (say) a car company designs a car whose fuel tank has a tendency to explode, or for the whole car to flip over in accidents? What happens if these accidents end up killing the driver? Is it manslaughter or murder?</comment>


Ask HN: Arcesium Culture - <AUTHOR> hi everyone,
Lurker here for a bit, but wanted to ask if anyone had any insight as to the culture of working at Arcesium. I saw they list themselves on the who's hiring for several months in a row. Any current or former staff willing to give some insights as to working there, compared to other shops ?
Much thanks <comment><USER2> You should get a fair idea via this video link:

[https://www.facebook.com/watch/?v=879765945745630](https://www.facebook.com/watch/?v=879765945745630)</comment>


Ask HN: What's the startup scene like in Austin? - <AUTHOR> We're most likely moving to Austin this fall (from Davis, CA). Given my interest in startups, my fear is we'll move from one startup desert to another. <comment><USER2> I've been in Austin for a number of years.

Austin has the whole "supply chain" of startups - from accelerators to large & mid-size technology companies. The network is close-knit but easy to access and people are very friendly here. Combine all of the aforementioned with the cost of living (albeit, it's increasing) and you have a great city to live in.

Highly recommend.

If you end up coming out here, please let me know and I'll buy you a coffee and am happy to introduce you to others/local events.

<comment><USER3> There's no email address in your profile

</comment></comment><comment><USER4> I'll start with that I am not from Austin. Having said that...

I think you will be fine if you go in with the right expectations. It's no Silicon Valley. so if you are expecting that kind of diversity and density startups you prolly will fall short of your expectations. Also, Having said that at the end of the day you need one company to work at a time. Also with COVID and wfh on the rise you might find a broader range of startups eventually but you shouldn't move based on that. If you think In terms of skills development I think there are more than enough startups to cover your basis.

<comment><AUTHOR> It's mostly skill development. I don't want at the end of my career to be a great big company programmer.

</comment></comment><comment><USER5> Austin is full of startups. It is no more a "startup desert" than Seattle or Boston.

The culture, size, and types of companies are different, as you'd expect when comparing completely different cities, but you certainly wouldn't feel like there's nothing going on. In fact, I think you'll be very pleasantly surprised coming from Davis.

It's definitely not like the Bay Area, but I'm not sure anywhere else (in the US) is yet.

<comment><USER6> I've lived in Austin for 6 years, my partner and I both work at startups.

IMO it's the maximum amount of "like the Bay Area" that you can get before it starts to become a negative. Unfortunately it shows no signs of slowing down in its movement toward that direction.

<comment><AUTHOR> We'll be doing our best to not move the bad parts of California with us.

<comment><USER7> The main problem is the sudden influx of money, and all the people driven out (or homeless) by the increased cost of living. Dunno what can be done about that.

<comment><USER8> Texas has a homestead law meaning unlike almost anywhere else, you can even keep your house in bankruptcy. There wasn't a lot of previous rental capacity before either. The gentrification is in every way more humane than Seattle or Sf.

The property I bought was developed after someone died. Granted there was no inheritance because it had accrued 1.4m in backtax, but the previous resident got to live out their home despite poverty. That's the case with most new construction within the city.

The homeless travel here because it's more tolerable to be homeless here than many places.

<comment><USER6> Most of those being pushed out are not homeowners, and Texas in general is not nearly as friendly to homeless/drug addicts/other people down on their luck as California is. Austin is better in that regard than the rest of Texas, but still.

<comment><USER8> What neighborhood of previously existing rental property do you have in mind? Most of Austin's rental capacity was built in the last 15 years. I find Austin's increase in housing supply to be a much more humane alternative to SF's 'market' having lived both places for many years.

</comment></comment></comment></comment></comment></comment></comment><comment><USER8> Just buy a plane ticket and talk to random people in capitol factory which is host to a ton of startups. There's no replacement for visiting.

<comment><AUTHOR> Might not get another visit in before we move this fall. It only occurred to me late in our city shopping that I should be also poking at the startup networks.

</comment></comment><comment><USER9> I think there's a decent number of startups here. Not sure about how much innovation you'll find though. Most of the ones I've seen are doing boring stuff like real-state or selling bs with their ML/AI products.

Also checkout [https://www.builtinaustin.com](https://www.builtinaustin.com)

</comment><comment><USER10> Awesome! I've been here for 8 years and love it. There are plenty of startups, a large public research university with tons of CS kids coming out, and lots of offices for typical tech companies.

Email or tweet me and I can point you in the right direction. I'm part of a Clojure meetup here that has some startup people that come often.

<comment><AUTHOR> Awesome, I'm also lisping these days. Followed on Twitter. Thanks!

</comment></comment><comment><USER11> If you are looking to work in startups, not sure Austin is the right choice. Look at the top cities by VC dollar raised, and Austin has lagged quite a bit over the last 10 yrs. Of course, SF and SV are top 2, followed by NYC which is a distant second. Boston is 3rd, Seattle 4th, and LA area 5th. If you think about unicorns and decacorns over the last decade, I know there are 1 or 2 Austin startups, but it is a far cry from Bay Area or NYC, which has household name startups.</comment>


PHP: An Introspective Retrospective  - <AUTHOR> http://www.goondocks.com/blog/08-02-24/php_an_introspective_retrospective.aspx

<comment><USER2> Fairly useless article for anyone who hacks. I'd ask the author to get another half-dozen languages under his belt before he bellows about what is right or wrong about this or that language.

PHP is an accessible language. It's on every Linux installation. Name a page .php and it just works. (What other language "just works"?) Open the page and with a little fiddling even a novice can create results.</comment>


Infinite loop in C  - <AUTHOR> http://furconit.wordpress.com/ugly-code/

<comment><USER2> Huh? Overflow in C doesn't cause a run-time error. Overflow of a signed integer is technically undefined but whatever the result is, it should just keep running.

</comment><comment><USER3> There are so many things wrong with that code its not even funny...

First off counter is of type static int. not unsigned int like the article says. Secondly j is decremented, j isn't even defined.

They are however right that it most likely will crash due to an overflow problem. Though this is not necessarily true.

<comment><USER2> "int" is signed unless you specify "unsigned". So "static int" would be a signed int that is also static.

Also, I see no reason why it would crash. Once it gets to the max value, incrementing would return some other value but I've never seen C produce a runtime error for an integer overflow.

<comment><USER4> Technically an overflow on a signed variable results in undefined behaviour so it could crash out, but all the compilers I've tried just wrap around.</comment></comment></comment>


Ask HN: How to compare costs of compute providers? - <AUTHOR> I've got some services which are mostly compute bound (image processing etc). They are packaged as Docker images, don't require much else (blob storage and a message queue), so it can run on almost any cloud provider. AWS, GCE, Azure, etc..
Naturally I'd like to use the cheapest. However it is really hard to compare different providers. The provided workers are all different performance (CPU/RAM/disk/network). There are steps and limits in the worker pricing. With autoscaling the timebase (per hour/minute/second) becomes significant..<p>Are there good cross-cloud comparison tools for pricing? How do you compare? <comment><USER2> Hi,

I'm building this exact thing:

HTTPS://www.cloudrac.es

I would love to help you work this out, my email is email@example.com

This is an example of the sort of insights I have been finding:

[https://www.cloudrac.es/blog/2017-01-12/Azure-Comparing-F- An...](https://www.cloudrac.es/blog/2017-01-12/Azure-Comparing-F-And-H-Series- CPUs/post.html)

Ed</comment>


Are language workbenches dead? - <AUTHOR> https://medium.com/@dslmeinte/are-language-workbenches-dead-4b05d1698d3c <comment><USER2> _" Martin Fowler coined the term somewhere in 2005"_

I expected a text about, for example, APSE ([https://en.wikipedia.org/wiki/APSE](https://en.wikipedia.org/wiki/APSE): _" Ada Programming Support Environment was a specification for a programming environment to support software development in the Ada programming language."_) from 1980 (more info at [http://www.adahome.com/History/Stoneman/stoneint.htm](http://www.adahome.com/History/Stoneman/stoneint.htm))

<comment><USER3> I have some (paywall) trouble accessing the article you reference, so I cannot really comment, but to me that seems to be describing an IDE, not necessarily a LWB that produces an IDE for a (set of) DSL(s).

</comment></comment><comment><USER4> This reads like it came from an alternate universe; I've never heard about any of this stuff before, and I can't imagine how any of the concepts described by these unfamiliar terms relate to anything I know about software development. Always fun to discover that the world is more complicated than it first appeared.

<comment><USER3> Happy to oblige, even if LWBs are meant to make things less complicated ;)

</comment></comment><comment><USER5> The Racket ecosystem allows developers to create DSLs as they like. Does it qualify as a "language workbench"?

<comment><USER3> Since Racket participated in the Language Workbench Challenge 2016, the answer is a resounding YES :)</comment></comment>


Final is live – First 750 invites going out today - <AUTHOR> https://getfinal.com/company-news/2016/06/29/were-live-thanks-to-you-awesome-people/ <comment><USER2> Been waiting a long time for this to go live. Congratulations, Final team!</comment>


Idea dump #4 | willgrant.org - <AUTHOR> http://willgrant.org/idea-dump-4/

<comment><AUTHOR> Fourth update to the pages where I 'open source' some ideas...</comment>


Show HN: In-site customer engagement tool by WebEngage - <AUTHOR> http://webengage.com/?ref=HN

<comment><USER2> The site design has come a really long way. Nice job!</comment>


The iPhone XS and XS Max Review: Unveiling the Silicon Secrets - <AUTHOR> https://www.anandtech.com/show/13392/the-iphone-xs-xs-max-review-unveiling-the-silicon-secrets <comment><USER2> __Big takeaways: __

\- A12 has 8MB on chip "SoC cache"

\- Big core L1$ = 128kB; Little Core L1$ = 32kB

\- For the big core, L2$ is a whopping 128 instances 6MB per core/thread, 8MB at 64KB/inst.

\- Little core L2$ is 32 instances, 1.5MB per core/thread, 2MB at 64KB/inst

\- A12 GPU uses memory compression!

\- A12 Big has 2.38 GHz base clock and 2.5 GHz 1 core boost

\- A12 Little has 1.538 GHz all core, and 1.562 GHz 2 or 3 core boost, and 1.587Ghz 1 core boost

\- A11 and A12 have a 7-wide decode (up from 6 on the A10) and 6Int ALU (up from 4 on the A10)

\- Apple's microarchitecture seems to far surpass anything else in terms of width, __including desktop CPUs __

\- SPECint /fp Numbers show that it's got 2x the speed of and any all other mobile SoC's. 3x perf/watt if you normalize speed / power consumption.

\- SPECint/fp numbers also show that the A12 is __faster than a skylake server cpu __(in core-for-core IPC). Not a perfect comparison, but far better than Geekbench

<comment><USER3> What does "in terms of width" mean in this context?

<comment><USER4> width in this context means number of CPU execution ports or how many INT/FP operations CPU core can perform at the same time

</comment></comment></comment><comment><USER5> Apple CPU Architecture excellence is nothing short of amazing. iPhone XS A12 processors are 2x or 3x the speed of a Snapdragon 845 (Pixel 3) and have lower power consumption. For these benchmarks they're approaching consumer desktop CPU performance, which typically draw 40-50 watts, using only 4 watts in the A12. [https://www.anandtech.com/show/13392/the-iphone-xs-xs-max- re...](https://www.anandtech.com/show/13392/the-iphone-xs-xs-max-review- unveiling-the-silicon-secrets/4) …

<comment><USER6> On the one hand I'm excited about Oculus Quest's promise for untethered VR. On the other, it's built on the Snapdragon 835 (last year's flagship to keep costs down) and I can't help but wonder what they could do if they had Apple's hardware instead.

Of course Apple's only publicly interested AR stuff with their phone-based ARKit, but media and gaming are huge markets for them. I don't think an Apple VR headset is out of the question, and it would 100% be an untethered device like the Quest is.

<comment><USER7> I'm not at all excited by Quest for reasons of performance. I just want a high DPI, wide FOV unit for use with my high end PC... so I'm holding off for the foreseeable future.

<comment><USER8> I am holding off for more social reasons. But then I don't watch much TV either.

</comment></comment></comment></comment><comment><USER9> Crazy how far ahead the iPhone is over every single Android phone. I moved over years ago because of the horrible hardware, lower-quality apps, and lack of support. Seems like this trend will continue.

<comment><USER10> I don't think that's a fair statement.

The processor is one of the only thing Apple has a clear lead in over Android flagships. (Others being customer support and longevity)

Android hardware and software are fully stable now. Android phones have better cameras and match apple in most other hardware metrics (display, speakers, antennas, build, touch response)

Software wise, it comes down to preferences. Both have a few things they do well, and others they stumble on. iOS12 is from what I have heard, smoother as butter. However, top flagships from Samsung, Google, OnePlus all run Android without any stutter at stable 60fps too.

All of my daily apps/usecases are at parity with their iOS. I don't know if the app ecosystem complaints are valid in 2018. (Apart from snap chat, because they have some wierd hate for Android)

I can respect your choice of wanting an Apple device. Especially if you are invested in their hardware and software ecosystem. But to someone who isn't, the iPhone does offer enough to switch from Android.

<comment><USER11> >>> The processor is one of the only thing Apple has a clear lead in over Android flagships.

This is the only thing I do not give a shit about. A much slower CPU would be just fine. The true advantage is the UX. Just try to disable automatic grammar correction on both iOS and Android and count the number of items you had to go through. It is insane how much crap Android has for every single thing. Designed by engineers for engineers mentality is the root cause here. Apple puts the user in charge how an mobile OS should look like or should behave and this is the biggest differentiating factor between iOS vs other platforms.

<comment><USER12> But I can't root my iPhone and use it as a Node.js server whilst simultaneously sniffing 802.11 traffic at DefCon. Therefore it's useless to me, and to everyone else who owns a phone as well.

/s

<comment><USER13> Unlike with iOS, you don't need to root your phone (or pay Apple a yearly fee) to do those things and many more on an Android.

<comment><USER14> That comment was sarcastic. It was intended to mock common pro-Android arguments by pointing out that the author doesn't care about doing that at all.

</comment></comment></comment></comment></comment></comment><comment><USER15> _" What is quite astonishing, is just how close Apple's A11 and A12 are to current desktop CPUs. I haven't had the opportunity to run things in a more comparable manner, but taking our server editor, Johan De Gelas' recent figures from earlier this summer, we see that the A12 outperforms a Skylake CPU."_

How do they do it?

<comment><USER16> I'm pretty skeptical of this. 3 W mobile CPU outperforms 165 W desktop CPU? If it was the case, they would have those things in macbooks already, and would boast tens of hours from one charge... If you go to the article that is mentioned in "recent figures", they tested single-core performance. So it was single core of a 28-core CPU (with boost though). It's still impressive, but not unbelievable.

<comment><USER17> The reason they don't have them in laptops is not because of performance, it's because they don't have an OS. A laptop that only runs iOS is called an iPad and it doesn't have the software I want to run.

<comment><USER16> My point was that if they had this abysmal advantage now, it means they would see it coming several years prior and would work on OS and anything else it needed.

But it's not the point, main point is that I think statement that current A12 is close (to whatever reasonable %) to top desktop chips is simply not true. I didn't see any concrete evidence of it, and everyone just seem to like this idea, that's why it was talked much lately. I'm all for great advantages and all that, but I still must use common sense, 3-4W vs 150+ W - that's too much.

<comment><USER18> People aren't comparing 3W mobile chips to 150W desktop CPUs. They're comparing like for like in terms of perf/watt. Skylake isn't a particular SKU, it's a micoarchitecture generation, from which Intel can scale the design from low power 10W parts to power hungry server chips.

<comment><USER16> Article reference specific CPU - Xeon 8176. It has 165W TDP.

</comment></comment></comment></comment></comment></comment><comment><USER19> > Overall the new A12 Vortex cores and the architectural improvements on the > SoC's memory subsystem give Apple's new piece of silicon a much higher > performance advantage than Apple's marketing materials promote. The contrast > to the best Android SoCs have to offer is extremely stark – both in terms of > performance as well as in power efficiency. Apple's SoCs have better energy > efficiency than all recent Android SoCs while having a nearly 2x performance > advantage. I wouldn't be surprised that if we were to normalise for energy > used, Apple would have a 3x performance efficiency lead.

Wow.

<comment><USER20> Wow indeed. I'm impressed that Apple has managed to create and maintain such an insane lead in ARM performance for such a long period of time.

Does anyone know of more technical reasons for Apple's ARM processors outperforming everyone else's by such a large margin, and for such a long period of time? Seems like there's some fundamental difference in what Apple is doing, and I'd love to read more about it.

<comment><USER21> Just speculating but surely it must have something to do with the entire stack being designed under one roof, no? Having the kernel devs be able to walk across the campus and ask the hardware guys what a register is for must speed up development immensely.

<comment><USER18> Once the CPU reaches peak frequency the OS shouldn't be involved for CPU benchmarks. So it's more down to hardware.

<comment><USER22> I can see how the compiler and stdlib (aren't things like memcpy implemented in hand-tuned assembly?) could be highly relevant, though.

<comment><USER18> They are, but that's really low hanging fruit. If Android for example doesn't use optimised memcpy implementations then they don't deserve to exist as a serious OS.

<comment><USER23> That reminds me, when I read fast code in the 90s-2000s all the asm hackers were into writing their own cool memcpy. Were they just showing off, or did Windows actually never optimize their standard library?

People still seem to like writing their own cool malloc, but memcpy not so much.

<comment><USER18> There are some cases where it may make sense to write your own implementation, if you have a niche microarchitecture that has unusual performance characteristics that the OS doesn't provide optimized routines for by default. But for most u-archs the default optimized routines should do a good job.

Things like malloc are quite a bit more complicated, and more workload dependent so there's still some opportunity specializing an implementation there.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER24> I don't think people realize how important this story is. Apple is about to take the single thread performance crown from Intel, who has held it nearly uncontested for, what, a decade or more? And they're doing it in a _phone_! Imagine what they could do on a laptop or desktop power budget. I'll bet you won't have to imagine much longer either, as I expect an ARM Mac within a few years.

<comment><USER25> > Apple is about to take the single thread performance crown from Intel

I believe they already have that crown have for mobile/low-power, but for desktop/servers nop... not even close considering the microarchitecture their processor are being designed they won't even be close to what intel already does with a single instruction.

<comment><USER2> Those AVX instructions are quite costly though.

</comment></comment></comment><comment> gm-conspiracy _Indeed in terms of cellular connectivity, the new iPhones boast a significant jump as we've seen an upgrade in download speeds to a gigabit for LTE networks._

I would like to see this speedtest and know the location, please.

<comment><USER26> We saw 120Mb/s from our office in Maryland - Annapolis. Older iphones getting only 20Mb/s

<comment><USER27> I'm getting 120mbps on iPhone 6s in Seattle (T-Mo).

</comment></comment></comment><comment><USER28> This may be obvious to many but I just noticed that the iphone's default wallpaper is designed to hide the notch.(at least I assume the wallpaper in this review is the default)

<comment><USER29> To me the screen notch and the camera bump are frustrating design abominations.

We participate in a mass delusion where we pretend modern smartphones are edge to edge screen - but they can not be used like that. You either bulk up your phone with a protective cover or you inevitably break the screen. The super tough "gorilla" glass is not suitable for the intended use: using your phone every day in a real world environment. We all pay premium for thin, light, glass/metal, all-screen phones with notches and bumps only to hide them in second plastic bodies made in China.

<comment><USER30> I've not had a cover on an iPhone, and have owned every iPhone since the original. I've broken 1 (and a case wouldn't have saved it..it got run over). Not everybody is fucking gorilla handling their phones. Some of us can have nice things...

<comment><USER31> I used to throw my blackberry at people. One time it missed and it skipped over a natural slate floor like a pebble over water - no damage. Also dropped it on cement many times. Never a scratch (sometimes had to pop the battery back in)

Compared to my first iPhone 3G w/ rubber+shell case which I absolutely demolished in my jeans longboarding my first time. I still feel bad about that.

At some point phones became less durable than my own body. It's just different.

<comment><USER32> > I used to throw my blackberry at people.

Is there any modern smartphone that would take this kind of abuse?

<comment><USER33> Is there any _person_ who would take this kind of abuse?

</comment></comment></comment></comment></comment></comment><comment><USER34> At this point I'm fairly confident that my XS is more powerful than my 2008 Mac Pro tower. How long before Apple goes full ARM for all of their future products? Owning basically the entire hardware chain.

<comment><USER2> I'd give it 2-3 years. They need to implement Marzipan fully, first.

<comment><USER32> Why would Marzipan have anything to do with switching to ARM? All of those apps are running on x86.

</comment></comment></comment><comment><USER35> I wonder if Apple will ever get into the server market, even indirectly through licencing their cores.

<comment><USER36> I've no idea if the following would make real-world economic sense, but if their chip design truly is in a class of its own in terms of power efficiency then there might be a competitive advantage to using them exclusively in their own datacenters.

</comment></comment><comment><USER37> Android isn't keeping up anymore.

</comment><comment><USER38> The iPhone prices are ridiculous. It can cost as much as 5 average Chinese Android phones. Maybe they don't have such fast CPU but still are pretty usable, and often have similar amount of RAM. Don't understand why people choose to pay more just to buy a device to browse Instagram or Telegram.

</comment><comment><USER39> It seems obvious, to me at least, that within the next decade, desktop/laptop/server makers will jump ship to ARM. Cheaper, faster, lower power chips with fanless designs and longer battery life. I can't for the life of me figure out why Intel's stock is valued so highly today. What am I missing?

<comment><USER40> It's the same reason a lot of other tech dinosaurs are valued so highly. They've been around forever and people are betting on things staying the same rather than changing.

</comment></comment><comment><USER41> > Cellular ... UE Category 16 LTE (1Gbps) with 4x4 MIMO and LAA

Do cellular providers allow 4x4 (or even 2x2) connections? Do they provide gigabit bandwidth to individual devices? I'd be surprised if they simply handed out bandwidth to whomever could suck down the most.

<comment><USER42> Yes, because cellular providers now mostly bill by GB rather than unlimited. If you can suck down a GB in 10 seconds that's a GB of bandwidth they sold in 10 seconds instead of 1 minute.

</comment></comment><comment><USER43> That web site is so full of cruft, it has become unusable. Even the best iPhone can't change that.

<comment><USER44> Funnily enough, even a 5S can, in fact, change that. For all its terribleness, it doesn't seem to mess with reader view _at all_.

</comment></comment><comment><USER45> Steve Jobs would never have allowed the UX regressions that have plagued the X and XS iterations.

<comment><USER46> Steve "you're holding it wrong" Jobs wouldn't let a product ship with a bug?

</comment></comment><comment><USER47> iPhone X or Xs is no good and a UX step backwards...

\- No I don't want to take hundreds of accidental screenshots a day & upload them to iCloud

\- In traffic jams I want to grab my phone with my thumb and have it open right away as my iPhone 8 does. Not mess with it.. put it up to my face & push up to open it. Why add a step?

Im taking this junk back today!

<comment><USER48> Why are you on your phone while driving?

<comment><USER49> Probably to find an alternate route.

</comment></comment></comment><comment><USER50> I'd love to upgrade to these epic new phones, but I won't, because FaceID…

Removing the fingerprint reader ruined the usability for me.

<comment><USER51> I just upgraded and honestly FaceID is really nice. I loved TouchID but there were plenty of times it didn't work because my fingers were too moist or whatever. FaceID really doesn't have any issues other than using it too close to your face.

<comment><USER52> I wish you could teach it multiple faces, because it doesn't work for me if I have stuff on my head, like a bike helmet and sunglasses, or ski goggles, etc

<comment><USER53> In iOS 12 you can set an alternate face. You know have two total faces you can set for FaceID.

<comment><USER52> Amazing. I did not know this, thanks!</comment></comment></comment></comment></comment>