Git Product home page Git Product logo

Comments (4)

keleshev avatar keleshev commented on September 27, 2024

You see, the problem of making a code generator consists of 2 parts:

  1. implement a template for code that does not change (C)
  2. implement generator which uses template to generate code (Python)

In our case the problem (2) is easy—just some string manipulation, and the problem (1) is hard—we need to implement a big subset of docopt functionality in C (the part of functionality that occurs at run-time and, thus, we cannot reuse Python implementation for that).

That is why we need test_docopt.c—tests for the hard problem. We also use docopt.c, because we cannot test template, we need to test some C code that could be compiled. log.h is just handy during development, it will be removed eventually.

from docopt.c.

keleshev avatar keleshev commented on September 27, 2024

I noticed that you're mostly targeting the (2) problem and almost dismissing the (1). You should take a closer look at it. Right now docopt.c supports only options and no pattern-matching. The pattern-matching needs to be implemented in C, since it happens during the run-time of the end-user program, and it's a hard task.

from docopt.c.

kblomqvist avatar kblomqvist commented on September 27, 2024

Let's get back to this after we have implemented other features like positional arguments, commands and pattern matching?

from docopt.c.

ffunenga avatar ffunenga commented on September 27, 2024

@halst ok, after the str.replace I'll be looking at the C code

@kblomqvist ok

from docopt.c.

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.