Software engineer, functional programming enthusiast.

  • 3 Posts
  • 133 Comments
Joined 3 years ago
cake
Cake day: April 27th, 2021

help-circle

  • I would go with Guile, because it is built-in to the Guix Package Manager which is a really good general-purpose package manager.

    It ticks several of your boxes:

    • has a CLI interpreter
    • is a general purpose language, Scheme, amd compliant with revisions 5, 6, and 7 of the language standard
    • allows writing in a functional style (it is one of the original functional programming languages)
    • small disk footprint, but still large enough to be “batteries included”
    • decent documentation, especially if you use Emacs
    • simple setup: not so much, unless you are using Guix to begin with. The standard distribution ships with lots of pre-built bytecode files, you need an installer script to install everything.

    It also has pretty good libraries for system maintenance and reporting:


  • I’m a communist but I suddenly realised that American conservatives should all be hardcore Linux enthusiasts. Why is this not already the stereotype?

    Libertarians and conservatives in the US demand liberty only for the already wealthy and powerful upper class, the liberty to enslave and exploit whomever and whatever they choose. They believe the ultra-wealthy have somehow earned the right to do so. On the contrary, the socialists, especially the anarchists, are opposed to unjust hierarchies, and the hierarchy created by wealthy and politically powerful classes are the most unjust of all – quite the opposite of the libertarians and conservatives.

    Libertarian (Liberal) propaganda appropriates the more popular socialist ideologies while conflating liberty for only the wealthy/powerful versus liberty for all people. One can see appropriation done in the same way in the very name of the National Socialist (Nazi) party of Germany. These tactics that were used by the Nazis are still used by various American conservative and libertarian parties, who mostly align under the umbrella of the Republican Party. Just look at what the Trump cult weirdos are all saying nowadays. It is pure KKK and Nazi ideology resurrected, under a thin veil of euphemisms.

    So if you take at face-value what libertarian and conservative politicians in the US say publicly about freedom, small government, civil liberties, etc., then they ought to be very enthusiastically in favor of Linux, but it is all just propaganda. They don’t care about freedom, only freedom for the elite clique of their supposed “supermen,” the wealthy elites, the freedom to exploit groups of people who they hate most — take your pick: foreigners, black people, women, gay and trans, Jews, Muslims, the “woke,” the “leftist,” etc. The libertarians and conservatives hate things that benefit society at large, because what benefits society also benefits these people they hate.

    Linux is pretty authentically a community project for the good of society, and it is truly subversive to the authority of the corporations and elites. So the various libertarians and conservatives of the US recognize Linux as a threat. Only that small group of privileged, middle-class libertarians stupid enough to be duped by the wealthy elite propaganda believe that free software is aligned with their ideology.


  • both can be installed side by side if you have enough disk space.

    Yeah, this is exactly what I do using QEMU and Aarch64 Debian. I suppose I could try the Asahi Linux in QEMU but that actually might be more difficult since I don’t think QEMU can emulate the MacBook hardware, as far as I know. And I can’t do dual boot, I want to be able to switch back and forth between Mac OS and Linux without rebooting anything.



  • I switched to Linux permanently in 2008. Last OS I used before Linux was Mac OS X version 10.4 “Tiger” (if I recall correctly) which is what came with the Macintosh PowerBook that I had bought roughly in the year 2004. I have never used Microsoft software unless someone was paying me to, but at the time, Windows XP was still all the rage even though Microsoft was trying to get everyone to switch to Windows Vista. (Vista got a lot of well-deserved hate too, sort of similar what we see with Windows 11 right now, actually.)

    Anyway, I was a die-hard Apple fanboy, but getting more and more into free software and I kept on using Macports/Homebrew to build Linux stuff I found online, but back in those days a lot of apps I wanted to try did not have good support for the Darwin kernel build of GCC which was pretty old compared to what Linux was using at the time. Occasionally a build would fail, and I would try to port the software on my own, with the idea of maybe submitting a package to Macports. But after a while I realized, “if I want to use Linux software, why not just use Linux?”

    So I bought a Netbook (Dell Inspiron Mini 10) with Ubuntu pre-installed. I really loved that little computer, I used it for a good 5 years until I needed a more powerful computer. I still have it, actually. I never went back to Apple until this year when I took a new job where they wanted me to use a MacBook Pro. (Again, not using proprietary software unless I am well paid.)

    I can say with confidence that Linux is considerably better than Apple’s operating systems. I use Aarch64 Debian 12.5 in a QEMU on that MacBook for most things, only switching over to Mac OS when I really need to.




  • Ramin Honary@lemmy.mltoLinux@lemmy.mlJanus, a simple text editor
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    5 months ago

    I have been using both professionally for at least 15 years and IMO without a doubt Qt is so much easier to use, read and work with it’s not even a comparison.

    I also use Qt professionally, and it is indeed an excellent GUI library. I have absolutely no complaints with how well it is designed and how easy it is to use, and I am consistently amazed by how beautiful the results are, especially with desktop environments like KDE Plasma.

    My complaint, which is really a deal-breaker for me, is that Qt effectively forces you into using C++ and Python and/or QML+Quick. For the non-professional software I develop, I want my apps to be scriptable by end users, and I do NOT want to force them to choose between only Python or Quick as their scripting language. For building scriptable, truly cross-platform GUI apps, Gtk is the only game in town.

    Gtk is much harder to use only if you are coding in C, because it depends so heavily on the C preprocessor to hack together the infrastructure that C++ has built-in. But because it is so easy to bind scripting languages to Gtk, you only need to program a few very core features in C, the rest you can program in any scripting language of your choice. This very important feature I think is a worthwhile trade-off for making it harder to code in C, especially if you are able to code the larger portion of your application (which is almost always the case) in a scripting language like Lua or Scheme. (Although I admit, most Gtk scripting is done in Python, just as it is with Qt.)

    Plus in comparison to Qt there are almost no commercial outfits using Gtk professionally and selling products based on it.

    Perhaps, but I would point out that both Canonical and RedHat (now IBM) are both heavily invested into developing Gnome, and I believe most of the paid Gtk development has been funded by these two companies.>


  • Ramin Honary@lemmy.mltoLinux@lemmy.mlJanus, a simple text editor
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    5 months ago

    As someone who is trying to develop my own Linux destkop apps, I can tell you that the day that I switch to Qt is the day Qt provides a feature that works as well as GObject Introspection (GI) does for Gtk. GI creates a cross-platform database of objects, properties, and signals, for auto-generating language bindings, so you can customize your Gtk programs with scripting languages (Python, Lua, Vala, JavaScript, Scheme). It is a relatively simple task to bind any programming language to GObjects thanks to GI.

    Qt does have a QMetaObject system which is similar, but C++ is a difficult language to bind to on most operating systems because of how native language functions are labeled in the library code – names are “mangled”, a hack to work around the miss-match between object libraries features (.so or .dll files), which do not provide the ability to “overload” functions, and C++ libraries features, which do provide this ability. The function/method overloading feature is used quite often in any C++ program. But decoding mangled names for language bindings can be very error-prone without the sort of automation that GI provides.

    As it is now, really the best way to develop Qt apps is to use C++, with Python for scripting, because these languages are the most well-supported by Qt (C++ natively, Python being the most stable and well-maintained “foreign” language for Qt). And I like neither of these two language. Gtk gives you a much larger selection of scripting language choices, even though it is programmed in C, and this is thanks to how well GObject Introspection works.




  • Awk is a programming language designed for reading files line by line. It finds lines by a pattern and then runs an action on that line if the pattern matches. You can easily write a 1-line program on the command line and ask Awk to run that 1-line program on a file. Here is a program to count the number of “comment” lines in a script:

    awk 'BEGIN{comment_count=0;} /^[[:space:]]*[#]/{comment_count++;} END{print(comment_count);}' file.sh
    

    It is a good way to inspect the content of files, espcially log files or CSV files. But Awk can do some fairly complex file editing operations as well, like collating multiple files. It is a complete programming language.

    Sed works similar to Awk, but it is much simplified, and designed mostly around CLI usage. The pattern language is similar to Awk, but the commands are usually just one or two letters representing actions like “print the line” or “copy the line to the in-memory buffer” or “dump the in-memory buffer to output.”


  • Whenever I open the symlink, does the software (player) understand «oh this file seems like a symlink, I should go and open the original file», or it’s a filesystem level stuff and software (player) basically has no idea if a file I’m opening is a symlink or the original movie.mp4?

    Others have answered well already, I just will say that symlinks work at the filesystem level, but the operating system is specially programmed to work with them. When a program asks the operating system to open a file at a given path, the OS will automatically “reference” the link, meaning it will detect a symlink and jump to the place where the symlink is pointing.

    A program may choose to inspect whether a file is a symlink or not. By default, when a program opens a file, it simply allows the operating system to reference the file path for it.

    But some apps that work on directories and files together (like “find”, “tar”, “zip”, or “git”) do need to worry about symlinks, and will check if a path is a symlink before deciding whether to reference it. For example, you can ask the “find” command to list only symlinks without referencing them: find -type l


  • They do! /bin has the executables, and /usr/share has everything else.

    Apps and executables are similar but separate things. An app is concept used in GUI desktop environments. They are a user-friendly front end to one or more executable in /usr/bin that is presented by the desktop environment (or app launcher) as a single thing. On Linux these apps are usually defined in a .desktop file. The apps installed by the Linux distribution’s package manager are typically in /usr/share/applications, and each one points to one of the executables in /usr/bin or /usr/libexec. You could even have two different “apps” launch a single executable, but each one using different CLI arguments to give the appearance of different apps.

    The desktop environment you use might be reconfigured to display apps from multiple sources. You might also install apps from FlatHub, Lutris, Nix, Guix, or any of several other package managers. This is analogous to how in the CLI you need to set the “PATH” environment variable. If everything is configured properly (and that is not always the case), your desktop environment will show apps from all of these sources collected in the app launcher. Sometimes you have the same app installed by multiple sources, and you might wonder “why does Gnome shell show me OpenTTD twice?”

    For end users who install apps from multiple other sources besides the default app store, there is no easy solution, no one agreed-upon algorithm to keep things easy. Windows, Mac OS, and Android all have the same problem. But I have always felt that Linux (especially Guix OS) has the best solution, which is automated package management.


  • I don’t understand this guy’s argument at all. First of all, he isn’t using any shell that I know about, he seems to have invented his own, and the command line arguments he uses are specific to his own shell. He doesn’t explain how these command line arguments work in terms of POSIX system calls, so I can’t follow along with what he is actually doing. As far as I can tell, these are security issues with his own software, not with Unix or Linux.

    If you are worried about file mutability, you can use ZFS or BTrFS or BCacheFS. All of these filesystems have a snapshot function, so if any changes (e.g. file encryption by ransomware attackers) are made you can reboot and roll back the changes, unless the attackers figure out a way to get root access and delete your snapshots. But if an attacker has gained root access to your computer, that is a much more serious issue and not really in the scope of filesystem security or file mutability.

    The snapshot and rollback feature also exists in NixOS and GuixOS, where your operating system kernel and all software installed is part of a snapshot that can be rolled back, if the system becomes unbootable, you can rollback from within the GRUB boot loader. Again, all software installation is managed by a service that runs for you at root level so you never need sudo to install software, and the software you install never effects any other user or the operating system. So the only way to hack this is to gain root access and alter the content of the Guix or Nix “store” database with malicious code, but again, root access is a much bigger issue than what we are talking about.

    So yeah, the argument stated in this video makes no sense to me.



  • Yes! Emacs has already taken over most of my desktop environment apps with the exception of the web browser and a few apps like Blender and Gimp. I haven’t gone as far as you, getting each Emacs buffer to display in its own frame in is own WM-level window, but that would make for a more immersive experience. Also, your color scheme is similar to the one I use now. I love it.

    I can’t wait for the day when software written in Lisp takes over my window manager, then my panel, then my session manager, then my whole operating system kernel.



  • Ramin Honary@lemmy.mltoLinux@lemmy.ml/run/user/1000: What to do with it?
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    2
    ·
    edit-2
    7 months ago

    @joeldebruijn@lemmy.ml the /run/user/1000 directory is an in-memory file system of a fairly small size. The operating system creates it for you to store certain things that are for your user account only. The permission settings on this directory forbid any other user on the system (except for “root”) to see what is inside. This makes it safe to store secret information that only you should know.

    One typical example of something stored in this directory would be your plain text (unencrypted) password database if you use a password manager. No other user but you (and “root”) can see it, and it is in-memory only so it is not accidentally copied to your persistent memory (HDD or SSD disk drive) where it might be removed and read by hackers if someone steals your computer from you. At the same time, any program running on the system that was launched by you and only you has access to your passwords so you don’t need to remember passwords for everything. (Actually it is a socket to a server containing your unencrypted password database in memory, it is probably not actually a file in that directory.)

    Other things that go in this /run/user/1000 directory are socket connections to the desktop bus (allows for things like copy-and-paste or drag-and-drop to work between programs), socket connections to your audio mixer (allows you do things like to listen to music and do video chat at the same time), and a record of what external media devices you have connected to the computer which you are using via GVFS, and so on.

    Also, the number 1000 is your user ID number assigned to you by the operating system. If you create other accounts, they will have ID 1001, 1002, and so on, and each of them will have a directory with that number created in the /run/user directory for them when they login.