From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luiji Maryo Newsgroups: gmane.lisp.guile.user Subject: Re: My Project: Guile Hypertext Preprocessor Date: Thu, 12 Aug 2010 14:49:17 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e0cb4e887a29cc8214048da4d21d X-Trace: dough.gmane.org 1281639195 773 80.91.229.12 (12 Aug 2010 18:53:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Aug 2010 18:53:15 +0000 (UTC) To: Guile Mailing List Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Aug 12 20:53:13 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ojcrq-0002Pz-Vh for guile-user@m.gmane.org; Thu, 12 Aug 2010 20:53:13 +0200 Original-Received: from localhost ([127.0.0.1]:48416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ojcrk-0004OG-DL for guile-user@m.gmane.org; Thu, 12 Aug 2010 14:51:00 -0400 Original-Received: from [140.186.70.92] (port=41641 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ojcr3-0003eF-No for guile-user@gnu.org; Thu, 12 Aug 2010 14:50:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ojcq7-0002xB-9u for guile-user@gnu.org; Thu, 12 Aug 2010 14:49:20 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:61570) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ojcq7-0002x6-4u for guile-user@gnu.org; Thu, 12 Aug 2010 14:49:19 -0400 Original-Received: by vws16 with SMTP id 16so1047379vws.0 for ; Thu, 12 Aug 2010 11:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=1wdRUDjT+G4pHWvP1hNMa+Ra1F3XQj52XLNpIEBe2hU=; b=pamaNxpXmy+2T4JeLaN+hW1ETk81Q6mIKN7dXN+0xGkj6rKZoi/ltzvrFj9pzvIl5j wkG10Qx+wM6CZxZCh0XZxpY38Or3gKWF3d8OozSoYSH11lhbytuFukNpVtAeFPJj4Wx2 aBfa7oj4BpQM1oV1q63NLI9+8n1bBQdZKvICM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=UDZAuJ+/e+5naaEugf8r5xBejRKTUo/tEjelj/2SVoiR0Pm2vfzi3p6/CGbzos/3/0 62ZW71y73PIZ4J39u9kTk/dNtuQtrP+Nmt5C186sjY26NIB5RvLe7wiC74Un3DuimwdD 5f7TeKm4R2SZb8ftt5d6S7BIVoOPLQsd44HBM= Original-Received: by 10.220.61.202 with SMTP id u10mr400187vch.15.1281638957613; Thu, 12 Aug 2010 11:49:17 -0700 (PDT) Original-Received: by 10.220.97.145 with HTTP; Thu, 12 Aug 2010 11:49:17 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: Lr-ndEhRlNia_UusRrBVHUyfKt4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8059 Archived-At: --e0cb4e887a29cc8214048da4d21d Content-Type: text/plain; charset=UTF-8 Hm...I've just realized a few problems with how I've structured this. For one thing, the Guile and Perl interpreters would not be able to evaluate just one section of code at a time, because:: - Guile would output "guile> " every line, which would appear in the output. - Perl would require an EOF in order to run the program, which would also end with the state being lost, which is unacceptable. The second problem is that the script would not be able to do cool things like allow editing HTTP headers like in PHP since the programs could not properly communicate with MHP (Multi-lingual Hypertext Preprocessor as it is currently named), thus giving PHP a major advantage. I have come up with a resolution to both of these problems: languages are not referenced by interpreter like [interpreter="/usr/bin/env guile"], it would instead need a plugin-based system so that [language="Guile"] would be translated by a plugin registered by "/usr/lib/mhp/interpreters/Guile.so". How would this solve the problem? Well you see, the interpreter would:: - Be able to evaluate single lines while retaining state. - Be able to communicate with MHP to send messages like "mhp_set_header('content-type', 'text/plain')". This would add a lot more power to MHP, but would also require a plugin for each available language. I currently see no alternative, but anybody may feel free to suggest one. -- Luiji On Wed, Aug 11, 2010 at 10:57 PM, Linas Vepstas wrote: > On 11 August 2010 19:12, Luiji Maryo wrote: > > Hello, > > > > (define title "My Title") > > (define user "CoolDude1024") > > ?> > > > > <?g (write title) ?> > > > >

> > How are you doing today, > > > I was wondering if anybody had any suggestions on this concept before I > get > > too far through coding it. > > For what its worth, there is an implentation of something like > this inside of gtt, the gnome time tracker. It uses html so that > users can write customized reports & layouts, while pulling > actual data from the inside of the time-tracker engine. > > At one point, gnucash was supposed ot do something similar, > too, for its reports/graphs, but I am not sure what actually > happened there. > > I really like the general idea, I think it was under-utilized by > most of the desktop-application apps. > > --linas > -- - Luiji Maryo (a.k.a. Brain Boy) Visit me at http://brainboyblogger.blogspot.com/. --e0cb4e887a29cc8214048da4d21d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hm...I've just realized a few problems with how I've structured thi= s.

For one thing, the Guile and Perl interpreters would not be able = to evaluate just one section of code at a time, because::
=C2=A0- Guile = would output "guile> " every line, which would appear in the o= utput.
=C2=A0- Perl would require an EOF in order to run the program, which would = also end with the state being lost, which is unacceptable.

The secon= d problem is that the script would not be able to do cool things like allow= editing HTTP headers like in PHP since the programs could not properly com= municate with MHP (Multi-lingual Hypertext Preprocessor as it is currently = named), thus giving PHP a major advantage.

I have come up with a resolution to both of these problems: languages a= re not referenced by interpreter like [interpreter=3D"/usr/bin/env gui= le"], it would instead need a plugin-based system so that [language=3D= "Guile"] would be translated by a plugin registered by "/usr= /lib/mhp/interpreters/Guile.so".

How would this solve the problem?=C2=A0 Well you see, the interpreter w= ould::
=C2=A0- Be able to evaluate single lines while retaining state.=C2=A0- Be able to communicate with MHP to send messages like "mhp_s= et_header('content-type', 'text/plain')".

This would add a lot more power to MHP, but would also require a plugin= for each available language.=C2=A0 I currently see no alternative, but any= body may feel free to suggest one.

-- Luiji

On Wed, Aug 11, 2010 at 10:57 PM, Linas Vepstas <linasvepstas@gmail.com> = wrote:
On 11 August 2010 19:12, Luiji Maryo <luiji@users.sourceforge.net> wrote:
> Hello,

> <?g
> =C2=A0 (define title "My Title")
> =C2=A0 (define user "CoolDude1024")
> ?>
> <html>
> <head><title><?g (write title) ?></title></= head>
> <body>
> <h1><?g (write title) ?></h1>
> How are you doing today, <?g (write user) ?>

> I was wondering if anybody had any suggestions= on this concept before I get
> too far through coding it.

For what its worth, there is an implentation of something like
this inside of gtt, the gnome time tracker. =C2=A0It uses html so that
users can write customized reports & layouts, while pulling
actual data from the inside of the time-tracker engine.

At one point, gnucash was supposed ot do something similar,
too, for its reports/graphs, but I am not sure what actually
happened there.

I really like the general idea, I think it was under-utilized by
most of the desktop-application apps.

--linas



--
- Luiji Maryo (a= .k.a. Brain Boy)
Visit me at http://brainboyblogger.blogspot.com/.
--e0cb4e887a29cc8214048da4d21d--