11 ms·
You may want to take a second impression. - OpenGL should be a library. This is just going to make OpenGL development easier in the long run. Right now there a
by klodolph 8y ago
You may want to take a second impression.
- OpenGL should be a library. This is just going to make OpenGL development easier in the long run. Right now there are too many OpenGL implementations and the differences matter. Running one OpenGL library on top of N different Vulkan implementations is miles better than running on top of N different OpenGL implementations.
- POSIX can be a library too. It doesn’t have to be provided by the kernel. People have been strapping POSIX layers on top of things for ages. This was originally how Mach worked. You can still do weird things on iOS and macOS “below” the POSIX layer (although most POSIX syscalls are just provided by the kernel).
You talk about how hard it is to change APIs… and how much you hate to refactor things every time Google decides they want the shiny new thing. But POSIX is rooted in the 1970s. It sucks. It’s about time to try something new. The entire POSIX model is based around the idea that you have different people using the same computer and you don’t want them to accidentally delete each others’ files. There are a ton of APIs in POSIX which are straight-up shit, like wait(). Sandboxes are unportable and strapped-on, using arcane combinations of things like chroot and cgroups.
Let’s give people a chance to try out something new. Unix is somewhere around 50 years old now. OS research is dying out. Make it easier to run untrusted programs.
- stdcli 8y ago"OS research is dying out" - this I was learning about kernel dev around the same time as trying to understand how conditional execution and speculative execution worked as a result of really trying to understand every step that happens when a system call hands something to the kernel and the kernel does something with it and hands it back to the system. I kept asking but alot of supposed linux nerds I spoke with couldn't tell me how the kernel and user space truly handed off data or negociated memory with eachother, leaving me drawing out trap handling routines on a posterboard penciling in gdb dissassembles of memory for system call source code, feeling dumb for not knowing, meanwhile we all find out about Spectre and Meltdown and that really there is not a secure handoff without significant performance degradation and/or increased sandboxing for things like the browser, etc. And of course what is the root of the issue here? The root of the issue is that linux is too deeply integrated into monopolized hardware architectures, which is perhaps why AMD's stock price skyrocketed the day Spectre and Meltdown came out, when we found out the only mitigation for this legendary security vuln in the near future, will cost a 30% reduction in performance across the board with intel as opposed to much less with AMD given the AMD architecture was less prone to exploiting the vulnerabilties around speculative execution. The more I learned about these things plus issues with other basic functions like wait() ot strcpy() or in general the lack of protections around C, the more I entertained the idea of looking for alternative operating systems. The networking stack in Fuschia is written in Go for example. While I don't know much about Go, can it be worse than C when it comes leaving it up to almost every developer to take care of their own garbage collection and what the performance and security implications of this are? Magenta is designed to be modular enough in nature to withstand the waves of hardware architectural evolution coming and given we are approaching 5nm development (the theoretical limit of how small a transistor gate can be before we can no longer control interactions/flipping a transistor switch due to quantum interaction), and this is not far off, Intel already has 10nm in production and probably others now as well (its been a bit since I checked) then to quantum computing: Because quantum computing (this is debatable and I know the least about this) is not ready for mass production, particularly on the mobile scale, my conjecture is once we reach the theoretical limit of how small a transistor will be, designs will turn to optimizing for performance in every other way we can without relying on powerful processors to accomodate for memory bloat or endless dependencies (yes I also pray this requires javascript modules to be better or die out but thats a long range dream). Meanwhile AMD gains ground post spectre and meltdown. So, in summary, there are alot of other options to consider than just optimizing for POSIX forever. Therefore, I am glad there is a push to explore alternatives. I feel as though anyone who thinks it's not potentially beneficial to explore POSIX alternatives based distros does not work with Unix based systems in any kind of depth on a daily basis, but if someone does, and you think Linux for example, is the best operating system in the world and can't be improved upon outside of its defining protocols, then I would love to hear from you on this thread. I am not nearly as experienced as most people who work with Linux, but I can say that most I have interacted with it view it as a love hate relationship for many of these very reasons. You can also see this trend of unhappiness with Linux OS defaults out in the wild outside of google. More and More and serious applications are looking to bypass userspace application development to be either more secure, customize, most often for the purpose of if not security, to optimize performance for the things we use to consider the std linux kernel somewhat good at. Here are few varied examples I can think of off the top of my head anecdotally when trying to solve everyday problems for users with linux, but I am sure there are many more: 1. Dropbox bandaid attempts to customise network schedulers usually handled in kernelspace due to performance issues: https://blogs.dropbox.com/tech/2018/03/meet-bandaid-the-dropbox-service-proxy/ https://blogs.dropbox.com/tech/2018/03/meet-bandaid-the-drop... 2. Wiregaurd is an example of a VPN where communication negociation is handled more and more in the kernel, because traditional vpn designs have left TLS handoffs in userspace (what is the point of userspace anymore for serious application development when this is the trending security default): https://www.wireguard.com/ https://www.wireguard.com/ 3. Sysdig implements epf functionality to allow for sysadmins and devops engineers to customise and or secure in ways we don't trust or consider the default linux operating systems userspace/kernel space design to do anymore: https://dig.sysdig.com/c/pf-blog-introducing-sysdig-ebpf https://dig.sysdig.com/c/pf-blog-introducing-sysdig-ebpf
- pjmlp 8y ago> The more I learned about these things plus issues with other basic functions like wait() ot strcpy() or in general the lack of protections around C, the more I entertained the idea of looking for alternative operating systems. Dig into the worlds of Burroughs B5500 (now Unisys ClearPath), IBM OS/360 (now IBM z), IBM OS/400 (now IBM i), and the now gone Mesa/Cedar, Oberon, Active Oberon, SPIN OS, Topaz OS, Mac OS/Lisa, Singularity, Midori, Inferno, ...
- stdcli 8y agoand yet you are still alive and not starving to death. But the banter I see on here is android video game developers complaining that a move away from android will be the end of them. Google is not stupid, they are not going to deprecate android overnight and replace it with Fuschia, this operating system has been in the works open source, you can see the commits on github for atleast two years I think more, and there will clearly be many iterations of its development to come with increasing adoption each time as people make money on the platform, just like with Android which took years before it reached the threshold of 50% use compared to iphones and no iphone video games developers that I know of starved to death trying to adapt to this change. The drama on this thread about api changes are significant for sure and I understand Google redacts API's or suddenly starts charging for them in a way that makes small companies close up shop overnight (like google maps for example) but it is not a justification to pretend that objective limitations around Moore's Law and the need for competition in computer hardware is forcing companies who have experience in both spaces to reconsider kernel development at a more fundamental scale.
- pjmlp 8y agoAndroid is being ported to run on top of Fuchsia.
- stdcli 8y agowhich is why I'm confused about all of the top ranking comments complaining that android will change their API for this. Will this require a change for android app developers if this is the case? Regardless, this seems like a more fundamental layer of improvement.
- Svoka 8y agoI agree with you, but I do not believe in Google. Google provided worst commercial platform I ever had experience developing for. I had a lot of different platforms in my past - pretty much all consoles, desktop and fringe, like smart TVs or various smartphones released since 99'. Only Google changes rules of the game on developer. They do not realize that they are make •a platform•, not a product. Stable, comfortable platform that software runs on. I honestly don't give two cents about all their struggles to make "a better OS". OS is to launch apps, and making those apps is a miserable experience, where I have full time people just to keep up with Google 'improvements'. Somehow every other platform is fine. I hardly had to change code written 10 years ago for iOS, for consoles or Windows - not at all! But Google keeps making their own special PhD driven darlings.
- hortense 8y agoIt will increase stability in a very important way because they apparently want stability of drivers, which Linux does not offer.
- yc12340 8y ago> they apparently want stability of drivers Strangely, the only Android drivers, that can be trivially ported between Android version, are those "unstable" bits in Linux kernel. Take any postmarket smartphone firmware — if something does not work after porting to new Android version, you can bet, that it is a proprietary userspace blob. Who develops HAL for those blobs? — Google. Who controls it's API? — Google. What "stability of drivers" are we talking about here? Certainly not the kind, helpful to users.
- ebg13 8y ago> Strangely, the only Android drivers, that can be trivially ported between Android version, are those "unstable" bits in Linux kernel. That's only because the Linux kernel is actively hostile to the idea of maintaining a stable driver interface. Windows 7 drivers from 10 years ago still work in Windows 10.
- 8y ago
- Svoka 8y agoJust to summarize my comment: I agree with you. I realize that eventually* having POSIX/Graphics/... APIs as a library would lead to better, more stable, less driver dependant platform. But I don't believe Google is interested in making better platform for developers, judging by my almost a decade of experience with ever-changing Android. *eventually is a big significance here. If I wouldn't have my APIs available on launch of FucOS, or like a clear roadmap to them in half a year, I would have to start my own projects to work around of that "eventually it would work" promise. Because "eventually" is not good enough.
- keeganpoppen 8y agoI've had the same experience, but I guess it's not cool to make comments based on your own experience on hackernews (and hence the downvotes).
- phkahler 8y ago>> I've had the same experience, but I guess it's not cool to make comments based on your own experience on hackernews (and hence the downvotes). Some people here think your own experience is just an anecdote. They're wrong of course. Ones own experience is a data point (or even a collection of them).
- shawnz 8y agoAs the saying goes "the plural of anecdote is not data". Unless you are collecting the anecdotes in a methodical way then it doesn't tell you anything, since you can't know what biases your data is affected by
- phkahler 8y agoI cured my X by doing Y. Is that an anecdote or a data point? What if 150 people tell you the same thing? Having done exactly that, I don't really care how anyone else classifies it, it is my reality.
- Crinus 8y ago> Running one OpenGL library on top of N different Vulkan implementations is miles better than running on top of N different OpenGL implementations. The issue with running OpenGL on top of Vulkan is that Vulkan's API exposes a very rigid and static view of the GPU and OpenGL is the exact opposite, allowing arbitrary state changes at any time. While actual GPUs are not as dynamic as OpenGL, they are also not as static as Vulkan so by implementing it on top of Vulkan you are forcing state changes that would not be necessary for the underlying GPU. Also OpenGL being a higher level API provides for more opportunities for optimization than Vulkan (a very common example would be display lists which thanks to their immutability and opaqueness can have a large number of optimizations applied to them - something that both Nvidia and AMD takes advantage of, especially Nvidia which performs very aggressive optimizations on them).
- pjmlp 8y agoGoogle will be doing it for Android Q, most likely due to all devs that still aren't bothered to wrestle with Vulkan.
- Crinus 8y agoI'm not saying it isn't possible, ANGLE is a thing after all, but possible doesn't mean optimal. Of course, given enough time, faster hardware will solve this.
- flohofwoe 8y agoAh well-written OpenGL "emulation" on top of a Vulkan driver is most likely faster than than a badly maintained native GL driver, and you'll only have to worry about the bugs present in the one GL implementation you're linking against, not a variety of bugs across different drivers and driver versions.
- Crinus 8y agoYes, the best scenario of the first case is better than the worst scenario of the second case, but personally i'm more interested on the best scenario of both cases - especially since we already have working OpenGL implementations that take advantage of how OpenGL is specified. I'd rather see a push to improve subpar implementations so they reach parity with the good implementations than throw all implementations out of the window because of the bad ones.
- pjmlp 8y ago> Right now there are too many OpenGL implementations and the differences matter. Vulkan is already going down the same path in spite of its youth. https://vulkan.gpuinfo.org/listextensions.php https://vulkan.gpuinfo.org/listextensions.php
- monocasa 8y agoThe extensions were always going to be in Vulkan. They embraced them even more than OpenGL, because you're not going to get around it. Hardware is just plain different from other hardware and PMs want a "value add". What Vulkan does differently is that you have to explicitly enable extensions, so you can't unknowingly be relying on an extension when trying to write cross platform code. This is all a good thing.
- pjmlp 8y agoYep, polluting the code with multiple execution paths is a good thing.
- monocasa 8y agoWhich code?
- pjmlp 8y agoGame engine code, where testing for each extension and reacting accordingly leads to several if(){ } else { }, or a vendor agnostic interface layer, making the total development cost hardly much different than supporting multiple 3D API flavours.
- monocasa 8y agoThe other option is waiting until all of the vendors have the ability that the extension provides and it has made it's way into the standard. That option hasn't been taken away from you. And unlike OpenGL, you can't unknowingly be relying on an extension since they're opt-in. So what's the problem again?
- phkahler 8y ago>> OpenGL should be a library. But it's not. Where is this OpenGL implementation that runs on Vulkan? I would argue that it should come as fully open source from Khronos group since they are the ones providing both standards. It's fine to create a new thing with a long term vision of what a better world looks like. But people won't follow if the pieces they need today are just a wish.
- messe 8y agoZink is an effort to write an OpenGL layer on top of Vulkan. Previous discussion: https://news.ycombinator.com/item?id=18356179 https://news.ycombinator.com/item?id=18356179
- Lorkki 8y agoBesides Zink, there is GL ES support on top of Vulkan through GLOVE[1] as well as Google's own ANGLE[2]. [1]: https://github.com/Think-Silicon/GLOVE https://github.com/Think-Silicon/GLOVE [2]: https://github.com/google/angle https://github.com/google/angle
- antirez 8y ago> POSIX can be a library too I've the feeling that POSIX is an API that makes many assumptions about how things internally are implemented in the kernel. So POSIX as a library is often limited or inefficient.
- natermer 8y agoI doubt anybody really writes 'POSIX' anymore, if that helps. What they do, more typically, is 'Write Linux software'. If they care about POSIX they will try to ignore features they don't think was mentioned in some POSIX manual from 20 years ago. It's all very hand-wavy. This is why you see the major operating systems advertise Linux software compatibility rather then paying for POSIX certifications. AIX, Solaris, Windows, etc. Sure it's not a official standard, but it's going to be pretty well defined because you can just model your compatibility on WWLD. If push comes to shove then Fuchsia could just add some variation of 'usermode linux' as one of those userspace kernel services.
- antirez 8y agoActually most system software today is POSIX, with some very rare #ifdef to leverage Linux-specific syscalls.
- seisvelas 8y ago>Sandboxes are unportable and strapped-on I contribute to an open source project called Torsocks, which is part of the Tor Project, and this comment really resonated with me. Creating a syscall sandbox that works across even a few, generally similar POSIX-compliant OS's is ridiculous. FreeBSD and MacOS for example have a very similar system interface. But sandboxing on FreeBSD is via pledge, and MacOS uses the App Sandbox. Linux uses seccomp. It's a mess.
- radist02 8y agoFreeBSD uses Capsicum, OpenBSD uses pledge.
- bogomipz 8y ago>"There are a ton of APIs in POSIX which are straight-up shit, like wait()" Could you or someone else elaborate on what is so loathsome about the wait() system call?