Hacker Newsnew | past | comments | ask | show | jobs | submit | ackfoobar's commentslogin

> it took like 2 weeks to ramp up

I worked on a purely functional Scala codebase (Cats). I joined after the original authors were gone.

Some new comers were not fluent in it after ~a year.


This might be the your missing puzzle piece:

https://en.wikipedia.org/wiki/Committee_to_End_Pay_Toilets_i...


You are of course right about what the word "commons" refers to. Still, I want to quibble.

Maybe the definition covers both, but I still think it's worth distinguishing between incentives creating a bad equilibrium and simply antisocial behaviours. When I hear "tragedy of the commons", I think of the former.


> stuck to why he thought it was bad for Bun to do this

Quite the opposite. "When Jarred announced the Rust rewrite, we were ecstatic."

> It’s definitionally an ad hominem against Jared.

Who Jarred is, as a CEO, definitely has an impact on how the company develops software - how Zig is used. And the argument is that Zig is used badly in Bun. Without that context, I, as a reader, would have to actually read through a lot of code to be convinced of that point.


As noted in the article:

> This feature does have some limitations, for instance when we have multiple nested function calls, but in those cases an explicit lambda expression is always still possible.

I've also complained about that a while ago https://news.ycombinator.com/item?id=35707689

---

The solution is to delimit the level of expression the underscore (or dollar sign suggested in the article) belongs to. In Kotlin they use braces and `it`.

    { add(it, 3) } // Kotiln
    add(_, 3) // Scala
Then modifying the "hole in the expression" is easy. Suppose we want to subtract the first argument by 2 before passing that to `add`:

    { add(subtract(it, 2), 3) } // Kotlin
    // add(subtract(_, 2), 3) // no, this means adding 3 to the function `add(subtract(_, 2)`
    x => { add(subtract(x, 2), 3) } // Scala


I think I like the explicit lambda better; I prefer to be judicious with syntactic sugar and special variable names.

    fun x => add(subtract(x, 2), 3) // Virgil


Coming from Scala to Kotlin, this is what I thought as well. Seeing `it` felt very wrong, then I got used to it.


I don't mind adopting features from popular languages. (After all, Virgil using _ for partial application turned out to be a happy accident that aligned with Scala.) Adopting features that are popping up in other languages helps to reduce the explanation burden, but I'm not sure on this one. It took me about 10 years to finally settle on having `fun` as a keyword to introduce lambdas instead of the parser back-tracking madness that JS parsers do.


> explicitly written to do this

In that case I want the signature of "this function pre-computes, then returns another function" and "this function takes two arguments" to be different, to show intent.

> achieved through compiler optimisation

Haskell is different in that its evaluation ordering allows this. But in strict evaluation languages, this is much harder, or even forbidden by language semantics.

Here's what Yaron Minsky (an OCaml guy) has to say:

> starting from scratch, I’d avoid partial application as the default way of building multi-argument functions.

https://discuss.ocaml.org/t/reason-general-function-syntax-d...


The premise of this joke is dead since 2020, when ZGC was production ready.


> ditch ORMs ... make good use of SQL

I think Java (or other JVM languages) are then best positioned, because of jooq. Still the best SQL generation library I've used.


Jooq with Kotlin for a back-end has been the best of both worlds for me.

Much cleaner, shorter code and type safety with Postgres (my schema tends to be highly normalized too). And these days I’ve got it well integrated with Zod for type safe JS/TS front-ends as well.


Anytime I use a language other than Java it's always jooq that I miss. It's that good.


I'm rather partial to MyBatis (and Liquibase) but I might have to give Jooq a try.


thumbs up for jooq


https://github.com/peterklijn/hammerspoon-shiftit

I use ShiftIt (a lovely project, but dead) reimplemented in Hammerspoon. It is very comprehensive.


I guess the answer has to depend on demographics. But if we are spitballing, it probably wouldn't be all bad for every country to have a Lee Kuan Yew.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: