blenderskool / vyaakaran

📜 Visualize formal languages and automata
https://vyaakaran.now.sh
MIT License
43 stars 8 forks source link

TDD approach to writing grammars #13

Open blenderskool opened 2 years ago

blenderskool commented 2 years ago

Rough idea that occurred to me while using Vyaakaran

The way I write grammars usually has following iterations:

  1. Write a rough grammar.
  2. Check sample strings it generates / Check some strings I expect it to accept.
  3. Go back to step 1 and extend the grammar with more details.

This approach makes writing complex grammars simpler as you don't have to think about fine details at the start. But it also has a downside of causing unexpected changes in the intended language the grammar represents as you extend it in every iteration.

With a TDD approach, I would be able to define some sample tests of strings that I'd always want my language to accept / reject. These tests would always run when I compile the grammar and let me know if any of my tests are failing. In case a test fails, it indicates my grammar has deviated somewhere and is no longer representing the language I intend it to.

For someone interested to work on this:

nishaaannnt commented 2 months ago

TLDR; Cool project. Would like to contribute and understood the issue you mentioned too. Will explore about this more and update you. Also any place you think this test section would look good?

Hello @blenderskool , was hunting projects for fosshack and had eye on this project from past 3 days. So i set it up locally and was experimenting around it. Cool project first of all. I am not that familiar with vue, but I would love to learn it just because of vyaakaran. Just wanted to know where do you think the test section would look cool? Like any UI pattern you think, would look better? (as you may know better)

blenderskool commented 2 months ago

@nishaaannnt I think it should look good next to the console section. We can have both of them as tabs with default being console. The user can click on "Tests" tab and the console area will change to the tests interface. Of course, we can change the location later too if this doesn't look good.

vaishakhRaveendran commented 2 months ago

@blenderskool Is the issue still open. Can we work on this.