[go-nuts] [ANN] Hackers Delight in Go

2024-06-14 Thread Nikolay Dubina
*What?*

https://github.com/nikolaydubina/go-hackers-delight

This is showcase of all code in famous "Hackers Delight" book in Go.

Code is tested, fuzzed, and benchmarked.

Best read through: 
https://pkg.go.dev/github.com/nikolaydubina/go-hackers-delight that shows 
interactive examples

*Who may find this useful?*

   - readers of Hackers Delight
   - researchers of low level optimisations
   - compiler designers
   - students of programming courses

Cheers!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b24b3f3d-b22e-4281-b577-6c1449da2b78n%40googlegroups.com.


[go-nuts] [ANN] extending json tags to variables and enum encoding generator

2024-03-27 Thread Nikolay Dubina
*What?*

https://github.com/nikolaydubina/go-enum-encoding

```go
type Color struct{ c uint8 } 

//go:generate go-enum-encoding -type=Color 
var (
UndefinedColor = Color{}// json:"-" 
Red  = Color{1}  // json:"red" 
Green  = Color{2}  // json:"green" 
Blue = Color{3}  // json:"blue"
)
```

This tool extends json tag notation to variables and generates JSON 
encoding/decoding boilerplate.

*More Details*

To generate boilerplate JSON encoding/decoding blocks.

This is very lightweight solution of <100 LOC single-file with 100% test 
coverage. It even generates tests for generated code as well.

I really liked this syntax, so would like to share to others. Cheers!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/561640bd-e00d-4db6-8a4a-898f026ca946n%40googlegroups.com.


[go-nuts] [ANN] 2023 update to go-recipes collection

2023-12-11 Thread Nikolay Dubina
https://github.com/nikolaydubina/go-recipes

Final 2023 update to this collection of tools for Go ecosystem.

Now it contains 179 entries, 16 new since last release. New entries are 
marked with .

Hope you find useful! Cheers! Happy holidays everyone!

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7fcff7ad-7fe8-43c6-b76b-bfdb6ab2f971n%40googlegroups.com.


[go-nuts] [ANN] annual update to go-recipes collection of Go ecosystem tools for 2023

2023-06-09 Thread Nikolay Dubina
Hi,

I released another big annual update to collection of Go tools:

https://github.com/nikolaydubina/go-recipes

Hope you find lots of useful and/or entertaining entries !

Cheers,

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ccbf07fe-e0a2-4399-bd18-ec2fefda2dcfn%40googlegroups.com.


[go-nuts] [ANN] new linter for "mixed pointer and value receivers"

2022-12-01 Thread Nikolay Dubina
*what?*

New go vet compatible linter that detects mixing pointer and value method 
receivers for the same type.

https://github.com/nikolaydubina/smrcptr

*why?*

It is recommended in Go wiki and in Google Go style guide. It is very 
common principle to keep code clean in practice and code reviews. Yet, 
there is no open source linter for this.

Thank you! ‍♂️

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/233f0dbb-4bb8-4479-a46f-63cd8b4dd691n%40googlegroups.com.


Re: [go-nuts] [ANN] Tool for automatic instrumentation of OpenTelemetry

2022-11-10 Thread Nikolay Dubina
Thank you!

tbh, I am a bit audacious by taking `//go:instrument`. But I think if 
official Go toolchain starts to use `//go:instrument` or more people raise 
concerns, I would definitely switch to something different.

Taking a note on your feedback. Will monitor for more comments about this.

-- Nikolay

On Friday, November 11, 2022 at 12:19:02 AM UTC+8 se...@liao.dev wrote:

> Interesting
>
> As a note, directive comments should be of the form 
> `//toolname:directive`, meaning the `//go:` prefix should be reserved for 
> the `go` toolchain itself.
>
> - sean
>
>
> On Thu, Nov 10, 2022 at 4:07 PM Nikolay Dubina  
> wrote:
>
>> *What?*
>>
>> Tool for automatic instrumentation of OpenTelemetry Traces of all 
>> functions and methods.
>>
>> https://github.com/nikolaydubina/go-instrument
>>
>> *Why?*
>>
>> It is laborious to add tracing code to every function manually. The code 
>> repeats 99% of time. Other languages can either modify code or have wrapper 
>> notations that makes even manual tracing much less laborious. As of 
>> 2022-11-06, official Go does not support automatic function traces. 
>> https://go.dev/doc/diagnostics. Thus, created a tool to automatically 
>> add Spans.
>>
>> *Thank you!*
>>
>> -- Nikolay
>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/0323b8d0-c1cc-47e9-9b32-82fecb4d9f66n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/0323b8d0-c1cc-47e9-9b32-82fecb4d9f66n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4a313875-8604-41f8-9e17-99eea96e5d08n%40googlegroups.com.


[go-nuts] [ANN] Tool for automatic instrumentation of OpenTelemetry

2022-11-10 Thread Nikolay Dubina
*What?*

Tool for automatic instrumentation of OpenTelemetry Traces of all functions 
and methods.

https://github.com/nikolaydubina/go-instrument

*Why?*

It is laborious to add tracing code to every function manually. The code 
repeats 99% of time. Other languages can either modify code or have wrapper 
notations that makes even manual tracing much less laborious. As of 
2022-11-06, official Go does not support automatic function traces. 
https://go.dev/doc/diagnostics. Thus, created a tool to automatically add 
Spans.

*Thank you!*

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0323b8d0-c1cc-47e9-9b32-82fecb4d9f66n%40googlegroups.com.


[go-nuts] [ANN] https://go-cover-treemap.io

2022-04-30 Thread Nikolay Dubina

*What?*

Online tool to generate treemaps for coverprofiles.

https://go-cover-treemap.io

*Why?*

It is much more convenient to drag and drop cover profile and adjust 
interactively window size and slider rather than CLI. Hope, this will make 
more Go engineers more often visualize their cover profiles.



*Is this private?*Yes. Your file is not uploaded. Everything runs in 
browser WebAssembly. This tool can work offline.

Code 
* https://github.com/nikolaydubina/go-cover-treemap-web
* https://github.com/nikolaydubina/go-cover-treemap



*Hope this is useful!*Cheers!

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3fbc8cae-64f8-4cb4-afc5-4b641722882fn%40googlegroups.com.


[go-nuts] Strange symbol size in symtab

2022-03-10 Thread Nikolay Dubina
Hello,

I am getting strange byte sizes for Undefined symbols in symtabs.

How to reproduce:
1. build and go binary (e.g. https://github.com/gohugoio/hugo)
2. make symbtab file (go tool nm -size )

In file you will see entries like this
```
 4294971392 U _symlink
 4294971392 U _sysconf
 4294971392 U _sysctl
 4294971392 U _sysctlbyname
 4294971392 U _unlink
 4294971392 U _unlinkat
 4294971392 U _unsetenv
 4294971392 U _usleep
 4294971392 U _utimes
 4294971392 U _wait4
 4294971392 U _write
```

What is strange here:
- 4294971392 is number of bytes per documentation: https://pkg.go.dev/cmd/nm
- this is around 4GB
- binary of hugo is much smaller 62MB
- the size of symbol has to be different, but it is same for all these 
undefined symbols.

Would be nice if anyone seen this problem or tells me what is happening 
here.

I am also planning to dig dipper into go core, but would like to check with 
you guys first.

Thank you and hope everyone is doing well,

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fa9aa8e9-bc23-416c-8c3e-9604b31f25cfn%40googlegroups.com.


[go-nuts] [ANN] Make treemap visualization of Go executalbe binary

2022-01-25 Thread Nikolay Dubina
*What?*

https://github.com/nikolaydubina/go-binsize-treemap

CLI tool to make treemaps of size of Go executable. This was inspired by 
prior work of Cockroach labs. Now that we have some tooling in Go that can 
do treemap visualization, I decided to improve that tool from Cockroach 
team (Python/JS/D3.js -> pure Go + tests). Some features are missing. The 
tool is experimental. Before diving into it, I would like to know if there 
is enough interested and utility in it.

*Audience*

Anyone who studies Go, compilers, does cgo, large projects, or C/C++ a lot. 
Educational purposes mostly.

Cheers!

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/089fa0d3-6904-4d5a-8fa6-40dccd5adfbcn%40googlegroups.com.


[go-nuts] [ANN] Convert coverprofile to SVG heatmap

2021-12-07 Thread Nikolay Dubina
*What?*

https://github.com/nikolaydubina/go-cover-treemap

CLI to convert coverprofiles to nice looking SVG heatmaps

*Why?*

Useful for large projects with lots of files and sub packages.
Useful if you can not (say due to legal or security) to use tools like 
Codacy or codecov.io.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/dbe148b9-3e09-4be9-8728-6038c318763bn%40googlegroups.com.


[go-nuts] Go and GPUs

2021-06-25 Thread Nikolay Dubina
I tried to write down my own CUDA / NVIDIA GPU driver in native Go last 
weekend. To my great surprise, CUDA and pretty much all high performance 
software/hardware from NVIDIA is proprietary close-source C/C++ code. 
Meaning, you can't write native Go driver even if you wanted to. Forget Go, 
people are trying to reverse engineer it in C/C++ with limited success. 
>From what I heard OpenCV is not a priority for NVIDIA either. Then I looked 
up what Apple is doing with their Neural Engine in latest chips. It too is 
closed-source Objective-C, Swift. I suspect situation with other powerful 
hardware is the same. Moore's law seem to be about GPU lately, and everyone 
is locking it in. Kind of not in the spirit open-source and Linux. That's 
quite bad state of affairs for Go and computing in general. Yikes!

Just want to see what others are thinking.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0913f098-700a-443f-bd02-2db7ad2408a6n%40googlegroups.com.


[go-nuts] Re: embedding files in tests

2021-06-01 Thread Nikolay Dubina
I think the question is about `go:embed` directive in `_test.go` files will 
be included in builds of non-test packages, right?

Don't know for sure, but I think:
- a) if you have `mypkg_test.go` and in it `package mypkg_test` then 
`go:embed` will not get to your non test build as the package is different
- b) if you have `mypkg_test.go` and in it `pakcage mypkg` then... less 
clear. As above referenced in original docs `_test.go` will be excluded 
from non test build regardless of package.

My personal take, is to go:embed only in case a).

Cheers,
On Wednesday, June 2, 2021 at 8:09:20 AM UTC+8 peterGo wrote:

> On Tuesday, June 1, 2021 at 9:17:11 AM UTC-4 manlio@gmail.com wrote:
>
>> When a file is embedded in a test file, will the file be embedded only in 
>> the test binary?
>> The documentation says nothing about this case, but the data from go list 
>> seems to confirm that the file is only embedded in the test binary.
>>
>> Thanks
>> Manlio
>>
>
> The documentation seems clear to me.
>
> Package testing
> https://golang.org/pkg/testing/
>
> To write a new test suite, create a file whose name ends _test.go that 
> contains the TestXxx functions as described here. Put the file in the same 
> package as the one being tested. The file will be excluded from regular 
> package builds but will be included when the "go test" command is run. 
>
> Peter
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/de6c4d87-abf4-4ecc-bf99-63a5e24a1f8fn%40googlegroups.com.


[go-nuts] [ANN] Benchmarking Machine Learning Inference

2021-02-18 Thread Nikolay Dubina
https://github.com/nikolaydubina/go-ml-benchmarks

*What is it?*

Benchmarks of latency on how different ways to get tabular machine learning 
models (XGBoost) work with typical Go scenario.

*Who is audience?*

This might be useful to folks who are calling machine learning services in 
their Go code. I was curious myself for a while how different methods 
perform (e.g. would CGo be faster than C++ with Unix Sockets? 樂). This is 
just one of the data points in making decision on how to implement it in 
your system. Hopefully it will be interesting and useful to you!

Thank you! Have a good weekend ahead everyone!

-- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a82b2097-ac79-4c49-90e8-1c35a42c1fd5n%40googlegroups.com.


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

2021-01-28 Thread Nikolay Dubina
This is great! Thank you!

On Thursday, January 28, 2021 at 11:27:49 PM UTC+8 Alex Rakoczy wrote:

> Hello gophers,
>
> We have just released go1.16rc1, a release candidate version of Go 1.16.
> It is cut from release-branch.go1.16 at the revision tagged go1.16rc1.
>
> Please try your production load tests and unit tests with the new version.
> Your help testing these pre-release versions is invaluable.
>
> Report any problems using the issue tracker:
> https://golang.org/issue/new
>
> If you have Go installed already, the easiest way to try go1.16rc1
> is by using the go command:
> $ go get golang.org/dl/go1.16rc1
> $ go1.16rc1 download
>
> You can download binary and source distributions from the usual place:
> https://golang.org/dl/#go1.16rc1
>
> To find out what has changed in Go 1.16, read the draft release notes:
> https://tip.golang.org/doc/go1.16
>
> Cheers,
> The Go Team
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f9f74c2a-cd27-4371-9f0f-b1f653a71cean%40googlegroups.com.


[go-nuts] Re: What's the status/roadmap of geo/s2 library?

2021-01-26 Thread Nikolay Dubina
Maybe you would need to tag or cc maintainers of that module.

If this not not implemented, looks like you would be a great person to 
submit fix/improvement since you directly work with this. If it takes too 
long to accept your PR, might be reasonable as a last resort to make a 
fork, if you are willing to support it.

IMHO, deprecated modules in Go are rampant. Whenever I look, I see 
partially implemented, archived, deprecated, updated years ago, modules. I 
even have doubts about work which is happening on Go compiler itself. Not 
sure what to do about it. Hope Go community and official Go maintainers are 
aware of this and working to improve this.

- Nikolay

On Wednesday, January 27, 2021 at 2:23:09 AM UTC+8 Piotr Wieczorek wrote:

> Hi,
> I love golang seo s2 library, but one thing that's a bit annoying to me is 
> the fact that documentation (type/method comments) often refer to 
> functionality that's not implemented.
> For example, there is the CellIndex type, documentation of which suggests 
> using method IntersectingLabels or ClosestCellQuery none of which seem to 
> be implemented.
> In fact, I don't know if the CellIndex can be queried at all, as there are 
> no Query types that reference it.
> I was trying to find any open issues or a roadmap that could tell me if 
> someone is working on finishing this functionality, but I could find none.
> I could try to take stab at implementing it (although I don't think, I'm 
> smart enough or have enough domain knowledge), but maybe someone's already 
> working on it.
>
> I'd love if someone could share this information. :)
>
> Best,
> Piotr
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4a91c0d1-b72f-4815-ba16-62fb6f7f775an%40googlegroups.com.


[go-nuts] [ANN] go-featureprocessing v1.0.0

2021-01-15 Thread Nikolay Dubina
*What is this?*

Fast feature preprocessing in Go with feature parity to sklearn

https://github.com/nikolaydubina/go-featureprocessing

*What is new?*

   - Added batch processing
   - Added inplace processing 
   - Added parallel processing
   - Made all inference code to have zero memory allocations
   - Added sklearn Python comparison benchmarks
   - Did a lot of benchmarking
   - Cleaned up API
   - Cleaned up generated code a bit
   - Made more realistic generated tests
   - Made more realistic benchmarks
   - Improved documentation

Thanks! 

- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/899a8eec-2c54-4940-a476-03040fb54a12n%40googlegroups.com.


[go-nuts] Re: Advice, please

2021-01-13 Thread Nikolay Dubina
Any primitive in `sync` package will do. I would go for two `RWMutex` each 
for each goroutine, or two unbuffered channels for each gorouitne. However, 
AFAIK, in Go you can't force start execution of a goroutine. Go will try to 
wake up any unblocked goroutine as soon as possible though.
On Thursday, January 14, 2021 at 8:57:56 AM UTC+8 Peter Wilson wrote:

> Folks
> I have code in C which implements a form of discrete event simulator, but 
> optimised for a clocked system in which most objects accept input on the 
> positive edge of a simulated clock, do their appropriate internal 
> computations, and store the result internally. On the negative edge of the 
> clock, they each take their stored internal state and 'send' it on to the 
> appropriate destination object
>
> This is modelled using a linked list of objects, each of which has a 
> phase0 and phase1 function, and traversing the list twice per clock, 
> calling the appropriate function.
>
> It all works fine. On a uniprocessor. If we have one processor object and 
> one memory object, with the processor implementing a standard instruction 
> fetch decode implement interpreted loop, and playing with simulated caches, 
> reading or writing on cache misses, we can get 20-30 MIPS on a Mac Mini. 
>
> So since (much!) more performance is wanted, implementing this for a 
> multiprocessor seems a good idea. Especially since every computer and its 
> dog is multicore. Using go rather than C also sounds like a good idea.
>
> So  the sketch of the go implementation is that I would have three threads 
> - main, t0, and t1. (more for a real system, but two suffices for 
> explanation)
> - main sets stuff up, and t0 and t1 do the simulation work
> - main has to initialise, set up any needed synchronization mechanism, and 
> start t0 and t1
> - t0 and t1 wait until main says its ok, then both traverse all objects in 
> the list. t0 runs the function if it's an even numbered object, and t1 if 
> it's an odd-numbered. No mutation of state by concurrent threads.
> - main loops, as do t0 and t1; t0 and t1 signal that they've finished; 
> when they have, main tells them to start the next traversal
>
> So, after a long ramble, given that I am happy to waste CPU time in busy 
> waits (rather than have the overhead of scheduling blocked goroutines), 
> what is the recommendation for the signalling mechanism when all is done in 
> go and everything's a goroutine, not a thread?
>
> My guess is that creating specialist blocking 'barriers' using sync/atomic 
> (atomic.Operation seems to be around 4nsec on my Mac Mini) is the highest 
> performance mechanism. There's a dearth of performance information on 
> channel communication, waitgroup, mutex etc use, but those I have seen seem 
> to suggest that sending/receiving on a channel might be over the order of 
> 100nsec; since in C we iterate twice through the list in 30-40nsec, this is 
> a tad high (yes, fixeable by modeling a bigger system, but)
>
> I know that premature optimisation is a bad thing, but I'd prefer to ask 
> for advice than try everything..
>
> many thanks for any help
>
> -- P
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6f3d412d-85a1-4bbb-aaab-cc31a41cdaben%40googlegroups.com.


Re: [go-nuts] Golang vs Python: Complete Comparison with their Top Frameworks

2021-01-11 Thread Nikolay Dubina
I would expected to see at these two things:

1. That most of the serious solutions in "Python" are actually wrappers for 
highly optimized machinery in C/C++. If you look at just basic ML stack: 
Pytorch, Tensorflow, OpenCV, numpy, scipy, XGBoost, so on. all is in C/C++ 
with wrapper in Python.
2. Language itself. Go syntax is unusable for data-wrangling and data 
science, while Python is very friendly. I am talking about things like: 
multi-dimensional arrays and indexing; standard library data structures 
like sets; short lambdas notation; ternary; errors vs try-catch semantics; 
operator overloading...

Python is not just webservers, as opposed to Go. Lastly, pure "Python" is 
slow. But given a lot of serious code is in C/C++ underneath, uses 
green-treads (like gunicorn), does batch processing, makes lots of GPU 
calls (which Go has no support at all)... it is debatable if Python is 
slower than Go. It depends on application.

- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1dcc8d41-23e6-44f3-bf42-da3656500f56n%40googlegroups.com.


Re: [go-nuts] Go and AI Recommendations

2020-12-27 Thread Nikolay Dubina
Go does not have much traction in ML and for good reasons:

* not a single one organization or company is backing Go ML projects
* with exception couple papers, no research in neither computer vision, 
NLP, or RL is done in Go, no papers are implemented in Go. It is mostly 
Pytorch these days.
* Go language does not support: multi-dimensional indexing; N-dimensional 
arrays; operator overloading; short lambda notation — all these are loved 
by data science and machine learning community since it makes life a lot 
easier for them, but not in Go
* Go support for GPU is not good
* Go compiler does not support optimizations like SIMD — so even CPU 
intense workloads are not as performant
* Go calls to C can be made, but "cgo is not go" and benefits of Go 
deteriorate quickly with this approach — so a lot of ML code in C can not 
be really efficient with Go
* Audio / Video / Image / Spatial data is not supported well in Go (just 
try to run OpenCV in Go, likely it will be either IPC or cgo...)
* Many ML related libraries are supported by a single person or already 
deprecated or highly unstable or experimental

Is there way forward?

Writing experimentation, data visualization, data wrangling, modeling, 
training in Go is shooting yourself in the foot. I already tried this 
myself once for porting Julia code. I would not believe any single DS or ML 
person would use Go seriously for these purposes.

However, there is a niche that Go may fit — tabular data (your backend data 
model) + inference. Which means, ML model is developed and *trained* in say 
Python/Julia/R but then ported to Go and loaded trained model artifacts. I 
recently wrote https://github.com/nikolaydubina/go-featureprocessing as a 
first step in that direction and more work will follow up.

Here is what ML there is in Go at the moment:

* https://github.com/josephmisiti/awesome-machine-learning#go
* https://github.com/avelino/awesome-go#machine-learning

On Monday, December 28, 2020 at 2:11:37 AM UTC+8 ren...@ix.netcom.com wrote:

> I think you might be better off learning AI/ML using Python - to 
> understand the concepts - most tutorials use Python/Colab as well since it 
> is so easy.
>
> Once you understand the concepts you can use Go libraries  
>  to 
> implement the concepts in Go.
>
> On Dec 27, 2020, at 11:55 AM, Philip Chapman  wrote:
>
> 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 
> seems to be based on python, but I rather prefer Go.
>
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CABEejsiZMjpTgbZx_7aGRdEcReyHYuk1eNe1WHOdHOdv6jsXFA%40mail.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f974314f-7458-4f64-9e94-fed3b850cc51n%40googlegroups.com.


[go-nuts] [ANN] Feature processing in Go

2020-12-22 Thread Nikolay Dubina
*What is it?*

A module with feature transformers plus go:generate script to generate 
feature processor for your data model in Go with emphasis on convenience 
and single sample latency.

github.com/nikolaydubina/go-featureprocessing

*Features*

   - feature parity to scikitlearn
   - convenient marshaling/unmarshaling
   - no 3rd party dependencies
   - benchmarks for module
   - go:generate script that *generates benchmarks and tests* for your 
   struct
   - ~100% test coverage
   
Cheers,

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8eaff3a3-431b-4b48-9918-4ebf2a18efebn%40googlegroups.com.


[go-nuts] Benchmarks in https://github.com/golang/go

2020-12-17 Thread Nikolay Dubina
Hello,

I am trying to find a dashboard with current benchmarks of go core routines 
(e.g. math, sort, reflect, etc.). For example, among others, I would like 
to see these benchmarks: 
https://github.com/golang/go/blob/master/src/math/all_test.go#L3196

I tried to run it with `go test -bench=. ./...` from the root of "go" repo, 
but getting errors like for case of "math":

```
package std/math
exp_asm.go:9:8: use of internal package internal/cpu not allowed
package std/math/big
big/arith_amd64.go:9:8: use of internal package internal/cpu not allowed
```

I think I am doing something wrong or I am missing some public dashboard. 
Thus, few questions:

1. How to run benchmarks from `https://github.com/golang/go`?
2. Is there a public official dashboard with benchmarks?
3. Any resources on how benchmarks have changed over last couple of years 
releases of go?

Thanks,

- Nikolay

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/2fed5db8-777e-4e4d-9d21-b024e4acc522n%40googlegroups.com.