go
crystal
Our great sponsors
go | crystal | |
---|---|---|
1849 | 218 | |
111,942 | 18,512 | |
1.1% | 0.4% | |
10.0 | 9.8 | |
about 20 hours ago | 4 days ago | |
Go | Crystal | |
BSD 3-clause "New" or "Revised" License | Apache License 2.0 |
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.
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
crystal
-
As a Go developer, I’m surprised Crystal isn’t more popular
There have been 7 releases in 2023 so far (https://github.com/crystal-lang/crystal/releases), one of them (1.7.0) having over 30 different contributors.
There is also an undocumented Thread class https://github.com/crystal-lang/crystal/blob/master/src/crystal/system/unix/pthread.cr to get at even lower-level multithreading primitives. But can't do anything that touches the scheduler.
-
How Much Memory Do You Need to Run 1M Concurrent Tasks?
"System time" rather than "user time" is the majority (7.94s system time, 2.83s user time in the 20.25s wall time run). Is this pointing to memory allocations?
Crystal Fiber docs https://crystal-lang.org/api/1.8.2/Fiber.html says "A Fiber has a stack size of 8 MiB which is usually also assigned to an operating system thread. But only 4KiB are actually allocated at first so the memory footprint is very small." -- and perhaps unsurprisingly, 4KiB times 1000000 is approximately 4 GiB. Nice when the math works out like that :)
To me this is useful as a baseline for something like a websocket server, with some number of idle connections, each Websocket connection mapped to a Fiber that is waiting for I/O activity but mostly idle.
-
Programming types and mindsets
I still just document everything using YARD and focus on designing really obvious Object Models and of course write tests. I have tried using sord to convert my YARD type annotations to RBS or RBI, but you still have to fill in missing bits, then use steep and somehow load in RBS/RBI files for other gems and stdlib, and it's just an uphill battle since Ruby is dynamically typed by default. Obviously Dynamic Typing lends itself more to Dynamic Languages, where you can call an arbitrary method and let the language VM figure it out at runtime. Static or Strong Typing lends itself better to compiled languages where everything needs to be resolved at compile time and converted into object code. If I need to work in a compiled language, then I'll use Crystal, which also supports type inference. TypeScript's type syntax is quite nice, but I tend to avoid writing massive JavaScript code bases where a Type Checker helps catch subtle bugs, and instead prefer sticking to minimal amounts of vanilla JavaScriot in order to keep complexity low and not overwhelm the browser.
-
Getting Lucky with HTMX
Lucky is a full-stack framework written in the Crystal programming language. One of the neat benefits of using Lucky with Crystal is the typesafety you get.
-
A Look at the Crystal Programming Language for Humans
„All the main platform features for Windows are finished“
-
Engineers who have a personal website/blog, what are you using to host/generate it?
Over the years, I’ve gone from Time Warner’s Road Runner, to Tumblr, to GitHub Pages, to Godaddy hosted WordPress. Though, after Godaddy messed up a migration, I switched to self-hosting on Heroku. I wrote my blog engine using Crystal. Reference: ejstembler.com
-
I created a fast, safe and powerful pythonic language which aims allow you to create simple scripts to complex systems in a code easier to read, write and maintain than other system languages with the same purpose. It's free and opensource.
The README describes the language as a systems-focused version of Python. In that sense it's similar to Crystal, a systems-focused version of Ruby. Also, Nim is a statically typed systems programming language with Python-like syntax.
-
Why should you learn Crystal?
Have you ever heard of this amazing language called Crystal? Okay, let's understand a little bit about everything this amazing programming language has to offer.
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.
Elixir - Elixir is a dynamic, functional language for building scalable and maintainable applications
sqlc - Generate type-safe code from SQL
mint-lang - :leaves: A refreshing programming language for the front-end web