Static C build

96 views
Skip to first unread message

Ka mara

unread,
Nov 2, 2025, 6:02:57 PM11/2/25
to The Ring Programming Language
After some time,  today I revisited ring prog Lang and PWCT 2.0, 

Discussion;
wouldn't it be interesting if under Distribute, there was an option say RING2C which simply creates a folder, changes code to C language, puts all the dependencies such as ring.h, etc in that folder!

this gives one ability to run .c file with any C compiler, easily creating a static build of .exe
Because the RING2EXE  static build doesn't build a functional.exe, and doesn't solve the problem of "many files" that may not be needed.

The C file generated ( which the system deletes later) I opened it, was around 25Mbs, I think most of it could be encrypted if, I not mistaken.

The Option using all runtime , which creates a folder named target with all the required libraries, works just fine, but wouldn't the option I am suggesting be "interesting"
I would like to hear, what other members/programers think about that idea.

Tim

Ilir Liburn

unread,
Nov 2, 2025, 6:39:40 PM11/2/25
to The Ring Programming Language
Hello Tim,

C language code is only used to build Ring VM or Ring extensions. Ring code doesn't generate any C code. Static building only links ring.c (ring_state_main) against static library, instead of dynamic linking.

Ring2C is a project I'm working with different goal: to allow static and dynamic typing in Ring (together with arrays and matrices) which can then be translated to C code with better performance (RING2EXE is expected to do such translation later in in Ring2D).That is also true for regular Ring code, except everything stays dynamic when translated to C.

Greetings,
Ilir

Ka mara

unread,
Nov 3, 2025, 2:13:25 AM11/3/25
to Ilir Liburn, The Ring Programming Language

Thanks for the reply.

Do you mean the C code generated is used to build the Ring extensions during run time??
because saying ,


"Ring code doesn't generate any C code."

Is not true because I opened that C file, that is generated.


--

---
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/a8cc9cde-d712-49b0-a576-b8fabb8f70ccn%40googlegroups.com.

Ilir Liburn

unread,
Nov 3, 2025, 6:34:45 AM11/3/25
to The Ring Programming Language
Hello Tim,

You're Welcome. By "Ring code doesn't generate any C code" I mean Ring code is not translated to C code. Instead, Ring VM executes bytecode which is translated from the Ring code.
File you have seen is generated by the ring/tools/ring2exe/ring2exe.ring (GenerateCFile function) which embeds bytecode without using ring/language/src/ring.c (used to build Ring executable + libraries).

If you want to encrypt bytecode, you need to develop your own encryption/decryption algorithm and implement it in the VM which then becomes integral part of the executable.

Greetings,
Ilir

Ka mara

unread,
Nov 3, 2025, 7:53:05 AM11/3/25
to Ilir Liburn, The Ring Programming Language

Thanks Ilir,
For clarification.
Tim


Ilir Liburn

unread,
Nov 3, 2025, 8:05:03 AM11/3/25
to The Ring Programming Language
Hello Tim,

You're Welcome.

Greetings,
Ilir

max

unread,
Nov 3, 2025, 1:37:17 PM11/3/25
to The Ring Programming Language
Hallo Ilir,

Where can I test Ring2C?

It is now possible to use static type rings with Ring2C. 

Ilir Liburn

unread,
Nov 3, 2025, 4:09:05 PM11/3/25
to The Ring Programming Language
Hello Max,

You can't. It is a work in progress.

Greetings,
Ilir

Mahmoud Fayed

unread,
Nov 7, 2025, 7:36:59 AM11/7/25
to The Ring Programming Language
Hello


Greetings,
Mahmoud

Ka mara

unread,
Feb 13, 2026, 2:28:22 PM (10 days ago) Feb 13
to Mahmoud Fayed, The Ring Programming Language

Hallo, revisited this today, the ring documention, talks about  the [options] such as -keep and -geo.

The simple  code  (test.ring) used loads  guilib.ring only, using option - keep
It avails a test.c, which managed to compile with gcc to get test.exe.

Running test.exe (I put ring.dll in same folder ) gives errors related to Qt5. not being present (isn't this strange, ie Qt errors when you have only  guilib.ring)

Any way, test.exe runs (without problems) when put in .../bin

@Mahmoud had suggested MonoRing earlier, as if it doesn't work with guilib.ring.

N.B the main issue why I even made this post in the first place was (I could not get a functional    .exe  using ring2EXE -static because of missing c compiler, yet machine had gcc, and tcc) that's why  I wanted .c file (to do the compiling myself, I don't know if  this is advisable or a nice workaround)

Tim


--

---
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.

Mahmoud Fayed

unread,
Feb 13, 2026, 7:45:23 PM (10 days ago) Feb 13
to The Ring Programming Language
Hello Tim

>> "Running test.exe (I put ring.dll in same folder ) gives errors related to Qt5. not being present (isn't this strange, ie Qt errors when you have only  guilib.ring)"

Loading guilib.ring means loading RingQt
Loading lightguilib.ring means loading QtCore, QtGUI & QtWidgets from RingQt
Loading qtcore.ring means loading QtCore from RingQt

So, these files are around using RingQt or specific libraries from it.

If you don't want to use Qt runtime files, don't use any of these libraries.

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