Static C build

59 views
Skip to first unread message

Ka mara

unread,
Nov 2, 2025, 6:02:57 PMNov 2
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 PMNov 2
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 AMNov 3
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 AMNov 3
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 AMNov 3
to Ilir Liburn, The Ring Programming Language

Thanks Ilir,
For clarification.
Tim


Ilir Liburn

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

You're Welcome.

Greetings,
Ilir

max

unread,
Nov 3, 2025, 1:37:17 PMNov 3
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 PMNov 3
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 AM (11 days ago) Nov 7
to The Ring Programming Language
Hello


Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages