Re: [go-nuts] Newbie: Where I can get to see Go routines' white paper and its implementation ( Header file equivalent) in Go Repo'?

2021-06-07 Thread Artur Vianna
Not a white paper per se, but there are a few resources by Dmitry Vyukov that i came about: A Talk: https://youtu.be/-K11rY57K7k The Slides: https://assets.ctfassets.net/oxjq45e8ilak/48lwQdnyDJr2O64KUsUB5V/5d8343da0119045c4b26eb65a83e786f/100545_516729073_DMITRII_VIUKOV_Go_scheduler_Implementing_

Re: [go-nuts] Recursive type definition

2021-05-03 Thread Artur Vianna
I believe the code is derived from a talk by Rob Pike on Lexers: https://talks.golang.org/2011/lex.slide#1 On Mon, 3 May 2021, 14:58 Jesper Louis Andersen, < jesper.louis.ander...@gmail.com> wrote: > On Mon, May 3, 2021 at 6:43 PM Delta Echo wrote: > >> >> Hi, Is there any document that explain

Re: [go-nuts] Re: Alternate implementations of regular expression matching?

2021-04-03 Thread Artur Vianna
Oops sorry, Powerset algo is actually O(n*2^n) time complexity On Sat, 3 Apr 2021, 13:49 Artur Vianna, wrote: > An interesting approach would be the implementation of a regex engine that > has optimizations just like a compiler (i think the stdlib one does that to > an extent). Using

Re: [go-nuts] Re: Alternate implementations of regular expression matching?

2021-04-03 Thread Artur Vianna
An interesting approach would be the implementation of a regex engine that has optimizations just like a compiler (i think the stdlib one does that to an extent). Using powerset and hopcroft's where it can be used and leaving backtracks where it can't. That would be fun to implement but very confu

Re: [go-nuts] string matching

2021-04-01 Thread Artur Vianna
Try the regex: "Core Count: [0-9]+", then split on ":" and select the second part. On Thu, 1 Apr 2021, 15:28 Sharan Guhan, wrote: > Hi Experts, > > New to Golang and finding it non trivial to achieve the below efficiently > :-) Any pointers will help.. > > I have a huge string as below .. Now f

Re: [go-nuts] GIL for Go

2021-04-01 Thread Artur Vianna
April 1st? You got me good on that last one On Thu, 1 Apr 2021, 12:41 Amnon, wrote: > An exciting announcement from the Go team this morning! > > The upcoming release of Go 1.17 (due in September) will include GIL for Go, > As the Pythonistas among us know, GIL is Python’s Global Interpreter Loc

Re: [go-nuts] Golang mentioned on Penn and Teller: Fool Us?

2021-03-04 Thread Artur Vianna
Rob Pike actually participated in their show in 1989: https://youtu.be/UbqUgIrO7xM?t=184 On Thu, 4 Mar 2021, 14:09 Tom Limoncelli, wrote: > No. Not really. > > However, on the most recent episode of Penn and Teller: Fool Us > ( > https://www.cwtv.com/shows/penn-teller-fool-us/back-to-the-future/

Re: [go-nuts] Compilation process and unused-declared variables (func/package) levels

2021-03-02 Thread Artur Vianna
Many packages expose useful variables that are not being used themselves, like useful defaults for example. I guess this would be an argument in favor of limiting this kind of behaviour to inside the functions. A good example is image/color/pallete. Also, there is some shenanigans on estimating t

Re: [go-nuts] A goroutine question

2021-02-19 Thread Artur Vianna
You can find what's the difference between the two programs yourself by profiling it, it will show the overhead of context switch, goroutine initialization, GC and so forth. Heres some good resources: https://blog.golang.org/pprof https://youtu.be/nok0aYiGiYA On Fri, 19 Feb 2021, 11:46 Yuwen Dai,

Re: [go-nuts] [ANN] Hare - a nimble little DBMS written in Go.

2021-02-15 Thread Artur Vianna
Looks very cool! Seems like a nice fit for persistent storage in games On Mon, 15 Feb 2021, 14:37 Jamey Cribbs, wrote: > After working on this package off and on for a long time, I've finally > decided to set it free into the wild. > > Hare is a pure Go database management system that stores eac

Re: [go-nuts] The Generics Proposal has been accepted!

2021-02-12 Thread Artur Vianna
thank you! On Fri, 12 Feb 2021, 12:49 Amnon, wrote: > I imagine that the people who usually write the blogs are busy getting > 1.16 out the door. > > But there are a few blog posts: > https://blog.golang.org/why-generics > > https://blog.golang.org/generics-proposal > > https://blog.golang.org/g

Re: [go-nuts] The Generics Proposal has been accepted!

2021-02-12 Thread Artur Vianna
Will there be a blog post about this? I really want to know more! On Fri, 12 Feb 2021, 12:39 Amnon, wrote: > And should be out in 1.17 (this Autumn). > > Congratulations to all those who made it happen, > and to the Go team for making sure that the design was right before it > was accepted. > >

Re: [go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-05 Thread Artur Vianna
it may be useful to avoid repetition, for example if implementing stacks, you have to create the "pop(), push(), top()" before starting to code what you want. Maybe there's place for this utility functions under the "container/" package (like "container/slice"), where you could do things like: st

Re: [go-nuts] instead of generics, why cant we just implement an "any" builtin?

2021-01-19 Thread Artur Vianna
He gave an idea and i found it *fun* to think of the implementation, i'm not proposing anything, in fact i wrote and deleted from my original text "This has probably been thought already", because it looked like i was proposing, and I'm not. On Tue, 19 Jan 2021, 09:21 'Axel Wagner' via golang-nuts

Re: [go-nuts] instead of generics, why cant we just implement an "any" builtin?

2021-01-19 Thread Artur Vianna
rote: > On Tue, Jan 19, 2021 at 12:19 PM Artur Vianna > wrote: > >> if you're trying to compare "a> store this as a operation necessary for that type to work, as an *implicit >> contract*. And whenever this function is used, it checks this implicit >> contrac

Re: [go-nuts] instead of generics, why cant we just implement an "any" builtin?

2021-01-19 Thread Artur Vianna
Not taking anyone's side here, but here's a example of how i think this "any" may work: if you're trying to compare "a wrote: > Hi, > > On Tue, Jan 19, 2021 at 6:47 AM mortdeus wrote: > >> The more I look at the proposed generic syntax the more I feel like a >> texan fearing the californian relo

Re: [go-nuts] Go Create

2021-01-12 Thread Artur Vianna
I don't think this tweet is very true, it took me many months of learning Go to start learning about go.mod. I think that's not the first thing one learns about a language, you can just 'vim main.go' and begin experimenting. How do you propose this tool will work? On Tue, 12 Jan 2021, 06:25 Kevin

Re: [go-nuts] Possible language improvement re multiple assignment

2020-12-28 Thread Artur Vianna
The only "disadvantage" i could think would be increasing the ways one could create variables: var i int i := 0 :i = 0 and it allows this madness: :a, b, :c, d, :e = 0, 1, 2, 3, 4 Otherwise i like the idea, but i don't mind using the long version in pro of simplicity. On Mon, 28 Dec 2020, 16:40

Re: [go-nuts] Go and AI Recommendations

2020-12-27 Thread Artur Vianna
I don't know what resources you have tried already so I'm probably going to state the obvious. You're probably looking for some language agnostic resources on the subject, since having it be Go specific will narrow your search. ML like any part of computer science can be described with algorithms

Re: [go-nuts] multicasting with encoding/gob

2020-12-24 Thread Artur Vianna
I will definitely explore your ideas, thanks for the insights. I'll let you know how it turned out in the end :D Thanks On Thu, 24 Dec 2020, 06:59 Axel Wagner, wrote: > On Thu, Dec 24, 2020 at 6:35 AM Artur Vianna > wrote: > >> Exposing the bytes would hurt the abstractio

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Artur Vianna
In games most code is shared between server and client so normally they're built on the same language, and even in the same framework. Sometimes you need to share load with the client to increase the amount of players. So I'm not too worried about inter-language interoperability. I'm not sure havi

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Artur Vianna
t changing the API. The ideal enconding would be a stateless gob, with the proper decoding/encoding "machines" set on either side when you call gob.Register, but i'm not sure of the feasibility of that. On Wed, 23 Dec 2020, 21:55 Axel Wagner, wrote: > On Thu, Dec 24, 2020 at 1

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Artur Vianna
nnection only needs the metadata and can decode further stream > messages. You may need framing resets to simplify things and reduce the > overhead depending on the hierarchy of “objects and references” > > On Dec 23, 2020, at 6:09 PM, Artur Vianna wrote: > >  > Before usin

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Artur Vianna
json would probably be fine) than trying to make > this work with gob :) > > On Thu, Dec 24, 2020 at 12:20 AM Matthew Zimmerman > wrote: > >> If you would "reset" each client with a new decoder each time you make a >> new encoder, everything should work fine. J

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Artur Vianna
fined types." >> >> In my own rudimentary understanding/terms, it sends the struct definition >> once, then uses shorthand for it afterwards. E.g, how many bytes and what >> order. If you mix and match streams that send definitions in different >> orders, then chao

Re: [go-nuts] multicasting with encoding/gob

2020-12-23 Thread Artur Vianna
If i create a bytes.Buffer and a gob.Encoder, each time i write to a group of connections i get "duplicate type received" and if i try and reuse the encoder, i get "corrupted data" and "unknown type". It seems i can't use both net.Conn.Write and gob.Encoder.Encode in the same connection, i will try

Re: [go-nuts] Re: Generics, please go away!

2020-12-22 Thread Artur Vianna
Ultimately Go is a community and polls are unavoidable. And even in the benevolent-dictator model, the dictator is forced by the community if the pressure is high enough, this has happened in a lot of projects like Vim and Python. And in Vim some changes only happened after the adoption of the NeoV

Re: [go-nuts] Re: Generics, please go away!

2020-12-22 Thread Artur Vianna
He did explicitly said in the last paragraph that Go is not driven by pools (aka surveys). On Tue, 22 Dec 2020, 18:46 Martin Hanson, wrote: > > I don't know of a poll specifically about generics. But for the past > > several years we've done a Go community survey, and every year there > > is sig

Re: [go-nuts] Re: Generics, please go away!

2020-12-21 Thread Artur Vianna
Although i am also against generics, as i didn't even know it existed before i started to see people complaining that Go didn't have it, i don't think it will be that bad. It probably won't be overused for the same reason interface{} isn't overused, the cases where it really makes sense and is idio