fast-string-interpolator icon indicating copy to clipboard operation
fast-string-interpolator copied to clipboard

Project Merging?

Open darkfrog26 opened this issue 7 years ago • 6 comments

Sorry guys, if I had noticed this project existed I might not have created this one: https://github.com/outr/perfolation

Would you be interested in combining efforts? We both seem to have the same core focus but have each branched off to add unique functionality. Perhaps together we could create one powerful project?

darkfrog26 avatar Mar 13 '18 15:03 darkfrog26

Great work, Matt!

You have managed to release a string interpolator which can be a replacement in most cases for all 3 standard interpolators of Scala, and made it available for Scala.js & Scala Native platforms!

I have checked that it works quite competitive in terms of throughput and heap usage. Please see updated results of benchmarks: https://sizmek.github.io/fast-string-interpolator/

Ideally, bests of our work should end up in the Scala language repository, and I see that some improvements for string interpolation are coming in 2.12.5: https://github.com/scala/scala/pull/6093

You are right that now we have different focusing. While our main goal is to get 100% compatible drop-in replacement for standard string interpolators with exceptional performance, the 2nd goal is to test Scala macros technology for emitting of low-level implementations (usually we call it boilerplate code) which will help reach safety and mechanical sympathy (when software and hardware working together in harmony). First steps of research in that direction were done in jsoniter-scala project, and here I would reuse some findings for serialization to strings.

Personally, I would happy to contribute to your project, but let see what think our organization owners and contributors.

plokhotnyuk avatar Mar 14 '18 08:03 plokhotnyuk

@plokhotnyuk thanks. I'm up for any changes in perfolation. It looks like you all are getting better performance, but there are a few extra features perfolation provides. I'm not stuck on the name, but I think "fast-string-interpolator" is a bit long and generic. I was looking for a name that I could extract a single character to be used for interpolation ("p" in this case).

darkfrog26 avatar Mar 15 '18 14:03 darkfrog26

String interpolation is defined without reference to the standard lib StringContext:

scala> object StringContext { class X { def s(args: Any*) = "hi" } ; def apply(ps: String*) = new X }
defined object StringContext

scala> s"asdf"
res1: String = hi

Instead of extension methods with funky names, you can just supply a custom StringContext for importing with the well-known names.

som-snytt avatar May 09 '18 21:05 som-snytt

@som-snytt Different names are used to not override standard string interpolators and allow mixed usage of them with that are proposed in this library

plokhotnyuk avatar May 10 '18 08:05 plokhotnyuk

👍 I see.

som-snytt avatar May 10 '18 18:05 som-snytt

Not sure how happy you guys will be, but I completely ripped off your Macro for Perfolation in the current branch. The primary functionality that Perfolation provides that FSI doesn't, is Scala.js and Scala Native builds in addition to additional type-safe numeric and date formatting functionality. I still want to discuss merging projects as I don't especially care about the interpolation, but it makes sense to couple with the type-safe formatting functionality.

darkfrog26 avatar May 16 '18 17:05 darkfrog26