mbraceproject / FsPickler

A fast multi-format message serializer for .NET
http://mbraceproject.github.io/FsPickler/
MIT License
326 stars 52 forks source link

C# friendly API #21

Closed buybackoff closed 10 years ago

buybackoff commented 10 years ago

Since it is a general-purpose serializer, it would be nice to avoid FSharp.Core references in C# projects just because of method signatures with optional parameters

eiriktsarpalis commented 10 years ago

I agree, definitely something that must be done.

eiriktsarpalis commented 10 years ago

This has been addressed in the latest nuget release.

See http://www.nuget.org/packages/FsPickler.CSharp/

ppanyukov commented 9 years ago

While this has been addressed by FsPickler.CSharp, I found one tiny issue with that package: the dependency on FsPickler.Json which in turn pulls down Newtonsoft.Json. This may seem like a non-issue for many people however consider this:

I personally would prefer the following structure:

  1. FsPickler.CSharp:

    FsPickler.CSharp 
       -> FsPickler
       -> FSharp.Core [1]
  2. FsPickler.CSharp.Json:

    FsPickler.CSharp.Json
       -> FsPickler.Json
           -> FsPickler
           -> FSharp.Core [1]
       -> Newtonsoft.Json

Or something similar along these lines. The point being that FsPickler.CSharp.Json should be a separate thing IMHO.

[1] The subject of FSharp.Core is a separate one but just to say we've run into some non-trivial VS/MSBuild/F# specific problem with it. Oh well at least it's fun :)

PS. Happy to get together a pull request to separate things if people agree this is a reasonable idea.

eiriktsarpalis commented 9 years ago

Good point, although one of the very next things on my to-do list is to implement the Json readers/writers from scratch. This will remove the Json.NET dependency once and for all from FsPickler.

ppanyukov commented 9 years ago

That would be cool from the dependency point of view. Not sure how everyone will like the idea of "yet another Json reader/writer/whatever" and the fact they can't use their trusted Newtonsoft.Json anymore though.

But does it still make sense to have separate FsPickler.CSharp.Json package? To follow the FsPickler structure:

- FsPickler <-> FsPickler.CSharp
- FsPickler.Json <-> FsPickler.CSharp.Json
eiriktsarpalis commented 9 years ago

If this work is done, there would be only two packages: FsPickler and FsPickler.CSharp.

ppanyukov commented 9 years ago

Ah I see. Yes makes sense :)