3 ms·
Yeah, I suppose you could do that! But I will say that Xsmith is designed to be self-contained. You specify both the syntax and semantics of your language with
by DonaldPShimoda 6y ago
Yeah, I suppose you could do that!
But I will say that Xsmith is designed to be self-contained. You specify both the syntax and semantics of your language within the DSL to produce a random program generator. Of course, at the moment Xsmith's semantic capabilities are more limited than Redex's, but it's also designed to solve a different problem than Redex is.
Maybe it would be neat to have an automated method of translating from Redex to Xsmith's DSL though... hm. I'll have to think about that!
- touisteur 6y agoHi, big fan of the work done on c/xsmith. Would be great if it was using some existing infrastructure instead of asking to write in yet another DSL. I'm thinking of an interesting thread some time ago https://news.ycombinator.com/item?id=21917927 https://news.ycombinator.com/item?id=21917927
- DonaldPShimoda 6y agoThe reason Xsmith is a fresh project is because the PhD student doing most of the implementation wanted to be able to make extensive use of Racket's macro system. Using metaprogramming allows for all the DSL forms to be first-class instead of, say, needing to run a program to generate the program that will then produce the program to create the language's test cases. Of course, this style of metaprogramming has downsides (for example, the start-up time is pretty lengthy, and adding new forms to Xsmith can be tricky if you're not familiar with the Racket macro capabilities), but overall it seems the benefits may outweigh the detriments. However, Xsmith's core is built upon RACR [0], a Scheme library for building what are called attribute grammars. This isn't quite what you were talking about, but at least it shows that not all of Xsmith is 100% novel implementation. :) [0] https://github.com/christoff-buerger/racr https://github.com/christoff-buerger/racr
- touisteur 6y agoHi thanks for the details, I didn't know racket that much before and I went diving into your links and that looks very interesting. I wasn't disparaging the approach at all, sorry if it came across like this. Research is research, anyone willing to spend years of their life digging into such a subject should use the most appropriate tech and follow their intuition. I'm just sad in general about the effort expected of developers (me!) or testers (me!), e.g. to write grammars in 3 or 4 dialects to be able to leverage new cool tools ;-) I know they all have their specificities, I wish there was a way to express them in one place/format. I hope this work allows some time in the future to test language parsers, compilers, interpreters, pretty-printers, so I can finally get some kind of answer to 'how do you test it'.