Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

You can use toml as a better ini by limiting yourself to the key / value schema. It still superior because:

- it has a spec

- it has other types than strings

- you can always decide you actually need nested data, and add them later


I wrote an INI parser that has numerical, boolean, timestamp, MAC address, and IP address types ;) "advantages" of not having a spec!

Seriously: for application-specific config files, the lack of a formal spec can be kind of a nice thing. You can design your parser to the exact needs of your program, with data types that makes sense for your use case. Throw together a formal grammar for use in regression testing, and you're all set.

Obviously a formal spec is essential for data interchange, but that's why JSON exists. To me, YAML is in a gray area that doesn't need to exist. The same thing goes for TOML, but to a far lesser extent.


> it has other types than strings

But isn't the config file just a string?


Everything gets serialized to a string of bytes. The point is that you can fail at parsing when the value doesn't make sense, rather than failing at some point in the future when you decide to use the value and it doesn't make sense. And if you have a defined schema, you can have your editor validate it against the schema when saving, so you don't accidentally have "FILENOTFOUND" in a Boolean.


> Honestly, I think a good configuration library should be more than a spec, it should come with a library that handles parsing/validation

You just described CUELang.

The type system allows to define a schema as well as the data, in the same file, or in 2 separate ones. Then you can call either a cli tool (that works on linux, windows or mac) or use the Go lib (or bind to it).

For compat, cue can import and export to yaml, json and protobuf, as well as validate them.


Isn't Dhall basically the same (=have the same set of features)?


In the same way python and js are basically the same.


Exactly. So if I'm going to learn/use one of them, there's no clear winner, really. Both also seem to also have about the same amount of adoption (zero?).


Ok, you have convinced me to give it a serious look.


I quite like CUELang (https://cuelang.org/), although it not yet widely supported.

It has a good balance between expressivity and readability, it got enough logic to be useful, but not so much it begs for abuses, it can import/export to yaml and json and features an elegant type system which lets you define both the schema and the data itself.

I hope it gains traction.


Just like a programming language, in fact.


Humans are mutually programming each other using homoiconic phonetic languages.


Or like CPU architectures. CISC vs RISC


> if there's a sudden influx of thousands of users

A $10 VPS will manage thousands of users fine for most CRUD apps. You don't need tons of VM.

You can always make it a... $20 VPS to have some margin if you fear HN hug of death.

You won't get a CDN close to the user or automatic backup, but that's really fine for the immense majority of projects.

It takes one hour to setup a VPS with nginx, python/node/ruby and postgres. Then it mostly runs on its own for years: no coldstart problem, no kubs to manage.

I get the benefit of the cloud at scale, but for thousands of users, it seems really overkill.


It depends on what the code is actually doing, but you're not wrong in most cases, especially the HN hug of death. I host all of my stuff on cheap VPS servers for example.

Some tasks, though, are just terribly slow. For example, crawling a webpage and taking a screenshot of it sounds incredibly easy but turns out to involve a lot of resource-intensive moving parts. The most common solution I see involves running Chrome in a container and taking a screenshot. That kind of code can easily overwhelm even a moderately expensive VPS with just a few clients. On the other hand, most CRUD stuff and frontend-heavy applications would run fine even off a modern Raspberry Pi.

You can't just let something run, though, because you need to manage system updates. It's something you can easily forget if you have tons of other stuff to do, so the laziness factor also helps defend the *aaS setup.

I don't like serverless, I think it's the next step in more wasteful programming by people who can't or don't want to understand the systems underlying their code. We're at the point where shipping an entire operating system along with an application has somehow become the norm, and I don't like the fact that eventually I too will need to learn this serverless crap.


> It depends on what the code is actually doing

Indeed, things like video encoding, machine learning, graph traversal, etc, can be pretty expensive.

But then again, our tooling are so powerful these days you can get away with a lot. Timeseries ? Clickhouse is your friends. Need geo calculations ? PostGis is here. Need to extract frames from a video ? ffmpeg will do that in a few cpu cycles. Data analysis ? Say hello to pandas. Validation, caching, expiration, encryption, workflow, pub/sub, logging, reporting... We have amazing solutions for everything that will let you scale up to the millions of users for few hundred dollars.

In your example with the screenshots, one can imagine putting them in a queue (5 minutes setup with python-rq + redis) or even more low tech, a cron, and suddenly your VPS can take one screenshot every 2 seconds, which is 43200 in a day. That's a lot of screenshots.

Your client need the screenshot immediately ? The browser can take a screenshot from JS with html2canvas.

Sometimes it feels we are using $TECH because there is a whole class of devs that can't find solutions to problems:

- don't want to think about your data structure ? Put everything in no sql.

- don't want to think about your deployment ? Put everything in a container.

- don't want to think about your algo ? Put everything in the cloud.

Of course, in the end, you still have to think about all that no matter the tool you use. You just moved the cost somewhere else, usually paying much, much more later.

In fact, even most of the stuff I get paid to do using Django could be done cheaper with wordpress. I'm already overkilling it.


I think the problem is in a general overcomplexity, ambiguity, configuration overflexibility and lack of reliability with LAMP or Node or Python or GNU/Linux installations.

Today I just can’t make a guarantee for a fresh Ubuntu LTS instance that it will run a 15-line pure C or sh code as I would intend to outside of my attendance, regardless of how easy the requirements or the SLA might be.

As much as I hate serverless or easy scripting language trends, they do the job and do it well.


It probably depends a lot on what the code is doing . I've seen systems with multiple services inside and a couple of them had to do db calls and could not be cached. You can easily end up with 10-30 servers. Also, the cheap versions may not have enough cpu or memory for all systems.

In this case the serverless versions may be better, easier or cheaper. We did not use Python or Ruby by the way. I still think Python is a bad choice for most systems.


> re-rolling a pair of dice until you get a result you like seemed ugly.

... then proceed to:

- create an entire new pair of dice for 2 turns of a game they play once in a while

- one die now has 2 values on each face with separate meaning

- for the first 2 turns, you have a special procedure to read the value of the dice that is quite convoluted

I understand the fun of it, but that's also how I see code being written in the corporate world, and that makes me sad.


The red numbers did seem like stretching it too far, but I actually think the original construction is quite elegant. Taking the number with more dots doesn’t seem like any more mental overhead than mentally adding the values on two normal dice.


Since he already takes the one with a higher number of dots on either die, wouldn’t that make it a d12?


No, because a d12 has a uniform probability distribution across all numbers which is explicitly not what is wanted for Catan


> the dices

"The dice". Single "die", plural "dice".


French here. Thank you.


Just to further complicate things.... native English speakers often use "dice" as the singular i.e. instead of "die". While technically incorrect, it's very common, probably more common than the "correct' form.

The plural is "dice" and unfortunately "dices" is definitely incorrect :-)

English is crazy.


I’ve even heard people use “die” as both the singular and plural! It’s the only singular/plural pair I know of where 3 of the 4 permutations show up in common parlance. I’ll be thrilled if I ever hear someone use dice as sing. and die as pl.


Some constructs in English can indeed feel a bit dicey.


Ah, you pipped me to it.



Mouse, mice therefore singular of dice is douse!


I think the word itself is from French too (although I don't know what the explanation for the strange plural form is).


From the OED: "As in pence, the plural s retains its original breath sound, probably because these words were not felt as ordinary plurals, but as collective words".

Here is another interesting article about the etymology and singular/plural usage: https://www.grammarphobia.com/blog/2016/10/dice.html


A pair of dies is dice! But then what does 'pair of dice' mean?

Which brings us to another problem: I can buy a new pair of pants - or even 'some new pants' - but I've never seen 'a pant' for sale !! ;-)


Doesn't the word dies connote exactly two dies? Then with three or more it becomes dice.


The pair-of-dice / paradise pun would be burned into your brain if you spent more time with bikers.


I don't think English has any plural form for >=3.


No.


I can't wait for the housing prices to go down, but there is no sign they will in France. They kept going up, even during the covid crisis.


The main question is, what would be the source of the bubble?

Is it cheap capital? Fraudulent bank practices? Or is it because people wanted more space during lockdowns while having the sense of financial stability?

If the demand increased while supply stayed constant, the price increase is not a bubble. I waited for "the bubble to burst" for years before realizing there likely is no bubble where I am from. Housing's just expensive.


My tip is "distrust against the future value of the currency". Bricks do depreciate as well, but not massively.

The bond buying programs of the ECB are pretty expensive already, and the Green New Deal will be mostly implemented on credit. And Europe is already quite deep in debt. So is the USA, but the USA can at least derive some strength from the dollar being the world reserve currency, with no clear challenger in view.


Increasing inequality in the world - driving foreign, speculative, investment e.g. vulture funds


> even during the covid crisis.

Well yeah people wanted more space and had more money to spend - of course prices went up. Not sure why you've said 'even'?


Because tons of professions, small business, workers laid off, etc suffered from the lockdowns, so there was not exactly clear that "people had more money to spend".


The markets absolutely soared. People saved money rather than spent. Most people's jobs carried on as normal or were protected by the government.

As a concrete example, bank account deposits in the UK rose 10% during COVID.


>The markets absolutely soared.

The markets are not invididuals, if we're talking about stock markets. And in Europe they don't represent most of the population as asset holders or anything like that.

Case in point for France:

"There was an 8.3% decrease in France’s economy in 2020, and the country has not seen a recession to this extent since World War II. For example, France’s travel and tourism sector’s contribution to the French economy decreased by 48.8% due to travel restrictions. As a result, that sector alone lost 193,000 jobs. (...) Before the pandemic, 9.3 million people lived below the 1,063-euros-per-month poverty line in France. Those who were poor had little opportunity to improve their lives, especially during the pandemic when unemployment rates reached a two-year high. As a result, retail workers, artisans and self-employed people were among those the pandemic most affected. Further, the number of French people in poverty has significantly increased to more than 1 million people during the pandemic. (...)"

>As a concrete example, bank account deposits in the UK rose 10% during COVID.

That's one disconnect. Most people don't have bank account deposits (or don't have any to write home about). That's apparently true for the US too...

https://www.cnbc.com/2019/01/23/most-americans-dont-have-the...

- though I guess those people don't go out buying houses either.


Careful, the French measure of “poverty” is a percentage of the median income. It’s more an indicator of inequality than anything else

And the 200k people laid off from the tourism and other sectors were paid 80% of their previous income by the state.


>areful, the French measure of “poverty” is a percentage of the median income. It’s more an indicator of inequality than anything else

It does say "below the 1,063-euros-per-month poverty line in France" which whether it was calculated with the median income in mind or not, it's quite fine as a poverty measure, not just inequality (that's like making less than $12K/year, or if we adjust for cosr of life, less than $18K/year or so).


Two things:

1) being a fixed percentage of a median, any variation in the median will change the “poverty rate” without it necessarily meaning anything. If the minimum wage increases by 100 euros, the poverty rate will actually increase because the median income will go up and more people will come under X% of it

2) you can’t really compare income across countries. 1000 euros a month means you will receive social housing or subsidies for private rental. It means neither yourself nor your children will pay for any state services (school, school meals, health, swimming pool etc, public transport etc). I’d far far prefer to be on 1k in France than 2k in the US


>2) you can’t really compare income across countries.

As a close by European whose been to France many times and have friends there, I can assure you 1000 euros a month doesn't by you much in France. Not sure if it corresponds exactly to $18-20K year, but it's not far.

That said, of course, being someone making 1K in France is better than 2K in the US -- regarding education, health, and several other aspects....


If the class of people who buy houses (people with assets and deposits) get wealthier then house prices go up.

As you say, people who aren't buying houses anyway not getting richer doesn't have any impact on the price of houses.


I guess so, but it makes sense to be surprised when house prices (and rent) goes up, in 2 years when most people get fucked over financially.


Yes. That’s clearly what happened. But lots of people, myself included, expected prices to go down. The early pandemic was marked by a market meltdown and a shutdown of the timber and housing industry as analysts expected a drastic slowdown in home buying and building. It was perfectly reasonable at the time to assume (or hope!) that house prices were going to fall, and let's not brow beat people over that.


Yeah, similar event happened to the car industry. Analysts and factories forecasted dramatic slowdown in sales, so are rental car companies. Yet after the reduction in investments happened, it turned out consumers in COVID prefer to buy additional cars, or rent to go to smaller towns. Cue pandemonium. (And the supply chain shortages of chips)

To be fair, if COVID happened anytime before broadband is available to homes, the analyses wouldn't miss. Novel pandemic, novel technologies, novel situations all around.


In the UK, people who suffered were low wage, casual workers such as hospitality staff- typically not people who were in the house buying market to begin with.

Public sector workers and corporate employees tended to fair well because they were 'working from home' and not paying a siginificant part of their income on getting to the office and back.

Factor in, also, much less properties available. I was looking for a house at the time and anything that came onto the market was getting snapped up in no time at all. This lack of supply soon translated into increasing asking prices.


In France? Not really. There was a massive injection of public money. Anyone furloughed was paid 80% to stay at home.


That's still 20% less than what they were making before. Not exactly something to start them buying houses...


Except that they’re not driving to work, they’re not eating at the cantine/restaurant at lunchtime, they’re not going on holiday, they’re not going out in the evening…


It keeps going up until it doesn't. It would be nice if we could predict when the music stops, but we really can't.


I've noticed that the covid crisis has resulted in steady or even growing home purchases, many of them as second homes. In the US there was a lot of talk in 2021 of those who had not lost their jobs sitting on more liquidity than ever before, so I'd assume it's many of these people who jumping into the housing market.


It was everything.

Interest rates fell dramatically, government stimulus/cash transfers were far in excess of any lost wages, fewer people wanted to list houses and do showings due to covid.

Certainly a perfect storm.


>but there is no sign they will

You just described every bubble. The whole point of bubbles is that you can't predict when they'll pop.


The value of real estate may decline but it’s very unlikely to dip into the “affordable for normal folks” territory where demand exists.

Rental houses are an asset class now, and that’s unlikely to change while the rich can get richer renting to people who can’t afford to buy.


A fact doesn't need to be usable as evidence in court to be usable for blackmail.

Anything that can make your life harder will do. They can find something that:

- will put a you in a difficult position with friends and family

- break trust in a business relationship

- destroy your reputation in regard of the public

- trigger costly investigations from a 3rd party

- pressure you and take your energy, moral, money, time and health in the process


Even if the censorship implications are a bit obvious, it's good that:

- we have more alternatives

- we add to the global network for resilience

- we increase our independence from the USA for something so critical

- we get more control over our little part of the internet in case of a digital attack

Provided we can always switch to an alternative DNS server from inside the EU if we need to, it's a net positive.


> - we get more control over our little part of the internet in case of digital attack

I’d love to hear what people think about this. To me it’s notable that Russia and China have taken steps to separate their internet access from the wider, global network. While the West continues to centralise its network access in the hands of a few companies. Presumably this makes Russia and China more protected from attacks on the global network.

Am I correct in thinking in this way? Could Russia and China continue with internal internets even if the global one went down, or are they actually as at risk as anyone else? I’m guessing that China’s censorship systems and firewalls are fairly centralised and so vulnerable in their own way.


> Presumably this makes Russia and China more protected from attacks on the global network.

Of course. And North Korea is probably more protected against terrorist attacks than most of the "free world". That doesn't mean it's a good trade-off in general.

In practical terms, it depends on what you mean "continue with their internal internets". Most of the points of failure for "internet use as understood by the public", are actually just implementation mistakes by private companies - i.e. nobody says you have to host on (and hence go down with) AWS, or rely on (and hence go down with) Facebook/Google Login.

DNS is distributed (it's in the name!); if rootservers went down there would be hiccups for sure, but they could be fixed. Same for the rest of the fundamental network stack; after all, the internet was built to withstand nuclear attack. Whether it would be a good experience (i.e. slow, private services not working, etc), that's something else. If you're based in China and you rely on FB Login, no amount of governmental infrastructure will help you when FB becomes unreachable.


I’m thinking about fairly close to doomsday scenarios.

If/when we reach a point of extreme tension with tit for tat cyber attacks, would Western countries be totally incapacitated for days or weeks while Russia or China were less impacted? Things like food supply, public services etc.

Perhaps such things would escalate so quickly that the internet would be the least of our worries.


There are books on this sort of things, the topic is vast. From energy supply to commercial food operations, there are a lot of very different situations. This said, I reckon that all-out cyberwar on the scale necessary to impact food supply, would see IRL retaliation too quickly for it to matter. The US military has its own network strategy, its own satellites, etc etc, so they will be ready to pounce.


Pardon my ignorance but in what way are EU citizens dependent on US DNS infrastructure prior to the introduction to this? And how does this infrastructure remove that dependence?


All big public DNS Resolvers are US-based. Google, Cloudflare, OpenDNS(Cisco). Quad9 is Swiss-based, so technicaly not EU-based.


All ISPs in my country run their own recursive resolvers (with IPs resolving to my country). How "big" a resolver is does not matter at all - it's not a social network; the resolver either works or it doesn't work.

Some of the root servers are also in the EU, so there is zero dependence on the USA for resolving european ccTLDs.


There is some level of importance in bigness. All the major public resolvers let nameserver operators (well, anyone, really) clear cached records. Which turns out to be a not-uncommon occurrence. I wrote my own DNS server, so I've been paying a ton of attention to this stuff, and I've found several scenarios where website operators (even, for instance, instagram!) seem to have wanted to change some DNS records but weren't happy with the TTLs they'd advertised on them, and instead of waiting them out, just cleared caches with the major resolvers and then gone ahead and turned off the old IPs.

With the end result that I had to go in and remove those records from my cache, too.


> Some of the root servers are also in the EU, so there is zero dependence on the USA for resolving european ccTLDs.

What percentage of the organizations that run the root servers are non-US? There are thirteen logical root servers ([a-m].root-servers.org):

* https://root-servers.org/

Three (i, k, m) are not run by non-US legal entities: Netnod (SE), RIPE (NL), WIDE (JP).


In every way. The US controls the TLDs and many of the core resolvers.


The US doesn't control the national TLDs nor the .eu TLD in any way. The core resolvers can be replaced at a moment's notice in case of problems.


This doesn’t address the tld issue and does it matter if a lot of people use US authoritative resolvers? Each domain can choose and the protocol isn’t biased towards US controlled infrastructure.

I can see the value in dns as public utility (though one I’d be skeptical about using or paying for) but this doesn’t seem to do what the OP suggests on the US independence front because DNS is already independent.

I’d be a lot more understanding of a public email provider than DNS to promote a break with US infrastructure.


Email would be fun. Beyond the rhetoric, a lot of EU governments are actually quite tyrannical when it comes to intercepting or seizing communications, compared to the US.


There is one problem. If the change in question is related to just having an alternate DNS stucture, that's perfectly fine. Because it doesn't mean users are forced to use it: at any moment, I can force my machine to use any DNS server I choose and it will respect that.

However, if they actually implement URL filtering, it might mean something completely different: that IP addresses of SciHub/Libgen will be blocked by the ISPs in the whole of EU no matter DNS server I use. Not all countries would individually agree to that.


Unless they go full on Great Firewall and block VPNs all they'd achieve is to make VPNs go even more mainstream (and while many adults may still not be used to VPNs, they can ask their kids - most of my sons friends all have VPNs set up for everything from evading region blocks for content to ban evasion from game servers)


I don't know where you're getting that IP-level filtering is the only way to "actually implementing URL filtering" - if they're talking about URL filtering as a feature of a new DNS infrastructure, then the most likely assumption is that they're talking about DNS-level filtering.


My assumption is based on the fact that DNS-based filtering ("of URLs leading to illegal content") simply doesn't work and is trivial to circumvent both by the client and the server, so the countries that block Libgen&co. do so at the ISP level using IP filtering.


It is trivial to circumvent.

And countries and ISPs still do it all the time, because most consumers are not capable of even the trivial step of changing DNS servers. e.g. in the UK blocking is usually just implemented by DNS filter.


The way I read it, the proposal is that ISPs and other providers of recursive resolvers MAY implement "value-added" filtering services. I didn't see anything about some central filtering agency that had the power to force some filter-package into every recursive resolver in the EU.


> Provided we can always switch to an alternative DNS servers from inside the EU if we need too, it's a net positive.

After the past decade why would you think they will allow that?


Why would I think they would not?

No matter how many bad things the EU does (and I'm not blind to them), after traveling all around the world, working in the US, Asia and Africa, it's still the place where I feel the most free.

I trust them much more to not go complete bonkers than Russia, the USA or China.

In fact, the GPRD, the right for repair and the various attacks at tracking are quite to my liking.

I'm not ruling out the possibility they mess it up, but I stay optimist.


Pleasantly surprised to see this degree of nuance in top level comments.

I do find it very alarming that they want to bake in "lawful filtering" and especially alarming that they want to bring in "premium and wholesale services."

In the best case scenario, if EU had a record of reasonable enforcement or ahead-of-the-curve thinking this might be okay, I don't think there's anything suggesting that the EU is thinking ahead or capable of imagining unintended downstream consequences.

I think more DNS is better, which is good, but its balanced with some concern.


> Even if the censorship implications are a bit obvious, it's good that:

LOL, sure, we better at the mercy of the american censorship and 'tracking' system


As long as they remain alternatives, it is okay. But given that this is the EU, it won't be optional for very long.


I don't think there is much prospect of the EU banning me from using my own recursive resolver. And I find it hard to see how they might try to enforce it.


Yes, it's a bad thing.

Because you can't choose what's acceptable, they do.

You won't decide the topic, format, quantity, density, duration, nature or interruption type. Which is different for you, me, or your children.

What's more, ads are not made for your benefit, ever, but to the benefit of the advertiser which may (but statistically more likely may not) align with yours.

And also because:

- the incentive gets twisted, which means you can't trust ublock on the long run.

- unkown unknowns means down the road, some ads will manage to track you or serve malicious content despite ublock filtering.

- ads paid content is a terrible business model which take a price people are not wired to assess nor realize they pay for something they disguise as free yet has an impact on the entire society. Not a great thing to encourage.

And I say all that as someone who gets revenue from ads.


> you can't trust ublock on the long run

Why is this? Would you also say this for other long running open source projects which have never breach the trust of their users?


Forgive me if I'm wrong, but wasn't uBlock handed over (changed owners? don't quite know how to put it) and uBlock origin started later precisely because uBlock breached the trust of their users?


I am assuming the person was referring to "uBlock Origin" given that "uBlock" has already shown it can't be trusted, maybe I am wrong and he was indeed referring to "uBlock".

The repo was handed in good faith, not for the sake of financial gains. It turned out to be a mistake, from which I learned. That was now nearly seven years ago. If the take away from that event after years of never breaching user trust is that "uBlock Origin can't be trusted in the long run", that's pretty harsh.


He was replying to a comment about the "Acceptable Ads" policy so he was clearly talking about uBlock, not uBlock Origin.

I think the story of how uBlock was transfered and then managed in a way that was not what you wished is pretty well known, and I think most people know that you forked back the project to restore that trust, and they appreciate the work you're doing for the community. At least I know I do, so let me take this opportunity to say thank you.


There is a lot of confusion going around in this thread regarding the difference between "uBlock" and "uBlock origin" with many people not even realizing there is a difference.

As far as uBlock Origin goes, it's one of the extensions I trust the most.


uBlock Origin is an entirely volunteer-run project. There is very little reason to trust that it will be around for any particular amount of time.


And the person you're talking to is the main dev.

Based on his past actions, I feel comfortable trusting and using uBO until he decides he's done.


I had no idea! But, my point is specifically about when “he decides he’s done.”


IIRC the developer said when he's done he is not going to transfer ownership. It's open source so it can live on, but not under the same name.


Right, any idea on how to keep content accessible and people with paychecks maintaining it?


> Because you can't choose what's acceptable, they do.

Not exactly the acceptable ads must conform to the standard that is defined by the acceptable ads Committee which consists of publishers users, and distribution. Something like that.


> because you can't choose

That seems like just an implementation detail. If users are able to choose/vote what is "acceptable" that seems like a concept worth trying.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: