Skip to content

மொழிகள்

எட்டு மொழிகள் real code-ல verified நிலைல இருக்கு (TypeScript/JavaScript, Python, C, Go, Ruby, Java, PHP, C#), மற்றும் மூணு மொழிகள் repository fixtures-ல tested நிலைல இருக்கு (Kotlin, PowerShell, Swift). PHP, C#, PowerShell மற்றும் Swift units JSON dispatchers வழியா bridge ஆகும் (shadow மற்றும் --batch இல்ல).

மொழி Unit Bridge Record மற்றும் replay செய்றது
TypeScript folder அல்லது file generate செய்யப்பட்ட binary wire கூட napi-rs அல்லது wasm-bindgen; classes மற்றும் async உட்பட Node, .ts sources-ஐ run பண்ணி
JavaScript folder அல்லது file generate செய்யப்பட்ட binary wire கூட napi-rs அல்லது wasm-bindgen; classes மற்றும் async உட்பட Node, .js sources-ஐ run பண்ணி
Python package அல்லது module PyO3 (abi3), direct conversion, typed exceptions Python, original-ஐ import பண்ணி
C .c file original பெயர்களோட extern "C" functions மற்றும் ஒரு header shared library-ஆ compile பண்ணப்பட்ட original, ctypes வழியா call பண்ணப்பட்டு, ஒரு case-க்கு ஒரு fork
Go package original API கொண்ட package-ல typed cgo calls மற்றும் generate செய்யப்பட்ட binary wire தனியா ஒரு module-ஆ build பண்ணப்பட்ட generate ஆன Go driver
Ruby module functions கொண்ட file அல்லது folder original modules-க்கு கீழ ஒரு magnus extension generate செய்யப்பட்ட Ruby driver
Java public static methods கொண்ட package original methods கொண்ட wrapper classes-ல typed JNI மற்றும் generate செய்யப்பட்ட binary wire generate செய்யப்பட்ட reflection driver
Kotlin top-level functions மற்றும் @JvmStatic methods கொண்ட Gradle module Java bridge: compile ஆன Kotlin statics-ஐ call பண்ற Java wrapper classes-ல typed JNI kotlinc-ஆல compile பண்ணப்பட்ட Kotlin sources கூட generate செய்யப்பட்ட reflection driver
PHP top-level functions கொண்ட file அல்லது folder (public static methods PHP-லயே இருக்கும்) original parameters-ஓட functions-ஐ redeclare பண்ற file-ல ext-ffi மேல ஒரு JSON dispatcher generate செய்யப்பட்ட PHP driver; CLIs மற்றும் servers (php -S)-க்காக app record, app replay மற்றும் front door வழியா முழு apps
PowerShell param() blocks கொண்ட functions உள்ள .psm1 module அல்லது .ps1 script (Export-ModuleMember படி export பண்ணப்பட்டது) load time-ல Reflection.Emit வழியா declare பண்ணப்பட்ட P/Invoke மேல ஒரு JSON dispatcher, அதோட original param() block-ஓட ஒவ்வொரு function-ஐயும் redeclare பண்ற .ps1 file-ல generate செய்யப்பட்ட pwsh driver (PowerShell 7.4+)
C# public static methods கொண்ட file அல்லது folder original methods-ஓட <namespace>.Rust classes-ல P/Invoke மேல ஒரு JSON dispatcher project-ஓட sources கூட dotnet build-ஆல compile பண்ணப்பட்ட generate ஆன reflection driver; CLIs மற்றும் ASP.NET servers (dotnet <app>.dll)-க்காக app record, app replay மற்றும் front door வழியா முழு apps
Swift SwiftPM target அல்லது folder-ல உள்ள top-level functions கொண்ட file swift/<Crate>.swift-ல C ABI மேல ஒரு JSON dispatcher, இது ஒவ்வொரு function-ஐயும் அதோட labels, defaults மற்றும் throws-ஓட redeclare பண்ணி, generate ஆன C module map-ஐ import பண்ணும் target-ஓட sources கூட swiftc-ஆல compile பண்ணப்பட்ட generate ஆன main.swift driver; trap ஆகுற case ஒரு trap-ஆ record ஆகும்

C, PHP, C#, PowerShell மற்றும் Swift தவிர மத்த எல்லா மொழிகளுக்கும் batch classes (--batch) கிடைக்கும்: items ஒரே முறை cross ஆகி Rust-லயே இருக்கும், ஒவ்வொரு call-உம் எல்லா cores-லயும் எல்லா items மேலயும் run ஆகும்.

மொழி repository-ல இருந்து detect பண்ணப்படும் (go.mod, pom.xml, build.gradle/build.gradle.kts, ஒரு .csproj அல்லது .sln, pyproject.toml, Gemfile, composer.json, package.json, Package.swift, இல்லன்னா அதிகமா இருக்கிற source files); .kt sources மட்டும் இருந்து .java sources இல்லாத Gradle module Kotlin ஆகும், இரண்டும் கலந்த modules Java-வாவே இருக்கும். --lang இதை override பண்ணும். Types source-ல இருந்து வரும்: TS types, Python hints, C, Go, Java, Kotlin மற்றும் C# signatures, Ruby YARD tags, PHP types மற்றும் phpdoc; numbers-ஆ பயன்படுத்துற untyped parameters numbers-ன்னு infer பண்ணப்படும். Types ஒவ்வொன்னும் port-ல என்னவா மாறும், எது function-ஐ அதோட மொழியிலேயே வைக்கும்னு list பண்ணுது.

ஒரு Java unit அதோட மத்த source tree கூட சேர்த்து compile பண்ணப்படும். அந்த sources வெளியில இருந்து classes-ஐ import பண்ணும்போது (module-ஓட libraries, அல்லது இன்னொரு module), record, diff மற்றும் bench-க்கு முன்னாடி project build பண்ற jars மற்றும் class folders-க்கு CLASSPATH set பண்ணுங்க; javac மற்றும் driver ரெண்டுமே அதைப் பயன்படுத்தும். Gradle-ல, module-ஓட compile classpath-ல இருந்து அதை print பண்ணுங்க (configurations.compileClasspath.asPath, அல்லது Android-ல <variant>CompileClasspath); Maven-ல, mvn dependency:build-classpath. இது இல்லன்னா, காணாம போன types-னால javac fail ஆகி, அதை set பண்ண சொல்லி error காட்டும்.

Android-க்கு, rust-anything build <crate> --profile android அதே JNI library-ஐ arm64-v8a, armeabi-v7a மற்றும் x86_64 (அல்லது நீங்க pass பண்ற --abi values)-க்காக NDK கூட build பண்ணி <crate>/jniLibs/<abi>/-ல install பண்ணும்; --api API level-ஐ set பண்ணும் (குறைந்தபட்சம் 26, generate செய்யப்பட்ட Java runtime-க்கு இது தேவை). இது NDK-வை ANDROID_NDK_HOME/ANDROID_NDK_ROOT அல்லது SDK-ல இருந்து கண்டுபிடிக்கும், Rust targets தேவை (rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android), 64-bit libraries-ஐ 16 KB page alignment-ஓட link பண்ணும், மேலும் ஒவ்வொரு JNI entry point-உம் export ஆயிருக்கான்னு check பண்ணும். Gradle இயல்பா src/main/jniLibs-ல தேடும், அதனால --jni-libs app/src/main/jniLibs pass பண்ணுங்க அல்லது <crate>/jniLibs-ஐ sourceSets.main.jniLibs.srcDirs-ல சேருங்க. rust-anything record <crate> --profile android connect பண்ணப்பட்ட device-ல (adb) ART-க்கு கீழ original Kotlin unit-ஐ run பண்ணும், SDK-யோட build-tools-ல இருந்து d8 வச்சு generate ஆன driver-ஐ dex பண்ணும், results-ஐ அதே cases.jsonl-ஆ திரும்ப எடுக்கும்; diff <crate> --profile android device-ஓட ABI-க்காக build பண்ணப்பட்ட .so-க்கு எதிரா அதை replay பண்ணும். ரெண்டுக்கும் adb, ஒரு device, kotlinc, build-tools மற்றும் ஒரு platform கொண்ட SDK, மேலும் ஒன்றுக்கு மேற்பட்ட device connect ஆயிருந்தா --device <serial> தேவை. இந்த profile logic units-ஐ cover பண்ணும்: Activity/Compose/XML UI, lifecycle மற்றும் SDK-only classes Kotlin-லயே இருக்கும், மேலும் ஒவ்வொரு call-உம் JNI-ஐ cross பண்றதால hot loops-க்கு generate செய்யப்பட்ட batch wrappers-ஐ பயன்படுத்துறது நல்லது. Host-ல record மற்றும் diff தொடர்ந்து desktop JVM-ஐயே பயன்படுத்தும்.

PHP-க்கு, analyze ஒரு PHP app-ஐ plan பண்ணும் (Composer packages மற்றும் PSR-4 autoloading, loose comparison மற்றும் integer overflow ஆகி floats ஆகுறது போன்ற risks, crates-க்கு map பண்ணப்பட்ட Composer packages), மேலும் ஒரு PHP CLI அல்லது server-ஐ record பண்ணி, replay பண்ணி, Rust front door-க்கு பின்னாடி வைக்கலாம். Scalar, string, list மற்றும் assoc-array parameters கொண்ட ஒரு unit-ஓட top-level functions PHP-யோட FFI extension (ext-ffi கொண்ட php, CLI-க்கு default-ஆ on-ல இருக்கும்) வழியா bridge பண்ணப்படும்: diff pass ஆனதும், app original-ஐ require பண்ண இடத்துல generate செய்யப்பட்ட php/<crate>.php-ஐ (பெயர் --க்கு பதிலா _ போட்ட crate பெயர், அதனால foo-rs என்பது php/foo_rs.php) require பண்ணுங்க, ரெண்டு files-ஐயும் அதுங்க இருக்கிற இடத்துலயே விட்டுடுங்க: wrapper அதோட native library-ஐ தன்னோட folder-க்கு relative-ஆ load பண்ணும், அதனால அதை நகர்த்தினா load break ஆகும். Wrapper ஒவ்வொரு bridged function-ஐயும் function_exists guard இல்லாம unconditionally declare பண்ணும், அதனால அது original file கூட சேர்றதுக்கு பதிலா அதை replace பண்ணும். அந்த file-ல இருக்கிற மத்த எதுவும் கூட வராது: classes, public static methods, bridge PHP-லயே வைக்குற functions (உதாரணமா callable அல்லது Closure parameter), மற்றும் define('FEATURE_ENABLED', true) போன்ற top-level statements wrapper-ல இருக்காது, ரெண்டு files-ஐயும் require பண்ணா bridged functions மறுபடி declare ஆகும். அதனால அவைகளை தொடர்ந்து require செய்யப்படுற ஒரு file-ல வைங்க. ஒவ்வொரு call-உம் JSON-ஆ cross ஆகும், சுமார் 1 µs, அதனால bench சின்ன functions-ஐ PHP-ஐ விட மெதுவா காட்டும்; PHP-க்கு இன்னும் shadow இல்ல (issue #200).

C#-உம் இதே மாதிரிதான் வேலை செய்யும்: analyze .csproj projects மற்றும் அதுங்களோட NuGet packages-ஐ (crates-க்கு map பண்ணப்பட்டது) படிக்கும், using directives-ஐ folders-க்கு resolve பண்ணும், C# வித்தியாசமா செய்யுற விஷயங்களை flag பண்ணும் (decimal, dynamic, LINQ-ஓட deferred queries, Task, lock, reflection). ஒரு C# CLI அல்லது ASP.NET server-ஐ record பண்ணி, replay பண்ணி, Rust front door-க்கு பின்னாடி வைக்கலாம். Scalar, string, array, list, dictionary மற்றும் record அல்லது plain-class parameters கொண்ட ஒரு unit-ஓட public static methods P/Invoke வழியா bridge பண்ணப்படும் (record மற்றும் diff பண்ண PATH-ல dotnet இருக்கணும்): diff pass ஆனதும், generate செய்யப்பட்ட cs/ wrapper-ஐ (crate பெயர் கொண்ட ஒரு file: foo-rsனா cs/FooRs.cs) project-ல compile பண்ணி, build ஆன native library-ஐ app பக்கத்துலயே வைங்க, அப்புறம் <namespace>.Rust namespace-ல இருக்கிற generate ஆன classes-ஐ call பண்ணுங்க (Acme.Text.Slug.Slugify என்பது Acme.Text.Rust.Slug.Slugify ஆகும்), அல்லது using வச்சு alias பண்ணுங்க. ஒவ்வொரு call-உம் JSON-ஆ cross ஆகும், சுமார் 1-3 µs, அதனால bench சின்ன methods-ஐ .NET-ஐ விட மெதுவா காட்டும்; C#-க்கு இன்னும் shadow இல்ல (issue #200).

PowerShell-க்கு, analyze .psm1 modules, .ps1 scripts மற்றும் .psd1 manifests-ஐ (RequiredModules) படிக்கும், Import-Module, using module மற்றும் dot-source பண்ணப்பட்ட files-ஐ follow பண்ணும், PowerShell வித்தியாசமா செய்யுற விஷயங்களை flag பண்ணும்: implicit output மற்றும் array unrolling, case-insensitive -eq, -match மற்றும் hashtable keys, $null, மற்றும் implicit conversions (5 / 2 என்பது 2.5, [int]2.5 என்பது 2). [string], integer, [double], [bool]/[switch], array, [hashtable] அல்லது untyped parameters கொண்ட ஒரு unit-ஓட functions, generate செய்யப்பட்ட ps/<crate>.ps1-ல இருந்து P/Invoke வழியா bridge பண்ணப்படும்; filters, begin/process blocks, pipeline input, [scriptblock], [ref] மற்றும் மத்த .NET types காரணத்தோட PowerShell-லயே இருக்கும். diff pass ஆனதும், rust-anything enable <crate> original file-ஓட கடைசியில wrapper-ஐ dot-source பண்ணும். ஒவ்வொரு call-உம் PowerShell code encode பண்ண JSON-ஆ cross ஆகும்: Apple M4-ல சில scalars-க்கு சுமார் 0.1 ms, arrays மற்றும் hashtables-க்கு இன்னும் அதிகம், அதனால ஒரு call-க்கு அதை விட அதிக வேலை செய்யுற functions மட்டும் தான் வேகமாகும் (bench உங்களோடதுக்கு அதை அளந்து காட்டும்). Tools-ல பெரும்பாலான மெதுவான PowerShell-க்கு காரணம் ஒவ்வொரு command-க்கும் ஒரு புது pwsh அல்லது powershell.exe start ஆகுறதுதான் (அதே M4-ல pwsh -NoProfile -c 1-க்கு 0.24 முதல் 0.45 s வரை), அதை எந்த port-ஆலயும் சரி பண்ண முடியாது: ஒரே shell-ஐ open பண்ணி வச்சு அதுக்கே commands அனுப்புங்க (FAQ பாருங்க).

Swift-க்கு, analyze SwiftPM packages-ஐ (Package.swift மற்றும் crates-க்கு map பண்ணப்பட்ட அதோட .package(url:) dependencies) படிக்கும், import-ஐ package-ஓட targets-க்கு resolve பண்ணும், SwiftUI, UIKit அல்லது AppKit-ஐ import பண்ற files-ஐ UI-ஆ ஒதுக்கி வைக்கும், Swift வித்தியாசமா செய்யுற விஷயங்களை flag பண்ணும்: Int overflow-ல traps, ! மற்றும் out-of-range indices, grapheme cluster மூலமா count மற்றும் compare பண்ணப்படுற strings, மற்றும் Double-ஓட text form. String, integer, Double/Float, Bool, optional, array மற்றும் [String: T] parameters மற்றும் results, மேலும் throws கொண்ட ஒரு file-ஓட top-level functions ஒரு C module map வழியா bridge பண்ணப்படும் (record மற்றும் diff பண்ண PATH-ல swiftc இருக்கணும்; Xcode அல்லது Swift 5.9+ toolchain). diff pass ஆனதும், original file-க்கு பதிலா generate செய்யப்பட்ட swift/<Crate>.swift-ஐ (foo-rsனா swift/FooRs.swift) target-ல compile பண்ணுங்க, கூடவே swift/<Crate>Native/-ல இருக்கிற module map-க்கு -I swift மற்றும் build ஆன library-க்கு -L swift கொடுங்க. Crate overflow-checks = true-ஓட build ஆகும், அதனால Swift trap ஆகுற இடத்துல port-ஓட + panic ஆகும், மேலும் wrapper ஒரு Rust panic-ஐ fatalError-ஆ மாற்றும்: diff ஒரு trap-ஐ இன்னொரு trap கூட compare பண்ணும். Port-ஓட Err("Type: message") அந்த type name மற்றும் message கொண்ட <Crate>Error-ஆ throw ஆகும், diff ரெண்டையும் original-ஓட error கூட compare பண்ணும். Methods, extensions, closures, inout, generics, async, Set மற்றும் project-ஓட சொந்த types Swift-லயே இருக்கும்; Swift-க்கு இன்னும் shadow, --batch, bench அல்லது profile இல்ல (issue #200).

ஒவ்வொரு மொழியோட நிலை

மொழி நிலை கடைசி real run
TypeScript/JavaScript Verified json-server, Fuse.js, vercel/ms, x18n-ஓட packages/core
Python Verified CPython 3.13-ல இருந்து colorsys.py: 2,400/2,400
Go Verified Go 1.24-ல இருந்து path: 2,642/2,642
Ruby Verified Ruby 3.3-ல இருந்து shellwords.rb: 1,617/1,617
Java Verified ஒரு facade-க்கு பின்னாடி JDK 21: 4,492/4,492
C Verified ஒரு facade-க்கு பின்னாடி glibc: ஒரு undefined-behavior case-ஐ நீக்கின பிறகு 1,859/1,859
PHP Verified ஒரு facade-க்கு பின்னாடி PEAR XML_Util 1.4.5: 1,838/1,838
C# Verified Google.Protobuf CodedOutputStream.ComputeSize.cs: 2,941/2,941 (2 known diffs உட்பட)
Kotlin Tested Gradle மற்றும் Android JNI fixtures
PowerShell Tested .psm1 module fixture (tests/powershell.rs)
Swift Tested SwiftPM fixture (tests/swift.rs, macOS arm64)

Commands-ஓட முழு table-உம் Status பக்கத்துல இருக்கு.

GitHub-ல இந்தப் பக்கத்தை edit பண்ணுங்க →