[Zope] Editing DTML Methods with Emacs ?
LD Landis
ldl@LDL.HealthPartners.COM
Thu, 9 Sep 1999 06:35:25 -0500 (CDT)
Hi,
Paul Everitt wrote:
> Two observations:
>
> 1) Does the XML Export accomplish roughly what you want? Namely, a
> mostly-text representation that can be round-tripped.
Probably good enough... I haven't had enough experience reading
code in this way yet to really say for sure.
>
> 2) What do you do when your source can also have state? That is, your
> source is stored as a rich object in a database, and can have run-time
> settings (permissions, properties, etc.). Uou are asking for both your
> source *and* your database to exhibit the above.
>
> Thus, can you name a database system that doesn't "get your goat"?
>
;-)
I guess that what I am asking for is to have a full decodable encoding of
whatever is "current"... If the XML is too obscure (in detail and
nesting) then we need something to abstract things to a higher level...
I sort of think of XML as being the "assembly language" representation...
need a "higher level" language... sort of byte code vs Python).
> > In reading Paul's reply, I am reminded of what /proc does... (To my
> > knowledge) nothing in /proc is a "real" file, but open(), read() etc
> > don't seem to notice that. Likewise, the "source" interface to ZOPE
> > could have an ftp (or even 'mountable filesystem') "appearance" for the
>
> I'd love for someone to write a mountable filesystem for Zope, but I'm
> not sure how much it would help. Zope has a lot of semantics that stat
> doesn't cover.
Right, and these semantics could (possibly) be presented in the form of
pre/post contract conditions for the explicit purpose of correctly
hooking the imported object into the database "circuit" correctly. (More
on this below).
> The problem here isn't how to get the object. The problem is how to
> express the object once it is gotten in a way that old-style,
> file-oriented programs and protocols (e.g. Emacs and ftp) can still
> participate.
Well, that's what the additional specifications do... If these can all be
gathered together in one area, then one can safely "ignore" them (e.g.
like a mail header is generally "hidden" from the e-mail user unless a
"display headers" setting is enabled), sort of pattern it after a mail
message perhaps:
<requirements>...</requirements>
<body>...</body>
If you have an integrated editor, then the <requirements> which has
acquisition linkage, etc, would be "hidden", and only the <body> would
be modifyable.
> The problem, and the goat :^), are as much with all the editors in the
> world and their protocols as it is with Zope. I could easily change
> your goat to say "All editors and IDEs should work with the web object
> model." :^)
Yes, that would be a logical interface to define, for those wishing to be
"integrated".
> > navigational/organizational aspects (object hierarchy). The contents of
> > each object (IMO) *must* have a source code representation, which is fully
>
> Again, do you make the same demand of Oracle/MySQL? If so, how do they
> accomplish it?
Actually, yes... What they are missing natively, we are adding what we
feel we need (metadata) to manage our diverse environment... Pretty basic
at this point (not even capable of representing all of the stuff that we
capture for eventual contents).
Actually, Oracle export files contain everything I need to recreate the
database... So, relative to Oracle, things are cool, IMO... I can get
out what I put in... Would I like improvements over exp? Absolutely!
But, it is mostly adequate (looses comments and other useful stuff).
> > capable of representing all aspects of the object, but in a "conventional"
> > format (not XML).
>
> Please name the format you're thinking of. If you ask nearly anyone on
> this list, "Name the standard for clear-text encoding of dynamic
> content", I imagine XML would get the most votes. I personally can't
> think of many other choices. Perhaps we could use the Python text-based
> pickle format. :^)
I am not thinking of a specific format, per se... Sort of had in mind
that the existing XML (with addition attribution for linkage,etc) would
serve as the "assembly language" representation. Then the "higher level"
representation would allow for a more "conventional" representation.
Think of how (well formed) byte code and Python source map to one
another. There's lots more stuff in the byte code than appears in the
Python source.
>
> > The fact that XML is capable of representing everything in ZOPE, it seems
> > that a suitable set of DTD/mapping/magic would render (decode) any ZOPE
> > object into a 'suitable' (<retronym>human</retronym> language independent)
> > source code, and could drive a "compiler" that would translate (encode) a
> > source back into the internal object structure.
>
> Are you suggesting we use an existing language and parser, or invent a
> new one? If the former, which one?
Probably a new one that is based on being DTD driven (a DTD that drives
the translation between XML and the target, not the XML DTD).
> > Essentially, what I am suggesting would be to add a layer between people
> > and the existing XML interface, where there is a 1:1 relationship between
> > each "source code construct" and each "object structure construct".
> >
> > ftp | /--->Encoder-->\
> > fs |Source- | --XML--ZOPE
> > etc | Code \<---Decoder<--/
> > \
> > DTD/mapping/magic
> > (vulgar localizations)
>
> XML is that layer. Whatever you've invented would replace XML, which
> would serve no purpose in the above diagram.
Not replace, augment... Much as Python is an abstraction over byte code
(which is XML in this context).
> > In fact, this interface notion would be useful regardless of the "source"
> > code, even XML. Maybe I am missing something, but it seems to me that the
> > XML encode/decode interface is mostly (if not completely) done. The
> > questions that I have are:
> >
> > 1. How well does the import/export function deal with 'partial' trees
> >
> > It seems to me that this is important for working on a single
> > ZOPE instance, or collection of instances, irrespective of
> > the hierarchy from which they may have been selected.
>
> It handles it, I believe.
Not surprised ;-)
> > 2. Can the acquisition expectations (of an object) be stated, or
> > explicitly encoded so that the encoding of an object more or less
> > 'stands alone' (that is, acquisition expectations be identified by
> > name so that any willing supplier of that name is acceptable.
> >
> > This is probably currently a weak link because (from what
> > I've seen, the XML representation is accomplishing the
> > encoding of these dependencies by "nesting" the specs.
> > IMO, the dependencies need to have explicit encoding
> > rather than a "inclusive scoping" (akin to what we have
> > in explicit transistors vs nested gates, or explicit gates
> > vs nested chips, in a circuit).
>
> Hmm, perhaps you could make a specific proposal? The design goal of
> acquisition was to make it transparent. If instead we take it in a
> direction where people have to use different syntax, and know it is
> there, then that would take it out of the hands of non-programmers.
Right, just as the scoping rules of Python are transparent in Python,
but explicit in byte code... I realize that I'm arguing for a backward
"detailing" (less abstract) to the rest of the argument, but this is
probably necessary since someone has to be "explicit"... Also, this
information could be carried in the <requirements> specification that is
not seen by an IDE or an "aware" editor... Sort of along the "resource
fork" idea? Separate, but together. The <body> may be broken to useless
without its <requirements> "fork".
> In summary, I think it is doubtful that you could invent a language that
> would improve on XML and gain wide acceptance. Perhaps it's worth a
> shot, so the best I can say is, good luck!
At the level of XML, I agree... However, for what I am suggesting, the
point is, no one would necessarily have to agree on "the language"...
only on the mechanism for specifying a language.
I'd have the ability to create custom "shorthand" languages that are
easily mapped into the "virtual ZOPE machine language".. Even a
"graphical" language. (A case in point... I developed a "finite state
machine language" that allowed developers to use either a graphical
drawing tool or a source code interchangably, either way at any time.
I had to make sure that the "language" and the "drawing tool" were both
capable of fully representing my internal representation (which included
where the "bubbles" and "arcs" were placed). Maintenance could be done
by either "programming" or "drawing" modes.
Also, if I had my special language based in English, and someone wanted
to make a Spanish/Italian/Esperanto version of the same language
(transliteration of a grammar rather than a different grammar), all that
would be needed is the mappings. The semantic processing to/from
XML/target would remain constant.
Presently, I'm "running for the ZOPE bus" that has temporarily stopped
beside the curb (busily documenting, right?) while waiting for those
running along side trying to catch up.
> --Paul
>
> _______________________________________________
>
--
Cheers,
--ldl
-----------------------------------------------------------------------------
LD Landis ldl@HealthPartners.Com N0YRQ Voice 612/883-5511 Fax 612/883-6363
HealthPartners, 8100 34th Avenue So, PO Box 1309, Minneapolis, MN 55440-1309
Shape your life not from your memories, but from your hopes. (Borrowed)
-----------------------------------------------------------------------------