An editor has nominated this article for deletion.You are welcome to participate in the deletion discussion, which will decide whether or not to retain it.Feel free to improve the article, but do not remove this notice before the discussion is closed. For more information, see the guide to deletion.Find sources: "TnFOX" – news · newspapers · books · scholar · JSTOR%5B%5BWikipedia%3AArticles+for+deletion%2FTnFOX%5D%5DAFD
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) The topic of this article may not meet Wikipedia's notability guidelines for products and services. Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.Find sources: "TnFOX" – news · newspapers · books · scholar · JSTOR (November 2018) (Learn how and when to remove this template message) This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources. Find sources: "TnFOX" – news · newspapers · books · scholar · JSTOR (November 2018) (Learn how and when to remove this template message) (Learn how and when to remove this template message)
TnFOX portability toolkit
Developer(s)Niall Douglas
Final release
0.88.1[1] Edit this on Wikidata / 24 March 2010; 13 years ago (24 March 2010)
Written inC++, Python
Operating systemCross-platform
TypeDevelopment Library
LicenseGNU Lesser General Public License

The TnFOX portability toolkit is a fork of the FOX GUI toolkit with most of the added code implementing orthogonal features (i.e. not substantially changing the FOX API) such that applications developed for FOX can be easily recompiled for TnFOX. Unusually, TnFOX also contains API emulations of some Qt library classes - according to the author, this was done to port a substantial project from Qt to FOX. Most of the added features implement a full "portability toolkit" library such that one can write one program to run anywhere - this differs from FOX which mostly just provides the GUI portability alone. TnFOX is therefore an example of an operating system abstraction layer.

Unlike FOX, TnFOX supports only a restricted set of C++ compilers and operating systems. It only supports Microsoft's C++ compiler v7.1 and later, GCC v3.2 and later and Intel C++ compiler v8 or later. It also only runs on Windows 2000 or later, Linux 2.6 kernels or later, FreeBSD and Mac OS X 10.4 or later, though on any processor or architecture.

TnFOX contains its own automatically generated bindings for Python based on Boost.Python library - such were the complexity of these it required adding the -fvisibility feature to GCC v4 onwards.[2] However, the quality and state of these have languished in recent years.

The library is no longer maintained by its author, as of 2012.[3]

Substantial Features of TnFOX

One of the more original features of TnFOX is its heavy usage of C++ metaprogramming though this is entirely kept away from the GUI side of things (for FOX compatibility). A full lightweight metaprogramming toolkit is included which allows many of the operations provided by the Boost metaprogramming library, including typelists, type traits, compile-time logic, functors, virtual table compilation, horizontal type list instantiation and more. Unlike Boost, due to the requirement for a modern C++ compiler, all the metaprogramming operates consistently across compilers without the need for ugly macros.

Another unusual feature is the use of pervasive exception handling and safety whereby any line is assumed to always potentially throw an exception. TnFOX provides a C++ rollback mechanism (as originally proposed by Andrei Alexandrescu) to keep track of what operations need to be undone at any given stage should an error occur - rather like a SQL transaction. One problem with this approach is the possibility of nested exception throws during object destruction which under the ISO C++ standard requires an immediate program termination - TnFOX works around this problem via preprocessing of the source to add extra support code.

A quirky addition of the v0.88 release is to use Google Translate to convert its locale strings. While of dubious utility, especially for shorter strings, it nevertheless may save time during translations.

Unlike most portability toolkits, TnFOX has been very extensively profiled and performance tuned for maximum speed and minimal memory usage. It has strong multithreading support including tuning to avoid two threads writing to the same cache line (which causes cache line bouncing and greatly bottlenecks parallel throughput). It optionally uses its own thread caching memory allocator, automatically uses dynamic algorithms which will trade speed for memory usage according to memory low conditions and has very strong x86 and x64 specific optimisations including a metaprogramming implementation of SIMD vectors which will automatically compile down into SSE operations (right up to SSE4 support). It has its own assembler written fast mutex implementation, extensive internal caching to avoid syscalls to the kernel and its own inter-process communication framework which can transport arbitrary C++ object instances from one place to another by leveraging metaprogramming to automatically implement serialisation & deserialisation. This is particularly evident in its SQL database interface where one can simply bind an arbitrary C++ object instance to a BLOB field and no further code is required.

TnFOX optionally includes copies of the OpenSSL library and the SQLite library in order to implement its strong encryption and its default SQL database implementation respectively. It can be built modularly as a set of separate DLLs or monolithically. It also has full portable support for host operating system ACL security and knows how to protect sensitive data from entering the swap file, plus automatically shredding any deleted portions. It can access which user is running the process and how to escalate its privileges as necessary.

It has a no GUI build suitable as a portability toolkit for daemon and system processes. This has no X11/GDI dependencies.

TnFOX has already begun to add C++0x features for those compilers which support them - this being the next revision of the ISO C++ standard.

See also


  1. ^ "Release 0.88.1". 24 March 2010. Retrieved 23 July 2018.
  2. ^ ned Productions - GCC Symbol Visibility Patch
  3. ^ See March 2012 comment by Niall Douglas: There hasn't been much work on TnFOX in recent years ... Probably, and sadly, most of the 40,000+ lines of my own code in TnFOX will be left to bit rot.