Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zig rewrite (finally) #517

Merged
merged 32 commits into from
May 9, 2024
Merged

Zig rewrite (finally) #517

merged 32 commits into from
May 9, 2024

Conversation

AnErrupTion
Copy link
Collaborator

@AnErrupTion AnErrupTion commented Jun 15, 2023

Hello everyone!

As you may have noticed for quite a while now, Ly hasn't been a very active project (most that is done is maintenance with light bug fixing here and there). Well, I want to change that.

I'm not very comfortable with C/C++. So I've decided to rewrite Ly into Zig, a language I'm much more comfortable with. This originally came off as a progressive rewrite, however I deemed that this was not the most optimal solution, and thus followed by a full rewrite into "idiomatic" Zig.

Considering I haven't gotten much news from @nullgemm recently (if at all), I believe he doesn't have a lot of time to work on his projects. Thus, I'm taking the initiative, but feel free to stop me.
EDIT: He seemed fine for the project to move to Zig, so I'm concluding I can proceed.

What's the point of this? Mostly to make myself more familiar with the code (even though it's small and tidy, as I said, I'm not very comfortable with C/C++), and to potentially reduce the code size a bit as well. This will, I hope, make it easier (for me at least) to fix bugs and to add new features.

For now, this PR will be a draft until the last things are dealt with (see the description of commit 92e1f08). I'm personally very excited about this, and I hope you are too!

@AnErrupTion
Copy link
Collaborator Author

AnErrupTion commented Dec 11, 2023

I've committed an unfinished full rewrite into Zig that I've been holding off for a while. I'm aiming for a v1.0.0 release: due to this, the configuration file is incompatible with v0.6.0 for example. This isn't true anymore, the configuration file is compatible with v0.6.0.

@AnErrupTion AnErrupTion self-assigned this Dec 11, 2023
@AnErrupTion AnErrupTion changed the title Merge Zig code into master Zig rewrite Dec 11, 2023
AnErrupTion and others added 6 commits December 31, 2023 15:09
Signed-off-by: AnErrupTion <anerruption@disroot.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* Everything

* make matrix.zig a bit cleaner

* make long lines shorter and add changelog

* vi mode

* update changelog

* get errors from child process and (hopefully) fix some other things

* fix utmp entry

* run authentication in a child process

* update changelog

* small code improvements

* change that

* clear terminal on SIGTERM

* Remove LogFile

* moved ini to a lib, fixed alternative langs

* fix logging out

* oops

* code improvements

* consistency

* clearing the env isn't needed anymore (afaik)

* replace vi_mode with a bool

* type aliases, avoiding zeroes(), breaking a long line

* lowercase insert/normal, merge conditionals, code improvements
…suffix

Signed-off-by: AnErrupTion <anerruption@disroot.org>
@AnErrupTion
Copy link
Collaborator Author

Good news everyone! The rewrite should be ready fairly soon as it now works. We're ironing out the last few bugs and missing features, as well as preparing the list of closed issues and PRs.

Signed-off-by: AnErrupTion <anerruption@disroot.org>
Kawaii-Ash and others added 7 commits April 18, 2024 10:27
* clean up child processes on SIGTERM

* small code improvement

* consistency.. i guess?
Signed-off-by: AnErrupTion <anerruption@disroot.org>
* less alloc, update migrator, get DesktopNames from .desktop

* small cleanup

* Update zigini to improve compatibility with old config

* Code improvements

* Update to zig version 0.12.0

* Some fixes

* tiny changes

* remove useless comment

* migrator changes, and small things

* set XDG env vars differently

* free memory on error when appending environments
Signed-off-by: AnErrupTion <anerruption@disroot.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
@AnErrupTion
Copy link
Collaborator Author

AnErrupTion commented May 4, 2024

Other issues closed by this PR: #508, #506, #491, #481, #429, #417, #405, #357, #350, #275, #274, #264, #256, #255, #226, #187

Signed-off-by: AnErrupTion <anerruption@disroot.org>
@AnErrupTion AnErrupTion marked this pull request as ready for review May 4, 2024 21:13
* fix loginConv and auth

* fix potential mem leak with configs

* BIG changes
@AnErrupTion AnErrupTion changed the title Zig rewrite Zig rewrite (finally) May 5, 2024
@AnErrupTion AnErrupTion merged commit d8d2d5a into master May 9, 2024
@AnErrupTion AnErrupTion deleted the zig branch May 9, 2024 21:50
@JAicewizard
Copy link

I was also put of from making some contributions since the C code was difficult to comprehend for me. I will try again with zig, as it gives me more confidence :) (if I find the time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment