AI as documentation writer

28 views
Skip to first unread message

Mansour Ayouni

unread,
Jun 25, 2024, 4:49:54 AMJun 25
to The Ring Programming Language
Hello Mahmoud and All,

It' clear that Generative AI will lead the way in code documentation (explanations, tutorials, examples etc), and my experience is that they do it better than us!

In the following example, I provided an image to both Claude and Gemini and asked them to explain the code, with any other context.

While Google's tool did its best to do the job, Claude was far better, both in understanding the two functions and the difference between them, and making an expressive and elegant explanation about the code.

See the difference in the two PDFs joined to the mail.

Do you plan to use AIs in generation documentation about your code?
In Softanza, I think I'll do it.


image.png
All the best,
Mansour
stz_code_explained_by_gemini_ai.pdf
stz_code_explained_by_claude_ai.pdf

Ilir Liburn

unread,
Jun 25, 2024, 7:33:39 AMJun 25
to The Ring Programming Language
Hello Mansour,

Yes, I'm currently working on array support after wonderful idea of Mahmoud to make a string (multi)dimensional, acting as an array. AI can help with that by checking if result matches C result (regarding operators) and while it is learning how is that done in Ring, consequently should be able to write documentation.

Array in this case is a C99 array, it can be expanded (reallocated) which means it can be also used in Ring2C extension (TCC runtime compiler).

Greetings,
Ilir

Mansour Ayouni

unread,
Jun 25, 2024, 8:02:13 AMJun 25
to Ilir Liburn, The Ring Programming Language
Hello Ilir,

Interesting!

Can you please elaborate more on Moahmoud's idea of multi-dimensional string? Is it an internal feature or something we could benefit from at a higher level? And how does it impact performance? And any detail you would add...

Thank you.
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 on the web visit https://groups.google.com/d/msgid/ring-lang/d9086d77-1aa2-40b2-89b8-62d843826ba6n%40googlegroups.com.

Ilir Liburn

unread,
Jun 25, 2024, 9:24:48 AMJun 25
to The Ring Programming Language
Hello Mansour,

it is internal feature which can be used as array at higher level (Ring code)

var = array("unsigned long",3,2,1)

Internally, it is just a string, but with multidimensional information. In other words, it is a string pointing to continuous memory block,   e.g. C array.

Advantage:

- holding only data (no items/item pointing to data)
- allowing full 64 bit range for integers
- faster on multidimensional access (for one dimensional access performance doesn't change)
- because it is a string internally, it is destroyed like any other string (true only for numbers)

Disadvantage:

- complex implementation because of various C data types and combinations defined in typehints library
- complex GC (if data is not a number) because there are no items to hold reference count

For more details, you will need to wait till end of the summer (estimated time).

Mansour Ayouni

unread,
Jun 25, 2024, 9:43:09 AMJun 25
to Ilir Liburn, The Ring Programming Language
I see... It's clear now.

All the best,
Mansour

Reply all
Reply to author
Forward
0 new messages