Live data from Hacker News

Introduction to SerenityOS Programming

awesomekling.github.io

31–40 of 44 posts

Re: Introduction to SerenityOS Programming

#31
post #29

Very nice and clean GUI library. Clean GUI C++ libraries like this always make me think that Microsoft deliberately chose to not implement such a nice C++ GUI API for Windows and instead gave us the horrible MFC in order to lock us in into Visual Basic and other proprietary projects. If Microsoft had given us a clean C++ API for Windows, the world of programming would be very different today.

> If Microsoft had given us a clean C++ API for Windows, the world of programming would be very different today. I mean, Win32 was a relatively clean C library. Not beautiful by any means, but it worked and was well documented. At the time it was huge, but it's pretty irrelevant today. If they did it in C++ instead of C, how could it have been different.

I wouldn't call the Win32 API clean. To me, it's one of the worst APIs I have ever encountered.

It worked and it was well documented, but that does not mean its design is very nice. To me, that is.

Re: Introduction to SerenityOS Programming

#32
post #2

Hello friends! Author here. Happy to answer any questions about SerenityOS and its programming environment. :)

These blogposts are awesome, keep them coming Andreas!

Are programmers expected to always use this high-level OOP style of writing GUI programs? Or does Serenity expose a lower level API for manually creating windows, reading hardware input, writing pixels to framebuffer, etc, like Xlib for example?

Re: Introduction to SerenityOS Programming

#34
post #2

Hello friends! Author here. Happy to answer any questions about SerenityOS and its programming environment. :)

I've heard about SerenityOS from the videos on YouTube and I'm impressed over its 90's GUI and some of the new OSes that have their own desktop environments and have the case for integration rather than a separate kernel + desktop environment, etc. Are there any plans for 64 bit support? and in general about SerenityOS's internal GUI system, how does it compare to RedoxOS or more similarly Haiku which language and GU…

Hello highspeedmobile! I don't generally make plans one way or the other. However we do have https://github.com/SerenityOS/serenity/issues/1327 open about adding x86_64 support as of a few days ago. :)

I haven't looked at RedoxOS or Haiku enough to tell you how similar they are.

Re: Introduction to SerenityOS Programming

#35

This basically looks like a cleaned up Qt API. (Which is a good thing, the basic design works really well for applications, it only gets annoying if you want "apps" and fully customized look and feel, animating everything)

Hi blattimwind! Yes, it is heavily inspired by (the excellent) Qt. I worked on the Qt team in the past, so the influence is unavoidable :)

Re: Introduction to SerenityOS Programming

#36
post #2

Hello friends! Author here. Happy to answer any questions about SerenityOS and its programming environment. :)

These blogposts are awesome, keep them coming Andreas! Are programmers expected to always use this high-level OOP style of writing GUI programs? Or does Serenity expose a lower level API for manually creating windows, reading hardware input, writing pixels to framebuffer, etc, like Xlib for example?

Hey voldacar! Writing is hard, but I suspect it will get easier if I do it more often. Thank you for the encouragement :)

Indeed, this is the only native GUI programming interface available on the system. Outside of the standard C library (which includes an increasingly reasonable subset of POSIX), the whole OS is modern C++.

Re: Introduction to SerenityOS Programming

#37
post #31

Earlier quoted context omitted.

> If Microsoft had given us a clean C++ API for Windows, the world of programming would be very different today. I mean, Win32 was a relatively clean C library. Not beautiful by any means, but it worked and was well documented. At the time it was huge, but it's pretty irrelevant today. If they did it in C++ instead of C, how could it have been different.

I wouldn't call the Win32 API clean. To me, it's one of the worst APIs I have ever encountered. It worked and it was well documented, but that does not mean its design is very nice. To me, that is.

There would be no surprise to this since the Win32 GUI APIs were created at a time when C++0x was widely used compared to what you see with APIs created in C++11 and onwards.

I guess the latter is the case for SerenityOS and other OSes with integrated GUIs.

Re: Introduction to SerenityOS Programming

#38
post #31

Earlier quoted context omitted.

I wouldn't call the Win32 API clean. To me, it's one of the worst APIs I have ever encountered. It worked and it was well documented, but that does not mean its design is very nice. To me, that is.

There would be no surprise to this since the Win32 GUI APIs were created at a time when C++0x was widely used compared to what you see with APIs created in C++11 and onwards. I guess the latter is the case for SerenityOS and other OSes with integrated GUIs.

Indeed, SerenityOS has been using C++17 from the start, and will be using any helpful C++20 features as soon as they are available in compilers. We're already using templated lambdas in a couple of places :)

Re: Introduction to SerenityOS Programming

#39
post #18

Please update the title to include GUI, i.e. "Introduction to SerenityOS GUI programming".

Is there some reason why an introduction to SerenityOS GUI programming cannot also be an introduction to SerenityOS programming as a whole? Especially considering that the graphical interface seems to be the focal point of SerenityOS (much like it is for Windows or BeOS/Haiku or classic Mac OS).

> Is there some reason why an introduction to SerenityOS GUI

> programming cannot also be an introduction to SerenityOS

> programming as a whole?

It could be, but it's vague. The original title was very much to the point, I don't understand why 'GUI' was dropped.

Re: Introduction to SerenityOS Programming

#40
post #26

Earlier quoted context omitted.

> That said, jcs@ from the OpenBSD project has been working on a port of the entire Serenity desktop environment to OpenBSD: https://twitter.com/jcs/status/1224205573656322048 Wow. That looks pretty awesome. Your gui aesthetic is pretty 90s in the best way possible, and combined with OpenBSD underneath this looks like it has potential to be a seriously no nonsense system.

Hi asveikau! Yeah, it's a nice glimpse of one possible future. :) I'm gonna keep building the custom SerenityOS kernel of course, since it offers extreme productivity and integration opportunities that would be a lot harder to explore with a foreign kernel at the moment.

At a time when I had more spare time vs. today I was also hacking on my own kernel, so I definitely understand the drive to do that. (And congratulate you for pulling it off.)

But OpenBSD is a great kernel and user mode, all around. For context on my own biases, usually when discussions of desktop environments occur around here I am defending X, because it isn't as bad as people say. But seeing the combination of OBSD and your UI I am like... Yes, that looks like a feasible system that is not X.

Post reply on HN