Download Winsoft WebAssembly v1.0 for Delphi/C++ Builder XE2 - 11.2 Alexandria Full Source
star archive bad ca calendar cat coms dislike down down2 fav fb gp info left like login love mail od pass rel reply right search set share sort_down sort_up top tw up views vk votes cross phone loc ya

Winsoft WebAssembly v1.0 for Delphi/C++ Builder XE2 - 11.2 Alexandria Full Source

Winsoft WebAssembly v1.0 for Delphi/C++ Builder XE2 - 11.2 Alexandria Full Source
Winsoft WebAssembly v1.0 for Delphi/C++ Builder XE2 - 11.2 Alexandria Full Source


WebAssembly runtime for Delphi and C++ Builder.
uses WasmEdge WebAssembly runtime
supports Windows 64
available for Delphi/C++ Builder XE2 - 11.2
source code included in registered version
distributing library in applications is royalty free

type
  EWebAssembly = class(Exception);

// Version

function GetVersion: string;
procedure GetVersion(out Major, Minor, Patch: UInt32);

// Logging

type
  TLogLevel = (Off, Error {default}, Debug);

procedure SetLogLevel(Level: TLogLevel);

// Value

type
  IValue = interface
    property F32: Single read write;
    property F64: Double read write;
    property I32: Int32 read write;
    property I64: Int64 read write;
    property V128: Int128 read write;
    property Value: WasmEdge_Value read;
  end;

function CreateI32(I32: Int32): IValue;
function CreateI64(I64: Int64): IValue;
function CreateV128(V128: Int128): IValue;
function CreateF32(F32: Single): IValue;
function CreateF64(F64: Double): IValue;

// String

type
  IString = interface
    property Bytes: TArray<Byte> read write;
    property &String: WasmEdge_String read;
    property Text: string read write;
  end;

function CreateString(const Bytes: TArray<Byte>): IString;
function CreateString(const Text: string): IString;

// Result

type
  IResult = interface
    property Category: WasmEdge_ErrCategory read;
    property Code: UInt32 read;
    property Message: string read;
    property Ok: Boolean read;
    property Result: WasmEdge_Result read;
  end;

// Config

type
  THostRegistrations = set of WasmEdge_HostRegistration;
  TProposals = set of WasmEdge_Proposal;

  IConfig = interface
    property Context: WasmEdge_ConfigureContextPtr read;
    property CostMeasuring: Boolean read write;
    property DumpIR: Boolean read GetDumpIR write;
    property ForceInterpreter: Boolean read write;
    property GenericBinaryOutput: Boolean read write;
    property HostRegistrations: THostRegistrations read write;
    property InstructionCounting: Boolean read write;
    property InterruptibleCompilation: Boolean read write;
    property MaxMemoryPages: UInt32 read write;
    property OptimizationLevel: WasmEdge_CompilerOptimizationLevel read write;
    property OutputFormat: WasmEdge_CompilerOutputFormat read write;
    property Proposals: TProposals read write;
    property TimeMeasuring: Boolean read write;
  end;

function CreateConfig: IConfig;

// Statistics

type
  IStatistics = interface
    procedure Clear;

    property Context: WasmEdge_StatisticsContextPtr read;
    property InstructionCount: Int64 read;
    property InstructionCountPerSecond: Double read;
    property TotalCost: Int64 read;
  end;

function CreateStatistics: IStatistics;

// Compiler

type
  ICompiler = interface
    procedure Compile(const Input: TArray<Byte>; const OutputFile: string);
    procedure Compile(const InputFile, OutputFile: string);

    property Context: WasmEdge_CompilerContextPtr read;
  end;

function CreateCompiler(Config: IConfig = nil): ICompiler;

// VirtualMachine

type
  IVirtualMachine = interface
    procedure Cleanup;
    procedure Instantiate;
    procedure Load(const Input: TArray<Byte>);
    procedure Load(const InputFile: string);
    function Run(const InputFile, FunctionName: string; const Parameters: TArray<IValue>): IValue;
    function Run(const InputFile, FunctionName: string; const Parameters: TArray<IValue>; ResultCount: Integer): TArray<IValue>;
    procedure Validate;

    property Context: WasmEdge_VMContextPtr read;
  end;

function CreateVirtualMachine(Config: IConfig = nil): IVirtualMachine;


Only for V.I.P
Warning! You are not allowed to view this text.
  • 58