10 ms·
Windows Code Samples
- p2t2p 10y agoI think we can call it 'click bait'
- tetrep 10y agoYeah I think "Windows Application Samples" or "Windows API Samples" would be more accurate.
- kirillkh 10y agoToo bad the WSL (Windows Subsystem for Linux) is not open source. It is already an impressive piece of software, but many features are still lacking (e.g., neither Valgrind nor gperftools work right now), and it could benefit greatly from community involvement. Fittingly, issue #1 in the WSL bug tracker is requesting it to be open-sourced: https://github.com/Microsoft/BashOnWindows/issues/1 https://github.com/Microsoft/BashOnWindows/issues/1
- 20161112 10y agoFor development, is WSL good enough to replace dual-boot?
- dustincoates 10y agoI've been using it for a couple months now for web development. There are still some quirks and bugs but I haven't had to move to dual-boot. I'm on the edge of doing so (see aforementioned quirks and bugs), but I've been rather happy with it so far.
- mrweasel 10y agoFor many people I think it's still the wrong way around. It's not the first solution to running Linux applications on Windows. The first I saw involved X-Win32 and a Linux server in the basement. It's just that most of these solutions get it wrong. It's not that people want Windows, and a little Unix. People want Unix/Linux, and a little Windows.
- danieldk 10y agoI think there is a large group of people that needs or want to develop on Linux (POSIX API, open source tools). But have difficulty getting their hardware running on Linux, need applications that are not available on Linux (Microsoft Office, Adobe suite), or simply want to run games as well without dual booting. I think this is a masterstroke by Microsoft, since it will give Windows the best of both worlds. Something that only OS X had so far. Of course, it's not for everyone. People might be morally opposed to proprietary software or want UNIX all the way down.
- CJefferson 10y agoI've been using this, and find it works well enough for me. I like a Linux/GNU terminal, but I prefer windows GUI to X, I find all laptops I have owned work better under windows than linux, I prefer outlook to mutt/thunderbird, and many of my games only run on windows. (Obviously, other people's opinion can be different!)
- kirillkh 10y agoDepends on your use case/tools/habits. WSL gives you the advantage of being able to access the same files with native Windows tools and from the GNU[1] command line. If you plan on using the X GUI tools, it will be much less useful to you. [1] I can't bring myself to use the term 'Linux' here, because, ironically, Linux is the primary missing part in this Ubuntu distribution. It should really be called WSG or WSU.
- swiley 10y agoAll of my friends on windows say X is just as easy to set up as on cygwin
- kirillkh 10y agoI never said X GUI apps could not be used, just that the more Windows tools you use, the more you gain more from WSL.
- danieldk 10y agoIf you plan on using the Linux GUI tools, it will be much less useful to you. If you install an X server, such as VcXsrv and set the DISPLAY variable (typically export DISPLAY=:0 will suffice), you can just run X11 apps. For instance, here's a screenshot of a Prolog/Tk application running on WSL: https://danieldk.eu/Posts/2017-01-10-Alpino-Windows/alpino-windows.png https://danieldk.eu/Posts/2017-01-10-Alpino-Windows/alpino-w... I have installed Windows on a workstation just to try WSL out and it's quite impressive. Many regular applications just work. I could build Ubuntu packages and upload them to my PPA (I just had to use fakeroot-tcp to replace fakeroot). Of course, there are also things that don't work for obvious reasons. E.g. because they require facilities deep in the kernel (performance counters/perf) or because they require kernel modules and hardware access (running CUDA programs).
- 20161112 10y agoSo if I want to use my GPU for machine learning applications, I would have to run my programs under Windows rather than from inside the WSL?
- sz4kerto 10y agoFor me not, because of the lack of Docker.
- dfcowell 10y agoI've configured the Docker client in WSL to talk to the Docker for Windows daemon. It's good enough for 90% of use cases.
- dethswatch 10y agowhy wouldn't you just use a vm rather than dual boot, these days?
- bostand 10y agoIt is significantly better than cygwin, but of course it doesn't beat real Linux.
- supernovae 10y agoYes, If you're comfy in Ubuntu land then the everything just works..
- jibsen 10y agoI don't have WSL available, but I would love some numbers for tasks like cloning a large repository with git and running cmake. These things tend to be slow on Windows due to fork, see for instance this comparison for Windows vs. Linux in a VM: https://gist.github.com/jibsen/7ebeddde3bc2bfd421b96ae53a824ad9 https://gist.github.com/jibsen/7ebeddde3bc2bfd421b96ae53a824...
- bobsgame 10y agoI really hope they open source the NT kernel, or at least part of it. This makes me really excited about the future of Windows!
- ealexhudson 10y agoIn all honesty, I wouldn't be that surprised if that happened at this stage - I don't know that they would have much to lose, but they'd potentially have an awful lot to gain.
- mrweasel 10y agoI suspect that large part of Windows, perhaps not the kernel, but many of the required subsystems, are written by 3rd. parties and licensing will prohibit an open source release of Windows.
- xorblurb 10y agoThere definitively are some third party components in Windows, but I believe in the core most is either written directly by MS or at least the copyrighted (or its handling) is transferred to them. Parts of an old NT kernel has already been published for a limited audience (mostly education and research, with some additional prereq and with the need of an explicit licence), so probably it can be done again.
- bostand 10y agoThe kernel is full of third party libs too.
- patrickaljord 10y agoThey still make money on every single pc/laptop that ships with windows which is still their biggest money maker with office. If they truely open source windows (BSD or else) it will be free to ship for OEM and Microsoft will lose one of their biggest source of income. tl;dr: not gonna happen
- 10y ago
- AJRF 10y agoFor one brief second, I really thought...
- interlocutor 10y agoHere's the problem: As a developer Electron (see http://electron.atom.io/ http://electron.atom.io/ ) is more attractive to me than Windows APIs. Take a look at the RSS Reader ( https://github.com/Microsoft/Windows-appsample-rssreader https://github.com/Microsoft/Windows-appsample-rssreader ). I can make a desktop app that is practically indistinguishable from this app using Electron, so why would I use Windows APIs? If I use Electron then my app will run on Mac and Linux, not just Windows, and my skills will be portable too. The Flat UI of Windows is a mistake. Because of Flat UI, there is no differentiation between Web apps and native Windows apps, which makes it possible--and even desirable--to make desktop apps using Web technologies.
- v0lta 10y agoWe had to redo an inhouse Electron app in WPF because we came to the point where we had to do some stuff within windows, e.g. printing or create a heavily customized MSI file. Both is possible with Electron but with the native Windows solution it's easier to fine-tune behavior. I think for UI and some web stuff Electron might really be superior. Especially if your team is already fluent with the web stack. But it has it's limits and if you reach them or have very specific requirements you might be better of with WPF or UWP apps and the initially higher effort of developing in C#/XAML might pay off. Saying this I believe the existence of Electron is a great possibility for UI devs.
- Longhanks 10y ago- Electron is big dependency, adding hundreds of MB to our app - Electron Apps haven't and won't ever 100% fit into the OS environment/theme, neither Windows, macOS, or any Linux desktop - Electron takes a long time to start up - Electron eats a big amount of memory - Electron uses a lot more battrey - Many APIs of the underlying OS are not avaiable to Electron, especially those not found on competing platforms So, allow me to say this: If web technologies are more attractive to you (which is completely fine), stick to the web. But don't create Desktop programs that waste ressources and time just for the sake of having "a true cross platform app".
- userbinator 10y ago
- erikbye 10y agoMost interesting thing MS has released the code for recently is perhaps the KMDF and UMDF. https://github.com/Microsoft/Windows-Driver-Frameworks https://github.com/Microsoft/Windows-Driver-Frameworks
- wilun 10y agoThis was previously in the WDK, I think, which was public (maybe only since a few versions, but nevertheless I believe at least even the Win7 WDK was public, so it has been a "few" years now...)
- erikbye 10y agoWDK != WDF source code. This release is ~200k LoC. WDK is just tools and code templates.
- deleted 10y ago[deleted]
- general_ai 10y agoHaving actually used UWP SDK for C++ fairly recently, I was left with the impression that it's a complete non-starter for most folks. It assumes too much skill on the part of the developer (i.e. "everything is asynchronous"), it uses a significantly extended superset of C++, and it inexplicably comes with _no_ libraries for such basic things as image processing, signal processing, linear algebra, etc -- stuff that Apple knocks out of the park. It's just basically WPF and very little else. Enough perhaps to write business apps, but way inadequate for anything outside this narrow niche. And because everything is async, and UI uses opaque data binding, the debugging experience tends to be a bit of a nightmare. I'm not sure what Microsoft was thinking, but Apple's approach to async (concurrent and serial queues in GCD) is an order of magnitude easier to understand, use, and debug, and OS X and iOS SDKs come with a ton more high quality features.
- bostand 10y agoI have no idea what your problems are, but I code UWP in C# which is the preferred language and its all fine and dandy here. (c++ .net is not real c++ anyway)
- general_ai 10y agoC# maybe. But C# is not suitable for what I do (fast deep learning on video, images, and audio). Any kind of managed language is hostile to those kinds of things and just plain not designed for them. I want to drop down to SIMD intrinsics and assembly when I need perf, and C# won't let me do so. But I think even folks with much more modest needs suffer with UWP. For instance, try to load an image from your hard drive (using UWP C++), resize it with Lanczos and get access to its pixels. The API is a fucking nightmare, there's no way to resize an image that I could find (unless you want to show it in the UI, in which case all is taken care of for you, but you can't get pixels from there). On macOS/iOS, it's just a few lines of rather plain looking code.
- pikzen 10y ago.Net offers reasonable SIMD access through the System.Numerics package. Roslyn offers writing plain IL Assembly, which is heavily used throughout SharpDX, and ultimately, P/Invoke is fast and allows you to call any C++ library you might want if you really want to get down to the metal. Seems a better alternative to me that having to deal with the hilariously bad C++ UWP API
- richev 10y agoFrom the footer on that page: "Windows maintained by Microsoft". Cute...