AlQalam (The Pen)

115 views
Skip to first unread message

Azzeddine Remmal

unread,
Jan 17, 2026, 7:32:28 PMJan 17
to The Ring Programming Language
Hello Mahmoud and everyone,

I'm happy to share this AlQalam extension with you

=============================================
1. QalamVector: The Numeric Stream
A dynamic array wrapper around `std::vector<double>`.

load "AlQalam.ring"

# Initialize with capacity for 1 Million items
oData = new QalamVector(1000000)

# 1. Basic Flow
oData.flow(10.5)
oData.write(1, 99.9)  # Update index 1
val = oData.read(1)   # Get index 1

# 2. Alchemy (Batch Math)
oData.flood(1.0)      # Set all to 1.0
oData.elevate(5.0)    # Add 5 -> [6.0, 6.0...]
oData.amplify(2.0)    # Mult 2 -> [12.0, 12.0...]

# 3. The Math Engine (Formula Compiler)
# Compiles string to bytecode and executes in parallel
oData.transform("x * 2 + sin(x)")
oData.transform("relu(x)")

# 4. Binary Persistence (Direct Disk I/O)
oData.saveBinary("memory_dump.bin")
oData.loadBinary("memory_dump.bin")

# 5. Bridge to RingTensor
# Converts to Tensor without copying memory
oTensor = oData.toTensor(1000, 1000)

 2. QalamInk: The Text Builder
Used to construct massive datasets or generate text without memory fragmentation.


oInk = new QalamInk()

# Inscribe data instantly
oInk.inscribe("In the name of logic, ")
oInk.inscribe("we build the future.")

# Batch inscription (High throughput)
aLines = ["Line 1", "Line 2", "Line 3"]
oInk.inscribeBatch(aLines)

# Output
see oInk.reveal()
oInk.wipe()

3. QalamIndex: The Memory Map
An O(1) Lookup table (`std::unordered_map`) for Tokenizers.


oMemory = new QalamIndex()

# Teaching
oMemory.define("hello", 5)
oMemory.define("world", 12)

# Instant Recall
if oMemory.knows("hello")
    id = oMemory.recall("hello")
ok


4. QalamChronos: The Timekeeper
A nanosecond-precision timer for benchmarking.

oTimer = new QalamChronos()

oTimer.reset()
# ... heavy operation ...
see "Time elapsed: " + oTimer.elapsed() # e.g., "450 us"


5 Formula Engine Reference
The `transform` method supports a mini-language compiled to bytecode:

Operators: `+`, `-`, `*`, `/`, `^` (Power)
Variable: `x` (Current element value)
Functions:
. `sin(x)`, `cos(x)`, `tan(x)
. `sqrt(x)`, `abs(x)`
. `log(x)`, `exp(x)`
. `relu(x)` (Rectified Linear Unit: `max(0, x)`)

Example:
# Normalize: (x - mean) / std
oVec.transform("(x - 5) / 0.2")
my regards,
Azzeddine

Mahmoud Fayed

unread,
Jan 17, 2026, 7:42:06 PMJan 17
to The Ring Programming Language
Hello Azzeddine

This looks beautiful, thank you for sharing :D

Could you submit a pull request and add it to RingPM registry:  ring/tools/ringpm/registry at master · ring-lang/ring

Greetings,
Mahmoud

Mansour Ayouni

unread,
Jan 17, 2026, 8:41:24 PMJan 17
to Mahmoud Fayed, The Ring Programming Language
Hello Azzeddine,

The very first sample raises this error:
image.png
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/ae81a072-de12-4e18-ae1f-7569abda9216n%40googlegroups.com.

Mansour Ayouni

unread,
Jan 17, 2026, 8:44:42 PMJan 17
to Mahmoud Fayed, The Ring Programming Language
Hello Azzeddine,

To help us test the samples, please let them be more expressive by:
  • telling us what they mean and for what they are useful
  • always give us the command that shows the result (? or see or whatever)
  • along with the result we should expect
All the best,
Mansour

Azzeddine Remmal

unread,
Jan 17, 2026, 9:41:19 PMJan 17
to The Ring Programming Language
Hello Mansour

Thanks for the test tips.
But I assume you're programmers.

The error is due to the bridge connecting AlQalam to the RingTensor.
The Ring Tensor has been updated. v1.2.1

ringpm install ringtensor from Azzeddine2017
or
ringpm update ringtensor

 my regards,
Azzeddine

Mansour Ayouni

unread,
Jan 18, 2026, 4:55:13 AMJan 18
to Azzeddine Remmal, The Ring Programming Language
Hello Azzeddine,

But I assume you're programmers.

I didn't know that RingTensor was another extension that I should install first. This information should be clearly stated in the readme file. An information like this should be explained for programmers who are supposed to be users of the Alqualam library

The error is due to the bridge connecting AlQalam to the RingTensor.

Please do not assume that a busy programmer willing to make a quick exploration of your library, just to get a taste of the samples you gave, if they were working or not, should spend time to understand these conceptual things by looking to your implementation and then searching for the meaning of what "tensor" means, what RingTensor is, what "vector" is, and what relates Alqualam to RingQML, and what's the role of "std:vector" from C or C++, what it adds to the standard list() in Ring, or what it distinguishes it from the QVector we already have in RingQt...

Especially if this programmer does not have the same low level background as you in making extensions, writing C and C++, and mastering ML and neural network staff.

All these questions should be taken on consideration while someone is inbording on your github repo and willing to help in testing the lib, unless you decide it's not a priority and then I personally should xait for your entire delivery before contributing with any test.

All the best,
Mansour



Azzeddine Remmal

unread,
Jan 18, 2026, 7:58:43 AMJan 18
to The Ring Programming Language
Hello Mansour.

But I assume you're programmers.
I apologize for my poor expression; I didn't mean to offend you.

But do you think I write the test for people to try?
I test it myself until almost everything works, correcting it again and again.
I share it so that others can benefit from it, whether through reading or using it.
are you Remember this word read.
is the only way the mind develops. 
I don't mean to be intrusive, but it's the truth: don't try what you don't understand.

my regards,
Azzeddine

Mansour Ayouni

unread,
Jan 18, 2026, 8:54:25 AMJan 18
to Azzeddine Remmal, The Ring Programming Language
Hello Azzedine,

I did not feel offended by your words at all!
Be insured that I appreciate the challenge you took in developing an ML framework in Ring.

My motivation was to contribute with some testing, and for this I needed some conceptual explanations to let the tests be knowledgeable for me.

I think you are right to focus on testing for yourself in this critical phase of your innovative work.

So please don't care about the remarks I gave, unless for now.

I hope you a brilliant success!
Best,
Mansour

Mahmoud Fayed

unread,
Jan 18, 2026, 9:46:57 PMJan 18
to The Ring Programming Language
Hello Azzeddine

>> "The error is due to the bridge connecting AlQalam to the RingTensor."

You can update the (package.ring) file in AlQalam to list RingTensor as dependecny


This way installing AlQalam using RingPM will automatically install/update RingTensor

Greetings,
Mahmoud

Mansour Ayouni

unread,
Jan 19, 2026, 5:10:02 AMJan 19
to Mahmoud Fayed, The Ring Programming Language
Hello Azzeddine,

Try to avoid capital letters in naming files so all operating systems can deal with your library without surprises:
image.png

This was one of my mistakes in StzLib until a friend who tested it on linux had problems in this regard. So I went back to all my files and renamed them in lowercase.

All the best,
Mansour

Azzeddine Remmal

unread,
Jan 19, 2026, 5:49:19 AMJan 19
to The Ring Programming Language
Hello Mahmoud and Mansour

Thank you for the valuable advice.

RingML relies on the Ring Tensor and  AlQalam  if it proves its efficiency in handling large datasets. 

The RingML library and extensions are still unstable I've made many changes. 
However, I wanted to share and exchange experiences, as someone might see something in my code that I don't. 
Thank you, Mansour; I wasn't aware of this information. I will work on it and correct it in the future. 

Best regards.
Azzeddine

Bert Mariani

unread,
Jan 19, 2026, 7:11:21 AMJan 19
to Azzeddine Remmal, The Ring Programming Language
Hello Mansour

Re: Capital Letters

I've never had that issue before of using capital letters or mixed letters in naming files in Linux. I have used Linux Mint, and a couple of others. The only rule is that the filename start with a letter and not a number.

You might want to ask which flavour or Linux it was. And what was the issue

Regards
Bert Mariani

Mansour Ayouni

unread,
Jan 19, 2026, 9:28:43 AM (14 days ago) Jan 19
to Bert Mariani, Azzeddine Remmal, The Ring Programming Language
Hello Bert,

I don't remember exactly if it was on Linux or Macos. But since then  I decided to make all files and paths used inside the code to be exclusively lowercase.

Best,
Mansour

Bert Mariani

unread,
Jan 19, 2026, 11:03:32 AM (14 days ago) Jan 19
to The Ring Programming Language
Hello Mansour

Well its not Linux. Its not Windows. Its not UNIX System 5, Solaris.
Any OS worth its salt would have no problem with mixed case filenames.

Regards
Bert Mariani

Youssef Saeed

unread,
Jan 19, 2026, 5:36:56 PM (14 days ago) Jan 19
to The Ring Programming Language
Hello everyone,

I’ve been following the discussion and wanted to add some technical context regarding the file naming issue.

Bert, the issue isn't actually that Linux can't "handle" mixed case, but rather that Linux and UNIX systems are case-sensitive, whereas Windows is case-insensitive.

On Windows, requesting image.png or Image.png will open the same file. However, on Linux, MyFile.ring and myfile.ring are treated as two entirely different files.

The "surprise" Mansour mentioned usually happens like this: a developer on Windows writes load "Mylib.ring". It works fine on their machine even if the file is actually named mylib.ring. But the moment that code is run on a Linux server, it crashes with a "Can't open file" error because Linux looks for an exact case match.

Using strictly lowercase for package and file names is a standard best practice in the open-source world (similar to Python or Node.js) specifically to ensure cross-platform compatibility and avoid these types of errors.

Best regards,
Youssef

Bert Mariani

unread,
Jan 19, 2026, 5:47:51 PM (14 days ago) Jan 19
to Youssef Saeed, The Ring Programming Language
Hello Youssef 

That makes more sense.
Unix, Linux, Solaris are Case Sensitive.
C, C++ are case sensitive.

The problem is really sloppy typing of filenames by the developer.

Windows and Ring are Case Insensitive.

Regards
Bert Mariani 




Mansour Ayouni

unread,
Jan 19, 2026, 5:50:20 PM (14 days ago) Jan 19
to Youssef Saeed, The Ring Programming Language
Hello Youssef,

It was exactly that! Thank you for the explanation.

Best,
Mansour


Youssef Saeed

unread,
Jan 19, 2026, 5:56:30 PM (14 days ago) Jan 19
to The Ring Programming Language
Hello Bert,

Agreed. Since we are all prone to typos, sticking to a lowercase standard acts as a safety net to prevent these issues across different environments.

Best regards,
Youssef

Youssef Saeed

unread,
Jan 19, 2026, 5:59:11 PM (14 days ago) Jan 19
to The Ring Programming Language
Hello Mansour,

You are very welcome. I am glad that cleared it up.

Best regards,
Youssef

Azzeddine Remmal

unread,
Jan 21, 2026, 7:26:35 PM (12 days ago) Jan 21
to The Ring Programming Language
Hello Mahmoud. 

Please rate the extension to help me improve it. 

Best regards
Azzeddine

Mahmoud Fayed

unread,
Jan 21, 2026, 11:00:58 PM (11 days ago) Jan 21
to The Ring Programming Language
Hello Azzeddine

>> "Please rate the extension to help me improve it."

(1) I like the idea of the transform() function and having more general features.

(2) Since you already used the extension to get better performance, this is very nice and the real tests/usage are what really matters.

(3) Since are see more grow in Ring extensions/packages/libraries, the rule should be always continue, recheck only if you discovered a problem or another developer reported a bug. 

Keep up the GREAT WORK :D

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