5 ms·
I fully agree. As a close runner up on C++ for bundling into executables is C# in my opinion.
by andi999 5y ago
I fully agree. As a close runner up on C++ for bundling into executables is C# in my opinion.
- pansa2 5y agoHow well does C# work for this cross-platform? Are its executables very large? I considered using Go for command-line apps - but in my case they often have to interact with existing C++ code. That’s easy enough to do from Python, but I was advised that interop with other languages is an area in which Go is particularly weak.
- pca 5y agoI think a standalone "Hello World", built with .NET Core, is around 60-70 MB large on both Linux and Windows. The startup times are alright - slower on Windows than on Linux in my experience because of the file system performance.
- arboghast 5y agoLower than this. If I use the AOT compile option with .NET Core 3.1 I get a 40MB binary which goes down to 10MB with the trim option. Just like Go which embed it’s runtime, .NET Core binary compiled with AOT embed the CLR but, unlike Go, it has options to trim out the pieces that aren’t necessary, which I really like.
- formerly_proven 5y agoIf you use legacy .NET (which is preinstalled on Windows) a GUI Hello World is about 10 kB.
- chrisseaton 5y ago> I think a standalone "Hello World", built with .NET Core, is around 60-70 MB large on both Linux and Windows. Lol what? What goes into a 70 MB implementation of 'hello world'?
- deleted 5y ago[deleted]
- Kwpolska 5y agoIt’s not a 70 MB implementation of Hello world. It’s a 70 MB compressed runtime with a standard library (or at least the most basic parts of it) and a couple KB "Hello world".
- chrisseaton 5y agoWhy is the runtime so huge and why is so much of the standard library included? Java ‘hello world’ compiled into a static binary is just a couple of MB.
- pjc50 5y agoSee PublishTrimmed: by default it includes all the standard library. "Trimming" is what almost all C-style linkers do by default, but C# doesn't because there are some reflection issues (e.g. you can reference types by strings and construct them at runtime, which would fail in a Trimmed environment unless you explicitly tell it not to trim those types).
- older 5y agoCan this couple MB static binary run without JRE?
- chrisseaton 5y agoWell it wouldn't be very 'static' if it couldn't, so yes of course.
- dmingod666 5y agogRPC is one way to go about it if you have control over both c++ and go. Go binaries work pretty consistently across Linux which is a positive.