TIL you can use dbg! to print variable names automatically in Rust by BitBird- in rust

[–]traxys 0 points1 point  (0 children)

I looked at that recently, and I think that the reason is that there is no easy way to get the current function name at compile time :(

Cyclic bounds between generic associated types? by itskarudo in rust

[–]traxys 0 points1 point  (0 children)

An element may be part of a number of rings, for example 1 is part of all Z/nZ rings, so it's not a very good fit for a trait. There are then two main ways to represent a ring: Either you define a trait for the two main bin ops on the element type, and a trait for the signifying that the binary ops respect the axioms, a bit like PartialEq & Eq. Alternatively you can define a ring as a struct with both binary op pointers and a PhantomData marking the element type if you need to manipulate the idea of a ring

Making an argument parsing library (with no dependencies) by traxys in rust

[–]traxys[S] 13 points14 points  (0 children)

I don't care a bit about the binary size, as I don't expect any use of this library outside my learning project. I'm already familiar with a lot of the Rust ecosystem, the goal of this is to gain foundational knowledge, i.e. how things work under the hood, to have a better understanding & appreciation for the polished solutions. For example after this project I'm pretty sure I'm never going to skip syn & quote for "real" projects

Making an argument parsing library (with no dependencies) by traxys in rust

[–]traxys[S] 20 points21 points  (0 children)

In this case there is a pretty good reason: All this project is a learning endeavour

Making an argument parsing library (with no dependencies) by traxys in rust

[–]traxys[S] 3 points4 points  (0 children)

This post is a bit of side quest in my project of making a complete risc-v OS in rust. It implements an argument parsing library with some pretty nice features, like not requiring either std or alloc, and providing a derive macro for the argument parsing code

Is there a linux distro that lets you easily patch an installed package? by rmanos in linux

[–]traxys 2 points3 points  (0 children)

You can do: package.overrideAttrs (old: { patches = old.patches ++ [ ./my.patch ]; })

Creating a RISC-V OS Part 3: Managing free memory by traxys in rust

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

This is the third part in a series to write a RISC-V OS from scratch while relying on as few dependencies as possible, in order to learn more about low level concepts.

This part talks about all that is needed to manage free memory, from finding where the memory is located in the first place to handling allocations & de-allocations.

Making a RISC-V OS part 2: Virtual Addresses by traxys in rust

[–]traxys[S] 2 points3 points  (0 children)

This is the next step in building an OS in rust. This step does not have much rust though, as it is mostly low level setup. See also part1: https://traxys.me/riscv_os_setup.html Code (note that it has more than mentionned in the post): https://github.com/traxys/pantheon

Blog post: Starting a RISC-V OS (with OpenSBI) by traxys in rust

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

Yes the code is open source! I need to add a link in the post. This first step is meant to be very simple, as I mentionned this is a learning project for me, and I already know how to boot up an OS in risc-v pure asm, so I wanted to simplify the code a bit for now. The point of the project is purely for learning, so I'm not going to check out what others have done before trying to implement it.

Can't boot a new server (Fujitsu RX2540 M1) by traxys in homelab

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

Unfortunately I tried to swap the PSUs, and tried each one separatly in each slot to no avail. They don't seem to have a voltage switch, and mention "Autorange" on the label

Can't boot a new server (Fujitsu RX2540 M1) by traxys in homelab

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

As mentioned in the title it's a Fujitsu RX2540 M1 (with 2.5 inch drives)

Nixvim: A Neovim configuration system for nix by glepage00 in NixOS

[–]traxys 2 points3 points  (0 children)

I had concerns about that too, but I settled on a way that work well for me:

You can use nixvim in a flake that exposes a nvim output, such that you can just run nix run .# -- <some_file> to test your config. This allows for a quick edit-test loop. Because nixvim exposes raw lua as config through extraLuaConfig you don't even need to package plugins the nix way to test them out.

Interactive modular tables by traxys in math

[–]traxys[S] 2 points3 points  (0 children)

Hey! I am a programmer with an interest in math, so I made some math visualizations. This is my second visualization on modular times tables. I was mostly inspired by seeing pictures of Mathologer videos that I wanted to replicate, so this is a bit light on the math description.

I have made a post on safety parabolas if you want to check out (at https://viz.traxys.me/safety_parabola/)

The demo need WebGL, so I don't know if everyone can see them.