Gabriel's Horn - Rendering and Animation

41 views
Skip to first unread message

Bert Mariani

unread,
Mar 7, 2026, 3:40:38 PM (7 days ago) Mar 7
to The Ring Programming Language

Hello Mahmoud et ALL

Gabriel's Horn - Rendering and Animation
A shape that has finite volume but infinite surface area

Attached:
    Gabriels_Horn_Painter.ring

It was created with Claude AI.
Required 10 iterations of prompts and corrections to syntax
It was confusing some syntax with JS and Python.
The Math was done Claude AI
I had to provide an  example of how to use Painter and Pixels.
Claude AI seems to forget any RING programing that it did in the past.
I did Not Write Any of the Code !

=============================
Claude AI Comment
The result is a proper tumbling 3D point-cloud of Gabriel's Horn — mathematically interesting too, since the shape that has finite volume but infinite surface area is now spinning in all three axes via a clean Rz→Ry→Rx rotation matrix. Nice piece of Ring code!  

========================

3-D Horn (main panel, dark background) Isometric mesh of Gabriel's Horn using painter.drawLine() quad edges. Each ring-slice is colour-graded — deep blue at the wide mouth (x = 1) fading through to bright orange at the narrow tip (x = 7).

Profile panel (top-left) Axes with arrowheads and the curve y = 1/x drawn in orange across x ∈ [1, 7].

Mouth circle (green) The opening ring at x = 1 (radius = 1) drawn as a closed polyline in green so the circular cross-section is clearly visible.

Math annotations (bottom-left) Parametric equations, the Volume = π and Surface → ∞ integrals, and the paradox note, all in matching colours.

===============================

GabrielHorn.png

gabriels_horn_painter.ring

Mahmoud Fayed

unread,
Mar 7, 2026, 4:45:04 PM (7 days ago) Mar 7
to The Ring Programming Language
Hello Bert

Thanks for sharing :D

I have over 140,000 lines of Ring code generated by Claude Code as of 2026.03.08

I have used the next prompts to teach him about Ring

=================

Things to remember about Ring language then revise your code to be sure that it's correct.

(1) In Ring statements comes first then functions and classes.

(2) In Ring assignment and add() of lists/objects do this by value,
if we need a reference during assignment or adding lists/objects to
lists or attributes, we use the Ref() function.

(3) In Ring when using New keyword then using () after class name this
means call init() method which must be defined in this case, if it's
not defined and we don't need it we don't use () after class name.

(4) In Ring the lists/strings index starts from 1.

(5) Ring is not case sensitive.

(6) Don't use len() inside for-loops and different loops if we can cache
it before the loop and use a variable which contains the len() output.

(7) Separate the source code to multiple *.ring source code files.
Use the load command to load files. Remember in Ring the source code must
follow specific order Loading files then global variables and statements
then functions then classes. Group each related functions together in one file.

(8) Ring doesn't support the ? : ternary operator (must use iif())

(9) The \" escape sequences inside double-quoted strings are invalid in Ring
     (must use char(34) or single-quote the string).

=================

Greetings,
Mahmoud

Azzeddine Remmal

unread,
Mar 7, 2026, 8:05:10 PM (7 days ago) Mar 7
to The Ring Programming Language
Hello Bert,

Thanks for sharing this excellent example of Claude AI's capabilities in generating Ring code. Your experience perfectly illustrates why AI assistants are becoming increasingly powerful when deployed in agentic environments like Claude Code or antigravity.

You've touched on a critical insight: a single system prompt alone is often insufficient for producing reliable code in specialized languages. Here's why an agentic approach changes this:

**Learning from Context:**
When Claude operates as an agent with the ability to browse and analyze code files, it can examine existing Ring code patterns, understand domain-specific conventions, and learn the actual syntax and idioms in use. Rather than relying solely on training data (which may be incomplete or outdated), the model can reference real working examples and adapt its responses accordingly.

**Iterative Refinement:**
Your 10 iterations with corrections isn't a limitation—it's the strength of the agentic model. Each correction provides feedback that helps the AI understand the exact requirements. In an environment where the AI can read the codebase, it can incorporate lessons learned across multiple examples and apply them consistently.

**Why System Prompts Alone Don't Suffice:**
As Mahmoud's prompt demonstrates, encoding specialized knowledge (Ring's 1-based indexing, Ref() for references, load order requirements, etc.) requires detailed rules. But static rules in a prompt can't replace *understanding* through code inspection. An agent that reads actual Ring files learns these patterns implicitly and applies them more robustly.

**The Advantage in Your Gabriel's Horn Project:**
Claude could have confused Ring with JavaScript or Python in a purely text-based interaction. But in an agentic environment with file access, the model can:
- Examine the Painter API implementation to understand correct usage
- Review syntax patterns in existing *.ring files
- Recognize language-specific conventions and apply them correctly

This is why Mahmoud's 140,000+ lines of generated Ring code are increasingly reliable—each project feeds back into the agent's contextual understanding.

**The Path Forward:**
The most effective approach combines:
1. A comprehensive system prompt (like Mahmoud's) that establishes rules
2. Agentic file browsing that grounds the AI in actual codebase patterns
3. Iterative feedback from the user

Together, these overcome the limitations of any single method alone.

Excellent work on both the mathematical rendering and demonstrating this workflow!

Best regards
Azzeddine
Reply all
Reply to author
Forward
0 new messages