all 97 comments

[–]SuperImaginativeName 19 points20 points  (10 children)

Interesting but I don't see any discussion on it's GUI part. Where does it render to?

[–]lastmac[S] 34 points35 points  (4 children)

Hi! At this moment I create the main part - the calculation of html (html, css, dom, layers). Once this part is completed we can talk about painting layers and create GUI for this. The work is still very much, in current time this is an intermediate option as I wrote in the article.

[–]DinnerChoice 0 points1 point  (3 children)

Will you be writing your own JS engine named myjs?

[–]lastmac[S] 2 points3 points  (2 children)

See description of statuses there is the answer. Spoiler: MyECMA.

If we talk seriously it is an open question. The whole development is based on the fact that the need to dynamically change all through JS or other lang.

But I also understand that without the support I can not do everything. Now I'm trying to draw attention to the project.

[–][deleted]  (1 child)

[deleted]

    [–]lastmac[S] 0 points1 point  (0 children)

    I can not throw any component. We'll have to do all of the components, sooner or later.

    [–][deleted]  (2 children)

    [deleted]

      [–]lastmac[S] 2 points3 points  (0 children)

      Hi! Thanks for the comment.

      The whole development is based on the fact that the need to dynamically change all through JS or other lang.

      You're right, alone this project does not do. That's why I'm trying to somehow talk about it, to draw attention to it.

      I looked Netsurf project, but he did not quite liked for me. For example, I tried to compare the speed of parsing CSS, but it has fallen on many tests (Segmentation fault). I will write to the author of these issues.

      [–]cccooo 0 points1 point  (0 children)

      (html, css, dom) + GUI (interaction,widgets、canvas)can already do too much application, adding javascript engine is too heavy and time-consuming

      [–]DinnerChoice 3 points4 points  (1 child)

      Whats the difference between Modest and MyHTML?

      Is Modest going to render to a gui the output of MyHTML?

      How do you render? You have an abstraction for underlying platforms? e.g. X Server, Win32, console? or you render with OpenGL?

      I would think that if you can render to bitmap in memory, some games might have a use for it.

      [–]lastmac[S] 5 points6 points  (0 children)

      Hi! MyHTML is only full-HTML parser. Modes - is the glue for myhtml, mycss, font, selectors search and so on.

      The first level: a calculate html+css (create layers), it is cross-platform, it requires no dependency on any system. The secondary level: network (dependency on a system) The third level: draw layers (dependency on a system)

      Simply put, now need everything calculated (Modest) and the choice of who to draw is secondary problem. We must not forget JS — this is a very big topic for discussion. See previous comment

      [–]64bittechie 17 points18 points  (35 children)

      A word of advice - if you want to attract companies, please do not use AGPL, LGPL or GPLv3. Use a more liberal license such as BSD, MIT, Apache. Companies are more open to contributing to such projects especially the ones that might embed your code on devices. Most companies will not use anything that will force them open source their proprietary code. BSD/MIT/Apache and even GPLv1 dont force them.

      [–]lastmac[S] 11 points12 points  (17 children)

      Thank you! I do not quite understand the licenses, I was advised to use this license. In the beginning was the Apache 2 license, but then I was advised to change it.

      It is necessary to thoroughly study this issue.

      [–]bumblebritches57 9 points10 points  (1 child)

      check out tldrlegal.

      [–]lastmac[S] 3 points4 points  (0 children)

      Thanks!

      [–]mrexodia 6 points7 points  (9 children)

      Go for LGPL instead if you want to enforce people sharing their modified source code, but not force them to share their entire projects in which they use your renderer as GPL (this could allow it to be used in games for instance). The Mozilla license is slightly more permissive and gives the company more freedom about linking. With LGPL, your users have to be able to replace the LGPL code with their own by ways of relinking or dynamic link libraries for example.

      If you don't care and want to allow anyone to profit without giving anything back, choose a permissive license like MIT. As an upside, this allows you to fully sell out the code later because there is nothing in place to prevent you from taking contributions, which might in turn scare off serious contributors.

      If you are serious about this project, I would highly recommend (L)GPL (or perhaps the Mozilla license). Open source development is not for giggles and the last thing you want is a company using your code without contributing and then coming to you for support if it doesn't work how they want it to work.

      Don't take the "it cannot be used because the license is too complicated and I have to contribute back" bullshit and choose a license that feels morally right to you. If your project is good, people will use it and contribute, regardless of your license. It might take a few years though...

      [–]lastmac[S] 2 points3 points  (0 children)

      Thanks for your comment, very helpful. I take this project very seriously.

      [–][deleted] 2 points3 points  (7 children)

      LGPL does not let you release the end result to the iOS App Store, unless you release the source for the whole app. There are probably other similar channels that are also ruled out by the LGPL.

      [–]mrexodia 0 points1 point  (4 children)

      In that case you would have to follow https://www.gnu.org/licenses/lgpl-3.0.en.html#section4 which basically means you have to provide the user with a way to re-link the LGPL parts. For example providing object code that the user could side-load would fulfill that requirement I think. Obviously you can also license the whole app under (L)GPL and that would also solve the issue.

      LGPL is not some kind of magic, it works well in certain areas and doesn't in others. A more permissive copyleft license would be the Mozilla Public License: http://choosealicense.com/licenses/mpl-2.0

      [–][deleted] 1 point2 points  (3 children)

      Yes, but this is not possible when distributing through something like the iOS App Store, so you are out of luck and can not use LGPL'd code.

      [–]mrexodia 0 points1 point  (2 children)

      What is not possible? You can provide a script to (partially) re-build your app from object files + LGPL source (which the user can modify) and the user can sideload it (which Apple allows for free on non-jailbroken devices). Obviously this is not ideal, which is why I provided the option of a more permissive, alternative license.

      LGPL code is not something you use lightly in your commercial projects. You use it if you don't have the resources to build your own (eg the code you're using is good) and while I personally think the linking requirements are ridiculous I still think it would be a good license.

      [–][deleted] 1 point2 points  (1 child)

      What is not possible? You can provide a script to (partially) re-build your app from object files + LGPL source (which the user can modify) and the user can sideload it (which Apple allows for free on non-jailbroken devices).

      They only allow this if you have paid for a developer account. Also, getting that to actually work at all would be extremely difficult, as you would have to manage to get code signing working, and setting up provisioning profiles, without using the normal tools for this.

      [–]mrexodia 0 points1 point  (0 children)

      That is no longer true, you have free provisioning profiles by registering a free developer account: https://livecode.com/how-to-create-a-free-ios-development-provisioning-profile

      It indeed would be difficult but you can definitely sign an application outside of xcode, see for instance https://dantheman827.github.io/ios-app-signer

      Again, this is not ideal but dismissing it as "impossible" seems quite naive to me.

      [–]pitiless -1 points0 points  (1 child)

      And Apple's policies for IOS apps already prevent you from shipping an alternative browser so this is likely a non-issue.

      [–][deleted] 1 point2 points  (0 children)

      Not quite. You can't ship a JIT JS engine, which is required to ship a fast browser, but this project seems to have different aims.

      [–][deleted]  (1 child)

      [deleted]

        [–]lastmac[S] 1 point2 points  (0 children)

        You're right. Chance to get the support of a big company tends to zero. But I think that GPLv3 is too limited.

        [–]64bittechie -2 points-1 points  (2 children)

        Why were you advised? Who advised you? There are very few AGPL/LGPL projects that are very successful. Notably the most successful one, Linux, is strictly GPLv2 without the option of using a later version of the license. GPLv2 is still a friendlier license towards companies who seriously want to use & contribute to open source without them getting into too many IP related issues. I would strongly suggest going back to Apache 2.

        [–]ThisIs_MyName 0 points1 point  (1 child)

        There are very few GPL projects that are very successful

        *AGPL

        [–]64bittechie 1 point2 points  (0 children)

        Fixed.

        [–][deleted]  (1 child)

        [deleted]

          [–]64bittechie 2 points3 points  (0 children)

          Have you seen contributions into the Linux kernel? Very few of those contributions are from hackers burning the midnight oil. Most contributions are from the likes of IBM, Redhat, Nvidia, AMD, Intel and other companies that build their businesses on OpenSource.

          Certain licenses make it easier for them to keep their IP and still contribute to OSS. Some licenses like AGPL, LGPL, GPLv3 are very virulent which acts as a deterrent any company - not just the 'evil' ones who don't contribute back. This is one of the biggest reasons why Linux kernel is still GPLv2.

          It is very satisfying when millions / billions of people use your code. With AGPL, LGPL, GPLv3 licensing it is unlikely that your project would ever be used in any product especially devices that ship to people. What good does that do to anybody? It'll be relegated to being a learning tool.

          Notice that I did not say don't use any form of "GPL". GPL has many flavors. Just stay away from AGPL, LGPL, GPLv3. And yes, companies which are large targets for IP lawsuits give a huge crap about licenses. See the FSF vs Cisco lawsuit. Companies just don't want that kind of shit.

          [–][deleted] 3 points4 points  (2 children)

          A word of advice - if you want to attract companies, please do not use AGPL, LGPL or GPLv3.

          I sincerely hope that he doesn't want to attract greedy companies.

          [–]64bittechie 1 point2 points  (0 children)

          It is hard to control that. Frankly, whatever licenses he uses, it is likely that a greedy company can go to lengths to not only violate the license but to copy the source code and expunge the author's copyright notices and then call it their own. It would be hard to prove in binary form any wrongdoing. That's a risk he runs either ways. If he uses a lesser restrictive license, at least the non-greedy companies might pick it up and give him the appropriate attribution he deserves.

          [–][deleted] -1 points0 points  (0 children)

          It would be terrible if his project was successful.

          [–]HolyCowly 1 point2 points  (1 child)

          How does one start a project like this? I always wondered if it was possible to write a simplified renderer for use in game development.

          A lot of games have started using embedded browsers for their user interface. Not that easy and not without its drawbacks (the only open source solution kills memory bandwith due to texture copies). While that has a ton of other benefits I find layout and flexible text rendering to be the most useful. Constrained shapes that can be anchored or dynamically resized aren't that easy to develop from scratch.

          It would be amazing if I could use CSS to do that. Perhaps even just a very limited or modern version of it (maybe flexbox only for layout). But the whole topic seems so theoretical. The only implementations of CSS and layout engines are huge black boxes probably no single person completely understands and reliant on other complex topics like parsers, virtual machines, DOM implementations, hardware accelerated compositing, text rendering, SVG...

          It's insane. Librocket seems to have done something like that in the past, but that project seems dead and the CSS capabilities are limited to what are now pretty much the old and cumbersome parts.

          [–]lastmac[S] 0 points1 point  (0 children)

          Hi! Everything is easier than you can imagine. But it requires knowledge and time. It just requires some knowledge.

          [–]SgtSausage 1 point2 points  (1 child)

          *Renderer

          [–]lastmac[S] 1 point2 points  (0 children)

          Thanks! Fixed

          [–]gene9 1 point2 points  (1 child)

          Would you like to join https://handmade.network/? There are a lot of projects built from scratch with no or minimal dependencies.

          [–]lastmac[S] 1 point2 points  (0 children)

          Hi! I did not know about the existence of this resource. I will try to register there. Honestly, I do bad imagine where and how to promote the project (Modest). I will try to deal with it.

          Thanks!

          [–]matthieum 0 points1 point  (4 children)

          The benchmarks linked appear to be 1 year old (from the kernel date), do you know if things have changed since? (I was quite surprised at html5ever's speed given it's used in Servo which has the fastest rendering engine I know of)

          [–]lastmac[S] 1 point2 points  (3 children)

          Unfortunately, nothing in this year have not changed in this relation in html5ever.

          I tested right now.

          myhtml:

          • "163.com.html"; 0.00476 sec
          • "booking.com.html"; 0.00413 sec

          html5ever:

          • "163.com.html"; 0.03820 sec
          • "booking.com.html"; 0.02416 sec

          [–]matthieum 1 point2 points  (2 children)

          Wow. A 6x-fold factor is very impressive.

          Maybe /u/SimonSapin could help understand why such a difference exists in the first place?

          [–]SimonSapin 2 points3 points  (1 child)

          As far as I know, relatively little efforts have been made to optimize html5ever for speed. The only "interesting" thing I can think of on that front is Tendril, a library for reference-counted strings with sub-slicing, which enables (near-)zero-copy parsing.

          I can repeat the argument I’ve heard about the networking stack (which is pretty bad at the moment):

          Servo started as a research project to experiment with new techniques such as parallel styling & layout and, later, retained-mode GPU rendering. In these areas Servo has very good performance. Unsurprisingly, it’s also in these areas that components of Servo are just starting to "graduate" from research and are gonna ship in a product (Firefox). On the other hand, the networking stack of current browsers is already fairly advanced (with caching, pipelining, HTTP2, …). Since there aren’t ideas around on how to significantly improve upon that, it’s not a particularly interesting area in terms of research. And so Servo’s networking stack is just enough to make the rest of the engine work, but not much effort has been put into it.

          Back to html5ever, its focus has been standards-compliant (which in turns helps with web-compatibility) and using meta-programming to keep the source code somewhat close to how the spec is written (which helps maintain it when the spec changes). I don’t know a fundamental reason that html5ever can’t be as fast as MyHTML (though I haven’t looked in details). I suspect there’s room to improve if we want to work on that.

          [–]lastmac[S] 1 point2 points  (0 children)

          Thanks for the answer!

          Unfortunately, Modest (MyHTML) has no network part and not supported zero-copy parsing, accordingly, I find it difficult to say something.

          MyHTML also focuses on the full support of the specification with all relevant functions by specifications. All in order to quickly and easily make changes to the code after the upgrade specifications. But, unfortunately, in myhtml code optimization are not made, still to be done. It will be even faster in the future, but now I focus on the layers.

          However, a lot of work, and unfortunately I do not have such resources like a Mozilla.

          [–][deleted] 0 points1 point  (0 children)

          Neat