Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Object Algebras

Name: Anonymous 2015-01-17 19:56

Namely, in terms of GoF design patterns ExpAlg<T> is an interface of an abstract factory for creating expressions.
https://oleksandrmanzyuk.wordpress.com/2014/06/18/from-object-algebras-to-finally-tagless-interpreters-2/

Name: Anonymous 2015-01-17 20:20

Another blog post about the expression problem? Negro, please.

Name: Anonymous 2015-01-17 20:24

Oh, and it's got Java in it. Why'd you even bring this shit here?

Name: Anonymous 2015-01-17 21:02

>>3 The ProblemFactory code looks like shit, per usual, complete with an accurate description by the quote in >>1, but the AbstractBullshite looks fine.

Anyway this is new ground for static+strong typed languages and it doesn't require any modification to existing code or convoluted abstraction in most languages (i.e. nearly anything but ProblemFactory.)

Name: Anonymous 2015-01-17 21:21

>>4
tagless final encoding
new ground
What else is new ground in your remote African village, negro?

Name: Anonymous 2015-01-17 21:50

>>5
Just because the idea isn't new doesn't mean the techniques presented aren't. Have you tried reading the related material?

Name: Anonymous 2015-01-17 21:54

>>6
Just read Oleg
http://okmij.org/ftp/tagless-final/
instead of discovering "new ground" in shitty blogs.

Name: Anonymous 2015-01-17 21:57

>>6
Go back to HackerJews!!!!

Name: Anonymous 2015-01-17 23:30

>>8
don't get triggered

Name: Anonymous 2015-01-17 23:37

>>9
Unlearn your faggot reddit/hackernews culture, and keep it out of /prog/, you disgusting normal.

Name: Anonymous 2015-01-17 23:46

cuck em

Name: Anonymous 2015-01-17 23:51

>>11
Cuckolded! Now watch and film while I impregnate your girlfriend with my black sperm.

Name: Anonymous 2015-01-18 0:35

>>10
u triggered bruh

Name: Anonymous 2015-01-18 0:56

>>13

U memeshitting to hide your embarrasment at getting called out as a norm casual, bruh?

Name: Anonymous 2015-01-18 2:15

U MENA NTR

Name: Anonymous 2015-01-18 2:49

>>14
butttriggered

Name: Cudder !MhMRSATORI 2015-01-18 3:08

I am going to describe two design patterns
I already have a bad feeling...

However, it is rather awkward to add new operations as we need to add new methods to the interface Exp, which is going to break all its concrete implementations.
If you're adding a new operation then "all its concrete implementations" likely "need to" implement them anyway (otherwise you would've provided a sensible default in the superclass - like the "pure virtual function call" thing), so what exactly is the problem here?

adding a new expression type is hard as it corresponds to adding a new row crossing all columns, and every intersection is a new case that has to be added to the corresponding function definition

Adding a new operation is hard as it corresponds to adding a new column crossing all rows, and every intersection is a new method definition that has to be added to each of the existing classes.

WTF? What is so bloody "hard" about doing something that has to be done anyway?

Can we achieve extensibility in both dimensions without loss of static guarantees and without having to modify existing code? That is the essence of the expression problem.
How is this even a problem? If you don't want to modify existing code for whatever perverse reason, then write a program (or even just use the preprocessor) to generate the code for you... there's no way around the fact that you will have M * N different pieces of code and adding one thing in one dimension will require M or N changes in the other. If you think most of those cases are going to be defaults then make the generation code fill it in.

Instead you add a bunch of extra classes, creating extra objects and indirection making the flow even more difficult to follow, and you think this is not "hard"?!?! What the actual fuck?

>>4
How is this not "convoluted abstraction"? It's deliberately being obtuse about a practically non-existent problem and then making an unnecessarily complex way of solving it.

Name: Anonymous 2015-01-18 4:03

WTF? What is so bloody "hard" about doing something that has to be done anyway?

You have to rewrite the code. That isn't always an option, and when it is it's insane if that code is in a third party library. Importantly, with this technique, it does not have to be done. And there's no boilerplate if you don't write it in Java.

How is this not "convoluted abstraction"? It's deliberately being obtuse about a practically non-existent problem and then making an unnecessarily complex way of solving it.
It's a very real problem when you need to augment a foreign ADT with your own variants. It's not obtuse, it's just a typical typeclass in the category of what's your fucking problem can you even read?

Name: Cudder !MhMRSATORI 2015-01-18 4:56

>>18
You have to rewrite the code. That isn't always an option, and when it is it's insane if that code is in a third party library.
You don't have to "rewrite the code", it's just adding a few functions. If it's a 3rd-party-lib then it's their bloody fault for not making the required source available.

Importantly, with this technique, it does not have to be done. And there's no boilerplate if you don't write it in Java.
You still have to add the functionality you wanted, only you go through a vastly more convoluted way to do it. Even if it's not Java, the runtime cost is still there.

augment a foreign ADT with your own variants
Using needlessly abstract bullshite terminology does not make you seem any more intelligent.

Name: Anonymous 2015-01-18 10:11

>>19
augment a foreign ADT with your own variants
Using needlessly abstract bullshite terminology does not make you seem any more intelligent.
Are you kidding me? That is ``abstract bullshite''? Have you even touched a language other than x86 assembly?

Name: Anonymous 2015-01-18 10:55

>>20
Nothing about ``augment'', ``foreign'', or ``variants'' in SICP or my C data structures book.

Name: Anonymous 2015-01-18 12:23

>>19
You still have to add the functionality you wanted, only you go through a vastly more convoluted way to do it. Even if it's not Java, the runtime cost is still there.

Of course you still have to do all the work, but that way it's all in one piece. You just add a piece to the pie and it blends with the rest of the pie seamlessly. As opposed to having to change the old pie and manually sew the string through a lot of places scattered all over the old pie (which you might not have rights to change anyway). It's modular - new stuff can be totally separated from the old stuff and yet they work seamlessly together.
As for runtime costs, Haskell has none. All the dispatch is done statically by the compiler, you just have to choose which type you want to interpret it as. E.g. one and the same piece of eDSL code can be interpreted as an integer (by doing numeric calculations), a string (just print the code), as a double (do numeric calculations with floating-point precision) etc. But the choice is done statically and there are no runtime checks involved.
Don't know about the slave languages though, they might introduce costs.

their bloody fault

You've just admitted defeat. You can't do something the blog author can, mwahahaha.

Using needlessly abstract bullshite terminology

OK, replace "ADT" with "a type that can be either this or that and there's a tag telling which one it is". You might have heard of them as "tagged unions".

Name: Cudder !MhMRSATORI 2015-01-18 14:57

but that way it's all in one piece
So what?

It's modular - new stuff can be totally separated from the old stuff and yet they work seamlessly together
What you call "modular", I call "poor integration". See http://bbs.progrider.org/prog/read/1406427616 for all the bloaty inefficiency that causes.

All the dispatch is done statically by the compiler, you just have to choose which type you want to interpret it as.
You can do that only if you know the type statically... which isn't the case with the general "expression problem".

you might not have rights to change anyway
Of course I fucking do... it's my goddamn computer, I control every bit of memory it has!

I get it now... this is just another one of those silly bureaucratic customs (how did I not notice, it's called "design patterns") that was brought about by OOP and all that stupid "modularity" "encapsulation" "structured programming" crap.

Name: Anonymous 2015-01-18 16:14

My little Cudder.
Memory is Magic!

Name: Anonymous 2015-01-18 16:14

>>23
If one were to listen to you, then separating source code into many files is "poor integration" and "bloaty inefficiency" too, LOL.

Name: Anonymous 2015-01-18 16:17

I think Cudder isn't even a real programmer. She's like a toilet scrubber except scrubs binaries.

Name: Anonymous 2015-01-18 16:24

>>25,26
idiots. Maybe you should stick to your blogs.

Name: Eat My Big Dick! 2015-01-18 16:39

>>27
Eat My Big Dick!

Name: Anonymous 2015-01-18 17:29

>>23
This retard doesn't know what "upstream" means, or "libraries" for that matter. Probably thinks that computer programs just huge monolithic pieces of binary.

Name: Anonymous 2015-01-18 21:05

>>29
This retard doesn't know what VIP QUALITY means, or ENTERPRISE SCALABLE SOLUTIONSTM for that matter. Probably thinks that BBSes just huge monolithic 4chans.

Name: Anonymous 2015-01-19 0:38

>>30
Get the fuck out crossboarding scum

Name: Anonymous 2015-01-19 0:41

>>31
'>triggered

Name: Anonymous 2015-01-19 1:40

>>32
Buzzwords
VIPPERs are litterally jews, faggots, horsefuckers, and SJWs. They are the scum of the internet and should be driven from our midst whenever they rear their ugly heads.

Name: Anonymous 2015-01-19 2:24

>>33
'>sjws
but i have a thing for sexy jewish womens

Name: Anonymous 2015-01-19 3:02

>>34
Then go right back to SAOVQ and circlejerk over Mittens

Name: Anonymous 2015-01-19 4:28

>>35
i don't know what any of that means

something to do with a liquor store and a cat maybe?

Name: Anonymous 2015-01-19 9:18

>>36

It's the Social Area Of inclusiVe Quality. A website devoted to smashing the white cis-het patriarchy and creatinng a glorious Chosen run utopia of progressive tolerance. Mittens is their leader.

Name: Anonymous 2015-01-19 11:22

>>37
huh. how do you know all this?

can i meet women there?

Name: Anonymous 2015-01-19 11:38

>>38

I payed Rabbi Koolowitz all my shekels to help the cause of defending Israel from another Shoah on the internet. You can meet plenty of single girls like Mittens and Mittens and also Mittens if you just pledge your body and money(they have no need for a soul since goyim don't have one) to the Jewish cause. It's just that simple. Go to http://www.secretareaofvipquality.net/saovq/index.html and post your dubs in support of Israel today!

Name: Cudder !MhMRSATORI 2015-01-19 12:01

>>25
Ever had to figure out a large Java application?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List