[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: 354
Thread images: 23

File: 1490011419158.jpg (194KB, 2038x1505px) Image search: [Google]
1490011419158.jpg
194KB, 2038x1505px
What are you working on, /g/?

Previous thread: >>61040119
>>
>>61042830
>be me
>Scheme/Haskell
>laugh at rust's small penis
>>
why are you being mean to .NET?
>>
>>61042819
>I am aware of no reason on why this is something only C++ can do.
Obviously, because you're a blub who can't understand anything higher than C.
Protip: templates.

Go learn how they work, unintelligent monkey.

>Irrelevant to the topic, he was talking about qsort being inlined. Stop trying to change the goalpost.
You are so fucking stupid if you cannot even follow a conversation properly.
You must have an IQ below 90.
You make all other C programmers look bad, just do all other C programmers a favor and kill yourself.

>For retards maybe. It's still wrong.
The facts, benchmarks, and assembly output disagree with you.

>>61042846
>What I'm implying is that you should be writing your own.
Ctards have to write their own version of the standard library to make it go fast because their language is so shit.
Have fun not being productive at all.

C++ doesn't have this problem, you don't have to reimplement the standard library to make it go fast, it can be inlined by design.
>>
Idris is pretty good but it's also pretty dead
Any alternatives?
>>
>>61042873
Wannabe JVM
>>
File: 1490011419158.jpg (246KB, 2382x1504px) Image search: [Google]
1490011419158.jpg
246KB, 2382x1504px
>>61042830
>>
>>61042886
>Protip: templates.
I see no reason on why templates would stop C from doing that.

>You are so fucking stupid if you cannot even follow a conversation properly.
Sure I can. Your insults won't change the fact that you talked about qsort being inlined.

>The facts, benchmarks, and assembly output disagree with you.
Well, I proven you wrong before so meh.
>>
>>61042830
You should add JAVA to the left.
>>
No matter how hard you try to teach your cat how to program, it won't ever even be capable of learning. It's brain is not sufficiently advanced.
Just ignore the Cfag.
>>
>>61042911

Now make it a webm
>>
how could i convert all csv files in a folder to json with python?
>>
>>61042916
>Your insults won't change the fact that you talked about qsort being inlined.
You're an idiot if you don't see the connection between qsort being inlined an std::sort being inlined.
The whole fucking point of the argument is that the design of C++ allows std::sort to be inlined, while the design of C does not allow qsort to be inlined.
>>
>>61042926
Nice try troll, you were proven wrong in the last thread though.
Keep whining.
>>
>>61042936

Import csv and json libraries
Loads the csv and dumps the json
>>
>>61042943
>The whole fucking point of the argument
No it is not.

>C++ allows std::sort to be inlined, while the design of C does not allow qsort to be inlined.
False
>>
>>61042956
oh yeah. thanks.
>>
>>61042946
Yeah, ok, I was proven wrong.
I guess that's why godbolt shows std::sort being inlined but not qsort
I guess that's why 2 different benchmarks show std::sort being 2x faster than qsort.
>>
Daily reminder C-men can't even into basic logic, they can't comprehend
A => B
B => C
-----
A => C
>>
C is like natural selection in a way, there are those who can do it and program in it, then there's those who failed at it so now they hate it
>>
>>61042964
>False
Do you have anything to back this up with?
Because so far you've presented nothing, while we have plenty of evidence to suggest the opposite.
>>
>>61042982
in Haskell this is just
(.)
>>
>>61042986
And then there are those who know it, respect it, and recognize there now exist better langs.
>>
>>61043000
flip (.) actually
>>
>>61042976
>godbolt shows
godbolt shows nothing, I posted a proof about that before.

>I guess that's why 2 different benchmarks show std::sort being 2x faster than qsort.
*in your specific implementations
Which was irrelevant to the topic.
>>
>>61043011
Such as Haskell and Scheme.
>>
>>61043014
flip is an isomorphism
>>
>>61043011
Better languages for brainlets, I agree
>>
>>61043040
I too am a fizzbuzz programmer
>>
>>61042986
I'm the one arguing for std::sort.
I programmed in C for multiple years, and I liked it. I still like C, I have respect for it.
I have no problems writing proper C, I have no problems and even like manually managing memory. I'm also into OS development.

But being unable to acknowledge C's shortcomings and defending it at all possible costs is just fucking stupid.
C++ is better than C in a lot of ways, and in this day and age, you should definitely be using C++. It's gotten a lot better with modern C++11 to 17.

I hate it when braindead <90 IQ fucking retards like you who know absolutely NOTHING about computers or programming ruin the reputation of C programmers.

Fanboys are the most retarded fucking idiots.
You flat out have no idea what you're talking about. You are unintelligent, and stupid.
You can't even think properly.

The one who failed the natural selection is you. People who passed it moved onto better languages to do more advanced things.

>>61043016
>*in your specific implementations
In GCC and LLVM. The two major and most optimized implementations.
>>
>>61042964
>>61042976
You fucking retards, it's not about functions themselves being inlined, it's about COMPARATORS being inlined. That's what happens in std::sort, not due to some magical compiler optimizations but due to the fact that comparator is templated.
>>
>>61042830

https://play.google.com/store/apps/details?id=com.altfolio.rmgsoftware
>>
>>61043102
>it's not about functions themselves being inlined, it's about COMPARATORS being inlined
I know that, but the C++fag in the last thread kept insisting that it's about qsort not being inlined.
>>
>there is this hypothetical possibility of existence of a C compiler being able to implement qsort in such a way that inlining of it would be possible, but still being in concert with the standard which explicitly says qsort is a function and not a macro, yet no major compiler is implemented this way for reasons totally unknown, despite spending the last 30 years on optimising C code, but we shouldn't concern ourselves with the reality on hand and focus instead on this totally hypothetical possibility of C not being 2 times slower than C++ at this typical task.
Wew.
>>
>>61043102
>it's about COMPARATORS being inlined
I know that you fucking retard. It's the Ctard who doesn't get it.
When I say inlining qsort, I mean inlining the comparator as well.
I thought that was fucking obvious from context, but Cfags can't infer things from context, evidently.
>>
>>61043099
LLVM is not a C compiler.
>>
>>61043130
>completely different things
>same
>>
>>61043129
this, C should just use macros like C++ does and call them "templates"
>>
>>61043123
>kept insisting that it's about qsort not being inlined.
No, it was about qsort AND it's comparator not being inlined. It should've been pretty obvious, but a Ctard like you will surely scrape the bottom of the barrel to find any last hope to defend your pathetic pride, like here: >>61043140

>>61043140
LLVM is responsible for optimizing code and translating it to the target machine language.
>>
>>61042943
For fucks sake you autists, just show a dissasembler dump of the code and shut up
Both C and C++ are shit, exept that C is solid shit so when you want to put that shit in to an embedded enviroment that is not x86 it does not melt.
>>
>>61043154
>No, it was about qsort AND it's comparator not being inlined
Nice backpedalling. You kept saying that it was about qsort only.
Anyhow, it has nothing with qsort being inlined but you are a retard so you can't into basic logic.

>like here: >>61043140
Not me but he is correct actually. Are you claiming that he is lying?
>>
>>61043166
>just show a dissasembler dump of the code and shut up
It has already been shown in the last thread, you retard.
std::sort and it's comparator gets inlined, qsort and it's comparator doesn't.
>>
>>61043154
>argues like a retard for a whole morning
>doesn't even use the proper terms
>some anon points it out
>have such low self esteem the only reply is "muh... muh Ctard!"
>>
>>61043193
You are moving the goalposts and dodging the issue.

The truth is that C's design doesn't allow it to perform as well as C++, because it can't be optimized as well.
Accept that fact.
>>
>>61043222
If qsort were defined in a header, it would perform just as well as std::sort
>>
>>61043243
How come it's not in every major implementation thn?
>>
>>61043179
I'm sorry that i dont follow autistic "discussions" for 8 threads you faggot.

Well then there you go, C++ compilers inline shit better because C std library is linked in from a compiled object file, however that isint really an argument since both of the compilers would do that as long as there is a code implementation. I'm sure that if you would link in std::sort from a library as well the C++ result would be slower. And as a side note using C++ in a microcontroller based project is not feasable. Like i said both C and C++ suck , use a language based on the task you need to perform.
>>
>>61043243

>If C weren't C, C would be faster
>>
>>61043243
>there is this hypothetical possibility of existence of a C compiler being able to implement qsort in such a way that inlining of it would be possible, but still being in concert with the standard which explicitly says qsort is a function and not a macro, yet no major compiler is implemented this way for reasons totally unknown, despite spending the last 30 years on optimising C code, but we shouldn't concern ourselves with the reality on hand and focus instead on this totally hypothetical possibility of C not being 2 times slower than C++ at this typical task.
>>
>>61042854
>hasklel being even close to scheme
hahaha the delusion is real
>>
>>61043254
>I'm sure that if you would link in std::sort from a library as well the C++ result would be slower.
You can't, it's a template function.

>use a language based on the task you need to perform.
C++ meets most of them, for me.
That includes OS development.

You're delusional if you think C++ can't do embedded as well as C.


C++ templates in general can be optimized much better than any C function, even if it was in a header, because template functions are specialized for the exact type passed in.
>>
>>61043222
>The truth is that C's design doesn't allow it to perform as well as C++,
And this has been proven to be false.
>>
>>61043294
>You're delusional if you think C++ can't do embedded as well as C.
You're basically limited to the common subset if you do that.
>>
>>61043306
In no implementation has it been proven to be false.
>>
>>61043306
Where?
>>
>>61043260
It's still C.

>which explicitly says qsort is a function and not a macro
He did not say that it would be a macro.
Anyhow, per the standard every function CAN also be a macro.
>>
>>61043324
Everywhere
>>
>>61043294
>have 12kb's of ram on a Cortex-M0
>lmao lets just create 3 objects everytime i get an interupt on this 10MHz 10k gate core with 2 pipeline stages and no branch predictor.

And yes , templates this , templates that.
Assume that you are working with already compiled library. Which is exactly the case in the C argument.
>>
>>61043248
Because some morons thought dynamic compilation for a standard library was a good idea.
>>
>>61043309
No you're not.
I'm using C++ features in my kernel right now, such as templates, some template metaprogramming, RAII, streams, and with the arrival of C++17, soon destructuring, constexpr if, and that new if initialization syntax they introduced.

Of course the standard library wouldn't be available, but you can reimplement the bits you need, and I have, such as generic containers, lock guards, smart pointers, formatted character streams, owned strings and string views, etc.
I do agree that C++ is best in a hosted environment, though, but it's far from useless in a freestanding environment.
>>
>>61042830
>Rustfags pretending to be the top of the food chain
Come back when your language is actually portable lmao
>>
>>61043360
>dynamic compilation
Sorry, dynamic linking. I need to sleep.
>>
>>61043248
Allows updates to a standard library implementation without having to recompile every C program.
>>
>>61043355
>>lmao lets just create 3 objects
This is more of a design issue.
Also, creating objects on the stack is as cheap as creating a C struct on the heap. In fact they are compatible with each other.
C++ just allows you to do more with it, and a good design would add useless stupid bloat to it.
C++ isn't about adding useless stupid bloat to things, it's about zero cost abstractions.
>>
>>61043399
>and a good design would add useless stupid bloat to it.
wouldn't*
>>
>>61043399
>creating objects on the stack is as cheap as creating a C struct on the heap
Fuck me, I meant as cheap as creating a C struct on the stack.
I don't know why I'm making so many mistakes.
>>
>>61043437
Sure, but object creation needs a heap system 9 times out of 10.
It costs instructions and memory. At the end of the day i would rather use a time tested C compiler chain rather then use a crippled version of C++.
Dont get me wrong C++ is great when you have all of the features and no memory constrains like on general consumer systems.
>>
>>61043521
>Sure, but object creation needs a heap system 9 times out of 10.
No more than using structs does. If your objects are anything more complicated than RAII structs you're doing it wrong.
>>
>>61043521
>It costs instructions and memory
No more than C.
>>
>>61043532
Well i doubt that, but i guess i will take you word for it.
>>
I guess Cfag finally realized he was defeated.
>>
>>61043625
>doesn't reply to my posts because he got btfo
>thus since nobody replied to me I have no reason to reply to anyone
>haha! he has not posted anything! he was defeated!
retard
>>
>>61043597

The whole point of C++ is that you only get penalized for the features you use. If you use virtuals and inheritance then you're going to start feeling the overhead of vptrs and indirection but if you write your classes the same way you write structs except with ctors + dtors then it costs nothing.
>>
>>61043648
All your posts, at least the ones that were in reply to me, were replied to.
So I don't know what you're talking about.

Your argument has already been defeated though, many times over.
>>
File: 1498213909219.png (563KB, 960x540px) Image search: [Google]
1498213909219.png
563KB, 960x540px
>>61042830
C influenced languages get an automatic F in my book.
>>
>>61043680
You have shit taste in languages, then.
Any language that isn't based on C syntax looks like absolute TRASH.

{} is godtier.
>>
>>61043673
>All your posts, at least the ones that were in reply to me, were replied to.
doubt

>Your argument has already been defeated though, many times over.
And this is false. No matter how many times you cry over it, it will still be false.
>>
>>61043687
>what is LISP
>>
>>61043689
Again, do you have anything to prove your point with?
Because literally all the evidence only supports my side of the argument.
>>
File: 1497800983456.png (323KB, 784x1008px) Image search: [Google]
1497800983456.png
323KB, 784x1008px
>>61043687
Look, it's not my duty to explain your own ignorance to you.
>>
>>61043701
Trash, is what it is.
>>
>>61043705
>Again, do you have anything to prove your point with?
I have proven my points multiple times to you, it has gotten tiresome.

>Because literally all the evidence only supports my side of the argument.
You probably summoned some kind of evidence in your head then, because there is no evidence that supports your nonsense.
>>
>>61043736
>because there is no evidence that supports your nonsense.
Except for assembly dumps and 2 benchmarks.
>>
File: 1481994392274.jpg (264KB, 1589x646px) Image search: [Google]
1481994392274.jpg
264KB, 1589x646px
>>61042911
kek
this >>61042928

>>61042830
still waiting for the meshed version I'm not doing myself

Also:
>All the C and C++ brain ants infighting
I mean, C++ wins any time by the fact that every known C programmer like LinusTechTips and the ganoolets is a brainlet and I'm too intelligent for it, but still.
>>
>>61043753
The benchmarks were not an evidence for anything related to the topic.
The assembly dumps supported me.
>>
when I run this simple code expecting output of (0, 1, 1) I get crazy numbers like (-1631314696, -267, 269). It changes on recompiles, I don't understand how its undefined behavior.

std::vector<int> a;
std::vector<int>::iterator it = std::upper_bound( a.begin(), a.end(), 2 );
a.insert( a.begin(), 2 );
std::cout << std::distance(a.begin(), it) << std::endl;

it = std::upper_bound( a.begin(), a.end(), 4 );
a.insert( it, 4 );
std::cout << it - a.begin() << std::endl;

it = std::upper_bound( a.begin(), a.end(), 3 );
a.insert( it, 3 );
std::cout << it - a.begin() << std::endl;
>>
>>61043770
>The assembly dumps supported me.
Like how when qsort and it's comparator were not inlined?

>The benchmarks were not an evidence for anything related to the topic.
The topic was the performance of qsort vs std::sort.
2 independent benchmarks showed std::sort being twice as fast due to inlining.
>>
>>61043790
Have you thought about trying a non-shit language?
>>
>>61043790
There's plenty of C++ experts talking trash about irrelevant functionality. I'm sure they'd stop to help you.
>>
>>61042830
Picture is accurate except that instead of a chain of point/laugh it should be a tower where the smallest (Microsoft .NET) is also the skinniest and each one from there on up is fatter and having to support all the fatter ones on top of them while the fattest slob at the top (Rust / SJW lang) doesn't have to hold anyone and is a disgusting fat pig who squashes the hard working skinny people under her girth while gorging on grease 24/7 reminder that the only reason she has access to the tub of lard she is stuffing her face with is because the people she is fucking crushing with her weight work so hard for her
>>
>>61043813
>Like how when qsort and it's comparator were not inlined?
There were no dumps for that, but even if there were, they would be irrelevant.

>2 independent benchmarks showed std::sort being twice as fast due to inlining.
For the last time, the benchmarks compared implementations, not qsort vs std::sort per se as these can't be compared by themselves.

This will be my last post from me, arguing with braindead people is REALLY tiresome.
>>
Ok so i got a project with c# asp.net and im stuck on a method
What im trying to acheive is show the information of a data grid view row when user searches by name
So i got a data grid view with name column and some other column
I got a text field and search button
After u enter the name and search press the click method is supposed to compare each row of column where names are find the row index then show all the other columns with the same row info in a label or something
How do i do this? Idk which premade methods to use to scan a datagridview column
>>
>>61043790
All vector's iterators are invalidated on push/insert/whatever, you can't use `it` after `a.insert`.
>>
>>61043839
please don't give me unsolicited weird boners
i don't want to be as "interested" in this idea as i am right now
>>
>>61043851
So it was a troll all along.
>>
>>61043851
>There were no dumps for that, but even if there were
Yes there were
>they would be irrelevant.
No they aren't, that was the whole point of the discussion.

You keep saying it's not the point, then what is the point?
>>
>>61043790
Use after free.
Rust literally prevents this bug.
>>
File: 1480983666040.jpg (136KB, 698x658px) Image search: [Google]
1480983666040.jpg
136KB, 698x658px
>it's a "qsort vs std::sort" thread
>>
>>61042830
>rust is huge and bloated and laughing at it's superiors
>>
>>61043911
ata.List.sort
>>
>people voluntarily get stds in their code
Who'd make their ai waifu be born with stds?
>>
>>61043866
more specifically, vector iterators are only invalidated on inserts if the container size is greater than when the iterator was created.
>>
>>61043906
>Rust literally prevents this bug.
By restricting what code you can write.
Rusts borrow checker can sometimes force you to write a less elegant solution because it's stupid borrow checker is too coarse.
I liked Rusts features and concepts but it's borrow checker is fucking retarded. I moved back to C++ where I can still apply it's concepts and some of it's features introduced in C++17 but not be treated like a retard who can't program properly.
>>
>>61043939
#define condom namespace std
using condom;
>>
>>61042830
Rustfags aren't laughing at anyone, they're unironically begging people to use their language in every single programming thread.
>>
>>61043970

can't you enter an unsafe mode?
>>
>>61043974
>disguising stds as condom
Vile.
>>
>>61043982
Yes
>>
>>61043982
Unsafe blocks don't turn off the borrow checker, and it's discouraged to use unsafe blocks.
>>
>>61044003
Then what's the point?
>>
>>61044011
make the ultimate cuck-language.
>>
>>61044011
To allow dereferencing of raw pointers and call functions marked as unsafe, and also to mutate global variables.
That's all, I think. There may be some other small details.
>>
>>61043977
You're confusing them with D-friends.
>>
>>61044095
At least D-friends don't bash others for not using their language.
>>
>>61044160
unless you're a sepplesfag
>>
>>61044160
Well yeah, you can't bash someone when you're dead.
>>
>>61044160
Oh I'm absolutely sure Walter Bright himself shitposts on /g/.
>>
>>61044171
Or a c-fag, or a go-fag, or a rust-fag, or a java-fag, or a sharp-fag.
>>
This will anger schemefags.
(define my-function
(lambda
>>
>>61044182
Actually it's just Andrei and these Romanian students he has hired to shill on /g/.
>>
>>61044197
>muh "lamb duhs"
>muh "moan ads"
>>
Is racket good? Looking into lisp or scheme. Racket came up.
>>
>>61044197
Why should this anger me?
>>
>>61044217
It's the Python of Lisps. Pretty and packed with features, but slow as fuck and touted as an "educational" language.
>>
>>61044095
That's how it was some years ago. Rust is the new D, and it'll die too.
>>
>>61044198
makes sense
>>61044197
good
>>61044217
well...
>racket -> lisp for people who want to teach/reinvent the wheel
>scheme -> lisp for morons
>clojure -> lisp mostly for web hipsters
>CL -> the only lisp with a sane standard and good implementations
>>
>>61044249
racket is not slow at least when compared to other schemes.
>>
>>61044217
Racket is probably the easiest scheme to learn. It has builtin support for SICP Scheme, and there are loads of good books on Racket. They've got a pretty good package system, and an easy to use FFI. Their IDE, Dr Racket is bretty gud as well, but entirely optional. Emacs + Geiser + Racket is my preferred Scheme environment. Their documentation is really easy to read, and the community has a sterling reputation.

>>61044256
Don't listen to this guy, he doesn't know what he's talking about. Racket is a Scheme, and Scheme is similar to Lisp. Clojure is a perfectly good language, and is probably the best language available for the JVM right now. There's no "reinvent the wheel" in racket compared to other Scheme languages.
>>
>his assembly language doesn't even have lambdas
>his cpu still uses shitty imperative constructs like "instructions" and "opcodes"
Literally why even live?
>>
>>61044296
hardware level garbage collection and only floating points when?
CPU should be able process json also.
>>
>>61044319
>only floating points
eww, what if I want to add .2 and .1?
>>
>>61044319
>CPU should be able process json also.
Well, that's why you want hardware gc, right?
>>
>>61044327
wait, what's wrong with this? Been outta school for a while dess
>>
>>61043099
>C++ is better than C
bwahahahahaha
>GCC and LLVM
>most optimized
BWAHAHAHAHAHAHA!
>>
>>61044347

open the js console in your browser and check
 0.1 + 0.2 == 0.3
>>
>>61044345
>hardware gc
how would you even do this?
>>
>>61044347
Do you have python installed? Try adding .2 and .1
>>
>>61044360
The lisp machines in the 70s had it.
>>
>>61044319
also desirable feature: memory devices that are associative instead of serial. no low level hashing allowed, that's cheating. the associativity should be at the hardware level
>>
>>61042830
I do all 4, C is the best programming language ever made. Rust is trash
>>
>>61043254
>C++ in a microcontroller based project is not feasable
iow, you don't know what the fuck you're talking about
>>
>>61044287
>Don't listen to this guy, he doesn't know what he's talking about. Racket is a Scheme
Racket is a toolkit for creating languages, you mongoloid. It even says so on its homepage.
It has some substandard scheme implementation shipped with it that you explicitly have to activate, but who cares.
also
>Scheme is similar to Lisp
>Clojure is a perfectly good language, and is probably the best language available for the JVM right now
Literally why even live?
>>
>>61044379
how would that even work?
>>
>>61044211
>muh
>>>/v/
>>
Why am I getting error in creating swap chain d3d12?
>>
>>61044393
check the implementation manuals.
>>
File: eggy.jpg (59KB, 500x526px) Image search: [Google]
eggy.jpg
59KB, 500x526px
>>61044395
> >
> >>>/
>>>/trash/
>>
>>61044389
>https://racket-lang.org/
>Racket is a general-purpose programming language as well as the world’s first ecosystem for developing and deploying new languages
When people discuss Racket, they are typically referring to Racket Lang formerly known as PLT Scheme.
>Literally why even live?
You must decide that for yourself.
>>
>>61044446
>as well as the world’s first ecosystem for developing and deploying new languages
Wow! So Racket developed and deployed C?
Cool!
>>
>>61044446
>When CS first semesters discuss Racket, they are typically referring to Racket Lang formerly known as PLT Scheme.
FTFY
>>
>>61044484
This edit also has a mistake.
>When people discuss Racket, they are typically referring to Racket Lang formerly known as PLT Scheme.
FTFY
>>
>>61043360
It is though. You're gonna have this thing in all your programs written in the language. Better get the symbols at load time than have them present in every binary ever.
>>
>>61044484
>CS first semesters
>he did not learn Racket in high school
t. brainlet
>>
Was it a mistake to make conditions a part of every ARM instruction?
>>
>>61044510
>he fell for the high school meme
How does it feel being so gullible?
>>
>>61044517
>high school is not mandatory in his country
>he is not an american
How does it feel being so brown?
>>
>>61044498
This edit also has a mistake.
>When CS first semesters discuss Racket, they are typically referring to Racket Lang formerly known as PLT Scheme.
FTFY

>>61044510
>not being ivy league Hasklel
>>
>>61044512
Yes. Risc-V will fix it.
>>
>live in literal third world poo hole
>westerner are call you pajeet
>yuor name is rajeesh
>very VERY rude to mispel name on purpose
>westerner tell you that yuo are "brain let" and no can program
>worst part is
>HE RIGHT
>BUT ONLY BECASE YOU CAN NOT AFORD ENOUGH FOOD TO BRAIN GOOD
>very humiliate
>feel much bad
>what for do?
>>
>>61042830
>C++ laughing at C
As Linus would've said, *YOU* are full of bullshit.
>>
>>61044582
poo in loo, my friend
>>
>>61044582
i cry everitm
>>
>>61044589
Q S O R T
S
O
R
T
>>
>>61042830
Trying to get the energy to do some ctf challenges and some project euler
>>
>>61044589
Why would I care what some gadget pleb thinks https://www.youtube.com/watch?v=yZJciVoBaRg
>>
>>61044591
not allowed
loo belong to superior caste
i would be kill
>>
Do you wear a suit at work? If so, what country are you from?
>>
>>61044608
>not implementing your own qsort as a macro that replaces the recursion with an iterative algorithm involving a pushdown automaton
>literally why even live
>>
File: 1498228632540.jpg (180KB, 2038x1505px) Image search: [Google]
1498228632540.jpg
180KB, 2038x1505px
>>61042830
Fixed.

>>61044621
He wrote the Linux kernel. What did you write with your shitty language?
>>
>>61043839
This is the fucking truth.
>>
>>61044681
>C++ laughing at anyone
>>
>>61044681
>What did you write with your shitty language?
Another kernel.
>>
>>61044681
s/C/Java
>>
>>61044681
>being this butthurt about his language being 2 times slower than C++
>>
>>61044730
Wrong.
>https://benchmarksgame.alioth.debian.org/u64q/c.html
>>
>>61044648
No.

US, Texas.
>>
>>61043369
Rust code is more portable than C/C++
>>
>>61044887
Hahahaha
>>
>>61044589
friendly reminder that for his latest app, linus moved from c to c++.
>>
>>61044887
kek
That'd be true if they supported any other arch than x86.
>>
>>61044900
Even the size of a fucking int is not portable
>>
>>61044908
Which "app" is that?

>>61044887
>>61044730
>Blatant lies.
>>
>rust and C arguing over who is more portable
>meanwhile living in the comfy JVM
>>
>>61044936
little baby pajeet is safe in his bubble :3
>>
File: 1491585550214.jpg (112KB, 1087x1080px) Image search: [Google]
1491585550214.jpg
112KB, 1087x1080px
>>61044887
>>
>>61043369
https://forge.rust-lang.org/platform-support.html
>>
>>61044914

Portable code and architecture support are different things.

Besides Rust supports tons of architectures.
>>
>>61044924
Ever heard of <stdint.h>?
>>
>>61044934
https://en.wikipedia.org/wiki/Subsurface_(software)
>>
File: rust platforms.png (373KB, 860x2736px) Image search: [Google]
rust platforms.png
373KB, 860x2736px
>they don't know
https://forge.rust-lang.org/platform-support.html
>>
>>61044887
Time to take your meds man.
>>
File: time-lapse.mp4.webm (2MB, 1280x720px) Image search: [Google]
time-lapse.mp4.webm
2MB, 1280x720px
a tiimelaps of me working on a microcontroller to do timelapses with my DSLR :^)
actually my prototype is working, but now gotta get a nice display and mount it on that atmega8 board which we made in uni.
In this exact clip I was more or less working on the ADC, because I want to use it to regulate timing intervall
>>
>>61044887
>>61044924
How many hardware platforms does rust support again??

>>61044992
>Guaranteed to build, not guaranteed to work
trash
>>
>>61044993
c and c++ have too much implementation/undefined behaviors that rust has not.
>>
>>61044969
No shit. Doesn't change the fact that a lot of assumptions are made regarding pointer size and int size everywhere in C when code is written leading to portability issues. Something that never happens in Rust mind you.
>>
>>61044980
Still 30% C.
>>
>>61044968
>Besides Rust supports tons of architectures.
One tier 1 architecture is not a tone dear anon.
>>
>>61044994
edit it to cut out the bits where you do nothing
>>61044953
just basing in the benefits of modern languages
>>
>>61045005
It's the programmer's responsibility to not put undefined behavior in his code.
Not to mention that C is an international standard, unlike your stupid language.
>>
*yawns*
>>
File: IMG_5503.jpg (320KB, 3000x2000px) Image search: [Google]
IMG_5503.jpg
320KB, 3000x2000px
>>61045020
>edit it to cut out the bits where you do nothing
no, because it was just a fuckin test, nigger.
Apperently it works, now just make it more nice

Thats what it looks right now.
Made that yesterday and used a attiny85, but I need atleast one pin more, so I move up to a atmega8 now (since I have that board ready)
>>
>>61045057
StackOverflow survey showed that Clojure is on top.
>>
>>61043014
(>>>) actually
>>
>>61045057
well, C is over 100k. So thats fine.
>>
>>61045015
>Only 30%
And decreasing.
>>
>>61043687
>curly braces are C syntax
>>
>>61045057
I'll bet tens of minutes were spent making that up in photoshop.
>>
>>61043970
Borrow checking in general is great, but I agree, Rust's is too strict. Well, actually it tends to be the APIs of the standard library and 3rd party libraries that are too coarse when it comes to borrowing.
>>
>>61044980
>As Subsurface binary software deployment for Linux users for the various Linux distributions turned out to be problematic,[9][10] the packaging was changed to a portable, self-contained, distro-agnostic[clarification needed] AppImage in 2015.[11]
Lmao, not even torvalds can properly package a binary application for his own operating system.
>>
>>61045105
https://jobsquery.it/stats/language/group
>>
>>61045130
What operating system?
>>
>>61045151
Gentoo
>>
>>61045151
GNU+Linux
>>
>>61045094
That's what happens when you use Qt, the majority of the core is written in C
>>
>>61044992
>Rustaceans don't even support their own killer-app OS
>>
>>61043970
For fucks sake. If your code is rejected by the borrow checker IT IS FUCKING WRONG. The fact that the same code would compile on C/C++ doesn't mean it's correct.
>>
>>61045169
Oh, so you meant the operating system he is running.
I thought you were mistakingly calling GNU+Linux his invention.
>>
>>61045094
>last commit is in 2011
Yeah, right.
>>61045101
Yes they are, and many languages copied it.
>>
>>61045194
Not necessarily. Rust's borrow checker is very conservative.
>>
>>61045194
IIRC the borrow checker has been known to give false positives. I'm pretty sure that for any language with non-trivial semantics, determining if code is correct is equivalent to solving the halting problem.
>>
>>61045219
>for any language with non-trivial semantics
You mean with function calls and branching?
>>
>>61045202
there was a commit 3 hours ago
https://github.com/Subsurface-divelog/subsurface/commits/master
>>
>>61045194
The borrow checker is notorious for rejecting correct code.
>>
>>61045005
>write stupid code
>get stupid answers
>>
>>61045180
The guy behind redox os is primarily the one to add support for redox os in the compiler, for example: https://github.com/rust-lang/rust/pull/42762
>>
>>61045234
Not by Torvalds. And what does that program even do?
>>
>>61045219
>I'm pretty sure that for any language with non-trivial semantics, determining if code is correct is equivalent to solving the halting problem.
Nope. Corecursion gives you Turing completeness and it's easy to check.
>>
>>61045194
>If your code is rejected by the borrow checker IT IS FUCKING WRONG.
Wrong.
I've written plenty of correct code that the borrow checker would reject.
The borrow checker isn't perfect, in fact there's plans right now to make the BC more fine grained in the future, accepting more code that would currently be rejected, because even the Rust team knows that their BC is too coarse.
https://github.com/rust-lang/rust-roadmap/issues/16
>>
>>61045260
Dive log, for scuba divers, pretty self explanatory.
>>
>>61045231
Not even function calls are necessary. Even if your language is constrained to increment, decrement, jump on zero/non-zero, and some form of I/O, there does not exist a generalized algorithm to statically determine if a program in that language is correct.
>>
>>61045194
The borrow-checker assumes that each variable has a unique owner. For some data structures, this isn't the case, e.g. the nodes of a doubly linked list, where each node owns and is being owned the previous and next node.
>>
>>61045283
That's when you start to use coq.
>>
>>61045255
Well that makes sense honestly. I just thought they'd be a bit more enthusiastic for the project. Having a fully self-hosting OS (bar LLVM) would really increase the credibility of the project.
>>
Rust would be better without the BC, desu.
>>
>>61045312
>ever implementing a linked list
>>
File: 1488321839821.png (136KB, 320x371px) Image search: [Google]
1488321839821.png
136KB, 320x371px
>>61045315
>cock
But yeah exporting source code from formal theorem provers might be the only practical way to write guaranteed safe code we ever find.
>>
>>61045319

>Rust would be better without the USP
>>
>>61045319
Rust would be better with HKTs. I can work around the borrow checker especially if I'm not using any libraries (just core).

>>61045337
>what are general purpose dependently typed languages
>>
>>61045319
Rust would be C++ without the BC, t b h.
>>
>>61045319
Rust would be better if it had green threads and a garbage collector.
>>
>>61045327
Linked lists are better than arrays because they aren't subject to buffer overflows.
>>
>>61045365
linked lists also have O(1) insertion and deletion
>>
>>61045327
You'd just use the one from the standard library, which internally has to use a lot of unsafe blocks, e.g: https://doc.rust-lang.org/src/collections/linked_list.rs.html#156-170
>>
>>61045365
you just fucking segfault instead
>>
File: happy_merchant.jpg (19KB, 220x220px) Image search: [Google]
happy_merchant.jpg
19KB, 220x220px
I need to find an ORM for Visual Basic
>Le meymey language
Yes I know, I do it for the shekels, what's a good one you'd recommend, /dpt/?

I am reading this as we speak:

https://visualstudiomagazine.com/articles/2015/11/01/management-tools-for-visual-studio.aspx
>>
>>61045305
Well, no, you also need a type system in order to be able to check the user's specification or infer one. Without that, there is no sense of correctness in the first place.
>>
>>61045346
Shit that combines the lack of features and long compile time of theorem provers with the shitty design decisions induced by having to satisfy general purpose programming on top of that.
See: Idris.
>>
>>61045374
Security > speed

>>61045383
Segfaults rarely allow arbitrary code execution. Ever heard of a fail-safe?
>>
>>61045411

if you're not concerned about speed then just use Java or some other managed lang
>>
>>61045305
>there does not exist a generalized algorithm to statically determine if a program in that language is correct
NO. There is an algorithm that, if there exist a proof of correction (or incorrection), will provide that proof in finite time.
>>
>>61045408
Idris is garbage, don't get me wrong, but I saw it coming a long way off. I plan to prove you wrong.
>>
>>61045360
>Rust would be C++ without the BC, t b h.
Yes, a better C++.

>>61045364
No, that would ruin the whole language.
>>
File: 1339112127540.jpg (538KB, 849x866px) Image search: [Google]
1339112127540.jpg
538KB, 849x866px
Programming newb here.
How do I use Cygwin to compile and debug C programs?
>>
>>61045401
That goes without saying since it is impossible to have a language without one. Without types, no manipulation of data is possible. All the so-called "typeless" languages are really unityped. You might need a WELL DESIGNED type system if you want your program to function correctly in the presence of complex inputs, but even something as rudimentary as a binary Turing machine has a form of type system.
>>
>>61045446
Didn't know Google was down.
>>
File: morning.png (355KB, 811x406px) Image search: [Google]
morning.png
355KB, 811x406px
>>61042830
>incompatible types: String can not be converted to char[]
what the FUCK? I thought Strings were just character arrays? What's going on here, java?
>>
>>61045432
>No, that would ruin the whole language.
The language is already ruined by the borrow checker.
>>
>>61045429
>There is an algorithm that, if there exist a proof of correction (or incorrection), will provide that proof in finite time.
That's not a complete solution, unless it can also determine the non-existence of a proof within finite time as well.
>>
>>61045484
I know, but there's no point in ruining the language yet again by replacing it with a GC.
In fact, I'd rather the BC than a GC.
>>
>>61045446
Put in a bat script (ie cygwin-msvc10-x64.bat)
@echo off

E:
chdir E:\cygwin64\bin

call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x64

REM bash --login -i
mintty -i E:\cygwin64\Cygwin.ico -


And you can run it to have msvc build toolchain in your env.

Fix the path because it's configured for my machine.
>>
>>61045467
Strings are immutable, char[] is not.
No idea why StringBuffer isn't a char[] though. Maybe helper methods?
Anyway, use .toCharArray();
>>
>>61045467
You're thinking of C. Java uses high-level strings, meaning they're a compound type, meaning implicit conversion is not possible. There's probably a String method to convert it to a char array though.
>>
>>61045446
run setup.exe
install gcc
vi hello.c
write program
gcc hello.c
./a.exe
>>
>>61045467
>He doesn't use a language where custom types can be context-converted to other types
>>
>>61045518
>In fact, I'd rather the BC than a GC.
Why? The garbage collector does not maim your code as the borrow checker does.
>>
File: 1443062162253.webm (383KB, 416x440px) Image search: [Google]
1443062162253.webm
383KB, 416x440px
>he's using a language that isn't a type theory describing an abstract machine
>>
>>61045525
>meaning implicit conversion is not possible
Of course it is.
In C++ this is just
operator const char*() { ... }
>>
>>61045548
>he's using a language that isn't a type theory describing a real machine
>>
>>61045542
Yeah, just your performance.
>>
>>61045555
this program doesnt compile on my machine
>>
>>61045542
Yeah, it maims your runtime and performance instead.
>>
>>61045555

I always wondered why this wasn't added to std::string
>>
>>61045542
What? BC can reject a valid code occasionally, but it doesn't maim it. GC, on the other hand, requires several times as much memory to achieve comparable performance and inject its GC stuff right in the middle of your code.
>>
>>61045561
Wouldn't be portable.
>>
>>61045527
>implying a wincuck knows how to use vi
>>
>>61045571
It has to be inside your custom class or struct, obviously.
And fill in the ... ofcourse.
>>
>>61045585
vi is a lot harder to use than Vim, but I can use it nonetheless.
>>
>>61045555
Java doesn't support operator overloading, so that sort of implicit casting isn't possible. Although Java does overload the addition operator for strings as "a special case", so there's no reason why they couldn't define a cast operator for built-in object types.
>>
>>61045577
Probably because it's not clear whether it should return .data() or .c_str().
>>
>>61045616

>Java supports the addition operator for the most questionable case of """addition"""
At least it cuts back on the boilerplate.
>>
>>61045613
vi is syslinked to vim on most machines
>>
Always makes me laugh when Java fags trip over themselves trying to justify the lack of operator overloading (or operator definition in the first place) when it still permits a fuck tonne of method overloading.
>>
>>61045563
>>61045574
Most applications are I/O bound anyway. The overhead of the GC is negligible.
>>61045582
>get vs get_mut
>Vec<Rc<RefCell<Box<Trait>>>>
>>
>>61045525
>You're thinking of C
C doesn't have any "String" data type. Only character arrays.
>>
>>61045640

>B-but morons might overload + to mean something which isn't addition
>It's not like they could do the same for methods and interfaces
>>
>>61045642
Rust isn't meant for I/O bound applications. Go use Python if that's your use case.

>get vs get_mut
So the compiler should infer the programmer's intent?

>Vec<Rc<RefCell<Box<Trait>>>>
Doesn't happen.
>>
>>61045651
That's what we call strings.
>>
>>61045640
>he cares about javamasters enough to shitpost about us
>meanwhile we don't even waste a singe moment of potential productivity thinking about members of his "language"
c++ is a meme
>>
>>61045642
>Most applications are I/O bound anyway
Maybe the applications you write.

It would be detrimental to the applications I write.
>>
>>61045658
I like to point out that the designers of Java themselves violated the first "rule".
>>
>>61045584
Sure it is, just move the machine.
>>
>>61045666
>Rust isn't meant for I/O bound applications. Go use Python if that's your use case.
So why do Rust fags hype up Tokio so much?
>>
I've been trying to learn 2D OpenGL and glut is not providing enough features I need something more GUI like. I've tried experimenting with some GUI toolkits but they are way too big and require a ton of extra code just to do simple stuff and I couldnt figure out how to get glOrtho to work with them to just setup 2D drawing.
>>
>>61045337
Why not use Ada SPARK or TLA+?
>>
>>61045679
those are quite plebeian "strings" you have there
>>
>>61045626

I'm not sure what the difference is. Let me take a crack.
.data() simply returns a pointer to std::string's internal char[] wiithout any additional work.
.c_str() will also return a pointer to std::string's internal char[], but it will possibly add a null terminator (which is not considered to be part of the string's char[]) at the end
Is that right?
>>
>>61045702
Is that how Rust achieves portability?
>>
>>61045706
I/O bound does not mean "I/O event loop" bound.
>>
>>61045719
>writing the same program twice
>>
>>61045723
They work perfectly. I never complain.
>>
I desperately need a project
>>
>>61045735
Or Iron, Nickel, Rocket.
>>
>>61045756
you can work on mine ;)
>>
>>61045651
typedef char *String;
>>
>>61045756
OpenMW
>>
>>61045727
Yes.
Basically .data() is not guaranteed to return a null terminated char array, while .c_str() is.
Should
operator const char*()
return .data() or .c_str()? I think returning .c_str() should work for pretty much all cases, but maybe the committee has their reasons.
>>
>>61045759
I'm not sure what your point is. None of those things can make your hard drive or internet connection faster. That's what I/O bound means, when the I/O sources or sinks are the bottlenecks.
>>
>>61044681
Muh tic-tac-toe program in Visual Basic. I'm a l33t hax0r.
>>
>>61045756
Reimplement the MS-DOS ``API" in Brainf*ck.
>>
>>61045783
Nice try, Karl Marx.
>>
>>61045777
Also, I'd like to add that std::string_view solves any issues you might have with std::string not being context convertible to const char*.
>>
File: 16634.jpg (24KB, 318x470px) Image search: [Google]
16634.jpg
24KB, 318x470px
>>61045771
gimme

>>61045775
looks fun, thanks

>>61045798
looks not fun
>>
>>61045807
>shitpost about Rust
>get BTFO
>call people Marxists
Will this ever stop?
>>
>>61045777

Makes sense. In general I think that any implicit behavior should be obvious, and picking one of those arbitrarily would break that rule.
>>
>>61044730
A language is just a language. It is not inherently faster or slower due to implementations of one language being faster than implementations of another language.
>>
Null terminated strings were a mistake.
>>
Reminder to believe in yourself.
>>
>>61045849
The features a language has are responsible for the techniques the implementer has at his disposal.
If some task is faster in every implementation of one language than it is in every implementation of another, you can generally thank the designs of those languages.
>>
>>61045870
This.
>>
>>61045829
>defending Rust
https://doc.rust-lang.org/1.4.0/book/dining-philosophers.html
struct Philosopher {
name: String,
}

impl Philosopher {
fn new(name: &str) -> Philosopher {
Philosopher {
name: name.to_string(),
}
}
}

fn main() {
let p1 = Philosopher::new("Judith Butler");
let p2 = Philosopher::new("Gilles Deleuze");
let p3 = Philosopher::new("Karl Marx");
let p4 = Philosopher::new("Emma Goldman");
let p5 = Philosopher::new("Michel Foucault");
}
>>
>>61045870
No.
Claiming that everybody can code is a mistake.
>>
>>61044955
this man is fat
reminder that fat """""people""""" are evil
if you disagree you are fat
>>
>>61045891
This is how it works, little baby. The retards who want to inject their politics everywhere settle for working on stuff like documentation. People who actually write code don't pull these stunts.
>>
>>61045891
>1.4
Why did you link to outdated docs?
>>
>>61045429
Doesn't that just reduce to the halting problem?
>>
>>61045930
>making a distinction between these two classes of people
>not writing your own documentation
>being this much of a brainlet
>>
>>61045870

size tagged strings > null terminated strings
nobody uses NULL terminated arrays, they put them in a struct with size/capacity tags
>>
new thread
>>61045958
>>
>>61045930
>>61045947
Why do you defend Marxism?
>>
>>61045820
4chan scraper in haskell
has markov chain generator to produce comments from a particular board
>>
>>61045948
Yes, but.
The program can loop forever, but if there is a proof it will find it (exactly like for the halting problem).
>>
>>61045467
That's high-level programming for you. The language assumes it knows what you want to do better than you do. I'm sure strings are character arrays under the hood, but it abstracts that away from the programmer to make it more "user friendly".
>>
File: 1485505911069.png (1KB, 71x22px) Image search: [Google]
1485505911069.png
1KB, 71x22px
>>61045930
This.
And the weebs settle on stuff like testing.
https://github.com/rust-lang/rust/search?utf8=%E2%9C%93&q=homura&type=

Also, I just noticed pic related in the URL. Cheeky Github.
>>
>>61046000
>homura: 20 code results
>madoka: 13 code results

It's official, Homura > Madoka.
>>
>>61045893
https://www.youtube.com/watch?v=-JPOoFkrh94
>>
>>61045585
I would think a wincuck wouldn't bother trying to use Cygwin and would be happy doing everything in Visual Studio.
>>
>>61045682
I take it you mostly write system maintenance daemons then?
>>
>>61045884
Well, since C++ is more or less a superset of C, I don't see how it can be inherently faster.
>>
File: N'wah.jpg (15KB, 141x114px) Image search: [Google]
N'wah.jpg
15KB, 141x114px
>>61045870
Why? You have thirty seven (37) seconds to give me no fewer than one (1) and no more than 14 (fourteen) reason why \0 isn't perfectly fine.

I'm waiting.
>>
>>61046297
Because I suck at coding.
>>
>>61046322
wrong
>>
>>61046322
The only right^H^H^H^H^H acceptable answer.
>>
>>61046297

because you don't null terminate other variable-size arrays, you tag them with their size
int *stuff[] = {&i, &j, &k, &l, NULL }; // retarded
>>
>>61045991
Which means there is no general solution for the halting problem.
>>
>>61046067
>https://github.com/rust-lang/rust/search?utf8=%E2%9C%93&q=homura&type=

Why is there code referencing medukas in rust's source code?
>>
>>61046456
No but it means that there is a general algorithm that prove correctness of correct programs.
>>
>>61046441
>>61045961
Actually I use null-terminated arrays of pointers to strings as option lists for text-mode menus.
>>
>>61046492
Which does not qualify as a ``solution" unless P=NP.
>>
>>61046297
String slices.
>>
>>61046525
There is an algorithm. I do not care if I have to wait 0.000001 second or 1e19 years. It's still an algorithm.
>>
>>61046555
But the time isn't bounded. It's infinite. Your algorithm is only useful if you already know your program is correct but don't have a proof (and how would you KNOW it's correct without a proof?). If you don't know if your program is correct, then you might be waiting 300 gazillion years for a proof, or the proof might never come at all and the proof checker will keep running forever.
>>
>>61046981
I never say the oppposite.
>>
>>61045239
>citation needed
>>
>>61044393
it probably had a microcode implementation of a memory allocator and garbage collector

then you just call the cons instruction or whatever and it does it all for you
Thread posts: 354
Thread images: 23


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