Better HN
topnewbestaskshowjobs
Log inSign up

SeasonalEnnui

291 karma · joined Feb 5, 2020 (6y ago) · 62 submissions

Submissions

comment 1w ago · link · parent

There is a gap in the C# developer ecosystem for native AOT compatible libraries doing these kinds of high-level operations (GPU/Web/Audio/PDF/LLM), that don't rely on shim DLLs (aka DLLs written in C/C++), so I am intrigued to see where this goes.

comment 5mo ago · link · parent

I agree, and the lack of empathy around this area is sad. If you're developing an app, it is better to fall into the pit of success by using a UI framework that already has accessibility baked in. Any project that uses Dear Imgui for end-user applications has already made a bad design choice. AccessKit (https://accesskit.dev/) seems to be a positive step forward, with some UI frameworks implemented (including immediate mode egui).

comment 7mo ago · link · parent

If you buy the UK 1.8-metre Power Adapter Extension Cable, this has a metal ground pin that grounds through the metal clip on the power brick. I switched all my MacBook & iPad chargers to this, no more earth leakage sensation from metal casing.

comment 10mo ago · link · parent

I tried it out, fetching i8 arrays from a localhost server, sending to webgpu and rendering the waveform. Wow, faster than I expected, 2 billion points/sec.

comment 10mo ago · link · parent

I had a look, that certainly looks like part of the solution, now I need to get that array buffer from my backend into the browser runtime transferable object.

comment 10mo ago · link · parent

Yeah I agree, I'd like to get an idea of the order-of-magnitude of difference between the two approaches by trying it out but realistically I don't think there's an easy way to get a i16 raw array into the browser runtime with minimal overhead (WebRTC maybe?)

comment 10mo ago · link · parent

What's the best way to get all those points from a backend into the frontend webgpu compute shader?

There doesn't seem to be a communication mechanism that has minimal memcopy or no serialization/deserialization, the security boundary makes this difficult.

I have a backend array of 10M i16 points, I want to get this into the frontend (with scale & offset data provided via side channel to the compute shader).

As it stands, I currently process on the backend and send the frontend a bitmap or simplified SVG. I'm curious to know about the opposite approach.

comment 12mo ago · link · parent

I've done both, I prefer embedded web views:

- All the work is done in my high performance backend, where I joyfully optimise my hot loops to the assembly level. The web view is a thin layer on top.

- HTML and CSS is a joy to work with in comparison to many UI toolkits. LLMs are better at supporting a web stack.

- The UI zooms/scales, and is accessible with screen readers (looking at you, imgui).

- Cross platform with low effort.

IMO you have to be extremely careful not to pull in a whole frontend stack. Stay as vanilla as possible, maybe alpine.js or tailwind, and I've got hot reload set up so the developer productivity loop is tight when editing the view.

comment 1y ago · link · parent

It's a huge leap forwards from those days.

- Works on linux/macos, x86/ARM64.

- The mature frameworks (e.g. ASP.NET with razor pages) are great. Microsoft still have the same issue of pushing new and different ways of doing web things, but you do see a lot of that on the web platform in general.

- CLI workflow for compilation/build/deployment is now there and works smoothly. VS Code extensions for a bit of intellisense without requiring a full IDE (if that's the way you work).

The thing I enjoy most about modern C# is the depth/levels of progressive enhancement you can do. Let's say in the first instance, you write a proof of concept algorithm using basic concepts like List<T>, foreach, stream writing. Accessible to a beginner, safe code, but it'll churn memory (which is GC'd) and run using scalar CPU instructions.

Depending on your requirements you can then progressively enhance the memory churn, or the processing speed:

for(;;), async, LINQ, T[], ArrayPool<T>, Span<T>, NativeMemory.Alloc, Parallel.For, Vector<T>, Vector256<T>, System.Runtime.Intrinsics.

Eventually getting to a point where it's nearly the same as the best C code you could write, with no memory churn (or stop-the-world GC), and SIMD over all CPU cores for blisteringly fast performance, whilst keeping the all/most of the safety.

comment 1y ago · link · parent

Yes! I’m glad to see this pointed out - when working on UIs, I regularly move them between 3 monitors with varying resolution & DPI. 4k @ 200%, 2K at 125%, and 2K at 100%. This reveals not only design issues but application stack issues with DPI support.

comment 1y ago · link · parent

The thing I enjoy most about C# is the depth/levels of progressive enhancement you can do.

Let's say in the first instance, you write a proof of concept algorithm using basic concepts like List<T>, foreach, stream writing. Accessible to a beginner, safe code, but it'll churn memory (which is GC'd) and run using scalar CPU instructions.

Depending on your requirements you can then progressively enhance the memory churn, or the processing speed:

for(;;), async, LINQ, T[], ArrayPool<T>, Span<T>, NativeMemory.Alloc, Parallel.For, Vector<T>, Vector256<T>, System.Runtime.Intrinsics.

Eventually getting to a point where it's nearly the same as the best C code you could write, with no memory churn (or stop-the-world GC), and SIMD over all CPU cores for blisteringly fast performance, whilst keeping the all/most of the safety.

I think these new language features have the same virtue - I can opt into them later, and intellisense/analysers will optionally make me aware that they exist.

comment 1y ago · link · parent

Yes, totally agree. The 2nd thing I found it great for was to explain errors, it either finds the exact solution, or sparked a thought that lead to the answer.

comment 1y ago · link · parent

Good blog post, I recognise much of that.

The positions of both evangelists and luddites seems mad to me, there's too much emotion involved in those positions for what amounts to another tool in the toolbox that should only be used in appropriate situations.

comment 1y ago · link · parent

Mode Control Panel? I'm not sure about "eating" the world but certainly used worldwide by aircraft.

Anecdotally I've noticed a lot of acronyms from science/technology being reused in the context of LLMs, what a curious phenomenon.

comment 1y ago · link · parent

I really like this. Did you investigate the options regarding CO2 sensors? I'm interested to know if you compared SCD30 to SCD41? The dual-channel design of SCD30 is supposed to offer lower drift and longer stability compared to the SCD41 (which claims to need taking outside once a week). That's the deal on paper, I'm wondering if you got any real data on this.

comment 1y ago · link · parent

This SDK update moving the RP2040 baseline to 200MHz is very welcome for the projects where you can't have an egregious overclock over manufacturer approved spec.

For hobby projects, I've achieved significant overclocks on both RP2040 and RP2350. I suspect this is mostly due to the use of TSMC's 40NM 40LP process which is a smaller process node than most microcontrollers use.

comment 1y ago · link · parent

This gets me every time. I expect to see something interesting and it turns to be the other one. One is a fantastic thing and the other is mediocre, pick which way round at your discretion!

comment 2y ago · link · parent

A good datapoint, thanks. Extending my original point - C# got really good in the last 5 years with regards to performance & low-level features. There might be an entrenched opinion problem to overcome here.

comment 2y ago · link · parent

I could argue the opposite - GC makes it more viable for games. "GC is bad" misses too much nuance. It goes like this: developer very quickly and productively gets minimum viable game going using naive C# code. Management and investors are happy with speed of progress. Developers see frame rate stutters, they learn about hot path profiling, gen0/1/2/3 GC & how to keep GC extremely fast, stackalloc, array pooling, Span<T>, native alloc; progressively enhancing quickly until there are no problems. These advanced concepts are quick and low risk to use, and in the case of many of the advanced concepts; what you would be doing in other languages anyway.

comment 2y ago · link · parent

What is the deal with accessibility & godot?

That's largely my concern with Dear ImGui et al. It's okay to have it as a debug environment in a game, it's not okay to have it as an application. The lead developer agrees: "I do know that Dear ImGui unfortunately does not align with requirements of accessible software. It was designed as a technical/debug tooling software to be used as an overlay over 3d/graphics applications which themselves tends to have little to no accessibility features. It's not really my fault that people have started using it for desktop-ey applications." (GH issue 7892)

comment 2y ago · link · parent

The grid display of instructions makes this one of my top bookmarks for SIMD development. Then switch over to the intel guide for depth.

comment 2y ago · link · parent

Same. I’ve adopted the “write it twice” (a play on WET/DRY) methodology to software & electronics development. Write v0 (formally called a “proof of concept” I suppose but perhaps a bit more developed), or protoboard a circuit, learn the problem domain, throw it out and write v1, or layout the PCB. That’s my compensation for being unable to visualise.

comment 2y ago · link · parent

One of the first things I do with a fresh install of an OS is to enable window titles on taskbar icons & disable any grouping feature. Icons-only cause a cognitive hiccup as I try to work out what it means, and extra clicks from grouping is inefficient. Why is the icon dock so popular with designers?

comment 2y ago · link · parent

I agree with what the parent is alluding to; the introduction of the RP1 is very understated but perhaps it's more interesting to SBC engineers rather than the end users.

In other words: 1. The RP1 (implemented on TSMC 40LP) contains all the power hungry/high bandwidth IO that is difficult to do on smaller process nodes. This allows the main processor to be moved to smaller nodes or even a different vendor/architecture in future boards. Easier to target better power efficiency in the future. 2. Going forwards, the IO feature set will now be consistent and reliable, by reusing RP1. It is no longer a requirement to try to get these peripherals on the main processor.

comment 2y ago · link · parent

Agreed! The gap is getting smaller, I can imagine feature parity in another few years. Some fellow nerds doing that kind of stuff in $$$-EDA say it isn't exactly smooth sailing in those EDAs - regular crashes and so on.

comment 2y ago · link · parent

KiCad is good now. That might seem like a flippant comment however it is indicative of the progress that KiCad has made in the last 3 years. I have moved from a firmly entrenched position with a proprietary EDA (which felt like a pair of comfortable shoes) to KiCad for the majority of projects.

To any KiCad dev reading this - thank you.

comment 2y ago · link · parent

I have seen a few comments expressing a desire for a statically typed scripting language. I’ve been using a new workflow for a couple of years I’d like to share.

Install .NET 8, and create a new C# Console application. From .NET 6 onwards, it uses the new “top level statements” style which is effectively like the blank slate of a script file. The barrier to entry has never been lower. (https://learn.microsoft.com/en-us/dotnet/core/tutorials/top-...)

This lets you take advantage of a really healthy toolchain/package manager ecosystem.

You can take this a step further by using VS Code with the Polyglot Notebooks extension to get a Jupyter-style experience with C# code. (https://marketplace.visualstudio.com/items?itemName=ms-dotne...)

comment 3y ago · link · parent

I got the impression the primary motivation to do this is so the BCM2712 (and future processors) can move to smaller process nodes (less power, more speed) but keep things like 5V tolerant IO, ADCs, analog features which work better on 40nm. Going forward they will be able to keep a consistent set of IO whilst iterating to new BCM variants without hitting constraints as a result of smaller process nodes.

comment 3y ago · link · parent

Have you got an exchange email or Teams set up on a mobile device? These will generate 2FA requests (but not make any kind of notification on the device).
123