Blockly is a visual programming editor developed by Google that uses drag-and-drop blocks to represent code concepts. It's designed to make coding more accessible, especially for beginners, by eliminating the need to worry about GCBASIC syntax. Blockly is used in popular coding education programs like Scratch and Code.org.
To implement Blockly for GCBASIC, we would typically follow these steps:
Set Up Blockly: Download and include the Blockly library in GCBASIC project. Using the Blockly library and documentation on the Blockly GitHub page.
Create a Blockly Instance: Initialize Blockly for the GCBASIC project. This involves setting up the Blockly editor and defining the blocks you want to use.
Generate Code: Use Blockly to generate GCBASIC code from the blocks. Blockly can produce clean code in the GCBASIC language, which you can then use in a GCBASIC project.
Run GCBASIC Code: Integrate the generated GCBASIC code into a GCBASOC project and run it on a target device ( PIC/AVR or LGT ).
Issues with implementing Blockly
Implementing Blockly can be quite powerful, but there are some common issues you might encounter:
Browser Compatibility: Blockly relies heavily on JavaScript and HTML5, which can sometimes lead to compatibility issues across different browsers. Ensuring that an implementation works seamlessly across all major browsers is crucial.
Performance: For large and complex projects, performance can become a concern. The drag-and-drop functionality and real-time updates can slow down if not optimized properly.
Customization Challenges: While Blockly is highly customizable, setting up custom blocks and integrating them with the existing GCASBIC codebase can be tricky. It requires a good understanding of both Blockly's block definitions and the target programming language.
Debugging: Debugging Blockly code can be more challenging compared to traditional text-based code. Since Blockly abstracts away the syntax, it can be harder to pinpoint errors and understand the flow of the program.
Learning Curve: Although Blockly is designed to be user-friendly, there is still a learning curve, especially for those who are new to visual programming or the specific implementation details of Blockly.
Integration with Backend: Integrating Blockly with backend services or databases can require additional work to ensure smooth data flow and synchronization.
Blockly is on the list of projects for 2025.
What are your thoughts? This is job #2 in 2025, so your input is very important.
Evan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is creating, on behalf of google, an alternative to using GCBasic and handing all of the Credit to Google. We should be encouraging people to learn GCBasic, not Google Blockly.
From your description it would appear the the users wouldn't even see, or know, that they are using GCBASIC . We are effectively providing a compiler backend so that google can claim to support the 100's of devices that GCBASIC supports.
The effort to do that dilutes the core compile and is time better spent and enhancing the Core Compiler, not handing over for Google to claim credit and moneytarise.
GCBASIC development resources should be focused on GCBASIC.
👎
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is the replacement for Graphic GCBASIC. If you have not experienced Graphic GCBASIC recently is lacks many, many, many of the features of text based GCBASIC.
This is not a Google thing. There are many tools like this but Blockly was selected as this has a great Open Source approach on GitHub.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Many of us may remember using wooden blocks (in primary school) to learn how fractions worked. This was a visual experience that was very effective for children.
Visual programming (or coding as they now call it in schools) has been shown to be the most effective method of introducing primary & middle school students to the power of microcontrollers. As Albert Einstein once said "One picture is worth 1000 words."
Just look at where much of Flowcode's (www.flowcode.co.uk) income comes from - Schools in the UK, France, Belgium etc). Flowcode claimed (some years ago) that their visual programming software is taught in over 700 schools & universities:(https://www.flowcode.co.uk/old_site/resources/files/datasheets/TEFLC4-60-7.pdf
Unfortunately Flowcode has been rather lax in supporting later released micros, which is where GCB shines.
Scratch & Blockly have also been extensively taught in schools over the years.
I just wanted to point Evan in the direction of Adel Kassah, a middle school coding teacher from Tunisia (16 years) and now in the UAE (3 years). Adel created Blocklyduino Enhanced. He added quite a few IoT library functions & mathematical calculations to the standard Blockly library. He also uses Python (with Block coding) for the ESP32 & ESP8266. His website (which needs a bit of updating) is www.easycoding.tn
You can run his code using a web browser, or you can run it offline.
I've programmed both ST6/7 & PIC16F parts using Realizer since 1997. It is a visual programming language that combines a-type-of FPGA programming (as in AND,OR, Data Latches, delays, oscillators etc) with a structured order to ensure everything is completed in the correct order. Behind every "icon" is an Assembly Language equivalent (just like GCB). The Realizer engine then assembled the Assembly instructions in the order dictated by the user. So, like GCB, small & fast code was generated.
Unfortunately Actum Solutions released their last update to Realizer in 2015 & disbanded in ~2021.
I would support an advanced form of Blockly (with GCB sitting behind it) to encourage young users to experience Great Cow Basic. I do realise however, that Evan, Kent, Angel & others only have a fixed amount of time to spend on GCB & Blockly support must work in with everything else.
Other user's comments are most welcome below.
😄
2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've never used a block language like flowcode in my life.
I tried it but I didn't like it.
I come from assembler and when I was in university I wrote some code that performed Fourier analysis completely in assembler.
I prefer text-based languages, where I have total control of the code.
Certainly the block language makes life easier for beginners. I know people who write very complex programs using Flowcode, but would never be able to write the same code using C or Basic, and, from what they told me, have no intention of learning C or Basic , given that in any case they obtained their result using this system.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Blockly is a visual programming editor developed by Google that uses drag-and-drop blocks to represent code concepts. It's designed to make coding more accessible, especially for beginners, by eliminating the need to worry about GCBASIC syntax. Blockly is used in popular coding education programs like Scratch and Code.org.
To implement Blockly for GCBASIC, we would typically follow these steps:
Set Up Blockly: Download and include the Blockly library in GCBASIC project. Using the Blockly library and documentation on the Blockly GitHub page.
Create a Blockly Instance: Initialize Blockly for the GCBASIC project. This involves setting up the Blockly editor and defining the blocks you want to use.
Generate Code: Use Blockly to generate GCBASIC code from the blocks. Blockly can produce clean code in the GCBASIC language, which you can then use in a GCBASIC project.
Run GCBASIC Code: Integrate the generated GCBASIC code into a GCBASOC project and run it on a target device ( PIC/AVR or LGT ).
Issues with implementing Blockly
Implementing Blockly can be quite powerful, but there are some common issues you might encounter:
Browser Compatibility: Blockly relies heavily on JavaScript and HTML5, which can sometimes lead to compatibility issues across different browsers. Ensuring that an implementation works seamlessly across all major browsers is crucial.
Performance: For large and complex projects, performance can become a concern. The drag-and-drop functionality and real-time updates can slow down if not optimized properly.
Customization Challenges: While Blockly is highly customizable, setting up custom blocks and integrating them with the existing GCASBIC codebase can be tricky. It requires a good understanding of both Blockly's block definitions and the target programming language.
Debugging: Debugging Blockly code can be more challenging compared to traditional text-based code. Since Blockly abstracts away the syntax, it can be harder to pinpoint errors and understand the flow of the program.
Learning Curve: Although Blockly is designed to be user-friendly, there is still a learning curve, especially for those who are new to visual programming or the specific implementation details of Blockly.
Integration with Backend: Integrating Blockly with backend services or databases can require additional work to ensure smooth data flow and synchronization.
Blockly is on the list of projects for 2025.
What are your thoughts? This is job #2 in 2025, so your input is very important.
Evan
Why?
It is not enhancing or improving GCBasic.
It is creating, on behalf of google, an alternative to using GCBasic and handing all of the Credit to Google. We should be encouraging people to learn GCBasic, not Google Blockly.
From your description it would appear the the users wouldn't even see, or know, that they are using GCBASIC . We are effectively providing a compiler backend so that google can claim to support the 100's of devices that GCBASIC supports.
The effort to do that dilutes the core compile and is time better spent and enhancing the Core Compiler, not handing over for Google to claim credit and moneytarise.
GCBASIC development resources should be focused on GCBASIC.
I should have mentioned.
This is the replacement for Graphic GCBASIC. If you have not experienced Graphic GCBASIC recently is lacks many, many, many of the features of text based GCBASIC.
This is not a Google thing. There are many tools like this but Blockly was selected as this has a great Open Source approach on GitHub.
Many of us may remember using wooden blocks (in primary school) to learn how fractions worked. This was a visual experience that was very effective for children.
Visual programming (or coding as they now call it in schools) has been shown to be the most effective method of introducing primary & middle school students to the power of microcontrollers. As Albert Einstein once said "One picture is worth 1000 words."
Just look at where much of Flowcode's (www.flowcode.co.uk) income comes from - Schools in the UK, France, Belgium etc). Flowcode claimed (some years ago) that their visual programming software is taught in over 700 schools & universities:(https://www.flowcode.co.uk/old_site/resources/files/datasheets/TEFLC4-60-7.pdf
Unfortunately Flowcode has been rather lax in supporting later released micros, which is where GCB shines.
Scratch & Blockly have also been extensively taught in schools over the years.
I just wanted to point Evan in the direction of Adel Kassah, a middle school coding teacher from Tunisia (16 years) and now in the UAE (3 years). Adel created Blocklyduino Enhanced. He added quite a few IoT library functions & mathematical calculations to the standard Blockly library. He also uses Python (with Block coding) for the ESP32 & ESP8266. His website (which needs a bit of updating) is www.easycoding.tn
You can run his code using a web browser, or you can run it offline.
I've programmed both ST6/7 & PIC16F parts using Realizer since 1997. It is a visual programming language that combines a-type-of FPGA programming (as in AND,OR, Data Latches, delays, oscillators etc) with a structured order to ensure everything is completed in the correct order. Behind every "icon" is an Assembly Language equivalent (just like GCB). The Realizer engine then assembled the Assembly instructions in the order dictated by the user. So, like GCB, small & fast code was generated.
Unfortunately Actum Solutions released their last update to Realizer in 2015 & disbanded in ~2021.
I would support an advanced form of Blockly (with GCB sitting behind it) to encourage young users to experience Great Cow Basic. I do realise however, that Evan, Kent, Angel & others only have a fixed amount of time to spend on GCB & Blockly support must work in with everything else.
Other user's comments are most welcome below.
I've never used a block language like flowcode in my life.
I tried it but I didn't like it.
I come from assembler and when I was in university I wrote some code that performed Fourier analysis completely in assembler.
I prefer text-based languages, where I have total control of the code.
Certainly the block language makes life easier for beginners. I know people who write very complex programs using Flowcode, but would never be able to write the same code using C or Basic, and, from what they told me, have no intention of learning C or Basic , given that in any case they obtained their result using this system.