Malical syntax highlighting for GNU nano editor
Posté le 11/07/2023 20:41
While I don't know how many of you are still programming in
Malical and how many are using nano editor to do it, I thought it can't hurt to share my syntax file
Following instructions are for Linux, don't know exactly how but I'm sure you can apply it for nano running under Windows...
To use it just create a file named "malical.nanorc" in your local .nano folder, where other syntax files usually reside, with the following content:
syntax "Malical" "\.mcl"
## Variables
color red "\<(var)\>"
## Control structures
color brightcyan "\<(if|while|else|end)\>"
## Defined functions
color brightblue "::.*"
color brightblue "\<(return)\>"
## Library functions
color orange "\<(sin|cos|tan|atn|int|abs|rand|val|tos|chr|asc|mid|len|type|eval|locate|print|printrev|printxy|printmini|printnum|printnumxy|printnummini|gets|getkey|iskeydown|line|box|circle|allclr|areaclr|lineclr|arearev|setpoint|getpoint|putdisp|popupwin|savedisp|rcldisp|rclpict|push|delete|clear|sizeof|showap|rtcreset|setyear|setmonth|setdomonth|setdoweek|sethour|setminute|setsecond|readyear|readmonth|readdomonth|readdoweek|readhour|readminute|readsecond|exit|sleep|cpuspeed|waitkey)\>"
## Strings
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
## Comments
color gray "#.*"
Then add that syntax to your .nanorc file, like this:
## Malical
include "~/.nano/malical.nanorc"
Hope this helps, happy programming!
(Edit: moved the comments at the bottom of the file, now they work as they should)
Citer : Posté le 11/07/2023 22:47 | #
Malical! That's one thing I wasn't expecting when I woke up today. I've never had the pleasure to program with it but I can see from the wiki that it's a custom language. As a language/compilation researcher now, I can't help but ask are there any fun things in this language that stray away from the typical imperative language with custom syntax?
Citer : Posté le 11/07/2023 22:54 | #
As one of the local expert in malical (self-proclaimed), appart from the list type that is python-like, it's just your regular imperative language.
The implementation however is quite clean and worth a look, but maybe not for someone with your background.
Citer : Posté le 12/07/2023 00:15 | #
I've just started playing with it a couple of days ago, so I'm far from being an expert
What I like so far is that it's a dynamically typed language, the application doesn't take up too much space on the calculator, the program source code seems to be also smaller compared to C for dPicoC, to say nothing about WSC/FVM, and it is rather fast for graphic display.
When I'll get some free time on my hands I'll look into adapting it for the newer CG-50, if it's possible without extensive rewriting. Guess the only incompatibility will be CPU overclocking, though I just took a quick glance at Malical's source code...
Guess the first step would be to manage to compile it for 9860G using fxsdk instead of the Casio SDK.
Citer : Posté le 13/07/2023 00:31 | #
I think I never heard something about this language before , but it seems cool !
libMicrofx : https://www.planet-casio.com/Fr/forums/topic17259-2-libmicrofx-remplacez-fxlib-pour-faire-des-add-ins-tres-legers.html !
Racer3D : https://www.planet-casio.com/Fr/programmes/programme4444-1-racer3d-mb88-jeux-add-ins.html
Citer : Posté le 13/07/2023 09:56 | #
Most of the things one can find about Malical are written by the authors, "diameter" and "Wudy", in Chinese, on cnCalc.
I used google translate on that forum and managed to register an account, so I've been able to download the attachments
I'm trying now to use the old Casio SDK to rebuild the project, maybe add file functions to it... something that was promised to be released in 2012... we can safely say it's not happening
Unfortunately the latest source files I found are for version 2.15, and the compiled app seems to be 2.50
If you're interested in this language, check out a translation of one of the posts below:
Translation
P.S.: after more than 40 years of programming, most of them working as a software developer, and having seen quite a lot of languages during this time, somehow Malical caught my eye. It has a certain "je ne sais quoi" that appeals to me.