Fork me on GitHub
#clr
<
2023-01-18
>
dangercoder18:01:02

Has anyone tried using a clojure.clr lib with .net 6 or newer?

dangercoder18:01:50

I tried core.async, my theory is that it doesn't work since it's compiled with .NET 2.1

dangercoder18:01:55

I'm running Ubuntu

Emma Griffin18:01:49

I've loaded a NuGet lib from ClojureCLR with .net 6 iirc

dmiller19:01:33

I've tried all of them. I was running all the tests under .NET 6. They are .netstandard2.0 and netstandard2.1. The latter should load under Core3.1 and later. Only on Windows. don't know why it would matter.

dangercoder19:01:54

Thanks for the clarification dmiller

dangercoder20:01:58

If anyone is interested, a .NET 7 api that can run with Clojure.Main -M on Ubuntu (haven't tried windows). https://github.com/Dangercoder/clojure-clr-dotnet-api It's currently showcasing: • Routing • Health Check endpoint • Json Serdes (request/response handling) • Structuring a clojure-cljr application using Integrant • Start/Stop the application via the repl to e.g. reload routes

🆒 6
gratitude-thank-you 2
dangercoder21:01:16

I think it's pretty fast for using some sloppy .NET interop 😄. But haven't tried db calls yet

dmiller23:01:29

Looking forward to playing with it and looking at how you structured it.

dangercoder13:01:10

I think it's really positive that .net 7 works so well with clojure-clr. We get tons of useful stuff for free, and those things are also maintained and used in the wild.

Emma Griffin14:01:28

This is awesome, thank you!

Emma Griffin14:01:53

It would be cool to have something like http-kit ported to ClojureCLR but I feel like that's probably a heavy lift

Emma Griffin14:01:11

Seeing .cljr everywhere made me a bit giddy

😄 4
Anders Eknert14:01:17

It seems like it’s even in a bit too many places in the latest alpha 😄

Could not locate clojure_clr/util/platform with extensions .cljr, .cljc, .cljr,
i.e. the .cljr is repeated twice ☝️ I’ll submit a fix

Emma Griffin14:01:31

I hope github can add Clojure syntax highlighting for .cljr files soon. I imagine it's difficult to request that sort of thing though

Anders Eknert14:01:02

oh! I didn’t realize that would be an issue

Emma Griffin15:01:35

Yeah I had assumed it would. On the bright side, github seems to be smart enough to know that .cljr files contain Clojure source code when calculating the language percent bar as @UBN9SNVB4’s repo is correctly "100% Clojure"

👍 2
Emma Griffin15:01:30

Ah, there is a way

🙌 4
Emma Griffin15:01:42

This may be good to add to the FAQ in the ClojureCLR repo

👍 2
Emma Griffin15:01:21

I wrote a Maya script a couple years ago and was annoyed at not having any syntax highlighting in github, so this is good to know more generally

Emma Griffin15:01:36

At some point .cljs and .cljc must have been added to the list of Clojure source files though, so I'm curious what process was involved in getting those added, as that's the better long term solution for .cljr

Emma Griffin15:01:14

Looks like adding a PR to this repo would do it, but they have a "checklist" of requirements for submitting new extensions, so we may have to wait until .cljr is used more widely. https://github.com/github/linguist

Emma Griffin15:01:54

Here's the PR that got merged to add .bb to the Clojure file extension list, probably a good template for whenever we meet the requirements https://github.com/github/linguist/pull/5931

Anders Eknert15:01:18

Great detective work, Emma! :female-detective: 👍

gratitude-thank-you 2
Emma Griffin15:01:09

Now we all just need to start writing and publishing more ClojureCLR code (and I need to start using the .cljr extension instead of crowding .cljc files)

👍 4
Anders Eknert15:01:37

yeah, I have a repo soon to be published where I’ll use that too 🙂

nice 2
🎉 2
dangercoder17:01:59

"files.associations": { "*.cljr": "clojure" } If you're using vscode, add this to ur settings.json 🙂

dangercoder17:01:00

@U03TVA3TR0T thanks for the advice, the repo now has syntax highlighting

nice 2
Emma Griffin18:01:44

I'm going to try to add .cljr to clojure mode in emacs as well, whenever I have the time to reach out to the project maintainer. The maintainer approved my PR to add lein-clr support to inf-clojure so I imagine he'll be open to this addition as well, hopefully

bobcalco19:01:48

@U03TVA3TR0T For syntax highlighting at least, the following works:

(setq auto-mode-alist (cons '("\\.cljr$" . clojure-mode) auto-mode-alist))
Cider support I believe would require ClojureCLR support nREPL, on which I understand@U45FQSBF1 is making inexorable progress.

gratitude-thank-you 2
dmiller20:01:19

I'm not sure I would describe progress on nREPL as 'inexorable'. I'm taking a short break to clear my head.

Emma Griffin20:01:17

yeah, clojure-mode support would be a good start though, especially for new users to that it works out of the box rather than requiring a custom config edit

Anders Eknert00:01:38

Have just switched to use .cljr for ring-clr 🙂