Programming thread

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
Haven't written any file systems but I'm pretty sure you're just going to have to suck it up and use FUSE. Kernel modules are probably going to end up being both more difficult to work with and more painful to use as a user.
Rip, fair enough

A little bit related to my console hacking work. FUSE is good.
TL;DR, I want to be able to activate the VFS for a directory, and have file IO pass through it while it's running. I tried FUSE but I was being a nigger and trying to run it under WSL2 at first.
 
I've been using Godot to make a ui-heavy game prototype and I'm really enjoying the workflow when it comes to the UI design. You can use containers to build complex layouts and panels for more granular position control within the containers.

You can use the node addressing notation to quickly change the properties of nodes within the scene tree from a script, for example loading a scene resource into a container within the scene tree and changing its text or image variables at once.

Python:
for k in %storage_item_container.get_children():
    k.queue_free()
for item in %game.player.items:
    var child = item_scene.instantiate()
    child.get_node("%count").text = str(item.count)
    %storage_item_container.add_child(child)

You can then use signals within your nodes script to communicate with nodes above it in the scene tree, like the root node or the container just above the node. You can use themes to dictate the look and feel of the UI from the top down without directly tinkering with every node in the tree. It took me a while to really understand how all this works but once I did I was able to rapidly create new UI elements with no limitations on positioning or behavior.
 
Based and $s=~s/^[0-9]\n//g;-pilled.
Perl is based. Do X or die, will be considered hate speech.

Edit: Also new bug at work. System we have is based on getting camera feed through direct ethernet connection and uploading it to the gpu (each camera gets its own thread so it can just read immediately without stopping). Now usually if we go overboard the upload takes longer while the feed remains at stable speed. But in a new PC the opposite happens (feed goes to shit and starts failing with missing packets) while the upload remains fast.

Anyone has an idea? Biggest suspects are memory and PCI but both seen identical to the original specs that do work.
 
Last edited:
Does anyone have experience writing virtual file systems? I’ve looked into it, and at least for Linux, there’s kernel modules or FUSE, but I’ve not had the best luck with either thus far
I've used FUSE a few times. I have looked at kernel modules for filesystems but never written any. FUSE is definitely the simpler of the two.
There's "low" and "high" level FUSE API. I've only used the low-level one extensively.

It's been a while, but I recall most of my struggles being with not taking in account the existence of inodes from the get-go. It's annoying if whatever you're wrapping doesn't have a notion of inodes, in which case you'll need a table to map inode to whatever sort of key you need.

Something that I found especially annoying is the need to keep around opened files even if they are unlinked from the file tree itself. You could of course give an I/O error if an operation is performed on a "deleted" file (or vice versa: prevent deleting open files) but it will break a lot of programs (even coreutils!) if you try to do that.
 
  • Informative
Reactions: Anti Snigger
Does anyone have any experience with nim? I'm considering using it as a glue language in a hobby project, but I've heard that performance can vary a decent bit.
My casual experiences with nim is that it compiles to C, the C is decent, and so you're gonna get better performance than interpreted languages unless you jump through hoops. If glue code is what you need, it is a good candidate, provided all the endpoints you're connecting play along well. Haven't had enough experience in this context to be more confident, though your problem statement is rather free of detail too, so.
 
  • Like
Reactions: SangeAndYasha
I just spent the better part of a week getting a Kubernetes cluster setup. I hate this shit so much. It's all fucking .yaml files, and none of it makes sense.
It could be worse, it could be RedHat OpenShift and needing RedHat's legendary support. Luckily it only took them a month.
 
I just spent the better part of a week getting a Kubernetes cluster setup. I hate this shit so much. It's all fucking .yaml files, and none of it makes sense.
What platform are you using?
For bare metal I have found k0s to be the simplest way to set up, although I don't really trust Mirantis.
 
Digital Ocean K8s has pretty good dev ex from what I remember.
The thing I like about DO is that, they make you do everything, but they have articles on how to do everything you would want to do on their service or off.

Need to setup a basic FTP server/client? They have an article for that. Need to setup container orcastraction they have an article to get started on that. Telling you that you are retarded and running your ingress and Cert Issuer/Services in different namespaces because you typed the wrong helm command, not so much. Although GCP/AWS would tell you in the console.
 
I have to say the app platform is looking pretty decent. I don't have to manage a nginx reverse proxy now. The only thing I'm serving is a single .HTML lol.
 
  • Feels
Reactions: HexFag
I have recently ran into the issue of not knowing what to choose for new projects. I have the pleasure to take contracts in which I have pretty much complete freedom programming-wise and can choose which technologies to use, versions, where to deploy etc. The problem arises when the language i'm most proficient at, Ruby, every day gets less and less support and I end up having to write my own libraries or having to fork old ones constantly to do basic things (take into account i'm only talking backend, and mostly webdev work). The alternatives of these libraries in other languages are very up to date and maintained making other languages very appealing, apart of being constantly updated and optimized. As of yet I have considered Node for its maintainability, as everyone knows JS, and some impressive performance tests and that's pretty much it. I love coding in C# but deployment is a chore or very expensive and VS only being available on Windows is infuriating, Java makes me want to kill myself, python seems very bad and I've heard pretty bad things about PHP. What do you think is the way forward here?
 
Something that I found especially annoying is the need to keep around opened files even if they are unlinked from the file tree itself. You could of course give an I/O error if an operation is performed on a "deleted" file (or vice versa: prevent deleting open files) but it will break a lot of programs (even coreutils!) if you try to do that.
I don't know if the relevant standards specifically require that (solid chance they might, but don't quote me on that), but it's been more or less an implied expectation for awhile.

Like one example use would be to create a shared memory file to share stuff between processes, but you could keep it private by unlinking the file after both processes have opened it and it's expected that the file handle will remain valid afterwards.
I have recently ran into the issue of not knowing what to choose for new projects. I have the pleasure to take contracts in which I have pretty much complete freedom programming-wise and can choose which technologies to use, versions, where to deploy etc. The problem arises when the language i'm most proficient at, Ruby, every day gets less and less support and I end up having to write my own libraries or having to fork old ones constantly to do basic things (take into account i'm only talking backend, and mostly webdev work). The alternatives of these libraries in other languages are very up to date and maintained making other languages very appealing, apart of being constantly updated and optimized. As of yet I have considered Node for its maintainability, as everyone knows JS, and some impressive performance tests and that's pretty much it. I love coding in C# but deployment is a chore or very expensive and VS only being available on Windows is infuriating, Java makes me want to kill myself, python seems very bad and I've heard pretty bad things about PHP. What do you think is the way forward here?
I like Golang.

Good multiprocessing / threading model, a usable type system, and error aware return types instead of exceptions.
 
What do you think is the way forward here?
If you're open to a more functional language, you may take a look at Elixir. I think the learning curve might be hard, but for webapps and everything to do with networking it's a beast.

Elixir is btw where most Ruby developers went to.

While I don't program PHP myself, I heard multiple people around me that it got very nice and readable with newer versions. So if you're not a functional language person, you could give PHP another chance. With Laravel etc it's a whole different experience.
 
  • Like
Reactions: Lemurakk
I have recently ran into the issue of not knowing what to choose for new projects. I have the pleasure to take contracts in which I have pretty much complete freedom programming-wise and can choose which technologies to use, versions, where to deploy etc. The problem arises when the language i'm most proficient at, Ruby, every day gets less and less support and I end up having to write my own libraries or having to fork old ones constantly to do basic things (take into account i'm only talking backend, and mostly webdev work). The alternatives of these libraries in other languages are very up to date and maintained making other languages very appealing, apart of being constantly updated and optimized. As of yet I have considered Node for its maintainability, as everyone knows JS, and some impressive performance tests and that's pretty much it. I love coding in C# but deployment is a chore or very expensive and VS only being available on Windows is infuriating, Java makes me want to kill myself, python seems very bad and I've heard pretty bad things about PHP. What do you think is the way forward here?
If you do want to get into the JVM ecosystem, Kotlin is actually pretty nice. I have always liked Java since it's my bread and butter, plus Spring is amazing once you get the hang of it.

Python is not as bad as you think and all of the ML people are really into it. I've been playing around with it, and having a blast. I actually just launched a website using Flask as the webserver.

PHP offers you the ability to work with Laravel, but most importantly it allows you to effectively develop with WordPress. I understand that may seem like a dirty way to make a living, but there are always people who need CRM help, and you can come up with some cool stuff using PHP.

JavaScript is pretty cool, but give Typescript a look if you have a month to play with it. It's not that complex, but helps with some of the problems that can arise from a weakly typed language. A lot of Jobs are looking for React right now, so check that out maybe. I'm still sad angular lost.

Above all languages are a tool. Look into SOLID principles and the like to find patterns that will help you do your job better. I really came into my own as a coder when I discovered the dependency injection pattern and I apply it whenever I'm developing. I'm sure you'll find your own style.

Lastly brush up on some dev ops stuff. CD is fucking butter when you get it running, and code with TDD. I can have a new release of a backend up in 3 minutes with Kubernetes and Docker after a Git push. The frontend is even faster.
 
I don't know if the relevant standards specifically require that (solid chance they might, but don't quote me on that), but it's been more or less an implied expectation for awhile.
At least one spec says yes:
When the file's link count becomes 0 and no process has a reference to the file via an open file descriptor or a memory mapping (see mmap ), the space occupied by the file shall be freed and the file shall no longer be accessible. If one or more processes have such a reference to the file when the last link is removed, the link shall be removed before unlink() returns, but the removal of the file contents shall be postponed until there are no such references to the file. When the space occupied by the file has been freed, the file's serial number (st_ino), and therefore the file identity (see XBD <sys/stat.h> ), shall become available for reuse.
It's certainly been standard behavior for every UNIX(tm) I've ever used.
 
Back