Category Archives: technology

C++, C++ is the answer to x-platform mobile development

James Gregory, a kick ass architect at Zynga, recently took on an investigation on cross platform technologies with a focus on how do you get c++ code to run on the web. You can read about what he did at code.zynga.com.

The core question we are wrestling with  at Zynga is how to you deliver a game on a variety of platforms concurrently without compromising the user experience.

Historically this has been a fools game. The hardware on multiple platforms has been so divergent so as to make it impossible to do. But as mobile devices and in particular tablets that are turning into PC’s in terms of hardware, and PC’s turn into tablets, the potential exists to deliver ubiquitous and similar experiences.

As someone who has been in the tech industry for a long time, what’s surprising is how hard it is to write portable code given the similarity of the underlying hardware. In the 90’s on UNIX we had radically different hardware and yet writing portable code was easy. In fact, the industry worked hard to try and make software portability possible*.

What’s made it hard to get software portability has been the OS interfaces that are widely divergent and worse require different programming languages.

One particular challenge we have is that in addition to writing games that run on multiple mobile devices, we also want to have games that run within web browsers.

Which brings me to C++. (Although I find it funny that the permanent URL to this blog post is c-c-is-the-answer, dropping the ++… the Universe trying to comfort me).

C++ as a low-level cross platform technology for mobile games is awesome. C++ delivers performance, and control and with a modicum of effort it’s possible to call into the underlying native interfaces of the OS.

The other nice thing about C++ is that it’s a language the gaming industry has a long history of using and is comfortable with.

The problem has been how do you go from C++ to the web.

What has made emscripten so interesting is that it makes it possible to go from C++ to javascript using a completely open tool chain. The reason this is interesting is that it allows us to deploy the amazing C++ talents of the entire gaming industry to the problem of getting C++ to the web.

The core approach of emscripten is something we’ve believed in for a while at Zynga. That the way you get to the web and mobile is have a programming language that compiles to multiple targets where a viable target is a web virtual machine (javascript or flash). The compilation of C++ to javascript is also somewhat of a blast from the past for me … after all it’s just like cfront. In fact some of the javascript output reminds me of the cfront output I used to edit …

The emergence of  this tool chain is potentially huge. With an armada of C++ programmers chipping away at the problem, because after all the entire gaming industry has the same problem, there is hope that in a very short period of time C++ will be a viable and easy to use tech for building mobile and web-apps.

Obviously we are at the early stage of this process. But the recent port of cocos-2dx via emscripten to the web is a very very encouraging first step. What it shows is that it is possible to write your game in C++ using a cross platform library and re-target that application to the web without having to rewrite anything…

* Well okay, anyone who was involved in POSIX knows that we really worked very hard to make it IMPOSSIBLE to write portable code but the government was pushing us very hard to make it easy to port their code..

Stalin would be proud

Lamar Smith, SOPA’s creator wants to insert himself into the NSF granting process. With SOPA he wanted to control free speech about ideas. With this latest attempt he wants to control which ideas get created.

Reading the text of his letter, it all sounds so innocent, he just wants to help.

If you are an innocent, all he’s asking for are the transcripts of the funding decision so he can understand where our money is going … If you are not so innocent, you realize it’s an attempt to get information that can be used to drive scientific inquiry in directions of political interest or away from areas that political interest would prefer no science be done.

Congress is not interested in being educated, they are interested in pushing an agenda and their agenda is not the pursuit of knowledge it’s the pursuit of a political line of reasoning.

Which would make Lenin oh-so-proud.

One of the weirdest properties of our age is the Republican Party’s transformation into a Leninist Bolshevik Party.

A Leninist party is one with strong central control, a single unified political position and very little internal democracy.

A Leninist party believes that everything is political. A Leninist party views objective reality as a political construct, and since it’s a political construct,  different political view can create a different reality.

A Leninist party is often indistinguishable from a religious group. Both groups believe, view outsiders as dangerous obstacles to the promised land, and have a lot of group think.

Enough with pre-amble.

Once a Leninist party’s politics take deep root, then it’s only a matter of time where politics drives scientific result and not the other way around.

For example, Stalin preferred Lysenokism instead of genetics because it lined up with his political theories. 

This latest bill is cause for concern, and more deeply distressing than SOPA ever was. SOPA controlled speech. Controlling the NSF is about controlling which new ideas we create.

let freedom win

over the last two months I have moved away from authoring content in Facebook to using Facebook only for distribution.

This reverses a five year trend.

simply put I post on my blog and then let my blog auto post to fb.

The core reason are

1. facebook surfacing doesn’t work for me. It works well but not perfectly and i have no control over it.

2. I can not trivially search for my own content

3. I can not trivially share my content with non Facebook friends

4. privacy doesn’t work for me on Facebook. I have too many friends and the rules change too fast for me to follow them. I just assume everything is public and don’t stress.

5. it’s hard to extract my content from Facebook.

so what I want now is to author my content on my computer, post it to my blog and have it trivially shared.

The Android cell phone makes this stupid easy because having applications work with each other is easy in the os.. I can take a picture with the camera and share it on my blog which then tweets and pushes to Facebook.

that ease of application sharing is a killer feature.

side note my next personal phone must have that feature.

I hope I am a harbinger not a peculiar fool because content should be free. Free as in liberty not beer.

kostadis

The day Google abandoned it’s original mission

I am going to be a little bit critical of Google today. But, before I do, let me be clear that I admire Google more than any tech company out there. The scope of their vision, the breadth of their technology, the greatness of their talent, and the depth of their pockets is breath-taking.  They are, quite possibly, the greatest technology company ever.

Having said that…

When Google abandoned Google Reader, they were not just abandoning a few hundred thousand members of the technorati, they were also telling us that their mission to organize the world’s information had changed.

Their recent focus on other things like eye glasses, and phones and cars and desktop operating systems and … probably should have given us a clue that organizing information was no longer where it’s at.

The original central conceit of Google was that you could rely on them to be the best and most authoritative place for finding information. Other people, we’re looking at you bing, could try to be almost good enough, but when you needed to find something you looked on Google. If it wasn’t on Google it might as well not exist.

In fact, part of the reason I restarted this blog was because after 5 years on FB, the lack of Google search meant that all of the content I ever created was, for all practical purposes, lost.

The decision to cancel Google Reader is shocking because it is  perceived to be central to the mission.

But Google’s cancelled other projects, right?

Google has cancelled other projects, that’s true. But nothing that felt as central to their mission.

Google Reader, and in particular it’s API, was central to how folks organized blogs.

When Google said “We’re done”,  they were also saying that their expansive original mission was over.

I suspect they have a new mission, but it does mean that someone else will have to take on the burden of organizing the world’s information. Here’s looking at you Microsoft.

My global village

image

Today I experienced the power of our global connected village.

My mom told me via SMS that my sister was in labor. My sister communicated, through a yahoo newsgroup, while in labor, with all of her cousins who are in the UK and the US and Greece to tell us that she was okay. Her mom then sent me some pictures via email. And then her brother, that’s me, in the US shared the first baby pictures with friends and family. Finally my aunt, my mom’s sister, used a skype chat from Guatemala to reach out to me to find out about her niece.

Although thousands of miles separated us, it felt like we were all in the waiting room talking to each other…

We live in an age of the miraculous.

Software Defined Storage – laying claims to being a visionary ;-)

After the recent valuations associated to Software Defined Networking startup, storage companies have decided to get on the band-wagon.

Proving that there is nothing new under the sun, I wanted to lay claim to having been a visionary in the space 😉

And for the record, much of this work would have not been possible without an extremely talented set of senior architects, in particular Jim Voll.

In 2003 Steve Kleiman, then CTO of NetApp, brilliantly noted that storage was a physical system that was going to turn into a software system. And that managing the software was going to be the problem in the virtualized data center.

He was right. And I spent 4 years trying to understand his insight. In 2008, shortly before I left NetApp, I got it…

But then I decided to go work on games.

Because a claim without proof is just a claim, let me refer to two papers I wrote.

The first describes a way to do software defined storage for the problem of managing storage withstorage of data replication:

https://www.usenix.org/conference/lisa-07/policy-driven-management-data-sets

The second describes the problem that increasing software virtualization of storage was going to create and the need for a new paradigm for management.

http://delivery.acm.org/10.1145/1320000/1317404/p38-roussos.pdf

NetApp then delivered a product, Provisioning Manager, which implemented a lot of these ideas.

In both of these articles, I called for re-thinking storage management from a hardware system to a software system and proposed an approach that would allow humans to manage the complexity.

Nice to see the world catching up 🙂

Revisiting things 6 years later

A friend of mine is in Barcelona. I remembered a great restaurant I went to and the review I wrote. While searching for the review I found something else I wrote 6 years ago;

Hype is like cancer that spreads until it obliterates all facts in their wake.

Currently the Google word processor is being hyped as the alternative to using MS Word.

About two years ago I tried to use Open Office. MS Word was going to cost me an arm and a leg and I had every incentive. A month of painful struggle and irritation at what was an inferior and ultimately unusable product as compared to MS Word, I shelled out the big bucks.

Google Docs is an impressive piece of web software, and certainly superior to wordpress’ text editor widget. However, I am pretty sure, that I prefer using MS Word if I ever have to write any document.

Nonetheless, this document was written using google doc.

My next task is to see if I can get MS Word to publish directly to my blog….

And for the record, Open Office was far more usable.

It’s 6 years later, and it’s painfully obvious that Google Docs is the alternative to MS Office products.

One of the interesting side effects of being disrupted is that you can stare at the disruption and it.

Google Doc’s was clearly a primitive version of MS Office, but it was good enough for some tasks and it was cheaper and simpler to manage than MS Office. Use Google Docs and you don’t need shared storage, license keys, a Microsoft deal etc.

What I didn’t understand 6 years ago was how computers and infrastructure were becoming free. As the cost per user declines, it becomes possible to offer a service for free for most people and charge a small number of people a small amount of money and still come out very much ahead.

Google Doc and SaaS is the destroyer of traditional IT and the vendors that support it. The process may take time, but it is a tidal wave of destruction that will leave new players in its wake.

The arrow of time moves forward and now I find myself practically never using MS Office because Google docs are free and easy to use. Sure I can’t write everything I want in them, but I don’t care.

tl;dr The latest laptop I bought does not have Office installed because I prefer to use Google Docs.

Introducing PlayScript

Over the last year Zynga has been looking at solving a hard problem in the mobile and web space: how do you deliver games that run on both mobile and web simultaneously without having to do a full port.

Although there are a variety of technologies out there that solve the problem to some degree or another, none of them were quite right for Zynga.

What we wanted was a single language that could then be compiled to a variety of run-times allowing us to quickly build 3D games for both web and mobile devices.

We looked at technologies like HTML 5, hAxe, Native Client and others but they all suffered from a distribution problem: not every browser supports 3D (IE) or the tool doesn’t support 3D (hAxe) or the technology is limited to one browser (Native Client)

So a couple of our great engineers looked at the problem and decided to see if there was a way we could bring actionscript games to mobile.

And so PlayScript was born.

PlayScript provides a Flash compatible runtime and rendering environment on mobile via OpenGL via the .NET platform, allowing games to be written once and run across web and mobile with the same code base.

PlayScript compiler and runtime has been released to open source under the Apache license.

You can find it here:

https://github.com/playscript/playscript-mono

Happy Hacking!

Childhood’s end

Today is a sad day.

Lucas Arts, the magical gaming company, is dead.

See here for more details: http://kotaku.com/disney-shuts-down-lucasarts-468473749

For most of childhood the Lucas Arts logo would cause my heart to race. Whether it was Indiana Jones or Grim Fandango or  x-wing, they made great games. Their games were and are fun.  Fun because they were well designed, and because they exploited their material better than anyone had before.

Although the last several years have been poor, like a champion athlete, you just wanted to believe that they could dig deep and give us one last bit of magic.

But instead, like so many great athletes whose time has passed, management announced their retirement.

May the force be with you, always Lucas Arts.

Microsoft Surface RT – Review

Thanks to the awesomeness of working for Zynga, I was able to get a Microsoft Surface RT as a loaner.

I used to be a huge fan of Microsoft products until one fine afternoon a virus struck. Right in the middle of a huge ops crisis with me frantically trying to get control of an errant set of web servers, some virus took control of my machine. Frustrated, I came into work the next day and said “Give me a Mac”.

After that 3 year experiment, I am moving back. Mostly because I found myself using a UNIX box disguised as a Mac instead of a Mac. The original Mac experience was nice because shit just worked. But now, after many years of customization I have basically replaced every single piece of Mac software with some downloaded application. And now I am dealing with the incredibly complicated configuration system that is UNIX. For me, the promise of the mac of was a simpler easier to use more robust system and that is no longer true. Therefore, I might as well use a device I am more comfortable using. More concerning is that the CEO of Apple, Tim Cook, views me as an uninteresting customer, preferring to sell tablets instead of making great laptop/desktop software..

So …

The Microsoft Surface RT is an interesting piece of hardware.

Screen

The form factor is unlike every other tablet. Following in the foot steps of Steve Jobs, the Android community makes Apple knock-offs. Microsoft chose to go different. The tablet screen is much longer than an iPad and much narrower. At first it was off-putting but it turns out that the form factor works great for surfing the web and for watching movies. Surfing the web is better because you see more of the web-site. As web-sites have gone from the page form factor to essentially an endless scrolling bottom, the long form factor is great. Watching movies is better because the screen aligns better with the 16×9 HD form factor.

Keyboard

The keyboard isn’t that great. But then again, unless it’s an IBM ThinkPad (not a Lenovo) the keyboard on all laptops etc suck. But it’s serviceable.

In use

Folks who claim you can’t put the device on your belly and watch a film are too thin. Fat Guys of the world rejoice, you can put the tablet on your belly with the kickstand and watch films… What is really cool is that you can use the kick-stand to watch a movie on your bed without holding the device…

I am finding myself using the device to surf the web, watch movies on netflix and talk on skype, and follow the world on Facebook…

Limitations

It’s painfully obvious that the device has an underpowered CPU.

It’s painfully obvious that if you have 1 neuron you’ll build an app for RT. If you have 2 neurons you will build apps for Windows 8 Metro. If you have 3 neurons, you will build an app for Windows 8… If you actually have a brain then you will build a Windows 8 app, that allow pieces of your app to be tiles on the Windows 8 metro interface. Evernote, honestly, does this best. If you are a windows 8 developer, use their product every day until you get what they did.

Conclusions

The digerati and the cognescenti are apple fan boys. The press is in love with Apple, mostly because their customers are Apple fans. And rightfully so. Apple has had an amazing run in terms of it’s products from the time jobs joined …

But… Microsoft Surface RT is an interesting piece of hardware. And the core problems with the device, a lack of performance and a lack of apps will be addressed by the Surface Pro. If the reddit thread is to be believed, then Microsoft has ways of addressing the battery power issues as well…

If you look around my office these days I see a lot of people running around with iPads hooked to keyboards… Which tells me MS is in the right ball park with their hardware…

Microsoft is an interesting company. With their cash reserves, and the sheer talent they have locked into their headquarters, they seem to be willing to lose money at rates that would cause other companies to panic to win in a market. Their first entrance into this market wasn’t a hit, but it wasn’t a miss. And the idea that a tablet is really just a different form factor for a laptop is looking increasingly prescient.

If I had some money sitting around I would buy a Surface Pro. Which is more than I can say about an iPad which I have never bought… (I own one because my wife loves them. She gives me her hand-me-downs…)