Xlinka / NeosPlus

NeosVR Plugin Extra Logix nodes and features
https://discord.gg/9QAaMtXwke
Other
29 stars 19 forks source link

C# to LogiX Compiler #37

Closed DoubleStyx closed 1 year ago

DoubleStyx commented 1 year ago

Yes, I know these listings are getting absurd, but I'd like to actually start discussing these kinds of things sooner rather than later. Or at least considering alternatives to solutions that are commonly proposed.

In a nutshell, some rudimentary way to compile C# to LogiX. This would involve analysis of the C# code, mapping it to some sort of equivalent LogiX representation, optimizing the data flow a bit, and grouping/arranging the nodes so that they are not a jumbled mess at the end of the process. The hardest part will be figuring out the mapping.

I don't think C# as the source language makes a lot of sense here. We're dealing with two separate programming paradigms here, and the object-oriented functionality of C# doesn't lay out well in a flatter, functional context. An option is to define a new scripting language (say, LogiXScript) and use that as a textual, high-level way to define a LogiX graph.

DoubleStyx commented 1 year ago

This "LogiXScript" would be as syntactically close to C# as possible, with the primary changes being a lack of OOP features and a more functional paradigm. Variables would be defined as value or reference registers. Control flow is handled using If, While, For, and other related nodes. Immediate assignment, when used, is handled using writes; "linked" assignment (which will require a symbol other than '=') will function as a drive. The compiler will check for syntactic or semantic errors, like attempting to write to a value that will be driven by that point. It will also provide warnings for possible undesired behaviors, like not checking whether a register is being driven before attempting to write to it.

DoubleStyx commented 1 year ago

Not planned, closing.