Softanza Zai in action

42 views
Skip to first unread message

Mansour Ayouni

unread,
Dec 1, 2025, 4:01:30 PM (7 days ago) Dec 1
to The Ring Programming Language
Hello All,

Working on Softanza Zai, the ML and AI module in StzLib.

Here, the BoxFace() method runs inside a Python instance, does the job using opencv and returns the result to Ring, both as image and as metadata (so you can use it to any need):

image.png

You want more details, just say BoxFace( ..., [ :Details = TRUE, ... ]) and you get:

face-color2.jpg

The goal is to turn ML and AI into a kid's game in Softanza, literally!

NOTE: Softanza has two layers of AI : Zai for classic and common ML and AI every other framework does, and Pi (for Programmatic Intelligence) which is an innovative vision to AI built on top of deterministic algorithms without any ML or data training staff.

Stay tuned.
Best,
Mansour


Mahmoud Fayed

unread,
Dec 1, 2025, 4:12:23 PM (7 days ago) Dec 1
to The Ring Programming Language
Hello Mansour

Thanks for sharing :D

I would like to share this report with you about a missing file

B:\RingWork\Packages\stzlib\libraries\stzlib>ring stzlib.ring

Error (E9) : Can't open file uuid.ring

B:\RingWork\Packages\stzlib\libraries\stzlib\base\system/stzuuid.ring Line (6) Error (C27) : Syntax Error!

Greetings,
Mahmoud

Mansour Ayouni

unread,
Dec 1, 2025, 4:26:58 PM (7 days ago) Dec 1
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Thank you for the report!
This is the uuid.ring file related to the C++ extension made by Youssef. Please install it and test again.

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/84f37ae9-7352-48e2-a93f-cc142deeb03bn%40googlegroups.com.

Mahmoud Fayed

unread,
Dec 1, 2025, 4:59:48 PM (7 days ago) Dec 1
to The Ring Programming Language
Hello Mansour

Yes, using ringpm install uuid will install the extension including the required uuid.ring file

Now I get this error
B:\RingWork\Packages\stzlib\libraries\stzlib>ring stzlib.ring
Line 76 Error (R35) : Can't create/open the file
In read() in file B:\RingWork\Packages\stzlib\libraries\stzlib\base\data/stzunicodedata.ring

Which requires changing
$cUnicodeData = read("../data/unicodedata.txt")
To
$cUnicodeData = read("base/data/unicodedata.txt")

Since I am using test programs next to stzlib.ring (In the same folder)

And when I run one of my test programs
I get the next error

B:\RingWork\Packages\stzlib\libraries\stzlib>ring mytest.ring
Line 2916 Output file 'output\diagram_2019.svg' not created. Log: The system cannot find the drive specified.
In raise() In function stzraise() in file B:\RingWork\Packages\stzlib\libraries\stzlib\base\common/stzfuncs.ring
Called from line 95 In method execute() in file B:\RingWork\Packages\stzlib\libraries\stzlib\base\extercode/stzdotcode.ring
Called from line 124 In method executeandview() in file B:\RingWork\Packages\stzlib\libraries\stzlib\base\extercode/stzdotcode.ring
Called from line 1602 In method view() in file B:\RingWork\Packages\stzlib\libraries\stzlib\base\graph/stzdiagram.ring
Called from line 25 in file mytest.ring

Which is fixed by changing
@cDotPath = "D:\Graphviz\bin\dot.exe"
In stzDotCode class to the next path (to match the folder on my machine)
@cDotPath = "C:\PL\Graphviz\bin\dot.exe"

Now I can run the next test program

load "stzlib.ring"

oOrg = new stzOrgChart("Basic_Hierarchy")
oOrg {
    SetLayout("TD")
   
    # Add executive position
    AddExecutivePositionXT(:ceo, "CEO") # ceo is the ID of the node and CEO it's label
   
    # Add management positions
    AddManagementPositionXT(:vp_sales, "VP Sales")
    AddManagementPositionXT(:vp_eng, "VP Engineering")
   
    # Set reporting lines
    ReportsTo(:vp_sales, :ceo)
    ReportsTo(:vp_eng, :ceo)
   
    # Add staff positions with attributes
    AddStaffPositionXTT(:sales_rep1, "Sales Rep 1", [:region = "North"])
    AddStaffPositionXTT(:dev1, "Developer 1", [:skill = "Backend"])
   
    ReportsTo(:sales_rep1, :vp_sales)
    ReportsTo(:dev1, :vp_eng)
   
    View()
}

Which produce this graph
graph.png

Summary:

StzLib need a way to configure the library and determine the path for related tools like "C:\PL\Graphviz\bin\dot.exe"
Also, the path used by read() for $cUnicodeData variable

This could be done using global variables or one global list that StzLib can check/use if the values are not empty

aStzLibConfig = [
   :DotPath = "C:\PL\Graphviz\bin\dot.exe",
   :UnicodeDataFolder = "base/data"
]

Note: some other tests no longer work and produce the next error
* Error (R3) : Calling Function without definition: viewbydepartment
* Error (R3) : Calling Function without definition: addanalysislayer

Greetings,
Mahmoud

Mansour Ayouni

unread,
Dec 1, 2025, 5:24:39 PM (7 days ago) Dec 1
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Thank you very much for your feedback: very helpful!

StzLib need a way to configure the library
Most of the staff are configurable in global variables at the start of each file or inside the classes attributes (see https://github.com/mayouni/stzlib/blob/main/libraries/stzlib/base/extercode/stzExterCode.ring)

But you are right, I need a unified vision for the entire lib to be configurable in a central place...
I also added $cUnicodeDataPath as you suggested.

Calling Function without definition: viewbydepartment
That's because I'm refactoring the Graph Module so the issue will be solved in my next commit.

Best,
Mansour


Mahmoud Fayed

unread,
Dec 1, 2025, 5:48:07 PM (7 days ago) Dec 1
to The Ring Programming Language
Hello Mansour

>> " But you are right, I need a unified vision for the entire lib to be configurable in a central place..."

Something like this could be done by stzlib.ring at the start of the library

# Define the list if it's not defined by the user/caller code
if ! isGlobal(:aStzLibConfig )
    aStzLibConfig = []
ok

And when you need a value from the configuration
if aStzLibConfig[:DotPath]   // Check if we have the value by the User code
    @cDotPath = aStzLibConfig[:DotPath]
else
    @cDotPath = "D:\Graphviz\bin\dot.exe"
ok

And so on

This way the test program could use
aStzLibConfig = [
   :DotPath = "C:\PL\Graphviz\bin\dot.exe",
   :UnicodeDataFolder = "base/data"
]

Load "stzlib.ring"

Such an update could be easy to be done, and once you do it I can update my test programs to use this feature.

Greetings,
Mahmoud

Mansour Ayouni

unread,
Dec 1, 2025, 7:43:50 PM (7 days ago) Dec 1
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Done and it's called $aStzLibConig.

The user global variable is checked here:

The settings for external langs paths are made here:

The Graphiz Dot.exe path is set here:

The unicodedata file path is set here:

Let me know if it works for you.
Best,
Mansour

Mahmoud Fayed

unread,
Dec 1, 2025, 7:58:37 PM (7 days ago) Dec 1
to The Ring Programming Language
Hello Mansour

I get this error

Line 11 Error (R24) : Using uninitialized variable: adn

in file B:\RingWork\Packages\stzlib\libraries\stzlib\base\extercode/stzdotcode.ring

Looks like (and) is written as (adn)

Also, I see the changes are done for DotPath, but not for $cUnicodeDataPath 

Greetings,
Mahmoud

Mansour Ayouni

unread,
Dec 1, 2025, 8:06:07 PM (7 days ago) Dec 1
to Mahmoud Fayed, The Ring Programming Language
Done!
Thank you a lot Mahmoud.
I learned an interesting technique with you today that I will use with all the global settings.

Best

Mahmoud Fayed

unread,
Dec 1, 2025, 8:20:15 PM (7 days ago) Dec 1
to The Ring Programming Language
Hello Mansour

This is beautiful, now it works directly using the next code

$cUnicodeDataPath = "base/data/unicodedata.txt"
$aStzLibConfig = [

 :DotPath = "C:\PL\Graphviz\bin\dot.exe"
]

load "stzlib.ring"

Thanks for the update :D

Note: it will be more beautiful if aStzLibConfig could contains UnicodeDataPath as option instead of separate global variable ($cUnicodeDataPath)

Greetings,
Mahmoud

Mansour Ayouni

unread,
Dec 1, 2025, 8:39:48 PM (7 days ago) Dec 1
to Mahmoud Fayed, The Ring Programming Language

Mahmoud Fayed

unread,
Dec 1, 2025, 8:50:06 PM (7 days ago) Dec 1
to The Ring Programming Language
Hello Mansour

Thanks for the update :D

$aStzLibConfig = [
  :DotPath = "C:\PL\Graphviz\bin\dot.exe",
  :UnicodeDataPath = "base/data/unicodedata.txt"
]

load "stzlib.ring"

Now, I can have $aStzLibConfig in a specific configuration file, Say (stzlibconfig.ring) 
And share this file between my tests using the LOAD command (i.e. load "stzlibconfig.ring" before load "stzlib.ring")

Greetings,
Mahmoud

Mansour Ayouni

unread,
Dec 1, 2025, 9:05:55 PM (6 days ago) Dec 1
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Now, I can have $aStzLibConfig in a specific configuration file, Say (stzlibconfig.ring) 
Nice idea! Do you think I can adopt it at the library level in a way that it makes it available for any developer?

And you raised my attention to think of a dedicated class stzConfig like the one we find in python and other frameworks:

What do you think?

Best,
Mansour


The Future of Programming

unread,
Dec 1, 2025, 9:15:14 PM (6 days ago) Dec 1
to Mansour Ayouni, The Ring Programming Language
Hello Mansour

Yes it can be done at the library level using many different ways

But I prefer supporting this at the project level 

So many different projects could customize the configuration file

Just a simple command line tool could be added to generate the configuratuon file in the current directory

So we can know the library options and default values

Greetings, 
Mahmoud


Mansour Ayouni

unread,
Dec 1, 2025, 9:20:34 PM (6 days ago) Dec 1
to The Future of Programming, The Ring Programming Language
Hello Mahmoud,
Thank you for your answer!
I will reflect about it.
Best
Mansour

Mahmoud Fayed

unread,
Dec 1, 2025, 11:19:04 PM (6 days ago) Dec 1
to The Ring Programming Language
Hello Mansour

You are welcome :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages