[go-nuts] Re: Vue-inspired library with Go+WebAssembly

2019-03-29 Thread Brad
Yeah, it's different.  But it would certainly be cool to have a solution 
that provides an Electron-like shell around a Vugu application.  I'll make 
an issue for it so it's noted for later.

On Friday, March 29, 2019 at 9:12:31 PM UTC-7, Mike Schinkel wrote:
>
> Oops. I think I spoke to soon. I don't think what you have is an 
> alternative to Lorca, but an alternative to Vue.js *(which might still be 
> interesting.)*
>
> *Whoever is moderating **if you see this in time **please just delete 
> both messages.*
>
> On Friday, March 29, 2019 at 12:39:42 AM UTC-4, Brad wrote:
>>
>> Now that WebAssembly is available as an (experimental) compilation 
>> target, it raises the question of how feasible is it to make a quality UI 
>> library. Vue (my personal fav) and React, while they have their issues, do 
>> have many ideas which are good and seem like they may translate well over 
>> to WebAssembly.
>>
>> Here's a working experimental Vue-like UI library with tools to write UI 
>> components in .vugu files (similar in concept to .vue files): 
>> https://github.com/vugu/vugu; Getting Started page: 
>> http://www.vugu.org/doc/start
>>
>> HTML with logic in it gets code generated to .go files.  In-browser 
>> rendering in wasm  with DOM sync as well as static HTML output are 
>> implemented.
>>
>> And this is my cheesy bullet-pointed list that makes it sound a lot more 
>> mature than it is:
>>
>> * Runs in-browser using WebAssembly
>> * Single-file components
>> * Vue-like markup syntax
>> * Write idiomatic Go code
>> * Rapid prototyping
>> * ~3 minute setup
>> * Standard Go build tools
>>
>> I'm curious what people think of the approach and ideas for improvement.
>>
>> --brad
>>
>>

-- 
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: Vue-inspired library with Go+WebAssembly

2019-03-29 Thread Mike Schinkel
Hi Brad,

This sounds *very* interesting.  

We are currently building a product using Lorca (
https://github.com/zserge/lorca) but am worried that it is not mature and 
may never be, and that Chrome could change and disable to features that 
make it possible at any time.

What are your plans for it?  I would be really interested if it could 
become a commercial product so that I could have better confidence of it 
being supported.

-Mike

On Friday, March 29, 2019 at 12:39:42 AM UTC-4, Brad wrote:
>
> Now that WebAssembly is available as an (experimental) compilation target, 
> it raises the question of how feasible is it to make a quality UI library. 
> Vue (my personal fav) and React, while they have their issues, do have many 
> ideas which are good and seem like they may translate well over to 
> WebAssembly.
>
> Here's a working experimental Vue-like UI library with tools to write UI 
> components in .vugu files (similar in concept to .vue files): 
> https://github.com/vugu/vugu; Getting Started page: 
> http://www.vugu.org/doc/start
>
> HTML with logic in it gets code generated to .go files.  In-browser 
> rendering in wasm  with DOM sync as well as static HTML output are 
> implemented.
>
> And this is my cheesy bullet-pointed list that makes it sound a lot more 
> mature than it is:
>
> * Runs in-browser using WebAssembly
> * Single-file components
> * Vue-like markup syntax
> * Write idiomatic Go code
> * Rapid prototyping
> * ~3 minute setup
> * Standard Go build tools
>
> I'm curious what people think of the approach and ideas for improvement.
>
> --brad
>
>

-- 
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: Vue-inspired library with Go+WebAssembly

2019-03-29 Thread Mike Schinkel
Oops. I think I spoke to soon. I don't think what you have is an 
alternative to Lorca, but an alternative to Vue.js *(which might still be 
interesting.)*

*Whoever is moderating **if you see this in time **please just delete both 
messages.*

On Friday, March 29, 2019 at 12:39:42 AM UTC-4, Brad wrote:
>
> Now that WebAssembly is available as an (experimental) compilation target, 
> it raises the question of how feasible is it to make a quality UI library. 
> Vue (my personal fav) and React, while they have their issues, do have many 
> ideas which are good and seem like they may translate well over to 
> WebAssembly.
>
> Here's a working experimental Vue-like UI library with tools to write UI 
> components in .vugu files (similar in concept to .vue files): 
> https://github.com/vugu/vugu; Getting Started page: 
> http://www.vugu.org/doc/start
>
> HTML with logic in it gets code generated to .go files.  In-browser 
> rendering in wasm  with DOM sync as well as static HTML output are 
> implemented.
>
> And this is my cheesy bullet-pointed list that makes it sound a lot more 
> mature than it is:
>
> * Runs in-browser using WebAssembly
> * Single-file components
> * Vue-like markup syntax
> * Write idiomatic Go code
> * Rapid prototyping
> * ~3 minute setup
> * Standard Go build tools
>
> I'm curious what people think of the approach and ideas for improvement.
>
> --brad
>
>

-- 
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: wasm output and modules

2019-03-29 Thread whitehexagon via golang-nuts
I took out the Funcs for now, but no difference.  But good point about the 
signal! I currently dont have an exit button, Although I figure most people 
just close a tab, or close the browser, so I guess I need to find a way to 
make that work without an explicit button...? or maybe they just hit 
refresh like I have been doing :)  I dont know enough about the browser 
environment to know if the wasm blob itself will just get released without 
the chan exit, but I would imagine it would?

Anyway here is my code:

https://github.com/WhiteHexagon/go2wasm-vr/blob/master/main.go

Even with Funcs I wouldn't expect an OOM or mostly I just get nothing at 
all from simply hitting refresh on the page.  I must be missing something 
obvious here.  (It's still working fine on my mac).

btw I found some mention of tools for wasm shrinking today, but not been 
able to try them yet.

https://rustwasm.github.io/book/game-of-life/code-size.html
https://rustwasm.github.io/book/reference/code-size.html

The most interesting one goes from wasm-to-wasm and is called 'wasm-opt':

https://github.com/WebAssembly/binaryen

Has anyone tried this yet?  It sounds quite impressive.

Thanks for your help, Peter


> Are you signalling the chan to exit ? Unless that happens, those Funcs 
> will not be released. Typically, you have an "exit" button which is hooked 
> to an event listener that signals your main goroutine to exit, cleaning up 
> its resources.
>
> Regarding restart, just use JS to call go.run() again, once you have 
> exited from it. Reuse the result.instance by storing it in a variable. I 
> think that should do 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] Confusing Behavior When Compiling an Assignment Using a Map

2019-03-29 Thread Marvin Renich
* jlforr...@berkeley.edu  [190329 15:28]:
> Thanks everyone for responding!
> 
> However, in the case that I illustrated there is no such problem. I
> would have thought that the language would allow this construct with
> any expression on the right side, as long as it only has one map
> access.
> 
> This isn't a big deal since it's so easy to work around, but it
> surprised me as a newcomer to Go.

I'm glad you got it figured out!  This may help you next time you run
into something similar:

Go is a strongly typed language, and its syntax consists of statements
and expressions.  Each expression only looks at its operands, and does
not depend on what complex sub-expression was evaluated to obtain
that operand.  Likewise, a statement only looks at the very outer layer
of its expressions.

So, for an assignment such as

  a, ok = foo(x[i]).y[z]

the compiler sees a potential assignment statement.  An assignment
statement must have a list of addressable expressions and/or map index
expressions on the left, which this does.  The expression on the right
must either be multi-valued, with two values, or it must be a map
indexing expression.  The only way this can be a map indexing expression
is if «foo(x[i]).y» evaluates to a map.

The Go syntax never looks deeper than this.  In fact, the Go
specification calls out this particular statement syntax as being a
"special form".  It only applies if the RHS _is_ a map indexing
expression, not if the RHS _contains_ a map indexing expression.

Hope this helps!

...Marvin

-- 
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] What do the U, V, and W in function names in src/math/big stand for?

2019-03-29 Thread Ian Lance Taylor
On Fri, Mar 29, 2019 at 3:14 PM Neven Sajko  wrote:
>
> For example in mulWW or addVV? It seems to maybe have something to do
> with function arguments?

W is a word (Word aka uint), V is a slice of word ([]Word).  U is also
a slice of word, but I'm not sure what the difference between V and U
is.

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


[go-nuts] What do the U, V, and W in function names in src/math/big stand for?

2019-03-29 Thread Neven Sajko
For example in mulWW or addVV? It seems to maybe have something to do
with function arguments?

-- 
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: [URGENT] Pass array of string between Go and C library

2019-03-29 Thread Ashutosh Baghel
Well i did some something like this, seems to be working


arr := make([]*C.char, count_emp)

for i, s := range arr {
cs := C.CString(C.GoString(s))
defer C.free(unsafe.Pointer(cs))
arr[i] = cs
}
k = (C.ushort)(C.FetchName_Emp(C.int(val),&arr[0]))



On Friday, 29 March 2019 09:23:31 UTC+5:30, Justin Israel wrote:
>
>
>
> On Friday, March 29, 2019 at 11:08:06 AM UTC+13, Ashutosh Baghel wrote:
>>
>> Hi folks,
>>
>> I am new to Go-Programming and  having the following requirement, I need 
>> to have Array of Strings,(for example names) at my 'Go Side' .
>>
>> But i would get this names from my C library API which i have included in 
>> my Go program.
>>
>> Note: I have liberty to modify the C library too, i could control the 
>> return type.
>>
>> Please help with this.
>>
>
> Here is an example from one of my projects using cgo as a binding to a C++ 
> library:
>
> C string array to Go
> https://github.com/justinfx/openimageigo/blob/master/imagespec.go#L387
>  
> Go string slice to C
> https://github.com/justinfx/openimageigo/blob/master/imagespec.go#L402
>
> There are other approaches besides this one. 
>
>
>  
>>
>

-- 
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] Re: proposal: Go 2: add untyped() type conversion for integer constants #31076

2019-03-29 Thread Michael Jones
I updated https://github.com/golang/go/issues/31076 to reflect the comments
here.
Thank you both.

On Fri, Mar 29, 2019 at 9:57 AM Ian Lance Taylor  wrote:

> On Thu, Mar 28, 2019 at 11:17 PM Jan Mercl <0xj...@gmail.com> wrote:
> >
> > The Compatibility section of the proposal says: "I think that this would
> break no existing code, as a user function invocation untyped(EXPR) is not
> at present allowed in constant specifications."
> >
> > It's true that user function cannot be called in a constant expression.
> But conversion to a user defined type is legal:
> https://play.golang.org/p/AXSFzMR677c
> >
> > IOW, the proposal is not backwards compatible.
>
> If we treat untyped as an ordinary predeclared identifier, then I
> think the proposal remains backward compatible.  The new predeclared
> untyped is not available in packages that defined the name untyped in
> package scope.  And there is no other way write untyped(EXPR).
>
> Ian
>


-- 

*Michael T. jonesmichael.jo...@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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] GopherCon Europe 2019 Tenerife

2019-03-29 Thread GopherCon Europe
Last year's GopherCon Europe in the far-north (Iceland) was a great 
success! This year GopherCon Europe turns to the far south of the EU, the 
remote and volcanic coast of the Canaries, Tenerife! From the *30th until 
the 1st of June*, we will have full days of talks, workshops, community 
activities and networking. More information about the speakers, workshops 
holders and program you can find on our website. 
 And stay updated with our latest info by 
following us on Twitter  Buy your ticket 

 
and join us from the 30th of May until the 1st of June in Tenerife. 


-- 
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] Confusing Behavior When Compiling an Assignment Using a Map

2019-03-29 Thread Jan Mercl
On Fri, Mar 29, 2019 at 8:27 PM  wrote:

> However, in the case that I illustrated there is no such problem. I would
have thought that the
> language would allow this construct with any expression on the right
side, as long as it only has one
> map access.

Consider

type v struct{
a T
b map[U]V
}
var m map[W]v{}

...

x, ok := m.b

Which map should the ok value reflect under the changed rules? And
disambiguation it with the "only one map access" rule, reading the code no
more hints about what ok belongs to without prior knowledge of what type of
m.b is.


-- 

-j

-- 
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] Re: proposal: Go 2: add untyped() type conversion for integer constants #31076

2019-03-29 Thread Ian Lance Taylor
On Thu, Mar 28, 2019 at 11:17 PM Jan Mercl <0xj...@gmail.com> wrote:
>
> The Compatibility section of the proposal says: "I think that this would 
> break no existing code, as a user function invocation untyped(EXPR) is not at 
> present allowed in constant specifications."
>
> It's true that user function cannot be called in a constant expression. But 
> conversion to a user defined type is legal: 
> https://play.golang.org/p/AXSFzMR677c
>
> IOW, the proposal is not backwards compatible.

If we treat untyped as an ordinary predeclared identifier, then I
think the proposal remains backward compatible.  The new predeclared
untyped is not available in packages that defined the name untyped in
package scope.  And there is no other way write untyped(EXPR).

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


Re: [go-nuts] Confusing Behavior When Compiling an Assignment Using a Map

2019-03-29 Thread Marvin Renich
* jlforr...@berkeley.edu  [190329 11:16]:
> I get the error
> 
> assignment mismatch: 2 variable but 1 values
> 
> for the assignment statement in Part 2 but the assignment statement in
> Part 1 compiles.  Both assignment statements have the same number of
> values, but it appears that referencing an integer in a structure
> field in the 2nd assignment statement, rather than a simple integer,
> confuses the compiler.
> ---
> 
> var a = map[int]int{
> 1: 2,
> }
> 
> var b = map[int]Word{
> 1: {2, 3},
> }
> 
> // Part 1
> num, ok := a[1]
> 
> // Part 2
> num, ok = b[1].code   // assignment mismatch: 2 variable but 1 values

To add to what others have said, look at the Go Language Specification
under Index expressions at https://golang.org/ref/spec#Index_expressions
just above the heading "Slice expressions".

It says that if a is a map, an assignment or initialization of the
special form «v, ok = a[x]» yields an additional untyped boolean.  In
Part 2 above, you are not assigning b[1] (which would work), but
b[1].code which does not match the special form whose purpose is to
allow the programmer to determine at runtime if the map contains the
given key.

...Marvin

-- 
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: proposal: Go 2: add untyped() type conversion for integer constants #31076

2019-03-29 Thread Michael Jones
Very helpful. Thank you. I will edit my proposal based on this.

On Thu, Mar 28, 2019 at 11:17 PM Jan Mercl <0xj...@gmail.com> wrote:

> The Compatibility section of the proposal says: "I think that this would
> break no existing code, as a user function invocation untyped(EXPR) is not
> at present allowed in constant specifications."
>
> It's true that user function cannot be called in a constant expression.
> But conversion to a user defined type is legal:
> https://play.golang.org/p/AXSFzMR677c
>
> IOW, the proposal is not backwards compatible.
>
> PS: Sorry for replying here. Still no other way available w/o a Github
> account.
>
> --
>
> -j
>
-- 

*Michael T. jonesmichael.jo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: Confusing Behavior When Compiling an Assignment Using a Map

2019-03-29 Thread Michel Levieux
Think of something like this https://play.golang.org/p/GyPlYefS7ZW (maybe
the example could be simpler) --> ok means we found the most nested value
or the least one?

Le ven. 29 mars 2019 à 16:55,  a écrit :

> Yes, that is expected. The right hand side of the assignment is
> `b[1].code`. That is a single value. The "magic" that allows a two value
> return from a map lookup does not carry through to more complex expressions
> that use the value from that lookup. It would get confusing really fast if
> it did.
>
> On Friday, March 29, 2019 at 11:16:03 AM UTC-4, jlfo...@berkeley.edu
> wrote:
>>
>>
>> go version go1.12 linux/amd64
>>
>> When compiling the example program below (
>> https://play.golang.org/p/koHORLMMuhK)
>> I get the error
>>
>> assignment mismatch: 2 variable but 1 values
>>
>> for the assignment statement in Part 2 but the assignment statement in
>> Part 1 compiles.
>> Both assignment statements have the same number of values, but it appears
>> that
>> referencing an integer in a structure field in the 2nd assignment
>> statement, rather than a simple
>> integer, confuses the compiler.
>>
>> I know I can work around this problem by breaking Part 2 into 2 assignment
>> statements, the first assigning a structure, and the second assigning the
>> structure field, but
>> I wonder if what I'm seeing is expected.
>>
>> Cordially,
>> Jon Forrest
>>
>> ---
>>
>> package main
>>
>> import "fmt"
>>
>> var a = map[int]int{
>> 1: 2,
>> }
>>
>> var b = map[int]Word{
>> 1: {2, 3},
>> }
>>
>> type Word struct {
>> codeint
>> scratch int
>> }
>>
>> func main() {
>> var num int
>>
>> // Part 1
>> num, ok := a[1]
>> if ok {
>> fmt.Println(num)
>> }
>>
>> // Part 2
>> num, ok = b[1].code   // assignment mismatch: 2 variable but 1
>> values
>> if ok {
>> fmt.Println(num)
>> }
>> }
>>
>>
>> --
> 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: Confusing Behavior When Compiling an Assignment Using a Map

2019-03-29 Thread jake6502
Yes, that is expected. The right hand side of the assignment is 
`b[1].code`. That is a single value. The "magic" that allows a two value 
return from a map lookup does not carry through to more complex expressions 
that use the value from that lookup. It would get confusing really fast if 
it did. 

On Friday, March 29, 2019 at 11:16:03 AM UTC-4, jlfo...@berkeley.edu wrote:
>
>
> go version go1.12 linux/amd64
>
> When compiling the example program below (
> https://play.golang.org/p/koHORLMMuhK)
> I get the error
>
> assignment mismatch: 2 variable but 1 values
>
> for the assignment statement in Part 2 but the assignment statement in 
> Part 1 compiles.
> Both assignment statements have the same number of values, but it appears 
> that
> referencing an integer in a structure field in the 2nd assignment 
> statement, rather than a simple
> integer, confuses the compiler.
>
> I know I can work around this problem by breaking Part 2 into 2 assignment
> statements, the first assigning a structure, and the second assigning the 
> structure field, but
> I wonder if what I'm seeing is expected.
>
> Cordially,
> Jon Forrest
>
> ---
>
> package main
>
> import "fmt"
>
> var a = map[int]int{
> 1: 2,
> }
>
> var b = map[int]Word{
> 1: {2, 3},
> }
>
> type Word struct {
> codeint
> scratch int
> }
>
> func main() {
> var num int
>
> // Part 1
> num, ok := a[1]
> if ok {
> fmt.Println(num)
> }
>
> // Part 2
> num, ok = b[1].code   // assignment mismatch: 2 variable but 1 
> values
> if ok {
> fmt.Println(num)
> }
> }
>
>
>

-- 
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] another attempt at desktop ui

2019-03-29 Thread jake6502
No mention of what platforms it supports. You may want to add that to the 
docs also. 

On Friday, March 29, 2019 at 5:46:29 AM UTC-4, Johann Freymuth wrote:
>
> Over the last few months I've tried to write a desktop GUI library that 
> takes a slightly different approach to traditional GUI libraries. It uses 
> ideas from immediate mode UI in order to be very lightweight and hopefully 
> somewhat idiomatic.
>
> https://github.com/jfreymuth/ui
>
> The API is now stable enough that I would like people to look at it and 
> provide feedback about the design and usability.
> I'm looking forward to hearing your opinions.
>
>

-- 
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] Confusing Behavior When Compiling an Assignment Using a Map

2019-03-29 Thread Jan Mercl
On Fri, Mar 29, 2019 at 4:16 PM  wrote:

> I wonder if what I'm seeing is expected.

It is. The language specification defines the selector to produce a single
value.


-- 

-j

-- 
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: [URGENT] Pass array of string between Go and C library

2019-03-29 Thread K.S. Bhaskar
You can see how the YottaDB (https://yottadb.com) Go wrapper does it. 
Documentation of the API is at 
https://docs.yottadb.com/MultiLangProgGuide/goprogram.html and source code 
is at https://gitlab.com/YottaDB/Lang/YDBGo

Regards
– Bhaskar

On Friday, March 29, 2019 at 5:16:05 AM UTC-4, Ashutosh Baghel wrote:
>
> Thanks let me check. Will update.
>
> On Friday, 29 March 2019 09:23:31 UTC+5:30, Justin Israel wrote:
>>
>>
>>
>> On Friday, March 29, 2019 at 11:08:06 AM UTC+13, Ashutosh Baghel wrote:
>>>
>>> Hi folks,
>>>
>>> I am new to Go-Programming and  having the following requirement, I need 
>>> to have Array of Strings,(for example names) at my 'Go Side' .
>>>
>>> But i would get this names from my C library API which i have included 
>>> in my Go program.
>>>
>>> Note: I have liberty to modify the C library too, i could control the 
>>> return type.
>>>
>>> Please help with this.
>>>
>>
>> Here is an example from one of my projects using cgo as a binding to a 
>> C++ library:
>>
>> C string array to Go
>> https://github.com/justinfx/openimageigo/blob/master/imagespec.go#L387
>>  
>> Go string slice to C
>> https://github.com/justinfx/openimageigo/blob/master/imagespec.go#L402
>>
>> There are other approaches besides this one. 
>>
>>
>>  
>>>
>>

-- 
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] Go: Ast: better view of initialization

2019-03-29 Thread Константин Изюмов

Hello, gophers.

My task: I have Go AST tree of next code:

https://play.golang.org/p/bKz3LGZyNtn
```
type s struct {
i int32
c byte
}

func main() {
var a []s = []s{s{1, 'a'}, s{2, 'b'}}
fmt.Println(a)
}
```

How to modify AST tree for better look struct initialization

https://play.golang.org/p/MH_hg_JoHN-
```
type s struct {
i int32
c byte
}

func main() {
var a []s = []s{
s{1, 'a'},
s{2, 'b'},
}
fmt.Println(a)
}
```

I will use that for project https://github.com/Konstantin8105/c4go

Thank you.

-- 
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: Vue-inspired library with Go+WebAssembly

2019-03-29 Thread Rusco
Congrats, I am sure a lot of gophers waited for something like this !
I especially like this comment:  "No node. No JS. No npm. No node_modules 
folder competing with your music library for disk space" 
😂


On Friday, 29 March 2019 04:39:42 UTC, Brad wrote:
>
> Now that WebAssembly is available as an (experimental) compilation target, 
> it raises the question of how feasible is it to make a quality UI library. 
> Vue (my personal fav) and React, while they have their issues, do have many 
> ideas which are good and seem like they may translate well over to 
> WebAssembly.
>
> Here's a working experimental Vue-like UI library with tools to write UI 
> components in .vugu files (similar in concept to .vue files): 
> https://github.com/vugu/vugu; Getting Started page: 
> http://www.vugu.org/doc/start
>
> HTML with logic in it gets code generated to .go files.  In-browser 
> rendering in wasm  with DOM sync as well as static HTML output are 
> implemented.
>
> And this is my cheesy bullet-pointed list that makes it sound a lot more 
> mature than it is:
>
> * Runs in-browser using WebAssembly
> * Single-file components
> * Vue-like markup syntax
> * Write idiomatic Go code
> * Rapid prototyping
> * ~3 minute setup
> * Standard Go build tools
>
> I'm curious what people think of the approach and ideas for improvement.
>
> --brad
>
>

-- 
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] [ANN] another attempt at desktop ui

2019-03-29 Thread Johann Freymuth
Over the last few months I've tried to write a desktop GUI library that 
takes a slightly different approach to traditional GUI libraries. It uses 
ideas from immediate mode UI in order to be very lightweight and hopefully 
somewhat idiomatic.

https://github.com/jfreymuth/ui

The API is now stable enough that I would like people to look at it and 
provide feedback about the design and usability.
I'm looking forward to hearing your opinions.

-- 
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: [URGENT] Pass array of string between Go and C library

2019-03-29 Thread Ashutosh Baghel
Thanks let me check. Will update.

On Friday, 29 March 2019 09:23:31 UTC+5:30, Justin Israel wrote:
>
>
>
> On Friday, March 29, 2019 at 11:08:06 AM UTC+13, Ashutosh Baghel wrote:
>>
>> Hi folks,
>>
>> I am new to Go-Programming and  having the following requirement, I need 
>> to have Array of Strings,(for example names) at my 'Go Side' .
>>
>> But i would get this names from my C library API which i have included in 
>> my Go program.
>>
>> Note: I have liberty to modify the C library too, i could control the 
>> return type.
>>
>> Please help with this.
>>
>
> Here is an example from one of my projects using cgo as a binding to a C++ 
> library:
>
> C string array to Go
> https://github.com/justinfx/openimageigo/blob/master/imagespec.go#L387
>  
> Go string slice to C
> https://github.com/justinfx/openimageigo/blob/master/imagespec.go#L402
>
> There are other approaches besides this one. 
>
>
>  
>>
>

-- 
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.