Hi. I believe that you have to consider Development Schedule - you may
want to learn another language but this project is "immediate". My
experience, top management doesn't usually care what technology you used
just you get to deliver on time and within specs. You may have to ask
yourself how good a Java programmer you are. The APL code may be simple
enough that Java and APL would work. Unless you're a software
development house, you won't get any thanks in using the right and cool
technology to solve a problem if there's a delay.

Ok. Now let's answer your questions one by one (NOTE: This is only my
opinion ... and I may not even be a good J programmer):
1. Can APL be converted to J?  and what are the options for doing that?.
- You have to do it manually. Why? Primarily because you need to
understand what's going on. Using an automatic converter never helps
unless what your doing is really simple. 
2. Is this required, beneficial, etc.? - No, converting from APL to J is
not required but it is beneficial. J is an array processing language
much as the same as APL. Java can never do what J or APL does without
the help of SQL. 
3. I saw some posts in the archive about Java to J communication. Anyone
have any comments about their experience integrating Java and J? -
during J 4x and J 5x ... we actually have a Java programmer who actually
did start interaction with J using the J Sockets interface. It actually
works but the project didn't pan out.
4. I feel like this communication would "need" to be as close to an
in-process call as possible and the J process would have to be long
running.  Similar to a service or "engine" approach. - Although I use C#
instead of Java, I actually have 2 kinds of implementation with J
running in production environment. 
        a. J as a Service - This has worked well for me. This has the
advantage of running J on a powerful machine and debugging scripts in
one location (which both have pros and cons). What I did was my system
can run in one of two modes. First is the debugging mode where my server
will only create one instance of J and throws all commands and requests
to that one instance. Unfortunately, due to how J handles threading,
multiple requests are actually queued. So my production system actually
creates a new instance of J every time a new command comes in. For more
information about this, I would like to point you to
http://www.zeroc.com ... they provide an Open Source middleware
communication engine that supports Java. This can greatly simplify your
java to J service development. I did used their product a few years back
and the speed is insane.
        b. J as OLEAUTOMATION server - This actually is a good
implementation but not without its caveats. The idea is that you create
an instance of J in the local PC where your application is running. This
has the advantage of being able to debug your system on the local
machine without interfering with the server. Of course, you now get into
headaches like running your J scripts in underpowered machines and other
user n00bness. :P I'm using this now because most of the times,
debugging server problems across the ocean is a hair pulling experience.

5. Anyone have any comments about J using an Oracle database? - first
off, I use J with MS-SQL using ADO.NET. It works which means it would
also work with Oracle. Now a word of warning ... J is FAST but saving
data back is SLOW. I actually get ALL possible data from the database
and just do the filtering and other data manipulation stuff in J. I have
already hit cases where I my result is an 2 dimensional boxed array with
33,750 rows by 58 columns. I was able to immediately transfer the data
from J to the C# application (as SQL Insert DML) ... the problem is that
trying to insert the 33,750 records takes some time and the web server
times out and forces the C# try-catch and all hell breaks loose. :)

One last unsolicited advice. You assume that your new to J and your
still starting out. I would suggest that you use the "primitives"
library. It would allow you to do the following:
NB. without loading primitives
   [temp=. i. 3 5
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14

    [temp=. temp,temp
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14

   +/ temp
30 36 42 48 54   

NB. Unique 1st column with tally, minimum, maximum, average of 4th
column
   (~.{."1 temp),.({."1 temp)(#,<./,>./,+/%#)/.3{"1 temp
 0 2  3  3  3
 5 2  8  8  8
10 2 13 13 13

   
NB. with primitives
   load 'primitives'

   [temp=. integers 3 5
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14

   [temp=. temp append temp
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14
   
   sum=: plus
   across=: insert
   average=: sum across dividedby tally
   minimum=. min across
   maximum=. max across
   unique=: nub
   (unique take rank 1 temp) stitch (take rank 1 temp) (tally, minimum,
maximum, average) key 3 from rank 1 temp
 0 2  3  3  3
 5 2  8  8  8
10 2 13 13 13

As you can see from my very simple example, if you're a newbie and your
still getting cross-eyed with all the symbols ... you can use some of
the word equivalents to help you along (although it will be longer).
Later on, where you've become comfortable with J, you can just search
and replace all the words with the symbol equivalent. :)

Good luck with your project.

r/Alex
        

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert Quinn
Sent: Sunday, March 09, 2008 9:12 AM
To: [email protected]
Subject: [Jprogramming] APL conversion to J and integration with
Java/Oracle

I preface this request with the disclosure that I know nothing about APL

or J.

But I've been asked to recreate an APL based system in Java and I'm 
trying to understand APL's benefits and found J as part of my research.

J seems a little more viable and possibly "better" then APL but I'm not 
knowledgeable enough to know. 

My questions are...

Can APL be converted to J?  and what are the options for doing that?. Is
this required, beneficial, etc.?

If there's any hope of using some of the existing code, I'd want to call
J/APL from Java and get back 
the results or have it update the data directly.

I saw some posts in the archive about Java to J communication. Anyone
have any comments about their experience 
integrating Java and J?  I feel like this communication would "need" to
be as close to an in-process call as possible and the 
J process would have to be long running.  Similar to a service or
"engine" approach. 

Anyone have any comments about J using an Oracle database?  The
application processes a lot of data and the performance has to be there.
I would
not want to send that much data to the J process, only the keys, it
would access the data from Oracle, store the results and send back a
status code or 
perhaps return some new keys or other minimum amount of data. 
  
Thanks for any help.

Robert Quinn

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to