Zig Language

toxi, (edited )
@toxi@mastodon.thi.ng avatar

A little video preview of a section of the upcoming new thi.ng website:

https://makertube.net/w/hDfuEUudsjskRtdLhVeiVC
(edit: moved from YT to makertube)

It's so nice for me to see these 10 computational art pieces & experiments all in one place (and most of them interactive & randomizable), also in the knowledge that apart from using @vite for bundling, everything else is entirely made using https://thi.ng/umbrella packages and tooling (three of the pieces are also partially written in #Ziglang / #WASM). Unlike the video (which at 1080p is ~110MB), on the website these ten realtime evolving animations together are only a ~650KB download (i.e. ~0.55% filesize) and all of them are running fluidly even on my old iPhone 11! Thanks to using IntersectionObserver, only a single piece is active at any one time...

Another side effect from this exercise: All these projects are only a small selection from the past 3 years, but most of them haven't been updated in the last 1-2 years. There were breaking changes (esp. the Zig parts, which I still have to largely address), but most of the supposedly breaking changes in #ThingUmbrella packages were actually super easy to address. I'm only mentioning this, since it's great to sometimes be completely in a "normal" user's shoes and see how painful (or not!) some of these changes are/can be... I'm often losing a lot of time contemplating making wide-ranging (but IMHO better & needed) changes, but always also trying to consider the effects of those on other people... This anti-bitrot exercise absolutely helped me to vindicate this approach!

#ThingUmbrella #Website #Design #Art #GenerativeArt #Computational #FluidSim #CellularAutomata #Boids #PixelArt #Video #TypeScript #WebAssembly

made,
@made@mastodon.gamedev.place avatar

@toxi @vite before its too late, can you please keep the search? I use it frequently when dealing with thi.ng! It is awesome and i am stunned by the teaser already 😃 great advertising for the library!

toxi,
@toxi@mastodon.thi.ng avatar

@made Don't worry! If anything, I want to expand on it a lot more, plus more cross-referencing and contextual information in general...

guidoschmidt,
@guidoschmidt@genart.social avatar

was a bit more tricky, for I was visualizing the map using a simple pgm image, now with the super large numbers on part 2 I used a single SVG polygon.

guidoschmidt,
@guidoschmidt@genart.social avatar

should be large enough to hold a decent amount of lava 🔥 🌋 😏

janvhs,
@janvhs@hachyderm.io avatar

@linusgroh is the author of one of the coolest projects, I know.
It’s called Kiesel and is a JavaScript-Engine, written in #ziglang.
Reading the code of Kiesel is really cool, because it is annotated with references to the #ECMAScript standard and really good structured.

It is available at https://kiesel.dev and https://codeberg.org/kiesel-js/kiesel

mahmoud,
@mahmoud@qoto.org avatar

Today in zerover (https://0ver.org) news, joins the 0verusers.

Also, notable emiriti surpassed in stars. Truly, is dead and ⁠ is the future.

Featured 0ver users: MAME (https://github.com/mamedev/mame) and ReactOS (https://github.com/reactos/reactos), both fast approaching 30 years of 0veruse!

lupyuen,
@lupyuen@qoto.org avatar

Find out how we build Touchscreen Apps with and test them in the Web Browser with ... Like this Feature Phone App for Apache RTOS on @PINE64

https://youtu.be/8gnD8pW7Bw8?si=cYf_7MYykx8AUTlf

leobm, German
@leobm@norden.social avatar
toxi,
@toxi@mastodon.thi.ng avatar

#HowToThing #010 — Creating a basic web app with declarative UI/DOM creation via Zig/WebAssembly and the super extensible https://thi.ng/wasm-api and its https://thi.ng/wasm-api-dom add-on module, both hybrid TypeScript/Zig libraries. See alt text of images for details.

Demo:
https://demo.thi.ng/umbrella/howtothing-010/

Source code:
https://gist.github.com/postspectacular/08098359f75fa703a2cda64b1258a459

Also see the related project template (and its readme and comments) this example is based on:
https://github.com/thi-ng/tpl-umbrella-zig

Also, several more advanced (and interesting) hybrid Zig/TypeScript examples and extensive docs can be found in the https://thi.ng/wasm-api readme...

#ThingUmbrella #Ziglang #Zig #WebAssembly #WASM #TypeScript #JavaScript #WebDev #Tutorial

raanismo,
@raanismo@kolektiva.social avatar

@toxi it's no trash, but it's nice. @trashbot

Yura,

@toxi Hi, could you tell on what principles would you choose to use Zig/WebAssembly for a web app? When it needs to process a lot of data and do it on a top-notch performance? Like games, CAD apps?

Koehr, German

Okay, maybe I'm missing something here, but why is there a difference between a union and a union(enum)? Why isn't every union behaving like a union(enum) from the start? #ziglang

lhp,
@lhp@mastodon.social avatar

@Koehr A normal union assumes you already know which field to access and so does not waste memory on tags.

jcash,
slimsag,

After more than a year of work and several thousands of commits; we released Mach v0.2 today ( game engine & graphics toolkit) https://devlog.hexops.com/2023/mach-v0.2-released/

nivrig,
@nivrig@mastodon.social avatar

@slimsag @akien You had me at “ziglang game engine”

toxi,
@toxi@mastodon.thi.ng avatar

This week, when I wasn't working on the upcoming thi.ng/fibers library (process hierarchies for cooperative multitasking), I've also been doing minor progress on my & -based (X)PBD (position based dynamics) physics library and the related art piece I've been working on:

Screen recording of 8 pieces of cloth (2D physics sim, driving by agents) floating/swimming/dancing/pulsating in an otherwise blank space. Each piece of cloth has its own color, only consists of particles connected by invisible springs and has an animated texture (2D cellular automata)

toxi,
@toxi@mastodon.thi.ng avatar

@nimbledave Hah, it wasn't what I thought of, but I can totally see it too now! Great reference! FWIW my inspirations were:

https://mastodon.thi.ng/@toxi/109785750223065218

comz,
@comz@genart.social avatar

@toxi Nice work.

palash,
@palash@hachyderm.io avatar

folks does anyone know where did zigforum.org go?

ifreund,
@ifreund@hachyderm.io avatar

@palash The latest zig forum incarnation is https://ziggit.dev

palash,
@palash@hachyderm.io avatar

@ifreund thanks

toxi,
@toxi@mastodon.thi.ng avatar

Very much love & respect @andrewrk's stance of prioritizing quality over quantity and not giving in to pressure to rush things. Zig v0.11 might be slightly delayed, but good things come to those who wait... hopefully, August 3rd! 🤞

https://ziglang.org/news/0.11.0-postponed-again/

toxi, (edited )
@toxi@mastodon.thi.ng avatar

As I've been updating the build files for my various projects & templates, also learned that quite a few of them have to be overhauled/refactored due to syntax changes and a more strict compiler. One example is this from 1.5 years ago which doesn't build anymore without major code updates, but the old build still works:

https://demo.thi.ng/zig/voxel-trace/

Reload for random views. Press x to export current frame. The renderer is incremental (never finishes) and slowly reduces pixel size from 8 down to 1. It would be much faster, but I had some ideas for creating a more stylistic output and in this current state it only renders a fixed area per frame...

The 2-bit 512^3 voxel model was generated with a custom fork of @R4_Unit's voxel automata... 🥰

Other renders & process on my old Twitter:

https://twitter.com/search?q=from%3A%40toxi+voxel+ziglang

Ps. This renderer is heavily using this vector library:

https://github.com/thi-ng/zig-thing/tree/main/vectors

...and is a rewrite of my 2013 hybrid voxel renderer:

https://github.com/thi-ng/raymarchcl

guidoschmidt,
@guidoschmidt@genart.social avatar

TIOBE Index for June 2023: Will AI Affect Python's Dominance?

https://www.techrepublic.com/article/tiobe-index-language-rankings/

ifreund,
@ifreund@hachyderm.io avatar

@guidoschmidt
> Meanwhile, Zig, a programming language spun out of Google

Gotta love the blatantly incorrect information xD Zig has nothing to do with Google.

guidoschmidt,
@guidoschmidt@genart.social avatar

@ifreund yeah didn't understand where that bit of info is coming from either 🤷‍♂️ ... was also wondering in which big data projects zig is used 🤔

slimsag,

Majority of Mach engine is now usable via Zig package manager, only a few Git submodules remain (e.g. due to bugs in package manager), will be 100% submodule free soon. ALSO NO MORE MONOREPO - look at all those 100% standalone packages/projects, beautiful

hywan,
@hywan@fosstodon.org avatar

Make the main zig executable no longer depend on LLVM, LLD, and Clang libraries, https://github.com/ziglang/zig/issues/16270.

Interesting move!

vazub,
@vazub@mastodon.online avatar

@hywan This is a rather expected and natural follow-up to this https://ziglang.org/news/goodbye-cpp/

Eagerly looking forward to seeing this happen as well!

slimsag,

Announcing mach-gamemode - a package which lets your game opt-in to Linux game mode (CPU governer, IO priority, and many more runtime optimizations.) https://github.com/hexops/mach-gamemode

Just call gamemode.start() and anyone with gamemode installed on their system will benefit automatically. Special thanks to @LordMZTE for contributing the Zig port & making Mach engine better every day :) and @feralgames for making gamemode a thing in the first place

Amirography, (edited )

Really liked to try but I have been too spoiled with rust-analyzer and gopls LSPs to be satisfied with what zls offers at this point. Maybe try again in a year?

Correction: it was my configuration.

theothornhill,

@Amirography can you expand? What do you miss, especially in a learning context?

theothornhill,

@Amirography Like this, or did you mean something else?

lupyuen,
@lupyuen@qoto.org avatar
guidoschmidt,
@guidoschmidt@genart.social avatar

🎉 whey, first sound from sending Open Sound Control messages via ... nothing fancy, just a random sequence to drive a VCO, but really happy I got this working. Builting on top of zig-network lib https://github.com/MasterQ32/zig-network

VCV Rack controlled via OSC messages send from . Mainly started to work on this for learning zig and how to write packages.

nitrogenez, Ukrainian

i am thinking of writing a new blog post on dev.to about my experiences with . the ones i got while writing software for Linux (package manager, distribution installation framework, etc). and if you are interested, yes, this software will be mostly usable on any distro other than cuteOS. i am planning to make my own general framework for application development with Zig, which will be available through ABI for C/C++, and maybe others, if the community will help to bind them.

guidoschmidt,
@guidoschmidt@genart.social avatar

day 11 part 1 was super fun... dug out the good old Jack Bresenham algorithm for drawing lines between each pair of stars 🤩 ... 👋 to my former computer graphics professor Prof. Müller 🙃

2023 day 11 part 1: Cosmic expansion. After extending rows and columns between the stars, I've used an oldschool line drawing algorithm by Jack Bresenham. adventofcode.com/2023/day/11
2023 day 11 part 1: Cosmic expansion. After extending rows and columns between the stars, I've used an oldschool line drawing algorithm by Jack Bresenham. adventofcode.com/2023/day/11

neovim,
@neovim@hachyderm.io avatar

Experimenting with a build.zig based alternative to the existing cmake based build pipeline.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • ZigLang
  • GTA5RPClips
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • osvaldo12
  • ethstaker
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • ngwrru68w68
  • kavyap
  • normalnudes
  • cisconetworking
  • JUstTest
  • InstantRegret
  • khanakhh
  • cubers
  • everett
  • Durango
  • tacticalgear
  • anitta
  • modclub
  • Leos
  • tester
  • provamag3
  • megavids
  • lostlight
  • All magazines