jm + turing-complete   5

BPF - the forgotten bytecode
'In essence Tcpdump asks the kernel to execute a BPF program within the kernel context. This might sound risky, but actually isn't. Before executing the BPF bytecode kernel ensures that it's safe:

* All the jumps are only forward, which guarantees that there aren't any loops in the BPF program. Therefore it must terminate.
* All instructions, especially memory reads are valid and within range.
* The single BPF program has less than 4096 instructions.

All this guarantees that the BPF programs executed within kernel context will run fast and will never infinitely loop. That means the BPF programs are not Turing complete, but in practice they are expressive enough for the job and deal with packet filtering very well.'

Good example of a carefully-designed DSL allowing safe "programs" to be written and executed in a privileged context without security risk, or risk of running out of control.
coding  dsl  security  via:oisin  linux  tcpdump  bpf  bsd  kernel  turing-complete  configuration  languages 
may 2014 by jm
Accidentally Turing-Complete
slightly ruined by the inclusion of some "deliberately Turing-complete" systems
turing  computation  software  via:jwz  turing-complete  accidents  automatons 
march 2014 by jm
Thoughts on configuration file complexity
some interesting thoughts on the old "Turing complete configuration language" question
configuration  turing-complete  programming  ops  testing 
march 2013 by jm
Turing-incomplete Lua?
discussion thread on the cons of using Turing-complete general-purpose programming languages in places where it's not necessary, such as configuration files
configuration  turing-complete  safety  coding  software  lua  from delicious
december 2009 by jm

Copy this bookmark: