Martin Fowler, of Extreme Programming fame, states:
"any fool can write code that a computer can understand. Good
programmers write code that humans can understand."
While true for every programmer in the business, this maxim also
applies to code generators and translators. In this installment of
"Web Services @ Work," we interview Federico Zoufaly, CTO and
cofounder of ArtinSoft. His company is dedicated to creating code
transformation tools that produce results humans can understand,
rather than code that is suitable only for machines.
ArtinSoft's latest and most exciting products relate to the
translation of Java to C#. To be honest, being a dedicated Java
developer occasionally made it challenging to be a dispassionate and
objective interviewer. While C# and the .NET Framework are becoming
increasingly interesting to me, it's difficult not to have a
knee-jerk reaction to things that advance a Microsoft agenda. But
it's a brave new world of open standards and cross-language
computing, and the best tool a developer can have is an open mind.
By the end of our conversation, I understood that ArtinSoft's
products aren't about advancing one corporate agenda over another.
Rather, they're about providing developers with choice in languages,
libraries, and frameworks. That said, as a Java developer I'll be
glad to see an ArtinSoft C# to Java translator when C# has the
install base to justify it.
MIKE: Federico, please give us some background on ArtinSoft, how long it's been around, and what the company offers.
FEDERICO: We started ArtinSoft in 1993 and since day one we've been
focusing our attention on source code-to-source code translation.
We've been in the migration business for over nine years and the
basis of our technologies is derived from research in artificial
intelligence, specifically in theorem proving.
For instance, when you're proving a theorem in mathematics or in
general logic, you have a set of statements that describe a certain
reality. Then you start rewriting those statements, preserving
equivalence each time in the right process until you reach some
conclusion from the original statements. That same technique is what
we apply to our source code-to- source code translation technology.
We take the original programming language or the original
application, translate it to an intermediate format that we can
manipulate, and then perform a lot of rewriting, preserving
equivalence, until we reach the normal state of the program in its
target language. We then print it with the correct syntax so that
it's ready to be consumed by both the computer and the developer.
It's very important to distinguish our technology from normal
compilation technology. A normal compiler goes from a certain level
of abstraction down to a lower level of abstraction until it reaches
the machine level. In our case, one of the main goals of our
technology is to make sure that the generated code is understandable
and maintainable by the original programmer. This means that we have
to make sure the output is of high quality so the programmer can
forget about the original source code and continue to evolve the
application in the new platform. See Listing 1, a simple JSP to
ASP.NET conversion.
MIKE: How did you come to start ArtinSoft and what is your background?
FEDERICO: I was one of the original founders of the company, so I've
been working for ArtinSoft since '93. At the time, I was finishing my
master's degree at the Costa Rican Technological Institute, and I
joined Dr. Carlos Araya, who is the president and founder of the
company. He is the one who had the original artificial intelligence
ideas that we apply to our technology. So it was three other people
and I that started ArtinSoft in '93. Shortly thereafter, another
person joined us, providing the commercial background for the
company, because the rest of the team was completely technical.
Eventually, around '96, we opened the company to some local venture
capital.
MIKE: Could you describe the business community in Costa Rica in
terms of software development?
FEDERICO: Costa Rica is a small country with less than four million
people. There are about 150 software companies right now. I think
there are so many software companies in Costa Rica because in 1948
Costa Rica eliminated the army and decided to spend the entire budget
on education. So the education level in Costa Rica is very, very good
- computer science in particular. Most of the major universities have
teachers with PhDs and master's degrees from U.S. and European
universities. So the level of faculty education is also very high. At
the same time, the business environment here has been good, and that
is why software development has been a great success. In 1999 Intel
made a big investment down here by building a large plant. They also
added to the stability of the country and proved that Costa Rica is
an excellent place to develop technology.
MIKE: What were the first practical applications of your conversion technology?
FEDERICO: Our first large, international account was doing research
for Oracle, starting in '93. Then we moved on to the translation of
Informix 4GL, where our first large customer was ICL of London. For
ICL we translated a large Informix 4GL banking application to Java.
At the time it was, in our estimation, the biggest Java application
ever developed, having 1.8 million lines of Java code. It was a very
good proof of concept for both Java and our technology.
MIKE: How did you establish a strong relationship with Microsoft?
FEDERICO: Microsoft was looking for a company that could help them
bridge between Visual Basic 6 and Visual Basic .NET. As you may know,
Visual Basic .NET is not backward-compatible with Visual Basic 6.
Microsoft wanted to move Visual Basic into a first-class language on
top of the .NET Framework. In order to add the features that they
wanted, it wasn't possible to keep backward compatibility. However
they didn't want to leave their install base stranded, so they looked
for a company that could develop a migration engine for them.
Eventually they chose ArtinSoft. We started to work with Microsoft at
the end of '99, and we're still working with them. We have already
delivered the Visual Basic .NET Upgrade Wizard, which has been
integrated into Visual Studio .NET. We're also developing for
Microsoft the Java-language Conversion Assistant, which is a Visual
J++- to-C# translation tool. It will be included in the next revision
of Visual Studio .NET. For now, the beta version is out and
downloadable from the Microsoft Web site. The RTM version is going to
probably happen later on this year.
MIKE: Now your latest product is the Microsoft Java-language
Conversion Assistant. Could you give us a description of the feature
set for that product, what someone could expect when he or she runs
it, and what's going to come out the other side?
FEDERICO: We're going to take Visual J++ source code, which is the
Java JDK 1.1.4 and is the last one [version] supported by Microsoft,
and we're going to turn that into C#. Both the language and all of
the object libraries are going to be mapped to C# and the object
model for .NET. This we're building for Microsoft. On top of that,
ArtinSoft is building the Java-language Conversion Assistant
Enterprise Edition that will take all of J2EE and translate that into
C# and the .NET Framework, including JSP to ASP.NET translations. So
we're going to deliver that on top of the VJ technology for the J2EE
platform.
MIKE: Will that be a product that any developer can simply download
and run on their projects? How would someone begin to evaluate this
product and see if it will work for his or her Java project?
FEDERICO: The Visual J++ product is now downloadable from the
Microsoft Web site, and I think that even though it covers the Visual
J++ object model instead of the full J2EE model, it's a good example
of what the translation technology can do. From there you can start
to evaluate our product. Eventually, we're going to license our JLCA
Enterprise Edition as a product, so customers can license it,
download it and then use it on their project.
MIKE: Do you feel like you get a good sense of every language that
you end up either reading from or writing to?
FEDERICO: Yes. Definitely. We have engineers who are language experts
in all the aspects of a language, from how to parse it, how to
generate it, and what the transformational rules are that we have to
apply in order to move from one to the other. We certainly have a lot
of expertise on that, and we also use sample applications from
real-world customers. We try to always collect a set of applications
to also provide us with a feeling on how languages are used in the
real world, and we focus on that. Our technology is based on pattern
matching, so we try to find the program patterns that exist in real
world applications, and that's what we translate in order to move the
high-level abstraction from one platform to the other.
MIKE: Excellent. Some people on the IRC channel #java wanted me to
ask you to compare and contrast Java and C#.
FEDERICO: Both Java and C# are derived from C++, so they have a
common root. In that sense, they're similar enough. But you have to
also understand that the language syntax itself is not as important
to these languages as the object library that comes with them. So
Java and C# are fairly simple languages. But what makes them very
powerful is the object library that comes with them. You have all the
Java SDK on one side and you have all the .NET CLR on the other side,
and mapping those two is the real challenge in the translation
business (see Table 1). Even though most of the functionality exists
on both platforms, the way in which it is implemented is different.
Our task is to match between the two platforms, which is not always
an obvious task.
MIKE: How do your engineers translate higher-level concepts from Java to C# in a way that preserves these concepts and thoughts?
FEDERICO: They have to study both plat
forms and find how to accomplish a certain action in Java and how you
would do the same thing in C#. It is not merely a one-to-one mapping,
string class to string class. For very basic things, some mappings
are very easy to find. For the most advanced features, you have to
understand how the Java platform works and how the .NET platform
works in order to find the right mapping. Remember, we are not
building a compiler, so we want to make sure that the code we
generate is understandable and is as close as possible to how it
would have been implemented in the first place, by a native C#
programmer.
MIKE: What are the market forces behind ArtinSoft releasing the
general Java to .NET Conversion Assistant?
FEDERICO: We think that both Java and .NET have a future in the IT
community. We actually would say that in a few years from now, the
market is going to be split among them. So there are always people
who want to move from one to the other, merely because they want to
get closer to the .NET platform or merely because a customer has a
preference for Java instead of .NET or .NET instead of Java. For
instance, a very good scenario is a software company, that builds
applications. Perhaps they have their application written in Java
right now, but they want the same functionality using a Microsoft
platform. They might want that same functionality in .NET. I think
.NET is a good alternative to Java. It's a platform that is
definitely going to be successful.
MIKE: Now another question that people in #java came up with - are
there plans for a .NET to Java converter?
FEDERICO: We at ArtinSoft try to pick our platform based on the
market demand. Right now .NET is too new. There is not a lot of code
written for the .NET platform yet. Therefore, writing a conversion
tool for .NET to Java doesn't really make a lot of sense for us at
this time. Eventually, if that becomes a market need, we will
certainly consider it.
MIKE: Could you tell us a little more about the WinToWeb tool you
launched at TechEd?
FEDERICO: It is a Windows Forms-to-Web Forms conversion assistant. So
it takes your client/server Windows Forms applications and moves them
to a thin-client approach, or ASP.NET. If you have Visual Basic 6
code, which normally is a client/ server or rich client, you will
first move it to .NET using the Upgrade Wizard that is supplied by
Microsoft. And then, once you're there, if you want to Web-enable
your application, we provide the WinToWeb solution, the Windows
Forms-to- Web Forms assistant that actually transforms it to ASP.NET.
We launched the beta version at TechEd, and launched a release
version early this summer.
MIKE: When will someone be able to download that product and work with it?
FEDERICO: The beta 1 version is available for download right now from
our Web site - www.ArtinSoft.com. You can download it now for
evaluation.
MIKE: Will the final conversion tool be downloadable?
FEDERICO: The final product is probably going to be downloadable - I
don't know - [by] fourth quarter this year. Those are the dates we're
looking at right now.
MIKE: Federico, any last thoughts?
FEDERICO: I want to make a point that in the past, migrations have
always been a very painful job for IT departments, but with
ArtinSoft's technology, we are minimizing the work that has to be
done in the migration process. We're providing companies with the
freedom to choose where or which technology to use, instead of having
to be locked in a particular platform.
MIKE: Thank you, Federico, and best of luck with your upcoming products.
Author Bio
Michael Sick is an independent Java architect who helps clients solve
complex product definition and design problems. He has more than
eight years of experience in the construction of distributed
information systems and Internet technology, such positions as
architect and VP of development.
mike_a_sick@yahoo.com
Nothing Lost in the Translation, by Michael Sick
WSJ Vol 02 Issue 08 - pg.46
Listing 1: Simple JSP to ASP.NET Conversion
JSP/Java Source Code
<%
// set up session attributes
session.setAttribute("key1", "value1");
session.setAttribute("key2", "value2");
// display session attributes
while (attributesEnum.hasMoreElements()){
String attributeName =
(String) attributesEnum.nextElement();
Object attributeValue =
session.getAttribute(attributeName);
%>
<%= attributeName %> : <%= attributeValue%>
<%
}
%>
ASP.NET Migrated Code
<%
// set up session attributes
Session.Contents["key1"] = "value1";
Session.Contents["key2"] = "value2";
// display session attributes
System.Collections.IEnumerator attributesEnum =
Session.GetEnumerator();
while (attributesEnum.MoveNext())
{
System.String attributeName =
(System.String) attributesEnum.Current;
System.Object attributeValue =
Session[attributeName];
%>
<%=attributeName%>:<%=attributeValue%>
<%
}
%> a
All Rights Reserved
Copyright © 2004 SYS-CON Media, Inc.
E-mail:
info@sys-con.com