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

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.


I'd gladly pay for Premium (I'm already paying for YT Music, the price difference is minimal) if they allow turning off shorts. But they won't. They see time spent in app goes up when they hypnotize the users. They're too Goodhart'ed to realize that quite a lot of users don't enjoy being hypnotized.


I checked out one of the accounts mentioned, mostly to check if I can discern fake accounts. The content is just still pictures. I'd dismiss those whether or not they're AI. Well, I'm not on TikTok anyway.

This reminds me of some youtube videos when I was researching some stuff to buy. Those videos are just still images plus text-to-speech narration, usually with an annoying background music.


>Well, I'm not on TikTok anyway.

I'm not on tiktok and the videos often won't play for me because of that.

Are they still images as videos with tts or literally just still images?


https://www.tiktok.com/@chloedav1s_ is the first account mentioned in the article. (Unless TikTok's UI is horrendously bad and I misunderstood) They are literally still images.


> mostly to check if I can discern fake accounts

You are making yourself easier to fool: You don't know which fake accounts you overlooked, and by increasing your confidence you make yourself more vulnerable to them in the future.


Your scenario is sth like: guy sees bad AI, good AI, and genuine content in his feed. Bad AI gives him confidence in his ability to detect slop, but he thinks the good AI is genuine content. Here the higher the quality of the slop, the harder it is to detect.

In this case some slop is hacked and exposed. I check them out to see if they're good yet. The quality of the slop is unrelated to whether they'd get hacked.


Just for the record, another one of his PRs was torn to shreds.

> some core developers (who are compiler developers by trade) are actually experimenting with and using these same tools too, but haven't suddenly turned into 13kLoC PR-opening AI superheroes.

>> Here's my question: why did the files that you submitted name Mark Shinwell as the author?

> Beats me. AI decided to do so and I didn't question it.

https://github.com/ocaml/ocaml/pull/14369


I guess it's really hard to write a sequel to Tron Legacy. Quorra came to life, then what? They're supposed to change the world. How? With a Q&A site? (Sorry I can't help myself with this dumb joke.)


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

Search: