Most of the work is already done by Adham Zahran, but still, there are some needed fixes.
Here's what to do.
-
Install Qt 5 (and preferably QtCreator too).
-
Install
libffi
(sudo apt install libffi-dev
on Debian/Ubuntu). -
Clone the repo
git clone --depth 1 https://gitlab.com/lordadamson/kalimat cd kalimat
-
Fix the transition from QtGui to QtWidgets:
echo 'QT += widgets' >> kalimat/kalimat.pro sed -i 's/<QtGui/<QtWidgets/' kalimat/main.cpp
-
Change
assert
insmallvm
to something else:sed -i 's/assert/_ASSERT_/g' $(grep assert -r smallvm -l | grep -P '\.cpp$|\.h$')
-
Fix
ارجع ب:
: the lexer doesn't understand this, apparently because it's three tokens; maybe something during the development of the English Kalimat made this error slip, anyway: we can "fix" it by simply modifying it into a single token. I suggestأرجع
(with an Alef with Hamza above), that's the correct spelling, but as everywhere else in the language all these verbs (that should start with an Alef with Hamza above) start with a normal, bald Alef, I reluctantly suggest modifying it toارجع
instead (which is the imperative of the intransitive verb, instead of the transitive one), so... forget all that and do the following command:sed -i 's/ ب://' kalimat/keywords.txt
Now, in every example code, change
ارجع ب:
to justارجع
(i.e., remove ب:
). -
Open
kalimat/kalimat.pro
in QtCreator, configure, build, and run!Now you can copy (or symlink) the built
kalimat
binary into your$PATH
. -
See these resources:
- مثال كرات متحركة بكلمات مع الكود.
- مثال آلة حاسبة بلغة كلمات مع الكود.
- تحقيق الذات في كتابة البرمجيات بلغة كلمات: كتاب
كامللمبتدئي البرمجة، أطفالًا أو كبارًا. - دليل استخدام كلمات: للمبرمجين الذين يعرفون لغات أخرى ويريدون تعلّم كلمات.
- كلمات بالآمثلة: عرض سريع لكل إمكانات اللغة في صورة أمثلة.
- مرجع اللغة (PDF).
- الدوال الجاهزة.
- موقع اللغة.
- عن كلمات (النسخة الأخيرة).
- عن كلمات (نسخة سابقة بها أمثلة)، بعضها:
-
فصيلة شخص: له اسم، سن، أبناء، غني نهاية ك = شخص جديد اسم ك = "كريم" سن ك = ٣٣ أبناء ك = ["ندى"، "مديحة"، "لبنى"] غني ك = خطأ حرر(ك)
-
مثال tail-call elimination (ما هي النداءات الذيلية؟):
إجراء عداد(أ، ب): إذا أ <> ب: اطبع أ وكل إلى عداد(أ+١، ب) تم نهاية عداد(١، ١٠٠٠٠)
-
ز = زر جديد ن = النافذة.الحالية() ز: حدد.المكان(٣٥٠، ٣٠) ز: حدد.الحجم(٨٠، ٢٠) ز: حدد.النص("اضغط هنا") ن: اضف(ز) كرر: تسلم إشارة من ضغط ز اطبع "لقد ضغطت الزر" تابع
-
- change the single character
…
to the three characters...
. - change the occasional curly
“
to a straight ASCII"
. - change
طالما <شرط>:
to كرر مادام <شرط>:
, but طالما صحيح:
to just كرر:
. - change every return-statement from
ارجع ب:
to justارجع
(i.e., remove ب:
). (See step 6 above.) - some other methods built-in methods are not defined at all.
Note about the screenshots: I input eastern Arabic numerals, and Kalimat understands them, but it always outputs western Arabic numeral.