Main Page | Report this Page
Computers Forum Index  »  Computer Languages (Smalltalk)  »  Java to Smalltalk conversion...
Page 1 of 1    

Java to Smalltalk conversion...

Author Message
Jecel...
Posted: Fri May 01, 2009 7:41 pm
Guest
On Apr 30, 6:09 pm, Davide Grandi wrote:
Quote:
Does someone knows if some kind of translation process has been done ?
(even for an ad-hoc / single application conversion)

Source to source translation is one option, but you might get similar
results by running Java inside a Smalltalk virtual machine (a bytecode
to bytecode translator). There is a thread in this group about people
interested in the opposite (Smalltalk on the JVM, which has actually
been done a few times). In the mid 1990s, there was a project that ran
Java on the Self virtual machine (I consider Self to be a Smalltalk)
and the results were good enough that Sun decided to buy Animorphics
and develop the Java Hotspot VM. See a description of Pep in:

http://www.merlintec.com/vmworkshop99/sub.pdf

-- Jecel
 
Davide Grandi...
Posted: Sun May 03, 2009 12:32 am
Guest
Jecel <jecel at (no spam) merlintec.com> wrote:

Quote:
On Apr 30, 6:09 pm, Davide Grandi wrote:
Does someone knows if some kind of translation process has been done ?
(even for an ad-hoc / single application conversion)

Source to source translation is one option, but you might get similar
results by running Java inside a Smalltalk virtual machine (a bytecode
to bytecode translator). There is a thread in this group about people
interested in the opposite (Smalltalk on the JVM, which has actually
been done a few times). In the mid 1990s, there was a project that ran
Java on the Self virtual machine (I consider Self to be a Smalltalk)
and the results were good enough that Sun decided to buy Animorphics
and develop the Java Hotspot VM. See a description of Pep in:

http://www.merlintec.com/vmworkshop99/sub.pdf

-- Jecel
Thank-you very much for the pointer (and on level up there are some

other interesting papers).

I'm focusing on (defining a process for) translating _working_apps_ from
java to smalltalk, because binary translations are out of my (practical)
reach. Software transformations _are_ in my practical reach (in a finite
time, may be).

Best regards and thank-you again, i hope to post something here in a few
months.

Davide
--
Ing. Davide Grandi
davide.grandi at (no spam) mclink.it
 
Mykhaylo Sorochan...
Posted: Mon May 04, 2009 8:10 pm
Guest
Quote:
Taking a working Java application and converting it into Smalltalk ?

Recently I wrote Java to Tcl and Java to Python source code
transformations (see http://macroexpand.org/doku.php/txl:projects:start)
with TXL (www.txl.ca). You can easily try them, there are binaries for
Win and Lin platforms.

I can say that it is not difficult in general to write a language
transformation Java->Smalltalk (e.g. I could write it rather fast
reusing e.g. java2tcl). The problem is with Java class library. I.e. a
tool can easily translate SomeJavaClass.MethodCall(arg1, arg2) to the
corresponding Smalltalk construction. But one will need to have an
implementation for that.

There are 2 solutions:
- translate the whole Java class library (or the subset needed for the
application) to SmallTalk. E.g. there will be corresponding Smalltalk
String class for Java String one.
- convert Java Class Libraries usage to the corresponding Smalltalk
classes. E.g. Java String class operations to the Smalltalk strings.
Both options have its pros and cons and depend on a particular
situation.
 
Joachim Tuchel...
Posted: Tue May 05, 2009 5:18 am
Guest
Mykhaylo,

Mykhaylo Sorochan schrieb:
Quote:
Recently I wrote Java to Tcl and Java to Python source code
transformations (see http://macroexpand.org/doku.php/txl:projects:start)
with TXL (www.txl.ca). You can easily try them, there are binaries for
Win and Lin platforms.

sounds interesting


Quote:
I can say that it is not difficult in general to write a language
transformation Java->Smalltalk (e.g. I could write it rather fast
reusing e.g. java2tcl). The problem is with Java class library. I.e. a
tool can easily translate SomeJavaClass.MethodCall(arg1, arg2) to the
corresponding Smalltalk construction. But one will need to have an
implementation for that.

I think that is exactly what Davide had in mind: harvest some of the
well-established Java class libraries and automatically port them over
to Smalltalk. In fact, there has been a fair amount of reimplementing
Java class libraries in Smalltalk over the years, and it sounds quite
interesting in the first place.

I am not sure whether I would like the resulting Smalltalk code. A 1:1
translation of a classical Java iterator loop or such would surely be
quite inefficient and, of course, blatantly stupid code in the context
of Smalltalk (I am not talking about Java code in general, although I
find some Java code patterns quite amusing Wink ). So a tool converting
Java to Smalltak would also have to recognize certain Java patterns and
"transpose" them to Smalltalk code. I don't think that simply
translating code would be a good idea, just because the code doesn't
have to be read by anybody since it can always be ported over again from
new Java libraries.

cu

Joachim
 
Panu...
Posted: Mon May 11, 2009 12:10 pm
Guest
Joachim Tuchel wrote:
Quote:
So a tool converting
Java to Smalltak would also have to recognize certain Java patterns and
"transpose" them to Smalltalk code.


I think this is the same kind of thing that
Smalltalk compilers do when they optimize
ifTrue: and blocks in general.

In other words the problem is not intractable,
though not trivial either. Clearly there is
some demand for a solution.

-Panu Viljamaa
 
 
Page 1 of 1    
All times are GMT
The time now is Fri Mar 19, 2010 6:23 am