[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1382198972401.jpg (6 KB, 275x183)
6 KB JPG
Seriously, why is Python a thing?
Why do I need to install a JavaScript runtime to run yt-dlp?
Why can't I just have a gallery organizer on my webserver without installing Perl?

Yes, I understand it's about "portability", but ffs we don't live in the 1980s anymore. These things have their place, but it should be a tiny exception, basically for scripting and prototyping and and never for anything you expect anyone else to run more than once. You don't distribute your shell scripts, do you?
For compiled software, nowadays you can easily get all the libraries you need, apt or pacman has you covered. Just install and bam you're good to go. And if you're lazy and/or retarded for even that, Go and (especially) Rust made this shit infinitely easier than anything else out there.

I never had to struggle with a C or C++ or Go or Rust program *too* much. Meanwhile pipx made me feel like pissing blood so so so many times. It's godawful. What's worse Python keeps changing its internals, so a program written for Python 3.12 suddenly doesn't run on Python 3.14. And lest we forget the entire "transition to python3" period when you had to juggle with the inconsistencies of who put which version where, pip vs pip3, etc.
And the punchline? Those programs run like shit. Just why?? If you're coding something, just write it in C++ ffs
>>
Python is nice for prototyping stuff, but the problem is that people just use the prototype.
>>
>>108888328
>a program written for Python 3.12 suddenly doesn't run on Python 3.14

and don't forget to recompile your c/c++ python extension modules while at it.

they scared off everyone who liked stability with 2 to 3 transition. on python 3 only those who enjoy constant breakage remain.
>>
File: image.png (126 KB, 1150x592)
126 KB PNG
>>108888328
good morning saar, please do the needful and redeem the is-even package i am very smart programmer perfect for blazing fast code gorgeous looks no virus
>>
>>108888328
From an ML standpoint Python is king because it allows you to work on your app using a REPL. You load your dataset once then do whatever you want with it while it's on memory.
Meanwhile, using a compiled language, if you decide you want to do a different transform or print on your dataset, you have to re-compile and re-run the application (which will includethe lengthy dataset load time). Or you have to code a REPL yourself which is obviously not ideal.
>>
File: 1434032641727.png (2.68 MB, 1402x1052)
2.68 MB PNG
>>108888402
>From an ML standpoint
>>
>>108888429
ML is much more than GenAI slop.
>>
>>108888328
>Why aren't compiled programs the absolute standard?
They are.
>>
>>108888328
management.
i protoyped something in python 10 years ago. it still is in production and haunts me to this day.
>>
File: 1779198741748964.png (2.37 MB, 1283x1226)
2.37 MB PNG
>>108888336
No it's not, unless your IDE is literally notepad. Compiled languages has way way better quality of life features, in their LSP. Python is good as a "extended calculator" and nothing else. Especially not for making software, and the funny thing is that it is not very hard to learn a new language, py-babies
>>
>>108888328
>Why do I need to install a JavaScript runtime to run yt-dlp?
its youtube being faggots and forcing devs to do this
>To download from YouTube, yt-dlp needs to solve JavaScript challenges presented by YouTube using an external JavaScript runtime.
>>
Python is kind of hilarious because every time I need to compile a toolchain or something, I end up with a gorillion versions of Python. Is it really that backwards incompatible?
>>
>>108889641
Python venvs and all are pretty shitty, I'll give you that, but I'll gladly take that over Sepples technical debt caused by backwards compatibility at all costs.
>>
>>108889287
Name a better language.
>>
That's a very good question.
>>
>>108889063
what decade are you living in?
>>
>>108890332
Windows
>>
>>108890332
The vast majority of executable code running on both your system and mine is compiled. Feel free to prove otherwise.
>>
>>108889803
C
C#
Java
Zig
Odin
Jai
C3
Beef
Lua(is scripting though)
Exel
>>
>>108888328
Just ask your local ai to install all your shit
>>
>>108888328
>Why do I need to install a JavaScript runtime to run yt-dlp?
I dont know what JavaScript is but I can still use yt-dlp easily. Sounds like you know just enough to overcomplicate things for yourself, but not enough to avoid being a retard.
>>
File: 1749433015609582.jpg (162 KB, 1606x887)
162 KB JPG
>>108888328
not just compiled programs, but programs that dont rely on dozen layers of abstraction on top of the system
>>
>>108889803
For scripts, scheme/guile
For ML, Julia
For webdev, Go

But I like Python. It's a quite nice 'one size fits all' language
>>
>>108891513
>julia
stop trying to force it. nobody cares about that dogshit language outside of academia. exactly like R
>>
>>108888336
Lisp is nice for prototyping stuff
Python is the stackoverflow vibecode prostitute full of dependency issue bugs
>>
>>108888328
>Why do I need to install a JavaScript runtime to run yt-dlp?
because modern youtube has become unscrapable using classical web scraping methods, you need to run some JS code
>>
>>108888328
>Seriously, why is Python a thing?
Sunk cost fallacy.
>>
>>108892742
dont use third party packages from jeets. i have no dependency problems.
>>
>>108888328
>why is Python a thing?
Because it's the easiest language to learn and people who were from another field like ML engineers and data scientists (who were mostly maths majors) or job switchers or boot camp kiddos wrote their programs in it. Hardware is fast enough now that they don't have to worry about its slowness too.
>>
>>108893087
memory is there to be used
>>
>>108888328
I challenge you to make a C program that can be as introspective as the languages you mentioned (perl, python)
This is why these languages are used, the ease at which they can describe the system and themselves
>>
>>108893145
use case?
>>
>>108889803
>sweats profusely
R...rust?
>>
Everyone complains about runtimes, command line interfaces, etc, until they're the ones actually developing the app.
>>
>>108893161
Namely hot reloading is a lot easier with introspection (like emacs) versus reloading a dynamic library during runtime. If you're configuring or tinkering with any software that you don't want to lose the state of this is pretty handy
>>
>>108893178
contrarianpost: some languages let you have your cake and eat it too. SBCL, graalvm etc
>>
>>108893178
Hot reloading angers the gods.
>>
>>108893087
>Because it's the easiest language to learn
python is easy to learn. i found it was so slow that it forced me to learn C
>>
>>108893192
(dev_work*dev_rate) + (exec_time*times_executed)
how to optimize can vary a lot. throwaway scripts are best with python.
OS utils are best in C.
jeets are never worth it.
>>
>>108893217
>throwaway scripts are best with python.
>OS utils are best in C
yes

>(dev_work*dev_rate) + (exec_time*times_executed)
the time wasted gets silly. I regret wasting as much time as I did with python but I must admit what I did learn in python made C a lot easier to learn. if i ever meet the creator of python one day I will thank him for forcing me to learn a language that isn't slow as fuck, if i can get through the crowd of indians
>>
>>108888336
>the problem is that people just use the prototype.
If it works, it works.
>>
>>108893178
>Namely hot reloading is a lot easier with introspection (like emacs)
Emacs is written in C.
>>
>>108893192
What tasks was it too slow for?
>>
File: terminal_tumor.png (27 KB, 571x618)
27 KB PNG
>>108888402
>>108888899
>>108889792
>>
>>108888328
>Why do I need to install a JavaScript runtime to run yt-dlp?
They can't bundle what they haven't solved in Python.
>>
I like interpreted languages like APL
>>
>>108889803
Every LISP
>>
>>108888402
>>108888429
Not just ML, any kind of work with non-trivial datasets you must play around with before doing the work, which is very common in research. Example: measurements.
Typical fa/g/s live in their cute little frontend bubble where everything is already done for you and so they will never understand.
>>
>>108894290
>no argument
>>
>>108894967
Language-wise, Common Lisp is better than Python.

However, the latter has such an enormous amount of useful libraries that it is often preferable in practice. Sad, but true.
>>
File: 1548238386665.jpg (193 KB, 1355x882)
193 KB JPG
>>108893087
>Because it's the easiest language to learn
Is it though???? I've been hearing this meme my whole life but I just don't see it. If by "learn" you mean children learning to make a for loop then sure, but that shit is easy to learn in literally any mainstream language (with the possible exception of Lisp). Once you go past that most basic CS101 stuff, Python is just like any other language, with its own concepts and idiosyncrasies.
If anything, Python is *harder* to learn because its documentation/resources are dogshit. C++ has learncpp.com, Rust has The Book, there have been literally hundreds of textbooks on C. Meanwhile what does Python has? Shitty tutorials written for 85 IQ apes, learnpython.org (but I repeat myself) and the crusty docs. How is that "easier to learn"??
>>
>>108893097
>why are you spending $50 on a sandwich
>dude stfu money is there to be used oh my god
>>
>>108888328
You're conflating too many things together.
You say you haven't had issues with C or C++ programs but that is very unlikely if you seriously compiled these programs from source, especially in the modern hell that is cmake. However, it is true that go and rust is much easier to work with. But that's about build and packaging, not about the language itself -- though I grant you it's inherently tied, just as much as I think it's fair to blame a language for having a shitty stdlib (e.g. ocaml).

Portability is a concern like you mention, but another concern is simply iteration speed. You forget another thing from the 80's: the slowness of compilers. It's still a massive issue today with rust and c++, but not so much with c or go. However, though it's more negligible, it's still a legitimate concern because it's an easy way to get knocked off your flow when programming.

When I mentioned you conflated too many things, I'm also referring to the distinction between python, javascript, compiled, vm, and interpreted languages.
For example, vm languages such as java and c# can be extremely fast, though not as fast as just c, so your point about python and js programs being slow does not apply in the general case. Lisp programs can be shared non-compiled and compiled locally to achieve the same kind of compatibility you ascribe to python while achieving phenomenal speed, so that disproves all your claims i.e. you don't know much outside python alone and you should ask 'why are people using python' rather than 'why isn't compilation the standard'.

Moreover, you completely discount the hell that is dynamic library version mismatches and runtime library loading in c and c++ programs.
>>
>>108888402
Absolutely nobody uses the repl in python in practice. It's why ipython notebooks had to become a thing.
>>
>>108890352
Most of it in most linux distros is python actually and unironically. If you're on windows, most of it will be js/reactnative.
>>
>>108891513
Julia is a broken piece of garbage for ml. Total joke. My PhD lab tried to migrate to julia. It didn't go well. I lol'd about it the whole way. They didn't listen.
>>
>>108893043
The only point of using python in the first place is to use 500 dependencies from jeets because it's already there. From p*ndas to n*mpy to l*tellm. If you're not doing this, then you can use any obscure programming language and have a 100000x better time and be infinitely more productive.
>>
>>108894272
For me, I was working on a mass spectrometry database search algorithm. I actually found that all the existing c bridges were so fucking slow at the call interface that I had to use a mix of numba and abusing a crazy retarded architecture around heavily sharded sqlite databases to get to acceptable performance levels, as the C b-tree implementation was somehow 20% slower than the numpy-based bruteforce approach when called from python (it was ~3x faster than my final version with numba and sqlite when called purely from C though).
>>
>>108895378
If llms actually worked even 1/10th as well as advertised, we could use them to rewrite python libraries in common lisp and not have to have this issue. Alas...
>>
>>108896532
> You say you haven't had issues with C or C++ programs but that is very unlikely if you seriously compiled these programs from source, especially in the modern hell that is cmake
It's literally true, though. Except truly monstrous projects with gigabytes of source code (e.g. chromium/firefox), I tend to download & compile anything not available on pacman (I don't trust AUR, only get stuff directly from the upstream).
I'm not saying I *never* encountered issues, but most of the time it Just Werks. When it doesn't, I just find what I'm missing via pkgfile and *then* it Just Werks.

> especially in the modern hell that is cmake
Works on my machine :^)
Besides, who the fuck still uses cmake? These days I only see it as an option, or in very old legacy repos. It's clearly going down the path of autoconf. Meson is where it's at.

> though I grant you it's inherently tied
Then stfu! If you get the point, why are you writing this? "I le grant you" gee thank you Anonymous

> For example, vm languages such as java and c#
Wow, good thing I haven't mentioned those then, or I would've come off as a retard, wouldn't I?

> Moreover,
Suck my dick.
>>
>>108896660
>>>/r/eddit/
>>
>>108896541
The -i interpretter flag (drops you to REPL after script execution) is amazing for debugging. IPython notebooks are just a better frontend to the REPL
>>
>>108896541
>Absolutely nobody uses the repl in python in practice.
Citation needed
>>
>>108896575
Not true, Python has a great stdlib.
>>
>>108896607
That's interesting to hear, but it doesn't seem to be related to the language per se. If the C B-tree implementation was that slow as well, it was probably just poorly designed from an algorithmic perspective.
>>
>>108896541
>Absolutely nobody uses the repl in python in practice.
These are the people telling you dynamic languages are bad.
>>
>>108891966
>R
i mean it's got its niché (humanities and representation value) but jesus christ, i know of a student worker for a prof whos task for the student is to make a programm for transkription all in R...jesus christ
>>
>>108898103
but they are bad
>>
>>108896541
If you write python anf don't ever use the repl you are most likely an incompetent. Notebooks aren't a replacement.
>>
File: 1760679160451_7647.jpg (71 KB, 700x693)
71 KB JPG
I find all the hate against python I'm the last few years kind of funny, I remember almost 15 years ago, when I started learning programming, python was consistently one of the most beloved programming languages, almost had the same positive attitude sveltekit or other newer tools that made development faster and easier had today and literally killed Perl, which was the Python/JS of those days. While people loathed Java and C what with their longass spaghetti code bases. I guess the greatest sin any tech can do is become popular.
>>
>>108898358
Python is loved by programmers similar reasons that UE5 is loved by programmers. Python is hated by passionate people for roughly the same reasons that UE5 is, and it's not popularity. Popularity just turns a problem that you can ignore into a problem that you can't ignore.
>>
>>108898358
Those who hate Python because it's easy, or "too high level" are idiots clinging to machismo and ignoring the fact that Python is deliberately designed to be a high level, dynamic language with a rich runtime,. This is a design choice, not inherently a flaw: some languages are intended to be suited for low-level work, others aim to be more abstract. Different goals.

With that said, Python has real technical flaws which should not be ignored. While 3 is IMHO a significantly better language overall, the 2 to 3 transition was very rough and showed that the language was unstable: you can't write Python code today and be confident that it will be usable 10 years from now.

I still use and like Python in spite of these issues, which everyone should fully acknowledge.
>>
>>108898093
Read nigga read. Even compared to the best implementation, it was still 3x faster. The problem was 100% on the c bridge, and that was also the conclusion by people in the python community I discussed with.
>>
>>108896617
I've seen more willingness to move away from Python because of the development speed enabled by LLMs. Earlier people made programs in Python considering development speed but now I hardly see new projects done in python. It's almost always Java/C#, Go or Rust. I've not worked in a python project in the last 3 years despite starting out as a python dev.
>>
I don't use interpreted languages because I don't know how to debug them, so they're useless except for very small scripts.
Powershell on the other hand, does have a debugger (Powershell ISE) so it's usable for more complex projects.
>>
File: c chad.jpg (21 KB, 735x884)
21 KB JPG
>>108889803
>>
>>108898158
Nope. They have their place. Monobrain retards can't fathom this concept.
>>
>>108898579
>I have skill issues therefore the language is bad
Many such cases
>>
>>108898607
If you don't make it easy for me to use your shitty scripting language then I won't use it, simple as
I can debug C/C++ in visual studio, Powershell in the ISE, Python in ??? weird software that literally no one has heard of
>>
I want to compile python.
>>
Try developing an app in Ruby, it's extremely addictive how easy, natural and intuitive it feels. Of course it's also going to be slow, but it's hard to deny developer experience is the bestest with Ruby - but for webapps le speed is not usually the problem, they aren't games. And if you need types, Ruby has that too now.

Not arguing for Ruby, but I'm just saying there's a certain advantage to be writing in a language like Ruby, it's so much nicer and convient it's not even close to anything else.
>>
>>108888328
There's nothing wrong with dynamically typed and interpreted languages and if you say otherwise you're Jewish or Chinese.
>>
>>108888328
It is the standard, the industry is just below standard.

You should be supporting the complete and total firing of everyone in it for whatever reason presented. But not only the employees, also the managers.
>>
>>108898740
The first dynamic and interpreted language was designed by a Jew.
>>
>>108898740
Yes, I started to realize that a lot of people badmouthing languages like Ruby or JavaScript and arguing for Go may actually have a skill issue. Because we always thought it's the webshit monkeys who are incapable of learning a compiled, statically typed language... turns out it's the other way around.
>>
>>108898763
As someone who worked in embedded for a few years, I'll boldly claim this: contrary to widespread belief, low level programming is easier than high level programming.

It only superficially looks the opposite to outsiders, hence this reputation.
>>
>>108888328
>Why aren't compiled programs the absolute standard?
I don't know and I have not known since 1992, BASIC on 8 bits gets a free pass because they boot into it as a shell

statically lined, no exceptions
>>
>>108898798
>lined
*linked
>>
>>108898673
It's easy to use, you just don't know how to use it properly. You are accustomed to one specific way of working and can't think any other way. Your brain is stunted. Python will remain far too popular for its own good no matter whether you figure it out or not.
>>
>>108898673
...
pycharm
>>
>>108899070
>??? weird software that literally no one has heard of
case in point
>>
>>108899073
have you not heard of jetbrains
>>
>>108899073
https://www.reddit.com/r/AskProgramming/comments/1p49ii9/is_pycharm_worth_it/

Stop trolling.
>>
>>108899075
>jeetbrains
literally never heard of this slopware
>>108899079
>posts a reddit link as evidence that "people" are using jeetbrains
whoa there partner, care to spread the love and happiness by gifting me a reddit gold?
>>
>>108898731
Not worth it, just use a language designed to be compiled it will be a superior experience.
>>
>>108899091
Why are you even here, did you just take your first progamming final yesterday and couldn't wait to come shitpost on /g/? You don't seem to have any relevant experience at all.
>>
>>108888328
ok boomer
>>
>>108898602
>Nope. They have their place.

bytecode VMs/interpretation? yes
GCs? yes
dynamic typing? yes, when script < 1000 LOCs
implicit conversion? yes, when script < 100 LOCs

There are way too many programs with >= 1000 LOCs that use scripting lanuguages.
>>
>>108899173
Lines of code isn't a relevant metric. It depends on what you are doing. 5,000, even 10,000 lines of code is not that much and perfectly maintainable in Python. Depends on its role and purpose in the problem space.
>>
>>108899208
>Lines of code isn't a relevant metric.
Yes it is. The best SWEs output the most lines and have the most commits.
>>
>>108899140
>programming is just Python and Java
>if you don't know Python and Java then you can't code, saar!
>you are dalit if you don't use python
Sorry but I simply have no desire to learn those onions langs
If I ever need some Python code written I'll just let AI do it
I prefer C, C# and powershell
>>
File: vomitbalcony.png (361 KB, 600x800)
361 KB PNG
>>108899218
>powershell
>>
File: file.png (51 KB, 824x296)
51 KB PNG
>>108899217
Now post your graph retard
>>
>>108899218
Your preferences aren't relevant to anyone else because they are derived from ignorance.
>>
>>108899353
>all those empty squares
LOL
KEK
LMAO

Kill yourself codelet
>>
>>108899208
>Lines of code isn't a relevant metric.
It's irrelevant when measuring the productivity of a programmer and things like that. But here it's relevant. The bigger the program the most likely you can fuck something up because you're a human and the more you need better semantic checking in the language used for writing said program.

>5,000, even 10,000 lines of code is not that much
It's enough for type errors or implicit type conversion to happen, or rather if you're programming defensively and writing manual type check everywhere, it's enough to be sick of writing those checks.

>perfectly maintainable in Python
We're talking about when type errors can be problem. That's not exactly the same thing as maintainability.

>It depends on what you are doing.
>Depends on its role and purpose in the problem space.
Sure. The LOCs I've given are orders of magnitude and really for the purpose of ordering how fast X type related feature is going to be a pain in the ass.
>>
>>108888328
shit like this is why i hate troonix and most of the open sores sphere
except that now those fuckers will smugly throw a 1gb docker container at you and be like "here, use this :)"
>>
>>108900160
>those fuckers will smugly throw a 1gb docker container at you and be like "here, use this :)"
their docker, appimage, electron, and python bloatware makes windows look like a minimal and refined OS
>>
>>108900330
>electron
don't get me started
>>
>>108900145
If type errors happen you fix them.
There's nothing special about type errrors that make them a more inherently important class of bug than any other type of bug. If your program is well-designed with consistent patterns, and suited to the problem domain, it's just not a big issue. You can always use asserts and modern python even has type checking features if you want to use them.

Some domains require that you care a lot about types and how they interact. Some really just don't. If 95% of your code is handling the same tree of strings loaded from a json file you probably don't need to be constantly checking it for type problems.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.