News for hackers. Stuff that matters.

valty

Ask HN: Best file watcher for Node.js/Bun

I liked the idea of Facebook's watchman. Cross-platform and it would only add a watcher on each dir once, regardless of how many apps needed watcher functionality.But it's currently uninstallable for weeks on macOS without some pain (https://github.com/facebook/watchman/issues/1199).There is `rs-notify` and `watchexec` that builds on that but seems a bit unstable.It's 2024, and we still don't...

( Read More... | no comments | on HN )
> "says"

I had of course already checked and it does not. https://github.com/bitgapp/eqMac/issues/380

So please remind me of why your condescending comment was necessary?

And which one has a keyboard shortcut for bass/treble smarty pants?
What I really need is a software bass/treble control that can be mapped to keyboard shortcut.
Re:Context: The Missing Feature of Programming Languages on Monday March 25, 2024 @10:43AM (#39816955)
This line of thinking led me to think: global variables should be, rather, considered good!

Plain text is the problem. We write code so it can be easily read as plain text. Not as living, breathing, running code.

Globals are considered bad because they are hard to trace and reason about. But this is only so with plain text. You cannot click on a variable and see all it's dependencies. We must painstakingly trace these.

If we visualized the dependencies and the flow of our code, we could see the complexity as we go. And the "context" becomes automatic. There is no difference between explicit and implicit context.

The key for globals, is to have one large graph data structure where everything is related. All your data is modeled the same. No mini-databases spread out over the code. No ad-hoc indexes strewn throughout. No modularity. One single giant data model.

Ask HN: Shell config is crazy complicated. Any solutions?

There are so many config files that are read in a particular order for each shell, interactive vs login, and for each platform. They all configure themselves using env vars and shell functions. Then every dev tool pastes some config into some of these config files.It's really out of control.The shell is probably the most used software on a developer's computer and it's a total mess.Are there...

( Read More... | 3 comments | on HN )
Re:Ask HN: Fastest cross-platform GUI stack/strategy on Thursday March 21, 2024 @09:39PM (#39786586)
Yeh horror story was probably too strong a word. I need to try it.
Re:Ask HN: Fastest cross-platform GUI stack/strategy on Thursday March 21, 2024 @09:36AM (#39778359)
I've heard a lot of horror stories with Swift UI.

I think it's crazy that it's closed source too. It's a big black box which makes debugging hard. Plus its the kind of framework that does a lot of magic stuff where you scratch your head wondering what is going on.

Re:Ask HN: Fastest cross-platform GUI stack/strategy on Tuesday March 19, 2024 @07:14AM (#39754617)
Wow 55K GitHub stars. This is like some record.
Re:Ask HN: Fastest cross-platform GUI stack/strategy on Tuesday March 19, 2024 @07:14AM (#39754608)
Good point. I would prefer to write in HTML/JS. Vanilla JS is probably the way to go.

I think modern frameworks are so bad at perf because they assume people just have so much compute available and are focusing on one app at a time.

Re:Ask HN: Fastest cross-platform GUI stack/strategy on Tuesday March 19, 2024 @02:35AM (#39753435)
When I said "stack/strategy", the _strategy_ part implied this build-for-each-platform approach.

The question still remains then of which to use for each platform.

On macOS there is Cocoa (Swift or ObjC(++) or pure CPP) and Swift UI.

On Windows there is .NET C# or CPP and a bunch of other stuff.

Any thoughts?

Re:Apple's AI ambitions could include Google or OpenAI on Monday March 18, 2024 @06:50AM (#39742338)
Apple should really be investing in their own stuff here.

Ask HN: Fastest cross-platform GUI stack/strategy

I want to build a cross-platform native app that starts up as fast as possible and responds as fast as possible, and has minimal memory use.Something that when the rest of someone's computer is slowing down, this can stay responsive.Not everyone has the fastest hardware or much ram; people like to have 100s of tabs open; and CPU's overheat and throttle, especially laptops.

( Read More... | 26 comments | 2 points | on HN )
> showed my tax dollars flowing through to that child...would be eye opening

I agree. Charity's often use this for marketing. Making clear the direct human impact of your donation. Tech companies like Apple do this a lot too.

But when a government talks of its successes in statistics...I don't think about my tax spend. I think that it was my (and other people's) vote for that team that did that. And typically not even the team...rather the leadership of the political party.

It's like a shift in the marketing approach.

We sent 100bn to this country to help out with this.

vs.

Average Joe paid 10$ of his income last year which helped pay for this and that for these people. One of those people today was Sally... One of those people 15 years ago was Tracy...

> small government

A different spin on "small".

I wonder if you could have micro-governments instead on a per-topic basis with their own mini-budgets.

These omnibus spending bills seem absurd.

The tax should be incurred/realized at the point of the benefit received.

Imagine getting a monthly bill on your estimated tax spend with details of everything it is spent on and how that benefit flows through to you. This might make people more receptive to government.

Also thinking about a Government+ premium subscription service. How can the government offer added benefits to raise more money for things. I guess this is charity.

> If companies aren’t forced to NOT pollute, they will pollute

If no one buys their products, or any products with them in the supply chain, then they won't pollute.

Visibility into these supply chains wasn't possible before internet/technology. A free market relies on consumers paying attention which so far they haven't been, because we are too used to relying on the government...and then complain so much about government.

You definitely see consumers driving improvements through their purchasing. Definitely in areas such as sustainability.

I guess regulation addresses a time lag situation. But if a private market developed for a companies that regulates other companies with subscription fees, then this would solve the problem and do it in a better way. Although I'm not sure how the threat of jail can fit into this. Can penalties be strong enough? Is bankruptcy a strong enough disincentive to lie to private regulators.

> They are there to stop a single fire from burning down the city.

Interesting point. Definitely has non-excludability.

I remember this scene in Gangs of New York where the firemen fight each other back when it was privatized (don't know if this was real).

> rich have freedom of movement but the poor do not

A lot of transport is private. Maybe the poor have more money if they don't have to pay so much in taxes.

Subscription tiers for national defense is funny to think about.

Priority assistance / 24/7 support / merch

Schooling is a tricky one for the free market, and it ultimately gets a bit morally dubious.

I guess you are trying to sell the benefit of a highly-educated country to those who choose private schooling, and getting them to pay for this.

It boils down to how much are you willing to pay for another child's education and what is the acceptable standard of that education.

But if we think about the supply of education, a lot of it is about good teachers, and ultimately someone has to be stuck with the worst teacher in the country. And also class sizes.

I'm interested to dive into this healthcare topic a bit deeper.

To find out what a true free market of healthcare looks like.

Often you find that government intervention distorts markets.

---

...and this looks like the case.

For example, people complain that benefits are tied to employers. But this was caused by the government capping wage increases to combat inflation in 1942, which resulted in companies offering pre-tax health benefits.

This looks like it is changing as people are like: wtf this makes no sense and creates so many bad incentives.

It looks like market forces will fix the system in the end, maybe it just takes 50 years or so.

> Maybe I try organizing online, which probably goes nowhere...Very few people have the time, energy, or resources

The thing is...a sector of companies that do this is probably a good business opportunity that is being crowded out by a mandatory government monopoly.

The fact that government does this means that you are already paying for it, and maybe its not being done well.

If people care about their food, they should look for a sticker on their food, from an organization that verifies it. If other people don't have the label, and people know about it, then people won't buy from them.

And if this is too much trouble, then have another industry above this where companies offer all-encompassing ratings on a variety of different things.

With modern technology so much is possible to solve problems that otherwise were too complicated.

You could end up with a marketplace of super apps, that ensure you are completely covered across all avenues of life to the parameters that you desire.

It sounds complicated, but today its even more complicated with government where we rely on the media mostly.

> Nobody would pay for the fire department

But they essentially do via their taxes. Implying people understand they need to fund it.

If we imagine a very transparent flow of information regarding fires...people would readily see the need for it. Like how we buy insurance.

All roads could be toll roads. We have technology to track exact usage of roads. Why should cyclists pay for the entire road?

If someone doesn't pay for the roads and gets a delivery, then they delivery company passes on the cost of the road.

If we have very transparent availability of pricing then this becomes possible.

> Are companies that don't pay for the EPA allowed to pollute to their heart's content?

If people don't want pollution...they shouldn't buy from companies that pollute.

If people don't want pollution they should ban it from their private property.

With modern tech we can see the entire supply chain of these companies, so consumers can make choices.

> inherent monopolies

I've learned to be careful about this "natural monopoly" term because it turns out to be very debatable. Recently with fiber deployments is a good example...see London/UK experience.

I feel like if people realized the benefits to having many companies compete for everything, then they would choose services that did not act like monopolies and to create barriers of entry.

The consumer ultimately dictates how companies should do business. The problem is a lot of the time they are choosing the price that is in front of them, and not considering the price in the future.

If consumers were smarter they could break monopolies without government intervention necessary.

Like if there were two companies building out some critical infra...if one promised they would do it in a way that others could compete easily, and consumers valued that, then they would win the contract.

> profit above all else a good objective for government services

This doesn't need to be the case.

People already work for government without profit incentive. It's personal prestige mostly I think.

Interesting to think about what would happen if we introduced duplication and competition within government departments. It seems extremely counter-intuitive because of duplication, but its how the entire capitalist sector deliver efficiencies. Same as how open source works. People compete for prestige.

Corporates sometimes do this too. Google might have multiple teams working on the same goal.

Interesting to think about what would happen if you hired two people to do one job and made them compete against each other on every task.

> If you don't have, and don't plan on ever having kids

Then you don't pay for their services, and other people pay more.

Most people don't want an uneducated population so they pay for them.

Government is this strange beast where we continuously seem to vote and pay for all these things we value at the ballot box, but then given the individual choice we change our mind. Or its a matter of "I won't if they don't". Which I guess creates the problem of excludability...if one group is paying for something that those who don't pay for it can't be excluded from...then it's unfair. Then it kind of comes down to everything being modeled as "insurance", such that you are guessing into the future as to what might happen to you and what you might need, and paying based on that.

Maybe its a convenience thing - it takes too much time.

> if I don't drive and don't have a car, I'd shortsightedly opt out of paying for road maintenance

I mean if you drive on the road you should pay more. And with modern tech we can now track road usage very precisely.

The *shortsightedly" argument could be resolved with civic education. People need to be more informed about these things. Or its like: if you don't pay for roads, then you get surcharged by any service you use that uses the roads.

> which is not to turn a profit

Government is then essentially a bunch of not-for-profits. But instead of multiple tackling the same problem, there is only one.

Nothing implies a need to turn a profit.

Those working in the public sector are incentivized by government committee scrutiny, who are incentivized by winning elections.

So you essentially have a bunch of people who do things for reasons other than money. It's a bit like open source software.

Some people will do things simply because they see there is a better way of doing them, and they enjoy doing it, and perhaps derive secondary benefits like prestige and fame.

By not voting for the "zero tax" party, people continuously show that they derive benefit from the services that their taxes pay for.

Already came across her. She was very good.

Ask HN: Why don't we turn government into a subscription service?

Every service government offers today could be thought of as a subscription service which we are forced to pay for.Every service exists to offer a benefit (direct or indirect) to the taxpayer.Why don't we let companies compete to offer these benefits, and let people pay for what they want?A good way to explore it is: if government ceased to exist overnight...what would be the order in which you...

( Read More... | 27 comments | 4 points | on HN )

Ask HN: Why is query, key, value in LLMs so hard to explain?

I have watched so many YouTube videos on this and no one seems to be able to explain it properly.Each explanation is so dramatically different from one another as well.I feel like its another infamously difficult to explain topic like "monads".I am desperately waiting for a 3Blue1Brown video on transformers to hopefully resolve this ambiguity.I am looking for a visual intuition, and something...

( Read More... | 2 comments | on HN )
Re:Tacit Programming on Wednesday February 28, 2024 @12:47AM (#39534491)
I feel like JS needs auto-currying.

    function greet(greeting, name) {
       return `${greeting} ${name}`
    }

    const greetWithGreetingHello = greet('hello')
    greetWithGreetingHello('sally')
And this should work with named arguments too.

    function greet({greeting, name}) {
        ...
    }

    const greetWithGreetingHello = greet({greeting: 'hello'})
    greetWithGreetingHello({name: 'sally'})
With named params, curried functions can be read more naturally too.

greetWithGreetingHelloAndWith({name: 'sally'}).

"and with name sally"

Re:Tacit Programming on Monday February 26, 2024 @07:37AM (#39510569)
> "naming fatigue"

ChatGPT is quite good at coming up with names.

It can map a description of a thing to a name. And the descriptions can vary between developers and probably still end up with the same name. So if everyone relies on its naming-prowess then everyone ends up naming things consistently.

Aside: I wonder if it can name parameters from tacit-style...

    Write this in non-tacit style:

    sort input.txt | uniq -c | sort -rn > output.txt

    sort input.txt > sorted.txt
    uniq -c sorted.txt > counted.txt
    sort -rn counted.txt > output.txt
Seems it can. Look how the output of `uniq` was `counted`.

Maybe we should just let ChatGPT name everything.

Interesting to think what programming is you no longer have to name things. A lot of programming is grouping code and coming up with names for the groups.

What if we didn't worry about grouping or naming, and just dealt with the data, and let chatgpt provide names on-the-fly.

Functions could even be replaced by descriptions of the actions.

I wonder if you could let an LLM evolve a graphical operating system from just the hardware definition.

We went through ~70 years of trial and error for programming languages going from low-level to progressively higher-level, and kept all the baggage along the way.

How would an AI go about this...with all the knowledge of today? How would it reason about each step in evolving a language.

I'm guessing it would probably be a LISP :D

Re:Clean your codebase with basic information theory on Thursday February 22, 2024 @11:53PM (#39477133)
> Our screens offers only a small window, and even the smartest IDE can’t give us instant access to everything

This is the real problem that needs solving.

> code that is read together should be written together

Code is a database of functions. This approach is like trying to design a database in denormalized form.

Re:What I learned failing to outsource an MVP on Thursday February 22, 2024 @11:48PM (#39477089)
I've been React for a long time but now I realize its clearly terrible.

I want to go back to the simplicity of Backbone.js where you could easily step through the code.

But at the same time I want to add one big magical abstraction that you can only use with tooling haha.

I want to play with the concepts of:

- one central database of everything: components and data

- visualizing a dependency and data flow graph between everything

Older »