This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-11
Channels
- # announcements (4)
- # babashka (4)
- # beginners (164)
- # calva (47)
- # cider (1)
- # cljs-dev (29)
- # cljsrn (3)
- # clojure (137)
- # clojure-europe (23)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (44)
- # clojurescript (35)
- # component (8)
- # conjure (119)
- # cursive (32)
- # datomic (12)
- # emacs (31)
- # figwheel-main (36)
- # graalvm (10)
- # jobs (2)
- # kaocha (1)
- # lein-figwheel (3)
- # meander (15)
- # mount (3)
- # off-topic (9)
- # pathom (8)
- # quil (4)
- # re-frame (13)
- # reagent (15)
- # remote-jobs (10)
- # shadow-cljs (128)
- # slack-help (2)
- # spacemacs (8)
- # test-check (6)
- # xtdb (6)
this is just my opinion, but i've never felt the need to have a debugger when i'm developing in clojure. REPL driven development is convenient enough that it's easy to insert print statements and re-eval
Logging and print statements are the lion's share of my debugging. There are a few other cool developments that I've tried (like https://github.com/vvvvalvalval/scope-capture), but none have taken ahold of me.
when working with interop, I often have a simple project open in IntelliJ with the libraries set as dependencies. Then I have the normal JVM debug settings running and IntelliJ listening on breakpoints. I start the repl running with the JVM debug parameters running. I can then debug whatever 3rd party libraries I use, combined with repl debugging as mentioned above makes for a powerful combination.
Yep, been working full time in Clojure for years, never needed a debugger. Just eval, tap>
(I need to add this) and print. I may well add CIDER debugger support at some point (I think it has a stepping debugger?)
(edit: Realised this comes across bad if there's someone who wants or needs a debugger, don't want to claim that "real" Clojure devs don't need debuggers. Was really just trying to say that I've never felt the need for one so I never focussed on adding one to Conjure. More than happy to consider adding it though! I am not trying to say that you shouldn't need one)
There's also stuff like https://github.com/philoskim/debux
Hi - Are there any plans to start a “default” repl if one cannot be found ?
It's on my list! But I'm holding off on it for a while since there's a LOT of other things to do and I see it as an optional extra that just saves you running another terminal. I think it's actually worse to run your REPL from your editor, especially if it's Neovim since the process is usually disposable and easily restartable. But, I can still see the need for it in some scenarios, so I'm not against it as an option.
One of the main goals I have for Conjure is to be as easy to use as possible by default (so a total Clojure newbie at a Clojure Bridge event or something) could pick it up and start evaluating within minutes. Just like VSCode + Calva but Neovim I guess. Having a button that starts the REPL and gets you evaluating right away is part of that.
I want Conjure to work out of the box for beginners, but still be a power tool experienced users can never hit the limits of through extra plugins that hook into it etc.
Also, what do you think about automatically downloading, running and connecting to babashka on eval with no connection :thinking_face:
sounds good - makes it work out of the box; certainly much easier for the beginner
What about a fallback port if the repl port file cannot be found ?
that way if you are experimenting outside a project you get a connection to a “sandbox” repl
… so long as you have it running.
Hmm, you can also use :ConjureConnect [port]
on the first time you open a Clojure file or when you hit a mapping :thinking_face:
You can also configure the portfile list to check for another portfile like .default-clojure-port
and put that in your home directory.
Just trying to think of ways you could do this within the current framework rather than adding more mechanics?
I think both of those can work; can I configure the port file list now ?
Yep, so if you run :ConjureConfig clojure.nrepl/connection.port-files [".nrepl-port" ".shadow-cljs/nrepl.port" ".conjure-port"]
it'll then look for .conjure-port
if the other two fail. In every directory above yours, including your home directory.
.conjure-default-port
; I know this may not fit with what you have in place but I’m not a fan of littering the home directory ( it all gets lost ) - I would personally prefer options like this to sit in the XDG_CONFIG_HOME/conjure
Or if I add a secondary search for the XDG config dir you could just create a .nrepl-port
file in there :thinking_face:
I like the that
Keeps it simple, gives you more options, doesn't add too much complexity / things that require more explaining and learning. Will still document this concept, but it's on top of existing ideas which is nice.
yes - it’s clear what you have setup
Okay, that's on develop! So you can now use ~/.config/conjure/.nrepl-port
as a fallback
It works for me 🍻
@dharrigan Thank you so much for your input! I've incorporated basically all of it with the odd tweak here and there. It's massively appreciated 😄 I hope this helps people get into Conjure and interactive evaluation as a concept!
Would someone without Fennel support in their Neovim be so kind as to test :ConjureSchool
for me? It should be kind of highlighted like Clojure since that's the fallback I use.
I've tested it without the filetype support and it works fine, I just noticed someone saying it didn't work and it makes me worry I have a case of "works on my machine".
It should show a warning about not having the filetype and falling back to Clojure syntax.
Nice! Glad to hear it. I think @comparalf was having issues :thinking_face: maybe it wasn't with the school but was with the evaluation of Fennel files in general.
So I'm putting together a one liner script that allows you to demo Conjure without even installing it with the school.
If develop
is working well for a few people other than me I think I'll release this. @matthew.newland let me know if that port file default thing works well 😄
will do
E492: Not an editor command: ConjureSchool jeje
Ah that sucks! I'll have to check again, was working well for me. Probably to do with runtimepath stuff.
Maybe this extra information helps: Macosx iterm nvim: 0.4.3
Hmm should be fine really. It's probably to do with whatever plugin manager you're using. I add Conjure to the runtimepath temporarily and there's probably something that's reverting that from your dotfiles. I think.
Just to clarify, I use vim-plug
Hmm, same as me then. Main difference is Linux / Mac. I wonder if it's /tmp
behaving differently on OSX?
How's that? I wait for VimEnter now which should give it time to load the plugin properly from the runtimepath.
@dave @nate While it's true that splicing printing statements might take care of 90% of debugging needs, it is still nice workflow to be able to just debug code by stepping through it. Occasionally, might even want to override a value/inject a value. 🙂 Personally for me, debugging is preferred because I'd rather examine values being passed through instead of bulk-printing large structures and searching for missing fields or fields that have irregular values. In other words, when my data is irregular and has "corner cases." Finally, remember that "old" Lisps had debuggers and were quite proud of them. :-)
That's fair. I totally recognize that a lot of people really like debuggers, I just never really took a liking to them 🙂 I have played around with Common Lisp a little and the interactive debugger is really unique!
you might find this interesting: http://arsenerei.com/blog/posts/2017-02-24-vim-sayid/
i played around with sayid in vim a while back, but wasn't quite able to get it working. i think that was before this blog post + 3rd party plugin
@dave Tried that plugin last night. It requires vim-fireplace. I didn't spend time trying to disentangle the dependency.
i also appreciate having a debugger option. there is a scenario i'm curious whether someone has figured out how to work with well via only the repl. if one uses cljs to write a plugin for atom or extension for vscode, the host application (the editor being extended here) is sometimes in a position to be triggering one's code. that is, the developer doesn't get to directly trigger code (it's "don't call us, we'll call you") and one or more input parameters are decided by the calling program and are not easy or practically impossible for a developer to fabricate (e.g. one of them might be editor window state). any thoughts on this type of situation?
Thanks for the inputs! I definitely see the value it in it, I won't want to rush the implementation though. If there's great support for it in nREPL (99% sure there is :D) then I'll just have to think up a nice set of mappings and interactions.
I am having an issue in lesson5
school.lesson-5-message$
Compile error in 'message' /conjure-school.fnl:2: unknown global in strict mode: message$
stack traceback:$
[C]: in function 'error'$
....vim/plugged/conjure/lua/conjure/aniseed/deps/fennel.lua:484: in function 'assertCompile'$
....vim/plugged/conjure/lua/conjure/aniseed/deps/fennel.lua:716: in function 'symbolToExpression'$
....vim/plugged/conjure/lua/conjure/aniseed/deps/fennel.lua:1068: in function 'compile1'$
....vim/plugged/conjure/lua/conjure/aniseed/deps/fennel.lua:2160: in function 'compileString'$
....vim/plugged/conjure/lua/conjure/aniseed/deps/fennel.lua:2286: in function ?$
[C]: in function 'anic'$
...im/plugged/conjure/lua/conjure/client/fennel/aniseed.lua:175: in function ?$
[C]: in function 'pcall'$
...e/.vim/plugged/conjure/lua/conjure/aniseed/nvim/util.lua:86: in function 'anic'$
...im/plugged/conjure/lua/conjure/client/fennel/aniseed.lua:183: in function 'word'$
[string "<VimL compiled string>"]:1: in main chunk$
Ah! Okay, I thought maybe it was how the word boundaries were defined, like, sometimes you can set up vim to consider - a break in a word. Which you don't want with lisps
If I place the cursor in “school” it works, but if I place the cursor in “lesson” it doesn’t
I don't want to change how your words are defined for you, but I can try and account for custom ones.
I'll alter the tutorial to work for everyone I think. Not sure about changing how word boundaries are defined for Conjure users although it may be the best approach.
And yeah, anything that moves the cursor (like motions or text objects sometimes) will hide the hud right away
That's because your cursor gets moved if it's at the end of the visual selection. It's teleported to the front of the selection.
Yay! I'm glad to hear that 😄 I'll try to address these HUD issues at some point (although HARD) and the word boundary issue. Maybe I'll set it for you to something nice for lisps but :thinking_face:
So this is defined by iskeyword
and the built in Clojure support apparently sets this up correctly. Here's mine: @,48-57,_,192-255,?,-,*,!,+,/,=,<,>,.,:,$
oh oh, looks like the long string printing is breaking again:
#_(println (apply str (take 2000 (repeat \x))))
results in (lines trimmed for clarity):
; eval (root-form): (println (apply str (take 2000 (repeat \x))))
; (out) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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