/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: 1526342735478.png (2838x3230, 478K)

Other urls found in this thread:

godbolt.org/z/BMmV6e
en.wikipedia.org/wiki/Non-English-based_programming_languages
youtu.be/uEHnI3pq_FM?t=1m47s
docs.scipy.org/doc/numpy-1.13.0/reference/arrays.indexing.html
twitter.com/SFWRedditImages

the Fold applicative is a glorious thing

Attached: anim haskell.jpg (480x480, 56K)

What's up with the meme benchmark?

your lang didn't make it?

kill every haskell "programmer"

Yeah, Rust isn't on it for some reason. But even so, the fact there's a difference between "raw pointers" C++ and "unique_ptr" C++ means the author didn't know what he was doing.

no

Attached: karen gun.png (128x108, 30K)

make friends with haskell "programmers"

unique_ptr can easily have additional overhead over raw pointers when interprocedural analysis fails to optimize unnecessary branches in destructors away.

Which branches? The only way they're different is if the raw pointers version doesn't call destructors and leak objects. It's a meaning discussion without the code tho.

user doesn't understand Haskell so is upset that others do

And introduce them to a real language, such as Idris.

wtf i love nim now

Be suspicious of benchmarks which show the author's pet new language as fastest. Remember the Julia debacle

why is googletest such a pain in the arse with VS?
I need to set my project to build as a static library for it to work with gtest when what I'm working on is an .exe
FUCK OFF

void bar(Foo *param);
void baz(std::unique_ptr param);
The calling convention almost always requires that the destructor for baz's parameter is executed at the call site.
If the body of baz is not available while a translation unit in which it is called is being compiled, the compiler cannot reason about the possible states of param. That means it's required to emit code corresponding to this.
if (param.ptr) delete param.ptr;
bar will simply delete the pointer in the function body, requiring one branch fewer since the pointer is assumed to be not null.

godbolt.org/z/BMmV6e

Wew, I was wrong, interesting stuff.

Kotlin is Scala for people who failed at Scala.

since scala failed, shouldn't everyone be writing kotlin?

What's so bad about Haskell?

Specifically, what's the difference between a program and an application, and why is Haskell said not to be able to do the latter?

Whom are you quoting?

Nim get some tricks to get C speed, but as Optional GC language, mostly Stdlib begin GC based.

Eternal research language, every feature for real world developer get avoid for new research extension.

It's too good. You end up losing sight of your original goals. You eventually just end up writing new languages in it to try to attain perfection in a vicious cycle.

>But that's the thing. A purely functional program has no side effects, and doesn't do anything. And people don't actually write applications in Haskell, so neither do Haskell programs.

Maybe I'm just being dense, but this seems to be a meaningful distinction of some kind.

It's a strange misconception which could only persist in someone who has never used Haskell. Even a simple putStrLn-based hello world would clarify things.

this fucking level of cope from OOPsies. they've conceded that Haskell is better because not even they can maintain the myth that OOP is better any longer, but they still need to come up with reasons not to leave their shitlangs

If you really think you need OOP, then use OCaml

Is haskell getting more common/popular?
I'd prefer to learn a language that is on the up and up.

functional languages are a meme

Just pick OCaml from the start. Scala has no domain.

>googletest
>VS

Attached: 1532940212489.png (1106x1009, 637K)

As in a popular fad? Sounds good to me.

It targeted people who think they need the JVM for some reason.

Hardly a fad, functional programming has been around for decades, and Haskell first appeared in 1990.

>what is clojure

A worse Lisp.

A bad lisp is still better than scala.

I don't disagree. If you want to do the sort of programming that Scala seemed to be going for then Ocaml is probably an easier language to switch to, though. Some people have a weird aversion to Lisps.

There are only two families of languages where I feel there is really good tooling. Lisps and higher-end pure functional languages like Idris. Writing programs in them with Emacs is such a breeze.

>all this circle jerk about programming languages
>meanwhile you get a job
>boss is only worry shipping the product
>no one cares about programming and correctness

Attached: 1535126195757s.jpg (249x219, 7K)

Is there a programming language that uses kanji/kana?
I'd use it just to feel like I'm part of a secret NEET elite

en.wikipedia.org/wiki/Non-English-based_programming_languages

I made a brainfuck compiler to mips assembly, what should I call it?

Attached: bips.png (1366x768, 144K)

Something recently introduced can't be categorized as a fad, time is needed to tell if something was a fad or not. We know now that Haskell was a fad, since it never caught on.

Attached: 1535126566459.jpg (5312x2988, 1.47M)

It caught on, just not as a mediocre shitlang.

>me blub, me no care if it works just ship it!!!
>write thousand tests, 99% line coverage all you need

this is what real life is like

basm
bf2mips

real life is shit, stay inside and write haskell and watch anime and play vidya

>stay inside and slowly alienate yourself from reality

no

this 2bh

then get out, normie

Don't forget to wear the programming outfit!

>normie
fuck off normalfag

...

import webbrowser

webbrowser.open("mentalhealth.org")

Idris > Haskell
Scheme > JS
OCaml > Scala
What other relations are there?

Isn't SICP a little bit tough for new programmers to get into? I believe I read somewhere that they used to make new CS students read it. Am I simply a retard if I think it's hard?

It assumes more math knowledge than the typical introductory programming textbook, if my recollection is correct.

>still reading SICP

kek

Don't get upset that other people are improving their programming abilities.

Thoughts on functional programming as a pattern? Where do you guys think it is strong or weak?

read this sentence.

thank you for wasting your time

Thoughts on loud noises as a composite alloy? Where do you guys think they are perceptive or judging?

I want an entire list of only the values (prices) in the specified column: data[0][1]. Currently this only gives me the price for the first item. How do extract all of the items in the column so that I just have a list of prices? Any help appreciated, thanks!

forgot pic

Attached: Capture.png (706x250, 15K)

cope

I can't stop reading numpy as numpty

bepis

Watch the first 5 minutes or so of this:
youtu.be/uEHnI3pq_FM?t=1m47s

do you know how to fix my column problem??

No. I don't know Python

>Messing around with Makefiles
>check results autistically
>compare md5sums of the resulting .o 's
>not the same
>mess with flags
>still not the same
>objdump relevant sections
>the same
Well anyway, it turns out that the current directory ends up somewhere in the .o

I would say you are correct.

What's wrong with it?

You can extract the prices like this data[:][1].

Did I understand your problem right?

Also check this out
docs.scipy.org/doc/numpy-1.13.0/reference/arrays.indexing.html

thanks for the reply

print(data[:][1]) still gives me the first tuple of the array. I don't want a tuple, I just want all the prices so I can chart them. I'm so close, I can feel it, but I'm stuck!

this general is shit. Everyone is fighting but no one is helping

How much point-free is too much?

Attached: fc93d9c4fd008c823b3772cb2f62de27.png (723x1023, 516K)

anything anone can read

removeOdds = filter isEven
-- or
removeOdds xs = filter isEven xsg

removeDuplicates xs ys = filter (\x -> not $ x `elem` ys) xs
-- or
removeDuplicates = flip (filter . (not .) . flip elem)

eta reduced;
not . (`elem` ys)

reminder that 6502 assembly won't get you a job

What's the fastest scripting language?

You could use Golang. It supports allot of non English characters

LuaJIT
JavaScript is quite fast too, for a scripting language.

best c++ ide?

use a preprocessor to convert your japanese shit to proper english -> any programming language can be your dream language

I did try in /sqt/, already:
What Windows Python IDE would work on mobile Celeron cpus? I got Anaconda and Spyder, but just opening the program is taking ages.

The features I like the most are the variable explorer and auto spacing.

>IDE
>for c++

never gonna make it

I was just playing around with a demo of the spectre exploit and I decided to see how to use it against other programs. I wrote a simple program to store a few strings in memory (in C) via pointers and printed out the address of where the strings are stored. When I ran the address through the spectre demo, it returned to me the words in the printf statement I used to print out the memory location for the strings. Do you know what I am doing wrong?
#include
//spectre test
int main()
{
char *str = "Password is this: 12345678";
printf("Putting password to memory at %p\n", (void *)str);
printf("Here is what is there: %s", (char *)blah); //blah is the hex location for the string
getchar();
}

Could you provide more information about the structure. What is it? What are the columns and details. Also data[0][:] might be the solution. Depends on hownthe data is structured.

Multiple inheritance and packages are same.

The GPL is the best license for projects (programs/libraries). Hear me out:
Imagine all open source projects (programs/libraries) being GPL or commercially licensed. Open source projects can use whatever they need from other open source projects under the GPL license. This is fair because they give their code back to the community. Commercial projects can use open source projects under a commercial license. This commercial license can be purchased anywhere from 10 to 100$. This is fair because they give part of their (possible) income back to the community.
Right?

Attached: Richard_Stallman_-_FĂȘte_de_l'HumanitĂ©_2014_-_010.jpg (3456x5184, 3.42M)

Maybe declare "blah" first?
#include
//spectre test
int main()
{
char *blah;
char *str = "Password is this: 12345678";
printf("Putting password to memory at %p\n", (void *)str);
printf("Here is what is there: %s", (char *)blah); //blah is the hex location for the string
getchar();
}

No. Blah has nothing to do with the program. It's a fill in for the strings memory location. So it's different for everyone. I just used that name there as a placeholder but compiled with the actual memory location to make sure it's where the string is stored

You can't combine a commercial license with the GPL, the GPL doesn't allow this as it must respect the four freedoms.

You can license you project in any way you want. So you can even use different licenses. The Qt project does something similar.

>You can license you project in any way you want. So you can even use different licenses.
Why would I want to buy a commercial license, when the GPL allows me to do whatever the fuck I want with it?

>The Qt project does something similar.
The Qt commercial license is mainly focused on support and gives access to non-GPL components (aka proprietary software) of Qt.