toxi, to zig
@toxi@mastodon.thi.ng avatar

Over the past 24h I've been restructuring the infant zig.thi.ng repo, added some new data structures, updated all sources to be Zig v0.11 compatible and added Zig package manager support. Took me a lot longer than expected, but already sure the changes & learning will help to accelerate my process (and re-use) on that front...

Since I don't want the extra overhead and don't want to setup & maintain separate Git repos for each of these tools, for now the new structure will be more like Zig's own standard library, sharing a common top-level module namespace ("thi.ng").

Even though there only a few things to use yet (check the readme to see what's there), I've also written some notes how to update your own build files to use these libs with the package manager:

https://github.com/thi-ng/zig-thing

bortzmeyer, to zig French
@bortzmeyer@mastodon.gougere.fr avatar

Ah, je viens de tester et c'est vrai. Je ne sais pas combien de langages de programmation ont ça mais #Zig impose désormais que les variables qu'on ne modifie pas soient déclarées comme constantes. https://ziggit.dev/t/error-local-variable-is-never-mutated/2238

ekuber, to zig
@ekuber@hachyderm.io avatar

For anyone familiar with , does the following code properly provide Zig's defer concept?

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=4db95b47e54d96f772e0c49bd8b1dc07

justsoup, to zig
@justsoup@mstdn.social avatar

Is there a reason to learn at this point? I know it aims to be a replacement for #C, but is there any actual practical use for it at the moment? (other than fun of course)

iacore, to zig
@iacore@mastodon.de avatar

The Average Experience

toxi, to zig
@toxi@mastodon.thi.ng avatar

After a hiatus of >3 years, this week I've been starting to pick up again some pieces of my "Forthy" cooperative multitasking WASM VM idea[1] and did some new code sketching. Whilst trying to wrap my head around WASM branch tables (to route the different VM ops to their "microcode" impls), I found a great blog post whose author shared similar head scratching experiences and is explaining the correct (if somewhat counterintuitive) syntax very nicely! Now I'm unblocked and in the zone... 🤩🙏

https://musteresel.github.io/posts/2020/01/webassembly-text-br_table-example.html

Not sure yet how to deal with this crazy nested format (and keep the source manageable/readable) once I'll be adding the full set of planned instructions (currently ~25 op groups, each with multiple variations, so 80-100 in total). Already looks like it's gonna take a lot of discipline and/or extreme levels of indentation and scope folding... or actually authoring the VM in (as originally planned), though the WAT route is maybe more lightweight

[1] originally prototyped in 2015 using http://forth.thi.ng (aka https://thi.ng/charlie)

toxi, to opensource
@toxi@mastodon.thi.ng avatar

A week ago was the 1st anniversary of this solo instance & more generally of my fulltime move to Mastodon. A good time for a more detailed intro, partially intended as CV thread (pinned to my profile) which I will add to over time (also to compensate the ongoing lack of a proper website)... Always open to consulting offers, commissions and/or suitable remote positions...

Hi, I'm Karsten 👋 — indy software engineer, researcher, author of hundreds of projects (since ~1999), computational/generative artist/designer, landscape photographer, lecturer, outdoor enthusiast, on the ND spectrum. Main interest in transdisplinary research, tool making, exploring techniques, projects & roles amplifying the creative, educational, expressive and inspirational potential of (personal) computation, code as material, combining this with generative techniques of all forms (quite different to what is now called and implied by "generative AI").

Much of my own practice & philosophy is about , interconnectedness, simplicity and composability as key enablers of emergent effects (also in terms of workflow & tool/system design). Been adopting a round-robin approach to cross-pollinate my work & learning, spending periods going deep into various fields to build up and combine experience in (A-Z order): API design, audio/DSP, baremetal (mainly STM32), computer vision/image processing, compiler/DSL/VM impl, databases/linked data/query engines, data structures impl, dataviz, fabrication (3DP, CNC, knit, lasercut), file formats & protocols (as connective tissue), "fullstack" webdev (front/back/AWS), generative & evolutionary algorithms/art/design/aesthetics/music, geometry/graphics, parsers, renderers, simulation (agents/CFD/particles/physics), shaders, typography, UI/UX/IxD...

Since 2018 my main endeavor has been https://thi.ng/umbrella, a "jurassic" (as it's been called) monorepo of ~185 code libraries, addressing many of the above topics (plus ~150 examples to illustrate usage). More generally, for the past decade my OSS work has been focused on , #C, , , , , , , , /. Earlier on, mainly Java (~15 years, since 1996).

Formative years in the deep end of the 8bit demoscene (Chip Special Software) & game dev (eg. The Brundles, 1993), B&W dark room lab (since age 10), music production/studio (from 1993-2003), studied media informatics, moved to London initially as web dev, game dev (Shockwave 3D, ActionScript), interaction designer, information architect. Branched out, more varied clients/roles/community for my growing collection of computational design tools, which I've been continously expanding/updating for the past 20+ years, and which have been the backbone of 99% of my work since ~2006 (and which helped countless artists/designers/students/studios/startups). Creator of thi.ng (since 2011), toxiclibs (2006-2013), both large-scale, multi-faceted library collections. Early contributor to Processing (2003-2005, pieces of core graphics API).

Worked on dozens of interactive installations/exhibitions, public spaces & mediafacades (own projects and many collabs, several award winning), large-scale print on-demand projects (>250k unique outputs), was instrumental in creating some of the first generative brand identity systems (incl. cloud infrastructure & asset management pipelines), collaborated with architects, artists, agencies, hardware engineers, had my work shown at major galleries/museums worldwide, taught 60+ workshops at universities, institutions and companies (mainly in EMEA). Was algorithm design lead at Nike's research group for 5 years, working on novel internal design tools, workflows, methods of make, product design (footwear & apparel) and team training. After 23 years in London, my family decided on a lifestyle change and so currently based in the beautiful Allgäu region in Southern Germany.

ekaitz_zarraga, to zig
@ekaitz_zarraga@mastodon.social avatar

Okay so some improvements are coming to the zig-build-system in

I prepared support for tunable packages so we can choose what cpu we want to build for, and I also sent a patch for cross-compilation support (I tested it in aarch64 and it works).

Next is to add zig-0.11.0 to guix but that's going to take a little bit longer because I have some tests failing for Mach-O and I don't know why they fail.

Good stuff.

mathiasx, to random
@mathiasx@mastodon.xyz avatar

This is interesting: Hare, a “100-year language” that will freeze at 1.0
https://harelang.org/blog/2023-11-08-100-year-language/

tetrislife,

@mathiasx C is a 100-year language. Even a small worthy improvement like Plan9's C dialect didn't catch on, so I guess first-to-market and compiler adoption renders any other language moot (as much as I would like to like Ada, and like Zig and Forth).

Higher-level languages is where there has been wiggle-room around Python and PHP.

#C

RKI, to zig German
@RKI@social.bund.de avatar

🌍🇿🇲 RKI's Centre for International Health Protection will attend the 3rd International Conference on in Africa in Zambia.

Register for a hybrid side event which reflects on a joint project within the Global Health Protection Programme 🇩🇪!

➡️ https://forms.office.com/pages/responsepage.aspx?id=FPdWT3xHoUShNaL7J2gKryiFgqI_dOFBq0SJf9rrIWpUNzlCV1lUU0pHMTc1TUJESDVQUE02VTFaWS4u

heapwolf, to random
@heapwolf@fosstodon.org avatar

🧵In 2014 when I started getting interested in #P2P, I really didn’t know anything about it except that I found it interesting.

So in 2015, after a lot of reading, I knew a little and I decided to round up everyone I knew who knew something about it and I put on a conference.

heapwolf,
@heapwolf@fosstodon.org avatar

The solution can be used on mobile, desktop, servers, IoT, by any front end developer (using Socket Runtime — https://github.com/socketsupply/socket) but it could also be ported pretty easily to any other language. We are in fact working on a , C++, Go, and Rust versions.

rml, to zig

out of the new "modern #C" or "C+" or whatever languages like (right), (left) seems to be the nicest, at the language level at least. clean block structure is hugely underrated and otherwise nice languages that take it for granted to ensure you can do

node.* = .{ .data = value, .next = null };
if (this.end) |end| end.next = node
else this.start = node;
this.end = node;

...completely ruins a block's clarity with too much syntax, which is part of what makes C code very confusing depsite being a minimal language (I also think there is something nice about the way that C does it, but its nice because you've seen it forever, not because they were great design decisions)

meanwhile I don't need to read anything about hare or even squint to read the code and understand whats happening.

pub fn Oucue(comptime Child: type) type { [ T const This = @This(); const Node = struct { data: Child, LSS [N } gpa: std.mem.Allocator, Bl el (LN end: ?*Node, pub fn init(gpa: std.mem.Allocator) This { return This{ gpa = gpa, BTN ELE VI iy b pub fn engueue(this: This, value: Child) !void { const node = try this.gpa.create(Node); node. = .{ .data = value, .next = null }; if (this.end) |end| end.next = node // else this.start = node; this.end = node; b pub fn dequeue(this: *This) ?Child { const start = this.start orelse return null; defer this.gpa.destroy(start); if (start.next) |next| this.start = next (AT this.start = null; this.end = null; b return start.data; b iy b test "queue” { var int_queue = Queue(i32).init(std.testing.allocator); try int_queue.enqueue(25); try int_queue.enqueue(50); try int_queue.enqueue(75); try int_queue.enqueue(160); try std.testing.expectEqual(int_queue.dequeue(), 25); trv std.testina.expectEaual(int aueue.deaueue(). 50):

shaft, to zig French
@shaft@piaille.fr avatar

Le fameux dont @bortzmeyer chante les mérites depuis quelques temps

ekaitz_zarraga, to zig
@ekaitz_zarraga@mastodon.social avatar

I tried to start writing straight away and it didn't work out because it requires some studying... ugh i hate when this happens but I also appreciate why it happens

bortzmeyer, to zig French
@bortzmeyer@mastodon.gougere.fr avatar

Je suis en train d'apprendre le langage de programmation donc je vous fais profiter ici de ce que j'ai appris. Je ne vais pas détailler les points secondaires, comme la syntaxe, mais plutôt parler des concepts originaux de Zig, comme sa gestion d'erreurs, ses variables optionnelles, ou son modèle de gestion mémoire.

https://www.bortzmeyer.org/mes-debuts-en-zig.html

yxnan, (edited ) to random

Ok, but can your Zig comptime do this?

static assert(!__traits(compiles,
add(1, 2)));

bortzmeyer, to zig French
@bortzmeyer@mastodon.gougere.fr avatar

Je sens que vous n'échapperez pas à un atelier de programmation en aux prochaines

lhp, to zig
@lhp@mastodon.social avatar

Might have written a regex library to unblock porting nfm to zig 0.11.0. Just one more item on my todo list before I'll tag a first release.

https://git.sr.ht/~leon_plickat/zig-exre

macleod, to rust

The Vale Programming language

We also discovered that they (Generational References) enable Vale to have complete memory safety, something no native language has been able to achieve.

  • No borrow checker
  • No GC
  • Writes like Go with a hint of Scala
  • FFI interop
  • No unsafe blocks
  • No comptime related keywords

https://vale.dev/memory-safe

[ # ] :: #c

bortzmeyer, to programming French
@bortzmeyer@mastodon.gougere.fr avatar

Strangest syntax stuff in : quoted idendifiers (so you can have funny characters in variable names):

const @"55_cows": i32 = 55;
const @"isn't true": bool = false;
const normal: i32 = 666;

civodul, to random
@civodul@toot.aquilenet.fr avatar

10:30PM. Reviewing a patch that adds a package for an implementation of APL in Java.

Feeling useful and productive.

pjotrprins,

@ekaitz_zarraga @civodul The zig build system is merged on GNU Guix trunk! Guix is also in Debian/Ubuntu. Zig is one of the most interesting programming languages to have landed in the last 10 years. https://packages.guix.gnu.org/search/?query=zig

ramin_hal9001, to scheme
@ramin_hal9001@emacs.ch avatar

Why Program in C+Python when you can program in Zig+Scheme?

Another bit of gold from by Pjotr Prins of the University of Tennessee. The actual title of the talk is "Why code in Python+C if you can code in Lisp+Zig?" but the "Lisp" in this case is actually Guile Scheme. I didn't know this, but Zig uses the C ABI so it binds to any language that can do FFI bindings to C, including most Scheme and Common Lisp implementations. But why don't I just post the abstract here:

> "Most bioinformatics software today is written in Python and for performance C is used. Lisp has been around for over half a century and here I don’t have to tell how or why programming Lisp is great. I will talk about Zig as a minimalistic new language that is unapologetically focused on performance, tellingly with a blazingly fast compiler. It is advertised as a replacement for Thompson, Ritchie, and Kernighan’s C, but it may even replace C++ in places. Zig uses the C-ABI and does not do garbage collection, so it is ideal for binding against other languages. In this talk I will present combining GNU Guile Lisp with Zig. I’ll argue that everyone needs two languages: one for quick coding and one for performance. With Guile and Zig you get both at the same time and you won’t have to fight the Rust borrow checker either."

bortzmeyer, to zig French
@bortzmeyer@mastodon.gougere.fr avatar

Entre les versions 0.10 et 0.11 du langage de programmation , la fonction de conversion de type @intToFloat est devenue @floatFromInt et cela m'interpelle. Vous auriez fait quoi, vous ?

macleod, to haskell

Various thoughts on too many programming languages, for no discernible reason.

I have been interested in Go since it's very initial release, but their dependence on Google is uncharming to say the least. I still haven't made up my mind on its GC, but its definitely better than most.

I used to do some ML work in .NET and if it wasn't dependent on Microsoft it would be a heavy contender for a great language, but it has far too many Microsoft-isms to ever really go much farther.

Rust is great, I enjoy beating my head against a brick wall battling with the compiler, and their safety is great, but overly complicated and feature-creep is a real problem on that entire project. I do a lot of work these days in Rust, for better (mostly) or worse (mostly-ish).

C is my bread-and-butter, as is Javascript for quick prototyping.

Elixir is great, but Erlang is unwieldy, the community is growing, but not fast enough - and I just can't get my mind to enjoy the syntax no matter how nice it is.

D is a lot of fun, but their GC can be slow at times, and the community is very small and packages are often broken and unmaintained.

Python was my first true love, but I really can't stand the whitespace, again love the language, hate the syntax.

Zig is fun, but just that. Fast, nimble, but early days, a bit confusing, could replace my insistence on C for core projects, but again, early days. I love to use them as a compiler for C, much faster than the defaults on any of the others.

Odin is one I love to keep an eye on, I wish I could get behind using it for more things. When I first took notice ~4 years ago the documentation was a bit scattered, but it looks much better now. The developer behind it is incredibly cool, could be seen as the next Dennis Ritchie imo. Runes are dope. The syntax is by far my favourite.

Julia, I love Julia, but performance last I tested was a bit of a miss, and by miss, it required a decent chunk of compute for basics, but when you gave it the system to throttle, it would be insanely productive to write in. Javascript is something that I prototype even syscalls in, but Julia is just the same but much better and more productive (and less strange) in many regards. I am really hoping this takes over in the ML/Data world and just eats Python alive. I've heard there has been major work in the perf department, but I haven't had reason to try it out lately.

Ada, memory safety before Rust! Great language, especially for critical applications, decades of baggage (or wisdom), slow moving language, insanely stable, compilers are all mostly proprietary, job market is small, but well paid, great for robotics, defense, and space industry types, but the syntax is... rough. Someone should make a meta-language on top of Ada like Zig/Nim/Odin do for C, or Elixir does for Erlang.

The others: Carbon, haven't tried; Nim, prefer when they were "Nimrod" (cue Green Day), decent but not my style; Crystal, seems cool, but not for me; Scala, great FP language, but JVM; Haskell, I'm not a mathematician, but my mathematician friends love it. I see why, but not my thing as much as I love functional languages. I'll try it again, eventually. I did not learn Haskell a great good.

I tend to jump from language to language, trying everything out, it's fun and a total timesuck.

[ # ] :: #c #d

marcuse1w,

@macleod

Very nice write up. I am doing the same just for fun really.

I really like Ada, I used Modula2 and Modula3 as well, played a bit with Oberon, but Ada is surprisingly powerful and jet it all feels manageable, especially as you can leave features out. If you don’t like OO in Ada for example then don’t use it and it’s still a quite elegant and useful language. If you do low level programming the bit fiddling and register management feels like a joy and not like a loaded gun that randomly shoots at you. The relative safety helps and with Ada-SPARK you can even get proofs.
But… at least for me on an aarch64 Laptop I sometimes struggle to get the compiler on the system I want, that makes it less fun. I guess if I would use a PC things would be easier.

Not really a fan of C, I don’t think you can love C and Ada ;-)
But there are a lot of aspiring C alternatives.

Zig seems to be on the up but it’s not a big jump from C except for compile time execution.
I really like Odin, it looks kind of like C but feels easy and comfortable, especially if you like graphics. You focus more on your algorithm than on your language.

Then there more like C2, C3 (not very original names), D, V, Jai, Scopes, Carbon. They all have their own benefits but the communities are quite small.

I always want to learn Rust properly but always get distracted. The functionality looks great though.

I also wanted to learn a Lisp and finally tried Janet. A very pleasant small language. Compiles to a single binary. The parentheses are not as distracting as I thought. But I also did not quite get why some people get so excited about Lisps.

#c

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