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 #LVGL Touchscreen Apps with #ZigLang and test them in the Web Browser with #WebAssembly ... Like this Feature Phone App for Apache #NuttX RTOS on #PinePhone @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 (#ziglang 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 🤔

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