Fork me on GitHub
#clojure-spec
<
2019-05-18
>
dottedmag05:05:22

I'm trying to write a dissector of a complex protocol for Wireshark. I have started by writing it manually in C, but it seems to be a very tedious task. I'm going to consume this protocol from Clojure, so I was thinking about specifying it using spec, and then generating C code from it. Has anyone seen anything similar?

dottedmag05:05:03

(C can be replaced with Python or Lua — does not matter much in this context)

seancorfield05:05:31

I bet if you ask that during Pacific daylight hours, my colleague @hiredman would have a fair bit to say. He's a big fan of generating stuff from spec and similar data-based systems.

👍 4
dottedmag05:05:28

Is there a way to have "switch-by-value" without describing all variants in one gigantic (s/alt)? I'm dealing with a protocol that has a command ID byte that describes format of what is following, and then another subcommand ID in some commands etc. I don't want to have (s/alt :0x00 ::0x00-command :0x01 ::0x01-command ...) — maybe I can register them separately?

dottedmag05:05:34

Something like a multi-spec for sequences.

y.khmelevskii18:05:08

Hi! Does anybody know when spec2 for clojurescript will be available? Also, just curious, was spec2 release date announced?

Alex Miller (Clojure team)18:05:24

Still months to go probably

y.khmelevskii18:05:54

got it, thank you

Alex Miller (Clojure team)19:05:34

Although at some point maybe we’ll decide to lock it and just make additive changes after that so who knows

y.khmelevskii20:05:53

It would be great to deploy cljs.spec-alpha2 in the same state as clojure.spec-alpha2 now. During development not stable clojure.spec-alpha2 is ok but I need cljs.spec-alpha2 as well for sharing new specs between frontend and backend

Alex Miller (Clojure team)20:05:31

afaik no one has actually started working on a port of the changes in spec-alpha2 to cljs yet. The implementation changes are fairly large (and still under way) so I'm not sure it makes sense to start that work until we feel the internals have started to stabilize, and I wouldn't say that yet.

y.khmelevskii20:05:46

understand, thanks for info! I will look forward to it