The Coming HTML 5 Revolution in GNU/Linux

by Rex Djere on December 12, 2011 · 13 comments

in TLWIR

My Route to HTML 5 Via C++

HTML 5 Gnu/LinuxI have spent the last couple of weeks working on a very ambitious C++ program. The program is a software model of a mechanical engineering system. I have never undertaken a more challenging or more rewarding computer programming project. As I spent hour after hour poring over the code, I began to realize why everyone is making such a fuss about HTML 5. The dream of HTML 5 is to make truly universal applications. I truly love C++, it is one of the world’s most flexible and powerful programming languages. However, this power and flexibility comes at a cost: complexity. I will always be a C++ programmer, but after seeing the power of HTML 5 combined with GNU/Linux and other free software, I have now become a believer.

When I write C++ code, I use a very powerful Integrated Development Environment known as Code::Blocks. I compile my Code::Blocks C++ code using GNU’s gcc compiler. The beauty of my system is that I can compile C++ code easily for GNU/Linux OR Windows. (I don’t own a Mac, so I’ve never really had the opportunity to try to compile my code for Mac). The wonderful thing about computer programming is this: the more that you learn, the more that you wonder just what else is possible. As I began to write great C++ programs, I began to investigate HTML 5, and I learned that it may offer easier ways of doing some things that I now do in C++. For example, the current C++ program that I am working on is called Tank Problem. It is a mechanical system with 2 pumps (pumps p0 and p1) and three tanks (tanks t0, t1, and t2). My goal was to write a C++ program that would demonstrate the faster method of filling tank t2: using just tank t0 OR using both tanks t0 and t1. Intuitively, I knew that the two tank method should be faster, but I did not know by how much. I successfully wrote the C++ console application, and it did give me the answer: the single tank method took about 5850 minutes, while the dual tank method took about 5790 minutes. My next desire is to make a GUI version of the application, one that will show all of the system operations: valves being opened, pumps being turned on, and tanks being filled. However, this desire introduced a whole new set of questions:

  • Which GUI Library would I use?
  • How would I represent changing numbers and visual tank levels graphically on a picture of a tank?
  • How would I render system messages and things like valves opening and closing.

I have never programmed a GUI application YET, so these are challenges that I will eventually overcome. Renowned saxophonist David Sanborn once said something that I found very interesting: he said that no matter how much you know, you are never truly a master, you are ALWAYS a student. There is always something that you don’t know, and often, the people who can give you that information know less than you do overall about the particular topic. I believe that the key to success is to stay humble, and to always keep an open mind. As I began to learn more about HTML 5’s canvas feature, I realized that HTML offered an alternative way to creating a GUI version of Tank Problem. (The HTML 5 canvas element allows one to easily draw 2D elements such as graphs. When I read this, I immediately thought about graphing and numerically displaying my updated tank levels real-time on top of a picture of the tank). I began to learn how much I did not know!

Since the syntax of C++ and HTML 5 are so similar, I could probably convert my existing C++ code over to HTML 5 in a day or so. Here is the beauty of HTML 5: it was built from the ground up with graphics in mind! When I realized all of this, the light bulb really went off in my head. C++, Perl, Php, Python, C, HTML 5, and all of the other programming languages complement each other. Skills learned in one language transfer to the other ones. That is why I have found that it is so important for me to continue getting better at C++, even as I forge ahead in the new discipline of HTML 5. Mastering one will makes stronger in the others.

C++ Versus HTML 5

Considering the last segment, “versus” is probably the wrong word to use. If one knows English AND Mandarin Chinese, he or she does not think of one of the languages opposing the other. To the contrary, knowing BOTH languages makes the person’s mind more adroit, flexible, diverse, and responsive. So the true master programmer can easily switch between varieties of programming languages. My goal when I started programming in C++ a few years ago was to become the best C++ programmer in the world. What I now realize is that this is not the way life works. Each bit of information that you learn makes it a little bit easier to learn the next bit. Each piece of information that you learn also makes you hungrier for MORE information. So as you learn more and more, it is impossible for you to ignore something new. Just hearing the words “HTML 5” made me curious to learn what it was all about. It also made me realize that I was crippling myself by only limiting my desired mastery to C++. I realized that the real world requires you to be flexible and able to solve problems using a variety of methods. I realized that C++ is the right tool for some jobs, but other jobs might be done more quickly and more efficiently using other tools.

Here is one difficulty that I ran into while writing the C++ Tank Problem application: coding a complex console application in C++ requires a lot of logical thinking, and attention to detail. Once the console version of the application is completed, debugged, and compiled, one still has to decide how to make a GUI version of it. There is no standard GUI library for C++. One can choose from Qt, GTK, WxWidgets, or a host of other graphics libraries. The promise of HTML 5 is to develop a standardized language which a programmer can use to create rich GUI applications that will run in any web browser. However, the painting is clearly visible on the wall: I believe that HTML 5 apps will eventually run outside of a traditional browser. I predict that many of what we now know as the desktop applications will eventually be written in HTML 5. Does this mean that traditional programming languages like C and C++ are dead? Absolutely not! I think that we will see a convergence where traditional languages are influenced by HTML 5. I see absolutely no reason why a standards body could not come up with a standard GUI library for C++. My final conclusion on this matter is that one should master making GUI apps in a traditional programming language such as C++, but also keep an open mind to learning how to do so in HTML 5 as well.

Why is HTML 5 gaining such traction in the GNU/Linux community?

To me, I think that the great interest in HTML 5 stems from the alleged technical shortcomings of Flash and the current version of HTML, which were famously spelled out by the late Apple CEO Steve Jobs. Flash did a great job of providing a unified web video platform, but allegedly poor performance on issues such as mobile device battery life and memory usage began to plague Flash. Microsoft offered Silverlight, but Silverlight ignored GNU/Linux users. The free software variant of Silverlight, Moonlight, was too far behind the latest Silverlight releases to be a serious option for the GNU/Linux community. Silverlight floundered, so much so that even Microsoft appears to have abandoned it in favor of HTML 5.

I believe that HTML 5 is gaining so much traction in the GNU/Linux community because it was created with the fundamental tenets of free software in mind: [1]

  • Adherence to accepted and open standards.
  • Platform independence.
  • Full access to program source code.
  • A disdain for proprietary plug-ins.
  • Lack of central control by a single commercial entity.

In other words, it was very clear that when Opera first proposed HTML 5, their vision was a revised and updated HTML language that freed both users and developers from the onus of coercive influence and control by any entity. No software vendor could force you to download plug-ins to watch your favorite video. The bottom line is that HTML 5 has arrived. A recent study showed that 34 of the world’s most popular websites are already using it. [2]

 

References

[1]HTML5. (2011, December 12). In Wikipedia, The Free Encyclopedia. Retrieved 22:00, December 12, 2011, from http://en.wikipedia.org/w/index.php?title=HTML5&oldid=465435877

[2] “Percentage of Web sites Using HTML5″. binvisions. http://www.binvisions.com/articles/how-many-percentage-web-sites-using-html5. Retrieved 21 October 2011.

 

{ 12 comments }

Dominique De Vito December 13, 2011 at 8:19 am

“I believe that HTML 5 apps will eventually run outside of a traditional browser. I predict that many of what we now know as the desktop applications will eventually be written in HTML 5″

Well, those apps quite already exist : into those application set, there are at least all applications built on top of XulRunner – https://developer.mozilla.org/en/XULRunner – which is the core of Firefox.
Those apps are developed using XUL which is currently a cousin of HTML 5, because HTML 5 still lacks some features in order to able to build such apps, like menus for example.
To quote Glazman – http://www.glazman.org/weblog/dotclear/index.php?post/2011/09/19/HTML-UI – HTML+CSS still lacks major, really major stuff like:
* real menus
* tabboxes
* pop-ins and more powerful tooltips
* trees (and when I mean trees, I mean tree-like widgets like the XUL able to render tens of thousands of lines w/o making the user experience awful)
* better integration with the OS/WindowManager
* etc.

Well, the native app development and the HTML-based app development are indeed strongly converging. But still some gaps remain to be filled, may be within HTML 5, or even HTML 6 ?

IGnatius T Foobar December 13, 2011 at 9:07 am

You are mistaken. It is called “The Linux Operating System” not “GNU/Linux.” GNU only supplied the compiler and toolchain and some other minor components.

apsillers December 13, 2011 at 9:46 am

@IGnatius: I see what you did there.

Hernan Silva December 13, 2011 at 11:58 am

Nice writing. Thanks for your appreciations.

Rex Djere December 13, 2011 at 2:02 pm

Thank you all for the wonderful comments! @Ignatius I have switched back and forth on the Linux and GNU/Linux thing. Richard Stallman is a friend of mine, and out of respect for him and the work he and the FSF have done, I have decided that I will always call it GNU/Linux, as the Debian organization and other well respected organizations also do. There is a lot of other free software in GNU/Linux beside GNU and the Linux kernel, but the fact of the matter is this: in 1991, if it had not been for the FSF and Richard Stallman, Linux Torvalds would have had no software to run on top of his great kernel. I have found that it is better to stick to your convictions and just decide upon something. Based on what I know, I will continue to call the operating system GNU/Linux. Thanks again for the wonderful comments!

Andy Jackson December 13, 2011 at 3:17 pm

HTML5 running any respectable UI toolkit (DOJO) or with a (very) little work can have all those constructs except OS/WM integration. I really hope HTML6 gets an Android-like permissions system:

i.e.: This HTML5 app wants the following features:
- Local Sandbox
- Add to Downloads folder
- P2P networking (Rate Controlled)
Where executing arbitrary commands, etc would be “Risk: High, Only if you trust the app creator”

f December 13, 2011 at 6:38 pm

When people talk about HTML5 they really mean Javascript, HTML5 and CSS3

The key here is Javascript for programming, HTML5 and CSS3 for structure ect.

Varol December 14, 2011 at 4:31 am

I think it is admirable to try to become the best in just about anything. Stick with it, it will get you to places.

Also C++ is ONE programming language. HTML5 is a whole lot of technologies combined.
When you talk about the similarities of HTML5 and C++, I had to laugh, after all HTML is a XML markup language, and has nothing to do with program logic.
You are thinking about JavaScript, which has improved in performance a hundred times over within the past couple of years.

If you stay on this road of learning and really dig in deep, you will eventually come to the conclusion to play with LLVM ( or similar ) and build your own language.Trial and error. Invest in what you accumulated over the years and improve -=> Give back.

I think of programming like the scene from “The Matrix” where Neo started to see the walls in numbers, when what we conceive as reality disappears in front of his eyes. You’ll become master of the known and a wizard of the imagination. Nothing can stop you.
One truth still remains, which is that of constant learning … YOU GO !

Gary December 14, 2011 at 5:24 am

Like “f” said Javascript is key. But Javascript is like a gun with 47 barrels. Once you have your target in the sights you need to be careful and make sure none of the barrels are pointed at your feet, chest or head. A while back a friend loaned me a book ( I have since bought my own copy) from O’Reilly – Javascript the Good Parts by Douglas Crockford. It won’t teach you to program but provide ways to use Javascript in ways you intend it to function.

Andreas Mohr December 15, 2011 at 2:35 pm

“Does this mean that traditional programming languages like C and C++ are dead? Absolutely not! I think that we will see a convergence where traditional languages are influenced by HTML 5.”

C++? Dead? No – simply start using Wt (web toolkit, http://www.webtoolkit.eu ) and whip up all those cool widgety environments (plus HTML 5) using “your favourite language”. And that would be? C++…

I don’t have extended experience with Wt (other than it having been one part of my multi-faceted thesis), but from what I could gather, it’s a very impressively implemented framework (code quality wise).

Just mentioning it since nobody seemed to have come up with it here yet…

Rex Djere December 15, 2011 at 4:33 pm

@Adreas Mohr Thank you for the great comment. I had never even heard of the Web Took Kit! I will look more into it. I know that Google also has an initiative that allows developers to develop programs in C++, and to run it in HTML 5 with little or no modification. It is called Chrome Native Client and this article gives a great description of it: http://www.2ality.com/2011/08/chrome-native-client.html

I read a little bit about it recently and I found it to be very interesting. However, here is one of those situations where my hard line stance on an issue gets in the way of learning something new. I am a die-hard Firefox user, and my loyalty to Firefox has held me back from investigating the full power of Chrome. I realize that to become a master programmer, I will have to overcome this feeling, and learn to use all kinds of different tools. Each of these tools can make me stronger. The biggest mental block that I have is to Microsoft’s products…lol. I have used Micorsoft’s Visual Studio to compile C++ code in years. I have been loyal to Code::Blocks and GCC for at least the last two years or so. Before that, I used Emacs + GCC.

I realize that I may work for some company in the future that forces me to re-familiarize myself with and use Microsoft Visual Studio, so I may begin to dabble with it again, just so I stay on top of it. Anyway, thanks again for the comment!

Erwin Müller December 16, 2011 at 1:30 am

Html for a real application? Are you kidding me?
I have yet to see a web user interface that don’t suck. It’s sluggish, comber some, and error prone.
Please stick in the Web for what the web was build for: content. That is, text with some images and maybe video.

Also I don’t really know what you talking about. What is the “power” of html5 – stuff that could be done in any language for decades, that you can now do in a browser? Now you have some Canvas stuff, good that we can now utilize the quad core CPUs, the software was too fast anyway. I really like how my browser and my desktop will become sluggish just for some Html5 game.

What is the “traction in the GNU/Linux community” for Html5 what you talking about?

If you want simplicity, just use a nice language. I use Java (with Groovy). You can use Python, Ruby. Also platform independence was solved decades ego, even for C++. Just use a cross-platform tool kit like Qt, GTK or wxWidgets.

Also I quote on the same topic from Slashdot.org
http://slashdot.org/comments.pl?sid=2574298&cid=38376434
For years Flash was pretty dominant in the web, like 99% of the browsers have Flash and if your browser or operating system not support Flash, nobody would use it. But what happened after years of dominance? Nothing at all, even Adobe now ditches Flash. Don’t tell you can’t build applications with Flash, that are pretty good, or that Flash is a bad technology. Flash is a super technology and you can do with it whatever you like. But after years and years of dominance it’s now dying, and it was not used for anything more then annoying ads, file upload, a flash game and some promotion web sites (like for games or film sites).

But now because you can draw some pixels in a CSS canvas, everyone thinks it will transform the web in some magical way. Sure, the new Html5 features will be used, and they are pretty good. But the web will stay in the same state as it was decades ego. That is, isolated web pages with content, without any semantics.

{ 1 trackback }

Previous post:

Next post: