Back to Search
Start Over
How to twist pointers without breaking them
- Source :
- Haskell
- Publication Year :
- 2016
- Publisher :
- Association for Computing Machinery (ACM), 2016.
-
Abstract
- Using the theory of monoids and monoid actions, we give a unified framework that handles three common pointer manipulation tasks, namely, data serialisation, deserialisation, and memory allocation. Our main theoretical contribution is the formulation of the notion of a twisted functor , a generalisation of the semi-direct product construction for monoids. We show that semi-direct products and twisted functors are particularly well suited as an abstraction for many pointer manipulation tasks. We describe the implementation of these abstractions in the context of a cryptographic library for Haskell. Twisted functors allow us to abstract all pointer arithmetic and size calculations into a few lines of code, significantly reducing the opportunities for buffer overflows.
- Subjects :
- Monoid
Semidirect product
Source lines of code
Functor
Computer science
Syntactic monoid
020207 software engineering
0102 computer and information sciences
02 engineering and technology
01 natural sciences
Computer Graphics and Computer-Aided Design
Algebra
TheoryofComputation_MATHEMATICALLOGICANDFORMALLANGUAGES
010201 computation theory & mathematics
Pointer (computer programming)
TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS
Mathematics::Category Theory
0202 electrical engineering, electronic engineering, information engineering
Computer Science::Programming Languages
Haskell
computer
Algorithm
Software
computer.programming_language
Buffer overflow
Subjects
Details
- ISSN :
- 15581160 and 03621340
- Volume :
- 51
- Database :
- OpenAIRE
- Journal :
- ACM SIGPLAN Notices
- Accession number :
- edsair.doi.dedup.....64983bb616b7a68b57f6b5b25be96809
- Full Text :
- https://doi.org/10.1145/3241625.2976004