Hi all,I am wondering if it would be possible to get some pointers or advice regarding integrating Ensime into Githubs atom.io editor. And if someone else is at all interested in this?I have used Ensime a bit before using both Emacs and later Sublime but went back to IDE:s and I'm currently mostly using IDEA.However, I just found out Github finally decided to really FOSS their editor Atom so I figured I would maybe try to give it a shot. I don't know how much time I will have to spend on this, but right now I got kind of inspired. On parental leave :)
I see that this project has started moving again which makes me really happy. Oh, I'm sorry if this email is long and dumb, I just figured I could try to absorb as much info from you guys before I start anything stupid. Since this list seems to have gotten revived I just thought it might be a good idea to ask and also state my intention instead of just working on my own in the dark.I'll just start listing questions:* What is your feel about adding a protocol, say json instead of swank? The atom editor is a browser and extended with js or Coffescript or whatever that compiles to js. However, I figured I would start out with Ensime server as is and maybe just reuse this: https://github.com/swank-js/swank-js/blob/master/swank-protocol.js from the client with existing communication protocol. One thing at a time and I definitely wouldn't want to fork the server unnecessarily. However, it might just be a bit weird to cross the bridge using a lispy exchange format when its js communicating with Scala? And then I read under C.4 over here http://ensime.github.io/ensime-src/index.html#tth_sEcC and got the feel that it probably wouldn't be that hard to add a protocol. But then _again_, I've seen that both Sublime and TextMate plugins DID use swank so I guess there's a good reason? And I guess its simple enough to just use swank anyways. What do you think? Could we add a flag to the server startup selecting client protocol and have different implementations of org.ensime.protocol.Protocol?
* Is there something you guys miss in Ensime that a full-fletched IDE like Eclipse and IDEA have? I saw that the old issue of navigating to attached sources of dependencies might have been solved. Big applause! That was my biggest issue before. Is there something that might make it hard to continue adding functionality to match up with the IDE:s? I haven't even really looked into the architecture of the server, but am I right that it uses the official Presentation Compiler, just the same as Eclipse? Then it should be possible to have it all, right? Just a matter of doing the work, no? :) I guess maybe showing implicit parameters and conversion is still missing. I think I'm kind of dependent on that functionality sometimes when using libs that do a lot of that. What I'm wondering is basically if there's anything architectural that would stop us from going the full nine yards feature-wise or if it's _just_ putting in the hard work?
* I just attended scaladays and watching the scala.js presentation I got a wonky idea. I _think_ Sébastien showed a demo of browser code communicating with server code using Akka actors on both sides. Akka actors compiled into js on the client though, but still code-wise all Scala. They've come really far with that compiler backend and had even compiled Shapeless into js. How far-fetched might it be to start working on a actor-based server AND client using this technique for Atom do you think? This is probably most about getting the build right to have a scala.js sbt project building into a Atom plugin structure so maybe this is not the right forum to ask about that though. And maybe it's a bad idea since it couldn't be shared with Emacs, only used in Atom, right? Or can Emacs have js-parts in plugins, no? Only elisp?Anyway, for me that would be a really pleasant programming environment. Would be a bigger change than just changing protocol over the existing socket-thing, but simply Scala actors and case classes for communication, wouldn't that be sweet? :)
* And related to the last question, does anybody have some insight into Atom? I haven't really looked too deeply into it but I got the feeling that it would be pretty easy to extend, even compared to other editors like Sublime. At least the graphical part I think. But I don't really know yet. Haven't seen any full-fletched language support things, just some basic grammars for highlighting.Anyway, if anyone has any insight on problems I might struck or any tips or any info, I'd be really glad!
* One more very concrete question: as of yet I only have a very basic start (using swank). I have an atom plugin that can run "Ensime:Init" and then I start the server, read the port-file, ask for swank:connection-info and log the answer to the js-console. I now just added reading the .ensime file and sending it with swank:init-project, but when I do that I get no answers from the server. Sending only000026(:swank-rpc (swank:connection-info) 1)I get a quick answer 00005e(:return (:ok (:pid nil :implementation (:name "ENSIME-ReferenceServer") :version "0.8.7")) 1)but when I do: 000026(:swank-rpc (swank:connection-info) 1) and then (without waiting for reply): 011039(:swank-rpc (swank:init-project ( :subprojects ( ( :name "dfkka" :module-name "dfkka" :depends-on-modules ( ) :package "se.uniply" :version "14.6-SNAPSHOT" :compile-deps ( "/Users/viktor/.sbt/boot/scala-2.10.4/lib/scala-library.jar" "/Users/viktor/.ivy2/cache/net.liftweb/lift-webkit_2.10/jars/lift-webkit_2.10-2.5.jar" "/Users/viktor/.ivy2/cache/net.liftweb/lift-util_2.10/jars/lift-util_2.10-2.5.jar" ...I don't get any answer to either of the calls…? Is it so that I have to wait for the first message's answer before it's ok to send the next call? Is there any log from the Ensime server where I can se what's going on server side?
--Thanks,Viktor
You received this message because you are subscribed to the Google Groups "ENSIME" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ensime+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In the long term I do think it'd make sense for the server to speak a more standard format (in addition to sexps), but for the purposes of getting atom off the ground I'd recommend just parsing sexps. It's really a negligible portion of the overall work.
We do use the standard presentation compiler. We have to deal with more latency than other IDEs (server to client) , but that hasn't been much of a problem so far. In my mind the trickiest thing is that we don't share an in-memory source file representation between client and server, so keeping things synced can be a bit awkward (generally we use the disk as the sync channel).
Sounds fancy. My two cents is that making a standard, javascripty plugin is going to be a lot easier to maintain in the long term and more likely to attract contributors from the atom world.
I know nothing about it. The first thing I'd research would be long-lived tcp connections, with asynchronous handling of socket events. If that's doable, you're in good shape.
Ensime server prints lots of info the stdout. There should be no problem with sending several messages as you are doing -- they will be handled in fifo order.
Hi,Thanks for the quick reply!In the long term I do think it'd make sense for the server to speak a more standard format (in addition to sexps), but for the purposes of getting atom off the ground I'd recommend just parsing sexps. It's really a negligible portion of the overall work.
Yeah, I figured as much.
We do use the standard presentation compiler. We have to deal with more latency than other IDEs (server to client) , but that hasn't been much of a problem so far. In my mind the trickiest thing is that we don't share an in-memory source file representation between client and server, so keeping things synced can be a bit awkward (generally we use the disk as the sync channel).Hm, yeah. Compared to the slowness of using something like Eclipse for text editing I can't believe that local network latency can really be an issue?How is this syncing typically handled? The editor sends a swank:builder-update-files whenever a file is saved? Are there any issues with this?Sounds fancy. My two cents is that making a standard, javascripty plugin is going to be a lot easier to maintain in the long term and more likely to attract contributors from the atom world.
Yeah, too much of setup time to get started I think. I'll just drop that for now. More interested to have some basic functionality in Atom up and running as quick as possible.I know nothing about it. The first thing I'd research would be long-lived tcp connections, with asynchronous handling of socket events. If that's doable, you're in good shape.I just used a node.js net module to open the connection: http://nodejs.org/api/net.html#net_net_connect_path_connectlistenerIt seems to work (at least with a single message :) ) Will look into why it failed when sending the second message.
Ensime server prints lots of info the stdout. There should be no problem with sending several messages as you are doing -- they will be handled in fifo order.Cool, I'll try to figure it out.Thanks a lot for the info!Cheers,Viktor
I'm actually working on separating out the 'swank calls' and the underlying 'swank wire format' - i.e. turning the calls into a set of case classes - with an encoder to sexps. Once this is done it should be very easy to create a converter for json instead.
I'm actually really intersted in this approach too - effectively making ensime manage the source and server it over the wire - obviously for atom this is great, might be quite invasive on the emacs model.
--
You received this message because you are subscribed to a topic in the Google Groups "ENSIME" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ensime/1dWUQwnFoyk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ensime+un...@googlegroups.com.
Between working on the ensime core and the ensime analyser stuff
I've started playing with creating a scalajs wrapper around Ace.
Its all a long way off, but I should get a chuck of time in a few
months to pull together a full prototype - until then I am adding
supporting features to Ensime to better support other editors.
@fommil has also been working on a better protocol layer so we can
support Swank and json protocols to make integration easier.
Cheers
Rory
You received this message because you are subscribed to the Google Groups "ENSIME" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ensime+un...@googlegroups.com.