lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

64
active users

#zig

1 post1 participant1 post today

Yritin eilen kirjoittaa #Zig'illä ohjelman, joka lukisi tekstimuotoisesta tiedostosta liukulukuja ja laskisi niiden #keskiarvo'n ”Raiding the lost average” -projektiani varten. Ei ole vielä onnistunut 😜 Lähinnä vaivaa tuottaa perus-I/O eli miten lukea tekstitiedostoa järkevästi rivi riviltä. Ilmeisesti Zigin ”koneläheisyys” tarkoittaa, että yksinkertaisetkin asiat voivat olla vaikeita. #atkjuttuja
legisign.org/koti/lost_average

legisign.orgLegisign.org ▸ Raiding the Lost Average

#vkuroko has full #Linux support now!

vkuroko is a project programmed in #Zig that brings the #Kuroko scripting language (dialect of #Python) to #SourceEngine #Games.

Originally only ran on Windows but now works on Linux!

github.com/evanlin96069/vkuroko

The creator is a great guy. You should check out his other projects like his #ika language. Go show him some support!

github.com/evanlin96069/ika

github.com/evanlin96069

Integrating Kuroko with Source. Contribute to evanlin96069/vkuroko development by creating an account on GitHub.
GitHubGitHub - evanlin96069/vkuroko: Integrating Kuroko with SourceIntegrating Kuroko with Source. Contribute to evanlin96069/vkuroko development by creating an account on GitHub.

Wrote a minimal HTTP server with sendfile support in ARM64 assembly. Started with a simple Zig server and ported to assembly syscall by syscall. Mostly straightforward but took a while to figure out memory related instructions and how to work with structs in assembly.

code: gist.github.com/rrampage/d31e7

Compiles to ~620 byte binary after `sstrip -z`

currently, it just serves an index.html. Will probably get around to adding `getdents64` support and maybe some multi-threading with `epoll` support

Here's a screenshot of serving a Game of Life WASM demo from a 10 year old android phone running this server

How did I not know of sr-speedbar? I used imenu-list for this use-case previously, but this is so much nicer.

Required a tiny configuration to work with #zig but now works flawlessly.

#StreamReport

Last night on stream, we hit four major milestones in my my 6502 #emulator:

1. We got the clock code working, so instructions actuary get executed

2. We got our first instruction actually executed. ldx!

3. We.... Ran our first program! A simple thing with a very limited number of instructions, but it was a program and it executed to completion!

4. Implemented all of the remaining instructions!

That's a lot of stuff done on one stream, eh?

Thursday we'll see about wiring things up to a gui; the little TUI I have is great, but it'd be nice to be able to interact with the emulator more, push and poke, things like that, and I think the best way to accomplish that is going to be an immediate mode gui. Probably imgui for now, with the understanding that we'll need something else when we start implementing actual graphics hardware for the emulator.

#zig remains the greatest language of all time. Zero barriers between me and getting things done.

Here's a link to the main commit from last night: codeberg.org/b4ux1t3/zigsty-fi

Hey I'm still looking for work.
I've applied to a lot of places in my area and I'm getting nothing.

I'm a programmer at heart, but I've also been looking for regular entry-level jobs because there haven't been any coding positions open at my level as far as I could tell.

If you can offer me a job, it might save my butt. And if you can't offer me a job, could you at least share this post?

I live 30 minutes away from Bellevue if that helps.

Well... I went on the deepest of dives today to fix the link error I've been tangling with while working on tigerbeetle-hs!

First, GHC passes `-lm` near the beginning of the linker flags it generates when compiling an executable. Pretty normal.

Unless you're linking a shared object file compiled from Zig.

Zig's build tool chain vendors it's own versions of libc for the various target platforms. When you call 'linkSystemLibrary2` and tell it to link `"m"` and tell Zig that's it's needed... well, it ignores you.

Zig's build tool sees that you asked to link a system library once and it links libc... and nothing else.

All of this means that if you pass `-lm` before you link the Zig shared object, you get a relink error. Because Zig helpfully provides an implementation for the libc symbol (in my case, `sin`) and the linker already has an implementation for that symbol... in libm.

It looks like Zig's tool chain doesn't include any of the GNU library paths in the RPATH of the elf header and so the linker asks you to relink the library against libm... which you can't actually do with Zig's build tools.

Trying out a hack with nix's `patchelf` to add the RPATH's into the nix store for the glibc so that the object file can declare its dependency on libm's implementation and will have to work through the community to see how we can get Zig to play nicer with systems.

Ooooooooooooh.

#Zig files are, themselves, structs.

This is awesome, and explains some of my confusion around namespacing and stuff.

Also: custom formatters for structs? So nice. Love the member accessing syntax.

Hot damn I haven't been this excited about a language in a few years.

Replied in thread

@mistersql I like the Rust ecosystem, but I don't like the syntax. I've never used Go other than printing "Hello World" some years ago, which produced a 5 MB (or so) binary. That's super ugly. Maybe there's a switch where you can link your binary to external runtime libraries, which would make the actual binary small. So I guess the "right" alternative to #Rust would then be #Zig.
#rustlang

Hello, Mastodon 👋 Time for an updated #introduction.

I’ve been here for a couple of years, mostly reading, occasionally posting. I’m a programmer by profession, and I’m interested in programming languages, the practice of software engineering, the history and future of computing, and permacomputing / frugal computing. Right now I’m learning the #zig programming language and having a lot of fun with it.

Other interests include bouldering (rock climbing), rewilding / nature conservation, and urbanism, ... and I’m just starting to get into photography.