[fpc-devel] Summer of code collaboration

Sven Barth pascaldragon at googlemail.com
Sun Feb 10 11:09:38 CET 2013


On 09.02.2013 14:40, Florian Klämpfl wrote:
> Am 09.02.2013 03:13, schrieb Vittorio Giovara:
>> To do that we are using a tool
>> named 'emscripten' which takes LLVM bytecode and generates Javascript,
>> without affecting performance too much. Yes, we had to write a horribly
>> hacked converter that took the small subset of Pascal used by Hedgewars
>> and convert it to C (on a side node, the converter is written in
>> Haskell) and reimplement the RTL.
>
> I still don't understand what's the use of generating LLVM code in
> between instead of generating directly Javascript ... The process
> pascal->llvm->js looks as well very fragile to me.

Having a LLVM backend would not only benefit HedgeWar's JavaScript case, 
but also all others that would like to use the LLVM backend for one 
purpose or the other. And in my opinion a pure JS backend would be much 
harder to implement than a LLVM backend as one also needs to think about 
how certain things should be implemented in JS (which the emscripten 
developers already thought of).

Regards,
Sven




More information about the fpc-devel mailing list