3 ms·
> it does not fit at all into my model of building hierarchies of DSLs Links to source code or GTFO. The only way people manage to combine DSLs in a single-nam
by sedachv 12y ago
> it does not fit at all into my model of building hierarchies of DSLs
Links to source code or GTFO. The only way people manage to combine DSLs in a single-namespace language is by having stupid naming rules and restrictions (see for example Ruby on Rails). Compare this to something like https://github.com/vsedach/cliki2 https://github.com/vsedach/cliki2 where I could just throw arbitrary CL libraries that define their own DSLs together and not worry that my function name is going to clobber some reference in the template system.
- sklogic 12y agoSee https://github.com/combinatorylogic/mbase 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.
- sedachv 12y ago> 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.htm 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.