I think its a good idea and I have given it some thought, but I had some concerns which everyone should probably consider:
-maintaining an API in multiple languages can be a burden. For example, simply maintaining dClass in Java and C is a lot of work which is why I opted for JNI. I would have prefered pure Java but did not want to maintain a single algorithm in 2 codebases... -dClass has some wider use cases and is currently and will continue to evolve towards to a more powerful and generic pattern database/engine So right now DeviceMap uses a small subset of dClass functionality. So it might be a good idea to just take that subset and port it over. That subset is basically an in memory search tree (but be linear in respect to number of patterns being searched), a tokenizer, a few regex (I found them to be optional in the DDR), ranking, CHAIN, WEAK, and STRONG patterns. The reason im focusing on this subset is that currently dClass supports *a lot* more than this which would be overkill for this project. I also think porting this subset over to other languages is a very doable task and im open to have someone take this as their own task. ________________________________ From: Bertrand Delacretaz <[email protected]> To: [email protected] Sent: Monday, May 6, 2013 12:11 PM Subject: Porting dClass to other languages? Hi, I'm still chasing the idea of a multi-language device identification implementation that uses the exact same data files and gives the exact same results on various platforms. Reza, do you think dClass [1] [2] would be a good candidate for that? As it's written in C, the PHP variant might just need a wrapper. A JNI wrapper for Java is already available, but for my use cases I'd prefer a real Java version which would require porting. The C code is not huge, but we'll need to check for any constructs that might be problematic in Java. We can test 100% of the results by comparing to the C implementation, so validating the various implementations would probably be easier than using different algorithms in different languages. WDYT? -Bertrand [1] https://github.com/TheWeatherChannel/dClass [2] http://www.rezsoft.org/device_detection/
