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

Depends of the work you have to do.

If you code a website, fast api and django, the two most popular framework to do so, heavily rely on them to make you productive.

comment 3y ago · link · parent

This is in discussion, but is not straighforward. We need a story for system python which does not want this behavior, a security story so that an attacker cannot just pop a dir and make you execute it, a story for entry points, a story for parent env handling and so on.

pypackages is a proposal for this, but since it's harder to do, and this one easier, one step after the other...

comment 3y ago · link · parent

We cannot do that yet because not all systems come with venv install, thanks to linux.

comment 3y ago · link · parent

One of the biggest problem in python packaging is... not packaging.

Bootstrapping a workable dev env is hard: you can fail at installing python, setting it up, creating a venv, activating it...

This PEP is a step in the right direction: we don't want people that don't know what they are doing (which is a lot of python users, since it's a popular language among non developers) to install something outside of a venv.

First, it can break things. But also, it will probably not work, and if it does, it will bite them later on.

So the PEP is willing to break backward compatibility for pip to say "nope, you are not in a venv, you can't install a package" by default, and give instructions on how to do so to the user.

Ideally, we should have something like cargo or npm, which solve the entire problem altogether, but believe it or not, it's not easy to do for a project as old and successful as python.

This is a healthy compromise while something better is decided.

2165.

PEP 704 – Require virtual environments by default for package installers(peps.python.org ↗)

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

comment 3y ago · link · parent

Well don't know if I'm a dick, but my code have proven its author to be an idiot many times :)

comment 3y ago · link · parent

Everybody agree that there are several of overpaid BS jobs out there.

Two things can be true.

comment 3y ago · link · parent

Stating those people are overpaid doesn't negate the fact that dev is incredibly well paid position with luxurious work conditions that people manage to complain about while being bad at it.

If you accept the premise that we should mock incompetent divas shareholder and CEO, then you should accept the premise we should mock our own community.

Plus a bit of self-deprecating humor is good for the soul.

comment 3y ago · link · parent

Boomers existed in a society were everything were not sold yet. Were every pieces of land was not occupied and optimized yet.

Now the theater is full.

It's not that boomers earned much and today a lot of people earn too little.

Is that then things were less rare than today compared to the demand.

Also, I earn way more than my father and grand-father, and my life style just cannot be compared, nor the energy I consume or waste I produce.

So as an IT guy, no, this is not enough to explain it. And boomers were certainly not divas. Their working conditions were definitly not as good as in IT today.

comment 3y ago · link · parent

And yet that's written by someone who is working for 10 times minimum wage from his home on his adjustable motorized standing desk. While ordering sushi (because I can afford to every day and the maid is off, because I can afford a maid) for lunch, I received a text message from my friend, a nurse, saying that she will do 50 hours this week and she can't come to the diner we plan.

I'm French, lived in Africa, worked in Asia and the US, and, no, this is not a twitter thing.

I already considered myself amazingly lucky just for having hot water, electricity, and always have heat/sleep/food.

But this life a lot of us enjoy in 202*?

It's damn luxurious.

comment 3y ago · link · parent

Two things can be true at the same time. But I don't know any VC. I know a lot of devs.

comment 3y ago · link · parent

100% agree.

In fact, I expect to be shortage of programmers even if none of those would happen (and they will), solely because the need will increase as we automatize even more things with AI. The people qualified to do those jobs we partially replace will not suddenly turn into devs.

So we will play divas for a long time. And good for us. Not going to complain that we have such a good situation.

But the fact so many people are surprised by being fired is hilarious. They lived in the illusion they were so special. Like this is perfectly normal to have so many privileges as we have.

We are just very, very lucky. I know doctors that work twice my week to save human life, doing so in terrible conditions and sleep deprived, for half of my salary.

Time to appreciate that.

comment 3y ago · link · parent

Oracle makes millions, but is it because of their amazing devs?

Doctors don't make millions, is it because saving human life is not valuable?

Correlation is not causation.

Not to mention Lebron James actually ships. Indeed, he plays the matches he is paid for. And doesn't cry on TV the coffee is not good enough in the stadium.

comment 3y ago · link · parent

Love it.

And a good explanation of why so many devs reach burn out.

But two things can be true.

comment 3y ago · link · parent

Of course, It's a caricature dedicated to HN readers.

I have met plenty of competent devs, working seriously and providing values to humanity, well enough to justify the not so huge salary they get.

But stating the obvious is not going to make people think.

However, the message that part of the community is growing into entitled spoiled kids, shocked that their shinning arses can even be touched by a lay off, is something I did want to convey :)

comment 3y ago · link · parent

I have been coding for 20 years now, pretty much on every continent, in many different projects.

At least half of them have failed.

I've seen NGO moving to docker based micro services for their data collection tools and burn the donators money for 2 years before dying under the weight of the complexity they just created.

I've seen start up working on ideas for months that made no sense, only to run out of cash but the belly full of useless lines of code.

I've seen corporations hiring 7 people to do the work one single senior dev could do, then from meetings to audits, proceed to ensure the budget would explode and the product never released.

I've seen fancy operations, with free food and fashionable people full of colors and style. And they spent 2 third of their day virtue signaling, fighting over how to do thing, what should have been done instead, and what we should do in the future. But certainly doing nothing right now.

I don't believe the free market is pricing the value of most things fairly. Just like I don't believe diamonds have much value, and never did, even before when people were still buying them for their wedding ring.

Yes, most of us are overpaid, given the problems we actually solve.

But we are in the IT golden age, if you throw computers at things, you get a 100x return. And money was cheap for so long.

So it was ok, to hire 100 people, and have 12 of them being actually useful, because you didn't have time figure out which ones.

However today the economy is contracting. The low hanging fruits have been harvested. And it's no longer economically viable for the companies (that were never our friends in the first place) that they care about how special devs are.

And so we get fired.

comment 3y ago · link · parent

Apparently, thousands of "engineers" were deemed not that valuable in the last 12 months.

comment 3y ago · link · parent

Yes.

We are overpaid for incredible working conditions and devs basically became capricious divas, despite the fact 90% of them are plumbers, and many not very good ones.

If you had any professional doing the same, wasting so much resources as us, changing part of the tech stack every month, debating vocabulary on twitter ad nauseam instead of coding, and whining about how their first world problem should be the focus right now rather than doing their job, they would get laughed at.

But we were incredibly lucky that IT is the most amazing productivity cheat code humanity has come up with so far, so that all this BS was accepted as the cost of doing business.

Well, here is the wake up call.

No, we are not paid to rate the best cappuccino of the valley, converting the most stable software of your org to Elm nor write a commit hook so that nothing can be pushed before the diversity committee validated the change set.

We are paid to solve problems.

If you don't solve problems, when the hard times come, and they always do, you become part of the problem.

comment 3y ago · link · parent

Since it's using websocket, there is no way around that: you need to have some sort of persisting instance for every connection.

comment 3y ago · link · parent

The fact it can read pictures is the real killer feature here. Now you can give it invoices to file, memo to index, pics to sort and chart to take actions on.

And to think we are at the nokia 3310 stage. What's is the iphone of AI going to look like?

comment 3y ago · link · parent

That's my understanding.

While it is possible to run Python on the browser, the typical solutions to do so has a lot of drawbacks:

- brython (https://brython.info/) doesn't work with pip, doesn't implement full python spec, and has very limited tooling. I never could find a use for it professionally.

- pyodide (https://pyodide.org/en/stable/) is very slow to load and execute. It's mostly (but very) useful for teaching.

Plus, pynecone would have to solve the complicated problem of finding out how to delimitate what's python on the server side and on the client side, which we don't see in the API (and would complicate things for their target customer, somebody with little web dev experience).

So the decision makes sense knowing their goals and constraints.

You just have to understand the price you pay for it: anything calling a python function will cost a roundtrip. You will have to write you app with that in mind, and don't expect miracles either.

I can see myself using the product when I need to hack something quickly that is a one page interactive program. Or for some one of my clients with quants, geographers and the likes, that often needs to make a small utility available but have only knowledge of basic python.

It also could be a good companion to tauri (https://tauri.app/) to create desktop app. To me that would be even more valuable to have finally an easy way to do a decent UI in python. Because QT, WX, GTK and Tkinter are not fun at all, and the web is an amazing platform.

I just hope they are not going to eventually lock you into their hosting solution. But given that it's on github and open source, I feel confident. Plus the doc is very good, which is a sure sign of good human beings presents in the team.

comment 3y ago · link · parent

Everything you see a big player do for ethics is for PR or legal reasons, for most companies.

Going green. Affirming diversity. Giving to charities. And of course, ethic committees.

When the cost of those outgrow the benefit they get from it, they throw it out of the window.

You know Bill Bernbach's quote: "A value isn't a value unless it costs you something."

It's not just for people. It's for corporation too.

comment 3y ago · link · parent

In another comment, OP explains the framework uses websocket to send and get values from the python functions you declare.

The python functions are NOT executed on the frontend.

comment 3y ago · link · parent

I get get benefit from it, and I saw what Dash and plotly can do for people with a bit of Python and a need for a quick UI.

So I get the point of the project, I can see a mathematicians getting value out of this.

Still, I would advice against using this for anything else than a small project (in the current state):

- any action your perform means a round trip to the server. This is why the counter seems so slow. Everytime you click on increment, it goes through the entire internet, ask for +1, and get the answer, then update the page.

- easy things will be easy, but even the average things are going to be hard. Every time you will want something that is not provided out of the box, the workaround is going to be painful.

- you are coding with react, one of the most complicated framework there is, but with a layer of indirection turning it into a black box. You better hope everything goes well because I don't wish debugging that on anyone.

- the database layer is going to bite you if you start to get fancy. Guaranteed.

- if you need this, you probably can't assess security. So no way to know if your website is secured. In fact, you can pretty much bet it is not.

This means if you use it for something big, you will eventually hit some kind of a big wall. Or something kind of painful experience that will possibly harm the project.

But of course, if the alternative is to never having started the project in the first place, you should definitely go for it.

The deployment being a pain for most python dev, this alone will make your life way easier, and 99% of projects don't have more that a few requests per minutes and a couple of pages anyway.

Just know what you get into: this is a trade off, as everything in engineering, not a unicorn.

Also, this is the Y combinator, so I assume there is a bigger plan behind this.

Good luck to the creators though, anything that move the needle even is good to attempt.

comment 3y ago · link · parent

Right. In fact any ORM worth its salt will have methods specifically designed to let you address the N+1 problem easily.

E.G: django "select_related"

Not to mention they will will have ways to use raw SQL through the lib infrastructure, which is still better than querying SQL manually, and give you full control of the query.

Also wordpress shows that you can write manual SQL and still have terrible performances because your application is badly structured, which an ORM helps with.

In the end, I don't think there is less trap with raw SQL, the traps are just different. It's not a matter of "better".

comment 3y ago · link · parent

Do you mean every time I click on the button, it goes to the backend for incrementing?

comment 3y ago · link · parent

So I tried the example in the doc: there is a huge latency between the moment I click on "+" and the moment the counter increment.

Is that what we can expect performance wise? What causes this?

comment 3y ago · link · parent

Thank you for correcting me.

comment 3y ago · link · parent

Most probably, but throwing geckos at knots is more fun.

comment 3y ago · link · parent

Maybe the pressure the knots hold is enough to maintain rows of sections of the material in close enough range for the casimir effect to apply, making making some part of it flexible (the material) and some part of it super resistant (the quantum fluctuation zone) which ends up giving this property.
1
727374
184