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


Thread archived.
You cannot reply anymore.



File: c.png (23 KB, 1200x1200)
23 KB
23 KB PNG
>>
>>71355260
I see
>>
>>71355260
b-but anon, I am learning Python. Do I need to go all over again with C ?
>>
>>71355305
people on /g/ shit on python a lot but never really explain why
>>
>>71355314
basically because its slow when you want to do anything more than your 1 line hello world script
people use it for data science and shit because its easy to use, but it's still terribly inefficient
>>
>>71355322
Wrong. You have two options: write shit in C, fast but takes more time to get working shit or write shit in Python: almost as fast as C because Numpy, numba, pandas etc all written in C, and you can get your shit done in minutes.

Pick your poison gentleman
>>
>>71355420
this is simply an inane and retarded comment
>>
>>71355420
python is like dropping a ball into a fucking pachinko
>>
>>71355260
What if you take C and make a language and call it, say, C++? Still C, right?
>>
>>71355437
>>71355448
Alright you masochists, give me your C program which can open 10 GB of CSV file with 10,000 column, 1,000,000 rows and does a spearman correlation among these.

My Python code written in a second is:
df = pd.read_csv(file.csv)
corr = df.corr()

Literally takes a second to compute the results too.
>>
>>71355504
read >>71355322
specifically
>people use it for data science and shit because its easy to use, but it's still terribly inefficient
also you can do that in C with the stdlib and gain a ton of efficiency over your "pandas" library (which is inevitably bloat)
>>
>>71355518
Show the code or shut up. Then compare performance.
>>
>>71355535
https://ideone.com/mSCgPM
>>
File: 1560162699.jpg (20 KB, 458x550)
20 KB
20 KB JPG
>>71355260
ftfy
>>
>>71355322
Jokes on you, all the data science parts are written in C.

>>71355314
Python is great as a scripting language for doing shit with files and strings, and as a wrapper around a BLAS and other compute heavy stuff written in C. Python sucks in a vacuum because it has some really fucking retarded design decisions that kill it's ability to do anything interesting that doesn't rely on separate C modules. For example, there are no primitive datatypes, everything is boxed including things like ints. That means if you have code that repeatedly modifies an int (like summing an array), the int won't end up in the cache, instead the box around it will, and each write to the int requires a pointer to be followed into main memory rather than just updating it locally. Another stupid decision is the global interpreter lock, which precludes any meaningful form of concurrency as only one thread can actually be in the interpreter at a time. Python is filled to the brim with shit like this where they sacrificed functionality and performance for ease of use in a way that poses a real problem to programmers looking to solve everyday problems.
>>
>>71355594
>data science parts are written in C
I'm so tired of you jokesters implying that because you're using a C library you will get anywhere near the efficiency of plain C
>>
>>71355594
You can use multiprocessing rather then multithreading to get rid of GIL though
>>
>>71355603
Have you actually benchnarked it?
On my machine numpy matmul takes 8% longer than just calling the BLAS directly. Python is basically relegated to passing pointers around and 90% of the execution time is spent in compiled C.

>>71355624
True, but there is probably a way structure the interpreter to allow for normal multithreading but they chose not to do it and instead have people work around the GIL by starting multiple copies of the interpreter. That said I don't actually know a whole lot about the python interpreter, so maybe there is some compelling reason that I'm not aware of.
>>
>>71355260
https://www.youtube.com/watch?v=uNjxe8ShM-8
The only language you'll ever need.
>>
>>71355674
Yeah you're right. Its basically an ancient decision by Guido fucker to have a single interpreter thread and they were too lazy to rewrite the whole thing to fix that. Idk why do they still suck his cock in 2019
>>
>>71355504
You do know that you can use external libraries and wrappers in any language, right? It's not exclusive to Python.
>>
>>71355260

That's a letter, not a language.
>>
>>71355683
*if you are a nigger.
>>
>>71355260
unny
>>
File: retard.jpg (40 KB, 600x485)
40 KB
40 KB JPG
>>71356159
hee hee hoo hoo
>>
>>71356178
say that to companies that use excel for everything
>>
>>71355260
C set us back decades.
>>
File: Sakura_Nene_CPP.jpg (111 KB, 1280x720)
111 KB
111 KB JPG
>>71355504
no answer 5 hours later
poor Cniles are probably busy reinventing basic data structures for 1000th time just to answer this question
>>
>>71355260
You appear to be missing a ++.
>>
>>71355260
In a perfect world, yes. C is immaculate, but people are not. That is why other languages exist, because people suck at coding. Badly.
>>
>>71357522
What? Are they retarded?
>>
>>71355260
Needs destructors.
>>
The only tool you'll ever need.
>>
>>71357542
C got us out of the computational stone age. It was the first civilized language.
>>
>>71360006
Retard, C set us back decades.
>>
Fuck C. Lisp is life.
>>
>>71357542
you have no fucking clue what you're talking about.
>>
>>71360034
Without C we'd still be sorting punchcards to feed into relay machines the size of a bus.
>>
>>71360100
Forth, Lisp and ML already existed prior to C.
>>
>>71360134
And they were all dead ends. Even today they're going nowhere.
>>
>>71360169
Today their evolution all the best options for their respective problem domains. This is why I say C set us back - it outright retarded progress.
>>
>>71355305
Python first, that's great.
Then C.
>>
>>71355260
how can i do web development using c?
>>
>>71360169
>dead ends
Forth -> Interpress -> Postscript -> PDF
so everytime you read or print a PDF file, you are using a stack based programming language that had its ancient roots in FORTH.
>>
>>71355305
>python

LOOOOOOOOOOOOOOOL
>>
how hard is it to develop a GUI in C?
total noob here.
>>
>>71360844
Open sockets and serve your HTML, how else?
>>
>>71362399
Depends, can be easy or hard depending on what you're using.
>>
File: file.png (66 KB, 756x651)
66 KB
66 KB PNG
>>71362507
for instance how hard is it to produce something similar?
>>
>>71362534
Not too hard with certain libraries since it's just generic UI elements with different colours



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.