News for hackers. Stuff that matters.
Re:How small is the smallest .NET Hello World binary? by neonsunset on Sunday July 09, 2023 @06:14AM (#36653196)
This article will confuse people since the executable in question requires a runtime installed on the system (in fact, it uses .NET Framework 4.7.2, in 2023!). Most likely fair comparison for such solution would be .jar or even .py files.

A good source of truth for an actual executable would be Native AOT binary, which can run on Windows, Linux or macOS. Naturally, it will be much larger, having to incorporate GC, possibly ThreadPool, Console and other auxiliary code.

Re:How small is the smallest .NET Hello World binary? by weinzierl on Sunday July 09, 2023 @06:41AM (#36653340)
A comparison between a fully statically linked native binary and one that loads some or all libraries dynamically would equally be vastly unfair.

I think build a Docker container with the most minimal possible image would be a good start. Then compare the uncompressed exported tars size. Probably also not completely fair depending on what question you want to answer but it takes the obvious variances out of the equation.

Re:How small is the smallest .NET Hello World binary? by whartung on Sunday July 09, 2023 @09:25AM (#36654275)
It’s funny because back in the day these were these kind of discussion points thrown around in the Lisp forums when folks would balk at “executable sizes”.

Specifically about how C leverages the “free” runtime of the OS while Lisp has to bundle is own.

This idea of container runtime sizes would be an amusing thread. A good test of something like Nix or Guix to a very fine grain. “We don’t need bash or ls so we removed it. “ “The VM only simulate a single network card, so we’ll scrap all the other driver. “

Re:How small is the smallest .NET Hello World binary? by kazinator on Sunday July 09, 2023 @11:19AM (#36655178)
C doesn't leverage the free run time of the OS, when that OS is Windows. Your hello.exe size has to include the run-time DLL's required for it from the C implementation that was used to build it.

Windows has only recently been moving toward providing a public run-time for C; the "Universal C Run-Time" (UCRT) that has been introduced in Windows 10.

Re:How small is the smallest .NET Hello World binary? by ChrisSD on Sunday July 09, 2023 @11:52AM (#36655527)
The ucrt is included as far back as Windows 7 (if you install updates).
Re:How small is the smallest .NET Hello World binary? by kazinator on Sunday July 09, 2023 @12:17PM (#36655773)
The increment in disk space usage caused by the update has to count toward the effective size of the hello program, experienced by the user of that installation.
Re:How small is the smallest .NET Hello World binary? by ziml77 on Sunday July 09, 2023 @02:18PM (#36657264)
For some reason, even with the UCRT, binaries seem overly bloated. I've been toying with Zig over the past couple weeks and I really like that it doesn't rely on a C runtime on Windows. Plus it makes it easy to operate entirely with UTF-16 strings, which is a nice to have when I'm writing a utility that is specific to Windows.
Re:How small is the smallest .NET Hello World binary? by mananaysiempre on Sunday July 09, 2023 @03:09PM (#36657817)
> C doesn't leverage the free run time of the OS, when that OS is Windows.

Stdio, no. Printf, no (unless you’re an adherent of LIBCTINY[1] or one of its descendants[2] and need only a minimal set of features). Malloc, yes—MSVC’s malloc() on Win32 has always been a thin wrapper around kernel32!HeapAlloc. Strlen or memcpy or whatnot—also possibly yes, but it’s not like minimal implementations of those are large anyway.

[1] http://bytepointer.com/resources/pietrek_libctiny_1996.htm

[2] https://www.benshoof.org/blog/minicrt

Re:How small is the smallest .NET Hello World binary? by sargstuff on Thursday July 13, 2023 @08:57PM (#36718152)
.net program on 8bit IOT OS such as contiki [0] would be lot smaller than 32/64 bit OSes. (assuming not requiring use of native 16/32/64 bit routines ).

[0] https://en.wikipedia.org/wiki/Contiki

Re:How small is the smallest .NET Hello World binary? by Kwpolska on Sunday July 09, 2023 @06:26AM (#36653267)
The .NET Framework is built into Windows, and a mandatory component of it since at least Vista. .NET Framework 4.7.2 specifically should be built-in on supported Windows versions.
Re:How small is the smallest .NET Hello World binary? by ad404b8a372f2b9 on Sunday July 09, 2023 @07:15AM (#36653531)
You never have the right version installed though. Every time I've tried to install a .NET program it's always asked me to install a different version than the one I had.
Re:How small is the smallest .NET Hello World binary? by CrendKing on Sunday July 09, 2023 @07:23AM (#36653570)
Sounds like confirmation bias, because when the right version of .NET is ever used, you probably never knew it was a .NET program to begin with.
Re:How small is the smallest .NET Hello World binary? by ntdll on Sunday July 09, 2023 @09:54AM (#36654457)
Not true in my experience. The "look and feel" of the program usually gives it away more or less immediately.
Re:How small is the smallest .NET Hello World binary? by grujicd on Sunday July 09, 2023 @01:37PM (#36656688)
Probably, if that app uses WPF, which is "self-drawn" GUI library. However, if .Net app uses WinForms, that API is just a wrapper over standard Win32 controls and it looks like any other old school Win app.
Re:How small is the smallest .NET Hello World binary? by ntdll on Sunday July 09, 2023 @03:08PM (#36657800)
You're right, but there are a few subtle differences here and there that often make Windows Forms recognizable.

The best example I got off the top of my head is KeePass v1 [0] and KeePass v2 [1]. v1 is written in C++ with native controls, and v2 uses Windows Forms.

If you look at the menu bar and the toolbar, you'll see a difference. Most notably the drag handle on the left, and the search box on the right, in v2. The difference is often a bit easier to spot on Windows 7.

[0]: https://keepass.info/screenshots/main_big.png [1]: https://keepass.info/screenshots/keepass_2x/main_big.png

Re:How small is the smallest .NET Hello World binary? by userbinator on Sunday July 09, 2023 @04:13PM (#36658409)
The blurrier font in the non-native one is another difference.
Re:How small is the smallest .NET Hello World binary? by EMM_386 on Sunday July 09, 2023 @02:14PM (#36657219)
> The "look and feel" of the program usually gives it away more or less immediately.

If you are talking about the base controls, then maybe. But there are .Net cross-platform frameworks such as Avalonia that can get you a modern loooking UI with theming.

https://github.com/irihitech/Semi.Avalonia

https://github.com/AvaloniaUI/Citrus.Avalonia

etc.

Re:How small is the smallest .NET Hello World binary? by TillE on Sunday July 09, 2023 @08:37AM (#36653982)
I'm surprised Microsoft still isn't pushing .NET 6 (and the MSVC runtime, for that matter) to everyone with Windows Update. They're not very large, most consumers will want them, and picky enterprises could opt out.

It's an odd annoyance that Windows developers have to deal with.

Re:How small is the smallest .NET Hello World binary? by formerly_proven on Sunday July 09, 2023 @08:44AM (#36654028)
Congruent with runtimes (both .NET and native) for Microsoft languages always being kinda weird. "Uh yeah don't use that CRT in %WINDIR%, that's not supported! Everyone need to bring their own... but not as loose DLLs, that's not allowed! Use the MSI package and install it whenever!" (I think most of those restrictions have been removed in the last couple years, and MS also settled down on VC++ ABI and VCRT changes and introduced UCRT in Windows 10, so)
Re:How small is the smallest .NET Hello World binary? by Uvix on Sunday July 09, 2023 @09:25AM (#36654274)
They push updates to .NET if it’s installed. I can understand them not installing if it’s absent, because there’s no good story for what to do when that version goes out of support. If they leave it, then customers have insecure unsupported software on their systems; if they remove it, they’ll break apps that depend on it.
Re:How small is the smallest .NET Hello World binary? by pjmlp on Sunday July 09, 2023 @10:35AM (#36654781)
Because the modern way is to ship it with the application and preferably use trimming.
Re:How small is the smallest .NET Hello World binary? by electroly on Sunday July 09, 2023 @11:42AM (#36655401)
Getting your thing adopted as a Windows component and distributed by Windows Update is a common trap for Microsoft developers. It's always a mistake if you're in some DevDiv or random app team instead of the Windows team. Windows is the slowest-moving product that Microsoft has, and users don't install updates. Hitching your wagon to Windows means no two users will have the same version installed, and getting people to update .NET via Windows Update is a nightmare. God forbid the Windows team decides to stop supporting a version of Windows that is still commonly use in industry; they'll never get a .NET update again.

As a user, think about how annoying it is to get a message saying you need to run Windows Update before you can start an application. Totally unnecessary own-goal for the team that decided to ship their independent component in Windows Update.

It's way easier to either 1.) go self-contained, or 2.) use the on-the-fly .NET download for a framework-dependent build. I absolutely think they made the right call removing current .NET as a Windows component. The annoyance was far greater when .NET Framework was part of Windows.

Re:How small is the smallest .NET Hello World binary? by why_only_15 on Sunday July 09, 2023 @06:57AM (#36653425)
On MacOS at least all binaries are dynamic (except dyld itself) so I think this is fair. This is because everything is supposed to link I believe some kind of runtime dylib instead of doing e.g. syscalls. This includes anything written in C, for example. Size of binary with dynamic links is the most fair comparison between anything running not on Linux.
Re:How small is the smallest .NET Hello World binary? by grishka on Sunday July 09, 2023 @07:57AM (#36653747)
According to Apple you are supposed to link to libSystem.dylib for syscalls, but there's obviously nothing stopping you from calling into the kernel directly.
Re:How small is the smallest .NET Hello World binary? by msla on Sunday July 09, 2023 @09:01AM (#36654135)
> According to Apple you are supposed to link to libSystem.dylib for syscalls, but there's obviously nothing stopping you from calling into the kernel directly.

As a matter of OS design, this is no longer obvious:

https://lwn.net/Articles/806776/

> A new mechanism to help thwart return-oriented programming (ROP) and similar attacks has recently been added to the OpenBSD kernel. It will block system calls that are not made via the C library (libc) system-call wrappers.

MacOS doesn't implement that, sure, but it could.

Re:How small is the smallest .NET Hello World binary? by H8crilA on Sunday July 09, 2023 @07:18AM (#36653540)
I think this will miss the point though. You can consider the specific .NET runtime as its own compute platform / operating system, regardless of what has to be installed on the machine for the program to actually run, and explore the limits of it. It will teach you a great deal about the binary format of the programs.

You can do this for any format that stores executables, for any programming framework. .jar might be interesting, .py obviously isn't. You can do this for obscure old formats, or for something very common like the standard Linux .elf.

Re:How small is the smallest .NET Hello World binary? by tempodox on Sunday July 09, 2023 @07:36AM (#36653636)
I disagree. I cross-compile F# sources with .NET on my Mac to get a stand-alone Linux executable without additional dependencies that I can upload to my server host. It's enough that I maintain the .NET stuff on my development host, I've got no desire to duplicate that work on the public host.
Re:How small is the smallest .NET Hello World binary? by H8crilA on Sunday July 09, 2023 @10:03AM (#36654514)
What do you disagree with?
Re:How small is the smallest .NET Hello World binary? by tempodox on Sunday July 09, 2023 @11:00AM (#36655009)
Considering the runtime as something separate from a single program. I want both in the same binary.
Re:How small is the smallest .NET Hello World binary? by H8crilA on Sunday July 09, 2023 @11:46AM (#36655448)
It's not about considering this or that, but about making a fun little exercise that tells you how the binary format works.
Re:How small is the smallest .NET Hello World binary? by BiteCode_dev on Sunday July 09, 2023 @08:48AM (#36654063)
> .py obviously isn't

Although .zipapp is to Python what .jar is to .py. Probably even closer to .war.

But for purely stand alone stuff, "nuitka3 /tmp/hello.py --standalone" does output a executable that can be used without the user to manually bring in the Python run time. In that case, the hello world is about 16Mb on Ubuntu.

It would be interesting to do this with MicroPython though.

Re:How small is the smallest .NET Hello World binary? by bombcar on Sunday July 09, 2023 @07:42AM (#36653674)
My hello world requires the "bash" framework and is zero bytes. You call it via:

    echo "hello world"
Re:How small is the smallest .NET Hello World binary? by bdhcuidbebe on Sunday July 09, 2023 @07:47AM (#36653693)
I’m intrigued, please share your 100% text compression rate algorithm!
Re:How small is the smallest .NET Hello World binary? by bombcar on Sunday July 09, 2023 @07:48AM (#36653697)
Just make sure you have a filesystem that can take arbitrary-length filenames! Then you can compress to zero byte file with a very long filename ;)
Re:How small is the smallest .NET Hello World binary? by bdhcuidbebe on Sunday July 09, 2023 @08:14AM (#36653838)
I guess if you store the filetable in unlimited S3 storage, maybe ;-)
Re:How small is the smallest .NET Hello World binary? by reilly3000 on Sunday July 09, 2023 @09:53AM (#36654449)
TXT records in Route 53 for 100% SLA
Re:How small is the smallest .NET Hello World binary? by anoncow on Sunday July 09, 2023 @09:45AM (#36654406)
Infinity compression.
Re:How small is the smallest .NET Hello World binary? by osigurdson on Sunday July 09, 2023 @04:43PM (#36658684)
I once ran gzip and infinite number of times on a text file. I was surprised at the result.
Re:How small is the smallest .NET Hello World binary? by besnn00 on Sunday July 09, 2023 @09:17PM (#36660876)
Should it become idempotent after a certain number of iterations? What were the results?
Re:How small is the smallest .NET Hello World binary? by Chaosvex on Monday July 10, 2023 @12:15AM (#36662017)
He doesn't have the results, yet. He's running it in an infinite number of times.

Without actually checking, the result is going to be that the output size increases slightly over time.

Re:How small is the smallest .NET Hello World binary? by osigurdson on Monday July 10, 2023 @11:58AM (#36668261)
I was in quantum space at the time so results are hard to translate. The best approximation to our current reality is a black hole.
Re:How small is the smallest .NET Hello World binary? by tynorf on Monday July 10, 2023 @01:08AM (#36662357)
I'm pretty sure part of the contract with gzip (and compression in general) is that applying it N times is undone by decompressing N times.

The size definitely gets bigger with each iteration:

  $ echo text >0.txt
  $ for i in {0..9}; do                             
  gzip <$i.txt >$((i + 1)).txt
  done
  $ ls | sort -n | xargs -n1 wc -c
       5 0.txt
      25 1.txt
      46 2.txt
      69 3.txt
      82 4.txt
     105 5.txt
     120 6.txt
     143 7.txt
     161 8.txt
     184 9.txt
     207 10.txt
Re:How small is the smallest .NET Hello World binary? by mkleczek on Sunday July 09, 2023 @08:46AM (#36654049)
I am afraid it requires "echo" runtime environment, doesn't it?
Re:How small is the smallest .NET Hello World binary? by tehsauce on Sunday July 09, 2023 @08:54AM (#36654103)
yes but it’s very easy to install if you have npm
Re:How small is the smallest .NET Hello World binary? by AdieuToLogic on Sunday July 09, 2023 @09:14AM (#36654201)
That almost launched a sip of morning coffee... Well played!
Re:How small is the smallest .NET Hello World binary? by hnfong on Sunday July 09, 2023 @08:59AM (#36654129)
echo is actually a bash builtin, so, not really, unless you're using another shell that doesn't have builtin echo.
Re:How small is the smallest .NET Hello World binary? by virtue3 on Sunday July 09, 2023 @10:19AM (#36654637)
whoosh...
Re:How small is the smallest .NET Hello World binary? by AdieuToLogic on Sunday July 09, 2023 @09:21AM (#36654252)
How about this, assuming there must be a stand-alone "binary":

  cd /tmp
  echo 'echo $0' > hello\ world
  chmod +x hello\ world
  PATH=. hello\ world
Re:How small is the smallest .NET Hello World binary? by osigurdson on Sunday July 09, 2023 @11:07AM (#36655066)
Are you sure that is zero bytes?
Re:How small is the smallest .NET Hello World binary? by stickfigure on Sunday July 09, 2023 @11:44AM (#36655428)
> echo "hello world"

I count 18 bytes in that program. Too long!

I left a definitive answer on Quora some years ago:

https://www.quora.com/What-programming-language-has-the-shor...

[dead]
Re:How small is the smallest .NET Hello World binary? by cvoss on Sunday July 09, 2023 @06:39PM (#36659746)
If you insist on categorizing `echo "hello world"` as the invocation, rather than the program, then what is the program under your categorization? I'll submit that it is the `echo` binary, which is a whopping 35kB on my machine.

I'll just observe that there is no way to compress "hello world" below a certain size (definitely not to size 0). If you think you have, you've just "moved" it into, say, the framework/os/input/algorithm/etc.

But this fun little debate we're having here is actually connected to some deep theoretical questions, like Kolmogorov complexity, its invariance theorem, and applications to the concept of data compression [0].

[0] https://en.wikipedia.org/wiki/Kolmogorov_complexity

Re:How small is the smallest .NET Hello World binary? by nighmi on Sunday July 09, 2023 @03:18PM (#36657903)
You can skip "echo" and let the error message output "hello world" along with extra text!
Re:How small is the smallest .NET Hello World binary? by tamrix on Sunday July 09, 2023 @07:32PM (#36660189)
My hello world in php. Requires php.

Hello World

Re:How small is the smallest .NET Hello World binary? by foepys on Sunday July 09, 2023 @08:24AM (#36653894)
.NET Framework is still officially supported and targeting anything higher than 4.7.2 is unnecessary since there are no new APIs in 4.8. 4.8 is just a drop-in replacement for 4.7.2 with things like better high DPI support.
Re:How small is the smallest .NET Hello World binary? by Deukhoofd on Sunday July 09, 2023 @08:47AM (#36654060)
How about any of the modern .NET versions? They're on .NET 7.0.8 nowadays.
Re:How small is the smallest .NET Hello World binary? by TrueSlacker0 on Sunday July 09, 2023 @08:50AM (#36654080)
.net core is at 7. This article is about. Net framework which stopped at 4.8
Re:How small is the smallest .NET Hello World binary? by Deukhoofd on Sunday July 09, 2023 @08:58AM (#36654121)
.NET Core stopped being called .NET Core at version 3, after which it was renamed .NET, and Microsoft announced it was meant to supersede the old legacy .NET Framework. The article opens with asking itself how to get the smallest .NET executable, and then for some reason limits itself to this legacy version.
Re:How small is the smallest .NET Hello World binary? by Kwpolska on Sunday July 09, 2023 @09:55AM (#36654464)
.NET Framework 4.x is built into Windows, and .NET Framework 4.x binaries are understood by the Windows executable loader. The modern .NET must be manually installed and the executables must take care of launching the runtime on their own.
Re:How small is the smallest .NET Hello World binary? by marcosdumay on Sunday July 09, 2023 @10:03AM (#36654509)
> Microsoft announced it was meant to supersede the old legacy .NET Framework

What actually never happened, to nobody's surprise.

So now we have .Net that was renamed into .Net Framework that is legacy, .Net Core that is legacy but compatible with the modern version, and .Net that is current. Anyway, the platform never stopped being called .Net, because it's larger than just the runtime.

We also have 2 different number sequences starting from 1, and one starting from... some times 4, other times 6, depends on your point of view.

We also have a bunch of confused people without any reason, because all of this is as clear as water. But anyway, it's not the author fault that he didn't communicate the version in an adequate way.

Re:How small is the smallest .NET Hello World binary? by orphea on Sunday July 09, 2023 @10:25AM (#36654688)
> .Net that was renamed into .Net Framework

This is not correct. .NET Framework was named Framework from 1.0. The only time something was renamed is .NET 5 which came after .NET Core 3.1.

> We also have a bunch of confused people without any reason, because all of this is as clear as water.

It's funny you say that. Do you consider yourself one of those confused people? :)

Re:How small is the smallest .NET Hello World binary? by marcosdumay on Sunday July 09, 2023 @01:15PM (#36656355)
> Do you consider yourself one of those confused people?

Yes. I have never took place in a conversation about versioning problems in .Net where each person wasn't talking about completely different things.

Anyway, I clearly remember nobody ever naming anything "framework" until the second or third stable version. And if there was such a thing, I would probably have heard, because MS was incredibly loud at the time.

It was retroactively renamed after it.

Re:How small is the smallest .NET Hello World binary? by WorldMaker on Monday July 10, 2023 @02:13PM (#36670576)
As I recall it, even 1.0 was always referred to as .NET Framework. There was a million .NET "brands" from Microsoft when .NET Framework launched. .NET was the overall "initiative" and .NET Framework was only one in that "portfolio". Then Microsoft got bored with most of the other ".NET brands" and .NET Framework was last .NET standing. It wasn't until 2.0 or so that I recall people felt safe calling .NET Framework just ".NET" without feeling confused about other .NET branded things. Microsoft's own branding advice never dropped "Framework" from .NET Framework even deep into the 4.x timeframe so long divorced from "the initiative" and no other remaining uses of .NET as a brand.
Re:How small is the smallest .NET Hello World binary? by borissk on Sunday July 09, 2023 @01:54PM (#36656933)
Haha, the burn.

I remember back in the day - around 2001 - Microsoft thought it will center all their products around Web Services and call them .NET. Windows .NET Server was the supposed name for Server 2003. In the end a few things came out of it: Visual Studio .NET, .NET (the framework), VB.NET, ASP.NET.

https://en.wikipedia.org/wiki/Microsoft_.NET_strategy

Re:How small is the smallest .NET Hello World binary? by belinder on Sunday July 09, 2023 @10:29AM (#36654714)
It didn't start from 4 but 5. they skipped 4 because people would confuse it for .net framework
Re:How small is the smallest .NET Hello World binary? by foepys on Sunday July 09, 2023 @01:46PM (#36656825)
> What actually never happened, to nobody's surprise.

Unless they provide feature parity, it will never happen.

A working WinForms designer for third-party controls (read: any control not provided by the framework itself or NDA-ed vendors) in Visual Studio would be nice, for example.

Re:How small is the smallest .NET Hello World binary? by brookst on Sunday July 09, 2023 @08:54AM (#36654104)
Do we care about “fairness” or “reality”? Since it’s impossible to have a modern Windows install without .net, and Linux and MacOS don’t have it by default, it seems an odd way to be “fair”
Re:How small is the smallest .NET Hello World binary? by deely3 on Sunday July 09, 2023 @09:44AM (#36654404)
> Windows install without .net

correction: without some specific version of .net.

Re:How small is the smallest .NET Hello World binary? by ptspts on Sunday July 09, 2023 @09:50AM (#36654437)
Is there backwards compatibility between .NET Framework versions? Which version number should I request in my ultraportable executable? (Java seems to work fine most of the time eith.some javac flags.)
Re:How small is the smallest .NET Hello World binary? by password4321 on Sunday July 09, 2023 @11:00AM (#36655005)
> Is there backwards compatibility between .NET Framework versions?

In theory: yes. In practice: mostly. There can only be one .NET Framework 4 installed at a time; the recent changes are found at https://learn.microsoft.com/en-us/dotnet/framework/whats-new.

> Which version number should I request in my ultraportable executable?

This gets tricky if you want to support more than Microsoft does. Here is the details on recent .NET Framework versions per OS: https://learn.microsoft.com/en-us/dotnet/framework/install/g... and ancient of days: https://learn.microsoft.com/en-us/archive/blogs/astebner/mai....

For example: Microsoft currently supports Windows 10+, which first included .NET Framework 4.6. However, Microsoft only currently supports v4.6.2+, and v4.8 has been "Windows Update"'d since May 2019. I personally bumped an old open source project from v3.5 to v4.8 recently because of how hard it was for myself as a returning contributor to build these days.

Re:How small is the smallest .NET Hello World binary? by WorldMaker on Monday July 10, 2023 @02:01PM (#36670377)
From my understanding, .NET Fx 1.x and .NET Fx 2.0 will likely "always" be supported on Windows. Both Fx 3.x and Fx 4.x have no trouble "pretending" to be 2.0 in a backwards compatible way and 1.x is small enough that Windows just still bundles it in about the same way that Windows still bundles the VB6 runtime.

If you want the most "ultra-portable" executable for .NET Framework, you could choose 1.1 or 2.0. Picking 1.1 in 2023 is about as silly as picking VB6, it also won't feel just about anything like modern .NET. 2.0 feels a lot more like modern .NET (especially because that's when Generics and Generic Collections first exist), but also not really something I'd recommend in 2023. (But in theory targeting .NET Fx 2.0 gets you ultra-portable all the way back to Windows 98.)

Re:How small is the smallest .NET Hello World binary? by sbjs on Sunday July 09, 2023 @09:49AM (#36654432)
Closer analogy would be .pyc files. Precompiled bytecode.
Re:How small is the smallest .NET Hello World binary? by pjmlp on Sunday July 09, 2023 @10:33AM (#36654757)
Microsoft themselves just released a new product based on .NET Framework 4.7.2, so don't be that hard on the authors.

https://www.infoq.com/news/2023/06/logic-apps-custom-code/

Re:How small is the smallest .NET Hello World binary? by aardvarkr on Sunday July 09, 2023 @10:52AM (#36654923)
That’s a logic app plugging that allows for compatibility with framework code. M$ is a behemoth that supports old legacy code from businesses that don’t want to upgrade so I’m not surprised that they’re making things like logic apps compatible but this isn’t really a “new product based on framework”.
Re:How small is the smallest .NET Hello World binary? by SirMaster on Monday July 10, 2023 @12:59AM (#36662296)
As far as I understand, VS 2022 is also written in .NET Framework. I am not sure exactly which version though.
Re:How small is the smallest .NET Hello World binary? by ramesh31 on Sunday July 09, 2023 @11:12AM (#36655111)
>This article will confuse people since the executable in question requires a runtime installed on the system (in fact, it uses .NET Framework 4.7.2, in 2023!).

That's fair though. The post is titled "the smallest .NET hello world binary", not "the smallest C# hello world binary"

Re:How small is the smallest .NET Hello World binary? by ComputerGuru on Sunday July 09, 2023 @12:08PM (#36655700)
Not necessarily - the actual output exe doesn't actually use the .NET framework for anything at all, besides invoking the main. The actual logic of outputting the bytes to the console is done via a pinvoke (c# ffi) call to the underlying unmanaged (non-.net) code exposed by ucrt.dll

But anyway, this other article [0] (shared in another comment here) about creating the smallest version of Snake (the game) was done on top of .NET Core (the new version of .NET that isn't bundled with Windows) and effectively does the same thing, but actually produces a non-.NET binary, if that's more to your taste.

[0]: https://medium.com/@MStrehovsky/building-a-self-contained-ga...

Re:How small is the smallest .NET Hello World binary? by sedatk on Sunday July 09, 2023 @08:37PM (#36660611)
> the actual output exe doesn't actually use the .NET framework for anything at all

except for runtime environment initialization, JIT compilation, and execution.

Re:How small is the smallest .NET Hello World binary? by niutech on Wednesday July 12, 2023 @07:48AM (#36693153)
For a tiny, single cross-platform binary, check out Cosmopolitan libc.
Re:How small is the smallest .NET Hello World binary? by fennecfoxy on Wednesday July 12, 2023 @08:57AM (#36693880)
Always see this sort of pedanticism with topics. Are we gonna start counting the bytes of firmware on all chips on motherboard as well?

Display drivers and firmware of various mcus used in the computer monitor itself?