Tuesday, March 4, 2014

Converters in Dart

In 2001 I was writing my first open source 'ZATreeX' which is a GUI to manipulate data regardless of what data structure is underneath. a tree Data structure was expressed though an interface (DataObject if my memory is good), and operations were also expressed through an interface that received that data and processed it. The "reference implementation" was made on the io file system...

As you expect, I'm not going to talk about that old product, but rather about generic concepts. "Making operations on data" is all what IT is about. Data differs, the operations differ, but this pattern is always there. So a language that includes this concept already in its core libraries is a language that is ready for the IT needs and this is perfect for programming efficiency:

Usually when you begin a mission (or revisit an old project), you have to spend a lot of time understanding how a given problem is solved (expressed) in that particular project. Usually there are some different possible ways, so you end up "decrypting" which of the ways the programmer chose (because you expect is somehow in one of the possible ways). Then comes the naming  issue: each person gives different names to his classes/methods and you have to understand which names correspond to the concepts you expect to find in the code. Documentations are useful for that, but frameworks are even better.

With a framework, you have a ready naming "convention" that everybody understands: when you say "Session Bean", "Struts Action", "Spring Prototype Bean", everybody understands what you're talking about and you can start explaining at a higher level...

But frameworks are many, and they compete. Therefore Sun microsystems, created the JSR to specify "standard ways" for the many existing frameworks: handling XML, database persistence, server communication (servlets)... but also more deep subjects such as transactions (JTA), connectors (JTC), extensions (JMX).

This way, a newcomer can immediately start working on a project without dealing with the specifics of a framework...

The earlier a language comes with "standard" libraries, the easier it is for the community to adopt it, since there are no time losses trying the different framework solutions and learning given solutions in the context of a project.

Converters and codecs are a central part of IT as explained in the introduction, so it's a very good news that it was addressed from the very start. here is a blog talking about the technical part of the subject

Written by Florian Loitsch 
February 2014
Converting data between different representations is a common task in computer engineering. Dart is no exception and comes with dart:convert,...

Thursday, February 6, 2014

Dart is becoming a js libraries ambassador

We could have thought that dart will position itself as an alternative to js libraries like Node.js, Angular, JQuery etc...

In fact, those libraries exist for some time already and propose rich functions that could be reused directly instead of having to write them in another language, test, debug, and maintain. So in short, people who are used to a js library will hardly want to learn a new language that will bring them troubles and hand work.

The issue with raw Js libraries is that you have to write your own js code to use them, and if you have complex tasks, you can find your self solving browser incompatibility problems, dealing with the js development tools that are limited since it's a script and there are too few assumptions the tools can make for you.


Because of that need, and because dart is a well thought language "that needs fewer lines to say the same things". Projects like AngularDart will inevitably emerge for the most active existing Js libraries.

More complex js "plaforms" will have to adapt: The more the platform was bringing services, the more it will have to do gymnastics to delegate some services to dart or parts of services.

Some blog posts still compare dart with js technologies like this interesting comparative table but this hard choice to do -especially if you have to learn a new language- cannot be left as a statu quo, there are too many things to win in joining instead of competing those technologies.

I'm sure the direction it is taking is not a concurrence but answers to real life problems like "How could I bring that feature to my project without being hardly tied to the library"

We will soon see a competition on who will adapt the first to dart, because dart is still making announcements for new js libraries that become compatible with it, it will fast become a sort of marketplace for new "club members". Especially because js libraries were needed for a long time, and many hundreds of js libraries emerged during that long long period, today if you search for a ready js gallery, you will find a plethora of solutions, some more buggy than others, if you have any kind of need, there are chances you will find your solution already working and tested on the web.

Dart will be the next way for these js libraries that are already in competition to become "visible" on the web, that's why the article says it's becoming an ambassador. I think it is not a good idea to create a "Dart play" website since Dart will surely be there at the right time, but on this specific point I could be wrong, and even this statement could influence the course of things: if some referee website will be born before, maybe they could also be then "bought" by dart with their already existing public...

Do you think I forgot an aspect of the js development world seen by dart aware developers? your comments will be welcome...

Wednesday, December 18, 2013

Rikulo one source code for all platforms

Following the previous article, here is a first early dart adopter company, who has clear future success in the
programming high tech field



http://rikulo.org/

With Dart you can target all browsers with one source code. With Rikulo, you can target all mobile platforms with one version of the mobile view layer.


Sunday, December 8, 2013

Why I think dart will detrone Java

The IT world is a very slow motion ecosystem, but when it comes to some very few technologies, things can go blazingly fast. Think about the iOs and xCode: a brand new system, a brand new language and millions of people adopting it the first year of its birth.

Java was also at some time a weird new language in the start of the millennium, but it promised twice a better programming speed performance against C++, the leading language at that time. Their one sentence argument was valid: resembles to C++ but removes the bug risky features. And it worked

We face today a new problem: proliferation of websites, each web site must be compatible with many browsers, many phones with different systems and/or different screen sizes, some people think that we will get back to the "all in html" philosophy because it becomes hard to write a native application for Android, iOS, Blackberry, Windows, and the other platforms. Some others invented the MEAP concept to compile an existing javascript web site to many native mobile platforms with a few code adapting

And I think that Google is preparing something big with Dart. Why?

Statistics say that programmers always wrote the same quantity of line code per day in all IT history. Humans can't express more lines than they do. So in a matter of speeding up programmers, if we cannot make them write faster, let's make them express themselves in less lines. That's the concept of expressiveness that was widely used by Ruby and Groovy to justify the reason they even exist, and they are right.



Dart was not made of "ideas" of what could be great, Google has put experts in language theory to decide the syntax. So it's not one smart guy, it's a smart team that already had a feedback on the ruby experience that created the language.

Now think about GWT, we now have a strong basis of companies solving the many browsers issue by writing their code one in java and having it compiled to all browser specific javascripts. Dart replaced the old GWT compiler, we can now write natively in dart to get javascript (without the .class bridge)

Add a Meap tool to your existing javascript website, and you instantly target all mobile platforms (PhoneGap seems to do it with few issues, but there are)

We have here a one base code for all, ideal world, but who can do it today? do you know many companies who do that out of their R&D projects? I don't.

So just imagine for an instant that Google announces you can write your application in Dart to have it compiled on all websites + all android screen sizes (that is possible when you do responsive web design). Android has 70% of the phone market already. People who were writing their android applications in java will not move to dart, but those who had to solve the problem of writing a website for all browsers + all mobile platforms will see a clear way to make economies on his investment.

So Dalvik 2 is getting out with Android 4.4, it already compiles .class files to the native format when installing the app: no more Dalvik VM (which drastically improoved performance). The next step for me is a no more JVM : because as you (should) know, java is written in Java: that means that "à part" some very low operations that are native like 'copy memory', all processing is done in java code, which is not hardware optimized: so the processor has to do statistical predictions to compensate the fact that it cannot know what is the java VM preparing to do...

My deduction from the fact that Google didn't announce you can write your Android application in Dart, besides the huge investment that is behind this language (auto-completion editor, very active community, GWT's official compiler) iiiis: they are preparing something bigger

You cannot hide for a too long Google, we know there's something on the way in your labs, so just say it :-)

So my prediction, is there will be a PhoneGap for Dart, or something of this kind... And this will make Dart the center of the world: it will natively compile to web sites and through the meap procedures and thanks to responsiveness, all phone platforms will be targeted. At the end, what made java beat C++ is what will make dart beat Java: one code for all

And you? do you think that java can be replaced one day?

By Zied Hamdi (1Vu.fr founder)