-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prototype #25
base: master
Are you sure you want to change the base?
prototype #25
Conversation
nobody interested in free quality code? |
You'll need to fix the cmake problem |
I haven't tried it, but you might need to add some directives like:
|
i will figure it out. busy elsewhere currently. |
You should be able to verify the build in your own repo if you go to https://github.com/bunker-bunk567/cpptcl/actions and enable the actions |
are there any open applications that use cpptcl? i am fairly sure my version is no longer compatible and the test cases don't cover those discrepancies. |
I'm not aware of any published ones, but FlightAware internally uses cpptcl extensively and if there is API breakage then that will likely be a very significant hurdle. |
i think we might be going different ways then. unless someone is interested at your end to change the way of doing business i see no point trying to remain compatible. if you have future plans for TCL, you have an opportunity to improve the quality of future code. there is still the issue of the extra std::map lookup for the policy object at each function call, which is a big unnecessary heat generator. if you move the policy object into the callback object, you can get 5 times faster function calls (backwards compatible). also you can omit some other std::map lookups for the callback object itself if you make use of TCL's ClientData mechanism. another issue is that cpptcl object() does not properly implement sharing and takes no advantage of TCL object sharing (creating and duplicating more than would be necessary). but that is likely going to cause some breakage. |
I would not rule out accommodating some changes, since this seems like a big advance in the way templates are used. We can't pull it immediately into master, but if it were merged into a branch we could migrate to it. |
we can just leave open this pull request without intending to merge it anywhere until we change our minds about it. i am primarily interested in improving openboardview using cpptcl as a building block, but if somebody wants to work with me on something else, they can come here. if you point me to an application that is not too large i would see if i can improve backwards compatibility myself. it would probably end up somewhere in the middle: backwards compatible with the style, but requiring some modifications due to technical limitations. or more precisely: it would make sense to be not 100% backwards compatible. |
garbage collected objects proper lifetime management and sharing of object()'s
Perhaps splitting this PR into multiple smaller ones that are individually less disruptive to existing users would be an option? |
* allow a function to be mapped with some argument conversions being applied useful for binding to existing code and interfaces * allow to specify whether a function is cold or not to use different optimization tag all constructors and destructors and register functions as cold for all functions (hot and cold) * an not yet 100% complete example GD library binding, derived and supposed to be compatible with tcl.gd. Code size reduced to 10%, as the original was very boilerplaty.
* value (copy) semantics for objects, embedding in Tcl_Obj->internalRep for small types * share callback objects between interpreters * call object methods with dot notation (. $object method args) to avoid installing command handlers for each individual object
Hi there,
i did some work on cpptcl. let me know if you are interested.