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

Of course, but the goal is not to win, the goal is to make it so it take years before they get fined. In the meantime, they will have made enough money and it will be factored into the cost of business, then they will come up with a new tracking scheme. Rinse and repeat.

comment 5y ago · link · parent

When you use Chrome for the first time, it makes you accept its ToS which tells you they are going to track you.

comment 5y ago · link · parent

Well, FLoC is implemented on Chrome, you don't disable it, you opt out with a Header.

So if Googles find that too many people uses the header, they can just decide to ignore it from now on. Who is going to prevent them to do that ?

comment 5y ago · link · parent

I don't know how other people played populous, but I was more an asshole than an angel with my believers.

Not doing what I want ? Eat this volcano !

comment 5y ago · link · parent

Make it a game about being a guardian angel.

Set objectives for the people, a few non intrusive tools (moving cats around, blowing wind, changing light traffic), and as the angel, the player must influence the world so that objectives are reached.

comment 5y ago · link · parent

I fought with webpack for years, then ViteJS came out.

It works out of the box, is uber fast, support Vue + React and does everything webpack did for me.

I stopped thinking about my tooling and could go back to spend those CPU brain cycle on solving my clients problems.

Peace of mind.

Thanks Evan You.

comment 5y ago · link · parent

Looks awesome.

comment 5y ago · link · parent

> So... Java is bad, but let's ignore Python's problems.

I don't know where you read either of your propositions in any of my comment.

comment 5y ago · link · parent

Indeed, my mistake.

comment 5y ago · link · parent

In the IP world, there are some-hidden gems that disappear with no trace one day.

I worked for a client that had this wonderful Python dsl that compiled to Verilog and VHDL. It was much easier to use than writing the stuff the old way. Much more composable too, not to mention tooling.

They created that by forking an open source project dating back to Python 2.5 that I could never find again.

Imagine if that stuff would still be alive today. You could have a market for paid pypi.org instances providing you with pip installable IP components you can compose and customize easily.

But in this market, sharing is not really a virtue.

comment 5y ago · link · parent

Dropbox, Instagram, Google, Youtube, reddit and Nasa all have been heavily Python powered for a decade.

I myself have coded a streaming platform getting half a million user every day in Python. Baring the CDN to store the content, it runs on 2 servers, one for the DB.

So real things get done in Python pretty well.

comment 5y ago · link · parent

If it's just about I/O, then no, threads in Python are super easy:

    import random
    import time
    from concurrent.futures import ThreadPoolExecutor, as_completed


    def hello(seconds):
        print(f"Starting hello in {seconds}s")
        time.sleep(seconds)
        print(f"End of hello in {seconds}s")
        return seconds


    # At the end of this blocks, it automatically join() and clean
    with ThreadPoolExecutor(max_workers=2) as executor: # 2 tasks in parallel max

        # this send jobs to threads via safe queues
        a = executor.submit(hello, random.randint(0, 5))
        b = executor.submit(hello, random.randint(0, 5))

        # this collect results from queues in order of completion
        # sync is automatic
        for future in as_completed((a, b)):  
            print(future.result())
And if about network I/O only, you can get even more perfs using asyncio.

Threads in Python are only inferior to Java threads when it's about using several CPU.

comment 5y ago · link · parent

So you are in the very niche use case where:

- you need a GUI

- you need perf beyond what Python is capable and you identified it clearly in advance

- you can't use numpy / multiprocessing / cython, pypy or they won't give you the perf you need

- you can't find a main hotpath you can optimize with a 5 lines c or rust extension and write 99.99% of your app in python. Or you don't want to bother.

If you ever find yourself in this very use case, then yes, use Java.

But I never found myself in this very precise use case.

comment 5y ago · link · parent

Python and Ruby both would fit the bill perfectly for all those use cases for me.

The cryptography module in Python is awesome. lxml and sud deals with XML and Soap in a blink.

Modeling large business concept is a joy with dataclasses, and the language will never be the perf bottleneck.

Now I understand that if you are experienced with Java, it would solve all those problems perfectly.

But again, I would not, personally, gain anything by using it for this.

comment 5y ago · link · parent

It's an anwser to "You use Java because it is low risk". I just don't think it's immune in any way.

comment 5y ago · link · parent

Django: zero dependencies for years, you could literally copy paste the code and it worked, ORM included.

It now has 2 dependencies. It is a 1000 times easier to use than hibernate, despite being one of the worse ORM in Python.

That the problem with old Java libs like Swing or Hibernate: they have been designed for the 90' and don't leverage the potential of what a modern Java version can do.

comment 5y ago · link · parent

Yes of course, don't fix what's not broken.

It's orthogonal to my point though.

comment 5y ago · link · parent

I literally wrote "It was necessary for the things that are were not easy to do without breaking compat such as unicode"

comment 5y ago · link · parent

Human being have the right to have an opinion and question the decision of the people designing the product they use.

FOSS is not a religion.

comment 5y ago · link · parent

1 - FastAPI was created before the change was announced.

2 - You assume they knew about it. It's a lot of work to create FOSS, it's very easy to miss those things given the huge amount of information you have to check for compat and security. Hell, I certainly don't assume my main dependency, which is a rock solid language no changing the major version and used by millions is going to break my project. I don't read each line of each changelog of each version upgrade of each of my dependency.

3 - Even if they knew about it, they may never have realized it would have broken something before people told them so.

4 - They may even have noticed, 3 years ago, but forgot about it. It was 3 years ago!

It's only human. It's FOSS.

comment 5y ago · link · parent

Dropbox, Youtube, Google, Instagram and NASA tell a different story.

And me too.

Scaling a Python project complexity is not harder than scaling Java, the things you have to be careful about are just different.

comment 5y ago · link · parent

Python 3 was necessary for cleaning. Having default new style classes, super() and so on are goodies, not necessities.

It was necessary for the things that are were not easy to do without breaking compat such as unicode, fixing comparison bugs, etc.

Now none of the stuff that broke compat in 3 after the initial release were things that were necessities. They were goodies. You don't need make from __future__ import annotations as default. You don't need to make async/await keyword.

comment 5y ago · link · parent

There was an even smaller team in 2.X, and 2.X broke less stuff while still providing new features.

So no.

It's a matter of product vision here.

comment 5y ago · link · parent

They don't serve the same purpose.

Pyinstaller builds bundle the python binary with the project. It works without a Python installed on the system, is not portable and the resulting binary is fat. It also can fail in numerous way and be slow, but end users will find it the easier to use when they work.

Pyz files just contains python code. Shiv produce them by bundling your code and the dependencies, but you still need a Python installed on the system to run that. You pay the cost of zipping only on the first run though, after that, it's unzipped. And their are portable if you use no binary wheel. It's light and easy to get right.

In that sense, they look more like War files in Java.

Pyinstaller, like cx_freeze and nuikta are for end users.

Pyz are for devs.

comment 5y ago · link · parent

They just hired Guido, the father of Python, at Microsoft.

So, I would not be so sure.

comment 5y ago · link · parent

Well, that's the point of opinion isn't it ?

comment 5y ago · link · parent

You don't need to write it. The ecosystem is already chock full of compiled extensions. That's kinda the point.

comment 5y ago · link · parent

It's not a matter of better. The original comment is all about what compromises work for me, and why I don't have a use case for Java.

You are trying to move the debate toward the quality of java, which is was never my point.

comment 5y ago · link · parent

See my answer to your sibling. It's not an "or" proposition.

The 2 to 3 transition was hard because we did an abrupt cut. We could have had few transitioning versions that supported both worlds, then disabled the old ways but with a switch to put them back on if needed for a while, and allow for a more peaceful transition.

comment 5y ago · link · parent

I agree, and I'm not advocating to freeze the python language, nor don't understand how understaffed the python core devs are.

But there are strategies that are in used or have been in used that we could draw inspiration from:

- async/await didn't need to become keywords so fast. True/False were not for 15 years.

- changing the default encoding is behind env var flag.

- changing the way the c api is done is currently made doing the separate HPy project. It's not breaking anything.

So there were instances where people intelligently decided to move the language forward, but stopped and remembered Linus wisdom of "we don't breaking userland". And they did improve things without breaking others.

Guido used to be very strict on that too. But after so many years, we can't expect him to spend all his energy still policing every aspect of the project, especially after he stepped down as a BDFL.

1
145146147
184