clr

dmiller 2023-04-04T14:08:52.941219Z

The porting blues: When you are trying to port a library from JVM to CLR, the file you're looking at has 14 regular expressions, and the first example you look at has the variant behavior JVM:

(re-find #"^(--[^ =]+)(?:[ =](.*))?" "--beta")  ; => ["--beta" "--beta" nil]
CLR:
(re-find #"^(--[^ =]+)(?:[ =](.*))?" "--beta")  ; => ["--beta" "--beta" ""]
So there is a test that fails on exactly that third value. And you ask yourself: Do I change the test to succeed with "" instead of nil? Do I test that third item at the point of generation and do a replacement there? Do I look for another line of work? And thinking about the other 13 regular expressions, you contemplate returning to bed. Because you know the rest of the day will have regular expressions of expletives.

1
🙏 1
😅 3
Frank Henard 2023-04-04T14:16:18.119879Z

> Do I look for another line of work? 😆 Makes me curious though... Are you able to do this as part of your full-time job?

dmiller 2023-04-04T15:05:11.784619Z

In the past, not part of my full-time job. This work was always on the side. Now I'm transitioning to semi-retirement. So I have more time to spend on this. A little bit of the ClojureCLR work paid. (And a shout-out to my Github sponsors while we're here.) But mostly the ClojureCLR stuff, ClojureCLR.Next in particular, is still on the side. There's just more 'side' now.

👍 1
Frank Henard 2023-04-04T15:06:10.063719Z

Ok, cool. Thanks for what you're doing!

dmiller 2023-04-05T03:07:29.287879Z

It turned out okay. Most of the regexes were fine. I now have a working port (at least the test suite passes) of tools.cli.

Frank Henard 2023-04-04T21:28:13.483959Z

Was having a conversation in another slack workspace... Anyone ever thought of the pros and cons of implementing Clojure in Haxe (goal of the language is cross-vm, with most of the major ones targeted)?

Frank Henard 2023-04-08T20:12:41.965549Z

@bobcalco, I was just rereading your reply > JVM has gotten closer to becoming that VM over the years I wonder if that has anything to do with Brian Goetz liking Clojure: https://youtu.be/GedrGWu16_I

1
Frank Henard 2023-04-04T21:29:04.401889Z

One possible concern is that Haxe is not widely adopted, and that might make it non an ideal target

dmiller 2023-04-05T03:05:18.335499Z

I've not heard any discussion of it, but I don't get out much.

👍 1
bobcalco 2023-04-05T11:39:56.271689Z

My opinion is that everywhere a virtual machine is, Clojure should be. Moreover I am of the opinion that some day a virtual machine will exist that was built to be Clojure's natural host, i.e., optimized for its FP and concurrency features. JVM has gotten closer to becoming that VM over the years, and CLR has growing potential as it matures; but really none of them are quite that, yet. BEAM's concurrency model makes it an awkward fit despite otherwise excellent FP design--and it deserves more attention. JS... ugh, don't get me started.

👍 1
💜 1
Frank Henard 2023-04-05T13:02:44.468609Z

On this topic, @phillip.klinefelter mentioned this article https://simongray.github.io/essays/spread.html > the different Clojure implementations retain the same level of access to the underlying machine that the languages whose runtimes they leech off (Java, C#, JavaScript) do. > > That makes Clojure powerful. I wonder if the layer of abstraction that Haxe adds on top of the ultimate target VM would only serve to hinder interacting with the host language in that VM

bobcalco 2023-04-06T01:56:34.571469Z

The key would be to target HashLink: https://hashlink.haxe.org/

👍 1
Frank Henard 2023-04-06T14:44:32.972989Z

@bobcalco My original motivation to implement Clojure in Haxe (compile to Haxe) is my thought was that it would apparently be cross-platform automatically. Do you not think that's realistic?

Frank Henard 2023-04-06T14:44:57.272729Z

Also, thanks for that. I didn't know HashLink existed

Frank Henard 2023-04-06T14:45:53.029759Z

I guess maybe it would be a matter of creating a Clojure interpreter in Haxe, and that would be automatically cross platform. Not sure exactly the distinctions