/dpt/ - Daily Programming Thread

Rolling release edition.

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

gist.github.com/bkaradzic/2e39896bc7d8c34e042b
youtu.be/BwqeFrlSpuI#t=43:58
benchmarksgame.alioth.debian.org/u64q/rust.html
benchmarksgame.alioth.debian.org/u64q/compare.php?lang=rust&lang2=gpp
twitter.com/AnonBabble

Has Haskell gone too far?

That would imply it has gone anywhere

Why do you keep reposting this shit? Are you so desperate you have no other ways of self-actualisation besides letting everybody know you can write typical Haskell code all by yourself until someone pays attention?

this is the second time

perhaps i should have said

>>io
>>no dependent types
>"""some quote of a meaningful post'''

and then you wouldn't have complained about repetition

>trashkell
who fucking cares? Go fork trashkell that has no I/O

From what a project owner wrote to the leadership team:

>I have come to the conclusion, that SCRUM offers the developers a framework to plausibilize stupid excuses

After I said:

>The acceptance criteria of your ticket did not specify on which operating system the executable must run. It works on my openBSD machine, therefore it's done.

What do you think?

C++98 is the comfiest c++ and you know it

Too bad we have to wait at least 70 more years to get to C+++98

Thanks for writing this, I was about to try rewriting my old go.

You're both assholes.

By then, every single program would consist of one line due to how much the C++ standard has enveloped everything.
Except for systemd of course. That would be in C and in the process of taking over the linux kernel

> every single program would consist of one line
auto auto(auto) { auto auto; }

gist.github.com/bkaradzic/2e39896bc7d8c34e042b
What do you think about orthodox sepples?
I think that if the guy is not going to use modern sepples he should just stop being a faggot and use C like any sane person.

auto auto:: auto(std::auto) { auto::auto; }

g++ -auto auto -auto auto auto.cpp

C does have some pains that come with it. I think it's a fine approach to use C+.
If it could be properly defined and taught to new programmers.

>The committee has been busy fixing the language for years
>Let's just ignore all it and use C++ as C-with-classes a-la 1983
>Oh, and let's reimplement all the STL because reasons
I actually agree on exceptions and RTTI tho. Sometimes I wish they'd cut all the C cancer out of C++, but then I remember Rust exists and calm down.

Started learning golang as a jsfag, it's fucking great

Go is a language for mentally chall-
>jsfag
Oh, nevermind, go ahead.

scrum is retarded, you're retarded, the PO is retarded

Even the author of STL doesn't like templates.
They should just ban templates as a library feature and have it be internal use only.

You shouldn't inflict that shit on other programmers.

C doesn't make C++ worse. It's the guiding principles of C that makes it worth anything. I agree that C++ could be a better language if they stopped with the backwards compatibility. Like D. It has its flaws but it's early days.

>C doesn't make C++ worse.
its literally the main reason why C++ is the way it is you delusional cnile.

Templates are the best thing to ever happen to C++, and if you don't recognize it you don't have any serious experience with C++, and C is the source of most bad decisions in C++.

How can people justify using rolling release languages that literally add and delete syntax from the language between minor version updates like rust?

Hate maintaining old php because of this...

>They should just ban templates as a library feature
Enlighten us. How else would C++ implement compile time code to fit every single data type?

If you don't like templates, don't use them.
Stuff like the STL and Eigen are good examples of how templates have spared them a lot of programming.
But it doesn't mean you have to make every class you make template based just because you can.

Because most people who are using volatile languages are either aware and don't mind, or just find it part of the fun to use and watch a language they like grow and change.

I think he means he wants to limit templates to the STL like java has limited operator overload to their own string type.

What's the fastest way to learn Java coming from C/C++?

not at all

learn the syntax, read the api of functions.

Today at work, I discovered that one of the programs we use frequently is actually written in CoffeeScript, that then gets compiled to Javascript through a convoluted chain of npm commands/scripts/tools/whatever-you-want-to-call-them, that is then executed by nw.js that's 2-3 years old because updating it "breaks the program". The UI is made of HTML template files and styled with CSS.

The person who wrote this monstrosity originally no longer works at there. A shame, because I'd love to ask him certain important questions regarding his choices of programming languages and technologies. Because I'm the person who, for some reason, was chosen to fix some bugs in it.

I know nothing about Coffeescript, npm or nw.js. I know a few little things about Javascript, but that won't help me. I don't even know where to start. I'm screwed.

No. Look at the proposals. People like the blame C but theres so many shitty features that were accepted. Look into structured bindings and how they've collided with std::tie.
They have an old feature preventing progress. And it's completely unrelated to C. This stuff is all over. C is not a complicated big language. You can easily design around it if you weren't a group of people who only cared for themselves and/or you didn't rush things.
It's not trivial to explain the problems with this in a short post user. Templates are a mess and they don't infer types well enough to be actually useful. If people think avoiding the copy pasting you'd do without templates is an argument to have a shitty metaprogramming language in C++ then your standards for language design is just very low.
See above. Also note how I explicitly said the issue with templates is libraries that use them. If you want to fuck yourself with templates that's fine. It's how it affects me I care about.

>You can easily design around it
Its that kind of rationalization that killed C++ before it began.

I hate how webdevs are creeping into programming. This is technically programming but still >>Sup Forumswdg/

Break it down into parts, take notes and unravel the parts that doesn't make sense.
It takes time but it is possible.

It always a lot of work but if nobody can work with it, someone has to spend time on this to sort things out.

I agree that it'd be better now if they had just made a new language but you would probably be programming in C now if that were the case.

>but you would probably be programming in C now if that were the case.
Not really, people didnt need sepples to figure out C needed put down.

>It's not trivial to explain the problems with this in a short post user
Cop out answer, user.
Templates are the simplest answer to it and you know it. Or if you want to fuck around with preprocessing, you're fine to as well.

//func.hpp

TYPE func(TYPE a)
{
return a;
}

//main.cpp
#define TYPE int
#include
#undef TYPE

This is actually the code that was recommended to write in C. How is this better?

It would probably be Ada, Modula-17 or Turbo Pascal 20 tho.

in C you would just
#define func(x) x

though

>io
Trash. Ignored.

I've actually seen such code in glibc IIRC, this is horrible.

I said >>io not >io
you stupid pleb

>templates is the easy answer
Templates isn't an easy answer to anything.
Polymorphic type dedication would be the easy answer.
>but that's templates!
No its not.
>how is this better
It's not as problematic as C++ templates from a feature-of-a-language perspective. It's certainly not how I'd do it anyway. Just use a parameterized macro. It's very similar to what I think is your idea of a template. But this is just a strawman. I never argued that C was the solution.

and in sane languages from the current century, we no longer need to do satans bidding with macro nonsense.

How is this instance of macros worse than the equivalent trivial template?

Why are you on nightly? AFAIK, stable does not do that.

For any nontrivial function, you're increasing the size of the binary with each call of the function
Not exactly ideal.

>Polymorphic type dedication would be the easy answer
>slow down every single aspect of every single C++ program because I'm too dumb to understand templates
You're better off using Python fucking scrub

>Just use a parameterized macro
See above

yeah, you just compile some other language to js.
There's nothing wrong with macros, dumb web shitter.

Which is exactly why templates shouldn't be used

>slow down
The compiler perhaps. But it sounds like you think it'd slow down runtime.
Which only a retard would think.

Because macros are a dirty hack and an insult compared to actual templates.
>my language doesnt have them so no one should use them
"no"

Coffeescript is unreadable. I'd suggest to scrap and reverse engineer the entire thing.

• Ambiguous type variable ‘m0’ arising from a use of ‘evalStateT’
prevents the constraint ‘(Monad m0)’ from being solved.
Relevant bindings include
count' :: Integer -> m0 [([Char], Integer)]

I read from right to left.

@60794653
>anyone who doesnt use macros is a web baby
(You)

>Because macros are a dirty hack and an insult compared to actual templates.
Templates are a fucking hack and an insult to actual macros.
Or let me guess, you think C style macros are the only macros?


>>my language doesn't have them
I'd use a real fucking programming language

should be evalState, whoops

Name me 1 (O N E) language with static polymorphic type deduction that's as fast as C/C++

>you're increasing the size of the binary with each call
Actually you don't. If this were an issue (aka you tell the compiler to minimize binary size) the compiler will outline (opposite of inline) it for you. Most of the time when the compiler outlines its to conserve instruction cache. But for the large majority of template-y/type macro things you'd never run into that since if you have a function you pound hard like that (see math-vector operations) you usually want them inline.

Why do brainlets think they can talk about programming?

>(You)
>doesn't give (you)
Kek

What do you mean "static polymorphic type deduction"?

If you just mean type deduction, that's at compile time anyway

If you just mean polymorphism, then plenty of C programs use void* all the time

Rust

ats, though

Rust.

>void* is polymorphism
Now I've heard it all.

Who are you quoting?

Ah, I see Ive riled up a Lisp-fag.

>t. newfag

(((Lisp)) is ((a) ((good))) language)

I don't use Lisp, I am simply pointing out that templates are literally a limited form of macro.

id :: forall a. a
id x = x

in C this would compile to

void* id(void* px) { return px; }

if you had C with polymorphism (not templates), the only difference would be safe typing

None available atm. Why would that be a requirement? Doesn't matter whatsoever
JAI has it as a presented feature.
Here's the most relevant bit of the talk. I doubt you'd actually appreciate this though. Since Jblow doesn't deem it worth rat-holing on why templates are problematic since everyone already knows that. Its not even the best part of the design of this language. He does some things in part 2 that C++ programmers would do with templates and it'd be absolutely insane to try. You probably wouldn't even bother.
youtu.be/BwqeFrlSpuI#t=43:58

...

>I don't use Lisp, I am simply pointing out that templates are literally a limited form of macro.
You're right that templates are limited macros, but they're limited to make sense in C++.

>none available atm
OK. I don't know a lot about irrelevant languages. But I guess there were some as evidenced by this thread.

Few things make sense in C++

Nothing makes sense in C++, including templates.

>header/source
Doesn't work with templates at all. Only one obscure compiler had export so they removed it.

>inb4 "this is ok because I know WHY this happens"
literally the javascript response

>templates are limited macros
Templates are Turing complete.
That's what makes them horrible. If they were just like these trivial 'replace this type' case then they'd be pretty OK. I wouldn't have an issue with them.

js people don't know why things happen, it's magic to the most basic stuff like left_pad function.

You can use them in that way, and they work perfectly fine when used that way.

Any good books on programming for me to grab?

I'm somewhat new to the realm. I've learned a few languages and written a couple basic programs for use on RPi/Duino projects, but aside from that I'm completely lost.

Help a newfag out?

Rust

Nice meme

Reminder the previous Dlang-chan was cuter than her current iteration.

Head to

But I'm not a gaymer

>

benchmarksgame.alioth.debian.org/u64q/rust.html
>consistently higher CPU time and ram
When will SJWs leave?

Point is that compilers can't optimize for stuff like that.
It's like doing a instead of a/2. They both nearly do the same thing, but a/2's assembly instructions are longer.

>None available atm. Why would that be a requirement?
>hey guys. Trust me. This is a totally faster way of doing this
>don't mind that no languages have ever pulled this off and always made it slower
>srs guys
>guys this is totally faster
This is how you sound like

They *work* fine. They're not convenient to write or modify in any way. They're a terrible feature if we intend to have a metaprogramming language (which is what templates are now). They're not a limited metaprogramming language as people claim. They're a very bad metaprogramming language which people love to use because they're starved c/c++ programmers who are desperately clammering for features.

>I am simply pointing out that templates are literally a limited form of macro.
show me a macro i cant implement with templates.

benchmarksgame.alioth.debian.org/u64q/compare.php?lang=rust&lang2=gpp

>Consistently faster than C++
kek

Honestly the ONLY issue with templates for non-retarded people is how analysis-unfriendly they are for e.g. completion tools and other things. Otherwise it's lit af tbqh fampais.

>Point is that compilers can't optimize for stuff like that.
What?


conditional inclusion of an .h

It has been proven to be as fast though. It compiles down to the same damn code user. It's static.

Again. If you can't watch that and immediately appreciate the fact that it's as fast as templates you're stupid. Not stupid in the sense of being a clever person who's out of his depth but actually stupid. Any moron can see this given enough knowledge of programming.

C++ is shitter than Rust

I agree with that. TMP was an accident.

Found the rustfag