Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 26 2019 21:07
    scala-steward synchronize #139
  • Jan 26 2019 14:33

    mpilquist on v1.11.0

    (compare)

  • Jan 26 2019 14:32

    mpilquist on 1.11.x

    Setting version to 1.11.0 Updated version to 1.11.1-SNAPS… (compare)

  • Jan 25 2019 10:28
    billpcs starred scodec/scodec
  • Jan 22 2019 22:01
    benhanna starred scodec/scodec
  • Jan 21 2019 20:36
    scala-steward opened #139
  • Jan 21 2019 14:51
    mpilquist closed #130
  • Jan 21 2019 14:48
    mpilquist closed #119
  • Jan 21 2019 14:48
    mpilquist commented #119
  • Jan 21 2019 14:48

    mpilquist on 1.11.x

    Scala 2.13.0-M4 Merge branch 'series/1.10.x' in… Upgraded to latest scala-collec… and 2 more (compare)

  • Jan 21 2019 14:48
    mpilquist closed #138
  • Jan 21 2019 14:40
    mpilquist opened #138
  • Jan 21 2019 14:37

    mpilquist on 1.11.x

    Created 1.11 branch (compare)

  • Jan 21 2019 14:31

    mpilquist on xuwei-k

    Upgraded to 2.13.0-M5 (compare)

  • Jan 21 2019 14:19

    mpilquist on xuwei-k

    Scala 2.13.0-M4 Merge branch 'series/1.10.x' in… Upgraded to latest scala-collec… (compare)

  • Jan 21 2019 14:03

    mpilquist on 1.10.x

    Update sbt-scalajs, scalajs-com… Merge pull request #129 from sc… (compare)

  • Jan 21 2019 14:03
    mpilquist closed #129
  • Jan 21 2019 14:03
    mpilquist closed #126
  • Jan 21 2019 14:03

    mpilquist on 1.10.x

    Pad-left on pbcd codec. Fixes #… Using padLeft in pbcd instead o… Merge pull request #133 from lJ… (compare)

  • Jan 21 2019 14:03
    mpilquist closed #133
Ryan Zeigler
@rzeigler
I'm interested in trying to write a parser for a complicated unframed network protocol. I poked around scodec-stream, but ultimately, I'm not trying to turn a stream of bits into a stream of messages but rather interact in specific ways. There doesn't seem to be a way to get at the coroutine bits inside of StreamDecoder to drive it myself. Is this correct?
Diego E. Alonso Blas
@diesalbla
@mpilquist Regarding scodec, several open-source projects (such as fs2) have migrated tests to munit, rather than scalatest or specs2, on account of it being a thinner library with a leaner development
Is that something you would also want in the pieces of scodec?
mpilquist
@mpilquist:matrix.org
[m]
scodec-bits, core, and protocols are already on munit, scodec-stream uses scalacheck only
Diego E. Alonso Blas
@diesalbla
? I was looking at scodec-bits series/1.1.x...
mpilquist
@mpilquist:matrix.org
[m]
look at main branch instead
Diego E. Alonso Blas
@diesalbla
... ok... thanks...
cranst0n
@cranst0n
I think maybe not, but is there any kind of combinator to deal with decoding values interleaved amongst others? Specific use case looks something like: [byte0][int24][int24][byte1][int24][int24]...[byte127][int24[int24]] and I want to decode all the ints into a list as well as bytes[0-127] into it's own custom type which has it's own codec.
I've got something working, but it's a rather convoluted xmap. Wondering if I'm somehow reinventing something.
mpilquist
@mpilquist:matrix.org
[m]
not sure it's any better but you could decode to a List[Either[Byte, Int]] and then use separate to turn that in to (List[Byte], List[Int])
cranst0n
@cranst0n
ill investigate to see how it fits. theres a few other steps involved but that's something i hadn't considered at the very least. thanks!
jilen
@jilen
Hi, how can I framing (param used by checksummed) a fixed(N bytes) + variableSizeBytes + checksum(1 byte) message?
Shubham Girdhar
@girdharshubham
Hi
I have a noob-ish question.
How do we write conditional codecs?
What I mean is, if the condition evaluates to true I decode a byte if it doesn't I don't.
I can put an if expression. but the type ultimately comes out as Codec[Nothing]
mpilquist
@mpilquist:matrix.org
[m]
take a look at scodec.codecs.conditional
Shubham Girdhar
@girdharshubham
Makes sense.
Thanks.
Kinda like this?
xCodec flatPrepend { (_: String, seqId: Int) =>
              conditional(seqId == 127, "PCM Id" | uint8L.withKey("pcmId"))
}
Thanks
btw withKey is just an xmap
Shubham Girdhar
@girdharshubham
Thanks @mpilquist
It works.
Rad Rares
@radRares1
Hello, do you know any good resources besides the documentation for someone who is just starting to learn how to use scodec? Thanks
mpilquist
@mpilquist:matrix.org
[m]
scodec-protocols has a bunch of "real world" examples
Rad Rares
@radRares1
thanks a lot!! :D
Jakub Kozłowski
@kubukoz
hi, is there a method corresponding to the pre-dotty sizedList? As in, a statically known number of values
encoded as a tuple, I suppose
mpilquist
@mpilquist:matrix.org
[m]
Hm, no I guess we lost that
Jakub Kozłowski
@kubukoz
natural numbers are in stdlib, right? Maybe we can get it back :D
mpilquist
@mpilquist:matrix.org
[m]
Yeah would be cool to return a TupleN
Jakub Kozłowski
@kubukoz
also having a hard time navigating to the sources, but that's probably on metals...
Is there a .choice?
mpilquist
@mpilquist:matrix.org
[m]
Codec.choice but there’s an open issue for a union type version
Jakub Kozłowski
@kubukoz
thanks
mpilquist
@mpilquist:matrix.org
[m]
Jakub Kozłowski
@kubukoz
hmm can't find that symbol on main
I have like 8 codecs of subtypes and want to combine them into the parent, not sure if that can still be done
used to have a shapeless coproduct of them, which I guess was proof that it was exhaustive
mpilquist
@mpilquist:matrix.org
[m]
Oh discriminator codecs
Jakub Kozłowski
@kubukoz
not really... I think I want .orElse semantics
I have the bit sequence for every case and just want to pick the one that matches
so kind of like codecs.fallback with N cases
mpilquist
@mpilquist:matrix.org
[m]
Whoops scodec.codecs.choice(a, b, …)
Jakub Kozłowski
@kubukoz
hmm, maybe mappedEnum...
it does seem to work on discriminators though
I might be able to use a derived codec, actually. Just need to see what rules they follow lol
I think that'll do it.
mpilquist
@mpilquist:matrix.org
[m]
The biggest change is definitely the removal of all the coproduct codec stuff
Partially because they no longer exist
But also because they were too clunky
Jakub Kozłowski
@kubukoz
I kind of wish there was a scala3-compatible shapeless with all the old stuff though...
thankfully I don't use scodec at work but folks definitely do. You probably know that best ;)
and the migration of everything at once might be a pain
mpilquist
@mpilquist:matrix.org
[m]
There’s a Google summer of code project for that