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

.NET (C#, F#, VB.NET, IronScheme, IronPython, etc...) Support #262

Open
LaylBongers opened this issue Feb 9, 2015 · 10 comments
Open

.NET (C#, F#, VB.NET, IronScheme, IronPython, etc...) Support #262

LaylBongers opened this issue Feb 9, 2015 · 10 comments

Comments

@LaylBongers
Copy link

I'm working on making this happen using the Scala implementation as example. I hope to have a nuget package up for basic functionality in a week but I can't know for sure as I'm busy with many other projects currently. I'm leaving this here as an issue to show to other people coming past this project that it's being worked on.

@LaylBongers
Copy link
Author

Achieved a simple connection from .NET to Thrust, thanks for keeping the API straightforward.

Screenshot

@LaylBongers
Copy link
Author

Here's a currently running example with code, about to push a first commit to github with the basic implementation so far. Needs a bit more TLC before I'll start adding all the different features Thrust supports, I want to get in an async API first.

Screenshot

Edit: If anyone happens to know a way to cause thrust_shell.exe to close even in the event of the debugger stopping the application please say. I'm right now manually closing the processes with task manager.

Edit 2: The code's now on github at https://github.com/LaylConway/Thrust.NET

@miketheprogrammer
Copy link
Contributor

Finally got some time to comment. It looks really good. So as far as closing thrust_shell, its difficult on windows, but you need to figure out how to kill a subprocess in windows, which I think is pretty difficult and unreliable at best.

  1. Figure out if there is a Safe Exit protocol for C# that allows you to run clean up on crash.
  2. If you can in C/C++ do a pull request for an API to tell thrust to exit, I am not sure if there already is one, but if there isnt and you can do the PR that would be great, and ill have @spolu merge it.
  3. (1) ==> (2) -- At safe exit time, issue an RPC Call to tell thrust_shell to exit.

Honestly, your C# Application shouldnt crash much, I would expect the Thrust Shell to crash more often, then the controlling application.

@miketheprogrammer
Copy link
Contributor

Also, have a look at my Go-Thrust bindings. Theres a bunch of code in there dealing with exiting.

@miketheprogrammer
Copy link
Contributor

Sorry, I just realized your using Scala and not C#, just replace anytime i said C# with scala heh.

@LaylBongers
Copy link
Author

Closing the process is no issue, I'm doing it without problems, the problem comes in when something like an exception or a debugger stop halts execution without anything being able to get in. Probably the only solution here is an auxiliary process that monitors the first one but I would hate to use that.

I'm pretty much at the point now where I've got a solid connection with Thrust and everything's working smoothly. What's left is to get in all the different call/creates in there and "async" keyword support for C#.

I'm noticing btw there's a bit of font rendering issues going on, is Thrust using an old version of chromium or am I just messing up my styling?

Here's a little screenshot again of the C# bindings in action!

Screenshot

@miketheprogrammer
Copy link
Contributor

Isn't .Net all about services. Couldn't you create a lightweight service at
runtime that deals with this problem. Haven't used .Net in years just
taking stabs in the dark

Closing the process is no issue, I'm doing it without problems, the problem
comes in when something like an exception or a debugger stop halts
execution without anything being able to get in. Probably the only solution
here is an auxiliary process that monitors the first one but I would hate
to use that.

I'm pretty much at the point now where I've got a solid connection with
Thrust and everything's working smoothly. What's left is to get in all the
different call/creates in there and "async" keyword support for C#.

I'm noticing btw there's a bit of font rendering issues going on, is Thrust
using an old version of chromium or am I just messing up my styling?

Here's a little screenshot again of the C# bindings in action!

[image: Screenshot]
https://cloud.githubusercontent.com/assets/3094382/6120945/5619923a-b0dc-11e4-9832-788c182bb6a5.png


Reply to this email directly or view it on GitHub
#262 (comment).

@LaylBongers
Copy link
Author

Creating a service and registering is, even with .NET, a gigantic headache. Even more you can't properly debug service projects. There's probably ways around it but I doubt people would enjoy the library installing a service just to close the process behind it.

It's not a huge problem really, the biggest problem is debugging causing a lot of processes after a while, but I can put in a bit of helper code that checks for old thrust processes still running on start.

@LaylBongers
Copy link
Author

I've added in async support, I'm now going through the docs and implementing everything.

@LaylBongers
Copy link
Author

A nuget package is up, still lacking a lot of features and the API not being that polished yet, but it works smoothly.
https://www.nuget.org/packages/Thrust/

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