Code Monkey home page Code Monkey logo

Comments (7)

aslakhellesoy avatar aslakhellesoy commented on August 15, 2024

Shall we use the .cf format used by http://code.haskell.org/bnfc/ ?

Is there a possibility that we can use bnfc instead of Ragel to obtain the same goals as we have set out for with Ragel? (Speed and portability)

from gherkin2.

msassak avatar msassak commented on August 15, 2024

There's no downside I can see to specifying the BNF in the .cf format, but I'm not sure about using bnfc itself as the backend. There's not a lot of information out there about it, including references to its speed, (or not much that I could find with some googling), and it doesn't target Ruby, so that would make development slower. On the other hand, if all we had to produce was a BNF, we might make up a lot of that time. There are some papers about it on the website. I'll dig into those and play around with it and see if I can't learn some more.

from gherkin2.

aslakhellesoy avatar aslakhellesoy commented on August 15, 2024

Remember that we only need Ruby for development purposes. The gem will C or Java for better speed. If we can save development time by writing less code (.cf) maybe that will outweigh the time lost on having to rebuild the C every time we run a spec. Of course, the time to research this also adds time and effort.

As far as speed is concerned - isn't it the speed of the parser generators supported by bnfc that counts?

from gherkin2.

msassak avatar msassak commented on August 15, 2024

Yes on all counts. I was thinking of the difference in speed between the C generated by Ragel, by all acounts insanely fast, and that of bnfc, which uses flex and bison behind the scenes, but whatever the case, it's likely an academic concern--both should ought to be significantly faster than Treetop.

from gherkin2.

msassak avatar msassak commented on August 15, 2024

I've looked at bnfc a bit, and it seems that using it would be more trouble than it's worth, especially considering how fast the Ragel work is coming along. It produces lex and yacc files like a champ, but these also depend on some code for creating an AST that bnfc produces. As the aim of Gherkin is explicitly not to create an AST, in order to use bnfc we would need to create the scanner and parser generator files, then edit them to remove the references to the AST, etc.

from gherkin2.

aslakhellesoy avatar aslakhellesoy commented on August 15, 2024

Thanks for looking into it Mike. Let's forget about bnfc and just do the BNF by hand in the wiki. It isn't that big anyway.

from gherkin2.

msassak avatar msassak commented on August 15, 2024

OK. Closing this ticket then; we've got the BNF page on the wiki.

from gherkin2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.