Skip to content

Instantly share code, notes, and snippets.

@TruncatedDinoSour
Created May 7, 2024 21:04
Show Gist options
  • Save TruncatedDinoSour/5bbb776d29d550d11d0cfa00ed93079d to your computer and use it in GitHub Desktop.
Save TruncatedDinoSour/5bbb776d29d550d11d0cfa00ed93079d to your computer and use it in GitHub Desktop.
Python vs C: Machine learning

I feel like Python is a very stupid choice for machine learning, C is a much better alternative because there's many libraries already available for it, and if not you can make them yourself. Machine learning is mainly mathematics, which C is efficient at, and if you're working with large numbers you could use a bigint implementation such as GMP. I don't get why people choose Python for such intensive tasks, yet choose something like Rust for backend web development, it just makes no sense. Backend doesn't need the best performance, and high level features in that sector are great, while performance and low level control in case of C for machine learning models can be great for optimization, performance, and efficiency for the model. It's so stupid, it's 1000% not worth the syntax sugar, high level abstraction, mathematics integration, and all that when stuff becomes like 6000000 times slower, and not as if mathematics from Python can't be ported to C, they can, and very easily, so like wtf, lol.

Python has no advantages in this scenario from what I see, besides, well, it being all pre-made, which is a stupid phylosophy which is extremely "soy-dev"-like. "Why would I look for another solution if this solution that's 4873829749832 times slower exists?" I hate this mindset.

I understand that Python has advantages in some places, but this isn't it. Ease of use, pre-made libraries, high-level and abstract features, prototyping, and "everyone uses it" isn't a valid point for using such an efficient tool for such an intensive purpose. In my, I'd say solid, opinion, Python should only be used for testing rather than actual production uses, and for simple models for beginners to learn with Python's almost-English syntax and large variaty of ML, AI, and DS libraries. I feel like if people will continue to use such a bad tool for such a computationally heavy task, it will just stunt the development of the technology, at least consider a language like Go... Literally any compiled language with an optimizer is better than Python at this point.

What do you think of this problem? I personally don't think Python is a great choice unless you're a beginner and learning basic concepts, but even at that stage, in my opinion, the beginner should delve into mathematics side of machine learning more (such as common algorithms like garient descent, neuron structures, loss functions, randomness and entropy concepts, etc.) rather than diving straight into abstract and high-level ML libraries which hide the details of the implementaion, making C a great choice even in this case! But I understand why a beginner familiar primarely with Python would prefer Python in this case, even without libraries (and even if training a simple model to predict a simple function would take like 17 times slower).

Modern world has truly ruined the percenption of computing and technical literacy of modern-day developers :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment