How do I debug code?

50 views
Skip to first unread message

Mansour Ayouni

unread,
Sep 15, 2020, 8:12:02 AM9/15/20
to The Ring Programming Language
Hello everyone,

While waiting for the 1.13 release, let me share this story with you, right from my desktop this morning, while I'm working on my Softanza Framework project.

Ring helps a lot in debugging code with its simple and comprehensive error code. Still, my rudimentary sense of readability finds it difficult to follow an erro message like this:

Line 147 Error (R24) : Using uninitialized variable : nresult

In function calculate() in file:\ring112\projects\SoftanzaLib\stzNumber.ring

called from line 856 In method derivative_sigmoid() in file D:\ring112\projects\SoftanzaLib\stzNumber.ring

called from line 4 in file D:/ring112/projects/SoftanzaLib/stzTempo1.ring


While debugging, I usually try to reconstruct the error message my way, visually like shown in the snapshot attached.


It's a manual effort that takes time, but never mind, I feel happy to perform it. By experience, this helped me not only understand what ha^^ended and resolved the bug, but better understand my program data flow and think of some structural enhancements.


In the future, I'll be working on a library that automates this, and I'll be happy to make it available for the community.


All the best,

mansour

debugging.png

Outnull

unread,
May 1, 2022, 12:53:35 PM5/1/22
to The Ring Programming Language
Hi Mansour, 

Yes, I am digging up your old posts to learn more about Softanza! This automated debugging feature which provides clearer insight into the error sounds really cool, so I was wondering if you ever got around to working on it? I've gotten pretty comfortable with Ring's native/interactive debugging facilities but your proposal here would help to simplify that process.

Thank you.

Mansour Ayouni

unread,
May 1, 2022, 5:53:45 PM5/1/22
to Outnull, The Ring Programming Language
Hello Outnull,
Thank you for your interest in Softanza.
This feature will be made in an independent library for enhancing debugging of Ring programs.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/3d6e8e39-00d9-4d3a-8aef-88c342916d16n%40googlegroups.com.

Outnull

unread,
Mar 6, 2024, 8:01:42 AMMar 6
to The Ring Programming Language
Hello Mansour, 

I found myself doing a bit of debugging this morning and remembered your enhanced debugging proposal here. Is this something I can try out now? I think it would be a great help!

Best, 
ON

Outnull

unread,
Mar 6, 2024, 8:47:43 AMMar 6
to The Ring Programming Language
Hi again Mansour, I thought I would add this here in case you can help.

I am trying to use your Softanza library on my Windows 11 VM, which I installed via RingPM, but it produced the following error. I copied this code example from your Github:

CleanShot 2024-03-06 at 07.40.12@2x.png

CleanShot 2024-03-06 at 07.40.21@2x.png

Also, I was unable to use the library at all immediately after installation for these 2 reasons:

1. Is was not unzipped yet, so I had to manually uncompress it in the ring\libraries folder
2. In the stzlib.ring file, it tried to load stzlib.ring using a relative path which was incorrect, but once I changed this to an absolute path pointing to stzlib.ring that error was resolved, i.e. 

load "C:\Users\myusername\Downloads\ring\libraries\softanzalib\stzlib.ring"


Look forward to trying this out some more if I can overcome these issues!


Thank you,

ON



Mansour Ayouni

unread,
Mar 6, 2024, 9:41:13 AMMar 6
to Outnull, The Ring Programming Language
Hello ON,

No unfortunately, this debugging library has not been started yet, since Sofranza takes all my time.

I'm sorry for this.

All the best.
Mansour

Mansour Ayouni

unread,
Mar 6, 2024, 9:44:37 AMMar 6
to Outnull, The Ring Programming Language
Hello ON,

The error you get is expected.

I should update the zip and increment the version o you can download it quickly using RingPM.

I'll do it and let you know.

Best regards,
Mansour

Outnull

unread,
Mar 7, 2024, 10:34:18 AMMar 7
to The Ring Programming Language
Thank you Mansour, eager to try it out!

Regards, 
ON

Reply all
Reply to author
Forward
0 new messages