News for hackers. Stuff that matters.

yafetn

Re:Christopher Hitchens and the Necessity of Universalism on Tuesday December 03, 2024 @02:13PM (#42310028)
Speaking of Hitchens, I highly recommend his “Letters to a Young Contrarian”. Or any writing of his, to be honest.
Re:Kotlin Money on Tuesday October 08, 2024 @09:59AM (#41777466)
The currency codes could probably be inline value classes. That way, you can do

    val price = 100 money USD
Note the lack of quotes around USD.
Re:Properly testing concurrent data structures on Saturday July 06, 2024 @01:20PM (#40891764)
JetBrains’ Lincheck[0] is a good library in the Kotlin/Java world for this stuff. I especially like that it’s declarative, and also the way it outputs the linearizability results.

[0]: https://github.com/JetBrains/lincheck

Re:What if null was an Object in Java? on Monday April 29, 2024 @05:17AM (#40196224)
> Scope functions are still huge.

I’d put any one of extension methods, value and data classes, immutable variables, structured concurrency, and top-level functions ahead of scope functions for reasons to switch to Kotlin. But hey, if you’re switching, we’re already friends :) .

Re:What if null was an Object in Java? on Sunday April 28, 2024 @06:30PM (#40192575)
If null-safety on the JVM is important to you, just use Kotlin.
> 2) choose paths now that keep options open later.

Not sure about this one. I’ve seen teams that are too noncommittal in their architecture decisions because “what if [insert unlikely thing that’d not actually be the end of the world] changes?” Then the project ends up only using surface level features of their chosen tooling because people want to keep too many options open and are afraid to commit to something where it matters.

Re:Java 23: The New Features Are Officially Announced on Wednesday April 17, 2024 @08:43AM (#40063834)
I think the Jetbrains team are dropping the ball when it comes to Kotlin on the JVM. They seem to be focusing their energy on KMP, and I’m not sure they have the capacity to deal with all the platforms they want to target (Kotlin/JS, Kotlin/Native, Kotlin/JVM, KMP, Jetpack Compose (?) etc). That being said, I’d strongly encourage others to try Kotlin as a Java alternative for server-side applications (Spring Boot integration is really nice, for instance). It’s such a delight to use! And it’s still my favorite language. Some features I especially like:

- context receivers (think of them as implicit parameters that are checked at compile-time)

- null safety. This is a BIG one, especially if you’re coming from Java.

- structured concurrency. Java still doesn’t have this. Note that SC is different from what was introduced in Project Loom.

- immutable variables, data classes, value classes etc.

I wonder if that’d make them a broker and not an exchange. Different set of rules, regulations, and licenses.
Interesting read, thanks! Some points:

> Hogging instances might pay, if this stops competitors getting good hosts. This would eat into PnL and is also wasteful on energy.

Aren’t reserved instances cheaper than spot?

> Bad players could do a ping test to many thousands of EC2 instances, find those which are also at very low latency to their good boxes (assuming these are competitors), and DDoS them during trading hours to hammer the hypervisor’s NIC. This would result in critical overhead occurring for competitors sending orders out.

Leaving out the logistics of how someone could do this (why are your instances reachable from the internet?), wouldn’t you have a good case with your exchange to get them kicked out?

I had a professor who hated Jared Diamond for being reductionist, and I’ve been skeptical of him ever since. However, I see the immense appeal of his theories (and the one linked here) because they’re so simple to understand. They make for good History Channel documentaries, and tidbits you can repeat at a cocktail party to make yourself sound smart.
Re:Fuzzing Ladybird with tools from Google Project Zero on Saturday March 16, 2024 @12:37PM (#39727317)
Fair enough, and that totally makes sense. I guess I just miss the “Well, hello friends…” :)
Re:Fuzzing Ladybird with tools from Google Project Zero on Saturday March 16, 2024 @11:33AM (#39726796)
A little off topic: what happened to the hacking videos on YouTube? Used to look forward to them but I haven’t seen a new one in a while.
Semi-related is the Aeron project: https://github.com/real-logic/aeron
This is interesting for several reasons.

1. It happened during the Treasury auction, and if the timing was intentional, a case could be made about it being a national security issue. The hackers disrupted the largest, and possibly most important, auction in the financial world.

2. The hackers may have unintentionally provoked an entity you definitely don’t want on your bad side: the People’s Liberation Army’s cyber arm.

3. I wonder if ICBC used a specialized courier service to send the USB stick, or if such a thing even exists. Or did they just use any old messenger service in Manhattan? If the latter, it’s funny to think that there was somebody biking across the city carrying billions of dollars worth of liquidity and settlement data and he/she would’ve been none the wiser.

Re:Kotlin Coroutines vs. Threads Performance Benchmark on Friday October 27, 2023 @11:05PM (#38046701)
Lest someone new to Kotlin only reads the title and decides to spawn bare threads all over the place, don’t. At first pass, it's not clear to me what the actual work the author is doing in his benchmark. Instead, I’d point to the excellent work of Marcin Moskala’s Kt.Academy[0] and other resources on the topic.

[0] https://kt.academy/article/cc-best-practices

Re:How Netflix Really Uses Java on Tuesday October 10, 2023 @12:34PM (#37834312)
Netflix’s DGS framework for GraphQL is nice to work with but we’ve been frustrated with some prioritization choices by the team. For instance, if you’re using Kotlin, it’s impossible to define and pass scalars to the latest version of the client. There’s a year-old issue highlighting this problem that’s been ignored it seems.

https://github.com/Netflix/dgs-codegen/issues/455

Re:Kotlin Multiplatform for Android and iOS Apps on Monday September 25, 2023 @12:30PM (#37646529)
I haven’t yet tried KMP, but I think Kotlin in general is slept on here on HN. My experience is on the server side with both Micronaut and Spring Boot and it’s such an ergonomic language to write in. It’s probably my favorite language thus far.
Re:Java 21: First Release Candidate on Monday August 14, 2023 @07:30PM (#37128179)
Yeah, I watched that talk (and many others from KotlinConf) but it was a bit too high level and not actionable.
Re:Java 21: First Release Candidate on Monday August 14, 2023 @06:43PM (#37127686)
Can someone please explain how Project Loom and virtual threads in the JVM affect Kotlin’s coroutines?
Re:Fintech engineering mistakes on Wednesday June 28, 2023 @12:44PM (#36509048)
It’s probably fine, but this sort of thing is why transactionAmount and transactionCurrency are better when separated. Consider the case when you’re doing some reporting from your DB based on currency; do you really want to have to deal with one string that contains both or just do a simple WHERE clause?
Re:Fintech engineering mistakes on Wednesday June 28, 2023 @11:32AM (#36507942)
I’d also add:

— If you’re using JSON to pass around monetary quantities (eg. from the frontend to the backend), put them in strings as opposed to the native number type. You never know what the serializers and deserializers across languages will do to your numbers (round them, truncate them etc.).

— Start recording the currency of the transactions as early as possible. It can be a separate column in your table.

— Use TIMESTAMPTZ. Always.

Hi Andreas, when are we getting the next batch of “FIXME Roulette” videos? They’re the most entertaining yet educational debugging videos out there.
Re:My Fifth Year as a Bootstrapped Founder on Friday February 10, 2023 @09:55AM (#34740422)
One of the updates I was looking forward to, and congrats on the $800k revenue!

   This year, I hope to transition assembly to China, where all of our parts originate.
I’d have thought people were doing the opposite nowadays — bringing assembly stateside.