I mean, it does scale with the size of the input. Just not with the count of inputs, but rather the size of each input element.
Ephera
- 17 Posts
- 252 Comments
I agree in general, that a crash is much better than silently failing, but well, to give you some of the nuance I’ve already mostly figured out:
- In a script or CLI, you may never need to move beyond just crashing.
- In a GUI application or app, a crash may be good (so long as unsaved data can be recovered), but you likely need to collect additional information for what the program was doing when the crash happened.
- In a backend service, a crash can be problematic when it isn’t actually necessary, since it can be abused for Denial-of-Service attacks. Still infinitely better than failing silently, but yeah, you gotta invest into logging, monitoring and alerting, so you don’t need to crash to make it visible.
- In a library, you generally don’t want to trigger a crash, unless an irrecoverable error happens, because you don’t know where it’ll be used.
Currently implementing error handling for a library I’m building and the process is basically to just throw all of the information I can find into there. It makes the error handling code quite verbose, but there’s no easy way for me to know whether the underlying errors expose that information already, so this is actually easier to deal with. 🫠
Last year, money was running out in our project and the guy who had trained me decided he’d take the L and move to another project, so we could continue in the project. And yeah, suddenly I was in the role of the lead developer.
Like, don’t get me wrong, I would’ve been the one to be moved to another project, if I wasn’t up for the task. It’s not like I was a complete dumbass.
But it did still feel more like “I guess, we doin’ lead development now” rather than something I had intentionally worked towards.
Yeah, HeliBoard or FlorisBoard would’ve been my recommendation. They’re very similar, though (and presumably share most code between themselves).
Multiple people have said that, yeah. But they also said that he did not particularly distance himself from the project, which is definitely something I would do, if I found out about this kind of backing.
Believe what you want, but Drew DeVault has more of a reputation than FUTO.
From a communication viewpoint, that is fair, but to my knowledge (from being a professional software developer), effectively any license that is not ‘open-source’ or ‘free’ is by definition proprietary.
Because those two terms describe licensing standards (the only established ones that I know of). Whereas I believe, “proprietary license” uses this meaning of proprietary:
Nonstandard and controlled by one particular organization.
So, they wrote that license themselves is the point. What it says in there is secondary in meaning.
This is so highly relevant because in legal disputes, there is certain license compatibilities which are known to be possible.
You can take a library licensed under the MIT license and use it in a project that uses the Apache-2.0 license and you’re perfectly fine. This is the foundation of why the open-source ecosystem exists at all.But you cannot take the source code from FUTO and use it in a differently licensed project, because no legal precedents exist to support this. (I believe, the FUTO license also actively prohibits this in some way, but that’s beside the point.)
This has massive implications. Like, yeah, you can look at the code, but it is useless. If FUTO closes shop or enshittifies, you cannot fork their projects.
And because you cannot legally re-use their source code in other projects, likely no one looks at it in depth either.
I find that if your command is complex enough that editing it on the terminal becomes annoying, then there’s a very high chance you want it in a file anyways, just to document what you did and to allow easily re-running it.
Having said that, you can also have your shell open the command in your editor of choice: https://www.stefanjudis.com/today-i-learned/edit-long-shell-commands-in-your-usdeditor/
Ephera@lemmy.mlto
Open Source@lemmy.ml•Open source GZDoom community splinters after creator inserts AI-generated code - Ars TechnicaEnglish
12·21 days agoThere’s no way they actually checked that it works. It includes code for:
- XDG
- GNOME
- “GNOME_old”
- KDE
Verifying this would mean logging into several different desktop environments.
It’s also extremely fragile code, running external commands and filtering through various files. There just is no good API on Linux for querying whether the desktop environment is using a dark theme, so it’s doing absolutely inane shit that no sane developer would type out.
Because it’s a maintenance nightmare. Because they almost certainly don’t actually need to solve this. That’s software development 101, to not write code that you don’t actually need. But apparently some devs never got the memo that this is because of the maintenance cost, not because you weren’t able to generate the code up until now.
Ephera@lemmy.mlOPto
Programmer Humor@lemmy.ml•Escaping a string when passing through multiple toolsEnglish
0·1 month agoI figured, I’d involuntarily sign up for counter suggestions by posting this. 😅
Using
lib.escapeis a good idea, thanks.But yeah, basically I want to configure Alacritty and I’m using the respective home-manager module.
Even more specifically, I want to pass stuff, including a regex, into thesettingsparameter, which more-or-less just takes the Nix expression that I shove in and then outputs it as TOML on disk.As for how I would’ve liked this to work:
- Use
''doubled single-quotes''in Nix to not need escaping. - Use
'single-quotes'in TOML to not need escaping: https://toml.io/en/v1.0.0#string%3A~%3Atext=single+quotes
But the TOML is templated with
"double-quotes", so I do need to escape the regex after all.I did just try to understand how the Alacritty module does the templating and found this gem:
# TODO: why is this needed? Is there a better way to retain escape sequences? "substituteInPlace $out --replace-quiet '\\\\' '\\'"So, that doesn’t fill me with a whole lot of confidence. 🙃
But yeah, it’s working now without me having to write a whole bunch of backslashes, so that’s good enough in my book.
- Use
I guess, there’s technically nothing which dictates that a debugger has to work by stepping through a program. It could also present you some diagram of variable values changing over time. But yeah, gonna be hard to find a more useful representation than those values being interleaved with your logs, at least for most applications. I have heard of more advanced debuggers being used in gamedev, which makes sense, since logs aren’t nearly as useful there.
But yeah, given that most people think of the stepping debuggers, them being the default advice does feel emblematic of our industry still shying away from concurrency.
Ephera@lemmy.mlOPto
Programmer Humor@lemmy.ml•Escaping a string when passing through multiple toolsEnglish
0·1 month agoThis meme brought to you by me trying to pass a regex from Nix into a TOML, which is certainly not the worst backslash orgy I’ve seen, but tragic in its own right. Both Nix and TOML have a way to specify raw strings, which do not need escaping. But Nix uses a normal string when passing into TOML, so I do have to escape anyways. 🫠
My regex also contains a double-quote, which was just guesswork as to how many backslashes I need there.
Ephera@lemmy.mlto
Free and Open Source Software@beehaw.org•How Ruby Went Off the RailsEnglish
6·1 month agoThere’s already alternative implementations, with somewhat different featuresets:
- Akkoma (more minimalist than Mastodon; Elixir in the backend): https://akkoma.social/
- Misskey (much more feature-rich than Mastodon; Typescript in the backend; extremely Japanese): https://misskey-hub.net/en/
Having said that, frankly, I doubt that the Ruby ecosystem will fall apart from this. There’s too many non-volunteers whose wage depends on Ruby to keep going…
I’ve been trying to basically build a library that helps you put together a distribution archive.
And my initial plan for the API looked something like this:Distribution::new("my-program") .dir("assets") .file("favicon.png", |path| build_favicon(path)); // "|path| ..." is a lambda function that gets the target path passed inSo, it would allow you to define the file structure, and for the parts that actually need to be built, you’d provide a lambda function, which it would automatically run or not, depending on whether the inputs changed.
Right, inputs, what are those? I kind of need my user to tell me. So, I decided to implement the caching as a separate API, which you would call on your own when you get called by the lambda function.
Then I realized, I kind of don’t need the lambda function then. I could just construct file paths and then my user calls their
build_favicon(...)function or similar on their own.There is just one crucial problem with that. This is what the file API in the stdlib looks like:
PathBuf::new("my-program") .join("assets") .join("favicon.png");I might not have built anything, really. 🫠
Ephera@lemmy.mlto
Programmer Humor@lemmy.ml•I'm new to using Ruby and this tickled me pinkEnglish
0·3 months agoAh, I’m not talking about Ruby, I’m talking about language design in general.
I’m currently mostly doing Rust, so I can only really name that as an example (even though there’s very likely other languages that allow this, too), but yeah, here’s for example the 64-bit signed integer in Rust: https://doc.rust-lang.org/stable/std/primitive.i64.html
That is a primitive type, not an object, so it is exactly 64-bits in size and stored on the stack, not the heap. But as you can see in the documentation, Rust allows for associated function anyways, like for example:
let my_number: i64 = -3; my_number.abs() //returns the absolute value, so 3That’s because that last call is just syntactic sugar for calling the same function statically on the type:
i64::abs(my_number)
Ephera@lemmy.mlto
Programmer Humor@lemmy.ml•I'm new to using Ruby and this tickled me pinkEnglish
0·3 months agoBy the way, it isn’t actually necessary for everything to be an object to make this work. The language just has to define
10.whatever()to be syntactic sugar forwhatever(10). Some languages, like Python and Rust, have an explicitselfparameter on their methods to help illustrate this.But yeah, a bunch of languages decided to special-case their objects instead, for whatever reason.
I feel like the LLMs really encourage that, too. They’ll deliver some garbage and then you tell them to make it less garbage and they’ll be like “You clever son of a removed, why didn’t I think of that?”.
I do think, it’s fair to use Python code which uses C under the hood in benchmarks, because it does often match reality. But then it also has to be realistic code. If it’s just a single line of Python code, which calls into C and then everything happens there, then there is really no point for you to use Python.
Python only makes sense to use, if you do write some amount of glue code with it. And then it does require significantly more skill to write performant code than it does with many other languages, as lots of costly abstractions are hidden from you. And it often also requires more effort, since you might not find performant libraries, since so much of the ecosystem only has performance as an afterthought. Reality is messy, which is why realistic Python code still tends to do terribly in benchmarks, whether it calls into C or not.
Oh yeah, I do think
setTimeoutexecutes in parallel, so only the largest element determines the execution time. It was difficult enough to make that sentence make sense, so I didn’t want to cram that detail in as well. 🙃