/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1480187906353.jpg (1920x1411, 1.32M)

Other urls found in this thread:

queue.acm.org/detail.cfm?id=3212479
youtu.be/lC5UWG5N8oY
github.com/Microsoft/TypeScript/issues/195
twitter.com/SFWRedditImages

board game in typescript

Lisp is the most powerful programming language.

The C++ language spec is about 400 pages with the library taking up most of the remaining 1000 pages. Cniles would have you believe there's an order of magnitude more to learn when really it's only 2x as large.

Also, Haskell 2010 is defined in about 330 pages. Including libraries.

most wasted numbers i ever got:

S-STOP PLEASE
EVERY DAY
EVERY SINGLE DAY WHY YOU GOTTA BULLY C

Attached: 1544729016111.png (1098x1126, 492K)

Fuck off, you retarded wojack poster.
Not everybody is an insecure little bitch like you are.

I don't remember if they do that for any of the language features, but the C++ standard often defers to the C standard, making it larger than the page count suggests.

have you listened to Linus at all? C is modeled after the computer unlike haskell.

>C is modeled after the computer
Your computer is not a fast PDP-11

queue.acm.org/detail.cfm?id=3212479

it's still working like a turing machine, not a lambda calculus evaluator.

>Some troll post by a literally who
I've always hated this meme.

>If I don't like an argument it must be a troll
Ah the echo chamber

JavaScript rocks!

Attached: js-rocks.png (1000x494, 368K)

irrelevant, i am referring to the language itself, not its implementation.

Haskell is a high level of expression language with very few specific requirements on how code is executed.
youtu.be/lC5UWG5N8oY
This talk is great for understanding the situation.

int, size_t, functions, memcpy, malloc are not logic gates.

>C is hardware
>OOP BAD FREE FUNCTION GOOD
>Muh Suckless
>Muh moan ads
>Muh FP

Attached: 1547998446687.png (882x1025, 246K)

What's this obsession with speed from autists?

It's literally not the 80's anymore and pcs have more than 100mb ram and even our phones beat the supercomputers from the time.

Obsessing with something that has absolutely nothing to do with today's IT environment is ridiculous.

OOP is actually bad though

yeah and one of these requirements is garbage collection. that alone makes Haskell unsuitable for bare metal programming.

Attached: risitas.png (272x204, 71K)

Wasting cpu cycles on a super computer cost several thousands of dollars.

new thought I'd ever see suckless and moan ads together

Attached: 1530990609488.jpg (335x366, 23K)

What is OOP and What's your alternative?

linear types will save bare metal programming

Attached: 1525899981387.gif (480x270, 363K)

Speed matters for non-trivial applications, just because you write CRUD webapps doesn't mean the rest of the world does

>Considered Harmful
Thread ruined. Do NOT reply.

Learning python.
The while loop is pretty cool.

Attached: python.png (329x114, 20K)

JS is the best but not JavaScript.

I like your font

>What's your alternative?
data types.

bunch of RT embedded wannabes screeching, as usual.

Is OOP void of data types? What is OOP?

>What is OOP?
reverse POO

I don't understand why you think someone who expresses that Haskell is a high level language would expect it to be used for bare metal programming.
It makes you sound like a fool honestly.

Rust generics hurt my brain more than I though it would. Save me.

Attached: cuteblob_rising_to_greatness.jpg (700x2000, 159K)

oop is about modeling your software architecture around objects instead of data types, obviously.

What is POO?

What's the problem? They're very straightforward compared to C++ templates.

objects are data types

you are the one who came with Haskell when we were talking about operating system development.

Why can't I partially specialize function templates?
Why can't I use variable templates as template arguments like I can for alias or class templates?

Does OOP disallow defining how an instance of a data type behaves?

What if your data types are modeled as objects?

>font
>python2
>tabs instead of spaces
>yourseft
You should really kill yourself.

it's a programming archetype designed to reuse code.
but for anything other than small projects it seems to just lead you down the path of a tangled mess.

Procedural and functional programming give you upfront pains, but it's a good pain because you sort everything out and when you grow large you don't pay for it with compounding interest later. The pains that drive people away are actually the strengths of the language squeezing out the weak who refuse to adapt and solve problems the correct way.

OOP can be good, it depends on the application. But the only people who seem to like OOP so much seem to like it and use it for the wrong reasons.

>replying to considered harmful faggot
you DO realize he's just an attention whore, right? Don't ruin this thread.

the whole point of having objects is to hide the data behind a set of operations.

Attached: wow anon.jpg (884x574, 78K)

also hide the data in the source code. By splitting it up into tiny needles and tossing them up in the air allowing them to scatter.

That's ADT not objects.

yeah but they're still data types

No. I didn't mention Haskell first at all.

I know what (linear) procedural programming is. It's a primitive, unsalable, faulty and DRY violating programming paradigm.

What I really want to know what do people ITT mean by "FP" and "OOP" and how exactly are they different and better than the other.

an adt doesn't hide the data, only its representation. seriously, wtf.
with a adt you still reasons with types, not with operations alone.

>procedures are a way to reuse code
>procedural programming violates DRY

no you're just failing to see that noones falling for your shitty bait

>What I really want to know what do people ITT mean by "FP" and "OOP" and how exactly are they different and better than the other.

fp and oop are not exclusive to each other. it's not oop vs fp but oop vs adt vs data types

>procedures are a way to reuse code
Procedures are not a complete solution to DRY. Want me to expand om it?

sure

>Write Great Code, Volume 1
more like abbreviated version of 1000 Wikipedia articles on how computers generally work.

error[E0117]: only traits defined in the current crate can be implemented for arbitrary types

Kill me. I just want to implement the Display trait for a type in the rusqlite crate, bu hu.

>7 (you)s, not counting the 2 implicit ones
IDK you tell me.
I don't think OOP disallows data types, nor ADTs.

lmao rust is shit

you repeated your question 7 times, kys

Procedure alone without polymorphism requires you to rewrite the same code

Attached: 1537771566378.png (1200x1400, 502K)

filtered.

Attached: 1548038451873.gif (450x450, 2.87M)

If you are looking for an echo chamber I highly suggest you to visit plebbit, user.

so just add parametric polymorphism

Procedures don't exclude polymorphism by design though, that would be the type system, you can write polymorphic code in C or Assembly

I wont deny that, of all the languages I used it is the worst but I wanted to learn it and use it before making any judgment because I'm not a stupid nigger.

So as I said, "Procedures are not a complete solution to DRY". You need other things and one of them being polymorphism. Is that clear to you or need I explain more?

this is why dynamic typing is so important and the way to go.

>Procedures don't exclude polymorphism
Procedures do not make polymorphism unnecessary either. I don't know what point you are trying to make but it's wrong.

Dynamic typing doesn't actually exist.

Polymorphism exists in programming by default. Polymorphism only disappears when you add a type system that doesn't support it

t. gopher

Polymorphism by definition cannot exist without a type system. If only a single type exists, then a data object cannot inhabit multiple types.

/dpt/ is my fanclub. Get over it.
Yes, regardless of a type system, procedure alone is not a complete answer to DRY. Are you being sarcastic or just too retarded to see an obvious mistake you made?
(The mistake being disagreeing with me)

Which board game?

Attached: 1548339523393.jpg (2496x2496, 289K)

One of the board games written in a language that doesn't even have an `int`type.

>procedure alone is not a complete answer to DRY
If you take assembly and add some procedure macro to it, you've created a complete DRY solution, albeit a shitty one. As the other poster points out, polymorphism or lack-of-polymorphism is irrelevant if there is no type system, there's just memory which you can do whatever you want with

>not filtering or anonymizing tripfags

Attached: 1531016302541.jpg (794x719, 117K)

What exactly is a "procedure macro"? I am not familiar with this term. And how exactly does it offer complete DRY?

I have been considering learning Go since I started to learn Rust. I ordered the Kernighan book already, nonetheless I will keep working with Rust for at least two months just to be sure it's the language itself that sucks and not me being lazy. Many of my previous problem arose from me being too lazy to read the documentation, but still, so far is sucks. Having to read the documentation all the time sucks.

In c#, can you call a method in an object when the object instance is referenced? Like
>foo(someobjectinstance)

>class Someobject
>Void methodthatiscalledwhenreferenced
>{print(that tickles user-san!)}

Like a custom get function for the object itself, so you can do something before returning the object.

The only real problem is the unacceptable FFI overhead, really. I don't think Go is going to fix that.

>And how exactly does it offer complete DRY?
Because you have procedures (reusuable code) and you have zero restrictions on what you're allowed to do with data, so it's polymorphic by default

Not really. When would such a thing even be triggered?

Do tell us your impressions of Go once you try it. You seem like one of the sane ones here.

Attached: 1540303383419.png (646x624, 248K)

Yeah, why don't they solve their problems with pen and paper instead?

apparently JS has no int guise

Attached: unknown.png (301x96, 2K)

SFML makes me happy

Attached: 1458266986297.jpg (413x395, 42K)

Polymorphism is not about having zero restrictions, it's about having zero restrictions for compatible data types. Which your "proc asm macro" won't ensure.

Polymorphism is essentially being able to treat a data type as another data type. Obviously without a type system you can treat your data as anything you want. You sound like you don't know what you're talking about

text mode makes my pee pee feel strange.

github.com/Microsoft/TypeScript/issues/195

idk what your background is, but if you're just looking to copy paste together kode without much thinking, yeah sure Go will be a billion times better for you, certainly.
I don't get why people pick languages without thinking and then complain about them for doing exactly what they're supposed to do.

>being able to treat a data type as another data type
So how does having no type system let you have data types exactly?

>2014
Based retard.

the type exists in your head, to the computer it's just data