HNHacker News
TopNewBestAskShowJobs

emidln

3,031 karma · joined November 7, 2011

I mostly use eBPF/C/C++ these days but I used to write lots of Clojure, Python, Java, and SQL, with smatterings of Lisp, Ruby, and Javascript where need be.

I'm attached to a tmux session. gdb is probably running in a split with vim.

My views are not necessarily those of my employer.

I live in the Chicago burbs, but I work in the loop. I'd love to buy you a tea, coffee, or a beer to talk about start ups, Clojure, C++, Lisp, Python, toolchains, Bazel or other tech.

github: https://github.com/emidln

bsky: https://bsky.app/profile/emidln.com

email: emidln@gmail.com

submissionscomments
emidln··on Unesco calls for global ban on smartphones in schools
The path my teachers took in school, a few decades ago, was to design math tests that never required a calculator. All problems used basic arithmetic and calculators would actively slow you down. This works for a large portion of elementary, middle school, and high school math. The only downside is the teacher needs to spend a bit more time crafting the problems.
emidln··on C++23: The Next C++ Standard
This works on my RHEL9-compatible for a .c file (using gcc). The type specifier for main is implicitly `int`. You get some warnings about implicit types and implicit declarations, but you get a binary that when executed writes "Hello, world".
emidln··on PyRF: Open-source comprehensive development environment for wireless signal
If you think Py2.7 is old for RF work, you'll be really unhappy with the 15-20 year old gcc you get as part of the SDK for your board.
emidln··on Kenji López-Alt spent 5 months studying Chicago thin-crust pizza
Growing up in Springfield, IL (3 hours south of Chicago), most of the pizza served ourside of chains was the ultra thin crunchy square-cut pizza mentioned in the article (or NY-esque Neapolitan slices).

Vic's (rip) Sam's (rip) Gabatoni's Joe's JT Costello's (more recently)

all served delicious crunchy thin crust with heavily spiced sauce cut thin and usually sent out covered in paper. Any bar that didnt serve frozen pizzas served a variation of this thin crust pie.

Notably, Gallina's Pizza and Lucca Pizza were both Neapolitan style.

emidln··on The pool of talented C++ developers is running dry
Hiring C++ isnt especially hard because our pay is opaque. Recruiters will tell you immediately what total comp you can expect and they'll let you know what you can contractually guarantee year 1.

Hiring for C++ is hard because C++ is hard and most people are quite bad at writing even somewhat reasonable code.

emidln··on The pool of talented C++ developers is running dry
Salary at an HFT doesnt tell an accurate story. I'd be shocked to learn any quality c++ dev at an HFT pulled down less than 500k last year, and I'd expect most to be well above that.
emidln··on Moderna CEO: 400% price hike on Covid vaccine “consistent with the value”
USPS seemed fine before the last administration's Postmaster General took power and started systemic obstruction. I had cheap and easy priority mail access for whatever I needed and it went anywhere in the US within about 3 days. First Class Letters almost always arrived in the stated window. There were improvements to visibility with a daily email announcing what would be arriving for the day. Since DeJoy took over, I rarely use USPS for personal package sending because I cannot trust that the packages will arrive in the stated time period. I pay roughly 1.5x to 2x with USPS Priority costs for other services, but I don't worry that my mail will simply disappear into the void.
emidln··on Ask HN: Contingency plans for a lead dev no longer avail?
I've also heard "Key Person Risk" recently for the same concept.
emidln··on GNU nano is my editor of choice (2021)
The convention on modern *nix is readline/libedit bindings in a shell. These default to emacs-like keybindings that nano ignores. It seems that we have a much stronger case for emacs with the menu enabled than for nano.
emidln··on What's New in Bazel 6.0
> You're assuming you have control over all the deps and can set `linkstatic` on them.

In bazel you have complete control over all of your deps. Ultimate power and ultimate responsibility. Even an external BUILD.bazel can be patched when you bring it in (bazel has provisions for patching stuff from http_archive if you supply a patch). You can even ignore an existing BUILD.bazel and write your own if you only care about part of an external thing. If it's a target in your graph, you can certainly modify it. If there is some internal process that prevents you from modifying your own code, I can't help you. Maybe fix that or go somewhere that gives you the authority to do your job.

emidln··on What's New in Bazel 6.0
*You are the consumer.* You are consuming it in foo. Are you building some straw man consumer who might want to delve into my build and rearrange my libraries with no work at all? You can even do that if you want. Remove the linkstatic line from qux. Now it has two outputs: `libqux.a` (default) and a `libqux.so` (implicit). If you want to ship both of them in a release artifact, you can. If you want to mark some binaries `linkstatic = True` and statically link them you can. If you want to dyanmically link some binaries, you can do that too.

I was demonstrating that you can force some libraries to be only static and still partially link some things static and some dyanmic. If you want to get really into the weeds, you could even affect the link line and individually pick dependencies in a custom rule (that is fully compatible with the rest of the bazel tooling). Almost nobody ever needs to do that, but maybe you want to make only every other dependency dynamic to satisfy some weird slide in a talk.

emidln··on What's New in Bazel 6.0
Not that I'd recommend it, but if you symlink your system library into the bazel build area, as long as your sandboxing setup don't hose you (or you just turn it off), bazel will track system tools/library in the same way as everything else.

Bazel's rules_cc even has a system_library.bzl you can import a `system_library` from that automates this for you. https://github.com/bazelbuild/rules_cc/blob/main/cc/system_l...

I'd still recommend building everything from scratch (and understanding the relationships and graph of your dependencies), but if your build isn't that complicated and you want to role the dice on UB, this isn't that hard.

As an aside, the most galling part of bazel's cache key calculations has to be that it's up to the individual rules to implement this how they see fit. The rules native to bazel written in java vary wildly compared to starlark-written rules. On thing you (or someone in your org) end up becoming pretty comfortable with while using bazel in anger is RTFC.

emidln··on What's New in Bazel 6.0
This is just false. Bazel creates both static and dynamic libs by default for every cc_library. The default is to link static, but you can control this on a per-binary basis. You don't need parallel trees of targets or even to write custom rules to access the non-default output groups that contain the shared library. This all just works out of the box.
emidln··on What's New in Bazel 6.0
I don't know what you're talking about. This is trivial to accomplish using `linkstatic` as documented on `cc_library` and `cc_binary`. I uploaded a demo to github here: https://github.com/emidln/bazel_static_dynamic_c_demo/blob/m...

Try it out like this:

    # you'll need a c compiler installed, xcode is fine on macos
    git clone https://github.com/emidln/bazel_static_dynamic_c_demo
    cd bazel_static_dynamic_c_demo
    bazel run //:foo
    ldd bazel-bin/foo  # otool -L bazel-bin/foo if you're on MacOS
emidln··on Diffoscope – In-depth comparison of files, archives, and directories
This saved a lot of effort verifying artifacts when my team ported a large codebase from maven+cmake to bazel. It's very good when you're doing build changes, large scale refactors, or partial rewrites.

Beyond build engineering, I've also found it useful to debug container image differences.

emidln··on Oracle lays off more than 200 California-based workers
> Know how the 40 hour work week became a thing, paid time off, etc.? Collective action by workers.

In the US? Armed revolt by unionized workers. Blood baths on both sides (labor and hired scabs/private police/paramilitary). Forced bargaining from state and federal governments. If you know where to look, there are little "union" cemeteries dotted across the Eastern and Midwestern US where union folk are buried due to company town cemeteries banning strikers and their families from being buried "in town".

Workers' rights were bought and paid for in blood.

emidln··on MTG Extended 1997
My first old school deck (B/u aggro with dark ritual, black knight, hypnotic specter, sengir vampire, etc and recall, walk, and psionic blast from blue) cost me $60 off tcgplayer. I took acetone to some misc commons and made proxies for dual lands, city of brass, strip mine, and power. Nobody batted an eye about my hand drawn proxies in the MTG Underground of the Midwest. I've seen Kinkos printed decks, 75 card proxied decks, no power, as well as fully powered, signed, and altered decklists. We're there to hangout and play games, not gatekeep whether you show up with a down payment on a house in a deck box.
emidln··on MTG Extended 1997
Chicago has an excellent scene for nostalgia MTG. We play a variety of old school formats and have a 93/94/95 event coming up in October. Most events put entry toward a charity (if there is any entrance fee) and are held at pubs around Chicago. Check out Eternal Central[0] for rules and some past event coverage and our local club page, The Lords of the Pit[1]. One thing slightly different about the Chicago (and Midwestern USA scenes in general) is friendliness toward proxies, esp hand drawn/painted versions. New players always welcome!

[0] https://www.eternalcentral.com/

[1] https://lordsofthepit.com/

emidln··on Ask HN: Does anyone else think SQL needs help?
Perhaps you're looking for a way of arranging SQL as an AST represented by data structures (or objects) that can be fed to a compiler. HoneySQL[0] is one such implementation of this idea and it makes your general transformation trivial for Clojure programs. You don't need to mess around with string concatenation because you have a predictable and extensible compiler for data structures (which are themselves easily composable/transformable/storable with Clojure) that you can trust to do the right thing. If you're using some weird database or need an esoteric syntax, extending the compiler to your clause is easy to do[1].

[0] https://github.com/seancorfield/honeysql

[1] https://github.com/seancorfield/honeysql#extensibility

emidln··on Win32 Is the Only Stable ABI on Linux?
There are other libc implementations that work on Linux with various tradeoffs. Alpine famously uses musl libc for a lightweight libc for containers. These alternate libc implementations implement users/groups/network manipulation via well-known files like /etc/shadow, /etc/passwd, etc. You could fully statically link one of these into your app and just rely on the extremely stable kernel ABI if you're so interested.
emidln··on John Carmack: Best Programming Setup and IDE – Lex Fridman Podcast Clips
CLion has a good debugging story and is based on gdb/gdbserver.

Emacs has a couple gdb modes which are fine, and a DAP mode which is very good.

emidln··on Robinhood lays off 23% of staff
The top talent can jump jobs on a whim in major tech hubs. The only senior programmers I know in Chicago that have been unemployed or underemployed for longer than a few weeks in the past decade were of their own volition. Maybe this is just my bubble and maybe it's just Chicago, but I doubt both of those.
emidln··on Slack messages older than 90 days will be hidden for free users from September
Mattermost is what my company uses. It can be self-hosted on-site, configured to keep an auditable log of changes and conversations, and many of its features that are not compliance-friendly can be turned off.
emidln··on Ask HN: Can competitors catch up to Apple Silicon?
No, but I used the Java 1.4 JVM to run StarOffice for compatibility with an old document that had no other reader within the last three months. I did this from my AMD Ryzen 9 5900x running Linux.

For work, I still have some third-party toolchains that were originally compiled on x86_64 linux in 2012. They are dockerized these days to make running these legacy toolchains easy. There is no possibility to recompile these on ARM to provide parallel containers that are compatible with Docker for Mac.

emidln··on Ask HN: Can competitors catch up to Apple Silicon?
Yes. People bandying about "legacy x86" instructions miss this often. This isn't much different, conceptually, from Apple's Rosetta, except it's provided in microcode automatically rather than a discrete transform you need to run once and cache. This is very convenient for broad x86 backwards compatibility (e.g. I can run a Java 1.4 JVM and StarOffice or a libc.so.5 to play Unreal Tournament 2004 just fine on my 5900x). Can I run x86 apps, even ones from the last couple years on an M1 with no questions asked? Well, we abandoned local dockerized development at work because Docker for Mac's qemu couldn't hook into Rosetta and qemu alone couldn't handle JIT'd instructions from a jvm11[0]. Maybe that changes with the new MacOS version and the next version of Rosetta (there seems to be a Rosetta that works like qemu's binfmt_misc translators for Linux), but it's been missing for 2 years so far and caused me to do a bunch of work on remote dev capabilities in the meantime.

[0] Let me stop you right there before you suggest I recompile 15 years of operating systems, third party toolchains, and internal tools for ARM and then rebuild every intermediate container just so we can work around Rosetta shipping without necessary features. I know that you can ship a whole parallel stack of containers with ARM but that's not feasible in the slightest for anything but the most trivial use cases or entirely greenfield projects.

emidln··on No-op statements syntactically valid only since Python X.Y
You can organize your packages however you want if you write and register a new module loader.
emidln··on Netflix’s bad habits have caught up with it
They call these services "private trackers" and "VPNs". They're inexpensive and probably have a better UX than whatever other five streaming sites you'd otherwise have to use put together.
emidln··on GitHub will require all code contributors to use two-factor authentication
GitHub does not have my phone number (although it's trivial to obtain). I use their TOPT 2FA.
emidln··on Compile time evaluation in Nim, Zig, Rust and C++
To take on another language solution, here's an obvious one, albeit in a lisp (Clojure):

    (defn fizzbuzz-nth* [n]
      (cond
        (zero? (mod n 15)) "FizzBuzz"
        (zero? (mod n 3)) "Fizz"
        (zero? (mod n 5)) "Buzz"
        :else (str n)))
    
    (defn fizzbuzz* [n]
      (->> (range 1 (inc n))
           (map fizzbuzz-nth*)
           (interpose " ")
           (apply str)))
    
    (defmacro fizzbuzz [n]
      `(println ~(fizzbuzz* n)))
    
    (println "macroexpansion: ")
    (println (macroexpand '(fizzbuzz 100)))
    (println)
    (println "invoke the macro: ")
    (fizzbuzz 100)
Compile-time programming isn't any different than runtime programming in a lisp. This is nice because we can write the business parts as regular code, which is easy to try out in the repl or write tests for and then wrap it in a macro for compile-time evaluation if that's what the situation calls for.

For those not versed in lisp, `fizzbuzz-nth` and `fizzbuzz` are regular functions and `fizzbuzz` is a macro (aka a function annotated to be executed at compile time). The `fizzbuzz` macro makes use of Clojure's `syntax-quote` (the backtick) to signify templating is going on and `unquote` (the tilde) to escape the templating and execute some code at macro expansion time.

It's a real shame most languages don't have these metaprogramming facilities as judicious use makes weird, hard, and untestable stuff into common, easy, and another boring part of the test suite.

I'm really pulling for C++ to eventually get here with templates, particularly now that vectors can be constexpr and the result of templates. Maybe c++26 will finally give us reasonable macro facilities in a mainstream language.

emidln··on Amazon workers at 100 more facilities want to unionize: Amazon Labor Union
Union protected programmers made me decide against pursuing a career doing tech for the Illinois EPA. It was impossible to get people who couldn't actually write software out of the way.
← PreviousPage 3 of 30Next →