Earlier quoted context omitted.
Maybe, but personally I've become quite tired of programming languages "organically grown" as opposed to properly designed the first time. After a good decade of C then C++, I found ANSI CL (despite being a massive compromise and unfinished) much more coherent and complete than both.
Scheme is (or at least was) coherent. You don't need to look any further than set/setf/setq to see that Common Lisp is "organically grown" from the fertilizer of a committee. CL does its best to make every other lisp more attractive.
Go: Support for Generic Methods
211–220 of 288 posts
Re: Go: Support for Generic Methods
#212Earlier quoted context omitted.
> As for the detractors, from the first generics proposal this was called out as a "not now", not never. What? The post quotes the Go FAQ as saying, "we do not anticipate that Go will ever add generic methods". There is also some similar discussion of the original generics proposal, with language like "then it's much less clear why we need methods at all". (I'm omitting some context, but I don't feel that it changes…
No, you’re clearly wrong; golang was always going to add support for generic functions. Everyone also wanted and accepted the need for generics. It was always something they wanted to add to the language. Rob Pike never said that that kind of abstraction isn’t what golang is for. It was always just a matter of getting the design right. Go has always been a systems language. It was one when we thought it was going to…
The writing is on the wall for next development.
“For the foreseeable future, the Go team will stop pursuing syntactic language changes for error handling. We will also close all open and incoming proposals that concern themselves primarily with the syntax of error handling, without further investigation.”
Re: Go: Support for Generic Methods
#213Since they can't implement interfaces, Generic methods are just syntax sugar for generic functions. I'm surprised they actually accepted this proposal for sugar.
Re: Go: Support for Generic Methods
#214Earlier quoted context omitted.
Ah the good old “just be a perfect programmer and you won’t run into any issues” argument. Haven’t heard that one in awhile.
If only you had made it to the second paragraph. Hey, at least we can now understand why you have such a hard time with nil, so that's something.
Re: Go: Support for Generic Methods
#215Chasing a perceived gap between language features and user expectations has been and continues to be the greatest error in the leadership of Go.
Re: Go: Support for Generic Methods
#216Earlier quoted context omitted.
> Funnily enough, Go's generics were designed by the same guy who introduced monads to computer science. No contributor to Go is responsible for "introducing monads to computer science", as the Monad concept is a member of (or defined by if you prefer) Category Theory[0]. 0 - https://en.wikipedia.org/wiki/Category_theory
As you point out, monads come from category theory, not native to computer science. Thus there had to be someone to introduce approaches to applying monads in computer science. The paper usually credited with that is: https://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/b... Which the parent rightfully points out was written by the same person primarily responsible for the design of generics in Go: https://home…
Re: Go: Support for Generic Methods
#217Earlier quoted context omitted.
They didn't say they never wanted to do generics, but that they did want to take their time and do them right. Debatable how much they have been "right", although this gets them somewhat closer. And I think they have not been "wrong" in the ways they wanted to avoid (they referenced some issues with Java generics as prior art, although I forget the details).
From another commenter here: > The post quotes the Go FAQ as saying, "we do not anticipate that Go will ever add generic methods".
Re: Go: Support for Generic Methods
#218Earlier quoted context omitted.
> but the reason against using runtime reflection is mostly that it's slow. More specifically, it is that it would introduce surprising performance cliffs – code becoming surprisingly slow due to seemingly unrelated changes. Though BTQH I think an even more important argument is that you would need to have effectively two generics implementations, one working at runtime and one working at compile time. That's a lot o…
> you would need to have effectively two generics implementations, one working at runtime and one working at compile time My understanding is that go already has a hybrid system works at compiletime and sometimes at runtime.
Re: Go: Support for Generic Methods
#219Earlier quoted context omitted.
The C++ way to do it currently would be: std::array , M> data; Which is contiguous int data[M][N]; also works fine and is contiguous in C++ Edit: For the stack at least. On the heap, you'd need to use a single std::vector and do the indices manually, or use mdspan
I does not work fine in C++ when N and M are not compile-time constants, which is basically always the case in any interesting numerical algorithm. Also not in Rust. It works fine in C though, or FORTRAN, or Ada, or ALGOL 60, ...
NVidia has pivoted to design CUDA hardware with focus on C++ back in , and seems to be doing quite well for them.
CppCon 2017: "Designing (New) C++ Hardware”
https://www.youtube.com/watch?v=86seb-iZCnI
They were also the ones sponsoring the ISO work on mdspan, while HPC research labs are pushing for linalg on top.
I would rather be using Ada today, but that isn't how the world moves.
Re: Go: Support for Generic Methods
#220Earlier quoted context omitted.
Theres a whole universe between proper enums and go becoming Ada. Same with null safety.
Ada is the lost knowledge of a past, more advanced civilization.
https://www.adacore.com/case-studies/nvidia-adoption-of-spar...