News for hackers. Stuff that matters.

devnull3

Re:Async/Await is finally back in Zig on Saturday November 01, 2025 @12:11PM (#45782819)
All the stunts in async/await or goroutines in go stem from the fact that there is no support for something lighter than posix threads in kernel.

Shouldn't the OS kernel innovate in this area instead of different languages in userland attempting to solve it?

In most production cases, there is no luxury of debugger.

In my current $job, all we get is logs from 70+ node cluster and that too in a shared-nothing architecture. You have to stitch together varied datapoints (job logs on multiple nodes, netstat o/p, job logs of other services, http access logs, tcpdump, etc) to even prove that problem is on the customer side and not ours.

Re:Htmx, Datastar, Greedy Developer on Friday October 10, 2025 @11:22AM (#45540045)
DHH is spot on like he is on many issues!

There is a saying in my language which translates: give someone a hand and they'll take your whole arm.

Re:Htmx, Datastar, Greedy Developer on Friday October 10, 2025 @11:09AM (#45539929)
A lot of PRO plugins can be self developed. An example: there is a poor-man's inspector plugin at [1].

The replace-url thing should be a simple JS code using history API no?

[1] https://github.com/sudeep9/datastar-plugins?tab=readme-ov-fi...

Why not use a different encryption key per session and stamp encrypted ids (or whatever info) to the outside word.

This way the DBs can use simple sequence numbers instead of timestamp based IDs.

Re:Just Use HTML on Tuesday September 16, 2025 @09:40AM (#45262130)
I am backend dev and dipping my toes in frontend dev for my side hustle.

It is a typical CRUD app (like most of them). I like the idea behind HTMX or datastar. I built a prototype in it as well. But then I pivoted to solidjs.

Some reasons for this:

1. Single backend API for web, mobile and any other platform

2. Some UI patterns which are suited for JSON REST APIs [#patterns]

3. Ability to support partial functionality offline.

#patterns

1. Showing a subset of columns in a table but have an option to view & edit each record in detail. In my case a dialog opens with editable checkbox. So it doubles-up as "view" and "edit". These actions render just another view of existing data. A round-trip to server is not desirable IMO.

2. Filtering, sorting on columns. HTML based solution becomes tedious if some of the cells are not plain text but instead a complex component like a <div>. Sorting json and rendering is much better experience IMO.

Edit: About solidjs & datastar

1. It has fine-grained reactivity which I find it appealing and it uses signals which hopefully will be standardized.

2. The compiled bundle size is much smaller than I expected. I have 24KB compressed js which is serves quite a lot of views, pages.

3. Datastar is amazing and I have added it in my toolbox.

Re:The Rise and Fall of Music Ringtones: A Statistical Analysis on Wednesday August 20, 2025 @05:32PM (#44966716)
There was a time when my main aim of a choosing a certain ringtone was to appear edgy and cool ... and how annoying and wrong was I!

A sample of bad ringtone (auto-tuned baby crying) which was trending back then (2007-2008) was [1]. Thankfully I never used it.

[1] https://www.youtube.com/watch?v=SVvFRzMWdL8

Re:Windows XP Professional on Thursday August 07, 2025 @03:38PM (#44829345)
For me the look and feel of Win XP was breath of fresh air compared to Windows 98. WinXP was more user friendly and I was not a power user back then.
Re:Windows XP Professional on Thursday August 07, 2025 @11:10AM (#44825505)
Win XP remains my favourite OS till date. I was in college and getting hands on a pirated copy back then makes me so nostalgic.

There was a cambrian explosion of tools to customize the look and feel. TweakXP pro is the one I remember. All pirated off-course.

Re:HTMX is hard, so let's get it right on Monday August 04, 2025 @10:56AM (#44786695)
> He just put the sessionId in the form data instead of a cookie.

This does not have the benefit of being usable across different tabs or even closing and re-opening the page. Besides, (a minor point) shoving all the state in the cookie makes code simple i.e. don't have use URL params.

Re:HTMX is hard, so let's get it right on Monday August 04, 2025 @10:27AM (#44786289)
Not really. DS v1.0 has HTMX like request/response option as well.

You might need async if there are lot of concurrent users and each of them using long duration SSE. However, this is not DS specific.

Re:HTMX is hard, so let's get it right on Monday August 04, 2025 @08:55AM (#44785142)
Cookie is what we make of it. For browser, its opaque data anyway.

So, when /upload is requested, the backend in response sets a cookie with a random uploadId (+ TTL). At the backend, we tie sessionId and uploadId.

With every step which is called, we verify sessionId and uploadId along with additional state which is stored.

This means even if the form is opened on a different tab, it will work well.

Re:HTMX is hard, so let's get it right on Monday August 04, 2025 @08:21AM (#44784820)
With DS (and HTMX) the backend is the source of truth. In the context of the blog post, the state will be made-up of: step no, file content, file path, etc. This can be stored against the session ID in a database.

So when opened on a different tab, the backend would do authentication and render the page depending on the store state.

In general, the backend must always compare the incoming state/request with stored state. E.g the current step is step 2 but the client can forces it to go to step 4 by manipulating the URL.

DS v1.0 now supports non-SSE (i.e. simple request/response interaction as well) [1]. This is done by setting appropriate content-type header.

[1] https://data-star.dev/reference/actions#response-handling

Re:HTMX is hard, so let's get it right on Monday August 04, 2025 @07:11AM (#44784237)
In DS, with SSE you can paint different parts of the page with ease. So in this case, it can update <form> and <label> separately. So instead of one update the backend fires 2. There is not separate marker or indicator for OOB.

I think it is best seen in examples on DS website.

Re:HTMX is hard, so let's get it right on Monday August 04, 2025 @07:00AM (#44784180)
> Challenge 2: Passing data down each step

Why not use cookies?

Re:HTMX is hard, so let's get it right on Monday August 04, 2025 @06:52AM (#44784121)
This should be trivial with the HTMX alternative: datastar [1]

In datastar the "Out Of Band" updates is a first class notion.

[1] https://data-star.dev

Re:Introduction to Indian English on Wednesday July 09, 2025 @05:24AM (#44507894)
One of the recent inventions I like: Presstitute

Its a combo of "Press" and "Prostitute" and it aptly describes some journalists and media people who clearly take sides and have sold their souls.

Re:Introduction to Indian English on Wednesday July 09, 2025 @05:18AM (#44507860)
This does not talk about the numbering system. See [1]

"Lakh" => 100K

"Crore" => 100Lakhs

[1] https://en.wikipedia.org/wiki/Indian_English#Numbering_syste...

Re:Introduction to Indian English on Wednesday July 09, 2025 @05:09AM (#44507810)
Re:Introduction to Indian English on Wednesday July 09, 2025 @05:08AM (#44507796)
Prepone is now a word in Cambridge dictionary [1]. It acknowledges the origin to India.

[1] https://dictionary.cambridge.org/dictionary/english/prepone

The irony is that these companies will make you sign & enrol trainings for "code-of-ethics" and the same management will indulge into shady practices (like the OP mentioned). Btw, there are other ways to get rid of employees which do not even need PIP.

I have made peace with the fact employees are just means to an end. Always have been. Nothing less or nothing more. The power is extremely lopsided in favour of the companies. This makes so many things beyond the control of an individual [1]. Focus on things in your control:

1. Keep learning

2. Be debt free as soon as possible.

3. Invest and build a financial cushion

4. Eat healthy and exercise (I am pretty bad at this but trying to improve)

5. Develop an alternative skill(s) which can you put to use if needed

6. Never burn the bridges, no matter what.

All of the above are easier said than done but I see no sustainable way of coping up.

[1] My current employer (which is a listed company) got acquired by a private equity. I have no idea what will happen but I am relaxed.

Re:Fossify – A suite of open-source, ad-free apps on Tuesday June 17, 2025 @09:08AM (#44298732)
Is there any list of games with same focus on being ad-free? Does not have to be free.
The behavior attributed to Indians in the article is universal. Admission to few college seats is a zero sum game anywhere in the world.

In SF, see if companies share knowledge if they are after the securing a contract from the same B2B customer.

In UK, drivers give way as a courtesy many times even though one has the priority. In return the other driver thanks using hand gestures. However, there was a local football match on a weekend and parking was very hard to find. Parking spots are zero-sum game. People started violating many rules. People started driving against the arrows on the road in desperation to grab the spot. Parking in places which were not marked as parking spots. All the manners & niceties went out of the window. It has hunger-games for parking spots.

BTW, google (and other big companies) hiring top graduates and researchers to deprive others of the same talent is hoarding.

Re:The Coleco Adam Computer on Friday June 06, 2025 @04:14PM (#44204557)
Fun fact: The computer in simpsons is a coleco [1].

On an unrelated note, the short clip is funny as well.

[1] https://youtu.be/av4lbel9aIo?t=7

I may have a outdated notion about the trades you mentioned, but I have seen an "apprentice" model a lot. I have seen it with a masonry where the experienced guy was bringing in his nephew and teaching him on the job. A lot of these trades are family owned and have seen taking in people based on someone vouching for the new guy.

Maybe this varies country to country. I have seen this in India and UK atleast.

In UK atleast there are trades like roofing, landscaping, exterior building cleaning, masonry, tree surgeon etc which I have seen them are mostly family based.

Males are under pressure to "sustain" it for 10-15 min atleast (with many people watching). For females, no such thing.
I wonder which other professions or trade ask people to perform infront of them in a simulated env as a filter criteria.

Actors for sure with auditions and maybe maybe chefs, male pornstars.

Re:Show HN: One Billion Checkboxes on Tuesday May 13, 2025 @02:06PM (#43975862)
Amazing! This nicely demonstrates capabilities of datastar.

I suggest to put a comment on the page to open dev tools and see the SSE event in action. I think people will appreciate D* even more.

Re:Show HN: One Billion Checkboxes on Tuesday May 13, 2025 @12:15PM (#43974546)
If I have to guess the tuning and optimizations:

SQLITE:

1. Smaller page size (to be specific: max(disk_sector_size, 512))

2. Integer primary keys

3. WAL mode

4. Increase page cache size. This is assuming that most people will click in the top-left 100x100 checkboxes.

Other optimzation:

1. In mem cache of bitmap of 1B bits, which is about 120MB, which is a shared state for all incoming connections.

Barring the interactivity SPAs will also end up talking to server anyway. So even SPAs will feel sluggish in a high latency env.

Older »