- Kip एक प्रायोगिक प्रोग्रामिंग भाषा है जो तुर्की भाषा के व्याकरणिक case और mood को type system में एकीकृत करती है, और प्राकृतिक भाषा की morphology तथा type theory के संयोजन की पड़ताल करती है
- यह तुर्की के संज्ञा case रूपांतरण और vowel harmony को कोड संरचना में दर्शाती है, जिससे function arguments के संबंध case suffixes से अलग किए जा सकते हैं और argument order में flexibility मिलती है
- pattern matching, polymorphic types, inductive data types, input/output effects जैसी आधुनिक functional languages की प्रमुख विशेषताओं को तुर्की व्याकरणिक रूपों में व्यक्त करती है
- इसे Foma morphological analyzer और Haskell Stack से build किया जाता है, और यह WASM-आधारित browser runtime तथा bytecode cache (.iz) सुविधा प्रदान करती है
- यह भाषाविज्ञान और programming language design के संगम को दिखाने वाला research और education के लिए बनाया गया project है, जो प्राकृतिक भाषा-आधारित भाषा डिज़ाइन की संभावनाओं का प्रयोग करता है
Kip का परिचय
- Kip का नाम तुर्की शब्द ‘kip’(mood) से लिया गया है, और यह एक प्रायोगिक भाषा है जो तुर्की व्याकरणिक case को type system में शामिल करती है
- तुर्की के संज्ञा case रूपांतरण(ismin halleri) और vowel harmony को programming language design में एकीकृत करती है
- यह research और educational purpose का project है, वास्तविक deployment के लिए बनी भाषा नहीं
- इसमें तुर्की और अंग्रेज़ी tutorials उपलब्ध हैं, जिनसे Kip प्रोग्राम लिखना सीखा जा सकता है
- इसका grammar और व्यवहार अभी प्रयोगात्मक चरण में है, इसलिए आगे बदलाव संभव हैं
भाषा की विशेषताएँ
- तुर्की व्याकरणिक case को type की तरह उपयोग करना
- यह 8 case को support करती है: nominative, accusative, dative, locative, ablative, genitive, instrumental, possessive
- हर case suffix के रूप में चिह्नित होता है और function arguments के बीच संबंध को स्पष्ट रूप से अलग करता है
- लचीला argument order
- case suffixes argument संबंधों को स्पष्ट कर देते हैं, इसलिए argument क्रम बदलने पर भी अर्थ वही रहता है
- उदाहरण:
(5'le 3'ün farkını) yaz. और (3'ün 5'le farkını) yaz. का परिणाम समान है
- inductive data type definition
- polymorphic type support
- generic data structures परिभाषित किए जा सकते हैं
- उदाहरण:
(öğe listesi) रूप में list data type परिभाषित करना
- pattern matching
- conditional suffix
-sa/-se का उपयोग करके pattern matching किया जाता है
- nested patterns, binders, wildcard (
değilse) का समर्थन
- constant definition
diyelim keyword से named constants घोषित किए जाते हैं
- उदाहरण:
sıfırın ardılına bir diyelim.
- input/output और effect handling
- basic types
- integer(
tam-sayı): toplamı, farkı, çarpımı जैसे operations का समर्थन
- string(
dizge): uzunluğu, birleşimi, tam-sayı-hali उपलब्ध
- input/output:
yazmak, okumak commands उपलब्ध
- comments और literals
- comments:
(* ... *)
- literals:
"merhaba"'yı yaz. जैसे case suffix वाले रूप
इंस्टॉलेशन और रन
- ज़रूरी tools
- Foma: finite-state morphological analysis toolkit
- Stack: Haskell build tool
- build का तरीका
install.sh script चलाएँ या stack build command से manual build करें
vendor/trmorph.fst में TRmorph converter शामिल है
- run करना
- REPL:
stack exec kip
- file चलाना:
stack exec kip -- --exec path/to/file.kip
- PATH installation:
stack install
WASM Playground
playground/ directory में browser execution build शामिल है
kip-playground को wasm32-wasi के लिए compile किया जाता है
- HTML/JS harness के जरिए browser के अंदर Kip चलाया जा सकता है
- विस्तृत build प्रक्रिया के लिए
playground/README.md देखें
bytecode cache (.iz)
- हर
.kip file के type-checking result को cache करके .iz file में सेव किया जाता है
- source या dependency न बदलने पर cache दोबारा उपयोग होती है
.iz file हटाने पर parsing और type-checking फिर से किया जाता है
- compiler hash शामिल होने के कारण version बदलने पर यह अपने-आप अमान्य हो जाती है
उदाहरण प्रोग्राम
- प्राकृतिक संख्याओं की परिभाषा, constants declaration, addition function, और result output का उदाहरण शामिल है
Bir doğal-sayı
ya sıfır
ya da bir doğal-sayının ardılı
olabilir.
sıfırın ardılına bir diyelim.
birin ardılına iki diyelim.
ikinin ardılına üç diyelim.
(bu doğal-sayıyla) (şu doğal-sayının) toplamı,
bu sıfırsa,
şu,
öncülün ardılıysa,
(öncülle) (şunun ardılının) toplamıdır.
(ikiyle üçün toplamını) yaz.
project संरचना
- app/ : CLI entry point (
Main.hs)
- src/Kip/ : AST, cache, interpreter, parser, renderer, type checker शामिल
- lib/ : base modules (
giriş.kip, temel.kip, temel-liste.kip आदि)
- tests/ : success(
succeed/) और failure(fail/) test cases
- vendor/ :
trmorph.fst morphological converter
टेस्ट
stack test command से चलाएँ
tests/succeed/: जो tests पास होने चाहिए
tests/fail/: जो tests fail होने चाहिए
morphological analysis
- Kip, तुर्की morphological analysis के लिए TRmorph का उपयोग करता है
- बहुअर्थी शब्द (जैसे: “takası”) को सभी संभावित व्याख्याओं के साथ parse किया जाता है
- type-checking चरण में उसका अर्थ तय होता है
- किसी खास व्याख्या को force करने के लिए apostrophe(
') का उपयोग करें (taka'sı, takas'ı)
लाइसेंस
अभी कोई टिप्पणी नहीं है.