stub bin/jpl that just runs JPL::Compile::files()
[p5sagit/p5-mst-13.2.git] / jpl / README
CommitLineData
93e0cdbd 1Copyright 1998, O'Reilly & Associates, Inc.
2
3This package may be copied under the same terms as Perl itself.
4
5Disclaimers
6-----------
7This is a work in progress, and relies on bleeding-edge technology
8from the network. Don't expect not to be surprised occasionally.
9
10Requirements
11------------
12Perl 5.005_02 (or later) must be compiled and installed as a shared library
13(libperl.so). I had to use the system's malloc. This version has not
14been well tested under 5.005_02, so you can expect some rough edges.
15
16You need JDK 1.1. On Solaris 1.1.5 works. On Linux you need 1.1.3 with
17the patches from
18
19 ftp://ftp.blackdown.org/pub/Linux/JDK/1.1.3/updates/libjava-1.1.3v2-1.tar.gz
20
21The get_jdk directory contains a script that will download JDK (but not
22the patch file above) off of the net for you. (This presumes you've
23already installed the modules mentioned in ../README.)
24
25You may need to ensure that all files under the ../jpl directory are writable.
26install-jpl expects to be run with super-user privileges so that it can
27put things in the right places.
28
29What the heck is JPL?
30---------------------
31JPL is a hybrid (to use the polite term) language. It's basically Java
32in which the methods can optionally be implemented by Perl code. A
33preprocessor called "JPL::Compile" looks at your .jpl file and spits
34out the appropriate .java, .c, .h, .pl, and .so files to accomplish the
35desired task. Hopefully a lot of those files can go away in the future
36as jpl mutates into a Perl-to-Java compiler. The long-term goal is for
37jpl to be able to take a pure Perl file and spit out a java .class
38file. This initial version of JPL is an attempt to begin to mesh the
39semantics of Java and Perl. Some people may find it useful in its
40current form, but you should know right up front that we've still got a
41ways to go with it. A journey of a thousand miles continues with the
42second step...
43
44JPL Syntax
45----------
46JPL syntax is trivial, given that you know Java and Perl. Pretend like
47you're writing a native Java method, but say "perl" instead of
48"native", and then instead of omitting the body of the method, put your
49Perl code in double curlies. (See Sample.jpl for an example.)
50
51Calling back from Perl to Java is done through the JNI (Java Native
52Interface). No weird transmogrifications are done by the preprocessor
53to your Perl code--it's all normal Perl. The preprocessor just wraps
54it up into funny subroutines you don't see unless you peek at the .pl
55file it generates.
56
57Installation
58------------
59Run "install-jpl". You have to tell it whether you want to use the
60current directory for JPL_HOME or some other directory. Everything
61else should take care of itself, except that after install-jpl
62writes the setvars program, you are responsible to invoke it properly
63before any JPL applications can be compiled under the current shell.
64
65 sh: eval `setvars -sh`
66 csh: eval `setvars -csh`
67 perl: eval `setvars -perl`;
68
69More Info
70---------
71
72You can look at the Sample and Test directories, as well as the ../eg
73directory for examples.
74
75Perhaps the most important bit of advice we can give you is to watch
76
77 http://perl.oreilly.com
78
79for further information on how to get further information.
80
81Have the appropriate amount of fun.