Welcome! Please see the About page for a little more info on how this works.

0 votes
in data.priority-map by

With the upcoming release of Clojure 1.7 and reader conditionals, is there interest in adding ClojureScript support? There is already a port at https://github.com/tailrecursion/cljs-priority-map. Alan Dipert may be interested in donating that to Clojure Core, otherwise I would be interested in working on a port.

10 Answers

0 votes
by

Comment made by: markengelberg

I agree this is worthwhile, and working off of the existing port might help considerably. Do you want to take the lead in asking Alan Dipert and figuring out how to use the reader conditionals effectively to merge the two?

0 votes
by

Comment made by: timvisher

Are we still interested in doing this?

0 votes
by

Comment made by: markengelberg

I am still supportive of the idea, but don't have time to do it myself right now.

0 votes
by

Comment made by: timvisher

Awesome. I'm digging in to this now. I just opened a different issue to try to get line endings together. http://dev.clojure.org/jira/browse/DPRIMAP-9

0 votes
by

Comment made by: timvisher

What would we like to do as far as clojure version support? If we were ok with dropping support for version prior to 1.7 then I could use cljc to target both platforms. If we want to maintain support for prior versions then I'll have to use a different approach.

Thoughts?

0 votes
by

Comment made by: markengelberg

I said in my earlier comment that, "I think it is worthwhile," and that comment was driven entirely by the sense that "cljc is what modern Clojure libs are expected to do". But the more I think about it the more I realize that it's not entirely clear what we gain by merging the clojure and clojurescript versions, especially since this code is almost exclusively about implementing protocols and interfaces that are completely different between Clojure and Clojurescript, so there is very little code in common. It's also unclear, since the code has so little in common, that it will be any easier to maintain or extend the code in one combined file versus two separate files. On top of that, priority map has changed very little in the past several years since its creation, and will likely have very few changes in the future.

Therefore, I'm starting to feel skeptical that it is worth the effort and the risk of introducing bugs, but to the extent that you're interested in exploring this issue, I think cljc is the way to go.

So before you dive into it, let me ask you your opinion: what are the gains of mashing the two files together into one cljc file?

0 votes
by

Comment made by: timvisher

I think it's worthwhile if only because that would give 'official' contrib support to clojurescript. I'm mostly interested in this because I need a priority queue in a project I'm on and I'd also like to experiment with cljc. So this is partly a learning exercise and partly a practical effort.

That said I am quite surprised at how different the type declarations are. I was assuming I'd be able to just swap out some types using #? but the implementations are quite different. I can't decide yet how much of it I'll be able to unify, but I'm hoping it's quite a bit.

So I guess whether you accept it or not I'd like to go through the exercise.

I assume implicit in what you've said above is the acceptance of a minimum supported version of 1.7?

0 votes
by

Comment made by: markengelberg

Yes, I'm fine with a minimum supported version of 1.7.

0 votes
by

Comment made by: alexmiller

FYI, currently our Hudson CI system that is used to do builds of contrib projects cannot build cljc projects. To build, a new version of clojure-maven-plugin is required, which requires Maven 3 for some of the required plugins, which is not supported in the old version of Hudson we're using.

This is fairly high in my priority list as we are already fighting this issue for test.check (and it's only a matter of time before it's needed for others as well). But you might want to hold off till we've addressed this issue.

It is possible to manually build and release projects without the CI server (and I've done this for test.cehck), but it's no picnic.

0 votes
by
Reference: https://clojure.atlassian.net/browse/DPRIMAP-8 (reported by desk@danielcompton.net)
...