[TYPO3-dev] TS compiler

Alban Cousinié ace at mind2machine.com
Fri Apr 13 10:02:33 CEST 2007


Hi,

Tell me if I am wrong, but it seems obvious to me that compiling Typoscript
to C would be equivalent to substitute typoscript binaries to PHP on the
webserver, which represents the work of many people for many years and means
recoding Typo3 almost from scratch as well. This is just not realistic.

Typoscript is actually interpreted and translated as a set of PHP commands.
Typoscript is more like an .ini configuration file for Typo3 rather than
being a structured language.

So writing a C compiler for Typoscript actually sounds like a very bad idea
to me, because it is a HUGE work and because it would mean rewriting
important parts of Typo3.

HOWEVER, I often find myself hating typoscript because it keeps failing
silently whenever you mistype the name of a variable. There is also no type
checking on values : you can put a string into an int field and it will, as
usual, fail silently.

I can't count the time lost attempting to debug my typoscripts, commenting
and uncommenting them line by line looking for the error.

So yes there is an important need for a Typoscript syntax and type checker
which would be able to report what error occurred at what line during
typoscript interpretation.

There exists PHP bytecode which can be, if I remember well, executed aside
with regular PHP code. So you could probably compile typoscript to PHP
bytecode which would probably improve execution time and not imply the
rewrite of typo3. This would also, I believe, be an interesting project for
your studies.

Here is such a bytecode compilers :
http://pecl.php.net/package/bcompiler
http://pecl4win.php.net/ext.php/php_bcompiler.dll

Regards,

Alban Cousinié


-----Message d'origine-----
De : typo3-dev-bounces at lists.netfielders.de
[mailto:typo3-dev-bounces at lists.netfielders.de] De la part de Martin
Kutschker
Envoyé : vendredi 13 avril 2007 09:21
À : typo3-dev at lists.netfielders.de
Objet : Re: [TYPO3-dev] TS compiler

Elmar Hinz schrieb:
> Hi,
> 
> currently I learn how to write compilers. As object of my lessons I have
> choosen TypoScript. I can produce the first output now, just the basics of
> the TS grammer for now to parse it into a PHP variable.
> 
> Is there any interest in a TS compile written in C? 

Yes, but there are such issues TS conditions and TS constants. So there you 
have to deal with a "compilation context".

To me the main advantage should be speed.

Masi
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev





More information about the TYPO3-dev mailing list