Masthash

#zig

Javier Salcedo
3 days ago

The time has come. I've been putting off going this low level for too long.

I plan to to the first part in #Swift instead of Java, and the second in #Zig instead of C.
But it's yet another side project I start, so who knows how long it'll take me to finish it 😆

I'd say reading "Game Programming Patterns" was a pivotal point in my career, so I have high expectations for this one.

yujiri 🏴
3 days ago

2 days ago out of boredom i went back to recording the number of issues of #zig, #rust, #go, #crystal and #nim each day.

changes i noticed since i stopped recording months ago:

* go has broken 8000 😭

* crystal has gone up a couple hundred, but is still the lowest

* nim is about the same as it was, if anything a few less i think

-karlos-
4 days ago

@fleischie28
Still reading docs. I will try #Zig with some gravity simulation or a Flipper. Looking for a 2D framework/engine for Web and native.

4 days ago

Here's a blog post benchmarking compilers by “Hello, World!” and Ruby didn't fare well.

https://drewdevault.com/2020/01/04/Slow.html

#MastoDev #FediDev #Programming #Assembly #Zig #C #Rust #Go #Java #Python #Ruby #Permacomputing

yujiri 🏴
4 days ago

#zig has made me really dislike #go. it's not the worst thing ever but there are so many awkward bits, random special cases, and pointless footguns.

jbz :catjam:
5 days ago

🦎 I think Zig is hard...but worth it
➥ ratfactor

"Zig is trying to help. C and assemblers don’t much care what I do with my memory, so they make it "easy" to write code that performs actions regardless of type. But if I get it wrong (and I will), the program will segfault. The language won’t get in my way, but it won’t help me either. Zig makes you get it right, and that’s a good thing. Slower and more tedious, especially at first, but good."

#Zig #ZigLang https://ratfactor.com/zig/hard

Juliette
6 days ago

made a blog post on writing a simple init daemon for #linux in #zig, https://juliette.page/blog/init.html

farcaller
1 week ago

@nixCraft #rust used to be fun but apparently I do way more stuff in #dart because it's fast, easy, and not #javascript

I want to take a closer look at #zig one of these days.

yujiri 🏴
1 week ago

yooo! #zig seems to have fixed a long-standing issue where building the compiler using its `build.zig` directly instead of `cmake`+`make` would always produce a non-working executable for me, even with the same version.

yujiri 🏴
1 week ago

excited for the #WebAssembly build of #SpacestationDefense! Almost all the pieces are in the place, I've figured out how to wrangle #emscripten into cooperating. I just need the #zig folks to release async support and then I can write the necessary websocket API.

-karlos-
1 week ago

What small program could I write for #OpenStreetMap to learn #ZigLang ? Preferred by using WASM in the Browser.
An ASCII-2D map renderer ;-). OSM to LEGO models?
Some gamification?! Packman (or a car race) on the OSM roads?
#Zig [⚡] => osm

Zig logo
About like
[⚡]
🐈Natalie Perret🍫
1 week ago

🦎⚡#zig
I know that I'm learning new things when I'm banging my head agaisnt the wall 👱‍♀️🧱.

https://ziglang.org/documentation/0.10.1/#Errors

@mitchellh Might want to tag it with #zig and/or #ziglang - fair amount of people following that.

Mitchell Hashimoto
1 week ago

Over the weekend I published a blog post describing how I integrate Zig with SwiftUI. This enables me to create cross-platform apps with native GUI experiences while a vast majority of the code remains shared/platform-neutral. https://mitchellh.com/writing/zig-and-swiftui #zig #ziglang

Jeezy
2 weeks ago

Does anyone know of any good "intro to #Zig for #Rust devs" articles or videos? 🤔

Annie
2 weeks ago

Trying to go really lowlevel in #zig is weird! On the one hand it has some things that make it far nicer then C (e.g. raw syscalls in the stdlib with minimal to no wrapping and even the option to do syscallN yourself) on the other hand its missing a fair number of constants and doing certain calls will be quite clunky or require a lot of pointless casts, and if you want to format strings that will be passed into a syscall, convert them first..

For example look at this: https://zigbin.io/9c5aa2

Nice read. Be interesting to do a similar integration that @mitchellh did here integrating #zig and #swiftui but instead integrating #scala #scalanative and #swiftui https://mitchellh.com/writing/zig-and-swiftui

@deech I am waiting on you to try it with #nimlang :)

🐈Natalie Perret🍫
2 weeks ago
-karlos-
2 weeks ago

Is there anyone knowing how to use #ZigLang on #macOS ?
What means a "shell startup script" ? (to extend the PATH)
I think, #Zig may be a good language for OpenStreetMap tools.

🔜🗣️Join our #ZIGTalk with Frode Forland today at 5 pm! He is a member of the Scientific Advisory Board of our international department #ZIG and currently seconded from Folkehelseinstituttet in Norway to Africa CDC in Ethiopia.

➡️ https://www.rki.de/SharedDocs/Termine/EN/ZIG_Talks/2023-05-25.html

#GlobalHealth #IANPHI

Text boxes in front of a blue world map with the inscription: "Lecture series ZIG-Talks (Centre for International Health Protection, ZIG). 25th May at 05:00 p.m. (CEST). Frode Forland (Norwegian Institute of Public Health/Africa CDC). Social and Environmental Determinants of Health – a Global Perspective"
🐈Natalie Perret🍫
2 weeks ago

Can't wait to see all of that shipped:
https://github.com/ziglang/zig/projects/4
#zig

Morten Linderud
2 weeks ago

A bit hacky, but I got zig running on the Tillitis key :)

https://github.com/Foxboron/tillitis-blink-zig

#zig #tillitis

Palash Bauri :tux:
2 weeks ago

#Zig's :zig: Build System is incredible. Building and cross compiling my #interpreter, which is written in C, is happening like magic.

It just Works!

Jan :rust: :ferris:
3 weeks ago

I've just seen the following comment 😅

"I Zigged so much to the point that I left my compiler in the rain and got Rust"

#Zig #Rust #RustLang #Funny #ZigLang

zimpenfish
3 weeks ago
#Zig also goes on the good step since `fmt.parseUnsigned` is happy to parse `10_000_000`.
yujiri 🏴
3 weeks ago

i'm excited for the release of #zig 0.11, but also anxious because i'm afraid it won't include async support, meaning #SpacestationDefense 's server will be stuck on 0.10.1 for another long time

Toby Jaffey
3 weeks ago

Saw a nice C++ example of separators in binary literals being useful for register accesses, à la 0b111'11'01'0001. Thought, "I should try and add that to #zig". Discovered it has had support for years
<insert Vince Mcmahon reaction meme>

Javier Salcedo
3 weeks ago

Looks like the latest #Zig version is linking C libs again on my mac, so I think I'll get back to my little game.

Since lately I'm trying to keep my code simple and not over-engineer the design, I decided to scrap all and start all over again.
However, I kept the previous state of development in a separated branch in case I want to go back just to see how far I can go with a language without inheritance.

pancake :verified:
3 weeks ago

Is build.zig stable yet? #zig

Lars Wikman
4 weeks ago

Currently Isaac Yonemoto is absolutely rocking as he shows off Zigler for doing #zig in #elixir and now, importantly for this crowd, in #erlang.

lorddimwit
1 month ago

My 18yo nephew asked me what my favorite #ProgrammingLanguage is and I don’t actually know the answer.

I *use* #C and #Go for applications. I write #Python for data munging and scripts and small apps. I’ve written many thousands of lines of each. I sponsor #Zig.

But is one of them my *favorite*?

I think my favorite would probably be something like #APL or #BQN or #Lisp or #Prolog or #PostScript or #Forth or #REXX or #Tcl or #Eiffel or #REBOL or #Oberon or #HyperTalk or #TutorialD or…

McSinyx
1 month ago

@mhd, compilers backed by #QBE are pretty fast, and I’m also waiting for #Zig’s self-hosted backend.

jbz :catjam:
1 month ago

🔮 Zig Nifs In Elixir
— Isaac Yonemoto

「 The programming philosophy of Zig matches up nicely with the programming philosophy of the BEAM VM and in particular its emphasis on simplicity and structure should very appealing to the practitioners of Elixir 」

#Zigler #Zig #MyElixirStatus #Elixir
https://github.com/ityonemo/zigler

Ian
1 month ago

It's been a really long time since my last blog post, but I just wrote a new one about some abstraction techniques I've been using in #zig: https://ianjohnson.dev/posts/zero-cost-bindings-with-zig/ Hopefully I will keep up the habit a bit better going forward 😆

With Go's toolchain, cross-compiling is a breeze. But what if your repo contains C++ code as well?

Faced with the outlook of setting up and maintaining 15 LLVM toolchains (three host architectures multiplied by five targets), a team at Uber decided to build a C++ version of Go's cross-compiling toolchain.

Their toolchain is based on Zig, which is more lightweight than an LLVM or GCC solution and supports all targets at once. So they only need one toolchain per host.

Result: "Since January 2023, the Zig toolchain compiles all of the C and C++ code in Uber’s Go Monorepo for Linux targets."

Kudos!

https://www.uber.com/en-US/blog/bootstrapping-ubers-infrastructure-on-arm64-with-zig/?utm_source=appliedgo-mastodon

#golang #zig #uber

Angel Munoz
1 month ago

In less inflammatory stuff, looks like ziglang might be actually pretty cool to learn!
Not a fan of having to use the main branch builds but I guess this will improve with time
I just tried the zig.pkg stuff and it worked just nice

Which is great I really didn't want to work with git sub modules
😅 (which I guess I still do but that's not my concern thanks to the pkg support)

Few observations as a completely new and outsider:
too many magic strings in the build.zig (see clap in the image)

That also touches in the following, hopefully for pure zig packages I won't have to actually specify this kind of stuff (or maybe I'm too used to higher level languages?)

Vs Code Tooling is cool but it still lets some errors slip by until the compiler lets you know.
Speaking of errors, they are so alien to me (I'd say because I'm not familiar with low level stuff)

Inline tests are... quite interesting I'm positively inclined to try them, perhaps that will make it easier to test some stuff I tend to just forget and try to test after things are in place (or never at all)

Strings are byte arrays?
I've never manipulated strings that way so I guess if I keep learning zig I'll finally know how to do that stuff!

Overall, I like it I'll keep trying

#ziglang #zig #softwaredevelopment #programming

thomas 🌸
1 month ago

Who is someone you follow on mastodon that is a programmer and posts regularly about new technologies? Looking for people to follow. #code #coder #programming #javascript #rust #nextjs #vercel #cloud #coding #webdev #zig #programmer #reactjs #react #typescript #deno #software

\x1b orhun 👾
1 month ago

If you are looking for making a #ziglang contribution, here is something that linuxwave project needs:

https://github.com/orhun/linuxwave/issues/10

#opensource #packaging #zig

Lobste.rs
1 month ago
rbino
1 month ago

The cool thing about #zig (especially when using comptime) is that you write some code and think "This makes sense, will it work?" and it actually does

Angel Munoz
1 month ago

I've been poking zig today and I'm wondering if I can load whatever wasm I have there in F# with https://github.com/bytecodealliance/wasmtime-dotnet

I think this might be interesting for Perla, users could write their plugins targeting wasm and I could just... load their wasm files in the dev server... I guess I will be able to explore both zig, and wasmtime-dotnet in the process
😂

#ziglang #zig #fsharp #dotnet #wasmtime

Guido Schmidt
1 month ago

This is finally coming together 😊 #zig #webassembly rendering via #thingumbrella + reactive ui with thi.ng/rdom, rstream and atom 🥳

Lobsters
1 month ago
Lobsters
1 month ago

I'm a Type 2 programmer of #C 🙋🏽‍♂️:

"The Two Types Of C Programmers (A Provocative Thesis)", Chris Siebenmann (https://utcc.utoronto.ca/~cks/space/blog/programming/CProgrammersTwoTypes).

Neither #Zig nor #Rust cut it for me as an alternative to C. 🤷🏽‍♂️

#Programming #CProgramming #SystemsProgramming

Lobsters
2 months ago

Zig Bits 0x3: Mastering project management in Zig https://blog.orhun.dev/zig-bits-03/ | https://lobste.rs/s/ibqzqp #programming #zig

Stefan Baumgartner
3 months ago

Intro to the Zig Programming Language by Andrew Kelley

https://youtu.be/YXrb-DqsBNU

#programming #ziglang #zig

Toby Jaffey
3 months ago

Now that I've got a #zig #wasm #gamedev web game lib thing, I think it'd be breaking some kind of internet law if I didn't port #doom to it...
https://ringtailsoftware.github.io/zig-wasm-audio-framebuffer/doom.html
https://github.com/ringtailsoftware/zig-wasm-audio-framebuffer/blob/master/src/doom/doom.zig 🔊

Toby Jaffey
4 months ago

Recently I've been incrementally porting a RISC-V emulator from C to Zig. I really enjoyed it, so have written something about the process. https://www.ringtailsoftware.co.uk/zig-rv32/ #zig #riscv #c #ziglang

Karsten Schmidt
4 months ago

Some of the breaking changes to the #Ziglang build system were a bit counter-intuitive to deal with, but I managed eventually... Just updated the https://thi.ng/wasm-api #Zig/#WebAssembly build script utils to simplify working with modules (formerly "packages") which are distributed via NPM. Because these Zig changes are *heavily* in flux right now, I've added a 2nd script for those of you who want to use the latest Zig v0.11.0-dev versions... The existing one can still be used for Zig versions up to v0.10.1

More info & source:

https://github.com/thi-ng/umbrella/blob/develop/packages/wasm-api/README.md#using-the-zig-build-system

To follow the Zig build system & package manager progress:

https://github.com/ziglang/zig/projects/4

Excerpt from the https://thi.ng/wasm-api readme showing Zig example build scripts...
Diogo Neves ☕️
4 months ago

@diceprophet same here!

Currently developing @Mochi a Unity plugin.
Also learning #zig and #raylib

I’m a bit concerned though, as I need to find contract work soon and feeling like I’m not progressing on that front…

I hope a varied background is a good thing these days 😊

Juan Alvarez
4 months ago

the *proposal* about telemetry added more bad publicity to the language, sad, guess gonna try #zig or I don’t know, #crystal?, #elixir?

#golang

Guido Schmidt
4 months ago

Bitshifting pixel colors. Some basic patterns emerged from learning to use canvas API from #zig via #wasm and #thingumbrella

#ziglang #thingumbrella #genartclub #generative #CreativeCoding #typescript #PixelArt #colors #creativecodeart #generative #GenerativeArt

Karsten Schmidt
4 months ago

@aeva Having worked my "up" from Z80 assembly to eventually dynamic langs like JS/TS/Clojure, it's hard, if not impossible, to switch off considering at least some implications of using certain highlevel features. These days (mainly to learn more about #Zig & #WebAssembly internals) I'm also regularly using @mattgodbolt's compiler explorer to see how various language structures get translated... as others have said already, there's so much to learn from peaking behind the curtain...

Humans interact with their environment in complex local networks that influence zoonotic outbreak risks. Our Centre for International Health Protection #ZIG won transnational research funding from Volkswagen Foundation. #GlobalHealth

➡️http://portal.volkswagenstiftung.de/search/projectDetails.do?siteLanguage=en&ref=9C448

6 project partners from 5 countries in West Africa and Europe join their forces for 4 years. We look forward to expanding our ethnographic research and to collaborating with colleagues in 🇳🇬, 🇫🇷, 🇬🇲 and 🇬🇧 .

➡️rki.de/zig-en

World map with overlaying text box and connections each from the following project partners to loctions on the map: SENZOR. A social-ecological network approach to understanding zoonotic outbreak risk. 

Robert Koch Institute, Centre for International Health Protection (ZIG), Berlin, Germany. French National Research Institute for Sustainable Development (IRD), TransVHIMI Unit, Montpellier, France. Medical Research Council Unit The Gambia at the London School of Hygiene & Tropical Medicine, Banjul, The Gambia. Redeemer's University, African Center of Excellence for Genomics of infectious Diseases (ACEGID), Ede, Nigeria. Zoological Society of London (ZSL), Institute of Zoology, London, United Kingdom
Karsten Schmidt
4 months ago

Excuse me for waxing poetically a little about some #ThingUmbrella #DesignPhilosophy... 😅 But since questions about it do come up fairly regularly and the design does somewhat seem divergent from (dare I say) the majority of other JS tooling in the frontend dev domain, I'd like to quote (as a clarification) what I just wrote in some GH issue:

"As for the auto-tracking & 'everything reactive by default' - that's exactly why all of these other tools require their enterprise-scale elaborate/complex pre-processing/transpilation tooling, something I've been strictly & fundamentally avoiding with all projects in this repo. In https://thi.ng/rdom, there's no "magic" reactivity or any form of centralized/auto-managed behind-the-scenes coordination and all reactivity and other control flow is forced to be explicit (by design). This not only provides super fine-grained control (see https://thi.ng/rstream & https://thi.ng/transducers for various reactivity/transformation building blocks), but also allows rdom to be absolutely nimble, components to be super simple, mix & match declarative/imperative updates, perform minimal updates without any need for diffing, and IMHO is just easier to reason about. I'm well aware this approach is not popular in the wider JS/frontend community, but in other language camps (e.g. #Clojure, now also #Zig) this 'no magic' and 'no hidden control flow' attitude is seen as one of the main design principles & net positives, even if it makes some parts more verbose (one can always build some cheap abstractions around that, if needed)...

As a more general comment about the design of umbrella packages: Most of the provided packages here started out as relatively low-level building blocks and basis for (slowly) building up higher level tooling/convenience layers, to experiment with different techniques & approaches. For years, I've been doing that myself, but also was always kinda hoping/relying that other people would do so too (and then maybe even share/feedback some of those results 😉 - not so much, yet...).

This design approach & focus on composability is totally counter to the much more popular all 'batteries-included' or 'zero-conf' myths and their constant re-invention of the wheel... To me composability and reasoning is 1000% more important!"

1/ What factors were supportive for emergency risk communication in the early phase of #COVID19?

Researchers from our Centre for International Health Protection #ZIG led a cross-country study comparing Guinea🇬🇳, Germany🇩🇪, Nigeria🇳🇬, Singapore🇸🇬.

➡️https://doi.org/10.3389/fpubh.2023.1038989

Guido Schmidt
5 months ago

@toxi 👏 ah yes, thanks for these recommendations! Really helps to dig deeper into #thingumbrella.

Yet I've only stuck to p5 and three for my #genuary pieces... mainly due to convenience.
At least wanted to use #thingumbrella for some of the upcoming prompts, ... probably even some #wasm #zig stuff 😁

Paweł Świątkowski
5 months ago

Long story short: I wrote a Ruby extension in Zig

https://katafrakt.me/2022/12/25/ruby-extension-zig/

#blogged #ruby #zig

Guido Schmidt
6 months ago

@toxi oh yes 🙌 haven't had the time to start using canvas with my edge of chaos experiments, but I'm pretty sure this will simplify some things. Btw. do you plan (have already?) to share some detailed info about how you approach writing a new wasm interop package? Something like "How to use X from zig/wasm". I was able to pick up #thingumbrella + #zig pretty easily, thanks to documentation and examples, but I feel like I don't yet understand completely how #webassembly works 🤔

llimllib
6 months ago

Back to zig for day 10 of advent of code: https://github.com/llimllib/personal_code/blob/master/misc/advent/2022/10/a.zig

I overengineered it in case we have to do more with our "CPU".

Array vs. slice types and memory allocations continue to be a stumbling point for me in zig.

#zig #AdventOfCode

llimllib
6 months ago

Day 9 of advent of code. Went back to bashing solutions out in #python, and found it much more fun after the detour to #zig.

I might come back and play around with zig again, but boy does it feel nice to be comfortable in the language you're using.

https://github.com/llimllib/personal_code/blob/master/misc/advent/2022/09/a.py

llimllib
6 months ago

Day 7 of Advent of Code, in #zig: https://github.com/llimllib/personal_code/blob/master/misc/advent/2022/07/a.zig

I found this a nice, pleasing exercise and I'm starting to feel comfortable allocating memory in zig.

I don't ever free it, mind you, but I didn't hit any segfaults in solving this first more complicated one, which is a big change from the past.

#AdventOfCode

llimllib
6 months ago
llimllib
6 months ago

Advent of code, day 5 in #zig: https://github.com/llimllib/personal_code/blob/master/misc/advent/2022/05/a.zig

This is the sort of problem I wanted to do zig for! Took me lots of learning about when and how I have to allocate, and I had some code that was succeeding intermittently because it was relying on stack memory not getting overwritten.

#AdventOfCode

llimllib
6 months ago

Day 4 solution in zig for of advent of code, topaz kept it chill through the first weekend.

https://github.com/llimllib/personal_code/blob/master/misc/advent/2022/04/a.zig

#AdventOfCode #zig

llimllib
6 months ago

Finished advent of code day 3 in zig just in time to watch the USA game. go USA!

https://github.com/llimllib/personal_code/blob/master/misc/advent/2022/03/a.zig

#AdventOfCode #zig