HNHacker News
TopNewBestAskShowJobs

Birch-san

323 karma · joined June 25, 2015

submissionscomments
Birch-san··on Usenix LISA2021 BPF Internals (eBPF)
bpftrace is considering adding a new backend that wouldn't involve any LLVM[0].

Additionally, ply is another effort (which doesn't use LLVM) to build a DTrace-like frontend to BPF.[1]

[0] https://github.com/iovisor/bpftrace/issues/1845

[1] https://github.com/iovisor/ply

Birch-san··on Ask HN: What are some tools / libraries you built yourself?
make-portable.sh.

Makes any macOS .dylib or executable portable.

It (recursively) makes local copies of all the dynamic libraries on which you depend, and rewrites all load commands to prefer the local copy.

This lets you safely distribute your software to another computer (rather than discovering it only works on your computer because of your brew installs).

https://gist.github.com/Birch-san/e84cfa3b93ffa104af2bd9a047...

Explanation, diagrams: https://birchlabs.co.uk/blog/alex/juicysfplugin/synth/cpp/20...

Birch-san··on Show HN: Box2D fluid simulation in WebGL and WASM
Ah, if it's blank, then it blew up really early.

It sounds like it's complaining about the use of ES modules. This script is loaded with `<script type="module">` and uses ES imports (`import App from './App.svelte'`).

Yes, Safari is expected to go bang (doesn't support module Workers).

I target Chromium's featureset — I developed on macOS Edge. macOS Chrome and Android's Chrome WebView work for me too.

It needs a few modern features in order to work:

  - Web workers
  - WebAssembly
  - top-level await (on Web, and in Worker)
  - ES modules + imports (on Web, and in Worker)
  - requestAnimationFrame in Worker
  - WebGL2
  - OffscreenCanvas
Most of these were chosen for "ease of development". With bundling, it'd be possible to eliminate the ES modules / await usage. WebGL2 isn't strictly necessary either. WASM + workers are widely supported.

So the primary blocker to Firefox support is support for OffscreenCanvas, and requestAnimationFrame in Worker. There's other options there: render on the main thread instead. Harder to develop (syncing timing + state between threads). Can probably be done performantly with SharedArrayBuffer.

In truth, I did include error-handling to provide a compatibility explanation if the worker explodes. This displays in Firefox. But I hadn't expected the main thread to explode too.

Here's a GIF of what it's supposed to look like!

https://birchlabs.co.uk/box2d-wasm-liquidfun/liquidfun.gif

Birch-san··on Debugging WebAssembly with Modern Tools
It's absolutely useful in practice. Sometimes the library you need was written in C++, and needs to run performantly and offline. I needed WASM and PWA to make an offline Japanese dictionary: https://birchlabs.co.uk/mecab-web/index.html It uses WASM to do linguistic processing via the C++ library, mecab. It tells you where the spaces should go in a Japanese sentence, and what the dictionary form is of each word (so you can lookup the meaning).
Birch-san··on DataHand
I agree that it's important to find something better than the laptop keyboard. Even a £2 keyboard will outperform it; position is critical.

Split keyboards solve the problem of ulnar deviation. This doesn't affect me as much as other RSIs, so I don't optimise for this.

I am convinced that technique can compensate for more strain than equipment can. Keep wrists straight, use gross motor (shoulders, arms), work with gravity (in fingers and in arms). Relax.

Bad keyswitches can force you to put in extra effort. But good technique, positioning and furniture can get a lot out of a budget keyboard.

Birch-san··on DataHand
There's a bunch of hackers trying to reverse-engineer and open-source the DataHand here (most recent reply was yesterday):

https://geekhack.org/index.php?topic=41422.0

I've had a couple of DataHands (and still keep one under my bed). It's a real marvel. For certain repetitive strain injuries: it's the only thing that helps.

I'm using regular keyboards now, and I'm grateful that I can. But I look forward to the day when anybody who needs one can find one.

Birch-san··on Some tea bags may shed billions of microplastics per cup
Genmaicha is a wonderful green tea based on sencha, with brown rice and sometimes popcorn added. Tastes a little nutty.

Dragonwell is a nice take on green tea. It's easy to drink endlessly, and a good choice for your main drink.

Keemun is a subtle take on black tea. Good to have in the rotation when you've bored of breakfast tea.

Rose black tea is a great treat to rest with. I've found it hard to acquire lately.

Gyokuro is a super expensive green tea, impressive for special occasions.

Matcha powder is nice if you're in the mood, and looks great sprinkled on a coffee.

I tend to buy from Tea Makers of London.

Birch-san··on Node.js and Python Interoperability
Have you considered GraalVM? You can run both languages inside the same managed runtime (JVM), sharing the same data structures, inlining across language boundaries, and debug both with Chrome Dev Tools.
Birch-san··on Ask HN: I need ideas to impress fifth graders with technology
Ever heard of Makey Makey[0]? It's crocodile-clip electronics. You can build a piano out of bananas. [0] https://makeymakey.com/
Birch-san··on Ask HN: What overlooked class of tools should a self-taught programmer look into
The Windows equivalent of DTrace is.. DTrace. [0] DTrace is about far, far more than snooping the filesystem. At best, Process Monitor is an equivalent of Brendan Gregg's DTrace utility, opensnoop. The true power of DTrace is to correlate events across subsystem boundaries. Like, graphing the top quartile of latencies from network acceses initiated via a given function in your application.

[0] https://techcommunity.microsoft.com/t5/Windows-Kernel-Intern...

Birch-san··on Steve Singh stepping down as Docker CEO
Consider installing podman if all you want is a client compatible with Docker.
Birch-san··on DTrace on Windows
the scope of DTrace far exceeds that of procmon. procmon will show you params and return code for file accesses, and provides filtering, but that's the limit.

whereas DTrace could tell you "these are the file accesses that took longer than 5ms" or "here's a histogram/heatmap of file access durations". DTrace can correlate — file accesses by a given process in-between a given function's entry and exit — telling you _why_ a file was accessed.

well, maybe you're just asking how performant DTrace would be at achieving the same output. sadly I can't answer that.

Birch-san··on Why has Plan 9 chosen statically linked binaries instead of dynamic ones? (2004)
True for Windows, but not true for macOS. See DYLD_FALLBACK_LIBRARY_PATH in https://www.unix.com/man-page/osx/1/dyld/ -- the dynamic linker will look for the library at the proposed absolute or macro-expanded path (specified in the load command), and failing that look for the leaf name under a few fallback paths:

$(HOME)/lib:/usr/local/lib:/lib:/usr/lib

You'll notice that those fallback paths do not include any location relative to the application. It's actually pretty difficult to get the object code to lookup libraries relative to its own directory. Explanation here:

https://birchlabs.co.uk/blog/alex/juicysfplugin/synth/cpp/20...

Birch-san··on Debugging Emacs, or How I Learned to Stop Worrying and Love DTrace (2018)
bpftrace's potential is higher than DTrace's, but at the moment it's definitely not reached parity. For example: we cannot yet read strings bigger than about 240 bytes (any bigger won't fit on the BPF stack).
Birch-san··on Debugging Emacs, or How I Learned to Stop Worrying and Love DTrace (2018)
BPF is compatible with DTrace probes.

The kernel verifier does extensive bounds checks on array uses and jumps in BPF programs.

Birch-san··on Full-system dynamic tracing on Linux using eBPF and bpftrace
pid provider's gone:

sudo dtrace -ln 'pid50922:::entry {}' dtrace: invalid probe specifier pid50922:::entry {}: pid provider is not installed on this system

mysql provider's gone:

sudo dtrace -x strsize=1024 -q -n 'mysql:::query-start{printf("%s;\n\n", copyinstr(arg0))}' dtrace: invalid probe specifier mysql:::query-start{printf("%s;\n\n", copyinstr(arg0))}: probe description mysql*:::query-start does not match any probes

those were really crucial for me. I'm preparing to do a presentation on dynamic tracing next week, and I think I'll have to use a BSD VM instead of using my Mac natively.

Birch-san··on Full-system dynamic tracing on Linux using eBPF and bpftrace
That used to be enough, but Mojave has broken DTrace further. I find it completely unusable now.
Birch-san··on Inkscape launches versions 0.92.4 and 1.0 alpha
> the project needs someone who knows how to automatically package a .dmg file

Recommended reading if you wish to bundle a macOS binary for distribution:

https://birchlabs.co.uk/blog/alex/juicysfplugin/synth/cpp/20...

Birch-san··on FoundationDB Record Layer
Even with the Record layer, it doesn't have support for JOINs in the same way as an RDBMS would.

Yes, the Record Layer helps you define and index into _hierarchies_ of entities, but I suspect it doesn't have an answer for other access patterns (e.g. producing "report" views that relate or aggregate non-hierarchical data).

You could retroactively construct a custom view _after the fact_, but only if you can do so within 5 seconds. And (if you want continued access to that view) you'll need to ensure that that view is maintained thereafter (you would have to define your own layer -- it cannot be entrusted to application logic unless you can atomically switch to a new version of your stack). Maintaining such a view is made more difficult if your data allows updates/deletes.

The same caveat affects schema migrations. You would need to be able to fit the migration into a 5 second transaction (or tell your applications to stop modifying the data for a while, and handle it as a series of smaller transactions).

My assessment is that if you have (non-hierarchical) relational use-cases at scale, FDB really requires you to plan your access patterns from day 1. Whereas a typical RDBMS fares far better at satisfying emergent needs. That said: FDB's model is brilliant for document store and key-value use-cases.

Birch-san··on FatBoy SoundFont
At the very least, it would be good to release an sf3 version; sf3 uses ogg compression (as opposed to mp3). This can be 10x smaller for comparable quality.

Though I found that (fluidsynth, at least) is very slow at loading sf3. Takes a few seconds.

Birch-san··on FatBoy SoundFont
Wonderful samples. None of the instruments are neglected; the standard is consistently high. And I'm happy to have clarity on the terms of use. So many (for example, Shan's Soundfont) have no stated license or provenance.

I'll be loading this into juicysfplugin[0] (my free, cross-platform soundfont synth) for a play.

[0] https://github.com/Birch-san/juicysfplugin

Birch-san··on C programmers with Mac experience wanted for revival of Eudora eMail client
looks like he's answering questions:

https://news.ycombinator.com/item?id=18854055

Birch-san··on I learnt C++ in 2018 and have no regrets
how about Java? it's a small enough language that one can encounter and use every language feature within a few years of professional development, and without needing to work in any obscure domain.

admittedly, Java got a lot bigger in Java 8 and beyond. but it's still the language I'd put forward as "most possible to master".

Birch-san··on C programmers with Mac experience wanted for revival of Eudora eMail client
:) depends on the desired result.

If the primary threat to the project was "not finishing", then I'd absolutely use Electron. Development with web technologies is fast.

But if performance _is_ critical, and the biggest risk to the project is "lack of community interest", then I'd go with React Native†.

† I'm prepared for the possibility that some newer or more exciting technology exists by now.

Birch-san··on C programmers with Mac experience wanted for revival of Eudora eMail client
I'm concerned by the team-shaming [0]:

> The only issue left is that of preventable costs arising from error, oversight, or incompetence

> [notably,] the indiscriminate destruction of data […] under the mistaken impression that it was otiose, by a programmer whose experience was insufficient for the task at hand.

> Although he might have been the 'cause of more harm than good' (in the opinion of another of our programmers), […] and while correction of the mistake took some time and effort, it did not result in schedule slippage.

His assertion that "the only phone suitable for the task (of talking to 3 people)" is a crowdfunded phone that doesn't exist yet, shows (at best) poor risk-management.

I don't understand how one developer could need $170/month of mobile data to fulfil their commitments to this project.

I don't understand why the Enterprise edition of Visual Studio would be necessary… nor why Visual Studio would be the right choice for macOS development.

I don't understand why he's being so open with such indefensible spending.

The project seems out-of-touch. One of his roles is to inspire collaboration, so he would have more luck using technologies that excite people today.

[0] https://www.kickstarter.com/projects/1313324524/hermes-eudor...

Birch-san··on Ply: Lightweight, Dynamic Tracing in Linux
Some key differences [1]

> ply, by Tobais Waldekranz, is another front-end to BPF. I like it. It isn't complete yet, but has some interesting differences to bpftrace: ply emits instructions directly, whereas bpftrace uses llvm's IR API (which can be fairly difficult to code in). ply is also C, whereas bpftrace is C++.

> It's possible that ply will find its users on embedded Linux and minimal environments, whereas bpftrace will be popular for large server Linux.

[1] http://www.brendangregg.com/blog/2018-10-08/dtrace-for-linux...

Birch-san··on Bpftrace for Linux 2018
This is a great update. I'd wondered how ply differed from bpftrace. And structs support is a huge step in achieving parity with DTrace.

DTrace has really helped me out* on macOS. To be without it is to lose a superpower, so I'm really rooting for bpftrace to bring the same tracing experience to Linux. I've been excitedly following bcc, too. It's just the right tool for HTTP metrics. But my most basic experiments so far have failed, and I don't know how to get support.

* DTrace is a real swiss army-knife. It seems intended for observing production systems, but I've found it indispensible for local development. The mysqld provider is great for tracing queries and perf. Opensnoop answers all sorts of questions. And DTrace saved a C++ project of mine: explaining a deadlock that would've otherwise spelled the end of the software. The most fun I've had is using the pid provider to hook text out of visual novels (in WiNE!).

Birch-san··on Miller Columns
Other shortcuts that changed the way I use Windows:

Alt+Space (open window management context menu)

Shift+F10 (right-click using the keyword)

Ctrl+Shift+Escape (launch task manager)

Windows+E (open Explorer window)

Windows+X (open context menu of random useful things)

Ctrl+L (select address bar)

Home (go to start of line of text)

End (go to end of line of text)

Ctrl+{direction} (move by one word)

Windows+{number} (focus a process from your taskbar)

And some useful things in the Run menu (Windows+R):

sysdm.cpl (System Properties)

inetcpl.cpl (Internet Properties)

%APPDATA% (goes to C:\Users\%USERNAME%\AppData\Roaming)

Birch-san··on Microsoft now has the best hardware lineup in the industry
I have the original Surface Pro (2013).

# Software problems:

- Windows frequently has bad touchscreen support. I've encountered many fullscreen games where a click can only be sent via a double-touch or double-pen-tap. It's phenomenally hard to click through text in story-driven games.

- The machine does not stay asleep at all (that or I've misunderstood what the lock button is intended for).

# Hardware problems:

- The machine electrocutes you whilst charging.

# Age / software / hardware problems:

- Recently (I think following Win10 April 2018 Creators Update), it has been BSoDing extremely frequently. i.e. within 5 minutes of startup, during basic usage.

Birch-san··on Miller Columns
Try pressing Space instead of Down.
← PreviousPage 2 of 3Next →