clr

dmiller 2023-01-14T22:33:03.788399Z

[ANN] clojureclr-1.12.0-alpha3 Some bug fixes. Most prominent are some things you can read about above.

👍 1
2
🤩 3
dangercoder 2023-01-14T23:28:25.010839Z

Why is this giving me bad type .NET 6 is installed? I was expecting this dll to be found when running: Clojure.Main -m clj-api.main on ubuntu. Thanks

dangercoder 2023-01-15T21:29:11.605139Z

So I thought. I've spent many hours trying to get https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.webapplication?view=aspnetcore-6.0 to load (can't find the correct assembly, loaded everything in /usr/lib/dotnet/shared/Microsoft.AspNetCore.App/6.0.13)

dangercoder 2023-01-15T21:30:02.819319Z

Microsoft.AspNetCore.Builder WebApplicationBuilder is available though but I want the WebApplication class. 😾

Toshik 2023-01-16T09:36:05.252139Z

very interesting, thank you for sharing! How are you going to be hooking routes? via .MapGet etc...? When I was doing this I extended the original Clojure.Main with .Web sdk, and created a wrapper around WebApplication

dangercoder 2023-01-16T10:50:54.389279Z

I’m using .MapGet and delegates. core.async can be used to interop with Tasks

dangercoder 2023-01-16T10:52:43.606769Z

Next step is to remove boilerplate with macros and add e.g. json-> edn support. .NET Core is actually very usable from Clojure, compared to e.g. the java counterpart Spring.

Toshik 2023-01-16T14:18:44.486889Z

are you sharing this work somewhere?

dangercoder 2023-01-16T14:21:01.561499Z

Not yet, once I manage to load the WebApplication class directly from clojure-clr I’ll OSS it 🙂

dangercoder 2023-01-16T23:20:41.851459Z

still no luck. Getting bad type whenever I try to reference (import '[Microsoft.AspNetCore.Builder WebApplication]) . According to packs/Microsoft.AspNetCore.App.Ref/6.0.13/ref/net6.0/Microsoft.AspNetCore.xml the Microsoft.AspNetCore.dll contains the WebApplication dll.

dangercoder 2023-01-14T23:50:02.180429Z

Think I found the error. Microsoft.AspNetCore.Http is a partial class. In order to load HttpContext I need to load more dlls.

dangercoder 2023-01-14T23:52:41.904629Z

Correct, in order to load Microsoft.AspNetCore.Http HttpContext I need to: (assembly-load-file "/usr/lib/dotnet/shared/Microsoft.AspNetCore.App/6.0.13/Microsoft.AspNetCore.Http.Abstractions.dll") This is cool, now I can build a .net core app via the repl. 🙂

👍 1
🆒 1