About Named Objects in Softanza (StzLib)

130 views
Skip to first unread message

Mahmoud Fayed

unread,
Sep 12, 2025, 3:02:09 AM (4 days ago) Sep 12
to The Ring Programming Language
Hello Mansour


I feel that the article could be improved by mentioning that Ring support using references (through Ref()) and using Find() we can find an object inside a list using the object reference.

Example:

aList = [1,2,3]
p1 = new point { x=10 y=20 z=30 }
aList + ref(p1)
aList + 5
? find(aList,p1)
class point x y z

Screen Shot:

findobj.png

Greetings,
Mahmoud


Mansour Ayouni

unread,
Sep 12, 2025, 5:14:57 AM (3 days ago) Sep 12
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Nice to know that Ref() can do that! 

I'll review my implementation of stzList.Find() which is currently limited to finding named objects.

And I'll update the article to change its focus from "Named Objects are a solution to objects findability in Ring" to whatever added value they would provide in other use cases.

Thank you very mutch!

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/7afa79ef-c1fb-4939-8718-d92c240c14e8n%40googlegroups.com.

Mahmoud Fayed

unread,
Sep 12, 2025, 7:16:22 AM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour

You are welcome :D

Greetings,
Mahmoud

Mansour Ayouni

unread,
Sep 12, 2025, 3:20:40 PM (3 days ago) Sep 12
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

After thinking twice about it and read the ref() documentation page, I concluded that it presents some limitations:
  1. Reference Count Behavior Switching: When reference count drops to 1, Ring automatically switches back to "copy by value" behavior, potentially breaking object finding unpredictably.
  2. Object Lifecycle Dependencies: Objects can be garbage collected if references aren't properly maintained, and there's no guarantee references remain stable throughout object lifetime.
  3. Complex Reference Interactions: Circular references create unpredictable behavior, and nested ref() usage has documented limitations.
  4. No Reference Validation: There's no way to verify if a reference is still valid or detect corrupted references.
So, while being usable for educational scenarios, one can't rely on references to find objects inside a list in a production setting...

What do you think?

Best,
Mansour

Mahmoud Fayed

unread,
Sep 12, 2025, 3:31:55 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour

>> "What do you think?"

Your message seems like a text generated by AI and all of the four points doesn't present real things to worry about why using Ref().

Greetings,
Mahmoud

Bert Mariani

unread,
Sep 12, 2025, 3:42:18 PM (3 days ago) Sep 12
to Mahmoud Fayed, The Ring Programming Language
AI doesn't always give the right answer. It easily gives wrong answers. And made up answers.

Found that out by asking simple known answers to  questions in various topics such as math, stock prices, simple coding, banking info  ....

It's an LLM Large Language Model , which is based in the next most likely word, phrase, or sentence.

LLM or scans 15-20 web sites to put together an answer.  Unfortunately the web is full of bad data, false data, garbage data.

Mahmoud Fayed

unread,
Sep 12, 2025, 3:45:56 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour, Bert

Another thing related to this topic

>> "Unlike numbers and strings that can be found using find(oVarName), objects in Ring lists remain anonymous."

This is wrong, using find() we can search in list of objects using object attribute value


Screen Shot:

listofobjects.png

Greetings,
Mahmoud

Mansour Ayouni

unread,
Sep 12, 2025, 4:53:02 PM (3 days ago) Sep 12
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Could you clarify why these do not constitute real concerns? The AI did not invent them but rather distilled them from the documentation. While I am not a low-level expert, the four points appear consistent and seem to merit clarification.

PS: This message is written using AI :D
Best,
Mansour


Mahmoud Fayed

unread,
Sep 12, 2025, 5:22:02 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour

>> "Could you clarify why these do not constitute real concerns?"

Because I said this, do you believe me or you will believe the AI :D :D

>> "The AI did not invent them but rather distilled them from the documentation."

And I am the one who wrote this documentation after investing over one year to implement this feature including writing over 100 tests. Also, our friend Ilir Liburn invested huge time in this feature too (development/testing/etc.)

Check Ring History, this feature is introduced in Ring 1.18 (2023) after over one year from releasing Ring 1.17 (2022)

>> "This message is written using AI"

Using AI to post in the technical groups is not recommended
I will not say THIS IS A SPAM
You are our friend, and I too uses AI, but I use it to automate some tasks, improve English, discuss some concepts.
But your usage for AI in this topic, is not a good use-case ---> It's a waste of time
Why?
Because you used the AI to study a chapter in Ring documentation while
1- You are better than AI to study/analysis this chapter since you are a Ring expert
2- You have direct contact with the chapter author 

So, using AI, what we have is not real 4 questions/issues, but the AI generated something that looks good while it's very !!!!!!

>> "Reference Count Behavior Switching"
This is under your control, since using Ref() when adding objects to the list, we tell Ring to create a Reference
And if the Reference count will drop to 1 where behaviour switching happens (while the object exists in the list), this case doesn't make sense since you will not have the object outside the list to use it as parameter to find() 
i.e. needing these features already requires at least two objects, one inside the list and another one used in the search!
So, the AI is not smart by Rasing this issue!

>> "Object Lifecycle Dependencies"
This generated content is funny! - Using Ref() In Ring is based on Ring lists, all of the behaviour of memory management for Ring lists is already used in every Ring program, we extend this behaviour to copy by reference (nothing more!)

>> "Complex Reference Interactions"
Ring manage references in a very good way, you don't have to worry about the implementation details! 
This point is just an assumption, like someone saying (Every software contains bugs/problems ---> So what?)

>> "No Reference Validation - There's no way to verify if a reference is still valid or detect corrupted references"
This is funny and completely wrong!
Ring is a high-level language and doesn't suffer from such issues!!

>> "While I am not a low-level expert, the four points appear consistent and seem to merit clarification"

NO ---> This AI content is based on data related to other programming languages 
It's not the right way to ask questions 

Greetings,
Mahmoud

Mansour Ayouni

unread,
Sep 12, 2025, 5:24:17 PM (3 days ago) Sep 12
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

I think we are addressing two different issues.

My point is about finding an object by its IDENTITY (the variable name that holds it). In Ring, this is not possible (unlike in other languages) so objects end up being effectively *ANONYMOUS* at runtime.

The statement is then correct because:

o1 = new Point
aList = [ 22, o1, "B", o1 ]

? find(aList, 22)      #--> 1
? find(aList, "B")     #--> 3
? find(aList, o1)      #--> 0  (What this 0 ever means? FALSE, but o1 exists; or index 0 which has no meaning in Ring?

class Point { x=10 y=10 z=10 }

While your point about finding an object through its ATTRIBUTES  is a separate matter. For me, that doesn’t resolve the identity issue; it just shifts the problem into the application domain instead of the language level.

I see this as a conceptual concern in Ring, which actually goes against its simplicity principle, and is likely a consequence of implementing objects internally as lists.

It’s a source of confusion I would prefer not to inherit in Softanza. For now, the Named Object feature will remain the main way of finding objects, unless I can be assured that ref() is guaranteed to be unique and stable for each object in the entire program lifetime.

Best,
Mansour


Ilir Liburn

unread,
Sep 12, 2025, 5:34:03 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour,

don't forget, list element creates the copy of the value (object is copied), so if you want to find external object you need to use

o1 = new Point
aList = [ 22, ref(o1), "B", o1 ]


? find(aList, 22)      #--> 1
? find(aList, "B")     #--> 3
? find(aList,o1 )      #--> 2

Regarding references, you can run into trouble only if you use object2pointer without pointer2object (which finally creates the reference).

Greetings,
Ilir

Mahmoud Fayed

unread,
Sep 12, 2025, 5:35:55 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour

>> "I see this as a conceptual concern in Ring, which actually goes against its simplicity principle, and is likely a consequence of implementing objects internally as lists."

1- The implementation way (using lists) has nothing to do with the features, i.e. it doesn't restrict me during programming the behaviour

2- The current Ring behaviour is what we could consider SIMPLE
It's about (Reducing references usage) - Assignments copy lists/objects by value and adding lists/objects to lists create a new copy/value

3- Using References is Explicit through the Ref() function

>> "For now, the Named Object feature will remain the main way of finding objects"

Do whatever you want/like (StzLib is your software)
Also, In Ring Game Engine for 2D Games we don't use Ref()
We just have the name attribute in each object which could be used to find objects

There is a power when avoiding Ref(), That's why it's optional (not the default behaviour)
Ref() is added based on requests that I received from many programmers, I don't use it in my projects.

PWCT2 source code doesn't use Ref()

THIS TOPIC IS NOT ABOUT WHAT YOU ARE DOING IN STZLIB, IT'S NOT ABOUT THE FEATURE, IT'S ABOUT DESCRIBING RING FEATURES IN A CORRECT/COMPLETE WAY WHEN INTRODUCING STZLIB FEATURES. 

Greetings,
Mahmoud

Mansour Ayouni

unread,
Sep 12, 2025, 5:36:18 PM (3 days ago) Sep 12
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

I trust you of course more than the AI, and that's why I exposed the subject to you.

PS: I don't use AI to write my posts, generally I write them and then I post them with this prompt "Make a better formulation" or "Check english", it's like you advised me years ago to use an online english checker, do you remember that?

And thank you very much for the clarifications you made.

Best,
Mansour

Mahmoud Fayed

unread,
Sep 12, 2025, 5:39:17 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Ilir

>> "Regarding references, you can run into trouble only if you use object2pointer without pointer2object (which finally creates the reference)."

Thank you very much 

Both of Object2Pointer()/Pointer2Object() are documented in Low-Level Functions chapter (Where we announce being careful before usage) - These functions doesn't exist in the Ref() chapter which is more high-level.

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Sep 12, 2025, 5:41:23 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour

>> "I trust you of course more than the AI, and that's why I exposed the subject to you."

Thank you very much

I just said (Because I said this, do you believe me or you will believe the AI :D :D) to bring some fun to the topic :D

Greetings,
Mahmoud

Ilir Liburn

unread,
Sep 12, 2025, 5:41:40 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mahmoud,

You're Welcome.

Greetings,
Ilir

Mansour Ayouni

unread,
Sep 12, 2025, 5:43:52 PM (3 days ago) Sep 12
to Ilir Liburn, The Ring Programming Language
Hello Ilir,

Happy to read your message!

Please explain to me the last sentence in simple terms and it adds to the discussion: does this mean that using ref() to find objects as Mahmoud described is not sufficient and other considerations are to be made?

In other terms, if I decided to use ref() to find objects in StzLib, without reading what you said, does this lead to a weakness in the solution or possible bugs?

Best,
Mansour

Ilir Liburn

unread,
Sep 12, 2025, 5:56:31 PM (3 days ago) Sep 12
to The Ring Programming Language
Hell Mansour,

To my knowledge, there are no bugs related to references in the official Ring. The point is: list always contains data which is a copy of any value unless you use ref() on a list or object type.

Last sentence is related to low level aspect of the Ring where you can get a pointer to a list or object without creating new reference. This can lead to dangled pointer if list/object is destroyed before pointer2object is called or any other operation is performed using the pointer. As long you are using only high level features, you have nothing to worry.

Greetings,
Ilir

Mansour Ayouni

unread,
Sep 12, 2025, 5:58:31 PM (3 days ago) Sep 12
to Ilir Liburn, The Ring Programming Language

Ilir Liburn

unread,
Sep 12, 2025, 6:02:17 PM (3 days ago) Sep 12
to The Ring Programming Language
Hello Mansour,

You're Welcome.

Greetings,
Ilir

Bert Mariani

unread,
Sep 13, 2025, 9:23:19 AM (2 days ago) Sep 13
to The Ring Programming Language
In the RED Corner -- AI  Artificial Intelligence
In the BLUE Corner -- Humans

I Go With the Humans ...
Who wrote this documentation after investing over one year to implement this feature including writing over 100 tests. 
Who invested huge time in this feature too (development/testing/etc.)

It was an Interesting back and forth discussion !  :D  :D

Mansour Ayouni

unread,
Sep 13, 2025, 10:23:40 AM (2 days ago) Sep 13
to Bert Mariani, The Ring Programming Language
Hello Bert,

The feature I mentioned—Named Objects—and the broader challenge of item findability in Ring lists (a core issue in object identity across languages) required months of human effort and thousands of hand-written test cases.

While 98% of Softanza's codebase (over 750K lines) is hand-coded, leveraging AI for coding isn't problematic; the risk lies in dismissing it amid evolving programming practices. Instead, we should develop thoughtful strategies to make AI a productivity ally, rather than resisting change.

AI also excels at accelerating high-quality documentation and testing—areas where over 80% of Softanza's docs were co-created: I outline the structure, provide the test samples after running them in Ring, and iterate with AI for polished results. This approach, from experience, sharpens both coding and technical writing skills, which are uncommon in one developer.

I share this not to challenge your respected view, but to observe that after 10+ years as a pioneer in proposing the natural language programming paradigm, Ring lacks a clear strategic vision for integrating AI, machine learning, and data intelligence.

This is my real battlefield in Softanza, which I designed as a compliment to Ring, and I hope I'll be able to accomplish it.

PS: For whomever it may help: This answer was written by hand and then passed on to AI.
image.png
image.png

Regards,
Mansour



Bert Mariani

unread,
Sep 13, 2025, 10:29:21 AM (2 days ago) Sep 13
to The Ring Programming Language
While working on a simple code  with Claude AI.
It made the same repeated mistake a few times.
I gave me the following respons

ERROR: -- Line 189 Error (R19) : Calling function with less number of parameters

You're absolutely right to question this - I clearly don't know what I'm doing with the Ring language specifics. Let me take a step back and be more methodical.


Mansour Ayouni

unread,
Sep 13, 2025, 10:34:33 AM (2 days ago) Sep 13
to Bert Mariani, The Ring Programming Language
Hello Bert,

It depends on how you design your prompting journey, what context you give to the AI about the Ring specifics and the requirements of the code in hand. If you want to share the details of request, I would suggest a better way to let Claude solve it.

Best,
Mansour

Bert Mariani

unread,
Sep 13, 2025, 10:40:16 AM (2 days ago) Sep 13
to The Ring Programming Language
Hello Mansour

Integrating AI, machine learning, and data intelligence :  are Really Complex Issues.
I don't believe Ring was originally written with those concepts that in mind.
LLM was the language invented. It has its points and  disadvantages.

An example of personal use: 
I asked Claude AI to write a rather simple program.
After 38 versions that it generated , many with repeated error ...
Even when pointing out the exact error.
I finally Gave Up.
I fixed the generated code in 15 minutes.
And that was the end of it.

My conclusion is that anything you write with AI is fast to generate.
But be prepared to Waste enormous amount of time debugging and fixing it.

An aside:
750,000 lines of code. Wow it Huge. That's more than I can type.

Mansour Ayouni

unread,
Sep 13, 2025, 10:58:42 AM (2 days ago) Sep 13
to Bert Mariani, The Ring Programming Language
Hello Bert,

I don't believe Ring was originally written with those concepts in mind.
Ring is a general purpose language, and AI and machine learning are specialized domains the language can deal with in two layers: Ring itself as a scripting language, and C and C++ extensions as an engine level.

750,000 lines of code. Wow it Huge. That's more than I can type.
It's about just 300 lines of code to write per day on average over the period of 5 years.

Best,
Mansour


Ilir Liburn

unread,
Sep 13, 2025, 12:44:08 PM (2 days ago) Sep 13
to The Ring Programming Language
Hello Mansour, Bert

>> Integrating AI, machine learning, and data intelligence :  are Really Complex Issues.
>> I don't believe Ring was originally written with those concepts that in mind.

I just finished eleventh iteration of the Ring2C+ using typehints library. Additionally to string, number and a list (ordinary, pointer or object) type, Ring2C+ adds support for types listed in the typehints library: (signed or unsigned ) char/byte, short, int, long long and float, double, boolean as separate. And for the first time, long double which is 80 bit floating number supporting whole 64 bit integer range (this type is used in between the operations to ensure value range stays intact) .

New types are possible using the scalar and array types useful for general purpose or matrix operations (very fast using C99 arrays and can be accelerated more by using threads on a single VM instance, usually possible only by creating new VM instance). Later it can be extended to use CUDA, etc.

Each type can be dynamically or statically typed (later having performance advantage like in static linking).

While this is a personal project, once it is released, anyone can use it. And therefore, use it to solve complex issues.

Greetings,
Ilir

Mansour Ayouni

unread,
Sep 13, 2025, 12:50:31 PM (2 days ago) Sep 13
to Ilir Liburn, The Ring Programming Language
Hello Ilir,
You've made a nice jump forward in the features of your projects.
Keep going.
All the best 
Mansour

Antonio F.S.

unread,
Sep 13, 2025, 12:57:32 PM (2 days ago) Sep 13
to ring...@googlegroups.com

Hello Ilir and everyone,

I don't understand why, instead of creating versions of a language (which will lead to confusion about which one to use), we don't improve the official version by collaborating all together.

Best regards,  
Antonio F.S.
--------------------------------------------------------------

El 13/9/25 a las 18:44, Ilir Liburn escribió:

Ilir Liburn

unread,
Sep 13, 2025, 1:35:56 PM (2 days ago) Sep 13
to The Ring Programming Language
Hello Antonio,

You can think in this way: features implemented in official Ring must be stable. Prototype is used to see what qualifies as a good feature, what does not.

For example, Mahmoud said he is not interested in arrays because RingFastPro library is enough. Typehints library is used only as a hint (doesn't have runtime impact), it was not designed for the runtime types (checked at runtime).

On the other hand, I need a faster runtime with Ring to C language translation (planed in Ring2D). This maybe qualifies as a good feature to be implemented in the official Ring, maybe not.

Greetings,
Ilir

Antonio F.S.

unread,
Sep 13, 2025, 2:12:22 PM (2 days ago) Sep 13
to ring...@googlegroups.com
Hello Ilir,

It's good to know about these differences, which I assume will be well
documented to keep them clear.
Personally, I prefer static types over dynamic types, among other
things. Although I understand that given how flexible Ring is, it might
clash a bit. But it could always be done like with its three encoding
types to choose the one you prefer, similarly. An example of this is
Groovy, which can use both static and dynamic types as preferred.

Best regards,
Antonio F.S.
-----------------------------------------------------------

El 13/9/25 a las 19:35, Ilir Liburn escribió:

Ilir Liburn

unread,
Sep 13, 2025, 2:58:36 PM (2 days ago) Sep 13
to The Ring Programming Language
Hello Antonio,

I keep it simple (on a language level), although arrays engine (which handles both scalar and array types) is not (because it needs to handle many type-to-type situations). 

For example:

matrix = array(4,4):double[]         # array(...) by default creates an array of characters, it needs conversion to specific type
scalar = 1:boolean

both are dynamic types, while

matrix = double[]:array(4,4)
scalar = boolean:1

are now static types where type can't change during the runtime. You just need to remember that cast on the right hand side

value = 1:int + 2:short

is a dynamic cast which follows the statement in direction of the operations, while static cast always points in direction of the assigned variable.

To assign values to the matrix, we use identifier[] syntax

matrix[] = [[5,2,3,4],[3,1,4,2],[4,3,2,1],[2,4,1,3]]

because variable is dynamic in the fist case, without identifier[] syntax variable gets assigned by the list instead of filling array with values.
In case of the statically typed variable, identifier[] syntax is still needed because list can't be assigned to array by default.

Example follows by

determinant = scalar / matrix
? determinant

operator / is specific on matrices because division is not allowed (can end in division by zero exception). It is used instead to calculate determinant, adjugate or inverse matrix

if determinant
? matrix / scalar # adjugate
? matrix / determinant # inverse
? (scalar/determinant) * (matrix/scalar) # inverse2
ok

Greetings,
Ilir

Antonio F.S.

unread,
Sep 13, 2025, 3:04:05 PM (2 days ago) Sep 13
to ring...@googlegroups.com

Hello Ilir,

Your examples are interesting.

Thank you.  


Best regards,  
Antonio F.S.
-----------------------------------------------------------

El 13/9/25 a las 20:58, Ilir Liburn escribió:
Hello Antonio,

Ilir Liburn

unread,
Sep 13, 2025, 3:11:02 PM (2 days ago) Sep 13
to The Ring Programming Language
Hello Antonio,

You're Welcome.

Greetings,
Ilir

Mansour Ayouni

unread,
Sep 13, 2025, 3:26:58 PM (2 days ago) Sep 13
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

I redesigned the article to shift from the particular case of Named Object to the more general Unified @Find() function offered by Softanza. I also presented the ways Ring provides to make objects and lists findable, while explaining why the unified experience adopted by Softanza can be an option:

I'm open to any remarks.

All the best,
Mansour

Mahmoud Fayed

unread,
Sep 13, 2025, 3:34:11 PM (2 days ago) Sep 13
to The Ring Programming Language
Hello Mansour

Thank you very much for the update :D

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Sep 14, 2025, 4:23:44 AM (yesterday) Sep 14
to The Ring Programming Language
Hello Mansour

>> "While 98% of Softanza's codebase (over 750K lines) is hand-coded"

This is what I get using cloc (count lines of code) and latest StzLib source code from your GitHub project

codesize.png

So, it's around 300 KLOC 

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Sep 14, 2025, 4:46:33 AM (yesterday) Sep 14
to The Ring Programming Language
Hello Mansour


While containing around 35KLOC, it's just a string!

You could isolate this string in a text file, and load it using read() function.

Greetings,
Mahmoud

Mansour Ayouni

unread,
Sep 14, 2025, 5:20:09 AM (yesterday) Sep 14
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Oh thanks, I totally forgot that we have the cloc tool!
Github stats induced me in error with this graph.

image.png

All the best
Mansour

Mansour Ayouni

unread,
Sep 14, 2025, 5:38:50 AM (yesterday) Sep 14
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Done, thank you!

A gift to you from the unicode database Softanza holds...
image.png
Best,
Mansour

The Future of Programming

unread,
Sep 14, 2025, 5:48:24 AM (yesterday) Sep 14
to The Ring Programming Language
Hello Mansour

You are welcome

Keep up the GREAT WORK :D

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