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

It seems to have kept a lot of good things from python, but fixes many quirks:

- slicing with index or with index+length ? Well, both apparently!

- len() is a method

- ranges and slices have the same syntax

- you can use | to avoid the indentation hell that comes with '''

- true, false and none don't have an upper case first letter

- the lambda design allow for multi lines, despite the language being heavily biased toward statements. And it's using "=>".

- circular imports do not cause errors

- explicit export, although i'd prefer it to be opt in

- lua style ffi

- mapping on dict key/values is the simple case

- CYON is quite interesting

- and of course concurrency and perf from the start

But some of them will cause big troubles:

"errors are values and do not propogate up the call stack by default. Users are not forced to handle errors unless the error value is passed to a typed destination."

Yeah, silent errors in bash scripting taught me I really don't want that.

"The shorthand method for calling functions omits parentheses and commas"

The reason I still can't parse Ruby after 15 years.

comment 3y ago · link · parent

As someone in a similar (alrhough less acute) situation, what did the doctor said that gave you hope?

comment 3y ago · link · parent

No OP but similar situation. It's easy to make the difference: I've been in terribly stressfull situations before. I went to live in Mali, started business, got Malaria, lost everything to the war and had to start all over, going back to my country.

It's not the same. Covid got me bad.

But strangely, only after the third dose of vaccine. Right after it in fact, and ever since.

But it's possible we will learn we are coupounding effects on a lot of fronts: stress from the situation, covid itself, unexpected side effects from the vaccine, and maybe something else.

Hard to tell.

But yeah, this is not regular run of off the mill, stress response.

comment 3y ago · link · parent

Cargo is the golden standard, but reaching that level is going to take 10 years at least. I'm not kidding, this is what will be needed to solve all the road blocks.

The first thing we need is a whole ne way of installing python, because half of the problems stems from that. That's just a huge endeavor.

comment 3y ago · link · parent

Fresh now solutions is what put us in this situation: distutis2 was fresh, setuptools was fresh, pip was fresh, wheels were fresh... So now you have a lot of complexity that come from having a lot of solutions in parallel that are slow to sunset.

But the dirty secret of python packaging is that most of the problem don't come from packaging, but from boostrapping python. And this is a huge can of worms I didn't even mentioned.

Also, plenty of things require the participations of other communities like debian splitting pip out of the main package or anaconda not being compatible with pip.

All in all, the way you hand wave the problem is typical from the critics that have a very narrow view of the situation.

If it was that easy, it would have been done.

comment 3y ago · link · parent

It has. It's just very slow.

A third party can ignore legacy. It can break stuff. It can avoid supporting platform. It can have a big bug and push a fix the day later. It can skip red tapes. It can document after the fact. It can drop features the next year. It can requires pypi dependancies when the stdlib is not sufficient. It can be by a single author that don't have to ask anybody what they think about before creating something. It can skip security issues and focus on practicality.

CPython cannot.

So any change to the packaging story will always take years for the smalles thing.

That's the same for removing the GIL: touching the c api is a huge deal for the scientific and machine learning stack.

That's why requests has never been included in python despite being vendored with pip: you can never update it fast enough once it's in the stdlib.

That's why we don't have node_modules equivalent yet: autoloading code in the current directory would be a big security risk for a language that is included in many os by default so we need a good design.

Don't assume the team is incompetent or deaf. Given what has already been achieved, that would be a total mismatch.

comment 3y ago · link · parent

It has.

So many things were fixed in python packaging.

   - "-m" was introduced.
   - Wheel replaced eggs. 
   - Manylinux target now exists. 
   - pypi was scaled uo, a new api
     introduced and 2fa added.
   - setup.py got replaced by
    setup.cfg and now
    pyproject.toml is gaining speed. 
   - the py launcher is a thing. 
   - Import priority changed. 
   - Import lib changed. 
   - Zipapps were added. 
   - Venv ships with python.
   - Pip replaced easy_install, 
     then ensurepip was created. 
   - The new dependancy solver
     was funded. 
   - Distutils has been sunsetted. 
     Setuptools is on its way.
This doesn't include the dozens of third party projects that target improving package that came out in the last 2 decades. Pip-tools by itself has changed the game.

A lot has been done, and the situation is 10 times better than it used to be. It is still bad, but not because nothing was done, simply because there is still a lot to do.

People dont realize the sheer scale of the task, and the inertia that comes with a language as successful and old as python.

You have a language that is 4 years older than java, highly dynamic, yet uses fortran/c/assembly code in very popular lib (scipy/numpy) accross all popular OS, and webassembly and arm, in 32 and 64 bits. People routinely install multiple versions of python on their machine, linux repos freeze the upgrades and split the packages, mac and windows stores ship broken versions, and half the python userbase is composed of people that are not professional coders that can't use a terminal. Of course companies will complain if you change anything that breaks their 5 years old server, and devs will complain if they don't get the last new great feature.

It's a really, really hard problem, dealt by a FOSS community that 10 years ago was still running on mostly volunteers and the budget of a small start up. Of course, just to get heat by comments on social media and no thanks for all the effort, as if you own total strangers your free work, with no flaws on top of that.

Not to mention you can imagine packaging is not the only things the core devs have to work on.

comment 3y ago · link · parent

They still have to pay it, but skipping on the state taxe an is already a huge break, espacially since no vat is paid in the transfert.

comment 3y ago · link · parent

Unlike netflix, Disney+ has a good incentive to never become profitable. It pays enormous licensing fees to its parent company. This means the profits flows to there, and they don't pay a cent of taxes.

Now you are going to say, but doesn't "The Walt Disney Company", the parent of Disney+, then pay all the taxes?

No, because this company is located in Delaware, which means it's virtually exempt of taxes as long as it makes only money from activities outside of Delaware. Which is does, since it's only selling IP to other companies, like the entity managing Disney+ which has it's headquarters in California.

comment 3y ago · link · parent

If my non stem sample would be able to engage with armchair science in the same way that the stem sample can engage with armchair philosophy, I would agree with you.

However, it's not the case.

I also find more stem people reading entry level materials in philosophy around me (like Moral letters to Lucilius), that I will find non stem people ready entry level materials in science (like A brief history of time).

The ratio is hugely disproportionate, and while I understand this is all anecdotal, I have a large and very diverse social circle to observe, spanning on wide areas of age, social backgrounds, political preferences, sexual orientation and jobs.

comment 3y ago · link · parent

Well, most people in math and science majors can pass an arts and humanities major. The opposite is not necessarily true.

Anecdotally, I can easily engage in talks about literature, politics and art with my friends coming from a biology or physics background. I can hardly do so with my friends with a major in French or Sociology. When we mix them together, the debate is always animated when we talk about philosophy, a specific author or book, and even painting. If we speak about GPT3 or the CERN, suddenly the table is divided in two.

comment 3y ago · link · parent

I used it 3 times yesterday (usually for re.match).

But I've been coding 15 years without it.

comment 3y ago · link · parent

To be fair the JS community is not as picky about his because it lived in a stage of spaghetti code since the beginning.

It's fair to want to mind easing readability in the design of the language. That's one of the things that has made it so popular since its inception.

comment 3y ago · link · parent

Sure. From version 1 even.

The one that shared an era with pokemon version 1, on the original black and white gameboy.

Because it was so clear from the beginning, even if emoji didn't exist, cpu had no core, ruby hasn't been invented yet, and people were sharing the source code on floppy disk.

comment 3y ago · link · parent

That's something most people don't realize.

The walrus got heat. F-string got heat. match/case got heat.

Unicode in python 3 got 15 years of trolling.

Every single time you make a proposal, you have to make a compromise between:

    - what the infrastructure and style of the language allows
    - the resources you have
    - the desire for staying compat
    - the desire for staying modern
    - the pressure of people wanting a new toy
    - the pressure of people hating any kinda change
You cannot flip a switch and "make the language better".

comment 3y ago · link · parent

Yeah, why did we even had that assembly stuff?

We should have had rust from the start!

Seriously, python was born in 1991, 4 years BEFORE Java existed. And it barely had any funding until 2010.

Insight is 20/20 but this is not how tech works. You are limited by knowledge, resources, politics, legacy, compatibility commitment and so on.

Not to mention you can simply get it wrong.

Would have been funny if the whole world moved out of unicode and we got stuck with it forever. Usually, you know something is a standard only when people complain you adopted it too late because everyone else did.

Like Java that used XML for all serialization and got suck with it for 15 years while we all moved to JSON. Or utf-7 that is still used by IMAP because they did the wrong call.

Yes, utf-7. What, you though utf8 was the only unicode standard? No, no, no. There are utf-7, utf-8, utf-16 (JS uses that) and utf-32 (C# uses that) in use. And more exist that abandoned.

People seems to be under the illusion that this stuff is easy, or obvious. Sure. In 2022.

Everything about text has been a fight for death to this day, for all programming languages. This includes formatting.

We have "%s" because... of printf() in C. Let that sinks in.

comment 3y ago · link · parent

Believe it or not, I discussed mining the moon with people, and they were horrified. Way more than mining Africa.

comment 3y ago · link · parent

I agreed, until I tried FastApi. DI can be done right.

comment 3y ago · link · parent

I can see that it's totally different from a search engine. If you can't understand that analogies don't need (and cannot be) to be perfect to be useful, you're not alone, and I'm afraid I can't help you. But -- IMHO -- you are very very wrong.

comment 3y ago · link · parent

Those are human traits.

ChatGPT is not human, and cannot be more assertive, authoritative or lying than Python.

If you give python "0.1 + 0.3", it will instantly, and without a doubt, output "0.30000000000000004". Is Python arrogantly thinking it's right and misleading you?

Of course not. This last sentence makes no sense, Python is just a program that does what it's programmed to do.

But because ChatGPT is using natural language as a UI, it triggers a very irrational response in humans interacting with it.

We are starting to anthropomorphize it, use adjective like "assertive", "authoritative", and "lie" to label its output, which is like calling Covid cruel and vicious because it kills old people, or a NPC lazy because it does not work to pay for its food.

There is no intent of ChatGPT to deceive or justify its supposed lies. There is only a program that does what's its programmed to do, and shows its limitations.

What do you expect, that is says "I think it's x but I can be wrong with a confidence interval of z" with every answer? Do you expect google to tell that when it outputs the results?

GPT is not talking to you. It's an output. It's not confident. It's a program printing text matching statistical analysis.

It's worrying that such a simple program is already close enough to the real thing that people, even on HN, are already attributing it character.

It reminds me of this scene from community with the pen named Steve: https://www.youtube.com/watch?v=z906aLyP5fg

comment 3y ago · link · parent

My issue here is with the word "confident". It's a program. It's as confident as Excel is with date parsing, meaning it's completely neutral about it. It just does its thing.

We attribute this "confident" adjective to the result, not because it outputs a confidence interval, but because it uses language and we associate that with human traits.

Even technical people get tricked, I read and heard some very emotional responses to what it outputs. Sometime people got angry that it was "not honest" or "trying to weasel out of the answer". Personally, I caught myself several times trying to prove it wrong.

That's just missing the point of what it is.

comment 3y ago · link · parent

People are starting to entropomorphise gpt3, stating it's bullshitting or lying, instead of realizing this is just a tool that is useful for some things and not for others.

The fact it talks makes people treats it differently than Excel.

But when Excel turns your date into a nonsensical value, people understand it's just a program with limitations

comment 3y ago · link · parent

If you are in Europe, this is likely illegal. But I don't think anybody has deep pockets enough to try to bring that to court.

comment 3y ago · link · parent

Inded. At least there is a very good decorator in pypy: https://pypi.org/project/retry/ But having it in the stdlib would make a ton of sense.

comment 3y ago · link · parent

Yeah that's kinda my take too. A good manager should have enough knowledge to understand the field and be respected, but that's it. Putting your best technical person in this job would probably be a waste:

- excellent biologists, physicists, computer scientists and so on, are rare. You should put them where they can yield the best results. Same for people with managerial qualities.

- managing may requires qualities that are in conflict with excellence in a field. Juggling projects, building relationships or the will to play some political/administrative game may be very useful for a manager, but not necessary something an excellent developer or a surgeon would have maxed out as a skill.

comment 3y ago · link · parent

Given that every attempt to sandbox python failed, and that every system exposed to the public have been pwn, I assume this is a cat and mouse game we can't win.

At best I suppose we could put in place checks to get low hanging fruits. But we are, after all, allowing a turing complete and highly dynamic language to execute.

> or just disallow unfamiliar .pth files from being installed altogether

That would kill the entire plugin ecosystem.

Now, the next thing could be to have a permission system, requesting access to the network, fs, .pth, etc. It would not be a bad idea, given that we are, after all, installing things that are as powerful as apps.

But it would be a gigantic effort, and users still would just accept without reading, like they do with apps.

comment 3y ago · link · parent

Yes but the problem here is the obfuscation of the malware code loading. No need to trigger it in the setup.py process, as long as you have it in the lib, you can always put a call in a .pth somewhere and run your malware as soon as any python is executed.

comment 3y ago · link · parent

Yes, but pypi has 4 millions release to check, and the scientific and machine learning wheels are very hard to compile (scipy contains c, fortran and assembly code, and must be compiled to mac, linux and windows).

Providing a build env for that would make it prohibitively complicated and expensive, and basically would mirror github CI.

That's the reason continuum is making money: they sell a python package distribution channel that is checked and locked.

comment 3y ago · link · parent

You can pip install complex stand alone executables, such as nodejs, and it's used in the entire ecosystem.

In fact, most packages are now wheels, which are not sources: they are compressed, and may contain binaries for compiles extensions, something extremely popular (the scientific and AI stacks exist only because of this).

Some packages need to be compiled after the fact, something that setup.py will trigger, and some even embed a fallback compiler, like some cython based packages.

Also, remember there is very few people working on pypi, there is no moderation, anybody can publish anything, so you would need a bullet proof automated heuristic. That's either impractical, or too expensive.

If you want a secure package distribution platform, there are commercial ones, such as anaconda. You get what you pay for.

comment 3y ago · link · parent

The foundation is not meant to give away Gates money while he is alive.

It's a way to be able to keep investing his money without paying taxes.

It only spends the legal minimal amount for charity, 5% (way less than taxes that would go to build roads, hospitals and schools). The rest is invested in a portfolio that, by the magic of being in a non profit, can make billions without paying any tax.

Since he directs the charity, he can therefore move the capital where he needs it to, including founding Monsanto and weapon makers, which he had to withdraw from after people noticed that it was quite the opposite of the claimed foundation mission.

That's why most billionaires have some kind of charity: they keep all the power of their money, get good PR (which given that the wealth gap makes people grumpy, is a great shield) and they optimize their finance while people defend them.

The PR operations worked well: most people on the internet now believe that Gates is a good person. A statement that would have made anybody smile in the 90'.

1
767778
184