|
I've got to say that I'm really loving this language. It is simple enough to follow easily (particularly coming from Scala) and the std lib is just a fantastic learning tool.
|
# ¿ May 1, 2014 16:33 |
|
|
# ¿ Apr 28, 2024 20:26 |
|
I am starting to suspect that the real reason they chose the name "go" was because it would allow an infinite number of puns
|
# ¿ May 8, 2014 03:57 |
|
So, I wrote up a function which takes a channel, and returns a new interface which can replay the values in the original channel, and only pulls values from the original channel lazily. Maybe some of you have some suggestions / criticisms of it? I wrote it after some guy on the go-nuts irc channel said it wasn't possible, gently caress that guy. actually, this is so much better: http://play.golang.org/p/H4awi7EmSY Bozart fucked around with this message at 05:52 on May 13, 2014 |
# ¿ May 11, 2014 05:15 |
|
Does anyone feel up to giving me some feedback on an ORM I am putting together? The core of it is done, I just want to know what people think of its interface & docs. However, I don't want it public yet so I'll have to give you access to my github repo. If you're interested then either pm me or post here.
|
# ¿ Jun 29, 2014 22:00 |
|
pram posted:Is it actually relational? Theres already like 10 'ORM's and the only one I've seen with actual relational stuff is Beego You bet. It is actually, really, really relational, in the sense that there are no nulls, all relations are distinct, and I don't implement an ordering. Here's an example from the readme. This works. Edit: either pm me or post your github account if you feel up to giving me some advice. pre:// Here's an example of sparse matrix multiplication using rel (relational meets linear): type matrixElem struct { R int C int V float64 } type multElemA struct { R int M int VA float64 } type multElemB struct { M int C int VB float64 } type multElemC struct { R int C int M int VA float64 VB float64 } type groupTup struct { VA float64 VB float64 } type valTup struct { V float64 } groupAdd := func(val <-chan groupTup) valTup { res := valTup{} for vi := range val { res.V += vi.VA * vi.VB } return res } // representation of a matrix: // 1 2 // 3 4 A := New([]matrixElem{ {1, 1, 1.0}, {1, 2, 2.0}, {2, 1, 3.0}, {2, 2, 4.0}, }, [][]string{[]string{"R", "C"}}) // representation of a matrix: // 4 17 // 9 17 B := New([]matrixElem{ {1, 1, 4.0}, {1, 2, 17.0}, {2, 1, 9.0}, {2, 2, 17.0}, }, [][]string{[]string{"R", "C"}}) C := A.Rename(multElemA{}).Join(B.Rename(multElemB{}), multElemC{}). GroupBy(matrixElem{}, groupAdd) fmt.Println("\n%#v",C) // Output: (might be in any order) // rel.New([]struct { // R int // C int // V float64 // }{ // {1, 1, 22, }, // {1, 2, 51, }, // {2, 1, 48, }, // {2, 2, 119, }, // })
|
# ¿ Jun 29, 2014 23:00 |
|
Dommer416 posted:I'll have to play with this! I look forward to it. Too bad I'm half asleep. Alrighty, it's public at https://github.com/jonlawlor/rel
|
# ¿ Jul 2, 2014 05:37 |
|
Thanks for actually looking at the package! The single value allocation thing is a little ugly and I'll try incorporating your suggestion. I was planning on using sync.Pool to help with the amount of literal allocation that takes place, but the community's opinion of it seems mixed. I really haven't gotten much feedback on the rel package because people take a look at its size, and the fact that it uses a ton of reflection, and run away as fast as they can. For now I'm putting that project on the back burner while I implement the relational operations in idiomatic go. There is something really interesting about connecting relational algebra with Go's pipeline mechanisms, so I'm going to start a blog to walk people through them as gently as I can, which means no reflection, and no query rewrite. By now I've rewritten them all a few times, so it isn't too hard, and I'm still figuring out what's good and bad in different situations. For example, ordered relational operations are at a huge advantage because you can make assumptions about what tuples will be sent to each pipeline stage, while the rel package doesn't assume any ordering exists (it doesn't even define a sort function!) so I basically use hash-joins and hash-groups for everything.
|
# ¿ Jul 16, 2014 00:19 |
|
Azazel posted:There is a reason people use empty structs, they are zero sized. That isn't what he's talking about though. The rel.Relation interface has methods which take an example tuple into an interface{} so that it can reflect on it to determine how to construct result tuples. He's saying I should have callers construct a nil pointer of the appropriate type instead to avoid the overhead.
|
# ¿ Jul 16, 2014 04:18 |
|
So I have the first post ready in a new blog: http://jonlawlor.github.io/2014/07/18/distinct/ Do you guys have any feedback? Otherwise I guess I'll be posting it on reddit tomorrow.
|
# ¿ Jul 18, 2014 05:23 |
|
Also, for game dev you might want to wait for Go 1.5 which will have GC improvements.
|
# ¿ Aug 10, 2014 16:14 |
|
Jsor, as a followup, how are you supposed to get gonum running? Going off of the readme at https://github.com/gonum/lapack didn't help. I'm running osx mav, installed gfortran: code:
No error messages, ran code:
test.go:18: undefined: clapack.Lapack after about a zillion warnings in clapack: ../../gonum/lapack/clapack/lapack.go:21582:3: warning: plain '_Complex' requires a type specifier; assuming '_Complex double' /usr/include/complex.h:37:17: note: expanded from macro 'complex' So at this point I don't know what to do. Does gonum have some kind of installation guide that I'm missing?
|
# ¿ Aug 10, 2014 21:03 |
|
Scaevolus posted:As much as I like Go, Julia is looking more promising for scientific workloads. Go's developers want a language to write networked services, so things like maximal performance (including FFI), good matrix support, and operator overloading aren't particularly high on their list of improvements. I think it really depends on the particular application. I don't think most matlab code (or probably julia code) deals with matrix algebra - most of it is the plain old programming that everyone does. I'm particularly excited about time series in matlab. I was going to take gonum for a test drive by implementing recursive lease squares estimation and/or a kalman filter, but first I'll have to figure out how to get it running. I will have to read up a little on julia to see what a comparable version there would look like.
|
# ¿ Aug 11, 2014 04:45 |
|
Does Docker alleviate some of that problem? I've never used it in a professional environment.
|
# ¿ Sep 30, 2014 23:48 |
|
SavageMessiah posted:Docker is a containerization tool for linux, how on earth would it help with this problem? It works in more environments than just linux. You could add 3rd party packages to the docker image, and then use that image for dev work. Then all of the devs are using the same version of each of the packages, which may alleviate the problem he described of multiple devs coordinating multiple packages. The downside may be as Look Around You mentioned being "frowned upon" but I don't know one way or the other, because as I said, I haven't used it professionally. Also, they aren't urls in the imports, they are file paths relative to $GOROOT. They are only interpreted as urls by the go tool.
|
# ¿ Oct 1, 2014 06:07 |
|
Pham Nuwen posted:This sounds like the equivalent of distributing a full Python installation with your program because of Python's version hell. (This is a thing people actually do) To distribute it you would just distribute the compiled binary?
|
# ¿ Oct 1, 2014 06:15 |
|
Uh, aren't you supposed to say it is simple, lightweight, or minimalist? edit: More seriously, I don't know enough about the domain to give advice in that regard, but you could run golint, which would pick up: code:
code:
Bozart fucked around with this message at 05:27 on Dec 30, 2014 |
# ¿ Dec 30, 2014 04:58 |
|
One thing you might want to do is get rid of lines sending on the q channel. Receives on a closed channel always succeed (with the zero value, but you're not using it...) so you could make q a chan struct{}, and then code:
The way I would change the code structure is to take the common parameters out sockAccept and connHandler, and put them into the Adminsock type. Then sockAccept would just be (*a Adminsock) sockAccept(), and connHandler would just be (*a Adminsock) connHandler(c net.Conn). It should also be possible to split out the wait group handling into a function like code:
As I said, I'm not sure that would be faster (although it might be under heavy load, because I believe there is less synchronization done when closing channels and blocking on them), but it is another approach, and it feels a bit more "go-like" to me. Do whatever works for you though.
|
# ¿ Dec 31, 2014 05:38 |
|
thats a good question to be honest
|
# ¿ Feb 25, 2015 07:14 |
|
can we stop with the dumb language wars and get back to dumb programs Sheesh
|
# ¿ Feb 27, 2015 04:59 |
|
sarehu posted:Here is what annoyed me about Go's type system yesterday. I had several types of slice, and for each of them, I wanted to find the index of the element that matched a given player. In other languages I could just write func[T] lookup(elems []T, f func(T)bool) (index int, found bool) { ... }, or actually it would be a utility written for me, but instead I had to rewrite the same for loop several times. And the same again when I wanted to make a new slice with the matched element removed. I guess it doesn't matter though because Go is made by titans in their field, just like Git, a perfect version control system that is also above criticism. Just curious, why isn't a map appropriate in this case?
|
# ¿ Mar 3, 2015 05:34 |
|
Khorne posted:In case anyone runs into this issue, the 1.4.2 msi installer is broken. Use the archive to install instead. I just used it yesterday, no problem.
|
# ¿ Mar 11, 2015 17:22 |
|
COOL CORN posted:Go is confusing to me. I just got a coupon code for a Udemy course about it, and it seems super great from the outset, and a lot of companies are using it. But... only 5 pages here, and most of it is complaining about the language. Did it just never get any traction? Is it dying out? Just not much activity in this thread to be honest. The reddit group has been growing in quality (particularly since the devs started doing AMAs) and it is on YC a lot. Go is really good at some stuff - especially deployment!!! - pretty good at most stuff, and meh at some stuff. If you're looking for language feature xxx in it, you'll be one of the people hating on it. I absolutely love how readable random github repos in go are. I love the tooling. I'm at the point where it is my go to language, unless the task is an extremely poor fit.
|
# ¿ Mar 9, 2016 04:19 |
|
There is also an atom plugin.
|
# ¿ Apr 8, 2016 03:33 |
|
Mr. Crow posted:How are the analytics libraries for go these days? Anything similar to pandas in Python? Nothing like pandas really. The type system really fights against data frames. I implemented something like it using the reflect package but it was quite a mess and I would never use it for actual work.
|
# ¿ May 18, 2016 02:23 |
|
so loving future posted:Yeah, pretty good example of thing that is probably awful in golang. Stick to pandas :/ To be fair pandas is pretty bad, but in golang it is only barely possible to do so it is even worse.
|
# ¿ May 18, 2016 02:52 |
|
Coffee Mugshot posted:Go would love to have a good debugger, but it turns out debugging is hard. I think people take my favorite program, gdb, for granted. That is what I put in the go user survey as something go could use. (Also I put multi-dimensional arrays but hey, that poo poo ain't coming anytime soon)
|
# ¿ Dec 15, 2016 01:49 |
|
|
# ¿ Apr 28, 2024 20:26 |
|
bonds0097 posted:What do you mean by multi-dimensional arrays? You can do slices of slices to arbitrary depth, right? If you want to bounds check every single sub-slice, and not be able to rely on matrices being rectangular, sure. e: there is a related benefit to having matrices laid out in memory in a specific way Bozart fucked around with this message at 03:40 on Dec 15, 2016 |
# ¿ Dec 15, 2016 03:32 |