Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-04

LLVM (again)

7 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reimar Grabowski

Hi,

I have read the discussions about FPC using LLVM and the reasons against it (which I fully understand and support). But a friend of mine called my attention to this: https://github.com/kripken/emscripten/wiki

From what I have seen this is quite an amazing project. And being in the process of deciding if I port my FPC 3D-Engine to JS or write a new one from scratch this would be the perfect solution if only FPC could create LLVM bitcode. Since I know virtually nothing about compiler development and LLVM and it looks like it would not be easy to use LLVM as a backend I won't be able to change this. But one can always dream.

Greetings
R.

Reply by email

Nikolay Nikolov
to Reimar Grabowski
Reimar Grabowski wrote 8 lines
Hi, I have read the discussions about FPC using LLVM and the reasons against it (which I fully understand and support). But a friend of mine called my attention to this: https://github.com/kripken/emscripten/wiki From what I have seen this is quite an amazing project. And being in the process of deciding if I port my FPC 3D-Engine to JS or write a new one from scratch this would be the perfect solution if only FPC could create LLVM bitcode. Since I know virtually nothing about compiler development and LLVM and it looks like it would not be easy to use LLVM as a backend I won't be able to change this. But one can always dream.

Actually, I think you can write an asm.js code generator for FPC. Going through LLVM isn't necessary.

Nikolay

Reply by email

Sven Barth
Sven Barth wrote 8 lines
Am 19.04.2013 14:02, schrieb Reimar Grabowski: > Hi, > > I have read the discussions about FPC using LLVM and the reasons > against it (which I fully understand and support). But a friend of mine > called my attention to this: https://github.com/kripken/emscripten/wiki If you would have read the discussion about LLVM you would know that emscripten was the reason that it was brought up the last time... ;)

Sorry, it should be "Since you have read ... you should know ..."

Regards,
Sven

Reply by email

Mark Morgan Lloyd
to Sven Barth: Sorry, it should be "Since you have read ... you should know ..." Sven
Sven Barth wrote 10 lines
Am 19.04.2013 14:05, schrieb Sven Barth: > Am 19.04.2013 14:02, schrieb Reimar Grabowski: >> Hi, >> >> I have read the discussions about FPC using LLVM and the reasons >> against it (which I fully understand and support). But a friend of mine >> called my attention to this: https://github.com/kripken/emscripten/wiki > If you would have read the discussion about LLVM you would know that > emscripten was the reason that it was brought up the last time... ;) Sorry, it should be "Since you have read ... you should know ..."

Nah. "Should you have read ... you would know..." unless such conciseness is frowned upon as an attribute of brace-using languages :-) :-)

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Vittorio Giovara
to Mark Morgan Lloyd

On Fri, Apr 19, 2013 at 2:49 PM, Mark Morgan Lloyd <

Show quoted text 19 lines
wrote: Sven Barth wrote: > Am 19.04.2013 14:05, schrieb Sven Barth: > >> Am 19.04.2013 14:02, schrieb Reimar Grabowski: >> >>> Hi, >>> >>> I have read the discussions about FPC using LLVM and the reasons >>> against it (which I fully understand and support). But a friend of mine >>> called my attention to this: https://github.com/kripken/** >>> emscripten/wiki <https://github.com/kripken/emscripten/wiki> >>> >> If you would have read the discussion about LLVM you would know that >> emscripten was the reason that it was brought up the last time... ;) >> >

Hi,
for this particular topic Hedgewars has developed a (simple) Pascal to C converter that enables the graphical engine to work with webgl/html5 using the very tool you mentioned. The demo was working fine but then then something changed in the IDB APIs and so it stopped working (and hasn't yet been updated) but in case you still have a Firefox 14 you can check it out here: http://hedgewars.org/hwjs/hwjs.html

The converter is written in Haskell (yay obscure languages) and is tailored for Hedgewars sources, and only because we use a minimal subset of the Pascal language we can do so. You can check out the tool here https://code.google.com/p/hedgewars/source/browse/?name=webgl#hg%2Ftools%2Fpas2cand a small rtl in C
https://code.google.com/p/hedgewars/source/browse/?name=webgl#hg%2Fproject_files%2Fhwc%2Frtl. Feel free to use it and improve it if you need, it's all GPL2 licensed.

That being said, LLVM or asm.js implemented directly in Freepascal would be awesome :)
Cheers,
Vittorio

Reply by email