[go-nuts] Re: Go channels overused and hyped?

2017-08-09 Thread Jason Stillwell
Here's the thing about channels in go. They're a primitive. Just like int 
is a primitive and string is a primitive. They're not an entire library, or 
framework. they're just a primitive.

In other languages, currency "tools" are usually provided as some part of a 
fully featured library, or package, or framework. But not in go. Go 
provides the primitive, and its up to you to use that to implement your 
actual concurrency tools.

You might try to store a date in an int. But there are lots of caveats 
along with doing so. Instead you take primitives like ints and structs and 
put them together to make a package and set of structures for dealing with 
Dates. You don't complain that int alone isn't good enough for doing all 
your date processing.

But a lot of devs see the channel and assume its some high level 
abstraction built with an API to deal with all your common situations, 
because thats what they are used to expecting from their other language 
experience. Its not though. Its just a building block. Build something with 
it, and then use that something.

On Monday, August 7, 2017 at 11:01:12 PM UTC-7, snmed wrote:
>
> Hi Gophers
>
> I stumbled over a nice and very interesting Blog entry "Go channels are 
> bad and you should feel bad 
> "
>  
> , I would like to hear some opinions about that article
> from seasoned go developers. Because I just used go for a couple of months 
> for my private web projects and rarely get in touch with channels.
>
> By the way, that article is not a rant and the author likes go very much 
> as far as I can conclude from the article.
>
> Cheers snmed
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Is slice in golang thread-safe for appending

2017-01-19 Thread Jason Stillwell
But it returns the new slice.

On Thursday, January 19, 2017 at 2:40:30 PM UTC-8, freeformz wrote:
>
> No, it is not.*
>
> * appending can replace the underlying array, so in certain situations it 
> can be, but that's more by accident IMO so just don't rely on that.
>
> On Thu, Jan 19, 2017 at 1:43 PM xiaohai dai  > wrote:
>
>> I know that map in golang is not thread-safe for writing.
>> However, I'm not sure slice/array is thread-safe for writing. I have 
>> searched the related posts and blogs in google, but find no unambiguous 
>> statement.
>>
>> Thanks in advance! 
>>
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Using the new plugin API to create a Go REPL

2016-11-25 Thread Jason Stillwell
https://github.com/dragonfax/go_repl_plugin_example

Its just a toy, but I thought it was an interesting idea.

You compile a plugin with the code the user typed, and then load that into 
the process and execute it.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] [ANN] (GUI) Qt binding which supports Windows / macOS / Linux / Android / iOS / Sailfish OS / Raspberry Pi

2016-11-12 Thread Jason Stillwell
Those are great answers. Not having used qt before, I needed this help.
Thanks.

On Sat, Nov 12, 2016, 11:36 AM Justin Israel <justinisr...@gmail.com> wrote:

>
>
> On Sun, Nov 13, 2016, 7:47 AM therecipe <the_rec...@hotmail.com> wrote:
>
> Most times there is some function that returns either some error code or
> some error string.
> Like in http://doc.qt.io/qt-5/qmediaplayer.html#error, but it's rarely
> needed.
>
> Am Samstag, 12. November 2016 18:54:16 UTC+1 schrieb Pietro Gagliardi
> (andlabs):
>
> Does Qt even expose errors itself? Back when I did Qt I never had to check
> myself..
>
>
> That,  or objects will have validation methods on them like isValid(),
> isNull(), isEmpty(), with documentation about when to expect those
> conditions.
>
> QRegExp also happens to expose an errorString() method, as an example of a
> case where it needs to communicate more information:
> http://doc.qt.io/qt-5/qregexp.html#errorString
>
> On Nov 12, 2016, at 4:17 AM, Jason Stillwell <drag...@gmail.com> wrote:
>
> I gave it a try using QMdiArea. It seems to work well.
>
> But I'm confused about where the errors go. There doesnt' seem to be a way
> to check for errors. Does it panic in every error situation?
>
> On Thursday, November 10, 2016 at 12:34:36 PM UTC-8, therecipe wrote:
>
> Hey everyone,
>
> I would like to officially announce the project I'm working on for a while
> now.
> It's a binding for the Qt framework + some tools to help you with
> development and deployment of your Qt applications.
>
> The most interesting feature of the Qt framework for the Go community is
> probably that it can be used to develop native looking GUI applications for
> various platforms without the need to make platform specific changes to
> your code.
> Beside the GUI modules Qt also includes: a webengine (chromium), several
> multimedia functions, access to bluetooth + nfc, access to various hardware
> sensors, gamepad support, access to position informations and much more ...
> The Qt article on wikipedia: https://en.wikipedia.org/wiki/Qt_(software)
>
>
> There are two caveats for those who intent to use the binding:
>
> 1. You code won't be pure Go anymore, as this binding heavily relies on
> cgo.
> 2. The binding dynamically links to Qt's libraries, which results in
> 25-50mb (depending on the platform) uncompressed libs that have to be
> deployed along with you binary.
> (But it's also possible to link against the static Qt libs and remove this
> need. And there is also work being done to reduce the size of the dynamic
> libs in the upcoming versions of Qt.)
>
>
> For the pro side, I should probably mention that:
>
> 1. The deployment to most platforms is pretty trivial (that includes cross
> compiling). (And there will be even more supported platforms in the future)
> 2. That the binding is almost complete and already supports most Qt
> modules (30+).
> 3. There are a lot of examples to get you started. (And porting over
> existing C++ examples should be super simple)
>
>
> If someone is interested in testing it out, it can be found here:
> https://github.com/therecipe/qt
>
>
> Or if you just want to take a quick look and test the examples on Linux
> and you are familiar with Docker.
> You could use one of the images as well: `docker pull therecipe/qt:base`
> And simply run `qtdeploy build desktop` in one of the `$GOPATH/src/
> github.com/therecipe/qt/internal/examples/`
> <http://github.com/therecipe/qt/internal/examples/> sub-sub folders.
> (inside the container)
> There will be a new folder created called `deploy`, which should contain
> everything that is needed to run the application on a regular 64-bit Linux
> system.
>
>
> Please let me know what you think.
> Any feedback is welcome :)
>
>
> --
> 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.
>
>
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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.
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] (GUI) Qt binding which supports Windows / macOS / Linux / Android / iOS / Sailfish OS / Raspberry Pi

2016-11-12 Thread Jason Stillwell
I gave it a try using QMdiArea. It seems to work well.

But I'm confused about where the errors go. There doesnt' seem to be a way 
to check for errors. Does it panic in every error situation?

On Thursday, November 10, 2016 at 12:34:36 PM UTC-8, therecipe wrote:
>
> Hey everyone,
>
> I would like to officially announce the project I'm working on for a while 
> now.
> It's a binding for the Qt framework + some tools to help you with 
> development and deployment of your Qt applications.
>
> The most interesting feature of the Qt framework for the Go community is 
> probably that it can be used to develop native looking GUI applications for 
> various platforms without the need to make platform specific changes to 
> your code.
> Beside the GUI modules Qt also includes: a webengine (chromium), several 
> multimedia functions, access to bluetooth + nfc, access to various hardware 
> sensors, gamepad support, access to position informations and much more ...
> The Qt article on wikipedia: https://en.wikipedia.org/wiki/Qt_(software)
>
>
> There are two caveats for those who intent to use the binding:
>
> 1. You code won't be pure Go anymore, as this binding heavily relies on 
> cgo.
> 2. The binding dynamically links to Qt's libraries, which results in 
> 25-50mb (depending on the platform) uncompressed libs that have to be 
> deployed along with you binary.
> (But it's also possible to link against the static Qt libs and remove this 
> need. And there is also work being done to reduce the size of the dynamic 
> libs in the upcoming versions of Qt.)
>
>
> For the pro side, I should probably mention that:
>
> 1. The deployment to most platforms is pretty trivial (that includes cross 
> compiling). (And there will be even more supported platforms in the future)
> 2. That the binding is almost complete and already supports most Qt 
> modules (30+).
> 3. There are a lot of examples to get you started. (And porting over 
> existing C++ examples should be super simple)
>
>
> If someone is interested in testing it out, it can be found here:
> https://github.com/therecipe/qt
>
>
> Or if you just want to take a quick look and test the examples on Linux 
> and you are familiar with Docker.
> You could use one of the images as well: `docker pull therecipe/qt:base`
> And simply run `qtdeploy build desktop` in one of the `$GOPATH/src/
> github.com/therecipe/qt/internal/examples/` 
>  sub-sub folders. 
> (inside the container)
> There will be a new folder created called `deploy`, which should contain 
> everything that is needed to run the application on a regular 64-bit Linux 
> system.
>
>
> Please let me know what you think.
> Any feedback is welcome :)
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.