Issue: Support for c#
MordechaiHadad opened this issue · 8 comments
Sure :-)
I am a complete novice to C# and roslyn, is there any REPL that I should be aware of (I could integrate it into sniprun modulo some extra work), or is the framework solely 'compiled' ?
C# is only compiled but there are third party tools like this one https://github.com/waf/CSharpRepl
But don't really know if its any benefit to have REPL
It's helpful if the REPl is very stable, though interpreted languages benefit most.
I'll leave it at that for now, non-REPL and 'the usual' support (bloc-level)
fair enough! thank you
Csharp based on mono
is released along with v1.2.9. You can simply update sniprun and have things working, though i've made a (fairly reasonable) assumption: that the filetype (output of :set ft?
) for csharp files was 'csharp' or 'cs'.
(Moreover 'cs' may conflict with coffeescript, so you may need to put 'CSharp_original' in the 'selected_interpreters' configuration field if your filetype is 'cs'. More info in the [wiki](https://michaelb.github.io/sniprun/sources/README.html#configuration if it doesn't work out of the box)
why exactly mono? @michaelb
- mono is the only thing that worked out-of-the box and supported compiling simple files (not projects) via cli utilities (though this assertion should be salted with the third point), and making a working C# interpreter didn't require
roslyn
per se - my previous experience with dotnet (for F#) was disastrous (multi-second latencies)
- explanations of the different ecosystems (roslyn vs mono) and how to setup/use them are either outdated (~2015) , saying roslyn is a part of mono or uncomprehensible to a novice such as me. (Just check out the difference in internet search results quality for "install roslyn csharp linux" vs "install mono csharp linux")
Sniprun uses the csc
compiler that is, as I understand it, roslyn under the hood. I still need mono
to run the produced executable. So I'm not sure what is the difference, maybe better error message ? idk
fair enough! thank you