The Cunctator wrote:
On 7/31/02 3:20 PM, "Jens Frank" JeLuF@gmx.de wrote:
Building an interpreter as mighty as TeX to process formulas is a big task, and using PHP would take very long to parse one formula.
I've hacked the phpwiki code to add a new namespace [[math: ]] so you can write formulas like [[math:a^2+b^2=c^2]] or [[math:\sum_{n=0}^{\infty}\frac{1}{n}=\infty]].
The code will make TeX create an image (PNG) of the formula. Those images will be cached, they will be created only once and will be shared between articles. ( [[math:E=m c^2]] might be used on many pages ).
That's a _really brilliant_ hack -- the idea of using the TeX code as the name of a page is the obvious right thing! We should have a garbage-collector sweep up orphan math: pages every so often. We should also be really cautious about TeX doing insecure things. Is there a subset of TeX syntax we could parse and validate before we pass it to TeX?
Processing one formula took about one minute on a very old 486/DX2, why I didn't submit the code to LDC for review or comments, yet.
The new server should run that code in about 0.5 second on one of its two processors, given typical CPU scaling figures. See http://field.hypermart.net/CPU/cpu.htm