/dpt/ - Daily Programming Thread

Why haven't you learned Haskell yet, Jow Forums?

Previous thread:

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

Other urls found in this thread:

gist.github.com/inoriy/bb7f1818b796d6e26df9b06923517f18
motherfuckingwebsite.com/
github.com/tutsplus/Introduction-to-JavaFX-for-Game-Development/blob/master/Example5.java
twitter.com/NSFWRedditVideo

Common Lisp is the most powerful programming language.

I do C++ for giggles every once in a while. I don't understand why the templates are not being included in the impl file? What am I doing wrong about it?

Attached: Screenshot from 2018-04-10 09-23-00.png (3840x2160, 663K)

but I have
it's just not very useful

Liar, it takes a lifetime to truly learn Haskell

Give me some IRC channels to meet fun hacker pals in. Now!

You must define templates where you declare them

reminder to hide 12yo-xboxlive-tier posts

It's not as expressive as idris

>Give me
>Now!
who's my little entitled princess? Yes you are! Yes you are.

##chat @ freenode

Has the FP crowd finally reached a consensus on whether or not monads are like burritos?

I once tried Idris and its compiler was buggy as fuck.

inb4 banned

are burritos like monoids in the category of endofunctors?

akchually, they can be viewed as isomorphic under certain conditions

Everyone agrees that monads share properties with burritos. The jury is out as to whether monads are a subset of burritos, however

Surely burritos are closed under composition

Templates are usually declared in the header file to ensure they can be instantiated properly.

el monado

i want to create a simple website, studying html is enough or do i also need php and java script? also, what are some good books about it?

It's not as buggy now that it's past 1.0. There are less working on it so of course the compiler will have more bugs. It's a young language

Why do weebs make the best programmers?
gist.github.com/inoriy/bb7f1818b796d6e26df9b06923517f18

Attached: 12904868.png (282x281, 33K)

I know! It's the autism.

Go to /wdg/ To answer your question, you should also learn CSS unless you want your website to look like this: motherfuckingwebsite.com/
PHP and JavaScript are necessary for dynamic websites.

sorry, i didn't knew there as a thread for that

>at fortune 500 company
>going through CVs
>immediately dump anyone who uses a non-anime github avatar
weebocracy is the best

Current state of C

Attached: Screenshot from 2018-04-10 09-41-08.png (1500x424, 66K)

>motherfuckingwebsite.com/
Did namasensei write this?

One does not simply learn Haskell.
Haskell isn't a programming language, Haskell is math.
You don't just fucking "learn math."
C++ isn't math, but it's along the same lines: it's not a programming language, it's a discipline all on its own, albeit a shittier one.
And, guess what?
It is, equivalently, pretty much impossible to learn C++.
You can learn to USE C++ / Haskell, but you can never learn THEM themselves.
I know how to use Haskell.
Don't ask me what the fuck some advanced ridiculous math concept is because I don't know. I don't know Haskell. All I know is how to use it.
And don't you laugh at me for that, because that's all you know, too.
Literally no one knows Haskell. It's impossible to know Haskell.

>hurrrrrrr tic tac toe in 3 bytes durrrrrrr wow so impressive
There are literally only 39366 possible game states. 3 bytes could encode 16777216 of them.

Around 1.91 bytes could encode all of them, but game states alone do not a game make. Though you could store the current state in 1.91 bytes, you'd need to cram into the remaining 1.09 bytes a function or table that maps a state and player input pair to a new state.

std::brainlet

>you'd need to cram into the remaining 1.09 bytes a function or table that maps a state and player input pair to a new state.
What the fuck are you talking about? Why would you need to have any such table? It doesn't encode the entire game logic in 3 bytes, just the current game state.

Any Python haters online?
Please convince me to use Guile over Pypy.
The goal is being able to write expressive plugins that users don't need to compile themselves, but still offer good performance.
Scheme is great but Pypy is executing over 10 times faster in some cases. If it was a smaller speed difference I'd just pick Guile, but damn.
Remind me of how unreliable Pypy's future is or something please.

Attached: me.jpg (1024x658, 325K)

>What the fuck are you talking about? Why would you need to have any such table?
Because it would have to encode the entire game logic in 3 bytes.
>It doesn't encode the entire game logic in 3 bytes, just the current game state.
I disagree.
You specifically said:
>>hurrrrrrr tic tac toe in 3 bytes durrrrrrr wow so impressive
First of all, the project you were replying to is a lot longer than 3 bytes, even when compiled.
Secondly, that really doesn't even matter, because I was responding to what you said, not to what you were responding to.
Point being, tic tac toe in 3 bytes would indeed be pretty impressive, so you are wrong to suggest it would in a sarcastic manner. The fact that what you're actually looking at here isn't even that, and is indeed much less impressive as you correctly observed, is irrelevant.

learn Haskell

>Haskell
>performance

Attached: 1489296532584.jpg (750x574, 47K)

Write the entire program in Nim. Easy.

>I disagree.
Nobody cares, you brain-damaged fucking autist. The 3 bytes in question refer to the game state, as you can see for yourself if you actually look at the code linked from the post I was responding to. Case closed.

>The 3 bytes in question refer to the game state, as you can see for yourself if you actually look at the code linked from the post I was responding to.
The code linked from the post you were responding to was irrelevant.
YOU LITERALLY SAID:
>>hurrrrrrr tic tac toe in 3 bytes durrrrrrr wow so impressive
YOU DID NOT SAY:
>>hurrrrrrr the game state of tic tac toe in 3 bytes durrrrrrr wow so impressive

>vs Python
yes

>what you were actually responding to is irrelevant
>what's relevant is how i interpreted your post in the vacuum of my autistic brain
Kill yourself, you genetic freak.

Pypy, not CPython

It's not a question of interpretation. The fact of the matter is that you did not say what you intended to say, and what you did in fact say is incorrect.

i want to go functional, why should i pick haskell instead of lisp?

types

types, purity, laziness

>gist.github.com/inoriy/bb7f1818b796d6e26df9b06923517f18
>TicTacToe in 3 bytes of memory
You can take your mindless autismal objections to the author of this garbage. I was merely responding to it.

Not him but this is the reason you SHOULDN'T pick Haskell instead of Lisp. Any language with typed functions is object oriented because the functions are exclusively compatible with the data types of their parameters and therefore belong to those types in the same sense as methods and messages

>>TicTacToe in 3 bytes of memory
Well I mean then you're both wrong. The author is wrong because that's not TicTacToe in 3 bytes of memory, and you're wrong because TicTacToe in 3 bytes of memory would indeed be impressive.

You're either baiting, retarded or schizophrenic.

>you're both wrong

Attached: b90.png (645x729, 91K)

Good performance, safety, elegant and concise syntax, lots of excellent packages, very active community.

Explain what Rust is useful for to a brainlet /dpt/

>what is polymorphism

>very active community
storm in a teacup kind of thing innit

Shit

An expanding teacup.

the ladies (male) love it!

Like, heat expansion?

Think about it though. Really the only difference between the receiver of a message and the parameter of a function is that the message is owned by the class of the receiver. This implies that a function, to the contrary, is NOT owned by the type of its parameter. And yet, in any strongly typed language, this assumption is inherently contradicted, because every function is exclusive to the particular types of its parameters as well as to that of its return value, and exclusivity to a type is really the same thing as ownership by that type in the OO sense if you boil both concepts down to their cores. So, even in strongly typed """""""functional""""""" languages, your functions are second class citizens, belonging as slaves to the types to which they apply, no different from methods in Java. The only real difference is superficial: even though the functions are not contained in the types in question as part of their definitions, nor do they occupy a table pointed to opaquely by each datum belonging said types, nor must the invocation of a function be qualified by a prefix consisting of its receiver, the semantics are nonetheless the same, since a datum of a specific type is required to invoke the function, and no other type of datum will do, so really the function is still a slave to the data type.

Scheme is much better because functions are TRULY free citizens, NOT belonging as slaves to any data type.

Lisp is shit though since it is also a POOlang

Can anyone tell me why xdotool returns an error unknown command: keydown A? I can't tell what I'm doing wrong
pid_t pid = fork();
string xdoCMD = " keydown A";
const char* mousepad = "mousepad";

if (pid < 0) {
cout

Going to bed now, lads. The simultaneous increase is in post quality, if it happens, will be a coincidence.

Attached: 1522871587492.jpg (485x443, 51K)

>>what is polymorphism
Shit, that's what it is. Shit, and very correctly frowned upon by Haskell devs.
Static polymorphism is ok though. e.g type variables

>The simultaneous increase is in post quality, if it happens,
don't worry it won't

It's true though. The author is wrong because that's not TicTacToe in 3 bytes of memory, and you're wrong because TicTacToe in 3 bytes of memory would indeed be impressive.

sleep well dude

>It's true though

Attached: d04.png (478x523, 14K)

It's true though. The author is wrong because that's not TicTacToe in 3 bytes of memory, and you're wrong because TicTacToe in 3 bytes of memory would indeed be impressive.

Free theorems ain't free.

>my inadequate autismal interpretation of your post makes no sense
>therefore your post is wrong

Attached: (You).png (645x773, 71K)

Forget it, I wasn't suppose to have (char*)0 as an argument in execl

It's not a question of interpretation. The fact of the matter is that you did not say what you intended to say, and what you did in fact say is incorrect.

>all that undefined behavior in just a few lines of code
I see you're a typical C programmer

Attached: 1473318280410.png (366x286, 6K)

>my autismal interpretations are objective facts so let me tell you what you really said
This has gotten boring. Get sterilized, animal.

Attached: 2930953242255.png (190x266, 5K)

I have been using Haskell for awhile now, and this is what I have found wrong with the language:
>horrid macro system
>modules are deficient compared to the module system of OCaml or the package system of Common Lisp
>partial functions pervade the language
>broken records (ugly hacks are needed to get around their deficiencies, leading to overengineered libraries like lens)
>most libraries are in alpha and look like a college student's summer project
>library authors tend to pepper their libraries with ugly, meaningless, custom operators, contributing to the overall ugliness of the ecosystem
>String as [Char]
>easily subverted type system with unsafe functions
>laziness makes it a chore even for experienced programmers to reason about algorithmic complexity
>in 30 years of existence, Haskell has yet to become a proven asset in industry

>C programmer
>.c_str()
>C programmer
>C
>programmer

>so let me tell you what you really said
YOU LITERALLY SAID:
>>hurrrrrrr tic tac toe in 3 bytes durrrrrrr wow so impressive
YOU DID NOT SAY:
>>hurrrrrrr the game state of tic tac toe in 3 bytes durrrrrrr wow so impressive

>same old pasta

Is this a critique of C?

>being so malformed that you don't understand how greentext works
(You)

Burritos are like monads.

Haskell was always intended as a testbed for language research. It has borne valuable fruit like async/await (yeah I bet you didn't know that was invented in Haskell land) but as a tool for writing production code it will always lose to languages that weren't designed for research. That shouldn't bother the people who like it, though, because it continues to be influential on other languages. Those that steal one or two features from it (or more often, from libraries that were written in it) are hailed as revolutionary.

Attached: philip spurdler.png (853x580, 58K)

>being so malformed that you don't understand how (You) works
greentext
And anyway, my use of greentext is correct. I was quoting your greentext, so the use of two brackets is appropriate.

>It has borne valuable fruit like async/await
citation needed

You were doing so well up until the last part.

eval and quote form a monad where quote is return and eval is bind

hmmmm i may be retarded

I'm working through some javafx examples and this has popped up.

The code I'm working from as an example is here, and the equivalent lines are @84-85

github.com/tutsplus/Introduction-to-JavaFX-for-Game-Development/blob/master/Example5.java

Basically I can't use a regular primitive long since the local variable as a primitive is defined in an "enclosing scope" and must be final or effectively final. A little googling told me that this was the result of me using a "lambda expression," I don't know if this is right or not. So I need some kind of wrapper class, and the regular Long wrapper class is apparently deprecated / I can't figure out how to use appropriately, and the class he uses here for some reason "cannot be resolved to a type" - it's an interface in in com.sun.jdi but including it in an import statement fixes nothing. Copy pasting the guy's code doesn't work either.

I'm working in Java 9 and this guy wrote this code in 2015, did things change that much from then to now? How can I refactor my approach to be workable?

I'm a little out of my depth and I'd appreciate any help I can get

Attached: pt1.png (706x404, 35K)

all i heard was:
>muh "moan ads"

I'll make you moan

Learn D

l--lewd

The code you are working off kinda sucks.

Anyway, the old Sun libraries got removed in Java 9 in a breaking change, I'm assuming that's why it's not resolving those types.

The issue also has nothing to do with lambda expressions, it's just the fact that the compiler thinks you are reassigning a variable from the outer scope of an anonymous inner class (you probably ran into lambda expressions on google with this issue because they are syntactic sugar for single abstract method anonymous classes).

You can't use java.lang.Long if that's what you meant by "the regular Long wrapper", they are immutable.

A quick and dirty drop in solution would be to wrap the long in an array and mutate the only element in it.

ad

Attached: hqdefault[1].jpg (480x360, 9K)

>String as [Char]
honest question how is this a problem? any time i do work with "strings" in lisp i find myself doing string->list because all my tools work on lists not strings.

Please teach me senpai, I've only been programming for less than 3 months. I thought I made progress but didnt