-
Notifications
You must be signed in to change notification settings - Fork 66
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
Any work on php for shoco? #5
Comments
Sorry for the delay – been busy. To answer that: Not really :( I haven't done php for years, and can't remember having done wrapping C code for php, so there's little inclination for me personally to start that. Plus, the concept of shoco kinda implies you include it in your project “as is”, since it requires your compression model to be compiled, so a generic wrapping for other languages may not make much sense. However, if you know your model, you can train shoco, compile it and create a php extension with it. It'd be purely project-specific, but again, that's the point of shoco. I doubt that it's a lot of work; if you do it, I'd be glad to hear about it! |
can u give me an idea where to start on writing a pure php implementation of shoco? i would like to help u add it into ur repo. |
I'm not sure a pure-php implememtation would make much sense for this project – aside from the algorithm implementation, one would have to re-create the model-generation which creates C-code, and all of this is really tailored for a static, compiled language. I see two approaches: Try to understand the algorithm by reading the code and the docs, and write your implementation from scratch in php. This would be a different project ( Second version: Generate a model suitable for your project, then write a php extension. What's important to realize is: It's not sufficient for both ends of the compression/decompression chain to use shoco – they need to use shoco with the same model. Model usage happens at the compile stage. Shoco is designed for C projects, where the "train model & compile shoco with new model" task is written down somewhere in your Makefiles. You need to have a clear idea what your use case is: Do you want a generic php version of shoco (which isn't really possible with the current design decisions), or do you have a specific use case (say: a web server) with specific training data (e.g. the html you generate) – in that case I'd say: Go for the second solution outlined above. The result would not be a php wrapper for shoco, but a php wrapper for shoco + a specific model. This could be part of shoco (I'd accept a pull request for out-of-the-box generation of php extensions), but bear in mind that this still requires re-compilation if the model changes, so you'll need least one project specific compile step anyway. The takeaway is: Be sure about your use case, and how generic it is supposed to be. I'll gladly help you with any issues you encounter, though my php-foo is very limited. |
Any work on php for shoco?
The text was updated successfully, but these errors were encountered: