This page is no longer maintained — Please continue to the home page at www.scala-lang.org

COBOL translator with Scala DSL

9 replies
eakarsu
Joined: 2009-06-14,
User offline. Last seen 42 years 45 weeks ago.

I am looking at alternative technologies on a translator from COBOL to
Java/.Net languages.

One choice is to use a compiler tool like ANTLR.

Another option is using Scala that has strong foundation to build DSL.

I need to have an idea from Scala founders.

Regards

Erol Akarsu

John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
Re: COBOL translator with Scala DSL

On Sun, Jun 14, 2009 at 8:51 PM, eakarsu wrote:
> I am looking at alternative technologies on a translator from COBOL to
> Java/.Net languages.

Why?

BR,
John

L Jantzen
Joined: 2009-01-27,
User offline. Last seen 42 years 45 weeks ago.
Re: COBOL translator with Scala DSL

I agree with John. Do yourself a favour and write it from scratch in
idiomatic scala/java/csharp/whatever. You will be glad you did.

LJ

John Nilsson wrote:
>
> Why?
>

maku
Joined: 2008-10-06,
User offline. Last seen 4 years 4 weeks ago.
Re: COBOL translator with Scala DSL

eakarsu wrote:
>
>
> I am looking at alternative technologies on a translator from COBOL to
> Java/.Net languages.
>
> One choice is to use a compiler tool like ANTLR.
>
> Another option is using Scala that has strong foundation to build DSL.
>
> I need to have an idea from Scala founders.
>
>
> Regards
>
> Erol Akarsu
>

When I had to write a translator from COBOL to anything else I would use a
specialized tool for this.

I use openarchitectureware xtext (http://www.openarchitectureware.org./ ,
http://www.eclipse.org/modeling/tmf/) for code generation purposes. It is
really powerfull. You woud be able to define a COBOL like DSL and generate
Java or Scala sources.

Regards,
Martin

eakarsu
Joined: 2009-06-14,
User offline. Last seen 42 years 45 weeks ago.
Re: COBOL translator with Scala DSL

Thanks for Reply,

I need to automate the translation process somehow and looking for better
method. Here I would translate millions lines of COBOL code.

Yes your are correct that I need to try to map first language constructs and
do translation theoretically.
Is it what you mean?

Regards

Erol Akarsu

L Jantzen wrote:
>
> I agree with John. Do yourself a favour and write it from scratch in
> idiomatic scala/java/csharp/whatever. You will be glad you did.
>
> LJ
>
>
> John Nilsson wrote:
>>
>> Why?
>>
>
>

eakarsu
Joined: 2009-06-14,
User offline. Last seen 42 years 45 weeks ago.
Re: COBOL translator with Scala DSL

Thanks Martin,

I will look at them

Erol Akarsu

Martin Kuhn wrote:
>
>
> eakarsu wrote:
>>
>>
>> I am looking at alternative technologies on a translator from COBOL to
>> Java/.Net languages.
>>
>> One choice is to use a compiler tool like ANTLR.
>>
>> Another option is using Scala that has strong foundation to build DSL.
>>
>> I need to have an idea from Scala founders.
>>
>>
>> Regards
>>
>> Erol Akarsu
>>
>
> When I had to write a translator from COBOL to anything else I would use a
> specialized tool for this.
>
> I use openarchitectureware xtext (http://www.openarchitectureware.org./ ,
> http://www.eclipse.org/modeling/tmf/) for code generation purposes. It is
> really powerfull. You woud be able to define a COBOL like DSL and generate
> Java or Scala sources.
>
> Regards,
> Martin
>

John Nilsson
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.
Re: COBOL translator with Scala DSL

I meant "Why?" more as in: "What makes the current COBOL code so
unusable that it is worth the effort, and risk of introducing defects,
to translate it to something else?"

Anticipating that the reason is that the code is no longer
maintainable due to COBOL knowledge disappearing from the organization
and that the code need to continue to evolve. I think translating the
COBOL code won't buy you anything. The result will undoubtedly be even
more esoteric and unmaintainable.

Maybe a better strategy would be to either integrate the existing
COBOL functionality with new features developed in another language
or, as LJ suggested, replace the COBOL code by hand.

BR,
John

On Mon, Jun 15, 2009 at 7:18 PM, eakarsu wrote:
>
> Thanks for Reply,
>
> I need to automate the translation process somehow and looking for better
> method. Here I would translate millions lines of COBOL code.
>
> Yes your are correct that I need to try to map first language constructs and
> do translation theoretically.
> Is it what you mean?
>
> Regards
>
> Erol Akarsu
>
>
> L Jantzen wrote:
>>
>> I agree with John.  Do yourself a favour and write it from scratch in
>> idiomatic scala/java/csharp/whatever.  You will be glad you did.
>>
>> LJ
>>
>>
>> John Nilsson wrote:
>>>
>>> Why?
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/COBOL-translator-with-Scala-DSL-tp24024603p2403893...
> Sent from the Scala - User mailing list archive at Nabble.com.
>
>

eakarsu
Joined: 2009-06-14,
User offline. Last seen 42 years 45 weeks ago.
Re: COBOL translator with Scala DSL

Martin,

Do you think current version of xtext can handle COBOL grammar efficiently
and correctly?
Have you had any experience with applying xtext project on large grammar?

Regards

Erol Akarsu

Martin Kuhn wrote:
>
>
> eakarsu wrote:
>>
>>
>> I am looking at alternative technologies on a translator from COBOL to
>> Java/.Net languages.
>>
>> One choice is to use a compiler tool like ANTLR.
>>
>> Another option is using Scala that has strong foundation to build DSL.
>>
>> I need to have an idea from Scala founders.
>>
>>
>> Regards
>>
>> Erol Akarsu
>>
>
> When I had to write a translator from COBOL to anything else I would use a
> specialized tool for this.
>
> I use openarchitectureware xtext (http://www.openarchitectureware.org./ ,
> http://www.eclipse.org/modeling/tmf/) for code generation purposes. It is
> really powerfull. You woud be able to define a COBOL like DSL and generate
> Java or Scala sources.
>
> Regards,
> Martin
>

maku
Joined: 2008-10-06,
User offline. Last seen 4 years 4 weeks ago.
Re: COBOL translator with Scala DSL

eakarsu wrote:
>
> Martin,
> Do you think current version of xtext can handle COBOL grammar efficiently
> and correctly?
> Have you had any experience with applying xtext project on large grammar?
>

From my point of view, every approach for converting COBOL to Java or Scala
would require to define something like a parser. You have to build/define
for your Cobol syntax a "DSL" which makes it possible to parse the existing
sources and to process it. There is NO predefined stuff for that!!!!!

XText is a specialized tool for code generation which makes it rather simple
to define a DSL (compared to other approaches).

From the website:
"Xtext is a framework for development of textual domain specific languages
(DSLs). Just describe your very own DSL using Xtext's simple EBNF grammar
language and the generator will create a parser, an AST-meta model
(implemented in EMF) as well as a full-featured Eclipse text editor from
that"

I use it extensively and I'm really impressed by the power of the tool.

But of course, the task is not simple whatever approach you will choose.

Florian Hars
Joined: 2008-12-18,
User offline. Last seen 42 years 45 weeks ago.
Re: COBOL translator with Scala DSL

eakarsu schrieb:
> I need to automate the translation process somehow

Not scala, but probably related: http://homepages.cwi.nl/~ralf/padl03/

- Florian.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland