DSLs in PowerShell

In an earlier post, I quoted John Lam saying that one reason Ruby is such a good language for implementing DSLs (domain specific languages) is that function calls do not require parentheses. This allows DSL authors to create functions that look like new keywords. I believe I heard Bruce Payette say in an interview that Ruby had some influence on the design of PowerShell. Maybe Ruby influenced the PowerShell team’s decision to not use parentheses around function arguments. (A bigger factor was convenience at the command line and shell language tradition.)

In what ways has Ruby influenced PowerShell? And if Ruby is good for implementing DSLs, how good would PowerShell be?

Update: See Keith Hill’s blog post on PowerShell function names and DSLs.

2 thoughts on “DSLs in PowerShell

  1. Perl doesn’t require parentheses for functions. I imagine that’s where Ruby got the idea. And in that case it was deliberate, to improve readability or rather, readaloudability.

    Are there other older languages that also don’t?

  2. VB had this strange syntax where sometimes you used parentheses and sometimes you not only didn’t have to but were not allowed to. At one point I understood it, but it’s been too long.

Comments are closed.