Live data from Hacker News

Kotlin for data analysis

kotlinlang.org

11–20 of 105 posts

Re: Kotlin for data analysis

#12
I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosystem is great. Etc. Bla bla bla. But the bottom line is that I don't love python. It's dreary to me. Mediocre. I can't get very excited about any of it. It just seems so backwards.

And it's not necessarily the most efficient path either. The interpreter is not that fast, the language is not that expressive, what passes for package management is a bad joke, etc. I can work with it but I'm not necessarily loving it.

For data engineering, Kotlin has a lot to offer. I wouldn't necessarily recommend it because it's all kind of niche. But it kind of works as well. If you aren't afraid of tinkering with it, there are a lot of other niche solutions out there as well that aren't python.

Kotlin is what I reach for when I want to get stuff done in a hurry. Part of that is just my limitation. It's what I know and I kind of grew up on JVM languages. I'm well aware that's not necessarily optimal and that that's just a bias I have. But objectively, it has a lot of nice things over modern python as well.

Kotlin is a modern language, it's a lot more expressive than python. It has a a great library ecosystem. Including some stuff that does not depend on the JVM. And even though it's kind of niche for a lot of things I use it for (e.g. developing reactive web frontends), it holds up well and rarely disappoints me.

People use python because everybody else uses python. That's it. It's not particularly good at anything it does. But it will get the job done and I can do it. But that just isn't good enough for me. It's the visual basic for data science. And that's not a compliment. Being idiot proof is it's main feature. But that doesn't make it the smart choice.

Re: Kotlin for data analysis

#13

I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosyste…

Kotlin just needs some stubborn people not to use python just because everyone else does, and build up the Kotlin ecosystem. That's how progress is made.

Re: Kotlin for data analysis

#14

I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosyste…

I think both languages have their strengths. I love Kotlin for its functional programming (map, filter, etc) and strong static typing. But Python has some nice features as well, such as list comprehension, the 'yield' keyword, and annotations are super simple to implement.

Re: Kotlin for data analysis

#15

I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosyste…

I'm not sure how someone could see Kotlin as more expressive than Python, unless I am misinterpreting what expressive means. Python has a good language features and helpful abstractions like list comprehensions.

What makes Kotlin more expressive? I understand it has some functional features but I've never seen anything dramatically flexible.

Re: Kotlin for data analysis

#16

I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosyste…

Have you looked at https://www.modular.com/mojo

Sounds like it has a good Python interop story.

Re: Kotlin for data analysis

#17

I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosyste…

I'm not sure how someone could see Kotlin as more expressive than Python, unless I am misinterpreting what expressive means. Python has a good language features and helpful abstractions like list comprehensions. What makes Kotlin more expressive? I understand it has some functional features but I've never seen anything dramatically flexible.

The biggest thing that wouldn't be available in Python would be the DSLs. Often they are not my favorite and overused, but they can be very expressive for things like their charting example https://kotlinlang.org/docs/data-analysis-overview.html#kand...

Re: Kotlin for data analysis

#18

I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosyste…

What about position, with kotlin language support:

https://i.imgur.com/SjbtX2z.png

https://www.andrewheiss.com/blog/2024/07/08/fun-with-positro...

Re: Kotlin for data analysis

#19

I do both Kotlin and Python. More Kotlin than Python to be honest. But I'm pragmatic. Python is where all the action is when it comes to data science, llms, and all the rest. So it's the path of the least resistance. And there's a great argument to not challenge that and just do what everybody else does and put your head down and not criticize any of that. Which is why I use it on a few projects. The library ecosyste…

I'm not sure how someone could see Kotlin as more expressive than Python, unless I am misinterpreting what expressive means. Python has a good language features and helpful abstractions like list comprehensions. What makes Kotlin more expressive? I understand it has some functional features but I've never seen anything dramatically flexible.

Kotlin's standard library has ruined me for other languages, especially its collections library. The consistency and comprehensiveness of its approach to collections is unmatched in any language I've tried, including all the big name functional languages. It's hard to get across what's so great about the library in writing because it's not just one standard library function, it's how they all interact with each other and how they interact with the language design—you really just have to try it to understand. The net result is that transforming data from one shape to another flows effortlessly, with the dot operator seamlessly connecting a stream of transformations. The fact that it's the dot operator also means that you get really great autocomplete to help you on your way.

Python, meanwhile, has always felt pretty awkward to me when it comes to data transformations. Comprehensions are okay, but they feel like they are special casing what should be a bunch of standardized helper functions operating on lambdas, as a sort of ugly workaround to the fact that Python refuses to implement proper lambdas. And when you can't use a comprehension, you're stuck with a pretty awkward collection of helper methods that are hard to find and use correctly and which are severely handicapped in expressivity by the lack of a proper lambda.

Post reply on HN