Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Discussions


Index du Forum » Discussions » Malical syntax highlighting for GNU nano editor
Iard Hors ligne Membre Points: 14 Défis: 0 Message

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)


Lephenixnoir Hors ligne Administrateur Points: 24574 Défis: 170 Message

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?
Mon graphe (11 Avril): ((Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; passe gint 3 ; ...) || (shoutbox v5 ; v5)
Hackcell Hors ligne Maître du Puzzle Points: 1531 Défis: 11 Message

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.
Iard Hors ligne Membre Points: 14 Défis: 0 Message

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.
Mb88 Hors ligne Rédacteur Points: 1211 Défis: 3 Message
Iard Hors ligne Membre Points: 14 Défis: 0 Message

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.

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 217 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd