The Felix library needs to be cleaned up more, and particularly
needs more I/O stuff.
Seems there are 4 kinds of code:
1. Completely platform independent code
this MAY include bindings to C libraries which hide the platform
dependence, for example FILE* IO
2. Code for particular platforms, eg unix file i/o using int handles.
Generally this code is actually platform independent. for example:
module Unix { type file_handle = "int";
gen read: int * int * charp = "read($1, $2, $3)";
...
This code will Felix compile on all platforms.. it just won't C++ compile
on Windows.
3. Code which covers up the platform dependencies with wrappers
for this code the usage is platform independent but the implementation
is platform dependent.
For example, a read() function which uses either Unix or Windows
read operation: ideally defined entirely in Felix, but using Felix
conditional compilation to chose which implementation to
provide. In turn, the Felix constant expression driving the chose
is set in a configuration file by the build system.
There's a better way I think: to use the package manage flx_pkgconf
at source time to choose the implementation.. but that's another story.
4 Code which is platform independent but which depends on class 3
platform dependent code.
in theory, types 1 and 4 only need to be tested on one platform,
whereas 2 and 3 require a specific platform. In practice this assertion
is true only if the interfaces or class 3 dependencies are suitable:
actual use may show that the design which works on say Unix
won't on Windows.
A good example of the complexity of the breakup is found in FAIO.
Well now, the question is: how to organise the library?
Should unix file io modules go in 'std' or 'plat'?
Should we have perhaps that stuff in the top level of
plat must be class 3 code, which uses the stuff
in plat/linux, plat/posix, plat/osx, plat/windows etc etc
in its implementation..
What do we do about the weird overlap between platforms?
Heck, functions like "stat" vary between versions of the same platform.. :)
--
john skaller
[email protected]
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language