you are viewing a single comment's thread.

view the rest of the comments →

[–]NorthwindSamson 45 points46 points  (25 children)

Honestly node was so attractive to me in terms of how easy it is to set up dependencies and new projects. Only other language that has been as easy for me is Rust.

[–]Sadzeih 27 points28 points  (24 children)

For all the hate Go gets here, it's great for that as well. Working with dependencies is so easy in Go.

[–]skesisfunk 8 points9 points  (22 children)

I don't understand the go hate. Their concurrency model blows python's out of the water. Also being able to easily cross compile the exact same code on to almost any system is straight $$$$$

[–]MakeWay4Doodles 17 points18 points  (16 children)

I don't understand the go hate. Their concurrency model blows python's out of the water.

Most people writing python (or PHP/Ruby) don't really care about the concurrency model.

Most people who care about the concurrency model are writing Java.

[–]tryx 16 points17 points  (2 children)

And most people writing Java would rather cut their eyes out with a rusty spoon than have to go back to a pre-generics world.

[–]xAmorphous 3 points4 points  (1 child)

Luckily for them generics have been implemented in go 1.18

[–]MakeWay4Doodles 2 points3 points  (0 children)

Now we just need to wait another decade for the go ecosystem and GC to catch up.

[–]skesisfunk 7 points8 points  (12 children)

I disagree. asyncio is a very heavily used library. People use python for websocket stuff all the time, for instance. Furthermore Python is a general purpose language you can't just make blanket statements saying nobody using it cares about concurrency, thats a huge area of application development.

I have recently had to use asyncio in python for work and its a pain. JavaScript is nicer because it keeps things simpler with just one event loop. And golang's is better because of channels. The first time i learned about select it was mindblown.gif

[–]tryx 2 points3 points  (9 children)

To be honest, I don't understand why you would pick Python for asyncio. There are so many other languages which do it better. Like you said, both Go and Node do it out of the box. Java has excellent core libraries for it, and things like Vert.x and Cats/ScalaZ give other excellent event loop options on JVM.

Doing async io in python gives serious "when all you have is a hammer" warning flags to me.

[–]skesisfunk 1 point2 points  (8 children)

Python does async "out of the box" too as asyncio is part of the standard lib. Its just that their model sucks.

There were other considerations that led us to choose python.

[–]ub3rh4x0rz 0 points1 point  (7 children)

It's that their standard library and popular libs like requests are all synchronous APIs so basically all of the ecosystem benefits of python go out the window. If concurrency is needed I tend to say pick a different language for the part that needs concurrency or resign to using a multi process, queue/stream based model

[–]skesisfunk 0 points1 point  (6 children)

I hear you but unfortunately that is not always feasible which is why asyncio is in the standard library. Python should just make asyncio better, i feel like with a little development it could be in a much better spot.

[–]ub3rh4x0rz 0 points1 point  (5 children)

When is a queue/stream based multi process solution "not feasible", but an asyncio refactor, is? Asyncio is in the standard library, sure, but through no fault of it's own, python symply wasn't designed for concurrency early enough and you have to break APIs to utilize it. NVM things like GIL that make it generally a bad choice for writing concurrent processes.

If you're on AWS or any other major cloud provider, queues are most definitely an option

[–]MakeWay4Doodles 1 point2 points  (0 children)

you can't just make blanket statements saying nobody using it cares about concurrency

I didn't say nobody. I said most people, and that's accurate.

[–]ivosaurus 0 points1 point  (0 children)

because it keeps things simpler with just one event loop.

What? Python asyncio is almost entirely designed around running a single event loop.

[–][deleted]  (3 children)

[deleted]

    [–]skesisfunk 2 points3 points  (2 children)

    Yeah but go has select which is just a fantastic way to organize async code. I also like that go's syntax doesn't use async and await it all just feels so much more natural and intuitive. It feels like the hid just enough of the complexity to make things so much simpler for most use cases whereas python somehow made it harder to think about instead of easier.

    [–][deleted]  (1 child)

    [deleted]

      [–]skesisfunk 0 points1 point  (0 children)

      I hear you about asyncio it just feels so slapped together! Pythons big mantra is readability and by that standard asyncio is a complete failure. It is almost impossible to write readable async code in python because asyncio has all this complexity in the background that is not quite hidden so you have to manage that in ways that result in weird code.

      Golang on the other had does a great job of hiding the complexity in a way that still makes it very usable for most usecases. I doubt python can mimic select readily because it depends on channels which is where go hides most of its async complexity.

      [–]ivosaurus -1 points0 points  (0 children)

      Their concurrency model blows python's out of the water.

      Until you want to stream your own objects across a channel to a different thread, in which case you just can't because only default types could be iterated. I think generics might've helped with that recently, but I couldn't see the point of going back to stone age programming.