The Go Blog: Why Generics?

blog.golang.org/why-generics
Fucking lol. So much for Go fans' "generics are (optional|complex|useless|harmful)" song and dance. It's funny that the leaders of their cult were never as fanatical as the cultists.

Attached: 312-3123756_golang-logo-png.png (568x568, 252K)

>harmful
i hate sjws trannys so god damn much

It's been established for a long time that people wanted generics, it's just noone knows how to do it right. I'm glad they're thinking it through properly and not just adding everything ahem C++.

It sounds like go 2 will be harmful.

Why use go when you could use deprecated versions of java instead? Basically the same thing but less of a meme.

Why use java when you can use C# with .net-core.

>it's just noone knows how to do it right
surprisingly many
I kinda like how Zig did them with comptime and compile-time type information.
Also works with other types, such as integers - this is where if matchesC++ templates which are more powerful than what other languages provide.
The way it's supposed to work to generate data types is weird, but works and is very consistent.
But since Go doesn't have any concept of compile-time information in its core, this is a non-option.

Zig desu is neat but I haven't had much chance to use it.

Go is the most disgusting language I've ever seen. Russ Cox must have 70 IQ at best

I just finished reading that and I'm not a fan. I hope they don't do it. The language will be just as toxic as Java.

>png.png
>still not transparent

is this piece of shit language finally getting usable?

>fanatical
This is not my experience. I only remember trolls suggesting that the language is shit because it doesn't have generics, and people responding that it is a great and productive language as it is.
But, well, here I am, falling for another troll thread.

Fucking hell this is going to be just like python. The people in charge will get fed up with all the stupid pressure to ruin the language. Next some retards come along, implement """quality of life""" features and suddenly factory of factories.
Is there any science in the language development field, outside lisp*? Like is it possible to have languages that only have a minimal feature set (stdlib aside) that covers the original intent of its creation? Or the only way is through studying real world code or something? If we keep doing language development based on developers opinion alone it's always going to be shit.
tl;dr how the fuck do we move from opinion based language development to a better model?

That's not where the use of the word "harmful" comes from.

>Go is a great and productive language
t. webshit with IQ of 75

Ada got it right almost 40 years ago

Attached: did someone say desu.gif (525x400, 35K)

It cancels out, like rot13.

Yeah but who gives a fuck about Ada?

Gentlemen of taste with huge salaries

I still don't know why they're going with this retarded contract bullshit when they could equally use interfaces as generic bounds.

How come? I like Go, it gets shit done. Downside is I cannot argue over which language feature to use any more with the buddies.

will generics fix the interface fuckery in go? you have to jump through lot of interfaces to do anything in go like functions that receive multiple types etc

no, go will still be retarded
>multimethods in go
manually bounce a method off every single interface type
>multimethods in lisp, haskell
just write the fucking method

>let's release an incomplete language
cope

why use C# when you could use Python+NumPy and not gargle on Microcock?

yes that's the shit, desu I am not a gonigger but I don't really know what generics are actually used for? I only have used them in java for specific data structures like map lists etc but don't really know what they accomplish that they are a much wanted feature. my guess is that like in java how you can make model classes and use class as types for oop convenience. I think its related to that, what even are generics

That's exactly what every language effort out there does. Remember the days when C++ didn't have lambdas? What about Java? Yeah, thought so.

generics = types and functions that take types as parameters
eg you have a declaration class List so now you can have a List, List or a List
all of those are distinct types, using one where another is expected creates a type error

> it's just noone knows how to do it right

Gotards made the same claim with dependency management.

In the end they implemented an abomination that was objectively worse than anything out there on the market. I expect the same to happen when Generics are implemented.

>comparing lambdas to generics in an object oriented language
keep copin' buddy

parameteric polymorphism has been done right since it was first used in ML 40+ years ago

when is it going to be released

This a 2^128 times

imagine you want to brogram a function func() that takes two parameters x, y, and this function will do something numerical like add x to y and then subtract 23.
What types are x and y?

Do they have to be integers? Couldn't they also be floats? Or doubles? Do you want to have to implement three separate functions for each of those types?

With generics, you can simply declare
func(T x, T y)
and now your function takes an extra parameter, T, which is the type of x and y, so you can call
func(x, y)
func(x, y)
func(x, y)
without having to rewrite your function.

i might have muddled some of the explanation (i actually don't think you'd make x and y type T, you'd make some of the private variables of func type T or something liek that) but i am very drunk so fuc you

>it is a great and productive language as it is.
you would honestly need to have schizophrenia to believe this

ML and it derivatives got generics right. Why can't other languages?

They got it right with:

>multithreading part of the language
>Not another OOP language
>Compiler comes with extra tools like indentation, doc server multiplatform....
>lots of libs and all well documented

They got it wrong with:

>looks like C
>adding new things
>statically typed language
>enabling people to link C libs
>expanding the language just some years in

Devs fear existing languages to fucking much, the programing styles from today are a fucking disaster that makes long term programs a nightmare, most of the cases companies prefer to make things from scratch because touching old code gives you cancer we reimplementing the wheel in a weekly basis and it has to stop.

try to write something that does SQL requests and all returned data has his own type.
Then you will understand why some people want generics

I swear programming is filled with buzzwords.

You want to learn C++, but you need to learn POINTERS and REFERENCES.

You want to learn JS, but you need to learn what a CALLBACK is for example or A PROMISE. Don't forget HOISTING or what a FUNCITON CALL is.

Oh, your language doesn't have SCOPE.

When I didn't know anything about it I was kinda overwhelmed and reacted with fear. Oh my God, who's gonna learn all of those. Now I laugh at the people who write shit like that.

Just learn the fucking language.

P.S. this post has nothing to do with you, it came to my mind when I read the term "generics"

you don't need to know any of those things to learn how to program, and with good reason those things are not taught to entry-level programmers (meaning COP 101 or whatever) at most universities
If you're past the point where you're a beginner, but you're resistant to learning interesting and useful features like pointers, references, callbacks, (tail) recursion, lexical scope, etc. then why the fuck did you learn how to program? So that you could post snippets of Python on twitter for social media points? fucking kill yourself faggot jesus fucking christ

You say "just learn the fucking language" but then get mad when people talk about language features and language design
End your sad life

Attached: 1559927181403.gif (320x180, 465K)

and YES I'm still drunik fuck you

Attached: 1535935817856.png (1000x1000, 58K)

Java isnt even free kek

It is, that's why I, like many others including the boomer legend Alan Kay, never considered it a real industry any more

It's a chase after fads and pop trites

OpenJDK is and always is free. Seethe harder.

Attached: 1534935983694.jpg (1291x3600, 610K)

Go's problem is much more than just not having generics. It's a totally fucked up language. Any average CS/CE undergraduate can design a better language

>700 job openings for scratch

Attached: Untitled.png (293x367, 168K)

R stands for R-Rust right?