ROSETTA STONE
JSON Request
Planned
ROSETTA 23 — Implementation Comparison
Compare sending JSON request bodies across web stacks.
Rosetta Stone
JSON Request
Preview coming soon
Rosetta Stone JSON Request
Comparison Contract
Serialize structured data and send the same request payload.
Comparison Contract
Serialize structured data and send the same request payload.
Objective & Comparison Rule
Build each implementation without changing the shared behavior or visual target.Rosetta Contract
Objective
Compare sending JSON request bodies across web stacks.
Comparison Rule
Serialize structured data and send the same request payload.
Keep equivalent input, behavior, and visible output in every later language version.
Implementation Plan
Keep the comparison surface fixed while language syntax and runtime details change.Technologies
Build Instructions
Start with the first technology listed under Technologies, then reproduce the same behavior in each following implementation.Freeze the Contract
Define the exact input, visible behavior, and expected output.Serialize structured data and send the same request payload.
Build Initial Implementation
Implement the reference version with the same standalone visual layer.Build and run the initial implementation, then save the visible expected result.
Later Comparison
Rebuild without changing the contract.Compare syntax, typing, modules, runtime, standard library, data handling, and implementation size.
TypeScript Implementation Reference
This implementation becomes the first concrete Rosetta comparison point.Reference Code
Use the same input when building later language versions.async function readJson(req: IncomingMessage): Promise<unknown> {
const chunks: Buffer[] = [];
for await (const chunk of req) {
chunks.push(Buffer.from(chunk));
}
return JSON.parse(Buffer.concat(chunks).toString("utf8"));
}TypeScript Implementation Configuration
Keep the TypeScript implementation independently buildable; each implementation should keep its own required setup.package.json
{
"type": "module",
"scripts": {
"build": "tsc",
"start": "npm run build && node --enable-source-maps dist/server.js"
},
"devDependencies": {
"@types/node": "^26.4.0",
"typescript": "^7.0.2"
}
}tsconfig.json
{
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022", "DOM"],
"types": ["node"],
"strict": true,
"sourceMap": true
},
"include": ["src/**/*.ts"]
}Comparison Dimensions
Record differences that teach language and runtime behavior rather than cosmetic syntax.Compare
- Syntax and data declarations
- Typing and validation
- Collections and standard-library operations
- Modules and file organization
- Runtime and build requirements
- Database or HTTP APIs when applicable
- Visible output and behavioral equivalence