/dpt/ - Daily Programming Thread

Last thread: What are you working on, Sup Forums?

Other urls found in this thread:

en.m.wikipedia.org/wiki/B_(programming_language)
p.sicp.me/mNusT.js
p.sicp.me/qjUJz.js
twitter.com/SFWRedditVideos

nice meme op

>What are you working on, Sup Forums?
Love

what's the problem in the op picture? i know that that kind of wojak is supposed to mean you're saying something dumb, but R does come before Z in the alphabet??

What's the solution to pure functional systems programming?

It's a /dpt/ meme. Doubles are a subset of integers.

>What's the solution to pure functional systems programming?
Taking its proponents behind the shed.

Why do you hate what you don't understand?

Doubles?

>Why do you hate what you don't understand?
What makes you think I hate functional programming? I just have a distaste for the likes of you, in part because you keep assuming other people reject your half-brained proposals because they "don't understand".

>ask how to solve the performance problem in FP
>get a "kys"
>What makes you think I hate functional programming?
gee user, i don't know

>but R does come before Z in the alphabet

I was always told having solid coding skills and being an algorithms and problem solving ace would easily land you a job. Now I realize it's all about knowing meme frameworks and tools + networking like crazy. I know programming gods who can't find a fucking job after 6 months and complete dipshits who walked in the front door basically because they knew somebody and did a tutorial one weekend.

checked

wasted numbers

>>ask how to solve the performance problem in FP
Maybe you should've actually asked that before vaguely implying that pure functional programming is desirable for systems programming.

a b c d e f g h i j k l m n o p q R s t u v w x y Z

>FP
kys and your meme language
also nice repeating digits

>a b c d e f g h i j k l m n o p q R s t u v w x y Z

what are must read books for computer science students?

If A and B come before C - why is C the firstborn

Check em

Having the skills is what might land you a job, the problem is proving you have those skills.
Also, muh character and soft skillz

Javascript Essentials
Think Python
Head First Object-Oriented Analysis and Design: A Brain Friendly Guide
Dynamic Typing with Dependent Types

i mean, im pretty sure that that's in the right order, so i don't know what you're getting at

Pure FP is desirable everywhere.
The only problem in systems is no one has done a decent GC-less memory model.

>this bait

* R, especially in that font, refers to the real numbers. Literally every number that doesn't have an imaginary component.
* Z refers to the integers: real numbers which have no decimal component.
* The symbol between them means "is a subset of".

Hence, the picture means "the real numbers are a subset of the integers". I'll let you decide if that's true or not.

>Pure FP is desirable everywhere.
Thanks for illustrating my point about why your cult deserves hate. It's nothing against FP in and of itself.

his point is, whether the OP was unironic or not. The threads OP has nothing to do with the alphabet.

It's amazing how entrenched Sup Forums is in irony when we also have so many oblivious autists.

Tell me why it's not desirable instead of lamenting your irrational disdain.

>it's desirable everywhere! prove me wrong!
>implying my disdain for you is irrational

Same reasons why brainfuck is not desirable. It is slow, obscure, hard to write and read and does not really fit for our computer architectures

>The threads OP has nothing to do with the alphabet.
>comparing R to Z has nothing to do with the alphabet

>It is slow
And that was my whole point you dummy.
>obscure, hard to write and read
You giving up isn't a valid argument.

This is why you shouldn't drop out of highschool.

I like imperative languages with FP things. It makes everything easier when you can choose to use what's best at the moment without sacrificing the other one.

>You giving up isn't a valid argument.
Yeah, dont give up! And check my brainfuck program, isn't it awesome?
+
+++
+++++
+[->+>+
++>++++++>++>,
>++++++++[-]+>+>
+>>+[->+++[-]

>I like imperative languages with FP things.
>choose to use what's best at the moment
If half of your program is imperative and effectful, how exactly are you doing pure functional programming?

What are some neat niche programming fields

I am tired of competition

Sup Forums is trying to program but can't even decide what an array is.

There was B and A before C. Where do you think C's name comes from? Why do you think there's another language called D?

FP is literally a sub set of iterative languages

show me A and B

oh, ok, i get it now, Z is like 1, 3, -1, etc, and it doesn't have 1.3, but R does, so the things inside R can't be inside Z

thanks for actually helping

well, im sorry that i wasnt born knowing all this advanced math stuff like you. im just a 2nd year comp. sci. student, why the fuck would i know about all these symbols

feel free to call me an autist anyway, at least im not ashamed to say that i dont understand something

brainfuck isn't a functional language, it's an esoteric toy language. The fact that you're even comparing it to FP like you think they're both some primordial magic is depressing and shows you haven't done any of it beyond looking at a haskell hello world.

Thanks for putting keywords like "functional programming" into your CV /dpt/, it makes it a lot easier to filter meme programmers

Using pure functions without side effects. Keeping the parts with side effects very separated from the others.

>hard to read/write: check
>rarely used: check
>no real world applications: check
FP only languages are also esoteric toy languages user

en.m.wikipedia.org/wiki/B_(programming_language)

I'm making up a language, here's some sample code:
(print (a or 1), b or 1): (opt a: Int, opt b: Int) -> (Int, Int) (b, a + b): (a: Int, b: Int) -> (Int, Int);
1..100 *> (print or or or and and and == % n 15 0 "fizzbuzz" == % n 5 0 "buzz" == % n 3 0 "fizz" n): n: Int -> Any;
r8

>hard to read/write

>well, im sorry that i wasnt born knowing all this advanced math stuff like you. im just a 2nd year comp. sci. student, why the fuck would i know about all these symbols
Not that guy but I learned this stuff in highschool and I live in the third world.

B was basically the beta for C.
I actually have no idea if there was an A that wasn't just an unofficial B. Considering B came from BCPL.

>getting rekt by a mere seconds
yeah, look how readable is that!

>Keeping the parts with side effects very separated from the others
Maybe if by "separated" you mean "part of a completely separate system". Otherwise your system, as a whole, is obviously not an instance of pure functional programming. In any case, this discussion is moot. I don't take issue with you. I take issue with the delusional cultists who think there's something to be gained from clumsily emulating imperative programming inside their FP sandbox in the name of theoretical benefits and "purity".

>print or or or and and and

>B also introduced the increment and decrement operators (++ and --

>mfw c++ fags ROASTED

add : x: Int -> y : Int -> Int
add x y = x + y

add 1 1
2

wow, how impossible to decipher

>Ok, to understand arrays, you got to understand pointers
It's worse than I thought.

Is it true that /prog/ sent a loveletter to prof. Sussman?

Prefix notation.
It's not the best practice to use it but I wanted to show that it's possible in my language.

You can use prefix, postfix and infix all you want and even mix them.

>can't meet his burden of proof
>starts arguing with his samefagging self to prove that the people who dismiss him just "don't understand"
Still waiting for you to explain why you shoving pure functional programming down every hole is somehow optimal, cultist.

When your fizz buzz gets complicated enough to be not decipherable at a single glace, you are not making it a good language.

I can't even imagine how big projects works in FP languages. Oh wait, there are no such things. All FP is good for toy programs

>Look into leetcode
>Pick an easy one
>Solution seems simple but doesn't work when I run it
>mfw struggling to figure out what I'm doing wrong

I'm never gonna make it

>Otherwise your system, as a whole, is obviously not an instance of pure functional programming
Of course it isn't. That's the point. I don't want to write pure functional systems. I just want to benefit from FP within my imperative system whenever I like.

Looks like trash syntactically. What's your gimmick?

>how big projects works in FP languages
implying they do

Why do you even think c++ was named that way?

I like the goal-post moving, user. Keep it up, you will definitely grow as a programmer.

by pretending it has invented incremention operator when actually it was stolen from earlier language kek

>I don't want to write pure functional systems
Then what are you trying to argue? I don't recall saying that every function in your project should have side effects, or that higher-order functions should be banned, or that C's shitty type system is perfect, or whatever it is you think I was implying.

>c == c++ is true
lol fags don't even know their own language. At least make it ++c

>I like the goal-post moving, user. Keep it up, you will definitely grow as a programmer.
Still waiting for you to stop your samefagging and back up your claim that pure functional programming is always appropriate.

what if you want to program an heating unit

>that pure functional programming is always appropriate.
It gets rid of run time errors, that's literally the single reason why a lot of webshit companies are switching.

What makes you think it pretends that? Increment operator is older than languages, they are as old as transistors and first implemented in hardware

>pure functional programming is the only means to get rid of runtime errors
>getting rid of runtime errors is the only factor
>pure functional programming gets rid of all runtime errors
Got any other brilliant arguments, you shitty cult member?

FP is not especially desirable in simulation programming that needs to be complicated and flexible, because in such cases, we are reasoning about actual objects that exist as objects in the real world. It is also appropriate for such objects to have methods, functions that they "own" and which can be used as messages to pass to them, because some objects in the world are autonomous, possess behaviors, and react to stimuli (messages). At a sufficiently minute level, real world objects together with their behaviors may be considered processes, if string theory is to be believed, but that's not a very natural way of modeling them.

However, for such cases it's also ill advised to use POO as commonly formulated, because in the pooplangs you usually see, classes are strictly hierarchical. In Venn diagram terms, there's no notion of intersection, only total enclosure or total separation. This is why simulations are usually best constructed with traits and/or multimethods, rather than strictly traditional classes. A POO system to be used for this purpose should also have first class methods, whether they're multimethods or not, and a way of dynamically querying a set of all methods applicable to any given object given its particular combination of traits -- so that, for example, a rational agent object might dynamically assess its options in terms of the methods implemented for it. It would also be nice to have something like traits for methods themselves, so that, in dynamically batch-processing available methods in this manner, a distinction might be made between, for instance, methods that represent actual actions the rational agent might choose to take, versus utility methods. However, in the case of multimethods, the same method might hold different significance to the nth receiver than to the mth receiver for n != m, so it would be nice if "method traits" could be relations between methods and "object traits," instead of just pure properties of methods.

>You can use prefix, postfix and infix all you want and even mix them.

Yeah I don't think allowing all of that makes a programming language more readable. Having fewer constructs make them easier to comprehend and parse.

Unless you don't care about people reading code. I mean, who does that? Actually reading code. Other people's code. Your own code from 6 months ago. What an absurd idea.

Everything is an expression, that can take any number of input and returns some output (or fails).
Some expression return multiple output, they're called generators. 1..100 is such generator.
and are streams. They're used to catch a single output of an expression and pass it to the other expression one by one.

For example, print 1..100 calls print once with 100 arguments and print

>in such cases, we are reasoning about actual objects that exist as objects in the real world. It is also appropriate for such objects to have methods, functions that they "own" and which can be used as messages to pass to them, because some objects in the world are autonomous, possess behaviors, and react to stimuli (messages)
And now the members of the opposing cult show up. Let me bring my popcorn.

>is the only means to get rid of runtime errors
i did not say that, but by being pure and having a good type system, you get it for free.
>>getting rid of runtime errors is the only factor
also didn't say that, just giving the biggest reason.
>gets rid of all runtime errors
NoRedInc has reported 0 RTE's from their 200k Elm code for years since they started using it.

sounds silly but this works -
step through every line of code and work out on paper what is happening. keep track of variables, draw out data structures, etc...
execute your code exactly as if you were the computer
*note: don't try this with recursion

>catch a single output of an expression and pass it to the other expression one by one.
How is your way of doing that better than the myriad of other ways available in more readable languages?

Actually I don't condone OOP as usually formulated, for instance in Javeet, sepples or smalltots. Even CL's object system is lacking, but it's getting there. Same with Ruby's.
(See second paragraph above)

The only argument for simulations is FP is slow and not at all realistic. There is literally no reason you cannot model this in FP assuming we solve the speed issue. Because you CAN do mutation, the difference is you don't risk blowing everything up because it's controlled mutation.

Just finished that: p.sicp.me/mNusT.js (the useful part is at the end)

It's a "build system" in node.js for a bot (to mirror Sup Forumsdpt comments on a chan)

- it takes a tree of js files
- sorts the paths (nested paths before - to preserve global vars ordering)
- remove blank lines and comments (//)
- save the concatenated content to a single file (cli.js)

The shrinked output looks like that: p.sicp.me/qjUJz.js

FYI we did an announce for #Sup Forumsdpt on rizon yesterday

>i did not say that
>also didn't say that
>NoRedInc has reported 0 RTE's
It's the only way to interpret your statement as an actual argument. Since you're not saying that, do you have anything to say that isn't a non-sequitur?

Or just use breakpoints and inspect your values as they change, mongoloid.

>there's only one person on /dpt/
I don't give a shit about your stupid debate
Merely pointing out how big of brainlet you have to be to consider FP hard to read and write.
Just stick to python, rajesh, the rest is clearly to hard for you to read or write.

how 2 get good at programming?

I'm not saying it's better. Actually, the language is highly inspired by Icon and last time I checked Sup Forums hated Icon for some reason. I'm doing this just for fun.

make posts on Sup Forums and definitely don't touch anything resembling an IDE or TE.

True. but usually I don't like coding my solutions to simple problems in an IDE or bloated text editor, and believe it or not I find it easier to reason about my code when I hand debug it.

>"FP is bad"
>obliviously perfectly describes record oriented dynamic FP as what he wants out of OOP for it to be usable
>calls it OOP
>"this is what you should use instead"
... Okay.

>Actually I don't condone OOP as usually formulated
It doesn't matter.

>See second paragraph
I'm talking about your first paragraph, in which you espouse a deeply delusional view that optimal code will somehow correspond to your vague taxonomical mental model of the problem domain.

Sounds like you would be a waste of everyone's time in the real world. Use your tools to increase productivity.

>Merely pointing out how big of brainlet you have to be to consider FP hard to read and write.
user, it was either you or one of your buddies trying to derail the discussion from you having to justify your cult dogmas to being able to yell that everyone who opposes it is just too retarded to understand a monad.

how to spot a brainlet:
"x language is shit / has no good uses"
"x paradigm is shit / has no good uses"

Mutation is not the issue here, the issue is that it's unnatural to envision autonomous material things (objects) that enact behaviors (methods) as functions representing those behaviors (free functions) being enacted by a mysterious force upon inert material things (records).
You CAN do anything in FP. By definition. After all, there are Turing complete functional languages. My concern is that it's a bad idea.