A place to cache linked articles (think custom and personal wayback machine)
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="fr">
  4. <!-- Has to be within the first 1024 bytes, hence before the <title>
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>as days pass by (archive) — David Larlet</title>
  13. <meta name="description" content="Publication mise en cache pour en conserver une trace.">
  14. <!-- That good ol' feed, subscribe :). -->
  15. <link rel="alternate" type="application/atom+xml" title="Feed" href="/david/log/">
  16. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  17. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  18. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  19. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  20. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  21. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  22. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  23. <meta name="msapplication-TileColor" content="#f0f0ea">
  24. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  25. <meta name="theme-color" content="#f0f0ea">
  26. <!-- Documented, feel free to shoot an email. -->
  27. <link rel="stylesheet" href="/static/david/css/style_2020-06-19.css">
  28. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  29. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  30. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  31. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  32. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  34. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  35. <script type="text/javascript">
  36. function toggleTheme(themeName) {
  37. document.documentElement.classList.toggle(
  38. 'forced-dark',
  39. themeName === 'dark'
  40. )
  41. document.documentElement.classList.toggle(
  42. 'forced-light',
  43. themeName === 'light'
  44. )
  45. }
  46. const selectedTheme = localStorage.getItem('theme')
  47. if (selectedTheme !== 'undefined') {
  48. toggleTheme(selectedTheme)
  49. }
  50. </script>
  51. <meta name="robots" content="noindex, nofollow">
  52. <meta content="origin-when-cross-origin" name="referrer">
  53. <!-- Canonical URL for SEO purposes -->
  54. <link rel="canonical" href="https://www.kryogenix.org/days/2020/05/06/hammer-and-nails/">
  55. <body class="remarkdown h1-underline h2-underline h3-underline hr-center ul-star pre-tick">
  56. <article>
  57. <header>
  58. <h1>as days pass by</h1>
  59. </header>
  60. <nav>
  61. <p class="center">
  62. <a href="/david/" title="Aller à l’accueil">🏠</a> •
  63. <a href="https://www.kryogenix.org/days/2020/05/06/hammer-and-nails/" title="Lien vers le contenu original">Source originale</a>
  64. </p>
  65. </nav>
  66. <hr>
  67. <main>
  68. <p>There is a Linux distribution called Gentoo, named after a type of penguin (of <em>course</em> it&#8217;s named after a penguin), where installing an app doesn&#8217;t mean that you download a working app. Instead, when you say &#8220;install this app&#8221;, it downloads the source code for that app and then compiles it on your computer. This apparently gives you the freedom to make changes to exactly how that app is built, even as it requires you to have a full set of build tools and compilers and linkers just to get a calculator. I think it&#8217;s clear that the world at large has decided that this is not the way to do things, as evidenced by how almost no other OSes take this approach &#8212; you download a compiled binary of an app and run it, no compiling involved &#8212; but it&#8217;s nice that it exists, so that the few people who really want to take this approach can choose to do&nbsp;so.</p>
  69. <p>This sort of thing gets a lot of sneering from people who think that all Linux OSes are like that, that people who run Linux think that it&#8217;s about compiling your own kernels and using the Terminal all the time. <em>Why would you want to do that sort of thing, you neckbeard,</em> is the underlying message, and I largely agree with it; to me (and most people) it seems complicated and harder work for the end user, and mostly a waste of time &#8212; the small amount of power I get from being able to tweak how a thing is built is vastly outweighed by the annoyance of <em>having</em> to build it if I want it. Now, a Gentoo user doesn&#8217;t actually have to know anything about compilation and build tools, of course; it&#8217;s all handled quietly and seamlessly by the install command, and the compilers and linkers and build tools are run for you without you needing to understand. But it&#8217;s still a bunch of things that my computer has to do that I&#8217;m just not interested in it doing, and I imagine you feel the&nbsp;same.</p>
  70. <p>So I find it disappointing that this is how half the web industry have decided to make websites these&nbsp;days.</p>
  71. <p>We don&#8217;t give people a website any more: something that already works, just <span class="caps">HTML</span> and <span class="caps">CSS</span> and JavaScript ready to show them what they want. Instead, we give them the bits from which a website is made and then have <em>them</em> compile&nbsp;it.</p>
  72. <p>Instead of an <span class="caps">HTML</span> page, you get some templates and some <span class="caps">JSON</span> data and some build tools, and then that compiler runs in your browser and assembles a website out of the component parts. That&#8217;s what a &#8220;framework&#8221; <em>does</em>… it builds the website, in real time, from separate machine-readable pieces, on the user&#8217;s computer, every time they visit the website. Just like Gentoo does when you install an app. Sure, you could make the case that the browser is always assembling a website from parts &#8212; <span class="caps">HTML</span>, <span class="caps">CSS</span>, some <span class="caps">JS</span> &#8212; but this is another step beyond that; we ship a bunch of stuff in a made-up framework and a set of build tools, the build tools assemble <span class="caps">HTML</span> and <span class="caps">CSS</span> and JavaScript, and <em>then</em> the browser still has to do its bit to build that into a website. Things that should be a long way from the user are now being done much closer to them. And why? &#8220;<a href="https://macwright.org/2020/05/10/spa-fatigue.html">We&#8217;re layering optimizations upon optimizations in order to get the <span class="caps">SPA</span>-like pattern to fit every use case</a>, and I’m not sure that it is, well, worth it.&#8221; says Tom&nbsp;MacWright.</p>
  73. <p>Old joke: someone walks into a cheap-looking hotel and asks for a room. You&#8217;ll have to make your own bed, says the receptionist. The visitor agrees, and is told: you&#8217;ll find a hammer and nails behind the&nbsp;door.</p>
  74. <blockquote class="twitter-tweet" data-conversation="none" data-theme="dark"><p lang="en" dir="ltr">What about the About page? That is just static text, surely that’s quicker? No, it is worse. (Of course, all the <span class="caps">JS</span>/<span class="caps">CSS</span> would be cached, but so to on mine, and you still don’t have to wait for <span class="caps">JS</span> to construct your <span class="caps">HTML</span> if you just give it <span class="caps">HTML</span>.) <a href="https://t.co/Rxyz322ngt">pic.twitter.com/Rxyz322ngt</a></p>&mdash; Matthew Somerville (@dracos) <a href="https://twitter.com/dracos/status/1251836599421329410?ref_src=twsrc%5Etfw">April 19, 2020</a></blockquote>
  75. <p><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> </p>
  76. <p>Almost all of us don&#8217;t want this for our native apps, and think it would be ridiculous; why have we decided that our users have to have it on their websites? Web developers: maybe stop insisting that your users compile your apps for you? Or admit that you&#8217;ll put them through an experience that you certainly don&#8217;t tolerate on your own desktops, where you expect to download an app, not to be forced to compile it every time you run it? <em>You&#8217;re</em> not neckbeards… you just demand that your users have to be. You&#8217;re neckbeard <em>creators</em>. You want to browse this website? Here&#8217;s a hammer and&nbsp;nails.</p>
  77. <p>Unless you run Gentoo already, of course! In which case… compile away. <img src="https://kryogenix.org/images/penguin.png"
  78. alt="" style="display:inline;box-shadow:none;vertical-align:text-top"></p>
  79. </main>
  80. </article>
  81. <hr>
  82. <footer>
  83. <p>
  84. <a href="/david/" title="Aller à l’accueil">🏠</a> •
  85. <a href="/david/log/" title="Accès au flux RSS">🤖</a> •
  86. <a href="http://larlet.com" title="Go to my English profile" data-instant>🇨🇦</a> •
  87. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel">📮</a> •
  88. <abbr title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340">🧚</abbr>
  89. </p>
  90. <template id="theme-selector">
  91. <form>
  92. <fieldset>
  93. <legend>Thème</legend>
  94. <label>
  95. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  96. </label>
  97. <label>
  98. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  99. </label>
  100. <label>
  101. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  102. </label>
  103. </fieldset>
  104. </form>
  105. </template>
  106. </footer>
  107. <script type="text/javascript">
  108. function loadThemeForm(templateName) {
  109. const themeSelectorTemplate = document.querySelector(templateName)
  110. const form = themeSelectorTemplate.content.firstElementChild
  111. themeSelectorTemplate.replaceWith(form)
  112. form.addEventListener('change', (e) => {
  113. const chosenColorScheme = e.target.value
  114. localStorage.setItem('theme', chosenColorScheme)
  115. toggleTheme(chosenColorScheme)
  116. })
  117. const selectedTheme = localStorage.getItem('theme')
  118. if (selectedTheme && selectedTheme !== 'undefined') {
  119. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  120. }
  121. }
  122. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  123. window.addEventListener('load', () => {
  124. let hasDarkRules = false
  125. for (const styleSheet of Array.from(document.styleSheets)) {
  126. let mediaRules = []
  127. for (const cssRule of styleSheet.cssRules) {
  128. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  129. continue
  130. }
  131. // WARNING: Safari does not have/supports `conditionText`.
  132. if (cssRule.conditionText) {
  133. if (cssRule.conditionText !== prefersColorSchemeDark) {
  134. continue
  135. }
  136. } else {
  137. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  138. continue
  139. }
  140. }
  141. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  142. }
  143. // WARNING: do not try to insert a Rule to a styleSheet you are
  144. // currently iterating on, otherwise the browser will be stuck
  145. // in a infinite loop…
  146. for (const mediaRule of mediaRules) {
  147. styleSheet.insertRule(mediaRule.cssText)
  148. hasDarkRules = true
  149. }
  150. }
  151. if (hasDarkRules) {
  152. loadThemeForm('#theme-selector')
  153. }
  154. })
  155. </script>
  156. </body>
  157. </html>