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 5y ago · link · parent

It's not that easy actually.

Python already does so much for you, and provides so much tooling to do even more, it's hard to write bad code if your daily job is to be a coder.

The iterator protocol means you rarely get off by one errors, context managers and GC deals with resource handling, the GIL, for all its faults, helps a lot of concurrency errors...

Now, add a good IDE, and syntax errors, names errors and attribute errors go away. Play a little in the REPL, and use cases become more obvious, behaviors more clear.

Want more security? You can add type hints and unit tests (which are incredibly easy to write, thanks to pytest).

Even without all that, the size of the ecosystem means you won't write most of the code anyway, and less code, means less potential for mistakes. Adds to that the language bare bone syntax, and you really has something that actively helps with writing good code.

Not to say you can't write bad code in Python, but unless you are not a professional dev (in that case, you can write bad code in any lang), you have a lot to help you there.

comment 5y ago · link · parent

Not to mention facebook leaders don't care, they already made billions by misbehaving without any consequence. Even if the story did end there, it's 100% win for them.

This is the lesson of our generation: makes money by delegating the consequences to society. Nothing will happen to you. In fact, in 20 years, you could buy the service of some PR firm, and they will even make you a hero in the eyes of the public eventually.

comment 5y ago · link · parent

I mean, they abuse the system like dictators "abuse" guns to kill people.

If you have a company selling a weapon, it's pretty obvious it's going to be used to harm. That's by design.

And just like we were never able to prevent the guns to arrive in the hand of the wrong people, or make sure people using guns respect any kind of rules, why would we expect NSO clients to be well filtered and behaved?

comment 5y ago · link · parent

The for loop in python is a try/except catching StopIteration in a trench coat.

Also, EAFP, and the context manager protocol.

comment 5y ago · link · parent

> they have created a system of incentives that are inexorably leading to harmful outcomes

If the people inside are "smart, thoughtful, kind, well-intentioned people", they would have tried to work around the incentive, influence them, denounce them, or quit.

It rarely happened. Most of the time, the just take the money, and goes with the flow.

comment 5y ago · link · parent

It's a good insight for any transformation really, including change in code: look at what's in common between the desired outcome and the current situation to have an idea how how much work to do.

comment 5y ago · link · parent

I don't use it either, but there is a lot of value in it because it forces formalism and transparency, and allow reproducibility for something as important as taxes.

comment 5y ago · link · parent

Can you have 2 different profiles on chrome opens at the same time on android?

comment 5y ago · link · parent

> Expecting a zero-config install for Linux is pushing it to begin with.

How so? Dropbox is zero config install for linux.

> Are pretty much mutually exclusive. If you want it to be powerful you'll need to do the work to configure it.

I never said zero config, I said easy to configure. Firefox has plenty of configuration nobs, but it's easy to configure it.

> What you really want is rsync over SSH to a ZFS volume with encryption enabled, or some other CoW filesystem that lets you do snapshots and access them online.

No because that's very complicated. I've done it in the past, and just the fact I have to manage a VPS to do so is more than what I want to do.

I've used rsync as well, it's again, too much scripting, meaning to much margin for errors.

Apple Time machine for linux is what I want, with remote capabilities.

comment 5y ago · link · parent

3 years is a lot, and tox the testing tool is much more used than tox the chat protocol.

comment 5y ago · link · parent

> To be fair, several options do not require changing habits or behaviors once in place

Please share.

comment 5y ago · link · parent

I can't find such tool for the love of me.

I'm ok to pay for it but:

1 - I need the client to use encryption and be open source

2 - It needs to run on linux

3 - It needs to backup files in arbitrary locations, including spanning several partitions (one NTFS, one ext3)

4 - It needs good filtering / curation capabilities

5 - Restore should have great granularity, and I should be able to browser the archive without having to unpack it all

6 - it needs to be easy to setup. I don't want to setup my own instance or mess with config files.

I've never found a tools that could do all that. One of those always fail, and sometimes the tool promise all of them, but doesn't even manage to backup. Some backup only partially, missing a files. Some backup, and don't restore. Some can only restore the all archive. Some don't encrypt. Some are close source, or only available on Mac and Linux. Some will store wrong files, and you can't them out of the backup.

It's crazy that in 2021, the state of backup sucks so much.

So have 2 backups on 2 different hard drives for all my files. One with "way back machine", the other one with a simple cp. Then I take essential files, and I put them on a usb drive.

My only remote backup are githup repo and emails.

Any suggestion?

comment 5y ago · link · parent

If you want the exact equivalent, use Firefox profiles (-p at startup, or install the profile switcher addon: https://addons.mozilla.org/en-US/firefox/addon/profile-switc...).

But Firefox has a much better feature: tab containers. You can attach a label to a tab, and only tabs sharing this label will share states, such as cookies, cache, localstorage and so on. This means you don't need to open a new window. You can have 2 HN accounts with each a different user logged in, in 2 tabs, next to each other, distinguishable with a color.

You can use it by activating a few settings in about:config (https://support.mozilla.org/en-US/kb/containers#w_for-advanc...), but the easiest way it to use the addon : https://addons.mozilla.org/fr/firefox/addon/multi-account-co...

comment 5y ago · link · parent

Tox is already a very popular testing tool in python, to the name is a bit confusing.

comment 5y ago · link · parent

The states don't do the taxes manually, either.

Just like France, they could open source their software.

comment 5y ago · link · parent

If you are an employee, usually you just have to approve it on the internet, since it's taken directly, every month, from your salary.

Even as a freelancer, it usually takes me 10 minutes on the web to fill my yearly taxes nowaday. It used to be way longer, with queue at the tax offices, real papers to fill, etc.

But I do have a very convenient status, administrative wise.

3617.

OpenFisca: The French tax code, turned into Python(openfisca.org ↗)

2 points · by BiteCode_dev · 5y ago · discuss

comment 5y ago · link · parent

The french initiative started in 2013 is still alive (last commit a few days ago), and passes the gov test suite (they keep in touch with our version of the IRS): https://github.com/openfisca/openfisca-france

The way we got this is interestingly twisted.

French citizens requested the software used by the administration, and they managed to get it!

But, it was written in Mlang, a proprietary language created by the french administration in the 90: https://github.com/MLanguage/mlang.

Someone then decided to create an OCaml compiler that takes mlang and emits python: https://arxiv.org/abs/2011.07966

As a result, we got Open Fisca. I now think there are other techs in the mix...

A slide of the story: https://www.slideshare.net/Etalab/opening-up-the-french-tax-...

But I believe it should be mandatory for the state to provide the source of every softwares they use internally to manage our lives. Also a test suite to allow any citizen to validate their own effort to comply with the law.

Just like laws should be published as diff of the previous laws, in a VCS repo.

comment 5y ago · link · parent

Honestly, being smart is overrated. Granted, it's better than being dumb, but being hard working, having social skills, being at the right time at the right place, having grit, having a head start in life (money, status, etc), looking attractive, having stamina, having an upbeat personality, all offer often as good or better deals and/or less downsides.

Smart is like a spice, it's great to add to something good to make it better. But it can't be the main thing.

comment 5y ago · link · parent

Although pattern matching is a good improvement, I'm more excited about the better error messages.

This is going to make using python anywhere I don't have an IDE much easier: while teaching, on a remote server, on someone else machine, on repl online, etc.

comment 5y ago · link · parent

It's already the case. It's been some times since some websites randomly are hard to reach for me. Changing DNS helped, but the best move has been a VPN to a far away country.

comment 5y ago · link · parent

> In terms of language features

In terms of language features yes. But, personally, I will install this version ASAP (3.10.1, I won't install the fresh one, there are always bugs to iron out) because of the great efforts toward improving error messages. Effort that will be ongoing in 3.11.

Those little things make the dev and teaching experience much, much better.

comment 5y ago · link · parent

Apple does the same, no?

comment 5y ago · link · parent

> Notably, the richest people in the United States - like Jeff Bezos, Elon Musk, Bill Gates, and Warren Buffett - are not in the so-called Pandora Papers, the Washington Post reported.

comment 5y ago · link · parent

Well if you like this, you are going to love 3.10 due for tomortow, because it's packed with a lot of error message improvements.

Everybody talks about the pattern matching, but I'm excited about this. I'm going to upgrade ASAP just so for it.

comment 5y ago · link · parent

Because python 2 has been unsupported for more than a year.

comment 5y ago · link · parent

On fact, for loops are try/except under the hood.

comment 5y ago · link · parent

Ah the speed runnin community is such a gem. So much effort, so much passion, for something that will disapear like a tear in the rain.

comment 5y ago · link · parent

I recently discoveree the "kai" version of popular animes, meaning a recut of the hundred of episodes by fans to remove repeatitions, fillers, useless flashbacks and long stares or empty dialogs that just waste time.

You can now watch the entire Dragon Ball and DBZ in half the time it should take, missing nothing from the original, saving on frustration.

There are gigabytes of content, it's crazy to me some people spend years on those and just give them away as torrents, doing a better job that the right holders swimming in money.

comment 5y ago · link · parent

Honestly, if the game made kids plenty of good memories, it was a great success.

And maybe I was already too old when I finished it. Everything taste differently when you are under 12.

1
120121122
184