Inviting Python Inside Ring

240 views
Skip to first unread message

Mansour Ayouni

unread,
Feb 23, 2025, 12:56:45 PM2/23/25
to The Ring Programming Language
Hello All,

Ring is a smart and innovative programming language, and I’m well-positioned to say that it excels in both small and large-scale projects.

Actually, SoftanzaLib, a multi-year project with hundreds of thousands of lines of code, is a testament to Ring’s capabilities. However, like any young language, Ring faces challenges in adoption due to the lack of an extensive track record  and an active ecosystem—especially when it comes to professional and customer-facing applications.  

To try to break this barrier, I introduced the `py()` feature—an intuitive mechanism that allows seamless execution of Python code within Ring, with more other languages to come in the future.

Read on to discover how it works:

All the best,
Mansour

Ilir Liburn

unread,
Feb 23, 2025, 1:25:15 PM2/23/25
to The Ring Programming Language
Hello Mansour,

Congratulations. I agree with your statement: A Game-Changer for the Ring Ecosystem. Better than Haxe because it doesn't rely on specific target builds.

Greetings,
Ilir

Mansour Ayouni

unread,
Feb 23, 2025, 6:07:54 PM2/23/25
to Ilir Liburn, The Ring Programming Language
Hello Ilir,  

Thanks! You’re absolutely right—that independence is a key strength.

That said, I also have a plan to support Haxe in the future to leverage its powerful cross-language translation. At some point, I’ll share my vision on how this could bring value to Ring and Softanza.  

Best regards,  
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/e9425a93-bfb3-4a50-a061-ce021713ddbcn%40googlegroups.com.

Ilir Liburn

unread,
Feb 23, 2025, 7:03:57 PM2/23/25
to The Ring Programming Language
Hello Mansour,

I think Haxe have only one target worth considering: HL (by Niko) which is a high performant VM (compiling and execution). Any other target will only transpile Haxe code to specific target code (for example to Python) which then just adds more steps in translation (via Eval which isn't fastest thing) and generates some Haxe specific code (helper libraries). It is better to execute target code directly which is then helpful for users able to find some specific code snipets on the internet (like Python code).

HL bytecode is generated and stored similarly to the Ring's object. Therefore, code like myHL = hl() {...} should be used to avoid recompiling (so that myHL {...} can be reused).

Greetings,
Ilir

Mansour Ayouni

unread,
Feb 23, 2025, 7:33:14 PM2/23/25
to Ilir Liburn, The Ring Programming Language
Hello Ilir,

Thanks for your insight! Haxe brings some unnecessary complexity then.

Best,
Mansour

Ilir Liburn

unread,
Feb 23, 2025, 7:34:38 PM2/23/25
to The Ring Programming Language
Hello Mansour,

You're Welcome.

Greetings,
Ilir

Mansour Ayouni

unread,
Feb 24, 2025, 8:49:54 AM2/24/25
to Ilir Liburn, The Ring Programming Language
Hello Ilir,

I spent a few hours this morning integrating the R language into the system. It’s really just a matter of configuring a list and writing a data type transformation function in the target language—nothing more to it!

What took time was the trial and error involved in getting the R transformation function to work (even with the aid of AI), since I’m using the language for the first time.

Here’s a data visualization graphic generated by one of the scripts I experimented with:

image.png

And here is the detailed article:

Best,
Mansour

Bert Mariani

unread,
Feb 24, 2025, 12:11:16 PM2/24/25
to The Ring Programming Language
Hello Mansour

Impressive stuff with the interface to Python and R !!
Will assume you know enough of these languages as to when to call and use them.
Also  Ring has a built in interface to C.

Note: Python and R  are built on C.
           You need a certain mindset to use and understand R - statistical computing and graphics.

Mansour Ayouni

unread,
Feb 24, 2025, 3:42:39 PM2/24/25
to Bert Mariani, The Ring Programming Language
Hello Bert,

You're right!

This approach aligns with the reality of multi-language projects, allowing programmers from diverse backgrounds to collaborate seamlessly under the umbrella of a main Ring program.

This is exactly what I plan to experiment with in a real-world project—I’ll keep you posted!  

Best,
Mansour



Mansour Ayouni

unread,
Feb 24, 2025, 6:01:14 PM2/24/25
to Bert Mariani, The Ring Programming Language
Hello,

In this technical article, I describe how this Softanza External Code Integration System (EXCIS) has been designed, what are the guidelines and best practices (for Python and R code), how it works, and how it can be extended:


Best,
Mansour

Mahmoud Fayed

unread,
Feb 26, 2025, 4:35:09 AM2/26/25
to The Ring Programming Language
Hello Mansour

Thanks for starting this topic and working on this powerful feature.

Just some suggestions

(1) As Bert said many programming languages including Python is based on C (At least the standard CPython implementation)
Such languages provide features to be embedded in C projects (i.e. called from C code)
And since in Ring we can develop extension based on C (These extensions are C projects that can call/use Python as a library)
Providing integration using this way comes with many advantages (and some disadvantages too)
But it's a common way for full integration.
Source: 

Such tasks could be contributed by developers with knowledge about C language and share the same interest.

(2) Using your beautiful feature in the current way looks like spreading SQL statements in many modules inside a database app.

Suggestion: Providing an abstraction layer (Ring Classes) for ML algorithms, and these classes called be implemented in different ways where using Python could be an optional way that can be changed in the future based on your decisions.

In most projects you will use specific number of ML algorithms in specific way (common way) and the abstraction idea match this common use-cases.
Where the current way match more general needs.

(3) Machine learning algorithms could be implemented in Ring itself, but to avoid performance problems, an implementation based on RingFastPro (After improving these extensions to match the required needs) could be more strategic option for future development.

(4) Writing Ring extensions (In C) as Bert Mariani and Azzeddine Ramal did in many tasks, provides more power at high-performance, If they are interested to contribute to your work in the future, this library will reach different levels of usability and performance since the library scope is very large and you are already doing too much work.

Just my little suggestions.

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Feb 26, 2025, 4:36:36 AM2/26/25
to The Ring Programming Language
Hello Mansour

This is the official documentation about Embedding Python in C projects:  1. Embedding Python in Another Application — Python 3.13.2 documentation

Greetings,
Mahmoud

Mansour Ayouni

unread,
Feb 26, 2025, 4:47:55 AM2/26/25
to Mahmoud Fayed, The Ring Programming Language

Hello Mahmoud,

Thank you very match for our thoughts wich I share completely!

Going the C extension way to extend Ring capabilities is the best strategic path we should take as a community to let Ring talk the language of modern AI and ML applications.

In this regard, the modest contribution I made will help a non-C and low level developer like me to quickly craft my projects prototypes, and for educational scenarios implying many languages to get an easy environment to work in.

PS: I have a plan of a high level ML and AI library built ontop of other lower level tools, called ZaiLib.

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.

max

unread,
Feb 26, 2025, 4:59:49 AM2/26/25
to The Ring Programming Language
Hallo Mahmoud,

I have a question for you. numpy is a library implemented in C.

Do you think Ring needs such a library or Ring lists are also as strong as numpy.

Is it possible to bring numpy to Ring as a extention?

Mahmoud Fayed

unread,
Feb 27, 2025, 6:18:32 AM2/27/25
to The Ring Programming Language
Hello Max

Ring lists are designed to be flexible and such flexibility comes with a cost (Performance/Memory)

C extensions could be used to improve the performance or memory usage

Some extensions are designed to be used in many cases by providing fast list operations or arrays

In Python world there are numpy for such purpose

In Ring, we have RingFastPro (Eary stage of development and requires a lot of improvements and features to satisfy the use-cases for many apps)


So, my plan is to improve RingFastPro (Not to copy an existing library like numpy)

Greetings,
Mahmoud

Mohamed AbdElhalim

unread,
Jun 21, 2025, 1:45:03 PM6/21/25
to The Ring Programming Language
"Can you also support the Alf programming language ?"


>>  To try to break this barrier, I introduced the `py()` feature—an intuitive mechanism that allows seamless execution of Python code within Ring, with more other languages to come in the future.

Mansour Ayouni

unread,
Jun 21, 2025, 4:30:35 PM6/21/25
to Mohamed AbdElhalim, The Ring Programming Language
Hello Mohamed,

I did not know that this language ever existed! It seems interesting and I'll study the opportunity to support it.

Thank you!
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.

Mansour Ayouni

unread,
Jun 21, 2025, 10:55:25 PM6/21/25
to Mohamed AbdElhalim, The Ring Programming Language
Hello Mohamed,

After exploring the language, I decided it has no added value to Prolog which I already included as a tool for logical programming.

All the best,
Mansour

Mohamed AbdElhalim

unread,
Jun 22, 2025, 5:52:53 AM6/22/25
to The Ring Programming Language
Maybe later,
 because the official version hasn't been released yet.
It is under development.

Bert Mariani

unread,
Jun 22, 2025, 9:05:26 AM6/22/25
to The Ring Programming Language
Hello ALL

RE:   "Can you also support the Alf programming language ?"

Ring is Ring !!
It you want to write in some other language -- go ahead -- don't use Ring!!
Mixing up languages leads to a Big Mess !!

If you want to use Ring ... use it as is.
If you need some routine or speed ... write it using the Ring C Interface.
That's it. That's what Ring supports.
Don't know C or how to do it, its not hard ... make an effort and learn.

Ring is a wonderful and flexible language in its own right.
There is the Ring Documentation pdf ... extremely useful as a reference doc.

Best Regards to ALL
Bert Mariani

Mohamed AbdElhalim

unread,
Jun 22, 2025, 12:50:07 PM6/22/25
to The Ring Programming Language

Subject: Clarification Regarding Alf Language Suggestion

Dear Bert,

Thank you for your clear and candid response. I truly understand and respect your position regarding preserving the purity and identity of the Ring programming environment.

My suggestion to consider support for the Alf language was never intended to complicate or mix languages unnecessarily. Rather, it stemmed from technical curiosity and a sincere interest in expanding the possibilities within Ring. Alf is an initiative by an Arab developer, inspired by Python, that aims to offer high performance while being more accessible to Arabic speakers. In a world where multi-language projects are the norm, I was genuinely interested in your perspective on including a Python-like environment within Ring—especially since Python was mentioned in the thread title without concern.

As an Arab, I was also drawn to the idea of integrating an Arabic-based language within Ring’s ecosystem to make it more inclusive for non-English-speaking developers in our region. This aligns, in fact, with the vision of Ring’s original creator, who aimed to empower the Arabic-speaking community with a programming environment that speaks their language.

If you were in my place, I believe you'd have felt a similar motivation: a desire to feel that we, as Arabic-speaking developers, have a place within this exciting system.

I appreciate your commitment to Ring’s philosophy and respect your perspective. Still, I believe every developer views things through a unique lens, and open conversations like this can lead to new possibilities.

Warm regards, Mohamed Abdelhalim

Mansour Ayouni

unread,
Jun 22, 2025, 6:10:10 PM6/22/25
to Mohamed AbdElhalim, The Ring Programming Language
Hello Mohamed, Bert and All.

My vision for modern programming is to use each language for its purpose, all in a well integrated and easy to use Ring environment.

I explained this polyglot programming paradigm and why I selected each programming  language, along with practical examples, in this article:

All the best,
Mansour


Antonio F.S.

unread,
Jun 23, 2025, 4:05:19 AM6/23/25
to ring...@googlegroups.com

Hello Mansour,

And here I was, unaware of this fantastic site! :-) :-) I loved the article and will read the rest as well!

Thank you very much.
Best regards,
Antonio F.S.
--------------------------------------------------------------------

El 23/6/25 a las 0:09, Mansour Ayouni escribió:

Mansour Ayouni

unread,
Jun 23, 2025, 6:52:34 AM6/23/25
to Antonio F.S., ring...@googlegroups.com

Hello Antonio,
Always welcome!
Thank you.
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.
Reply all
Reply to author
Forward
0 new messages