zig
TinyGo
Our great sponsors
zig | TinyGo | |
---|---|---|
808 | 95 | |
29,799 | 14,310 | |
3.7% | 1.8% | |
10.0 | 9.4 | |
about 10 hours ago | 7 days ago | |
Zig | Go | |
MIT License | GNU General Public License v3.0 or later |
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.
zig
-
Zig, Rust, and Other Languages
https://github.com/ziglang/zig/blob/5cd7fef17faa2a40c8da23f0...
Generally speaking, it’s as mentioned just a convention. A zig library might not allow its users to pass allocators for example.
In C++, stl containers can take an allocator as a template parameter. Recent C++ versions also provide several polymorphic allocators in the stdlib. You can also override the global allocator or a specific class’ allocator (override placement new).
-
Nanos – A Unikernel
We need to remove that. We did have a channel on freenode a while back but got rid of it.
Outside of gh discussions there is also https://forums.nanovms.com/. We made a decision a while ago to follow Zig's lead here and have no 'official' community space (https://github.com/ziglang/zig?tab=readme-ov-file#community) instead letting people form their own spaces.
Zig also has an IRC channel on libera (#zig) that is moderated by Andrew Kelley.[1]
- Ask HN: What Underrated Open Source Project Deserves More Recognition?
-
Top Paying Programming Technologies 2024
1. ZIG - $103,611
-
MicroZig: Unified abstraction layer and HAL for Zig on several microcontrollers
ESP32 and STM32 support is very welcome!
I have been following https://github.com/ziglang/zig/issues/5467 for a while and progress seemed to have slowed significantly
-
Asynchronous Clean-Up (in Rust)
I have never used it directly, take what I say with a grain of salt.
As far as I know at least part of the idea was to eliminate the function coloring problem by letting the compiler do some nifty compile-time deductions. This had some issues (I don't know if this is still planned, it seems like the kind of thing that should not work in practice). Additionally, there were all sorts of hard technical issues with LLVM, debugging, etc.
I recommend checking the issue tracker, eg. https://github.com/ziglang/zig/issues/6025
I personally don't understand the domain well enough at all, but honestly, I feel like (if possible) Zig should try to double down on its allocator approach.
Instead of trying to use some compile-time deduction magic explicitly pass around an "async runtime/executor" struct which you explicitly have to interact with. Why not?
-
Show HN: Tokamak – A Dependency Injection-Centric Server-Side Framework for Zig
Atop your readme, you point out that nginx or another reverse proxy should be used. Kudos for that.
As for performance, I'd be curious what gains you get using `std.http.Server` with keepalive and a threadpool. Possibly you can re-use your ThreadContext - having 1 per thread in the threadpool that you can re-using. `std.Thread.Pool` is also very poorly tuned for a large number of small batch jobs, but that's a place to start.
[1] https://github.com/ziglang/zig/blob/b3aed4e2c8b4d48b8b12f606...
Yes, fundamentally. In Rust if you take a parameter of generic type T without any bounds, you cannot call anything on it except for things which are defined for all types. If you specify bounds, only things required by the bounds can be called (+ the ones for all types). Another difference is where you get an error when you try pass something which doesn't adhere to a certain trait. In Rust you will get an error at the call site, not at the place of use (except if you don't specify any bounds).
Zig is doing just fine without any trait mechanism and it simplifies the language a lot but it does come up from time to time. The usual solution is to just get type information via @typeInfo and error out if the type is something you're not expecting [0]. Not everybody is happy about it though [1] because, among other things, it makes it more difficult to discover what the required type actually is.
[0] https://github.com/ziglang/zig/blob/b3aed4e2c8b4d48b8b12f606...
TinyGo
- Gokrazy – Go Appliances
-
A "Tiny" APISIX Plugin
Reading through the documentation, you will understand why this plugin is called "tiny," i.e., the SDK uses the TinyGo compiler instead of the official Go compiler. You can read more about why this is the case on the SDK\'s overview page, but the TLDR version is that the Go compiler can only produce Wasm binaries that run in the browser.
-
What's Zig got that C, Rust and Go don't have? [video]
Not only you can fit Go into a kernel, there is at least two products that do so.
TamaGo, used to write the firmware used in USB armory.
https://www.withsecure.com/en/solutions/innovative-security-...
TinyGo, which even has official Arduino and ARM support, and is sponsored by Google
Ah but that isn't proper Go! Well neither is the C code that is allowed to be used in typical kernel code, almost nothing from ISO C standard library is available, and usually plenty of compiler specific language extensions are used instead.
-
Show HN: A new stdlib for Golang focusing on platform native support
Reminds me of https://tinygo.org/ - a project that brings Golang to embedded devices, browser (wasm) contexts. Do you converge or diverge from that project?
-
Pico with C
You should also consider TinyGo. It can compile Go for the Pico, and is starting to get good device support.
-
Rust 1.71.0
Thankfully some folks completly ignored whatever the rest of the world thinks system programming is all about and created:
- TinyGo (https://tinygo.org/), which is acknowledged by people in the industry[0][1]
- TamaGo unikernel on USB Armory secure key (https://www.withsecure.com/de/solutions/innovative-security-...)
And then there is the question if writing compilers, assemblers, linkers is systems programming or not.
[0]-https://www.cnx-software.com/2019/08/28/tinygo-go-compiler-f...
[1]-https://twitter.com/ArmSoftwareDev/status/131680481331796787...
-
When would you (not) recommend Go over Rust?
Have you seen TinyGo? In the case of embedded system I would probably still chose C over Rust if the system didn't support dynamic memory allocation, and most embedded systems do not.
-
WebAssembly System Interface (WASI) with sockets for Go
Gist link fixed, thanks. Compared to TinyGo, Go with GOOS=wasip1 will probably generate larger artifacts (at least, for now). This is because it bundles the entire Go runtime. The benefit is that it fully supports goroutine scheduling and non-blocking I/O. TinyGo (I believe) still uses a custom asyncify pass and does not support non-blocking I/O nor basic WASI networking (e.g. https://github.com/tinygo-org/tinygo/pull/2748 never landed, but GOOS=wasip1 supports it).
-
Do you know some sbc or soc that can be programed to run rtos and c++ on top?
Look into Go(lang), which runs on ARM boards (including via tinygo on the low end like the RPi Pico) or Embedded Rust. C++ is optimized for creating buffer overflows.
-
Writing an OS in Go: The Bootloader
Great article. See also: TinyGo.
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).
Odin - Odin Programming Language
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
MicroPython - MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
go - The Go programming language
rust - Empowering everyone to build reliable and efficient software.
rust - Rust for the xtensa architecture. Built in targets for the ESP32 and ESP8266
ssr-proxy-js - A Server-Side Rendering Proxy focused on customization and flexibility!
crystal - The Crystal Programming Language
micropython-ulab - a numpy-like fast vector module for micropython, circuitpython, and their derivatives
awesome-micropython - A curated list of awesome MicroPython libraries, frameworks, software and resources.