HNHacker News
TopNewBestAskShowJobs

yawaramin

4,189 karma · joined November 3, 2012

submissionscomments
yawaramin··on Rails World 2026 Opening Keynote [video]
Sounds like OCaml has the answer then. It has the equivalent of all the great things you described in Rust, plus compile speeds similar to or better than Go. Agents should be able to blaze through changes with it.
yawaramin··on .gitignore Everything by Default
You’re not wrong. I’ve used tig, a git TUI that renders very nice views of the diffs, for many years: https://jonas.github.io/tig/

Fun fact: Jonas, the creator of tig, is an ex-colleague of mine. It’s cool working with people while using dev tools they wrote!

yawaramin··on Learn Programming with OCaml
What language and framework do you use for GUI programming?
yawaramin··on Learn Programming with OCaml
Posting 'why should we learn' a programming language on Hacker News is top-quality ragebait :-D
yawaramin··on Learn Programming with OCaml
1. Compile times. OCaml compiles very quickly (think Go) and this gives you a fast feedback loop. It lets the LLM rip through the implementation.

2. OCaml has an idiomatic approach of using interface files for all modules that can be accessed outside their libraries, and interface files give LLMs a great précis of exactly what is wanted. They then just have to follow the types and fill in the blanks to get the implementation. It's nearly the perfect use case.

yawaramin··on Learn Programming with OCaml
I'd be very interested to read this paper when it comes out.
yawaramin··on Htmx 4.0
Haha, good one. You said ‘the creator is stuck in 2012 as I said’. Except that was said by a different user account ;-)
yawaramin··on Htmx 4.0
It’s not really decentralized in that way. If you’re loading a bunch of pages in your mobile browser, your device is paying the power consumption cost of deserializing, parsing, and running all that JS. It doesn’t save on that because some other user also did it.
yawaramin··on Htmx 4.0
Oh ok, in that case see here https://developer.mozilla.org/en-US/docs/Learn_web_developme...
yawaramin··on Htmx 4.0
Are you sock-puppeting two different user accounts in this discussion? https://news.ycombinator.com/user?id=asdfsa32

I didn’t realize that was allowed.

What do HN mods think of that, dang?

yawaramin··on Htmx 4.0
Parsing and processing several megabytes of JS for each page you visit can get expensive quickly. https://tonsky.me/blog/js-bloat/
yawaramin··on Htmx 4.0
The client pays it.

- If the server is responding with JSON, the client has to parse, decode, and validate the JSON. Then it has to transform it into HTML DOM nodes. Finally, it can inject them into the DOM.

- If the server is responding with a bespoke non-JSON data structure, it's the same situation as above except even more work because a third-party, non-standard library has to decode this structure into something (most likely JSON) and then transform the JSON into HTML nodes, etc. etc.

- If the server is responding with straight-up HTML, the client uses the browser's HTML parser to directly transform it into HTML nodes and inject it into the page. And by the way, the browser engine is essentially a function that is highly optimized for exactly this use case–parsing bytes into DOM nodes.

'We' might use the same API but it's widely accepted that generally the same API doesn't work for all contexts. See https://samnewman.io/patterns/architectural/bff/#general which details the many well-known problems with having a single API for different contexts.

yawaramin··on Htmx 4.0
That's super simple, it's your favourite backend web framework. Rails, Spring Boot, Laravel, Django, Flask, FastAPI...really whatever you like.
yawaramin··on Htmx 4.0
Yeah but when you're reading the actual source code you're not thinking in terms of bytes, you're looking and files and line counts. Htmx is deliberately maintained as a single, no-dependency file of about 5000loc. The maintainers are of the opinion that it reduces complexity, and I tend to agree.
yawaramin··on Htmx 4.0
The htmx creator has made similar things for a long time, if anything htmx has diverged from those ideas by taking Intercooler.js and stripping out the bundled jQuery to simplify it and create htmx. See https://news.ycombinator.com/item?id=49496634
yawaramin··on Htmx 4.0
I’m talking about auth, like a session cookie. What do you use for auth?
yawaramin··on Htmx 4.0
Htmx is a direct descendant of Intercooler.js, which has been around since circa 2013, more than a decade. Intercooler still exists and is used in production, and you can clearly see that it works almost exactly the same way as htmx does today, it just bundles jQuery together.

The creator has been working on these ideas for a long time, but the core idea–swapping HTML from the server into the DOM–has been constant throughout.

It's exactly because he followed the past two decades of web dev that htmx avoids almost everything about it. Fixi and htmx extensions follow the 80/20 principle and can work by just being dropped in with a script tag. You don't need an elaborate npm setup, same as everything else in the htmx ecosystem.

yawaramin··on Htmx 4.0
What part of the Fixi project is building something like React?
yawaramin··on Htmx 4.0
You’ve misunderstood the reason for v4; see https://news.ycombinator.com/item?id=49493929
yawaramin··on Htmx 4.0
Correction: they didn’t ‘realize they needed to make a breaking change’, they got excited by the improvements they could unlock by using the Fetch API and wanted to make a breaking change.

The upgrade is completely voluntary: it won’t even be set as the default version in npm till next year, and there are no known security issues that would force anyone to upgrade. People happy with v2 can just stay on it for the foreseeable future.

yawaramin··on Htmx 4.0
Where does it say that exactly?
yawaramin··on Htmx 4.0
The explanation is a single, obvious click away.
yawaramin··on Htmx 4.0
So what do you use instead?
yawaramin··on Htmx 4.0
Feeling this pain with Django right now. I don't even have to deal with a database in this app (it's just a BFF) and it's unnecessarily complex. Right now I'm ripping out the React frontend and replacing it with htmx. Using Pydantic for form validation (will write a custom validator if I ever need multiple values from form fields). And using htpy instead of a templating engine. So far so good. Let's see how it goes.
yawaramin··on Go is an ideal language for AI-assisted software engineering
Lol, so Rust is perfect until you actually try to do something with it.
yawaramin··on Building Progressively Enhanced Forms Using htmx
Sure, that's basically what Phoenix LiveView does. But I would submit that you don't actually need that level of complexity with a bit of judicious UI/UX design, where as the app grows in scale, the number of oob swaps to keep track of doesn't grow as much.

There are many ways to skin the cat.

yawaramin··on Building Progressively Enhanced Forms Using htmx
> Fiddling with out-of-band swaps to solve this feels error prone and overly hard to maintain.

This is almost always because of using a string-based templating system. If you use a language-embedded HTML generation library, it represents HTML fragments as first-class values in your language, and you can compose them together in flexible ways. This makes out-of-band swaps very simple.

yawaramin··on Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)
One man’s React is another man’s Blub.
yawaramin··on Let's make the worst Htmx
> They are overselling it.

They quite literally have a a large essay on their site dedicated to discussing when to and when not to use it: https://htmx.org/essays/when-to-use-hypermedia/

Also, it’s not at all sold as a ‘competitor to React’, it’s sold as a simpler option for many apps where React is overkill. If you want to make a game with React, no one will argue for using htmx instead. The game will probably have a lot of perf issues though.

yawaramin··on Let's make the worst Htmx
Ok, for the sake of completeness–why do you want to add a JSON API to the program? Quite a lot depends on the reason.
Page 1 of 34Next →