HNHacker News
TopNewBestAskShowJobs

rikroots

1,620 karma · joined June 28, 2019

submissionscomments
rikroots··on An SVG is all you need
It's sub-optimal in that browser developers have - for a number of legitimate reasons - chosen not to spend their time building SVG engines into their browsers that are efficient, robust and fast. I think its more a story of benign neglect rather than active discouragement. Compared to the Javascript and CSS engines, which have improved massively over the past decade, SVG remains ... serviceable for basic requirements (simpler stuff - static graphics, icons, etc), but nothing more. If that makes sense?
rikroots··on An SVG is all you need
SVG rendering on browsers is still sub-optimal, which I think is a shame as SVG has great potential if it was treated as a first-class element on the web. Recent improvements to the code driving (2D) Canvas API canvas elements shows that this work could be done across browsers. The big thing holding back development is possibly the continuing failure to finalise the SVG2 standard?
rikroots··on Craft software that makes people feel something
This explains my entire drive with my work on my canvas library. I wanted to do something different with the way I was presenting my poems on my poetry website, so I went away and built something which would help me do just that. I didn't expect the library to take over the majority of my spare time for over a decade, but then I was having too much fun to stop.

The library's on GitHub and I could spam a link to it here, but it's much more exciting to spam a link to a poem that finally gets to use it - https://rikverse2020.rikweb.org.uk/poem/flaw

rikroots··on Prompt Injection via Poetry
> Can someone explains why does that work?

I've discovered that if you lecture the LLM long enough about treating the subject you're interested in as "literary" then it will engage with the subject along the lines of "academic interpretation in literature terms". I've had to have this conversation with various LLMs when asking them to comment on some of my more-sensitive-subject-matter poems[1] and the trick works every time.

> I mean you can't social engineer a human using poetry?

Believe me, you can. Think of a poem not as something to be enjoyed, or studied. Instead, think of them as digestible prompts to feed into a human brain which can be used to trigger certain outlooks and responses in that person. Think in particular of poetry's close relations - political slogans and advertising strap lines.

[1] As in: poems likely to trigger warning responses like "I am not allowed to discuss this issue. Here are some numbers to support lines in your area".

rikroots··on Zig quits GitHub, says Microsoft's AI obsession has ruined the service
> Things like number of stars on a repository, number of forks, number of issues answered, number of followers for an account. All these things are powerful indicators of quality, and like it or not are now part of modern software engineering.

I hate that this is perceived as generally true. Stars can be farmed and gamed; and the value of a star does not decay over time. Issues can be automatically closed, or answered with a non-response and closed. Numbers of followers is a networking/platform thing (flag your significance by following people with significant follower numbers).

> Developers are more likely to use a repo that has more stars than its alternatives.

If anything, star numbers reflect first mover advantage rather than code quality. People choosing which one of a number of competing packages to use in their product should consider a lot more than just the star number. Sadly, time pressures on decision makers (and their assumptions) means that detailed consideration rarely happens and star count remains the major factor in choosing whether to include a repo in a project.

rikroots··on The Fat-Tailed Sheep on the First Fleet; Australia's First Sheep
Interesting article - of all parts of the lamb/mutton to eat, tail was not a cut I'd heard of before.

If we're talking sheep, then I have to put out a shout for my local breed - the Romney Marsh sheep (the sheep that conquered the world!) - https://en.wikipedia.org/wiki/Romney_sheep

rikroots··on New way to organically market your product
tl;dr: This is a link to a sign up sheet for a yet-to-be delivered product promising something that is vaguely hinted at - "Drive traffic [...] AI-powered [...] help you create and share content [...]" - nothing to see here.

And yet the CTA touches on something I find deeply interesting: how can we use LLMs to make products more discoverable to people using LLMs to search for products to solve their particular problems.

I put some work into this over the summer - prepping my canvas library repo (and my author site, but that's just vanity) with LLM-friendly documentation and training data which I hope will, at some point, get picked up by the AI data scrapers and crawlers for inclusion in the next generation of training data, to be used in turn to train the next generation of LLMs.

The big downside to this approach is, of course, the terrible lead-in times (6-18 months) alongside the lack of guarantee that the docs I've written will be good enough to pass muster and make it into the training data sets.

But the payoff I'm after is to get accurate, unbiased information about my canvas library into LLMs in such a way that when people ask general questions about coding up the canvas element my library gets ranked alongside the usual suspects, and gets assessed fairly against them. Plus having accurate "how to" templates to minimise the glaring mistakes current LLMs make when hallucinating how they think my library should be used.

rikroots··on How to build silos and decrease collaboration on purpose
Reminds me of why I left the Civil Service after 18 years. The volume of stupidity seems to increase exponentially, the higher you climb through the ranks.
rikroots··on Dithering – Part 1
I responded in that post (though not to you, and probably not what you're after) with a link to my JS canvas library's "reduce palette" filter. It includes both supplying an array of colors to act as the palette, and setting the required number of colors for which the filter can calculate a "commonest colors" palette, calculating color distances in the OKLAB color space - https://scrawl-v8.rikweb.org.uk/demo/filters-027.html

If anyone wants to see the filter code, it in the GitHub repo here: https://github.com/KaliedaRik/Scrawl-canvas/blob/064469928a3...

rikroots··on Image Dithering: Eleven Algorithms and Source Code (2012)
I rewrote my canvas library's "reduce-palette" filter last month to make it a lot more code-efficient (because: the library doesn't use web workers, WebGL, etc). But the main reason to go hunting for efficiencies was my (slightly unhinged) decision to do all the color distance calculations in the OKLAB color space.

Demo here: https://scrawl-v8.rikweb.org.uk/demo/filters-027.html

rikroots··on The Scrawl-canvas graphical filter system
Posting because I've spent the summer giving my JS canvas library's filter system a major code overhaul to make it more performant. The system itself is inspired by the SVG approach to composing filters.

Practical demo here: https://scrawl-v8.rikweb.org.uk/demo/canvas-007.html

rikroots··on Our Paint – A featureless but programmable painting program
> 16 bit as standard. Do a gradient in an 8 bit Photoshop document and you will see how limited 8 bit info is. (OUR PAINT supports this).

For interest, this seems to be an active issue for the HTML <canvas> element in browsers. There's a proposal[1] to extend the canvas data type to include both "unorm8" (the beloved default) and a new "float16" (normalised?) format - which should meet your desire?

Typically, the proposal seems to have shipped already in Chrome/Edge browsers. Documentation around what the new functionality is for and how to make best use of it is (of course!) sparse - MDN barely mentions it. As a canvas library maintainer I find this upsetting (eg: Ignore it and it might Go Away).

(I think for now my unhelpful response is: manipulate your RGB images as much as you like; just do it in the OKLAB color space.)

[1] - https://github.com/w3c/ColorWeb-CG/blob/main/hdr_html_canvas...

rikroots··on An open-source maintainer's guide to saying “no”
I await the first LLM generated PR to my JS canvas library with eager anticipation.

I can't wait to ask them if they've run the PR branch against all of the test demos, so they can prove that the PR doesn't break existing functionality. Currently there's just under 200 test demos, each of which needs to be tested manually (because: hell = canvas library + animation) across the three main browsers to make sure nothing breaks. Bonus points for going the extra mile for testing on mobile device browsers.

rikroots··on Eels are fish
Human embryogenesis would like to disagree with you.

https://www.bbc.co.uk/news/health-13278255

rikroots··on Monday – A personality experiment
I had a rather pleasing interaction with this persona[1]. I'm thinking: if the British had invented and trained ChatGPT, this is the sort of conversation everyone could've been having from the first day it launched.

Which is fun, but also a really bad marketing move - OpenAI really did an excellent job with the post-training thing to increase user time on the page with all the "How about I do this or that thing next for you" nonsense.

[1] - https://chatgpt.com/share/68a1c7fa-22d0-8004-ab28-6825e0e3b9...

rikroots··on The electric fence stopped working years ago
My coping mechanism for interacting with people who approach me is: 1. Act friendly and open when they start talking to me; 2. centre the questions on them, hoping that they reveal information that might clue me in on who they are. It's only in recent years that I've learned step 3: if I haven't recognised them in the first 10-20 seconds, mention that I'm face blind (usually as an apology) and ask them who they are. Most times that is enough to stop the encounter turning sour.

My coping mechanism for approaching a person I think I might know (usually in spaces where I wouldn't expect to encounter them) is: don't. At least not immediately. Rather, watch and observe (if possible) to see if the voice/gestures/body positions/etc firm up enough to bring the certainty levels up and the risk levels down.

I think I'd make a good spy, if only I didn't suffer from this face blindness nonsense.

rikroots··on Show HN: Shaders – WebGPU effects for front end frameworks
Complete tangent ... but whenever I see something like this waiting list sign up thing, my mind goes back to the famo.us debacle - now 10 years ago. That one didn't end happily: https://news.ycombinator.com/item?id=10520181

Slightly more on-topic: yes, WebGL/WebGPU canvas shader backgrounds are wonderful to behold, but the question I always ask is: are they worth it? Could something less snazzy but coded in HTML/CSS (and maybe a touch of 2D canvas) perform just as well for pulling potential customers into the funnel? Has anyone ever AB tested their animated backgrounds to demonstrate the effectiveness of the investment?

rikroots··on How well do coding agents use your library?
I've done a lot of work recently to make my library more "LLM Friendly", but I'm not willing at this time to sign up to a service which I don't know I'd ever use again just to run a test on your behalf. If you want to run the test on my library then its GitHub can be found here: https://github.com/KaliedaRik/Scrawl-canvas
rikroots··on A Guide Dog for the Face-Blind
I commented about my experiences of Prosopagnosia in this recent HN thread here: https://news.ycombinator.com/item?id=44484595#44487570
rikroots··on “The Hollow Men” at 100
I was going to respond saying how much I dislike the way the narrator reads the poem - like a vicar 45 minutes into an overlong Sunday sermon, as bored as the congregation - then I saw the OP article included a link to Eliot reading his own poem. And that one sounds like the vicar now entering the third hour of his overlong Sunday sermon. So I have to agree: your favourite reading is the better reading of the poem.
rikroots··on Rethinking DOM from first principles
I really wish this was true. Sadly the caniemail website - https://www.caniemail.com/ - says that Gmail still doesn't support CSS grid or flex, which leaves nested tables for layout as the only viable solution for HTML emails (which, however many times you plead with your marketing colleagues, is still their preferred way for contacting/stalking customers).
rikroots··on Genie 3: A new frontier for world models
> Granted, you can say "you still can play musical instruments/paint pictures/etc for yourself", but I don't think there was ever a period of time where creative works were just created for sake of itself rather for sharing it with others at masse.

There's a whole host of "art" that has been created by people - sometimes for themselves, sometimes for a select few friends - which had little purpose beyond that creation[1]. Some people create art because they simply have to create art - for pleasure, for therapy, for whatever[2]. For many, the act of creation was far more important than the act of distribution[3].

For me, my obsession is constructing worlds, maps, societies and languages that will almost certainly die with me. And that's fine. When I feel the compulsion, I'll work on my constructions for a while, until the compulsion passes - just as I have done (on and off) for the past 50 years. If the world really needs to know about me, then it can learn more than it probably wants to know through my poetry.

[1] - Emily Dickinson is an obvious example: https://en.wikipedia.org/wiki/Emily_Dickinson

[2] - Coral Castle, Florida: https://en.wikipedia.org/wiki/Coral_Castle

[3] - Federico Garcia Lorca almost certainly didn't write his Sonetos del amor oscuro for publication - he just needed to write them: https://es.wikisource.org/wiki/Sonetos_del_amor_oscuro

rikroots··on Tell HN: I'm tired of formulaic, "LLM house style" show HN submissions
I've shown a product on HN in both human-authored, and LLM-assisted, versions. Neither got traction. When I showed my human-authored submission to LLMs they summarised it as "not a good post likely to gain traction" because, basically "too British in tone". The initial attempt at generating post copy for the LLM-assisted version was surprisingly similar to the OP's critique. Maybe it would've gained more traction - but I hated it (far too boastful) so I told the LLM to pull back on the marketing crap and make it shorter.

Of course the most obvious response is that the product is too niche for general interest. Still, I'll stick to human-authored in the future because HN always needs more "British".

rikroots··on HTML-in-Canvas
Please excuse me for spamming this thread with examples of how my canvas library approaches these issues:

> Use case: Styled, Laid Out Content in Canvas. There’s a strong need for better styled text support in Canvas. Examples include chart components (legend, axes, etc.), rich content boxes in creative tools, and in-game menus.

Single line, unstyled text is relatively easy using the Canvas API. Multiline text is a world-of-pain. Styled text is a completely separate world-of-pain. Underlined text? Same! So that's gives us a problem space of world-of-pain-cubed. Don't talk to me about RTL text, vertical text, CJK punctuation, Thai text ignoring spaces as a word separator, heavily kerned fonts (staring at you, Arabic and Devangari), etc.

Demo: https://scrawl-v8.rikweb.org.uk/demo/canvas-207.html

This demo takes the following html markup and displays it in a truncated circle shape. The styling itself happens in CSS - see here: https://github.com/KaliedaRik/Scrawl-canvas/blob/v8/demo/can...

  const westernText = '<span class="underline">Lorem</span> ipsum <b>dolor sit</b> amet, con&shy;sectetur  adi&shy;piscing &eacute;lit, sed <s>do eius-mod</s> <u>tempoj yn&shy;figizqunt</u> ut <span class="stamp-outlined">labore et dolore</span> <span class="green-highlight">magna aliqua.</span> Ut enim ad <span class="bold">minim veniam,</span> quis <span class="letter-spaced">nostrud</span> exercit-ation <span class="strike">ullamco laboris</span> nisi ut aliquip ex ea <span class="make-monospace">"commodo"</span> consequat. Duis <em>(aute irure d&ouml;lor)</em> in reprehenderit &icirc;n <i>voluptate</i> velit &copy;2024 <i>esse &lt;cillum&gt; <b>dolore</b> eu fugiat nulla</i> pariatur. <span class="red">Excepteur sint</span> occaecat &iexcl;cupidatat! <strong>non proident,</strong> <span class="word-spaced">sunt in culpa qui</span> offici&thorn;a deserunt <span class="make-bigger"><span class="green-highlight">mollit</span> anim</span> id est laborum.';
As for the other things I don't want to talk about, see this other demo which attempts to overcome those issues: https://scrawl-v8.rikweb.org.uk/demo/canvas-206.html

> Use case: Accessibility Improvements. There is currently no guarantee that the canvas fallback content currently used for <canvas> accessibility always matches the rendered content, and such fallback content can be hard to generate. With this API, elements drawn into the canvas bitmap will match their corresponding canvas fallback.

I welcome and applaud this focus on making canvas text accessible. However it's not enough (in my highly opinionated opinion) to just reflect the text back into the DOM. People using screen readers probably don't need every number on the Y axis read out to them every time they navigate onto a chart, they probably just need to hear values as they keyboard navigate the chart.

Demo: https://scrawl-v8.rikweb.org.uk/demo/modules-001.html

The canvas element is highly inaccessible - I've tried to detail all the issues that have to be addressed here (again, a highly opinionated take): https://scrawl-v8.rikweb.org.uk/docs/reference/sc-accessibil...

> Use case: Composing HTML Elements with Shaders. A limited set of CSS shaders, such as filter effects, are already available, but there is a desire to use general WebGL shaders with HTML.

We already have a comprehensive set of filter effects available through SVG <filter> elements. They are, however, difficult to compose and have a tendancy to be computationally heavy. WebGL shaders can be fantastic, but face the (current) limit of how many WebGL canvas elements you can include on a page; they're also difficult to compose.

For my library's filter engine, I took inspiration from the SVG approach. Details can be found here: https://scrawl-v8.rikweb.org.uk/docs/reference/sc-filter-eng...

> Use case: HTML Rendering in a 3D Context. 3D aspects of sites and games need to render rich 2D content into surfaces within a 3D scene.

HTML canvas elements are just DOM elements, and can be 3d-rotated like other elements. Interacting with 3d-rotated canvas elements is an interesting problem space.

Classic rotating cube demo: https://scrawl-v8.rikweb.org.uk/demo/dom-008.html

Tracking the mouse over a 3d-rotated canvas element demo: https://scrawl-v8.rikweb.org.uk/demo/dom-013.html

rikroots··on Face it: you're a crazy person
Wilfred Owen: soldier and poet (whose poetry was ignored/neglected until the 1960s)
rikroots··on We revamped our docs for AI-driven development
From my experience with my canvas library, devs seem to want different types of documentation for different purposes:

1. Something that tells them what the library does: what problems it's gonna solve for them; how easy it is to work with; etc. Having something to play with is really useful here, for instance some "Getting started" code to (very quickly) show them the basics and let them play with the library. A set of "learn to" lessons tackling some interesting problems is good bonus documentation, alongside a good range of demo code.

2. Something that they can show to whoever controls which libraries they can use in the product they're working on, to help convince them to let the dev use the library. Usually involves some marketing copy and comparison charts - whatever A/B tested copy|crap floats the boat.

3. Some easy-to-use lookup reference stuff - what function do I have to invoke to get this specific thing done? Stuff that their coding environment doesn't reveal at the click of a button. This is where the LLM-focussed documentation comes in (I think), given the move to using code assistants: failing to (be able to) teach the models what the library can do (and how to best do it) can lead to bad code and wasted time, which reflects really badly on the library.

rikroots··on The HTML Hobbyist (2022)
All of my canvas library's demo pages are hand-coded HTML, CSS and JS. Including the site navigation. Is it worth the effort? Probably not; I just do it this way because I'm too lazy to pull together a sensible tool chain.

https://scrawl-v8.rikweb.org.uk/demo/index.html

rikroots··on Ask HN: What are you working on? (July 2025)
I published 2 (two!) new chapbooks of poetry, both priced at $0.00:

> Sonnets of dark-held love - A sequence of poems after the 'Sonetos del amor oscuro' by Federico García Lorca - https://rikverse2020.rikweb.org.uk/book/sonnets-of-dark-held...

> End Time - A collection of noir-themed poems for the last days of the world - https://rikverse2020.rikweb.org.uk/book/end-time/

rikroots··on AI is killing the web – can anything save it?
This is why I've had to spend a huge amount of my free coding time this year documenting my canvas library[1][2] in a way that can (potentially[3]) be used as LLM training data instead of, well, developing my library with new and exciting (to me) features.

On the silver lining side, it's work that I should have been doing anyway. It turns out that documenting the features of the library in a way that makes sense to LLMs also helps potential users of the library. So, win:win.

[1] - Telling the LLM training data Overlords about the capabilities of the library is in itself a major piece of work: https://github.com/KaliedaRik/Scrawl-canvas/blob/v8/LLM-summ...

[2] - The Developer Runbook was long-overdue documentation, and is still a work-in-progress: https://scrawl-v8.rikweb.org.uk/documentation

[3] - Nothing is guaranteed, of course. Training data has to be curated so documentation needs to have some rigour to it. Also, the LLMs tell me it can take 6-12 months for such documentation to be picked up and applied to future LLM model iterations so I won't know if my efforts have been successful before mid-2026.

rikroots··on Nobody has a personality anymore: we are products with labels
Developmental prosopagnosia wasn't recognised as a "thing" before the late 2000s. Before that, everybody assumed that being able to recognise someone was just something everyone, well, did. Failure to recognise a friend or relative in the street was seen as an affront, or a deliberate snub. Failure to recognise famous people in films or on the TV was something to be ridiculed. Prosopagnosiacs quickly learn coping strategies growing up in such a world, but those recognition mechanisms are significantly slower: they don't solve the problem.

It is amazing how upset even the most decent and understanding of people can get when they feel you've slighted them in some way. Having someone (you like/respect/love/etc) screaming abuse at you in the middle of the street because you failed to respond to their greeting, because you didn't recognise them and realise they were saying hello specifically to you ... is humiliating. Not knowing why this situation was happening on a regular basis - can you blame me for thinking that it was my fault? That I wasn't a reasonable, decent person? That the things being screamed in my face were accurate?

Hence my relief when discovering there was a label for my condition. Though, sadly, no cure.

← PreviousPage 2 of 25Next →