HNHacker News
TopNewBestAskShowJobs

leibnitz27

182 karma · joined August 24, 2017

Likes the little things. 80s micros, decompilation, and pointless but fun optimizations.
submissionscomments
leibnitz27··on Commodore 64 floppy drive has the power to be a computer and runs BASIC
Some demos offloaded work to the 1541 - https://csdb.dk/release/?id=820
leibnitz27··on Java Decompiler
< disclaimer - I wrote CFR, which is one of the original set of 'modern' java decompilers >

Generic erasure is a giant pain in the rear. C# doesn't do this. You don't actually keep any information about generics in the bytecode, however some of the metadata is present. BUT IT COULD BE FULL OF LIES.

There's also a huge amount of syntactic sugar in later java versions - take for example switch expressions.

https://www.benf.org/other/cfr/switch_expressions.html

and OH MY GOD FINALLY

https://www.benf.org/other/cfr/finally.html

leibnitz27··on Ask HN: What are you working on? (September 2025)
I'm building a tool shed completely from scratch. Actually doing woodwork (ok ok it was also an excuse to get a nice nail gun) and seeing something tangible at the end of your efforts is surprisingly nice if your day job is entirely virtual.
leibnitz27··on At Amazon, some coders say their jobs have begun to resemble warehouse work
If it compiles, ship it. Even if it's subtly broken.....

I, for one, look forward to the contracting gigs fixing garbage code. :)

The pull back on this will be brutal.

leibnitz27··on Ask HN: Do you already see the impact of LLMs on the job prospects for dev's?
This. The adoption of LLMs for code generation, even with this statement well understood, feels inevitable, and there's going to be some amazing consultancy work fixing the garbage that gets put near production.
leibnitz27··on The era of American computer magazines has drawn to a close
For me, the end of the computer magazine was the end of print Dr Dobbs. For years, it was a wonderful staple that was just there. The world's a sadder place for its loss. :(
leibnitz27··on We Automated Bullshit
Absolutely this - I'm a bit sad that the alternative name "Plausible Bullshit Generator" hasn't taken off.... https://www.google.com/search?q=%22plausible+bullshit+genera...
leibnitz27··on Bitrex – the brand name of the bitterest substance in the world
Can't be the only person who grew to associate anti-fingernail-biting taste with YAY BITING FINGERNAILS.
leibnitz27··on Engineer distributes resume via IPv6 traceroute
Great, but not Bad Horse great.

https://www.a2wd.com/traceroute-bad-horse/

leibnitz27··on Ask HN: Can I see your scripts?
Not mine, and not ..... really.... serious.... but someone has to mention the greatest work scripts ever :

https://github.com/NARKOZ/hacker-scripts

leibnitz27··on Excel Never Dies
Excel never dies, but BOY does it get worse with each iteration.

It often feels to me that in the last several releases all that's been done is apply more and more lipstick to a pig that's already 90% lipstick.

I recently fired up excel 2003 on a whim (yep, I'm that much of a party animal.)

MY GOD. It was blazingly fast. Beautiful. Usable. (If you ignore the fact that the one good change in the last 2 decades is the XLOPER12, allowing >255 rows and lots of columns). (X)

(X) Yes, Lambda looks interesting, but HOF aren't really necessary in basic sheets, I'd rather they got it usable first.

leibnitz27··on It’s OK for your open source library to be a bit shitty (2015)
I have an OSS 'fun project' - I'm still amazed by the number of issues/emails I get raised which say:

"You should rewrite in" / "Why does't it do" / "Make it do".

It's nice that people are using it. I generally (try to) assume this is a language/cultural thing, and people don't realise that they're coming across as a bit rude in English.

But, it would be nicer if people approached commenting on OSS by first thinking "Author is doing this for fun, unpaid, and I'm getting something nice out of his/her time", THEN writing their comment.

I'd get the same issues raised, and that's fine. But the language might read a bit nicer.

leibnitz27··on New Features in Java 14
I haven't raised mine, as I consider it to be a refinement of the bug noted in https://twitter.com/tagir_valeev/status/1210431331332689920 (Don't know if java devs have responsed to that.)

(again, reachability analysis of unrelated code changes semantics.)

The problem is that this IS defined behaviour - the scope of the instanceof-assigned variable is dependent on whether or not the taken if-statement is provably exiting.

This is intended to allow

  {
    if (!(obj instanceof String s)) return;

    // s exists now.
  }
But it's not been thought through.
leibnitz27··on New Features in Java 14
Nope - the if condition is not considered in flow analysis. Read the end:

https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.htm...

"14.21. Unreachable Statements It is a compile-time error if a statement cannot be executed because it is unreachable.

This section is devoted to a precise explanation of the word "reachable." The idea is that there must be some possible execution path from the beginning of the constructor, method, instance initializer, or static initializer that contains the statement to the statement itself. The analysis takes into account the structure of statements. Except for the special treatment of while, do, and for statements whose condition expression has the constant value true, the values of expressions are not taken into account in the flow analysis."

leibnitz27··on New Features in Java 14
negative instanceof is a disaster

I posted a bit about it here http://www.benf.org/other/cfr/java14instanceof_pattern.html

it was first noted https://twitter.com/tagir_valeev/status/1210431331332689920 here

but the main thing is that if the 'taken' conditional is guaranteed to exit, then scope hiding happens, if not, not.

But in java

if (true) { throw new Exception(); }

is not guaranteed to exit.

So: https://github.com/leibnitz27/cfr_tests/blob/master/src_14/o...

In case you don't want to run, as of java (build 14-ea+34-1452) this prints:

Fred

WIBBLE

  public class InstanceOfPatternTest10 {
    static String s = "WIBBLE";

    public static void test(Object obj) {
        if (!(obj instanceof String s)) {
            throw new IllegalStateException();
        }
        System.out.println(s);
    }

    public static void test2(Object obj) {
        if (!(obj instanceof String s)) {
            if(true) {
                throw new IllegalStateException();
            }
        }
        System.out.println(s);
    }

    public static void main(String ... args) {
        test("Fred");
        test2("Fred");
    }
}
leibnitz27··on Show HN: Regex Cheatsheet
I knocked up a silly dynamic regex grapher a while back as a little teaching aid - mildly fun

https://www.benf.org/other/regexview/

leibnitz27··on I thought I understood recursion
(and yes, the nested yield is ABSOLUTELY an anti-pattern. They did promise to do a bulk yield at some point, I haven't used C# in a few years so don't know if I'm out of date!)
leibnitz27··on I thought I understood recursion
Sure you can. Here's a super grotty (and expensive) c# version.

        static IEnumerable<int> infinite()
        {
            int x = 2;
            while (true)
            {
                yield return x++;
            }
        }

        static IEnumerable<int> primes(IEnumerable<int> l)
        { 
            int head = l.First();
            yield return head;
            foreach (var x in primes(l.Skip(1).Where(x => x % head != 0)))
                yield return x;
        }


        static void Main(string[] args)
        {
            System.Console.WriteLine(string.Join(",", primes(infinite()).Take(20).Select(x => x.ToString()))); 
        }
leibnitz27··on The .Org Fire Sale: How it sold for less than half its valuation
I bought an org domain back in the 90s, and have been using it as my personal domain (i.e. also primary email address) ever since.

While, granted, I was perhaps a little silly to go org (it seemed like a good idea back then!), it's mildly terrifying that my personal footprint on the web of 20+ years can now be held to ransom by a random VC firm, and to keep my own email address I might have to pay an additional $$$ annually.

Sigh.

leibnitz27··on An interview with Barbara Liskov
Such a waste of a good title. Should have been:

"An interview with Barbara Liskov. Accept no substitutes."

leibnitz27··on Perl Master Plan
Aside from all the other excellent points about the motivations behind this group - this one sentence on the website is really a very silly move : 'Currently, most software courses teach either Python or (worse yet) Java'.

If you're trying to show that a language is good, don't slag off other languages just for the sake of it.

At best it makes unjustified suppositions. At worst it makes you look like a bitter zealot.

leibnitz27··on Verb-Noun vs. Noun-Verb
Hang on. Is no-one else here just blown away by the fact that the guy lucked into meeting Garriot & Watson? Man, I'd have given my right arm for that as a kid.
leibnitz27··on Ray tracing in Excel
I feel I should link a function mode excel ray tracer a friend wrote in 2004.

https://github.com/simon-frankau/excel-ray-tracer

leibnitz27··on Calgary student has been studying decibel levels in hand dryers since age nine
I'm in exactly the same boat. To be honest, I've started to get twitchy whenever anyone uses one when he's NOT around, I'm that used to watching out for them.

Hand dryers. Leaf blowers. Hair dryers. Hoovers.

But bowling alleys and swimming pools are fine. I really want to figure out the spectrum of noise that hurts.

leibnitz27··on Day of the Tentacle
One of the things that's interesting to me is the resources available at the time - in terms of help.

With a game like this now (Say, the excellent Thimbleweed Park - you played it, right?), if you get truly, epically stuck, there's a walk-through no more than a few clicks away. And you'll probably admit defeat and go there after a few hours.

When I picked DoTT up (a few seconds after release ;) ), no such thing. You were in it alone. Maybe there was a magazine write in for hints, and if you were lucky you knew a guy on a BBS, but other than that, you were on your own. That made the puzzles so much sweeter when you got them.

leibnitz27··on Absolute truths I unlearned as junior developer
Way back in the day, my boss made a lovely observation - 'write your code like it's going to be maintained by an axe murderer who has your home address, and nothing to lose.'

Simple guidelines to live your life by ;)

leibnitz27··on How Many Type Parameters Can a Java Method Have?
One little thing - the string that's running out of space here is the signature of the interface, not the signature of the method. You could use that fact together with method scoped type parameters to get a few more, if it weren't for the fact the descriptor would blow up too soon already.

Since it's not mentioned in the article - the signature of a method is the description containing generic information. The descriptor is the erased signature, which, because A strips to Ljava/lang/Object; will likely be a fair bit longer.

An aside - you can (mostly) still get away with corrupting signatures, if you want to obfuscate code.

(eg https://github.com/ItzSomebody/StopDecompilingMyJava/blob/ma... )

(yes, I used to blow up on one of these in https://www.benf.org/other/cfr - (my java decompiler), but it's all good now).

leibnitz27··on Sinclair ZX Spectrum Prototype
You can still get a real working zx spectrum off ebay for about £30-50. Go on, treat yourself!
leibnitz27··on The CPython Bytecode Compiler Is Dumb
Sometimes, you have to.

An example - some code I was working with gave subtly different results on two processors. It turned out this was because one of them implemented FMA - Fused Multiply Add.

https://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_op...

It wasn't particularly painful to find this, but if you were attempting to debug this kind of problem without considering lower level issues, you'd spend a whole lot of time banging your head against a wall.

leibnitz27··on Linux Reverse Engineering CTFs for Beginners
I'd definitely recommend trying the flare-on RE challenges - they do a new compo every year, and the previous compos, with helpful hints / solutions, are available.

http://www.flare-on.com/

Page 1 of 2Next →