Hacker Newsnew | past | comments | ask | show | jobs | submit | andix's commentslogin

I guess there are some Python workloads on Azure, Microsoft provides a lot of data analysis and LLM tools as a service (not paid by CPU minutes). Saving CPU cycles there directly translates to financial savings.

Microsoft is huge, it's many companies inside one company.

.NET seems to be somewhere close to Azure, but now far away from Windows or the business applications (Office/Teams, Dynamics, Power Platform). Things like GitHub, LinkedIn or Xbox seem to be de facto separate companies.

Edit: .NET used to be tied closely to Windows, which gave it the horrible reputation. The dark age of .NET ;)


It's a code generator that runs during compile time. It's a source generator that adds some generated code files to the project. So it runs way before AOT or JIT. Once AOT/JIT run, Comptime is already invisible to them, they only see the generated code from Comptime.

The syntax looks a bit like F#. But F# only has a few features that generous people might consider meta programming.

There was a lot of fuss about meta programming around 10-15 years ago, but it never got a lot of traction. Maybe for a good reason? I think a lot of the problems it solved, were also solved by functional programming features that slowly appeared in C# over the years.


Please don't. Nobody wants even more complexity in MSBuild ;)

Modern C# and .NET are great. It still suffers from the bad reputation of the Windows-only .NET Framework. It's still a quite heavy platform with a lot of features, but the .NET team invested a lot of time to make it more approachable recently.

With top level Programs and file-based apps[1] it can be used as a scripting language now, just add a shebang (#!/usr/local/share/dotnet/dotnet run) to the first line and make it executable. It will still compile to a temporary file (slow on first run), but it doesn't require a build step anymore for smaller scripts.

[1]: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals...


Also, if you compile Ahead Of Time (AOT) you can cut down on the features and get basically as small a subset as you want of the libraries. IMHO C# and dotnet are really starting to become very impressive.

There's also bflat [0]. Not an official Microsoft product, more of a passion project of a specific employee.

"C# as you know it but with Go-inspired tooling that produces small, selfcontained, and native executables out of the box." Really impressive. Self contained and small build system.

[0] https://github.com/bflattened/bflat


AOT requires a lot of fiddling around, and might break the application unexpectedly, with very weird errors. It is mostly targeted to Blazor (WASM) and for serverless functions.

The default runtime and JIT are fine for most use cases.


  > AOT requires a lot of fiddling around, and might break the application unexpectedly, with very weird errors.
It hasn't been my experience. Native AOT does come with some limitations [1][2], but nothing awful. Mostly it's that you can't generate code at runtime and you have to tame the code trimmer. Just don't ignore code analysis warnings and you should be good.

  > It is mostly targeted to Blazor (WASM) and for serverless functions.
Making your CLIs start fast is also a huge use case.

[1]: https://learn.microsoft.com/en-us/dotnet/core/deploying/nati...

[2]: https://learn.microsoft.com/en-us/dotnet/core/deploying/trim...


C# AOT may sometimes require fiddling around, but in my experience a lot less fiddling around than what my alternative used to be, which was to use C++.

Does this finally allow reading string literals from files and include them into the binaries?

I've seen a Go project that was heavily using https://pkg.go.dev/embed for loading some template files, and got a bit jealous. Back in the days of .NET Framework it was common to compile file contents into resource files, but it was always quite cumbersome.


C# / .NET has always had that abililty.

  <EmbeddedResource Include="/path/to/file.txt" /> 
Then you can read that file from the assembly with:

  assembly.GetManifestResourceStream
I'm not sure what's awkward about that, but it's nothing new.

Discoverability for this is in visual studio, if you go to file properties there's a drop-down where you choose between Content, EmbeddedResource, Ignore, etc.

That determines what happens in compile, whether it is copied to output directory, compiled into the binary, etc.


The Stream is awkward. It needs to be processed either once at startup or lazy on access, or every time it's used (allocations!). Also discovering multiple files is awkward.

Can't you already do that with embedded resources?

Yes, you can. But it's a bit cumbersome. The API to read them is not really intuitive, they are only accessible as a Stream, so they need to be either read every time into a string (new allocation, slow), or you need a helper that reads them once and keeps them in memory. I think there are also a lot of gotchas around naming and listing them.

In modern code I don't see them that often anymore.


I see your point and I don't necessarily disagree but better API for embedded resources is just a couple of simple extension methods away. I wouldn't even bother adding an external package for it.

Array also implements IReadOnlyList if I'm not mistaken.

I think C# doesn't really have immutable collections, they just can be typecasted to IReadonly* to hide the mutable operations. But they can always be typecasted back to their mutable base implementation.

The only real immutable collections I know of, are F#s linked lists.


Immutable collections exit, they were just added later. See System.Collections.Immutable:

https://learn.microsoft.com/en-us/dotnet/api/system.collecti...


Those collections are more like copy-on-write than actual immutable. System.Collections.Frozen is the real thing.

Isn't Frozen something you do to a set or dictionary to say, I'm not going to add any more values, please give me a version of this which is optimized for lookup only?

I do a lot of .NET programming, and I've never seen them getting used. :O

Roslyn, the C#/VB compiler, uses them extensively, but in other code they're indeed quite rare.

Adding to the sibling comment, there are also Frozen{Dictionary,Set}: https://learn.microsoft.com/en-us/dotnet/api/system.collecti...

One man's constant is another man's variable.

This has to be on purpose, right?

Redacting documents is hard for people who didn't learn how to properly do it, and don't have the right tools. But for courts, the FBI or the DOJ this shouldn't apply. They know how to do it right.

I can only imagine, that some people didn't redact the documents properly on purpose. Plausible deniability.


Is there any option for passengers to chose another airport? Or for ATC to force the plane to use the next best airport? For example if the runway is under construction and severely blocked.

I would imagine it is aware of NOTAMs that indicate runways being closed when it picks where to land.

It's probably a possibility in some bizarre & unlikely set of circumstances with perfect timing, but even then it's still a better outcome than flying into the ground uncontrolled. See the Gimli Glider where a 767 flown by humans was forced to make an emergency landing at a runway that was actively being used as a dragstrip during the landing—everyone survived.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: