ANN: Potemkin 0.3.0

Visto 500 veces
Saltar al primer mensaje no leído

Zach Tellman

no leída,
19 jun 2013, 15:12:4119/6/13
a clo...@googlegroups.com
Potemkin [1] is a collection of facades and utilities that I've found helpful when writing larger-scale libraries or applications.  I've never formally announced it before, but I think it's gotten to the point where others can benefit from it.

A few highlights:

* 'def-map-type', which allows for the definition of custom map-like objects with 10x less code
* 'unify-gensyms', which allows for more concise nested syntax-quotes
* 'import-vars', which allows for code sprinkled across multiple namespaces to be exposed via a single namespace

It's been pointed out before that ideally a library should have no dependencies but Clojure itself, or we risk transitive dependency conflicts when everyone uses different versions of a utility library.  In deference to this, Potemkin is licensed such that any piece of code can be simply pasted into your library, as long as there's a comment describing the origin.

If anyone has questions, I'm happy to answer them.  If anyone has moral or aesthetic objections to 'import-vars', you're not alone, but please remember you're under no obligation to use it.

Zach

Zack Maril

no leída,
19 jun 2013, 15:29:1619/6/13
a clo...@googlegroups.com
We've been using Potemkin inside Titanium, Ogre, and Archimedes. It works well for importing functions, but I'm about to do a rewrite of Titanium and Ogre because of complications arising from being clever with importing dynamic vars. I would caution against trying to import dynamic vars (or functions that rely on dynamic vars) between libraries. 
-Zack

Matthew Chadwick

no leída,
19 jun 2013, 21:47:2619/6/13
a clo...@googlegroups.com
If anyone has moral or aesthetic objections to 'import-vars', you're not alone, but please remember you're under no obligation to use it.

I used lein-clique to make a graph of Lamina's dependencies (huge PNG), but the use of import-vars caused several mirrored subgraphs which I don't really know how to filter out. 

Jason Wolfe

no leída,
19 jun 2013, 23:38:3219/6/13
a clo...@googlegroups.com
We're starting to use potemkin at Prismatic, and the part we've found most useful which Zach didn't mention in his post are the smart types.  Especially definterface+, which is like a love child of defprotocol and definterface:
 - Same syntax as defprotocol, and defines functions in your namespace that wrap the interface functions (without extend-protocol support, obviously)
 - Allows for primitive arguments and return values (like clojure.core/definterface), which are propagated to the wrapper functions for maximal performance
 - Doesn't re-evaluate if the body has not changed, which can make repl development less painful (especially when used with its defrecord+ counterpart).

Dave Sann

no leída,
14 sept 2014, 3:53:4714/9/14
a clo...@googlegroups.com
Does Potemkin work well with clojurescript?

I have seen some discussion of issues in some places. Is there anywhere that notes challenges?

I am particularly interested with the import-vars scenario (defining namespaces separately and then merging definitions into one namespace for usage).

Dave

Dave Sann

no leída,
16 sept 2014, 3:30:4716/9/14
a clo...@googlegroups.com
to answer my own question. It does not play well. I created a couple of simple macros that mimics the import-vars behaviour for fns and vars in clojurescript. 
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos