Open djlw78 opened 4 years ago
You mean on Windows? Yes, it's compiled under bin/Debug for instance and called cscs.exe You can submit any CSCS script as a command-line argument to that exe, e.g. cscs.exe myscript.cscs Actually almost same thing happens on a Mac.
On Tue, Mar 10, 2020 at 10:41 PM John notifications@github.com wrote:
How would compiling to exe look/work?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vassilych/cscs/issues/19?email_source=notifications&email_token=AE74VFG2LAHB7L4HQ5MRALLRG2XZDA5CNFSM4LFIRGO2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IUA7GJQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE74VFHRPSU7GQM7LUKQCKLRG2XZDANCNFSM4LFIRGOQ .
Oh no I mean MyScript.exe Compiling scripts or script clusters to an portable executable file.
https://www.codemag.com/Article/2001071 but there is no perfect example on precompiler.
Ok, I see. Then you'd need to do a small change in Main.cs. Instead of reading the scripting file from the command-line, you "hardcode" the filename in the code like this (ca. line 40):
string scriptFilename = "somepath/myscript.cscs";
string script = Utils.GetFileContents(scriptFilename);
But the script must under somepath at runtime (could be in the same directory as the binary itself). You might have a question if you can encode the contents of the script so that if you distribute the executable together with the script the clients won't be able to see the scripting code. If this is the question, I am currently working on it.. Let me know...
On Wed, Mar 11, 2020 at 12:01 AM John notifications@github.com wrote:
Oh no I mean MyScript.exe Compiling scripts or script clusters to an portable executable file.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vassilych/cscs/issues/19?email_source=notifications&email_token=AE74VFDTNBH7AVRGYLPD2ZLRG3BEPA5CNFSM4LFIRGO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEONQGKA#issuecomment-597361448, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE74VFHFA2T2ZUUJ22IJCC3RG3BEPANCNFSM4LFIRGOQ .
Yeah, that's almost useless I ripped this code out "DebuggerServer.StartServer(13337, true);" by commenting itself and the if statement around it because it was generating a very disliked outcome for me, after all of that was removed it ran fine. (I don't wish to connect to the remote debugger every run), still unsure about how to compile the cscs script to and exe file with includes, because there is no documentation on precompiler because the arguments for it are "string functionName, string[] args, Dictionary<string, Variable> argsMap, string cscsCode, ParsingScript parentScript" and I am not even sure if the precompiler is the thing I am looking towards to compile.
What exactly is almost useless? First step to include a script into the binary is to add those two lines (or edit them) that I mentioned in my previous e-mail:
string scriptFilename = "somepath/myscript.cscs"; string script = Utils.GetFileContents(scriptFilename);
After this work next step is the precompiled stuff. I didn't get if this step worked for you or not. Obviously you should remove all the stuff you don't need, like the Debugger (it is used to connect from VS Code actually).
On Wed, Mar 11, 2020 at 12:19 AM John notifications@github.com wrote:
Yeah, that's almost useless I ripped this code out "DebuggerServer.StartServer(13337, true);" by commenting itself and the if statement around it because it was generating a very disliked outcome for me, after all of that was removed it ran fine. (I don't wish to connect to the remote debugger every run), still unsure about how to compile the cscs script to and exe file with includes, because there is no documentation on precompiler because the arguments for it are "string functionName, string[] args, Dictionary<string, Variable> argsMap, string cscsCode, ParsingScript parentScript" and I am not even sure if the precompiler is the thing I am looking towards to compile.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vassilych/cscs/issues/19?email_source=notifications&email_token=AE74VFDGDBLF4PREO423BSLRG3DHTA5CNFSM4LFIRGO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEONRNQI#issuecomment-597366465, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE74VFD3QVWBC3DSS4WLBF3RG3DHTANCNFSM4LFIRGOQ .
Yes that part works fine, not sure what to fill in for precompiler(args...) though.
Not sure I got your question - args where, in what call?
On Wed, Mar 11, 2020 at 1:44 AM John notifications@github.com wrote:
Yes that part works fine, not sure what to fill in for precompiler(args...) though.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vassilych/cscs/issues/19?email_source=notifications&email_token=AE74VFHMX3T3ZDSLZUDS6KTRG3NH7A5CNFSM4LFIRGO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEONWWXI#issuecomment-597388125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE74VFDNV45VT2FQQJ4BJTDRG3NH7ANCNFSM4LFIRGOQ .
Its just not documented how to tell the cscs compile to convert cscs files into exe files, or dlls for some matter (dll is less important) I think the pre-compiler is in charge of that but I am not sure how to use it.
No, you don't compile it directly into an .exe file. When Pre-compiler compiles a function, it puts it into a dll. But this dll is created at runtime and added to the executing binary either at start-up, when a start-up script contains a pre-compiled function (the keyword is "cfunction" for such function) or any time after the start-up...
On Wed, Mar 11, 2020 at 7:05 PM John notifications@github.com wrote:
Its just not documented how to tell the cscs compile to convert cscs files into exe files, or dlls for some matter (dll is less important) I think the pre-compiler is in charge of that but I am not sure how to use it.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vassilych/cscs/issues/19#issuecomment-597784487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE74VFF7A4SEAFZ3SMZDA2LRG7HF5ANCNFSM4LFIRGOQ .
Okay I am getting no where will this i'll just find a way to compile it exe myself.
Can you let me know if you have a particular question or if there are questions to anything I wrote before?
On Thu, Mar 12, 2020 at 3:42 PM John notifications@github.com wrote:
Okay I am getting no where will this i'll just find a way to compile it exe myself.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vassilych/cscs/issues/19#issuecomment-598226059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE74VFARRMQGMCGAP3CJMDDRHDYDZANCNFSM4LFIRGOQ .
How would compiling to exe look/work?