[go-nuts] using interface{} values in C/C++ bindings

2024-04-08 Thread Carl-Philip Hänsch
Hi, I am currently developing a JITable interpreter for a scripting language where users can define user-defined functions with the signature func (...interface{}) interface{} that can interoperate with the scripts. interface{} can be bool, int, string, []interface{} or another func(...interfa

[go-nuts] Go JIT

2024-04-08 Thread Carl-Philip Hänsch
Hi, I saw in go's source code that all methods and data structures regarding parsers, the IR and so on are private. Is there a way to import go's parser and compiler as a library and start compiling .go files, building IR code at runtime and finally (with some implementation effort) JITing the

Re: [go-nuts] Re: Why can't a regexp.Regexp be const

2023-02-14 Thread Philip Stein
Related to this, couldn't it also be made case insensitive to simplify it? https://go.dev/play/p/5qJTAcmkowg On Tue, Feb 14, 2023, 1:51 p.m. Rob Pike wrote: > I suggest two changes. > > First, always use backquotes `` around regular expressions to avoid > misunderstandings should a backslash occ

Re: [go-nuts] go build hangs with 1.15.7 on Windows 10

2021-02-01 Thread Philip Stein
It turns out that you were right. Despite my antivirus not logging anything, and the directories and executables being allowed, they were blocked. An antivirus update seems to have resolved it. On Tue., Jan. 26, 2021, 3:28 a.m. Wojciech S. Czarnecki, wrote: > Dnia 2021-01-25, o godz. 11:07:50 >

Re: [go-nuts] go build hangs with 1.15.7 on Windows 10

2021-01-26 Thread Philip Stein
It was a good suggestion, but unfortunately my AV doesn't show anything in it's logs, and I already had the executables allowed. On Tue., Jan. 26, 2021, 3:28 a.m. Wojciech S. Czarnecki, wrote: > Dnia 2021-01-25, o godz. 11:07:50 > "pst...@gmail.com" napisał(a): > > > I just upgraded to 1.15.7 f

Re: [go-nuts] Re: go build hangs with 1.15.7 on Windows 10

2021-01-25 Thread Philip Stein
I'm using the native windows CMD. On Mon, 25 Jan 2021 at 19:34, bnix...@gmail.com wrote: > Are you performing the build in native windows CMD/PowerShelll or in WSL? > > On Monday, January 25, 2021 at 1:07:50 PM UTC-6 pst...@gmail.com wrote: > >> Hello, >> I just upgraded to 1.15.7 from 1.13, and

[go-nuts] Go and AI Recommendations

2020-12-27 Thread Philip Chapman
I am an experienced developer and fairly knowledgeable in Go, but new to AI and machine learning. I'd like to expand my skillset in that direction. I would be happy for and recommendations and advice on good material for learning AI and machine learning with Go. Most of the material out there seem

Re: [go-nuts] Re: Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-09-11 Thread Philip Chapman
There is a gtk binding, but I'm not sure if it's fully cross platform. https://github.com/gotk3/gotk3 On Fri, Sep 11, 2020, 6:26 PM Kent Sandvik wrote: > I tested fyne on my Mac, hey didn't crash, that's a big plus with these > cross-platform GUI frameworks. The Look&Feel is somewhat different

Re: [go-nuts] Is it possible to build Linux executables on Windows with lxn/walk?

2020-04-08 Thread Philip Chapman
thers. I've not tried it though, so your mileage may vary. On Wed, Apr 8, 2020 at 7:27 AM Kevin Chadwick wrote: > On 2020-04-08 12:00, Philip Chapman wrote: > > I personally like Wails. Here is a breakdown of some of the options so > that you > > can resear

Re: [go-nuts] Is it possible to build Linux executables on Windows with lxn/walk?

2020-04-08 Thread Philip Chapman
roup 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/f6edf972-3f86-6eee-cc92-3568970ed8ef%40gmail.com > . > -- Philip A. Chapman Java Software

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-03-04 Thread Philip Boampong
On Wed, Mar 4, 2020 at 4:09 PM Ian Lance Taylor wrote: > > The links that I looked at were speculating about behavior, not > demonstrating real behavior in kernels. I don't know how to judge > whether those speculations about hypothetical behavior are correct or > not. Many things are hypothetic

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-03-04 Thread Philip Boampong
Thanks for the feedback. > "If the close operation fails to close fildes2, dup2() shall return -1 > without changing the open file description to which fildes2 refers." > "If close() is interrupted by a signal that is to be caught, it shall return > -1 with errno set to [EINTR] and the state of

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-03-04 Thread Philip Boampong
On Sun, Mar 1, 2020 at 3:55 PM Ian Lance Taylor wrote: > > If dup2 can 1) close newfd; 2) receive a signal before duping oldfd to > newfd; 3) return EINTR leaving newfd closed, then dup2 requires > considerable care in any multi-threaded program. It requires that if > one thread is calling dup2,

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-02-29 Thread Philip Boampong
On Sun, Mar 1, 2020 at 3:06 AM Ian Lance Taylor wrote: > > > But if you opened newfd yourself, or if it is 0/1/2 and you never > > closed os.Std*, then you *can* dup2 safely, regardless of other > > packages. > > Those are examples where you are in charge of the FD namespace > (assuming you know t

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-02-29 Thread Philip Boampong
> If you are getting an error nothing has happened, no replacement of newfd and > no close I wish that sentence was written on the man page. That was the way I first understood it too (and it makes more sense) but the little information I found disagree (libuv [1], python [2] (see the note about

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-02-29 Thread Philip Boampong
On Sat, Feb 29, 2020 at 9:13 PM Brian Candler wrote: > > I don't quite follow. If two threads are fighting to use the target fd, then > that's just a race anyway. One case is when you have full control of the FD namespace, then you can rely on your own synchronization and do whatever you want,

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-02-29 Thread Philip Boampong
On Sat, Feb 29, 2020 at 4:35 PM Uli Kunitz wrote: > > My reading of the Linux kernel sources (5.3) is that dup2 will never return > -EINTR. Thanks, good to know. > But you will have to program the loop around the syscall anyway, because > Linux may return EBUSY, which happens if the new fd has

Re: [go-nuts] Re: How to handle EINTR from syscall.Dup2

2020-02-29 Thread Philip Boampong
On Sat, Feb 29, 2020 at 3:41 PM Manlio Perillo wrote: > > What about using fcntl with F_DUPFD? > [...] > It does not have the problems of dup2 where you can use an already in use fd, > and unlike dup you can specify where the new fd should be allocated. Thanks, good to know and may come in handy

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-02-29 Thread Philip Boampong
On Sat, Feb 29, 2020 at 1:34 PM Ian Lance Taylor wrote: > > It does not make sense to use dup2 if you are not in control of the FD > namespace. In order to use dup2 you need to specify the new FD. If > that FD might be concurrently opened by some other package, or by the > runtime, then you can

Re: [go-nuts] How to handle EINTR from syscall.Dup2

2020-02-28 Thread Philip Boampong
Thanks for the reply. > Note that dup2() can only fail with EINTR if the new fd is currently open on > a "slow" device and the implicit close() fails due to being interrupted. I understand the condition may be rare, but I still want to know the correct way to handle it. > In my experience it is

Re: [go-nuts] Re: Experience report on a large Python-to-Go translation

2020-01-27 Thread Philip Boampong
> > log.Fatal and os.Exit have the same problem. They are not "terminating > > statements", so if you want them at the bottom of a function with result > > parameters you have to add a panic("unreachable"). > > Excellent point. But contemplating being able to declare library functions > termina

Re: [go-nuts] Ignoring errors from os.File.Close

2020-01-12 Thread Philip Boampong
On Mon, Jan 13, 2020 at 3:07 AM Ian Lance Taylor wrote: > The difference between os.Stdout and other files is: if writing to > os.Stdout fails, where are you going to report the error? You could > report it to os.Stderr, of course, but if os.Stdout doesn't work then > it is very likely that os.S

Re: [go-nuts] Http header and CR LF

2019-05-29 Thread Philip Chapman
t;https://groups.google.com/d/msgid/golang-nuts/e3ea401d-d40a-4535-8d8c-bec9c539a1c9%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Philip A. Chapman Java Software Development Enterprise, Web, and

Re: [go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread Philip Chapman
ot;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. > -- Philip A. Chapman Java Software Development Enterpris

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-14 Thread Philip Nelson
You can't copy from outside the context but you can volume mount it. In my docker-compose.yml I have the following for a golang:1.11-alpine image derivative: ``` volumes: - ${GOPATH}:/go ``` Phil I `RUN go mod download` before copying my source On Monday, January 14, 2019 at 8:49:05

Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Philip Chapman
I hope that the compiler bug will not manifest itself there. > > -- > 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+

Re: [go-nuts] go 1 on Ubuntu 18.04

2018-05-05 Thread Philip Chapman
essage 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] best practices for gccgo and external packages

2018-04-24 Thread Philip Brown
On Tuesday, April 24, 2018 at 6:56:21 AM UTC-7, Ian Lance Taylor wrote: > > > Sorry, you're quite right. I completely forgot that > -buildmode=archive is the default for a non-main package. > > Okay, so just to close the loop on information sharing, I think you are saying that -buildmode=arch

Re: [go-nuts] best practices for gccgo and external packages

2018-04-23 Thread Philip Brown
On Mon, Apr 23, 2018 at 9:23 PM, Ian Lance Taylor wrote: > > > There is no -buildmode=archive. Using -buildmode=c-archive should > work if that is what you want to do. > ORLLY? :-} $ go help buildmode The 'go build' and 'go install' commands take a -buildmode argument which indicates which kind

[go-nuts] best practices for gccgo and external packages

2018-04-23 Thread Philip Brown
the docs at https://golang.org/doc/install/gccgo seem to mention how to use packages for your own code, but dont mention how to use third party packages. In other words, in situations where you would normally do go get github.org/blah/somepackage What should you do for gccgo, once you have do

Re: [go-nuts] Re: Implementing JDBC Driver

2018-04-14 Thread Philip Chapman
e. >> >> Ken >> > -- > 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. >

[go-nuts] golang.org/x/crypto/ssh hangs when connecting to some servers

2017-08-11 Thread Philip Stein
Hello, I'm working on a utility that uses the golang.org/x/crypto/ssh library to connect to about 100 servers. Most of the connections work fine, but there are 6 servers where the connection hangs during the ssh.Dial. Using delve, I've been able to track it down to clientAuthenticate in client_a

[go-nuts] Re: Which Go client for ElasticSearch?

2017-05-30 Thread Philip Pearl
Hi, I'm afraid I just followed the elastic search reference docs. I don't know if any tutorials Phil On Tue, 30 May 2017, 04:52 , wrote: > Hello Philip, > I searched quite a lot for any tutorials on how to write directly to the > http API but couldn't find tutorials

Re: [go-nuts] Looking for a SQLite statement parser

2017-01-31 Thread Philip O'Toole
Great -- thanks for the reference, I'll take a look. Philip On Tue, Jan 31, 2017 at 10:02 AM, Vasiliy Tolstov wrote: > cznic/ql have own lexer for SQL and it syntax very similar. > > 31 Янв 2017 г. 16:33 пользователь написал: > >> Hello, >> >> I am the cr

[go-nuts] Looking for a SQLite statement parser

2017-01-31 Thread philip
uting, and send the statements to the right endpoint. I'd really like rqlite to just do the right thing, and determine this automatically. Hence my idea to parse the SQLite command, create an AST, and work it out. Or perhaps there is another way of thinking about this? Thanks, Philip -- Yo

Re: [go-nuts] Re: Go 1.8 Release Candidate 1 is released

2017-01-11 Thread Philip Silva
Super awesome, cheers for mips32! Am Mittwoch, 11. Januar 2017 11:22:45 UTC+1 schrieb Michel Casabianca: > > Hello Gophers, > > I have updated my list of Go interfaces at: > > http://sweetohm.net/article/go-interfaces.en.html > > Enjoy! > > 2017-01-11 1:43 GMT+01:00 João Henrique Machado Silva >: