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

See https://github.com/combinatorylogic/mbase

Problem with two namespaces is, well, need to maintain two namespaces, in all your DSLs. Which in many cases may double the effort.

Of course, macros must have their own namespace, but that's an obvious thing, you cannot mix compile-time and run-time namespaces anyway.



> Problem with two namespaces is, well, need to maintain two namespaces, in all your DSLs. Which in many cases may double the effort.

How so? And why only two namespaces? Common Lisp probably has a dozen: package name, lexical variable, dynamic variable, function (stores either function or macro function), documentation string, property list, type name, class name, slot name, etc.

As long as you have first-class identifiers, you can define arbitrary namespaces without having to worry about conflicts between the namespaces.

> Of course, macros must have their own namespace

That doesn't have to be true, and is not true in Common Lisp: http://www.lispworks.com/documentation/HyperSpec/Body/03_bba...

Having an identifier denote a function and a macro at the same time like that enables adding partial evaluation and other compile-time optimizations to DSLs without having to dig into the compiler.

> but that's an obvious thing, you cannot mix compile-time and run-time namespaces anyway.

? You have to mix them if you want a compiler in your runtime.




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

Search: