-
Notifications
You must be signed in to change notification settings - Fork 21
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
Why Lua? #22
Comments
Lua is used to allow users to customize freshfetch, rather than make their own fetch just for a different look. The API isn't very user friendly as of writing this, but it literally lets you do anything you want, within the limits of ANSI escape codes. |
Can't these ANSI codes be implemented using string replacing or compiling
the syntax to a text file? Or at least giving an option to build it without
Lua? I feel like this is unnecessary bloat for people that don't use it.
Em seg., 3 de mai. de 2021 20:03, Jack ***@***.***> escreveu:
… Lua is used to allow users to customize freshfetch, rather than make their
own fetch just for a different look. The API isn't very user friendly as of
writing this, but it literally lets you do anything you want, within the
limits of ANSI escape codes.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQRVPRMTJHQJAEXZQWSLA3LTL4TV3ANCNFSM44BJ4DYQ>
.
|
|
What Lua also allows is for users to fetch their own information. I may make a cfg flag that removes lua when I rework the codebase, but it wouldn't be the default. |
fetch their own information.
Why not make a rust config then? you remove the lua (bloat) and allow
customization through editing the source.
Em ter., 4 de mai. de 2021 às 14:33, Jack ***@***.***>
escreveu:
… What Lua also allows is for users to fetch their own information.
I may make a cfg flag that removes lua when I rework the codebase, but it
wouldn't be the default.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQRVPRMMHEF37P2ZRQXF5LDTMAVYPANCNFSM44BJ4DYQ>
.
|
I don't believe in the suckless mentality of forcing users to recompile their programs to configure them. I'm not against having a rust config, but if i did it it would be dynamically loaded or something. |
Yeah, why not bundle rustc and compile config with a flag.
…On Thu, May 6, 2021, 9:28 PM Jack ***@***.***> wrote:
I don't believe in the suckless mentality of forcing users to recompile
their programs to configure them.
I'm not *against* having a rust config, but if i did it it would be
dynamically loaded or something.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQRVPRM4R77CKY3OH62E24LTMMX2DANCNFSM44BJ4DYQ>
.
|
@K4rakara I'm 2 months late in the matter, but what about making it configurable through a TOML file? It's kind of a standard for Rust programs and it works really well. (Maybe I can even try to code that in, hmmm) |
Lua is too complex for a simple project like this. I agree that TOML is a
good, widespread format. If the API isn't good or user friendly, why is it
there?
Em qua., 14 de jul. de 2021 02:19, Speykious ***@***.***>
escreveu:
… @K4rakara <https://github.com/K4rakara> I'm 2 months late in the matter,
but what about making it configurable through a TOML file? It's kind of a
standard for Rust programs and it works really well.
Take a look at Starship <https://starship.rs> for example. It's an
incredibly extensible prompt also written in Rust, and it's configured
with TOML <https://starship.rs/config/>.
(Maybe I can even try to code that in, hmmm)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQRVPRMVHWK75FQKCLEMYSTTXTJXXANCNFSM44BJ4DYQ>
.
|
@Speykious, @matteoturini After reflecting further, I think you're right. I plan to rewrite the codebase in async Rust, with a config.rs file in the repo root. The default config.rs file will have a simple TOML config reader. That way, if you wanted to use it in a suckless manner, you could, or if you wanted to use it with a config file, you could. Rewriting this is gonna take a while, I've got a lot of IRL things going on at the moment. I'll leave additional comments on this thread once I make some headway. |
Glad you thought about it. Good luck with the rewrite!
|
@K4rakara What about using Rhai for the config part? |
While Rhai is cool, I don't think I'm going to support configuring it with it out of the box. I don't know how to explain it well, but Rust crates are heavier, at least when they are statically linked. I'd rather not statically link an entire programming language for configuring a system fetch. |
But how about as an alternative for writing plugins instead of Lua? |
Why is lua necessary? Isn't it possible to not use Lua?
The text was updated successfully, but these errors were encountered: