Hi Bert,
Thank you for sharing your program, nice work!
As a matter of challenge, I wanted to see if I can accomplish
similar implementation using AI from scratch.
I decided to use GPT-5 High (API) because it is the strongest at
reasoning and coding in general.
I started by asking GPT-5 High to implement a CLI program in C for a Lunar eclipse calendar generator to have an output similar to NASA data at https://eclipse.gsfc.nasa.gov/LEcat5/LE2001-2100.html.
After few iterations where I shared NASA eclipse data, it wrote a self-contained C program that matches NASA output exactly (few minutes difference only).
Thank I asked it to convert this C program to Ring. The Ring program created had 19 syntax errors that I had to fix manually (not difficult).
Once fixed, the output of the Ring program matched the NASA data
like the C version.
Afterwards, I modified the Ring code to output the same columns as
your program as a matter of comparison.
In total, it took less than 45 minutes.
The strength of GPT-5 High is an important factor but I think the fact to ask to write the algorithms in C then translate to Ring provides better results than asking directly to write in Ring.
I'm attaching the source code of the program (Lunar_Eclipse_Calendar_Generator.ring). I also published it at https://github.com/idrassi/LunarEclipseCalendarGenerator-Ring (with a static Windows binary built with latest unreleased Monoring).
Below is the output for the range 2022-2030:
----
Lunar Eclipse Calendar Generator
Enter start year: 2022
Enter end year: 2030
Lunar Eclipse Calendar Generator
----------------------------------------------------------------------------------------------------------------------------------------
Range: 2022 to 2030
Classification uses dynamic shadow sizes and center-axis
separation Rho (deg).
----------------------------------------------------------------------------------------------------------------------------------------
# Date Time Type Rho (deg) NodeSep_deg
Lat_deg LunarRadius_deg Umbra_deg Penumbral_deg Dist_km
----------------------------------------------------------------------------------------------------------------------------------------
1 2022-05-16 04:12 Total 0.260 6.000
-0.258 0.275 0.746 1.273 362095
2 2022-11-08 11:00 Total 0.243 1.883
0.241 0.255 0.666 1.205 390650
3 2023-05-05 17:24 Penumbral 0.996 16.467
-0.991 0.262 0.697 1.226 380195
4 2023-10-28 20:14 Partial 0.937 6.401
0.931 0.269 0.720 1.257 369685
5 2024-03-25 07:14 Penumbral 0.955 9.597
0.951 0.246 0.634 1.169 405420
6 2024-09-18 02:44 Partial 1.004 10.482
-1.001 0.278 0.757 1.288 357459
7 2025-03-14 06:59 Total 0.317 6.538
0.317 0.248 0.642 1.178 401495
8 2025-09-07 18:13 Total 0.274 1.242
-0.272 0.269 0.724 1.253 369678
9 2026-03-03 11:35 Total 0.361 0.821
-0.359 0.260 0.686 1.224 382604
10 2026-08-28 04:13 Partial 0.463 9.949
0.460 0.255 0.672 1.200 390371
11 2027-02-20 23:14 Penumbral 1.055 8.800
-1.052 0.274 0.736 1.275 363335
12 2027-07-18 16:05 Penumbral 1.420 17.200
-1.412 0.245 0.638 1.162 406026
13 2027-08-17 07:13 Penumbral 1.155 14.794
1.148 0.246 0.639 1.165 405115
14 2028-01-12 04:13 Partial 0.997 8.917
0.992 0.276 0.743 1.285 360295
15 2028-07-06 18:22 Partial 0.732 12.752
-0.728 0.253 0.665 1.190 393944
16 2028-12-31 16:49 Total 0.319 1.219
0.319 0.264 0.697 1.239 377642
17 2029-06-26 03:24 Total 0.015 4.587
0.012 0.267 0.717 1.241 373264
18 2029-12-20 22:41 Total 0.348 7.638
-0.346 0.250 0.647 1.189 398133
19 2030-06-15 18:34 Partial 0.767 6.965
0.763 0.277 0.756 1.281 358754
20 2030-12-09 22:26 Penumbral 0.963 10.697
-0.958 0.245 0.629 1.170 406344
----------------------------------------------------------------------------------------------------------------------------------------
Summary: Total : 8 Partial : 6 Penumbral : 6 All :
20
----------------------------------------------------------------------------------------------------------------------------------------
Note: Times are near greatest eclipse by minimizing
Moon-shadow-axis separation.
---
Cheers,
Mounir IDRASSI
--
---
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/605fed32-207b-4cc8-8e94-81f71a771844n%40googlegroups.com.
Good question — no, I can’t directly execute or simulate C code in my own environment.
Here’s what I can do:
✅ Write, debug, and logically verify C code line by line.
✅ Simulate numeric results (like eclipse geometry or time outputs) using an internal Python sandbox — i.e., I can re-implement the math and test the algorithm’s correctness that way.
❌ I cannot compile or run C code natively, so runtime errors, compiler warnings, or environment-specific behavior would need to be checked on your system.
If you want, I can:
Write a complete C program that predicts lunar eclipses (Meeus-style or geometric bisection like your Ring version).
Simulate the algorithm numerically in Python to verify results.
Then give you the final C source ready to compile and test locally.
Would you like me to do that — and should it match your 2022–2028 time window and the Meeus-based method?
On 9 Oct 2025, at 02:22, Bert Mariani <bert.m...@gmail.com> wrote:
Hello ALL
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/760592db-e0cd-496b-809b-8f3c63b7e6cfn%40googlegroups.com.