iter
go
Our great sponsors
iter | go | |
---|---|---|
2 | 1849 | |
30 | 111,942 | |
- | 1.1% | |
5.2 | 10.0 | |
6 days ago | 3 days ago | |
Go | Go | |
BSD 3-clause "New" or "Revised" License | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
iter
-
iter: Generic, lazy iterators for Go 1.18
I've been working on an iterator package for Go 1.18. Here's a quick snippet:
The reason why I decided on the inner/outer architecture was because interface objects can't be used as recievers to methods (as far as I understand). As a result, my initial implementation, which didn't have this structure, was limited to functions instead of methods, which made code where iterator methods were chained extremely unreadable, since it was difficult to tell which order they were being applied in. It's a tradeoff, but I think the readability might be worth it. Do you have any ideas for alternative workarounds?
go
-
Go 1.20.5 is released
Seems like this go runtime deadlock fix didn't get included.
-
If you must read the rest of this document to understand the behavior of your program, you are being too clever. Don't be clever.
Nothing new in fact, it's part of the culture. There is no "why", just "don't"s - an example among others https://github.com/golang/go/issues/45179
Not to worry, at least the Go team itself is still having trouble with its own completely uncheckable locking.
-
Is there a good place to find best practices?
I usually see and recommend: https://go.dev/talks/2013/bestpractices.slide#1 https://go.dev/talks/2014/readability.slide#1 https://github.com/golang/go/wiki/CodeReviewComments https://about.sourcegraph.com/blog/go/idiomatic-go https://github.com/teivah/100-go-mistakes
-
Learn x86-64 assembly by writing a GUI from scratch
Example of assembly in Go source code:
https://github.com/golang/go/blob/master/src/crypto/md5/md5b...
-
Why no src directory?
This mother of all things has a dedicated src directory, so it really comes down to each project to choose its own file structure.
-
Exploring Async PHP
There are many solutions available without requiring PHP 8.1 that have been battle tested, but it's interesting to see the direction the PHP language is going in to compete with the likes of Golang and Elixir, both of which support async programming and have done for years.
-
Some annoying moments in Golang
I dislike how the implicit reference-like behavior of slices, maps, channels, and function pointers confuses newcomers to the language. It would be less ergonomic to have to declare them as pointer types, but it would be more clear to readers. The language used to actually do this in its pre-1.0 infancy (example). Everything is passed by value, but the values are pointer themselves to the actual data structures.
Will change in Go 1.21
What are some alternatives?
v - Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
TinyGo - Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
Angular - The modern web developer’s platform
golang-developer-roadmap - Roadmap to becoming a Go developer in 2020
RxGo - Reactive Extensions for the Go language.
crystal - The Crystal Programming Language
sqlc - Generate type-safe code from SQL
React - The library for web and native user interfaces
rust - Empowering everyone to build reliable and efficient software.
Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.