Mystical
(suberic.net)- Mystical PostScript प्रोग्रामों को जादुई वृत्त जैसा दिखने वाली गोलाकार संरचना में ड्रॉ करने की एक notation शैली है; दस्तावेज़ इसे भाषा की तरह पेश करता है, लेकिन असल में यह PostScript की visual representation के ज्यादा करीब है
- इसकी मुख्य संरचना ring है, और executable array
{}, non-executable array[], dictionary<< >>को border, star, triangle और polygon से अलग किया जाता है - ring के किनारे का text और sigil PostScript operators, variables, keywords, strings और names को symbols या decorative रूपों में बदलते हैं
mystical.psarrays, executable arrays और dictionaries को Mystical images में render करता है, औरmystify.pyPostScript program को 8.5x11 page पर 8-inch चौड़ी Mystical drawing में wrap करता है तथा comments को भी convert करता है- फिलहाल Mystical images को पढ़कर computation करने वाला कोई interpreter नहीं है; यह इस स्तर तक है कि इंसान image को PostScript में बदलकर चला सके
PostScript को जादुई वृत्त की तरह ड्रॉ करने वाली notation
- Mystical की शुरुआत एक ऐसी programming language बनाने के लक्ष्य से हुई थी जो जादुई वृत्त जैसी दिखे
- असल में यह PostScript को जादुई वृत्त जैसा दिखने वाले तरीके से लिखने या ड्रॉ करने की पद्धति के ज्यादा करीब है
- installation और शुरुआत करने के docs अलग से उपलब्ध हैं
Ring-based structure
- Mystical program ring से मिलकर बना होता है
- ring अंदरूनी और बाहरी border वाली circular band होती है, जिसके भीतर text और sigils रखे जाते हैं
- main ring का content दाहिने छोर यानी 3 o'clock direction से शुरू होकर counterclockwise दिशा में बहता है
- यह PostScript के angle system का पालन करता है, और इस assumption को भी दर्शाता है कि ring को बाहर की तरफ से लिखा जाता है
- sub-ring उस बिंदु से शुरू होती है जहां वह उसे call करने वाली structure से जुड़ी होती है
-
तीन ring types
- executable array PostScript के
{ }के बराबर है; इसमें अंदर-बाहर simple circular borders होते हैं और भीतर star shape होता है - executable array के start और end points को alchemy के “work completed” symbol से लिए गए symbol से दिखाया जाता है
- non-executable array PostScript के
[ ]के बराबर है; यह executable array जैसा है लेकिन इसमें star shape नहीं होता - non-executable array के start और end points simple triangle से दिखाए जाते हैं
- dictionary PostScript के
<< >>के बराबर है; इसे double outer border और single inner border वाले polygon के रूप में दिखाया जाता है - dictionary के start/end point markers array जैसे ही होते हैं
- dictionary image में items का order PostScript text से अलग हो सकता है
- क्योंकि PostScript में dictionary insertion order preserve नहीं होता
- executable array PostScript के
-
Nested structures और constraints
- जब कोई structure दूसरी structure के अंदर आती है, तो inclusion point के छोटे circle या dot से एक line निकलकर sub-ring के start/end sigil से जुड़ती है
- PostScript में
[ ]या<< >>को ऐसे तरीकों से इस्तेमाल किया जा सकता है जिन्हें Mystical के लिए process करना मुश्किल होता है - example की तरह array boundaries को conditional या branch के भीतर बांटने वाले patterns से बचना चाहिए
gsave/grestore,begin/endजैसे commands के unbalanced होने या loops को cross करने की संभावना ज्यादा होती है, इसलिए उन्हें सामान्य sigil की तरह treat किया जाता है
Text और sigils
- ring के किनारे पर text या sigils रखे जाते हैं
- PostScript में
/nameके रूप में लिखे जाने वाले names को Mystical में name text या sigil को घेरने या overlap करने वाले triangle से दिखाया जाता है - PostScript की string
()को string text रखने वाले cartouche के रूप में represent किया जाता है -
Standard sigils
- कई built-in operators के अपने standard sigils होते हैं
- operator या name के रूप में आने पर text की जगह sigil इस्तेमाल होता है, लेकिन string के अंदर यह लागू नहीं होता
- standard sigils आम तौर पर command के पहले अक्षर और concept की drawing को combine करके बनाए गए हैं; कुछ में अधिक descriptive drawing या standardized visual language का उपयोग है
- पूरी list Standard Sigils में देखी जा सकती है
- example के तौर पर cover की गई operator categories
dup,copy,add,mul,negfor,forall,repeatif,ifelse, comparison operatorsmoveto,lineto,arc,curveto,stroke,fillgsave,grestore,translate,scale,rotate- color setting/query operators
dict,begin,end,def,get,put,length
-
User sigils
- नए function या name के sigils runtime पर
sigil_bankमें जोड़े जा सकते हैं - user sigil origin को center मानकर 1 unit square के भीतर होना चाहिए, और coordinate values 0.5 से ज्यादा नहीं होनी चाहिए
- सुविधा के लिए coordinate system को transform किया जा सकता है
strokeके बजायnstrokeइस्तेमाल करने पर standard sigil जैसा calligraphic effect मिलता है- user variables के sigils किसी भी sigil system से design किए जा सकते हैं
- examples मुख्य रूप से Spare के Chaos Magick system से inspired letter collision का इस्तेमाल करते हैं
- kameas, wheels, Square Word Calligraphy, Circular Gallifreyan, sitelen sitelen, drawings, wordplay आदि भी संभव हैं
- official operators से derived नए names में उस operator का standard sigil शामिल हो सकता है
- नए function या name के sigils runtime पर
/name { ring } def के लिए combined notation
defका अलग sigil है, लेकिन name push करने, function push करने और फिर उस name पर function define करने का pattern अक्सर दिखता है- Mystical
/name { ring } defform के लिए special syntax देता है- सामान्य name triangle इस्तेमाल होता है
- connection line का end name के ठीक नीचे रखा जाता है
defsigil पूरी तरह omit किया जाता है
- simplicity के लिए यह syntax बाकी दो ring types तक भी extend किया गया है
defको दूसरे तरीके से इस्तेमाल करते समय सामान्यdefsigil ही इस्तेमाल होता है- dictionary के अंदर
/name { ring }के लिए भी similar combined notation पर विचार किया गया था, लेकिन गलत process होने की संभावना ज्यादा होने से इसे लागू नहीं किया गया
Comments handling
- Mystical के comments program के किसी specific point की ओर इशारा करने वाले incomplete speech bubble के भीतर small text के रूप में दिखाए जाते हैं
- वास्तविक PostScript comments Mystical renderer के देखने से पहले गायब हो जाते हैं, इसलिए
mystify.pycomments को detectable code sequence में बदलता है - उदाहरण के लिए
% Show a standard message, centered horizontallyजैसा comment इस form में convert होता है(Show a standard message, centered horizontally) /mystical_comment_flag pop pop
- renderer इस pattern को detect करके Mystical comment के रूप में दिखा सकता है
Sample algorithms
- page के ऊपर की drawing Quicksort example है
- Euclid के GCD algorithm का example भी शामिल है
- यह example dmmlib के
/arg {exch def} deffunction का इस्तेमाल करता है
- यह example dmmlib के
Mystical image generation functions
- सभी functions
mystical.psमें defined हैं mystical- array, executable array और dictionary लेकर उन्हें Mystical form में render करता है
- जरूरत होने पर sub-structures तक उतरकर draw करता है
- पूरी image को unit circle में fit करने के लिए scale किया जाता है
mystical_evokemysticalजैसा ही है, लेकिन input के रूप में current dictionary में lookup किया जाने वाला name लेता है
mystical_evoke_labelmystical_evokeजैसा है, लेकिन ऊपर name-definition combined notation जोड़ता है- name sigil सीधा दिखाई दे, इसके लिए image को rotate करता है
- तीनों functions के
_unscaledsuffix वाले versions भी हैं- ये versions scaling step skip करते हैं
- ring thickness 1 unit होने के कारण image काफी बड़ी हो जाती है
- usage Mystical usage notes में है
Mystical image generation program
- अभी उपलब्ध program एक Python script
mystify.pyहै mystify.pyदो काम करता है- पूरे PostScript program को Mystical program के रूप में draw करने वाले code से wrap करता है, और उसे 8.5x11 page के center में 8-inch width में रखता है
%से शुरू होने वाली PostScript comment lines को Mystical comments में convert करता है
- file की शुरुआत के comments convert नहीं किए जाते
- उदाहरण:
%!PS
- उदाहरण:
- समान indentation वाली adjacent comment lines को line breaks सहित एक लंबे comment के रूप में treat किया जाता है
-
Layout constraints
- current code layout calculate करता है ताकि sub-circles collide न करें
- calculation बहुत ज्यादा safe है, इसलिए ज्यादातर programs बहुत फैले हुए हो सकते हैं
- page example parsing/layout functions
mystical_get_spell,mystical_make_evocation_ligatureचलाने के बाद result को adjust करके, औरdraw_sigil,draw_linkcall करके बनाया गया था - default layout को improve करने की योजना है
क्या इसे भाषा माना जा सकता है
- फिलहाल Mystical PostScript program को draw करने का तरीका है
- Mystical image को input लेकर उचित computation करने वाला कोई interpreter नहीं है
- इंसान Mystical image पढ़कर execute भी कर सकता है, या अधिक संभवतः उसे PostScript program में बदलकर चला सकता है
दूसरी languages पर लागू होने की संभावना
- यह approach Forth जैसी केवल operators वाली languages पर भी लागू हो सकती है
- अधिक complex sentence structure वाली languages पर इसे लागू करना मुश्किल हो सकता है
- braces या indentation हर बार नई ring बनाने से चीजें बहुत complex हो जाएंगी या नहीं, यह पता नहीं है
अभी कोई टिप्पणी नहीं है.