This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-12
Channels
- # announcements (1)
- # babashka (124)
- # beginners (98)
- # calva (54)
- # cider (32)
- # cljdoc (5)
- # cljs-dev (131)
- # cljsrn (1)
- # clojure (107)
- # clojure-australia (2)
- # clojure-europe (2)
- # clojure-losangeles (1)
- # clojure-norway (3)
- # clojure-uk (28)
- # clojurescript (21)
- # conjure (86)
- # core-async (7)
- # cursive (3)
- # datascript (5)
- # datomic (28)
- # defnpodcast (2)
- # devcards (1)
- # exercism (47)
- # fulcro (22)
- # graalvm (29)
- # graphql (1)
- # malli (5)
- # nrepl (31)
- # off-topic (111)
- # re-frame (23)
- # reitit (4)
- # spacemacs (6)
- # tools-deps (10)
- # tree-sitter (1)
- # xtdb (6)
Should I just be able to brew update && brew upgrade? :thinking_face: not sure if that grabs a slightly older version.
Ah no, sorry, this is not released yet, because I want to see some testing before that. You can use this link for a pre-release:
Mostly looking very good. Switching session, cloning and creating fresh ones seems to work (although I haven't checked if fresh / cloned were actually fresh or cloned)
The one issue I have (which I need to check if it's just my end) is when I close all sessions in quick succession, nothing seems to happen.
; Sessions (4):
; 1 - 18b5f070-5b94-4381-acd8-2cbd19dbb1ba (current)
; 2 - 5b92247a-683f-4bce-bf19-940a0a0f0220
; 3 - db6173f5-1b36-42e7-8249-a527d213f170
; 4 - e8342e09-da88-4199-bf2a-a66525440bdd
; debug ->
{
:id "1a441259-e361-4ef2-a16b-bae31909f13f"
:op "ls-sessions"
}
; debug ->
{
:id "c738cede-1acb-40a3-8ecc-ebd754859366"
:op "close"
:session "18b5f070-5b94-4381-acd8-2cbd19dbb1ba"
}
; debug ->
{
:id "b733f68a-f40f-472c-a055-b3498c9c1a7d"
:op "close"
:session "5b92247a-683f-4bce-bf19-940a0a0f0220"
}
; debug ->
{
:id "352a4ad8-c09b-4a1c-97f3-a551c608cf05"
:op "close"
:session "db6173f5-1b36-42e7-8249-a527d213f170"
}
; debug ->
{
:id "661bb7bb-3b8d-460d-9352-1ceda0568dc2"
:op "close"
:session "e8342e09-da88-4199-bf2a-a66525440bdd"
}
; --------------------------------------------------------------------------------
; Closed all sessions (4)
; debug ->
{
:id "4319d688-87b6-4a64-a94f-c71c80854d0b"
:op "clone"
}
; --------------------------------------------------------------------------------
; Assumed session: 9b743e1f-61d9-43bb-93c7-523afb0fc0be
; debug ->
{
:id "a9c6c10a-6675-4a3e-9f32-fe6dbb20c8ed"
:op "ls-sessions"
}
; --------------------------------------------------------------------------------
; Sessions (4):
; 1 - 5b92247a-683f-4bce-bf19-940a0a0f0220
; 2 - 9b743e1f-61d9-43bb-93c7-523afb0fc0be (current)
; 3 - db6173f5-1b36-42e7-8249-a527d213f170
; 4 - e8342e09-da88-4199-bf2a-a66525440bdd
sorry it's a lot of output, but I've sent a bunch of closes and I think only one of them registeredNote sure why the sessions aren't closing in quick succession. Does closing just one work?
I can close some but not others... or maybe I can only close one before it stops working...
This is what my test currently looks like: https://github.com/borkdude/babashka/blob/b0a3549babff0ac188479f3c888f45e5ddcfe5c3/test/babashka/impl/nrepl_server_test.clj#L140
I think I only use the strings:
(let [id (str (java.util.UUID/randomUUID))]
(swap! (:sessions ctx) (fnil conj #{}) id)
(send os (response-for msg {"new-session" id "status" #{"done"}}))
(recur ctx is os id))
are there any other editors / clojure environments that use ls-sessions so I can test it myself?
I'm really not sure :thinking_face: you can always try Conjure if you have Neovim with a plugin manager but it might be a bit of hassle. All I'm doing is cloning some subsequent sessions then trying to close some.
; --------------------------------------------------------------------------------
; Sessions (5):
; 1 - 003fd936-4e7e-429c-aa3d-2245523eb41a
; 2 - 82617ba6-04a0-4dee-9542-1a49a027771c
; 3 - 98a3c464-9a39-42b8-9614-c1fbe37c83b1
; 4 - a40faa48-0958-4712-aaad-efb38fc75dd7 (current)
; 5 - db66665a-5523-46c7-9ebf-890fab6cae20
; --------------------------------------------------------------------------------
; Closed all sessions (5)
; --------------------------------------------------------------------------------
; Assumed session: 2fa9758a-dc49-4564-ba7c-a2c4476c8b02
; --------------------------------------------------------------------------------
; Sessions (5):
; 1 - 003fd936-4e7e-429c-aa3d-2245523eb41a
; 2 - 2fa9758a-dc49-4564-ba7c-a2c4476c8b02 (current)
; 3 - 82617ba6-04a0-4dee-9542-1a49a027771c
; 4 - 98a3c464-9a39-42b8-9614-c1fbe37c83b1
; 5 - db66665a-5523-46c7-9ebf-890fab6cae20
can you run bb with BABASHKA_DEV=true bb --nrepl-server
to see if your close message do arrive?
I can match the session ID up to one that is still in ls-sessions after I asked it to close
"Received" {:id "f2b118d6-2a41-41bd-a135-35155cb85f1c", :op :ls-sessions}
Reading! ea7d375c-944e-43d1-a174-4fe5236dd087 0
"Received" {:id "2ff43e04-814e-4b27-8a3f-6286b186f821", :op :close, :session "0c1d815c-b387-49d5-8541-77155257f4f1"}
Reading! ea7d375c-944e-43d1-a174-4fe5236dd087 104
"Received" {:id "9bfd95d4-379f-4e16-974f-5185937f01aa", :op :close, :session "40f6d2a9-882d-4624-ac36-cf60aa59f10b"}
Reading! ea7d375c-944e-43d1-a174-4fe5236dd087 312
"Received" {:id "2f41872f-4c99-4959-b381-717b7a4780f9", :op :close, :session "6d306267-e21c-485d-bc37-1f2253a3a324"}
Reading! ea7d375c-944e-43d1-a174-4fe5236dd087 208
"Received" {:id "d2640738-1d32-413a-bbc7-308c1937a930", :op :close, :session "97e45296-9ee3-4c2d-8c85-264e3ecf6612"}
Reading! ea7d375c-944e-43d1-a174-4fe5236dd087 160
"Received" {:id "70343c3e-818e-4535-9fd0-81b23782534b", :op :close, :session "ea7d375c-944e-43d1-a174-4fe5236dd087"}
Reading! ea7d375c-944e-43d1-a174-4fe5236dd087 56
"Received" {:id "bfe0c3d6-c07d-4e16-8450-14788a4dc5a8", :op :clone}
Cloning!
Reading! c9092576-8175-4fcd-a256-6e8d4d21e3d2 0
"Received" {:id "3171e89a-1a39-4d04-8948-06b915a319cd", :op :ls-sessions}
Reading! c9092576-8175-4fcd-a256-6e8d4d21e3d2 0
Because they're all in the same thread etc (this is okay, just understanding what's going on)
Fixed on master. Can you try this?
$ git clone --recursive
$ cd babashka
$ BABASHKA_DEV=true clojure -A:main --nrepl-server
to test it?I guess sessions don't have the same power as in JVM land where they're all separate threads with thread local bindings you can clone to child sessions etc, but it's still nice to have the API work like the others. Great work!
babashka does have threads, so that could be functionality to implement, I think I just haven't used it that much
and what doesn't work is interrupt, because babashka doesn't have Thread stop, that method is deprecated and the GraalVM engineers don't support it
Well now the outer API is in line with the other implementations, so if they eventually got their own threads and interrupts it would just work I guess.
As an alternative I could just kill the entire server, but I'm not sure if that's a good alternative
Yeah, that's true. You could run sub bb instances in each session that get killed 😅 (no)
Hi @olical - if you need some more early testing / feedback of the new version I can help out.
Thanks a lot! I'm working on docs and the final essential features today / tomorrow, so hopefully it'll be in a usable state very soon! I'm just lacking a few niceties like autocompletion at the moment.
Great - I’ll keep an eye on the channel and switch over when you are done; I can also update https://github.com/thecontinium/asyncomplete-conjure.vim when you are ready.
I'll try to get the autocomplete switch over smooth, make sure they all work on their respective develop branches before I release the rewrite.
ok - just give me the nod and I’ll update.
please update the coc-conjure 🙂
Rather than a text based help intro I think I'll have a small Fennel based tutorial you can interact with :thinking_face: then at the end of it, it will point you at the docs to work out how to configure mappings etc.
Did a bunch of work to improve Fennel / Aniseed evaluation so I can provide a nice out of the box eval tutorial where you actually run Lisp in Neovim. Functions that return multiple results now display all of them in the log, anything printed to out is captured and printed in the log and it uses the Aniseed version bundled with Conjure by default. So you don't need Aniseed installed to evaluate fennel code in .fnl buffers. You can change the config to a global copy of Aniseed if there's a newer version and Conjure is behind or something. Kinda irrelevant to the Clojure world but useful for the initial tutorial buffer that you get to play around in!
https://asciinema.org/a/0zo8XZK2Rxm5vKiGgqLhjzBjp just playing about with the idea for now, but I think this will be the way you get introduced to all mappings and how this sort of eval experience works. Through actually doing it.
You can try this yourself now too if you want, it'll at least test if the Fennel eval stuff works out of the box for everyone 😅 it might explode...
I'm going to add more lesson steps that you work through, teaching you root form, current form, word under cursor, doc lookup, eval at mark.