Better HN
topnewbestaskshowjobs
Log inSign up

BiteCode_dev

24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions

I write to save you time and effort when dealing with Python:

https://www.bitecode.dev/

Email: contact at bitecode.dev

Submissions

comment 4y ago · link · parent

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

comment 4y ago · link · parent

> 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.

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

Just like a programming language, in fact.

comment 4y ago · link · parent

> 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.

comment 4y ago · link · parent

French here. Thank you.

comment 4y ago · link · parent

> 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.

comment 4y ago · link · parent

> 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.

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

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

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

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.

3224.

Sonora: Python implementation of gRPC-Web built on top of WSGI/ASGI(github.com ↗)

53 points · by BiteCode_dev · 4y ago · 15 comments

comment 4y ago · link · parent

It's not hard, it's just that politicians and businessmes don't want to say "we don't know", "we are not sure", "we take the chance of a probability x". If you say "I'm going to solve all of your problems tommorow", you'll get better ratings today, so they choose that instead of managing expectations, explaning to adults the process that is undergoing, and giving the data and sources etc.

Now we have trust at an all time low, in a period of social media outrage and a conspirationnist gold era.

Which means more death and a prolonging crisis.

I do understand that the public have a limited attention span and a lack of critical thinking, but those in charge are nurturing it, for the worse.

The covid, IMO, is as much a social crisis than it is a health one.

comment 4y ago · link · parent

That's not the problem, the problem is the way the whole thing has been communicated to the people.

comment 4y ago · link · parent

One of the recurring arguments from anti-vaxers is that big pharma is setuping us for a vaccine version of netflix: Shot As A Service.

After being told one dose of the vaccine will prevent us from catching covid, then that actually it needs a second dose the same year, well actually you could catch it, wait actually you will probably catch it but it's less deadly, oh I forgot you'll need 3 doses. Ah, now 4 in 2 years... Also, the FDA wants 55 years to process FOIA request over the vaccine data.

Those people need to get their communication act together, because they are loosing credibility at the speed of an R0 of 3. The public is already squirmish, not to mention tense because of the economic and social impact of the pandemic.

It's like they have a secret wish for people to explode in their face.

comment 4y ago · link · parent

Suddenly, the reason for the recent employee purge seems more clear. They never fired anybody for bad behavior before, and now, just soon to be aquired, they do.

3229.

Xpresso: Fastapi inspired Python web framework with flexible deps injection(github.com ↗)

2 points · by BiteCode_dev · 4y ago · discuss

comment 4y ago · link · parent

Another thing is that people defending a believe don't necessary hold it true deep inside. But it's part of their identity, so they play their role, and defend it.

Once you pick it up, you'll start to notice it for a lot of things: racism/sexism, welcoming immigrants, climate change is a hoax, I'm a busy person, my boss is terrible, I just love to do < hard thing >, capitalism is bad, I'm concerned by the planet...

E.G:

I have a friend who keeps insisting she prefers women, has a lesbian dominated social circle, but mostly have sex with males. She is joining protests for all things hurting migrants, but one was sleeping in a car in our street, and after getting her bike stolen, she decided with no proof he was the culprit and called the cops on him and got him deported.

I know a vegetarian that eats meat when he travels, because nobody can see him.

I had a flatmate who was writing her memoir on the way women were badly treated in India. She eventually dated our Indian other flatmate, and took great care of cleaning his _disgusting_ bedroom and doing his laundry without any reciprocity, for the entire relationship.

I know 2 guys that, if asked, will declare they are for peace and think war lords are a bad thing. I mean, who doesn't ? Both considered working for weapon dealers, one actually accepted, and the main clients are the Emirates.

All those persons are people I love very much: humans are weird creatures, full of contradictions, doing plenty of bad things. I'm sure those flat earthers can be good friends too, maybe even great citizens for some things I'm terrible at.

I'm certainly an asshole competing in several categories, believing idiotic things, pretending to believe others.

I think people who see themselves differently have huge blind spots which help them go on the hate train.

We all suck. Even when taught critical thinking, which I manage to abuse regularly for terrible results.

True, we are not all at the same level on the Gaussian idiocy curve. At least according to ourselves.

Yet, in my experience, education works only if freed from contempt.

So let's have compassion for "stupid people in large numbers."

There are 7 billions of them.

comment 4y ago · link · parent

That is based on the id a cloud base service would not need a team to make it work.

I'd argue it actually need a more expensive team.

comment 4y ago · link · parent

One month part time once a year as an additional cost is way, way cheaper than anything else.

> Cloud is surprisingly cheap once you factor in engineering costs.

No, it's not, since you need somebody qualified to operate it. And such qualificatied employees is very expensive. And you will need them on call anyway, since it will break, just in different way than a bunch of private servers.

I'd argue the cloud would be more expensive, even if hosting were not, because you need a more expensive team to run it.

comment 4y ago · link · parent

> pay a little extra

The whole idea is that it's not a little extra, but 2 orders of magnitude.

comment 4y ago · link · parent

You keep moving the goal post.

It seems it's criminal to run a service on the cheap, there must be a terrible human being behing it.

Well no, the dev is not attached 365 days on its computer.

A freelancer is hired part time for the duration of the vaccations. It cost a full dev salary for one month, taking in consideration training time, that's all.

> If you’re running a website where extended outages are no big deal and you don’t care about lost revenue, then it’s not really a valid comparison to the typical business website.

Most services can actually go down once a month, and be a viable business. You are not google or facebook.

In fact, most human service goes down for days: bakeries, lawyers, teachers, plumbers.

The fact your think internet services should be up all time is only in your head. Humans adapt perfectly.

It's not that a big deal. Most of our softwares are not as important as we want to think.

If you really want a 99.99999% up time, you going to increase your service quality by 10%, and your service cost by 1000000%.

The funny thing is, the downtime of ourservice has not being more than github's downtime in the last few years. So honestly the freelacer is mostly hired to have drinks on the house. Because monolythes are very reliable in the first place.

> Your situation is unique, not a model by which other companies should follow.

Every situation is unique, I never, ever stated it was " a model by which other companies should follow". You did.

There is no such thing as "a model by which other companies should follow". You must adapt to the situation and goals. Engineering is about compromises.

My post is simply stating the reality that you can get very far with good old tech.

And a lot of projects don't need the cloud, or high availability. Yet they pay premium for it.

comment 4y ago · link · parent

Nobody is on call 24H.

If the system has a problem during the night, the users will wait until the morning.

The world doesn't stop because a streaming service is down for a few hours. It's not a medical service, or something thousands of businesses rely on.

It just looses a bit of money and users are grumpy for a day because they had to wait until they could access new content.

It's ok.

comment 4y ago · link · parent

A python that knows python and linux is enough to support the up time needs and evolutions of this particular product. Actually a part time one.

The entire team is composed of half of one dev.

I'm 100% sure it's way cheaper than anybody that has AWS on resume.

Of course, some things have to give, like the global CND, and some data guarantees.

Everything is a compromise. It's all depend of what is important for your project.

EDIT: also, my comment was not meant to oppose the article, but rather confirm the view that you should calibrate your setup to your project. Doing so will lead to great savings in hosting, and project complexity. A lot of projects don't need the cloud.

comment 4y ago · link · parent

No, the system is maintained by one single part time dev. That's the entire dev team.
1
107108109
184