APL language compiler to IL

1.2k views Asked by At

I don't have any experience working with APL and no one in our team has, but what we have is huge code base, which must be rewritten using more modern approaches. So I am just wondering are there any compilers, which can help with producing IL code from APL code? Or any other suggestions are really welcomed, how should we approach it?

2

There are 2 answers

5
Adám On

You do not say why it must be rewritten. I imagine it could be any of the following reasons:

You need to make changes and your team does not have any APL programmers.
 There are APL programmers and consultants out there and more are constantly appearing. I suggest advertising your need on an APL forum and contacting various user groups and application developers.

You are using an APL system from a vendor which no longer provides the needed support or you are looking to switch platform.
Contact Dyalog directly as Dyalog has much experience in migrating systems to the actively maintained, developed, and supported cross-platfrom Dyalog APL.

APL is perceived as old-fashioned so you want to future-proof your system by changing to a more common language.
Dyalog APL is a language that has been tuned and optimised for more than 30 years and has thus has evolved from classical APL2-style into a modern, multi-paradigm programming language. As Dyalog APL has full support and integration with .NET, it is on Microsoft's official list of .NET languages.

You are looking for higher performance.
 Depending on which APL system you use, you have several options here. Just upgrading to the latest interpreter version can gain you tremendous speed-ups. A consultant may also be able to tune your APL code to increase speed. Dyalog APL includes an on-the-fly compiler and now has built-in hashing for faster lookups. If you restrict yourself to the functional programming subset of Dyalog APL, dfns, you may use the Co-dfns Compiler to create C++ code from your APL code.

If none of these reasons apply to you, then please update your question to be more specific.

0
Lobachevsky On

There are several APL compilers out there which output different target languages, namely C, C#, Java, JavaScript, SAC, and perhaps others. However, these compilers may be experimental, academic, or not of an expected commercial quality. Further, the compiler may support only a subset of the language or not support newer language features (like Dfns). Lastly, the code emitted by a compiler would be very large and may not be something one would want to maintain going forward. Google Snake Island Research, Aaron Hsu, and Timothy Budd for more info.

One other thing to consider is that the philosophy and thinking behind APL programming may be rather (if not wildly, if not profoundly) different from that of programming in languages like C# or Java. Have a look at Aaron Hsu's talk from 11 September 2017 which explains this rather well. See https://video.dyalog.com/Dyalog17/?v=cpbtX0jK1z4 - Aaron's talk starts at around 2:00:00.

It would be useful to know something about the APL code in question - roughly when and for what APL system was it written, then where you'd like to go with the code - target language (Java etc.), OS, whether it should be a web application, etc.