I like the jfli style a little better. Macros could make the abcl syntax nicer.
 
So jfli works with LW and abcl style is based on Franz jlinker, correct? Is this a productive path, two java call styles?
 

armedbear-j-devel-request@lists.sourceforge.net wrote:
Send armedbear-j-devel mailing list submissions to
armedbear-j-devel@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
or, via email, send a message with subject or body 'help' to
armedbear-j-devel-request@lists.sourceforge.net

You can reach the person managing the list at
armedbear-j-devel-admin@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of armedbear-j-devel digest..."


Today's Topics:

1. Re: Re: stack overflow on tail recursion (Peter Graves)
2. Re: re: stack overflow on tail recursion (Peter Graves)
3. Re: Re: [jfli-users] jfli for abcl: How To Build? (Andras Simon)
4. Re: cygwin/w2k build patch (Larry Clapp)
5. Re: abcl socket interface (Andras Simon)
6. Url reader (Wayne Rogers)
7. build-abcl.lisp (Peter Graves)
8. Re: stack overflow on tail recursion (Sam Steingold)
9. Re: cygwin/w2k build patch (Sam Steingold)
10. Re: stack overflow on tail recursion (Sam Steingold)
11. Re: Url reader (Andras Simon)

--__--__--

Message: 1
Date: Mon, 2 Aug 2004 21:04:15 -0700
From: Peter Graves
To: sds@gnu.org
Cc: Andras Simon ,
armedbear-j-devel@lists.sourceforge.net
Subject: Re: [j-devel] Re: stack overflow on tail recursion

On Mon, 02 Aug 2004 at 17:40:55 -0400, Sam Steingold wrote:
> > But seriously, if you got this far, you can run j and/or abcl, just
> > not from a jar file.
>
> how?

To run abcl, maybe this:

java -cp C:\j\src org.armedbear.lisp.Main

Or, to run j:

java -cp C:\j\src Main

assuming C:\j is the root of your j tree.

In general, Windows support is a bit sketchy. In particular, the abcl
and j shell scripts haven't been tested under Cygwin (only under Linux).

> PS. why aren't `announce' and `user' lists also available on gmane?

All the real action (such as it is) is on the development list.

-Peter


--__--__--

Message: 2
Date: Mon, 2 Aug 2004 21:08:23 -0700
From: Peter Graves
To: Wayne Rogers
Cc: armedbear-j-devel@lists.sourceforge.net
Subject: Re: [j-devel] re: stack overflow on tail recursion

On Mon, 2 Aug 2004 at 18:16:03 -0700, Wayne Rogers wrote:
> I'm using WinXP SP1. If I launch j by double clicking
> the j.jar I can only use the embedded lisp. I get the
> same error using when trying the "separate process".

This sounds like a bug. I don't run Windows, but I'm assuming double
clicking j.jar is the moral equivalent of java -jar j.jar, and when I
do the latter on Linux I can run Lisp as a separate process without any
problem.

Maybe someone who does run Windows can look into this.



> FWIW your code appears to run to completion in Corman
> 2.5.
>
> -- here's the tail end of the print out
>
> 1,995,647 --> 441, 52,483,285,312
> 1,995,935 --> 252, 18,433,005,568
> 1,998,847 --> 278, 16,824,415,768
> 1723519
> 557
> 46571871940

With current CVS, abcl is able to run the code also and gets the same
results.

-Peter


--__--__--

Message: 3
Date: Tue, 3 Aug 2004 13:05:37 +0200 (CEST)
From: Andras Simon
To: Peter Graves
Cc: glr , armedbear-j-devel@lists.sourceforge.net
Subject: Re: [j-devel] Re: [jfli-users] jfli for abcl: How To Build?



On Mon, 2 Aug 2004, Peter Graves wrote:

> On Mon, 2 Aug 2004 at 21:35:12 +0200, Andras Simon wrote:
>> Does this happen on a Cray? I don't use ant to build abcl, so I don't
>> know for sure what 'ant all' does, but if it compiles all the Java
>> files, I'm surprised it only takes 43 seconds.
>
> 43 seconds is way slow:
>
> ; Loading /home/peter/depot/j/customizations.lisp ...
> ; Loaded /home/peter/depot/j/customizations.lisp (0.0020 seconds)
> JDK: /home/peter/blackdown/j2sdk1.4.2/
> Java compiler: jikes
> Options: +D -g
> Build completed successfully in 2.129 seconds.
>
> This is a full build of all the Java files on an Athlon 2100+, using
> jikes with build-abcl.lisp, which I hope to check in later today.

Incredible! It's 5+ minutes here (with a 733Mhz PIII).

Andras




--__--__--

Message: 4
Date: Tue, 3 Aug 2004 07:32:30 -0400 (EDT)
Subject: Re: [j-devel] cygwin/w2k build patch
From: "Larry Clapp"
To: armedbear-j-devel@lists.sourceforge.net

Sam Steingold said:
> To avoid this error:
[snip]
> /cygdrive/c/java/bin/jar: argument list too long
> make: *** [j.jar] Error 2
>
> I propose the appended patch (agains CVS).
>
[snip]
> + cd src && \
> + $(JAR) cmf manifest ../j.jar Main.class org/armedbear/j/*.class && \
> + $(JAR) uf ../j.jar org/armedbear/j/version org/armedbear/j/build \
> + org/armedbear/j/images/*.png && \
> + $(JAR) uf ../j.jar gnu/regexp/*.class
gnu/regexp/MessagesBundle.properties && \
> + $(JAR) uf ../j.jar org/armedbear/j/mail/*.class && \
> + $(JAR) uf ../j.jar org/armedbear/j/jdb/*.class && \
> + $(JAR) uf ../j.jar org/armedbear/j/*.keywords && \
> + $(JAR) uf ../j.jar org/armedbear/j/mail/*.keywords && \
> + $(JAR) uf ../j.jar org/armedbear/lisp/*.class && \
> + $(JAR) uf ../j.jar org/armedbear/lisp/java/awt/*.class && \
> + $(JAR) uf ../j.jar org/armedbear/lisp/*.lisp org/armedbear/lisp/build

This invokes jar several times. Why not echo the filenames to a temp file
and say

$(JAR) cmf manifest ../j.jar @temp_file_name
rm temp_file_name

?

This is a documented feature of jar under (at least) Solaris & Windows.
See http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/jar.html and/or
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html .

-- Larry



--__--__--

Message: 5
Date: Tue, 3 Aug 2004 13:43:34 +0200 (CEST)
From: Andras Simon
To: Peter Graves
Cc: sds@gnu.org, armedbear-j-devel@lists.sourceforge.net
Subject: Re: [j-devel] abcl socket interface



On Mon, 2 Aug 2004, Peter Graves wrote:

> On Mon, 02 Aug 2004 at 19:05:49 -0400, Sam Steingold wrote:
>> 1. how do I resolve a hostname (gethostbyname(2)/gethostbyaddr(2))?
>> 2. how do I extract the local hostname/local port/remote hostname/remote
>> port from a socket stream?
>> 3. how do I extract the host/port pair for a server socket?
>> 4. why doesn't socket-accept take a timeout argument?
>> 4. how do I Sleep until there is input on the stream (like with LISTEN)
>> with timeout?
>
> ABCL's socket interface is incomplete.
>
> I think all of the things you mention are doable, in principle, but
> nobody has done them yet.

In the meantime, you may get away by calling out to
Java. E.g. swank-abcl.lisp in slime has

(defimplementation create-socket (host port)
(ext:make-server-socket port))

(defimplementation local-port (socket)
(java:jcall (java:jmethod "java.net.ServerSocket" "getLocalPort") socket))

(defimplementation close-socket (socket)
(ext:server-socket-close socket))

(defimplementation accept-connection (socket)
(ext:get-socket-stream (ext:socket-accept socket)))

Andras



--__--__--

Message: 6
Date: Tue, 3 Aug 2004 06:37:02 -0700 (PDT)
From: Wayne Rogers
To: armedbear
Subject: [j-devel] Url reader

--0-1253601107-1091540222=:503
Content-Type: text/plain; charset=us-ascii

Ok, can't attach files to dev list either.

;Try my inefficient URL reader! Calls java libraries.

;use (print-webpage "http://www.msn.com:80/") or
;(return-webpage "http://www.msn.com:80/") to return
it ;in a string.


-- URLstring.lisp

(defun java-object-class (obj-instance)
"returns the Class name string of a given object reference, including primitives and arrays"
(jclass-name (jobject-class obj-instance)))
(defun bytes-string (byte-array)
"convert byte array to a String object"
(jnew (jconstructor "java.lang.String" "[B") byte-array))
(defun print-webpage (URL-STRING)
"print the data returned from URL-STRING to the standard out"
(LET ((URL (JNEW (JCONSTRUCTOR "java.net.URL" "java.lang.String") URL-STRING))
istream inreader bufferedin)

(unless (null (setq ISTREAM (JCALL (JMETHOD "java.net.URL" "openStream") URL)))
(setq INREADER (JNEW (JCONSTRUCTOR "java.io.InputStreamReader" "java.io.InputStream") ISTREAM)
BUFFEREDIN (JNEW (JCONSTRUCTOR "java.io.BufferedReader" "java.io.Reader") INREADER))
(DO ((STR "" (JCALL (JMETHOD "java.io.BufferedReader" "readLine") BUFFEREDIN)))
((NULL STR) 'END-OF-STREAM)
(format t "~A~%" STR)))
(values)))

(defun return-webpage (URL-STRING)
"return the data from URL-STRING in a String"
(LET* ((url (JNEW (JCONSTRUCTOR "java.net.URL" "java.lang.String") URL-STRING))
(data (jnew-array "byte" 1))
(inputstream-read (jmethod "java.io.InputStream" "read" "[B"))
(stringbuffer-append (jmethod "java.lang.StringBuffer" "append" "java.lang.String"))
(instream (jcall (jmethod "java.net.URL" "openStream") url))
(buffer (jnew (jconstructor "java.lang.StringBuffer"))))

(do ((len (jcall inputstream-read instream data)(jcall inputstream-read instream data)))
((= len -1) (jcall (jmethod "java.lang.StringBuffer" "toString") buffer))

(jcall stringbuffer-append buffer (bytes-string data)))))



---------------------------------
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
--0-1253601107-1091540222=:503
Content-Type: text/html; charset=us-ascii

Ok, can't attach files to dev list either.

 

;Try my inefficient URL reader! Calls java libraries.

;use (print-webpage "http://www.msn.com:80/") or
;(return-webpage "http://www.msn.com:80/") to return
it ;in a string.

 

-- URLstring.lisp

                   
 (defun java-object-class (obj-instance)
  "returns the Class name string of a given object reference, including primitives and arrays"
  (jclass-name (jobject-class obj-instance)))  

(defun bytes-string (byte-array)
  "convert byte array to a String object"
  (jnew (jconstructor "java.lang.String" "[B") byte-array))

(defun print-webpage (URL-STRING)
  "print the data returned from URL-STRING to the standard out"
  (LET ((URL (JNEW (JCONSTRUCTOR "java.net.URL" "java.lang.String") URL-STRING))
        istream inreader bufferedin)
       
         (unless (null (setq ISTREAM (JCALL (JMETHOD "java.net.URL" "openStream") URL)))
           (setq INREADER (JNEW (JCONSTRUCTOR "java.io.InputStreamReader" "java.io.InputStream") ISTREAM)
                 BUFFEREDIN (JNEW (JCONSTRUCTOR "java.io.BufferedReader" "java.io.Reader") INREADER))

           (DO ((STR "" (JCALL (JMETHOD "java.io.BufferedReader" "readLine") BUFFEREDIN)))
               ((NULL STR) 'END-OF-STREAM)
               (format t "~A~%" STR)))
       (values)))


(defun return-webpage (URL-STRING)
  "return the data from URL-STRING in a String"
  (LET* ((url             (JNEW (JCONSTRUCTOR "java.net.URL" "java.lang.String") URL-STRING))
        (data             (jnew-array "byte" 1))
        (inputstream-read (jmethod "java.io.InputStream" "read" "[B"))
        (stringbuffer-append (jmethod "java.lang.StringBuffer" "append" "java.lang.String"))
        (instream       (jcall (jmethod "java.net.URL" "openStream") url))
        (buffer           (jnew (jconstructor "java.lang.StringBuffer"))))
     

        (do ((len (jcall inputstream-read instream data)(jcall inputstream-read instream data)))
            ((= len -1) (jcall (jmethod "java.lang.StringBuffer" "toString") buffer))
         
          (jcall stringbuffer-append buffer (bytes-string data)))))

                



Do you Yahoo!?

Yahoo! Mail is new and improved - Check it out!
--0-1253601107-1091540222=:503--


--__--__--

Message: 7
Date: Tue, 3 Aug 2004 07:07:18 -0700
From: Peter Graves
To: armedbear-j-devel@lists.sourceforge.net
Subject: [j-devel] build-abcl.lisp

I've checked in build-abcl.lisp and customizations.lisp.

This is the tool I normally use to build abcl. It doesn't do absolutely
everything you might want to do (for example, it doesn't jar up the
=2Eclass files or create a script that launches abcl). But it's fast, it
works on both Linux and Windows, it's tolerant of whitespace oddities,
and it doesn't use XML.

You'll need to edit customizations.lisp to suit your situation.

I normally use jikes, which is faster than javac.

On Linux, I always use jikes 1.18, because every later version of jikes
seems to have some problem building j (note j here, not abcl), and 1.18
works fine. I use a 1.4 JDK, because jikes 1.18 has problems with 1.5;
the resulting class files nevertheless work fine with 1.5 (which is my
preferred version of Java these days).

Looking at customizations.lisp, I apparently have gotten jikes 1.21 and
the 1.5 JDK to work on Win2K, but I don't remember the details.

Here are two usage scenarios:

A. Freestanding

1. Get yourself a shell looking at the root directory of the j
distribution, where build-abcl.lisp and customizations.lisp live.

2. Fire up sbcl or abcl

3. (load "build-abcl")

4. (build-abcl :force t)

B. Inside j

1. Run j.

2. Do Alt X, "jlisp" (or "Run Embedded Lisp" from the Lisp menu).
(This is one time when you do want to use the Lisp embedded in j!)

3. :cd

4. :ld build-abcl

5. Ctrl W (to close the jlisp window)

6. Open a buffer looking at src/org/armedbear/lisp/Lisp.java (or
any other Java file in the src/org/armedbear/lisp directory).

7. F9 (or Alt X, "compile")

8. Enter "(build-abcl :force t)" in the "Compile command:" text
box, and hit Enter.

9. A compilation buffer will open. Wait until the build completes.
Hit Escape to close the compilation buffer. (Note that if there are
compilation errors, you can use F4 to navigate to them, as usual.
See the section entitled "Compilation Buffers" in j's help system.)

I think you could eliminate steps 2-5 of scenario B by putting

(autoload 'build-abcl "/home/peter/depot/j/build-abcl")

in ~/.j/init.lisp (untested). (Your path may vary.)

It shouldn't be hard to add support for other Lisps in scenario A;
you'd just need to provide implementations of RUN-SHELL-COMMMAND and
PROBE-DIRECTORY (you get both of these for free with abcl); look at
build- abcl.lisp around line 15. (The provided implementation of PROBE-
DIRECTORY should work for any Lisp that adheres to the convention of
terminating directory pathnames with a path separator character.)

If you omit ":force t" when invoking BUILD-ABCL, only those classes
will be rebuilt whose .java files have changed. On my system, it only
takes 2-3 seconds to rebuild everything, so I always use ":force t".

Note that if you're doing the build inside j, after you've done it
once, you can use Ctrl F9 (or Alt X, "recompile") to do it again
without being prompted for the compile command.

Good luck!

-Peter



--__--__--

Message: 8
To: armedbear-j-devel@lists.sourceforge.net
From: Sam Steingold
Date: Tue, 03 Aug 2004 10:06:54 -0400
Organization: disorganization
Reply-To: sds@gnu.org
Subject: [j-devel] Re: stack overflow on tail recursion

> * Wayne Rogers [2004-08-02 18:16:03 -0700]:
>
> Correct me if I'm wrong, but I thought it was necessary to make the
> recursive function the last one to be called in order to be properly
> tail recursive and get the compile 's help. Your cycle-length call
> takes values from other function calls.

cycle-length _is_ properly tail recursive.
it means that the recursive calls are the last function calls and thus
can be replaced with a goto.

> FWIW your code appears to run to completion in Corman 2.5.
yes, and on CLISP too.


--
Sam Steingold (http://www.podval.org/~sds) running w2k


Life is a sexually transmitted disease with 100% mortality.



--__--__--

Message: 9
To: armedbear-j-devel@lists.sourceforge.net
From: Sam Steingold
Date: Tue, 03 Aug 2004 10:13:14 -0400
Organization: disorganization
Reply-To: sds@gnu.org
Subject: [j-devel] Re: cygwin/w2k build patch

> * Larry Clapp [2004-08-03 07:32:30 -0400]:
>
> Sam Steingold said:
>> To avoid this error:
> [snip]
>> /cygdrive/c/java/bin/jar: argument list too long
>> make: *** [j.jar] Error 2
>>
>> I propose the appended patch (agains CVS).
>>
> [snip]
>> + cd src && \
>> + $(JAR) cmf manifest ../j.jar Main.class org/armedbear/j/*.class && \
>> + $(JAR) uf ../j.jar org/armedbear/j/version org/armedbear/j/build \
>> + org/armedbear/j/images/*.png && \
>> + $(JAR) uf ../j.jar gnu/regexp/*.class
> gnu/regexp/MessagesBundle.properties && \
>> + $(JAR) uf ../j.jar org/armedbear/j/mail/*.class && \
>> + $(JAR) uf ../j.jar org/armedbear/j/jdb/*.class && \
>> + $(JAR) uf ../j.jar org/armedbear/j/*.keywords && \
>> + $(JAR) uf ../j.jar org/armedbear/j/mail/*.keywords && \
>> + $(JAR) uf ../j.jar org/armedbear/lisp/*.class && \
>> + $(JAR) uf ../j.jar org/armedbear/lisp/java/awt/*.class && \
>> + $(JAR) uf ../j.jar org/armedbear/lisp/*.lisp org/armedbear/lisp/build
>
> This invokes jar several times. Why not echo the filenames to a temp file
> and say
>
> $(JAR) cmf manifest ../j.jar @temp_file_name
> rm temp_file_name
>
> ?
>
> This is a documented feature of jar under (at least) Solaris & Windows.
> See http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/jar.html and/or
> http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jar.html .

I thought of that, but java version "1.4.1_05" does not support this.


--
Sam Steingold (http://www.podval.org/~sds) running w2k


WHO ATE MY BREAKFAST PANTS?



--__--__--

Message: 10
To: armedbear-j-devel@lists.sourceforge.net
From: Sam Steingold
Date: Tue, 03 Aug 2004 10:09:59 -0400
Organization: disorganization
Reply-To: sds@gnu.org
Subject: [j-devel] Re: stack overflow on tail recursion

> * Peter Graves [2004-08-02 21:08:23 -0700]:
>
> On Mon, 2 Aug 2004 at 18:16:03 -0700, Wayne Rogers wrote:
>> I'm using WinXP SP1. If I launch j by double clicking
>> the j.jar I can only use the embedded lisp. I get the
>> same error using when trying the "separate process".

=== message truncated ===


Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.