/dpt/ - Daily Programming Thread

old thread: Friendly reminder not to reply to the D language shitposter, they are the same person who spams that illya mac desktop all day.
They will also reply to you the same way, do not talk to him.

Other urls found in this thread:

rust-lang.org/en-US/faq.html
github.com/commit-sudoku/firefox-css
youtube.com/watch?v=u_hDHm9MD0I
en.wikipedia.org/wiki/Computable_number
en.wikipedia.org/wiki/Sieve_of_Eratosthenes
twitter.com/NSFWRedditImage

nth for lets all get along and share what were working on

First for anime.

If you have freedom of speech you are free to reply to anyone.

I need to learn python to get A on reprogramming class

I'm just a dumb engineer

D shitposting is mild and actually rather fun. Unlike "muh buffer overflows" and "whom art thou quoting" shitposting, which have really become stale.

>
>that would imply
Only if you're a brainlet.

Free speech is a spook.

rust-lang.org/en-US/faq.html

>Does Rust do tail-call optimization?

>Not generally, no. Tail-call optimization may be done in limited circumstances, but is not guaranteed. As the feature has always been desired, Rust has a keyword (become) reserved, though it is not clear yet whether it is technically possible, nor whether it will be implemented.

>What are higher-kinded types, why would I want them, and why doesn't Rust have them?

>[T]here’s no inherent reason for the current lack of support.

Why is there so much hype about Rust?

wtf is a reprogramming class

>Friendly reminder not to reply to the D language shitposter
Wow, sorry for responding to faggots sperging out over a language

Sorry
Programming class
I'm learning shit like octave, but now I need to git gud on python

Because it does something different.
People dont care whether its good or bad.
Personally i see rust becoming as bloated and clusterfucky as c++

>Why is there so much hype about Rust?
People use it, they like it, they recommend it to the others. That's how. Every languages have their shortages and from what I see, you really are nitpicking

Have you read your SICP today?

I don't think wanting to be able to guarantee TCO in a language in 2017 is really nitpicking. Scheme has had it for *decades*.

Well, they have a keyword reserved for it, they may implement it later down the road

Yes.

Threadly reminder that dlang-chan is not dead, and she's super duper cute and holy fuck you guys are absolutely retarded: stop shitposting over language usage and start a decent discussion or at least shitpost over something else. FUCK
Oh, and she's fast! Say something nice about her, you mongs!

Bought it years ago, never read it.

fite me

D is easy to prototype. This is why I like D

>they may implement it later down the road
Just like D will get rid of its garbage collector soon! You just have to wait a little longer, honest!

I'm being harsh, but the promise of something this basic maybe, possibly being implemented at some point in the future doesn't exactly fill me with confidence.

Please just stop, I'd really rather not see more shitflinging

>Just like D will get rid of its garbage collector soon!
When did I say that?
Also, you can strip D out of it's runtime and GC

>Can I overload operators? Which ones and how?

>The following operators can be overloaded:

Why can't I just define my own symbolic operators/functions, like >=> and >>> and =

Yes it is! Thank you for not shitposting.

Those faggots will just shitpost about something else then. That's how they work.

Read about some different implementations of DMRG and QMC today.

operator overloading is bad and you should feel bad if you do it

I never said you said that, I'm just comparing you saying Rust may implement a way to guarantee TCO at some point to people saying D will get rid of its garbage collector at some point.

Having to fuck about with the language/runtime doesn't count, you could implement TCO in Rust by editing the source and changing the language, it wouldn't mean Rust today has TCO.

Although I am thinking of ditching D since I am getting used to Rust by the days. Writing D programs without GC is tedious

t. java programmer

I'm not really inclined to take design advice from a language in which this compiles:

String[] strings = new String[10];
Object[] objects = strings;
objects[0] = new Integer(3);

one day they'll bite you in the ass, have fun while you want to though

Operator overloading is bad in most cases, but in some it can be useful; with that said, those cases still don't justify its inclusion in a language.

And I can't blame you for it. I'll probably be dead before dlang-chan gets her GC tumor removed. And yet, I still love working with her. She and C are my langfus.

When is she going to get rid of that garbage collector?

Been programming for years and never been bitten by overloading operators.

It must be so frustrating, needing the language to straitjacket you in order to stop you hitting yourself in the face. Most people just don't hit themselves in the face.

There are many language without GC as well.
D is in the middle ground really.

I'd suggest an alternative stdlib with no GC instead of removing GC altogether, GC is quite handy at times.

When her parents can afford chemo.

you're the first person i've ever heard be up on a high horse about operator overloading. it's not elegant or impressive, genuinely don't know why you seem proud of it

Making @nogc exceptions will actually be a big step in making Phobos completely GC-free (though I haven't heard where Walter is with this, he might have talked about it at DConf). Until then, it doesn't bother me too much.

...

Would you rather have

a . b . c


or

compose(compose(a, b), c)


?

>Why is there so much hype about Rust?
No such thing, only propaganda from SJW because their plan's taking IT sector hostage now

That's also the same reason why suddenly everyone is "hyping" inclusion in tech for no good reason at all

Why?

a ∘ b ∘ c

Operator overloading, then.

compose(a, b, c)

i'd rather use the syntax supported by the language, rather than building my own composition operator with operator overloading

Disgusting.

Not an operator. My language doesn't have those.

But everyone knows that symbolic names means you're overloading operators. Function and method names cannot be symbolic.

It's an operator

My language doesn't have "methods". Only functions.
And why would I be overloading them? There is only one type in my language.
Nope.

>Function and method names cannot be symbolic
According to whom?

github.com/commit-sudoku/firefox-css

this is firefox after some css, is there a way I can make or get this theme on google chrome? does google chrome allow u to customize the tabs like that, so far ive just seen themes for it webpages and the only thing that I think has come close to me achieve what I want is a webpage from google from 3 years ago telling me ill have to code it in c sharp or some sht

According to C++, Java, and C#. Y'know, real languages.

>There is only one type in my language.
And that type is trash.

What is a "real" language? The things you listed are shit languages only an idiot would use, there is nothing "real" about them.

What do you have against real numbers?

it's got nothing to do with types and everything to do with infixitivity

Upcasting?

or mixfixitivity

They're mostly uncomputable.

Java arrays are covariant.

So? That doesn't stop me from using them as my main type.

You wouldn't use a space of 2^32 values to represent three possible results from a function...

Oh wait, Java already did.

They're not supported on the 8086.

No computer truly supports real numbers.

My language is certainly better than Java though.

youtube.com/watch?v=u_hDHm9MD0I

I feel like I """learned""" a decent bit but I still feel like I cant do shit
i know for/while loops, if/else conditionals, functions, lists/dicts/tuples.
I tried making a "sum of all primes below 2 million" script but it takes too long to return anything.

That's not much of a claim, user.

Why not?

>I tried making a "sum of all primes below 2 million" script but it takes too long to return anything.

What if you could avoid some of the computations somehow?

Then fucking do it? Don't know what you want us to tell you. Practice makes perfect.

Don't bother. They don't get it. They're drunk with the feeling of superiority that having to care about low level details gives them.

And while they're still writing mutexes and struggling with dead locks, FPists have had concurrency solved for decades now.

Because you can construct a bijection between the set of valid programs in any Turing-complete language and the natural numbers.

Tips to speed up checking if a number is prime:
Don't check even numbers. Aside from 2, they will NEVER be prime.
Don't check above the square root of the number you're testing: they will never be a factor.

>script
In what language, Python?

FP itself isn't enough. It has to be non-garbage FP. That being said, any FP will be by definition better than the garbage presented in that post.
That makes me wonder, what "part" of real numbers can a computer truly support?

last part meant for

Is this the new desktop thread?

en.wikipedia.org/wiki/Computable_number

yes
I want to be a good programmer one day but I feel like I never will.
especially if I miss obvious stuff like

Fuck off faggot

no bully
also girls cant be faggots dumbo

Don't worry about that kind of shit. Realistically, you don't check for that kind of stuff first.

You get your shit working, then you run it. While it's running, you look at what's eating up computation time. You find out that over half the numbers you're testing are not prime. Why the fuck is that? I'm wasting so much time, how can I filter these out? What do they have in common? Holy shit even numbers aren't prime. So you code that in. Same thing for square roots, "well, shit, every time this code runs, we find a lot of smaller factors, but larger factors are just wasting resources. wat do?

how did you make your topbar look like that on os x?

en.wikipedia.org/wiki/Sieve_of_Eratosthenes

sauce?

you shouldn't spoil it. let him/her learn criticla thinking

>especially if I miss obvious stuff like
Get a discrete math textbook and you'll get a decent foundation on that kind of crap.

Tsuki ga Kirei
This girl will most likely not win, and the feMC is insufferable. So be prepared for that.

I don't give a fuck dude lfmao

I know about that, I just couldn't think of a way to implement it correctly.

It's literally given in pseudocode on the wiki page. You just copy it, you don't even need to know programming. I was able to implement a sieve not even a week into Python, with no programming experience beyond crude bash scripts

you underestimate how stupid I am.
I didn't go down that far because I saw the logic of it and tried to write it myself.

Rate my meme-program written in the meme-lang:
fn main() {
let mut primes = vec![2];

// Shitty meme-lang doesn't support custom steps yet
for i in (1..1_000_000).map(|x| x * 2 + 1) {
if primes.iter().take_while(|&x| x * x

>meme

rust was a mistake

>custom steps

Stupid boys are cute. Stay stupid and daddy will keep you safe.

What do you do when your function declaration doesn't fit on one line?

It always fits.