Potential new native Haiku browser

I was working on a enhancing the Netsurf browser and noticed it has a BeOS frontend. I assume this could work on Haiku too.
I did get a lot of crap for using AI while enhancing the Netsurf code so I just want to be open about this. It wasn’t vibe coding, it was genuinely using AI to help debug and enhance the existing Netsurf code. While doing this I manage to fix most of the errors Netsurf had while rendering https://www.haiku-os.org/ . It was a few days work.
I have for now only worked on and tested the Qt6 and Windows GDI implementations. If anyone is interested I can take a look at the native BeOS frontend from Netsurf.
As far as I am aware Haiku has the Webpositive browser but this Netsurf port is probably lighter even though of course not nearly as polished, more of an alpha version with JS notably being only some stubs.

Still the project is here : GitHub - mcirsta/wisp: Wisp browser - a NetSurf fork with various improvements .

Thanks and if you have any comments or constructive feedback let me know.

3 Likes

Netsurf has been available for Haiku for many years already,it’s right there at HaikuDepot: Haiku Depot Server
That build already makes use of the upstream BeOS-specific code,so it’s safe to assume it works,assuming you didn’t break it with your changes.

My personal opinion on this it that I really like Netsurf for being native and really lightweight and fast,and it’s a shame that it doesn’t keep up enough to at least render static websites more correctly (JS would be overkill,and not having it is probably more a feature nowadays).
But I agree with the upstream Netsurf developers that using The Great Bullshit Machine isn’t the right way to work with such a big and security-critical codebase like a webbrowser.
It’s forbidden for Haiku contributions,too,for a good reason.
That doesn’t mean third-party applications can’t be developed that way,but I’ll personally stick to the original developed by humans,even if that unfortunately means a few more broken pages.

6 Likes

Thanks for your reply. I did make some breaking changes to the frontend so without some work the BeOS frontend will not just work in Wisp.
One specific change that was required for the Haiku website because it’s using gradients and Netsurf has 0 support for gradients, this then lead to some changes for the frontends.
Another change was because the rendering now supports downloaded fonts and so on…

The decision to use or not use AI is up to each project. After 2 months of using AI for this project I can say that depending on how you use it and which AI you use it can lead to some decent or good results.

I have great respect for the Netsurf devs and all their hard work but there are some serious bugs in their code that Opus caught for instance. Some bad overflows where INT_MAX was used for instance as a signal value and then that case was not handled properly. Humans also make mistakes and as a programmer myself I am quite aware of this. Many AIs are indeed producing bullshit, Gemini 3 for one but some like Opus can be quite focused and 99% do what their are told. If I compiled with ASAN which spotted the memory problem I could then tell Opus to investigate and it did find the exact cause of an error introduced by humans. Yes, Opus itself then introduced some mem leaks , found again with ASAN and fixed.

To be honest to have a secure modern browser or rather a rendering engine you need lots of resources, knowledge and time. No one outside of Chrome , Firefox and Safari has the ability right now to produce a safe rendering engine. Even so Webkit which is the base of WebPositive had quite some serious vulnerabilities and exploits.

That being said I just wanted to gather some opinions because I thought it would be cool to try Haiku and see how Wisp works on it. The Haiku website itself helped me spot and fix some bugs or unimplemented features in the Netsurf code.

Unfortunately even https://www.haiku-os.org/ itself uses JS as far as I can tell, for the fundraising part, so some limited JS support is needed these days. Google search won’t work without JS support and a JS redirect.

If anyone is interested I think maybe the Qt6 frontend could work even now on Haiku.

3 Likes

I do have a Qt6 development build (NetSurf 3.12) that I hobbled together. I’ve been playing with it since August.

1 Like

Cool , well if you want you can give Wisp a try. I can tell you that the haiku website should render better.
There might be regressions too but overall I hope the experience will be better.
I’ve done 0 of the Qt6 frontend outside of CachyOS though.
There were some minor fixes that I have made to Qt6 specifically , I think mostly around High-DPI.
My plan was to port the Qt6 look to all other frontends too as I think it’s a good minimalist UI but just have native UI elements and rendering.

Lets try to approach the AI Development with less emotions, and more nuanced.

Sadly the only way i would be able to help coding is with massive AI “help”, i have fixed a few bugs here and there, but i cannot code.

If wisp is creating a better working, more funktional Netsurf, i support that.

If someone works on the BeOS/Haiku Frontend for that, that is great

Welcome to Haiku

1 Like

My point exactly. I can code, I have been a C/C++ programmer for 17 years now but I have not even remotely worked on anything related to a browser.
I didn’t like AI, I don’t want it to take my job but hiding your head in the sand doesn’t solve anything so I decided to take a look and see what it can actually do and also what it cannot.
It’s very bad at making decisions, it often proposes to just leave thigs as they are or breaks them even more.
Opus though with good prompts, persistance and code reviews is able to improve the Netsurf codebase, not everything but at least some things.
To anyone who wants to see the difference try the Haiku homepage in Netsurf and then in Wisp.
There are fundamental fixes and improvements, I made sure of it, it’s not an if website=haiku do this else do that. That’s what vibe coding gets you, especially with lousy models. This is not it, it’s not perfect but as I said unless you’re an experienced browser dev you will not do better with manual coding either.

2 Likes

If I can get such sponsors : Ladybird
Then yes I can quit my job and hand code everything.
Like this it was a decision , I either spend 2 months of my spare time fixing 100 bugs with Opus or I go at it manually bug by bug line by line and fix what ? 10 or 20 ? And given how much work there still is to get something modern from Nersurf that would take years and years of time I don’t have and I am not sure I am willing to put in.
In my open source usage the community has given me a lot of nice tools and projects to work with. Wisp is something that I want to give back to the community. I personally don’t think it’s just some AI crap, I did my best.

2 Likes

It’s not forbidden to use LLM for Haiku development. The rule just says one should ensure that no code with ambiguous or incompatible licenses are contributed:
“The Haiku project cannot accept contributions (e.g. code, documentation, translations, etc.) which are under ambiguous or incompatible licenses. (This includes most content produced with the use of LLMs.)”

PulkoMandy explained it quite well here: Shhh... Haiku isn't blind anymore! - #41 by PulkoMandy

The policy only says that you have to make sure there are no copyright violations, not that AI is banned outright.

Reading the generated AI code and writing something based on it would be fine (just as we often have a look at gpl driver code in Linux for reference, but we don’t directly copy it).

Searching the web for cooe snippets to make sure they are original and not copypasted from somewhere else would also satisfy the policy. Don’t make it more extreme than it is.

1 Like

Don’t let a few naysayers keep you from using your fav AI as a tool/help to find and fix bugs. If the tool you used was called buffer-overflow-fixer-v3.1 everyone would applaud your efforts. Now they hear AI and automatically reject it. Soon, it’ll be like trying to promote a car to people riding horses. And ofc I know it’s not real AI, but it’s still a valuable tool in the hands of a developer. Everything can be abused or misused, obviously. A hammer in the hands of a carpenter or a serial killer also produce different results…

Anyway, keep on hacking away​:+1:t2::grinning_face:

1 Like

The situation is a lot more complicated than that.

Use AI in your personal projects if you want. I may dislike it (because of ecological reasons, ethical reasons, and because I spend more time than I’d like banning AI bots from scrapping my website, saturating my internet connection bandwidth and raising my electricity bill as my server is home-hosted).

But when it comes to submitting code to someone else’s project. The expected workflow is that you took some time to study the code, make some changes, and you put some effort to contribute. Then the people reviewing your work can ask questions, and if the code review is done properly, you can use it to share your knowledge with the developers, the developers can share their knowledge with you, and in the end, not only the code gets better, but also everyone knows the code a bit more.

This process is very important, for the person who submit new code to learn new things and make better contribution, and for the person reviewing it because they learn how the code they are about to merge works. They are, most likely, going to maintain that code in the future. So, this is how we keep the maintainers of the code understanding what we do, and also how we grow new contributors to the project.

Now imagine the person submitting the code is not the one who wrote it. The reviewer asks them questions. They don’t know, of course, because they didn’t write the code. So they try to repeat the question to the person who actually wrote the code, and copy the reply back. I think you can see how this can turn out into a huge waste of time for everyone?

Finally, take this last case and replace any one of the three people involved with an LLM. I think you can see how things can go even worse.

So, use LLMs and assistants any way you want in your own project. But keep in mind that it will not enable you to understand the code on a global scale as good as you would otherwise. Some projects may be ready to accept that, some have decided to set up high standards for the quality of contributions, and it’s unlikely that you can get there with only an LLM. You could get there with some little help from an LLM, but for one person who does that, there will be a dozen others who will blindly paste the output of the LLM into their code editor and try to submit changes. They’re in for the fame without the hard work, especially in popular projects (cURL is a very good example of this).

I don’t really see a solution to that except warning people that such behavior is not welcome. In Haiku we can attempt to be a little tolerant to it. But NetSurf with an even smaller team? I totally understand they don’t want to spend their time on such things. If they wanted to generate code using an LLM, they could do it themselves, and not adding a person in between them and the LLM. That will surely be more efficient.

So, in the end: do not submit someone else’s work that you don’t understand to an open source project. It will go badly. And also do not submit work that’s primarily the output of an LLM, that is similarly problematic. If you used the LLM as a kind of peer programmer and wrote or at least carefully reviewed the code yourself? Maybe you can have a try.

10 Likes

You can still use AI to find issues in the code, and then fix them yourself, though :grin:

6 Likes

Wisp does build fairly easily on Haiku, and it seems to be hit or miss on rendering of websites. The haiku-os homepage does display better on the Wisp build than the NetSurf Dev build, However on other sites Wisp does crash or does not render anything but text compared to the NetSurf build.

1 Like

Thanks a lot for testing, could you please share as many sites as you can where you have found regressions ?
Those are my first priority, regressions compared to Netsurf and I am really curious what is going on.
Some are really regressions but some regressions are oddly from adding support for some new features where Netsurf is kinda cheating.

Here’s acouple for you to look at. Attempting to go up foxnews.com causes Wisp to crash. I attempted to access site a number of times.

Here’s some screenshots of ctvnews.ca comparing both NetSurf and Wisp

1 Like

Thanks for your reply, appreciate your opinions.
For me the main problem was 0 understanding of web, web browsers and web development. The proper way as a programmer would have been to start and learn but I wanted to get things done faster and see what could be achieved, if there’s any hope for the code base and so on.
I would have needed these 2 months probably to just learn and read and understand , then yes, I would have been able to do some of the things that the AI did even better and gained some knowledge. I was impatiend and also I really , really need to do something that brings me some revenue. Maybe someone would sponsor my browser work but if not what do I do ?
Yes, the Netsurf devs are quite skilled but if you look at the Netsurf git there have not been any meaningful contributions to the browser in years. JS support si still stuck with Duktape and even that is half working. There’s no support for more modern features like the grid layout, the flex layout is full of bugs.
Don’t get me wrong, I am not criticizing, I have great respect for the codebase itself but it was going nowhere.
I don’t even thing it’s as simple as if they wanted to use AI they could have done it themselves. First there’s cost. For such work you really need at least one of the Ultra ( 200 dollars or more ) packages because it’s mostly Opus that is able to handle the work and that is expensive. Then after AI does whatever it does you need to take a look and review which even if you have experience takes time.
The biggest issue is perhaps that you need a team. For one person to know about the Qt API, the CSS, about JS, about Direct2D on windows and then some Haiku API or OS X cocoa is really not realistic.
AI can to some degree be your team of assitants who do know something …. Not very smart ones but the knowledge is there.

Funny enough even with AI I managed to undertand quite a bit about browsers and the code. I don’t know every loop but I asked a lot of questios, had it draw a lot of flow diagrams , put many traces to see the performance issues. I know exactly why an image that is requested at time 02:02 is rendered only at 04:05 even though the download took just 00:10.

Great, thanks. That will give me some things to dig into for the 0.2 version.

You may find some value in using your skills in this area. Many experienced devs on these projects.

AI only does so much for devs. But, use as needed. :wink:

1 Like

For now at least I don’t think my goals align with theirs. I want to have something that is as small and lean as posible and Webkit is not it.
Also I don’t think the WebPositive team is much interested in a native widget frontend for Windows that uses Direct2D for rendering.

At the end of the day it’s good to have more than one option but for now Wisp is nowhere near what WebPositive can offer. Still , you need to start somewhere.

Foxnews is now fixed, should not crash with the latest changes from git. It’s quite a heavy site and with the single threaded nature of the Netsurf codebase takes a while to load.
Also the rendering is not perfect but Wisp does offer some support for grid layouts while Netsurf doesn’t support native grid layouts.

The other site, ctvnews.ca is different kind of beast. It apparently use CSS variables which neither Netsurf nor Wisp support.

Contrary to what some believe I won’t just tell Opus to implement such a big feature. I need to better understand the Netsurf CSS code and probably come up with some refactoring so that we can have more modern CSS feature support.

That being said I have no idea why it looks a bit better in Netsurf but I am pretty sure it’s quite broken in Netsurf too without support for these CSS variables.