Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Clojure CLR #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brandoncorrea
Copy link

@brandoncorrea brandoncorrea commented Oct 21, 2024

  • Add deps-clr.edn
  • Add reader conditionals for :cljr
  • Add GitHub Workflow step for Clojure CLR tests
  • Update README with placeholder for Clojure CLR installation
    • This will need to be updated once a new :git/tag / :git/sha is added

With this change, it may (or may not) be worth removing the ports section from README.md.

Copy link
Owner

@weavejester weavejester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this! I've reviewed the code and have some changes/suggestions. Once we're done with that we'll need to clean up the commit history a little as well.

.gitignore Outdated Show resolved Hide resolved
src/medley/core.cljc Outdated Show resolved Hide resolved
src/medley/core.cljc Outdated Show resolved Hide resolved
src/medley/core.cljc Outdated Show resolved Hide resolved
test/medley/core_test.cljc Outdated Show resolved Hide resolved
test/medley/test_runner.cljr Outdated Show resolved Hide resolved
@brandoncorrea
Copy link
Author

@weavejester The PR has been updated to include all your recommendations, except for those regarding test_runner.cljr and commit history. How would you like these addressed? Should commits just be squashed into a single "Add support for Clojure CLR" commit?

@tomdl89
Copy link
Contributor

tomdl89 commented Oct 27, 2024

I'm assuming after this PR is merged, all future additions will need to consider CLR compatibility? The state of Clojure survey reports that about 1% of respondents use it (compared to about 99% Clojure and 65% Clojurescript), and a port does exist. Maybe a conversation instigated this which I've missed? But if not, I wonder if one is worth having? As a contributor with no interest in CLR, I worry this will dissuade me (and others) from contributing in the future. Why not update (and continue to maintain) the port?

@brandoncorrea
Copy link
Author

I'm assuming after this PR is merged, all future additions will need to consider CLR compatibility? The state of Clojure survey reports that about 1% of respondents use it (compared to about 99% Clojure and 65% Clojurescript), and a port does exist. Maybe a conversation instigated this which I've missed? But if not, I wonder if one is worth having? As a contributor with no interest in CLR, I worry this will dissuade me (and others) from contributing in the future. Why not update (and continue to maintain) the port?

Great question. I considered updating the CLR port, but decided to go this route for several reasons:

  1. The repo hasn't been touched in 2 years (probably due to the small number of CLR developers).
  2. Forked repos will always be chasing changes to the root repo. Keeping them in the same repo allows us to reuse everything.
  3. The dependency paths are different. If I have a CLR/CLJS project, for example, this forces me to have two separate dependencies, whether in a :cljr / :cljs alias, or in a separate deps.edn / deps-clr.edn. With everything in the same repo, I can share the dependencies with something like io.github.weavejester/medley {:git/tag "1.8.1" :git/sha "ef3a8ff"}.

While this does add a little extra work for contributors, the translations are quite simple. I believe the time I spent adding reader conditionals to the entire repository was maybe an hour or two. Scaling this down to only future changes, I imagine time spent thinking about cljr will be negligible, especially with many of these functions knowing nothing about the platform they run on.

I'm happy to move this PR over to the CLR port of medley, but I'll wait on @weavejester for that directive.

@tomdl89
Copy link
Contributor

tomdl89 commented Oct 27, 2024

@brandoncorrea thanks for the answer. FWIW I'm not convinced the advantages you list outweigh the disadvantages (at least when weighted by number of those affected) but of course it's @weavejester 's call. Cheers

@brandoncorrea
Copy link
Author

@tomdl89 Unofficial support of Clojure CLR may also be worth considering. This way, future contributors need not concern themselves with CLR. If there happens to be a release that doesn't fully support CLR and somebody wants those changes, they may contribute that those changes and see those in following releases.

@weavejester
Copy link
Owner

@tomdl89's observation is a good one, and certainly why I've rejected CLR ports in the past. However, there are a couple of differences in this case that make me more amenable to including this:

  1. The GitHub action provides an easy way of checking compatibility.
  2. It doesn't appear that many functions require much change.
  3. It doesn't require many additional files, and it can be easily run under Linux/MacOS.
  4. The pace of new functions being added to Medley has slowed down considerably.

New functions being added to Medley are rare enough these days that I don't think mind the overhead of helping getting them working with ClojureCLR, especially now I have ClojureCLR and cljr running on my Linux machine.

I'll give this a little more thought, but my inclination is that in this case it's a reasonable inclusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants