Yes, absolutely.  

There were some early examples with Tony O'Dell's inline SQL module. It doesn't 
actually check the syntax, and just passes off everything between 'sql' and 
';'.  You can see it at <https://raku.land/zef:tony-o/Slang::SQL>.  I'm sure it 
could be updated today to check off some of its current limitations, but it was 
more of a "hey, this can be done" module.

Recently, I made a test module wherein BASIC was provided as a language for 
methods that could be used just like traditional Raku methods.  
<https://github.com/alabamenhu/BasicTest>.  Both Fernando Correa de Oliveira 
and I have been working on (separate) regex-like slangs for specific purposes, 
and you can definitely expect to see some more stuff coming from us in the near 
future.

The main thing holding this back is the difficulty switching between languages. 
 You'll notice that it's possible to easily slip between all three of Raku's 
languages (main, regex, and Q).  For instance / regex { main: say 'q lang' } /. 
 At the moment, there's no easy way to enable that in slangs at the moment, but 
—and this is key— it's coming.  As soon as Rakudo can be run fully on RakuAST, 
I will be able to quickly enable the following syntax in BASIC (no, seriously, 
it'll be a 3-5 line modification, it will be that easy):

    method-basic foo {
        10 LET A = { $*RAKU.version ~~ /\d+ {say "I'm in the Q lang in Raku v$/ 
in Regex in Raku in BASIC in Raku" }/; +~$/ }
        20 LET B = A * 10;
        30 PRINT B
    }

With the printed output being
 
    I'm in the Q lang in Raku v6 in Regex in Raku in BASIC in Raku
    60

All of the same syntax checking niceties that Raku has could be made available 
in any DSL created for Raku (for instance, in that BASIC example, compilation 
will fail —with an a message— if the line numbers don't go in order), it'd just 
be on the developer to provide them.

I'm fairly certain that DSLs were the main draw of both slangs and the 
grammars, it's just taken a while for us to get there.  But the light is at the 
end of the tunnel finally.

Matéu

> On Feb 12, 2022, at 4:12 PM, Parrot Raiser <1parr...@gmail.com> wrote:
> 
> In this article, "Every Simple Language Will Eventually End Up Turing 
> Complete"
> https://solutionspace.blog/2021/12/04/every-simple-language-will-eventually-end-up-turing-complete
> the author points out an unfortunate tendency for "simple" languages
> to accrete features and morph into misshapen monsters. Could Raku's
> grammars provide a way to express the unique features of a DSL while
> using the extra features from a carefully considered framework?

Reply via email to