what's so difficult about namespace?

Xah Lee xahlee at gmail.com
Wed Nov 26 18:28:51 EST 2008


Dear Kaz Kylheku,

your post is too much verbiage and enthusiasm.

Why? because you went into the la la land of philosophy.

Although, i do think you did give some good exposition on your views.

Now, let me detail some analysis of your post.

In summary, you are saying a few things about namespaces, for example,
you gave some reasons javascript doesn't really need namespaces that
much, and in general, your thesis is that although lack of namespace
is bad, but overall it's ok, and the pain of adding namespaces is more
than the problem it solves. You cite C and linux, and some joe blog's
philosophy on the multi-core crisis as support.

On the whole, given your post as is, i don't disagree with your
general point of view. However, you seem to went onto your own gripe
about alarmists, by the magic of vodoo speak and future-predicting
formula, wantonly applied it to the namespace “crisis”. And in the
process, you seems to brush it off, almost sounding like lacking
namespace is a none-problem.

Nobody is saying that lacking namespace is a CRISIS. But it is a
problem, a problem that is rather seriously, practically, hampering
software development, in PHP, in Scheme Lisp, in Emacs Lisp, a widely
acknowledged problem by programers in these communities, counting
myself. Nobody is saying that linux development is crumbling just
because C lacks namespace. Nobody is saying that human animal couldn't
land on the moon when people are still using slide rules and punch
cards. (note that the issue proper of this thread is about technical
issues of introducing namespace into a existing lang. Am not accusing
you of derailing, but just pointing out a background fact.)

Can you see, how you latched your personal beef about anti software
crisis philosophy into this no namespace thread?

In your fervor to dispel the software crisis beliefs, you painted a
picture that lacking namespace in C, Javascript, Emacs Lisp, Scheme
Lisp, PHP, as trivial, unimportant, none problems.

Do you actually, seriously, believe, that lacking namespaces in these
languages is not a problem? Sure, if a programer got a accident and
fell into a manhole and broke his legs, i bet he can still live long
and program well. But that doesn't mean being a cricrublempple is
cool, right?

In your hot haste, you got a few things factually wrong too.

• Javascript, although used in browser mainly, but that is not its
only use. It has huge potential as a general purpose lang. It is
adopted here and there as the scripting lang. Check out Wikipedia on
it. It lists about 20 such adoptions by various tech or software app
as scripting lang.

• You mentioned that adding prefix is a workable solution. Yes, but
only to some extent. For example, in elisp, it lacks lexical scoping,
lacks closure, and its manual suggest that names shouldn't be more
than 32 chars. These, seriously put a dent on the workaroundibilities
of the no namespace problem. I do a lot emacs lisp scripting, i
already felt the pain. Steve Yegge in his blog, for his work of
implementing javascript interpreter in elisp gave detail. Similarly,
lacking namespace in PHP is also a major, practical, problem to web
app developers. Scheme lisp's lack of namespace is also a major sore
point, being one of its major problems that in their view prevented
them from going outside of academia. These are not just made-up
scenarios. These are widely acknowledged, practicality oriented,
problems. Yeah sure, you can always find some workaround, and the
world won't crumble by it, just like cripples and dumb and blind can
all still lead a happy and fruitful life.

There is no crisis!

  Xah
∑ http://xahlee.org/

☄

On Nov 26, 1:32 pm, Kaz Kylheku <kkylh... at gmail.com> wrote:
> On 2008-11-26, Xah Lee <xah... at gmail.com> wrote:
>
>
>
> > comp.lang.lisp,comp.lang.functional,comp.lang.perl.misc,comp.lang.python,co mp.lang.java.programmer
>
> > 2008-11-25
>
> > Recently, Steve Yegge implemented Javascript in Emacs lisp, and
> > compared the 2 languages.
>
> >http://steve-yegge.blogspot.com/
> >http://code.google.com/p/ejacs/
>
> > One of his point is about emacs lisp's lack of namespace.
>
> > Btw, there's a question i have about namespace that always puzzled me.
>
> > In many languages, they don't have namespace and is often a well known
> > sour point for the lang. For example, Scheme has this problem up till
> > R6RS last year.
>
> Scheme hasn't officially supported breaking a program into multiple files until
> R6RS. If the language is defined in terms of one translation unit, it doesn't
> make sense to have a namespace feature.
>
> > PHP didn't have namespace for the past decade till
> > about this year. Javascript, which i only have working expertise,
> > didn't have namespace as he mentioned in his blog.
>
> Javascript programs are scanned at the character level by the browser as part
> of loading a page.  So there are severe practical limitations on how large
> Javascript programs can be.
>
> Namespaces are useful only in very large programs.
>
> > Elisp doesn't have
> > name space and it is a well known major issue.
>
> C doesn't have namespaces, and yet you have projects like the Linux kernel
> which get by without this.
>
> Given that the Linux kernel can do without namespaces, it's easy to see how
> Javascript and Elisp can survive without it.
>
> > Of languages that do have namespace that i have at least working
> > expertise: Mathematica, Perl, Python, Java. Knowing these langs
> > sufficiently well, i do not see anything special about namespace. The
> > _essence_ of namespace is that a char is choosen as a separator, and
> > the compiler just use this char to split/connect identifiers.
>
> The essence of a true namespace or package system or whatever is that you can
> establish situations in which you use the unqualified names.
>
> You can emulate namespaces by adding prefixes to identifiers, which is
> how people get by in C.
>
> In C, you can even get the functionality of short names using the preprocessor.
>
> I have done this before (but only once). In a widely-used public header file, I
> prefixed all of the names of struct members (because struct members are not
> immune to clashes: they clash with preprocessor symbols!)
>
>   struct foo {
>     int foo_category;
>     time_t foo_timestamp;
>     /* ... */
>   }
>
> Inside the implementation module, I made macros for myself:
>
>   #define category foo_category
>   #define timestamp foo_timestamp
>
> In this way, I didn't have to edit any of the code in order to move the struct
> members into the namespace. Expressions like ``pf->category'' continued to work
> as before.
>
> > Although i have close to zero knowledge about compiler or parser, but
> > from a math point of view and my own 18 years of programing
> > experience, i cannot fathom what could possibly be difficult of
> > introducing or implementing a namespace mechanism into a language.
>
> The same things that make it difficult to add anything to a language, namely
> the stupid way in which languages are designed to get in the way of extension.
>
> What would it take to add namespaces to C, for instance?
>
> If you have any proposal for a new C feature, the ISO C people encourage you to
> develop a proof-of-concept, which means: hack it into an existing
> implementation to demonstrate that it's feasible.
>
> If you need new syntax, hacking it into an implementation means hacking it into
> the parser. Everyone who wants to experiment with your feature needs to get
> your compiler patches (for GCC for instance) and rebuild the compiler.
>
> The process is painful enough that it's only worth doing if it solves something
> that is perceived as being a critical issue.
>
> > do not understand, why so many languages that lacks so much needed
> > namespace for so long? If it is a social problem, i don't imagine they
> > would last so long. It must be some technical issue?
>
> I recently read about a very useful theory which explains why technologies
> succeed or fail.
>
> See:http://arcfn.com/2008/07/why-your-favorite-programming-language-is-un...
>
> The perceived crisis which namespaces solve is not sigificant enough relative
> to the pain of adoption.  No, wrong, let's restate that. Programmers do use
> namespaces even when there is no language feature. It's not about adoption of
> namespaces, but adoption of proper support for namespaces.  Not using
> namespaces is a crisis in a software project, but (at least in the perception
> held by many programmers) that crisis is adequately mitigated by using a naming
> convention.  Proper namespaces only address the small remaining vestiges
> of the original crisis.
>
> Thus: the perceived crisis which is solved by properly incorporating namespaces
> into a programming language (rather than living with a prefix-based emulation)
> is not significant enough relative to the perceived pain of adopting proper
> namespaces into the programming language.
>
> However, proper namespaces, if available, are easier to use than prefixed
> identifiers, and not diffcult to adopt. So if someone has gone to the trouble
> of making them available in the programming language, then they do get used.




More information about the Python-list mailing list