4 ms·
One example would be a language to deal with TLV data, like ASN.1 DER (e.g. TLS certificates). Currently most TLS libraries use C, which is insane, but in princ
by alricb 11y ago
One example would be a language to deal with TLV data, like ASN.1 DER (e.g. TLS certificates). Currently most TLS libraries use C, which is insane, but in principle, you don't even need recursion to parse DER data; so even vanilla Haskell is overpowered for the purpose.
- mcnamaratw 11y agoYeah, for sure, in a lot of applications you really don't want people chanting "code is data, data is code" and building impossible shit that nobody can figure out. A finite state machine can easily be made basically un-debuggable by human beings. It's just ... maybe it's the crowd I hang out with, but I feel like these ideas have already totally won.
- nullc 11y agoFun fact; what these things implement is more general than DER; a sub/superset of BER. BER does have "constructed values" which are most 'obviously' parsed recursively. OpenSSL handles this via C macros that unroll the parsing 7 levels deep, but no more. (What does it do when given nested constructed values? Well-- when its expecting an integer it goes and traverses into the constructed values in a particular order, pulls out the primitive types at the bottom, concatenates their bytes, and treats the result as an unsigned integer. ... Why? Because this is precisely the kind of madness that happens when you deploy a 'too powerful' language! :) )