Commit 86cf17f8 authored by Camil Staps's avatar Camil Staps 🍃

Add WasmTest example program

parent 7047eada
Pipeline #27634 passed with stage
in 5 minutes and 10 seconds
module WasmTest
import StdEnv
import iTasks
import iTasks.UI.JavaScript
// This is a simple test program to try out things with the WebAssembly ABC interpreter.
Start w = doTasks task w
where
task = updateInformation
(Title "WebAssembly test program")
[UpdateUsing id (flip const) editor]
()
editor :: Editor ()
editor = leafEditorToEditor
{ LeafEditor
| genUI = withClientSideInit initUI genUI
, onEdit = onEdit
, onRefresh = onRefresh
, valueFromState = valueFromState
}
where
genUI attributes datapath mode vst = (Ok (uia UITextView (valueAttr (JSONString "Check the browser console.")), ()), vst)
onEdit datapath (_,()) st vst = (Ok (NoChange,st), vst)
onRefresh datapath st _ vst = (Ok (NoChange,st), vst)
valueFromState s = Just s
initUI me world
= jsTrace "Hello world from WebAssembly!" world
Version: 1.5
Global
ProjectRoot: .
Target: iTasks
Exec: {Project}/WasmTest
ByteCode: {Project}/WasmTest.bc
CodeGen
CheckStacks: False
CheckIndexes: True
OptimiseABC: True
GenerateByteCode: True
Application
HeapSize: 167772160
StackSize: 1048576
ExtraMemory: 81920
IntialHeapSize: 204800
HeapSizeMultiplier: 4096
ShowExecutionTime: False
ShowGC: False
ShowStackSize: False
MarkingCollector: False
DisableRTSFlags: False
StandardRuntimeEnv: True
Profile
Memory: False
MemoryMinimumHeapSize: 0
Time: False
Stack: False
Dynamics: True
GenericFusion: False
DescExL: True
Output
Output: ShowConstructors
Font: Courier
FontSize: 9
WriteStdErr: False
Link
LinkMethod: Static
GenerateRelocations: False
GenerateSymbolTable: False
GenerateLinkMap: False
LinkResources: False
ResourceSource:
GenerateDLL: False
ExportedNames:
StripByteCode: True
KeepByteCodeSymbols: True
PrelinkByteCode: True
Paths
Path: {Project}
Precompile:
Postlink:
MainModule
Name: WasmTest
Dir: {Project}
Compiler
NeverMemoryProfile: False
NeverTimeProfile: False
StrictnessAnalysis: True
ListTypes: StrictExportTypes
ListAttributes: True
Warnings: True
Verbose: True
ReadableABC: False
ReuseUniqueNodes: True
Fusion: False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment