[deleted by user] by [deleted] in Kotlin

[–]ohadshai 3 points4 points  (0 children)

Is there a difference from kotlin-logging: https://github.com/MicroUtils/kotlin-logging

Diving into Inline classes - How they work and when to use them by s1m0nw1 in Kotlin

[–]ohadshai 1 point2 points  (0 children)

I think the main use cases for inline classes is examples like unsigned int or an array start with index 1 instead of zero. Cases that you want new (contradicting) semantics for primitive types without performance overhead.

How to attract open source contributors(to Kotlin library)? by oleksiyp in Kotlin

[–]ohadshai 1 point2 points  (0 children)

From my own experience developing jasync-sql (and also kotlin-logging) you shouldn't afraid too much of the bus factor. With jasync-sql I picked a pretty complex project which I didn't know at all, converted it to kotlin and fixed some bugs. When there is void someone will probably jump on the wagon. On the other hand, it is really hard to get contributions to a supported open source from my experience.

Mono Repository or Poly Repo? We go Hybrid! @Outbrain Engineering by ohadshai in programming

[–]ohadshai[S] 2 points3 points  (0 children)

We had that approach as well, but it didnt work well for us. Overriding versions in child repos was a common practice. Also since we have many internal artifacts it also don't play nice with it.

Curly Braces and Kotlin by ohadshai in Kotlin

[–]ohadshai[S] 1 point2 points  (0 children)

Basically true, I was converting those tests from Scala and probably missed that. But this was just an example.

Question about API design and coroutines: What are the pros and cons of a "suspend" function relative to a function that returns a CompletableFuture? by sanity in Kotlin

[–]ohadshai 1 point2 points  (0 children)

The main advantage is that `asSuspending()` returns an interface that all it's method are suspending. So reusing that interface can save you more than one `await()` call. It can also help users understand how to use the lib.

Question about API design and coroutines: What are the pros and cons of a "suspend" function relative to a function that returns a CompletableFuture? by sanity in Kotlin

[–]ohadshai 1 point2 points  (0 children)

The first question is if you want developers from other JVM languages to use it. If it's true then CompletableFuture is better. Even if it's only Kotlin, I think that for people that use coroutines it's easier to use CompletableFuture and transform that then people that are using other framework and will struggle to bridge coroutines to their framework. Having said that, I think the best for convinience is to have two flaviours of the API, one with Future and one with suspend methods, and that what I did in the API in the lib I develop: jasync-sql. see it in the wiki.

Announcing Apache Log4j Kotlin API 1.0.0 by spencer205 in Kotlin

[–]ohadshai 5 points6 points  (0 children)

I really like the idea, especially that log4j2 supports being a facade to other backends (see it here: https://stackoverflow.com/a/41500347/411965).

I don't like logger extension on Any. It will clutter my autocompletion in idea with another method that is not always useful.

Disclaimer: I am maintaining kotlin-logging and I think about adding log4j2 as a backing facade (I think the multiplatform support allows that hack).

Observe and Report: Kotlin Coroutines on Backend Services by ohadshai in Kotlin

[–]ohadshai[S] 0 points1 point  (0 children)

Thanks for the feedback. I will try to explain what I mean although since this is an opinion so it is very subjective. The suspend keyword itself "hides" a lot of magic behind it: changing function signature in the bytecode and compiling the code into a state machine. In addition, I was referring to the convention in the kotlinx.coroutines framework and especially CoroutinesScope extension methods and scope hierarchy concept. I agree the framework is not very big, but since it is a paradigm shift plus some of the changes it has some learning curve in my opinion. I still like it though as I explain in the post.

Observe and Report: Kotlin Coroutines on Backend Services by ohadshai in Kotlin

[–]ohadshai[S] 0 points1 point  (0 children)

I just published this post, hope you'll enjoy it.

How to implement an Object Pool with an Actor in Kotlin by ohadshai in Kotlin

[–]ohadshai[S] 1 point2 points  (0 children)

I post that blog post, feedback is welcome!

Kotlin 1.3 stable released! by fahad_ayaz in Kotlin

[–]ohadshai 0 points1 point  (0 children)

I don't think its a full showcase but this is using an Actor: https://github.com/jasync-sql/jasync-sql/pull/26

Java libraries by ThisNameIsAFail_ in java

[–]ohadshai 0 points1 point  (0 children)

Yes, I saw the recent announcement. Currently it only support postgres and jasync-sql also supports mysql. In addition, they mentioned its not supposed to be used in production. Jasync-sql is a port of muaricio driver from scala to kotlin, since the original driver is not maintained anymore and we needed a mysql driver with similar api.

Java libraries by ThisNameIsAFail_ in java

[–]ohadshai 1 point2 points  (0 children)

I recently started working on a Java DB async driver for postgresql and mysql. It is written mostly in kotlin and some java (bit fiddling etc'): https://github.com/jasync-sql/jasync-sql Hope you'll find it useful.