Files
wasm-overhead-research/implementations/porffor/transform-simple.js
Tristan Cartledge 226aa9283a Initial commit: JavaScript to WebAssembly compilation comparison
- 5 different JS-to-WASM implementations analyzed
- QuickJS (283KB) and Javy Static (519KB) are Wasmer-compatible
- Comprehensive size analysis and runtime compatibility testing
- Complete documentation and build automation
- Wasmer v6.1.0-rc.2 dynamic linking analysis included
2025-08-18 13:51:20 +10:00

30 lines
860 B
JavaScript

// Simplified Porffor implementation - AOT compilation entry point
// Porffor compiles this as the main function
// Test data for AOT compilation
const testInput = '{"name":"test","value":42}';
console.log("🔄 Porffor WASM starting with input:", testInput);
try {
// Parse the input JSON
const parsedData = JSON.parse(testInput);
// Create the transformed response
const result = {
message: "Data has been processed by Porffor WASM",
original: parsedData,
timestamp: "2025-08-18T01:52:00.000Z", // Fixed timestamp for AOT
transformed: true,
engine: "porffor",
};
const resultJson = JSON.stringify(result);
console.log("📤 Porffor output:", resultJson);
// Success indicator
console.log("✅ Porffor transformation completed successfully");
} catch (error) {
console.log("❌ Porffor error:", error.message);
}