Code Monkey home page Code Monkey logo

hs-msgpack-binary's Introduction

TokTok - Toxing on Android

GSoC Project - New Tox Android Client

Up to 2016/11/10: This is a demo application showing new modern design and all the basic UI interactions. No connection, messages, audio/video calls are presented here yet.

Installation

1. Install the latest gradle-android-scala-plugin from git:

Unix:

$ git clone --depth=1 https://github.com/saturday06/gradle-android-scala-plugin
$ cd gradle-android-scala-plugin
$ ./gradlew install

Windows:

  1. Use TortoiseGIT or any other git client to clone https://github.com/saturday06/gradle-android-scala-plugin with specifying depth = 1.

  2. Use commandline to install the plugin:

cd /path-to-gradle-android-scala-plugin
gradlew.bat install

2. Pull the toktok project from git:

Unix:

$ git clone https://github.com/TokTok/toktok.git

To build .apk from commandline (files may appear in /toktok/build/outputs/apk):

$ cd toktok
$ ./gradlew build

Windows:

Use TortoiseGIT or any other git client to clone https://github.com/TokTok/toktok.git.

To build .apk from commandline (files may appear in /toktok/build/outputs/apk):

cd /path-to-toktok
gradlew.bat build

To run from Android Studio consider some requirements:

  • Android studio 2.1.2 - 2.2.2
  • Scala, SBT and Android Scala plugins installed
  • Android device with 23 API and higher (Android 6)

hs-msgpack-binary's People

Contributors

beam2d avatar delta2323 avatar hiroshinoji avatar igrep avatar iphydf avatar jchia avatar kuenishi avatar martoon-00 avatar mwotton avatar oiwah avatar pepshiso avatar restyled-commits avatar sx91 avatar tanakh avatar unnonouno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hs-msgpack-binary's Issues

MessagePack profiles

The spec defines the encoding profiles, e.g. prohibit binary (we don't need it, binary support is our main motivation to consider moving to MessagePack), or restrict key types to strings (this is actually something we need).

Any view on how it could be added?

data-msgpack-0.0.5 benchmark build failure

As seen on the stackage build server:

Preprocessing executable 'msgpack-parser' for data-msgpack-0.0.5...
[1 of 1] Compiling Main             ( tools/msgpack-parser.hs, dist/build/msgpack-parser/msgpack-parser-tmp/Main.o )
Linking dist/build/msgpack-parser/msgpack-parser ...
Preprocessing benchmark 'benchmark' for data-msgpack-0.0.5...
[1 of 1] Compiling Main             ( bench/benchmark.hs, dist/build/benchmark/benchmark-tmp/Main.o )

bench/benchmark.hs:6:1: error:
    Failed to load interface for ‘Data.MessagePack.IntBench’
    Perhaps you meant
      Data.MessagePack.Instances (from data-msgpack-0.0.5)
      Data.MessagePack.Object (from data-msgpack-0.0.5)
      Data.MessagePack.Spec (needs flag -package-key messagepack-0.5.3)
    Use -v to see a list of the files searched for.

bench/benchmark.hs:7:1: error:
    Failed to load interface for ‘Data.MessagePackBench’
    Perhaps you meant
      Data.MessagePack (from data-msgpack-0.0.5)
      Data.MessagePack (needs flag -package-key messagepack-0.5.3)
      Data.MessagePack.Get (from data-msgpack-0.0.5)
    Use -v to see a list of the files searched for.

How I reproduced this locally:

$ stack unpack data-msgpack-0.0.5
$ cd data-msgpack
$ stack init --resolver nightly-2016-10-24
$ stack build --bench

`user error (invalid encoding for list)` on unpacking a listless structure

I'm trying to unpack msgpack into my type that has no lists:

data UniverseView = UniverseView
	{ planets :: Object
	, star_systems :: Object
	, current_id :: Object
	, empires :: Object
	, planets_in_star_systems :: Object
	, starlanes :: Object
	, star_systems_in_empires :: Object
	, ships :: Object
	, ships_in_star_systems :: Object
	, ships_in_empires :: Object
	, controlled_empire :: Object
	--, turn_number :: Word
	, turn_number :: Object
	} deriving (Show, Eq, Generic)

instance MessagePack UniverseView

On running my program, i get this:

*** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace: 
  Data.MessagePack.unpack,
  called from Main.rpc,
  called from Main.main
test: user error (invalid encoding for list)

This behaviour seems incorrect. The code employed is

	decRetVal <- unpack $ BL.fromStrict retVal
	--print $ (decRetVal :: Object)
	print $ (decRetVal :: UniverseView)

It woks ok if i decode it as an Object. The printed Object has a top-level array with the same number of items as my data type: http://dpaste.com/0F6045T

Add option to encode records as string-to-T maps

Currently, records and tuples are encoded the same way. Reordering or adding fields in records will break the serialisation format. We could add an option to use field names as map indices. This would only break if fields are renamed. We could also add an option to be lax about accepting input: extra fields are ignored. To be lax about missing fields, we would need to require a Default instance for every field type, effectively making MessagePack a subclass of Default.

Test `cabal sdist` on Travis CI

We should check that the tarball produced by cabal sdist actually includes all source files, including all test and bench sources.

Separate data-msgpack-types and serialisation implementations.

We are currently tied to the binary package for serialisation. While very elegant, it may not be the best performing binary serialisation library. store seems to be faster. By separating the types and the specific serialiser, we can give the user a choice, and we can provide at least two implementations: one correct one (the existing one) and one fast one. We can then do random quickcheck-style equivalence testing between the two to make sure the fast one is also correct.

Why did fromObject change?

I was trying to update some old code which was still using the msgpack package, so I tried switching to this fork. I see the MessagePack class now has

fromObject :: (Applicative m, Monad m) => Object -> m a

instead of

fromObject :: Object -> Maybe a

Can you explain the rationale for this change? I see no reason why fromObject needs to work polymorphically over all monads, it has nothing to do with monads at all! You end up using just the fail method for all your instances. At best, you could change Maybe a to Either Error a using an Error datatype.

msgpack-c equivalence testing

Add a test that generates random messagepack objects and serialises them with both data-msgpack and msgpack-c, checking whether they are the same. Do the same for deserialisation.

Think whether `groom` is actually needed

Hi.

data-msgpack depends on the package groom, which is used only in the msgpack-parser executable. groom is a heavy dependency since it pulls in haskell-src-exts.

Can you get away without groom? I suppose it's a too high price to pay for exactly one usage.

Maybe should result in ObjectNil OR ObjectXXX

This case is special and IMO should be implemented this way. Otherwise this realization will be useful for Haskell to Haskell communications only.

Original msgpack package instantiated it like that, so why did you change that?

Update hackage/stackage version

Hackage version doesn't contain commit which adds MessagePack instance for Either as well commit for Void by @Martoon-00. They are very useful, so it would be cool to see them on hackage ASAP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.