4 ms·
But why would you expect to use WebKit to render rich text? If using an HTML/CSS/JS renderer to render text is "completely appropriate", what isn't appropriate
by stavros 6mo ago
But why would you expect to use WebKit to render rich text? If using an HTML/CSS/JS renderer to render text is "completely appropriate", what isn't appropriate for it? Why would you not render everything with it?
I don't understand how you go from "rendering text is completely appropriate" but then "rendering everything is ridiculous".
- joenot443 6mo ago> what isn't appropriate for it? It'd be very silly to render a shader pipeline in WebKit. You could, but with Metal sitting right there, it would be silly.
- stavros 6mo agoIf we're all agreeing that all the native elements are useless, I can see how the question is "do I use Metal or do I use WebKit", but my question wasn't about WebKit vs metal, it was WebKit vs native elements.
- Wowfunhappy 6mo agoI mean, this is why I think PDFKit is a good comparison. Could you render your app's entire UI as a series of PDFs? Absolutely! Should you do that? Uh, probably not. You should use the native controls Apple gives you for buttons and dialogs and input fields and so on. But WebKit is the native UI for HTML, and Markdown is intended to be transpiled to HTML.
- stavros 6mo agoIt's irrelevant what Markdown was meant to be transpiled to. When people say "Markdown support" these days, they mean "rich text support", since Markdown is actually just ASCII. It is ridiculous to need a Web renderer to render rich text, on any platform. Even terminal emulators can do it.
- Wowfunhappy 6mo agoHTML is basically analogous to RTF, no?
- nottorp 6mo agomaybe html 0.9 :)
- deleted 6mo ago[deleted]
- carlosjobim 6mo agoIf think that the MacOS GUI is actually entirely rendered as a series of PDFs, if I have understood things correctly.
- jonhohle 6mo agoThat’s how it originally worked, but Apple has moved away from PDF to other native GPU frameworks for drawing. Now window content is stored as bitmaps instead of redrawing vector instructions.
- mpweiher 6mo agoThat's not how it ever worked. Quartz is a vector drawing engine whose output can be captured as a PDF and which is closely aligned with the PDF imaging model. Window content was always stored as bitmaps.
- jonhohle 6mo agoYou’re correct. I meant to say textures, but even that isn’t completely accurate. AppKit used to generate the bitmap directly through CoreGraphics (PDF model). Now it uses Core Animation and Metal and no longer draws the bitmap directly.
- mpweiher 6mo agoYou have understood things incorrectly.
- p-e-w 6mo ago> But why would you expect to use WebKit to render rich text? Because rendering rich text correctly and consistently is one of the hardest problems in software. Bidirectional text, a million glyph shaping complexities, mixed content such as inline images and different text sizes, reflow that should take milliseconds, natural-feeling selection, etc etc. No implementation comes even close to browser rendering engines in covering all of these.
- mrbombastic 6mo agoa bit of a roundabout way to answer this, but i think most native devs are okay with a self contained app element using webkit, that is what it is there for and generally stuff like rendering html, markdown, a one off static page, it is just a view from UI perspective. When things get more interactive, have a navigation hierarchy, animations etc are when things start to diverge from native feel and performance and you have gone too far.
- tardedmeme 6mo agoUsing an HTML renderer to render arbitrarily formatted text with full HTML formatting capabilities makes perfect sense. If that's your problem statement, then you kinda need an HTML renderer.
- stavros 6mo agoThe author wasn't trying to render HTML. Everyone is focusing on the word "Markdown", I wish the author had just said "rich text" instead so we could actually have a fruitful conversation.
- Wowfunhappy 6mo agoBut if he'd said rich text the answer would be different! Markdown is designed to be converted to html, and in fact it can contain html.
- stavros 6mo agoRight, but he clearly didn't mean HTML, otherwise he wouldn't be trying native elements in the first place.
- tardedmeme 6mo agoHe means Markdown, but Markdown is mean to turn into HTML. Rendering it any other way than converting it to HTML gives a different result, and if anyone complains about it, it'll be your fault since you didn't render it the proper way. It turns out a lot of things are like this. Another commentator mentioned Slack messages.
- Wowfunhappy 5mo agoI feel like Typescript is a good analogy here. Typescript is its own language, but it is intended to be transpiled into Javascript. Yes, you could probably create a JIT that executes Typescript directly—but you would do so at your own peril. Reaching for an existing Javascript interpreter such as JavaScriptCore or V8 is the logical choice.