Fork me on GitHub
#calva
<
2023-02-06
>
lspector12:02:43

Here is more detail on the error that one of my students is getting, in this case when trying to fire up the Getting Started REPL: > I am currently on Microsoft Windows 11. I tried Calva: Fire up the Getting Started REPL", but the terminal gave me the same following error message: > > java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""1.0.0""},cider/cider-nrepl {:mvn/version,""0.28.5""}}}" -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" > Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,1.0.0},cider/cider-nrepl {:mvn/version,0.28.5}}}": java.lang.NumberFormatException: Invalid number: 1.0.0 > Jack-in process exited. Status: 1 Is this the Windows-specific issue that you mentioned earlier, @pez? I will suggest that they try installing the CLI tools, which I don't think they've yet done.

pez12:02:01

Yes, looks like the bug I mentioned earlier. This bug: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8266473 I somehow doubt that the CLI tools will handle it better. But I'm curious if it does. I have myself never succeeded in installing the CLI on Windows, so I haven't been able to check.

lspector13:02:25

Interesting. I will let you know about the student's experience in trying CLI. Is the workaround mentioned there implemented?

pez13:02:08

Nope. Then it would work. 😃 The bug is fixed back to Java 11, I think, so re-installing Java should get rid of it.

lspector13:02:47

Good to know! I will pass this along.

pez13:02:05

If someone runs into troubles installing the Clojure CLI, here's what I do when I need clojure on Windows: • Download the windows-amd64 zip from https://github.com/borkdude/deps.clj/releases • Unzip it -> gives me deps.exe • Rename deps.exe to clojure.exe • Place clojure.exe somewhere on the PATH (like C:\Windows\System32\clojure.exe). This will use deps.clj instead of the official Clojure CLI, so in case the official CLI tool can dodge that Java bug, then this is not a solution.

👍 2
Kiyanosh Kamdar20:02:58

This may be a known issue, not sure. But using #dbg on a private method (defn- doesn’t work. But setting the private meta data (`^:private`) works.

bringe03:02:11

It seems to work for me. Can you provide an example for reproducing the issue? I can’t think of why it wouldn’t work for you if the private metadata is working.

Kiyanosh Kamdar16:02:20

let me try it again with latest version

Kiyanosh Kamdar16:02:19

Here is what I found. v2.0.331 it works. But the cool lines you draw above and below the function don’t appear. In v2.0.324 it doesn’t work. But the cool lines still appear. 🤷 I’m using v2.0.324 because the lsp works in this version.

bringe17:02:20

Ahh I’m not sure why the lines wouldn’t show for you in 2.0.331, if they show for me. Feel free to create an issue for that and provide details such as how you’re starting your repl, if you’re using lein or deps.edn, the Calva version (2.0.331) and sample code for which the lines don’t appear when instrumented.

noprompt20:02:34

Hello. 👋

👋 2
noprompt20:02:26

It would be really awesome to have the # %% Python code cell notation in Calva (`; %%`): https://code.visualstudio.com/docs/python/jupyter-support-py

🧵 2
👍 2
pez21:02:57

Hi! (We try to use threads here.) Can you describe this feature a bit? I'm not familiar with it. But sounds cool! 😃

noprompt21:02:37

Sure basically when you write Python in a .py file you can place a comment above code like so

# %%
1 + 1
and then type shift+enter anywhere in the area below the # %% and it will send the code as a code cell to a live notebook.

noprompt21:02:35

Try it out. Just create a Python file. Write # %% type some code as I have in the screen shot and press shift+enter.

pez21:02:09

Do I need some Python extension? Nothing happens when I try it. 😃

noprompt21:02:20

Yeah, you probably need to install the Python extensions.

noprompt21:02:30

Forgot that part. 😛

pez21:02:54

What's the use case in Clojure code? When would you use this instead of alt+enter och ctrl+enter?

noprompt21:02:00

Should be the one provided by Microsoft.

noprompt21:02:35

I prefer the output format of a Notebook to the standard Clojure REPL.

pez21:02:13

Have you tried the Calva Notebooks?

noprompt21:02:33

Also, since # %% evaluates everything below there is no need to wrap things with let and/or do to evaluate multiple forms, etc.

noprompt21:02:47

Yes. I don’t want to work in the Notebook.

noprompt21:02:06

I want to work in a clj file as usual and send forms to the notebook as with # %%.

noprompt21:02:17

This is why I was asking.

noprompt21:02:47

Is it already possible to send to a notebook?

pez21:02:10

Calva has a an API which lets you use its REPL. Maybe this should go in a separate extension using that API, or maybe it can be done with Joyride?

pez21:02:53

I didn't know about send to notebook until now. 😃 Maybe @U02EMBDU2JU knows what's possible around that.

noprompt21:02:35

Sure. I’m just now learning about the Notebook API in VS Code. A lot of this is new to me so I apologize if I don’t know everything yet. I’ve just barely ported over my standard Emacs evil bindings to work with neovim etc.

pez21:02:10

Not saying I know this shouldn't be added to Calva, but sounds like Joyride could be a good first step to prototype it at least.

noprompt21:02:12

Mostly I’ve used VS Code for Python and JavaScript. I’ve almost got most of my creature comforts for Clojure. 🙂

noprompt21:02:27

I’ll take a look.

Lukas Domagala21:02:30

Mhh no never heard of send to notebook

noprompt21:02:47

Check out the link and my description of the feature.

pez21:02:48

Sounds like send to notebook is something we should take a look at.

noprompt21:02:34

I’m going to work through the Notebook extension guide and learn a bit more.

pez21:02:12

I don't get any cell UI even with the Python extension installed...

noprompt21:02:25

FWIW it could also be handy for new people using the language who like to def everything and aren’t used to working with a loaded weapon like the REPL. 😛

noprompt21:02:19

@pez Ah, I think you may need to install the Jupyter package.

noprompt21:02:35

pip install jupyter

noprompt21:02:11

> To work with Jupyter notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you’ve installed the https://pypi.org/project/jupyter/. To select an environment, use the Python: Select Interpreter command from the Command Palette (⇧⌘P).

noprompt21:02:38

You don’t have to install Anaconda. It should just find your OS default python.

pez21:02:47

Doing it now. A bit more than I would want to happen with my machine, but anyway 😃

noprompt21:02:35

LOL I feel like I have no discipline. gem install hairball 😛

noprompt21:02:42

I’ve kinda gotten used to Python pip install just about everything but I also use conda to keep things sane.

pez21:02:09

@U9A1RLFNV, we discussed alternatives for the Output/REPL window some days ago. This Interactive jupyter thing looks pretty interesting.

👍 4
noprompt21:02:56

Its definitely nice. It’s really convenient for all sorts of things. Just checked out Portal too.

pez21:02:57

It's quite similar in concept to Portal.

noprompt21:02:46

The two go together right?

pez21:02:36

I think something unstructural like # %% isn't a good fit for Calva, but a Joyride script or an extension could do it for people who want it.

👍 2
noprompt21:02:26

Thanks for pointing me in the right direction.

pez21:02:21

Thanks for showing us about Send to Notebook!

seancorfield21:02:47

Re: Portal -- I have all my evaluations go into Portal for viewing (and my REPL output window is always hidden). I use the Portal middleware so it captures regular evaluations, but I can also tap> values and those go directly to Portal without middleware wrapping. I like that it allows me to switch to data exploration mode if I need to, expanding parts of nested data, and visualizing them in different ways, but I also have hot keys that I can use from my editor to expand/contract parts of the Portal view without needing to switch over to Portal directly.

metal 2
bringe21:02:04

> I use the Portal middleware so it captures regular evaluations So I can just use Calva’s regular eval commands and results are sent to Portal, if I use the Portal middleware?

noprompt21:02:23

Yeah, that’s one way to do things. I’m not a big fan of tap> though.

noprompt22:02:23

Well, what I mean is, I like tap> for certain things (async). The use case of # %% is very nice for several use cases and easy to clean up.

seancorfield22:02:37

tap> is one of the best additions to Clojure in years for me - I use it so much in development and in debugging, even with remote servers.

noprompt22:02:01

Its handy. No doubt.