Giter Site home page Giter Site logo

Symbol selection about dstep HOT 7 CLOSED

jacob-carlborg avatar jacob-carlborg commented on July 21, 2024
Symbol selection

from dstep.

Comments (7)

jacob-carlborg avatar jacob-carlborg commented on July 21, 2024

Could you please elaborate on why this is useful.

from dstep.

trikko avatar trikko commented on July 21, 2024

Some cases:

  • Struct I just need signature.
  • Symbol inside a file but dstep force me to import all
  • Ignore errors by dstep on enum/struct/functions I don't care about
  • Clean binding importing only functions I need (it's easier to maintain in future)

For example check:
https://github.com/2night/mondo/blob/master/source/mongoc.d#L103
That struct it's not a valid d code. Anyway I need just its definition.

Or:
https://github.com/2night/mondo/blob/master/source/mongoc.d#L8

I need just a couple of functions from libbson to interface with libmongo, I don't care about other functions/structs from library. And if they will add function/struct/enum/typdef I don't like to have them added to my binding. For exampl symbols could be collide with existing imported symbols or generate invalid D code.

from dstep.

jacob-carlborg avatar jacob-carlborg commented on July 21, 2024

I prefer to fix DStep to not generate invalid code in the first place.

from dstep.

trikko avatar trikko commented on July 21, 2024

You're right, of course. But anyway I have to write a dirty-script to fix error with a workaround. It would be better to have some options to skip them. Also to keep binding stable also if they add new things, as said.

It would be fun to have dstep as library. I give it a source and it returns a range of translated definition/declarations. So I can filter them or merge easily. (and dstep app could be built over this library).

from dstep.

ciechowoj avatar ciechowoj commented on July 21, 2024

What about adding --skip and --skipdef switches to CLI. The first one would remove the translated item from the output completely and the second one would remove the definition of structs (keep only the declaration). For instance:

dstep ... --skip foo --skip bar --skip baz --skipdef _bson_value_t

It starts to be quite long, but it would be still useful for someone who uses dstep as part of some script.

from dstep.

jacob-carlborg avatar jacob-carlborg commented on July 21, 2024

--skipdef would translate struct Foo { int a; } to struct Foo?

from dstep.

ciechowoj avatar ciechowoj commented on July 21, 2024

Yes, that is the idea.

from dstep.

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.