Simulation core in TypeScript