14 ms·
Windows is the strangest, or hardest, operating system to keep curl support for
- nells 4y agoLol, the first answers are by “autinerd” and “ocdtrekkie”. Mastodon is really something else.
- nextstep 4y agothose are also their handles on Twitter... https://twitter.com/autinerd https://twitter.com/autinerd https://twitter.com/ocdtrekkie https://twitter.com/ocdtrekkie I don't get it
- intelVISA 4y agoPerhaps the implication is that it's poor form to publicly announce you understand How Things Work so you should use a more neutral handle like SoyLord66 or DankM3mer - same reason nerdctl is a worse Docker.
- executesorder66 4y agoWho is publicly announcing that they understand How Things Work?
- intelVISA 4y agoThe nerd suffix is poor form was my vague point
- pjc50 4y agohttps://news.ycombinator.com/user?id=ocdtrekkie https://news.ycombinator.com/user?id=ocdtrekkie is also on here and a reasonably prolific poster.
- mschuster91 4y ago> Mastodon is really something else. My biggest gripe with Mastodon is just how bad their thread support is. With Twitter, it's easily noticeable which reply belongs to which chain, Mastodon just flattens everything.
- jurip 4y agoDepends on the client, I think. Toot! for iOS visualizes threads like this and at least it's pretty clear: https://apps.apple.com/fi/app/toot/id1229021451 https://apps.apple.com/fi/app/toot/id1229021451
- superkuh 4y agoMy biggest gripe is that it is just like twitter: there's no HTML page with text or images. There's only a javascript application to run. For twitter I could use a nitter mirror. For mastadon... I just close that tab because there's no way to avoid executing the javascript that I'm aware of. Does anyone know of a way? edit I found a way. You can use the JS api, like: https://mastodon.social/@bagder/109432034039353503 https://mastodon.social/@bagder/109432034039353503 becomes, https://mastodon.social/api/v1/statuses/109432034039353503 https://mastodon.social/api/v1/statuses/109432034039353503 which returns the post in json form. Readable without execution.
- mschuster91 4y agoWhat would I give for an API that returns HTML-formatted JSON for browsers... Rancher for example does that.
- anaisbetts 4y ago"Windows is so bad at being Linux compared to Linux! Why is it so bad at being the same as Linux?" Well, yeah. I sympathize with @bagder here trying to be cross-platform but Windows is just Different than POSIX, and if you try to write everything for Linux then "compatibility shim" your way to Windows support, you're gonna have a Bad Time
- izacus 4y agoYeah, I've spent a lot of my career supporting cross-platform software and pretty much all problematic cases were because POSIX fanboys wrote the software and then tried to shim themselves onto macOS and Windows while refusing to rethink their approach. A lot of issues disappeared when better abstractions were found on top of POSIX.
- screamingclay 4y agomacos is posix compliant though
- izacus 4y agoSo is Windows (certified even!), which is exactly my point. It's not a practical and useful abstraction. If anything, it's even more problematic, because Windows is "wierd" and people go out of their way to create special approaches to handle it. For macOS, too many developers think it's "just posix, ya know, like Linux" and then walk into horrible compatibility edge cases.
- tpush 4y ago> So is Windows (certified even!), which is exactly my point. AFAIK, only the versions of Windows that included the POSIX subsystem were certified, the last one being NT 4.0. Long time ago.
- mort96 4y ago> POSIX fanbois That's a weird and derogatory way to talk about people who appreciate having a standard which makes it easier to write cross-platform software. EDIT: To expand on this comment and make it more productive. You're right. If the goal is to have first-class support for both Windows and POSIX-like platforms, the right approach is to have an understanding of what your software needs to do, what the POSIX APIs make easy, and what the Windows APIs make easy, and build abstractions which make sense based on that. But man, do I appreciate that if first-class Windows support isn't top priority, I can support essentially every other widely used platform in the world (including macOS) by just writing against the POSIX API, and I can even get okay-ish Windows support by using a POSIX compatibility layer on Windows. So my point isn't, "People who want to have first-class Windows support but do so through POSIX compatibility shims are doing it right".
- justahuman74 4y agoI'm just surprised windows (non-WSL) is actually supported
- intelVISA 4y agowinsock2 is basically the Berkeley socket API as well, so why wouldn't it be?
- sumtechguy 4y agoHaving used both. It is close in that the api looks similar. But has a lot of interesting edge cases. Usually around error codes. One thing you learn quickly is win32 != bsd != linux. Each one has their own set of quirks and issues.
- tssva 4y agoCurl has been part of the base install of Windows 10/11 since the December 2017 preview release. Bsdtar was added at the same time.
- moffkalast 4y agoTar, on Windows? What heresy is this. /s
- jetbalsa 4y agois it /real/ curl? Curl in cmd.exe is real curl, but in powershell that thing gets mapped to Invoke-Webrequest
- tssva 4y agocurl in Windows Powershell is by default mapped to Invoke-Webrequest but it is not in powershell which you download or install via the store. I long ago removed the alias for curl in Windows Powershell too.
- goranmoomin 4y agoHonesty this just seems that we’ve lost a lot of operating systems except for POSIX and NT. Imagine a libcurl for a SmallTalk machine… or a custom RTOS without any POSIX comapt layer; I’d bet Windows will seem easy compared to one. In fact, maybe the fact that a Windows port of libcurl can exist at all means that the Windows BSD socket implementation is useful enough to allow these sort of things.
- pavlov 4y agoSymbian was the last weird built-from-scratch OS that shipped a massive amount of units (over 100M in 2010). In its last years it got a POSIX compatibility layer. Before that it was hard to even use C strings — which I presume was considered a feature by the Symbian API designers, but unfortunately they made their design choices in the mid-1990s using a subset of C++ that didn’t age well at all.
- leoetlino 4y agoFWIW Nintendo's Horizon OS is also built from scratch (and isn't Unix at all), and has also shipped on a massive amount of units (over 110M as of 2022). (and it happens to have a libcurl port)
- pavlov 4y agoFair point, but it's not an open platform, so not a lot of developers will encounter it. Symbian was open in the same sense as Windows or macOS.
- Brian_K_White 4y agoBut the point is that crazy thing was not what the developer said was the hardest to deal with. Doesn't matter much that it's closed or not many developers see it, he does.
- nine_k 4y agoI think QNX still ships in large quantities, just not on devices consumers see as "computers". It has a POSIX layer though.
- api 4y agoAfter porting ZeroTier to Windows years ago I then had to merge some helpful person’s pull request to remove a lot of profanity that didn’t look professional. I discovered things about the Windows driver, installer, and networking subsystems and APIs that are best described by pinhead from Hellraiser: “I have such sights to show you.” No other OS comes close. Definitely not the fruit company one or even commercial Unix (yes Solaris and AIX still live). Most Linux package management is a tire fire but the OS is pretty nice. I blame backward compatibility coupled with what seems to have been a series of fits of overengineering that now must be carried along as boat anchors.
- hwpky 4y agoThis might be my favourite comment yet on hn :)
- _8j50 4y agoThis is because a) windows is truly general purpose, anyone from your old grandma to a corporate scientist is the audience b) It is an emergent system, it was pieced together after supporting many features over decades to meet a wide range of needs. In other words, it wasn't architected to meet the needs of a specific subset of users. Like with MacOS it is the graphic designers and consumers that want a simple pc (wasn't alwayd corporate friendly, still isn't compared to windows) and nix, I hardly need to describe that on HN. You must remember, Windows was at its core made for the PC! Which meant random manufacturers get to shove it on their PC and random devs get to write code on it and it was closed source. This meant a lot of apis and the burden of supporting them long term. It was made in the era whe se purchased software in CDs. The more I learn the internals of windows (it's a hybrid kernel but I mean the stuff close to the kernel not userspace) the more I am finding our a lot of fascinating design decisions that others can learn from. But even in user space, COM and WMI alone would be amazing to have on nix (I think KDE sort of tries for COM). But from curl's perspective I can see why he'd be frustrated but I truly wonder what the problems are. If you use openssl and basically the same libs as on *nix, could it be the build systems and runtimes (Visual C++?)?
- theta_d 4y agoWindows was made in the floppy era, not CD era. I still remember picking up my release day copy of windows 95. It was on several floppies.
- _8j50 4y agoYou're right, I just don't have memory going back that far.
- qubex 4y agoAs a teenager I avidly read some Microsoft book on the impending Windows 95 release (I didn’t have the “Chicago Betas”. I remember reading that book cover to cover. I remember that it depicted checkboxes are rhomboid-shaped, which didn’t actually appear in the final release. I remember my excitement as I queued to get my upgrade edition of Windows 95 that I then installed onto my sluggish 486DX2-66. I miss those times.
- csmpltn 4y ago> "Windows is the strangest, or hardest, operating system to keep curl support for" Opening a socket and issuing a GET call is somehow too difficult on Windows? Will you entertain the possibility that CURL's architecture is to blame?
- dsr_ 4y agoIf all curl did was "opening a socket and issuing a GET" it would be about a hundred lines long, including input validation and two kinds of errors. It does a lot more than that, because the Internet isn't actually that simple. You should look at the first paragraph of https://curl.se https://curl.se rather than have me rehash it here.
- csmpltn 4y agoCURL supports plenty of protocols, but at the end of the day they're all application-layer and should've easily been written as platform-agnostic business logic. If CURL was architected properly, keeping any OS-specific code behind platform-agnostic interfaces - porting it across operating systems should not have been an issue. When the codebase depends on POSIX and platform-specific quirks everywhere, putting the blame on the operating system when it's time to port things is hilarious. I don't see posts like this from the people who had to port Portal 2 to run natively on Linux, as an example. If Portal 2 (a codebase you can safely assume is 1000x more complex) made it fine without the drama, there's no reason CURL can't follow suit (unless the architecture is botched).
- iwillbenice 4y ago
- npn 4y agoI wonder what part of "curl has to run on many versions of a single OS" is so hard to uderstand that people keep making dumb example like this. Porting a codebase to a specific target is way easier compare to porting it to multi version of the same target, especially the older ones.
- magicalhippo 4y agoAs a primarily dev who grew up on Windows and has just used curl for some basic stuff, wonder what's so hard. That is, on the face of it, curl seems like a quite basic application in the grand scheme of things. Would have been nice with some specific, juicy details. I've worked on a medium sized open-source project (~500kLOC) that was supported on Windows, Linux and MacOS, so I'm not unfamilar with cross-platform support. For us, MacOS was by far the weirdest of the bunch. One of the complaints was the path separators. We solved that by just consistently using / everywhere internal. Any supplied paths would get converted right away. Not really an issue to write home about IMHO.
- elzbardico 4y agoNot to mention that this can also be easily remedied with a macro or even a constant and an IFDEF
- user3939382 4y ago> curl seems like a quite basic application It's an HTTP client. Here's 1 of 7 HTTP RFCs https://www.rfc-editor.org/rfc/rfc7230 https://www.rfc-editor.org/rfc/rfc7230 There are bigger specs like for wifi where it's thousands of pages, but I don't think you can classify a client that implements even half of the HTTP specs as basic.
- phendrenad2 4y agoIn other words, curl attempts to fully implement the RFCs, which have many, many edge cases and weird features, so a seemingly simple application balloons into a massive undertaking.
- theandrewbailey 4y agocurl is way more than HTTP. > curl supports about 26 protocols. We say "about" because it depends on how you count and what you consider to be distinctly different protocols. https://everything.curl.dev/protocols/curl https://everything.curl.dev/protocols/curl
- magicalhippo 4y ago
- simula67 4y agoWhat is the best way to learn to write programs for Windows? For example, let's say 'I want to disable taskbar tab grouping programmatically', how would I know where to look?
- elzbardico 4y agoWindows Internals by Mark Russinovich. It is the bible of windows development.
- pionar 4y agoCan't upvote this enough. This really is the answer.
- Aachen 4y agoThat doesn't sound like a program so much as a registry key
- lzooz 4y agoThat's a user setting, if you change that from your program Raymond will get mad at you. But yes, it's a registry key. It will be a bit hard to make explorer.exe reread that registry key without restarting it, though, since it probably reads the key on startup and caches it.
- delta_p_delta_x 4y ago> What is the best way to learn to write programs for Windows? There are many ways to program Windows. If you want C or C++, you can use Win32[0] and COM[1]. Of course, the C and C++ standard libraries are also available, within ucrt.dll[2]. Not to mention additional libraries/frameworks like Direct3D, OpenGL, DirectSound, etc. For .NET, there's several options: - Windows Forms[3] - Windows Presentation Foundation (WPF)[4] - WinUI 3[5] (most recent, but lacking some features) Windows' command-line shell of choice is PowerShell[6], written in C#. There are two flavours, Windows PowerShell 5.1 (Windows-only, uses .NET Framework 4.8), and PowerShell Core (cross-platform, uses .NET 6+). > For example, let's say 'I want to disable taskbar tab grouping programmatically', how would I know where to look? There are registry keys and GPO policies[7] (you can use any of the above C/C++/C# APIs to read/write from the registry, but your program will need the appropriate permissions)> However, Windows really is best configured with the GUI (Settings app -> Personalisation -> Taskbar). [0]: https://learn.microsoft.com/en-us/windows/win32/ https://learn.microsoft.com/en-us/windows/win32/ [1]: https://learn.microsoft.com/en-us/windows/win32/com/component-object-model--com--portal https://learn.microsoft.com/en-us/windows/win32/com/componen... [2]: https://learn.microsoft.com/en-us/cpp/porting/upgrade-your-code-to-the-universal-crt?view=msvc-170 https://learn.microsoft.com/en-us/cpp/porting/upgrade-your-c... [3]: https://learn.microsoft.com/en-us/dotnet/desktop/winforms/overview/?view=netdesktop-6.0 https://learn.microsoft.com/en-us/dotnet/desktop/winforms/ov... [4]: https://learn.microsoft.com/en-us/dotnet/desktop/wpf/overview/?view=netdesktop-6.0&preserve-view=true https://learn.microsoft.com/en-us/dotnet/desktop/wpf/overvie... [5]: https://microsoft.github.io/microsoft-ui-xaml/ https://microsoft.github.io/microsoft-ui-xaml/ [6]: https://learn.microsoft.com/en-us/powershell/ https://learn.microsoft.com/en-us/powershell/ [7]: https://social.technet.microsoft.com/Forums/en-US/f08bc6bb-a5d8-4414-afd2-f33af009f49a/gpo-for-taskbar-quotcombine-taskbar-buttonsquot?forum=win10itprogeneral https://social.technet.microsoft.com/Forums/en-US/f08bc6bb-a...
- elzbardico 4y agoNT is different from Unix, it is heavily inspired by VMS, which was the anti-Unix of its time. The basic architectural metaphors are different, and the way you think about things is different. It is more architectured and more opinionated, which may look like over-engineering for some and a superbly coherent design for others. There are some pain points, of course, a lot of them related to the need to support code written for a completely different OS (MS-DOS + Windows non-nt), but overall, I think that the general architecture of NT is pretty neat, and I would dare say, beautiful in some places.
- AdamN 4y agoThis is really the New Jersey approach vs the MIT approach: https://www.jwz.org/doc/worse-is-better.html https://www.jwz.org/doc/worse-is-better.html
- ilyt 4y agoIt appears that author does not like HN as this redirects to https://cdn.jwz.org/images/2016/hn.png https://cdn.jwz.org/images/2016/hn.png Is that the same wanker that got in a hissy fit over distros including xscreensaver ?
- gpderetta 4y agoHe is indeed the same JWZ!
- teddyh 4y agoBetter link (from the actual author of the text, and without referrer tricks for links from HN): https://dreamsongs.com/RiseOfWorseIsBetter.html https://dreamsongs.com/RiseOfWorseIsBetter.html
- galangalalgol 4y agoOne thing I have trouble with in windows is debugging problems. If say I plug in a usb device and nothing happens, I know what logs to look at, and they are verbose and if I don't, I can search the internet and find five or six possible solutions depending on distro and age. In windows the search generally says "download this malware and it will solve your problem", "restore to a save point" or "grab your install media and start over". I would be surprised if there is a good way to do the same things, they just aren't discoverable. When the device manager and services.msc show all is well, but it clearly isn't, there doesn't seem to be much advice out there. Edit: I liked vms fine, I don't think this is inheritance from that, or even dos. I knew how to debug in dos, using debug.com even. I think it has something to do with the lack of expectations for a user to be able to debug a problem. Osx has abit of this, but sitting on a bsd saves it to some extent.
- halpmeh 4y agoA lot of comments here aren’t acknowledging the actual complaint, which is: > everything from path separators, stupid shells, charsets, to not excepting non-sockets in select, no std libc, ownershipd of memory passed to DLLs, ... Not having a standard-compliant libc seems really annoying. Also, curl is an IO heavy library. Not having select work as it does on other platforms or not having libc work as expected is going to be really annoying.
- cesarb 4y ago> Not having a standard-compliant libc seems really annoying. Also, curl is an IO heavy library. Emphasis on library, curl is not just a command line tool. Calling a library compiled with one version of libc (actually msvcrXX.dll) from a program or library compiled with a different version of libc (for instance, msvcr71.dll vs msvcr81.dll) means things like file descriptors (not just FILE structs, but also numeric file descriptors) aren't shared between them.
- Joker_vD 4y agoYes, and if you link against something compiled with cc3290.dll (or whatever Borland's C runtime was called) you too will have bad time unless you structure your library with explicit understanding that there may be any number of C runtimes inside one process, including zero. Expose CreateX()/FreeX() from your library or arrange that the process would on start up pass to your library a table of allocation/deallocation functions to use and use those.
- kuroguro 4y agoEh, just link everything against the "old" "unsupported" msvcrt.dll that comes with the system and Bob's your uncle! /s
- CodesInChaos 4y agoNowadays there is the Universal C Runtime you could link against. It's available on Windows 10 out of the box, and via Windows Update or redistributable on Windows Vista/7/8.1.
- sidlls 4y agoAt one point when I was in academia I had to write drivers for Windows to control some scientific equipment for our experiments. I remember it being a damn nightmare compared to even the VAX we had (which, granted, was basically just a toy we had in the lab, and didn't do much serious with).
- adzm 4y agoOne of the most frustrating thing with Windows is the UTF16/UCS2/etc wide chars needed everywhere with their APIs. UTF8 is so much nicer to deal with in almost every situation. Things are starting to get better on that end but it's still behind compatibility flags that third party libraries may not handle properly anyway. It's probably a minor annoyance, but seems entirely unnecessary now that you may need more than one wchar to encode a character anyway.
- jetbalsa 4y agoI bet that came down as strings coming from the filesystem, or user for that matter might be in a language that requires UTF16 to properly be used.
- pjc50 4y agoIt came about because Microsoft deployed what they called "unicode" before UTF-8 was standardized. In Microsoft-land "Unicode" means UTF-16. This isn't great but it's also baked into all the APIs.
- account42 4y agoThey could always use WTF-8 for the filesystem APIs which can encode all WTF-16 strings (i.e. the encoding that Windows actually uses).
- cshokie 4y agoIn a lot of ways Windows predates that being an option. This blog post has more of the history on that: https://devblogs.microsoft.com/oldnewthing/20190830-00/?p=102823 https://devblogs.microsoft.com/oldnewthing/20190830-00/?p=10...
- yuuta 4y agoNT and Unix are completely different OS. You cannot develop Windows programs the Unix way, and vice versa.
- rkagerer 4y agoIs this just a rant or did I miss further content that gives examples of the "many custom, special, weird and quirky ways that require special-case solutions in the code"? As a long time Windows developer I know of several, but am genuinely interested in hearing about more from the perspective of someone who's been "in the trenches" of several OS's. eg: - What does Windows get right? - What's it get miserably wrong? - Is the trouble that all the other OS's are more POSIX-like and this is the odd one out?