Beside the easily found example that I felt only scratched the surface, how spread is the use of DSLs?

A DSL is like things that are hard to define, but you know it when you see it. Perl has at least 2, regular expressions and XS. Any program that provides for language like constructs in their configurations or for which you can write "scripts". Matlab is a DSL for matrix operations. Erlang began as a prolog-based DSL. Ragel State Compiler uses a DSL. Some would call PHP a DSL for web applications. varnish cache has a DSL; httpproxy does...I'd say they're incredibly wide spread - some more functional than others. The key concept is that is tailored for a specific domain (application). I once wrote an XML based DSL for scripting the interaction of remotely connected computers over ssh. The engine was written in Perl.

Furthermore, when taking into account the difficulty of designing and maintaining a language (I found grammar and syntax to be complicated to do well, but it might just be me) why not use pure lua to script your application?

I've never embedded a scriptable interface, but the main language you use is for you; Lua is used to support a DSL that is tailored for your users. It's up to you, I've never seriously looked into doing something like this, so others might have a better opinion. Also, when using Lua to create a DSL, I think you're focused more on special functions rather than actual grammars. This is where Lua takes over; you just define and implement your special functions (and keywords?). E.g., Lua gives you "if" and other tradition language constructs.

What are some good ressources on the most maintainable design patterns used when you need to come up with an architecture for supporting user written addons? (I read Module::Pluggable documentation's but I could not think of a way to make it able to directly use lua scripts without having to wrap each of them in a perl module

Honestly, I'd look at the applications you mentioned before (Snort, Nmap); I'd look at mysqlproxy, varnish cache, Redis. I don't have any examples of a Perl application using Lua, but they've got to be out there.

HTH


In reply to Re: it's scripts all the way down! by perlfan
in thread it's scripts all the way down! by QuillMeantTen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.