Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
look if you want to type safely just buy a kinesis advantage pro, it's compatible with any language and it looks and feels great.

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
it also has a foot pedal which is great if you use modal typing systems

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.

comedyblissoption posted:

interface{} everywhere is a golang idiom, because the golang standard library itself uses the idiom of forcing consumers to use interface{} everywhere and giving language users the worst of both dynamic and static typing
https://github.com/golang/go/issues/23077

the vast majority of that list uses interface{} for reflection, which is a legitimate use of interface{} since you're inspecting the RTTI anyway

a small portion of it is to make up for a lack of sum types (which also sucks)

there are a couple cases like context when the user is providing an arbitrarily-typed value and is the only one getting it back later but multiple users are providing values, all of differing types, so there's no single type to parameterize over

none of those would be helped by generics

the rest are things like sync.Map or the useless container/* packages where generics would certainly fix everything

Volte posted:

What's the alternative

don't try to write a generic data structure because you can't. use the built in generic types like slice and map, if you can, and write a type-specific data structure if you cannot (which is often fairly simple to do in terms of slices and maps)

algorithms are simpler because you can define them in terms of an interface, like sort.Interface does it

comedyblissoption
Mar 15, 2006

Volte posted:

What's the alternative


Sapozhnik
Jan 2, 2005

Nap Ghost

cursed image

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
im the three separate I-beam cursors in the last image

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

fixed for appropriate score

https://www.youtube.com/watch?v=nV76z7B7lsY

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.
I'm the missing edge cases for floats

redleader
Aug 18, 2005

Engage according to operational parameters

Volte posted:

What's the alternative

https://www.reddit.com/r/rust/comments/5penft/parallelizing_enjarify_in_go_and_rust/dcsgk7n/

Zlodo
Nov 25, 2006

this is a sacrilege against the great vision of Rob "colors are for children" Pike

Athas
Aug 6, 2007

fuck that joker

MALE SHOEGAZE posted:

look if you want to type safely just buy a kinesis advantage pro, it's compatible with any language and it looks and feels great.

Can confirm; strong typing goes well with static typing. Been using a Kinesis Advantage for years (not Pro because I am an academic).

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
TIRED: relentlessly mocking interface{}
WIRED: making fun of https://golang.org/pkg/sort/ and everything implemented like it

nbsd is it still haram if I use a container of interface{} as the under-the-covers implementation of a typesafe container? At that point, the copypaste is reduced from "whole implementation" down to "just the interface methods, full of typecasts".

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.
everything in sort is fine except sort.Slice which is dumb

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

Lonely Wolf posted:

everything in sort is fine except sort.Slice which is dumb

yeah, I agree that sort is okay (if clunky)

package sort is also a golden example of how, in go, things that you normally would use generics for don't have to use interface{}

redleader
Aug 18, 2005

Engage according to operational parameters

prisoner of waffles posted:

TIRED: relentlessly mocking interface{}
WIRED: making fun of https://golang.org/pkg/sort/ and everything implemented like it

this is some tragic poo poo. does go not even have operator overloading?

Volte
Oct 4, 2004

woosh woosh

prisoner of waffles posted:

yeah, I agree that sort is okay (if clunky)

package sort is also a golden example of how, in go, things that you normally would use generics for don't have to use interface{}
That package is the epitome of "see, we don't need generics *proceeds to emulate generics in the clunkiest possible way*". there's not needing generics and there's not admitting it

edit: I guess that's got nothing to do with interface{} but christ, the whole problem could have been avoided

Toady
Jan 12, 2009

people are constantly complaining about go. why does anyone use it?

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
your periodic reminder that they haven't said no* to generics (just no to many of the performance or structural characteristics common to generics in other languages)

if you are like "I am a genius and they just need to add generics liek _so_" you can go and take a dang look at the proposal-in-the-abstract: https://github.com/golang/proposal/blob/master/design/15292-generics.md

and at the 4 concrete proposals, all of which were not accepted but serve as examples of what functionality they want:
https://github.com/golang/proposal/blob/master/design/15292/2010-06-type-functions.md
https://github.com/golang/proposal/blob/master/design/15292/2011-03-gen.md
https://github.com/golang/proposal/blob/master/design/15292/2013-10-gen.md
https://github.com/golang/proposal/blob/master/design/15292/2013-12-type-params.md

Space Whale
Nov 6, 2014
C is scary I guess
And cpp is cpp

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

Rob Pike posted:

C is scary I guess
And cpp is cpp

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Toady posted:

people are constantly complaining about go. why does anyone use it?

Does anyone actually use it on a large scale? All I've seen of examples are Google and a lovely wine app company in copenhagen.

Space Whale
Nov 6, 2014
Lol

Notorious b.s.d.
Jan 25, 2003

by Reene

prisoner of waffles posted:

your periodic reminder that they haven't said no* to generics (just no to many of the performance or structural characteristics common to generics in other languages)

if you are like "I am a genius and they just need to add generics liek _so_" you can go and take a dang look at the proposal-in-the-abstract: https://github.com/golang/proposal/blob/master/design/15292-generics.md

and at the 4 concrete proposals, all of which were not accepted but serve as examples of what functionality they want:
https://github.com/golang/proposal/blob/master/design/15292/2010-06-type-functions.md
https://github.com/golang/proposal/blob/master/design/15292/2011-03-gen.md
https://github.com/golang/proposal/blob/master/design/15292/2013-10-gen.md
https://github.com/golang/proposal/blob/master/design/15292/2013-12-type-params.md

none of this matters

it's too late

they needed generics on day one. ten years of banging void{} around, including in the stdlib itself, dictates that it will always be turbofucked

think how long the hangover of no-generics, then type erasure, haunted java. (and that language had much greater overall uptake + billions of dollars of investment from multiple vendors!)

Notorious b.s.d.
Jan 25, 2003

by Reene

Boiled Water posted:

Does anyone actually use it on a large scale? All I've seen of examples are Google and a lovely wine app company in copenhagen.

don't forget kubernetes

even if very few people choose to develop new things in go, they're still affected by the "quality" of the golang ecosystem

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
none of those are language proposals, they are essentially vague requests for someone else to please start thinking about making a language proposal

go will never actually do generics because they introduce way more complexity than the go implementors are comfortable with. go is not quite python levels of "gently caress you we'd rather be slow than weird" but they're not adventurous people

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Notorious b.s.d. posted:

none of this matters

it's too late

they needed generics on day one. ten years of banging void{} around, including in the stdlib itself, dictates that it will always be turbofucked

think how long the hangover of no-generics, then type erasure, haunted java. (and that language had much greater overall uptake + billions of dollars of investment from multiple vendors!)

you’re discounting the possibility of a gotwo which could ignore backwards compat. i thought that was the plan but i haven’t followed it in a whole

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


MALE SHOEGAZE posted:

you’re discounting the possibility of gotwo which could break apis and stuff. i thought that was the plan but i haven’t followed it in a whole

making gotwo would be almost as worse as making something not backwards compatible, but with everything proposed crammed in there

called go++

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Boiled Water posted:

making gotwo would be almost as worse as making something not backwards compatible, but with everything proposed crammed in there

called go++

maybe that’s always been the plan. they’re just waiting for bjarne to do it.

VikingofRock
Aug 24, 2008




Has anyone written a blog post called "go, too, considered harmful"?

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


MALE SHOEGAZE posted:

maybe that’s always been the plan. they’re just waiting for bjarne to do it.

he'll be in the cold ground before being allowed to invent anything like that again

Space Whale
Nov 6, 2014
I want to fork go and call it went.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

VikingofRock posted:

Has anyone written a blog post called "go, too, considered harmful"?

:eyepop:

comedyblissoption
Mar 15, 2006

go 2 considered harmful

CPColin
Sep 9, 2003

Big ol' smile.

Space Whale posted:

I want to fork go and call it went.

Go New Edition

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Space Whale posted:

I want to fork go and call it went.

go for Windows 3.1 with workgroups

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
goto 1980

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Space Whale posted:

I want to fork go and call it went.

this reminds me of a bumper sticker I saw on a door once that read HONK IF YOU FSCK

akadajet
Sep 14, 2003

pokeyman posted:

this reminds me of a bumper sticker I saw on a door once that read HONK IF YOU FSCK

i've never had to

Notorious b.s.d.
Jan 25, 2003

by Reene

Boiled Water posted:

go for Windows 3.1 with workgroups

wfw 3.11, never forget

Adbot
ADBOT LOVES YOU

LinYutang
Oct 12, 2016

NEOLIBERAL SHITPOSTER

:siren:
VOTE BLUE NO MATTER WHO!!!
:siren:

Notorious b.s.d. posted:

they needed generics on day one

nah considering golang is skyrocketing in popularity and java is not

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply