Re: [go-nuts] Re: Building a Package With Multiple Subdirectories?

2022-11-22 Thread jlfo...@berkeley.edu
It might indeed make more sense to fix the cyclic dependencies. I'm not 
even sure
there will be any. I'm just trying to anticipate possible problems.

Thanks,
Jon


On Tuesday, November 22, 2022 at 5:37:20 PM UTC-8 chri...@aperture.us wrote:

> Doesn't it make more sense to fix the cyclic dependencies rather than hack 
> the go compiler and make it do something it wasn't designed to do?
>
> Best regards,
> Christian
>
> On Tue, Nov 22, 2022, 4:44 PM jlfo...@berkeley.edu  
> wrote:
>
>> The reason I'm asking this question is because, as a learning exercise, 
>> I'm trying to
>> rewrite several large existing applications in Go. These have been around 
>> a while
>> and have a very sensible source subdirectory layout, sometimes with 
>> multiple levels of
>> subdirectories.
>>
>> My initial approach was going to be to have each source subdirectory tree 
>> be a Go package.
>> That would allow me to concentrate on the Go code, which is less work 
>> than a total source
>> reorganization.
>>
>> I had also thought about creating multiple packages, as you suggest. What 
>> worries me about
>> this approach is that it increases the chance of import cycles.
>>
>> I'm still pondering this issue.
>>
>> Cordially,
>> Jon Forrest
>>
>>
>> On Tuesday, November 22, 2022 at 5:27:02 AM UTC-8 Amnon wrote:
>>
>>> Don't do it.
>>> Don't fight the Go tools. Use them the way they are intended. They are 
>>> your friends.
>>> Put all your package files in a single directory. Or break them up into 
>>> multiple packages.
>>> That is the way everyone else write Go. If you follow the convention, 
>>> your life will be simpler,
>>> and your code will be easier for others to understand and maintain.
>>>
>>>
>>> On Tuesday, 22 November 2022 at 01:15:33 UTC jlfo...@berkeley.edu wrote:
>>>
 Back in June I asked why Go requires all the files in a package to be 
 in the same 
 directory. I learned that this is an implementation-specific decision. 
 I was also referred to


 https://stackoverflow.com/questions/45899203/can-i-develop-a-go-package-in-multiple-source-directories

 which discusses this. Someone named "Volker" in this posting said

 "Yes, this is doable without any problems, just invoke the Go compiler 
 by hand, that is not 
 via the go tool."

 I'm wondering how to actually do this. Suppose I have a directory, 
 which contains several
 subdirectories. There are .go files in all these directories that I'd 
 like to use to make a
 single package. How could I invoke to Go compiler by hand to make this 
 happen?
 (I've tried adding the "-x" flag to "go build" but I don't see which 
 arguments I'd need to 
 change to do what I'm trying to accomplish). Volker says "It's 
 complicated".

 Also, let's say I was able to figure this out. Would using such a 
 package confuse any of
 the other commands in the Go tool chain or the dlv debugger?

 Cordially,
 Jon Forrest


 -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/5c19ed2f-caab-4fa4-b21d-37c3d9c9d0e9n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4a7e99b8-1585-401d-bb04-f2c36db8b638n%40googlegroups.com.


Re: [go-nuts] Re: Building a Package With Multiple Subdirectories?

2022-11-22 Thread 'Christian Stewart' via golang-nuts
Doesn't it make more sense to fix the cyclic dependencies rather than hack
the go compiler and make it do something it wasn't designed to do?

Best regards,
Christian

On Tue, Nov 22, 2022, 4:44 PM jlfo...@berkeley.edu 
wrote:

> The reason I'm asking this question is because, as a learning exercise,
> I'm trying to
> rewrite several large existing applications in Go. These have been around
> a while
> and have a very sensible source subdirectory layout, sometimes with
> multiple levels of
> subdirectories.
>
> My initial approach was going to be to have each source subdirectory tree
> be a Go package.
> That would allow me to concentrate on the Go code, which is less work than
> a total source
> reorganization.
>
> I had also thought about creating multiple packages, as you suggest. What
> worries me about
> this approach is that it increases the chance of import cycles.
>
> I'm still pondering this issue.
>
> Cordially,
> Jon Forrest
>
>
> On Tuesday, November 22, 2022 at 5:27:02 AM UTC-8 Amnon wrote:
>
>> Don't do it.
>> Don't fight the Go tools. Use them the way they are intended. They are
>> your friends.
>> Put all your package files in a single directory. Or break them up into
>> multiple packages.
>> That is the way everyone else write Go. If you follow the convention,
>> your life will be simpler,
>> and your code will be easier for others to understand and maintain.
>>
>>
>> On Tuesday, 22 November 2022 at 01:15:33 UTC jlfo...@berkeley.edu wrote:
>>
>>> Back in June I asked why Go requires all the files in a package to be in
>>> the same
>>> directory. I learned that this is an implementation-specific decision. I
>>> was also referred to
>>>
>>>
>>> https://stackoverflow.com/questions/45899203/can-i-develop-a-go-package-in-multiple-source-directories
>>>
>>> which discusses this. Someone named "Volker" in this posting said
>>>
>>> "Yes, this is doable without any problems, just invoke the Go compiler
>>> by hand, that is not
>>> via the go tool."
>>>
>>> I'm wondering how to actually do this. Suppose I have a directory, which
>>> contains several
>>> subdirectories. There are .go files in all these directories that I'd
>>> like to use to make a
>>> single package. How could I invoke to Go compiler by hand to make this
>>> happen?
>>> (I've tried adding the "-x" flag to "go build" but I don't see which
>>> arguments I'd need to
>>> change to do what I'm trying to accomplish). Volker says "It's
>>> complicated".
>>>
>>> Also, let's say I was able to figure this out. Would using such a
>>> package confuse any of
>>> the other commands in the Go tool chain or the dlv debugger?
>>>
>>> Cordially,
>>> Jon Forrest
>>>
>>>
>>> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/5c19ed2f-caab-4fa4-b21d-37c3d9c9d0e9n%40googlegroups.com
> 
> .
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bh8R2qvN6yEp9COWXYS0mpQ3qEHjQAwp5Ca1fPfXnOx51a2Nw%40mail.gmail.com.


[go-nuts] Re: Building a Package With Multiple Subdirectories?

2022-11-22 Thread jlfo...@berkeley.edu
The reason I'm asking this question is because, as a learning exercise, I'm 
trying to
rewrite several large existing applications in Go. These have been around a 
while
and have a very sensible source subdirectory layout, sometimes with 
multiple levels of
subdirectories.

My initial approach was going to be to have each source subdirectory tree 
be a Go package.
That would allow me to concentrate on the Go code, which is less work than 
a total source
reorganization.

I had also thought about creating multiple packages, as you suggest. What 
worries me about
this approach is that it increases the chance of import cycles.

I'm still pondering this issue.

Cordially,
Jon Forrest


On Tuesday, November 22, 2022 at 5:27:02 AM UTC-8 Amnon wrote:

> Don't do it.
> Don't fight the Go tools. Use them the way they are intended. They are 
> your friends.
> Put all your package files in a single directory. Or break them up into 
> multiple packages.
> That is the way everyone else write Go. If you follow the convention, your 
> life will be simpler,
> and your code will be easier for others to understand and maintain.
>
>
> On Tuesday, 22 November 2022 at 01:15:33 UTC jlfo...@berkeley.edu wrote:
>
>> Back in June I asked why Go requires all the files in a package to be in 
>> the same 
>> directory. I learned that this is an implementation-specific decision. I 
>> was also referred to
>>
>>
>> https://stackoverflow.com/questions/45899203/can-i-develop-a-go-package-in-multiple-source-directories
>>
>> which discusses this. Someone named "Volker" in this posting said
>>
>> "Yes, this is doable without any problems, just invoke the Go compiler by 
>> hand, that is not 
>> via the go tool."
>>
>> I'm wondering how to actually do this. Suppose I have a directory, which 
>> contains several
>> subdirectories. There are .go files in all these directories that I'd 
>> like to use to make a
>> single package. How could I invoke to Go compiler by hand to make this 
>> happen?
>> (I've tried adding the "-x" flag to "go build" but I don't see which 
>> arguments I'd need to 
>> change to do what I'm trying to accomplish). Volker says "It's 
>> complicated".
>>
>> Also, let's say I was able to figure this out. Would using such a package 
>> confuse any of
>> the other commands in the Go tool chain or the dlv debugger?
>>
>> Cordially,
>> Jon Forrest
>>
>>
>>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5c19ed2f-caab-4fa4-b21d-37c3d9c9d0e9n%40googlegroups.com.


[go-nuts] Solver for mixed integer programing in pure go

2022-11-22 Thread ChrisLu
Hi,

Are there any pure-go solver for mixed integer programming?

Specifically, I am looking for a replacement of SCIP solver in Google's 
OR-tool.

Chris

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b1af3ae6-ad7a-4385-91eb-e2496a9a85bbn%40googlegroups.com.


[go-nuts] Re: Go 1.20 release date

2022-11-22 Thread ben...@gmail.com
You can also use the "gotip" command 
(https://pkg.go.dev/golang.org/dl/gotip) to pull the latest, unreleased 
version from the Go development tree.

-Ben

On Wednesday, November 23, 2022 at 2:24:12 AM UTC+13 Amnon wrote:

> Feb 2023 is a good bet.
>
> On Tuesday, 22 November 2022 at 10:24:07 UTC piotr.w...@gmail.com wrote:
>
>> Hi,
>>
>> is the date of the 1.20 release roughly known? I need some goodies it 
>> promises to provide.
>>
>> Best regards, Piotr 
>>
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/68bc781e-faae-4338-91f8-8c911363f0cdn%40googlegroups.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Ian Lance Taylor
On Tue, Nov 22, 2022 at 11:31 AM Ayan George  wrote:
>
> For me this is as much if not more of a communications issue than a technical 
> one.  It seems like the definition of what an OO language is broad enough 
> that we could go on forever about if Go is one.
>
> The language developers can also choose to declare what it is meant to be 
> definitively.
>
> I feel like we should either say it is or it isn't OO and not equivocate in 
> the FAQ.
>
> I land on the side of simply saying it is not an OO language because of the 
> conceptual baggage the notion carries.  I've personally seen these concepts 
> misapplied to Go because if you squint... Go resembles other languages while 
> being fundamentally different.
>
> But in general, that lack of clarity seems un-Go like. I've always found the 
> unwillingness to commit to an answer in the FAQ jarring.

I think the length of the discussion shows that the answer really is
"yes and no," because it depends on exactly what you mean by
"object-oriented."  Since different people mean different things,
there is no clear answer possible.

It seems to me that you are suggesting that we make that answer
clearer for people who assume that either C++ or Java or both are the
definition of "object-oriented," but as we can see in this discussion
others disagree.

So I think the FAQ is saying the right thing.  Rather than try to
tackle the definition, which is out of place in the Go FAQ, it tries
to briefly mention the salient parts of the language.  Then it leaves
the decision as to whether that is the same as being "object-oriented"
to the reader.  I don't see how we can do better than that.

Thanks.

Ian

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVw8nGysTcwiBMuc3tvAxky6NDujHaxkEQO_orrVa1hFA%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread 'Dan Kortschak' via golang-nuts
On Tue, 2022-11-22 at 10:16 -0800, Ian Lance Taylor wrote:
> On Tue, Nov 22, 2022 at 10:11 AM Robert Engels
>  wrote:
> >
> > I do not know why the mailing list is set up as the sender is the
> > user. Is should always have the sender be the list email and the
> > name be the user, or the sender details included elsewhere. I don’t
> > have this problem in any other lists.

Robert, this has been an ongoing problem with mail from your address
for years for me, and I think that I have raised it in the past. It
breaks thread chains and drops messages. To illustrate, I'm reply to
the message from Ian because your message never made it to my inbox,
and his message is the only one that contains this text in my inbox.
Worse, his message is a thread-orphan. Interestingly, this does not
happen all the time, so I suspect that either your mail client is
flakey with regard to the References: header or you are using more than
one client. I don't recall seeing this behaviour from any other
sender's client on the list.

Dan


-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/31dce71be5156464b437ab421ae01519bd9409f4.camel%40kortschak.io.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Ayan George
Great points.

For me this is as much if not more of a communications issue than a 
technical one.  It seems like the definition of what an OO language is 
broad enough that we could go on forever about if Go is one.

The language developers can also choose to declare what it is meant to be 
definitively.

I feel like we should either say it is or it isn't OO and not equivocate in 
the FAQ.

I land on the side of simply saying it is not an OO language because of the 
conceptual baggage the notion carries.  I've personally seen these concepts 
misapplied to Go because if you squint... Go resembles other languages 
while being fundamentally different.

But in general, that lack of clarity seems un-Go like. I've always found 
the unwillingness to commit to an answer in the FAQ jarring.

On Tuesday, November 22, 2022 at 11:11:44 AM UTC-5 Thomas Bushnell, BSG 
wrote:

> Asking "the definition of object oriented programming" seems a bad idea to 
> me. Alan Kay invented the term, and he was pretty clear that C++ was not 
> anything like what he had in mind, and yet, a lot of people think C++ is an 
> object oriented language. I don't, as it happens.
>
> Inheritance used to be thought of as quite fundamental, but not so much 
> any more. I think that's probably right.
>
> But here are some other things: object oriented languages are supposed to 
> have object ubiquity. I think Stroustrup probably did not understand the 
> point, and the designers of Java couldn't figure out how to make it 
> efficient. So much for them. C++ gets so much wrong it hardly matters. But 
> Java doesn't; it more or less regrets that it has non-object types. Go is 
> very different however: Go does not regard interfaces as something that 
> should be ubiquitous or feel bad when they aren't used. In fact, they are 
> discouraged except when actually required.
>
> Late binding is another key feature, one which again C++ mostly didn't 
> understand the point of, and Java couldn't figure out how to implement 
> efficiently, so everyone does "final" instead. Go does have late binding 
> for interface method calls, but only on-demand.
>
> Object oriented languages are generally either class-based or 
> prototype-based. Go is neither, having nothing like classes and nothing 
> like prototypes. For me, this is the most salient thing to keep in mind.
>
> On Tue, Nov 22, 2022 at 10:56 AM Jan Mercl <0xj...@gmail.com> wrote:
>
>> On Tue, Nov 22, 2022 at 4:43 PM Robert Engels  
>> wrote:
>>
>> > Go is not listed as an OO language on Wikipedia.
>>
>> Check https://en.wikipedia.org/wiki/Go_(programming_language):
>> "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>>
>> > Personally I think it is OO-like. OO typically has inheritance.
>>
>> Typically they may, but that's not the same as what a requirement
>> would be, right?
>>
>> > There are also no “class variables” - only package level - which makes 
>> some encapsulation patterns harder (every class has to become a package).
>>
>> No class has to become a package because Go has no classes. You may
>> think of what a "class" in Go means, but you have not defined that
>> idea and the language specification is somehow silent about Go
>> classes.
>>
>> -- 
>> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com
>> .
>>
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/18fb45c6-6511-4b1a-ad4b-c60886838ccan%40googlegroups.com.


[go-nuts] Google’s Go style guide published

2022-11-22 Thread 'Gaal Yahas' via golang-nuts
Hi Go community,

We've released Google's style documentation for Go:
https://google.github.io/styleguide/go/.

These are the house rules that Google uses to write Go code internally.

The intention in publishing this is to help collaborators on Google open
source projects, and to provide a starting place or reference for other
groups to create their own. We hope that people may find it useful if they
work on other codebases, but there is no expectation that Go programs at
large follow it exactly: although the Go language project is of course led
by Google, this guide is not specifically endorsed by the Go project.



The style documentation has its own overview section, but I thought it
might be useful to include a brief FAQ.

Q: Why a style guide? Let me just gofmt.

A: Google operates a huge monorepo ,
with many Go programmers writing to it. Large codebases benefit from
uniformity and developing idioms

that minimize certain bugs and readability problems.

Q: Do I need to adopt these style rules?

A: Code checked into the main Google codebase generally needs to follow
these guidelines. If you contribute to a Google open source project, you
can save review churn by using this style.

Q: Who wrote this? What is the relationship to
https://github.com/golang/go/wiki/CodeReviewComments/?

A: Dozens of people over at least a decade have contributed to these
guidelines. A lot of the early text was written by the fledgling Go team,
copied over to the wiki page (which is why there's a lot of overlap). The
Go Readability team maintains the document and updates the advice when
there's internal consensus to do so.

Q: What is readability?

A: It’s a program to share best practices. You can read more about how
Google maintains a large codebase with many contributors in the book Software
Engineering at Google (read online

).

Q: I can't believe you want me to do X! I've been doing Y and it's better.

A: It may be that Y is better in your project. Our requirements may be
different from yours.

Remember also that some conventions can be valuable even if they represent
a choice that is mostly arbitrary. For example, using “got before want”
probably isn’t a lot different from the other way around, but either one is
better than every line of code doing something new.

Q: This is long! Do I really have to read all of it?

A: The style documentation is deliberately split into three parts. We
advise Go programmers at Google to take the core Style Guide
 text seriously, and pick up
more specific points as they go through the readability program.

Q: Will you take my pull request?

A: This repo is not accepting external contributions, sorry. If you spot an
error such as a dead link or a typo, we welcome bug reports.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CACTCKKU8mQhBb4C6jidaqSpEKq6A8DrvJdN%2BuOYvP0vFPrzR5g%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Ian Lance Taylor
On Tue, Nov 22, 2022 at 10:11 AM Robert Engels  wrote:
>
> I do not know why the mailing list is set up as the sender is the user. Is 
> should always have the sender be the list email and the name be the user, or 
> the sender details included elsewhere. I don’t have this problem in any other 
> lists.

We are just using ordinary Google Groups.

https://support.google.com/groups/answer/1046523?hl=en

I think many Google Groups work this way.  I don't think we are an outlier.

Ian

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUVZzxX19Qst0PV%3DM0B4Q2EPxfwxGt9AAxpUvo94F59Dw%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread 'Thomas Bushnell BSG' via golang-nuts
Late binding means you don't need to know the types of your parameters *at
all* when you write a method call. If the language supported late binding,
then you would be able to define all your variables as Object and
*everything would continue to work*.

In Go you could define everything as interface{} and then use small
interfaces around every call:

foo.(interface{ Method() string}).Method()

In Java, you can use the reflection interface. In this sense, it is
available "on demand", but that's not the same thing at all.

Both Java and C++ made the mistake of confusing a class with a behavior,
and then using classes as names for behaviors.



On Tue, Nov 22, 2022 at 11:46 AM Robert Engels 
wrote:

> What would be the purpose of writing B calling a method on A that doesn’t
> exist?
>
> On Nov 22, 2022, at 10:36 AM, 'Thomas Bushnell BSG' via golang-nuts <
> golang-nuts@googlegroups.com> wrote:
>
> 
> Both Java and Go require that a method be instantiated in the declared
> interface of the type at compile time. This is contrary to the point of
> late binding.
>
> In the case of Go, this cannot be detected, because everything is built
> together. But with Java, you cannot call a method on an object unless that
> method has *already *been defined. In other words, late binding supports
> the following order of things:
>
> 1) Write class A, with method X and only X. Compile it.
> 2) Write class B, which instantiates class A and calls method Y (which
> does not exist yet). Compile it.
> 3) Extend class A to add method Y. Compile it.
> 4) Execute class B.
>
> Late binding says this should work, but the Java compiler will throw an
> error at step two. Go never throws that error, because Go only builds the
> whole program at once, so the partial compilations don't make sense.
>
> In addition, any method marked final does not support late binding -
> indeed, this is the point of the keyword, and is why I remarked that this
> is because they couldn't figure out how to do it efficiently.
>
> Thomas
>
> On Tue, Nov 22, 2022 at 11:25 AM Robert Engels 
> wrote:
>
>> Why do you say that Java does not have late binding. It 100% does. In
>> fact the JVM supports dynamic dispatch to make this as efficient as
>> possible. Then the JIT optimizes it even more based on runtime behavior.
>>
>> On Nov 22, 2022, at 10:18 AM, Matt KØDVB  wrote:
>>
>> 
>> But see https://en.wikipedia.org/wiki/Self_(programming_language)
>>
>> Self was considered an OO language back when I was a grad student and is
>> still listed that way today, even though it has neither classes nor
>> inheritance.
>>
>> Anyway, my point would be that the term OO originates with Alan Kay and
>> the team at Xerox PARC; Kay’s response to the OO flame wars was to
>> de-emphasize classes and inheritance.
>>
>> Of course, using his definition, neither Java nor Go would be “truly” OO
>> since not all things use late binding :-)
>>
>> Perhaps we can talk about class-based and non-class based OO languages?
>>
>> On Tue, Nov 22, 2022 at 10:07 AM Robert Engels 
>> wrote:
>>
>>> The wiki OO page lists classes as a requirement - but not necessarily
>>> inheritance. Class variables require classes.
>>>
>>> Also, your link does not work.
>>>
>>> > On Nov 22, 2022, at 9:56 AM, Jan Mercl <0xj...@gmail.com> wrote:
>>> >
>>> > On Tue, Nov 22, 2022 at 4:43 PM Robert Engels 
>>> wrote:
>>> >
>>> >> Go is not listed as an OO language on Wikipedia.
>>> >
>>> > Check https://en.wikipedia.org/wiki/Go_(programming_language):
>>> > "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>>> >
>>> >> Personally I think it is OO-like. OO typically has inheritance.
>>> >
>>> > Typically they may, but that's not the same as what a requirement
>>> > would be, right?
>>> >
>>> >> There are also no “class variables” - only package level - which
>>> makes some encapsulation patterns harder (every class has to become a
>>> package).
>>> >
>>> > No class has to become a package because Go has no classes. You may
>>> > think of what a "class" in Go means, but you have not defined that
>>> > idea and the language specification is somehow silent about Go
>>> > classes.
>>> >
>>> > --
>>> > 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...@googlegroups.com.
>>> > To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com
>>> .
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/A1F03B77-7CDC-46CC-B2E0-2C3C1B7DC966%40ix.netcom.com
>>> .
>>>

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread 'Thomas Bushnell BSG' via golang-nuts
Both Java and Go require that a method be instantiated in the declared
interface of the type at compile time. This is contrary to the point of
late binding.

In the case of Go, this cannot be detected, because everything is built
together. But with Java, you cannot call a method on an object unless that
method has *already *been defined. In other words, late binding supports
the following order of things:

1) Write class A, with method X and only X. Compile it.
2) Write class B, which instantiates class A and calls method Y (which does
not exist yet). Compile it.
3) Extend class A to add method Y. Compile it.
4) Execute class B.

Late binding says this should work, but the Java compiler will throw an
error at step two. Go never throws that error, because Go only builds the
whole program at once, so the partial compilations don't make sense.

In addition, any method marked final does not support late binding -
indeed, this is the point of the keyword, and is why I remarked that this
is because they couldn't figure out how to do it efficiently.

Thomas

On Tue, Nov 22, 2022 at 11:25 AM Robert Engels 
wrote:

> Why do you say that Java does not have late binding. It 100% does. In fact
> the JVM supports dynamic dispatch to make this as efficient as possible.
> Then the JIT optimizes it even more based on runtime behavior.
>
> On Nov 22, 2022, at 10:18 AM, Matt KØDVB  wrote:
>
> 
> But see https://en.wikipedia.org/wiki/Self_(programming_language)
>
> Self was considered an OO language back when I was a grad student and is
> still listed that way today, even though it has neither classes nor
> inheritance.
>
> Anyway, my point would be that the term OO originates with Alan Kay and
> the team at Xerox PARC; Kay’s response to the OO flame wars was to
> de-emphasize classes and inheritance.
>
> Of course, using his definition, neither Java nor Go would be “truly” OO
> since not all things use late binding :-)
>
> Perhaps we can talk about class-based and non-class based OO languages?
>
> On Tue, Nov 22, 2022 at 10:07 AM Robert Engels 
> wrote:
>
>> The wiki OO page lists classes as a requirement - but not necessarily
>> inheritance. Class variables require classes.
>>
>> Also, your link does not work.
>>
>> > On Nov 22, 2022, at 9:56 AM, Jan Mercl <0xj...@gmail.com> wrote:
>> >
>> > On Tue, Nov 22, 2022 at 4:43 PM Robert Engels 
>> wrote:
>> >
>> >> Go is not listed as an OO language on Wikipedia.
>> >
>> > Check https://en.wikipedia.org/wiki/Go_(programming_language):
>> > "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>> >
>> >> Personally I think it is OO-like. OO typically has inheritance.
>> >
>> > Typically they may, but that's not the same as what a requirement
>> > would be, right?
>> >
>> >> There are also no “class variables” - only package level - which makes
>> some encapsulation patterns harder (every class has to become a package).
>> >
>> > No class has to become a package because Go has no classes. You may
>> > think of what a "class" in Go means, but you have not defined that
>> > idea and the language specification is somehow silent about Go
>> > classes.
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com
>> .
>>
>> --
>> 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...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/A1F03B77-7CDC-46CC-B2E0-2C3C1B7DC966%40ix.netcom.com
>> .
>>
>
>
> --
>
> Matt
> K0DVB
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CANRS-2%2Bre6WUFT6tE8QinUZ-ipqLvwNTr2hoHNiD4H%3DwQ8T7HA%40mail.gmail.com
> 
> .
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/A5532469-6B1D-4C18-8DBE-F03FD56E8830%40ix.netcom.com
> 

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Matt KØDVB
I didn't say Java didn't have late binding, but that it didn't have late
binding of every possible type (the "all things" in Kay's quote).

On Tue, Nov 22, 2022 at 10:25 AM Robert Engels 
wrote:

> Why do you say that Java does not have late binding. It 100% does. In fact
> the JVM supports dynamic dispatch to make this as efficient as possible.
> Then the JIT optimizes it even more based on runtime behavior.
>
> On Nov 22, 2022, at 10:18 AM, Matt KØDVB  wrote:
>
> 
> But see https://en.wikipedia.org/wiki/Self_(programming_language)
>
> Self was considered an OO language back when I was a grad student and is
> still listed that way today, even though it has neither classes nor
> inheritance.
>
> Anyway, my point would be that the term OO originates with Alan Kay and
> the team at Xerox PARC; Kay’s response to the OO flame wars was to
> de-emphasize classes and inheritance.
>
> Of course, using his definition, neither Java nor Go would be “truly” OO
> since not all things use late binding :-)
>
> Perhaps we can talk about class-based and non-class based OO languages?
>
> On Tue, Nov 22, 2022 at 10:07 AM Robert Engels 
> wrote:
>
>> The wiki OO page lists classes as a requirement - but not necessarily
>> inheritance. Class variables require classes.
>>
>> Also, your link does not work.
>>
>> > On Nov 22, 2022, at 9:56 AM, Jan Mercl <0xj...@gmail.com> wrote:
>> >
>> > On Tue, Nov 22, 2022 at 4:43 PM Robert Engels 
>> wrote:
>> >
>> >> Go is not listed as an OO language on Wikipedia.
>> >
>> > Check https://en.wikipedia.org/wiki/Go_(programming_language):
>> > "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>> >
>> >> Personally I think it is OO-like. OO typically has inheritance.
>> >
>> > Typically they may, but that's not the same as what a requirement
>> > would be, right?
>> >
>> >> There are also no “class variables” - only package level - which makes
>> some encapsulation patterns harder (every class has to become a package).
>> >
>> > No class has to become a package because Go has no classes. You may
>> > think of what a "class" in Go means, but you have not defined that
>> > idea and the language specification is somehow silent about Go
>> > classes.
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com
>> .
>>
>> --
>> 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...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/A1F03B77-7CDC-46CC-B2E0-2C3C1B7DC966%40ix.netcom.com
>> .
>>
>
>
> --
>
> Matt
> K0DVB
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CANRS-2%2Bre6WUFT6tE8QinUZ-ipqLvwNTr2hoHNiD4H%3DwQ8T7HA%40mail.gmail.com
> 
> .
>
>

-- 

Matt
K0DVB

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANRS-2%2Bmh04pZ_azKuknUe0%3DtVJE4JS_ZZV%2BjBijS%2BCBcQOOaQ%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Robert Engels
The wiki page on late binding discusses the Java facilities in depth. 

It also misses things like runtime proxy interfaces. 

> On Nov 22, 2022, at 10:25 AM, Robert Engels  wrote:
> 
> 
> Why do you say that Java does not have late binding. It 100% does. In fact 
> the JVM supports dynamic dispatch to make this as efficient as possible. Then 
> the JIT optimizes it even more based on runtime behavior. 
> 
>>> On Nov 22, 2022, at 10:18 AM, Matt KØDVB  wrote:
>>> 
>> 
>> But see https://en.wikipedia.org/wiki/Self_(programming_language)
>> 
>> Self was considered an OO language back when I was a grad student and is 
>> still listed that way today, even though it has neither classes nor 
>> inheritance.
>> 
>> Anyway, my point would be that the term OO originates with Alan Kay and the 
>> team at Xerox PARC; Kay’s response to the OO flame wars was to de-emphasize 
>> classes and inheritance.
>> 
>> Of course, using his definition, neither Java nor Go would be “truly” OO 
>> since not all things use late binding :-)
>> 
>> Perhaps we can talk about class-based and non-class based OO languages?
>> 
>>> On Tue, Nov 22, 2022 at 10:07 AM Robert Engels  
>>> wrote:
>>> The wiki OO page lists classes as a requirement - but not necessarily 
>>> inheritance. Class variables require classes. 
>>> 
>>> Also, your link does not work. 
>>> 
>>> > On Nov 22, 2022, at 9:56 AM, Jan Mercl <0xj...@gmail.com> wrote:
>>> > 
>>> > On Tue, Nov 22, 2022 at 4:43 PM Robert Engels  
>>> > wrote:
>>> > 
>>> >> Go is not listed as an OO language on Wikipedia.
>>> > 
>>> > Check https://en.wikipedia.org/wiki/Go_(programming_language):
>>> > "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>>> > 
>>> >> Personally I think it is OO-like. OO typically has inheritance.
>>> > 
>>> > Typically they may, but that's not the same as what a requirement
>>> > would be, right?
>>> > 
>>> >> There are also no “class variables” - only package level - which makes 
>>> >> some encapsulation patterns harder (every class has to become a package).
>>> > 
>>> > No class has to become a package because Go has no classes. You may
>>> > think of what a "class" in Go means, but you have not defined that
>>> > idea and the language specification is somehow silent about Go
>>> > classes.
>>> > 
>>> > -- 
>>> > 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...@googlegroups.com.
>>> > To view this discussion on the web visit 
>>> > https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com.
>>> 
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/A1F03B77-7CDC-46CC-B2E0-2C3C1B7DC966%40ix.netcom.com.
>> 
>> 
>> -- 
>> 
>> Matt
>> K0DVB
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/CANRS-2%2Bre6WUFT6tE8QinUZ-ipqLvwNTr2hoHNiD4H%3DwQ8T7HA%40mail.gmail.com.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/E7E04951-A2A7-45FB-A8C8-24DD3B292270%40ix.netcom.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Robert Engels
Why do you say that Java does not have late binding. It 100% does. In fact the 
JVM supports dynamic dispatch to make this as efficient as possible. Then the 
JIT optimizes it even more based on runtime behavior. 

> On Nov 22, 2022, at 10:18 AM, Matt KØDVB  wrote:
> 
> 
> But see https://en.wikipedia.org/wiki/Self_(programming_language)
> 
> Self was considered an OO language back when I was a grad student and is 
> still listed that way today, even though it has neither classes nor 
> inheritance.
> 
> Anyway, my point would be that the term OO originates with Alan Kay and the 
> team at Xerox PARC; Kay’s response to the OO flame wars was to de-emphasize 
> classes and inheritance.
> 
> Of course, using his definition, neither Java nor Go would be “truly” OO 
> since not all things use late binding :-)
> 
> Perhaps we can talk about class-based and non-class based OO languages?
> 
>> On Tue, Nov 22, 2022 at 10:07 AM Robert Engels  wrote:
>> The wiki OO page lists classes as a requirement - but not necessarily 
>> inheritance. Class variables require classes. 
>> 
>> Also, your link does not work. 
>> 
>> > On Nov 22, 2022, at 9:56 AM, Jan Mercl <0xj...@gmail.com> wrote:
>> > 
>> > On Tue, Nov 22, 2022 at 4:43 PM Robert Engels  
>> > wrote:
>> > 
>> >> Go is not listed as an OO language on Wikipedia.
>> > 
>> > Check https://en.wikipedia.org/wiki/Go_(programming_language):
>> > "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>> > 
>> >> Personally I think it is OO-like. OO typically has inheritance.
>> > 
>> > Typically they may, but that's not the same as what a requirement
>> > would be, right?
>> > 
>> >> There are also no “class variables” - only package level - which makes 
>> >> some encapsulation patterns harder (every class has to become a package).
>> > 
>> > No class has to become a package because Go has no classes. You may
>> > think of what a "class" in Go means, but you have not defined that
>> > idea and the language specification is somehow silent about Go
>> > classes.
>> > 
>> > -- 
>> > 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...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com.
>> 
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/A1F03B77-7CDC-46CC-B2E0-2C3C1B7DC966%40ix.netcom.com.
> 
> 
> -- 
> 
> Matt
> K0DVB
> -- 
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CANRS-2%2Bre6WUFT6tE8QinUZ-ipqLvwNTr2hoHNiD4H%3DwQ8T7HA%40mail.gmail.com.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/A5532469-6B1D-4C18-8DBE-F03FD56E8830%40ix.netcom.com.


Fwd: Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Jan Mercl
Hello Ian,

I have repeatedly asked this user to not use an email address that
spambots back for posting to this list - to no avail, unfortunately. I
think you are the moderator of this ML. I suggest banning posts from
.

Thanks for consideration.

To Robert (not CC'ing you for obvious reasons): You can create an
email for participating on this ML for free in minutes. There are
bazilions of such services available all over the Internet.

-j

-- Forwarded message -
From: 
Date: Tue, Nov 22, 2022 at 4:56 PM
Subject: Re: Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?
To: Jan Mercl <0xj...@gmail.com>


I apologize for this automatic reply to your email.

To control spam, I now allow incoming messages only from senders I
have approved beforehand.

If you would like to be added to my list of approved senders, please
fill out the short request form (see link below). Once I approve you,
I will receive your original message in my inbox. You do not need to
resend your message. I apologize for this one-time inconvenience.

Click the link below to fill out the request:

https://webmail1.earthlink.net/newaddme?a=reng...@ix.netcom.com=11ed-6a7e-3bda9c8e-8843-00144ff8e89f

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-WXGFH5YVUG5%3DVHf6HE7Z%2BCmB-miqxNqOLhEO%3DNYCf6dA%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Matt KØDVB
But see https://en.wikipedia.org/wiki/Self_(programming_language)

Self was considered an OO language back when I was a grad student and is
still listed that way today, even though it has neither classes nor
inheritance.

Anyway, my point would be that the term OO originates with Alan Kay and the
team at Xerox PARC; Kay’s response to the OO flame wars was to de-emphasize
classes and inheritance.

Of course, using his definition, neither Java nor Go would be “truly” OO
since not all things use late binding :-)

Perhaps we can talk about class-based and non-class based OO languages?

On Tue, Nov 22, 2022 at 10:07 AM Robert Engels 
wrote:

> The wiki OO page lists classes as a requirement - but not necessarily
> inheritance. Class variables require classes.
>
> Also, your link does not work.
>
> > On Nov 22, 2022, at 9:56 AM, Jan Mercl <0xj...@gmail.com> wrote:
> >
> > On Tue, Nov 22, 2022 at 4:43 PM Robert Engels 
> wrote:
> >
> >> Go is not listed as an OO language on Wikipedia.
> >
> > Check https://en.wikipedia.org/wiki/Go_(programming_language):
> > "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
> >
> >> Personally I think it is OO-like. OO typically has inheritance.
> >
> > Typically they may, but that's not the same as what a requirement
> > would be, right?
> >
> >> There are also no “class variables” - only package level - which makes
> some encapsulation patterns harder (every class has to become a package).
> >
> > No class has to become a package because Go has no classes. You may
> > think of what a "class" in Go means, but you have not defined that
> > idea and the language specification is somehow silent about Go
> > classes.
> >
> > --
> > 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...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com
> .
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/A1F03B77-7CDC-46CC-B2E0-2C3C1B7DC966%40ix.netcom.com
> .
>


-- 

Matt
K0DVB

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANRS-2%2Bre6WUFT6tE8QinUZ-ipqLvwNTr2hoHNiD4H%3DwQ8T7HA%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread 'Thomas Bushnell BSG' via golang-nuts
Asking "the definition of object oriented programming" seems a bad idea to
me. Alan Kay invented the term, and he was pretty clear that C++ was not
anything like what he had in mind, and yet, a lot of people think C++ is an
object oriented language. I don't, as it happens.

Inheritance used to be thought of as quite fundamental, but not so much any
more. I think that's probably right.

But here are some other things: object oriented languages are supposed to
have object ubiquity. I think Stroustrup probably did not understand the
point, and the designers of Java couldn't figure out how to make it
efficient. So much for them. C++ gets so much wrong it hardly matters. But
Java doesn't; it more or less regrets that it has non-object types. Go is
very different however: Go does not regard interfaces as something that
should be ubiquitous or feel bad when they aren't used. In fact, they are
discouraged except when actually required.

Late binding is another key feature, one which again C++ mostly didn't
understand the point of, and Java couldn't figure out how to implement
efficiently, so everyone does "final" instead. Go does have late binding
for interface method calls, but only on-demand.

Object oriented languages are generally either class-based or
prototype-based. Go is neither, having nothing like classes and nothing
like prototypes. For me, this is the most salient thing to keep in mind.

On Tue, Nov 22, 2022 at 10:56 AM Jan Mercl <0xj...@gmail.com> wrote:

> On Tue, Nov 22, 2022 at 4:43 PM Robert Engels 
> wrote:
>
> > Go is not listed as an OO language on Wikipedia.
>
> Check https://en.wikipedia.org/wiki/Go_(programming_language):
> "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
>
> > Personally I think it is OO-like. OO typically has inheritance.
>
> Typically they may, but that's not the same as what a requirement
> would be, right?
>
> > There are also no “class variables” - only package level - which makes
> some encapsulation patterns harder (every class has to become a package).
>
> No class has to become a package because Go has no classes. You may
> think of what a "class" in Go means, but you have not defined that
> idea and the language specification is somehow silent about Go
> classes.
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com
> .
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BYjuxt7BVNP22hy%2Bd9AoE56qssrhxUdu%2BSs9EwiqS7m8LGHCQ%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Robert Engels
The wiki OO page lists classes as a requirement - but not necessarily 
inheritance. Class variables require classes. 

Also, your link does not work. 

> On Nov 22, 2022, at 9:56 AM, Jan Mercl <0xj...@gmail.com> wrote:
> 
> On Tue, Nov 22, 2022 at 4:43 PM Robert Engels  wrote:
> 
>> Go is not listed as an OO language on Wikipedia.
> 
> Check https://en.wikipedia.org/wiki/Go_(programming_language):
> "ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"
> 
>> Personally I think it is OO-like. OO typically has inheritance.
> 
> Typically they may, but that's not the same as what a requirement
> would be, right?
> 
>> There are also no “class variables” - only package level - which makes some 
>> encapsulation patterns harder (every class has to become a package).
> 
> No class has to become a package because Go has no classes. You may
> think of what a "class" in Go means, but you have not defined that
> idea and the language specification is somehow silent about Go
> classes.
> 
> -- 
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/A1F03B77-7CDC-46CC-B2E0-2C3C1B7DC966%40ix.netcom.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Jan Mercl
On Tue, Nov 22, 2022 at 4:43 PM Robert Engels  wrote:

> Go is not listed as an OO language on Wikipedia.

Check https://en.wikipedia.org/wiki/Go_(programming_language):
"ParadigmMulti-paradigm: concurrent imperative, object-oriented[1][2]"

> Personally I think it is OO-like. OO typically has inheritance.

Typically they may, but that's not the same as what a requirement
would be, right?

> There are also no “class variables” - only package level - which makes some 
> encapsulation patterns harder (every class has to become a package).

No class has to become a package because Go has no classes. You may
think of what a "class" in Go means, but you have not defined that
idea and the language specification is somehow silent about Go
classes.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-U%3DG8gqAZEHrnLUxbg5vsAcRkNV35c86c79xcrhSzLSWw%40mail.gmail.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Robert Engels
Also, there is an interesting point about OO languages made by Rob Pike (on the 
wiki page) that would also imply that Go is not OO by design. 

> On Nov 22, 2022, at 9:43 AM, Robert Engels  wrote:
> 
> 
> Go is not listed as an OO language on Wikipedia. 
> 
> Personally I think it is OO-like. OO typically has inheritance. 
> 
> There are also no “class variables” - only package level - which makes some 
> encapsulation patterns harder (every class has to become a package). 
> 
>>> On Nov 22, 2022, at 9:06 AM, Matt KØDVB  wrote:
>>> 
>> The correct answer is actually “yes” because neither classes nor 
>> inheritance are necessary or sufficient for “object-oriented” programming.
>> 
>> https://www.youtube.com/watch?v=jexEpE7Yv2A
>> 
>> Sent from my iPad
>> 
 On Nov 22, 2022, at 9:02 AM, Ayan George  wrote:
 
>>> 
>>> 
>>> The Go FAQ begins the answer to the question, "Is Go an object-oriented 
>>> language," with, "yes and no."
>>> 
>>>   https://go.dev/doc/faq#Is_Go_an_object-oriented_language
>>> 
>>> The section goes on to say that Go has methods but there is no type 
>>> hierarchy.  I guess those are the yes and no.
>>> 
>>> But I feel like programmers bringing their ideas from other less 
>>> ambiguously object oriented languages like Java and C++ often have 
>>> difficulty writing idiomatic Go.
>>> 
>>> If the answer to that question is "yes and no," it'd be less ambiguous to 
>>> simply say, "no."  And that would be a definitive way of indicating that it 
>>> woul be inappropriate to apply many patterns from object oriented languages 
>>> to Go -- and to encourage people to accept Go for what it is.
>>> 
>>> Since receivers are parameters and one could use methods without using the 
>>> method calling syntax at all, I'd suggest we'd classify it as a structured 
>>> programming language with methods.
>>> 
>>> In either case, is there a way to make the FAQ more clear on this point?
>>> 
>>> -ayan
>>> 
>>> 
>>> 
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/CAPSh2XBozm9bOe-O3SphET3A3wTif%3D0RiV%3D1Bw6GJkgT3wedLA%40mail.gmail.com.
>> 
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/2B1E6084-E6F1-4B21-8ADF-06DA02A56966%40k0dvb.com.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/650DFE5D-C686-4F2D-A957-6E296E0D17CA%40ix.netcom.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Robert Engels
Go is not listed as an OO language on Wikipedia. 

Personally I think it is OO-like. OO typically has inheritance. 

There are also no “class variables” - only package level - which makes some 
encapsulation patterns harder (every class has to become a package). 

> On Nov 22, 2022, at 9:06 AM, Matt KØDVB  wrote:
> 
> The correct answer is actually “yes” because neither classes nor inheritance 
> are necessary or sufficient for “object-oriented” programming.
> 
> https://www.youtube.com/watch?v=jexEpE7Yv2A
> 
> Sent from my iPad
> 
>>> On Nov 22, 2022, at 9:02 AM, Ayan George  wrote:
>>> 
>> 
>> 
>> The Go FAQ begins the answer to the question, "Is Go an object-oriented 
>> language," with, "yes and no."
>> 
>>   https://go.dev/doc/faq#Is_Go_an_object-oriented_language
>> 
>> The section goes on to say that Go has methods but there is no type 
>> hierarchy.  I guess those are the yes and no.
>> 
>> But I feel like programmers bringing their ideas from other less ambiguously 
>> object oriented languages like Java and C++ often have difficulty writing 
>> idiomatic Go.
>> 
>> If the answer to that question is "yes and no," it'd be less ambiguous to 
>> simply say, "no."  And that would be a definitive way of indicating that it 
>> woul be inappropriate to apply many patterns from object oriented languages 
>> to Go -- and to encourage people to accept Go for what it is.
>> 
>> Since receivers are parameters and one could use methods without using the 
>> method calling syntax at all, I'd suggest we'd classify it as a structured 
>> programming language with methods.
>> 
>> In either case, is there a way to make the FAQ more clear on this point?
>> 
>> -ayan
>> 
>> 
>> 
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/CAPSh2XBozm9bOe-O3SphET3A3wTif%3D0RiV%3D1Bw6GJkgT3wedLA%40mail.gmail.com.
> 
> -- 
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/2B1E6084-E6F1-4B21-8ADF-06DA02A56966%40k0dvb.com.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8EFF20CB-31CA-44B5-9958-7D08A97C51F4%40ix.netcom.com.


Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Matt KØDVB
The correct answer is actually “yes” because neither classes nor inheritance 
are necessary or sufficient for “object-oriented” programming.

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

Sent from my iPad

> On Nov 22, 2022, at 9:02 AM, Ayan George  wrote:
> 
> 
> 
> The Go FAQ begins the answer to the question, "Is Go an object-oriented 
> language," with, "yes and no."
> 
>   https://go.dev/doc/faq#Is_Go_an_object-oriented_language
> 
> The section goes on to say that Go has methods but there is no type 
> hierarchy.  I guess those are the yes and no.
> 
> But I feel like programmers bringing their ideas from other less ambiguously 
> object oriented languages like Java and C++ often have difficulty writing 
> idiomatic Go.
> 
> If the answer to that question is "yes and no," it'd be less ambiguous to 
> simply say, "no."  And that would be a definitive way of indicating that it 
> woul be inappropriate to apply many patterns from object oriented languages 
> to Go -- and to encourage people to accept Go for what it is.
> 
> Since receivers are parameters and one could use methods without using the 
> method calling syntax at all, I'd suggest we'd classify it as a structured 
> programming language with methods.
> 
> In either case, is there a way to make the FAQ more clear on this point?
> 
> -ayan
> 
> 
> 
> -- 
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CAPSh2XBozm9bOe-O3SphET3A3wTif%3D0RiV%3D1Bw6GJkgT3wedLA%40mail.gmail.com.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/2B1E6084-E6F1-4B21-8ADF-06DA02A56966%40k0dvb.com.


[go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread Ayan George
The Go FAQ begins the answer to the question, "Is Go an object-oriented
language," with, "yes and no."

  https://go.dev/doc/faq#Is_Go_an_object-oriented_language

The section goes on to say that Go has methods but there is no type
hierarchy.  I guess those are the yes and no.

But I feel like programmers bringing their ideas from other less
ambiguously object oriented languages like Java and C++ often have
difficulty writing idiomatic Go.

If the answer to that question is "yes and no," it'd be less ambiguous to
simply say, "no."  And that would be a definitive way of indicating that it
woul be inappropriate to apply many patterns from object oriented languages
to Go -- and to encourage people to accept Go for what it is.

Since receivers are parameters and one could use methods without using the
method calling syntax at all, I'd suggest we'd classify it as a structured
programming language with methods.

In either case, is there a way to make the FAQ more clear on this point?

-ayan

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAPSh2XBozm9bOe-O3SphET3A3wTif%3D0RiV%3D1Bw6GJkgT3wedLA%40mail.gmail.com.


[go-nuts] Re: Building a Package With Multiple Subdirectories?

2022-11-22 Thread Amnon
Don't do it.
Don't fight the Go tools. Use them the way they are intended. They are your 
friends.
Put all your package files in a single directory. Or break them up into 
multiple packages.
That is the way everyone else write Go. If you follow the convention, your 
life will be simpler,
and your code will be easier for others to understand and maintain.


On Tuesday, 22 November 2022 at 01:15:33 UTC jlfo...@berkeley.edu wrote:

> Back in June I asked why Go requires all the files in a package to be in 
> the same 
> directory. I learned that this is an implementation-specific decision. I 
> was also referred to
>
>
> https://stackoverflow.com/questions/45899203/can-i-develop-a-go-package-in-multiple-source-directories
>
> which discusses this. Someone named "Volker" in this posting said
>
> "Yes, this is doable without any problems, just invoke the Go compiler by 
> hand, that is not 
> via the go tool."
>
> I'm wondering how to actually do this. Suppose I have a directory, which 
> contains several
> subdirectories. There are .go files in all these directories that I'd like 
> to use to make a
> single package. How could I invoke to Go compiler by hand to make this 
> happen?
> (I've tried adding the "-x" flag to "go build" but I don't see which 
> arguments I'd need to 
> change to do what I'm trying to accomplish). Volker says "It's complicated
> ".
>
> Also, let's say I was able to figure this out. Would using such a package 
> confuse any of
> the other commands in the Go tool chain or the dlv debugger?
>
> Cordially,
> Jon Forrest
>
>
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f4f1dca8-6e19-4f71-9a62-45097cf43872n%40googlegroups.com.


[go-nuts] Re: Go 1.20 release date

2022-11-22 Thread Amnon
Feb 2023 is a good bet.

On Tuesday, 22 November 2022 at 10:24:07 UTC piotr.w...@gmail.com wrote:

> Hi,
>
> is the date of the 1.20 release roughly known? I need some goodies it 
> promises to provide.
>
> Best regards, Piotr 
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ef295ef6-7148-4107-aa6b-55ffda441f2fn%40googlegroups.com.


[go-nuts] Re: Proposal for change type Duration int64

2022-11-22 Thread Nikhilesh Susarla
Got it. I was wrong. 
time.NewTicker would panic if duration is negative.

But if the duration is used widely in negative then fine :) 

Thank you for correcting 

On Tuesday, 22 November 2022 at 16:03:58 UTC+5:30 Volker Dobler wrote:

> On Tuesday, 22 November 2022 at 11:28:15 UTC+1 nikhil...@gmail.com wrote:
>
>> [...] the duration value should never be less than 0 else it will panic
>>
> This statement is wrong, a negative time.Duration doesn't panic.
> (Maybe you are talking about time.Sleep?)
>
> Is there any reason for not using uint?
>>
> Because negative durations are common and useful.
>
> V.
>

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c1ff0c7c-fca3-4bf7-9623-b97739915abfn%40googlegroups.com.


Re: [go-nuts] Proposal for change type Duration int64

2022-11-22 Thread Shulhan
On Tue, 22 Nov 2022 02:28:14 -0800 (PST)
Nikhilesh Susarla  wrote:

> Hi, 
> 
> type Duration int64
> 
> The current Duration is int64 and the duration value should never be
> less than 0 else it will panic. It would be safe and advisable to
> change it to uint64 or so, where at least it would not cause panic. 
> 
> Is there any reason for not using uint?
> 

A negative duration is required to compute time.Time-d, using
Time.Add(-Duration) [1].
Also, Time.Sub may return negative too.

[1] https://pkg.go.dev/time#Time.Sub

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20221122173816.07ed2f06%40inspiro.localdomain.


pgpaaCaq6qWJ4.pgp
Description: OpenPGP digital signature


[go-nuts] Re: Proposal for change type Duration int64

2022-11-22 Thread Volker Dobler
On Tuesday, 22 November 2022 at 11:28:15 UTC+1 nikhil...@gmail.com wrote:

> [...] the duration value should never be less than 0 else it will panic
>
This statement is wrong, a negative time.Duration doesn't panic.
(Maybe you are talking about time.Sleep?)

Is there any reason for not using uint?
>
Because negative durations are common and useful.

V.

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ff31c65c-b672-4f87-8e0b-e417cd64d153n%40googlegroups.com.


[go-nuts] Proposal for change type Duration int64

2022-11-22 Thread Nikhilesh Susarla
Hi, 

type Duration int64

The current Duration is int64 and the duration value should never be less 
than 0 else it will panic. It would be safe and advisable to change it to 
uint64 or so, where at least it would not cause panic. 

Is there any reason for not using uint?

Thank you
Susarla Nikhilesh

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/bc708af3-add6-4929-936f-a624ec09411cn%40googlegroups.com.


[go-nuts] Go 1.20 release date

2022-11-22 Thread Piotr Wyderski
Hi,

is the date of the 1.20 release roughly known? I need some goodies it 
promises to provide.

Best regards, Piotr 

-- 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/bdbafb78-4ff7-4a70-aa66-c4f035243fd5n%40googlegroups.com.