[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 345
Thread images: 29

File: final-fantasy-20091005090019998.jpg (115KB, 400x298px) Image search: [Google]
final-fantasy-20091005090019998.jpg
115KB, 400x298px
Retro video games development edition

Back when you couldn't just be an Unity-monkey

Old: >>52282853
>>
first for python
>>
>>52286997
Fuck off to >>>/vg/abdg and stop creating threads before the bump limit.
>>
File: W1TeV1R.gif (628KB, 500x332px) Image search: [Google]
W1TeV1R.gif
628KB, 500x332px
It's time to ask your beloved programming literate anything.
>>
>>52287051
>>>/vg/agdg
I mean.
>>
>>52287040
>Python is not significantly slower than Java

>http://benchmarksgame.alioth.debian.org/u64q/python.html
>>
raw opengl masterrace
>>
>>52287061
Can you into writing ASM that runs on the NES?
>>
>>52287051
>>52287066
b-but I don't like unityfags anon-san
>>
>>52287067
good grief
>>
File: trap programmer.png (1MB, 1702x2471px) Image search: [Google]
trap programmer.png
1MB, 1702x2471px
Daily reminder that if you don't program while dressed like a schoolgirl, you don't belong on /dpt/.

You can redeem yourself by buying a schoolgirl outfit and a copy of The C Programming Language (2nd Edition) by Kernighan and Ritchie, preferably in the same amazon cart.
>>
>>52287184
fuck off bender
>>
>tfw Unitydev

At least i have my game on Steam, that's something
>>
File: ughhh.jpg (53KB, 1280x720px) Image search: [Google]
ughhh.jpg
53KB, 1280x720px
>tfw you want to make a game but you can't draw for shit
>>
>>52287220
hire an artist
bonus: dont pay them
>>
>>52287239
(assuming you live in america and do it before sanders gets elected)
>>
>>52287220
is this the sole picture you have ? stop posting that every thread.
>>
>>52287275
what, is sanders going to make working over the internet illegal or something?
>>
>>52287275
what are his policies? does he have a shot at beating cliton or is he just a meme?
>>
File: Kawaii_7585be_5428960.gif (119KB, 400x450px) Image search: [Google]
Kawaii_7585be_5428960.gif
119KB, 400x450px
>>52287070
Yes but nes ISA is shit.

>>52287220
http://www.ctrlpaint.com/
>>
File: 1 copy.jpg (21KB, 206x300px) Image search: [Google]
1 copy.jpg
21KB, 206x300px
"Be sure to read your SICP." 'SICP'? A crummy commercial?
>>
>>52286950

It seems YouCompleteMe was hiding eclim's completions even though I followed their config instructions to have them work together.

Can someone recommend me another vim plugin that will open the completion list as I type that wont fuck it up?
>>
>>52287313
>http://www.ctrlpaint.com/
looks cool, thanks anon
>>
>>52287204
link?
>>
>>52287353
http://store.steampowered.com/app/405960

I posted it here like a week ago, people seemed to like it
>>
>>52287220
start by making game with free arts, commercially successful games have been made like that.

http://opengameart.org/
https://forums.tigsource.com/index.php?board=24.0
>>
File: Denzi100225-4.png (58KB, 976x800px) Image search: [Google]
Denzi100225-4.png
58KB, 976x800px
>>52287220
Just get some free sprites

http://www3.wind.ne.jp/DENZI/diary/
>>
Why is not ok to say something like "if there's a black history month why isn't there a white history month?"?

Is the implication that white people don't need it?
>>
>>52286997
>>52287061
>>52287184
>edition
>transvestite
>faggot doing AMA
>>>/reddit/
>>
>>52287434
because white history month is all other months.
>>
>>52287434
The implication is that blacks have very little history, whereas the entire world history is centred around white Europeans, Eurasians and Eastern asians.
>>
>>52287434
It's just racism, plain and simple.
Black people will tell you that racism against white people doesn't exist and not realize the irony in doing so.
Also, the fact that white people aren't really allowed to have their own culture in of itself speaks more about white people than anything else.
>>
>>52287467
*own culture anymore
>>
>>52287290
he'll force you to pay someone $15 to so much as smile at you

>>52287292
free everything
>>
>>52287457
>>52287467
give me the name of a famous black computer scientist.
>>
>>52287487
I'd love to get paid $15 to smile at you while spitting in your mocca fellapuchino
>>
>>52287467
What are you talking about? Don't whites have country music and line dancing anymore?
>>
>>52287434
>Is the implication that white people don't need it?
Yes.
>>
>>52287499
That's american culture.

I'm mostly talking about young people and how they've pretty much embraced every other culture other than their own.
>>
>>52287516
The culture which one embraces IS one's own culture.
>>
>>52287434
>Is the implication that white people don't need it?
Actually, we don't. We don't need parades or a month dedicated to how awesome we are. We already know we're #1, you couldn't even fit all the white accomplishments in a month anyways.
>>
>>52287540
Bullshit
>>
>>52287540
If a weeb worships japan and only enjoys things that comes from japan, is that still his culture?
>>
I need logic help

let's create a simple betting game

you can spend between 1-100 dollars on a round
you have these three types of peices
green chips - costs 1 dollar
blue chips - costs 2 dollars
red chips - costs 3 dollars

you can buy whatever chips you want.

however you don't know the effect of the chips, you think that sure, the more red chips you buy the better off you are but you don't know the multiplier - perhaps it's only twice what the green chips yield in the same value

luckily I have 10,000 round results with random amounts of the different chips

I can tell you how much was spent each round

but how could you solve such a problem?

the actual problem I need to solve is even more complex than this but I simplified things
>>
>>52287559
Dude, this is unsolvable...
>>
>>52287558
That's his culture as he chooses to join that culture.
>>
>>52287558
Sure.
>>
>>52287558
nope
his culture is his original one (unwanted, during childhood), mixed with the one he wants
and that's better like that, so he can have a different view when he encounters the culture he likes, and so modifying that culture
>>
>>52287559
Where is the actual bet in the game?
>>
>>52287559
I still don't understand the spec. It feels like it's missing the idea about the multiplier.
>>
>>52287549
Nope.
>>
>>52287559
don't get the purpose
what does motivate the algorithm?
analyzing 10.000 rounds with probabilistic AI?
>>
File: 1451764605927.jpg (168KB, 1280x720px) Image search: [Google]
1451764605927.jpg
168KB, 1280x720px
Why does learning OpenGL have to be so hard?
Why is every tutorial so shit?
I just want to draw some rotating triangles...
>>
>>52287467
>the fact that white people aren't really allowed to have their own culture
because white culture is kkk, lynching, segregation, slavery, pedophilia, genocide, hitler, ... white culture is being replaced for good reasons, trust me.
>>
>>52287600
I sortof forgot that, I don't think it changes things though

lets say the chips increase your chance of "winning", getting a return of 150% on your investment each round

really this is looking at CSGO rounds mathematically.

you can spend 8000 dollars on a full buy or nothing. you can win the round either way.

but there is going to be a linear relationship between the amount of money spent and your chance of winning the round. I have already successfully parsed all that data, I have about 5000 rounds sitting around.

see this problem is incredibly complex, what you should buy, since you have to think what causes a win in the first place. But we don't have to know how the exact probability increases if I buy an awp or not. Just that it does, in a linear fashion.


So here I am trying to decide what the best way to conduct my analysis is going to run on. Because the goal is to say: ok you have 2700 dollars and an ak an kevlar. buy a flashbang, an HE, and a helmet to have the best chance of winning the round.

see the money is linear, right? but we don't know the probability.
>>
>>52287671
Because OpenGL is full of traps.
>>
>>52287684
>only white people can be racist
my little anon can't be this retarded
>>
>>52287671
>opengl
>hard
>>
>>52287671
http://antongerdelan.net/opengl/
>>
File: Jerry_J Sussmanjpg.jpg (29KB, 618x300px) Image search: [Google]
Jerry_J Sussmanjpg.jpg
29KB, 618x300px
>>52287671
Hmm, it shouldn't be that difficult. Tell me, have you read your SICP today?
>>
>>52287067
One's a programming language and one's a scripting language, what do you expect?
>>
>>52287699
haven't said that but racism takes a large part in the the white culture (same for japanese)
>>
File: trap kornheiser.jpg (63KB, 430x534px) Image search: [Google]
trap kornheiser.jpg
63KB, 430x534px
>>52287694
Traps, you say?
>>
>>52287559
On the most basic level, each of the results you find which color 'wins'.

Average the results
Take the average, and each case where a certain color was a higher percentage than the other two and the result was higher than average, give it a 'point'.

Color with the most points wins, you can sort of determine which color is the best to choose.

You can get way more in depth with some statistical formulas, taking into account standard deviations from the average score and by how much above or below the average result is, as well as factoring in percentages of the colors used per round.

Having typed all of this, I just realized that you don't know how many of each color was used each round.

Problem unsolvable, no way to analyze colors as a factor, other than if the amount spent was 1 or 2 dollars.
>>
>>52287725
this is bullshit

white people are the least racist
white people invented "all races are equal" etc bulllshit
>>
>>52287725
Pretty sure this is bait, sounds like a false flag straight out of /pol/.
>>
>>52287693
Where did you get your data?

In a normal game the loadout isn't really randomly picked.
People have their standard loadouts that they are comfortable with and will take those.

Also what about all the other variables?
One player may be used much more with generally less efficient weapons, or different maps favour different loadouts, etc.
>>
>>52287671
Because Windows has shit support for OpenGL context.
>>
>>52287796
I'm on linux tho...
>>
>>52287759
>thinking White people are less racist than asians
>>
>>52287740
Yes traps.
>>
ITT https://www.youtube.com/watch?v=xdyin6uipy4
>>
>>52287759
>white people are the least racist

Wtf??
>>
Why haven't you learned underwater programming?
It pays 3x more than regular programming.

no whiteys allowed
>>
>>52287559
>luckily I have 10,000 round results with random amounts of the different chips
>I can tell you how much was spent each round
>but how could you solve such a problem?
I would start by looking at amount spent : number of chips played.
If you can find certain combinations you can solve it directly.
For example 1 dollar spent : 1 chip played = can only have been the green chip, green multiplier = result.
4 dollars spent : 2 chips played = can only have been 2 blue chips, blue multiplier = result / 2.
So basically: Enumerate all possible ways to add up to amount spent using the chips and see if you find any unique matches.
>>
>>52287494
That black guy who made Linux for Niggers
>>
>>52287802
Asian countries are literally the most xenophobic, second only to the Middle East and some African countries.
>>
File: Capture.png (279KB, 1916x1039px) Image search: [Google]
Capture.png
279KB, 1916x1039px
>>52287757
yeah this is helpful, that's exactly right

I suppose it's not actually important to find the precise percentages

>>52287795
all of this can be controlled for fairly easily.
this is the three sources I have, and I can go between platforms fairly easily with a CSV file

Basically this analysis treats the players like AI, in a lot of ways
>>
File: 1424225338538.jpg (181KB, 454x674px) Image search: [Google]
1424225338538.jpg
181KB, 454x674px
Whats the easiest way to get a C compiler for my architecture? i can't write a compiler, I'm already busy with the assembler, linker, and machine.
I don't want to learn Clangs backend API because it's C++ and it looks like a clusterfuck and I hate C++ code, can i get away with translating LLVM bytecode to my assembler language? are there any libraries that parse LLVM bytecode to an in memory format or will i have to do that too?
I really just want a C compiler, I want to focus mainly on developing the VM, assembler, and linker. Compiler is too much for me to handle.
I want a compiler that fully supports C11 and has competent optimization, so no garbage like lcc.
>>
>>52287819
It's fucking true you idiot
You know there are still fucking african tribes hunting albinos so that they can eat them to gain their magic powers? You know there is plenty of racially motivated anti-white crime in South Africa? You know 90% of what the left does is just hating on white people? You know white people are being displaced from nearly every western country?
>>
>>52287862
honestly, I can't think of any non-white culture that thinks highly of white people
>>
>>52287864
>I suppose it's not actually important to find the precise percentages
Actually, if you want to do a proper statistical analysis, it very much is.

That being said, you're talking about getting into some college-level actuarial stuff, so...
>>
>>52287866
sudo apt-get install gcc
>>
/g/. everyone
>>
>>52287870
>honestly, I can't think of any non-white culture that thinks highly of white people
You haven't been to any African refugee camps then, obviously. They actually distrust black/native workers and accuse them of stealing the food for themselves and being corrupt, and only trust whites to actually distribute food fairly and evenly.
>>
>>52287881
I don't feel that suicidal, so no, I'm not writing a backend for GCC.
>>
>>52287866
If you don't have a compiler, what are you using to make executables for your architecture?
>>
>>52287759
>white people are the least racist
yes, it's the blacks, the native americans, the incas, ... who have colonized, mass killed, enslaved the white peoples, amiright ?
>>
>>52287901
>you haven't been to any African refugee camps
Of course not...
>>
>>52287918
>Of course not...
Well, of course maybe on this board, silly me... I forgot where I was.

But jokes aside, I have two friends (one of them my ex) that went to Africa for two years to work with Doctors Without Borders in my circle of friends, and my sister visited a camp for a couple of days when she was studying.
>>
File: WarlikeHappyLabradorretriever.webm (304KB, 414x422px) Image search: [Google]
WarlikeHappyLabradorretriever.webm
304KB, 414x422px
I'm going to make project Euler solutions in a GUI application for fun.

What are you programming for fun today, anon?
>>
>>52287912
every race in history has colonised, mass killed, genocided, enslaved, etc.

white people were just the most successful race

i'd rather be a black slave for a white man during the slave trade than a white slave working for any black man in the past 10000 years
>>
>>52287910
My assembler and linker run on my host machine.
Assembler code -> assembler -> own object format -> linker -> flat binary -> VM
I don't have an OS on the VM, so ofcourse i have no assembler or linker actually on it either.
All i need is a C compiler that runs on the host and produces assembler code for my architecture, then i just feed that into the chain above.
>>
>>52287912
That has nothing to do with the race.
If the native Americans were white it would have still happened.
>>
>>52287866
>C11 and has competent optimization
>so no garbage like lcc.
gcc and clang are your only options.
>>
>>52287945
If the native Americans were white, they would have had an advanced society established by the time we got here.
>>
>>52287945
>If the native Americans were white it would have still happened.
This

Vikings went on raids throughout Europe and Russia and took slaves wherever they went and then sold them to Arabs in Constantinopel.
>>
Where do you think the word slave even comes from?
From slavic.

>inb4 slavs arent white
>>
>>52287880
my major is applied math, luckily ;)
econ, particularly

however I meant that you don't need to... well ok lets look at it. you're right, I think. Every peice needs to be weighed against the probability of winning, balanced in order to set priorities.
The chip problem is solvable by isolation of the determining factor

if you look at all the instances where green == red and note the number of blues vs the chance of winning you can get the amount it increases your odds by, if you control for the other two.
It's fuzzy in my brain but I think it'd be doable with some trial and error.
>>
>>52287958
Advanced societies form when it is tough to live solely off the land. If it is easy to live off the land, there is no need to start farming or buildings to live in and work in.
>>
>>52287955
Clang it is, so the easiest option would be to translate LLVM bytecode then.
Also, is there a library that parse the bytecode into an in-memory format?
>>
i want to select the top 20 entries from the json at the bottom that i retrieve from the server; however, my code selects 20 entries from the dict at random. how do i get it to just werk? also, the json data is in the correct order. the iterating just doesn't preserve order.

while True:
r = requests.get("apilink")
rjson = r.json()
x = []
i = 0
for key, value in rjson['attacknews'].iteritems():
print(key)
if i < 20:
for key, value in rjson['attacknews'][key].iteritems():
if len(str(value).split("</a>")) > 1:
x.append(str(re.sub(r"</?a(|\s+[^>]+)>", '', value)))
i += 1
print("\n".join(x))
time.sleep(1.5)


{
"category": {
"180109314": {
"timestamp": 1452170695,
"entry-that-i-need": "string with useful info"
},
>>
What is the highest level math I should know to be good at programming/compsci?
>>
>>52287981
You're right, anon, what I posted was extremely vapid and simplified the advancement of societies.

To add, another detriment is lack of free trade with other technologically advanced societies. All of Europe and Asia were able to learn from each other's advancements due to proximity.
>>
>>52287994
what does "good" mean?
>>
>>52287944
You do know that you can make both gcc and clang spit out assembly, right? Just make them compile for some really reduced (but similar) instruction set, and then make an assembly translator that translates between that instruction set and your own.

I guess you could write your own back-end, but I don't see why you would do something as complicated as that if you could just parse a text file and do simple substitutions, provided that the instruction set is similar enough.
>>
>>52288011
"Put an end once for all to this discussion of what a good man should be, and be one."
>>
>>52287959
and now 10% of sweden population are made of immigrants. sweet karma.
>>
Does postgresql use the same query syntax as MySQL? I've tried my hardest but I can't get mysql to work with Sinatra (ruby web thing), so I'm stuck with PSQL which I've never used b4.
>>
>>52287220
>>tfw you want to make a game but you can't draw for shit
start your work ethic off by making a 5 minute RPG maker game every morning, until you have established a real work ethic, then start making real games, and just make friends with an artist. Stop being a NEET faggot.
>>
>>52288017
Most of the vikings were not raiders though. We were farmers, fishers and traders. Saying that vikings were violent raiders, rapist and murderers is like saying that the Roman Empire was all about military conquest and nothing more.
>>
>>52288015
I guess i could do that, I'd rather avoid parsing text though, I've had enough of that from my assembler.
Would translating some text assembly for another architecture really be easier than translating LLVM bytecode?
>>
>>52288024
>Does postgresql use the same query syntax as MySQL?
They both use SQL

Postgres uses a dialect of SQL though, that supports stuff like procedures.
>>
>>52288030
But that's literally what Vikings were.
The ones that went out to sea.
Not the retards they left at home.
>>
>>52288033
>Would translating some text assembly for another architecture really be easier than translating LLVM bytecode?
You need to make that call yourself. I know nothing about your architecture.
>>
>>52287990
Dicts don't preveserve order
http://stackoverflow.com/questions/6921699/can-i-get-json-to-load-into-an-ordereddict-in-python
>>
>>52288050
>But that's literally what Vikings were.
It's not

>The ones that went out to sea.
They established trade routes all over the known world. They were 80% traders, 15% explorers and 2% violent raiders and 3% mercenaries.

>Not the retards they left at home.
They all went home. It was uncommon for one single viking to do more than one such raid during his entire life, as one raid would provide riches and slaves to last a life-time in viking-age Scandinavia.
>>
>>52288011
well what does good mean to you? To me it means you know what you're doing and you're doing a quality job.
>>
>>52288078
>we wuz good vikings
>we dindu nuffin wrong
>they wus peaceful protests
>>
>White people are literally the reason racism exists
>Hurr white people are the least racist
>>
>>52288116
The bad reputation the viking got was christian slander. Those half-jews in southern europe couldn't handle the fact that we were awesome and fucked all their pretty girls, and took the most prettiest with us home to have as our own personal sex slaves, and the brits couldn't handle the fact that we conquered Britain and it were under viking control until a Frankish (as in fucking frog) kicked us out.
>>
>>52288130
>fishing this hard with such shit bait
>>
File: bait.jpg (39KB, 736x849px) Image search: [Google]
bait.jpg
39KB, 736x849px
>>52288130
you can stop anytime you like
>>
>>52288140
>>52288141
Why do people reply to what they think is bait?
>>
>>52288130
>>White people are literally the reason racism exists
>blaming the victim
Not our fault shitskins and niggers both hate us and want to be us
>>
>>52288134
https://en.wikipedia.org/wiki/Harrying_of_the_North
>>
>>52288145
Anon has to know his bait is shit so he can improve it and next time make it decent.
>>
>>52288134
God, are you some fedora-wearing neo-pagan?
>>
Anyone here using LibGDX?
>>
File: backtov.png (167KB, 709x636px) Image search: [Google]
backtov.png
167KB, 709x636px
>>52286997
Fuck off child
>>
>>52288161
>implying /v/ even knows or even plays games made before the xbox
>>
>>52288151
No, I just paid attention in history class instead of watching some lame TV series.

>Perceived views of the Vikings as alternatively violent, piratical heathens or as intrepid adventurers owe much to conflicting varieties of the modern Viking myth that had taken shape by the early 20th century. Current popular representations of the Vikings are typically based on cultural clichés and stereotypes, complicating modern appreciation of the Viking legacy.

https://en.wikipedia.org/wiki/Vikings

https://en.wikipedia.org/wiki/Trade_during_the_Viking_Age
https://en.wikipedia.org/wiki/Viking_expansion
>>
>>52288171
/vr/ is equally shit
>>
>>52288180
I don't know.
Sperging out about this in the dpt seems pretty fedora to me.
>>
>>52288180
>history class
>vikings
m8 nobody hears about you
>>
>>52288182
Hell no, /vr/ stays on topic and any trolls/shitposting/bait gets deleted. Now, I'll admit there is currently a decline with anons constantly bitching about wanting the GBA and other 6th gen stuff on /vr/ and what no, but it's still much better than /v/.
>>
>>52287487
Fuck him for wanting artists to get paid, amirite?
>>
>>52288159
>le Java is shite meme

As though anyone on /dpt/ is actually doing anything worthwhile, instead of just shitposting irrelevant trash.
>>
>>52288217
>implying the viking age isn't a topic in scandinavian history class just like black history month is a topic in the usa

>>52288210
>sperging out
Three fourths of this dpt has been discussing why there is a "black history month" but no "white history month" and if non-whites can be racist or not. I simply pointed out that whites were enslaved too and mentioned vikings, late romans/eastern romans and arabs as an example.
>>
>>52288146
>/daily /pol/ htread/
>>
>>52288255
I really dont understand the Java meme. Its probably the stupidest shit going around here. Its 2016 and the Android market is pretty good so wtf is wrong with fucking Java!?
>>
>>52288182
>/vr/ is equally shit
/vr/ is one of the god tier boards in this shithole right now, its only succeeded by /diy/ and /tg/
>>
>>52288272
It's popular.

We don't like popular things.
>>
File: sweden.jpg (73KB, 876x493px) Image search: [Google]
sweden.jpg
73KB, 876x493px
>>52288180
yeah yeah, whatever, jamal the syrian refugee will soon puts his dick right in the kisser of your sweet daughter and permanently ruins your pure aryan gens. sweden is the next sicily.
>>
>>52288277
it's literally autistic cartridge collectors central
>>
i can't decide if i'm going to learn python or ruby after learning C. i've been going back and forth all day. help g!
>>
>>52288266
we're all /dpt/ here
doesn't matter what we talk about
>>
>>52288286
/pol/ please

>>52288210
>>52288151
>correcting misconceptions about vikings is fedora neo-pagan white supremacist shit
>being blatantly racist and saying that europe is doomed because of immigrants is not

If you're gonna shitpost, you could at least be consistent...
>>
>>52288272
Java comes bundled with adware on Windows and it doesn't have pointers so interop with other languages is pretty much impossible
>>
>>52288306
they're both complete trash and if you choose either of them i'll have no sympathy for you

t. concerned reader
>>
File: traffic-cop-stop.jpg (71KB, 480x320px) Image search: [Google]
traffic-cop-stop.jpg
71KB, 480x320px
>>52288286
Sir, do you know how many memes you were spouting?
>>
>>52288285
>We
>C is popular
>C++ is popular
>neither of these are hated

>>We
>>
>>52288311
I'm only shitting on the biggest autist in the thread.
How is that not consistent?
>>
>>52288297
collectorfags/purityfags are only an obnoxious minority that care if you buy the game physically or emulate it. /vr/ has a general dedicated to emulation. Most of /vr/ doesn't care if you have a physical copy of the game or you emulated it. Just ignore those spergs.
>>
>>52288272
A bunch of suckers read articles about vulnerabilities in the web plugin, and decided their whole opinion of the language based on the quality of shitty web applets. Despite becoming more knowledgeable they still hate on Java, using their tenkeyless mech, unusablely convoluted meme tier desktop environment configuration, overexpensive placebo headphones, etc. etc.
>>
>>52288285
Thanks. At least now i know.
>>
>>52288316
>>52288316
i need to learn at least one of them. from reading around, even if i end up doing c++ for the rest of my life, most people recommend you should choose at least one
>>
>>52288314
>interop with other languages is pretty much impossible
What the fuck are you talking about?

https://en.wikipedia.org/wiki/Java_Native_Interface
https://wiki.python.org/jython/JythonFaq/EmbeddingJython
https://gcc.gnu.org/java/papers/native++.html
https://wiki.python.org/moin/IntegratingPythonWithOtherLanguages#Java
http://jni4net.com/
http://docs.oracle.com/javase/7/docs/technotes/guides/idl/corba.html
>>
File: Kawaii_731aaa_5428960.gif (1MB, 640x360px) Image search: [Google]
Kawaii_731aaa_5428960.gif
1MB, 640x360px
>>52288182
vr is actually great, probably because the average age is way higher there.
>>
>>52288272
>>52288341
It's hard to go back to Java when you've used C#, purely from a 'writing the code' standpoint.

Java is fine, though.
>>
>>52287866
This sounds really interesting and I wish I were competent enough to help.
>>
>>52288338
>popular
C and C++ are popular in the field of systems programming and embedded programming, which is a relatively small niche.

They are popular on this board, because we like stuff that isn't generally popular.

>>52288339
>sperging out because someone called you out on being wrong about vikings
>"n-n-no u are autistic"
>>
>>52288348
But what if a third party library requires that you pass it a pointer?
>>
>>52288359
Yeah, the typical age for /vr/ is somewhere in his late 20s to 30s.

/vr/ has a massive hateboner for /g/, what did we do to them to deserve the hate again?
>>
>>52288373
They are literally two of the most used languages in general, as well as python which isn't really hated either.
>>
>>52288387
I hate python quite a lot actually. I just don't like using it though, not because of its popularity.
>>
>>52288362
I haven't done nearly as much work in C#, but the only really outstanding difference was how much better UI work is in C#, and JavaFX has improved things a lot on the Java side recently anyway.
VS == Intellij, in my opinion anyway, so C# doesn't have the advantage of a better development environment anymore.
>>
>>52288345
why the fuck would you need to learn one of those 2? what retards have you been talking to?

what do you actually want, because learning one of those two shit stains is unlikely to help
>>
>>52288380
Java has pointers in the form of references (from Java's point of view) that are the same as pointers (from JNI's point of view). You make this bindings with JNI. It's not rocket science and all of the links includes examples, check them out.

>>52288387
>They are literally two of the most used languages in general
Legacy code are seldom popular, anon.

>as well as python which isn't really hated either.
You must be posting in an alternate reality /g/...
>>
>>52288415
>Legacy code are seldom popular, anon.
You said yourself C is used for systems and embedded programming, and C++ is used for lots of stuff (mostly muh gaymes). They are very widely used for new projects.

>You must be posting in an alternate reality /g/...
A few spergs hate python but it's not a meme to hate it.
>>
>>52288401
Why?
It's pretty comfy for quick prototypes or more involved scripts you don't want to do in bash.
>>
>scandinavian
>relevant
>>
>>52288456
If it stopped at prototypes I wouldn't have a problem. People use it for actual projects with 1000s of lines of code.
>>
>>52288452
>C++ is used for lots of stuff (mostly muh gaymes)
The market for C++ game programmers is even smaller than embedded/system programmers, anon.

First of all there are not many jobs available, and secondly there are not many people who are willing to do it for a living either. Source: 5 years experience working in three different development jobs, one as an application developer, one as an embedded developer and the last as firmware developer.
>>
>>52288468
People mostly do shit in every language.
It's a silly reason to hate it.
>>
>>52288074
I changed the code to some extent, and it works better... but not entirely; error thrown is this:
AttributeError: 'str' object has no attribute 'iteritems'

but how do i properly turn the ordered dump in string to an ordered dict? a dict would lose order all over again...

while True:
r = requests.get("apilink")
rjson = json.dumps(r.json()['relevantkey'], sort_keys=True,)
x = []
i = 0
for key, value in rjson.iteritems():
print(key)
if i < 20:
for key, value in rjson[key]['keythatineed']:
if len(str(value).split("</a>")) > 1:
x.append(str(re.sub(r"</?a(|\s+[^>]+)>", '', value)))
i += 1
print("\n".join(x))
time.sleep(1.5)
>>
>>52288502
I don't like the language itself that much either.
>>
>>52288502
>>52288456
>le python is a prototyping language meme
This meme is even more harmful than just not liking Python.
>>
>>52288532
What are you on about?
>>
Challenge time /g/

Make a program to choose and play a random song either from youtube or your music collection.
>>
>>52288502
There are legitimate criticisms of Python though. It is incredibly slow by programming language standards. It's probably actually the slowest programming language in widespread usage. The whitespace syntax throws many people off, since the most widely used programming languages all use "{}" and ";", and it can hide subtle errors with no indication. Everything is an Object hides the real value of OO programming.

It's a good jumping in point for programming, but that's about it.
>>
>>52288542
Lurk more

It's a common misconception on /g/ that Python is only suitable for prototyping stuff. It is one on the most mature scripting environments out there with libraries and frameworks to do anything from heavy number crunching and video analysis to full-fledged web frameworks, and the only reason /g/ still holds on to this myth is because they somehow think that Python is just another Perl.
>>
>>52288580
Perl is great though.
>>
>>52288562
find $MUSIC_DIR | shuf -n 1 | xargs -d "\n" mpv
>>
>>52288580
No, see here
>>52288592

Perl - Good
Python - Shit

Understand?
>>
>>52288580
I see perl more as an "awk on steroids" not a prototyping language.
>>
>>52288575
>It is incredibly slow by programming language standards. It's probably actually the slowest programming language in widespread usage.
While you can argue that "hurr durr python is slow" because of how it handles concurrency (aka the dreaded interpreter lock) and secondly because it lacks a proper JIT compiler, the fact that it is widely used for number crunching should make you stop and think for a second. It's a well-known fact that any library worth anything in Python is implemented in C, and even large parts of the Python standard library is implemented in C.

>The whitespace syntax throws many people off
It really doesn't, as most people do in fact indent their code regardless of whether it is required or not from a syntactical point of view.

>and it can hide subtle errors with no indication.
Python is no more prone to scope errors than any other language, but it does not have block scope (scope is on a function namespace).

>Everything is an Object hides the real value of OO programming.
This is because you are an imperative pleb.

The "everything is an object" is actually everything are first-class citizens, even functions.
>>
>>52288592
Perl is nifty, see below.

>>52288615
And you think this because as I said earlier, /g/ hates everything popular and loves the underdogs.

>>52288625
I do too.
>>
Plebs using higher level languages. Make your own server for anything with good old assembler
>>
>>52288651
Python is only popular among people that can't program
>>
>>52288676
>t. NEET
>>
>>52288523
never mind, i got it
>>
>>52288676
>Python is only popular among people that don't enjoy making AbstractBeanFactoryBuilders or looking up the man page for wcharstrntoullpow2sqrt
>>
suck my python
>>
>>52288690
I'll take the lack of dispute as an admission of the truth
>>
>>52288714
>>52288676
FTFY
>>
>>52288714
>>52288726

Python programmers in a nutshell. Anything that isn't Python must obviously be Java or some other specific shit that embodies what I don't like.

Guess what - there are languages that aren't python that DON'T encourage the use of AbstractBeanFactoryBuilders! Surprising, I know.
>>
>>52288724
>lack of dispute
An inane claim easily refuted by the fact that many software companies not only use Python internally for scripting, but a lot of production software also use Python? Yeah, that's definitively justified and needs to be disputed.
>>
>>52288743
>t. Haskell fuccboi
>>
>>52288746
Many more software companies use Java.
Java must be a much better language, then.
>>
>>52288755
Who are you quoting?
>>
>>52287703
neat, thanks.
>>
Made some rice in my rice cooker and it smells so good omfg
>>
>>52288743
>>52288724
>>52288676
Python haters in a nutshell, avoids arguments such as >>52288640 like a plague because of their limited technical understanding
>>
>>52288755
Haskell is shit.
Python is still shit.
>>
>>52287796
How so?
Also how does that affect the difficulty of learning OpenGL?
>>
>>52288766
>Java must be a much better language, then.
Maybe it is, but that's not what I said though. I answered the claim that only people who can't program like Python, which is obviously refuted unless you're going to follow up and non-ironically claim that most software developers can't program.
>>
>>52288783
Just use something like glew and glfw
>>
>>52288778
Why are any of them shit?
>>
>>52288640
People who are using Python for number crunching obviously don't need real time performance, or their "crunching" isn't as hard as it might seem.

Sometimes code can be better formatted by breaking the usual formatting rules, if you had to do that in python, can you remember how?

Everything is an object doesn't mean everything is a first class citizen, it just means that everything runs slower.

Also, the one advantage of Python is that it is easy for new learners to pick up. This ends as soon as you start trying to do GUI work in it, which lots of learners want to do. Have fun pulling your fingernails out with tk, or trying to integrate with a GUI toolkit written in a different language. In my personal opinion, C# (I actually shudder saying this, but it's true) is a better beginner language than python. It may be more complex, but OO concepts are much easier to learn when you can explicitly see them all the time, rather than hidden behind the curtain like Python does. Yes, you can do explicit OO in Python, and you should at a certain size, but it's similar to the old "To learn C++, you must first learn C" argument.
>>
File: umaruw.webm (1MB, 1280x720px) Image search: [Google]
umaruw.webm
1MB, 1280x720px
>>52288562
Two lines in python.

import webbrowser
webbrowser.open("http://ytroulette.com/?&c=1")


dedicated to all code artisans.
>>
>>52288815
This would be what I assumed - why would anyone go lower level than glew + glfw for a graphical application?
>>
>>52288835
performance
compatibility
etc
>>
>>52288830
10/10
would hire
>>
File: 2016-01-04-233115_1440x900_scrot.png (200KB, 1440x900px) Image search: [Google]
2016-01-04-233115_1440x900_scrot.png
200KB, 1440x900px
C is the best language
>>
>>52288835
What are
>Mantle
>D3D12
>Vulkan
>>
what's the fastest language to complete this task:

>iterate through each line of a csv file (>80,000 lines)
>perform a query with that line

I'm using ruby (lol) and it is taking HOURS.
>>
>>52288883
what query?
>>
>>52288883
The language doesn't matter as much as your database/query structure.
>>
File: ternary operator choose variable.png (70KB, 1920x1080px) Image search: [Google]
ternary operator choose variable.png
70KB, 1920x1080px
C#

Is something like this possible, /g/?
>>
>>52288883
Well not python for sure

Maybe C
>>
>>52288858
What happens to the trailing Null character of the string when you only have 64 characters space? Is it ignored by a smart compiler?
Also you should probably const qualify the table.
>>
>>52288829
>People who are using Python for number crunching obviously don't need real time performance,
Most people who do number crunching don't. Number crunching != high-performance trading

>or their "crunching" isn't as hard as it might seem.
Yeah, I'm sure all the use of numpy in academia isn't "hard" at all, amirite...

>Sometimes code can be better formatted by breaking the usual formatting rules,
You're talking like Python enforces a single kind of formatting, it doesn't. The only requirement is that you are consistent, and if you format your code inconsistently you are a shit programmer desu senpai.

>Everything is an object doesn't mean everything is a first class citizen,
It does in Python's case

>it just means that everything runs slower.
Python's argument was never one about speed. If speed is your argument, then any language besides C, C++ and FORTRAN are shit. Is this really your argument?

>the one advantage of Python is that it is easy for new learners to pick up.
And a direct consequence of that is that seasoned programmers are able to cut the cost of development drastically as well.

>This ends as soon as you start trying to do GUI work in it, which lots of learners want to do
>Have fun pulling your fingernails out with tk, or trying to integrate with a GUI toolkit written in a different language.
WTF are you talking about? Do you have any experience with this at all, because it really doesn't seem like it. The GTK+ python bindings are easy-peasy, if you're familiar with GTK in any language the same concepts apply in Python. The same is also true for Qt (PyQt).... Have you actually done any GUI programming or are you just relying on winforms in C# and saying that Python is shit because it doesn't have the same?
>>
>>52288910
Nope.
>>
>>52288903
>>52288909
adding them to the database of my neo4j server
>>
>>52288918
>if speed is your argument, then any language besides C, C++ and FORTRAN are shit

This is what Python script kids actually believe
>>
>>52288829
>Have fun pulling your fingernails out with tk
What?
Tk is really nice - not much sense in not using it directly with Tcl but still it's really comfy to use.
>>
whoa
hold up senpaitachi
did i see perl love going on? you have my attention.
>>
>>52288830
>>52288562

#include <stdlib.h>
int main(void)
{
system("xdg-open http://ytroulette.com/?&c=1");
return 0;
}


Just as easy in C.
>>
>>52288829
>>52288575
>talks about how shit a language is based on the fact that they are multi-paradigm rather than single paradigm
>>
>>52288883
> what's the fastest language to complete this task:
In this case, the language is irrelevant; the queries will dwarf the language overhead.

>iterate through each line of a csv file (>80,000 lines)
>perform a query with that line
Wrong approach. Create a table with the contents of the CSV file then do one SQL query.
>>
>>52288948
we're gonna need more info anon. ruby is almost certainly not your bottleneck. show us your query and database structure.
>>
>>52288882
>Mantle
>D3D12
>Vulkan
Just use OpenGL, unless you like fucking with platform compatability/hardware independency.
But I get your point.
>>
>>52288972
hmm, i've just done some googling and it looks like no matter what language I use, it's going to take forever. sorry for the dumb question.

here is my query anyway:

CSV.foreach('ratings.csv', {headers: true}) do |row|
session.query('MATCH (u:User { userId: {user_id} }), (m:Movie { movieId: {movie_id} })
CREATE (u)-[:RATED { rating: {rating}, timestamp: {timestamp} }]->(m)',
user_id: row[0], movie_id: row[1], rating: row[2], timestamp: row[3])
end
>>
>>52288966
For learning a paradigm, arguable the most important paradigm for employable programmers, multi-paradigm is confusing. It is much easier to learn OO with Java or C# than it is with Python.
>>
>>52288974
Vulkan is theoretically just as cross-platform as OpenGL

Of course, Apple seems to want to not implement Vulkan and keep using Metal instead on OS X and iOS, fucking special snowflakes
>>
>>52288954
>This is what Python script kids actually believe

This is what any tech competent would actually believe, as most of the reasons anything is considered "slow" these days is because they are IO bound. There are some exceptions, but these are usually solved by implementing smarter algorithms. The last resort, when you have eliminated IO bound stuff and optimised your algorithms and data structures is to speed up the calculations themselves, by implementing them in said languages and exploiting architecture specific features such as vectorisation (SIMD, SSE) and GPGPUs (CUDA, OpenCL).

Doing network traffic or writing stuff to disk is equally slow in C++ as it is in Python and in Java.
>>
>>52288958
I prefer the more modern XML style layout stuff, or the amateur hour VS drag and drop designer. So many amateur Python applications use it, and it looks even worse than Java's Swing, if that is possible. I never looked very deeply though, because I had a bad first impression of it.
>>
File: koch-snowflake.png (10KB, 601x693px) Image search: [Google]
koch-snowflake.png
10KB, 601x693px
#!/usr/bin/env python

depth = 5
length = 600
speed = 0

import math
import sys

import turtle

def edge (depth, length):
if depth == 0:
turtle.forward (length);
else:
edge (depth - 1, length / 3)
turtle.left (60)
edge (depth - 1, length / 3)
turtle.right (120)
edge (depth - 1, length / 3)
turtle.left (60)
edge (depth - 1, length / 3)

def center (length):
turtle.penup ()
turtle.left (180)
turtle.forward (length / 2)
turtle.right (180)
turtle.left (90)
turtle.forward (length / (2 * 3 ** 0.5))
turtle.right (90)
turtle.pendown ()

def snowflake (depth, length):
for i in range (0, 3):
edge (depth, length)
turtle.right (120)

def main ():
turtle.speed (speed)
center (length)
snowflake (depth, length)
turtle.hideturtle ()
turtle.done ()

main ()
>>
>>52288998
Does Vulkan work with Nvidia hardware? What about AMD's or Intel's integrated graphics or mobile devices?
>>
>>52288995
>For learning a paradigm, arguable the most important paradigm for employable programmers,
Employable programmers should already be familiar with multiple paradigms, anon. How did you even land a job as a programmer in the first place if you have no idea what object-oriented programming is or what functional programming is?

>For learning a paradigm, multi-paradigm is confusing
>It is much easier to learn OO with Java or C# than it is with Python.
Baby duck syndrome
>>
>>52288995
OO is probably the least intuitive paradigm. They only teach it to beginners in university because it take a while to grasp if you don't understand the 'why'. And shouting the why at students faces doesn't do shit. They must experience it.
>>
>>52289037
>functional programming
You can have a coding job without knowing what is it.
>>
>>52288974
> Just use OpenGL, unless you like fucking with platform compatability/hardware independency.
If only it was that simple. Writing OpenGL code which is actually valid (rather than "works on my system") isn't trivial. All implementations let some errors slide, but the details vary from one to another. For anything to do with memory coherence, you can screw up heavily and it will typically work most of the time, but fail often enough to be noticeable.
>>
>>52289036
All of the above

If it's not on a given platform, either it's because of politics (Apple) or because the hardware isn't general-purpose enough (like pre-GCN or pre-Fermi)
>>
>>52289029
Tk looks "native".
The problem is Tk's idea of native Unix GUI look is Motif
>>
>>52289056
>You can have a coding job without knowing what is it.
Thanks for your time Sanjay. Don't call us, we'll call you.
>>
>>52289056
And that's a damn shame

>>52289072
Yeah, it's probably easier in the long run to use a "new API" than OpenGL if you're interested in the lower-level stuff
OpenGL lets you do a lot of it, but drivers have too much control at that level
>>
>>52289014

Not only is that a completely different point that I didn't say anything about, but it's bullshit. There are plenty of slow tasks that have nothing to do with IO. Python is a slow fucking language and there's no way you'll convince anyone here otherwise.
>>
>>52288998
>tfw Nvidia will have to support Vulkan which is based on Mantle
>>
>>52289077
>native Unix GUI
Does unix have a "native" look? To me it's "native" look is a collage of garbage.
>>
>>52289037
>coding
nice
>>
>>52288989
looks fine to me, if it's a big problem you could post it on stackoverflow and some autist will optimize it.

otherwise do what anon said: >>52288970
>>
>>52289090
I know good coders who don't have a fucking idea of what FP is. And I know lame coders who know what FP is.
>>
>>52289101
The operation of AMD and Nvidia GPUs is not very different, apart from some minor details which will be handled by the (now extremely cut-down) drivers, as well as availability of certain optional features like conservative rasterization or async compute

Mantle has to be generalized a bit to support all the platforms that it does, plus it will probably get some new features like bundles, but looking at D3D12, I can tell you that Vulkan will be like 95% the same
>>
>>52289036
Vulkan hasn't been released yet, so it doesn't actually "work" with anything.
>>
File: CDE_Application_Builder.png (205KB, 800x600px) Image search: [Google]
CDE_Application_Builder.png
205KB, 800x600px
>>52289106
Well, CDE was pretty much the standard desktop on UNIX systems.
>>
>>52289091
CPython, being an interpreted language, is slower by a factor of about 100, in all benchmarks. For tasks that don't require a lot of time to execute this factor is probably smaller (not all programs are like benchmarks) and usually unnoticeable to the user on modern computers.
>>
>>52289148
Was. I rather doubt that's still the case now.
>>
>>52289014
Imagine some future utopia* where desktop programming is largely done in Python. Imagine, a Python browser, a Python office suite, a Python IDE written in Python, a 3D Python game engine. At the moment, applications like this already exist, but you only run one or two at a time. Imagine trying to run an operating system where the majority, even of just the user space applications was written in Python.

Look at how much memory your system is using right now. Python would use more.
Look at your CPU load. Python would use more.

*dystopian jew state

Don't even try and say that this speed hit doesn't matter because you are only writing small applications in Python. Is a language good or powerful if it bloats up and restricts you to a certain scale of application, so far below what the hardware is capable of?
>>
>>52289056
>You can have a coding job without knowing what [functional programming] is.
Maybe if it's a lowly code-monkey-tier job. I haven't had a single colleague ever who didn't at least know what FP was, even though they might not be very well-versed in it.

>>52289091
>Not only is that a completely different point
It really isn't. You were talking about how shit Python was for being slow, and I said that if that was your main argument, then how come you use anything but C, C++ or FORTRAN. I followed up with putting it perspective.

>There are plenty of slow tasks that have nothing to do with IO
Yes, and that's why I included those tasks in my posts. It basically boils down to this: If it's still slow without any IO and without better algorithms, then you need to exploit architectural features such as multi-threading, vectorisation and et cetera. And when you're at this level, you're better off with C or C++ than anything else.

>Python is a slow fucking language and there's no way you'll convince anyone here otherwise.
You keep repeating this like you're a fucking drone, yet you haven't pointed out what you think is slow about it. I mentioned the main reasons why it is slow (GIL and lack og JIT in CPython), but I also pointed out that large parts of the standard library is implemented in C, and third-party libraries that are worth anything (such as number crunching libraries or video encoding) are also implemented in C.

So what exactly is so slow?
>inb4 everything
Please point out what you need the speed for and why Python is insufficient?

As I already said, speed is not Python's selling point, but you already dismissed C and C++ as viable as well so I'm really wondering what you actually mean.

I sincerely suspect that you only know a single language, C#, and you're suffering from severe baby duck syndrome.
>>
>>52289173
Hey, don't shit on Grail.
>>
>>52289154
100x slower is not a good thing
The only use python has is scripting
>>
>>52289191
Of course, python is a scripting language
>>
>>52289173
Why should I imagine something that is never going to happen? I'm not arguing that "hurr durr Python should be used for everything", I'm only arguing that your arguments against Python are uninformed, reeks of lack of technical understanding and is largely based on parroting stuff you have read on 4chan.
>>
>>52289191
>The only use python has is scripting
Well duh, it *is* a scripting language.
>>
>>52289035
thank you for using python
>>
>>52289185
>I mentioned the main reasons why it is slow (GIL and lack og JIT in CPython)
It's also slow because of numeric system being abstract, requiring a lot of runtime overhead. You can also just look at any benchmarks for the language. Just because some libraries are written in C does not mean they are fast relative to other languages.

Not the guy you are responding to btw, just chiming in.
>>
hi
/^>[A-ZÅÄÖ].*$/
I use this piece of regex to filter fedoraposting on int with 4chanx, but it doesn't work if the match isn't on the first line and the post only contains one line. IE it filters:
>Blablablba

but it doesn't filter
>>52286997
>Blabla
>Blablablbalba

how can the regex be changed to fix this?
>>
>>52289244
I don't use python. For me it's a toy not a tool.
>>
>>52289191
>The only use python has is scripting
There are better faster options though
>>
what should i program
>>
File: 1452043788880.jpg (169KB, 960x691px) Image search: [Google]
1452043788880.jpg
169KB, 960x691px
>hi
>/^>[A-ZÅÄÖ].*$/
>I use this piece of regex to filter fedoraposting on int with 4chanx, but it doesn't work if the match isn't on the first line and the post only contains one line. IE it filters:
>>Blablablba
>
>but it doesn't filter
>>>52286997(OP)
>>Blabla
>>Blablablbalba
>
>how can the regex be changed to fix this?
>>
>>52289154
>CPython
that's why we have pypy, pyston, cython, nuitka, numba, ...
>>
>>52289154
> CPython, being an interpreted language, is slower by a factor of about 100, in all benchmarks.
That depends upon the nature of the benchmark. A factor of 100 is about right if you try to use Python as if it's Fortran (i.e. primitive operations inside loops).

But that's not how you use Python. Any practical Python program delegates most of the work to libraries which are written in C or C++ (or possibly Fortran for numeric work; most of NumPy's advanced functions are wrappers around BLAS/LAPACK).

If there's no alternative to writing Fortran-style code, you pick another language.

> For tasks that don't require a lot of time to execute this factor is probably smaller (not all programs are like benchmarks) and usually unnoticeable to the user on modern computers.
It's actually the opposite. For short-run programs, the time taken to initialise the interpreter and libraries tends to dwarf the actual processing.
>>
>>52289260
http://lmgtfy.com/?q=learn+regex
>>
>>52289191
I bet there are applications written on your computer in Python (assuming you're using a Linux distro) and you don't even realize it. Sendmail was written in Python, deluge is written in Python, Bitmessage is written in Python (C with intrinsics for PoW algo). Notice a theme? There are tons of applications that don't need to be written in a faster language because they are mainly IO bound. And when they aren't (BM), they profile and reimplement the slow parts in C.
>>
>>52289249
>It's also slow because of numeric system being abstract
>requiring a lot of runtime overhead
See numpy

That shit aint slow nigger.

>You can also just look at any benchmarks for the language.
As >>52289154 already said, benchmarks are stuff that really pushes CPU and RAM and does other resource intensive stuff. Of course Python is not performing well on these compared to other languages...

This is EXACTLY why I said you should use C or C++ instead if a need for speed is your biggest requirement.... I can't believe I have to repeat this for the third fucking time to you.

>Just because some libraries are written in C does not mean they are fast relative to other languages.
Not all, but many are. Python is a viable option to both R and MATLAB for example, and it is often used for web (because web is mostly IO bound [database, requests to back-end servers/services, reading files from disk etc], speed of the language matters less).
>>
File: overthesun.png (3MB, 4961x3508px) Image search: [Google]
overthesun.png
3MB, 4961x3508px
https://dzone.com/articles/learn-python-overtakes-learn-java

You can't stop python.
>>
>>52289311
>That shit aint slow nigger.
so?

I can write a physics engine in C and make python bindings for it. Hardly means python is as fast as C.
>>
>>52289260
Or if you regexwizards know something who doesn't filter a post starting with
>>52286997
with a following quote starting with a capital letter

but does filter one or more quotes in seperate lines starting with a capital letter

>>52289289
I know regex syntax but not how it works with 4chanx, a match should filter the entire post no?
>>
>>52289301
Especially if you use gentoo.
>>
new thread when ? :3
>>
>>52289330
>I can write a physics engine in C and make python bindings for it. Hardly means python is as fast as C.
When virtually all of Python's standard library is (also) implemented in C, it kinda does. See >>52289288

When you write code like a retard, it's going to be slow. If you offload stuff to the proper libraries, it's literally as fast as C (when the library is implemented in C).
>>
>>52289185
You are arguing with at least 3 people at once man, and you think they are the same person, so you are confusing yourself.

Python is slow because it's interpreted, and everything in python is a relatively complex object. There exist no good AOT or JIT compilers, and the idea of optimization is a foreign to the interpreter as good programming languages are to you. The GIL kills any kind of serious multithreading. We all know it's slow. Stop saying "how is it slow", because that doesn't really matter. The truth is that it just fucking is.

Also, distributing as non source sucks, and requires you to ship the entire interpreter alongside the source off your application. Good luck ever distributing non open source software to end users.

I never dismissed C or C++, and I barely program in C#. I don't run windows for development, and I don't have any love for .Net. Don't try and tar my opinions by making me look like a microsoft fuckboi.
>>
>>52289185
Thanks for breaking that up for no fucking reason whatsoever.

Your "follow up" had absolutely nothing to do with what I implied, which is that plenty of fucking languages have performance almost as or as good as C (to be expected with any decent, uninterpreted language), with performance approaching fine-tuned C (especially if you fine tune in said language). The overwhelming majority of high level features come at no extra cost whatsoever when they're static, C++ being an obvious example of this.

Multi-threading and concurrency in general is standard in nearly every language, if you consider using it to be an "architectural exploit" then there's something wrong with you. C/C++ don't do this best, though they might do this the fastest. Vectorisation isn't out of the question in many static languages.

The libraries don't fucking matter, the language is fundamentally slow because it's interpreted. 100x slower, according to >>52289191

I didn't "dismiss" C/C++, I joked that python users seriously believe that C or C++ eclipse other static languages in terms of performance. Obviously nobody is actually dumb enough to believe that.


>>52289191
>>52289236
Some people use it as their main "programming" language, or actually use it to write applications.

>>52289263
There probably are. I'm not defending python.

>>52289301
I'm not using a linux distro. You keep saying "are implemented in C". That's not a compliment for python.
>>
>>52289331
>a match should filter the entire post no?
?
if the regex matches the post, the post is hidden
>I know regex syntax
yet you cant fix a simple regex yourself
what do you mean by fedoraposting?
>>
>>52289375
By >>52289191 I meant >>52289154
>>
You do realize that even if you use a C library in Python, you still have the overhead of doing the dynamic type checking and converting between Python's representations and C's (including GC when leaving Python and allocation when going back to Python)?
>>
this is a pretty cool/scary extension I found for chrome. shows your age increasing as you open a new tab.
>>
>>52289367
>There exist no good AOT or JIT compilers, and the idea of optimization is a foreign to the interpreter as good programming languages are to you.
http://pypy.org/
http://nuitka.net/
http://numba.pydata.org/
https://github.com/dropbox/pyston

pypy for php:
http://hippyvm.com/
>>
>>52289367
>You are arguing with at least 3 people at once man, and you think they are the same person, so you are confusing yourself.
Maybe, sorry. I always thought it was just me and that guy that calls himself Anonymous.

>Python is slow because it's interpreted, and everything in python is a relatively complex object. There exist no good AOT or JIT compilers, and the idea of optimization is a foreign to the interpreter as good programming languages are to you. The GIL kills any kind of serious multithreading. We all know it's slow. Stop saying "how is it slow", because that doesn't really matter. The truth is that it just fucking is.
The point was never that it wasn't slow, but the original anon's claim about it being slow making it unsuitable for development. My argument all along has been what was said by >>52289301, it's more than fast enough for most things because the real work is done in libraries that are implemented in C.

This is true for EVERY SINGLE HIGH(ER) LEVEL LANGUAGE, which is why every single "hurr durr X is shit because it is slow" is the most useless discussions we have in the DPTs.

>Also, distributing as non source sucks, and requires you to ship the entire interpreter alongside the source off your application
Which is no different from how it's done with Java (JVM is bundled with executable) or C# (CLR is bundled with executable).

>Good luck ever distributing non open source software to end users.
The first company I worked in did exactly this. CPython compiles Python source files to intermediate byte code, which you can distribute freely without having to distribute source files.
>>
>>52289391
What are ctypes
>>
>>52289301
> Sendmail was written in Python,
That's wrong. For a start, Sendmail is much older than Python.

You're probably thinking of some interface script named /usr/bin/sendmail. The standard way to send email on Unix is to execute that program and feed it a message on stdin. On desktop systems which just hand off email to a remote server, it's fairly common to install a script which implements just that feature.

Sendmail itself is a full MTA (roughly "SMTP server", although it can also handle local submission, UUCP, etc), and is written in C.
>>
>>52287867
>White people invade and colonise black people
>Slavery is abolished, but racial oppression becomes a thing via THE LAW
>After years of oppression, racial segregation is abolished too
>20 years later, black standard of living hasn't improved much for most black people cause these things take time

I'm not condoning anything, but if I were black and deprived and was forced to turn to crime, you best believe I'd target white people
>>
>>52289381
>if the regex matches the post, the post is hidden
I recall a regex-match is line-specific, which means if a filter matches a line in a post the post should be filtered, no? It doesn't.
>what do you mean by fedoraposting?
People/scripts quoting entire posts they think are edgy or something, without actually quoting the person who wrote it. IE the post doesn't start with >> and the quotes most often starts with a capital letter >>52289279
>>
RPG Maker
>>
>>52289418
At the end of the day, I just don't like the magic that Python hides from you. While it's valuable as a starting point for new programmers, I think that in the end it's counterproductive. Eventually a new programmer will have to learn a C-like language, and then a whole bunch of things hidden away behind Pythons magic curtain start to make sense. __magic__() style functions are an awful, obtuse language feature.
>>
>>52289461
Grow some skin mate and stop posting on /int/ if you can't hack the banter
>>
>>52289375
>Your "follow up" had absolutely nothing to do with what I implied, which is that plenty of fucking languages have performance almost as or as good as C (to be expected with any decent, uninterpreted language), with performance approaching fine-tuned C (especially if you fine tune in said language).
My follow up is that for any well-written Python application, you would do virtually all of the heavy lifting in a library written in C anyway....

>The overwhelming majority of high level features come at no extra cost whatsoever when they're static, C++ being an obvious example of this.
C++ is basically "C with more features", although C++ fanboys will argue that idiomatic C++ is nothing like C. These extra features are mostly resolved in compile-time (see STL) and the ones that aren't (RAII and stuffs) are implemented with minimal cost.

>Some people use it as their main "programming" language, or actually use it to write applications.
Yes, you can do this with scripting languages these days. A script is an application, an application can be a script.

>Multi-threading and concurrency in general is standard in nearly every language, if you consider using it to be an "architectural exploit" then there's something wrong with you.
But it definitively is. There is no way of doing efficient multithreading that is completely independent of the underlying architecture.

>C/C++ don't do this best, though they might do this the fastest. Vectorisation isn't out of the question in many static languages.
See above

>The libraries don't fucking matter, the language is fundamentally slow because it's interpreted.
See above


Also, see >>52289418


>>52289391
This cost *should* be minimal compared to the cost of actually doing what the library is doing. I mean, if you are for example encoding video, then this cost is absolutely minuscule
>>
>>52289363
>it kinda does
It doesn't though, that just means the libraries themselves or fast. Doing work with the language itself is slow. You can literally argue any language is really fast because it has libraries written in C, which almost all of them do.
>>
>>52289472
>banter
half of the images in /int/ generals are fedora images which means you have to swap threads almost twice as often and it's annoying more than anything, and has went on for months at this point
>>
>>52289470
I like __magic__ methods more than the C++ mess.
>>
>>52289470
Now this is an argument I see the point of.

>>52289441
There are a gazillion different implementations of sendmail though, the most recent ones are implemented in Python for sure.

>Sendmail itself is a full MTA (roughly "SMTP server", although it can also handle local submission, UUCP, etc), and is written in C.

https://docs.python.org/2/library/
>>
>>52289363
Hey man, wanna hear about my super fast shell script? I'v got a trick for writing shell scripts that are REALLY fast:
#! /bin/sh

~/bin/rest_of_my_application_in_a_ficking_elf


Look at how fast this script performs!
>>
>>52289448
>colonialism is bad
>segregation is bad
pick one

>abolition is good
>white law is bad
pick one

>black standard of living hasn't improved
>blacks aren't living in mud huts constantly fighting, killing, cannibalising, raping, etc as is STILL HAPPENING in Africa
pick one

Let me guess, it's just because of white people that black history is so much worse... even if "everything the white man did" had been done much less humanely by fellow blackizens of Africa
>>
>>52289489
>Doing work with the language itself is slow
The standard library is part of "the language itself".

>You can literally argue any language is really fast because it has libraries written in C, which almost all of them do.
That's exactly what I am arguing and that's exactly why I'm outright saying that the recurring "hurr durr X is slow, Y is better" discussions we have on /g/ are pointless.
>>
>>52289461
>>52289495
alternate solution:
dont go on /int/
>>
>>52289525
Invoking a different executable is not the same as invoking a library.

The standard library is arguably part of the language, a stand-alone executable is not.
>>
>>52289470
i find magic methods to be a great way to overload operators in an dynamic way.
>>
>>52289419
They don't change anything about what I just said; to Python, any value could still be of any type

>>52289480
If the amount of Python in your application is so minimal that you can actually say it doesn't affect the performance, what's the point of writing it in Python over anything else, besides greater familiarity with Python?

The point is that Python is slow, the fact that applications which are 99% running in C are not slow doesn't change that
>>
>>52289548
>The standard library is part of "the language itself".
I know. Almost every standard library for every language has components written in C. This reasoning is retarded for claiming the entire language is fast.

Even still, compared to what? Python has libraries written in C, so does every language. Using shit like numbers is still orders of magnitude slower than something like C, which is not an uncommon thing to use in python.
>>
>>52289470
> __magic__() style functions are an awful, obtuse language feature.
There's nothing "magic" about them. They just let you use more natural syntax, e.g. a+b rather than a.add(b), a[i] rather than a.get(i), etc.

If you don't think that's a gain, you haven't tried reading any vector/matrix math code written in a language which doesn't support operator overloading.

> Eventually a new programmer will have to learn a C-like language
If you mean "they'll have to learn C", you're wrong. C is pretty much dying. If you actually meant "C-like language", then you're wrong. Most "C-like" languages have OOP features, which largely boils down to hiding implementation details so that your code doesn't get bogged down with boilerplate.
>>
>>52289480
Then it's not really a python application, is it?

Idiomatic C++ is an oxymoron. And yes, C++ is effectively as fast as C - similarly, many other static languages are or approach that. "If speed is your argument" then you shouldn't use python, but there's no reason to limit yourself to C/C++ for speed.

... And using a scripting language to program anything more than a calculator is retarded. A script is not an application any more than the script for a play is a performance.

.. Multi threading can easily be completely independent, it's abstractable to all the same shit and it's not like the cost of starting a new thread is worth anything. Yeah, vectorisation is hardware dependent. What's your fucking point? Only C/C++ do that? Fuck off.

I don't see the part where you point out why "but most of Python isn't written in Python" is a god damn selling point for Python.
>>
>>52289635
>Idiomatic C++ is an oxymoron
I disagree, I think the core guidelines could be called "idiomatic C++"
>>
>>52289597
>If the amount of Python in your application is so minimal that you can actually say it doesn't affect the performance,
This is true for 100% of IO bound code, anon.

>what's the point of writing it in Python over anything else
Development time. Hacking together a script that populates my database in Python from an old database and notifies me by email when its done takes 5-10 minutes. Doing the same in C takes 30-40.


>Even still, compared to what? Python has libraries written in C, so does every language. Using shit like numbers is still orders of magnitude slower than something like C, which is not an uncommon thing to use in python.
Which has been my point all along.
>>
>>52289659
Ok, name the core guidelines for C++
>>
>>52289696
https://github.com/isocpp/CppCoreGuidelines
>>
>>52289635
>I don't see the part where you point out why "but most of Python isn't written in Python" is a god damn selling point for Python.
It was never about being a selling point for Python. It has been about saying "Python is slow" is uneducated at best and outright wrong in many cases.

>And using a scripting language to program anything more than a calculator is retarded.
People make entire web applications in scripting languages, anon.

>Multi threading can easily be completely independent,
Not really, then you end up with Python-esque multithreading where really a thread is just another process and you need mechanisms such as a GIL.

>"If speed is your argument" then you shouldn't use python, but there's no reason to limit yourself to C/C++ for speed.
If speed is the only thing you care about, then there is literally no point in using anything else.
>>
>>52289666
C is not the only alternative to Python, Satan. Maybe you should stop acting like it is?

>>52289704
You may as well have linked some random code of conduct
>>
>>52289734
>The C++ Core Guidelines are a collaborative effort led by Bjarne Stroustrup
>>
>>52289597
> If the amount of Python in your application is so minimal that you can actually say it doesn't affect the performance, what's the point of writing it in Python over anything else, besides greater familiarity with Python?
The usual reason is that it takes a fraction of the time to write. If you're prototyping, having a REPL certainly helps, as does not having to re-compile after every change.

In my line of work, C and C++ are on a downward trend. If performance isn't critical, Python code can be developed much faster. If performance matters, the core algorithms are probably going to be written in CUDA, and they're going to look a lot more like the Python+NumPy prototype than like anything you'd write in C.

A similar process is used in high-frequency trading: the parts that need throughput rather than latency get written in Java, the latency-sensitive parts in Verilog.
>>
>>52289526
Don't put words in my mouth faggot, I'm not condoning the behaviour or saying white people are to blame for all black people's problems, some of those are black people's fault. But if you were a black man living in South Africa and you had been denied opportunities and continuously gotten shat on by your lighter counterparts all of your life, who are you more likely to abuse/be mad at?
>>
>>52289696
RAII
SFINAE
const-correctness
Prefer references over pointers
etc
>>
/!\ A L E R T /!\

new thread
>>52289791
>>52289791
>>52289791


/!\ A L E R T /!\
>>
>>52289734
>C is not the only alternative to Python, Satan. Maybe you should stop acting like it is?
It was just an example, Jesus fucking christ.

The point was ALSO that all other higher-level languages have libraries implemented in C. Naming those languages instead would kinda defeat the point I'm trying to make now, wouldn't it?
>>
>>52289597
Because Python is good at gluing all those C libraries together.
It's like bash, most of the actual work is done with C code, you're just putting all those binaries together.
>>
>>52289726
1.
WHY DO YOU THINK THE LIBRARIES ARE WRITTEN IN C?

2.
Yeah, they're retards.

3.
No, you end up with a thread being an executable function. That's it. Completely hardware independent.

4.
I don't understand how you can't get this through your head.
Ok, imagine this graph


|
|
(|x70)
|
| .
| | .
| | | |
P:M:C:C
y:i: :+:
t:s: :+:
h:c: : :
o: : : :
n: : : :
>>
>>52289795
can we get one that doesn't reference an awful anime?
>>
>>52289773
I wouldn't call them idiomatic.

>>52289798
"B-BUT IF YOU WANTED PERFORMANCE WHY NOT C/C++"

Hypothetically, maybe there's a series of languages that have better performance than python... but worse performance than C.

In fact, maybe there are other languages with similar performance to C++

In fact, maybe most of the languages between python and C/C++ are usually only 1.5-10x slower (depending on a lot), while Python is more like 100x slower (on a good day with little CPU usage)
>>
>>52289817
>WHY DO YOU THINK THE LIBRARIES ARE WRITTEN IN C?
Because I know they are.

>No, you end up with a thread being an executable function. That's it. Completely hardware independent.
That is not multithreading anon.


>>52289849
>I wouldn't call them idiomatic.
But that's what they are though.

>Hypothetically, maybe there's a series of languages that have better performance than python... but worse performance than C.
But practically? After all, that's what we are actually discussing here (since *practically* the standard library of Python is mostly written in C).

>In fact, maybe there are other languages with similar performance to C++
There might be, such as ALGOL and FORTRAN, but these are not so popular anymore.

>In fact, maybe most of the languages between python and C/C++ are usually only 1.5-10x slower (depending on a lot),
Why would you accept 10x slower performance when your ENTIRE FUCKING POINT WAS

>I gotta go fast

??

Also, you are assuming that Python is 100x slower. In many cases it is in fact only 1.5x-10x slower.
>>
>>52289849
>hypothetically there is a language that's only X slower but Python is Y * X * Z slower!!!!

Great fucking argument there, anon.
>>
>>52289849
Your entire argument has been "development time means shit, I need maximum performance".

Then why would you suddenly make an exception and say "oh, but I performance isn't everything, I accept <this arbitrary performance cost> but I can't accept <this other arbitrary performance cost>, that's simply not doable for me"
>>
>>52289954

What are you on? Do you even know the context of this conversation?
The fact that there are languages between python and C/C++ in terms of performance is obviously something the person I'm replying to has no idea of


>>52289940
You just don't get it. They're written in C because PYTHON IS SLOW

Are you dumb? Have you ever even used C++?
A generic thread literally just runs a function.

No, they aren't idiomatic. Are you even the same person?

What the fuck is "but practically?" supposed to mean?

Holy shit are you seriously just fucking trolling with those last two pieces of shit?
You know what? Why the fuck aren't you recommending ASM or a hand built PC? Are you retarded or just mentally defective?
>>
>>52290014
What the fuck are you talking about?

Look, this is EXACTLY what you're fucking arguing:

>>Horse driven carriages aren't even slow.
>You should just use a car.
If you want speed why aren't you using a rocket ship?
Checkmate!
>>
File: cannabis.png (7KB, 505x462px) Image search: [Google]
cannabis.png
7KB, 505x462px
#!/usr/bin/env python

import math
import turtle

scale = 100
speed = 0
theta_max = math.pi
theta_min = -math.pi
theta_ticks = 400

def eq (theta):
return (
(1 + 9 / 10 * math.cos (8 * theta))
* (1 + 1 / 10 * math.cos (24 * theta))
* (9 / 10 + 1 / 10 * math.cos (200 * theta))
* (1 + math.sin (theta))
)

def draw ():
for i in range (0, theta_ticks + 1):
theta = i * (theta_max - theta_min) / theta_ticks + theta_min
radius = scale * eq (theta)
if i == 0:
turtle.penup ()
turtle.goto (radius * math.cos (theta), radius * math.sin (theta))
if i == 0:
turtle.pendown ()

def main ():
turtle.speed (speed)
turtle.hideturtle ()
draw ()
turtle.done ()

main ()
>>
>>52290014
Plus, what development time?

Oh, right, you still believe that you need to trade performance to get development time because your only experience is C and Python
>>
>>52287329
Seriously Illegal Cheese Pizza
>>
>>52287220
mfw ive been an artist all my life and now am learning to program. cant wait to get this framework in decebt shape so i can get on to making some bitmap animations
>>
>>52290367
well you could do much worse than C++
>>
>>52287443
imblying game edition hasnt been the best /dpt/ all week
>>
>>52290144
The very nature of your argument is that speed is the singular measure of a programming language's worth
If that's the case, fly me to the fucking moon
>>
>>52290496
One of these days, Lucy.
>>
>>52290496
No it's not you fucking liar
The only thing like that I've so much as implied is that speed is important
Which disqualifies python
>>
>>52287671
http://learnopengl.com/
Thread posts: 345
Thread images: 29


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.