-
Notifications
You must be signed in to change notification settings - Fork 14
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
An ode to borer, or: Please add support for scala-native #633
Comments
Thank you, Philipp, for the praise and this ticket! And one more question: Can you show the prompt for the "ode"? ;-) |
JSON Schema support? |
The latter... :-) |
Glad you liked it :) Here you go:
|
About native image vs. scala-native: Yes, I have used both native image and scala-native. My experience is mostly in line with this article: I like the idea of scala-native targeting LLVM and producing faster and leaner binaries. This might look very different if you have the enterprise version of GraalVM where you can do profile guided optimization in native image, however. Alas, I do not. In addition, typelevel has put a lot of effort into publishing their libraries for all platforms including scala-native. I trust that they are seeing potential in using scala-native over native image. If you want to know more, I can recommend this blog post: My hope is that since borer is already being published for Scala.js, publishing it for scala-native might be relatively low effort. I have never published anything for scala-native, so admittedly that hope is not based on much. I can only tell you that on a Mac it is very easy to use scala-native due to the availability of LLVM. |
Ok, Philipp, thank you for this nice writeup! There is one thing that I'm not sure about yet: From a quick glance |
Thanks for this interesting analysis! That does sound like a bit of a predicament, indeed. It seems that jsoniter-scala, which is available for scala-native, ran into a similar issue: plokhotnyuk/jsoniter-scala#94. I haven't found anything similar in circe even though it is also available on scala-native but I only looked for a brief moment. I am sure this can be solved, though. As you already pointed out, going low-level with scala-native is what it's made for. Satisfactory performance might already be achievable through ordinary bit manipulation. After all, a UTF-8 encoded In any case, I'd welcome borer for native even if it had to use a fallback or this simple bit masking for the time being. |
borer doesn't really need any SIMD support from the platform. It's just that I don't have time right now to dig into this matter. Do you need borer for its JSON or its CBOR capabilities? |
I see, thanks for the explanation. Regarding urgency: It’s more of a want than a need. Until borer is released for native there are the two aforementioned JSON libraries. And whilst I would like to experiment with CBOR, that is by no means urgent. In the unlikely case that I will find myself with too much time at my hands I might try what happens when borer is built for native and report back but I wouldn’t count on this happening anytime soon. |
+1 for Native CBOR library. If we can use Borer on Scala native, we can build agile and type-safe rigid utility that uses binary format. Using Scala CLI, we have been able to build native tool easier! |
My points above about the (few) |
Probably you can do it like in this amazing hack contributed by @armanbilge |
Nice, @plokhotnyuk, thank you for the pointer! |
tl;dr: doing REST with scala-native is more feasable than ever, yet borer is not available for scala-native. Is there a chance for this to change?
With http4s-curl there exists a non-blocking http backend for scala-native and rumor has it the next version of scala-native will bringt support for multiple threads. Exciting times!
And whilst there are indeed a number of json libraries published for scala-native, e.g., circe, upickle and jsoniter, my favourite json library of them all is notably absent. Please publish borer for scala-native. You shall have my eternal grattitude and this ode to borer:
The text was updated successfully, but these errors were encountered: