[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My Project: Guile Hypertext Preprocessor

From: Luiji Maryo
Subject: Re: My Project: Guile Hypertext Preprocessor
Date: Thu, 12 Aug 2010 14:49:17 -0400

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/".

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 <address@hidden> wrote:
On 11 August 2010 19:12, Luiji Maryo <address@hidden> wrote:
> Hello,

> <?g
>   (define title "My Title")
>   (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.  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.


- Luiji Maryo (a.k.a. Brain Boy)
Visit me at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]