gnu.expr.ModuleMethod no more? (+ Emacs SLIME)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

gnu.expr.ModuleMethod no more? (+ Emacs SLIME)

Sudarshan S Chawathe
The source and binary packages for kawa-2.4 (from ftp.gnu.org) both
include the class gnu.expr.ModuleMethod but the Gitlab repository
doesn't seem to have it.  Is that indicative of a change in future
Kawa releases?  If so, what is the recommended replacement?

Sorry if I'm missing something obvious here.  I did a quick grep and
skimming on the Changelogs and couldn't figure much out except that
ModuleMethod.java did exist in the repository a while back.  I suspect
this may be somehow related to recent changes related to the merged
invoke branch, but have only vague ideas.

Background: I go to the above question as I was trying to get Emacs
SLIME working with Kawa using swank-kawa.scm in SLIME's contrib
directory and discovered that it uses gnu.expr.ModuleMethod which my
current Kawa installation (tracking the Kawa Gitlab repo) doesn't have.
However, I did find them in the Kawa 2.4 releases.  (As an aside, if
anyone is using SLIME with Kawa and/or has pointers in that regard, I'd
be grateful to receive them.)

Regards,

-chaw

Reply | Threaded
Open this post in threaded view
|

Re: gnu.expr.ModuleMethod no more? (+ Emacs SLIME)

Per Bothner
On 06/04/2017 01:50 PM, Sudarshan S Chawathe wrote:
> The source and binary packages for kawa-2.4 (from ftp.gnu.org) both
> include the class gnu.expr.ModuleMethod but the Gitlab repository
> doesn't seem to have it.  Is that indicative of a change in future
> Kawa releases?  If so, what is the recommended replacement?

The replacement is gnu.expr.CompiledProc.
> Sorry if I'm missing something obvious here.  I did a quick grep and
> skimming on the Changelogs

Yes, that is what you should have done - except I got a bit sloppy
maintaining the ChangeLog in the invoke branch ...

> and couldn't figure much out except that
> ModuleMethod.java did exist in the repository a while back.  I suspect
> this may be somehow related to recent changes related to the merged
> invoke branch, but have only vague ideas.

CompiledProc is a very direct replacement for ModuleMethod.  However, the
former uses a MethodHandle (or a java.lang.reflect.Method) that points
to a procedure's check method; the old way used an index that was used is
a compiler-generated switch.

--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: gnu.expr.ModuleMethod no more? (+ Emacs SLIME)

Per Bothner
In reply to this post by Sudarshan S Chawathe
On 06/04/2017 01:50 PM, Sudarshan S Chawathe wrote:
> Background: I go to the above question as I was trying to get Emacs
> SLIME working with Kawa using swank-kawa.scm in SLIME's contrib
> directory and discovered that it uses gnu.expr.ModuleMethod which my
> current Kawa installation (tracking the Kawa Gitlab repo) doesn't have.
> However, I did find them in the Kawa 2.4 releases.  (As an aside, if
> anyone is using SLIME with Kawa and/or has pointers in that regard, I'd
> be grateful to receive them.)

FWIW, I think the future of Kawa/IDE integration is Microsoft's
Language Server Protocol (http://langserver.org/).
See https://github.com/Microsoft/language-server-protocol/wiki/Protocol-Implementations
Most likely the kawa.jar would include an implementation of the server.

One step needed to do this is for Kawa's source representation to support
ranges, and not only positions.
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: gnu.expr.ModuleMethod no more? (+ Emacs SLIME)

Duncan Mak
Hello Per,

I'm interested in working on an LSP implementation for Kawa. Do you
have any suggestions on how / where to get started?

Adding support for ranges on top of positions seems like an obvious
choice, but I'd also like to write more Scheme code than Java, do you
know of any other tasks that would help get this feature bootstrapped?

Thanks!


Duncan.

On Mon, Jun 5, 2017 at 9:33 AM, Per Bothner <[hidden email]> wrote:

> On 06/04/2017 01:50 PM, Sudarshan S Chawathe wrote:
>>
>> Background: I go to the above question as I was trying to get Emacs
>> SLIME working with Kawa using swank-kawa.scm in SLIME's contrib
>> directory and discovered that it uses gnu.expr.ModuleMethod which my
>> current Kawa installation (tracking the Kawa Gitlab repo) doesn't have.
>> However, I did find them in the Kawa 2.4 releases.  (As an aside, if
>> anyone is using SLIME with Kawa and/or has pointers in that regard, I'd
>> be grateful to receive them.)
>
>
> FWIW, I think the future of Kawa/IDE integration is Microsoft's
> Language Server Protocol (http://langserver.org/).
> See
> https://github.com/Microsoft/language-server-protocol/wiki/Protocol-Implementations
> Most likely the kawa.jar would include an implementation of the server.
>
> One step needed to do this is for Kawa's source representation to support
> ranges, and not only positions.
>
> --
>         --Per Bothner
> [hidden email]   http://per.bothner.com/



--
Duncan.
Reply | Threaded
Open this post in threaded view
|

Re: gnu.expr.ModuleMethod no more? (+ Emacs SLIME)

Per Bothner
On 06/05/2017 08:01 AM, Duncan Mak wrote:
> I'm interested in working on an LSP implementation for Kawa. Do you
> have any suggestions on how / where to get started?

One thing to do is look at other language servers, especially for
JVM-based languages: Groovy, Java, Scala, Clojure:
See https://github.com/Microsoft/language-server-protocol/wiki/Protocol-Implementations
https://github.com/thheller/shadow-cljs/issues/2

It seems plausible that when in a REPL we'd want to use the same
JVM for both the RPEL and the LSP server.  That leads to some interesting
possibilities and challenges integrating and editor with the REPL front-end.

> Adding support for ranges on top of positions seems like an obvious
> choice, but I'd also like to write more Scheme code than Java, do you
> know of any other tasks that would help get this feature bootstrapped?

I'm working on the basic data structure support for 'end positions'.
So far lots of compiler errors, but I'll check it in once there are
no regressions.
--
        --Per Bothner
[hidden email]   http://per.bothner.com/
Reply | Threaded
Open this post in threaded view
|

Re: gnu.expr.ModuleMethod no more? (+ Emacs SLIME)

Per Bothner
In reply to this post by Duncan Mak
On 06/05/2017 08:01 AM, Duncan Mak wrote:
> Adding support for ranges on top of positions seems like an obvious
> choice, but I'd also like to write more Scheme code than Java, do you
> know of any other tasks that would help get this feature bootstrapped?

I've checked in support for source-code ranges.

When line number are included the output from ---debug-print-expr or
--debug-print-expr you should now see end positions as well as start positions:

$ bin/kawa --debug-print-expr
#|kawa:1|# (+ (* 3 4)
#|.....2|#   10)
[Module:atInteractiveLevel-2
(Module/atInteractiveLevel-2/2/ ()
   (Apply line:1:1-2:6 (Ref/4/Declaration[applyToArgs/2])
     (Ref/3/+/Declaration[$Pl/3])
     (Apply line:1:4-11 (Ref/6/Declaration[applyToArgs/2])
       (Ref/5/*/Declaration[$St/5])
       (Quote 3)
       (Quote 4))
     (Quote 10)))]
22

--
        --Per Bothner
[hidden email]   http://per.bothner.com/