Scarp v0.0.5-alpha.2 — प्रकाशित रिलीज़ और प्रमाण
प्रकाशन: 2 नवंबर 2026। आधिकारिक compiler prerelease, निश्चित source commit e4db8e191cd7ea623123cae7348450ca6c95b170 पर आधारित है।
प्रकाशित compiler में क्या नया है?
प्रकाशित alpha.2 source और tagged runnable examples के आधार पर प्रमुख नई सुविधाएँ हैं:
- Integer bitwise operations, binary/hex literals और bounded shifts।
bind/varके explicit type annotations, checked scalar conversions तथा Unicode text-query built-ins।- Immutable integer collections, population statistics और finite vector activation kernels।
- Static module inspection,
scarp modules, JSON inspection औरscarp explain E####से diagnostic स्पष्टीकरण। - सीमित compile-time scalar module constant expressions।
Compiler examples, CLI source reference और module-inspection reference देखें। Upstream के कुछ Markdown पृष्ठ अभी भी "unreleased" लिखते हैं क्योंकि वे publication से पहले लिखे गए थे। सही रिलीज़ स्थिति के लिए प्रकाशित tag/source निर्णायक हैं।
पाँच compiler-verified प्रोग्राम
नीचे के सभी code और stdout blocks प्रकाशित .srp और .stdout फ़ाइलों के पूरे उदाहरण हैं। TypeScript checker दोनों भाषाओं का source/output, Git blob hashes और क्रम जाँचता है; अलग CI job pinned alpha.2 compiler से इन्हें चलाती है।
1. Integer bit operations
प्रकाशित सोर्स: examples/bit_fields.srp और stdout fixture।
// Pack and inspect a 64-bit word without implicit numeric conversions.
var flags = 0xA0;
flags |= 0b0011;
println(flags & 0x0F);
println(flags >>> 4);
println(1 << 63);
println(~0);
अपेक्षित stdout (CI में वास्तविक output bytes भी जाँचे जाते हैं):
3
10
-9223372036854775808
-1
बाइनरी (0b) और hexadecimal (0x) literal, integer ही हैं। यह उदाहरण bitwise OR assignment, mask, unsigned right shift (>>>), sign bit तक left shift और complement (~) का सही output दिखाता है।
2. स्पष्ट संख्यात्मक conversions
प्रकाशित सोर्स: examples/scalar_conversions.srp और stdout fixture।
bind count: integer = 42;
bind scaled: float = to_float(count) / 4.0;
bind exact: integer = to_integer(12.0);
print(scaled, exact, to_integer(-0.0));
अपेक्षित stdout (CI में वास्तविक output bytes भी जाँचे जाते हैं):
10.5 12 0
Typed declarations में लिखा हुआ type लागू रहता है। to_float(integer) और to_integer(float) स्पष्ट, checked conversion हैं; ये implicit casts नहीं हैं। उदाहरण में negative floating zero का integer zero में बदलना सत्यापित है।
3. Typed bindings और mutations
प्रकाशित सोर्स: examples/typed_declarations.srp और stdout fixture।
bind samples: vector = [1.0, 2.0, 3.0];
var total: float = sum(samples);
total += 0.5;
bind grid: tile = tile(samples, 1, 3);
bind ready: boolean = width(grid) == 3;
bind label: string = "typed";
print(label, ready, total);
अपेक्षित stdout (CI में वास्तविक output bytes भी जाँचे जाते हैं):
typed true 6.5
Immutable bind और mutable var में explicit primitive, vector और tile type annotations लिखे जा सकते हैं। total += 0.5 घोषित float type के साथ काम करता है। इससे user-defined struct या generic types उपलब्ध नहीं हो जाते।
4. Unicode text queries
प्रकाशित सोर्स: examples/unicode_text.srp और stdout fixture।
bind text: string = "café 🌍";
print(text_len(text), text_bytes(text), text_codepoint(text, 5));
print(text_find(text, "🌍"), text_contains(text, "é"));
print(text_starts_with(text, "caf"), text_ends_with(text, "🌍"));
अपेक्षित stdout (CI में वास्तविक output bytes भी जाँचे जाते हैं):
6 10 127757
5 true
true true
text_len Unicode scalar values गिनता है, जबकि text_bytes UTF-8 bytes गिनता है। Emoji की वजह से दोनों में अंतर आता है। Index और search position, Unicode scalars पर आधारित हैं—grapheme clusters पर नहीं; automatic normalization का वादा नहीं है।
5. Statistics और activation kernels
प्रकाशित सोर्स: examples/numerical_kernels.srp और stdout fixture।
bind samples = ints_to_vector(ints_range(-2, 5, 1));
print(variance(samples), stddev([3.0, 3.0]));
print(relu(samples));
print(sigmoid([-1000.0, 0.0, 1000.0]));
print(tanh([-1000.0, 0.0, 1000.0]));
अपेक्षित stdout (CI में वास्तविक output bytes भी जाँचे जाते हैं):
2.0 0.0
[0.0, 0.0, 0.0, 1.0, 2.0]
[0.0, 0.5, 1.0]
[-1.0, 0.0, 1.0]
यह उदाहरण integer collection को finite-float vector में बदलता है और फिर variance, stddev, relu, sigmoid तथा tanh चलाता है। ये numerical primitives हैं, कोई पूर्ण मशीन-learning training framework नहीं।
चार और सत्यापित उदाहरण
Alpha.2 collections और classification ट्यूटोरियल में immutable integer collections, stable score selection, numerical probabilities और स्पष्ट loss gradients के चार पूरे प्रकाशित प्रोग्राम हैं। इस पृष्ठ के पाँच उदाहरणों के साथ अलग alpha.2 CI suite अब 12 runnable programs (module constants और JSON tutorial के तीन उदाहरण सहित) जाँचती है। पुराने alpha.1 suite को बिना migration के नहीं बदला गया।
CLI निरीक्षण कमांड
प्रकाशित alpha.2 में static scarp modules <path>, scarp modules --json <path> और scarp explain E0044 जैसी सुविधाएँ हैं। ये inspection/help commands हैं; native executable compilation या package manager नहीं। Module inspection सामान्य runtime statements नहीं चलाता, लेकिन import और type नियम जाँचता है। अधिक जानकारी के लिए module inspection और JSON schema देखें।
सही संस्करण इंस्टॉल करें
Alpha.2 रिलीज़ से अपने सिस्टम का archive डाउनलोड करें, प्रकाशित SHA-256 checksum मिलाएँ और उदाहरण चलाने से पहले scarp --version जाँचें। Windows x64, Linux x64 और macOS ARM64 assets उपलब्ध हैं। scarp build या native .srp executable compiler का दावा नहीं किया गया है।
प्रमाण और सीमाएँ
यह पृष्ठ केवल alpha.2 के लिए है। पहले के compatibility reference और feature status अभी अपने अलग alpha.1 baseline के लिए हैं। सत्यापन नियम दोनों pinned suites का अंतर बताते हैं। इनमें कोई भी स्थिर language specification नहीं है।