A reboot of PHP: keep the philosophy, improve the syntax with the jvm - <AUTHOR> https://code.google.com/p/phpreboot/ <comment><USER2> PHP has only one feature going for it: it already exists. As soon as you introduce a new programming language, you lose what PHP has to offer. Another success is the lack of a library culture -- just copy-and-paste code into your app, and you never have to worry about installing dependencies on your shared host.

If you want a better version of PHP, try Perl / Python / Ruby. If you want a language that can check your code for safety at compile-time, use Haskell. But if you invent your own language, it will have three problem: nobody will know how to use it, it won't be installed on any three-dollars-a-month shared host, and it won't have any libraries.

If you can't solve the "I want to use it for $3 a month" problem, your programming language is a failure compared to PHP. If you can afford more than $3 a month for hosting, then you're not using PHP anyway. Most people learn to program because they want to share something with their friends. They choose PHP because it lets them do that, and they don't have the experience to know that They Are Doing It Wrong. By the time you introduce a PHP "reboot", you're not going to get that "Don't Know That I'm Doing It Wrong" crowd anymore, and then who's your audience?

Writing a new programming language is fun, but don't expect it to replace PHP. That's going to be impossible unless your rewrite is shipped from php.net and replaces what exists now.

<comment><USER3> So Facebook must be on those $3 per month servers... right? The only thing you said that make sense is the last sentence.

<comment><USER4> [http://www.quora.com/Why-hasn-t-Facebook-migrated-away- from-...](http://www.quora.com/Why-hasn-t-Facebook-migrated-away-from-PHP)

They use it cautiously and reluctantly because they don't have much choice at this point. The Asana and Quora founders ditched it at the earliest opportunity.

<comment><USER5> Asana and Quora ditched PHP? Is it supposed to be news that a small tech company changed their architecture? Happens all the time.

</comment></comment></comment></comment><comment><USER6> Hi guys, I'm the author of PHP.reboot and also one of the guys that worked on JSR 292 (invokedynamic in Java). First, I don't know based2 and please don't be too serious, PHP.reboot was written as a small prototype to see what can be done on top of invokedynamic. It was also used to debug the hotspot implementation of JSR 292.

The language is tailored unlike any dynamic languages. Instead of adding features and wondering how to optimize them after, I have worked backward and carefully pick/design features only if I was able to optimize it to be at least as fast as Java.

The hidden jewel of PHP.reboot is its runtime which first interpret the script and then use a type inference/type checker algorithm to try to emit exactly the same bytecode as javac. So some parts of the language are quite fast, but not the whole language because some parts still run in interpreted mode only.

As a demo, I've taken the mandelbrot benchmark from the Computer Language benchmark[1] and write it in PHP.reboot (I hope with no mistake). Here is the result on my laptop:

[forax@localhost phpreboot]$ time bin/phpr.sh test/mandelbrot.phpr >/dev/null

real 0m34.189s user 0m34.087s sys 0m0.088s

You can compare with your favourite dynamic language :)

cheers, Rémi

[1] [http://shootout.alioth.debian.org/u64/performance.php?test=m...](http://shootout.alioth.debian.org/u64/performance.php?test=mandelbrot)

<comment><USER7> If you're serious about this moving forward, I very strongly suggest renaming it. PHP.reboot is a very hostile, aggressive name that is clearly trying to steal thunder. Call it a reboot of PHP informally, playfully base the name off of PHP somehow, but don't outright call your language "PHP.something that Google won't correctly parse as part of the same word so the search will still pull up nothing but PHP results". In addition to the hostile nature of the name, being effectively Google-blacklisted isn't a great way to start.

Also, admittedly off of just a glance, beware the specialized syntax sinkhole. Can I easily take two XML snippets and compose them together somehow? Can I easily take two SQL snippets and compose them together? A lot of times these specialized syntaxes make for cute-looking demos but in practice work out worse than just using language constructs because they are _so_ highly specialized you can't do anything with them but exactly the one use case the author had in mind. I'd submit there's a reason that basically no large-scale successful language has this sort of specialized syntax built into it, and you may want to ponder on those reasons until you understand them. It isn't because it's hard to write the grammar or anything implementation-related like that. (And I'm not saying don't do it. Personally, I think it's a solvable problem. Look to LINQ for what is probably the closest to date. I'm suggesting you try to spend some time understanding why the obvious solutions haven't worked before you go too far down what can be a language-killing rathole.)

<comment><USER6> Here is why I've chosen the name the language PHP.reboot. My father ask me to patch one of the page of his website written in PHP so I've written one page of PHP. 3 days later, my younger brother (not 18 years old at that time) call me and ask me to never touch a PHP page again because I had introduced 3 security holes. It was a painful day for me, I have a Phd in Computer Science, I study computer languages, compilers and runtimes but I'm not able to write a correct PHP script.

That's why I think I own the right to call this language PHP.reboot.

Rémi

<comment><USER8> Don't get me wrong, I think the project is a neat one. I like the features, I like the goal, and honestly I just like new-language projects in general. So please don't think I'm hating on the project.

But your argument for the name is so utterly broken.

First of all, having a PhD in CS and introducing 3 security holes is no reason to blame the language. It's not even necessarily a reason to blame yourself. Since when is a PhD in CS supposed to make you a good software engineer? If it is, I know a lot of PhDs who got a raw deal.

Second, how does your language fix the three security bugs you introduced? The only security feature I see in your highlights list is "secure by default: no eval, no magic quotes/string interpolation". 99 out of 100 competent PHP programmers force magic quotes off (so if your brother didn't, he can shut up), and most bugs that can be introduced with string interpolation can be (and usually are) introduced with string concatenation (which I assume you can still do).

Third, the main thing you demonstrated with this story (as others have said) is that you aren't very good with PHP. That's no big shame, but it's also not a reason you "own the right to call this language PHP.reboot". This reasoning is crazyface.

Fourth, as others have said, calling it "PHP.reboot" just confines it to the ghetto. If it were to grow, people wouldn't be able to search for articles/blogs/forums/help/mail/etc about it without getting lost in the PHP (even admitting that for me googling "php reboot" does return your google-code repo). And right in the name it says "I'm the wanna-be little brother of the big successful language". Although I don't think this last criticism is a problem, because I assume the goal was not to actually replace PHP, because that's impossible for reasons others have mentioned. So, no big deal.

The GOOD argument for the name is "It's just a toy language, so it doesn't matter what it's called, and rebooting PHP was my motivator when I started this particular project."

Oh, and as an aside, if one page of PHP is your web programming experience, then you really should probably not be shipping an HTTP server.

<comment><USER9> > Oh, and as an aside, if one page of PHP is your web programming experience, > then you really should probably not be shipping an HTTP server.

I disagree. How are webprogramming skills applicable to writing a HTTP server? Seems to me the relevant skill would be network programming and my (admittedly limited) web developing experience leads me to believe the skills are mostly if not completely disjoint...

<comment><USER8> Yeah, that's absolutely true, so I overstated my case somewhat on that point (although in my defence I did say "probably"). So, in place of the mis-stated claim in my original comment, let me try that part again.

Writing robust high-load network servers is actually a little tougher than it seems, and the skillset has very little overlap with the "designing a nice language" skillset, or the "making an efficient compiler" skillset. And not only is robustness is important, but to be useful it probably needs a lot of auxiliary features like HTTPS and authentication and logging and FSM-knows- what-all (this point, on which features matter, is the only place that web- programming experience might actually be relevant). And so tacking a half- assed HTTP server onto your new-language project is, well, half-assed. And IMO, there are enough shitty toy web-servers out there already.

</comment></comment></comment></comment></comment></comment><comment><USER10> Sometimes on rainy nights when I've had a few too many glasses of wine, I dream of doing a PHP "reboot": something with syntax and features like C#, which I personally love, but without the sometimes deceptive magic that goes on behind the scenes of stuff on the .NET stack. Just output HTML to the browser, no compilation required, arrays like PHP, and sane and useful built- in libraries. FOSS.

Sometimes I even think it would be a good idea to half-ass it and just create a "wrapper" type library to map built-in PHP functions to namespaced and standardized (naming, parameter order, etc.) functions.

Then I usually wake up in the morning with a bad hangover and a deep sense of sadness.

<comment><USER11> ASP.NET Web Pages/WebMatrix is pretty close to what you describe. Nice syntax with Razor and full .NET framework access with some shortcuts added on.

</comment></comment><comment><USER12> What exactly is the philosophy of PHP? You should write a bit about it on the project page.

Right now it looks like a completely different language, and you might as well just give it an original name. I'm having a bit of a hard time seeing the connection to PHP here.

</comment><comment><USER13> As a PHP developer, I'm less than enamored by this because it seems as though it increases spaghetti code.

\- Embedded sql in the fashion of php.reboot is dirty.

\- No open/close tags and using brackets sounds error prone.

\- I'm also personally a fan of the dollar sign.

It appears as though what you really want is Ruby.

<comment><USER14> "- I'm also personally a fan of the dollar sign."

May i ask why? i think that this makes the languaje very ugly.

<comment><USER15> Here's a contrived example to demonstrate the value of sigils:

        /* in version x of SFL (Sigil-Free Language) */

        school = get_school("Saint Fred's School For Girls");
        class = get_class(school, "Agricultural Studies", 12);
        yield = get_agricultural_yield(class, "Turnips", 2011);
        printf("The Year 12 Ag Studies class produced %d turnips in 2011", yield);

Now we try upgrading to version x+1 of SFL, which adds object-orientation and concurrency (it was a BIG upgrade!). Now three of the lines in that four-line program contain errors, because "class" and "yield" are no longer valid variable names, having been turned into keywords.

In a language with sigils, that's no problem. It also makes it easier (therefore faster) for syntax highlighting to spot where variables are used, without needing a full dictionary and an exact version number - that makes a difference for me as an Emacs user especially.

<comment><USER16> While true, it's a very minor deal because the scenario you've described:

\- Happens very rarely \- Is trivially solved, even in a large codebase

</comment></comment></comment></comment><comment><USER17> When will people realize that the main reason PHP was/is so successful has nothing to do with the language? PHP got huge because it's free and super easy to deploy on commodity-level hosting. Ubiquity breeds popularity.

Basing a reboot on the JVM makes little sense in this context.

That said, you lost me at "less ';' like in javascript".

<comment><USER18> IMO you are only partially right and some of PHP's success does have to do with the language and not just availability.

As horrible as PHP is, it is really easy to sit down with PHP and a tutorial or a book and start banging out code that gives you instant results. PHP is like the MS Basic 2.0 of the web era -- people who aren't really programmers (yet?) can sit down with it and GTD right away -- their code may be ugly but they can see it working as they go. They don't have to learn what a 'WAR' directory is and how it is structured, they don't have to mess around with xml configurations, etc. The ubiquity helps, certainly, but IMO the reason it got ubiquitous is how easy it is to go from nothing to "hello web world".

I think a project that maintains this instant GTD environment but improves the language is actually quite a good idea, though I also think cutting ties with PHP by giving it a new name makes more sense than calling it phpreboot and once you involve Java it seems less likely PHP's context-free easy start-up will be maintained.

<comment><USER19> That's exactly right. I learned to code from a PHP book a decade ago, and now I am using the excellent OOP Symfony2 PHP Framework. The full spectrum of options are already available with PHP, the language and its frameworks lack nothing.

<comment><USER20> > the language and its frameworks lack nothing.

It lacks a coherent design philosophy; it's a collection of hacks; a house of cards with no style. It's full of idiosyncrasies that must be memorized because they make no logical sense. Put simply, it completely lacks taste.

<comment><USER21> But it does the job :)

Which at the end of the day is the most common benchmark of utility.

<comment><USER22> Everything does the job, it just depends how quickly and easily you can get that job done.

<comment><USER23> Right, and under the category of easily: What languages do you already know, What languages are you already actually comfortable using for a large scale project, and What is the production server running.

If the answer to all of the above is PHP, then you're going to get projects done faster there than you would in Python or Ruby.

</comment></comment></comment></comment></comment></comment></comment><comment><USER24> Why, when "rebooting" PHP, do you still keep the inane non-object arrays? Why not either/both create a syntax for manipulating arrays, or promote arrays to objects with their own methods.

When I see special functions which exist to do basic array-as-list operations, like his `add()` function, my eyes roll. Then I see arbitrary, inconsistent use of the dollar sign to indicate variables and they start to bleed -- you either have a dollar sign or not, but pick one and make it work.

When the language designer adds features at whim, without considering whether or not his implementation is keeping consistency or breaking it, well that's how you get a language like PHP in the first place!

<comment><USER25> what might make sense is to only implement the SPL stuff, and force all array access to be objects implementing the SPL interfaces. it would hurt 'ease of use' compatibility, but would enforce as a standard something that's already defined in PHP.

</comment></comment><comment><USER26> Interesting, this is by Rémi Forax who is involved in the Asm Java bytecode manipulation library[1] as well as hacking on all kinds of other Java related stuff.

He's got a blog post here with some initial performance tests:

[http://weblogs.java.net/blog/forax/archive/2011/09/04/hotspo...](http://weblogs.java.net/blog/forax/archive/2011/09/04/hotspot- loves-phpreboot)

Looks really fast when using type annotation (edit: faster than Java?!). Interestingly he is using the upcoming -hsx Hotspot server flag which makes a big difference in speed.

[1] <http://asm.ow2.org/>

</comment><comment><USER27> Would a coffeescript-like language that generates php be something of interest to people? Improving the syntax whilst maintaining the ability to just drop onto an apache server.

<comment><USER28> Yes, that would be something huge (or maybe I'm thinking that because I have this idea for a long time and really wish someone would do this). Obviously, the quality of the output php code would matter a lot. Actually, by quality I mean mostly the performance.

<comment><USER29> I've started something like that a year ago. It's called purplescript( <https://github.com/martinrusev/purplescript> ) and it's a ruby like language written in Python ( with PLY ) and it compiles directly to PHP, so there is no need to rewrite PHP functions - they just work.

</comment></comment></comment><comment><USER30> Writing a programming language in this day and age and posting about it on HN is like visiting each denomination of your favorite religion and announcing that you're starting a new cult. Personally, I think it's a lot of fun, just don't expect a positive or welcoming reaction. Best of luck to you.

</comment><comment><USER31> I'll voice a minority opinion: Well done!

If I was starting a green field project and had mostly PHP talent around I'd definitely consider using this.

<comment><USER32> Seconded.

</comment></comment><comment><USER33> It looks like someone had fun!

Native parsing of markup and SQL looks like a neat idea (reminds me of Facebook's XHP plus LINQ) but I'm concerned about using the JVM. Does this use a .NET style multithreading model instead of using one process per request? If not, I can't see the benefit of using a JVM given its best features (GC and JIT) would be rendered not only useless, but a bit of a drag.

My personal PHP wishlist is:

* Better interfaces for the core libraries. Ideally replacing them all with namespaced and object-oriented ones with none of this needle-hackstack mixup

* A standard autoloader

* Removing the concept of 'PHP errors' and replacing them all with exceptions

</comment><comment><USER25> Basing this on the JVM may afford some benefits, but widespread adoption will not be one of them. I'm a big Groovy fan, and love Grails, but it's never going to challenge PHP in uptake. I get a lot of JVM benefits by using Grails, but I still do a lot of PHP too, and each have their place. I suspect others would chime in with their own non-PHP loves (ruby, c#, python, etc) but PHP's massive adoption has a lot more to do with availability than syntax.

The people that don't like PHP's syntax already use other tools when they can, and when they can't, because they need to use PHP, it's likely going to be because they're using some existing PHP library or platform already (wordpress, drupal, etc).

I'm all for people experimenting and trying to make things better, but you're probably better off just making a new language than trying to make something that's sort of like php, but different enough that existing code libraries won't work with it.

</comment><comment><USER34> While I'd agree that PHP needs a "reboot", I don't think this is the right way to do it.

</comment><comment><USER35> I have a been in a love affair with PHP and also have been FRUSTRATED for its lack of few things. Despite the fact that PHP lived as a royal king of its era, few new comers like Rails, NodeJS are really taking the attention away; I've been always wondering and why wasn't community really taking the great examples of nifty syntax from ruby and evented model from Node to create the same beast again? I've been waiting 3 years for getting myself out of crappy array('foo' => 'bar') syntax to something neat like {'foo': 'bar'}. I really appreciate your move to create something where we would be able to fix these issues. Keep up the good work!

</comment><comment><USER36> PHP (and Perl, and Rails, and even Erlang) were all created to fulfill an immediate need. That's one of the reasons why they are so successful. They aren't like, say, Pascal in that they were created with abstract goals in mind. If you want to replace PHP you have to do so on PHP's turf and PHP's terms, you need to make something even MORE practical and even EASIER to go from zero to functional dynamic website.

<comment><USER2> Java wasn't created to fulfill an immediate need (other than to make money for Sun), and it's more popular than Perl, Rails, or Erlang.

</comment></comment><comment><USER37> PHP is widely used because of deployment, not because the language is awesome. If you reboot PHP you need to keep the deployment easy as well.

</comment><comment><USER38> From the phpreboot code.google.com site page:

"What's missing ? ... \- ports of all useful PHP functions"

Seems a bit premature to call it "phpreboot". In the present factor, the programmatic constructs identified have equivalents in nearly every language I can think of.

Maybe once it has some PHP functionality incorporated, it could be called phpreboot.

</comment><comment><USER39> A little confused about why this project is starting when there is already a fully supported PHP for the JVM in Quercus. <http://www.caucho.com/resin-3.0/quercus/>

Understand the cleaner syntax hopes... and using JVM 7 features...

</comment><comment><USER40> I think this problem solves the wrong problems.

</comment><comment><USER41> php is fine the way it is. the updates you'd like to make would just turn it into python or ruby as others have alluded to

</comment><comment><USER42> I don't like the reduction of brackets, one thing I like in php is the readability of the symbols: if(){ }else{ } I know when things start and stop, with the conditionals presented there are no indication of start/stop except possibly indentation... lack of closure symbols is one of the reasons I am not comfortable with python as much, I gain comfort in being able to visibly close my sections, and I think for learning a language it makes it way more readable/understandable too.

<comment><USER42> My second thought is it needs a seamless transition path where you can run both old and new PHP without error, there is a lot of code out there and I don't think everything would be rewritten in one fail swoop in many applications.

</comment></comment><comment><USER43> Native JSON is a nice step, but for the most part I would have to agree with the other commenters. Especially embedding SQL as a literal as seems more convoluted than clarifying.

<comment><USER44> I think it might be elegant in small doses - just look at C#'s LINQ. Also, it's a nice strategy to lure newbies away from string concatenation and give security for free...

</comment></comment><comment><USER45> I would recommend a reboot of javascript instead:

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

</comment><comment><USER25> One extra comment different from my last - easier Android app development could make this a very interesting project. That's assuming this as a JVM language will work on Android (groovy doesn't right now because of too much AST stuff, fwict).

I do also see <http://www.phpforandroid.net/> but it doesn't look as ambitious as phpreboot.

</comment><comment><USER46> I think this is a good idea. PHP solves a niche of small sites with slightly dynamic templates.

(To some extent it owes more to rebol than to php - it has a large grammar and a notable amount of literals.)

It makes first class what other languages embed in strings - sql, urls, html, etc. In doing so it can solve a large class of security problems that plague many php projects - you don't need to worry about sql injection when the language handles the query parsing.

PHP was successful for a number of reasons, one of which was that it was embedded and exposed a number of cgi specific features into the language ($GET, $POST, etc), this continues in this vein to embrace urls, sql and html as part of the language. The programmer no longer has to deal with escaping or transforming or sanitising strings. This is cool.

Given it runs on the jvm - it should be possible to layer this atop of heroku or google app engine without worrying too much either.

This approach isn't new either - philip wadler tried in a similar way with the functional language 'links'.

(disclaimer: I think php is a terrible, terrible implementation of some good ideas - the library, language and implementation are notable examples of bad ideas in programming)

<comment><USER47> > PHP solves a niche of small sites with slightly dynamic templates.

Like Facebook. And Flickr. And StumbleUpon. And...

Wait a minute, are we not past this "PHP only works a small sites" thing yet?

<comment><USER46> it turns out a tempting language can be useful for more than one thing, but for small sites, it works very well.

you are reading between the lines to find an argument that isn't there.

</comment></comment></comment><comment><USER48> I hope the "less ';' like javascript" isn't implemented in the same way it is in JavaScript...

</comment><comment><USER49> I just wonder: how are you supposed to escape braces in embedded JavaScript? If the language 'intelligently' finds braces inside <script> tags, then I'd recommend everyone to run as fast as possible in the opposite direction.

<comment><USER50> [http://code.google.com/p/phpreboot/source/browse/trunk/phpre...](http://code.google.com/p/phpreboot/source/browse/trunk/phpreboot/test/testxmljavascript.phpr)

It apparently "auto-protects" braces inside a script tag, but it's not clear how one would then embed phpr inside the javascript.

</comment></comment><comment><USER51> The embedded XML reminds me of Facebook's XHP: [https://www.facebook.com/notes/facebook-engineering/xhp-a- ne...](https://www.facebook.com/notes/facebook-engineering/xhp-a-new-way-to- write-php/294003943919)

</comment><comment><USER52> i wonder how the embedded sql syntax would handle multiple database connections.

</comment><comment><USER53> A better approach might be to go the CoffeeScript way or better still, contribute to php itself. Sure it might take longer but languages take years to catch on...

</comment><comment><USER54> I hear perl tried this a decade ago. I don't think it worked out too well.

Also, design a language with features, then think about the runtime. A language is not it's runtime.

<comment><USER55> what?

Perl is older than PHP!

<comment><USER56> I think they mean perl tried a reboot of perl, not of php.

<comment><USER57> I at first thought it meant the Perl team tried to do a reboot of PHP. But what you said makes more sense.

</comment></comment></comment></comment><comment><USER58> Call it PHP version 6 instead.

</comment><comment><USER59> isn't it in fact a Java reload? (i mean java for web by mimicking PHP syntax)

</comment><comment><USER60> If we're going to rewrite PHP, lets make it look and act like Objective-C.

<comment><USER61> For the love of all that is holy, no.

</comment></comment><comment><USER62> My PHP reboot is simple: drop it for more versatile interpreted languages like Ruby & Python, and their respective web frameworks. Loving it, personally.

<comment><USER62> Not surprised at this getting negged, nor at nobody actually writing why.

<comment><USER63> I didn't neg but would agree that the comment adds little to the discussion. Comes off as snark and not much else.

<comment><USER62> It's not though. If you're going to upend PHP in order to make it more like something else, maybe just use something else.</comment></comment></comment></comment>


Why I avoid SDKs in production - <AUTHOR> http://brandur.org/sdk <comment><USER2> That's cool. You're not the guy we built it for.

We built that SDK so that Junior Dev Jimmy can make calls to our API and actually finish integrating our service without giving up. That guy can't code his way out of a paper sack, and certainly couldn't successfully send us an HTTP request or parse the result that we sent back. We built him a client library so that he'll stop sending us stupid emails asking how to call our server-side API using jQuery or, not making this up as it's happened several times from several customers, a form on an HTML page.

Anything we can do to get that guy up and running and done implementing our API, we'll do. Because the guy who hired him is paying us money, and the last thing we want to do is explain why he needs to fire his only developer and find a new one.

<comment><USER3> > "... he'll stop sending us stupid emails asking how to call our server-side > API using jQuery or, not making this up as it's happened several times from > several customers, a form on an HTML page."

Have you considered that maybe an API _should_ be callable using `jQuery.ajax(...)` or a simple `application/x-www-form-urlencoded` POST?

(...or was this satire?)

<comment><USER2> I'll assume you missed the "server-side" in the above, or that I wasn't clear in what that meant.

I'm referring to API calls that you really really only want to ever do from your server. Things like starting and stopping EC2 instances, where you need to send along your API keys that are essentially the keys to your bank account and your business's future survival.

Now imagine, as the owner of that service, that your customer is sending those keys in plain text to the client, and wondering why he's having a hard time starting EC2 instances using javascript from his user's browser.

<comment><USER4> I wrote a thing to start & stop OpenStack servers via JavaScript. HTTPS is a thing.

I have trouble thinking of any API that shouldn't be callable from a client.

<comment><USER5> Any API that uses some form of authentication token that is not obtained via some user-based interaction like OAuth may need to be at least proxied via a server side piece to prevent exposing credentials/keys.

<comment><USER4> Err.. why?

Clearly the keys need to be obtained somehow, but that was out of band for my application. Once they are obtained I don't see any reason why passing them from a 3rd party app over HTTPS (using CORS) is any less secure than using session based authentication with a 1st party app.

In both cases you are vulnerable to MTM and XSS attacks. Sessions expire which is nice, but that's the only real difference.

</comment></comment></comment></comment></comment></comment><comment><USER6> Even if I don't use the SDK, I greatly appreciate when the same company that writes the API also builds an SDK.

APIs which don't also maintain SDKs - in my experience - don't understand the cost of making breaking changes, and aren't as 'nice' to consume. When the SDK is built, these issues are discovered: I appreciate that it's not me that has to go through those pains.

<comment><USER7> It's also good to have a test client application that the service provider supplied to be able to demonstrate that problems are with the service rather than with the client code.

<comment><USER8> Agree.

</comment></comment></comment><comment><USER9> Here's a suggestion: design the SDK such that calling a method returns you everything you need to construct the REST call yourself: the verb, the url, the query params, the form params, and perhaps some headers.

        case class HttpCall[OutputType](
            verb: String,
            url: String,
            queryParams: List[(String,String)],
            formParams: List[(String,String)],
            resultType: Class[OutputType])

        trait Api {
          def getMyTasks(): HttpCall[List[Task]]
          def getTask(taskId: String): HttpCall[Task]
        }

The SDK can also provide a driver for making the http calls:

        trait Driver {
          def call[Out](httpCall: HttpCall[Out]): Out
        }

So now api invocations look like this:

        val myTasks: List[Task] = driver.call(api.getMyTasks())
        val aTask: Task = driver.call(api.getTask("foo"))

What's nice about this design is that the consumer can write their own driver if they don't like yours. Prefer asynchronous over synchronous? No problem!

        trait Driver {
          def call[Out](httpCall: HttpCall[Out]): Future[Out]
        }

Everything in the article except for grep-ability can be achieved with this kind of design.

<comment><AUTHOR> Great idea!

I can definitely see this as a workable solution. The only thought I have is that once in a while behavior like retry/idempotency support might have to be tweaked on a per-endpoint basis rather than from the general `call` method, and at that point things get a little less pretty.

In general I'd say that the ideas expressed in the article apply more to dynamic languages where you see much more of the convention of SDKs just giving you back hashes instead of strongly-typed models representing foreign resources. In something like Scala, the barrier of having to implement every model yourself might be an extra motivator for just defaulting to the SDK.

</comment></comment><comment><USER10> You know what I don't want in production?

Dual-column layouts that still require me to scroll to the bottom of the page, and then back up, and then back down.

<comment><AUTHOR> Hah! Call it a design experiment, and either way it's good to gather a data point that someone hates it.

The multi-column layout will only trigger at large screen sizes. The idea here was to fill some of that extraneous white space you get when browsing full screen on big monitors. I may revert it.

<comment><USER11> Interesting. Before reverting, maybe you could try detecting page height and then flow from left column to right column with one page height then draw a horizontal rule under than and repeat left to right again with the next page- height's worth of text. I.e., instead of

      1 | 4
      2 | 5
      3 | 6

try

      1 | 2
      -----
      3 | 4
      -----
      5 | 6

...kinda like reading both sides of a book spine.

<comment><AUTHOR> Nice idea!

I naturally worry a bit that the reader's eye will have a hard time tracking which segment it should be looking at next (say they accidentally jump from 1 --> 3 for example). But like you said, if you used the horizontal rule between say 1/2 and 3/4, and just had whitespace between 1/2, it might be distinctive enough for a fluid reading.

Thanks for the tip. I'll draw up a prototype.

</comment></comment></comment></comment><comment><USER12> Brandur, this is indeed very actual topic (and will be even more with the rise of APIs).

As with everything, the issue is twofold. In the case of Heroku and your user- base it is reasonable to expect your users are closer-to-wire than an iOS guy hacking in Cocoa Touch.

From your point I can't agree more. A well designed HTTP APIs goes a long way here. Putting a Cocoa Touch developer's hat on and I can't be bothered learning HTTP, checking all the possible responses, handling redirects and errors when the only thing I need is to just fire a single Mixpanel track event...

Sort of C/C++ vs. let's say a Ruby. Assembler anyone? Stay on the metal or develop (and crash:) faster with some trade-offs.

Anyways, good stuff. Important bringing it on the table!

<comment><AUTHOR> Z,

> As with everything, the issue is twofold. In the case of Heroku and your > user-base it is reasonable to expect your users are closer-to-wire than an > iOS guy hacking in Cocoa Touch.

Certainly! Regarding the overall question of "SDK vs. custom HTTP wrapper" there isn't a right answer; different parties have different requirements and should use the right option for them. I'm not even saying that users of Heroku shouldn't have an SDK here -- they should absolutely have one if it will help them, and Heroku ships SDKs for just that reason. I was trying to make the point that me, as a maintainer of a Heroku backend service that talks to other services, would like the option of not having an SDK; like you said, I want to be as close to the wire as possible.

Thanks for the feedback and reading!

</comment></comment><comment><USER13> I agree with the article. The last thing I want to do is add another layer of complexity to an already complex application.

More layers of software equals increased chances for vulnerabilities and/or bugs.

</comment><comment><USER14> SDKs do have their value. I honestly think if the SDK is designed correctly and is open source, a lot of these points are mute.

On top of that, the SDK can handle some interesting dev tasks that everyone has to deal with regarding a REST API. For example, best practices with api keys / secrets, error handling, caching, etc...

SDKs like any piece of software needs to be evaluated before integration, if it is an SDK that doesn't meet your requirements for development, you build your own against the REST API.

<comment><AUTHOR> > SDKs do have their value.

I agree! And a well designed API can certainly help workaround many of these problems.

I would say that fully evaluating an SDK is a non-trivial undertaking though, especially when it comes to features like connection persistence. And then what if it turns out that the SDK doesn't support everything you want (which is often the case)? On the flip side - if a service has a good API, I can build my own wrapper which uses my own conventions very quickly. And that leads to what the main point of the article was meant to be: please design a good API so that I can opt out of your SDK if I want to.

BTW, I think you were looking for "moot".

</comment></comment><comment><USER15> Including SDKs in production, as the author alluded to, is completely situational. It comes down to answering the question: can you write a significantly higher quality implementation to make it be worth your while? When it comes to starting out with a web service, a ruby gem or maven library, is invaluable. I love being able to work with an API within 5 minutes of setting up my dev environment. As other's also mentioned, it does cut down on support calls for the provider.

</comment><comment><USER16> Another thing that client libraries often forget: configurable timeouts. Without them the default is around 60-120 seconds depending on the system.

</comment><comment><USER17> > The Grep Test

I fail to see the point of this criterion. Even when you implement the client code yourself, you'd surely not copy&paste identical HTTP calls everywhere just so you can search for them. You'd use some form of encapsulation (modules, classes, subroutines). And those calls are just as hard (or just as easy) to grep for as calls to an external library.

<comment><AUTHOR> Yeah, I included this last as I think it's by far the weakest argument.

I've found in the past, especially when looking being introduced to new codebases that I'll see URLs around in the logs but that the logging is weak enough that it's somewhat difficult to track down which module is initiating them. With thin HTTP wrappers a quick Grep will expose exactly where the offending code segment is, and I find that occasionally useful.

</comment></comment><comment><USER18> We built a clients SDK on top of a regular HTTP library (as any other do). However if you want, you can get access to the parts of the library that exposes headers, http methods and other thing that effectively allows you to do work with the rest API directly if you want to.

<comment><AUTHOR> Right. It's certainly possible, and it's awesome that many services like your own provide good clients that empower developers this way.

My experience though is that some don't, and figuring out whether they do support these more advanced features, and how to use them if they are included, often makes the discovery process longer than just implementing a simple HTTP wrapper. That of course assumes a reasonable well designed API with pretty good docs though.</comment></comment>


Proposed CA law tells cities: Build more, or we'll do it for you - <AUTHOR> http://sf.curbed.com/2016/12/9/13902592/housing-california-development-scott-wiener?utm_campaign=sf.curbed&utm_content=chorus&utm_medium=social&utm_source=twitter <comment><USER2> Someone on HN posted a link to this article that compared Japanese zoning laws to American zoning laws.[0] There was also some interesting discussion.[1] The reason I thought of this is because in Japan the broad outlines of zoning laws are made at the national level, and cities can only make exceptions to them, unlike in America where cities make their zoning laws out of whole cloth. A bill like this is a small movement closer to the Japanese system.

0: [http://urbankchoze.blogspot.com/2014/04/japanese- zoning.html](http://urbankchoze.blogspot.com/2014/04/japanese-zoning.html)

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

</comment><comment><USER3> Sounds like a recipe for even more sprawl. The bay area may need more housing but build up, not out.

<comment><USER4> What's needed is large amounts of new housing in Palo Alto, Mountain View, Santa Clara, Cupertino, Menlo Park, Sunnyvale, etc. etc. The most reasonable places to put it are near public transit and near office parks. These cities don't really have a whole lot of "out" left to build on.

<comment><USER5> NIMBY is a huge problem. I live in Cupertino, and we just defeated a couple of bills that would have allowed a nine story high rise of apartments right next to the freeway.

In this particular case most people opposed it because they didn't want a nine story building. I didn't actually mind, even though I would literally live in it's shadow.

But I voted against it too because the they were apartments, not condos, which means that they will send their kids to the schools but not pay for them. Actually worse, their rent would have been higher because of the schools, but the schools would never see any of that money since apartments don't pay parcel taxes, which is where a good chunk of the school funding comes from.

But my main point is that almost all of my neighbors opposed it because "they don't want high density housing to ruin the neighborhood".

I hate to break it to these people, but they said the same thing in the 1960s when _their_ houses were being built.

<comment><USER6> So whomever actually owns the apartments that get rented pays no parcel tax?

<comment><USER5> They pay a single parcel tax instead of one per home like the rest if us.

</comment></comment></comment></comment></comment><comment><USER7> What I like about the cali coast is that while there is a lot of space, most of it is not developed. Besides a road, and the occasional vantage points. I don't think "mandatory developement" plans like this which just sprawl and sprawl is that good of an idea, it really takes out from the landscape.

More information regarding Scott, [https://www.crowdpac.com/candidates/559c008cac423b7c02c95011...](https://www.crowdpac.com/candidates/559c008cac423b7c02c95011/scott- wiener)

Damn land developers.

<comment><USER8> CA desperately needs more housing, especially places like the Bay Area. If this proposition passes, it might be a real good thing.

<comment><USER9> CA has too much housing already. Consider water availability and traffic jams. In LA and sometimes in San Jose, consider smog.

Why does everybody have to live there anyway? The country would be way better off if 25 million people left there for Tennessee, West Virginia, Mississippi, Kentucky, Michigan, Maine, Indiana, Arkansas, and Louisiana.

<comment><USER10> yeah no kidding, blue hipsters need to spread their progressivism to the rest of the country(as I noticed most of those states lean Republican), if we're ever to have a more progressive country.</comment></comment></comment></comment>


Monte Carlo theory, methods and examples (2013) - <AUTHOR> http://statweb.stanford.edu/~owen/mc/ <comment><USER2> Fun trivia: Stan Ulam was on sick-leave and was playing solitaire. He came up with the Monte Carlo method while trying to calculate the probability of a successful solitaire game. The method was named after his uncle's favorite place to gamble.

When he got back from sick-leave, he immediately began applying it to his work: calculations leading to the fusion bomb.

I find that little background stories like this help students to get engaged with subject.

<comment><USER3> I've been thinking a bit about hands of solitaire recently as I play it on my phone on the commute to work. It's cool to know that it's an interesting problem to other people as well.

At the same time, you know, I didn't even think to _use_ Monte Carlo let alone design the damned thing...

<comment><USER4> As I understand it he got bored of the game itself, and was thinking about it at a higher level.

I've been playing it heavily recently though, and it seems to be so well weighted. Completing games about 10% of the time.

Trying to work out strategies to finish more games.

</comment></comment></comment><comment><USER5> Author here: I was pleased to see this while attending MCM 2017 (Monte Carlo methods). I'm open to reports about mistakes in the notes, or even thoughts on which further topics (from within MCMC, QMC, SMC, ETC) are most worthy of coverage in future chapters.

<comment><USER6> Thank you for releasing this book. I've just started working with simulations to solve some toy problems I've been pondering, and couldn't solve analytical, so the timing of this post is impeccable!

I've read the first chapter and it is very well written and easy to follow, and the exercises look really good.

I have 2 questions:

1) Are you open reports on minor spelling/grammar mistakes? (There's a missing full-stop on page 6, and on page 4 you write "in the road" instead of "on the road". Really minor things.)

2) Do you consider the current chapters "done"?

<comment><USER5> I'm happy to get helpful suggestions. With enough eyeballs, every typo is shallow. I'm easy to find online.

The current chapters are done enough to post. They could change somewhat later but only to another 'done' state.

</comment></comment></comment><comment><USER7> Professor Owen has been a leader in Monte Carlo, sampling, and experimental design. He recently chaired the relevant conference ([http://mcqmc2016.stanford.edu](http://mcqmc2016.stanford.edu)). People who do experimental design should have some understanding of what QMC, for example, can offer -- standard error reduction by 1/n as opposed to just 1/sqrt(n).

He was also one of the few statisticians who was seriously interested in neural nets _long_ before they became fashionable, serving as a reviewer of learning theory work for NIPS.

</comment><comment><USER8> We made an algorithm for Monte Carlo related random number generation. It makes slightly worse random numbers fast, but in a way which is good in some situations. I am still very excited about it!

Please see our paper: An Efficient Method for Generating Discrete Random Variables with General Distributions for example from [http://dl.acm.org/citation.cfm?id=2935745&CFID=782777315&CFT...](http://dl.acm.org/citation.cfm?id=2935745&CFID=782777315&CFTOKEN=49114698)

or just email to some of the authors to get the pdf ...

<comment><USER9> I am a layman in this field and not read the paper (behind a paywall), but not sure I see how using a method that requires random numbers to generate random numbers makes sense?

<comment><USER10> It's not a method to generate random numbers, but to re-distribute random numbers according to an arbitrary distribution. In general RNG generate purely uniform distributions.

<comment><USER8> Too bad it's too late to use your words on the paper

</comment></comment></comment></comment><comment><USER11> I remember using Monte Carlo to calculate Pi on an XT back in the late 80's (the explanation was in a kids math book), iirc (it's been a while) it took all night to get to 4 sig fig, it was an interesting demonstration.

<comment><USER12> I've done that one with a basic maths class using rice grains dropped on a circle drawn on graph paper and then in a spreadsheet with rand() function generating the coords. Seems to help understanding.

Someone here suggested extending to finding the volume of the Steinmetz solid which I must get round to.

<comment><USER11> Yeah it was in a book with a title like "Fun with Maths" or something unusually for that type of book it's title was true.

</comment></comment></comment><comment><USER13> Judging from the copyright notices, this hasn't been updated since 2013.

Did the author finish the book and leave this draft online, or was it never finished?

</comment><comment><USER14> I remember simulating the Monty Hall problem with random numbers, because it was hard to imagine.

<comment><USER15> I did the same thing to help me get my head around it. For anyone else finding it difficult to imagine the probabilities in Monty Hall intuitively, consider replacing the 3 doors with 100 doors. After you choose the first door, the host opens 98 of the remaining 99 doors. That generalization, at least for me, helps to show that the problem can be reduced to the choice of 1 door vs all unchosen doors.

</comment></comment><comment><USER16> Why is there so much written on Monte Carlo theory and (comparatively) hardly anything on Las Vegas theory?

<comment><USER17> Because what happens in Vegas... doesn't fit stochastic calculus.

<comment><USER18> HERO :D

</comment></comment></comment><comment><USER19> Fooled by Randomness by Nassim Nicholas Taleb talks about the Monte Carlo theory extensively.

</comment><comment><USER20> It's interesting that MC can work best with non-random numbers :-)

</comment><comment><USER21> I always wonder where the upvotes for those posts that simply plant a link to highly specialized lectures/books that likely take months to work through (given a sufficient mathematical background) come from. Especially since the material at hand isn't relevant unless you work in certain specialized subfields.

Don't get me wrong, the resources posted here are often good and learning is great, but I doubt anyone who sees them here actually follows through and starts studying.

<comment><USER22> as a hacker news reader it's your responsibility to become an expert in the basics of things like computer vision, machine learning, wavelet algorithms (even if it becomes irrelevant) and so forth.

at the end of the day, _someone_ has to build something using all this, and that someone is us.

I mean what else are you going to do while waiting for another javascript framework to appear? surely we can't _all_ write new front-end frameworks. It just doesn't make sense.

 _(note: this comment might be at least partly sarcastic, but I 'm not sure which part and how much.)_

<comment><USER23> I am glad you added a disclaimer stating your post is meant to be sarcastic because my automated deep learning HN voting bot has not learned sarcasm, opencv or angular6 yet.

I don't know how or why but it has mastered memory management in spark.

<comment><USER22> >it has mastered memory management in spark.

that's really only half of learning something, though, isn't it? it needs to write a blog article about its experience.

<comment><USER23> I just hope it is just a matter of time before it learns to do that!</comment></comment></comment></comment></comment>


Ask HN: How did you finance your start-up? - <AUTHOR>

Did you use your own money? Did you find an angel investor? If so, where did you look?<p>Just wanted to get a feel for how people reached their fiscal goal before I dive into trying to fund my own projects. <comment><USER2> With the money I saved up on my first job. I'm usually quite Lean. I found a co-founder who owned a developer team. I gave him a small percentage and some "salary" to get it started.

Also, I'd never ask for money until my startup already has traction.

</comment><comment><USER3> I hooked up with 2 other co-founders friends that i use to work with.

We worked in our spare-time to get out a really early beta, once we had that and some users I started asking around and networking to find investors.

Took around 3-4 weeks and dozens of meetings to find the right one. Almost took the first offer we got which was a quarter of what we settled for.

Although I used Angel List and F6S, in the end it was a personal intro from a old freelance client that got us the money

</comment><comment><USER4> I second edwardliu's comment. did the same thing, putting my own money where my mouth is. Whether you take on investor money obviously depends on many, many things but in my view, but bootstrapping it for as long as you can helps you focus on what matters most when you run a business: revenues. build a product that solves a real problem, get traction and make money.

</comment><comment><USER5> \- I pretty saved up money from my first job.</comment>


Beautiful examples of movement in interaction design - <AUTHOR> http://hoverstat.es/

<comment><USER2> I love the tiny black text on a dark gray background.</comment>


US rice imports 'contain harmful levels of lead' - <AUTHOR> http://www.bbc.co.uk/news/science-environment-22099990

<comment><USER3> Here's an abstract from the researcher, Tsanangurayi Tongesayi. Not this exact presentation, but apparently the same research:

 _Lead was present in all the foods samples and its concentration ranged from 4.3 to 17.9 µg/g. Some baby rice food had levels of Pb as high as 12.5±0.2 µg/g._

[http://webcache.googleusercontent.com/search?q=cache:d4lyxhr...](http://webcache.googleusercontent.com/search?q=cache:d4lyxhrXhkQJ:abstracts.acs.org/chem/244nm/program/view.php%3Fpub_num%3D280%26par%3DENVR+&cd=1&hl=en&ct=clnk&gl=us)

(Google Cache because of the intellectual property circus).

The FDA's recommended limit, expressed in total Pb ingested per day (only figure I could find), is

 _The FDA's recommended Provisional Total Tolerable Intake Level (PTTIL) for lead in children less than 6 years of age is 6 μg lead/day. For children 7 years and older, the PTTIL is 15 μg lead/day. It increases to 75 μg lead/day for adults (USFDA 1993)._

[http://health.mo.gov/living/environment/hazsubstancesites/pd...](http://health.mo.gov/living/environment/hazsubstancesites/pdf/HercExposureInvestigation.pdf)

This limit can be exceeded with a _fraction of a gram_ of rice (for small children) -- literally a single grain. You could eat a small bullet's weight of lead in a few hundred kg -- several years of eating.

And here's an FDA survey of the US food supply: 731 food products, about 10,000 samples, and nothing within orders of magnitude of this.

[http://www.fda.gov/downloads/Food/FoodScienceResearch/TotalD...](http://www.fda.gov/downloads/Food/FoodScienceResearch/TotalDietStudy/UCM184301.pdf)

(pp. 69-80). Notably, their rice samples (#50) had undetectable amounts of lead, at a detection threshold of 0.007 mg/kg (= µg/g).

(I'm beginning to suspect someone confused a mg/mcg/μg somewhere; that seems like the Occam's razor explanation. Otherwise, this looks really bad).

<comment><USER4> Thanks for pulling those numbers. But something doesn't quite add up.. The first linked report says:

 _Samples of rice products from the US, South America, Asia, and Europe were purchased from local supermarkets and analyzed using XRF and GFAAS. Lead was present in all the foods samples and its concentration ranged from 4.3 to 17.9 µg/g._

So both domestic US rice and imported rice were in the 4.3-17.0 µg/g range, which if true would contradict the FDA's results, and mean that US rice was order-of-magnitude as dangerous as imported rice. What are we (or I) missing?

<comment><USER3> It doesn't make sense to me either. If the FDA found n.d. levels of lead in all their samples, you would expect _some_ of the new study's samples to have low levels as well.

<comment><USER4> Right, the low end of the range should be much lower. Right now, my money is on a units error.

</comment></comment></comment></comment><comment><AUTHOR> _"If you look through the scientific literature, especially on India and China, they irrigate their crops with raw sewage effluent and untreated industrial effluent," he explained."_

...

 _"Dr Tongesayi also said that the increasing practice of sending electronic waste to developing countries - and the pollution it leads to - <USER2> the problem."_

This is seriously scary!

I had no idea that the delicious Indian and Pakistani basmati rice that I buy from my local asian grocery store might have been grown in sewage!

They certainly don't advertise this at the grocery store. And this article mentions that high levels of arsenic in rice was a "well-known" problem, linking of FDA's advice on the matter:[1]

I had no idea about this either. Why isn't there more publicity about this?

What happened to the FDA's mission to protect the consumer? Why aren't rice imports tested for heavy metals?

If not an outright ban on products that fail to meet basic safety standards, at the very least the FDA could require clear labeling of these products, so the consumer at least has half a chance of avoiding them if they are concerned. And who wouldn't be concerened about accidentally poisoning themselves on sewage-grown rice?

[1] - [http://www.fda.gov/forconsumers/consumerupdates/ucm319827.ht...](http://www.fda.gov/forconsumers/consumerupdates/ucm319827.htm)

<comment><USER5> _What happened to the FDA's mission to protect the consumer? Why aren't rice imports tested for heavy metals?_

You know why. Because that would be onerous government regulation. Americans are obsessed with the idea that the government overregulates everything. That's why Congress is unwilling to fund enforcement actions.

<comment><USER6> The government does overregulate damned near everything. Even worse, it fails to regulate the right things. You can't buy Kinder Eggs in the US because of FDA regulations, and yet the FDA lets in literally tons of rice that is tainted with lead or arsenic.

Does that seem like a problem to you? It seems like a problem to me.

<comment><USER7> Number of kids that've died from lead poisoned rice: Zero.

Number of kids that've died from eating a Kinder Surprise, Darwin's Law notwithstanding: At least one?

If you want to complain about regulation, you're really complaining about people who don't want to take personal responsibility for their own actions. Rather than not buy Kinder Surprise treats for infants, they'd rather ban them for everyone _just in case_.

Regulations, in many cases, just reflect collective attitudes.

<comment><USER6> I'm not sure what sort of point you're trying to make. The major risk of lead poisoning isn't death it's the many other serious negative health effects, especially on children's development. Is there a particular reason why we should ignore lead exposure in children at levels several times higher than the current EPA limits?

Moreover, if a simplistic analysis of deaths caused by "exposure" are to be used to guide policy then we should ban water first of all, along with buckets, gravity, and food.

<comment><USER8> I suffered through childhood lead poisoning and I'm still here on HN!

</comment></comment></comment></comment></comment></comment><comment><USER9> Good thing the FDA is funded to appropriate levels to ensure that the rest of our food is safe! Oh wait...

[http://www.cbsnews.com/8301-204_162-57572066/sequester- may-l...](http://www.cbsnews.com/8301-204_162-57572066/sequester-may-lead-to- less-safe-food-fda-commissioner-says/)

The really frightening thing to me is that even before the sequester, the FDA has largely left it up to industry-approved 3rd party food inspectors to validate food safety.

[http://www.bloomberg.com/news/2012-10-11/food-sickens- millio...](http://www.bloomberg.com/news/2012-10-11/food-sickens-millions-as- industry-paid-inspectors-find-it-safe.html)

</comment><comment><USER10> We heard about this a year ago and cut almost 95% of the rice in our diet. Now we have a rice dish about once a month or less. There were even warnings that small children should avoid rice completely.

Unfortunately you just need to be proactive about what you put in your mouth, and don't assume that since you live in a "developed" country that everything sold is safe to eat.

Don't even get me started on the FDA's stance of "all chemicals used in consumer goods are considered safe until proven otherwise" stuff.

<comment><USER11> Couldn't you just buy rice grown in the USA?

<comment><USER10> No, even US-grown rice suffers the same problem (not as the article, though). Basically rice in the southern US is grown in fields that used to be used for cotton, and the use of arsenic as a pesticide was allowed back then.

Fast forward and they're using the same fields to grow rice, and the metals are still in the soil...

I'll try and dig up some sources when I'm not mobile.

<comment><USER11> I found some sources on my own. Interesting. It looks like California rice is the safest, and white rice is better than brown.

<comment><USER12> White is better than brown? Isn't white just brown with the brown removed?

<comment><USER13> Depends on what you mean by _with the brown removed_ It isn't bleached white. It is like they sold white and brown potatoes at the store, where a white potato was a pealed brown potato. Just as with potatoes, apples and others, the nutrients as well as the harmful stuff tends to collect in the skin.

</comment></comment></comment></comment></comment></comment><comment><USER14> I don't think this a new problem, its just one that has been hidden exceptionally well in "recent" times.

The obvious example is _The Jungle_ by Sinclair which was essentially publicity of precisely these problems, except in the beginnings of the 20th century. I highly doubt that the situation has been drastically improved, but, really hidden much more thoroughly from the public view.

</comment><comment><USER15> Specifically, Chinese rice contains harmful levels of lead. If there is one lesson we've learned about consumer products in the last decade, it's _don't eat anything from China._

<comment><USER16> I do vaguely try to avoid buying food from China, but some things are hard to find from anywhere else (ginger, for example).

<comment><USER17> Put some fresh ginger in some soil and start harvesting your own after a few months.

[http://herbgardens.about.com/od/indoorgardening/a/How- Can-I-...](http://herbgardens.about.com/od/indoorgardening/a/How-Can-I-Grow- My-Own-Ginger-Root-Indoors.htm)

</comment></comment></comment><comment><USER18> Although I acknowledge that lead is nasty stuff, something about this issue bothers me.

According to some studies, increasing exposure to lead at low levels (1-10 micrograms/dl) shaves 4-7 points off IQ scores[1].

Yet, as population blood lead levels have plunged in recent years, there haven't been proportionately massive gains in IQ in the population. Indeed, the Flynn effect may have stalled in recent years[2].

This either means that there are confounders or some other effect is in place. But I'm no expert, and I'd value the input of someone better informed.

[1] <http://www.nejm.org/doi/full/10.1056/NEJMoa022848> [2] [http://en.wikipedia.org/wiki/Flynn_effect#Possible_end_of_pr...](http://en.wikipedia.org/wiki/Flynn_effect#Possible_end_of_progression)

<comment><USER19> If the lead exposure is a threshold effect, most of the population might have already banked the benefits of going below it.

If it mostly impacts development (rather than ongoing performance), even more so.

<comment><USER18> _If the lead exposure is a threshold effect, most of the population might have already banked the benefits of going below it._

Experts claim there is "no threshold"[1].

[1]<http://www.chem.unep.ch/pops/pdf/lead/leadexp.pdf>

</comment></comment></comment><comment><USER20> Any data about rice in the Philippines?

My family owns a farm in central Luzon, and I know that the majority of farmers there doesn't use irrigation from streams but instead uses a kerosine- powered pump deep-well system.

I know this might sound anecdotal, but for more than 20 or so years I've been visiting our farms every summer, even farmers near the River streams uses deep-wells and rain water, and the irrigation that runs along the farms are from deep-wells.

Also, here's a recent article about the Philippine rice are certified arsenic- free '[http://ph.news.yahoo.com/philippine-rice-certified- arsenic-f...](http://ph.news.yahoo.com/philippine-rice-certified-arsenic- free-122344970.html)

<comment><USER21> I was under the impression that rice in Uruguay is similarly lead-free, using water from the "Guaraní" aquifer.

<http://en.wikipedia.org/wiki/Guarani_Aquifer>

I worry about the mushroom imports (I buy Chinese champignons and other stuff), maybe I should stop buying those.

</comment></comment><comment><USER22> I've been trying to find drinking straws not made in China.

Makes me wonder what's in them with mouth contact.

But this endeavor seems to have no solution, cannot find any.

</comment><comment><USER23> Is anything safe to eat anymore?

<comment><USER24> Sure, Lab-Grown Petri Dish Meat© is perfectly safe.

*Name still pending, all rights reserved, GloboCorp Inc.

<comment><USER25> You mean "Spam"? Already trademarked.

<comment><USER26> <http://en.wikipedia.org/wiki/In_vitro_meat>

<comment><USER25> Ok, that's disgusting.

</comment></comment></comment></comment></comment><comment><USER27> So is there a source of rice that is reliably free from Arsenic contamination?

<comment><USER28> Rice from India had the least arsenic, but apparently now they have lead!

I'm not sure there is anyplace that is safe.

</comment></comment><comment><USER29> Has anyone been able to find the actual journal article? I would like to read it and come to my own conclusions. I find it suspicious that I cant find it, but maybe I am just not looking hard enough.</comment>


Data visualization, empathy, and representing people with dots - <AUTHOR> https://source.opennews.org/en-US/learning/connecting-dots/

<comment><USER2> Who else was reminded of _Up in the Air_ by Antoine Rose?</comment>


Market Size Doesn't Equal Market Demand - <AUTHOR> https://bettereveryday.vc/market-size-doesnt-equal-market-demand-4f213e5e1be7 <comment><USER2> jaw-dropping customer value. I think the key here is allowing customers to be an order of magnitude lazier than they were before.

1\. amazon - don't need to go to the store

2\. google - don't need to search 2-3 pages to find a good search result

3\. facebook - don't need to call your friends to see what they're upto

4\. uber - remember 444-4444 when your drunk.</comment>


Algorithm Clones Facial Expressions and Pastes Them onto Other Faces - <AUTHOR> https://medium.com/the-physics-arxiv-blog/algorithm-clones-facial-expressions-and-pastes-them-onto-other-faces-fc7ce49a4a4

<comment><USER2> How about using a stripped down version of such a system to re-target just the eyes of a person in a video chat? Could this be used to solve the "not looking into cam, thus not looking at me" issues in video chats today?

<comment><USER3> Seems like what you need for that is a lot simpler. You really just need to be able to cut out and redraw the iris and pupil in a different position. The rest of the face shouldn't need to change at all.

<comment><USER4> That isn't all that's needed. When i skype with my family i do notice that the entire shape of my eyes looks different when i look at the screen vs. looking at the camera.

<comment><USER2> Yes, so it would need more than re-targeting the eyes, but maybe still less than being able to apply an arbitrary expression... Could be fun for Chat- Masks with Facial-Expressions though. Ready Player One / OASIS here we come ;)

</comment></comment></comment></comment><comment><USER4> Oh good, more research without the tools necessary (code) to reproduce the results. Thanks, modern scientists.

<comment><USER5> I've read a crazy amount of biomedical papers that model development or some such thing, spend the whole time talking about how cool their model is, hardly validating it _in vivo_ or _in vitro_ and call it a day without a single line of code released.

Frankly, I don't even know how reviewers even believe them.

<comment><USER6> Academics are all cronies.

</comment></comment></comment><comment><USER7> We have that and quite a bit more at www.3D-Avatar-Store.com. Expression cloning with local target fitting is quite easy... to the degree we don't even mention it. It's sorta expected when mapping expressions from one character to another, otherwise the mapping is painfully obvious.

</comment><comment><USER8> The application I see for this is avatar or even character faces in games, reflecting their user's expression in real time.

Also probably cat memes.

<comment><USER9> Any advancement in avatars makes it easier for us to virtualize our real selves. You might be able to get higher-fidelity video chat if you relied more on a base avatar and sent transformations of the face over the wire. Virtual reality avatars are going to be pretty good assuming this technique transfers well to three dimensions.</comment></comment>


Pantera drummer Vinnie Paul dies aged 54 - <AUTHOR> https://www.bbc.com/news/world-us-canada-44586238 <comment><USER2> __I 'm Broken __

    I wonder if we'll smile in our coffins
        while loved ones mourn the day,
        the absence of our faces,
        living, laughing, eyes awake.
        Is this too much for them to take?

        Too young for one's conclusion, the lifestyle won.
        Such values you taught your son.
        That's how.

        Look at me now.
        I'm broken.
        Inherit my life.

        One day we all will die, a cliched fact of life.
        Force fed to make us heed.
        Inbred to sponge our bleed.
        Every warning, a leaking rubber,
        a poison apple for mingled blood.

        Too young for one's delusion the lifestyle cost
        Venereal Mother embrace the loss.
        That's how

        Look at you now.
        You're broken
        Inherit your life.

</comment><comment><USER3> Rock In Peace.

</comment><comment><USER4> Damned shame.</comment>


The Story of Tetris [video] - <AUTHOR> https://www.youtube.com/watch?v=_fQtxKmgJC8 <comment><USER2> I watched this last night. Pretty well done. Another worth watching is Tetris - From Russia with Love that aired on BBC a few years ago and is on youtube: [https://youtu.be/NhwNTo_Yr3k](https://youtu.be/NhwNTo_Yr3k)

</comment><comment><USER3> Great documentary, I learned a lot.

If anyone wants to hear Alexey Pajitnov speak about Tetris, I can recommend this section of the Thumb Candy documentary (released in the early 2000s):

[https://youtu.be/UAo4CZTGFQQ?t=40m37s](https://youtu.be/UAo4CZTGFQQ?t=40m37s)

</comment><comment><USER4> 30 years later Tetris is still my most played game on my mobile. I got bored of Call of Duty, Assassin's Creed, even GTA5. But after 10 consecutive years of continuous iphone Tetris playing it is still as addictive. This game is just genious.

<comment><USER5> I played the hell out of Tetris on the Nintendo DS, but I just can't play it on a touchscreen unfortunately - I do wish I could play it on the way to work, but you just can't get the speed and reliability you get with clicky buttons.

Fun fact: Tetris has been shown to help with mental burdens such as anxiety, PTSD, and intrusive thoughts, and anecdotally I have found this to be true.

<comment><USER6> Has Tetris been released for the Switch yet? I'd hope that they could support the digital inputs (like the D-pad).

<comment><USER7> Puyo Puyo Tetris is pretty decent. Some of the options (like endless mode) are a little hard to find. The story is weird but interesting.

<comment><USER8> and the Japanese Puyo Puyo Tetris might help us archive Switch games for the future, too...

<comment><USER7> I'm not familiar. Care to elaborate?

<comment><USER8> Kinda tongue in cheek as the dumping of Switch cartridges is very rudimentary and not at the level where say, redump.org would accept them.

There's a flaw in the Japanese Puyo Puyo that allowed unsigned code to run on firmware version 3 Switches.

The first thing the scene will try to do other than running Doom will be dumping cartridges. You may immediately jump to piracy, but dumping carts and especially title updates is really important for preserving games into the future, as game companies have proven again and again that they either don't care or don't have the resources for proper archival.

<comment><USER7> I am all for homebrew and archiving.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER9> Ohhhhhh this explains something that confused me at the time and that I never followed up on. My family had a Nintendo and rented a copy of Tetris, played it for a few days, liked it. Aside from the gameplay, I remembered that they had clear level breaks and interludes where tiny Russian figures danced on the screen. Not that long after, we bought our own copy, and that stuff was totally not there....

What is now clear, in retrospect, is that the one we rented was the Tengen version, and the one we bought was the Nintendo release! The year must have been 1989 just as this was all going down.

<comment><USER8> Sidenote: have a look at the eBay prices for Tengen Tetris vs Nintendo Tetris. Retro collecting is another world.

</comment></comment><comment><USER10> And you can play it here [http://www.goodoldtetris.com](http://www.goodoldtetris.com)

<comment><USER11> That version has neither sound nor colors, but at the same time does not look like the original shown in the documentary either. At least it's mobile friendly though.

Does anyone have an online version that is in color and has sound and is also mobile friendly?

<comment><USER6> There is an online version at [https://tetris.com/play- tetris/](https://tetris.com/play-tetris/), but I don't know if it's mobile- friendly. It's also ad-supported, so you'll need to turn ad blocking off.

As for other platforms, I suggest looking here: [https://tetris.com/product- list-videogames](https://tetris.com/product-list-videogames)

Why am I pointing to tetris.com? Because, those products benefit (either directly or indirectly) Tetris Holding and the Tetris Company, a co-owner of which is Alexey Pajitnov, the creator of Tetris.

</comment></comment></comment><comment><USER12> I really enjoyed this and after it was over had no idea I had been watching it for an hour. This story could make a good movie in the vein of Pirates of Silicon Valley.

That said, the note at the end about how Vladimir Pokhilko ended up killing his wife, son, and himself was more dark than I expected. What a shame.

</comment><comment><USER13> Not completely off-topic, a 6-minute video from 2010: Complete History Of The Soviet Union, Arranged To The Melody Of Tetris [1]

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

</comment><comment><USER14> If written histories are more your thing, Jimmy Maher did a series on Tetris for his Digital Antiquarian blog: [http://www.filfre.net/tag/tetris/](http://www.filfre.net/tag/tetris/)

</comment><comment><USER15> A shameful plug from 2001, while we are at it :)

Playable: [https://archive.org/details/tetris_201801](https://archive.org/details/tetris_201801)

Tetris for DOS, text-mode but with colors! :)

</comment><comment><USER16> Love this guy's videos, recommend to check out his channel.

</comment><comment> james-skemp I too watched this the other day, but I still like Chrontendo's telling much more: [https://youtu.be/Z0VKg_dJzzQ?t=29m48s](https://youtu.be/Z0VKg_dJzzQ?t=29m48s)

His entire series is very well done, but episodes have slowed down, especially after starting two more series, Chronsega and Chronturbo.

</comment><comment><USER17> This documentary is great, I thought I knew the Tetris story, but this filled in every blank.

</comment><comment><USER18> A related documentary, about the 2010 Classic Tetris World Championship:

[http://watch.ecstasyoforder.com/](http://watch.ecstasyoforder.com/)</comment>


Bribe Your New Employees To Quit - <AUTHOR> http://kk.org/ct2/2008/05/bribe-your-new-employees-to-qu.php

<comment><USER2> What a terrible idea. I can't think of a worse morale destroyer than this. You may think you're checking commitment levels, but what you're really saying is: "We don't want you. Here's a paltry sum, now scram."

If I were given such an offer at ANY company, it would raise so many red flags that I'd take the money and leave.</comment>