Coder Social home page Coder Social logo

Comments (15)

VinGarcia avatar VinGarcia commented on July 20, 2024

Hello Jean, thanks for the suggestion.

Can you exemplify your use-case? I think this can be a worthy contribution, however, we need to consider the pros and cons.

For example, if we add this new feature we'll add complexity to the framework which might complicate the documentation for new users.

On the other hand, if there is a use-case that we can estimate to be a common need and that will make the library more useful for a good number of our users, this extra complexity might be worth it.

Also, please submit a Pull Request, it will be nice to be able to see your code and we can continue the discussion there.

In either case, thank you for your contribution and interest.

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

VinGarcia avatar VinGarcia commented on July 20, 2024

Hello @jpfeger, sorry for taking so long to answer,

  1. The TravisCI environment compiles it under GCC 4.8 on an Ubuntu VM.
  2. Since the only types that are passed by value are strings, integers, booleans and doubles if you implement this change for strings it would be perfect.
  3. I also considered that. If it did not crash it might be one of those cases where it is using a pointer to something that was already deleted but is still there; this might cause hard-to-debug problems if the user uses it without understanding how references work.

About the performance, I haven't tested it but I kind of expected it not to be very fast. There are several optimizations I want to do that would improve it in a little bit but the code was made to be flexible and very easy to use, so it does have some problems on this area.

For example, all the operations are saved on maps that associate strings to function pointers, each time an operation has to be performed it has to access the map, retrieve the function sometimes wrap the parameters on a packToken and then run it.

The bright side is that if you want to specialize the framework for your own programming language you should be able to remove most of the abstraction layers and it would become much faster for sure.

So, long story short, it was meant to be flexible and modular, not fast. I would appreciate help if you have the time, I think the main point where we could optimize it is on how the tokens are stored on the memory, probably using a union type would be more efficient than the way it is done today with polymorphism and inheritance.

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

VinGarcia avatar VinGarcia commented on July 20, 2024

Hello @jpfeger, sorry for the delay,

About 6: For you to make a Pull Request (PR for short) on CParse you just need to fork the repository on your own account. Then you should be able to submit a PR, here's the documentation:

About 2: Don't worry if the feature is good I will fix any problems on the Linux compilation, just make the PR and we talk about it.

About 4: If you are able to improve the performance it would be great, but it would be better to create a separated branch and a separated PR so if one of them is rejected the other can still be merged.

Again, I am sorry for disappearing, I am not having much free time =/

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

VinGarcia avatar VinGarcia commented on July 20, 2024

You cannot push into someone else's repo, but you always push on your own repo and ask me to pull your changes into my repo, that's the concept of the Pull Request.

The SSH key unrelated to this process of creating a PR, it is only used to allow you to make pulls and pushes without ever needing to type your password, it is quite handy, but not a necessity for anything.

So I don't know if it is possible to make a PR via command line, but I know you will have to push your changes on one of your own branches, the usual workflow goes like this:

# Note that I am cloning your repo, not mine:
git clone https://github.com/jpfeger/cparse.git myCparseClone
cd myCparseClone/

# Create a new branch with a descriptive name:
git checkout -b optimize-cparse-performance

# ... make some changes on the code ...

# Commit your changes (preferably with multiple small commits instead of a single big one)
git add some-files
git commit -m 'optimized function foo()'
git push origin optimize-cparse-performance

# Then go to github.com/jpfeger/cparse and click on "new pull request"
# From there on it should be straight forward

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

VinGarcia avatar VinGarcia commented on July 20, 2024

I actually did not get the images but I am pretty sure I know what is wrong.

The first thing is that it is not normal to push to someone else's repo. I could give you permission but it would also give you permission to do a lot of stuff on the repo that might not be desirable. So this isn't the usual way.

What far more common is the concept of a Pull Request or PR, this is a more elegant way to offer code changes on a open-source project:

You make a fork, like this one you already have:

Make your changes and push them to your own fork, not the official CParse repo.

And then you use a special feature from Github called Pull Request or PR where I can see your code, suggest changes, run tests and etc before I allow any changes to happen on the official code.

Then if I am satisfied I click on a special button to accept your changes and merge them into my master branch.

You can't do a PR on the command line as far as I know since it is a Github feature, not git.
Also, the Github interface is so easy that it should be easy to use.

I found a tutorial online with pictures showing how to make a Pull Request, you may skip to section 8 since there is where he explains the PR part:

from cparse.

VinGarcia avatar VinGarcia commented on July 20, 2024

@jpfeger here's an example of a PR I just created to submit some changes on an open-source project of a friend of mine:

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

VinGarcia avatar VinGarcia commented on July 20, 2024

Yeah, no problem, I will take a look.

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

jpfeger avatar jpfeger commented on July 20, 2024

from cparse.

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.