[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


I use it at work and I despite the son of a bitch.
>typing
god i hate wasting my time and energy chasing down a type error deep in my python shitcode. type hints and linter plugins are a hack and only sort of work.
>libraries
somehow they tend to be terribly designed and clumsy to use. for example, see matplotlib
>api references
larger packages will usually have a sphinx documentation page, but smaller ones often just have something like a single markdown file where all documentation gets dumped, which is hell to work with.
>design decisions
more bad than good here. python is known for its indent-based syntax but didn't even get that right (haskell did it better) and has a bunch of awkward shit that feels like it wasn't thought through well. to its credit, though, features like range(...), list comprehension and array indexing/slicing are an improvement over most languages.
>performance
doesn't matter for my use case, but it can be terrible. not only is python slow, but the GIL basically kills parallelism.
>>
Why would you use a dynamic-typed language if type safety is top priority at your job? I'd really like to see an example of this so-called type related error that you are running into.
>>
>>101563706
>be me using matplotlib
>'oh that looks good, now i just want to tweak this small thing'
>you have to use the fig, ax object and redo all the plotting code
>fine whatever i guess
>ax.plot(...)
>'huh it looks like the methods for the axis objects are the same as plt objects, that makes it easy to rewrite at least'
>ax.xlim(...) -- error
>'wtf, why is it set_xlim()? why are some methods different?'
>30 mins later
>'looks good again! hm now i wonder if i can make the left subplot smaller than the right one?'
>you now have to use gridspec and redo all the code AGAIN and figure out the gridspec method names too
fuuuuck

Also another thing, why do python error messages print the entire stack trace? It often goes off screen it's so fucking long, like why? Rust has way cleaner error messages
>>
>>101563706
an upside of python I forgot to mention is that interactive notebooks are a cool and useful feature for my work. i still hate it overall though
>>101563756
>Why would you use a dynamic-typed language if type safety is top priority at your job?
there's a python library I need for my work and binding it to a better language would take too much time to justify at the moment. therefore, I suffer.
>I'd really like to see an example of this so-called type related error that you are running into.
basically, a simple typo like foo(4) instead of foo("4"), or bar([9]) instead of bar(9) can lead to a long and painful debugging session in python. in better languages, the type error is caught by your tooling, or in the worst case, when you compile.
to be fair, type hints and linters working together can help catch this in python. however, the linter can fail for any number of reasons and let the mistake slip through. plugins for other languages can also fail but at least the mistake will be caught by the compiler.
>>
>>101563706
We need a language which is C + some syntactical sugar and some decent generic/ dynamic data structures and a decent string implementation. Why do we keep getting Python, Rust and C++ instead?
>>
>>101563942
>We need a language which is C + some syntactical sugar and some decent generic/ dynamic data structures and a decent string implementation.
sounds like go if you're okay with it having gc. the problem with go is that it's pretty unwieldy for anything but really basic programs and a few domains and tasks that are basically built into the language (e.g. web apps, parsing json). the language being focused isn't necessarily a bad thing but it does mean that people doing anything else will usually reach for something else
>>
>>101563942
It’s called C#. Seriously.
>>
>>101563706
python is the worst language I've ever had the displeasure of using. It's the subsaharan Africa of programming languages. If you've used python at least once and you still think it's good, either you have literally no idea of what it's like to use a good language, or you're a 75 IQ nigger
>>
>>101563864
which library?
hard to imagine nobody rewriting it in rust
>>
>>101563706
Syntax complaints are always retard-tier and indicate a babyducked beginner.
matplotlib has a terrible API because it was inspired by Matlab. Makes nice plots but the API is complete garbage, one of the worst I've used. This complaint is really cherrypicked though, the average Python library has an API like requests rather than like matplotlib. I would say that Python has some of the best designed APIs. The pattern of having a ton of keyword arguments, but most of them with defaults, leads to code where the simple cases are very short but you can still customize things if you want. In other languages, this often involves wrapper object / builder pattern boilerplate (Java) or having many variants of a method that do a similar thing.
If you want performance, push for HPy or another ground-up redesign of the API, which would create an even ground for multiple Python implementations to compete on.
For parallelism, forget about threads. They suck in Python; on the other hand, multiprocessing is one of the nicest libraries for worker processes I've used, in any language. So just use processes.
>>
>>101564557
>Syntax complaints are always retard-tier
They are relevant though. Since a big fraction of programming is just reading code to understand it, and readability is basically syntax, yes, it matters quite a bit.
>>
>>101563706
my coworker mains python and machine learning.
he forces everyone to use abstraction and design pattern otherwise he won't merge our code.
maybe you will like him
>>
Why use matplotlib instead of plotly?
>>
>>101563706
>matplotlib
use plotnine, seaborn, or hvplot
matplotlib is shit
>>
>>101564557
Why do they sometimes use strings and sometimes constants for arguments? Seems to be braindead to me. What's wrong with many methods or builder pattern? Overloading often brings more trouble than good.
Seems to be only using constants https://docs.python.org/3/library/socket.html
Then they use strings here https://docs.python.org/3/library/stdtypes.html
>>
>>101563942
It's called Java
>>
>>101563706
>typing
stop being a shit coder. there's literally no case where this should be a problem with hints+pyright.
>libraries
fair enough, this is why I roll my own when possible
>api references
use an ide, use non-shit apis
>design decisions
complaining about indent is a huge tell that you're a retard
>performance
you're right it doesn't matter for your use case, because you decided to use python. you know to use other things when performance matters, right? you're not a python-only retard are you anon?
>>
>>101564803
>coworker
>controls your ability to merge
hate to tell you this, but this guys is defacto your boss.
>>
>>101564777
>readability is important
>fuck you I don't want to have sane indentation!
>>
File: this is going well.png (1.8 MB, 1300x1011)
1.8 MB
1.8 MB PNG
The only valid criticism of python is the inability to declare forward references and/or resolve cyclic imports. Leads to code crammed into the same file that should be separate, and leads to things being defined in a jumbled order based on whether or not something else needs to use it later.
>>
>>101563706
Python the language is fine. A lot of your early objections are due to the fact it's different than what you're used to, which isn't really an objection it's an argument from ignorance.

That said, I've been using python since 2009 and one thing they've never really fixed is package management:

I hate that they took the lazy route where you can install some python package but it's just going to install the python wrapper code and just break whenever you upgrade it or don't have the right C libraries. The fact package managers don't manage this for you is extra work on your part and an extra annoyance.

I hate their retarded approach of having "environments" and having to make and maintain them. There should just be a package config file and a modules folder. I'm so tired of having to switch out between "virtual environments" and accidentally polluting them and seeing the string off warnings about how this version is needed but it's not going to be installed. Make the "environment" in the modules folder, I don't give a shit, just make it unixy and have it easily driven with plain text files and config.

Also the quality of libraries depends on whether than library is written and used companies or some hobbyist. It's senseless to complain about something some guy is giving away for free, doing it in his spare time or for a pittance with some grant.
>>
>>101566410
Have you ever heard of an autoformatter?
>>
>>101566520
Have you ever heard of configuring an autoformatter?
Have you ever heard of directives to exclude code blocks from autoformatting?
>>
>>101566539
I thought you love having everything indented so why would you need to configure it
Yea I have heard of directives to disable formatting for a region, what's wrong?
>>
>>101564557
>The pattern of having a ton of keyword arguments, but most of them with defaults, leads to code where the simple cases are very short but you can still customize things if you want.
You can do the same thing in Java, what you're talking about is just standard polymorphic methods
>>
>>101563789
So what? Pipe it to "tee" if it bothers you. In what cases would you NOT want a full stack trace?
>>
>>101567394
I can say from experience writing scripts for codelet engineers, if you give them a whole stack track they always somehow manage to snip out the wrong part of it when asking for help.
But it’s a solvable problem, you can control the exception stack if you need to, anon is just lazy.
>>
File: 1721924682520.jpg (51 KB, 432x653)
51 KB
51 KB JPG
>>101563706
Oh this goddamned thing... People lump Java and Jeets together most of the time but Saar powered Python projects are way, WAY worse than any Gradle bullshit could be.
>>
>>101563706
Have you ever use VBA?
Compared to Python, Python is bless
>>
>>101563942
C++
Take it or leave it
>>
Stackoverflow running on aps.net: 9 servers

Quora running on tornado in python : 1000 servers

If you do a project in python just hope that it will never scale
>>
>>101563706
Agreed. I hate it so much that I started making my own scripting language as a replacement
>>
>>101567924
they should've switched to gunicorn. hold on one sec... let me make a call to their server admin. I hope it's not bedtime in bora bora.
>>
>>101566410
The problem isn’t indent based syntax, it’s that python has a bad implementation of it. Haskell does it better. Scala 3 probably does too
Python also has other retarded crap like “x if p else y”
>>
>>101566357
>typing
type hints and tools like pyrighr are a lot better than nothing but they’re also bolted-on cope
>performance
many people indeed only know python (or work with mathematicians and scientists who only learned python and refuse to learn anything else)
I feel bad for those people
>>
>>101564777
>Since a big fraction of programming is just reading code to understand it
That is true, but your conclusion is wrong. It's a matter of habit, unless the syntax is truly egregiously bad. The most important thing is consistency, so that you can get used to the style. A code base should be formatted consistently, but what style it actually is matters a lot less.

>>101566294
Yeah, I'd rather have more constants. But that's orthogonal to keyword arguments and builder pattern.

>>101566849
Not at all, unless you want to create 2^n methods for n optional arguments that have default values. The closest thing Java has to this Python pattern is the builder pattern. Which admittedly is pretty nice, but Python's way is nicer.
>>
>>101571086
>Not at all, unless you want to create 2^n methods for n optional arguments that have default values.
or.... you can just pass an array and then parse it?
>>
>>101571915
I don't think you know which feature I have in mind, because that doesn't make any sense.
I'm talking about this pattern from Python:
subprocess.run(
args,
*,
stdin=None,
input=None,
stdout=None,
stderr=None,
capture_output=False,
shell=False,
cwd=None,
timeout=None,
check=False,
encoding=None,
errors=None,
text=None,
env=None,
universal_newlines=None,
**other_popen_kwargs
)

Which makes it really easy to use the API with the default settings, but also lets you supply your own settings for everything if you want. So the basic cases make for really short code but the advanced cases are still possible.
>>
>>101572432
public static void Run(ArrayList<Flags> args) {
//set stuff to stuff
if (!args.contains(settings) {setting=defaults.get(setting)};
}

class Defaults {
//contains the defaults
}

class Flags {
String name;
String value;
}

ArrayList<Flags> myFlags = new Flags();
myFlags.add(new Flag("stdin", null);
myFlags.add(new Flag("input", null);
myFlags.add(new Flag("stdout", null);
//etc

run(myFlags);


there, i just invented your stupid pattern with a couple of methods in java. obviously it could be a little more succinct but to say that you "cant do that in java" is wrong
>>
>>101572532
You made it stringly typed lmao. You're literally writing Bash in Java. I can't believe you're this fucking retarded haha
>>
>>101572593
I wrote it in 30 seconds to prove a point. You can make your own types
>>
>>101572532
>>101572629
Outside of Flag being misnamed in the class declaration, this seems like a good to do it.
The input of args can be expressed as
public static void run(Flag...) {
}

and it should automatically handle 0 through N inputs of the same type.
Then the default set up only needs to be written once and default unset key values.
>>
>>101572629
I never said this is impossible in Java, just that I don't find it as nice as in Python. Try to keep up with the conversation.
Also, I haven't written any Java for years and even I know that the idiomatic Java equivalent is the Builder pattern, not this stringly typed retardation you just shat out. How are you programming in Java when you don't know the basics? Have you literally never read a Java book?
>>
>>101572694
just because people expect you write code one way at a company doesnt mean you cant write code another way for yourself
you literally dont have to use any pattern you dont want to use
>>
>>101572714
That is true, but what you're suggesting is worse in every way: more code, less reliability, more need for error checking. I don't know why you'd do things that way unless you're babyducked on some shit language like Bash or Perl.
>>
File: .png (1.25 MB, 2000x1000)
1.25 MB
1.25 MB PNG
>>101563706
Of course it's OK. We should treat those with indentation phobia kindly and not judge them for their disability. They have tragic lives already. I hope that one day, scientists will find a cure for their brain condition.
>>
>>101563706
>range(...)
No. It's shit.
Most languages have seq() which is far more intuitive.
Furthermore, syntactic sugar like # in Bash and Lua is far better than len() and is better than range() when constructing loops.
>list comprehensions
Horrible. Only slightly faster than a for loop, and in the process hides complexity and makes it difficult to profile a program.
It's better that the complexity be obvious in an actual for loop block.
>array indexing/slicing
Yes, Python's array slicing is good.
>>
>>101564547
he said a better language anon
>>
for loops using range() in Python are the dumbest fucking thing.
Even COBOL's PERFORM UNTIL VARYING is more sensible.
Guido should have just used C's for syntax like every other language.
>>
>>101563706
What's the next logical step after python? Go or Java?
>>
>>101564547
and...
of course he didn't say any library
because he made all this up
>>
>>101572432
public class Subprocess {

public enum Stdin {
None,
Some
}

public enum Shell {
False,
True
}

public static class Properties {
public Object[] args = {};
public Stdin stdin = Stdin.None;
public Shell shell = Shell.False;
// ... etc
public HashMap<String, Object> kwargs = new HashMap();
}

public void run(Properties properties) {
if (properties == null) {
properties = new Properties();
}
// ... etc
}

}

        Subprocess t = new Subprocess();
Subprocess.Properties p = new Subprocess.Properties();
p.args = new Object[] {1,2,3,4,5};
p.shell = Subprocess.Shell.True;
t.run(p);

The needful.
>>
>>101574559
What's so bad about range?
>>
>>101574208
>>101574559
range() isn’t just part of the syntax of for loops, honorary saars.
>>
Sounds like you just need to learn how to code retard
>>
>>101576011
Yes, that's exactly what I said: it's a worse version of seq()
>>
>>101563706
God, looking at this thread makes me so eager for summer to end, too many high school retards in this thread straight up just sperging cargo cult nonsense
>>
>>101563706
>somehow they tend to be terribly designed and clumsy to use. for example, see matplotlib
this is true of all libraries written by """scientists""" and not by programmers, but this happens in all common programming languages
>>
G4vykp>>101563789
>be me using matplotlib
>'oh that looks good, now i just want to tweak this small thing'
>you have to use the fig, ax object and redo all the plotting code
>plt.gcf()
>plt.gca()

You are like a little baby to me. I don't know about gridspec but there's probably an easy way for that too
>>
>>101577815
Try using non shit tools
Wolfram Language does not have this retardation
>>
File: file.png (46 KB, 1280x558)
46 KB
46 KB PNG
Help is coming
>>
itt: notebook jockeys
>>
>>101578485
What can it do right now?
>>
File: mpl.png (350 KB, 1227x978)
350 KB
350 KB PNG
>>101563706
Don't use matplotlib directly unless you're a masochist and enjoy frustration. It's a flaming pile of garbage. There are two different APIs, a Matlab-like one and an object-oriented one. But the OO one also looks Matlab-like, because these retards did an almost straight port and kept the Matlab-like naming in the new API, rather than doing a ground-up redesign to have something that's Pythonic and pleasant to use. Any advice you find online is likely to use a mix of the two APIs, sometimes within the same post. And it's not always obvious: the APIs look similar, but are just different enough to trip you up. Because of matplotlib's evolution plus backwards compatibility, for anything you want to do, there are probably 5 ways that look like what you want but only one that will actually work and won't cause weird edge cases.
Literally anything else is less frustrating than matplotlib. Plotnine is better than matplotlib. Saving your shit to CSV and plotting it from R with ggplot2 is better than matplotlib. Getting fucked with a rusty cactus while listening to Imagine Dragons is better than matplotlib. I hate matplotlib.
>>
>>101564529
It's the only language that looks like it was designed with humans in mind, the syntax is easy and beginner-friendly, people only hate on Python because it's popular and they want to feel like contrarians/hipsters
>>
File: mongodb_100213.png (142 KB, 460x272)
142 KB
142 KB PNG
>>101563706
I might try python when it doesn't care about spaces. Will stick with perl in the mean time.
>>
>>101580828
Programming languages are designed for humans
Except Python was designed for subhumans by subhumans
>>
File: brainlet.png (75 KB, 645x729)
75 KB
75 KB PNG
>>101580828
All languages, except for bytecode and native machine code, were designed with humans in mind. Python is good but let's not exaggerate. I've seen some very readable code in Kotlin, Lisp, sometimes even modern Java.
>people only hate on Python because it's popular and they want to feel like contrarians/hipsters
That part is 100% true though. The Python hate is one of the dumbest /g/ memes to date, only rivaled by the meme of making a big deal of how frugal and anti-consumerist you are by using an old ThinkPad, then buying half a dozen of them. I'd understand if the hate was coming from the Haskell magicians who want to verify as much as possible statically. I'd also understand if it was coming from the Jon Blow watching performance maniacs for whom every frame of latency is unacceptable. Both these groups make good points, even if I don't share their priorities. But the Python hate on /g/ usually comes from people who recommend languages that are like Python except worse, such as Lua or Ruby, which proves they're just braindead contrarians.
>>
>>101563706
i want to hate python, but i have to do a lot of automation and data processing and that is the only thing that is anywhere near plesant to use for it
>>
>>101563706
>chasing down type errors
Without fail, when I hear people complain about this, they ALWAYS have done the most absolutely pants-on-head retarded shit imaginable: using nested dicts instead of classes. I swear babyduck python codelets are always terrified of using classes, I suspect there’s some tutorial somewhere that’s lying to them that classes are bad and you’ll die if you use them.
>>
>>101581225
True. This is how you should write Python: https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-its-rust.html
I don't know why this guy calls it "like Rust" though, it's simply good Python practice.
>>
>>101581237
Because rust people are mentally deficient and think it invented all the best coding practices.
>>
>>101581237
@dataclasses.dataclass
class City:
name: str
zip_code: int


@dataclasses.dataclass
class Person:
name: str
city: City
age: int


def find_person(...) -> Person:

Wow so.... they reinvented java?
>>
>>101580838
>perl
opinion discarded
>>
>>101581627
Types and classes aren't a Java-only thing, retard-kun.
>>
>>101578485
What is that?
>>
>>101579184
Run a subset at matching or exceeding numba speeds
Compile to static bins

>>101585549
https://github.com/modularml/mojo
>>
>>101563706
hating a programming language. get a life
>>
>>101567707
>Saar powered Python
Try Chinese powered Python ML/NN stuff
>>
>>101563706
yeah when I find a random python tool I assume it will waste my time while trying to make it run, needing a random dependency that also needs another two, that needs one to be compiled beforehand, but the compiler needs some random library, but that library only works on loonix for whatever reason, but this specific distro doesn't have it for whatever reason, and so so so on... I just hate the dependency hell, I hate this modern "compile everything™" philosophy linux made popular nowadays between soigrammers. I don't care about this random library being gnu/open sooooors or whatever, just give me the binary thing and just make the stupid script run already.
>>
>>101585819
Why would it divert so much from python by using fn instead of def
>>
>>101581079
I don't think I've ever seen anyone on /g recommend Ruby, but I agree with everything else you just said.
>>
>>101563706
Great scripting language. Bad programming language. Simple as.

Nothing here is a problem for one-off "programs" or for very small and limited tools. I've seen it in too many oversized applications to ever trust it in production, though.
>>
>>101588665
Because of autism
>>
>>101589045
Oh there's a difference
>The fn declaration enforces type-checking and memory-safe behaviors (Rust style), while def allows no type declarations and dynamic behaviors (Python style).
>>
>>101563864
What linter are you using? I can't imagine mypy or pyright failing for anything that simple unless you explicitly forwent type hints somewhere. One gotcha people usually don't realize is that if you don't fully type a function signature, then the function body won't be type checked unless you use the flag to check untyped defs. Then if you combine mypy/pyright with pre-commit you essentially get the type safety you so desire, provided you type things properly.
>>
>>101589699
How easy is to setup a precommit on vscode to run mypy and ruff, and show output in a terminal if errors?
>>
File: 1714609429513052.jpg (96 KB, 462x542)
96 KB
96 KB JPG
>>101563706
i really really don't understand Python
it has no identity. it's a nothing language.
it seems to have all the same flaws as the much maligned JavaScript (but slower) and with none of its advantages
it does everything poorly, yet is used for ridiculous things

imagine that your task is doing heavy duty computation that is related to data, science, machine learning
what would you use? Some kinda high performance language that makes CPU go as fast as it possibly can? Some kinda math language, optimized for matrix operations and nerd shit like that?
no it's PYTHON

other languages have some kinda identity, the one thing they're known for
>C: the lingua franca of computers!
>Ruby: every object is dynamic!
>Rust: borrow checker safety and fast

and Python's identity is what? having some retarded "rules" that it doesn't even follow lol?

also I am irrationally upset by the terms:
>pythonic
>pythonista
>benevolent dictator
and i don't even understand why

i'm genuinely just more confused by its existence than enraged
>>
File: nimporter.jpg (36 KB, 989x415)
36 KB
36 KB JPG
>>101591143
>imagine that your task is doing heavy duty computation
Just write the critical parts in nim
>>
>>101563942
It's called Jai
Although Rust has all the things you've described but I guess it's le bad cause trannies and syntax (who cares)
>>
>>101591150
Every part is a critical part

if you want to make your CPU go fast at incredible hihg speed and not fuck up your memory and make it simple and pleasant, use Rust
you don't need an interpreted piece of slow shit language and you don't need a GC
>>
File: memoryleak.jpg (59 KB, 1454x395)
59 KB
59 KB JPG
>>101591165
>you don't need a GC
>>
>>101591165
If your code is fast enough simply because of how low level the language is, I would be concerned about the possibility that your code is badly written doing very inefficient things but that don't get caught because if the language's speed
>>
another reason python is shit:
most languages will let you have multiple statements in a lambda. python doesn't because it's a special fucking snowflake or something, and this makes some code more frustrating to write than it should be.
only the snake fucker nigger macaques known as pythonistas will defend this
>>
>>101591202
not Rust
>>101591214
what
>>
>>101591214
>>101591919
I mean, It's a dumb point but with python if something gets very slow you know you're doing something wrong and find a more efficient algorithm, whereas if your c program performs "good enough" you might not look further into ways to torture the machine less
>>
>>101591974
if "good enough" really is good enough, then ... good
>>
File: kita_question.jpg (41 KB, 621x695)
41 KB
41 KB JPG
>>101563706
Am I being retarded by thinking that you should not use Python if you require typing ?
>>
>>101563942
Zig is literally that. even advertised as such
personally I don't like C though, its harder to write maintainable programs as complexity grows and don't care about gc, so Haskell or Elixir is usually my go to for almost everything. you can always write a component in C if manual memory management is needed and make native calls
>>
>>101569596
>x if p else y
this is infuriating. Why not do it like everyone else?
 if p then x else y 
>>
>>101572532
>absolute state of this retard
get back to doing the needful saar
>>
>>101591165
>rust
into the trash
>>
>>101566347
>Everything is a class
Yeah, no please keep it.
>>
>>101578485
It's a grift. If you want to use a Python library it doesn't call it itself. It goes:
>Mojo > Python > Whatever language the library is ran in. It's not a superset of Python in the way C++ is a superset of C. There is no interoperability with Python libraries, it just makes Python calls from Mojo.
>>
>>101589699
>forwent
New word learned today
>>
>>101592694
>everything is a file
AAAAAAHHH NO SO SCARY!!!!!
>>
File: .jpg (55 KB, 886x499)
55 KB
55 KB JPG
>>101563706
It's unironically a good distribution system for C and C++ libraries. Like say I want to whip up a simple program for batch image modification with OpenCV, or a simple GUI with Qt, then share it with a Windows-using colleague. I could spend an entire day fucking with CMake so that I get that shit to build both on Linux with GCC and on Windows with Visual Studio... oooor I could just tell him to pip install opencv-python/PySide6 and run my Python script.
>>
>>101593195
>oooor I could just tell him to pip install opencv-python/PySide6 and run my Python script.
Or you can also give him a pipx install, he just needs to install pipx, and it automatically creates an isolated install. But you have to know how to make a proper setup.py which is not that hard. I've been packaging and instructing people to install my programs this way lately. I myself just pipx install stuff from my github
>>
File: 1662285661372013.png (70 KB, 676x676)
70 KB
70 KB PNG
>>101591143
>all the same flaws as the much maligned JavaScript
Not really. JavaScript has a ton of bizarre "dark corners", like its implicit type conversion and a prototype-based object system which is so inconvenient to use that people built a regular class-based object system on top anyway, so now you have to cope with both.
>machine learning
>Some kinda high performance language that makes CPU go as fast as it possibly can?
It doesn't really matter at all for machine learning research.
>but slower
Absolutely true. Support HPy. We need a situation in which "Python" is just a language definition and multiple implementations can compete fairly, rather than a situation in which there's one official blessed implementation.
>>
>>101591214
I like Python but this is just a weak excuse lol. I've had more than 100x speedups rewriting algorithms from a Python prototype to a C final version. Yes it's just a constant factor rather than an asymptotic speedup, but constant factors still matter when they're so big.
>>
>>101563942
>a language which is C + some syntactical sugar and some decent generic/ dynamic data structures and a decent string implementation
That's literally Zig. It's designed as a better C, without the advanced features of Rust or C++.
>>
>>101591458
def my_function(a):
def my_lambda(x):
do_stuff(x)
do_other_stuff(x)
call_something(a, my_lambda)

Wow, that was so hard. Definitely not just a retard-tier excuse.
>>
>>101563706
For me its:
>lack of typing
python libs sometimes have really awful docs. i dont know how people are supposed to understand how to use methods or what arguments are supposed to do without good docs outside of just reading the code which always sucks

>packaging
fuck pip, fuck setuptools, fuck poetry, fuck it all its all garbage
>>
>>101593195
>ooor I could just tell him to pip install opencv-python/PySide6 and run my Python scrip
I'm confused as to why you would do this instead of use your OS' package manager? Surely thre's a libopencv or something? Its not like the pip package uploaders didn't use CMake or whatever build tool opencv uses to compile it.
>>
File: file.png (25 KB, 344x148)
25 KB
25 KB PNG
>>101588665
>>101589045
Read more than 2 lines you dip, you can do/have both
def for compatibility, fn to enforce types at compiler level

>>101592765
>They are not porting the entire ecosystem!!
Interop means that you can use libraries by calling functions and passing objects as if it was the same language i.e. without FFI, did you expect them to port the entire ecosystem?
>>
>>101585819
>no classes
wow it’s complete garbage
>unsafe pointers
wow it’s still complete garbage
>>
>>101594072
classes are coming, language is work in progress you triplefaggot
>>
>>101594120
It shouldn’t have shipped at all without them. There’s going to be a codebase doing all sorts of awful shit to get around the ‘no classes’ problems and no one will ever bother to fix it. They literally failed at initial release.
>>
>>101594166
They literally did not release GA 1.0 yet, there's only nightly builds to gather feedback
>>
>>101593585
>Surely thre's a libopencv or something?
Yeah, there is, but the problems start when you want to share code with people who use different distros or OSes. For example, despite Qt being cross-platform, last time I tried to port a Qt program from Linux to Windows (Visual Studio), the CMake config needed many hours of tweaking before that shit finally started working. Windows is just too much of a special snowflake to use pkg-config, so I needed to use the Qt installer, which downloaded many gigabytes, then manually tweak the paths.
On the other hand, with Python it just werks. One pip install and you have Qt, because the Python packagers have already done the work for you to whip Windows into shape. If you'd prefer to try things out locally in one directory, because you're not sure you actually like the C++ library and you don't want it installed system-wide, that's trivial with virtualenv as well.
>>
>>101593849
You're still just using normal Python, but with extra steps. You would only use Python if you want to use a Python library, because the language itself is utter garbage. Mojo's big spiel was you use the same libraries etc but you get increased speed. In reality that is a complete lie. You get python with extra steps and another language bolted onto the side with similar syntax. There is no reason to ever use Mojo (which is a closed source walled garden) outside using any other fast compiled language with a GC and make Python calls as and when you need it.
>>
>>101594442
over using any*
>>
>>101563706
I fucking hate python but my coworker doesn't know any other language so Im forced to take his shitty programs that are just solid code blocks of feces written in python with no comments, functions, or intuitive variable names and decrypt them to either integrate into one of python's shitty GUI libraries or take the time to translate to .net or java. So many times I just have to resort to the latter because python libraries can't help but be built with crayons and duct tape and GUI of any size beyond 100 lines become cancer without things like proper concurrency.
>>
>>101593416
why does everyone complain about javascript's implicit type conversion?
all dynamic languages have that
(and C, lol)
Python too
>a prototype-based object system
i still don't really get it, but class system didn't solve shit, it's just a different way to write the same thing and they're both using inheritance. Inheritance is bad
>It doesn't really matter at all for machine learning research
machine learning is all about processing an absolute fuck ton of data. why wouldn't you want more performance?
>"Python" is just a language definition
i don't like the syntax either. fuck indents!!!
>>
>>101593416
>We need a situation in which "Python" is just a language definition and multiple implementations can compete fairly, rather than a situation in which there's one official blessed implementation.
aka
>We need to recreate the compiler hells of C/C++
>>
>>101594684
>machine learning is all about processing an absolute fuck ton of data. why wouldn't you want more performance?
I remember reading some Go dev talking about Python ML freaks being shocked at how fast Go could process a whopping 1GB of data. These gay scripting languages are already dying as people realize they were just launched to popularity by bootcamp grifting scams
>>
>>101594442
>There is no reason to ever use Mojo
Faster than numba and numpy, static compilation, types can be enforced via the compiler
>closed source walled garden
stdlib has been OSS since april
>>
>>101581079
ruby is python++ and your a moron



[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.