>
I have been arguing passionately against adding generics to Go because
I truly believe that it is going against the simplicity of Go and the
philosophy behind the design of Go.
How about providing some evidence to back such an assertion, in the same
spirit of asking others to provide justi
Also a lot of the proposals listed in the `Wrapping` section of
https://seankhliao.com/blog/12020-11-23-go-error-handling-proposals/
On Wednesday, December 2, 2020 at 9:30:24 PM UTC+1 seank...@gmail.com wrote:
> see also
>
> https://github.com/golang/go/issues/41908
> https://github.com/golang/go
Hi,
Is there a way to set a hard limit on the max heap size a process is
allowed to consume, from within it?
It's almost never a problem for a process to consume as much memory as is
available, however, I've ran into real-life cases in a k8s environment,
where a pod with a Go process will get
I've had success with using
github.com/dop251/goja as a javascript interpreter
On Thursday, October 22, 2020 at 7:00:34 PM UTC+2 Jan Mercl wrote:
> In case you're on Linux and you like Tcl:
> https://godoc.org/modernc.org/tcl#example-Interp-NewCommand
>
> On Wed, Oct 21, 2020, 07:32 Aravindhan K
This would require something similar to rust's const generics. IIRC, that's
not on the table with the initial draft
On Tuesday, October 6, 2020 at 3:31:46 PM UTC+2 markus@gain.pro wrote:
> It appears to me the current proposal does not allow you to write a
> function that sorts an array of
I don't find any difference between calling t.Errorf and assert.Something
with a provided message. Both will populate the test log, with the later
giving you more details exactly where things differ from the expectation.
On Monday, October 5, 2020 at 3:03:48 PM UTC+2 Bryan C. Mills wrote:
> I t
't use interfaces with type lists.
> I'm not sure exactly what you're trying to do in your example, but ISTM
> that it could be somewhat simpler. You
> only need one type parameter: https://go2goplay.golang.org/p/4E0ZnVxJwL9
>
>
> On Thu, 10 Sep 2020 at 15:54, Vik
Would using parametric interfaces be allowed in type assertion expressions
/ type switches?
The current behavior in the go2go playground is for the compiler to return
the error: "interface contains type constraints (T)"
(https://go2goplay.golang.org/p/O1Un2Vm9Dh0)
I was under the impression th
"Doesn't really need to be there" is highly subjective
On Friday, August 28, 2020 at 7:10:45 PM UTC+2 Ashton Cummings wrote:
> My first impression of Go not having generics was negative. I came from
> C#, Java, typescript, C++, and a few other languages that had generics. So,
> learning Go and
On Saturday, August 22, 2020 at 12:49:21 AM UTC+2 rog wrote:
> On Fri, 21 Aug 2020 at 23:12, jimmy frasche wrote:
>
>> I don't want a generic min unless it looks like this:
>>
>> func Min[T constraints.Ordered](a, b T) T {
>> switch T {
>> case float32:
>> return T(math.Min(float32(a),
I like all points in the draft change.
My 2 cents around the any alias would be that it shouldn't be a problem. I
don't think people are suddently going to start overusing it, since using
vaues of type `interface{}` is extremely tedious in Go, and that won't
magically change if the type is shor
What problems would you expect generics to bring in terms of syntax, where
such flexibility would be a solution?
On Sunday, August 9, 2020 at 4:51:40 AM UTC+2 ivaniva...@gmail.com wrote:
> Add support of optional syntax_version to file beginning, allow compiler
> to tokenize/compile file by the
There's a big difference between creating arbitrary operators like c++, and
just allowing the predefined set of operators to be implemented for custom
types only. The later, combined with the overall aversion of the Go
community towards operator overloading as a whole, will probably lead to
ver
None of my laptops have guillamets on them, so that's pretty much dead on
arrival
On Friday, July 17, 2020 at 5:56:32 PM UTC+2, Jon Conradt wrote:
>
> In the spirit of “show me, don’t tell me” and experience reports. How hard
> would it be to release a beta which supports both [] and guillamets?
These type lists that are used in generic interfaces are not sum types.
they are there to allow restrictions on operators, since only base types
have operators in go (and types which use them as underlying types
inherit). You are thinking of sum types, which go does not have.
On Sunday, June 28
I seem to recall that the compilation time of C (and C++) programs is
directly proportional to the number of includes your program has. I'm sure
that monomorphisation in C++ exacts some kind of cost to the compilation
time, but perhaps it's not as much as people seem to think.
On Friday, June
20 at 9:41:21 PM UTC+3, Ian Lance Taylor wrote:
>
> On Mon, Jun 8, 2020 at 10:44 AM Viktor Kojouharov > wrote:
> >
> > The full code can be seen in this diff:
> >
> >
> https://github.com/urandom/go/commit/d10ccdd907dac690bfcb31df1115ce1508775458
> &
e runtime to call typedmemmove is very unsupported.
>
> On Sunday, June 7, 2020 at 10:02:21 AM UTC-7, Michael Jones wrote:
>>
>> Thank you. I now officially know that I don’t understand. Sorry.
>>
>> On Sun, Jun 7, 2020 at 7:54 AM Viktor Kojouharov
>> wrote:
>&
y to fail, and
> even when it does not, it is quite likely to be meaningless. (random data
> from some other use).
>
> If I misunderstood, please forgive me.
>
> On Sun, Jun 7, 2020 at 6:15 AM Viktor Kojouharov > wrote:
>
>> p.s. should such questions be posted in gol
p.s. should such questions be posted in golang-dev, since it deals with
runtime internals?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr..
Hi,
I'm playing around with the runtime, copying some data behind
unsafe.Pointer to a destination whenever a function is invoked. I'm
currently doing it with the 'typedmemmove' function from within the
runtime. That works for certain code, but panics with "unexpected fault
address" - going thr
gt; Not to say that this means Go should support it necessarily.
>
> On Wed, Dec 19, 2018 at 12:16 PM Jan Mercl <0xj...@gmail.com >
> wrote:
>
>> On Wed, Dec 19, 2018 at 9:09 PM Viktor Kojouharov > > wrote:
>>
>>
>> > I'm interested t
Hello,
I've tried and failed at finding any previous discussion on this topic, so
do point me to one if it exists.
I'm interested to know whether it was considered (I can't imagine that it
wasn't) for if and switch statements to be expressions instead, and if so,
why were they ultimately left
func Foo(in interface{}) {
val, ok := in.(someTypeOrInterface)
if !ok {
// TODO HANDLE ERROR
}
...
}
Wow, this is so much more readable /s
On Thursday, August 24, 2017 at 6:14:58 PM UTC+3, JuciÊ Andrade wrote:
>
> A lot of people like Go becau
Adding a new keyword would break backwards compatibility
On Saturday, April 15, 2017 at 10:21:32 AM UTC+3, mhh...@gmail.com wrote:
>
> hi,
>
>
> The question is in the title,
>
> the rationale, all the changes needed to apply on the source code to a add
> context as a parameter.
>
> We may imagin
Hello,
Considering how easy it is to create new types based on underlying types,
how come the newly created ones do not delegate method calls to their
underlying types? Consider the following example:
https://play.golang.org/p/Zs7Ve8ECk2
In the example, calling `b.num()` directly will not wor
It seems to me that the response is always a map[string]SomeStruct{}.
Nothing wrong with that.
On Wednesday, December 7, 2016 at 12:02:57 AM UTC+2, vanmuld...@gmail.com
wrote:
>
> An example JSON response :
>
> Query : /id/123456
>
> Response :
>
>
> {"123456":{"id":123456,"name":"qsdsdqsdqs
Or, you should just leave, stop saying /r/golang is an official go channel,
and leave it to its fate. I see no reason to delete it whatsoever.
On Friday, November 25, 2016 at 1:53:32 AM UTC+2, bradfitz wrote:
>
> In light of the CEO of Reddit admitting to editing user comments (see
> dozen news
nd replace isn't
going to cut it :)
On Wednesday, November 9, 2016 at 5:21:04 PM UTC+2, mattn wrote:
>
>
> On Wednesday, November 9, 2016 at 6:00:45 PM UTC+9, Viktor Kojouharov
> wrote:
>>
>> Why doesn't the change standardize the placeholder format? The driver c
Why doesn't the change standardize the placeholder format? The driver can
easily convert from a standard "[SOME-RUNE]PLACEHOLDER" to whatever the
actual database supports. Having a non-standard format just introduces
confusion and difficulty for the users of the api.
On Tuesday, November 8, 201
It's quite efficient to have a lot of goroutines. That's how I update the
feeds in my aggregator. Though your network interface might not like it if
you try to initiate thousands of connections at the same time.
On Friday, November 4, 2016 at 11:14:24 PM UTC+2, Marwan abdel moneim wrote:
>
> i a
On Wednesday, October 19, 2016 at 10:16:50 PM UTC+3, Jan Mercl wrote:
>
> On Wed, Oct 19, 2016 at 8:58 PM Viktor Kojouharov > wrote:
>
> > Not really, as this is all hypothetical, it might be implemented in a
> way so that any type that wants to satisfy an interface with d
On Wednesday, October 19, 2016 at 6:52:30 PM UTC+3, Jan Mercl wrote:
>
>
> On Wed, Oct 19, 2016 at 5:40 PM Viktor Kojouharov > wrote:
>
> > That's just a default method implementation. There's nothing inherently
> confusing about what gets called. If a co
On Tuesday, October 18, 2016 at 9:27:36 PM UTC+3, Konstantin Khomoutov
wrote:
>
> On Tue, 18 Oct 2016 11:11:59 -0700 (PDT)
> parais...@gmail.com wrote:
>
> > Obviously in Go this is a compile time error :
> >
> > type Foo interface {}
> >
> >
> > func (f Foo) DoSomething(){}
> >
> I w
A future is just a special case of an observable. Honestly I'd prefer if
an observable was built-in the language like a channel. You could use it
like a channel in selects and the like, but with the possibility of
receiver observables to be closable. When the list receiver observable is
closed
It would probably be pretty easy if you implement the json.Unmarshaler
interface on the byte type:
https://play.golang.org/p/hzGalLA2yA
On Wednesday, September 14, 2016 at 6:06:41 PM UTC+3, Luke wrote:
>
> Hi,
>
> i have something like: https://play.golang.org/p/j5WhDMUTI-
>
> type A struct {
>
go test ./... | fgrep -v '[no test files]'
that should be perfectly sufficient to you
On Friday, August 12, 2016 at 10:28:08 AM UTC+3, Simon Ritchie wrote:
>
> > go test ./...
>
> Sorry, I should have said, I already tried that. The problem is, if you
> have any directories that don't contain a
.@googlegroups.com [mailto:
> golan...@googlegroups.com ] *On Behalf Of *Viktor Kojouharov
> *Sent:* 2016 July 14, Thu 03:57
> *To:* golang-nuts
> *Subject:* [go-nuts] Re: How to make the first character in a string
> lowercase?
>
>
>
> https://play.golang.org/p/miLAFSDjrS
&g
https://play.golang.org/p/miLAFSDjrS
For unicode
On Thursday, July 14, 2016 at 7:26:13 AM UTC+3, Tamás Gulácsi wrote:
>
> But this works only for ASCII input!
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and st
It would have been quite useful for the stdlib to define a logger
interface, so that third party loggers would implement it and allow for
easier switching between them
On Friday, July 8, 2016 at 11:34:01 AM UTC+3, Ian Davis wrote:
>
> On Fri, Jul 8, 2016, at 05:29 AM, zger...@pivotal.io wrote:
You have to define your protocol that goes through the websocket. For
example, the json-rpc protocol has a special error field when an error
occurs.
On Thursday, July 7, 2016 at 10:45:04 AM UTC+3, Johann Höchtl wrote:
>
> I am using the gorilla websocket implementation. I am also new to
> webso
This would probably introduce unnecessary confusion. People are used to the
equality operator comparing values in go, as opposed to references. It's
much better if the slices finally support the equality operator, even
though the comparison speed will depend on the number of items in the
slices
On Tuesday, June 21, 2016 at 9:56:01 PM UTC+3, Axel Wagner wrote:
>
> The issue is, that a "KeyValuePair" (no matter if you implemented it
> via generics or like you mention via interfaces) is a fundamentally useless
> type and generics encourage people to add useless types. A "KeyValuePair V>"
https://golang.org/pkg/math/ and https://golang.org/pkg/container/ are just
two stdlib packages that would greatly benefit from some kind of generics.
I'm pretty sure there are more packages in the stdlib that would be greatly
improved. And that's just the standard library.
On Tuesday, June 21
I'm also for such types. There was also an interesting discussion about
them here:
https://www.reddit.com/r/golang/comments/46bd5h/ama_we_are_the_go_contributors_ask_us_anything/d03t6ji?context=3
On Monday, June 13, 2016 at 4:21:13 AM UTC+3, Michael Jones wrote:
>
> The position of the language d
Polymorphism is a far cry from a bad idea.
On Monday, June 13, 2016 at 12:05:34 PM UTC+3, Peter Kleiweg wrote:
>
> Op zaterdag 11 juni 2016 22:31:06 UTC+2 schreef charr...@gmail.com:
>
> What do you need to be added to the Go language?
>>
>
> A garbage collector for bad ideas.
>
--
You received
46 matches
Mail list logo