Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I think the main question is: Does the language get the job done?

The last six months, I've reworked a 30 years old legacy system written in MUMPS to use some state-of-the-art hardware. Low-level drivers for the hardware were delivered as DLLs written in C, High-level drivers came wrapped as Java classes, using JNI and Python wrapped in Java. High-level communication uses hexdumps wrapped in XML. My first attempt was to use the low-level interface and a MUMPS-C-Interface, but that failed because the low-level interface is essentially unuseable. So I tried to embed Java inside the MUMPS process, that failed because of at least two different C runtimes fighting out who owns the processs and who can create threads. Instant crash. The final solution is a TCP server written in Java that communicates with the high-level drivers and translates XML and hexdumps into something that can easily be parsed by MUMPS. The MUMPS process communicates via TCP/IP with the Java TCP server.

Missing details: A custom C program loads the Java runtime. A big Makefile written for both dmake and GNU make builds everything. Perl to generate some code and the documentation for the MUMPS code, and to test both Java and MUMPS code. Perl also converts legacy data written out by MUMPS as CSV into a new format, generating executable MUMPS code to reconstruct the data in the new format. InnoSetup builds a nice setup.exe, using Pascal for scripting during the setup. And a second Java program, also started via a custom C program, that connects MUMPS to an an external SFTP (SSH) server.

So, what's the "best" language? I used to say (or even shout) "Perl, because of CPAN, and because it stays out of my way". That's still true for many problems, but in this case, Java was "better" because of the 3rd party high level drivers written in Java. Interfacing those drivers from anything else than Java would have added even more layers of wrappers, making the solution even more complex than it is now.

I've learned that it can be very helpful to have more than one tool in your toolbox. I use Perl, and I prefer it for many problems, but I have no problem to use C, Java, Javascript, Bash, Pascal, MUMPS, assembler or a Makefile if that solves the problem easier or cleaner than Perl. And when it comes to adapting things that were never designed to fit together, I combine my tools, as shown above.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re: Argument for Perl ( again and again ) by afoken
in thread Argument for Perl ( again and again ) by heatblazer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found