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
Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

QuarkJets posted:

You mean having the *privilege* of inserting Aboriginal characters
I apologise.

Adbot
ADBOT LOVES YOU

NtotheTC
Dec 31, 2007


I'm honestly impressed the Aboriginals were even doing templating back when their language was developing

Volte
Oct 4, 2004

woosh woosh
I've seen that template technique before in C, but it just used GNU M4 or whatever and didn't get cute with weird characters. I guess using valid identifier characters keeps the syntax highlighter happy but any kind of IDE or analysis tool is going to break anyway.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Volte posted:

I've seen that template technique before in C, but it just used GNU M4 or whatever and didn't get cute with weird characters. I guess using valid identifier characters keeps the syntax highlighter happy but any kind of IDE or analysis tool is going to break anyway.

Back in the day :corsair: we used macros to instantiate container classes.
:bang: HP codelibs :bang:

repiv
Aug 13, 2009

Doesn't Go have real generics now, in what ways is their implementation stupid and broken

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

repiv posted:

Doesn't Go have real generics now, in what ways is their implementation stupid and broken

your generic classes always do virtual calls for everything instead of getting specific implementations inlined and optimized

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

repiv posted:

Doesn't Go have real generics now, in what ways is their implementation stupid and broken
I feel like there's a "no, money down!" joke in here somewhere

repiv
Aug 13, 2009

Jabor posted:

your generic classes always do virtual calls for everything instead of getting specific implementations inlined and optimized

lol of course, they're obsessed with minimising compile times but refuse to have an "optimize extra hard" flag so the only way to make generics fit is to never expand/inline them

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Many years ago $OLDJOB sent me to GopherCon as part of a marketing and recruiting push and the keynote was from one of the language designers (some Googler pulling in a million a year but still dresses in Hawaiian shirts) talking about the elegant simplicity of the code generator, and I then realised the main design goal of Go is to be simple to implement by lazy Google engineers

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

DoctorTristan posted:

Unicode was a mistake

Really, programming in real alphabets and words was the mistake, we should have taken a page from APL and just made anything that's not user facing I/O content be weird, bespoke symbology that requires a separate keyboard. This would have kept the priesthood of programming interact, preventing shenanigans like this under thread of Programmer Exile.

Dijkstracula posted:

and I then realised the main design goal of Go is to be simple to implement by lazy Google engineers

Incorrect; the main design goal of all Google programming is to perform artificially hard tasks as a rationale for promotion. Being simple to implement for the slothful among us (everyone) is a laudable bonus.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Volmarias posted:

Incorrect; the main design goal of all Google programming is to perform artificially hard tasks as a rationale for promotion.
:hmmyes:

Canine Blues Arooo
Jan 7, 2008

when you think about it...i'm the first girl you ever spent the night with

Grimey Drawer

Volmarias posted:


Incorrect; the main design goal of all Google programming is to perform artificially hard tasks as a rationale for promotion.

This would explain a lot. Go has such promise but they forgot that general purpose languages need general purpose features, and someone got a stick up their rear end about it.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

a friend of mine was one of the core tensorflow devs back in the 2010s and he'd always tell me about all the upstart internal competitors that seemingly popped up from nowhere to get people on other teams a promotion, so I can see it here too

Xarn
Jun 26, 2015

Jabor posted:

your generic classes always do virtual calls for everything instead of getting specific implementations inlined and optimized

It is even worse than just virtual calls, interfaces do virtual calls and generics manage to be slower :suicide:

(Actually generics can sometimes be monomorphized, the actual story is a bit more complex than that, this is a good article about them: https://planetscale.com/blog/generics-can-make-your-go-code-slower)

QuarkJets
Sep 8, 2008

The tensorflow api broke my illusion of Google only hiring good engineers

Ranzear
Jul 25, 2013

repiv posted:

Doesn't Go have real generics now, in what ways is their implementation stupid and broken

Getting a strong impression that it's very much the same 'technically, yes' as multi-threading.

Someone do please correct me if I'm wrong about go still being strictly one concurrent thread. It only has the barest sync primitives and no actual thread spawning call and parallelism with goroutines is "maybe?"

I pointed and laughed at a language being designed SO HARD just to be JavaScript++ and set it aside in 2015. Seems justified.

Ranzear fucked around with this message at 01:24 on Jan 9, 2023

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
Per the article Xarn linked above, go generics are only actually compile-time generics for basic datatypes like int32 / float64.

For every pointer-to-object type, the compiler generates a single dynamic void* implementation shared between all types that looks up the required vtables in a global shared cache at runtime.
This makes it perform worse than just using a non-generic polymorphic function and accepting an interface pointer, since at least for those the vtables are passed in alongside the function arguments.

RPATDO_LAMD fucked around with this message at 01:37 on Jan 9, 2023

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

RPATDO_LAMD posted:

Per the article Xarn linked above, go generics are only actually compile-time generics for basic datatypes like int32 / float64.

For every pointer-to-object type, the compiler generates a single dynamic void* implementation shared between all types that looks up the required vtables in a global shared cache at runtime.
This makes it perform worse than just using a non-generic polymorphic function and accepting an interface pointer, since at least for those the vtables are passed in alongside the function arguments.

Sounds like Smalltalk-80 and Objective-C method dispatch. Except that Smalltalk-80 did it that way for all types including ints/floats.

Kazinsal
Dec 13, 2011


Volmarias posted:

Incorrect; the main design goal of all Google programming is to perform artificially hard tasks as a rationale for promotion. Being simple to implement for the slothful among us (everyone) is a laudable bonus.

I'm pretty sure that Rob Pike actually said something along the lines of "Go exists because we can't trust programmers to be good enough to write C++" once upon a time

shame on an IGA
Apr 8, 2005

Volmarias posted:

Really, programming in real alphabets and words was the mistake, we should have taken a page from APL and just made anything that's not user facing I/O content be weird, bespoke symbology that requires a separate keyboard. This would have kept the priesthood of programming interact, preventing shenanigans like this under thread of Programmer Exile.

I am loving this brute-force solution to SQL injection, just look at all the trouble in-band signalling caused telephone companies.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Go is reasonably parallel these days and GOMAXPROCS doesn't default to one any more. This did reveal that goroutines aren't actually very good at parallelism, but you can just ignore them and do normal threading.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Plorkyeran posted:

Go is reasonably parallel these days and GOMAXPROCS doesn't default to one any more. This did reveal that goroutines aren't actually very good at parallelism, but you can just ignore them and do normal threading.

My favorite part about go is that the one interesting feature the language has everyone just says, "oh yeah ignore that thing it's never really worked right or as expected"

Ranzear
Jul 25, 2013

Plorkyeran posted:

Go is reasonably parallel these days and GOMAXPROCS doesn't default to one any more. This did reveal that goroutines aren't actually very good at parallelism

Every example I see on the internet boils down to "See? The numbers weren't printed in the order expected! Go is very clearly threaded." When this is challenged, the response is always "The scheduler determines the need for threading and you aren't doing enough work to cause it to invoke any, duh."

But uh, also:

Plorkyeran posted:

you can just ignore them and do normal threading.

No, you can't. They don't let you. There is literally no provided method. go will tell you to sit and spinwait and that goroutines are threads.

Digging deeper with five extra years of being insufferable, I'm a little thrown as to what things yield. It's really unclear if waiting on a future or something like time.Sleep() yields. Syscalls clearly will, and a goroutine can claim a whole thread entirely to itself and never be forced to yield, but other than that...

In prior releases, a goroutine that was looping forever could starve out other goroutines on the same thread, a serious problem when GOMAXPROCS provided only one user thread. In go 1.2, this is partially addressed: The scheduler is invoked occasionally upon entry to a function. This means that any loop that includes a (non-inlined) function call can be pre-empted, allowing other goroutines to run on the same thread.

So I would guess it just yields at any scope change. What jumps out at me is the non-inlined parenthetical, so the only way to be sure is to intentionally break inlining entirely. This means it might yield on some given function all, or it might not and just blocks the thread for the duration, all depending on how the compiler feels about inlining.

Maybe that's where the 'not enough work to thread' thing comes from. Inlining prevents yielding, and the smaller some test of threading is, the more likely it is to be inlined and never yield. I recall/assume that there is some mechanic in go's compiler to find concurrency/threadability boundaries, and those boundaries are likely tied to functions/scopes, but I would supposed that if it's not been yielded at one of those boundaries then it can't ever multithread anything.

It probably doesn't help that the last five or six versions have some variation of 'more things will inline automatically' in their release notes, meaning even fewer yield points to find threadable code. The more your code is inlined, the worse it multithreads? I don't actually know, kinda just spitballing here.

Some dingus on Stackoverflow posted:

Your concern is a solved problem in go and you don't have to worry about it

I like that all of this stems from hilarious hack of generics into go, but even async/await requires boilerplate. Fascinating what's 'solved' and what's left to users to cobble together.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
The Go thing I have to touch maxes out all of my cpu cores and does actually run faster if I let it do so rather than set GOMAXPROCS=1.

It is actually sort of too good at maxing all of my cpu cores. Go's scheduler isn't big.LITTLE-aware so it'll regularly block power cores waiting for an efficiency core and you have to set manually set GOMAXPROCS to the number of power cores and hope that everything works out. Yet another dumb problem caused by them porting plan9 to run on top of other platforms rather than making Go cross-platform*.

* This is not a literally true statement.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
I’m wondering if there’s implementations of programming languages where the keywords or other syntax aren’t latin ascii, outside of stuff like apl which isn’t from natural language. Like I almost assume cyrillic basic probably existed. Hangul java? Probably not.

e: well poo poo: https://en.m.wikipedia.org/wiki/Non-English-based_programming_languages

dougdrums fucked around with this message at 11:30 on Jan 10, 2023

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
“C++” [url]https://ћпп.срб[/url]

e: :thunk:

dougdrums fucked around with this message at 12:00 on Jan 10, 2023

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

dougdrums posted:

I’m wondering if there’s implementations of programming languages where the keywords or other syntax aren’t latin ascii, outside of stuff like apl which isn’t from natural language. Like I almost assume cyrillic basic probably existed. Hangul java? Probably not.

e: well poo poo: https://en.m.wikipedia.org/wiki/Non-English-based_programming_languages

Apple script has locale dependent language

b0lt
Apr 29, 2005

dougdrums posted:

I’m wondering if there’s implementations of programming languages where the keywords or other syntax aren’t latin ascii, outside of stuff like apl which isn’t from natural language. Like I almost assume cyrillic basic probably existed. Hangul java? Probably not.

e: well poo poo: https://en.m.wikipedia.org/wiki/Non-English-based_programming_languages

lingua maxime similis latini hic est

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
the concept of a splash screen, in general

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Hammerite posted:

the concept of a splash screen, in general

Better than Civ 5's "let's play the intro movie every time to disguise that it's a loading screen",

Armauk
Jun 23, 2021


Volmarias posted:

Better than Civ 5's "let's play the intro movie every time to disguise that it's a loading screen",

Thankfully you can disable the "intro" movie in Civ6.

CPColin
Sep 9, 2003

Big ol' smile.
I think you can just delete it in Civ5 too

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
Following this commit, instead of one single extremely large structure
named 'g' to house all of the relocated global variables, they
are distributed into several ga through gz.

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug

For those of you who aren't up on this, NetHack is one of the oldest roguelikes around, being first released in 1987, so honestly I imagine any codebase starting back that far is just redolent with code smells.

That's still fantastic though.

Carbon dioxide
Oct 9, 2012

https://twitter.com/JeroenFrijters/status/1615204074588180481

cheetah7071
Oct 20, 2010

honk honk
College Slice
The most horrifying part of that is calling a proportion a percentage

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

cheetah7071 posted:

The most horrifying part of that is calling a proportion a percentage

:hmmyes:

OddObserver
Apr 3, 2009

cheetah7071 posted:

The most horrifying part of that is calling a proportion a percentage

That's me every time checking checking NHL goalie statistics: ".93 save /percentage/?"

... And honestly, with 11 cases the if chain maybe less hassle than writing it concisely.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

And the first file in the commit already has a bug. (Typo: "gv" for "gz".)

Adbot
ADBOT LOVES YOU

Volte
Oct 4, 2004

woosh woosh
There's nothing wrong with this :colbert: And it's still a percentage. 0.1 and 10% are the same thing: 10/100.

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