Better HN
topnewbestaskshowjobs
Log inSign up

leibnitz27

182 karma · joined Aug 24, 2017 (9y ago) · 40 submissions

Likes the little things. 80s micros, decompilation, and pointless but fun optimizations.
Submissions

comment 10mo ago · link · parent

Some demos offloaded work to the 1541 - https://csdb.dk/release/?id=820

comment 12mo ago · link · parent

< 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

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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. :(

comment 3y ago · link · parent

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...

comment 3y ago · link · parent

Can't be the only person who grew to associate anti-fingernail-biting taste with YAY BITING FINGERNAILS.

comment 4y ago · link · parent

Great, but not Bad Horse great.

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

comment 4y ago · link · parent

Not mine, and not ..... really.... serious.... but someone has to mention the greatest work scripts ever :

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

comment 5y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

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."

comment 6y ago · link · parent

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");
    }
}

comment 6y ago · link · parent

I knocked up a silly dynamic regex grapher a while back as a little teaching aid - mildly fun

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

comment 6y ago · link · parent

(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!)

comment 6y ago · link · parent

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()))); 
        }

comment 6y ago · link · parent

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.

comment 7y ago · link · parent

Such a waste of a good title. Should have been:

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

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

I feel I should link a function mode excel ray tracer a friend wrote in 2004.

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

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

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.

comment 7y ago · link · parent

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 ;)

comment 7y ago · link · parent

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).

comment 7y ago · link · parent

You can still get a real working zx spectrum off ebay for about £30-50. Go on, treat yourself!

comment 7y ago · link · parent

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.

12