Re: [go-nuts] Is it possible to build a Go binary without the runtime ?

2024-01-23 Thread Raffaele Sena
with goobj files, a somewhat obscure internal format of the > compiler, rather than a more typical object file format. > > Raffaele Sena: > > Well, if it's a package/module you could build it as a library archive > > (go build -buildmode=archive) and then disassemble/decompile the libr

Re: [go-nuts] Is it possible to build a Go binary without the runtime ?

2024-01-23 Thread Raffaele Sena
Well, if it's a package/module you could build it as a library archive (go build -buildmode=archive) and then disassemble/decompile the library. On Tue, Jan 23, 2024 at 3:18 PM Def Ceb wrote: > No, this is not possible. This is the case for practically every other > language, even C. Unless

Re: [go-nuts] a simple linux audio player pkg?

2023-11-22 Thread Raffaele Sena
I have used github.com/jfreymuth/oggvorbis to read the ogg file (and convert to PCM) and github.com/ebitengine/oto/v3 to play the PCM. I don't know of a full ogg player in Go On Wed, Nov 22, 2023 at 2:02 PM 'Mark' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Is there a simple

Re: [go-nuts] when doing a WalkDir of a FileSystem, how do you get access to the path that you are working on

2023-01-14 Thread Raffaele Sena
The function you implement (WalkDirFunc should receive "p" as the path to the parent (that seems to be what you want) and "d" as the current directory entry. I am not sure why in your example you are showing full paths to the file for "p". On Sat, Jan 14, 2023 at 3:39 PM Pat Farrell wrote: >

Re: [go-nuts] WebAssembly and Filesystem access

2022-12-16 Thread Raffaele Sena
tinygo now has a "wasi" target that you can try. On Fri, Dec 16, 2022 at 2:10 PM 'Kevin Chowski' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I recently learned that WASI ( > https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-intro.md) > supports filesystem

Re: [go-nuts] [CGO] How can I convert GoString to wchar_t?

2020-09-26 Thread Raffaele Sena
wchar_t is a 16 bits value representing a UTF16 character so you could convert Go strings to and from UTF16 using the unicode/utf16 package. On Sat, Sep 26, 2020 at 11:39 AM Sean wrote: > Hi gophers, > > I'm trying to write the Golang wrapper for a dll with CGO. > > A wrapper that will only

Re: [go-nuts] hook into os.Stdout / os.Stderr

2020-09-19 Thread Raffaele Sena
You can create your own writer and overwrite os.Stdout/Stderr (just supply your own write method with the appropriate before/after hooks) Sent from my iPhone > On Sep 19, 2020, at 12:38 PM, Alexander Mills > wrote: > > Forgive me for this pigeon code, I am looking to do something like: > >

Re: [go-nuts] Re: How to print arrays with commas and brackets

2020-08-06 Thread Raffaele Sena
One option is to use json.Marshal or json.Encoder.Encode fmt.Printf("%q", []string{"Hello", "world", "!") would quote the separate strings and put the square brackets, but doesn't comma separate the items. On Thu, Aug 6, 2020 at 9:24 AM wrote: > Hello Michele > > This won't print in the array

Re: [go-nuts] Equivalent of os.Args but on custom input

2020-04-20 Thread Raffaele Sena
I do something similar for some of my interactive tools and ended up writing this: https://github.com/gobs/args. If interested the command parser is here: https://github.com/gobs/cmd. -- Raffaele On Mon, Apr 20, 2020 at 10:23 AM Kurtis Rader wrote: > > os.Args simply exposes the arguments

Re: [go-nuts] Golang on UnixWare

2020-01-27 Thread Raffaele Sena
There are instructions on how to bootstrap the toolchain in here: https://golang.org/doc/install/source Look for "Bootstrap toolchain". -- Raffaele On Mon, Jan 27, 2020 at 4:20 PM Eric Raymond wrote: > > I've received a feeler about a most interesting reposurgeon-related > consulting

Re: [go-nuts] Re: Go 2 generics counterproposal: giving up restricting types

2019-05-30 Thread Raffaele Sena
Completely agree about "Generics are useful except when their syntax becomes cryptic". But reading this proposal (quickly, while doing a bunch of other stuff :), the syntax is very clean and the proposal is very well thought. On Thu, May 30, 2019 at 10:44 AM Michal Strba wrote: > I agree with

Re: [go-nuts] [ANN] Gio: portable immediate mode GUI programs in Go for iOS/tvOS, Android, macOS, Linux, Windows

2019-03-31 Thread Raffaele Sena
While I do find it odd that this project doesn't use github, because github requires an account, but SourceHut currently also requires to sign up for an account to submit issues or to submit to the mailing list, I don't think the fact that the demo asks for a GitHub token is really "nefarious".

Re: [go-nuts] Re: Starlight - run python inside Go to extend your applications - easily

2018-12-10 Thread Raffaele Sena
If you want a full python interpreter, you should look at https://github.com/go-python/gpython, but gpython also doesn't have a full standard library implemented. -- Raffaele On Mon, Dec 10, 2018 at 1:58 AM Justin Israel wrote: > > > On Mon, Dec 10, 2018, 9:39 PM wrote: > >> >> >> On Friday,

[go-nuts] [ANN] pygor: yet another Python to Go regurgitator

2018-10-19 Thread Raffaele Sena
Inspired by ESR pytogo (and tired of writing python code), I went the complete opposite way and came up with pygor: https://github.com/raff/pygor pygor is written in Go, using the Python parser and AST from https://github.com/go-python/gpython (so right now it only targets Python 3.4). The

Re: [go-nuts] Strange behavior of range over composite literal.

2018-10-08 Thread Raffaele Sena
Thanks for the answers. I tried to read the specs, but didn't go as far as the parsing ambiguity section :( -- Raffaele On Mon, Oct 8, 2018 at 12:20 PM Ian Lance Taylor wrote: > On Mon, Oct 8, 2018 at 12:10 PM, Raffaele Sena wrote: > > > > I found a strange behavior (wel

[go-nuts] Strange behavior of range over composite literal.

2018-10-08 Thread Raffaele Sena
I found a strange behavior (well, I would call it a bug) of for-range over a composite literal where the literal type is a user type (or alias). This is true for both maps and array/slices, but the following example is with a slice. My guess is that at the compiler level the for-range statement

Re: [go-nuts] Announcing pytogo. a crude but surprisingly effective Python to Go translator

2018-10-04 Thread Raffaele Sena
I also, for this kind of things that seems to be coming out once in a while, tend to start from AST and a "pretty printer". This has limitations since AST doesn't give you type informations (not that it matters much for Python) but it's good for a "first pass" of translation. Here is my latest

Re: [go-nuts] Bizarre Error Message (Go 1.9.2)

2017-11-02 Thread Raffaele Sena
Or you use the "standard" unix trick: go run ls.go -- ls.go On Thu, Nov 2, 2017 at 1:55 PM, Ian Lance Taylor wrote: > On Thu, Nov 2, 2017 at 10:37 AM, Jon Forrest wrote: > > > > I'm learning Go. Whenever I learn a new programming language I like to > try >

Re: [go-nuts] Go -> C++ transpiler idea: Miracle child or horrible abomination?

2017-03-24 Thread Raffaele Sena
go get github.com/raff/walkngo If you use --lang=c it will actually generate c++ code. It's not perfect but it does the bulk of the conversion. Unfortunately working with only the ast has it's limits (and I wrote this before the ssa stuff was available) -- Raffaele > On Mar 24, 2017, at

[go-nuts] [ANN] Go client for Chrome devtools

2017-03-17 Thread Raffaele Sena
Now that headless support for Chrome is becoming available I decided I am fed-up trying to deal with phantomjs and related problems. And because I love Go and didn't see an available client, I decided to build my own: https://github.com/raff/godet Still in the early stages (a week old ?), but

Re: [go-nuts] create dmg

2016-07-30 Thread Raffaele Sena
This uses some python modules, that should be ok if you are building your installer on a mac: http://dmgbuild.readthedocs.io/en/latest/ On Sat, Jul 30, 2016 at 4:00 PM, Joe Blue wrote: > recommended way for a gopher to make a dmg, so my users can install my > golang app ?