Task for contributors: RingLua

109 views
Skip to first unread message

Mahmoud Fayed

unread,
Aug 16, 2025, 5:36:44 PMAug 16
to The Ring Programming Language
Hello

This is a task for contributors that I hope one of the Ring developers with knowledge about C & Lua will find it interesting to do.

If you fell that you will enjoy this task and decided to do it, please tell us in this topic, The task will be owned/managed by the first contributor who declare interest and then show progress in next 14 days. (To own this task, we expect that you are not already working on another task shared in Ring Group at the same time).

Lua is a known lightweight and embeddable scripting language written in ANSI C and it's one of the programming languages that influenced the Ring language design.

Languages influenced Ring: Introduction — Ring 1.23.0 documentation

Also, Lua is known for being very fast compared to other scripting languages, and with a project like LuaJIT more performance could be achieved: The LuaJIT Project 

Lua is used for game scripting, configurations, 2D game development, etc.
There are many libraries/frameworks for gamedev in Lua like:
2- Solar2D: Solar2D Game Engine
3- LOVR: LÖVR

There are many packages for Lua too: LuaRocks - The Lua package manager

Task Description:
Developing a Ring extension in the C language that provide complete access to the Lua programming language 
1- Lua (latest version) should be embedded in This extension
2- Ring applications can load the extension then execute Lua code
3- The ability to call Lua functions and source code files from Ring code
4- The ability to pass parameters to Lua functions (Strings, Numbers & Lists)
5- The ability to get output of Lua functions in Ring code

This extension should enable Ring developers to write/use libraries written in Lua
Why?
1- Reusing Lua code that already exist
2- Introducing a way to write faster functions 
3- Encouraging Lua programmers who already have written Lua code/libraries to try Ring and use it for developing large GUI apps or domain-specific languages on the top of these libraries.

Once a contributor develops this extension and distribute it as RingPM package, we will test it and provide feedback then:

1- We will announce this extension in Ring Website - News Section
2- We will be very happy to accept a chapter about this extension in Ring documentation
3- Based on extension usability and the quality of the implementation, it could become standard extension in ring/extensions folder.

Notes:
 
(1) Ring comes with code generator for extensions which could help in this task: Code Generator for wrapping C/C++ Libraries — Ring 1.23.0 documentation

(2) It's not necessary for such a task to be picked by one of the contributors NOW, because it's better to be owned by the right person, someone who is already falling in love with Lua, know it's power/secrets then discovered Ring, and decided to create a beautiful bridge between the two languages. 

Greetings,
Mahmoud

Mansour Ayouni

unread,
Aug 16, 2025, 5:53:37 PMAug 16
to Mahmoud Fayed, The Ring Programming Language

Hello Mahmoud,


This is a very promising direction! Ring is already open to C and C++, and extending it to bridge with other active languages would bring tremendous value.


I’m particularly thinking of Python, the de facto language for AI and Machine Learning, which I truly hope will be supported in the future.

Looking forward to seeing this realized.
All the best,
Mansour


--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/344242b4-0548-4f76-9eae-cbc510a9b74an%40googlegroups.com.

Mahmoud Fayed

unread,
Aug 16, 2025, 6:14:56 PMAug 16
to The Ring Programming Language
Hello Mansour

>> "This is a very promising direction! Ring is already open to C and C++, and extending it to bridge with other active languages would bring tremendous value."

I agree with you, also beside C/C++, we have access to JavaScript through RingWebView (by our friend Youssef Saeed)

>> "I’m particularly thinking of Python, the de facto language for AI and Machine Learning, which I truly hope will be supported in the future."

Lua is designed to be embeddable, but Python added such features when people started asking about it (I remember hearing this from a talk by Guido van Rossum, but I don't remember the source exactly). So, Lua is lightweight like Ring (Or to be more accurate, Ring is designed to be lightweight which is a lesson learned from Lua). Embedding lightweight languages is more straightforward and doesn't increase the application size with notable difference.

I am not saying I am not interested in embedding Python in Ring apps when this is necessary, but I think running the Python scripts as external process could satisfy most needs as you already did in StzLib. Embedding Python VM could be done too but not sure how much this could be useful in current use-cases. But if we have a Python developer in our Ring community and is interested in developing RingPython extension, we will encourage him and see the benefits through practical implementation.

Greetings,
Mahmoud

Mansour Ayouni

unread,
Aug 16, 2025, 6:24:41 PMAug 16
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

I agree with you in the cultural requirement of selecting a language to embed with Ring: Lua is a clear choice but Python is not.

Also, thank you for reminding me of the JS bridge made by Youssed in Webview :D

All the best,
Mansour


Mahmoud Fayed

unread,
Aug 16, 2025, 6:31:33 PMAug 16
to The Ring Programming Language
Hello Mansour

>> "Also, thank you for reminding me of the JS bridge made by Youssed in Webview"

You are welcome, such a bridge opens many doors :D

I could imagine a developer enjoying his time while using Ring to develop a domain-specific language on the top of one or more JavaScript libraries like 
Three.js for example: Three.js – JavaScript 3D Library
 
Greetings,
Mahmoud

Bert Mariani

unread,
Aug 21, 2025, 11:06:34 AMAug 21
to The Ring Programming Language
Hello Mahmoud

A couple of comments on LUA
  - Nobody is responding because they don't want to be assigned
  - If I am using Ring, what interest would I have in LUA, when I can use it directly.

  - The biggest issue is always Arrays since 2016.
  - LUA used Tables to implement Arrays - Again not doing Arrays as proper Arrays
  - Arrays should be implemented as the Computer Hardware handles them.
         Fixed length --  Integer,  Floating Point,  Char,  Field  
         with Index Register to address sequential elements or specific element,

Best Regards
Bert Mariani

Mahmoud Fayed

unread,
Aug 21, 2025, 11:50:07 AMAug 21
to The Ring Programming Language
Hello Bert

>> "Nobody is responding because they don't want to be assigned"

1- This task appeals more to someone who already know Ring & Lua, have Lua code & wants to continue development in Ring without rewriting his Lua code/libraries.

2- In open-source world, Things takes time, and as I said in the topic "It's not necessary for such a task to be picked by one of the contributors NOW, because it's better to be owned by the right person, someone who is already falling in love with Lua, know it's power/secrets then discovered Ring, and decided to create a beautiful bridge between the two languages."

3- Using Ring code generator for extensions, and my knowledge about Lua, I could develop RingLUA in ONE DAY at very high quality. but doing this is not enough. This task will be done better by someone who is expert in Lua, knows Lua libraries very well, and have the motivation to bring them to Ring world.

4- This topic is not just about developing (RingLUA) - It's about saying (Welcome) to contributors who have knowledge and want to contribute

>> "If I am using Ring, what interest would I have in LUA, when I can use it directly."

The use-case is using Ring to develop a domain-specific language that uses natural command/declarative style and this DSL uses Lua libraries/frameworks for gamedev.

>> "The biggest issue is always Arrays since 2016."

In Ring, using List() function, create continuous blocks of memory for the list items. 
This is a suitable solution for Ring at the current stage, since we support having different types for each item
And I want to keep the language principles as it in the current stage (using small number of basic types) 
 
RingFastPro, already satisfy my needs when I need more performance, and I could use C/C++ extensions too

Also, our friend Ilir Liburn, is already working on a version of Ring that support Types, Arrays, etc.
This version is designed for high-performance game development.

>> "LUA used Tables to implement Arrays - Again not doing Arrays as proper Arrays"

Lua is very fast, and using LuaJIT ---> WE GET VERY HIGH PERFORMANCE

>> "Arrays should be implemented as the Computer Hardware handles them."

We can do this (as our friend Ilir did in his version of Ring) by reusing our implementation for Ring Strings
In Ring, the String implementation is an array of bytes (each element is 1 byte)
Using the similar idea, we can have Arrays for different types (each element is N bytes)

I know a way to do this without changing the language spirit, but it's not my goal for now because I have more important things to do first.

Remember, it's not just about (Arrays) 
It's about having (BETTER PEROFRMANCE), and Arrays is one thing to do to improve the performance
When I think about the performance, I think about the big picture, not just Arrays.

FINAL WORDS: I HAVE A BIG VISION FOR RING, AT THE CURRENT STAGE I DEVELOP THE LANGUAGE TRYING TO HAVE THE BEST SCRIPTING AND DYNAMIC LANGUAGE, WHEN I FEEL THAT THIS GOAL IS SATISFIED, THE LANGUAGE DESIGN WILL GROW IN NATURAL, BEATUFUL BUT UNEXPECTED WAY AS A SURPRISE ABOUT HOW WE CAN HAVE A LANGUAGE THAT COULD BE SUITABLE FOR ANY PROGRAMMING TASK INCLUDING SYSTEM PROGRAMMING AND HIGH-PEROFRMANCE SOFTWARE DEVELOPMENT WITHOUT SACRIFICING SIMPLICITY OR CHANGING THE LANGUAGE SPIRIT. SOME IDEAS MUST STAY SECRECT AND NEVER SHARED UNTIL IT'S DONE, WE JUST GIVE LITTLE HINTS TO OUR CONTRIBUTORS THAT THEY ARE CONTRIBUTING TO A PROJECT THAT IS DESIGNED TO GROW AND FILL HUGE GAPS IN PROGRAMMING LANGUAGES WORLD. and as a researcher, I learned an important lesson, have big dreams and try to achieve them, no problem if you failed, you would learn something from the journey. 

Greetings,
Mahmoud

Bert Mariani

unread,
Aug 21, 2025, 12:22:22 PMAug 21
to The Ring Programming Language
Hello Mahmoud

RE: " ...Remember, it's not just about (Arrays) 
It's about having (BETTER PEROFRMANCE), and Arrays is one thing to do to improve the performance
When I think about the performance, I think about the big picture, not just Arrays. ..."

This will sound like I am repeating myself ...

I understand what you are saying
Proper Arrays is the Sore Point.  (As the  computer hardware handles them.)
It should have been addressed and fixed 9 years ago.
Its a bottleneck in Ring's lack of performance.
Avoiding the issue  for so long hasn't fixed anything.

Array and Integer should be added as a Basic Type to improve Ring.
I know you are waiting for Ilir .... But.

Years ago hardware did not have Floating Point. Only Integer.
It was implemented in software routines.
Hardware had BCD - Binary Coded Decimal  (4 bits per number)  to handle Decimal Numbers 0-9
Eventually Floating Point Processors on a Chip were developed.
The chip used Lookup Tables to do Floating Point.
It was faster only because the code routine was encoded on the hardware chip.

Remember the Intel Bug when the Lookup Tables have wrong values built in.
It gave wrong answers depending on the data !

Best Regards
Bert Mariani




Mahmoud Fayed

unread,
Aug 21, 2025, 12:54:12 PMAug 21
to The Ring Programming Language
Hello Bert

>> "It should have been addressed and fixed 9 years ago. It's a bottleneck in Ring's lack of performance. Avoiding the issue for so long hasn't fixed anything."

It's not an issue to fix. it's a design decision. each decision comes with trade-offs. 

At the current stage, do you want arrays? do you want types? do you want native performance? 
Just write/use a C extension, all what you need is already provided by the C language (In Ring, we can use extensions written in C/C++ through simple API).

Think about it, Ring is designed for productivity, if we will keep adding features for performance you will reach the next situation
1- Having many features where the language is no longer very high-level & simple. 
2- The implementation complexity will grow very fast, and expect thousands of issues (check GitHub projects for other languages)
3- You will not get the same performance as C/C++ and will switch and use them to get high-performance 

While mixing a high-level language like Ring/Python/Ruby/Perl/Tcl/Lua/etc. and a system language like C/C++/D/Rust/Zig/Odin/Jai/etc. is known as the two-languages problem
IMHO, having everything in one language by adding many features is not the solution (This leads to very complex languages). 
Complexity starts by one step in a direction that you should not move towards (at the current stage) then continue step-after-step until the way back is lost (because applications code will depend on these steps).

Why many C++ developers complain about this great language? ---> BECAUSE IT COMES WITH MANY FEATURES AND IMPLEMENTATION DETAILS AND PROGRAMMERS WANTS TO KNOW EVERYTHING ABOUT THEIR LANGUAGE THAT THEY ARE USING.

Summary:

1- Ring is design according to specific vision and clear goals and it's growing according to this vision (it's a Continuus work, not one shot)
2- When Ring solve the (TWO-LANGUAGES) problem, it will come with novel solution (Not mixing features in one complex language)
3- Ring is open-source, want to add more feature and customize the language according to your ideas?  Create a fork.
4- Our friend Ilir Liburn is using his experience in C/C++, GameDev, etc. and customizing the language, adding more features, this helps him to have the language that he is looking for and also, sharing his work/results with us to get knowledge/feedback. This is how open source is done. You don't like something about the current design? change it. 
5- Ring is a beautiful language and growing such a language towards Systems programming & high-performance software is very attractive but must be done in a beautiful/novel way that match the language spirit, and this direction will not be done now (While I have a plan for it and how it will be done). You are happy with the current Ring implementation except performance, so you are asking for features that improve the performance. But Ring for me is not done yet, I am still not satisfied with the main goal (productivity/customization) - when this is done first, a complete focus on another direction will be started. This doesn't mean performance is not in my mind. Test Ring 1.0 and Ring 1.23 performance difference. You will discover that Ring 1.23 is from 10x to 38x faster than Ring 1.0.

IF I SAID I WILL NOT RELEASE MY LANGUAGE IN 2016 BECAUSE IT'S NOT FAST AS IT TODAY (2025), THEN RING 1.0 WILL NOT BE RELEASED, WE WILL NOT KNOW EACH OTHER, THIS GROUP WILL NOT EXIST, ETC. WE ARE NOT USING RING BECAUSE OF PERFORMANCE - WE ARE USING IT BECAUSE OF SIMPLICITY/PRODUCTIVITY. 

Greetings,
Mahmoud
Reply all
Reply to author
Forward
0 new messages