Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really don't care about Lisp.

The point is that if you are designing a language and want a lively ecosystem, you either build in features that establish conventions, or implement them in a Standard Library if the language is powerful enough to express them that way.

Failing to build common ground to enable libraries from different places to interact cleanly dooms your language to obscurity.



Not sure what that has to do with Lisp then, since macros establish conventions, but on a language level.

Example: the Common Lisp Object System was initially developed as new a library, based on two other earlier libraries. This was then standardized and it is the standard way to develop object-oriented software in CL.

The library has three API layers: an object-oriented layer, a functional layer and a syntactic layer. The syntactic layer is implemented with Macros. It provides for the developer a convenient way to specify the elements of an object-oriented program: classes, generic functions, methods, control structures, ... As a developer everyone prefers to use the syntactic level.

There are many libraries and applications using it. It's also extensible, so that other user can add new behaviour to the object-system itself.

That macros enable new language extensions also on a syntactic level is nothing special. To use macros from other developers is not more difficult than using a class graph, or similar.

There is a lot of 'fear' of user-level syntax extensions from people who have never developed with it. Understanding the implementation of macros themselves is an added burden, since many developers are not used to write&read code which is written on a meta-level of incremental code generation. But there are practices which can be learned and applied. Macros themselves can make the code much more readable, since it allows one to support a problem domain also on a syntax level and hides implementation details.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: