This is a perfect example of why we need parallel restyling. :)
This is a perfect example of why we need parallel restyling. :)
Is it worth restricting an editor to only styles that don't influence block layout? For example, should it be impossible for a theme to make comment lines taller or shorter? I don't know; it's a tradeoff between performance and flexibility. My feeling is that there's a lot more room to improve the implementation before we have to resort to reducing capabilities, but reasonable people can disagree.
Of course not; everyting should be in the same damned monospaced font in a text editor for writing code.
The only actual reason I can think of for it is alignment, and that seems like a minimal benefit really. Variable width text is generally considered easier to read, so why couldn't this also apply to code?
Because alignment.
>The only actual reason I can think of for it is alignment, and that seems like a minimal benefit really.
Most programmers I know would argue otherwise, including me. Wanna try a poll?
>Variable width text is generally considered easier to read, so why couldn't this also apply to code?
Because it's only considered "easier to read" for general text (books, articles, etc) where you don't need to quickly see anything standing out of the ordinary, and alignment doesn't matter.
Even for traditional uses like accounting, "variable width" is not considered easier to read.
It's not just for neatness; either. Alignment shows where differences are between similar lines. And not necessarily consecutive lines. For instance, if we rapidly flip the editing window back and forth between two buffers showing similar code, we can see the differences as the moving parts in a two-frame animation.
Even in proportional fonts, the digits 0 to 9 get the same width. Why? So that tables of figures will look reasonable.
We don't want 1111.11 looking narrower than the 100.00 in the preceding row.
I want everything to be crisply aligned between lines like:
xr = x * cos(theta) - y * sin(theta);
yr = x * sin(theta) + y * cos(theta);
This makes it easy to see where the differences are. Any gratuitous deviation from the alignment is visually distracting. I want to be able to scan the thing vertically y and see that I have two x's, two y's, cos/sin sin/cos, and -/+ at a glance.Based on my limited experience, most text editors don't have correct information for off-screen content anyways, as they tend to do lazy syntax highlighting, which you can sometimes see adjusting while you scroll.
To know how high the editor is, for scroll bars, Sublime Text-style minimaps, etc.
Computing metrics basically requires computing full style information. Doing cascading for any property isn't much more expensive than doing cascading for all properties.
> Based on my limited experience, most text editors don't have correct information for off-screen content anyways, as they tend to do lazy syntax highlighting, which you can sometimes see adjusting while you scroll.
Sure. The way to do that in the Web platform is to do what Atom is doing here: adjust styles only when elements come into view. IntersectionObserver can be useful for that.
It would be great to have a small high-performance subset. The subset needs not have low expression power, though.
That includes font-* and many other attributes that affect text rendering. It isn't possible to know the length of a line of text without computing most of the text layout in modern font rendering. Font family/size/variant, weight, kerning, vertical hinting, traditional horizontal hinting, and LCD subpixel hinting all influence character positions at 1/256 pixel resolution. I highly recommend this[1] paper for a good overview of how this works, which includes an analysis of why Microsoft's older font handling caused serious layout issues (cumulative x-length error) due to over-hinting that forced glyphs onto the pixel grid.
> editors
Monospace fonts usually let you ignore most of these issues, but some (crazy?) people program with proportional fonts[2], and we can't actually ignore Unicode...
(I just use an 80/20 solution: fast - and predictable - Terminus and Dina bitmap fonts most of the time, and let Unicode distort the layout with other stuff as needed)
[1] http://www.antigrain.com/research/font_rasterization/index.h...
Which give even more credence to what the parent said: that "CSS isn't the right abstraction for styles in a text editor…".
We don't really need the "more power" in an editor, but we could use the less slugginess (and less conceptual overhead) than what CSS offer.
>Is it worth restricting an editor to only styles that don't influence block layout? For example, should it be impossible for a theme to make comment lines taller or shorter?
I'm pretty sure existing editors can do that today too, without CSS. Setting a different font size for comment lines for example.
Also, you are going nuts with the scare quotes. I don't even see what point you are trying to make with those.
That's debatable for the vast majority of them. "Clearly" is a strong word here. And certainly, regardless of how "good" they are, almost none are worth the hit in performance in the most basic of tasks for me.
Extension quality is a bit subjective, sure. But if you are going to claim that emacs extensions are of higher quality because they're written in a more obscure language, then you should give evidence. That is not my experience.
I use TortoiseGit and IDEs to access Github.
Have any of you seen the kind of stuff recent games draw in 16 ms? It's amazing! They sure as hell don't use a work-stealing scheduler in a thread pool for single vertices, though.
Besides, vertices are a much simpler problem than CSS styling. CSS supports hundreds of properties, all of which are parsed and cascaded differently. You have properties that are inherited and properties that are noninherited. You have properties that depend on other properties: for example, any lengths might be specified in terms of ems, which means you have to have resolved the font size first. You have properties that result in completely different render trees, for example "display". You can't effectively throw stream processors like GPUs at the problem (believe me, I've tried).
Could we do better? Sure. But every proposed replacement for CSS I've seen (e.g. Cassowary) has made the complexity problem worse. And most native styling solutions I've seen are usually just very slow implementations of CSS. Separating presentation and markup is just hard, no matter what.
Hi, what other proposed replacements for CSS do you know about? I'm interested in seeing what problems they ran into.
I need to go look at Cassowary again. IIRC it's a solver, so sometimes the layout won't be what you expected, and it's very hard to know what to change such that it does what you want.
For us ordinary folks trying to write good applications that can be maintained by one person and scale reasonably well, there's justifiable reason to jump off this rollercoaster and work in a more humble environment with modest perf/safety tradeoffs and native code executables(e.g. Go, Basic, Pascal).
Where the funding comes from is practically irrelevant, specially if it is a feedback function (i.e., an economic phenomenon, not "phone the legislature to fund more research!!1").
New funding models are good, too, of course. But the tone of the anti-ad camp is asinine.
The SV camp has said nothing to convince me otherwise.
I preper phoning the legislature -- more democratic and less private interests-driven.
Is the whole CSS debacle a particularly unlikely concept to yield anything close to a reasonable performing implementation? Sure, but that is because nobody has applied the pressure necessary. People won't play a game that doesn't consistently meet a 30 ms deadline but they seem to happily put up with 3 seconds to final render and call it "amazing".
GPUs work here because games fundamentally operate on a list-like datastructure (the display list), with little interdependence.
Styling on the other hand operates on a tree like datastructure (the DOM), with lots of interdependence.
Cascading isn't something games need at all, and if it was, it could be precomputed. THis can't be done in webpages.
You don't have analogues for tree-structure-based "selectors" and anything more than straightforward property inheritance (e.g. inheritance of transformations in a skeleton) in game engines. CSS is much more complex in this aspect.
The DOM having lots of legacy issues is not the reason styling is slow.
CSS is designed for a lot of flexibility and can't be precompiled, which is why it is slow to style.
I disagree. Look up how modern material systems work. There absolutely are analogous things going on to CSS in PBR rendering, shaders, multipass compositing etc.