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

Install fails on artix linux #227

Open
devosalain opened this issue Feb 17, 2025 · 8 comments
Open

Install fails on artix linux #227

devosalain opened this issue Feb 17, 2025 · 8 comments

Comments

@devosalain
Copy link

nimble install gintro

/tmp/gintrosalewski/gen.nim(1462, 27) Error: tuple expected for tuple unpacking, but got 'seq[string]'
stack trace: (most recent call last)
/tmp/nimblecache-1050319643/nimscriptapi_1486438167.nim(224, 29)
/tmp/nimble_29327/githubcom_stefansalewskigintro/gintro.nimble(77, 7) installBefore
/tmp/nimble_29327/githubcom_stefansalewskigintro/gintro.nimble(62, 7) prep
/usr/lib/nim/system/nimscript.nim(265, 7) exec
/usr/lib/nim/system/nimscript.nim(265, 7) Error: unhandled exception: FAILED: nim c gen.nim [OSError]
Tip: 5 messages have been suppressed, use --verbose to show them.
nimscriptwrapper.nim(161) execScript

Error:  Exception raised during nimble script execution
@StefanSalewski
Copy link
Owner

Thanks for reporting.

I strongly assume that it fails now everywhere :-(

Gintro was the attempt to bring some high level GTK support to Nim, it was actively developed from 2015 up to 2021. That was not that easy, I think I spent 1600 hours of work on it, of course unpaid. I got really not much support, and I think over the years only very few people actually used it. As the Nim main devs have been not very friendly over all the years, and most of my friends had left Nim already, I finally left it as well in early 2023. I have not followed its further development any longer, sorry. I think there have been attempts to create other GUI toolkits for Nim, I think one was Figma/Figet, and I think there was also something about GTK, with a more declarative concept -- I can not remember the name.

From your error message, it seems to be about tuple unpacking, so it might be similar to #226. The Nim compiler changed relatively often -- GTK as well -- making a lot of fixes necessary over all the years. This tuple unpacking was relatively easy to fix, a few people did it locally. But I just gave up with that, as it makes not much sense for one or two users -- and if the compiler dev just introduces changes without caring for consequences.

I am now mostly using Rust -- not that I like Rust that much, but it just works, and there are some friendly and helpful people in the Rust community. Rust GUI is not fully solved -- gtk-rs is ugly, and the other native Rust GUI toolkits are not perfect as well.

For Nim: I heard they were working on a total rewrite, something like Nimoy? Well, maybe with AI that might be manageable for two or three part-time devs. But Rust, Go, Julia, Mojo, Kotlin, and some more are all strong competitors.

Well, I hope you will find some GUI solution for Nim,

Best regards, Dr. Stefan Salewski

@enthus1ast
Copy link

enthus1ast commented Feb 19, 2025

I finally left it as well in early 2023.

sad :/

@DrunkenAlcoholic
Copy link

DrunkenAlcoholic commented Feb 20, 2025

That is a shame Stefan, It looks like you have put a great deal of work into this, and I honestly find it non believable only a few of people were actually using this, I don't think I need to say GTK is one of the most popular tool kits on Linux, and having bindings to be used in Nim would have been a god send. Could you please describe the fix for the tuple issue so someone can make PR to fix it, I am assuming you since no longer work on this, but still have the ability to accept and approve PR's, that once a fix is submitted by the community you would approve it?

Thanks again for your fantastic work, hopefully we can get this working again for current Nim

@enthus1ast
Copy link

enthus1ast commented Feb 20, 2025

To be honest i was not aware that this tuple unpacking has ever worked this way.
It was the other way around, a proc that returned a tuple can be unpacked into multiple vars.
Edit: My guess it that this was a bug in the compiler, which now is fixed?

@StefanSalewski
Copy link
Owner

please describe the fix

That tuple unpacking fix was very simple, a few people including myself applied it locally, I think we had 3 lines to modify. I think creating a temporary variable was involved. For each Nim beginner it was obvious how to do it, from the compiler error message. But I assume now, two years later with some more compiler changes, and changes in GTK as well, there might be again more issues.

I would strongly recommend to try other Nim GUI toolkits first. But I can really not remember their names. I once created a list in my book, see https://nimprogrammingbook.com/book/nimprogramming_rouge_molokai.html#_gui_toolkits, but that list was last updated in 2022. I think two or three years ago one more GTK related Nim GUI appeared, but I can not remember the name or find it with Google, sorry.

GTK is unfortunately hard to support. The Rust people took a gigantic effort to support it with gtk-rs. That have been a few really bright people. Gtk-rs works, but it is ugly with all the unwraps, and hot easy to use. So Rust users typically use some of the other Rust GUIs like EGUI, Iced, Druid, or web based ones.

Best regards,

Dr. Stefan Salewski

@StefanSalewski
Copy link
Owner

To be honest i was not aware that this tuple unpacking has ever worked this way.
It was the other way around, a proc that returned a tuple can be unpacked into multiple vars.
Edit: My guess it that this was a bug in the compiler, which now is fixed?

Yes, I think you are right. I saw it somewhere in my early Nim days, it worked at least for 7 years, and then stopped working. I saw no announcement for the change, seems that they did not testing for regression with gintro. We had dozen of such tiny changes from the Nim side over all the years. And a few from the GTK side. While I got some support from the GTK side, e.g. by Mr Droege and others from the Rust team, I got no support from Nim. And a few Nim macro issues have been a bit hard for me.

@StefanSalewski
Copy link
Owner

@devosalain
Copy link
Author

devosalain commented Feb 21, 2025

For the record i found crystal language has bindings to gtk,
https://github.com/hugopl/gtk4.cr/tree/main

Nim has a wrapper for wxwindgets.

For scala there is
https://scalafx.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants