summaryrefslogtreecommitdiffstats
path: root/2021/talks/bindat.md
blob: 208a0635296cee92f8efde95d041568bb915851f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[[!meta title="Turbo Bindat"]]
[[!meta copyright="Copyright © 2021 Stefan Monnier"]]
[[!inline pages="internal(2021/info/bindat-nav)" raw="yes"]]

<!-- You can manually edit this file to update the abstract, add links, etc. --->


# Turbo Bindat
Stefan Monnier

[[!inline pages="internal(2021/info/bindat-schedule)" raw="yes"]]


# Table of Contents



Bindat is an ELisp library to help manipulate binary data. This is a
niche library that is used by packages such as Websocket, EMMS, and
cpio-mode. Its implementation was repeatedly caught harassing hapless
kitten while at the same time providing poor service slowly. For
Emacs-28, Bindat was rewritten so as to make it more efficient and
flexible while respecting the kitten. In this presentation I intent to
show how we saved those. Not recommended for birds.

# Discussion

[[!template id="help" tags="need_chapter_markers" message="""Want to help make the Q&A session easier to search? You can [add chapter markers](/2021/contribute/#chapter-markers) or [edit the captions](/2021/contribute/#edit-captions), maybe starting with these
[auto-generated captions](emacsconf-2021-bindat--turbo-bindat--stefan-monnier--answers.ass)."""]]

-   Q1: bindat seems very similar to GNU Poke (except that GNU Poke is a
    superset, and then some, with a different syntax). I'm wondering if
    it might be good to add a bindat variant that translates to/from
    Poke if need be (using libpoke), for sheer insane blazing
    native-code JITted speed. (And, later, maybe letting bindat gain
    some of the insanely expressive capabilities GNU Poke has got). Its
    use of eval blocked this in times past. but now...
    -   A:GNU Poke is indeed the natural evolution, and is much more
        powerful.  Given the fairly little use of BinDat so far, I'm
        not sure there will be enough motivation to give access to GNU
        Poke from Emacs, tho.  One of the main benefits of using GNU
        Poke would probably be that lots of formats are already
        available for GNU Poke, so you could directly re-use them.
-   Q2: Is your dog's name something Lisp or PL related...? :)
    -   A:Winnie?  I don't think so, no (we didn't choose the name, in
        any case)
-   Q3: This looks amazing!  Is it merged into mainline Emacs, a patch,
    an external library?
    -   A: It's in Emacs-28
-   Q4: Are there benchmarks of this vs. the older bindat?
    -   A:There is a benchmark for it in the `elisp-benchmarks`
-   Q5: Do you know of any CL or Scheme libs similar to bindat.el?
    -   A: No, but I'd be interested to hear about it if someone else
        does.
-   Q7:  You are a hero of kittens everywhere.  Do you have any feline
    pets as well?  :)
    -   A: Not yet.  If you're near Montreal and you have a kitten for
        me, I'm interested
- I *hope* cl-loop is more efficient than building a bunch of intermediate lists when you chain map/filter/reduce operations.


[[!inline pages="internal(2021/captions/bindat)" raw="yes"]]

[[!inline pages="internal(2021/info/bindat-nav)" raw="yes"]]