1<!DOCTYPE html> 2<html lang="en"> 3<head> 4<meta charset="utf-8"/> 5<meta name="copyright" content="Philosophy behind winlibs.com"/> 6<meta name="description" content="WinLibs design philosophy."/> 7<meta name="keywords" content="winlibs,winlibs.com,philosophy,design,decisions,development,architecture"/> 8<meta name="robots" content="index,follow"/> 9<meta name="DC.Creator.PersonalName" content="Brecht Sanders"> 10<meta name="DC.Title" content="WinLibs philosophy"> 11<meta name="DC.Format" content="text/html"> 12<meta name="DC.Language" content="en"> 13<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css"> 14<title>WinLibs design philosophy</title> 15<!-- Google tag (gtag.js) -->
vendor: 64 bytes, lines 15-16
15 16<script async src="https://www.googletagmanager.com/gtag/js?id=
16G-5ZV60QG955
vendor: 12 bytes, line 16
16"></script>
17<script> 18
vendor: 134 bytes, lines 18-22
18window.dataLayer = window.dataLayer || []; 19 function gtag(){dataLayer.push(arguments);} 20 gtag('js', new Date()); 21 22 gtag('config', '
22G-5ZV60QG955
vendor: 4 bytes, line 22
22');
23</script>
23 24<!-- --> 25</head> 26<body> 27 28<h1>WinLibs design philosophy</h1> 29 30<p>Winlibs aims to become a development ecosystem for Microsoft Windows developers, that addesses a number of issues by adhering to a set of design decisions.<br/></p> 31 32<h3>Target Windows</h3> 33 34<p>The goal of <a href="http://winlibs.com/">winlibs.com</a> is to provide a collection of tools and libraries targetting native Microsoft Windows to be used on Microsoft Windows.<br/></p> 35<p>It is possible to use MinGW-w64 on other platforms (like Linux for example) to build Windows software - a practice known as cross-compilation.<br/> 36However this is not easy for a novice user, especially if this user is more at home in a Microsoft Windows environment and maybe not even familiar with a command line environment.<br/> 37That is why the focus of <a href="http://winlibs.com/">winlibs.com</a> is entirely Windows. No knowledge of other operating systems should be required. And if an IDE is used no knowledge of command line should be required either.<br/> 38</p> 39 40<h3>Improve software portability</h3> 41 42<p>While focussing on Windows, most of the tools and libraries used come from the Linux and Unix-like world.<br/> 43Since the same tools are shared (for example the GNU Compiler Collection) it is easier to write software that also runs on other operating systems (like Linux or macOS).<br/> 44And on the other hand, if code exists on other platforms it may be easier to port them to Windows. 45</p> 46 47<h3>Selected tools</h3> 48 49<h4>Compiler</h4> 50 51<p>In the past there have been several open source solutions to build software for Windows:</p> 52<ul> 53<li><a href="https://www.cygwin.com/">Cygwin</a> - Emulates POSIX API, allowing compilation of sources coming from the Linux/Unix world.<br>However this emulation layer has its performance impact and it also means the generated binaries are not <i>native</i> Windows.</li> 54<li><a href="http://www.mingw.org/">MinGW</a> - Short for "Minimalist GNU for Windows", generates native Windows binaries, but doesn't support newer Windows features and doesn't support Windows 64-bit.</li> 55<li><a href="http://mingw-w64.org/">MinGW-w64</a> - Mingw-w64 is an advancement of the original mingw.org project, created to support the GCC compiler on Windows systems. It has forked it in 2007 in order to provide support for 64 bits and new APIs.</li> 56</ul> 57 58<p>The compiler tools provided by <a href="http://winlibs.com/">winlibs.com</a> are based on <a href="http://mingw-w64.org/">MinGW-w64</a> primarily in combination with the <a href="https://gcc.gnu.org/">GNU Compiler Collection</a>, but other build software has been added like <a href="https://llvm.org/">LLVM</a>/<a href="http://clang.llvm.org/">Clang</a> and various assemblers.<br/> 59</p> 60 61<h4>Shell</h4> 62 63<p> 64As a lot of open source software was originally not intended for Windows, a Linux/Unix like shell is often needed to be able to build this software (for example when <a href="https://www.gnu.org/software/autoconf/">Autotools</a> are used):<br/> 65</p> 66<ul> 67<li><a href="https://www.cygwin.com/">Cygwin</a> - Comes with a Bash shell, but comes with its emulation layer performance overhead.</li> 68<li><a href="http://www.mingw.org/wiki/MSYS">MSYS</a> - Bash shell environment built using <a href="https://www.cygwin.com/">Cygwin</a>, also slow.</li> 69<li><a href="https://www.msys2.org/">MSYS2</a> - Rewrite of MSYS built using <a href="https://www.cygwin.com/">Cygwin</a> and <a href="http://mingw-w64.org/">MinGW-w64</a>, which is a lot faster than <a href="http://www.mingw.org/wiki/MSYS">MSYS</a> or <a href="https://www.cygwin.com/">Cygwin</a>.</li> 70</ul> 71 72<p><a href="https://www.msys2.org/">MSYS2</a> comes with a package manager that also allows installation of its own builds of <a href="http://mingw-w64.org/">MinGW-w64</a> and <a href="https://gcc.gnu.org/">GNU Compiler Collection</a>, however these will not be used as they do not always follow the same principles as <a href="http://winlibs.com/">winlibs.com</a>.<br/> 73</p> 74 75<h3>Threading model</h3> 76 77<p>MinGW-w64 can be built with 2 different multithreading models:</p> 78<ul> 79<li>win32 - Standard Windows multithreading features, without C++11 multithreading features.</li> 80<li>posix - POSIX threads compatible implementation (makes libgcc depend on libwinpthreads), includes C++11/C11 multithreading features.</li> 81</ul> 82 83<p>To maximize compatibility and portability the posix threading model was chosen. Applications can still use Win32 API or pthreads API.<br/> 84</p> 85 86<h3>No mixing</h3> 87 88<p>Certain things should not be mixed together, as they often lead to problems:<br/> 89</p> 90<ul> 91<li>Separation of 32-bit and 64-bit Windows - A lot of people struggle with linking their software because they are - sometimes by accident - mixing 32-bit and 64-bit Windows libraries.<br/>To avoid such mixups the two platforms are separated completely. For example a 64-bit c
91ompiler that generates 32-bit output is not provided.</li> 92<li>All libraries are built with with the same compiler - No libraries will be used that are downloaded elsewhere in binary form or compiled with another compiler (like for example <a href="https://visualstudio.microsoft.com/">MSVC</a>).</li> 93<li>Exception handling methods should not be mixed. Available exception handling method depends on platform (Windows 32-bit or Windows 64-bit). 94 <ul> 95 <li>DW2 (DWARF-2) - requires the use of DWARF-2 (or DWARF-3) debugging information and can cause executables to be slightly bloated because large call stack unwinding tables have to be included in the executables</li> 96 <li>SJLJ (setjmp/longjmp) - slower than DW2 (penalising even normal execution when no exceptions are thrown), but can work across code that has not been compiled with GCC or that does not have call-stack unwinding information</li> 97 <li>SEH (Structured Exception Handling) - native Windows exception handling mechanism, not supported yet by GCC for Windows 32-bit</li> 98 </ul> 99 After extensive debates (see: issues <a href="https://github.com/brechtsanders/winlibs_mingw/issues/4">#4</a> and <a href="https://github.com/brechtsanders/winlibs_mingw/issues/20">#20</a>) and careful deliberation the following exception handling methods have been selected: 100 <ul> 101 <li>Windows 32-bit: DW2 (DWARF-2)</li> 102 <li>Windows 64-bit: SEH (Structured Exception Handling)</li> 103 </ul> 104</li> 105</ul> 106 107<h3>Coexistence</h3> 108 109<p>The <a href="http://winlibs.com/">winlibs.com</a> ecosystem does not have a Windows installer, so it doesn't need administrator rights to be installed and it does not modify the system (for example by writing to the Windows registry or changing the <span class="code">PATH</span> environment variable).<br/>Simply extracting the standalone package is enough to get started.<br/>You can even put it on a removable drive (like a USB-stick).<br/> 110</p> 111 112<p>Multiple <a href="http://winlibs.com/">winlibs.com</a> toolchains can exist on the same system in different folders (for example 32-bit and 64-bit or even different release versions).<br/> 113</p> 114 115<p>Since the system is not modified other installed build environments won't break (like for example <a href="https://visualstudio.microsoft.com/">MSVC</a>).<br/> 116</p> 117 118<p>This makes it easy to try out. To remove, simply delete the folder.<br/> 119</p> 120 121<h3>Don't reinvent the wheel</h3> 122 123<p>We live in a reality of open source and knowledge sharing.<br/> 124A lot of the time it is not necessary to reinvent things. Sometimes the thing you need is already available. Why reinvent it if it has already been made? Chances are the existing solution is already more mature and has already solved issues you haven't even encountered or thought of.<br/> 125This is why <a href="http://winlibs.com/">winlibs.com</a> plans to offer a large collection of libraries for Windows, many of which were ported from other platforms like Linux.<br/> 126But also the tools provided by <a href="http://winlibs.com/">winlibs.com</a>, like the MinGW-w64 and the GNU Compiler Collection, use the same libraries.<br/> 127</p> 128 129<h3>Eat your own dogfood</h3> 130The phrase "<a href="https://en.wikipedia.org/wiki/Eating_your_own_dog_food">eat your own dogfood</a>" refers to using your own product.<br/> 131Everything in the <a href="http://winlibs.com/">winlibs.com</a> ecosystem is built with components from the same ecosystem.<br/> 132For example: each release of the personal build of MinGW-w64 and the GNU Compiler Collection is build with itself.<br/> 133 134<h3>Support winlibs.com</h3> 135 136<p> 137If you like this project and would like to support it please consider donating.</p> 138<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> 139<input type="hidden" name="cmd" value="_s-xclick" /> 140<input type="hidden" name="hosted_button_id" value="JMZTFBPNUFHAN" /> 141<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" style="border: 0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" /> 142<img alt="" style="border: 0" src="https://www.paypal.com/en_BE/i/scr/pixel.gif" width="1" height="1" /> 143</form> 144 145</body> 146</html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.