Saturday, May 23, 2015

data: GraphQL (React.js, Relay, Facebook), JsonQL

GraphQL Introduction | React
A GraphQL query is a string interpreted by a server that returns data in a specified format. Here is an example query:
{
  user(id: 3500401) {
    id,
    name,
    isViewerFriend,
    profilePicture(size: 50)  {
      uri,
      width,
      height
    }
  }
}
(Note: this syntax is slightly different from previous GraphQL examples. We've recently been making improvements to the language.)
And here is the response to that query.
{
  "user" : {
    "id": 3500401,
    "name": "Jing Chen",
    "isViewerFriend": true,
    "profilePicture": {
      "uri": "http://someurl.cdn/pic.jpg",
      "width": 50,
      "height": 50
    }
  }
}
Introducing Relay and GraphQL | React
"GraphQL is a data querying language designed to describe the complex, nested data dependencies of modern applications. It's been in production use in Facebook's native apps for several years.

On the server, we configure the GraphQL system to map queries to underlying data-fetching code. This configuration layer allows GraphQL to work with arbitrary underlying storage mechanisms. Relay uses GraphQL as its query language, but it is not tied to a specific implementation of GraphQL."


JSON_QL could be an appropriate name... and as expected it already exists!
(written in Go Lang)

jsonQL

Inspired by GraphQL, build JSON documents from a declarative JSON-based spec.
// select * from users where 1 < id and id < 4 and id != 3
{from: "users", where: "1 < id and id < 4 and id != 3"}
Now, this syntax is more descriptive than template based as in GraphQL...





Go lang productivity, benchmarks

Go Is Unapologetically Flawed, Here’s Why We Use It | Brave New Geek
As Bjarne Stroustrup (creator of C++) so eloquently put it, “There are only two kinds of programming languages: those people always bitch about and those nobody uses.”

static vs dynamic 2


Go by Example: Hello World


"Go is an open source programming language designed for building simple, fast, and reliable software. Go by Example is a hands-on introduction to Go using annotated example programs. Check out the first example"

free e-book: Azure for Developers

free e-book: Azure for Developers
What Programmers Need to Know about Microsoft's Cloud Platform
By John Adams
Publisher: O'Reilly
Released: May 2015

Tesla Motors self-driving cars liability solution

Who’s Responsible when a Driverless Car Crashes? Tesla’s Got an Idea - WSJ
"The Palo Alto, Calif., electric-car maker soon will begin activating semiautonomous features, including the capability to pass other cars without driver intervention, in its Model S sedans. A driver can trigger the passing function by hitting the turn signal...That action not only tells the car it can pass, but also means the driver has given thought to whether the maneuver is safe."