<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [clean-list] Dynamic typing for communication with non-cleanprograms</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>And dump all the hard work on Java? Dynamics are a proprietary Clean format and likely more complex/liberal than you need. Maybe JSON is easier to use: probably available in your JAVA implementation already and under the hood JSON converters are already available in Clean iTasks.<BR>
<BR>
<BR>
-----Oorspronkelijk bericht-----<BR>
Van: clean-list-bounces@science.ru.nl namens Groenouwe, C.<BR>
Verzonden: ma 21-11-2011 13:39<BR>
Aan: pieter@cs.ru.nl<BR>
CC: clean-list@science.ru.nl<BR>
Onderwerp: [clean-list] Dynamic typing for communication with non-cleanprograms<BR>
<BR>
Dear Pieter (and others),<BR>
<BR>
Then another question:<BR>
<BR>
If you want to send information from one programming language (e.g. Java) to Clean, a typical way to go would be the following. First define an intermediate representation (for example in XML, or your own format). Then write a generator on the sender's side (in this case in Java), which converts a Java value or object into a file in the intermediate representation. Finally, write a parser on the receiver's side (Clean) which parses file holding the intermediate representation into a Clean value (with a Clean type). This is a labourious process during which you have the feeling you are are doing a lot of unnecessary work. As if you are repackaging the same sandwich three times in a row, first in a Java structure, then in the intermediate structure, and then again in a Clean structure... Waste of time (and the environment...) ;-)<BR>
<BR>
However, I had an idea: is it possible to use Clean's dynamic types for this purpose? Instead of generating some arbitrary intermediate type on the sender's side, immediately generate a value that can be read by Clean's dynamic type system. This would cut your work in half: you don't have to write a parser on Clean's side any more.<BR>
<BR>
I don't have any experience using Clean's dynamic typing yet, therefore I decided to first ask whether it is a fruitful approach before exploring it. Thus, is this possible and is it a good idea? Of course, I'm also open to other suggestions.<BR>
<BR>
Thanks in advance,<BR>
<BR>
Chide<BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>