jiffy icon indicating copy to clipboard operation
jiffy copied to clipboard

Add encode! and decode!

Open AndrewDryga opened this issue 7 years ago • 4 comments

It would be really awesome to have Jiffy API fully compatible with Poison and ExJSX, so it can be used as a drop-in replacement in most of the projects.

AndrewDryga avatar Jun 21 '17 13:06 AndrewDryga

Not sure what this would require from Jiffy? Is the api already the same and I just need to add the ! function names that proxy through to the existing encode/decode functions or are you asking for more API option equivalence stuff?

davisp avatar Jun 21 '17 19:06 davisp

Adding ! functions would be a great start, but usually this means that functions without ! return {:ok, binary} or {:error, reason} (I guess {ok, Binary} and {error, Reason}` in Erlang) tuples. Since this is a breaking change I guess you can consider it only on next major update.

Other option may be adding mix.exs file and Elixir module, that will use existing Erlang jiffy implementation and provide a Poison-compatible interface, which won't break anything and will make using this package even simpler.

AndrewDryga avatar Jun 22 '17 20:06 AndrewDryga

Do you know of an example for me to look at that gas the Elixir API layer? I've only skimmed over the intro tutorial so I'm not super familar with the ecosystem for that sort of mixed project. Not against adding such a thing just don't want to have it be a non-standard thing if possible.

On Thu, Jun 22, 2017 at 3:52 PM Andrew Dryga [email protected] wrote:

Adding ! functions would be a great start, but usually this means that functions without ! return {:ok, binary} or {:error, reason} (I guess {ok, Binary} and {error, Reason}` in Erlang) tuples. Since this is a breaking change I guess you can consider it only on next major update.

Other option may be adding mix.exs file and Elixir module, that will use existing Erlang jiffy implementation and provide a Poison-compatible interface, which won't break anything and will make using this package even simpler.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/davisp/jiffy/issues/147#issuecomment-310499255, or mute the thread https://github.com/notifications/unsubscribe-auth/AABN2TKZ8-IAzPLe-K8rDJzUBzHyzLb-ks5sGtQEgaJpZM4OA-S0 .

davisp avatar Jun 22 '17 23:06 davisp

See #149

AndrewDryga avatar Jun 23 '17 11:06 AndrewDryga