mirage335 / SigBlockly-mod

Automatic integration of SigBlockly modifications over upstream Blockly repository, adding minimal support for C, Bash, and other languages.
Other
1 stars 0 forks source link

A New Request -- On How It Works and How To Add New Languages #1

Open sanyaade-iot opened 5 years ago

sanyaade-iot commented 5 years ago

Hi @mirage335 ,

This is a request and not a bug or other things. I have followed your SigBlockly-mod which I strongly believe will help me and many others like me who will like to not only to study Blockly but to be able to add new language extension to it.

SigBlockly is a great tool! A brief (a paragraph or two ) on important parts of it, how it works and how to add a new language will greatly appreciated. This could be based on the steps you taken and how you add the C language as an example. Many thanks!

Many thanks for all your efforts!

Hear from you soon!

God blesses!!!

Best regards, Sanyaade

mirage335 commented 5 years ago

Greetings, thanks for the interest, and thanks for the suggestions. Also, if you are using SigBlockly, I am curious to know more.

Proper documentation from me for "SigBlockly-mod"/"SigBlockly" is probably several months away. Too many other things do not exist at all, possibly including another graphical programming environment. Pull requests welcome!

Briefly though, IIRC, adding a new language starts with "_construct_generator", which copies the relevant JavaScript/HTML/etc files to a new directory, and modifies them with the new language name. Once appropriate code has been added to this 'template', it is copied to the "overlay". From there, the "_refresh_overlay" function copies individual files as appropriate, overwriting files in "Blockly". All automatic procedures are included in "core.sh", which is concatenated into "ubiquitous_bash.sh", where all variable definitions may be found. https://github.com/mirage335/SigBlockly-mod/blob/master/ubiquitous_bash.sh https://github.com/mirage335/SigBlockly-mod/blob/master/_prog/core.sh https://github.com/mirage335/SigBlockly-mod/tree/master/_lib/modules/overlay https://github.com/mirage335/SigBlockly-mod/tree/master/_lib

So, to create a template for the "c" language, the first thing to do might be to run this command. ./ubiquitous_bash.sh _construct_generator "c" "C"

Adding new languages may not always be necessary though. "SigBlockly" has 'arbitrary' blocks, which allow graphical programming with completely arbitrary code snippets.

SigBlockly just adds C, BASH, arbitrary blocks, and some custom blocks for specific things like network configuraton. If signal processing functions/macros are available, it can be used in a manner similar to GNURadioCompanion, with native C output. Lately, it has been used for CoreAutoSSH logical network configuration, where being able to visually see how the code is structured might help prevent mistakes that would make machines unreachable. https://github.com/mirage335/BiosignalProcessor/blob/850d4fb78d80a6cf030c0b834572b6a1d9e02fb4/src/BiosignalProcessor.c#L216 https://github.com/mirage335/ubiquitous_bash/blob/9a9054992a0efcd883cbc949b897c21d7b47cf5c/_lib/ssh/ops.png

sanyaade-iot commented 5 years ago

@mirage335

Just getting back here to see your reply. Many thanks! I am following all your instructions above and do those outlines step by step

Many thanks for your effort!

Great! Once again many thanks! I will be working on this through the Easter period. I will give you a shout if I need more help!

God blesses!!!

Best regards, Sanyaade