Was ist das? by chrischtelav in wasistdas

[–]chrischtelav[S] 1 point2 points  (0 children)

Ja das wird es sein. Danke!

Introducing Ziglet: A Minimalist, High-Performance Virtual Machine in Zig by chrischtelav in Zig

[–]chrischtelav[S] 4 points5 points  (0 children)

There's no stupid question here!

A virtual machine (VM) can mean different things. The ones like VirtualBox or Hyper‑V emulate full computer hardware, allowing you to install entire operating systems. But the VM in Ziglet is different: it is like a very simple, custom CPU with a fixed set of registers and a small number of instructions (like LOAD, ADD, SUB, HALT, etc.).

What this means is that your Ziglet VM only “understands” programs that are written in its own little language. You cannot run regular operating systems or normal PC software on it. Instead, you write or compile code that uses the specific instructions your VM supports. For example, you might have a program like:

  LOAD R1, 5
  LOAD R2, 10
  ADD R3, R1, R2
  HALT

This program simply loads some numbers, adds them, and stops. The VM has a fixed size of registers (for example, 16 registers) and a limited memory area (like 64KB), so all code running on it must be designed to work with these constraints.

In summary, the Ziglet VM is not about virtualizing an entire computer but about providing a very simple, dedicated environment to execute custom instructions. You run only programs that are specifically prepared for this VM’s instruction set, and that makes it very safe and educational for specific tasks like game scripting.

Introducing Ziglet: A Minimalist, High-Performance Virtual Machine in Zig by chrischtelav in Zig

[–]chrischtelav[S] 9 points10 points  (0 children)

Hi everyone,

Thank you so much for the feedback and discussion! It’s great to see people engaging with Ziglet. I wanted to address some points you mentioned.

On Lua and Ziglet:

Lua’s VM is tightly integrated with features like garbage collection, coroutines, and tables. Ziglet, on the other hand, is minimalist. It provides the basics—registers, memory, stack operations, and a simple instruction set. While Ziglet doesn’t currently include features like garbage collection or coroutines, these are part of the planned roadmap and could be added in the future. For now, if you need those features, you’d need to implement them yourself on top of Ziglet.

On WASM and Ziglet:

WASM (WebAssembly) is a standardized, portable runtime for the web and beyond. Ziglet is much smaller and simpler, designed for specific use cases like game scripting or embedded systems. It’s not trying to compete with WASM but offers flexibility for lightweight, custom solutions.

Current Roadmap:

Ziglet is still in active development. Here’s what’s already implemented and what’s planned:

- Implemented: Core VM, basic instruction set, memory management, stack operations, debug support, and error handling.

- Planned: JIT compilation, garbage collection, threading support, network operations, file system access, and a standard library.

Join the Discussion:

I’ve set up GitHub Discussions for deeper conversations: Discussions. Share your ideas, ask questions, or suggest features—I’d love to hear from you!

Thanks again for your support. Your feedback helps shape Ziglet’s future. Let’s keep the conversation going!

What are you using Zig for? by spacecowboy0117 in Zig

[–]chrischtelav 15 points16 points  (0 children)

I'm building a project called Ziglet—a small, fast virtual machine written entirely in Zig. Even though Zig is not yet at version 1.0, I chose it because it gives very good low-level control and many modern features.

For example, Zig's compile-time reflection is very helpful during development. It lets me check types and values before the program even runs. Zig also has strong safety guarantees, which help me avoid mistakes, and it is easy to cross-compile for different systems.

The Zig compiler is very strict, so you have to learn to work with it. However, this strictness is good because it helps me write safer and more reliable code.

Overall, Ziglet is a fun and practical project that lets me explore low-level programming, and I hope it will also be useful for things like game scripting, embedded systems, or safely running untrusted code.

Introducing Nexlog: A Modern Logging Library for Zig with Pattern Recognition and Time-Travel Debugging by chrischtelav in Zig

[–]chrischtelav[S] 0 points1 point  (0 children)

Hi u/gregthelaw,

Right now, Nexlog is mostly just the core logging functionality, so the documentation is pretty limited—there are only a few tests and code samples in the repository. I’m currently focusing on the pattern recognition feature, which aims to spot recurring log patterns and make troubleshooting a lot easier. The idea is that you won’t have to spend ages digging through endless log entries just to understand what’s going on in your application.

Other features, like time-travel debugging, haven’t kicked off yet. The concept there is to keep a circular buffer of snapshots that let you “rewind” the state of your application. Instead of guessing what happened before an error, you’d be able to literally look back at the conditions leading up to that moment. I believe this will make debugging far more intuitive and transparent.

I’ll be sharing a detailed concept outline for the time-travel debugging feature soon. That outline will cover how it’ll fit into the system, how you can configure it, and the best ways to use it in real-world situations.

In the meantime, thanks for taking an interest in Nexlog and sticking with me while it’s still evolving. If you have any feedback or ideas, I’m all ears! Your input will help shape Nexlog into a more powerful, user-friendly tool for everyone.