HNHacker News
TopNewBestAskShowJobs

noblethrasher

2,892 karma · joined March 14, 2007

https://github.com/noblethrasher

http://stackoverflow.com/users/3927/rodrick-chapman

rodrick@rodlogic.com

submissionscomments
noblethrasher··on OOP Is Dead, Long Live OOP
Yep, I follow him pretty closely, and knew about his account and comments on here.

Funny story: That is at least the second account that he created on HN. He registered an earlier one just to reply to a comment that I had made[1].

[1]: https://news.ycombinator.com/threads?id=alanone1

noblethrasher··on OOP Is Dead, Long Live OOP
Well, the best analogue to the Codd's relational algebra is Hewitt's actor model in my professional opinion. Both are based on mathematical formalism, though the Actor Model goes a bit further in that it's also informed by physics.

But, just as SQL doesn't really implement Codd's relational algebra, so it is the case that most so-called OOP languages miss the mark vis-à-vis Alan Kay's original conception.

The analogy is buttressed by the fact that many early RDBMSs didn't even support joins (path independence being an essential characteristic of RA), just as many mainstream OOP languages didn't/don't idiomatically endow objects with a strong way to protect themselves (encapsulation being a necessary characteristic, thus pervasive use of setters being the main sin)). But, Kay did praise Erlang for getting OOP right.

noblethrasher··on OOP Is Dead, Long Live OOP
Or… if you're talking about languages like C# and Java (and presumably C++), just make sure all of your classes are either sealed or abstract. This turns classes into proper algebraic data types.

To wit, implementation inheritance gives you a sum type (e.g. a Shape is either a Circle, or a Square, or…) whereas interface inheritance gives you a product type (class Foo : IBar, IBaz means that Foo is an IBar and an IBaz).

noblethrasher··on Money Can Buy Happiness [pdf]
> When do we get to sit back and say, "cool, I think we're done."

When collective productivity is turned into collective leverage.

noblethrasher··on Ask HN: What things have richly rewarded the time invested in mastering them?
Because doing so desensitizes you to the pain and suffering of others.

Maybe a society full of sociopaths can get along just fine, but I'd rather not run that experiment.

noblethrasher··on Announcing TypeScript 3.1
Agreed that it’s pedagogically useful to think of Typescript as a light(ish) extension, hence literture on pure JavaScript will still repay study. But, overall it's best to treat TS as its own language, especially when it comes to developing libraries. This situation isn't dissimilar to Objective-C/Cocoa where the language is a strict superset of C (as in the case of TS and JS), but the real leverage came from framework.
noblethrasher··on Stop writing lambda expressions in Python
C# offers three different ways to denote an anonymous function: Anonymous delegates, lambda expressions, and statement-bodied lambdas. Each of them are true closures and can be used to construct a "method" of a given delegate type (i.e. any one of them can be used to as a value for a given variable — interestingly, in any case, an anonymous method must be assigned to a variable (or parameter) before you can use it, unlike, say, the anonymous functions of Lisp, JavaScript, F#, or even the criminally underrated VB).

But they have some important difference:

1) Anonymous delegates (introduced in C# 2.0) allow you to elide the formal parameters when defining a method of a given type if the body of the method doesn't use those parameters. Even though this construct is basically obsolete, I still use it just for this feature.

2) Lambda expressions can be automatically transformed into expression trees, which means that you can use them to construct (awesomely powerful) fexprs[1]. But, they can't contain statements, which means you can't use them for any kind of imperative code. These are the most equivalent to Python's lambda as far as that limitation is concerned.

3) Statement-bodied Lambdas can contain statements (as the name implies), but the language won't convert them into expression trees for (you can do it manually – tedious but not at all hard). At the time that the lambda expression feature was introduced (as a member of the constellation of features that made up LINQ), the framework didn't even contain expression classes that corresponded to most of the imperative constructs, but that changed with the advent of C# 4.0 which implemented a meta-object protocol[2].

Another implementation detail (last time I checked, which has been a while) is that anonymous delegates get turned into instances of System.Multicast delegate, whereas a lambda expression either gets turned into a class with a method that corresponds to the lambda expression (and fields that correspond to closed over variables), or into an expression tree, depending on the class of the variable to which it's being assigned.

[1] https://en.wikipedia.org/wiki/Fexpr

[2] https://en.wikipedia.org/wiki/Metaobject

noblethrasher··on Channels are Actors
It's worth noting that the submitter of the post is also the inventor of the Actor Model.
noblethrasher··on Functional approaches to dependency injection (2016)
Logging with computation expressions: https://fsharpforfunandprofit.com/posts/computation-expressi...
noblethrasher··on Lisp and Haskell (2017)
Also see Dr. Racket.
noblethrasher··on MacOS Mojave removes subpixel anti-aliasing, making non-retina displays blurry
Meh. I see their point. Subpixel AA was about using software to simulate better hardware. But, at the end of the day you really do want the better hardware so that you can use your software budget to simulate an even better generation of hardware. Repeat ad-infinitum, modulo scaling limits.

Pretty sure this is what Alan Kay means when he says that people who are serious about software will make their own hardware.

noblethrasher··on Ted Nelson struggles with uncomprehending radio interviewer (1979) [audio]
> It invites or raises the question rather than begs it, but your point is understood.

By my reading, 'nicklaf used the phrase in the technically correct way.

But, as a recovering philosophy major, I'll just point out that the phrase "begging the question" is just a bad 16th century English translation of the Latin phrase "petitio principii" that literally meant "requesting a postulate", and which itself was a medieval translation of the original Greek phrases "τὸ ἐν ἀρχῇ αἰτεῖσθαι" and "τὸ ἐν ἀρχῇ λαμβάνειν", which meant, respectively, "asking the original point" and "assuming the original point."[1]

We say that the English translation is "bad" because the translators were jumping through hoops to avoid using the fancy Latin in favor of the vernacular (or vulgar) English.

I caucus with the folks that say that we should just use the Latin phrase, "petition principii", as we do with other well-known fallacies.

[1] http://languagelog.ldc.upenn.edu/nll/?p=2290

noblethrasher··on Railway-Oriented Programming (2015)
Actually, the above code doesn't compile (I just dashed it off while waiting for a real world project to compile).

Valid C#: https://gist.github.com/noblethrasher/2d0e99f86b9853c646f3fa...

noblethrasher··on Railway-Oriented Programming (2015)
Here is a moral equivalent in C#:

     public abstract class Maybe<T>
     {
     	public abstract T Value { get; }
     
     	public virtual string Failure => null;
     	
     	public SelectMany<U, V>(Func<T, Maybe<U>> f, Func<T, U, V> g)
     	{
     		var that = f(this.Value);
     		
     		if(that.Failure != null)
     			return new Failed(that.Failure);
     			
     		return new Success(g(this.Value, that.Value));		
     	}
     	
     	public sealed class Success : Maybe<T>
     	{
     		public override Value { get; }
     		
     		public Success(T value) => this.Value = value;
     	}
     	
     	public sealed class Failed : Maybe<T>
     	{
     		public override Failure { get; }
     		
     		public override Value => throw new InvalidOperationException();
     		
     		public Failed(string s) => this.Failure = s;
     	}
     }
     
     Maybe<string> UpdateCustomerWithErrorHandling()
     {
     	return 
     		from req in receiveRequest();
     		from v in validateRequest(req)
     		from c in canicalizeEmail(req)
     		from d in db.updateDbFromRequest(req)
     		from e in smptServer.sendEmail(req.Email)
     		
     		select "OK";
     
     }
noblethrasher··on This car is on Autopilot. What happens next?
… or copilot.
noblethrasher··on Chatbots were the next big thing: what happened?
Before Twitter, people on AIM and similar services would use status messages to broadcast short little notes to their buddy list. I had the idea of turning that into a service in the early 2000s.

What surprised me was seeing a serious journalist like Wolf Blitzer regularly reading people's tweets on his prime time show.

noblethrasher··on Value Type Hygiene
It's worth noting that Don Syme also brought type erasure to the .NET platform via type providers, because provided types can be erased (and typically are, I believe). But, F# also lets the author of the type provider decide which class will be used to represent the erased type. So, unlike the JVM, and F# programmer can erase to something other than System.Object.
noblethrasher··on The Web We Lost (2012)
Yeah, I made this same observation/lament six years ago: https://news.ycombinator.com/item?id=3876834
noblethrasher··on Stop assuming audiences can't handle female-led sci-fi films
Arguably, the Ellen Ripley that we have all come to know and love was mostly developed and solidified in Aliens, and "motherhood" was a major theme in that film.
noblethrasher··on Why Is SQLite Coded in C? (2017)
> talking to a web server written in C

The HN web server and application are written in a dialect of Lisp, unless something has changed.

noblethrasher··on How generics were added to .NET
> If the bindings are reference types, the CLR will economize their representations as long as they don't have any static state, I think.

Yep, I knew about that, but type providers don't necessarily generate generic types. So, I meant something a bit different.

As you know, If Foo<T> is an ordinary generic, then T must be a CLR type, which is to say that it must be code that was somehow turned into a CLR type (usually by a compiler such as C#). But, if Foo<> is a type provider, then arbitrary code of an arbitrary language can go in between the angle brackets (which is why type providers can accept strings). Essentially, each type provider is a compiler, but the code that is generated must be expressed (or "wrapped", if you will) as a CLR type. But these types need not be generic (and usually aren't, I think). So, not having erased types in F# is akin to having a compiler that can't generate loops or subroutines†.

†(Perhaps a better analogy is a compiler that can't eliminate tail-calls, since erasing everything to a certain base type (that F# lets you choose) is kind of like reusing stack frames vis-à-vis the analogy)

noblethrasher··on How generics were added to .NET
> Interop is another advantage of the erasure model

And, in the case of F#'s type providers, it means not having to generate zillions of types when coding against some huge schema. But, on the other hand, it does give you the option to do so.

noblethrasher··on Why Developers Never Use State Machines (2011)
In 's4vi0r’s defense, “FP” usually means ML-style FP, which does happen to be pretty biased towards creating stack-based FSMs since it has literal syntax for stacks (list literals), states (discriminated unions + tuples), and transitions (pattern matching).
noblethrasher··on An SVG that always shows today's date
On the other hand, I think it would be straightforward to strip script tags and attributes using XSLT. You could even go as far as just whitelisting certain tags/attributes.
noblethrasher··on In One Tweet, Kylie Jenner Wiped Out $1.3B of Snap's Market Value
eBay is a famous case study of this: https://theuxblog.com/blog/redesigning-user-experience
noblethrasher··on The next billion users are the future of the internet
> I can't really imagine how everybody on a train in Delhi is going to talk to their digital assistants without a noise proof helmet on their head. (or going crazy)

Eventually, “our” devices will be able to read lips[1] and recognize other subvocal gestures.

[1] https://www.theverge.com/2016/11/24/13740798/google-deepmind...

noblethrasher··on Who is the longest-serving programmer?
Yep, that's what I mean.

I originally started to write something that explicitly called out some of the other examples as cases of talented amateurs (in the best possible sense of the term, and only vis-à-vis actual coding as opposed to producing books and theorems).

But, the cases of Cutler and Moore are probably what we mean by "longest-serving".

noblethrasher··on Who is the longest-serving programmer?
Dave Cutler (b 1942) has been continuously paid to write code for 53 years.
noblethrasher··on Why some apps use fake progress bars (2017)
Don Norman (The Design of Everyday Things) discussed this at the Business of Software Confence almost a decade ago: https://vimeo.com/96714148

He specifically talks about the case of benevolently deceptive progress bars vis-à-vis tax software @ 52:30.

Basically, UI/UX is theater, and just as Puck observed in A Midsummer Night’s Dream, humans come to theater because they want to be fooled.

So, good UX is the magician that is upfront about the fact that everything is a trick, but evil UX is the charlatan that hides the fact that a trick is being done in the first place (credit to Jaron Lanier).

noblethrasher··on Video editing with Python
I don't agree with 'ageofwant’s prediction (though I really wish that I could), but command discovery is a solved problem:

Pharo Smalltalk has a nifty feature whereby you can find methods by example[1].

E.g. typing

    'hello, world', 'HELLO, WORLD' 
in the finder returns the method `asUppercase` on the String class.

In a statically-typed language, you can just search by function signature (e.g. Clip -> RotatedClip (an effect) or Clip -> Time -> Clip * Clip (a cut)).

[1] https://www.youtube.com/watch?v=HOuZyOKa91o&app=desktop&t=30...

← PreviousPage 3 of 32Next →