Live data from Hacker News

Kotlin and linear programming

tomstechnicalblog.blogspot.com

11–20 of 46 posts

Re: Kotlin and linear programming

#11
post #5

Not sure why Kotlin would be picking this fight - Python and to some extent R already dominate in data science with a little bit of Scala added in Spark - where does author see an opening for Kotlin? For high performance libraries nobody would pick Python or any JVM-based language either, and that's what most of the wrappers end up calling anyway (C++, CUDA, Fortran, OpenCL).

I use Python for machine learning, but I wish I could use a friendly, modern, statically-typed language like Kotlin, Swift, etc. instead. Dynamically typed languages feel scary beyond around 1000 lines of code.

Re: Kotlin and linear programming

#13
post #4

Adding to my other comment, my biggest dissatisfaction with this article is that all it did was show the quite excessively verbose problem setup, without actually showing an algorithm for integer linear programming. An interesting post would have explained how to implement branch and bound in Kotlin, not how to call somebody else's library. Needless to say, I'm not sold on Kotlin from reading this.

Also, I believe no one is doing linear programming without vectorized operations (SIMD) nowadays.

I know JVM optimizes small methods, so maybe their JIT optimizer does that automatically, but I'm not sure that optimizer is better that manually optimized code like in numpy.

Re: Kotlin and linear programming

#14
post #11
post #5

Not sure why Kotlin would be picking this fight - Python and to some extent R already dominate in data science with a little bit of Scala added in Spark - where does author see an opening for Kotlin? For high performance libraries nobody would pick Python or any JVM-based language either, and that's what most of the wrappers end up calling anyway (C++, CUDA, Fortran, OpenCL).

I use Python for machine learning, but I wish I could use a friendly, modern, statically-typed language like Kotlin, Swift, etc. instead. Dynamically typed languages feel scary beyond around 1000 lines of code.

Python 3.6's optional types are pretty great. Block out your solution first then start constraining it where you need to.

Re: Kotlin and linear programming

#15
post #5

Not sure why Kotlin would be picking this fight - Python and to some extent R already dominate in data science with a little bit of Scala added in Spark - where does author see an opening for Kotlin? For high performance libraries nobody would pick Python or any JVM-based language either, and that's what most of the wrappers end up calling anyway (C++, CUDA, Fortran, OpenCL).

I love Python, but after working on a large Python project I saw first-hand that JVM scales way better to large codebases.

Currently Python took a niche between quick ad-hoc exploration tasks (land of R) and production pipelines (land of JVM/C#/C++), but for large pipelines it's not so suitable IMO.

Re: Kotlin and linear programming

#16
Without wishing to disparage the article at all (I really love this kind of article, including this specific one) ...

I feel like Kotlin is almost exactly the wrong language in this space. You either go all the way to a more powerfully typed language where Scala has grabbed mindshare, or you go fully towards dynamic languages like Python or (my favorite, even though it has almost no mindshare in this space), Groovy. It really feels like all Kotlin did here was add verbosity and cloud the actual question being answered with more syntax.

Re: Kotlin and linear programming

#17
>Linear programming (also called linear optimization) is an applied field of mathematics often used in operations research and planning. It attempts to find an optimal solution to a planning problem when a set of business constraints exist.

No, linear programming is an applied field of mathematics that attempts to find an optimal solution to a goal within a system which is under some sort of constraint(s). Whether those constraints are business constraints is irrelevant; the theory exists outside of any particular application.

Re: Kotlin and linear programming

#18
post #5

Not sure why Kotlin would be picking this fight - Python and to some extent R already dominate in data science with a little bit of Scala added in Spark - where does author see an opening for Kotlin? For high performance libraries nobody would pick Python or any JVM-based language either, and that's what most of the wrappers end up calling anyway (C++, CUDA, Fortran, OpenCL).

Python is often a second class citizen in these areas, even if much is made about its widespread support in the data science realm. I don't want to say it's hype is overblown... but a lot of the pain points and cracks in the seams are glossed over. Take spark, for instance. You run into extreme performance issues the second your data has to be serialized to cross the py4j gap. An many essential parts of its API requi…

> In any case, a "not-java" language that can talk java is freakin amazing

I don't understand why this is such a big draw for people when literally any jvm language[1] has this feature. Languages like jython, ABCL, clojure, jruby, groovy, and perl6. Kotlin is certainly not unique in this regard.

1: https://en.wikipedia.org/wiki/List_of_JVM_languages

Re: Kotlin and linear programming

#19

Earlier quoted context omitted.

Python is often a second class citizen in these areas, even if much is made about its widespread support in the data science realm. I don't want to say it's hype is overblown... but a lot of the pain points and cracks in the seams are glossed over. Take spark, for instance. You run into extreme performance issues the second your data has to be serialized to cross the py4j gap. An many essential parts of its API requi…

> In any case, a "not-java" language that can talk java is freakin amazing I don't understand why this is such a big draw for people when literally any jvm language[1] has this feature. Languages like jython, ABCL, clojure, jruby, groovy, and perl6. Kotlin is certainly not unique in this regard. 1: https://en.wikipedia.org/wiki/List_of_JVM_languages

True. But I think Kotlin strikes a nice balance of seamless interoperability, convenience, and apparently few compromises. The java interop feels natural - far more natural than it does in most of those other languages you mention (I don't have experience with them all though) - but the language is more concise and convenient than java, even though its very similar. It also has static typing.

Some of the languages you mention come with serious compromises when used on the JVM, like Jython and Jruby - decent portions of their ecosystems are implemented in C - and hence won't work on the JVM.

Re: Kotlin and linear programming

#20
post #5

Not sure why Kotlin would be picking this fight - Python and to some extent R already dominate in data science with a little bit of Scala added in Spark - where does author see an opening for Kotlin? For high performance libraries nobody would pick Python or any JVM-based language either, and that's what most of the wrappers end up calling anyway (C++, CUDA, Fortran, OpenCL).

Python is often a second class citizen in these areas, even if much is made about its widespread support in the data science realm. I don't want to say it's hype is overblown... but a lot of the pain points and cracks in the seams are glossed over. Take spark, for instance. You run into extreme performance issues the second your data has to be serialized to cross the py4j gap. An many essential parts of its API requi…

> In any case, a "not-java" language that can talk java is freakin amazing, in my book (Scala doesn't scratch my itch there - it's far too clever - had enough of that with perl back in the day).

Clojure is a bunch simpler than Scala, many Python programmers are quick to pick it up. The dynamic nature and interactive prompt is all there.

If you look at Norvig's Python-Lisp comparison table at http://norvig.com/python-lisp.html - all the red cells (where Lisp lost to Python) are fixed in Clojure.

Post reply on HN