News for hackers. Stuff that matters.
Re:Why do we need Flask, Celery, and Redis? (2019) by jakearmitage on Saturday April 18, 2020 @09:57AM (#22907753)
> same developer experience as go

You can't say that when Python shoves Pip/Poetry/VirtualEnv/Black/Flake and what not into people. In contrast, Go has built-in package management and gofmt. Python is essentially gate-keeping new devs.

Re:Why do we need Flask, Celery, and Redis? (2019) by sandGorgon on Saturday April 18, 2020 @12:24PM (#22908761)
Go has had an equally bad packaging experience.

Kubernetes - which is one of the biggest projects built in go - has been struggling with dependency and package management.

Here's the CTO of Rancher commenting on his struggles

https://twitter.com/ibuildthecloud/status/118752909888666419...

https://twitter.com/ibuildthecloud/status/118753821015230873...

This is not trivial stuff..and it shouldn't be trivialised into a go vs python flamewar. Because it can't be.

Re:Why do we need Flask, Celery, and Redis? (2019) by throwaway894345 on Saturday April 18, 2020 @04:59PM (#22911062)
I've used Python and Go extensively. Go's packaging story has a few rough edges, but Python's is an impenetrable maze of competing tools that each purport to address others' major hidden pitfalls.

To work with Python packages, you have to pick the right subset of these technologies to work with, and you'll probably have to change course several times because all of them have major hidden pitfalls:

* wheels

* eggs

* pex

* shiv

* setuptools

* sdist

* bdist

* virtualenv

* pipenv

* pyenv

* sys.path

* pyproject.toml

* pip

* pipfile

* poetry

* twine

* anaconda

To work with Go:

* Publish package (including documentation): git tag $VERSION && git push $VERSION

* Add a dependency: add the import declaration in your file and `go build`

* Distribution: Build a static binary for every target platform and send it to whomever. No need to have a special runtime (or version thereof) installed nor any kind of virtual environment nor any particular set of dependencies.

Re:Why do we need Flask, Celery, and Redis? (2019) by ForHackernews on Saturday April 18, 2020 @05:58PM (#22911457)
Yeah, until github is unreachable and the entire Go universe grinds to an immediate halt because nothing will build.

Python packaging is a mess, but Go doesn't even bother. "Just download from some VCS we'll pretend is 100% reliable and compile from source" is not a packaging solution.

Re:Why do we need Flask, Celery, and Redis? (2019) by kelnos on Saturday April 18, 2020 @07:10PM (#22911890)
How is that any different than the entire Python universe grinding to an immediate halt if there's an issue with pypi.python.org? (Hint: it's not.)

You can certainly debate the difference in uptime between specific services; I don't know either way, but if you told my that PyPi had higher uptime than GitHub, I'd believe you... but that's kinda missing the point. If you depend on an online service to host your release artifacts, if and when that service goes down, it's gonna hurt.

Meanwhile, Python's packaging wars continue to rage on. Go's is simple: a release is a tag in a VCS repository. I'm sure there are issues with that as well, but that should come as no surprise, considering there are issues with literally every packaging solution. At any rate, there's little moral difference between downloading a tarball (or a wheel, or... whatever), vs. pulling a tag from a git repo. It requires equal levels of trust to believe that no one has tampered with prior releases in both cases.

I'd like to also point out that I don't have a dog in this race. I've done a little Go here and there, but frankly I don't like the ergonomics of the language too much, so I stay away from it. I've done (and continue to do) a decent amount of Python. I like the language, but tend to prefer strongly-typed, functional languages, and languages with performant runtimes, so I tend to only use it for smaller projects.

Re:Why do we need Flask, Celery, and Redis? (2019) by ForHackernews on Sunday April 19, 2020 @03:38AM (#22914250)
You can trivially run your own local PyPI mirror or install packages directly from some other source (e.g. S3 bucket, LAN storage). Is there a way to do that for Go? If so, I've never seen it done.
Re:Why do we need Flask, Celery, and Redis? (2019) by morelisp on Sunday April 19, 2020 @04:45AM (#22914464)
It's possibly as of the proxy in Go 1.13, but this was not well-documented, suffers from competing implementations, and introduced in a way that probably broke more builds than it helped.
Re:Why do we need Flask, Celery, and Redis? (2019) by jatone on Sunday April 19, 2020 @09:39AM (#22915801)
yes you just vendor your dependencies.

go has support for a proxy system, tooling is still immature though.

Re:Why do we need Flask, Celery, and Redis? (2019) by throwaway894345 on Saturday April 18, 2020 @09:37PM (#22912733)
I’ll take “doesn’t even try, but just works” all day every day. What is Github’s downtime for cloning in the last year, and how does it compare to Pypi? And if you’re really worried, why not use a caching proxy just like you do with Pypi? In my experience (using Python since 2008 and Go since 2012), Go package management has far fewer problems.
Re:Why do we need Flask, Celery, and Redis? (2019) by petre on Sunday April 19, 2020 @03:54AM (#22914293)
I can't build lego from source due to a failed dependency. The docs don't help either, they're plain wrong. To make matters worse, Go pulls the latest dev version so good luck trying to build a stable binary of some complex package. I've opened an issue which was promptly closed and I was told to "just download the binary dist, source builds are for devs". To add insult to injury, each project is built in its own usually broken way. Out if date software? Good luck. Sorry, but I've had overall better experiences installing random Python programs with pip or building D libs with dub. Pulling half of Github rarely qualifies as "package management". It only encourages a giant mess, which is precisely what software development has been lately. Go is probably worse than npm in this respect.
Re:Why do we need Flask, Celery, and Redis? (2019) by jatone on Sunday April 19, 2020 @09:40AM (#22915808)
no have no idea what you're talking about. these problems don't exist anymore since godep and now go modules which is builtin to standard go tooling.
Re:Why do we need Flask, Celery, and Redis? (2019) by jatone on Sunday April 19, 2020 @09:37AM (#22915786)
> Yeah, until github is unreachable and the entire Go universe grinds to an immediate halt because nothing will build.

that's what vendoring is for and the proxy cache. this problem hasn't existed since like go 1.8 and is completely resolved in go1.14.

Re:Why do we need Flask, Celery, and Redis? (2019) by joshuamorton on Saturday April 18, 2020 @08:42PM (#22912417)
You're combining multiple problems: maintaining a package for redistribution, and using packages. For the second, the much more common case, 2/3 of the things on your list are irrelevant.
Re:Why do we need Flask, Celery, and Redis? (2019) by throwaway894345 on Saturday April 18, 2020 @09:52PM (#22912798)
For either case, Python’s story is more complex than Go’s.
Re:Why do we need Flask, Celery, and Redis? (2019) by morelisp on Saturday April 18, 2020 @10:59AM (#22908182)
Go may be unique in being the only ecosystem built after Python that can't claim it avoided Python's packaging disasters.
Re:Why do we need Flask, Celery, and Redis? (2019) by throwaway894345 on Saturday April 18, 2020 @05:14PM (#22911144)
How do you figure? Go's packaging is wayyyy better than Python's. I've done considerable work with each and while Go's ecosystem has warts here and there, it's far from disastrous. I can't say that about Python.

If nothing else, Go lets you distribute a static binary with everything built in, including the runtime. Python's closest analog is PEX files, but these don't include the runtime and often require you to have the right `.so` files installed on your system, and they also don't work with libraries that assume they are unpacked to the system packages directory or similar. In general, it also takes much longer to build a PEX file than to compile a Go project. Unfortunately, PEX files aren't even very common in the Python ecosystem.

Re:Why do we need Flask, Celery, and Redis? (2019) by morelisp on Saturday April 18, 2020 @06:50PM (#22911771)
In the context of

> Pip/Poetry/VirtualEnv

"packaging" refers to the way the language manages dependencies during the build and import process, not how you distribute programs you have built.

Python has a deservedly poor reputation here, having churned through dozen major overlapping different-but-not-really tools in my decade and a half using it. And even the most recent one is only about a year into wide adoption, so I wouldn't count on this being over.

Go tried to ignore modules entirely, using the incredibly idiosyncratic GOPATH approach, got (I think) four major competing implementations within half as long, finally started converging, then Google blew a huge amount of political capital countermanding the community's decision. My experience with Go modules has been mostly positive, but there's no really major new idea in it that needed a decade to stew nor the amount of emotional energy. (MVS is nice but an incremental improvement over lockfiles, especially as go.sum ends up morally a lockfile anyway.)

Re:Why do we need Flask, Celery, and Redis? (2019) by dnautics on Sunday April 19, 2020 @02:53AM (#22914091)
I'm slowly deprecating a python system at work and replacing it with elixir. We don't use containerization or anything, and installing the python system is a nightmare. You have to set up virtualenvs, not to mention celery and rabbit, and god help you if you're trying to operate it and you forget something or another.

With elixir, you run "mix release" and the release pipeline is set up to automatically gzip the release (it's one line of code to include that). Shoot the gzip over (actually I upload to s3 and redownload), unzip, and the entire environment, the dependencies, the vm, literally everything comes over. The only thing I have to do is sudo setcap cap_net_bind=+ep on the vm binary inside the distribution because linux is weird and, as they say, "it just works".

Re:Why do we need Flask, Celery, and Redis? (2019) by throwaway894345 on Saturday April 18, 2020 @10:00PM (#22912831)
I fully agree with this assessment, but I don’t see how this puts Python’s story on par with Go’s. While GOPATH was certainly idiosyncratic, it generally just worked for me. While go modules aren’t perfect and the history was frustrating, they generally work fine for me. Python feels like an uphill battle by comparison.
Re:Why do we need Flask, Celery, and Redis? (2019) by morelisp on Sunday April 19, 2020 @04:41AM (#22914450)
If Go sticks with modules and doesn't keep making significant changes (e.g. the proxy introduced 1.13 was not handled well), then it will be better than Python.

But if Python finally "picks" poetry, sticks with it for a few years and incrementally fixes problems rather than rolling out yet another new tool, that will also be better.

You can only identify the end of the churn for either retroactively. Python just looks worse right now because it's been around longer.

Re:Why do we need Flask, Celery, and Redis? (2019) by jatone on Sunday April 19, 2020 @09:51AM (#22915890)
difference here is track record.

go: tends to wait and implement something once the problem is understood. took 2 years after go maintainers decided to solve the dependency issues. and as of the latest release its finally been labelled production ready.

and honestly the proxy issues were not real. go modules was still optional. you could just turn it off.

python is how old now? couple decades? and it has only gotten worse over time.

Re:Why do we need Flask, Celery, and Redis? (2019) by morelisp on Sunday April 19, 2020 @04:38PM (#22918616)
Another thing Python and Go unfortunately have in common is a community (not necessarily core developers) with knee-jerk reactions to any criticism.

> go: tends to wait and implement something once the problem is understood.

Go's modules provide no additional "understanding" over any of the other Bundler-derived solutions in the world. MVS was the primary innovation, but wanting checksum validation means I have to track all the same data anyway.

> took 2 years after go maintainers decided to solve the dependency issues

This is revisionist history. There were other official "solutions" before ("you don't need it", "vgo is good enough", and "we'll follow community decisions"). If this one sticks, it's fine. But you can't say it's good now just because it's the one we have now - it's good now if it's the one we still manage to have in five years.

Go's track record is not "good" (in that regard I think only Cargo qualifies). At best it's "mercifully short."

> and honestly the proxy issues were not real.

Documentation was poor, the needed flags changed shortly before release, the design risks information leaks, and the entire system should not have been on by default for at least one more minor version.

> python is how old now? couple decades? and it has only gotten worse over time.

Yeah, that's exactly why I said "Python just looks worse right now because it's been around longer." It hasn't gotten worse though, it just also hasn't stopped churning. And if Go doesn't stop churning, in 10 years it will look the same.

The age argument works both ways - multiple major versions of Python predate Bundler. Go has no excuse for taking so long to reinvent "Bundler with incidentals", just like every other language.

Re:Why do we need Flask, Celery, and Redis? (2019) by takeda on Saturday April 18, 2020 @01:01PM (#22909080)
I believe Python suffers from no leadership in that space (everyone creates their own packaging, every tutorial advocates something different, many tutorials are outright wrong).

There was also a bad decision of using Python code for installation (setup.py) instead of a declarative language.

Most of that issues are actually fixed in setuptools if you put all settings in setup.cfg and just call empty setup() in setup.py.

Like here: https://github.com/takeda/example_python_project/blob/master...

Re:Why do we need Flask, Celery, and Redis? (2019) by mdtusz on Saturday April 18, 2020 @11:42AM (#22908469)
Cargo works pretty well too.
Re:Why do we need Flask, Celery, and Redis? (2019) by takeda on Saturday April 18, 2020 @12:51PM (#22908994)
Cargo is not from Go
Re:Why do we need Flask, Celery, and Redis? (2019) by jessaustin on Saturday April 18, 2020 @05:40PM (#22911325)
As a name for a package manager, "cargo" certainly appears more suitable for "go" than for "rust".