clr

dangercoder 2023-01-18T18:56:02.506359Z

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

dangercoder 2023-01-18T18:56:50.654529Z

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

dangercoder 2023-01-18T18:56:55.808399Z

I'm running Ubuntu

Emma Griffin (OST) 2023-01-18T18:58:49.043819Z

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

dmiller 2023-01-18T19:47:33.891629Z

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.

dangercoder 2023-01-18T19:59:54.536339Z

Thanks for the clarification dmiller

dangercoder 2023-01-18T20:58:58.613759Z

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

🆒 3
1
dangercoder 2023-01-18T21:00:16.944709Z

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

Anders Eknert 2023-01-18T21:19:56.689609Z

Nice! 👏

dmiller 2023-01-18T23:13:29.054959Z

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

dangercoder 2023-01-19T13:11:10.851719Z

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 Griffin (OST) 2023-01-19T14:49:28.095869Z

This is awesome, thank you!

Emma Griffin (OST) 2023-01-19T14:49:53.719199Z

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

Emma Griffin (OST) 2023-01-19T14:50:11.025089Z

Seeing .cljr everywhere made me a bit giddy

😄 2
Anders Eknert 2023-01-19T14:51:17.268069Z

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 Griffin (OST) 2023-01-19T14:58:31.298289Z

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 Eknert 2023-01-19T14:59:02.219019Z

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

Emma Griffin (OST) 2023-01-19T15:01:35.282889Z

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 @jarvinenemil’s repo is correctly "100% Clojure"

👍 1
Emma Griffin (OST) 2023-01-19T15:02:30.188969Z

Ah, there is a way

🙌 2
Emma Griffin (OST) 2023-01-19T15:02:42.937629Z

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

👍 1
Emma Griffin (OST) 2023-01-19T15:04:21.388659Z

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 Griffin (OST) 2023-01-19T15:05:36.557549Z

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 Griffin (OST) 2023-01-19T15:10:14.325739Z

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 Griffin (OST) 2023-01-19T15:15:54.558489Z

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 Eknert 2023-01-19T15:18:18.882509Z

Great detective work, Emma! 🕵️‍♀️ 👍

1
Emma Griffin (OST) 2023-01-19T15:19:09.266299Z

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)

👍 2
Anders Eknert 2023-01-19T15:19:37.201699Z

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

1
🎉 1
dangercoder 2023-01-19T17:36:59.331879Z

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

dangercoder 2023-01-19T17:48:00.321759Z

@emma.griffin thanks for the advice, the repo now has syntax highlighting

1
Emma Griffin (OST) 2023-01-19T18:15:44.906099Z

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

bobcalco 2023-01-19T19:32:48.828269Z

@emma.griffin 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@dmiller is making inexorable progress.

1
dmiller 2023-01-19T20:19:19.910969Z

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

Emma Griffin (OST) 2023-01-19T20:20:17.451359Z

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 Eknert 2023-01-31T00:19:38.459409Z

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

dmiller 2023-01-31T03:49:39.477959Z

👍