On Fri, 2006-09-01 at 22:49 -0700, Erick Tryzelaar wrote: > 2. create a felix_cpp.flx file to store all the C/C++ modules > > This is to prevent polluting pure felix programs with C/C++ modules. Of > course, I can understand that some of the standard library would need to > call C/C++ stuff (like the RTL), but it shouldn't be directly exposed to > the user unless they request it.
The idea is good 'in theory' .. but lacks detail, which is where the problem lies. Abstractions just don't "layer" as we might like. They're related by recursion. For example: STL vector modelled in Felix works for C++ data types but not Felix ones which contain Felix pointers. But if you replace STL vector, then you can't handle user algorithms and data types which already do use STL vector. Copying one to the other (type conversion) isn't a solution in a language with mutable store. Aliasing would be a solution but requires isomorphism at the representation level .. but that implies the Felix version cannot support Felix pointers, which is the original problem. One solution is to see that Felix pointers aren't base C++ data types, so we use a C++ vector of T, except when T is a Felix data type, in which case we use instead a vector of wrapper<T> for some type which mimics the semantics of T*, but which the collector can follow. I have actually implemented this wrapper, but never tested it. The problem is it uses a doubly linked list connected to the garbage collector, so the collector has an alternate way of reaching the T*, and also supporting in place deletion. The problem is clear: it requires 3x the storage of a pointer. One possible solution is to use a trie instead. This will break the Boehm collector. Also my own implementation has massive overheads. According to the claims Judy arrays solve this problem: they're very very fast and memory efficient.. but I can't penetrate the documentation, the author is unreachable, and the implementation very difficult. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Felix-language mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/felix-language
