<< Back to previous view

[DPRIMAP-8] Add clojurescript support Created: 05/May/15  Updated: 28/Nov/15

Status: Open
Project: data.priority-map
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Daniel Compton Assignee: Mark Engelberg
Resolution: Unresolved Votes: 0
Labels: None


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.

Comment by Mark Engelberg [ 07/May/15 4:14 AM ]

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?

Comment by Tim Visher [ 16/Nov/15 4:00 PM ]

Are we still interested in doing this?

Comment by Mark Engelberg [ 16/Nov/15 11:17 PM ]

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

Comment by Tim Visher [ 17/Nov/15 4:00 PM ]

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

Comment by Tim Visher [ 17/Nov/15 5:24 PM ]

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.


Comment by Mark Engelberg [ 17/Nov/15 11:52 PM ]

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?

Comment by Tim Visher [ 26/Nov/15 6:58 AM ]

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?

Comment by Mark Engelberg [ 28/Nov/15 4:07 PM ]

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

Generated at Sun Nov 29 01:05:00 CST 2015 using JIRA 4.4#649-r158309.