HNHacker News
TopNewBestAskShowJobs

benaadams

4,573 karma · joined September 7, 2015

[ my public key: https://keybase.io/ben_a_adams; my proof: https://keybase.io/ben_a_adams/sigs/gvU8GwPtjTPPJkoiHhuw1fW7zJ-3qMcHhbK2r-BuxrY ]
submissionscomments
benaadams··on Ghostcat bug impacts all Apache Tomcat versions released in the last 13 years
> According to Snyk, apps built on the Spring Boot Java framework are also vulnerable since they come with a pre-included Tomcat server. Per Red Hat, Tomcat also ships with other Java-based frameworks and servers, such as JBossWeb and JBoss EAP.
benaadams··on The U.S. is charging Huawei with racketeering
I hear OSS is doing well when it comes to innovation...
benaadams··on “We already store data. In a database. It works well”
Well the commits are proof-of-work; though the validation is done by human (assuming the user doesn't have commit access on the main branch)

However its more of a Merkle tree https://en.wikipedia.org/wiki/Merkle_tree; which blockchain is also.

benaadams··on .NET everywhere apparently also means Windows 3.11 and DOS
That article isn't about running on Windows 3.11 and DOS; that article is about shrinking the executable size to under 8kB
benaadams··on .NET everywhere apparently also means Windows 3.11 and DOS
Because its a different article.

The first one is about shrinking to under 8Kb.

This is about running on Windows 3.11

benaadams··on .NET everywhere apparently also means Windows 3.11 and DOS
Its a substantially different article mostly about running on Windows 3.1; whereas the first is about shrinking the executable under 8 kilobytes (but not DOS).

And yes the game now runs on MS-DOS 5.0 https://twitter.com/MStrehovsky/status/1218966180104458240

> 1/n It has always bugged me that I can't run my 64-bit C# games on MS-DOS. Today I fixed that. A thread.

benaadams··on The Go runtime scheduler's way of dealing with system calls
There are two main ways to do async/concurrency where you release the thread to do other work while you are waiting.

1. stackless (async/await) where the operation becomes an inspectable object that you can choose what to do with (awaiting being suspend for completion) as taken by C#, C++, Python, JS, PHP, Swift and Rust

2. "with stack" where you pretend its not async; but this means when something else uses the thread you need to get the suspended operation's stuff off the thread; usually by not using the thread's stack at all and having it in the heap and just jumping into and out of these "off-thread" stacks; as used by Go and being looked at for Java (as Project Loom)

Interesting paper on it http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2018/p136...

> While fibers may have looked like an attractive approach to write scalable concurrent code in the 90s, the experience of using fibers, the advances in operating systems, hardware and compiler technology (stackless coroutines), made them no longer a recommended facility.

Disadvantage of stackless is the extra boilerplate (e.g. async/await everywhere); though it also gives more control as the consumer of the operations (e.g. fanout and wait for many; or continue not waiting for the result at all)

Advantage of the "with stack" approach is it looks the same as non async code as its all hidden (goroutines aside); which is why Java is no doubt looking at doing it as there is a large body of code that would need to be rewritten so "hiding it" is easier to avoid that.

C# had/has teething issues when async/await was introduced as it kept the initial thread blocking methods; and added the async and they don't mix very well, you need really to go one way or the other when developing.

Javascript leapt at async/await as it was all async anyway, but callback based which makes for horrible code to follow; so it made everything much cleaner.

benaadams··on Fed Adds $72.8B to Markets, Balance Sheet Moves to $4.07T
https://www.nybooks.com/articles/2019/12/05/against-economic...
benaadams··on Fed Adds $72.8B to Markets, Balance Sheet Moves to $4.07T
Yes. Inflation decreases debts and means people with wealth need to do something with their money (e.g. invest) in order to retain its value.

However, speculative increases (buying land for increase in prices, buying shares for increase in share price, etc) and rent seeking adds price but doesn't add real value/investment to the economy.

benaadams··on .NET Core 3.0
And in 2.0 https://devblogs.microsoft.com/dotnet/performance-improvemen...

And in 2.1 https://devblogs.microsoft.com/dotnet/performance-improvemen...

3.0 has new JIT capabilities like CPU hardware intrinsics; devirtualization; Span etc which in turn enable new techniques in the standard library.

Though 3.0 is a vast set of improvements compared to the previous two

benaadams··on .NET Core 3.0
.NET Core is faster than .NET Framework
benaadams··on Goldman Sachs is spending $100M to shave milliseconds off stock trades
That's due to technology; not capitalism, they aren't the same thing.

A huge amount of R&D happens in academia which isn't capitalism; but then is monetised by capitalism (but doesn't reinvest it back into the academia)

benaadams··on Deserts 'greening' from rising CO2
We've just passed 400 ppm, everything was pretty different when it was much higher https://e360.yale.edu/features/how-the-world-passed-a-carbon...

> To find a time when the planet’s air was consistently above 400 ppm you have to look much farther back to the warm part of the Miocene, some 16 million years ago, or the Early Oligocene, about 25 million years ago, when Earth was a very different place and its climate totally dissimilar from what we might expect today.

Towards the end Miocene was when grasses began to emerge significantly

> The higher organic content and water retention of the deeper and richer grassland soils, with long-term burial of carbon in sediments, produced a carbon and water vapor sink. This, combined with higher surface albedo and lower evapotranspiration of grassland, contributed to a cooler, drier climate. C4 grasses, which are able to assimilate carbon dioxide and water more efficiently than C3 grasses, expanded to become ecologically significant near the end of the Miocene between 6 and 7 million years ago.

https://en.wikipedia.org/wiki/Miocene#Flora

benaadams··on Apple to Pay £3.8m Tax on £1.2bn UK Sales
And those price rises would increase their profits which would ...
benaadams··on Apple to Pay £3.8m Tax on £1.2bn UK Sales
Companies don't pay VAT on their purchases; the consumer pays the VAT.

Would they sell their products for 20% less; or would they decide consumers were happy to pay at that price so keep the price the same and keep the extra as profits?

benaadams··on One whole-body MRI could replace multiple cancer scans
NHS isn't a for profit healthcare system; and they'll break even earlier on the early detection and diagnosis as since it covers you for life treating you early is less expensive then treating you later when the treatment costs would be higher.

Considerations would be different if the MRI scanner was running as for profit; or you could switch coverage so the later costs would be borne by someone else.

benaadams··on Announcing WSL 2
> File intensive operations like git clone, npm install, apt update, apt upgrade, and more will all be noticeably faster. The actual speed increase will depend on which app you’re running and how it is interacting with the file system. Initial tests that we’ve run have WSL 2 running up to 20x faster compared to WSL 1 when unpacking a zipped tarball, and around 2-5x faster when using git clone, npm install and cmake on various projects.
benaadams··on ASP.NET Core: Saturating 10GbE at 7M Rps
> Less than 1MB allocated in total for processing more than 122 Million requests and generating their responses!

The framework gets out of the way and any allocations are under your control

benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
I think the pattern is to give the socket to a `NetworkStream` constructor, then it has all the regular async methods on it.
benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
Yeah, at a guess you'd combine the multiple `WaitToReadAsync` with `await Task.WhenAny`; then use `TryRead` to run though the bunch of channels in a non-blocking way.

Could even use the return `await Task.WhenAny` to tell you the specific one to check. Shouldn't be a very hard construct to make; to make it more select like.

benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
Yeah you have a triple for different use cases; the sync call is `TryRead` so its non-blocking; `ReadAsync` for async reading and `WaitToReadAsync` to wait for data to be available without reading (likely then followed by the non-blocking `TryRead` in usage)
benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
Any obvious reasons currently; or just historic ones?

i.e. its been fully open source for 4 years https://mattwarren.org/2018/12/04/Open-Source-.Net-4-years-l... and is under the .NET Foundation rather than Microsoft https://dotnetfoundation.org/

benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
Can use System.Threading.Channels https://docs.microsoft.com/en-us/dotnet/api/system.threading... if you like that programming model
benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
.NET Foundation's baby now https://dotnetfoundation.org/

With open membership https://dotnetfoundation.org/blog/2018/12/04/announcing-net-... and election of its board https://dotnetfoundation.org/blog/2019/01/23/why-you-should-...

benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
More coming in .NET Core 3.0 as it get access to all the SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and FMA cpu intrinsics

https://github.com/dotnet/corefx/tree/master/src/Common/src/...

benaadams··on Memory usage of a toy C# server and client with 500K concurrent connections on
Can blend the PHP and .NET Core ecosystems if you want: https://www.peachpie.io/
benaadams··on Performance Tuning for .NET Core
Size generally; you can aggressive inline it, but you'll likely be pulling in some chunky stuff for the throw. Push the throw out of line and your inline will be more trim.
benaadams··on Performance Tuning for .NET Core
Yes; extension methods just operate over the public interface
benaadams··on Inside Rust's Async Transform
> is very different to other well-known implementations (C# and JavaScript [...]). Instead of performing a CPS-like transform where an async function is split into a series of continuations that are chained together via a Future::then method, Rust instead uses a generator/coroutine transform to turn the function into a state machine.

C# async/await is also very much resumable state machines

benaadams··on Type erasure and reification
Can use the Desktop Bridge https://docs.microsoft.com/en-us/windows/uwp/porting/desktop... with .NET Core 3.0 and the newly open sourced UI frameworks to get full Jitting and Store access (UWP is microsoft-ui-xaml https://github.com/Microsoft/microsoft-ui-xaml)
← PreviousPage 2 of 8Next →