summaryrefslogblamecommitdiffstats
path: root/2021/talks/bindat.md
blob: 21ae0959c27614fd8208dfad33371a2063eda316 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                                 

                                                                 












                                                                      

            


                                                                                                                                                                                                       
                                                                        
                                                                       



                                                                       
                                                      
                                                                    
                                                                     



                                                                      

                                                                       


                                                                        
                           
                                                          
                                                               
                                                                  
                                                                     


                                                                        

                                                                       
                                                                                                                             

 
                                                            
 
                                                            
[[!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

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"]]