ProgrammerHumor

seenYallSlanderMyGoatRecently

seenYallSlanderMyGoatRecently

I know it's difficult since we have jobs, but Java bros, it's time to fight back

https://i.redd.it/v5hx6xmcn8ef1.png
Reddit

Discussion

liquidmasl

uv ftw

2 days ago
Puzzleheaded_Car_987

uv gang

2 days ago
romulof
:cp::py::js::j:

Is there an official doc for how to structure projects using UV?

A while ago I tried and the lack of structure and proper documentation was quite disturbing.

2 days ago
klorophane

No offense, but that tells me you haven't ever read the uv docs... https://docs.astral.sh/uv/guides/projects/

2 days ago
liquidmasl

unsure what exactly you are looking for there, especially in comparison to pip

2 days ago
romulof
:cp::py::js::j:

For example: what should I use? - requirements.txt - pyproject.toml - uv lock file

2 days ago
liquidmasl

pyproject toml, lock file is generated. No need for requirements.txt

when in a project just do uv init. it generates a starting point. add dependencies with uv add, apply them with uv sync

2 days ago
ReadyAndSalted

generally you shouldn't have to interact with locking and syncing in UV. uv will update your lock file when you add and remove. It will also create/enter venvs and sync environments when you run.

1 day ago
dubious_capybara

No, it will update the toml when adding and removing packages. It will update the lock file when you sync or run.

1 day ago
ReadyAndSalted

Nope, I just tested it out on my pc (uv version 0.7.20).

Did uv init, then uv add numpy. uv created a venv, installed numpy and created a new lock file for me. Then did uv add pandas and it installed pandas in the venv then added it to my lock file automatically. Finally I did uv remove pandas, and it removed it from my venv and my lock file.

As I said, you generally will not need to interact with syncing and locking, as uv add and uv remove sorts it for you.

1 day ago
Darkstar_111

How do I ensure all the modules are running versions that are compatible with each other?

1 day ago
ReadyAndSalted

It will not install packages that are incompatible with each other due to version conflicts. A package may be incompatible for some other reason I suppose, but I'm not sure what UV is meant to do about that.

1 day ago
Darkstar_111

pytorch are cuda are notorious for this. And this also applies to frameworks that use one of those.

So, what I do, is I create an requirements.txt file with only the names of the libraries and no version numbers. Pip will sort out compatibility based on the python version thats running in the venv.

1 day ago
liquidmasl

uv handles that, and its doing it fast

9 hours ago
hypothetician

Use inline deps for single file scripts: https://docs.astral.sh/uv/guides/scripts/#declaring-script-dependencies

And pin them like this: https://docs.astral.sh/uv/guides/scripts/#improving-reproducibility

1 day ago
jujuuzzz

Pyproject.toml + uv go brrrrr

20 hours ago
[deleted]

[deleted]

2 days ago
mikevaleriano
:ts::py:

Just in case what...? uv works.

2 days ago
MiigPT

Good luck using uv with pytorch and dependencies that depend on torch, spoiler: it's not fun.

But to be fair, that's not uv fault as it's also a nightmare with poetry or any other standard package manager/resolver. It's an issue of python's dependency resolution when it comes to GPUs

2 days ago
Pyroglyph
:cs::ts::rust:

I only use Python (and by extension, uv) for local AI stuff, and I haven't had a single problem with Torch. I'm also a complete Python luddite. What's wrong with uv and Torch?

2 days ago
ReadyAndSalted

You mean sorting out cuda versions, GPU driver versions and torch versions? Yeah that's outside of the purview of a python package manager, conda based managers could help there.

1 day ago
_dotdot11
:j:

God I love uv. Being able to manage Python versions is PEAK.

1 day ago
BarrelRollxx

Do you prefer manual unwrapping or smart uv project?

1 day ago
liquidmasl

smart uv project, I am not skilled enough for a manual unwrap

9 hours ago
maryjayjay

How do you know if a python developer uses uv?

1 day ago
liquidmasl

huh?

9 hours ago
maryjayjay

He'll tell you

9 hours ago
bb994433

uv is so awesome, it finally just works

1 day ago
seba07

And then you go to C/C++ and notice that there simply isn't one standard dependency management tool.

2 days ago
PeoplesFront-OfJudea
:cp::js::ts::py:

I AM the dependency management tool

2 days ago
ColaEuphoria
:c::cp::py::asm::rust:

Oh there is. It's called CMake.

I know it sucks but fuck everything else. Just use CMake. Just do it and stop complaining. Any C/C++ project without a CMakeLists.txt is considered a bug and should have an issue filed over and over again until it's implemented.

2 days ago
noaSakurajin
:cp: :gd:

A) cmake isn't THE standard it's A standard.

B) cmake isn't a package management solution it's build system with some tools for package management

Many projects are moving away from cmake for several reasons. poor package management and poor build isolation being some of them.

The closest thing to a standard system for finding and using c/c++ dependencies is pkgconfig. However it usually isn't present on windows and is not responsible for installing the dependencies only for announcing them.

If there was a standard C/C++ package management solution msys2 wouldn't exist.

2 days ago
SenoraRaton
:c::hsk::lua::rust::g:

https://conan.io/

It exists. Its not "standard", but then there will likely never be a standard C package manager because its out of the scope of the project and been that way for 40 years.

2 days ago
noaSakurajin
:cp: :gd:

Well there is also vcpkg. Both do basically the same thing with minimal advantages over each other.

There is a chance C++ might get a package manager but C will never get an official one.

2 days ago
_a_Drama_Queen_

this last sentence is just wrong. msys2 has nothing to do with package management at all. it's an attempt to serve equivalent libraries (.dll) that may only exist on linux systems (.so) within the windows eco system. this is written on the website itself:

MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software.

2 days ago
noaSakurajin
:cp: :gd:

Yes that is the goal, however msys2 would be a rarely used tool if there was a single proper package manager for C/C++ libraries on windows.

it's an attempt to serve equivalent libraries (.dll) that may only exist on linux systems (.so)

That's not even what their own description even says. All of those libraries exist as pure windows builds, msys provides a streamlined way to fetch them and locate them on your system, like a package manager...

2 days ago
EuphoricCatface0795
:c::cp::py::ts::s:

Me, using msys2 to organize Python venvs:

1 day ago
noaSakurajin
:cp: :gd:

What do you mean by organizing python venvs and why do you need msys for that? I just create one venv in the project dir and then never think about it again.

1 day ago
EuphoricCatface0795
:c::cp::py::ts::s:

Actually I'm just more comfortable with Linux/Bash than cmd or powershell and never cared to learn it properly on Windows. I thought Conda was how you do it?

23 hours ago
noaSakurajin
:cp: :gd:

Actually I'm just more comfortable with Linux/Bash than cmd or powershell and never cared to learn it properly on Windows

That's reasonable. Although for many things the usage is identical since the args for the command are determined by the program you use not the terminal.

I thought Conda was how you do it?

In my experience conda just causes pain. I always use "normal" python with good ol' pip. It just works the same way on every os and has instructions that actually work.

16 hours ago
ColaEuphoria
:c::cp::py::asm::rust:

Many projects are moving away from cmake for several reasons. poor package management and poor build isolation being some of them.

Do you have a list of projects that have 1) used CMake in the past, and 2) have then migrated away to something else, and 3) their stated reasons for doing so.

I'm not calling you a liar, but I can't help but call out your journalistic use of the weasel word "many" and "several reasons" here.

2 days ago
noaSakurajin
:cp: :gd:

Well I personally migrated from Cmake to meson and I found a few other posts of people doing the same. For now most projects that adopted cmake tend to stick with it, unless the encounter serious problems (which I did, causing me to migrate).

The core reasons are the following:

  • more understandable syntax
  • easier to understand build scripts
  • better build isolation of subprojects
  • easier dependency management
  • better cross platform compatibility

These are the core reasons you hear from projects adopting meson or build 2. Yes by far most of them come from pure makefiles or autotools, but there are some that come from cmake.

Also in my experience meson tends to have faster setup and compile times. Due to the more sane syntax it also allows you to get started with a project more quickly.

1 day ago
MiracleHere
:gd::dart::hsk::rust:

X11 switched to meson. Actually a lot of projects have switched from cmake to meson.

2 days ago
gufranthakur OP

I watch The cherno videos. He does C++ code reviews and in almost every code reviews, half of his video is fixing broken packages and CMake scripts. While I don't understand the errors on a deep level, it's what keeping me away from making C++ my primary language

2 days ago
ColaEuphoria
:c::cp::py::asm::rust:

To be frank, if you're able to, I would generally avoid C++ in this day and age anyway.

2 days ago
katyasparadise
:rust: :py: :cs: :c:

It's the reason I prefer Rust over C++. Cargo is so good.

2 days ago
Shadowaker
:c::cp::py:

I hate Rust grammar, I deeply hate it

2 days ago
gufranthakur OP

If you mean the rust syntax, same. Although im still trying to code more and get used to it, it's a great language

2 days ago
Shadowaker
:c::cp::py:

Yes, sorry

2 days ago
katyasparadise
:rust: :py: :cs: :c:

It took few weeks to get used to it. If expressions are very neat tho.

2 days ago
Cybasura

Personally I did C++ for awhile before I went into C, C has alot more control and is just better, and if you need OOP, just use C#, or golang

I guess rust is technically better than C++ but the community and the fundamental un-readable nature of the code - literally gave me a migraine that lasted for afew days - pushed me away after 2 months

2 days ago
Sibula97

Rust isn't unreadable lol, just a little different.

Also, cargo (an actual standard for package management) is great.

2 days ago
Landen-Saturday87

Yeah, cargo alone is already a good reason to migrate to rust. CMake is just such a clusterfuck. It doesn’t even help when you understand how it works, because half of the people messing around with C/C++ don’t or only have a vague idea about it. So you‘ll end up fixing the CMakeList.txt they messed up.

1 day ago
AdorablSillyDisorder

Arguably only strong argument in favour of C++ is templates - but it's also reason enough to use the language. I'm yet to find something comparable; various codegen/macro solutions feel much harder to write and use as you go.

And sure, it can be hard to learn and debug (those famous few-screens-long compiler errors), but when used right it's very pleasant to use, especially for unit testing - can easily do proper mocking/dependency injection while keeping dependencies resolved compile-time.

2 days ago
land_and_air

Template is the cause of many of those many screen long compile errors

15 hours ago
UdPropheticCatgirl
:c::ftn::sc::rust::cp::elm:

I guess rust is technically better than C++ but the community and the fundamental un-readable nature of the code - literally gave me a migraine that lasted for afew days - pushed me away after 2 months

I mean the community sucks, and dependency culture sucks, but you can mostly avoid that by just not interacting with the ecosystem. And cargo makes bunch of stuff pain in the ass that’s easy in most C++ build systems, but once you figure it out, it’s not that awful.

But the language doesn’t really have a readability issue, it’s pretty easy to read… The syntax is just inelegant and approaching C++ levels of ugly… But C++ has the same problem, and lot of other languages like C# are even worse so I don’t think ugliness is ultimately what stops people from using something.

2 days ago
ColaEuphoria
:c::cp::py::asm::rust:

What exactly sucks about the Rust community? I know that certain places like reddit and YouTube definitely have a level of circlejerking and evangelism, but when I'm looking through issues and pull requests on GitHub I just see people working.

2 days ago
UdPropheticCatgirl
:c::ftn::sc::rust::cp::elm:

What exactly sucks about the Rust community? I know that certain places like reddit and YouTube definitely have a level of circlejerking and evangelism, but when I'm looking through issues and pull requests on GitHub I just see people working.

Evangelism is what I dislike in general. The dependency culture is bad (I want to punch through a wall everytime I see a “anyhow” dependency), there is also a lot of “invented in rust” even though it wasn’t eg. every time I see a rustacean claim that rust invented coproduct types I die inside a little.

And they wholesale adopt some of the dumbest memes from C++ community and repeat them ad naseum. Like I thought “Zero cost abstractions” has finally died and I would never have to hear that shit ever again, rust community successfully revived it and kept it alive for the last several years. They also invent new even more ridiculous ones “If it compiles, it works” is the one I keep hearing a lot and that one just drives me insane.

1 day ago
SenoraRaton
:c::hsk::lua::rust::g:

Look at this nonsense ->

pub async fn run_search<T>(
     args: CliArgs,
     cfg: AppConfig,
 ) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
 where
     T: for<'de> serde::Deserialize<'de>
         + HasTitle
         + HasYear
         + HasDetails
         + HasId
         + Eq
         + PartialEq
         + Promptable
         + Clone
         + Send
         + Sync
         + 'static,
     T::Details: HasRuntime,
 {
2 days ago
UdPropheticCatgirl
:c::ftn::sc::rust::cp::elm:

I mean that’s not particularly bad, the worst thing here is the “de” for the serde lifetime, which for the record I think is a dumb name. Most of this is pretty obvious what it means… It’s ugly but readable

1 day ago
ColaEuphoria
:c::cp::py::asm::rust:

I had a similar experience but came to different conclusions. I started with C++ (technically GML but I wanted to learn a real™ language) and kept bashing my head with it on and off for a while until I completely burnt out with it and just went with C.

I stuck with C and got really good with it for about 10 years or so (and use C exclusively at my current job still) before I picked up Rust a few years ago.

Rust isn't an easy language but it feels less...bolted on than C++? It's hard to describe, but in a weird way I feel like learning Rust (and even Java to some extent) made learning the language features and concepts in C++ more approachable. I'll be thinking somewhat often "oh this C++ thing is like this thing in OtherLanguage™ just with clunkier syntax and more footguns. That's all."

2 days ago
LeoTheBirb
:c::j::s:

Honestly the “best” style of package management is just downloading whole ass repos with git and using cmake. Archives would’ve been better if they were somehow cross platform.

1 day ago
Gabriel55ita
:j:

Never going back after trying Meson

1 day ago
awsfs

I have never ever installed something with Cmake and not had 1 million errors and had to fix them, c and c++ package management is the most garbage of any language

2 days ago
ColaEuphoria
:c::cp::py::asm::rust:

I honestly think the lack of a de jure build and package system will be the downfall of C/C++ more than any of the footguns or warts in the language syntaxes themselves.

2 days ago
Spaceshipable
:sw:

I quite like Conan

2 days ago
AtomicPeng

If it wasn't moving so slowly, was less opinionated and had anything actually resembling a healthy package index (conan-center-index is a joke tbh), yeah, maybe. At least they don't use JSON for their configuration files.

2 days ago
dubious_capybara

What's better, txt?

1 day ago
dubious_capybara

Cmake isn't similar to a package manager.

1 day ago
al-mongus-bin-susar

Meson and premake are way better. Even regular make is better than the cancer that is cmake. And for package management you still need to vendor your dependencies or use vcpkg/conan.

1 day ago
Cybasura

Just do it and stop complaining

And this is why C has such a fucking bad name, because of people like you

2 days ago
Ayjayz

Yeah the world needs more complaining

1 day ago
Gorzoid

Java has a standard dependency management tool? Maven and Gradle would disagree

2 days ago
tRfalcore

Ant has ivy

2 days ago
romulof
:cp::py::js::j:

Ages ago Apple tried something with those .framework folders. Did you hear about it?

2 days ago
altermeetax
:c::cp::bash::py::js::g:

It's called "your Linux distro's package manager". Or msys2 if you're on Windows.

1 day ago
LeoTheBirb
:c::j::s:

Dependency manager:

Compile each library separately as a DLL using Visual Studio (DO NOT USE GCC)

1 day ago
Shadowaker
:c::cp::py:

Divided by languages, united by "Chat, please fix"

Until it deletes the db because vibe coding bad

2 days ago
gufranthakur OP

Sure!, here's the revised code without the changes you told me to exclude!

Includes the changes I told it to exclude

2 days ago
femptocrisis

Minsky and Papert were right all along! neural networks can't even learn a simple XOR function!

(obligatory /j)

16 hours ago
reallokiscarlet

When you said "Chat, please fix" it made me think of a programmer streaming on twitch, asking viewers for help.

2 days ago
katyasparadise
:rust: :py: :cs: :c:

Java is so boilerplate and outdated

First appearence dates:

  • Python: 1991
  • Java: 1995

🤔

2 days ago
MinosAristos
:py: :ts: :cs:

Python started with Python 3 in 2008, the other versions are... something else

2 days ago
Sibula97

Python 2 was fine for its time and purpose, but I wasn't a fan of it. Python 3 though, especially more recent versions, that's the good stuff.

2 days ago
aspect_rap
:ts:

I can also make java newer by arbitrarily choosing a later version of the language as the starting point.

2 days ago
ReadyAndSalted

I suppose their point is that python did a pretty deep and breaking change at python 3, effectively re-inventing itself to shed its bloat.

1 day ago
MinosAristos
:py: :ts: :cs:

Choose any starting point, you can't make Java seem modern

2 days ago
aspect_rap
:ts:

Spoken like someone who's only knowledge on java is seeing some code example based on java8 and formed his entire opinion on the language on it.

2 days ago
-Kerrigan-
:j::kt:

Modern Java started with Java 8 in 2014

1 day ago
Dotcaprachiappa
:s:

Fair enough, but I've never seen someone using anything other than python 3, Java 8 on the other hand..

2 days ago
PityUpvote
:py::rust:

You've never seen anyone use python 2.7? People were just starting to switch in 2018.

2 days ago
Forward_Thrust963
:py::cs:

can confirm, still using 2.7

2 days ago
ofnuts
:j::py::bash:

Just shows how good it is 😎

2 days ago
ZORO_0071

I think the controversy should end at this point

2 days ago
Prof_LaGuerre
:py:

You don’t blame the screwdriver for being a bad hammer if you fail to understand how to use the tool correctly.

2 days ago
ZeAthenA714

If a screwdriver required as much shenanigans to screw something as Python does to use it, I would happily screw things with a hammer instead.

2 days ago
gufranthakur OP

✍️✍️✍️🔥🔥🔥

2 days ago
nextnode

Does that even happen nowadays? Seems like a 2010's thing

2 days ago
dosadiexperiment

Happened to me last week. Depends what stuff you try to use.

Not that java is actually any better. "Write once, debug everywhere", as we used to say.

2 days ago
gufranthakur OP

Ironically JavaScript is becoming the "write once run everywhere"

2 days ago
anotheridiot-
:g::c::py::bash::js:

Until the build breaks for no reason.

2 days ago
gufranthakur OP

It works on my local host tho

2 days ago
anotheridiot-
:g::c::py::bash::js:

works_on_my_machine.png

2 days ago
slaymaker1907
:cp:

I feel like that’s for any programming language.

1 day ago
anotheridiot-
:g::c::py::bash::js:

Have not had this happen with go yet.

1 day ago
Ubermidget2
:py:

Well of course there is a reason, left-pad got deleted

1 day ago
LeoTheBirb
:c::j::s:

Technically “write once debug everywhere” is true of all languages. The difference is that with Java and other VM languages, you don’t have to recompile the dependencies for different architectures.

1 day ago
kaptain__katnip

Oh it absolutely happens. We use pipenv as our package manager. It has a lock file for package versions, but when you install a new package, it will automatically update everything, regardless of what's in the lock file. You can restrict it to only updating dependent packages, but there's no option to just install the new package and update nothing if the packages already meet the minimum version requirements. So I had to spend an entire day pinning package versions for stuff I've never heard of because the updates broke our code or made it do funky stuff (one introduced rich stack traces that would print every element of a million row dataframe as part of the stack trace).

23 hours ago
PhillipDeLarge

Delightful

23 hours ago
imforit

the biggest issue I have is when a package is in pip, figuring out what it's called in conda (if it exists).

2 days ago
nextnode

What do you use conda for nowadays?

2 days ago
imforit

data science. I'm using prebuilt base containers and that's what it uses.

2 days ago
knightwhosaysnil

strongly recommend shifting off of conda or just using it to install a better dependency manager. Was nothing but trouble for our DS team until the SWE team showed them the light of UV

2 days ago
anotheridiot-
:g::c::py::bash::js:

uv my beloved.

2 days ago
imforit

Heard, friend. That's the beauty of containers is the moment it doesn't work I can throw it away! Using NVidia's containers. adding whatever we need in top has been easy enough.

I am curious what specific horror stories people have. I'm seeing the horor but deeply curious about the details 

2 days ago
lolcrunchy

I use conda at work because IT's security settings break venv and uv...

2 days ago
mavenHawk

It does because pip is still a terrible package manager. And the fact that it installs globally if you forget to activate virtual env is still a problem. Nothing 2010 about it

2 days ago
cemanresu

I spent literally entire weeks just last year on untangling a dependency nightmare caused by some random ass cryptography library, some openssl libraries, and some conflicts way upstream of those

2 days ago
gufranthakur OP

Python is actually incredible if you are dealing with maintained packages from good contributers and companies.

Java on the other hand, I have used some really old and outdated swing libraries that were last updated a decade ago and they still worked with my app. I was amazed

2 days ago
Alphasite

Not if you’re using UV or Poetry. PiP is useless but there are legitimately good tools which make this a non issue.

2 days ago
gufranthakur OP

Happened to me last week at work when I tried using tflite and some libraries and got mismatching numpy versions, spent a big while trying to fix it before giving up and taking an alternate route

2 days ago
liquidmasl

just use uv, its a godsend

2 days ago
gufranthakur OP

We had to run it on a debian-dockerised container inside of a Toradex controller. We had limited options

2 days ago
Fiwexila

Use uv

2 days ago
Bob_Dieter

Not a Java dev, so could be wrong, but isn't Java known for its 12 page long error traces? Sounds a bit like the pot calling the kettle black.

2 days ago
gufranthakur OP

Yep. But the error is stated right at the top, with the exact exception (if it is) which makes it easier to catch it in a try and catch statement

The "long errors" don't make sense because no one is gonna tell you to scroll down and read it all. The exception, why it occured, and the line number are all at the top in most cases.

The long errors do get annoying when you get multiple exceptions at the same time, which means that you're doing something very wrong to get multiple exceptions at the same time

2 days ago
Sibula97

And with Python you get the same thing (exact exception, etc.) at the bottom of the trace, you know, the part you see on your terminal screen while the top of the stack trace is somewhere up there you need to scroll to.

2 days ago
Bob_Dieter

This. Plus, you get an exact highlight of the source line that causes the exception. Honestly, this sounds more and more like a python W.

2 days ago
reallokiscarlet

Do you like janky syntax, supply chain attacks, and abstractions that depend on C?

That is to say, are you a python user?

Consider the crab language.

2 days ago
gufranthakur OP

I am still trying to get used to its syntax. Although I wanna use the crab language the syntax just makes me want to quit it

2 days ago
reallokiscarlet

It takes a lot of getting used to. I've messed with crab before but when picking it back up I struggled with the syntax nonetheless.

Like, when to let mut and when not to let mut. Sometimes, when you make a variable with a long lifetime but assign it in a smaller scope, you might get a warning or error for initializing it as mutable because you only use it after assigning it later. And if the program believes it's only ever going to be mutated once, it might just expect you to let it uninitialized and make it immutable. This can also create a warning or even an error, depending on the situation.

So then you make it immutable, only assigning it once and never mutating it afterward... Until you add more code and suddenly you're mutating it. Then you have to go back and make it mutable.

And that's the *tip* of the iceberg.

Still, after using it a while, I really think it could make a good python replacement, especially if the python version of your program was gonna ship as bytecode or a binary with the python code and interpreter jammed in anyway.

2 days ago
UdPropheticCatgirl
:c::ftn::sc::rust::cp::elm:

Like, when to let mut and when not to let mut. Sometimes, when you make a variable with a long lifetime but assign it in a smaller scope, you might get a warning or error for initializing it as mutable because you only use it after assigning it later. And if the program believes it's only ever going to be mutated once, it might just expect you to let it uninitialized and make it immutable. This can also create a warning or even an error, depending on the situation. So then you make it immutable, only assigning it once and never mutating it afterward... Until you add more code and suddenly you're mutating it. Then you have to go back and make it mutable. And that's the tip of the iceberg.

None of this is syntax related tho? Rust is ugly… But this is all about semantics and actually the correct way to handle them anyway, there is nothing to struggle with… Like the complicated parts of rust all live in proc macros and combination of async and lifetimes.

Still, after using it a while, I really think it could make a good python replacement, especially if the python version of your program was gonna ship as bytecode or a binary with the python code and interpreter jammed in anyway.

I mean rust and python are basically diametrically opposed. The only sane reasons to ever use python is that it has great standard library and really fast iteration speed. You use rust for everything else the language has to offer in spite of having a standard library that kinda sucks and iteration in it being painfully slow even in comparison to something like C++.

2 days ago
reallokiscarlet

None of this is syntax related tho?

In full disclosure, it was all I could think about lately because it's been driving me crazy. I could go down a long list of syntax weirdness but a lot of it boils down to "why do I need to write a novel to make this work"

iteration speed

Well now I know one thing I don't need to test in my program. Kinda sucks given matching and iteration are actually pretty fun in crab. It makes parsing things pretty easy, but it makes a lot of things that would be easy in C++ super frustrating unless I just... Ya know... Enter unsafe and drop to C.

2 days ago
gufranthakur OP

Rust is sadly never replacing python because the extremely vast difference in syntax and their use cases. It can compete, but never replacing it unless rust announces some ground breaking changes that completely changes the way we code in rust

2 days ago
No_Issue_7023

python -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt

Yeah it’s a real struggle

2 days ago
arpan3t

Check out uv.

uv init

uv add package

uv run main.py

Either way, idk how ppl are having package management issues with Python these days.

2 days ago
ShimoFox

I'm almost positive it's people who don't use venv and then get mad that they can't get the older versions of packages in their live system due to version requirements of other packages.

Venv is a lifesaver. And I think JS folks are just too used to npm defaulting to the current directory without the -g global. Whereas pip defaults to global.

I use both js and python in my work a lot. And I've watched the people on both sides complain about the package management of the other side. Lol. But the truth is, they both have issues that the power users just forget are issues because they're used to working around them.

2 days ago
anotheridiot-
:g::c::py::bash::js:

Not compatible with your python version, sorry.

2 days ago
nabagaca

UV venv --python {version}, or alternatively if the repo has .python-version, it's set automatically

2 days ago
Sibula97

Better yet, use a pyproject.toml file.

2 days ago
wutwutwut2000

uv init will automatically set up a project.toml file with a build backend and version requirements

2 days ago
Sibula97

I meant the .python-version file, you should define the Python versions in the toml as well.

2 days ago
wutwutwut2000

uv init does that automatically too. 

2 days ago
Sibula97

I know, I use uv myself.

2 days ago
the_other_brand
:j:

Oh, running this on Windows? Screw you here's an obscure error instead of a clear message telling you the library only supports Linux/Unix systems.

(This was every major AI Python library until 2023)

2 days ago
AdmiralQuokka
:rust:

"running on Windows"

closed as user error

2 days ago
anotheridiot-
:g::c::py::bash::js:

Baka user.

2 days ago
gufranthakur OP

You forgot an argument? Here's the exact implementation of it in it's underlying C implementation! (But hey it does tell you the exact error at the end of the error log, thanks)

2 days ago
gufranthakur OP

Ah, should've used python3.9 instead of python3.12

2 days ago
dasterix

Package libobscurev3.2.1 is not available on your OS

2 days ago
HiniatureLove

Nah. This just didnt work for me at all. I literally had to go to pypi and download each whl and manually install each dependency after wrestling with the company proxy because for some reason, pip could not find any modules that are compatible with the environment. I m guessing some funky settings on uat/prod servers by the network team.

2 days ago
romulof
:cp::py::js::j:

I was away from Python for about 10 years and it was quite disappointing to see how things did not evolve.

NPM and Node module resolution is ages ahead of Python.

- “Oh, but node_modules is huge”

- “bla bla bla left-pad”

These are just testaments of how great is Node’s module management.

2 days ago
j03ch1p

have you ever tried uv?

2 days ago
romulof
:cp::py::js::j:

Yes, but there are multiple competing standards, multiple ways to do the same thing.

Even the most recent attempt of standardizing the lock file went down when uv said they won’t be using it (this info might be outdated).

2 days ago
UdPropheticCatgirl
:c::ftn::sc::rust::cp::elm:

I mean sure npm is probably only the second worst package management solution after pip… I would probably take CMake over either of these and CMakes package management is always a guaranteed source of severe mental distress. That’s how bad they are compared to every other ecosystem…

2 days ago
romulof
:cp::py::js::j:

How do you organize a super fragmented ecosystem?

Make dependency management and build system almost like another programming language.

2 days ago
jameyiguess
:g:

Strawman. None of this is real in Python if you just use a venv... 

I don't mind Java, BTW.

2 days ago
fryhenryj

Sometimes you dont have the luxury of using a virtual environment. Sometimes you are stuck on whatever version of python is available and whatever environment the system has access to (eg Kodi Vs xmltree = 😞)

2 days ago
nobody0163
:c::cp::cs::py::ts::asm:

I have never had any issues with just pip and no one i know has had any issues with pip.

2 days ago
PARADOXsquared

I use whatever language makes the most sense for a given project. I've seen both spaghetti and well-written code in both Java and Python. The fight is imaginary.

2 days ago
gufranthakur OP

Yeah lol. I've faced issues in Java and python, and rust, and JS, and C#. Every language is a pain if you dive deep enough. It's just pick your poison

2 days ago
moradinshammer

I can write shitty spaghetti code in over 12 languages and can reinvent the wheel in all modern frameworks.

Ready for management

2 days ago
gufranthakur OP

I can prompt 12 AI models with "fix it" and get even more broken features in more code files

Ready for production

2 days ago
Slow_Ad_2674

I have been developing using python for over a decade and never had any of these issues. What are you guys developing?

2 days ago
EconomyDoctor3287

Haha, that's so real.

2 days ago
RamonaZero

Me in my cozy corner doing x64 Assembly watching all programming languages burn :0

2 days ago
gufranthakur OP

Just curious, what do you use assembly for currently? I was thinking about trying it for fun but never tried it

2 days ago
Flimsy_Meal_4199

I like java

I love python

Dep mgmt is tremendously uncomplicated 99% of the time and once you dig under the hood a few times it's very concrete and predictable.

That said my local machine (personal desktop) is a disaster area loool I need to rip my installations out and re do it

2 days ago
realqmaster

Just a friendly reminder that Python is actually older than Java.

2 days ago
SoftwareSource

Java stack traces may be long, but if you cannot find where the error is and how it moves from it, the problem is you.

2 days ago
northparkbv
full stack web dev, i guess :p::j::py::vb::msl:

Java 21 has 2 lines of boilerplate now

2 days ago
jamiejagaimo

Long live Kotlin.

2 days ago
fryhenryj

To be fair doing something like installing all the modules for python gui setup without an environment manager like anaconda to manage all the conflicting dependencies is truly painful and you will break everything.

But on the other hand curly braces, nah.

2 days ago
linuxdropout

I thought node_modules was bad until I encountered python dependency management.

Utterly insane.

2 days ago
gsdev

Python is a magical language. It lets you experience syntax errors when you're not even developing, just trying to run someone else's software.

1 day ago
Trevor_GoodchiId

Node developer rolling the dice on npm update of a 6 months old setup.

1 day ago
myrsnipe

The fun starts when dependencies in the same project requires different versions of binary compiled libraries

1 day ago
ShopNo7513
:j:

JAVA BROS UNITE!!!!!!!!!

1 day ago
usrlibshare

The last time I had a dependenc problem was...yeah, wait a sec...ah yes, before containers became a thing 😎

2 days ago
UdPropheticCatgirl
:c::ftn::sc::rust::cp::elm:

Because needing to ship better half of linux userland, buch of esoteric machinery to configure C groups and user permissions and depending on the underlying platform entire linux vm is a sign of a language that doesn’t have dependency management problem.

2 days ago
usrlibshare

is a sign of a language that doesn’t have dependency management problem.

Pretty sure I never said that.

Pythons dependency management is a mess. So is its handling of multiple interpreter versions and isolation of runtime environments. I am merely stating that there is a widespread, easy-to-use way around these problems.

And besides, thanks to the good folks who make uv even managing dependencies directly on the host system is nowadays a far cry from the PITA it used to be.

2 days ago
Bryguy3k
:c::py:

You know the number one sign of a disorganized dev who doesn’t know what they’re doing? Crying over package dependencies.

Keep your shit clean and organized bozos.

And if you use conda then you deserve the pain - that is a disaster of a project.

2 days ago
gufranthakur OP

Yeah sorry, It was my fault for not knowing that x package was using numpy 1.8.9 and y package was using numpy 2

2 days ago
lehvs

Requirements.txt has left the chat.

2 days ago
Xhadov7
:c:

go mod tidy solos 🥱

1 day ago
edgeofsanity76

Boilerplate and outdated? That, doesn't even make sense

1 day ago
Optoplasm

Python dependencies and venv really aren’t bad to troubleshoot tbh. Have you tried to deal with JS library dependencies before? That is 100x worse

19 hours ago
Xaxxus
:sw:

It always amazes me how people love all these languages with all this bad tooling/env setup.

Meanwhile you have languages like rust, go, swift that you can pretty much get up and running with a single command to fetch all your dependencies.

2 days ago
L4ppuz

It might be because you can build a CNN in an afternoon with like five imports and python

2 days ago
UdPropheticCatgirl
:c::ftn::sc::rust::cp::elm:

Meanwhile you have languages like rust, go, swift that you can pretty much get up and running with a single command to fetch all your dependencies.

Rust and Go, those I get, but there is none who can convince me that the swift build system isn’t giant pain in the ass, which involves ceremony after ceremony to actually get going.

2 days ago
gufranthakur OP

Rust and Java always amazed me with their library management. I love cargo and Maven. Haven't used swift tho

2 days ago
oclafloptson
:py::js::ts::j::cp::c:

Why do anti Python memes always reference bullshit that's not really an issue for anyone other than first month students

2 days ago
SleeperAwakened

Because that's exactly the same for all other languages as well.

2 days ago