Live data from Hacker News

Yoga: A cross-platform layout engine

code.facebook.com

71–80 of 168 posts

Re: Yoga: A cross-platform layout engine

#71
post #70

Why not use parallelism? Parallel layout tends to be a major speed boost in our experience, and we have a parallel implementation of flexbox already. See Meyerovich 2010 [1] for the basic idea; you can adopt it to flexbox relatively easily. Additionally, I'm a bit skeptical about the use of C here: this stuff tends to end up exposed to the user and security-sensitive. [1]: http://citeseerx.ist.psu.edu/viewdoc/downloa…

For React Native, at least, I think the threat model is a little different. Browsers have to deal with any hostile webpage, so all input can be considered hostile to something like the layout engine -- but here, you're baking the application along with the engine and shipping it wholesale. But I guess it depends on the details of how Yoga actually integrates and what its surface area actually is. That said, I think t…

Right, it's not an issue with React Native. My concern is that people will end up using this in browser-like settings with untrusted content. Do they adequately guard against stack overflow with deeply nested layouts, for example?

Re: Yoga: A cross-platform layout engine

#72

I like the concept and the C# code is just hands down the best example out of all of them (yet another reason I miss coding in C#). I'm curious though, will this be eventually ported to JavaScript? Yeah yeah I know "flexbox is already on the web!" but if you could write a layout in this fashion versus using style sheets then you could take it and directly apply it to any of your applications (even if you have to conv…

> I'm curious though, will this be eventually ported to JavaScript?

Here's a similar but seemingly dead project:

http://gridstylesheets.org/

Re: Yoga: A cross-platform layout engine

#73
post #62

One thing I've thought about recently is Facebook's Patent grants, and it's one thing that makes me uneasy about using any open source technology from Facebook like React (I currently do but am thinking to move to Preact because of the nicer MIT license and that it's analogous to React in many ways) because they're generally given a patent grant. I'm not a lawyer so I don't know if the grant would hold up in court si…

Maybe I'm misunderstanding the license terms but I feel like this is a bit of a "Maserati Problem", at least, if you are not competing directly with Facebook. If you are worried you might want to sue Facebook for patent infringement some day, you could still use React today and switch to Preact or some other library "just in time".

Re: Yoga: A cross-platform layout engine

#74
post #68

Earlier quoted context omitted.

I'm not very familiar with Xamarin but I think it should work. If it doesn't please file an issue on the repo.

How do you see it being used? I'm especially interested in the C# widget toolkit you used this with, if any.

I haven't worked much with the c# bindings myself. It should be able to integrate into most widget toolkits fairly seamlessly I would think.

Re: Yoga: A cross-platform layout engine

#75

Why not use parallelism? Parallel layout tends to be a major speed boost in our experience, and we have a parallel implementation of flexbox already. See Meyerovich 2010 [1] for the basic idea; you can adopt it to flexbox relatively easily. Additionally, I'm a bit skeptical about the use of C here: this stuff tends to end up exposed to the user and security-sensitive. [1]: http://citeseerx.ist.psu.edu/viewdoc/downloa…

Parallelization is something that I've wanted to do for a long time and as you mentioned, flexbox is well suited for that :) Would love for someone to try and implement it!

Re: Yoga: A cross-platform layout engine

#77
post #62

One thing I've thought about recently is Facebook's Patent grants, and it's one thing that makes me uneasy about using any open source technology from Facebook like React (I currently do but am thinking to move to Preact because of the nicer MIT license and that it's analogous to React in many ways) because they're generally given a patent grant. I'm not a lawyer so I don't know if the grant would hold up in court si…

Please do not spread FUD, or at least clearly explain your worries. The patent clause only applies if you sue Facebook for patent infringement in React itself. It's a very clear defensive policy. Despite all the breathless blog posts claiming that you can lose your license for "competing" with Facebook, it is not true.

https://code.facebook.com/pages/850928938376556

Re: Yoga: A cross-platform layout engine

#79
post #77
post #62

One thing I've thought about recently is Facebook's Patent grants, and it's one thing that makes me uneasy about using any open source technology from Facebook like React (I currently do but am thinking to move to Preact because of the nicer MIT license and that it's analogous to React in many ways) because they're generally given a patent grant. I'm not a lawyer so I don't know if the grant would hold up in court si…

Please do not spread FUD, or at least clearly explain your worries. The patent clause only applies if you sue Facebook for patent infringement in React itself . It's a very clear defensive policy. Despite all the breathless blog posts claiming that you can lose your license for "competing" with Facebook, it is not true. https://code.facebook.com/pages/850928938376556

I never said that you could lose your license for competing against Facebook, I said that you could lose your license if you have a patent and assert it against Facebook if it infringes. This is the patent grant from React, which is identical to the grant in the post's repo as well. The language in the patent grant is pretty clear and doesn't mention anything about React specifically:

The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software. Notwithstanding the foregoing, if Facebook or any of its subsidiaries or corporate affiliates files a lawsuit alleging patent infringement against you in the first instance, and you respond by filing a patent infringement counterclaim in that lawsuit against that party that is unrelated to the Software, the license granted hereunder will not terminate under section (i) of this paragraph due to such counterclaim.

Also, your link doesn't actually dispel any fears I have. It specifically doesn't mention about if I sue Facebook for patent infringement if I have a valid patent that Facebook infringes upon, which is the main basis of my argument and worry.

Re: Yoga: A cross-platform layout engine

#80
post #62

One thing I've thought about recently is Facebook's Patent grants, and it's one thing that makes me uneasy about using any open source technology from Facebook like React (I currently do but am thinking to move to Preact because of the nicer MIT license and that it's analogous to React in many ways) because they're generally given a patent grant. I'm not a lawyer so I don't know if the grant would hold up in court si…

This project is under the BSD license, which is equally silent about patent rights to the MIT license, making it ambiguous whether it applies to patents. The patent license is on top of that; Facebook's approach is basically strictly more permissive, patents-wise, than typical use of the MIT license. (But not as permissive as the Apache 2 license, which contains explicit patent grants with a "don't sue us" condition that only applies to the specific software being licensed.)

Well, there's some argument that including a patent license makes the other license less likely to be construed as implicitly extending to patents, even if it says "additional". But you really shouldn't be depending on either the MIT or BSD license counting as a patent license.

See also: https://writing.kemitchell.com/2016/09/21/MIT-License-Line-b...

Edit: I misremembered the scope of the Apache 2 patent license, sorry.

Post reply on HN