Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
Rust agent-skillsclaude-codeclicode-migrationcodexffigolangjavajavascriptmcpmigrationnapiperformanceportingpyo3pythonrewriterubyrusttypescript
<?php
declare(strict_types=1);
namespace Acme\StaticText;
final class Words
{
public static function count(string $text): int
{
return strlen($text);
}
public static function clamp(int $value, int $lo = 0, int $hi = 10): int
{
if ($lo > $hi) {
throw new \InvalidArgumentException('lo is above hi');
}
return max($lo, min($hi, $value));
}
}