crystal
zig
crystal | zig | |
---|---|---|
247 | 876 | |
19,752 | 38,875 | |
0.3% | 1.6% | |
9.8 | 10.0 | |
8 days ago | 4 days ago | |
Crystal | Zig | |
Apache License 2.0 | MIT 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.
crystal
- We Fell Out of Love with Next.js and Back in Love with Ruby on Rails
-
Rhombus Language
Did you ever see Crystal? It's more or less a typed Ruby. I've heard that you can port some code directly.
https://crystal-lang.org/
-
Tiny JITs for a Faster FFI
If you like the Ruby syntax (but want a statically typed language), you might want to take a look at Crystal: https://crystal-lang.org/
> Crystal is statically typed and type errors are caught early by the compiler, eliminating a range of type-related errors at runtime.
-
Advent of Code #1 (in Gleam)
I really enjoyed using Crystal last year. It is a very ergonomic language with a featureful standard library. I was tempted to use it again this year, but I figured I should use this opportunity to try something new. After considering several languages including Go, F#, Nim, and Raku, I decided to go with Gleam.
- Understanding Ruby 3.3 Concurrency: A Comprehensive Guide
- One-Liner for Finding Typos
-
Notes on the Crystal Language
Temp file issue is debunked here: https://news.ycombinator.com/item?id=41684848
Dir module works fine, though maybe the docs could be improved. https://crystal-lang.org/api/1.13.3/Dir.html . The stdlib code is also highly readable: https://github.com/crystal-lang/crystal/blob/d14d04562/src/d... shows that #each_child just calls #read and yields it to the block, so I don't think this is really a wart :)
- A Language for Humans and Computers
-
Top Paying Programming Technologies 2024
27. Crystal - $77,104
-
Crystal 1.11.0 Is Released
I like the first code example on https://crystal-lang.org
# A very basic HTTP server
zig
-
How to Use Libuv In Your Zig Project
The program we made ran smoothly, but you may encounter an error dependency loop detected if you use certain functions from libuv. It will point to the uv_read_cb function as the cause. This is due to how Zig translated the C code. Follow the steps below to fix it:
-
RawWeb Updates: SimHash and Meilisearch
For local testing, just run cargo build --release. But cross-platform compilation is much more complicated. Fortunately, the Zig toolchain greatly simplifies C cross-compilation, eliminating the need for musl libc!
- C++26: more constexpr in the core language
-
Things Zig Comptime Won't Do
Here is, I think, an interesting example of the kind of thing TFA is talking about. In case you’re not already familiar, there’s an issue that game devs sometimes struggle with, where, in C/C++, an Array of Structs (AoS) has a nicer syntactic representation in the language and is easier to work with/avoid leaks, but a Struct of Arrays (SoA) has a more compact layout in memory and better performance.
Zig has a library to that allows you to have an AoS that is laid out in memory like a SoA: https://zig.news/kristoff/struct-of-arrays-soa-in-zig-easy-i... . If you read the implementation (https://github.com/ziglang/zig/blob/master/lib/std/multi_arr...) the SoA is an elaborately specialized type, parameterized on a struct type that it introspects at compile time.
It’s neat because one might reach for macros for this sort of the thing (and I’d expect the implementation to be quite complex, if it’s even possible) but the details of Zig’s comptime—you can inspect the fields of the type parameter struct, and the result SoA can be flexible in the number and type of its own fields—mean that you don’t need a macro system, and the Zig implementation is actually simpler than a macro approach probably would be.
(sorry for the slow reply!)
-
Zig's new LinkedList API (it's time to learn fieldParentPtr)
Two points here:
Linked lists are useful in unsafe code. Most recent use case I had for them was in an event loop with coroutines. It's not possible to implement such thing in memory safe languages. For example if you use Rust, you have to use unsafe [1].
@fieldParentPtr does not yet have safety but it is a planned upcoming change to the language, with a fairly straightforward implementation [2].
[1]: https://github.com/search?q=repo%3Atokio-rs%2Ftokio%20unsafe...
[2]: https://github.com/ziglang/zig/issues/2414
- Zig is a general-purpose programming language
-
Tail Call Recursion in Java with ASM (2023)
Generally I also find Zig's documentation pretty lacking, instead I try looking for the relevant issues/prs. In this case I found comments on this issues [1] which seem to still hold true. That same issue also links to the relevant LLVM/Clang issue [2], and the same restriction is also being proposed for Rust [3]. This is were I first learned about it and prompted me to investigate whether Zig also suffers from the same issue.
[1]: https://github.com/ziglang/zig/issues/694#issuecomment-15674...
- Zig: A good memory allocator in 200 lines of code
- A good memory allocator in 200 lines of code
-
Zig-0.14.0 Landed
One thing I'm super excited about here is that Zig can now cross-compile CGO to macOS [0], granted you link the appropriate macOS frameworks and SDK [1].
[0]: https://github.com/ziglang/zig/issues/20689, https://github.com/ziglang/zig/issues/21721
[1]: https://github.com/tpoechtrager/osxcross
What are some alternatives?
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).
ssr-proxy-js - A Node.js tool for Server-Side Rendering (SSR) and Static Site Generation (SSG) using headless Chrome via Puppeteer
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
Odin - Odin Programming Language
mint-lang - 🍃 A refreshing programming language for the front-end web.