45 karma · joined September 7, 2015
- https://github.com/go-hep/hep/blob/main/groot/rhist/efficien...
Also, for the longest time, the I/O format wasn't very well documented, with only 1 implementation.
Now, thanks to groot [1], uproot (that was developed building on the work from groot) and others (freehep, openscientist, ...), it's to read/write ROOT data w/o bringing the whole TWorld. Interoperability. For data, I'd say it's very much paramount in my book to have some hope to be able to read back that unique data in 20, 30, ... years down the line.
[1] https://go-hep.org/x/hep/groot (I am the main dev behind go-hep)
- neugram.io
- https://github.com/cosmos72/gomacro
here is a mybinder that used to use the former, and now uses the latter:
I disagree. Again, this may very well be science-domain dependent, but in High Energy Physics (where, finally, Python is recognized as a mainstream language, BTW) many -- if not all -- of the pain points that slow down undergrads, PhDs, post-docs and researchers at large, are these Go features.
yes, the time from "idea" to "little script that shows a bunch of plots" on a subset of the overall data is definitely shorter in Python (exploratory analysis is really really great in Python). but, at least for LHC analyses, python doesn't cut it when it comes to Tb of data to swift through, distribution over the grid/cloud, ... you die by a thousand cuts. and that's when you are alone on one little script. LHC analyses can see well over 10-20 people assembling a bunch of modules and scripts. You really long for a more robust to (automated) refactoring language than python, pretty quickly.
generics may help in that department.
in the meantime, there's Apache Arrow:
- https://github.com/golang/tools/blob/master/cmd/golsp/main.g...
sure, when you need it, you need it. but float64 caters for a good 99% of my usual work day.
From a user POV, seamless installation of packages is a great boon. From a grid/cloud operator POV, static binaries are great too.
Gonum is almost on par with _e.g._ NumPy/SciPy (most notably lacking: ODEs). So still ways to Go but it's getting there.
Go-HEP is my attempt to bring a few High Energy Physics oriented packages to particle physicists:
I've also written a few words on why I think Go is great for science:
- https://sbinet.github.io/posts/2018-07-31-go-hep-manifesto/
TL;DR: Go is great b/c it brings great s/w engineering practices and a s/w engineering-friendly environment to scientists.
Admittedly, generics will change how packages are written. So some code churn will take place when/if they land, but the Go community learned the lessons from Python2/3 and Perl5/6. Expect a better migration path.
Lastly, I guess the 2 remaining weak points of Go are:
- runtime performances sub-par wrt C++ or Rust
- GUIs (which may or may not fall into "interactive visualization")
That said, the Go community worked on a Go kernel for Jupyter:
- https://github.com/gopherdata/gophernotes
hth, -s
- the next version of the Go toolchain (Go-1.11) will have a wasm target
that's true. that is... until a (real) Go interpreter shows up. something that's bound to happen when Go will be used for (data) exploratory work.
Last summer, I tried an experiment: have a student migrate a little python-based analysis to a Go-based one. The analysis was fitting some cosmological constants out of the so called Hubble diagram.
I was pleased to see that, in the span of 2-3 months, the student who had limited knowledge in programming (a bit of python), managed to pull off the minimization of a 740 supernovae dataset with a 2220x2220 nuisance parameters matrix.
and the run time was 2x faster than the python one (with scipy/minuit for the minimization, so everything in C/C++, really).
success. :)
(and this motivated us to completely switch to Go as a teaching language for our master in particle physics / cosmology.)
- https://github.com/golang/go/issues/10958
- https://go-review.googlesource.com/c/go/+/33910
- https://go-review.googlesource.com/c/go/+/36206
https://github.com/astrogo/fitsio
(a pure Go version)
I don't see how reimplementing Go in Go but with a REPL (on top of, let's say, a SSA interpreter) is a Go-like REPL at best and not just a Go REPL. Could you expand a bit?
AFAICT, once one has a Go interpreter (the x/go/ssa is basically just that), implementing a REPL is "just" providing a program counter to the interactive interpreter layer, together with the ability to modify that PC... (many details have been dropped on the floor, of course)
It is a true REPL (not like "gore", mentioned somewhere in that thread). It doesn't implement the whole Go specs, but there's AFAICT nothing in the Go specs that prevent `igo` to implement the whole Go specs. It's "just" work. Moreover, with the introduction of the "buildmode=plugin" in the yet-to-be-released Go-1.8, import-ing packages on the fly should be easy implementable.
("my" new vehicle to provide a true REPL for Go is at https://github.com/go-interpreter)
it automatically creates a CPython-2 extension module out of a Go-1.5 package.
I plan to update it for Go>=1.6 and also directly generate a "cffi" python module so CPython-{2,3} and PyPy can be directly supported out of the box.
nothing's wrong with that except that you accumulate side-effects:
gorepl> f := func() { launchMissiles(); fmt.Printf(">>> missiles launched\n") }
gorepl> f()
>>> missiles launched
gorepl> var a = 2
>>> missiles launched
gorepl> fmt.Printf("oops!\n")
>>> missiles launched
oops!
that's not the kind of REPL I want, and that's not what "my" REPL does (https://github.com/sbinet/igo) nor the one built on top of LLVM (llgoi: http://llvm.org/viewvc/llvm-project/llgo/trunk/cmd/llgoi/) $ gore
gore version 0.2.5 :help for help
gore> var i = 41
gore> f := func() { i++; fmt.Printf("universe=%d\n", i) }
(func())(0x4012b0)
gore> f()
universe=42
gore> f()
universe=42
universe=43
when Go was released back in 2009 there has been a string of such REPLs, which don't match "my" definition of a REPL, at least, not the one I want to be able to use for exploratory work (the kind you get from a python or IPython prompt)again, that's my personal bias. that said, GoRe is a nice project (gocode-completion, especially, is nice)
tangential: actually, you can refactor with the CLang libraries: http://llvm.org/releases/3.7.0/tools/clang/docs/LibTooling.h... (well, to some extent)
I am not sure I completely get what a compiler-as-a-service really is. could you expand please?
(wrt JITing, yes, we considered it and it's on our radar. we know some version of it worked at some point, at least at the proof-of-concept level: https://github.com/nelhage/gojit)
thanks for your input!
my plan for this new go interpreter proposal, is to be able to use for scientific exploratory work (like we do with IPython right now when in a python-based ecosystem or CLing when in C++ land).