HNHacker News
TopNewBestAskShowJobs

hota_mazi

2,724 karma · joined May 30, 2016

submissionscomments
hota_mazi··on Functional programming patterns in Smalltalk
I think the author is so enamored with Smalltalk that they no longer see how quirky and non intuitive the Smalltalk syntax is. Case in point:

    ourList := { 1. 2. 3 }.
    ourList collect: [:in | in + 1 ].
Here it is in Kotlin:

    val list = listOf(1, 2, 3)
    list.map { it + 1 }
No spurious colon, dots sprinkled a bit everywhere, mysterious ":in" or pipe bar, square brackets. Just a very naked syntax.

Next:

    ourList select: [ :num | (num \\ 2) = 0  ] thenCollect: [:n | n + 2]
Kotlin:

    list.filter { it % 2 == 0}.map { it + 2 }
The next example is an ever better illustration of why Smalltalk feels so antiquated and wasteful, and is not respecting the developer's time:

    ourList chain
      select:  [ :num | (num \\ 2) = 0  ];
      collect: [:n | n + 2];
      collect: [:m | m + 2].
Why do I have to find names for all these closure parameters? And why use a different name every time (num, n, m).

Again, Kotlin shows how to do it right:

    list.filter { it % 2 == 0}.map { it + 2 }.map { it + 3 }
hota_mazi··on Functional programming patterns in Smalltalk
Can you elaborate?

Smalltalk was certainly a pioneer in that area but in the past twenty years, plenty of languages have implemented closures in a way that's pretty much 100% identical to how Smalltalk did it, just with different syntaxes.

What's so different about Smalltalk's closures from the likes of Rust, C#, Kotlin, Swift, Groovy, etc...?

hota_mazi··on Flutter is the most popular cross-platform mobile SDK
Flutter is most likely over represented on StackOverflow because of Dart, which is niche and used nowhere outside Flutter. So people have a lot of questions about it.

Flutter would probably be more popular if it didn't use Dart (e.g. Kotlin), which also means it would receive fewer mentions on StackOverflow. That's exactly the phenomenon we are seeing with React Native.

To me, the only real, tractable metric for assessing how popular a technology is is by looking at job postings. And from that perspective, Flutter is nonexistent.

hota_mazi··on Skip: A programming language to skip the things you have already computed
This is like saying that you prefer to read the description of a new car instead of seeing the car itself.
hota_mazi··on Case against OOP is understated, not overstated (2020)
I used to think that the solution to mutable state was to prohibit it and code with immutable structures all the time, but after a few years of Rust, I think it's the wrong approach.

The right way to handle mutable state is not to pretend it doesn't exist but to accept it as a reality of complex systems and to encode its management in the type system of the language. And that's exactly what Rust does.

With Rust, I no longer feel dirty whenever I have mutable state and I trust Rust to not just keep my code bug free but also to make me think carefully about mutable state and how to design my code with it in mind.

hota_mazi··on Why static languages suffer from complexity
> Python is easy to grok,

It's not, though, it just gives you that illusion.

The code might be easier to read but it's harder to understand and to modify safely because of the absence of type annotations.

hota_mazi··on Why static languages suffer from complexity
> Static languages unfortunately don't save you from that. You find automatically inferred types,

Oh yes, they do. Even inferred, the types are there and pretty easy to locate, even if you're not using an IDE.

hota_mazi··on Writing a Game Boy Emulator in OCaml
Start with a CHIP-8 emulator, it's a great first emulator to write that will expose you to a lot of core concepts without all the complexity that comes with more advanced systems.
hota_mazi··on Open-sourcing the Sorbet VS Code Extension
I very much doubt dynamic typing will ever come back, it's a thing of the past now. No sane new project will ever start in a dynamically typed language.

Modern statically typed languages do everything that dynamic languages do and a lot more.

hota_mazi··on Open-sourcing the Sorbet VS Code Extension
The same argument can be made of PHP, COBOL, or even FORTRAN.

None of this is changing the fact that Ruby has been on a sharp decline for a decade now and it's probably never coming back.

My personal interpretation: Ruby is extremely slow, dynamically typed, and RoR hasn't kept up with the web innovations of the past decade.

hota_mazi··on The Clojure Mindshare (2019)
> Lisp is the most expressive and flexible language. You can reach a flow-state where ideas can freely flow from your mind into code

This kind of claim typically comes from someone pretty new to the world of software development.

You can say this of any language, really, and any developer who's reasonably proficient in language X will also claim that with X, their ideas flow directly into code.

> The Lisp programming language Racket is used to teach programming fundamentals in modern Computer Science courses.

Unsurprising cherry picking. How many universities teach Racket compared to, Javascript C/C++, or Java?

The rest of the article is of the same cloth, raving about Lisp and Clojure as the best programming languages ever invented.

You should learn Lisp, no matter what kind of developer you are. But by today's standards, Lisp a pretty antiquated language which still hasn't caught up to modern trends (static types, asynchronism, etc...) and with a very poor tooling (lack of IDE's) and library ecosystem (building websites, parallelism, GUI, etc...).

hota_mazi··on A Review of the Zig Programming Language (Using Advent of Code 2021)
Ah, ok.

So... you have to do the bubbling up manually if the caller cannot handle the early exit.

Maybe I'm missing something but it still feels like a solution that looks like exception but is inferior to them.

hota_mazi··on A Review of the Zig Programming Language (Using Advent of Code 2021)
So... like checked exceptions (e.g. Java needs to declare those in the signature, and they are an integral part of said signature).

The more I hear about how Zig implements it, the more it is exactly like exceptions.

hota_mazi··on A Review of the Zig Programming Language (Using Advent of Code 2021)
Can someone more knowledgeable than me in Zig explain this:

> var x = try foo(); means x is equal to the result of foo() unless there was an error in the result.

> If there was an error, return from the function with the error now.

> This meant that you don’t have the messy littering of if conditionals after every function that you

> typically get in C, but you also don’t have the complete disaster that is exceptions in C++/C#.

How is this different from exceptions?

Exiting a function immediately in case a function call fails sounds exactly like an exception.

hota_mazi··on A Review of the Zig Programming Language (Using Advent of Code 2021)
> you will notice immediately

No, you won't notice immediately. You will only notice when you run your code, because it will crash. And it might not crash right away, because the bad code is not being run, so you have a crash waiting to happen at some time in the future, which might have been avoided with a competent type system.

Users of statically typed languages have a different understanding of "immediately" than you do. If the compiler knows my code will crash, it should simply refuse to compile it until I fix it.

> The idea that everything must be caught by the compiler is narrow-minded and ultimately can't be achieved.

Ah, the famous fallacy "We can't reach 100% so let's just be content with 0%".

That's not how the world works. Static types provide not just non crash guarantees but plenty of other advantages (automatic refactorings, performance, code that's easier to read and maintain, etc...).

You have just gotten used to a crappy developer experience because you are using a dynamically typed (or very badly typed) programming language. Get out of that boiling pot and be more exigent from your programming language, there are some very good ones available today which will make you go back to your statements above in a few years and think "Yeah... that was a pretty silly thing to say, but I know better now".

hota_mazi··on I can read C++ and Java but I can’t read Smalltalk (2000) [pdf]
This is not an argument in favor of verbosity, it's an argument in favor of static types and type inference.

Keep the verbosity to a minimum while making the code easier to read, understand, and maintain.

hota_mazi··on I can read C++ and Java but I can’t read Smalltalk (2000) [pdf]
Why would anyone think that a verbose language is a good idea?

Explicit? Sure.

But verbose?

There's no good reason for that, except that when Smalltalk was designed, we thought it was a good idea.

We know better today.

hota_mazi··on I can read C++ and Java but I can’t read Smalltalk (2000) [pdf]
You are trying to excuse Smalltalk's excessive verbosity by pointing out Java's excessive verbosity.

Yes, Java is excessively verbose. No disagreement there. But so is Smalltalk.

Your argument is basically whataboutism.

My point is that Kotlin and Swift both solve Smalltalk's mistakes elegantly by making the parameter name optional. Use it if you have to, but omit it otherwise. And as it turns out, most of the time, you don't need to mention the name at all.

hota_mazi··on I can read C++ and Java but I can’t read Smalltalk (2000) [pdf]
The Smalltalk syntax is pretty esoteric, but even if you become used to it, the fact that it requires all parameters to be named makes it an exceptionally verbose language that takes longer to parse in your head than most.

I much prefer more modern languages that allow you to explicitly name the parameters when you need to, but other than that, never requires it (e.g. Kotlin and Swift).

hota_mazi··on Julian Assange can be extradited to the US, court rules
This can definitely be one reason but I find your cherry picking very disingenuous.

His disclosures have shown a consistent bias to damage the Democrats, support the Republicans, Trump, and the Putin regime. He also endangered the lives of multiple assets by revealing their names and locations.

It's a lot more nuanced than you portray it.

hota_mazi··on Julian Assange can be extradited to the US, court rules
You're forgetting he tried to reach asylum but was stopped midway, and while he was stuck in limbo, he applied for multiple asylums, all of which were rejected.

Not really the mark of someone who wanted to be a martyr as opposed to someone like Navalny, for example.

More an indication of someone who didn't really know what he's doing and became an accidental but very effective Russian agent who ended up being a major contributor to shaking the very foundations of democracy in America.

hota_mazi··on Denuvo-Protected Games Rendered Unplayable After Domain Expires
> Trust me when I say people who pirate are usually the ones who never ever buy video games

Why would we trust you? This is just you speaking for yourself.

I used to pirate and when I couldn't, I bought the games. I'm probably not the only one.

The fact that publishers routinely spend millions of dollars on DRM is evidence that DRM works at protecting their sales. They wouldn't throw this kind of money with hundreds of experts crunching the numbers if it wasn't valuable for them.

Money speaks, while you are just making claims without any evidence.

hota_mazi··on Denuvo-Protected Games Rendered Unplayable After Domain Expires
The "general dislike of DRM" is a non issue because it's only shared by a minuscule portion of game players. And most of those who have a dislike for DRM still won't let that get in the way of them playing a game they really want to play at release time.

Denuvo seems to be extremely effective at delaying piracy for a few months, during which the publishers of the game make most of their sales.

hota_mazi··on Why Co–Star Uses Haskell
So... an article from six years ago, and then a few open job reqs.
hota_mazi··on Why Co–Star Uses Haskell
I've always been fascinated by the fact that these claims are always completely unfalsifiable.

"A lot of companies use this <non mainstream language> in internal projects but since it's internal, we can't show you".

It reminds me of "I have a girlfriend but she goes to another school".

hota_mazi··on An Update on Our Outage
It won't be a doozy: it will be a few paragraphs of general statements without saying anything specific, just like this communication (the first of consequence in days, another big failure on their part).

Roblox has to start taking infrastructure a lot more seriously than they have so far.

hota_mazi··on Expectations for generics in Go 1.18
> Because we will not know what the best practices are for using generics,

Well, you could... take a look at languages created these past twenty years that support generics, learn lessons from that, and see how these lessons could apply to Go.

But well, the Go team is not exactly known for paying much attention to the state of programming language theory, so I guess that's out.

hota_mazi··on Where transcendental numbers hide in everyday math
You didn't justify why you picked y' = y, though, and I'm having a hard time connecting that differential equation with the one that follows "so" in your message.

Could you break it down further?

hota_mazi··on New language features since Java 8 to 17
> Kotlin libraries on the JVM cannot take advantage of JVM ecosystem

This makes literally no sense since Android apps are built using not just Gradle but actually the entire Maven Central repo that all Java apps use.

Without any changes.

If what you said was remotely close to accurate, Android would have its own Maven Central repo.

hota_mazi··on New language features since Java 8 to 17
Anyone who values static typing will never be in awe of Clojure. Or any dynamically typed language, for that matter.

And Java developers care a lot about static typing.

← PreviousPage 7 of 34Next →