Ramin_HAL9001

@Ramin_HAL9001@lemmy.ml

Software engineer, functional programming enthusiast.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

Ramin_HAL9001,

If I saved up my money and bought a tractor

What if I instead offered to plow their fields for them instead

You assume it is necessary to use money to buy a tractor for yourself, you assume “their fields” are owned by “them.” What if the state provided you with a tractor and the land? Or even if money were involved, what if the state provided you with the money to buy the tractor and the land?

There would be laws to allow you to hire other people to use the tractor and farm the land, but by law, the surplus of their labor (whatever they planted, farm, sell at market) would belong to them, likewise the surplus of your own labor would belong to you. You could use the surplus (money, goods, what have you) to trade with anyone else.

Ramin_HAL9001,

I know, this one is so plausibly something those psychos in the various school board across the fucked-up state of Florida would actually do, I honestly thought this was real for a moment.

They have already shut down entire school libraries, and censored several other public libraries, and are trying to make it illegal to speak freely about slavery or genocide or generally being critical of the US or the glorious military. And there is no shortage of 100% serious, 100% unironic talk (“protected free speech”) among ordinary Florida folk about how the slaves actually had it pretty good since they never had to worry about paying for rent or food, and anyone could have done the unskilled labor they did, “I mean, they never had human rights, but what would animals I mean black folk want with those.”

I mean, this Onion headline is really, really plausibly real, and might even become real pretty soon.

Ramin_HAL9001, (edited )

I wrote a few articles on my blog for people in your situation, who are mostly only familiar with Windows and/or Mac and want to learn Linux more in depth.

https://tilde.town/~ramin_hal9001/articles/2022-02-03_advice-for-people-who-want-to-learn-linux.html – This article is kind of an overview of the Linux learning process. The point of this article is to teach you what it is you need to learn about so that you set your own curriculum. Once you understand what a few of the basic things are, you can look up your own tutorials on how to learn each thing.

https://tilde.town/~ramin_hal9001/articles/2022-04-28_how-to-pick-a-linux-distro.html – This article is for people who are overwhelmed by the number of choices for Linux distro. The bottom line is: don’t over-think it, just pick a mainstream distro like Mint, Ubuntu, or Fedora. There is like a 99.99% chance that each of these will just work as soon as you install it, no weird issues with audio, graphics, WiFi, BlueTooth, security updates, or anything else. Also, a lot of the “choices” you see among all those distros are only skin deep – differences in the default theming (i.e. the default “desktop environment”, a concept explained in the “advice” article above). But really they are all using the same basic software packages so there very little substantive difference between any of them except in their app stores, and the mechanism they each use install software.

If you have any questions, feel free to ask me here. I can clarify here, and also update my blog posts if you think anything is confusing.

Ramin_HAL9001, (edited )

As many here have said, but I will emphasize: learn the Bash programming language. Linux Survival is a very good start, and you can just start experimenting right away in your own terminal on your own computer.

To go more in depth, you can read through the manual on your computer by typing “info bash”. The Info documentation browser is a command line app. You may need to install it using your package manager (“apt-get” or “pacman” or “dnf”).

In the “info” app, you can navigate with the arrow keys, pressing enter on hyperlinks, typing l (lowercase “L”) works like the “back” button in a web browser, typing r (lowercase “R”) works like the “forward” button. Info also lets you search the index by pressing i (lowercase “I”) then entering your search in the prompt, or search the full text by pressing s and entering your search in the prompt. And q quits back to the command line prompt. “Ctrl-Z” pauses the “Info” app and drops you back into the command line, and you can resume your “info” session using the “%” (percent sign) command.

Another thing that can help is to learn about the GNU “Coreutils”, this is a suite of commands usually installed into /usr/bin or /bin which provides helpful command line utilities. These are commands like cat, wc, sort, cut, ls, du, cp, ln, chmod and many others. Read through the Coreutils Info manual by typing “info coreutils”.

And I will also reiterate recommendations from others: learn how to use Vim and/or Emacs. Vim has the more difficult learning curve but is extremely useful for writing scripts. Emacs is better though because it lets you split-screen with manual pages, and copy-paste commands between Man pages, “Infodoc” documents, the shell, and/or a text file, all using only keyboard commands. I think it makes it much easier to learn since everything is integrated together. Ask the Emacs community how to get started if you are interested.

Ramin_HAL9001,

Steps are being made toward Guile Emacs integration. The work is mostly being done by Robin Templeton, who (last I heard) works at the Spritely Institute. And as I understand, there are other people pushing on the Guile in Emacs front as well, so you may not have to wait long.

Have you considered trying to setup Kakoune bindings in Emacs? For example like this: github.com/jmorag/kakoune.el

Ramin_HAL9001, (edited )

It’s a i3-6006U with just 4.0GiB of RAM.

Emacs is considerably more lightweight than a modern Web browser, or any app based on Electron.js (e.g. VSCode) so a computer with those specs is more than powerful enough to run Emacs. If you use version 29.1 or later, Emacs comes with “libgccgit” which will spend a little time pre-compiling Emacs code to very fast native code.

Emacs used to have a reputation for being slow back in the early 1990s when 32 bit personal computers were just beginning to gain popularity. But nowadays when everyone downloads FlatPak and AppImage and Snap apps which install many hundreds of megabytes of code, Emacs is relatively small and light.

Also, Guile Emacs and Guilemacs are two different projects, right? Because I also happen to come across this, and I’ve been interested in this project as well.

The whole history of Guile and Emacs is here on the Emacs Wiki.

So there are a few projects related to Guile and Emacs. The link you provided me by Ken Raeburn is a fork of older versions of both Guile and Emacs, it seems it has not been worked on in about 20 years, unfortunately.

The project by Robin Templeton is also a little bit out of date, but still somewhat actively developed. You must build it from source from a patched version of (I think?) Emacs 26 or 27, I am not sure which it was. It works by loading libguile (the Guile interpreter/compiler) into Emacs so you can run Scheme code, and it also provides Scheme “foreign function” wrappers to the Emacs C APIs so you can do everything Emacs Lisp does in Scheme by importing the elisp-functions Scheme module. (There is an example of how to use it on the Emacs Wiki.)

I did hear Robin say in a recent Spritely chat that it could be made to work on Emacs 29 with not too much effort, they just haven’t had time to do it.

If you are interested in Scheme, you might also want to check out the Edwin text editor which is built-in to the MIT/GNU Scheme compiler, you launch it from the Scheme REPL with the (edit) function. It is a clone of Emacs 19 (a very old Emacs) written entirely in Scheme, but unfortunately it is a little too old to be useful nowadays, in my opinion. Still, you could learn something by reading the Edwin source code.

Finally there is TeXmacs, which is a full WYSIWYG application with a built-in LaTeX rendering engine designed for writing scientific papers, and it includes the Guile Scheme compiler for writing extensions, although I would not call TeXmacs a general purpose programming text editor the way Emacs is.

[Humor] A song about the Emacs Philosophy (www.extrema.is)

A close friend of mine was “inspired” to write a song by my series of blog articles called “Emacs Fulfills the Unix Philosophy” (actually I think he is busting my chops a bit for being an annoying Emacs evangelist, but anyway…) I thought it was pretty funny and worth sharing here....

Ramin_HAL9001, (edited )

The argument stretches “Unix philosophy” so far that Lisp systems end up being a better fit for it than Unix itself. To me that just makes the whole thing lose meaning. Emacs doesn’t particularly fit the Unix philosophy and that’s fine!

Thanks for reading my article, and for your thoughtful comment!

I will go further and say that no GUI or TUI application fits into the Unix philosophy.

I suppose I can agree with you on this point for sure, since the Unix philosophy is not really all that well formulated to begin with (it is a philosophy closely related to the principles of functional programming devised by people who were seemingly not interested in functional programming).

Nonetheless there are people who still insist there is wisdom in the Unix philosophy, which I think is more misguided ritual than carefully-considered principle. The reason I wrote the article was to make people question the utility of this ritual, of drawing an arbitrary border line around a piece of software and saying “within these borders is a tool that does just one thing and does it well.”

Ramin_HAL9001, (edited )

That looks like artwork from The Lispy Gopher Show. I love it!

EDIT: yep, artwork by Tomas Prahou a.k.a. @pmjv .

Janus, a simple text editor

For the past few months I have been working on a simple windows notepad like text editor. It’s nothing special, but when I first switched to linux I looked around and it took me a while to find leafpad. Unlike leafpad however, Janus uses gtk3, a much more modern toolkit then gtk2, it can display and modify binary data, and it...

Ramin_HAL9001,

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.

Ramin_HAL9001, (edited )

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_HAL9001,

It was also the plot of the Terminator series of films. Well, except for the detail that the AI controlling the aircraft (called “Skynet”) became “self aware” and that is what caused it to launch all the nukes to kill all the humans.

So how it differ from Terminator’s “Skynet” is that these real life AI are being controlled by genocidal maniacs (the largest concentration of whom seem to live in the US and Israel at present) and they are setting these things to “auto-kill” mode, like what happened in Gaza recently. And the genocidal maniacs gleefully ignore international law, saying “you want to stop me, you and what army?” So who is to keep them from turning the robots against you and me?

Ramin_HAL9001,

According to the story told by Schwarzenneger’s character in part 2, Skynet started out controlling only in US Air Force drones (hence the name), and was soon after connected to everything else. Eventually human decision making was removed from the control of the system.

Ramin_HAL9001,

Came here to say this. I once cut open a 9-volt battery and discovered it was really just 6 AAAA batteries wired in series.

Ramin_HAL9001, (edited )

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.

Ramin_HAL9001, (edited )

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

Ramin_HAL9001, (edited )

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:


<span style="color:#323232;">awk 'BEGIN{comment_count=0;} /^[[:space:]]*[#]/{comment_count++;} END{print(comment_count);}' file.sh
</span>

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.”

How would one support innovation in socialism?

I am genuinely interested how such a thing would be done. I understand that it wouldn’t be as hard as with communism, but I can’t think of any way to encourage companies to make better (genuinely better) products. I remember how my mother told me how in her days (she lived in the DDR) there wasn’t really any reason to be...

Ramin_HAL9001,

@Smorty when humans have their basic needs all satisfied, and they feel secure and mostly content with life, they naturally become very creative and innovative.

Think about it: if you were not worried about paying rent every month, not worried about medical bills, not worried about where your next meal is coming from, and the job you did only require you work 6 huors a day 4 days a week, what would you do with your abundant free time? You might have kids and devote your life to them, and that is really helpful for perpetuating society. You might be happy to just play video games and watch TV and movies and maybe read fictional novels in all of your free time, and that would be totally OK too.

But a lot of people would get antsy, they would want to find tasks for themselves to perform. They may devote themselves to sport, and become the best players in the world. They may devote themselves to art, and without a free market to satisfy, without a business case to defend the art you make, the art you make would be truly free and likely very innovative. Even in engineering and science, in which some creativity is required to come up with innovative solutions to problems, if you don’t have to worry about making things that are marketable, you just want to make things that you think are cool and useful for yourself, it may turn out to be useful for millions of other people.

Ramin_HAL9001, (edited )

“but the question is how new inventions or better versions of existing goods are spread.”

That question is a little hard to answer unless we have more specifics of this hypothetical socialist economy we are talking about.

If everything is centrally planned, innovation might come from the government paying out bonuses to people who improve the efficiency of production of goods with very high demand, or otherwise reduce the amount of human labor necessary to produce goods.

If we are talking about a heavily regulated market economy with a concerted effort to minimize the gap between rich and poor (e.g. 100% tax rate beyond a certain level of income, along with universal basic income), then the free market forces could encourage innovation as they are theoretically supposed to do right now.

Even without government intervention, people might enjoy hosting contests in which large numbers of people vote for which products they believe deserve more innovation. This model already sort-of exists in the form of free/libre open-source software. Projects that people find to be most useful tend to amass larger communities of users, and these communities continue to innovate the software. This happens without any rewards offered, but projects that become very large tend to attract donation money which becomes a kind of reward for the innovation. This also happens in a “game jam” where participants compete to create a compute game, and the game that gets the most votes wins a prize.

Ramin_HAL9001,

the job you did only require you work 6 huors a day 4 days a week,

Has that been a common occurrence in socialism?

I wish I knew. I have never in a country like Vietnam or Cuba, and I have little knowledge about how people live in these countries. Although these few countries that are genuinely socialist/communist are heavily sanctioned by the US and forbidden from participating in trade with neighboring countries (I have heard this referred to as “economic warfare”). Without access to international trade, these countries tend to be extremely poor in natural resources, which leads to tremendous scarcity, and makes life very difficult to live. Naturally, this would be a hindrance to innovation.

So personally I don’t know if the difficulties of living life in a communist country is a result of the problems inherent to communism. I strongly suspect the the problems are all caused by economic warfare, but I personally have no evidence to say one way or the other.

That said, Cuba did develop their own COVID vaccine completely on their own at the height of the crisis, so that could be a bit of evidence in favor of innovation under socialism, which if it is, would be amazing given that they could be so innovative even while being the victims of economic warfare.

Ramin_HAL9001,

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.

Ramin_HAL9001,

I will never regard “prompt engineering” as any kind of real engineering. Engineering requires design, it requires an understanding of science so that you can use it invent new technology. It requires accountability for those designs: justifying your designs with regard to cost and function using mathematics, and your math needs to be checked by other engineers to make sure you aren’t making mistakes. Prompt “engineering” requires none of this.

The very term “prompt engineer” is just a marketing term that AI companies are spreading around in their propaganda to try to make their business seem more legit and less like a scam.

With large language models (LLMs), you are basically compressing huge quantities of data into a large, black-box statistical model. You cannot describe the nature of this black box scientifically, its nature changes completely every time more training data is immersed into it. There is no expertise to be gained, no way to say "using these prompt terms the output improves by XX% for the reason that…"

  • you cannot gradually learn its nature through experimentation
  • the prompts can only be reused for a brief time until the LLM changes
  • there is no metric by which anyone could hold you accountable for your prompts once the LLM changes

A prompt “engineer” is just an endless game of guessing and checking, and the results selected will be subject to all the biases of the person running the prompts. It is labor intensive, to be sure, but not in any way that requires design with regard to cost and function. It is NOT engineering.

Ramin_HAL9001,

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_HAL9001,

That might work if I re-bound the split-window function to launch a new Emacs client, because this is the function that most other Emacs functions use to split the frame into windows.

But I think a better approach would be to just add a single rule function into the display-buffer-alist that always asks for a new frame no matter what the input is.

Mickey Peterson wrote an article on how Emacs manages its own windows, and the Elisp Manual on Windows is pretty good too.

Ramin_HAL9001,

Now you say the word “fascist” is an ad-homenim, just like every neo-Nazi I have ever had the misfortune of meeting.

You are a fascist. That is fact, and if you are insulted by that, that is your own problem, not an ad-homenim on my part.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • rosin
  • thenastyranch
  • tester
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • tacticalgear
  • Youngstown
  • ethstaker
  • osvaldo12
  • slotface
  • everett
  • kavyap
  • JUstTest
  • khanakhh
  • ngwrru68w68
  • Leos
  • modclub
  • cubers
  • cisconetworking
  • Durango
  • InstantRegret
  • GTA5RPClips
  • provamag3
  • normalnudes
  • anitta
  • lostlight
  • All magazines