-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate more into (functional) Scala environment #87
Comments
Thank you for your feedback :) Type issueI am very well aware of this. The vertx-scala for Vert.x 3 is a full wrapper around VErt.x-APIs.
Issue one could be resolved using value classes BUT this wouldn't hiode the exisitngf Java-methods, leading to confusing, mixed API. So far the cleanest solution I've found is using value classes to add Scala-features like Futures. I am still considering to add additional methods to convert between Scala and Java versions but I am quite a bit afraid to produce an inconistent, leaky API. Functional ScalaWell, I am always open for PRs ;) |
Type Issue As a brief discussion in SO, converting from Scala Collections/primitive types to Java alternatives will not cause performance issue. But you may try more scenario in Vertx ;-) And put the performance test on my computer:
No difference at all, IMO. If it's correct, I hope when generating code, you can hide things like Thanks a lot! |
This is a very interesting link. Thanks for being persistend ;) |
@UkonnRa I have experimented with integrating Vert.x into Monix if that is useful to you: https://github.com/DavidGregory084/vertices I have added some conversions to the generated code, but at the moment it's limited to converting Java's boxed primitives to Scala's equivalents. There are also some type class instances for Vert.x things here. |
I've considered trying the same approach with cats-effect but I don't know it well and don't need the flexibility personally. I could be convinced to try though. |
@DavidGregory084 WOW, that IS REALLY what I want! I may try to look at this project. What's the performance comparing with the official Java/Scala API? |
@UkonnRa I haven't done performance testing as I'm not using this in performance-critial code or anything that runs in production. I expect it to be competitive with scala.concurrent.Future because Monix Task generally has better performance (see e.g. https://github.com/ThoughtWorksInc/Dsl.scala/wiki/Benchmarks:-Dsl.scala-vs-Monix-vs-Cats-Effect-vs-Scalaz-Concurrent-vs-Scala-Async-vs-Scala-Continuation and https://kubuszok.com/2019/io-monad-which-why-and-how/#cats-io-vs-monix-task-vs-zio). |
HEy everyone. Sorry for the long delay but I have rethought a lot of what I was doing in the meantime. Maybe this can be a basis of more discussions. I am completely open to add new modules to vertx-lang-scala, what I am doin will remain as sort of a basis by providing the basic API wrapper which we casn put other things on top. I would be very happy to hget some feedback on the current state. |
Hi, I am a big fan of Vertx and Scala, so I am very glad to see vertx-scala is growing better and better. While using vertx-scala, there are some annoying problems.
Common Scala
Type issue
Now vertx-scala use original java types instead of their scala alternatives, like the example, which may cause problems when integrate with other scala libraries. At least, it is not that clean. :-)
Functional Scala
Support more functional libraries
I hope vertx-scala can integrate some functional scala libs like Scala Cats and their environment like vertx-kotlin-coroutine, like circe, refined, fs2 and so on. All of them are well-known toolkits in functional scala world!
The text was updated successfully, but these errors were encountered: