Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunJs assembly missing #1

Open
Beej126 opened this issue Oct 7, 2016 · 2 comments
Open

RunJs assembly missing #1

Beej126 opened this issue Oct 7, 2016 · 2 comments

Comments

@Beej126
Copy link

Beej126 commented Oct 7, 2016

TildeSupport project references RunJs... i'll comment it out for now but was pretty amazed i couldn't google it right up, help?

@jamietre
Copy link
Owner

jamietre commented Oct 7, 2016

Disclaimer: I had a lot of fun with this but there were some unresolvable (for me anyway) issues. It works great with your own C# code. However, you can only reference .NET DLLs targeted to the specific platform (e.g. x64) that you build this on (and you can't build it as a cross-platform DLL or it won't work with DllExport, which is required for the COM API to be exposed to TCC). If you reference platform-independent code, it will crash. It seems to work with Microsoft core libraries, but anything else (like JSON.net, etc) doesn't work. I am not that familiar with cross-platform architecture issues and couldn't figure it out after quite a bit of research so I kind of gave up.

RunJs is a project I created (and I guess never put on github) that wraps Jint as a javascript interpreter. I had to compile Jint from source as platform-specific x64 for it to work. The whole point of this was so I could just run arbitrary javascript from the CLI. You could always do this with node, e.g. node --eval ..., but it used to be kind of slow to start node in Windows, which made it less than satisfactory for some uses, e.g. as part of a dynamic command prompt.

But I don't use it any more. It became annoying enough to deal with the architecture issues that I eventually gave up on trying to add external DLLs to the plugin. So I can put RunJs up there if you want but now I just use node for everything :) The performance of node on windows has improved enough that it isn't a problem as it was before.

I also am using javascript for my prompt string instead of the TCC plugin. It's just easier to maintain and tinker with. See this: https://github.com/jamietre/node-windows/blob/master/tcc-le.md

Using just native TCC functions, you can create a prompt that calls a node.js script, and from there you can do whatever you want. This one queries your git repo status, etc to produce a meaningful prompt. The example code here creates a prompt that looks like

[code/tcc-plugin] *master[-1] >
  • last 2 segments of path
  • * indicates dirty repo
  • branch name
  • [-1] indicates one commit behind

This is the info I like, it would be trivial to customize it any way you want. This all works without tcc-plugin. So the only thing I really need here is the tilde parsing (which is ok but doesn't work for all scenarios anyway), everything else I feel like is more easily created as node.js globals or scripts launched via alias.

@Beej126
Copy link
Author

Beej126 commented Feb 28, 2017

hey thanks for getting back... apologies i didn't see sooner... that all makes basic sense.

regarding running of various .js files as command line scripts via node... it strikes me that you could do the mild convenience of dropping the node.exe and .js the same way i've done here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants