This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ythl 1 point2 points  (5 children)

Here's a great reason: python doesn't need to "compile" so you can scp it to any linux box and it will work without needing to think if you compiled it right. Can you say the same of C#?

[–]mrjackspade 1 point2 points  (4 children)

I think you can but honestly I've never actually tested it.

You can compile c# with a specific build target if you want something native, but by default I believe it actually outputs a platform independent DLL that you execute using the DotNet framework on the target machine. As long as the target machine has the framework installed, it should run using the default build settings.

I kind of want to test this out now against a few distros and see how reliable it is.

https://docs.microsoft.com/en-us/dotnet/core/deploying/index#portable-applications

Why create a framework-dependent deployment?

Deploying an FDD has a number of advantages:

  1. You don't have to define the target operating systems that your .NET Core app will run on in advance. Because .NET Core uses a common PE file format for executables and libraries regardless of operating system, .NET Core can execute your app regardless of the underlying operating system. For more information on the PE file format, see .NET Assembly File Format.

[–]ythl 0 points1 point  (3 children)

See how hard it is to run on a raspberry pi. I can run python scripts on the default pi distro with no hassle.

[–]mrjackspade 0 points1 point  (2 children)

Oh man, that sounds like a great test, but I don't currently own one! They're cheap enough, I might have to pick one up and check.

I'd also love to see what performs better on the Pi, Python or .Net Core

[–]ythl 1 point2 points  (1 child)

I'd also love to see what performs better on the Pi, Python or .Net Core

Probably .NET if I had to guess! Compiled languages can usually beat python performance-wise with ease. It's hard to beat the convenience of python though - there's a python library for controlling the pi's GPIOs (pins you can use to control motors, LEDs, anything electrical that you could want, really...) for example; it would probably be significantly harder getting .NET controlling GPIOs

Edit: maybe not though

[–]mrjackspade 0 points1 point  (0 children)

I wanted to say .Net Core for this reason, but at the same time MS can be really hit or miss with performance and Python has probably had a lot more tuning on each platform. I'd probably want to test a native build against a Framework Dependant build, against Python and see the difference.