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

The distros devs live in their own world, they don't have to work on a fast api service connected to a sap db that must run on windows with no admin rights for dev but must be deployed on centos 7.

comment 5y ago · link · parent

There are some differences indeed:

- python is more active than most alternatives, you have new packages created every day.

- python is massively used outside of the web, unlike JS, ruby or PHP, that are 99% web. You get Python in SIG softwares, data analytics, automation, pen testing, sysadmin, biology, etc. It's a huge graph.

- python is used by the distro themselves to code features of the OS. E.G: you remove Python, there is no yum.

- python has a rich compiled extensions ecosystem, produced from c, c++, fortran, and assembly. It's very complicated to ship them.

- it's much more common to have several Python installed than for other dynamic languages. So isolation matters even more.

So the difference is the sheer size of the problem.

comment 5y ago · link · parent

Please don't take it the wrong way, I have a lot of respect for distros packagers and maintainers. I donate to debian, and I report bugs. I think you are basically heroes of the FOSS world, because without your invisible (and frankly thankless) work, mine wouldn't exist.

But come on, there are 300k entries on pypi, 200k more for perl and 160k for ruby. I'm not even counting the whooping 1.3M on npm because I assume this is considered taboo at this point.

You cannot package 0.0001% of that, not to mentions updates.

And unless distros make it as easy to package and distribute deb/rpm/etc than it is to use the native package manager, this means distro packaging will never be attractive to most users because:

- they don't have access to most packages

- the provided packages are obsolete

- packages authors have no way to easily provide an update to the users

- it's very hard to isolate projects with various versions of the same libs, or incompatible libs

And that's not even mentioning that:

- package authors may not have the right to use apt/dnf on their machine.

- libs may be just a bunch of files in a git repo, which pip/gem/npm support installing from

- this is not compatible with anaconda, which has a huge corporate presence

- this is not compatible with heroku/databrics/pythonanywhere, etc

- this is hard to make it work with jupyter kernels

Now let's say all those issues are solved. A miracle happens. Sorry, 47 miracles happen.

That would force the users to create a special case for each distros, then for mac, then for windows. I have a limited amount of time and energy, I'm not going to learn and code for 10 different packaging systems.

It's not that we want to screw over linux distros. It's that it's not practical, nor economically viable to use the provided infra. The world is not suddenly going to slow down, vulnerabilities will not stop creeping up, managers will not stop to ask you to use $last_weird_things. This ship has sailed. We won't stay stuff only published 5 years ago with delays of months for every updates.

comment 5y ago · link · parent

Optimal != Best for most people.

comment 5y ago · link · parent

I doesn't work on windows, so you lose half of your users. And WSL is not the answer to that.

Also, unless you repackage thousands of compiled c extensions and you play well with anaconda and can plug into the entire python ecosystem of platforms such as heroku, python anywhere, databrick and so on, you then lose 90%

comment 5y ago · link · parent

Unfortunatly windows has plenty of problems too. First, the system PATH will kick you if of you have more than one python installed, so the official installer does not add to it by default, hence the python command doesn't work after an install. Instead, you get the py launcher, but it's not provided if you installed python from the app store or with anaconda.

The you have powershell permission system.

It's a ton of fun.

comment 5y ago · link · parent

Yes that's the point. We won't use distro packages because only regular python packages allow this.

Edit : arf, sorry, I answered the wrong comment, I actually agree with my parent.

comment 5y ago · link · parent

Sure, so my lib works on mac, windows, centos and debian.

Tell me how I'm supposed to define my lib python deps ?

How am I suppose to package the lib ? Distribute it ? Deal with os versions differences? Allow isolation for my user projects ?

comment 5y ago · link · parent

Yes, explaining to a beginer how to bootstrap python is hell because windows, mac and linux keeps making sure nothing work the same.

comment 5y ago · link · parent

The day packaging for distros will be easy, we will use it. Right now, making a deb is hard. Isolating 2 projects with different deb verions is hard. Distributing debs is hard. Upgrading your OS but not your python debs is hards.

Then rinse and repeat for red hat, arch, nix, mac and windows ?

Yeah right.

comment 5y ago · link · parent

The purpose of vite is not to be fast for build, but to be a live reload instant dev platform. So you almost never run build. You code with vite's server, and it let you see the result instantly in the browser. You can use modules, modern js, and transpiled languages transparently.

Then when you put in prod, you build once. 30s once a day doesn't matter.

comment 5y ago · link · parent

That's fantastic news.

comment 5y ago · link · parent

> Equally, there's no Hibernate for Python, no Spring for Python. And FastAPI looks basically like JAX-RS to me.

Of course there is. In fact, SQLA is easier to use than Hibernate, and the ecosystem around is as rich. As for Spring, crossbar fits the bill.

> I don't think the lack of any of these things is because they're impossible, or even particularly hard. It's because the community did or did not have the need and energy to build them.

I've never say they are impossible. I've said they require less energy to build them in python :)

comment 5y ago · link · parent

There is also no Django for Java, no Fast API for Java, no Typer for Java, etc.

Why ? Because it's easier to write great frameworks in Python.

It compounds.

comment 5y ago · link · parent

Java, Perl and Ruby all had the same.

In fact, in 2018, Java 8 was still massively used:

https://jaxenter.com/java-8-still-strong-java-10-142642.html

Then you have libs and frameworks, and they break compat too. The JS ecosystem basically broke everyone code for 10 years every 6 month.

It's not a Python thing.

comment 5y ago · link · parent

Yes, that's my whole point.

Where in the stack do you see that Python performances matter?

Only one software out of a 1000 will actually need it. The others will mostly do plumbing or automation.

And scripting languages excel at both.

If you don't fall in that category, then yes, do use a fast language. If you are coding a chat server, use Erlang. If you want to do a rendering engine, use Rust. But if you most likely want to code your company CRUD software and glue it to some external services and providers, use Python.

comment 5y ago · link · parent

Talking about gotchas and then recommend bash is not a sign of credibility in my book.

Bash has one strong point: 4 to 5 lines admin scripts for which concision and expressiveness matter more than anything else. That's it.

There is nothing else it can be better at than ruby, python, perl, php, or even go or kotlin.

The argument you need to learn x stands for bash as well, btw.

comment 5y ago · link · parent

I have a half million users a day streaming website coded in Python. It does machine learning, uploading, encoding, dynamic load balancing, live search, comments, votes and most of the code I had to write was in django or rq endpoints.

On first load, not only the page is ready, but the video has started to auto play (including buffering), under 3 seconds. Less than 500ms on a reload.

The whole project has been running for 10 years on 7 servers. Hosting costs under $1K/mo.

And even better, the code base is a mere 11K LoC, so a single dev can manage it. And make a living out of it.

That's because:

- Python is almost never the bottleneck in a website

- Python wraps compiled languages for slow stuff. That's the whole point.

- your archi matters much more than the language you chose. Because good db providers, proper caching and optimized data fetching will be the pareto moves, unless you are google size.

- you will not code most things anyway. You are not going to code the video encoding, you will use ffmpeg. You will not recode a database, you will use an existing one. You will not code a server, you will use nginx or something else. What you will spend time on is creating logic for your clients.

So I think your are extrapolating this rare use case where your POV makes sense, and ignore the 99% of the case were, indeed, a slow language doesn't matter.

In fact, if electron success tells anything, it's that while I do value speed a lot, the market has voted.

comment 5y ago · link · parent

This is the limit to technical solution to political problems. If the gov wants troubles for you, you will get them unless you manage to escape.

A state entity can only be slowed down.

3350.

Ceno: A P2P mobile browser to fight censorship(censorship.no ↗)

5 points · by BiteCode_dev · 5y ago · 3 comments

comment 5y ago · link · parent

Briar is really neat, and I hope it will land on Linux, Mac and Windows. Being able to send messages and files directly to anybody on a local network without any account just rocks.

comment 5y ago · link · parent

It's very slow for big files though, and requires several clicks on the 2 devices. If you are on the local network, kde-connect is still the golden standard provided you use linux (even with gnome) and android:

- click on the top bar menu to select your device

- select the file

- done

It uploads automatically in the download folder of the other device. It uses the local network speed. Doesn't require additional clicks.

But as soon as I'm on 4G, telegram saved messages is what I use too. In fact, I use it to takes vocal notes, pictures of stuff to remind me later, schedule reminders (yes, it has delayed messages!) and so on. It's my inbox basket for GTD at this point.

comment 5y ago · link · parent

Shared drives ?

comment 5y ago · link · parent

You do have imports and functions so you can reuse what you want.

The doc is also quite clear and rich, but the way it's organized means I have to read it entirely before writting my first CUE file. It also lacks IRL examples so trials and errors were my best friends.

It can be discouraging.

comment 5y ago · link · parent

Any valid json can be parsed by any 1.2 yaml parser. That's how it gained popularity in the first place: you didn't have to migrate. Like ascii and utf8.

comment 5y ago · link · parent

I've tried dhall, cue and jsonet, and cue is so far my fav. It's very well designed, expressive, but restrictive enough so that config files don't look like scripts.

The way it blend types and values makes learning it super easy, yet you can do complex things with few lines.

But the main implementation exports to yaml without quoting the strings, which kinda defeat the purpose :(

comment 5y ago · link · parent

"It's to fight terrorism, don't tell anyone"

comment 5y ago · link · parent

Somes tools will parse it as a file extension

comment 5y ago · link · parent

The problem is that the american politicians justify those actions by pretenting it's a moral call.

So the BS meter is rising.

1
111112113
184