13 ms·
Learning to Program with Haiku
- dddw 2y agoThere is so much love and attention to Haikus
- DeathArrow 2y agoThe tutorial is from 2010. At the time people were much more enthusiastic about Haiku and other alternative operating systems. Now we only have Windows and Unix like. I still wonder what would have happened had Jean-Louis Gassée been less greedy and Apple acquired BeOs instead of Next. I discovered BeOs in 2000 and it seemed to me much more interesting at that moment than either Windows or Linux. Not only it looked and felt better but it introduced other ideas and concepts. I had hopes it's adoption will increase but it soon withered and died. I still wonder why we can't do better than Unix and Windows. Unix is 50 years old and Windows is old, too. There should be better concepts out there waiting to be discovered and implemented. At some point there were many companies, universities, groups and individuals involved in researching and implementing operating systems. At that point I was following OsNews website daily and each day there were news about some new and exciting developments. Not anymore. I miss the days when I read about BeOS, Syllable, AROS, MorphOS, AtheOS, SkyOS, Plan 9, Inferno, Singularity. And there were a ton of interesting kernels, too.
- erremerre 2y agoI think the main issue is... hardware. There is a reason why I have 0 problems using linux on a raspberry PI, yet everytime I try to install in a real computer I got lying around I got a myriad of nosense problems which are particularly hard to solve. If we want a new OS we need to make it for certain platform which is always identical in terms of hardware. I would say a PS3, Steam Deck, or Nintendo Switch would be good candidates. They have plenty of identical hardware units in the market, and you could focus on the OS rather than supporting strange hardware issues. You missed my favourite from the list: ReactOS
- desdenova 2y agoDrivers are precisely the reason we only have Windows, Macos and Linux as viable options. Hardware manufacturers write Windows drivers, Linux community write drivers for basically all consumer hardware, and apple develops both the hardware and the OS with their own drivers.
- DeathArrow 2y ago>Drivers are precisely the reason we only have Windows, Macos and Linux as viable options That is one big issue and another one is software. Writing drivers and porting software means both time and money. How ever if a new OS would bring lots of benefits to both users and companies, it might tip the scale and make the time and money investment worthwhile. Of course, by a new OS I don't mean just another platform that ebables us to run software and use hardware, as existing OSes do that just fine. By a new operating system, I mean one that enables us to use new computing paradigm, enable new types of software to software and software to hardware interactions and would make a big disruption to the market. Something with the same kind of impact as AI or the introduction of smartphones.
- actionfromafar 2y agoEverything is so fluid nowadays. Even if use-case was found, someone would find a way to run Linux on it.
- whywhywhywhy 2y agoYeah but finding a way to run it is having a hobby of debugging software and work arounds on top of your job.
- flohofwoe 2y ago> I still wonder what would have happened had Jean-Louis Gassée been less greedy and Apple acquired BeOs instead of Next. Nothing different would have happened. You would have used C++ instead of Objective-C to write macOS UI programs, but other then that macOS would be in the same shitty state it as is today (assuming a wildly popular iPhone would also have happened in that alternative timeline and take the focus away from desktop UI development). One thing might probably be different: macOS might be less popular amongst developers because BeOS wasn't a UNIX clone (but 'Linux on the desktop' might actually be in a better state).
- b800h 2y agoYes, this - OS X wouldn't have become a near-ubiquitous developer desktop. That would have been very bad for Apple.
- graemep 2y agoReally? Most users I have come across are not developers. A high proportion of developers use it, but the proportion of users who are developrrs is quire low.
- cbzbc 2y agoI think you'd have got a much smaller eco-system of third party apps for MacOS (think omnigraffle etc). Whether that would have made a substantive difference I can't say.
- actionfromafar 2y agoDevelopers drive adoption (not least by creating software) and high specs.
- graemep 2y agoYes, but those developing for Apple OSes would have adopted whatever OS Apple used. The developer who pick it because it is a Unix are people who developer for Unix like OSes, mostly for servers, so they mostly do not produce software that drives adoption by people who are not developers.
- kitd 2y agoOS/2 was created by the biggest computer company in the world at the time, yet even it couldn't get enough traction. In the world of OSes, "the same as what everyone else is using" is much more important than "new takes on old concepts".
- piokoch 2y agoIt came a few years to early. I remember my shock when I get [1] my OS/2 copy and it was on 10 (yes, ten!) 3.5 inch Floppy Disk, while Windows needed two (one for main OS, one for some utilities). [1] This was 1987 still communistic Poland, so I bought a pirated copy on a famous Warsaw computer bazaar on Grzybowska street.
- sixothree 2y agoAgreed. Their timing was not right. But once Windows 95 hit, it was over. Also, the RAM requirements made it pretty much impossible for people to recommend to their friends and family. I really had a special fondness for OS/2. But using it today, it really is a quirky thing. Maybe if it had won I wouldn't be thinking that way.
- lproven 2y ago> Their timing was not right. I agree. https://www.theregister.com/2025/01/05/microsoft_os2_flop_future/ https://www.theregister.com/2025/01/05/microsoft_os2_flop_fu... I think OS/2 1.x should have targeted the 386, in the 1980s. > Also, the RAM requirements made it pretty much impossible for people to recommend to their friends and family. I bought OS/2 2.0 with my own cash, and ran it on several different 386SX machines in 4MB of RAM. It was usable on that spec. Any good spec of machine for Windows 3.0 could run OS/2 2.x usefully without being unpleasant.
- lproven 2y agoI don't think you are remembering correctly. > It came a few years to early. I remember my shock when I get [1] my OS/2 copy and it was on 10 (yes, ten!) 3.5 inch Floppy Disk Not so bad, really. > while Windows needed two (one for main OS, one for some utilities). No version of Windows came on 1 floppy. Windows 1.01 took 4 360k disks -- here's a picture: https://www.firstversions.com/2015/05/microsoft-windows.html https://www.firstversions.com/2015/05/microsoft-windows.html Windows 2 took 8 360k disks: https://archive.org/details/microsoft-windows-v2.0 https://archive.org/details/microsoft-windows-v2.0 Windows 3 took 8 even on DS DD 720kB disks: https://archive.org/details/windows_3.00_english_with_ms-dos_6.22_eng https://archive.org/details/windows_3.00_english_with_ms-dos... By Windows 95 it was up to 27 high density 1.4MB disks: https://www.reddit.com/r/interestingasfuck/comments/uopb1n/the_27_installation_disks_of_windows_95/ https://www.reddit.com/r/interestingasfuck/comments/uopb1n/t... 10 is not bad at all for a full preemptive multitasking x86-32 OS with a GUI, IMHO.
- terhechte 2y agoJust wanted to say that I was only someone who read OsNews daily back somewhere from 2002 to 2007 or 2008. So many interesting things going on. With the proliferation of web apps and containers, alternative operating systems are actually more feasible today. At the same time, I'm dependent on all the niceties that the macOS/iOS ecosystem offers (the integration, the sync). Something I wanted to look into is just running macOS in a very default way and then using a fast OS (such as Haiku, though their Arm64 support is not very good yet) in a fullscreen VM. With modern Apple Silicon, there's almost no performance penalty.
- pjmlp 2y agoiDevices and Android are not Unix like, there is hardly any way to do an usable application with POSIX APIs. Same applies to cloud computing with language runtimes and serverless. While it looks grim, there are some hopes for OS lovers.
- anthk 2y agoRisc OS it's still alive, it works great under an RPI B+ and up. Just get some industrial graded SD. I suggest you to get the Risc OS Direct 'distro' and then the update which has wireless support. Read the documentation first, of course. Risc OS it's very similar to Windows in usage (more like an Amiga), once you read the docs you will get it ready in no time. You have the old Netsurf browser on its native plataform, it's fun. On plan9, 9front superseded it.
- WillAdams 2y agoI'm faintly surprised that the Raspberry Pi hasn't made OS-experimentation more of a thing. There are: https://www.raspberrypi.com/news/risc-os-for-raspberry-pi/ https://www.raspberrypi.com/news/risc-os-for-raspberry-pi/ https://wiki.sugarlabs.org/go/Installation https://wiki.sugarlabs.org/go/Installation https://9p.io/wiki/plan9/Raspberry_Pi/index.html https://9p.io/wiki/plan9/Raspberry_Pi/index.html as well as a couple of RTOS options: https://all3dp.com/2/rtos-raspberry-pi-real-time-os/ https://all3dp.com/2/rtos-raspberry-pi-real-time-os/ and QNX: https://pidora.ca/qnx-on-raspberry-pi-the-professional-grade-os-you-didnt-know-you-needed/ https://pidora.ca/qnx-on-raspberry-pi-the-professional-grade... and TRON: https://www.tron.org/blog/2023/09/post-1767/ https://www.tron.org/blog/2023/09/post-1767/ (but that's only on the Pico? I'd love to see it as a desktop OS on an rPi5)
- MisterTea 2y agoTo add for Plan 9: https://9front.org/releases/ https://9front.org/releases/ Maintained daily. pi is 32bit and pi3 is 64bit. WiFi works.
- MisterTea 2y ago> I still wonder why we can't do better than Unix and Windows. Unix is 50 years old and Windows is old, too. There should be better concepts out there waiting to be discovered and implemented. Plan 9. It's a Unix built on top of a network. Each process can be thought of as a container as each gets a namespace which consists of a table of mounts and binds of resources. Those resources are served by an architecture neutral RPC protocol which serves a tree of objects we call files: 9P. The server of these resources is called a file server and is akin to a micro-service that runs bare metal on the CPU, the kernel is the container host. These resources are protected by Unix permissions verified by the kernel against a security service called factotum, itself a 9P server. Cloud ready, bare metal micro-service computing started in the late 80's and nobody noticed. > I miss the days ... Plan 9, Inferno, ... Still alive and kicking. Head over to 9front.org for a maintained fork of each. Patches arrive nearly daily to 9front and the community is encouraged to contribute. 9front also runs my home network because setting up DHCP, DNS and TFTP for PXE is dumb simple.
- ForHackernews 2y agoThere is still new exciting stuff happening https://serenityos.org/ https://serenityos.org/ https://collapseos.org/ https://collapseos.org/ http://kolibrios.org/en/ http://kolibrios.org/en/
- lproven 2y ago> https://serenityos.org/ https://serenityos.org/ Trad Unix, redone in C++; not self-hosting; project lead has quit to work on a browser. > https://collapseos.org/ https://collapseos.org/ Interesting but mainly for extreme smallness. Forth will alienate a lot of people. For me, Oberon would have been a more interesting basis. > http://kolibrios.org/en/ http://kolibrios.org/en/ Hostile fork of Menuet OS; based on 25YO code. I mean, yes, it is good there's interesting stuff, but these are not inspiring examples IMHO.
- 7thaccount 2y agoI too long for different ways of interacting with a computer. Unfortunately, I think the ship may have sailed as it's getting too hard to both start from scratch and also provide support for everything from a web browser to drivers and so on. It was a lot easier when the to do list was 1/100th the size. The workaround is to utilize what has already been done, but then that kind of defeats the entire purpose and you just get a slightly different flavor of the same thing. The only other real option would be a radical revision of what a computer is. Something really simple that maybe a bit closer to what Carl Sasserath was doing with iOS (no, not Apple iOS, but the internet OS via Rebol thing) iirc, or what the Forth folks do with hardware. I think Alan Kay may have talked about this as well from a smalltalk perspective. The question is if you can do anything interesting with it. I'm sure there are dozens of us that would give up YouTube and social media to have a fully understandable computing system :)
- DeathArrow 2y ago>It was a lot easier when the to do list was 1/100th the size Things in the past look simple only if we look at them through today's lens. The apparent complexity was the same. Today I work with microservices, on top of Kubernetes on top of cloud services and I have to know a gazillion things. But I don't have the feeling that I had an easier time when I was a kid playing with C/C++ under DOS, learning assembly, writing terminate and stay resident programs, trying to write simple device drivers or trying to program the graphics hardware using whatever limited info I had access to. When I started doing desktop application using Win32 and Qt, it didn't seemed more simple than now. Learning how to use Linux syscalls, how to program for X11 in 2000 didn't seem simpler. Of course, software was much more simpler but now we have better tools, a lot of more easy accessible information, we have developed practices, standards and methodologies to help. And since we have huge resources, we don't have to extract every last drop of performance from the hardware. So, I don't think the life of average programmer in 70s,80s,90s,2000 was easier than now. It only seems easy if we have to resolve problems from 40 years ago using the knowledge, tools and the hardware we have now.
- 7thaccount 2y agoWe may be talking past each other. I don't think it is harder on programmers now (or easier for programmers in the past). I can do things in Python that would make me a 10x programmer 40 years ago if the hardware could have supported it. They also didn't have stack overflow back then...just a dog-eared copy of some old C book. They didn't have hardware like we do that would've made a supercomputer back then look like something you'd put in a toaster today (that was a poorly worded sentence...sorry). The challenges they faced were numerous. My point is that the actual complexity layers are much worse now. Back in the Commodore 64 days, many users knew the machine inside and out. They could program in assembly, do graphics on the display...etc, all while understanding exactly what is going on. None of that was easy or as efficient as what I can do in Excel today or some 3D graphics program, but it was something you could wrap your head around. Today, we have huge monolithic amounts of code or hardware for everything. I don't understand anything about my hardware, I don't understand the millions of lines of windows, I don't understand the millions of lines in Microsoft Office, or how my web browser works or how Unreal engine was built...etc. It's the product of millions of people working together to create something beyond the limits of a single human. If we wanted to truly start from scratch, there's no way (that I can see) where we can reinvent all of that and actually get a large amount of users. It's not impossible, but Herculean. You could do something if the to-do list was MUCH smaller, like what was done with Temple OS or Collapse OS.
- Kon5ole 2y ago>I still wonder what would have happened had Jean-Louis Gassée been less greedy and Apple acquired BeOs instead of Next. I'm pretty sure Apple would have been bankrupt a few months later if they didn't buy back Steve.
- lproven 2y ago> I still wonder what would have happened had Jean-Louis Gassée been less greedy and Apple acquired BeOs instead of Next. I'm paraphrasing an old blog post of mine, but... In today's world, spoiled with excellent development tools, everyone has forgotten that late-1980s and early-to-mid 1990s dev tools were awful: 1970s text-mode tools for writing graphical apps. Apple acquired NeXT because it needed an OS, but what clinched the deal was the development tools (and the return of Jobs, of course.) NeXT had industry-leading dev tools. Doom was written on NeXTs. The WWW was written on NeXTs. Apple had OS choices – modernise A/UX, or buy BeOS, or buy NeXT, or get bought and move to Solaris or something – but nobody except NeXT had Objective-C and Interface Builder, or the NeXT/Sun foundation classes, or anything like them. The meta-irony being that if Apple had adapted A/UX, or failing that, had acquired Be for BeOS, it would be long dead by now, just a fading memory for middle-aged graphical designers. Without the dev tools, they'd never have got all the existing Mac developers on board, and never got all the cool new apps – no matter how snazzy the OS.
- interroboink 2y agoSomewhat tangential: this reminded me of Neal Stephenson's "In the Beginning was the Command Line" [1] which speaks highly of BeOS. I liked the bug report "R4: BeOS missing megalomaniacal figurehead to harness and focus developer rage" (: [1] https://web.stanford.edu/class/cs81n/command.txt https://web.stanford.edu/class/cs81n/command.txt
- troyvit 2y agoMan I read that during my formative years as a computer guy and it helped me big-time make the switch from MacOS to Linux. That and "The Cathedral and the Bazaar."[1] I don't know how well that one stands up to the test of time though. I'm going to re-read your link now. http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/ http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral...
- ameliaquining 2y agoThe most immediately obvious answer to that question, shared by Stephenson himself, is that the essay quickly failed the test of time because it did not anticipate Mac OS X, which breaks the dichotomy of user-friendly-but-anemic Classic Mac OS vs. powerful-but-forbidding Unix. (I personally still don't really like Apple systems and don't use them, but I think it's clear that by the standards of the time OS X squared this circle.)
- troyvit 2y agoI was speaking to ESR's essay holding up to the test of time but you have a good point. I'd argue however that the lock-down Apple imposes on OS X, such as signed system volumes, keeps them firmly planted in a cathedral. That said I don't know why I'd argue with Neal Stephenson about this stuff to begin with so maybe I should stop typing :)
- ameliaquining 2y agoIIUC cathedral-style development of open source projects (i.e., intermediate development versions aren't publicly available, you can only get official releases) is now very rare; Android is the only project I can think of off the top of my head that works that way. So in that respect ESR's perspective clearly won out. Of course an essay of that length makes any number of claims and some will have aged better than others.
- Aldipower 2y agoThis a a great tutorial! Very easy to read and understand. If someone would like to dive into C programming I would suggest this.
- 10729287 2y agoThat's exactly what I wanted to read and was about to ask. I always wanted to both contribute to FOSS beyond helping with translation and to learn coding. That seems to be the perfect opportunity to check those two boxes as I've got a lot of sympathy for the Haiku os.
- sverhagen 2y agoKindly disagree. You are either an experienced programmer, in which case this starts off way too basic, or you are coming into programming for the first time, in which case: why would an average person start with C++ or whatever Haiku is?!
- Aldipower 2y agoNope, if you read carefully, I've wrote "dive into C programming". This does not target first time programmers. But this doesn't mean you are an experienced programmer already. Fair enough, I've meant C++, not C. :-) I think this tutorial is perfect for kind of beginners, but not complete novices of course.
- ktallett 2y agoThis was how I relearned to program in C++ and ported a few apps to the OS. It was a great experience and the OS has come on leaps and bounds. If anything for many it could be a daily driver nowadays.
- tialaramex 2y agoBecause Haiku has taken such an extraordinarily long time, as with a city centre that was constructed over multiple centuries we can see the clear lines of new work with new techniques and materials on top of old work done in a way that was usual at the time. Haiku has a lot of C++ 98 code or even pre-standard C++, not least all the stuff re-used with permission from BeOS. As was usual for projects at that time many fundamental building blocks are provided rather than using a language standard. For example there's BString and BList. Haiku also has seams of BSD code where there'd be a project to do Whatever (WiFi, TLS, drivers, etc.) "properly" in a way unique to Haiku but as a stop gap here's some BSD code until we finish our own proper solution, which of course never happens.
- waddlesplash 2y ago> with new techniques and materials on top of old work done in a way that was usual at the time. But is there any long-lived project for which this isn't true? Linux and the BSDs surely have many components that fall into this category. > For example there's BString and BList. BString is a much nicer string class to work with (IMO) than std::string. It lacks some modern conveniences, and it has some unfortunate footguns where some APIs return bytes and some return UTF-8 characters (the former should probably all be considered deprecated, indeed that's a BeOS holdover), but I don't think there's any intent to drop it. BList could be better as well, but it's still a nicer API in many ways than std::vector. Our other homegrown template classes also are nicer or have particular semantics we want that the STL classes don't, so I don't think we'd ever drop them. > Haiku also has seams of BSD code where there'd be a project to do Whatever (WiFi, TLS, drivers, etc.) "properly" in a way unique to Haiku What would be the point of implementing WiFi drivers from scratch "uniquely" for Haiku? Even FreeBSD has started just copying drivers from Linux, so that may be in our future as well. I don't know that anyone ever really considered writing a whole 802.11 stack for Haiku; there was some work on a "native" driver or two at one point, but it was for hardware that we didn't have support for from the BSDs, and it still used the BSD 802.11 stack. Writing our own drivers there just seems like a waste of time; we might as well contribute to the BSD ones instead.
- tialaramex 2y ago
- revskill 2y agoBut i already know how to program, then why do i need Haiku ?
- Hj8Rd2Qw 2y ago[flagged]
- codr7 2y agoI was really into BeOS for a few years, right around the Intel pivot. Very nice OS, but I remember the programming API to be tricky since everything was multi-threaded.