Fork me on GitHub
#calva
<
2022-02-23
>
pez08:02:53

@U02JTH42R7A I am assuming you are using Calva, are you?

Pagoda 5B09:02:05

to be more specific I have a file with this simple code

(defn lights [n]
  (let [exp (reduce *' (repeat n 2N))]
   (long (mod (dec exp) 1e5))))
and when I jack-in and load the file it tells me that *' can't be found I had similar issues with biginteger type coercion. They both are in clojure.core but it's like it can't find them

Pagoda 5B09:02:29

; Could not resolve symbol: *'

pez09:02:18

Hmmm, I tried to reproduce this, but I didn't get that error. The function is defined and works. I tried it in Clojure. Is this Clojure or ClojureScript?

Pagoda 5B10:02:27

might be something with vscode config...

Pagoda 5B10:02:41

I'll check it out

pez10:02:59

I somehow doubt it is vscode config.

pez10:02:04

Is it some project you can share?

Pagoda 5B10:02:25

it's just a few files I'm using to learn clojure on hackerank

Pagoda 5B10:02:40

no real project, no dependencies... I can only use core clojure there

Pagoda 5B10:02:51

so there's really nothing to set up

Pagoda 5B10:02:50

I saved the file, started up bb REPL to jack-in to and tried to load the file with calva, and the error popped up

Pagoda 5B10:02:24

what could it be that fails to load only some definitions in the clojure.core... doesn't make much sense

Pagoda 5B10:02:27

you mentioned clojurescript... I actually didn't specify it in any other way, but I wrote a .clj file, so I assume it's standard clojure

pez10:02:01

So you are using Babashka 😃 Let me try that.

pez10:02:33

It works when I use babashka... Hmmm. Can you describe the steps you take in more detail?

Pagoda 5B10:02:42

I opened an empty folder project and created a clojure file inside. I open the command menu and choose Calva: Start or Connect to a clojure REPL then Start your project with a REPL and connect (a.k.a. jack-in) then I'm offered with a choice of repl babashka or bb And I chose bb

Pagoda 5B10:02:47

are there ways to choose any other nRepl

pez10:02:59

FYI. Babashka is a special version of Clojure. It is remarkably like Clojure, but there are also some differences. I am super happy you can use it to explore Clojure in the editor.

Pagoda 5B10:02:27

I didn't realise... why does I only get those choices, and not a standard clojure nRepl?

Pagoda 5B10:02:44

should the project have a configuration file to do that?

pez11:02:10

There are some more quick REPLs like that in Calva. You reach them differently, which might be confusing (note to self: figure out how to ease this confusion). Anyway you find them searching for "fire up” in the command palette.

Pagoda 5B11:02:47

Can't see the image... it's all a blurred dark thng

pez11:02:30

Well, it only shows what you will see if bring up the command palette in vscode and type ”fire up”. 😃

Pagoda 5B11:02:45

No, I've been through the welcome stuff, but I think it's misleading... I was lead to think that the "fire up" command is only to run the "introductory exploratory sessions"

Pagoda 5B11:02:06

Every time I fire up the Repl like that vscode opens all the intro files

pez11:02:18

FYI2: nREPL is a protocol that Calva uses to connect to the REPLs in your projects.

1
Pagoda 5B11:02:36

Should I work on those only? What if I'm running other source files?

Pagoda 5B11:02:02

I'm also confusing the protocol with the repl itself, ok, clear now

pez11:02:12

Very good questions. Calva doesn't help very well with that yet.

pez11:02:17

I'll use your questions to aid me in designing some better support for what you are needing right now.

Pagoda 5B11:02:21

Just pointing that out to improve the beginner's experience here... maybe it would be better to have a way to not "fire up" the files if you tell it so

Pagoda 5B11:02:49

Anyway, thanks a ton for your kindness... now I can work fine with calva!

Pagoda 5B11:02:00

Awesome job, btw... really

calva 2
pez11:02:14

VS Code is a bit peculiar with when there is no folder open. There's no way to create the folder an open it via the API, so the fire-up folders are created in a /tmp folder where they are not very accessible... But nothing stops us from also allowing them to be created in a folder that the user does have open. Maybe we should do that. And add a way to create an empty project that way as well.

pez11:02:52

Now, let me try your steps with starting the Babashka repl...

pez11:02:46

Hmm. That works for me too. I really don't understand what goes wrong on your machine. What OS are you using? Which version of bb?

pez11:02:02

Also. If you just run bb in a terminal. Can you define that function there?

Pagoda 5B12:02:14

For me switching to non-babashka repl worked fine, I simply expect the clojure.core missing some implementation?

Pagoda 5B12:02:26

Or it doesn't make sense

Pagoda 5B12:02:50

Now I'm busy to test babashka locally, not even sure I have it installed

pez13:02:42

I don't think Calva bundles it.... (I must check).

pez13:02:54

No, that's still on my maybe-todo list. 😃

bringe04:02:11

> why does I only get those choices, and not a standard clojure nRepl? This is because Calva does not detect a project file associated with a specific CLI tool, like Leiningen (project.clj), or the Clojure CLI (deps.edn). If you add a deps.edn file, for example, and place an empty map in it (`{}` - which avoids an error during the jack-in process), then you’ll see an option to start a deps.edn repl when you run the commands you mentioned above to start a repl. This is beyond the “getting started” and standalone REPLs, however, but is the more “standard” way to work on a Clojure project, even if it’s just a small project with a file or two for testing things out. I just wanted to add that info here in case it helps.

thanks2 1
gratitude 1
Grant Horner18:02:12

Awesome! You guys pushed out the fix for https://github.com/BetterThanTomorrow/calva/issues/1539 so quickly, can’t believe it

calva 3
❤️ 1
pez20:02:20

Thanks, @U02RXJVMKNE! I wonder about my solution a bit. Seems like a very roundabout way. But whatever works, works, I guess. 😃 And it isn't like I can see an alternative route.

pez20:02:08

The VS Code API make it a bit difficult to give clearer indication about ongoing evaluations. Please help with upvoting this issue: https://github.com/microsoft/vscode/issues/143774

👍 4
pez17:02:36

Bumping this. Your votes on the issue are needed, Calva friends. 🙏

Stuart22:02:06

Would it be possible to have the green highlighting stay on forms that haven't been changed at all ? e.g. Say I have these silly functions, and I evaluate them all in: Then I go and edit bar, I lose the green highlighting on foo and quax... I expect it would be REALLY hard for Calva to know that foo and quax haven't changed, so leave the highlighting on them ? Or maybe a gutter icon, basically something to let you see at a glance if something is the same as is currentl evaluated into the repl ?

Stuart22:02:16

I realise I may be asking for the moon on a stick here 😄

Lukas Domagala00:02:30

yeah those decorations are hard to make sticky, since you define them on certain lines/columns. So tracking where a form moved and if it’s the same is kinda complicated 😅

pez06:02:00

CIDER keeps the user informed about wether something top-level is evaluated or not. Using the gutter to indicate it. We can check how it's done. As for retaining the decorations, I’ve tried, but it got very messy an and I ended up with the current scheme.

Cora (she/her)20:02:53

@pez are you still seeing eslint errors you shouldn't be?

pez21:02:45

Locally on my machine, yes.

Cora (she/her)21:02:12

which OS are you using?

Cora (she/her)21:02:23

I'm curious if it's different file path handling or something

pez21:02:28

I'm on macOS Monterey

pez22:02:51

I had a directory src/cursor-doc/out (no idea when it was created, or why, there was even a node_modules there) that was causing most of the noice. Removing that and adding /site to .eslintignore fixed it for me.

pez22:02:03

All good now. Sorry for the alarm. 😃

Cora (she/her)03:02:40

oh that's odd, glad it's all sorted at least 💜

pez11:02:38

Now remember why I had this. Some years ago I made branch of Calva where the clojure-doc/mirror stuff was published and consumed as an npm library. https://www.npmjs.com/package/calva-clojure-cursor-doc

Alex Miller (Clojure team)20:02:58

Just a reminder that the State of Clojure 2022 survey https://www.surveymonkey.com/r/clojure2022 is open and to make sure you register your use of Calva (Question #20) - I'm kind of surprised how low it is at the moment!

4
pez20:02:01

That's interesting. I thought we would be increasing the usage share.

Alex Miller (Clojure team)20:02:13

We are still early in the sampling so make your usage known!

pez21:02:42

According to the usage stats that Calva collects we have almost doubled since last year in daily usage.

pez21:02:42

We don't really know from that, though, since only users allowing telemetry are counted. But hard to see how real usage could have decreased...

Lukas Domagala00:02:02

Yeah, I’d have guessed Calva to be the fastest “gainer” since it’s the easiest beginner IDE. Would be interesting to compare “clojure experience time” to IDE usage

Alex Miller (Clojure team)00:02:06

yep, we will be doing some of that stuff for analysis.

Alex Miller (Clojure team)18:02:26

actually, I may need to apologize on my initial comment - I believe I had a filter enabled on one or both of the 2021/2022 results when I got that impression which made it an incorrect comparison. I do see a ~5% increase in total share this year for Calva (so far)

pez18:02:20

Ah, that's more in line with what I think I see out there. 1/6-1/5 use Calva. We appreciate that you reached out! ❤️

Alex Miller (Clojure team)19:02:37

yep, I think that's a good estimate, prob closer to 1/5!

calva 2
🎉 2