HNHacker News
TopNewBestAskShowJobs

yw3410

230 karma · joined July 22, 2020

submissionscomments
yw3410··on Choose Boring Technology (2015)
The problem is the client doesn't want to admit it - if you ask the client how much volume they're realistically expecting and they insist on a ludicrous number; what do you do?
yw3410··on From First Principles: Why Scala?
We do this too - but the other problem you get is that Exception aren't treated specially (like Any and Nothing) in the inference hierarchy so errors are liable to "collapse" to Throwable or Exception. I like wrapping them with a new type if possible to stop this behaviour.
yw3410··on From First Principles: Why Scala?
Sure - you can implicit srcloc or capture the Exception, both of which preserve it; but that's not the default behaviour and it's not what we recommend to beginners.

If you go onto the scaladoc for Either today, you see a stringly-typed Either where they discard the Exception.

yw3410··on From First Principles: Why Scala?
Yes - but you /also/ lose the stack trace and it's /far/ too easy to do; hence my OP.

It is /infuriating/ to be knee-deep trying to work out which of your 30 Eithers failed with a non-descript error.

yw3410··on From First Principles: Why Scala?
This is also the reason we have the convention in Scala as well - the inference to partially apply the type works in a certain way. But I agree with the parent post, a more descriptive name would be better.
yw3410··on From First Principles: Why Scala?
ScalaJS is one of the projects which I don't understand why more people don't rave about. It's /extremely/ nice that I can have a single project which share code between them for validation; no need for swagger or OpenAPI.
yw3410··on From First Principles: Why Scala?
Verizon's Scala projects are very cool - I wish that they got more limelight and documentation/support.
yw3410··on From First Principles: Why Scala?
Yes, it is a side-effect - and does make the code impure; but it's an /exceptional/ flow like OOM, infinite looping, stack overflows which also break equational reasoning.

My argument is that as a programmer you /choose/ the base lemmas which you're comfortable with - with an exception you're saying for a large swathe of your code, it will assume a lemma. When is /does/ break you get to point the finger at it with a stack trace saying here is where the lemma was broken. As an aside there are nicer ways to do this ala contracts, but exceptions aren't a /bad/ way.

The equivalent of try.toOption is try catch everything and discarding. The equivalent of flatMapping without adding surrounding context is equivalent to try catch rethrowing. Both of these are /much/ too common in FP codebases.

yw3410··on From First Principles: Why Scala?
Complete aside, but how is Swift these days? I used it literally a week after release and promptly stopped because the compiler kept segfaulting - I imagine it's more stable now?
yw3410··on From First Principles: Why Scala?
It's easy; there's mill, maven and fury. Mill is quite good - but I've had to dive into the source code a few times to do things.

If you're dealing with dependencies only, then it's a straightforward change. OTOH I've never had an issue with SBT since it's cleanup a couple of years back so YMMV.

yw3410··on From First Principles: Why Scala?
I seem to remember Stefan Ziegler asking around the channels about questions relating to how to do certain features to uplift Slick. Don't know if anything came out of it.
yw3410··on From First Principles: Why Scala?
DI in Java world is another example where people require this type of feature (unsafely) via reflection.
yw3410··on From First Principles: Why Scala?
It's literally one feature - each of the different "ways" gets rewritten.

It's why Scala 2 and 3 are able to maintain pretty good interoperability.

yw3410··on From First Principles: Why Scala?
Scala 3 has type-classes as a core feature.
yw3410··on From First Principles: Why Scala?
I am continually perplexed at the swallowing of exceptions in certain FP communities.

Result types, Either et cetera make it extremely easy to swallow errors by flatMapping thoughtlessly losing the context of where they were - you typically /want/ the call stack when you hit into an exceptional flow.

yw3410··on The Vaccine Had to Be Used. He Used It. He Was Fired
That's not entirely true though - the penalties for attempted murder are not the same as murder, for example.
yw3410··on Pattern matching accepted for Python
Depends on the language, but a lot of them use guard clauses (so case ... if cond =>).
yw3410··on Why I still Lisp
Unit tests, maybe not, but it's commonly accepted even in statically-typed communities that property-based tests are practically as good to guarantee properties which a stronger type-system would catch.

For example in Haskell almost all of the abstractions (Monoid, Semgroup) use property-based testing rather than proofs.

yw3410··on Losing faith in UX
What? Discovery in Emacs is amazing; all the API is a keystroke away.

Do you mean something else?

yw3410··on Racket Compiler and Runtime Status
This is a very good post; kudos for writing it up.

Another thing which may be nice to talk about is where the communities are for each language (Racket on Slack and the mailing lists, Common Lisp has an irc...).

yw3410··on Racket Compiler and Runtime Status
If you want live image reloading stick to a Lisp like SBCL rather than Scheme.

If you care about startup times or FFI then don't pick Clojure.

YMMV between Racket and Guile; I would say Racket is better insofar as the culture of documentation is really very good.

In practice, once you learn a Lisp, you can jump between them without too much trouble.

yw3410··on Signal WhatsApp Chats Import
Did a quick skim and dont see why not. There's examples to receive the message. It's up to you what you want to do with it afterward.
yw3410··on Why Clojure? (2018)
Don't get me wrong, my laundry list with SBT is huge - that single point was an example; but I have other points for make, cargo, cabal, stack etc...

My question was what makes SBT uniquely bad when the topic of build tooling comes up that people immediately comment how terrible it is.

yw3410··on Why Clojure? (2018)
Whoa, this was a point about syntax (non-Algol vs. Algol) being overstated. Haskell and Idris absolutely fall in non-Algol languages that make people do a double-take.

For the record I like lots of languages - dependent types are awesome. I find that the language I reach for will mostly be a function of the problem space.

Just an FYI, certain Lisps have static typing as well.

yw3410··on Why Clojure? (2018)
Sure; but half the problems apply to other build tools too, not just sbt.

Take for example the point on syntax - is gradles groovy receiver syntax not just as esoteric as operator overloading?

yw3410··on What I’ve Learned in 45 Years in the Software Industry
I think your points are good. Another point I would add is abstraction is a tool for managing complexity, not a tool for reducing knowledge.

You will have issues in that library/network/function/language. Learn to be comfortable peeling away the abstraction when you need to.

yw3410··on Why Clojure? (2018)
Does programming in-school really count as programming in anger? I did a module on C++ at university but I'm not equipped to evaluate it.
yw3410··on Why Clojure? (2018)
Why do you think sbt is a bad build tool?

I've used the build tools of almost all the major languages (JS/TS, Rust, Haskell, Kotlin, C etc) and I don't honestly see any which are particularly easy.

yw3410··on Why Clojure? (2018)
I use a variety of languages and always feel that Scala gets a bad-rap because it's a compromise language (though I feel the same about Rust and most people seem to like it).

Scala 3 pros:

+ Higher-Kinds + Type-classes + Decent-ish hygienic macros + Decent OO model with mixins + for-comphrension + Compile-time evaluation + Laziness + Currying

It's pretty good at all of them - but not quite.

If you're used to Haskell you'll get annoyed at the fact that the inference is only within a single statement and that polymorphic functions resolve the typeclasses in a particular way.

If you're used to Scheme, you'll get frustrated that the identifiers can't be created easily in its new macro system or you can't manipulate the scope-sets of the identifiers.

If you're used to Erlang you'll wonder why Akka can't reload functions easily.

If you're from Java you'll wonder why everyone is going on about profunctors, effects and finally tag-less.

yw3410··on Why Clojure? (2018)
Only a relatively few amount of programmers have programmed in non-Algol syntax in-anger, rather than the reverse.

How can you weigh up the pro or con of a syntax when you haven't used it much? I couldn't tell you whether APL syntax was any good.

← PreviousPage 4 of 5Next →