Difference between revisions of "WebAssembly/Compiler"

From Lazarus wiki
Jump to navigationJump to search
Line 36: Line 36:
  
 
Extract the binaries and put them somewhere in your path.
 
Extract the binaries and put them somewhere in your path.
 +
==wasm-demo==
 +
Wasm-demo (https://github.com/skalogryz/wasm-demo) is a Pascal WebAssembly demo project, ported Google's C WebAssembly example (https://codelabs.developers.google.com/codelabs/web-assembly-intro)
 +
 
==See Also==
 
==See Also==
 
*[[WebAssembly]]
 
*[[WebAssembly]]
 
[[Category:WebAssembly]]
 
[[Category:WebAssembly]]

Revision as of 19:28, 21 September 2019

Instructions

Compiling the compiler

Get the sources:

 git clone https://github.com/skalogryz/freepascal fpc-wasm

switch to correct branch:

 cd fpc-wasm
 git checkout webasm

compile:

 cd compiler
 

Using Lazarus

 open ppcwasm.lpi

hit the "compile" button.

Using command-line
 fpc -dnoopt -dwasm -Fiwasm -Fuwasm -Fusystems -S2 pp.pas 

the compiler can be renamed

 mv pp ppwasm

or, on windows:

 mv pp.exe ppwasm.exe

Using the compiler

You need a system.pas unit. It can be found here:

wasm-demo

You'll also need the wasm tools:

wasm tools

Extract the binaries and put them somewhere in your path.

wasm-demo

Wasm-demo (https://github.com/skalogryz/wasm-demo) is a Pascal WebAssembly demo project, ported Google's C WebAssembly example (https://codelabs.developers.google.com/codelabs/web-assembly-intro)

See Also