Live data from Hacker News

The Kotlin Foundation

kotlinlang.org

121–130 of 236 posts

Re: The Kotlin Foundation

#121

Earlier quoted context omitted.

> Another thing I'd like to see changed is better support for DSL's I keep waiting for a good solution for SQL in Java (or another language) that isn't a builder or a string with templating. I don't like what React does architecturally, but JSX shows how mixing languages in an elegant-ish way can be huge.

Checkout jooq(1) for a SQL DSL in Java. I've used it with MySQL and love it. Trying to convince my employer for the paid version with RDS. [1] http://www.jooq.org/

we use jooq extensively it's probably the most valuable tech in our backend.

Also among various other tech stacks I've never seen something that hits the sweet spot between "plain sql" and "advantages of ORM-stuff" as well as jooq

Re: The Kotlin Foundation

#122

Earlier quoted context omitted.

Who said anything about a few classes? How does using Ktor preclude one from using anything you just described? Lol just using Koin alone would bring every thing you just described, with the added benefit of not delving into XML files. Really some people are just married to the mentality of "If it's not on the feature list, I guess you can't do it". I believe in using focused tools that excel at specific things. Ktor…

Spring (and particularly Spring Boot) requires no XML for configuration — everything can be done with annotations and plain Java (or Kotlin).

The canonical way to use Profiles, even with Kotlin is with your Maven XML or a web.xml

You can set them up other ways, but it just ends up making a lot of sense to define them there.

To be fair, Ktor is pretty similar with the "application.conf" if you use the built-in Profiles equivalent: https://ktor.io/docs/configurations.html#hocon-overview

I just prefer that if I'm using DI, the concept of environments be handled by DI. Scoping is what DI does best after all...

Re: The Kotlin Foundation

#123

A question for HN - I like Java a lot for the ‘http API talking to SQL database’ usecase, with my goto for that being dropwizard or spring boot. I’ve only ever looked at Kotlin code in blogposts, haven’t ever actually used it. I’m probably at least a few years behind on its feature set, but I am aware of all the great features Java has added in that timeframe, many no doubt inspired by Kotlin! Would you advise me to…

You can't go wrong with either choice. Both languages are mature enough to be used in production. I, personally, would use Java, but that's just my preference.

Actually you don't really need any new features to write useful programs. They might help, but they are not necessary.

My advice would be to learn both languages and use your own judgement which one you would like more.

Re: The Kotlin Foundation

#124
post #92

This is great for Kotlin! But I need to make an observation about Google... They're also co-founders of the Rust Foundation[1], the major member of the select group of companies at the table at WHATWG[2] (which amongst other things decide on the future of web technologies, including JavaScript) due to their browser's market share, and a "visionary sponsor" of the Python Foundation[3]. They also develop a few programm…

I think we have to understand that Google is a large company filled with people with technical skills. These people are rewarded for contributing to open source. So they do. That's it. It is entirely possible that maybe Google employees might want a feature that others don't, but I haven't seen that evidence. In 10 years of developing Go, I know of only 2 things that the community has disagreed on with the Go team -…

This lacks nuance. You ignore the effect they have on the ecosystem as a whole. Mentioning the "Go community" and their "agreement" of Google's decisions without acknowledging this is disingenuous at best. They have already swayed and gatekept large swaths of the (web)development "community" by their decade-long dominance and no one can make an impactful, meaningful decision in that field without their implicit approval. Their dominance is felt best by the way they control the conversation i.e. what we don't talk about - i.e. the web among other things they touch sucks, continues to suck and it is going to get worse and less free and they are significant negative contributers. So yeah, I'd rather see them cut into pieces.

Re: The Kotlin Foundation

#125
post #100
post #98

Earlier quoted context omitted.

Why do you say so? I do think kotlin isnt only aiming to the Java Virtual Machine, it is mucho more.

Life experience of seeing guest languages come and go, during the last 30 years, and never succeeding in the goal to replace platform languages. On the contrary, platform languages slowly acquire the relevant features of the shiny languages, which eventually either fade away or find a niche for survival. Kotlin will be relevant as long as Android exists, that is all.

Scala, Clojure, and Groovy are all mature languages that haven't gone anywhere. No one has a goal of replacing Java, and they all benefit from improvements to the JVM.

Re: The Kotlin Foundation

#126
post #92

This is great for Kotlin! But I need to make an observation about Google... They're also co-founders of the Rust Foundation[1], the major member of the select group of companies at the table at WHATWG[2] (which amongst other things decide on the future of web technologies, including JavaScript) due to their browser's market share, and a "visionary sponsor" of the Python Foundation[3]. They also develop a few programm…

Google needs a real competitor, I feel like people don’t try to create search engines because it’s such a monolithic task and Google is so far ahead

I read an article in the FT recently saying that a new batch of startups is looking at competing with Google in the search-engine field [0].

[0] https://www.ft.com/content/24efc152-a65d-4c48-9032-ee349a2c8...

Re: The Kotlin Foundation

#127

A question for HN - I like Java a lot for the ‘http API talking to SQL database’ usecase, with my goto for that being dropwizard or spring boot. I’ve only ever looked at Kotlin code in blogposts, haven’t ever actually used it. I’m probably at least a few years behind on its feature set, but I am aware of all the great features Java has added in that timeframe, many no doubt inspired by Kotlin! Would you advise me to…

I'm doing a kotlin project. You won't find it hard or unfamiliar if you're used to Java. You still got gradle, and you still can use whatever java lib you want. It just feels much nicer in kotlin. Just jump into it, you can swap back if it doesn't suit you.

I've been using Kotlin in the backend since 1.0 (4 years now??) and it's great, but it does have a few small annoyances. We still have most of our codebase in Java and routinely, we create new Java code instead of Kotlin for everything, interestingly enough (mostly because when a module is already written in Java, it's mostly a source of confusion to add a few Kotlin files - so we tend to only use Kotlin when creating new modules that are fully Kotlin). Also, some of our developers just don't seem to have enough abstraction power for the higher level of code you can write in Kotlin (specially when you start using things like Kotlin builders to make code "prettier", or just abust a little bit the "everything is an expression" feature to completely avoid separete statements - e.g. functions without braces).

People moving from Kotlin back to Java is not unheard of: https://blog.allegro.tech/2018/05/From-Java-to-Kotlin-and-Ba...

Re: The Kotlin Foundation

#128
post #106

Earlier quoted context omitted.

If I were to use Kotlin server-side on JVM and didn't care about portability to other Kotlin platforms, could I not just use JVM green threads?

Depends on how Kotlin decides to expose them at the language level. For example, you need special syntax to use SAM types and Kotlin cannot use all use cases from interfaces with default methods. That is the thing with the Java Virtual Machine, the bytecodes and runtime are designed for Java, all guest languages have to pretend to be Java. Just disassemble the amount of boilerplate generated by the Kolin compiler.

This is not always the case. One example is checked exceptions which are purely Java thing and do not exist in JVM (outside of metadata). That always amused me, it's like a switch to remove checked exceptions from language, you can turn it any time without backward compatibility issues.

Another example is inner classes. Inner class can access private fields of outer class in Java. But in JVM there's no inner class concept, so compiler generates synthetic accessors for outer class private fields and inner class uses those methods to access private fields. That was fixed recently, though, but it was the case for many decades.

Also I remember some funny bytecode with try-finally, I think it's implemented with gotos.

Of course Kotlin generates a lot more boilerplate, that's for sure.

Re: The Kotlin Foundation

#129
post #107

Earlier quoted context omitted.

Spring is not standing still, and I'm not trying to claim it is, but there's still a fair bit of ceremony around a lot of features That's not necessarily a bad thing, but usually people who are giving the JVM a "second chance" via Kotlin were initially turned off by that ceremony - So when someone asks me "What should framework should I try for Kotlin web services?" my answer is usually Ktor. Because if they had to a…

Java developers are spoiled for choice. There's everything, from the simplest possible https://sparkjava.com/ , to the a little bit nicer https://javalin.io/ (which has a Kotlin wrapper), to the high performance and full framework https://vertx.io/ (which always had great multi-lingual support within the JVM), to the newer and GraalVM-friendly https://micronaut.io/ and https://quarkus.io/ ... for the Enterprise-only…

You forgot https://www.playframework.com/

Re: The Kotlin Foundation

#130
post #92

This is great for Kotlin! But I need to make an observation about Google... They're also co-founders of the Rust Foundation[1], the major member of the select group of companies at the table at WHATWG[2] (which amongst other things decide on the future of web technologies, including JavaScript) due to their browser's market share, and a "visionary sponsor" of the Python Foundation[3]. They also develop a few programm…

I think we have to understand that Google is a large company filled with people with technical skills. These people are rewarded for contributing to open source. So they do. That's it. It is entirely possible that maybe Google employees might want a feature that others don't, but I haven't seen that evidence. In 10 years of developing Go, I know of only 2 things that the community has disagreed on with the Go team -…

This does not warrant them giving them a board seat just because they have cash.

Go is moot point because they control that language anyway, people have no say on it except people who work at Google.

No surprise that you cannot donate any money there.

Post reply on HN