Ring: A Lightweight and Versatile Cross-Platform Dynamic Programming Language Developed Using Visual Programming
Abstract
:1. Introduction
- According to our knowledge, this is the first study to use visual programming to develop and maintain a compiler and virtual machine for a dynamic programming language over many years. We started development in September 2013, and the first version of the Ring language was released in January 2016. We have provided multiple releases each year to improve the design and respond to community feedback. Ring 1.21.2 was released in September 2024;
- Novel features that can extend the object-oriented programming paradigm, enabling the development of domain-specific languages that resemble CSS and Supernova. Additionally, Ring’s customization features, such as syntax modification, could support multiple languages (e.g., Arabic, English);
- The design and implementation of a dynamic programming language with broad cross-platform compatibility, featuring a lightweight implementation that still provides rich features.
2. Related Work
3. Materials and Methods
3.1. System Architecture
3.2. Non-English Syntax
- The user interface is designed using the Ring form designer. The form file (try.rform) generates the tryView.ring file, which contains the RingQt source code that defines the window controls and layouts and sets the default style;
- In the controller class (tryController.ring), we determine the Ring code that will be executed based on user interaction with the application GUI;
- The (style.ring) file contains the Style class, which changes colors based on the selected style. The default style is Black, and the user can change it to another predefined style (Black, White, Blue, Modern, or Windows);
- The (samples.ring) file contains a Ring list that provides the predefined samples, where each sample is represented through a nested list containing the sample name and the sample code;
- The (ringvm.ring) file contains a class that enables the sample’s source code to be run in an isolated Ring virtual machine. If the sample produces a runtime error or terminates the program, we can still use the Try Ring Online application executed by the caller VM;
- The (onlinering.ring) file contains functions that are automatically called before executing any sample code in the nested VM. These functions override the standard functions used for input/output operations. When the console application requires an input, these functions will pause the sub VM. Later, when the user enters the required data, the caller VM will update the state of the sub VM, set the variable value, and then resume the sub VM.
3.3. Domain-Specific Languages
3.4. Object-Oriented Programming (OOP)
3.5. Batteries Included
3.6. The IDE and the Form Designer
3.7. The Implementation (Using Visual Programming)
- Applying principles such as “Don’t Repeat Yourself” (DRY) and the “Keep it simple and stupid” (KISS) principle;
- Using a single-pass compiler where the parsing and code generation are interleaved;
- The ability to separate the compiler and the virtual machine and use any of them alone;
- All the built-in functions are grouped in optional modules through preprocessor directives;
- Ring Lists vs. C Structures: In most cases, we opted for Ring Lists over C structures;
- Selective Use of C Structures: However, in specific features where performance impact matters significantly, we chose to use C structures. These targeted optimizations enhance critical parts of the language;
- Flexible List Implementation: Our list implementation combines various data structures and optimization techniques, including Doubly Linked Lists, Deques (Double-Ended Queues), Singleton Caches, arrays of pointers, Hash Tables, and continuous memory blocks. This flexibility accommodates diverse use cases;
- One block for Bytecode Storage: The bytecode resides in a single continuous memory block, avoiding fragmentation. Moreover, we intentionally allocate extra space within this block. This foresight reduces the need for frequent memory reallocation during runtime, especially when using the Eval() function;
- Writable Long-Byte Code Format: The bytecode format uses a longer representation, which allows for performance improvements. During runtime, instructions can be dynamically replaced with faster alternatives, all without resorting to just-in-time compilation to machine code or bloating the implementation size;
- The Virtual Machine does not use a global interpreter lock (GIL), which results in better performance when utilizing threads for CPU-bound tasks.
4. Results
4.1. Early Users and the Programming Language Used Prior to Ring (2016)
4.2. Feedback from Online Course (2017–2018)
4.3. Feedback After a One-Hour Lecture (2019)
4.4. Downloads Statistics and Users Group (2016–2024)
4.5. Use Cases and Printed Books (2017–2024)
4.6. Visual Implementation (2013–2024)
4.7. Lightweight Implementation
4.8. Performance Benchmarks
5. Discussion
- Large Storage Size: Visual implementations tend to occupy more storage space compared to their textual counterparts. This is an important consideration, especially when dealing with large projects;
- Memory Requirements for Multiple Instances: The PWCT environment is designed to open one visual source file at a time. To work with multiple files simultaneously, you need to run multiple instances of PWCT. Unfortunately, this approach comes with a memory cost. Opening all the visual source files related to the Ring compiler and virtual machine implementation (43 files) requires approximately 1.3 GB of memory. This could become an issue for larger projects that contain more visual source files, where opening these files simultaneously for quick navigation could be problematic. This might be required when searching in multiple files. We also noticed that PWCT supports search/replace in a single visual source file, which is not practical for large projects. To work around this issue, we used external tools to search in the generated textual source code;
- Limitations of the Steps Tree Editor: The Steps Tree editor lacks support for drag-and-drop functionality. Moving steps within the tree is possible only through cut-and-paste operations. While this may not be a critical issue, it is worth noting for usability purposes because it forces using the keyboard to move steps faster from one location to another;
- Performance Challenges with Large Visual Source Files: When dealing with visual source files containing thousands of components, performance can become an issue. Loading such files or generating source code may exhibit slower behavior. For example, our largest file (genlib_ext) contains 1732 components and 2965 steps. Loading the file and displaying the visual representation takes over two seconds, while generating the source code takes over 14 s, as demonstrated in Figure 21 and Figure 22. This results in slow development and iteration when tasks involve updating many visual source files;
- No support for importing textual source code. This missing feature introduces many limitations. If a programmer submits a GitHub pull request by modifying the textual source code of the Ring Compiler/VM, we cannot simply import these changes. Additionally, this is a barrier to integrating with AI tools that generate textual code. While in visual implementation, we could use external libraries provided through textual code (without visual implementation), the problem occurs when the generated source code (from visual implementation) is modified directly by other contributors in the project without making the change through visual programming first and then generating the textual source code. This leads to effort duplication. This demonstrates a limitation on collaborative development efforts. For users who might wish to integrate Ring with existing workflows or tools and are looking to modify the language implementation, we recommend making a choice and sticking to it: either use the visual implementation and make any changes through it first or use the generated textual source code and continue development based on it;
- PWCT is designed to work only under Microsoft Windows. The support for other operating systems is not native and requires extra tools (Like Wine for Linux).
- Separate the visual source into many files with clear names and purposes;
- Keep each visual source file to fewer than a few thousand steps;
- Open related visual source files according to the current task while closing unrelated visual source files (or not opening them) to provide easy navigation between PWCT instances through the operating system features;
- External tools are needed when searching multiple generated source code files.
6. Conclusions and Future Work
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
ANSI | American National Standards Institute |
CDF | Cognitive Dimensions Framework |
CGT | Code Generation Time |
CSS | Cascading Style Sheets |
DRY | Don’t Repeat Yourself |
DSL | Domain Specific Language |
FAQ | Frequently Asked Questions |
GIL | Global Interperter Lock |
GUI | Graphical User Interface |
IDE | Integrated Development Environment |
IDSL | Internal Domain-Specific Language |
IoT | Internet of Things |
JSON | JavaScript Object Notation |
KISS | Keep it simple and stupid |
KLOC | Thousands of lines of code |
LLM | Large Language Model |
LOC | Lines of Code |
LT | Loading Time |
ML | Machine Learning |
OOP | Object Oriented Programming |
PWCT | Programming Without Coding Technology |
REPL | Read-Eval-Print-Loop |
SQL | Structured Query Language |
SWIG | Simplified Wrapper and Interface Generator |
VFP | Visual FoxPro |
VI | Visual Implementation |
VM | Virtual Machine |
VPL | Visual Programming Language |
References
- Vanilla, O.; Yu, J.; Abdalla, H.B. Cesno: The Initial Design of a New Programming Language. In Proceedings of the International Conference on Computing, Control and Industrial Engineering, Wuhan, China, 21–22 June 2024; Springer Nature: Singapore, 2024; pp. 128–146. [Google Scholar]
- Noone, M.; Mooney, A. Visual and textual programming languages: A systematic review of the literature. J. Comput. Educ. 2018, 5, 149–174. [Google Scholar] [CrossRef]
- Wilhelm, R.; Seidl, H. Compiler Design: Virtual Machines; Springer: Berlin/Heidelberg, Germany, 2010; Volume 10. [Google Scholar]
- Mitchell, J.C. Concepts in Programming Languages; Cambridge University Press: Cambridge, UK, 2003. [Google Scholar]
- Ortin, F.; Garcia, M.; Perez-Schofield, B.G.; Quiroga, J. The StaDyn programming language. SoftwareX 2022, 20, 101211. [Google Scholar] [CrossRef]
- Gao, K.; Mei, G.; Piccialli, F.; Cuomo, S.; Tu, J.; Huo, Z. Julia language in machine learning: Algorithms, applications, and open issues. Comput. Sci. Rev. 2020, 37, 100254. [Google Scholar] [CrossRef]
- Pang, A.; Anslow, C.; Noble, J. What programming languages do developers use? A theory of static vs dynamic language choice. In Proceedings of the 2018 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC), Lisbon, Portugal, 1–4 October 2018; pp. 239–247. [Google Scholar]
- Callaú, O.; Robbes, R.; Tanter, É.; Röthlisberger, D. How developers use the dynamic features of programming languages: The case of smalltalk. In Proceedings of the 8th Working Conference on Mining Software Repositories, Honolulu, HI, USA, 21–22 May 2011; pp. 23–32. [Google Scholar]
- Armstrong, J. A history of Erlang. In Proceedings of the Third ACM SIGPLAN Conference on History of Programming Languages, San Diego, CA, USA, 9–10 June 2007; pp. 6-1–6-26. [Google Scholar]
- Paulson, L.D. Developers shift to dynamic programming languages. Computer 2007, 40, 12–15. [Google Scholar] [CrossRef]
- Kay, A.C. The early history of Smalltalk. In History of Programming Languages—II; Association for Computing Machinery: New York, NY, USA, 1996; pp. 511–598. [Google Scholar]
- McCarthy, J. History of LISP. In History of Programming Languages; Association for Computing Machinery: New York, NY, USA, 1978; pp. 173–185. [Google Scholar]
- Fayed, M.S.; Al-Qurishi, M.; Alamri, A.; Al-Daraiseh, A.A. PWCT: Visual language for IoT and cloud computing applications and systems. In Proceedings of the Second International Conference on Internet of things, Data and Cloud Computing, Cambridge, UK, 22–23 March 2017; Volume 2017, pp. 1–5. [Google Scholar]
- Dasgupta, S.; Hill, B.M. Learning to code in localized programming languages. In Proceedings of the Fourth (2017) ACM Conference on Learning@ Scale, Cambridge, MA, USA, 20–21 April 2017; Volume 2017, pp. 33–39. [Google Scholar]
- Maloney, J.; Resnick, M.; Rusk, N.; Silverman, B.; Eastmond, E. The scratch programming language and environment. ACM Trans. Comput. Educ. (TOCE) 2010, 10, 1–15. [Google Scholar] [CrossRef]
- Bassil, Y. Phoenix—The Arabic Object-Oriented Programming Language. arXiv 2019, arXiv:1907.05871. [Google Scholar]
- Hamid, M. Design of an Arabic programming language (ARABLAN). Comput. Lang. 1995, 21, 191–201. [Google Scholar]
- Gasolin. Zhpy Python Package. 2020. Available online: https://pypi.org/project/zhpy/ (accessed on 11 October 2024).
- de Mooij, G. Citrine Programming Language. 2014. Available online: https://citrine-lang.org/ (accessed on 11 October 2024).
- Mahmoud, F. Supernova Programming Language. 2010. Available online: https://supernova.sourceforge.net/ (accessed on 11 October 2024).
- Lyu, R.Y.; Kuo, Y.H.; Liu, C.N. Machine translation of English identifiers in python programs into traditional Chinese. In Proceedings of the 2016 International Computer Symposium (ICS), Chiayi, Taiwan, 15–17 December 2016; pp. 622–625. [Google Scholar]
- Stanojević, M.; Stanojević, B. Lua APIs for mathematical optimization. Procedia Comput. Sci. 2024, 242, 460–465. [Google Scholar] [CrossRef]
- Ierusalimschy, R.; de Figueiredo, L.H.; Celes, W. The evolution of Lua. In Proceedings of the Third ACM SIGPLAN Conference on History of Programming Languages, San Diego, CA, USA, 9–10 June 2007; pp. 2-1–2-26. [Google Scholar]
- Ierusalimschy, R. Programming in Lua; Roberto Ierusalimschy: Rio de Janeiro, Brazil, 2006. [Google Scholar]
- Ierusalimschy, R.; De Figueiredo, L.H.; Filho, W.C. Lua—An extensible extension language. Softw. Pract. Exp. 1996, 26, 635–652. [Google Scholar] [CrossRef]
- Nystrom, R. Crafting Interpreters; Genever Benning: Mumbai, India, 2021. [Google Scholar]
- Apodaif, M.G.; Shohdy, A.; Farghal, A. Layout Automation of Variable Gain Amplifier Circuit based on TCL Language. Sohag Eng. J. 2024, 4, 87–99. [Google Scholar] [CrossRef]
- Hammen, J. Bipscript: A domain-specific scripting language for interactive music. In Proceedings of the 17th Linux Audio Conference (LAC-19), CCRMA, Stanford, CA, USA, 23–26 March 2019. [Google Scholar]
- Welch, B.B.; Jones, K.; Hobbs, J. Practical Programming in Tcl and Tk; Prentice Hall Professional: Hoboken, NJ, USA, 2003. [Google Scholar]
- Wetherall, D.; Lindblad, C.J. Extending Tcl for Dynamic Object-Oriented Programming. In Proceedings of the Tcl/Tk Workshop, Toronto, ON, Canada, 6–8 July 1995; Volume 670. [Google Scholar]
- Ousterhout, J.K. Tcl: An Embeddable Command Language; University of California, Berkeley, Computer Science Division: Berkeley, CA, USA, 1989. [Google Scholar]
- Giorgi, F.M.; Ceraolo, C.; Mercatelli, D. The R language: An engine for bioinformatics and data science. Life 2022, 12, 648. [Google Scholar] [CrossRef] [PubMed]
- Moler, C.; Little, J. A history of MATLAB. In Proceedings of the ACM on Programming Languages; Association for Computing Machinery: New York, NY, USA, 2022; Volume 4, pp. 1–67. [Google Scholar]
- Granor, T.E.; Hennig, D.; Roche, T.; Martin, D. Hacker’s Guide to Visual FoxPro 7.0; Hentzenwerke: Milwaukee, WI, USA, 2002. [Google Scholar]
- Moore, A.D. Python GUI Programming with Tkinter: Design and Build Functional and User-Friendly GUI Applications; Packt Publishing, Ltd.: Burmingham, UK, 2021. [Google Scholar]
- Hao, J.; Ho, T.K. Machine learning made easy: A review of scikit-learn package in python programming language. J. Educ. Behav. Stat. 2019, 44, 348–361. [Google Scholar] [CrossRef]
- Summerfield, M. Rapid GUI programming with Python and Qt: The Definitive Guide to PyQt Programming; Pearson Education: London, UK, 2007. [Google Scholar]
- Ruys, W.; Lee, H.; You, B.; Talati, S.; Park, J.; Almgren-Bell, J.; Yan, Y.; Fernando, M.; Biros, G.; Erez, M.; et al. A Deep Dive into Task-Based Parallelism in Python. In Proceedings of the 2024 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), San Francisco, CA, USA, 27–31 May 2024; pp. 1147–1149. [Google Scholar]
- Eggen, R.; Eggen, M. Thread and process efficiency in python. In Proceedings of the International Conference on Parallel and Distributed Processing Techniques and Applications (PDPTA), Las Vegas, NV, USA, 29 July–1 August 2019; pp. 32–36. [Google Scholar]
- Masini, S.; Bientinesi, P. High-performance parallel computations using python as high-level language. In Proceedings of the Euro-Par 2010 Parallel Processing Workshops: HeteroPar, HPCC, HiBB, CoreGrid, UCHPC, HPCF, PROPER, CCPI, VHPC, Ischia, Italy, 31 August–3 September 2010; Revised Selected Papers. Springer: Berlin/Heidelberg, Germany, 2011; Volume 16, pp. 541–548. [Google Scholar]
- Rockoff, L. The Language of SQL; Addison-Wesley Professional: Boston, MA, USA, 2021. [Google Scholar]
- Attardi, J. Modern CSS; Springer: Berlin/Heidelberg, Germany, 2020. [Google Scholar]
- Günther, S.; Cleenewerck, T. Design principles for internal domain-specific languages: A pattern catalog illustrated by ruby. In Proceedings of the 17th Conference on Pattern Languages of Programs, Irsee, Germany, 11–15 July 2012; pp. 1–35. [Google Scholar]
- Maximilien, E.M.; Wilkinson, H.; Desai, N.; Tai, S. A domain-specific language for web apis and services mashups. In Proceedings of the Fifth International Conference on Service-Oriented Computing–ICSOC 2007, Vienna, Austria, 17–20 September 2007; Springer: Berlin/Heidelberg, Germany, 2007; Volume 5, pp. 13–26. [Google Scholar]
- Fayed, M.S.; Al-Qurishi, M.; Alamri, A.; Hossain, M.A.; Al-Daraiseh, A.A. PWCT: A novel general-purpose visual programming language in support of pervasive application development. CCF Trans. Pervasive Comput. Interact. 2020, 2, 164–177. [Google Scholar] [CrossRef]
- Suresh, P.; Daniel, J.V.; Parthasarathy, V.; Aswathy, R.H. A state of the art review on the Internet of Things (IoT) history, technology and fields of deployment. In Proceedings of the 2014 International Conference on Science Engineering and Management Research (ICSEMR), Chennai, India, 27–29 November 2014; pp. 1–8. [Google Scholar]
- Zikria, Y.B.; Ali, R.; Afzal, M.K.; Kim, S.W. Next-generation internet of things (iot): Opportunities, challenges, and solutions. Sensors 2021, 21, 1174. [Google Scholar] [CrossRef]
- Fayed, M.S. Network generations and the security challenge in IoT applications. arXiv 2022, arXiv:2201.01927. [Google Scholar]
- Silangern, H.; Tanaka, K. Internet of Things Implemented with Mruby. In Proceedings of the International Conference on Computational Science and Its Applications, Hanoi, Vietnam, 1–4 July 2024; Springer Nature: Cham, Switzerland, 2024; pp. 165–181. [Google Scholar]
- Tanaka, K.; Ogura, S.; Krishnamoorthy, R.; Sugiyama, K.I.; Kawahara, M. Flexibility and Productivity in IoT Programming: A Case Study with Mruby. In Proceedings of the International Conference on Advanced Research in Technologies, Information, Innovation and Sustainability, Madrid, Spain, 18–20 October 2023; Springer Nature: Cham, Switzerland, 2023; pp. 17–27. [Google Scholar]
- Plauska, I.; Liutkevičius, A.; Janavičiūtė, A. Performance Evaluation of C/C++, MicroPython, Rust and TinyGo Programming Languages on ESP32 Microcontroller. Electronics 2022, 12, 143. [Google Scholar] [CrossRef]
- Halfacree, G.; Everard, B. Get Started with MicroPython on Raspberry Pi Pico: The Official Raspberry Pi Pico Guide; Raspberry Pi Press: London, UK, 2021. [Google Scholar]
- Ray, P.P. An overview of WebAssembly for IoT: Background, tools, state-of-the-art, challenges, and future directions. Future Internet 2023, 15, 275. [Google Scholar] [CrossRef]
- Yan, Y.; Tu, T.; Zhao, L.; Zhou, Y.; Wang, W. Understanding the performance of WebAssembly applications. In Proceedings of the 21st ACM Internet Measurement Conference, Virtual Event, 2–4 November 2021; pp. 533–549. [Google Scholar]
- Gallant, G. WebAssembly in Action: With Examples Using C++ and Emscripten; Simon and Schuster: New York, NY, USA, 2019. [Google Scholar]
- Juric, S. Elixir in Action; Simon and Schuster: New York, NY, USA, 2024. [Google Scholar]
- Vegi, L.F.D.M.; Valente, M.T. Code smells in Elixir: Early results from a grey literature review. In Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension, Pittsburgh, PA, USA, 16–17 May 2022; pp. 580–584. [Google Scholar]
- Deo, A.K.A.; Gupta, S.; Kundu, R.; Jaiswal, P.; Fatma, T.; Dehury, M.K. Performance and Metrics Analysis Between Python3 via Mojo. In Proceedings of the 2024 2nd International Conference on Sustainable Computing and Smart Systems (ICSCSS), Virtual Event, 10–12 July 2024; pp. 1291–1297. [Google Scholar]
- Xurshid, M. Differences between Mojo and Python programming languages. In Proceedings of the Conference on Digital Innovation: Modern Problems and Solutions, Ho Chi Minh City, Vietnam, 21–22 June 2023. [Google Scholar]
- Lutz, M. Programming Python; O’Reilly Media, Inc.: Sebastopol, CA, USA, 2001. [Google Scholar]
- Thomas, D.; Fowler, C.; Hunt, A. Programming Ruby—The Pragmatic Programmer’s Guide; Pragmatic Programmers, LLC: Raleigh, NC, USA, 2004; Volume 238. [Google Scholar]
- Marson, R.L.; Jankowski, E. Build management with CMake. In Introduction to Scientific and Technical Computing; CRC Press: Boca Raton, FL, USA, 2016; pp. 119–132. [Google Scholar]
- Spinellis, D. Git. IEEE Softw. 2012, 29, 100–101. [Google Scholar] [CrossRef]
- Wirth, N. The programming language Pascal. Acta Inform. 1971, 1, 35–63. [Google Scholar] [CrossRef]
- Cottom, T.L. Using SWIG to bind C++ to Python. Comput. Sci. Eng. 2003, 5, 88–97. [Google Scholar] [CrossRef]
- Franz, M. Dynamic linking of software components. Computer 1997, 30, 74–81. [Google Scholar] [CrossRef]
- Lazar, G.; Penea, R. Mastering Qt 5: Create Stunning Cross-Platform Applications Using C++ with Qt Widgets and QML with Qt Quick; Packt Publishing, Ltd.: Birmingham, UK, 2018. [Google Scholar]
- Leff, A.; Rayfield, J.T. Web-application development using the model/view/controller design pattern. In Proceedings of the Fifth IEEE International Enterprise Distributed Object Computing Conference, Seattle, WA, USA, 4–7 September 2001; pp. 118–127. [Google Scholar]
- Thau, R. Design considerations for the Apache Server API. Comput. Networks ISDN Syst. 1996, 28, 1113–1122. [Google Scholar] [CrossRef]
- Westra, E. Modular Programming with Python; Packt Publishing, Ltd.: Birmingham, UK, 2016. [Google Scholar]
- Stroustrup, B. What is object-oriented programming? IEEE Softw. 1988, 5, 10–20. [Google Scholar] [CrossRef]
- le Clercq, A.; Almroth, K. Comparison of Rendering Performance Between Multimedia Libraries Allegro, SDL and SFML; KTH Royal Institute of Technology, School of Electrical Engineering and Computer Science: Stockholm, Sweden, 2019. [Google Scholar]
- Fahy, R.; Krewer, L. Using open source libraries in cross platform games development. In Proceedings of the 2012 IEEE International Games Innovation Conference, Rochester, NY, USA, 7–9 September 2012; pp. 1–5. [Google Scholar]
- Smith, S.; Smith, S. How to Connect Pico to IoT. In RP2040 Assembly Language Programming: ARM Cortex-M0+ on the Raspberry Pi Pico; Apress: Berkeley, CA, USA, 2022; pp. 265–289. [Google Scholar]
- Fayed, M.S. General-purpose visual language and information system with case-studies in developing business applications. arXiv 2017, arXiv:1712.10281. [Google Scholar]
- Chin, J.M.; Chin, M.H.; Van Landuyt, C. A String Search Marketing Application Using Visual Programming. e-J. Bus. Educ. Scholarsh. Teach. 2013, 7, 46–58. [Google Scholar]
- Ierusalimschy, R.; De Figueiredo, L.H.; Celes Filho, W. The Implementation of Lua 5.0. J. Univers. Comput. Sci. 2005, 11, 1159–1176. [Google Scholar]
- Ike-Nwosu, O. Inside the Python Virtual Machine; Leanpub: Victoria, BC, Canada, 2015. [Google Scholar]
- Zagallo, T. A New Bytecode Format for JavaScriptCore. 2019. Available online: https://webkit.org/blog/9329/a-new-bytecode-format-for-javascriptcore/ (accessed on 12 October 2024).
- Dahm, M. Byte code engineering. In JIT’99: Java-Informations-Tage 1999; Springer: Berlin/Heidelberg, Germany, 1999; pp. 267–277. [Google Scholar]
- Nässén, H.; Carlsson, M.; Sagonas, K. Instruction merging and specialization in the SICStus Prolog virtual machine. In Proceedings of the 3rd ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, Florence, Italy, 5–7 September 2001; pp. 49–60. [Google Scholar]
- Pedersen, J.B.; Kauke, B. Resumable Java Bytecode–Process Mobility for the JVM. In Communicating Process Architectures; IOS Press: Amsterdam, The Netherlands, 2009; pp. 159–172. [Google Scholar]
- Ring Team. Ring Programming Language Website. Available online: http://ring-lang.github.io (accessed on 13 October 2024).
- Downloads Statistics from the Ring Programming Language Mirror Hosted on SourceForge. Available online: https://sourceforge.net/projects/ring-lang/files/stats/timeline?dates=2016-01-21+to+2024-10-01 (accessed on 11 November 2024).
- Alohali, Y.A.; Fayed, M.S.; Mesallam, T.; Abdelsamad, Y.; Almuhawas, F.; Hagr, A. A Machine Learning Model to Predict Citation Counts of Scientific Papers in Otology Field. BioMed Res. Int. 2022, 2022, 2239152. [Google Scholar] [CrossRef]
- Fayed, M.S. Classification of the chess endgame problem using logistic regression, decision trees, and neural networks. arXiv 2021, arXiv:2111.05976. [Google Scholar]
- Ayouni, M. Beginning Ring programming; Apress: New York, NY, USA, 2020; Volume 978. [Google Scholar]
- Steam platform. GoldMagic800 Game. 2018. Available online: https://store.steampowered.com/app/939200/Gold_Magic_800/ (accessed on 11 October 2024).
- Alohali, Y.A.; Fayed, M.S.; Abdelsamad, Y.; Almuhawas, F.; Alahmadi, A.; Mesallam, T.; Hagr, A. Machine Learning and Cochlear Implantation: Predicting the Post-Operative Electrode Impedances. Electronics 2023, 12, 2720. [Google Scholar] [CrossRef]
- Ghanem, M. Developing Poet Software Using Ring Language; MetaBook: Mansoura, Egypt, 2021; ISBN 978-977-6928-38-1. Available online: https://ring-lang.github.io/ref/GhanemBookUsingRing.pdf (accessed on 11 October 2024). (In Arabic)
- Hassouna, A. Over 500 Videos to Learn the Ring Language. Available online: https://www.youtube.com/playlist?list=PLHIfW1KZRIfl6KzfLziFl650MmThnQ0jT (accessed on 11 October 2024).
- Su, H.; Jiang, S.; Lai, Y.; Wu, H.; Shi, B.; Liu, C.; Liu, Q.; Yu, T. ARKS: Active Retrieval in Knowledge Soup for Code Generation. arXiv 2024, arXiv:2402.12317. [Google Scholar]
- Green, T.R.G.; Petre, M. Usability analysis of visual programming environments: A ‘cognitive dimensions’ framework. J. Vis. Lang. Comput. 1996, 7, 131–174. [Google Scholar] [CrossRef]
- Green, T.; Blackwell, A. Cognitive dimensions of information artefacts: A tutorial. In Proceedings of the BCS HCI Conference, Sheffield, UK, 1–4 August 1998; Volume 98, pp. 1–75. [Google Scholar]
- Green, T.R.; Blandford, A.E.; Church, L.; Roast, C.R.; Clarke, S. Cognitive dimensions: Achievements, new directions, and open questions. J. Vis. Lang. Comput. 2006, 17, 328–365. [Google Scholar] [CrossRef]
Refs. | Category | Examples |
---|---|---|
[22,23,24,25] | Lightweight and Embeddable | Lua, Squirrel, Wren, etc. |
[29,36] | Comes with Ready-to-Use Libraries | Tcl, Perl, Python, etc. |
[12,43] | Support creating Embedded DSLs | Lisp, Ruby, etc. |
[11,34] | Comes with Powerful IDEs | Smalltalk, Visual FoxPro, etc. |
[19,20] | Supporting Non-English Syntax | Supernova, Citrine, etc. |
[32,33,34] | Domain-specific dynamic languages | R, xBase, etc. |
[9,56,57] | Concurrency-oriented design | Erlang, Elixir, etc. |
[6,58,59] | Comes with a focus on Performance | Julia, Mojo, etc. |
[49,50,51,52] | Other implementations | MicroPython, mRuby, etc. |
Criteria | Lua [24] | Python [60] | Ruby [61] | VFP [34] | Supernova [20] | Proposed Language (Ring) |
---|---|---|---|---|---|---|
Open Source | √ | √ | √ | X | √ | √ |
Portable | √ | √ | √ | * | * | √ |
Lightweight | √ | * | * | X | √ | √ |
Embeddable | √ | √ | √ | X | X | √ |
Dynamic Typing | √ | √ | √ | √ | √ | √ |
Function like Eval() | √ | √ | √ | √ | X | √ |
Classes Concept | * | √ | √ | √ | X | √ |
Inheritance Concept | * | √ | √ | √ | X | √ |
Private Attributes | * | * | √ | √ | X | √ |
Batteries Included | * | √ | √ | √ | * | √ |
IDE | * | √ | * | √ | * | √ |
Form Designer | * | * | * | √ | * | √ |
Non-English Syntax | * | * | * | * | √ | √ |
Case insensitive | X | X | X | √ | √ | √ |
1-based indexing | √ | X | X | √ | √ | √ |
Change Keywords | X | X | X | X | X | √ |
Internal DSL | √ | √ | √ | √ | X | √ |
IDSL (Custom Syntax) | X | X | X | X | X | √ |
Visual Implementation | X | X | X | X | √ | √ |
VI Based on CPWCT | X | X | X | X | X | √ |
Desktop | √ | √ | √ | √ | √ | √ |
Web | √ | √ | √ | √ | X | √ |
WebAssembly | * | √ | √ | X | X | √ |
Microcontroller | * | * | * | X | X | √ |
No-GIL | √ | * | * | X | X | √ |
Register based VM | √ | X | X | X | X | X |
Off-side rule | X | √ | X | X | X | X |
xBase (Database DSL) | X | X | X | √ | X | X |
C Compiler | Platform/OS (Target) |
---|---|
Watcom C/C++ | MS-DOS |
Microsoft Visual C/C++ | Microsoft Windows |
GNU C/C++ | Ubuntu Linux |
Clang | macOS |
Android-clang | Android |
Emscripten | WebAssembly |
GNU ARM embedded toolchain | Raspberry Pi Pico |
Domain | C/C++ Libraries/Tools | Count |
---|---|---|
Terminal User Interface (TUI) | ConsoleColors and RogueUtil | 2 |
Network and Security | LibCurl, Libuv, and OpenSSL | 3 |
Web Servers | HTTPLib and Apache Web Server | 2 |
Database | ODBC, SQLite, MySQL, and PostgreSQL | 4 |
Games & multi-media | Allegro, LibSDL, RayLib and Tilengine | 4 |
Graphics | OpenGL, FreeGLUT and StbImage | 3 |
Graphical User Interface (GUI) | Qt, Libui, and NAppGUI | 3 |
Common Files | MiniZip, PDFGen and CJSON | 3 |
SDK for Specific Platforms | Android SDK and Raspberry Pi Pico SDK | 2 |
Command | Parameters | Usage |
---|---|---|
ChangeRingKeyword | OldKeyword NewKeyword | Change language keyword |
ChangeRingOperator | OldOperator NewOperator | Change language operator |
LoadSyntax | Syntax file name as literal | Load syntax file |
EnableHashComments | None | Support using # for comments |
DisableHashComments | None | Disable using # for comments |
Usage (Ring Code) | Output |
---|---|
new DSL { 200 400 Important 50 600 Important 60 10 20 30 40 50 60 Stop 70 80 90 800 Important } | Sum: 1520 Important: 400 600 |
Lesson | Description | Duration (H:M:S) |
---|---|---|
1 | Installing Ring and writing the Hello World program | 0:30:43 |
2 | Input/output, data types, strings, and numbers | 0:36:33 |
3 | Arithmetic/Logical operators and the if Statement | 0:58:20 |
4 | Lists, nested lists, and loops | 1:01:71 |
5 | While Loop | 0:48:34 |
6 | Defining and using Functions | 0:45:30 |
7 | Standard functions | 0:28:39 |
8 | Using Eval() | 0:23:01 |
9 | Internet Library | 0:38:47 |
10 | Database and SQL | 0:33:13 |
11 | Classes and Objects | 0:47:07 |
12 | Declarative Programming | 0:52:29 |
13 | Domain-Specific Languages | 0:19:46 |
14 | Domain-Specific Languages (Part 2) | 0:46:33 |
15 | Functional Programming | 0:42:37 |
16 | Reflection and Meta-Programming | 0:27:57 |
17 | Memory Management and variables scope | 0:58:28 |
18 | Interactive Debugger | 0:22:08 |
Variable | Value |
---|---|
Male | 70 |
Female | 6 |
Completed less than two lessons | 20 |
Completed more than one lesson | 56 |
Completed the course | 23 |
Contributors | 2 |
Ref. | Type | Domain | Description |
---|---|---|---|
[85] | Research Paper | Front-end apps for ML Models | Predicting citations count |
[86] | Research Paper | Front-end apps for ML Models | Predicting game result |
[87] | Printed Book (USA) | Games Development | Shooter Game |
[88] | Steam Game | Games Development | Puzzle Game |
[89] | Research Paper | Text/Data Processing apps | Predicting impedance |
[90] | Printed Book (Egypt) | Text/Data Processing apps | Arabic Poetry Analysis |
[91] | YouTube Videos | Desktop/Web development | Free course |
[92] | Research Paper | LLMs Training | Dataset preparation |
Modules | File Name | Storage (MB) | Memory (MB) | Components | Steps | Visible Steps | Comment | LOC |
---|---|---|---|---|---|---|---|---|
Loader | ring | 2.07 | 21.5 | 211 | 320 | 287 | 35 | 236 |
state | 7.7 | 32 | 513 | 841 | 720 | 77 | 640 | |
General Library | general | 4.32 | 24.6 | 211 | 388 | 321 | 18 | 287 |
hashtable | 2.27 | 35 | 189 | 322 | 268 | 16 | 251 | |
item | 4.04 | 24.3 | 231 | 440 | 356 | 54 | 301 | |
items | 0.54 | 19.3 | 52 | 87 | 74 | 3 | 63 | |
list | 10.85 | 40.1 | 969 | 1798 | 1432 | 118 | 1378 | |
string | 3.94 | 26.6 | 271 | 497 | 399 | 18 | 383 | |
hashlib | 1.72 | 25.5 | 54 | 81 | 70 | 3 | 59 | |
Compiler | codegen | 5.74 | 28.4 | 425 | 700 | 588 | 68 | 543 |
expr | 14.52 | 46.8 | 705 | 1263 | 1059 | 155 | 918 | |
objfile | 5.98 | 29.1 | 524 | 934 | 757 | 85 | 606 | |
parser | 3.61 | 23.9 | 327 | 460 | 415 | 49 | 372 | |
scanner | 10.18 | 37.9 | 790 | 1318 | 1097 | 75 | 1006 | |
stmt | 11.59 | 41.2 | 913 | 1603 | 1376 | 278 | 1132 | |
Virtual Machine | vm | 14.18 | 48.1 | 1498 | 2285 | 1992 | 278 | 1655 |
vmapi | 7.23 | 31.6 | 522 | 874 | 744 | 103 | 673 | |
vmduprange | 0.8 | 21.2 | 70 | 127 | 104 | 6 | 94 | |
vmerror | 1.5 | 20.7 | 139 | 265 | 220 | 37 | 186 | |
vmeval | 2.48 | 21.8 | 233 | 428 | 371 | 81 | 295 | |
vmexit | 1.82 | 21.1 | 83 | 167 | 132 | 15 | 119 | |
vmexpr | 12.28 | 43.8 | 986 | 1817 | 1445 | 57 | 1383 | |
vmext | 10.5 | 36.2 | 34 | 72 | 59 | 9 | 43 | |
vmfuncs | 7.78 | 32.7 | 498 | 1000 | 838 | 206 | 675 | |
vmgc | 11.64 | 41.9 | 922 | 1746 | 1422 | 240 | 1264 | |
vmjump | 1.97 | 21.3 | 119 | 231 | 183 | 11 | 170 | |
vmlists | 7.21 | 30.7 | 379 | 674 | 549 | 36 | 513 | |
vmoop | 11.13 | 39.9 | 820 | 1497 | 1268 | 215 | 1081 | |
vmperformance | 3.45 | 25.6 | 192 | 332 | 273 | 24 | 255 | |
vmstackvars | 6.85 | 30.4 | 487 | 997 | 770 | 81 | 697 | |
vmstate | 5.5 | 27.2 | 385 | 619 | 578 | 146 | 435 | |
vmstrindex | 0.69 | 19.6 | 49 | 78 | 67 | 2 | 61 | |
vmthread | 1.59 | 44.4 | 148 | 262 | 219 | 32 | 191 | |
vmtrycatch | 0.76 | 19.7 | 20 | 38 | 33 | 5 | 25 | |
vmvars | 8.51 | 33.8 | 362 | 685 | 569 | 91 | 497 | |
Built-in Functions | vminfo_ext | 6.06 | 28.1 | 289 | 443 | 389 | 24 | 360 |
dll_ext | 10.74 | 37.1 | 89 | 147 | 123 | 4 | 112 | |
file_ext | 9.57 | 36.9 | 688 | 1235 | 991 | 26 | 961 | |
genlib_ext | 22.75 | 66.6 | 1732 | 2965 | 2438 | 169 | 2308 | |
list_ext | 5.65 | 28.5 | 531 | 982 | 782 | 35 | 740 | |
math_ext | 3.93 | 25.2 | 336 | 649 | 489 | 3 | 497 | |
os_ext | 5.25 | 26.8 | 313 | 572 | 464 | 23 | 427 | |
refmeta_ext | 8.05 | 33.5 | 636 | 1075 | 886 | 26 | 851 |
Criteria | Total |
---|---|
Modules | 5 |
Visual Source Files | 43 |
Storage Size (MB) | 278.95 |
Memory (MB) | 1350.6 |
Visual Components | 18,945 |
Steps | 33,314 |
Steps (Visible) | 27,617 |
Lines of Code (LOC) | 24,743 |
Comments | 3037 |
LOC including comments | 27,780 |
Language | Period | Implementation | LOC (FR) | LOC (LR) | Growth |
---|---|---|---|---|---|
Ring | 2016–2024 | C | 16,402 | 24,743 | 51% |
mRuby | 2014–2024 | C | 18,134 | 23,742 | 31% |
Squirrel | 2004–2022 | C++ | 9311 | 13,991 | 50% |
Lua | 1993–2024 | C | 5603 | 20,081 | 258% |
Benchmark | Ring 1.17 (2022) | Ring 1.19 (2023) | Ring 1.21 (2024) | Ring 1.21 (WebAsm/Edge) | Ring 1.21 (WebAsm/Chrome) | VFP 9.0 | Python 3.13 |
---|---|---|---|---|---|---|---|
Loop (500 K) | 9 | 5 | 4 | 7 | 7 | 8 | 7 |
Loop (1 M) | 18 | 11 | 9 | 13 | 13 | 15 | 14 |
Loop (10 M) | 185 | 113 | 91 | 133 | 132 | 47 | 149 |
Loop (100 M) | 1896 | 1154 | 954 | 1362 | 1332 | 595 | 1534 |
MathMax (100 K) | 136 | 25 | 7 | 11 | 12 | 16 | 7 |
MathMax (1 M) | 1384 | 245 | 69 | 117 | 119 | 94 | 66 |
MathMax (10 M) | 13,847 | 2474 | 708 | 1161 | 1204 | 909 | 776 |
MathMax (100 M) | 139,373 | 24,868 | 7178 | 11,833 | 11,935 | 8968 | 7315 |
FuncCall (100 K) | 111 | 19 | 4 | 10 | 9 | 16 | 3 |
FuncCall (1 M) | 1134 | 194 | 39 | 97 | 94 | 110 | 32 |
FuncCall (10 M) | 11,337 | 1943 | 398 | 1001 | 962 | 1102 | 444 |
FuncCall (100 M) | 113,142 | 19,542 | 4058 | 10,164 | 9563 | 11,214 | 3297 |
FibDP (500) | 6 | 5 | 3 | 3 | 4 | 6 | 0.1 |
FibDP (700) | 11 | 10 | 5 | 5 | 6 | 13 | 0.3 |
FibDP (1000) | 21 | 19 | 10 | 10 | 11 | 15 | 0.4 |
FibDP (1200) | 29 | 27 | 15 | 15 | 17 | 16 | 0.4 |
FibDP (500) | 6 | 5 | 3 | 3 | 4 | 6 | 0.1 |
FibRec (20) | 22 | 6 | 1 | 2 | 3 | 16 | 0.3 |
FibRec (25) | 244 | 65 | 13 | 22 | 23 | 31 | 3 |
FibRec (30) | 2887 | 763 | 148 | 252 | 254 | 377 | 39 |
FibRec (35) | 33,847 | 8660 | 1691 | 2795 | 2810 | 4357 | 431 |
ListFill (100 K) | 10 | 10 | 6 | 11 | 12 | 14 | 5 |
ListFill (500 K) | 54 | 50 | 31 | 56 | 56 | 30 | 19 |
ListFill (1 M) | 108 | 99 | 62 | 112 | 113 | 63 | 35 |
ListFill (10 M) | 1085 | 1007 | 643 | 1143 | 1145 | 565 | 376 |
Language | FPS (Min) | FPS (Max) |
---|---|---|
C | 470 | 480 |
Ring 1.21 | 161 | 170 |
Python 3.13 | 80 | 85 |
Ring 1.20 | 33 | 40 |
Variable | Value |
---|---|
Extension | RingQt |
Configuration Files (Input) | 439 |
Input Size | 478 KB |
Generated Files | 197 |
Generated Lines of Code | 211,174 |
Output Size | 6.27 MB |
Processing Time | 3420 ms |
Application/Sample | Size (LOC) | Loading Time (ms) |
---|---|---|
Analog Clock | 256 | 36 |
Image Pixel | 548 | 66 |
Knight Tour | 646 | 67 |
Othello | 780 | 78 |
Visualize Sort | 817 | 81 |
Game Of Life | 903 | 90 |
Laser | 1051 | 94 |
Checkers | 1354 | 124 |
Get Quotes History | 3401 | 117 |
Discrete Fourier Transform | 6417 | 203 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Fayed, M.S.; Alohali, Y.A. Ring: A Lightweight and Versatile Cross-Platform Dynamic Programming Language Developed Using Visual Programming. Electronics 2024, 13, 4627. https://doi.org/10.3390/electronics13234627
Fayed MS, Alohali YA. Ring: A Lightweight and Versatile Cross-Platform Dynamic Programming Language Developed Using Visual Programming. Electronics. 2024; 13(23):4627. https://doi.org/10.3390/electronics13234627
Chicago/Turabian StyleFayed, Mahmoud Samir, and Yousef A. Alohali. 2024. "Ring: A Lightweight and Versatile Cross-Platform Dynamic Programming Language Developed Using Visual Programming" Electronics 13, no. 23: 4627. https://doi.org/10.3390/electronics13234627
APA StyleFayed, M. S., & Alohali, Y. A. (2024). Ring: A Lightweight and Versatile Cross-Platform Dynamic Programming Language Developed Using Visual Programming. Electronics, 13(23), 4627. https://doi.org/10.3390/electronics13234627