On Sun, 2008-11-30 at 23:51 -0600, James Bennett wrote:
> Apologies for bringing this up past the 1.1 feature deadline, but
> since this isn't a feature perhaps it'll be OK :)
> 
> Currently, Django bundles a copy of simplejson[1], at
> django.utils.simplejson. We use this solely in the serialization
> system to support dumping to and loading from JSON fixtures.
> 
> This presents several problems:
> 
> 1. Because we exclusively look for Django's copy of simplejson, we
>    naturally cannot take advantage of bugfixes or performance
>    improvements in simplejson unless/until we integrate them into the
>    bundled copy.

Which typically takes about 10 minutes every few months. Not really too
onerous.

> 
> 2. This in turn creates a maintenance headache and a source of
>    potential bugs (e.g., one found recently by someone using NetBeans
>    to report unresolved symbols[2]).

However, there haven't been any actual bugs that I know of in this. That
particular case is an example file. There's an argument for not shipping
that file at all.

> 
> 3. We constantly get into debates about when and how often to update
>    our bundled copy of simplejson.

Rarely. They're not exactly a huge use of our time.

> 4. We occasionally get into debates over whether Django ought to first
>    search for a system-installed copy of simplejson or for the "json"
>    module (simplejson under a new name) which exists in the Python
>    standard library as of Python 2.6[3].

Again, a pretty rare event. Reasonable consensus has been reached on
that particular issue, since it's not really that controversial about
what to do.

> It is occasionally stated that Django tries, as much as possible, to
> avoid having many dependencies out of the box and, if this is true,
> then bundling simplejson may make sense despite the above problems, as
> it means there's one less piece of software people need to install to
> use Django.
> 
> But this argument doens't really hold water, because we already
> require people to install:
> 
> * A database adapter (unless on Python 2.5+ and using SQLite).
> 
> * PIL, to use ImageField.
> 
> * The Python memcached bindings to use memcached.
> 
> * Perversely, Jing to use XMLField.
> 
> * flup to use FastCGI/SCGI/AJP.
> 
> * A whole pile of stuff to use django.contrib.gis.

So, in other words, for many large cases, using Python 2.5, you need no
extra dependencies (although you left out mod_python -- I can't see a
way to do a serious installation with no extra piece to integrate with
the webserver). We seem to have met our goal there.

> * And, most damning for th case of something that's only bundled to
>   support serialization, PyYAML for YAML serialization.

No, this is not "most damning". Json has very broad usage as a data
tranfer protocol, since web browsers understand it out of the box. YAML
is understood by ... well... not a lot at all. It's a useful protocol,
but minor compared to json. There's not really any great alternative in
practical use to json for transferring stuff over AJAX-style pipes (as
opopsed to the argument of why we don't ship, say, a Javascript library,
where there are large alternatives).

> I'm sure there are more dependencies lurking out there, actually,
> depending on which bits of Django people want to use, but hopefully
> the point is made: any argument based on "Django doesn't have
> dependencies" falls flat, because Django's always had various
> dependencies for the core framework and various others for additional
> functionality.

As few as possible is still a reasonable goal. Zero doesn't have to be
that number. Also, most of your dependencies are optional.

> The only remaining argument I can see against unbundling simplejson is
> that it would break backwards compatibility in the 1.x release
> series.

It also costs us essentially nothing not to do. Will be interesting to
see how people fall out on this, although I really think it's not
particularly necessary at the moment.

Personally, if, in some distant future, we choose to remove it... meh.
But not at all worth worrying about in the near future, as far as I can
see.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to