clr

Benjamin 2023-02-08T11:24:48.373029Z

I'm trying to run crl.tools.nrepl. How do I do it? lein clr repl [ERROR] No such environment variable: CLJCLR15_40 1

dmiller 2023-02-08T13:45:33.659029Z

Depends on how you are running ClojureCLR. Assuming Windows. Adjust accordingly. Given I always have an executable of ClojureCLR sitting around and I'm often playing with local changes, I just set CLJCLR15_40=path-to-executable If you have ClojureCLR installed as a dotnet tool, then in CMD.exe: set CLJCLR15_40=%USERPROFILE%\.dotnet\tools In Powershell: $Env:CLJCLR15_40 = $Env:USERPROFILE + "\.dotnet\tools" (On linux, similarly except use $HOME/.dotnet/tools )

Benjamin 2023-02-08T13:46:37.423709Z

I see thanks

bobcalco 2023-02-08T12:15:34.625009Z

@dmiller caught this via reddit (https://www.reddit.com/r/Clojure/comments/10wsyws/london_clojurians_talk_simpler_user_interfaces/) and thought you might find this "functional ui meta wrapper" of sorts interesting in light of our recent side-discussion about UI stuff. Looks like this library is well designed and written portably - cljc with cljs/clj for specific UI frameworks: https://github.com/phronmophobic/membrane . Should be more straightforward to port to CLR UI frameworks than reinventing another paradigm. Maybe others will find it useful too. Was generally nodding my head throughout the talk.

dmiller 2023-02-08T15:47:13.277619Z

I'm keeping an eye on https://github.com/tensegritics/ClojureDart. They have to deal with some of things I hope to deal better with in ClojureCLR.Next, such as real generics. See https://t.co/SVxdMLJPqb for their cheatsheet. (@cgrand @baptiste-from-paris)

❤️ 2
cgrand 2023-02-08T18:01:18.893949Z

I don’t know the CLR world but two things were instrumental in dealing with generics: they have cast methods as part of many interfaces and they stick to their naming conventions.

cgrand 2023-02-08T18:02:17.152859Z

For example https://api.dart.dev/stable/2.19.2/dart-core/List/cast.html

baptiste-from-paris 2023-02-08T18:02:33.197059Z

I was searching exactly for that

cgrand 2023-02-08T18:05:39.863319Z

Thus our collections are dynamically typed, only the root deals with generics. And when we emit calls to cast methods (to ensure the root is properly typed) when we pass them as argument to a typed param.

dmiller 2023-02-08T18:11:01.687579Z

Not really any equivalent of the cast methods, if I understand them correctly. I was looking at some of the notational variants you have introduced into the reader. I'm going to need something along those lines for designated generic types. What we have right now is just painful to use.

baptiste-from-paris 2023-02-08T18:11:47.339239Z

If I recall correctly you use the | right?

dmiller 2023-02-08T18:14:23.171629Z

Yes, | is used. That's not the problem. The problem is that it ties into the very basic and cumbersome platform designation for types rather than a simplified syntax that you see in C# or F#. Thus

|System.Collections.Generic.List`1[System.Int32]|

cgrand 2023-02-08T19:29:27.110439Z

We chose to use symbols with metadata for types because it doesn’t break other dialects readers and we could leverage tagged literals to provide a more convenient notation. Two things that weren’t a concern or possible when ClojureCLR started.

cgrand 2023-02-08T19:42:55.308259Z

In fact cast methods are not required we could have done it about the same way without them. They just gave us the idea and simplified implementation.

dmiller 2023-02-08T19:49:47.476119Z

Yes, tagged literals came after I did |...|. If only ...

cgrand 2023-02-08T20:22:56.088269Z

Well you can always offer two notations one legacy and a new one.

dmiller 2023-02-08T20:58:20.387109Z

I figured I would have to do that.

cgrand 2023-02-08T21:03:26.198949Z

Well, if you do that, I don’t think there’s any value in using the exact same notation as ClojureDart (since chances a generic type would be exactly the same on two targets is hair thin). However reusing / as the tag would create a precedent that #/ is an interop thing.

dmiller 2023-02-08T23:07:49.659019Z

that thought occurred to me as i looked at your cheatsheet

baptiste-from-paris 2023-02-09T08:33:08.217949Z

we also have "weirder" type hints in some rare situation like this one -> (let [a' ^#/(int double String -> void) a] a) which translates to final void Function(, dc.double, dc.String, ) a$PRIME_$1=(a$1 as void Function(, dc.double, dc.String, ));

baptiste-from-paris 2023-02-09T08:35:09.558399Z

it's for type hinting as a Function that has 3 typed parameters and returns void. cljd users should never face this kind of forms, it's really for low level programming