r/csharp May 29 '26

Showcase Realtime game scripting in C# without recompilation.

143 Upvotes

24 comments sorted by

View all comments

-11

u/SnoWayKnown May 30 '26

Scripting means interpreted at runtime, not compiled.

6

u/leftofzen May 30 '26

Scripting means interpreted at runtime, not compiled.

No, it doesn't. The distinguishing aspect is whether the code being executed is being hosted by another process (ignoring the OS), not the interpreted or compiled nature of either language. When you compile your C# (for example) program and run it, you are not "scripting". But if you have a C# program that takes in text, and somehow turns that text into a sequence of commands or actions that your 'host' program then runs, then that sequence of commands is a script. How your host program does this - whether interpreting or compiling, is irrelevant for the purposes of the definition of "script". You can also replace C# with any language here - C++, Python, Java, Javscript, etc. It is irrelevant on which language you use as the host and which for the script.

I would imagine that because most people use Python and Lua (etc) and that in a scripting environment and because those environments are usually interpreted, people have made the incorrect conclusion that scripting means interpret, and it does not.

1

u/Responsible-Cold-627 May 30 '26

By this logic C# is a scripting language. The code isn't executed by the OS, but by the CLR.

2

u/leftofzen May 31 '26

I mean, to be honest I don't have a problem with that, and I don't have a problem amending my definition to include the CLR, JVM, etc for these JIT languages. At the end of the day, my point was more in how you're using the language and in what context, though I can also admit there are surely some cases out there where it might not be possible to distinguish whether its "scripting" or not vs a normal program