logoalt Hacker News

groundzeros2015yesterday at 7:24 PM1 replyview on HN

You can also configure a read table to disable any other data structure features you want.

inb4 DoS attack. That is a universal parsing problem and should be solved by configuring OS limits for your process.


Replies

pfdietztoday at 2:28 AM

I'm of two minds about read tables.

Yes, it's nice we have control over it. This is a lisp thing, where features that are used to implement standard things (like the standard reader) are exposed so the user can play with them also.

But code written with custom read tables has some problems. Different code with different read tables may not be composable. If I have two packages that use incompatible read tables I can't import them into a third package and expect to be able to use their readtables there.

Also, it makes treating code as an object to be inspected, modified, and written out again difficult. This is similar to the problem of code rewriting systems on preprocessed languages like C or C++.

A different branch of Lisp put everything into S expressions. Interlisp, for example, had comments in the code as forms, so the code could be editted as S-expressions. But that was dropped from Common Lisp, which took the surface syntax more from Maclisp.