HNHacker News
TopNewBestAskShowJobs

tomhallett

882 karma · joined January 14, 2011

Ruby and Javascript Developer.

Software Engineer at Incredible Health.

github.com/tommyh

submissionscomments
tomhallett··on React 19 almost made the internet slower
To me, the initial allure of the vdom was how much further it got you then backbone.js’ “this.model.on(‘change’, this.render)”. When that one liner in backbone was enough, it was magical. But once you hit scenarios where overwriting the this.el.innerHtml, it became super painful (usually when that el was hooked up to 3rd party plug-ins, html5 video tags, etc).

Once react switched from class based components and mixins, each subsequent release was only more confusing. I remember the conference talk where they explained the problems with mixins (forgetting to cleanup and them all sharing one state), both of which can be solved in a few different ways, but they opted for a whole rewrite for hooks, which I “get”, but think it increased the complexity dramatically for a very low gain.

tomhallett··on Show HN: I built a backend so simple that it fits in a YAML file
Thoughts:

1) put the “# Short syntax for string type.” comment in your docs on your homepage example. When I first saw the “price” element I thought it was a jsonb field or something

2) why the emojis? So confused. Are those an alternative to a “dash” for entities? Do I need todo those? Do they set the favicon for that rest page? Note: it looks like it messes up indentation alignment. If it’s trying to be cute, I would deprioritize it

3) a “curl” command example on the homepage would make it a bit easier to grok the value of how simple your backend is

4) where does the data get stored? SQLite? Duckdb?

tomhallett··on Show HN: We open sourced our entire text-to-SQL product
Would open sourcing the core IP of a company “typically” require board approval?

If a company goes under, the investors will want to sell off the IP, open sourcing everything would make that IP less valueable. There must be some blanket clause in the term sheet to cover that, right? Ie: founders won’t do anything which will materially hurt the company without board approval (or something, I am no where close to a lawyer, this is all conjecture)

tomhallett··on Starting emails with "BEGIN PGP MESSAGE" will fool the filter
Is that what AOL Instant Messenger “Punters” used to do?
tomhallett··on Show HN: Visual debugger for Rails system tests
at one point i started to make a gem called "dora" where you could "explore" the page with methods around the capybara driver, but never finished it. for example: page.find_blog_posts.highlight_all would draw a blue box around each "blog_post" element.
tomhallett··on GPT-4o
Any recommendations on patterns/approaches for these declarative logic trees and where you put which types of logic (logic which goes in the prompt, logic which goes in the code which parses the prompt response, how to detect errors in the response and retry the prompt, etc). On "Show HN" I see a lot of "fully automated agents" which seem interesting, but not sure if they are over-kill or not.
tomhallett··on Pg_lakehouse: Query Any Data Lake from Postgres
For aws to make it available on rds Aurora, would it be safe to assume there would have to be some changes to the extension source to make it compatible with the Aurora engine? If we assume aws doesn’t want todo that, then their licensing provides some protection there.
tomhallett··on Show HN: Visual debugger for Rails system tests
Very cool! Will definitely check it out.

Random question: when you "pause" a test, is it actually pausing the capybara/rspec test such that I can have a breakpoint/debugger/REPL experience to try out various capybara/rspec code?

The reason I ask: one of the slowest/annoying parts of writing capybara tests is the context jump between "this is the css selector i get from chrome dev tools" and "this is the capybara/rspec code which I use in my tests". While they are similar, there are differences which slow things down: locating buttons based on text (vs css), case sensitivity issues with text, ambigious matches, wanting to use nested "find" calls [ie: find(css: ".modal").click_button("Close")], trying to use page objects vs selectors directly in tests, etc.

Often times my first attempt is "close" but not quite right, which compounds when you hit that on most steps of the user's flow.

super stretch goal: if you are using page objects in your rails app, if the page objects where written in a way that "cyperful" could parse them, you COULD have a feature where cyperful could highlight the page objects on the page. So instead of showing me css selectors, you draw a box around a page/section object.

I know that Playwright was doing some cool stuff with their "Pick Locators" and it allowing you to test playwright locators in the tool, not sure if this ever got extended to Page Objects or not. https://playwright.dev/docs/test-ui-mode#pick-locator

tomhallett··on Did we lose our way in making efficient software?
$10 = 6% fee; $5 = 8% fee. Both of which are far better than apple’s fees, so that point is a bit confusing.

Chargebacks = customer support. I agree with that, but if you have a B2C business which has any non-trivial revenue (OP is talking about word doc apps, so we’re obviously not talking about indie $2 side project apps), then you would already have CS anyway. I fully understand there is an opportunity cost with any service and where those costs get realized, but your examples don’t seem like a slam dunk in apple’s favor.

tomhallett··on Kobold letters: HTML emails are a risk
While I’m not saying the specific scenario will work 100% of the time, it doesn’t need to - by the email getting forwarded at all, there is some element of trust in “my manager forwarded me this email and typed ‘complete this for me’”. If this css technique increases the attackers odds, then it’s an issue.

Or for your specific example, imagine the recipient is passing their manager in the hallway: “hey, can we chat about the Acme Corp email, I’ve got some questions about it”. Response: “sorry, super busy. It’s a fairly common ask, just get it done!”

tomhallett··on Show HN: I made a site to find top YouTube courses, bypassing expensive courses
Question: does the YouTube content found by your algorithm have the follow/like/subscribe promos in it? Sponsored content in the videos? Is there some sort of score/rating for the “youtube creator self promo” (# of seconds per video), which is not there on udemy?

Note: I think it’s 100% fine that YouTube creators put this in their YouTube videos, but it’s why I prefer to pay for content on udemy/skillshare/others.

tomhallett··on Brave, Firefox, Vivaldi Surge on iOS Due to Europe's Digital Markets Act
When I was setting up my mother in law’s HP, her windows machine gave me a choice screen for the browser, but they littered it with dark patterns. It gave repeated warnings, would ask me to confirm that I wanted chrome, and then (accidentally?) kept switching the default back to Microsoft Edge. I really hope the EU puts enforcement teeth into these agreements, where the actual UX is pro-consumer when they choose the non-default.
tomhallett··on SQLPage – Building a full web application with nothing but SQL queries [video]
When I look at the Tiny Twitter example and see the code below, I'm curious if there is a more "SQL" way to implement it.

``` select 'checkbox' as component, 'Terms and conditions' as label, true as required; ```

I'm thinking "What would the workflow of a sql-enthusiast be, to build that page".

I think they'd want todo this first:

``` select * from sqlpage.components; ```

which would list the `name` of each component. Which then takes me to:

``` INSERT INTO sqlpage.dom SET name = 'checkbox', label = 'Terms and conditions ', required = TRUE FROM sqlpage.components ```

(or VALUES syntax for INSERT)

This would allow you to re-order your dom, update dom entries, etc. Very similar to jsx, but instead of jsx creating in-memory javascript objects, it's sqlpage's sql creating rows in a postgres table. Then the SQLPage virtualdom gets transformed into actual html.

Just a thought, :)

tomhallett··on Bruno: Fast and Git-friendly open-source API client (Postman alternative)
Do you plan on supporting SQL queries? My top 2 would be postgres and snowflake.
tomhallett··on Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
random idea: an event for "x-sync:missing". the server responds with `<ul x-sync id=notification>`, but the page doesn't have a matching id (and the notifications aren't inside a different target....). if the last part is slow to figure out, people could opt into it with "x-sync x-sync-required".
tomhallett··on Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
A few features which look minor but the author got totally right, which IMHO would allow this solution to scale very well with more complex applications.

1) X-Alpine-Target

``` <form method="post" action="/comments" x-target="comments comments_count" ```

generates an ajax request with this header by default:

``` X-Alpine-Target: comments comments_count ```

This is very very cool! In most usecases, one the serverside I can return a full html document and alpine-ajax will only look for #comments and #comments_count in the response. BUT, if I want the serverside to be faster (ie: do less), then the client is able to tell the server which parts of the html it wants via the `X-Alpine-Target` header -- instead of the server having to know which parts need updating via the url alone. It's like graphql for the htmx/hotwire architecture.

2) `ajax:missing`. If the client expects dom ids to be in the response and they aren't there, you can create a sentry error to expose the broken "contract" between the initial page's request and the action's response.

3) x-merge="append"

In hotwire, the html markup is dumb and the turbo-stream response is smart (`turbo-stream action="append"`). But in alpine-ajax, the response is dumb and the html markup is smart (`x-merge="append">`). This difference is subtle, but it allows for the serverside responses (for actions) be more general purpose/discrete components, while the ux which might change from page-to-page or section-to-section is decoupled to that page's/section's container html.

4) x-sync

"Elements with the x-sync attribute are updated whenever the server sends a matching element, even if the element isn't targeted with x-target."

Wow - amazing developer ux for cross cutting concerns like notifications, flash messages, etc. So practical.

5) Creating demos with an alpine-ajax mock server.... wow, an out of the box way to make standalone component test pages.

tomhallett··on Show HN: Alpine Ajax – If Htmx and Alpine.js Had a Baby
My first reaction was “why do I need an htmx-like version written in alpine?” when I could just use htmx. BUT… if you assume that you will need something more low level to complement htmx (“htmx + alpine” OR “htmx + hyperscipt”) and if you decide hyperscript is not for you, then it does make sense to a stack where the higher level is built upon the lower level: alpine-ajax + alpine.

Looks very interesting!

Also loved the comparisons, especially with rails/turbo and the downsides of custom elements wrt tables.

tomhallett··on CAP twelve years later: How the "rules" have changed (2012)
Would love to learn more. Guess: Is the “different position” that consistency can be achieved when a fault occurs by having the longest chain, instead of a leader/voting mechanism?
tomhallett··on Htmx and Web Components: A Perfect Match
This seems like the best option, because it works just as well if the child components are loaded async (Ie: a tab component loading sub tabs on hover, and then the parent tab container needing to subscribe to that)
tomhallett··on RawJS is a better way to call document.createElement()
To me the usescase feels like: I am using Hotwire/htmx. When I need more complex behavior, instead of using stimulus/apline/hyperscript, you can make custom webcomponents which use rawjs for the rendering.
tomhallett··on Build your own WebAssembly Compiler (2019)
Thanks! I was looking for a wasm book a few weeks ago, and most looked (understandably) out of date. Very helpful!

The frontend masters course by Jem Young was really good as well. https://frontendmasters.com/courses/web-assembly/

tomhallett··on OpenAI's employees were given two explanations for why Sam Altman was fired
I’m curious: if one of the board members “knows” the only way for OpenAI to be truly successful is for it to be a non-profit and “don’t be evil” (Google’s mantra), that if they set expectations correctly and put caps on the for-profit side, it could be successful. But they didn’t fully appreciate how strong the market forces would be, where all of the focus/attention/press would go to the for-profit side. Sam’s side has such an intrinsic gravity, that’s it’s inevitable that it will break out of its cage.

Note: I’m not making a moral claim one way or the other, and I do agree that most tech companies will grow to a size/power/monopoly that their incentives will deviate from the “common good”. Are there examples of openai’s structure working correctly with other companies?

tomhallett··on Monaspace
Could the “jump” problem be improved with a subtle transition (200ms, 1s, etc) from one state to the other?

If the editor “repaints” commit mono on the letter-pair boundary, I could see that being a very jumpy UX — ie: the letter I just typed is moving by a few pixels. But if that repaint happens on the word boundary it might be less noticeable?

In either case, a transition could be helpful for commit mono and/or Monaspace. (But agreed with above comments that Monaspace is more subtle because it spreads the spacing over the entire word, so maybe the transition is not actually percievable or worth it). :)

tomhallett··on Build a Lightweight Code Generator with TypeScript and JSON Imports
The way I interpreted it:

* Person A [Marketer who knows html/handlebars] logs into Postmark and makes a new email template.

* Person A tells Person B [node js developer], "Please send the new 'welcome' email template from the app".

* Person B runs the cli script, so the json file now has a template with a key of 'welcome-template-2023-blue'.

* Person B can write/modify any code which calls "sendEmailTemplate" and know exactly what code is valid, wont compile, etc.

They are "generating" the "class/object/type definitions" programmatically - which seems fine to me for the code generation problem they lay out.

Which part is not "a valid case" to you?

Note: the fact that the article is "typescript + json" versus pure "typescript" doesn't seem like a important distinction with respect to it be valid code generation, not sure if others disagree.

Random note: A different way to solve this problem would be with the "cog" python module [1], but that would come with a different set of tradeoffs. :)

[1]: https://nedbatchelder.com/code/cog

tomhallett··on Failing Startup Confessions
I highly recommend reading "The Mom Test", https://www.momtestbook.com/
tomhallett··on WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
100% agreed with you. Here's the part where I agree with user "PoignardAzur":

* user "menaerus" goal is have "C/C++/Rust developer [...] expose your product as a browser service", which they can transpile to wasm - cool.

* they will need "a bit of JavaScript you integrate it into the end service" - UI targets the DOM, sounds great.

The questions become:

* how much code will need to be written into each layer (rust wasm, react html ui, bridge between the 2)?

* what level of experience with that tech will you need todo that? ie: writing a react ui which interfaces with a wasm shim is some non-trivial javascript to say the least.

* based on the above: how far has wasm enabled a "c/c++/rust developer" to easily port their application to the web without also being a super strong frontend developer?

I'm trying to draw a contrast between:

A) I have business logic which is not well suited for javascript (image processing on binary data, figma, etc), and I have rust/c++ developers AND javascript frontend developers to build the application

B) I am a rust/c++ developer who wants to target the web with their rust/c++ product, but doesn't want to dive deep into frontend/js/react tech.

In the long term, I am optimistic that scenarios like "B" will be opened up by application (web) frameworks which target wasm via backend technologies and their MVC patterns. But in the short term, the amount of "glue code" to be written is non-trivial.

tomhallett··on WasmGC – Run GC languages such as Kotlin, Java in Chrome browser
Yes, but it's important to think about the bridge/shim between your application code (the web assembly module) and the host (the browser). If you have a C++ game which draws to the screen with SDL, then you can use a shim to convert SDL calls into html canvas calls [1]. But if a backend engineer wants to compile their java swing application to web assembly, there is a larger impedance mismatch from Java Swing => react html, then from Java Swing => html canvas.

If your application is built upon a web framework which already has this translation layer, like Blazor, then the amount of harness/shim-glue code you need to write goes down.

1: https://web.dev/articles/drawing-to-canvas-in-emscripten

tomhallett··on Show HN: DoltgreSQL – Version-Controlled DB, Like Git and PostgreSQL had a baby
It sounds like question is: why fork Dolt to make DoltgreSQL?
tomhallett··on How to Fetch a Turbo Stream
In this case, are you recommending the serverside validations (is a promo code still active and not expired) run after the call to stripe's confirmPayment, because you have a clientside validation (promo code matches a regex)? If so, that seems problematic because your severside validation could have prevented stripe from ending up in a dirty state. If not, then I'm not following what you are recommending.
tomhallett··on Don't use DISTINCT as a "join-fixer"
Any recommended resources (books, courses, etc) which go deeper on sql topics like this? Comparing and contrasting different ways of writing the same query, with respect to performance.

The one book I’ve found and really enjoyed was “SQL Performance Explained”.

← PreviousPage 2 of 10Next →