From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: A Soare Newsgroups: gmane.emacs.devel Subject: Re: Embedding Html in Lisp Date: Tue, 24 Jun 2008 02:32:51 +0200 (CEST) Message-ID: <6343543.567111214267571791.JavaMail.www@wwinf4604> Reply-To: alinsoar@voila.fr NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1214267589 16692 80.91.229.12 (24 Jun 2008 00:33:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Jun 2008 00:33:09 +0000 (UTC) Cc: "Emacs Dev [emacs-devel]" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 24 02:33:52 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KAwTo-0001YT-KL for ged-emacs-devel@m.gmane.org; Tue, 24 Jun 2008 02:33:52 +0200 Original-Received: from localhost ([127.0.0.1]:52015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAwSz-0006h8-7a for ged-emacs-devel@m.gmane.org; Mon, 23 Jun 2008 20:33:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAwSs-0006ee-I0 for emacs-devel@gnu.org; Mon, 23 Jun 2008 20:32:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAwSr-0006eF-Pk for emacs-devel@gnu.org; Mon, 23 Jun 2008 20:32:54 -0400 Original-Received: from [199.232.76.173] (port=55834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAwSr-0006e4-KD for emacs-devel@gnu.org; Mon, 23 Jun 2008 20:32:53 -0400 Original-Received: from smtp3.voila.fr ([193.252.22.173]:63183) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KAwSr-0002SA-38 for emacs-devel@gnu.org; Mon, 23 Jun 2008 20:32:53 -0400 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf4211.voila.fr (SMTP Server) with ESMTP id E3DAE7000084 for ; Tue, 24 Jun 2008 02:32:51 +0200 (CEST) Original-Received: from wwinf4604 (wwinf4604 [10.232.13.31]) by mwinf4211.voila.fr (SMTP Server) with ESMTP id C26DB7000081 for ; Tue, 24 Jun 2008 02:32:51 +0200 (CEST) X-ME-UUID: 20080624003251796.C26DB7000081@mwinf4211.voila.fr X-Originating-IP: [93.112.69.191] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-CC: |~| X-WUM-REPLYTO: |~| X-me-spamlevel: not-spam X-me-spamrating: 40.000000 X-me-spamcause: OK, (-170)(0000)secvtfgvtghiphhivghnthhsucdlqddutddtmdenucdlqddutddtmdenmhhishhsihhnghcuvffquchfihgvlhguucdlfedtmd X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:99814 Archived-At: Thanks a lot for your reaction. You asked very well a question. > A Soare wrote: > >> Html is lisp. > >> > >> You dignify html a lot more than it deserves! > >> =20 > > > > With the classical definition of HTML , yes. > > > > With the new definition, they can be compared. > > > > =20 >=20 >=20 > Are there any "structured data" languages that you know > of that can *not* be transformed to lisp in a similar way? > In other words, is HTML really special this way? Or > is this a specific instance of a generalized phenomenon? >=20 What is behind of the phenomenon that I discovered here? Good question... The general principle discovered here is:=20 =C2=ABThe class of Markup languages is a subset of functional languages. Every markup language is a very special case of functional language.=C2=BB That says everything. Html is defined as a very simplified functional language. Xml is a simplified functional than html a little different of html. Every markup language is a very simplified example of functional language. To understand this principle, it is easy. Consider a functional language like an implementation of a lambda-calculus, and consider an implementation of a lambda-calculus as an evaluator. Consider lisp evaluator as first example. To interpret html we need a lisp evaluator in which the objects have just 2 types: strings and list (in emacs Lisp the evaluator supports objects of 19 types (from which 12 are Subtypes Lisp_Misc, because the evaluator allocated for type object location just 3 bits)). (using these 2 types we can express everything that html want to express). So HTML evaluator embedded in LISP uses very little from the power of the lisp evalutor. (imagine Edward Scissorhands working to create an html evaluator from a lisp evaluator). So I define html as a functional language defined by an evaluator with 2 types. It does not matter whether the evaluator supports closure property or not and these kind of details. Imagine the tag (center 30 "string"). Do we need a closure property to execute it? What does it have to do? Simple: It knows the width that is allocated for the object that it must return, and it knows the value of the object. So it will create a string in which this object is centered. It will return: " string " (if the string was aligned on a single line) or something like: " string1 " " string2 " " string3 " " string4 " if the string =3D " s1 s2 s3 s4. etc. The same reasoning for XML. For XML we need 3 types (symbol + string + list as I imagine). All these markup languages are very simplified types of functional languages. This is the genetal phenomenon. This is the new definition of html. Is't an element of the class of functional languages. Sorry for not having expressed myself clear from the first message. So I proved that Html deserves so much! It's a simplified lambda-calculus like Lisp! A.S. PS: for the rest of the message I will answer you later or tomorrow. > Code is data and data is code. >=20 > An interesting point of history: one of the very first > lisp programs *ever* did symbolic differentiation. > It would take input like: >=20 > (exp x 2) # x squared >=20 > and produce output like: >=20 > (* x 2) >=20 > That program manipulated the math expressions just as > data. On the other hand, there is no reason you couldn't > have passed one of the expressions to EVAL, e.g., to get > a numeric value from it. >=20 > It would have been inconvenient, though, to try to write > the differentiation program by defining the function EXP > as a function that interpreted its arguments as sub-expressions > and returned the derivative of the overall expression. > (Of course, now some Schemer will be tempted to show > some Scheme macros that do symbolic differentiation but, > that's not the point.) >=20 > By analogy, for some uses it might be handy to interpret > HTML elements as procedure calls. For other uses, it is handy > to interpret them as lists. For still other uses, it is handy to > interpret them as tree objects (e.g., the DOM data structure). >=20 > As for a browser in Emacs: in spite of recent cracks (funny!) bout > "yet another Emacs in Javascript" -- Emacs in a browser might be > a lot easier than a browser in Emacs, judging by how Mozilla > works. E.g., Mozilla parses HTML and build a tree. That tree > acts a lot like an Emacs buffer in the sense that extension programs > can edit the tree abstractly and the display of that tree is automaticall= y > updated. The standards for proper display of a web page are defined > in terms of these trees. By the time Emacs gained enough functionality > to handle such standards, it would resemble a small superset of the > functionality that already exists in Mozilla. Conversely, it is > probably a much smaller job to modify some of the key components > of Mozilla so that they provide all of the functionality of Emacs > buffers and display. >=20 > For the task you describe, though -- a desire not to make a full > browser but to be able to access a few simple web pages from Emacs -- > of course Emacs can handily do that (and it sounds like you are getting > some stuff to start working, so congratulations!). >=20 > -t >=20 >=20 ____________________________________________________ En quelques secondes, cr=C3=A9ez-vous une autre adresse mail ! http://mail.= voila.fr ____________________________________________________ En quelques secondes, cr=C3=A9ez-vous une autre adresse mail ! http://mail.= voila.fr