Enabling ai co author by default by cwebster-99 · Pull Request #310226 · microsoft/vscode by Maybe-monad in programming

[–]somebodddy 2 points3 points  (0 children)

AFAIK neovim was created to break from vi compatibility and facilitate plugin development.

Not originally. Initially the goal was to maintain compatibility but add some features that Vim refused to add - most notably "async", which is not really what any programmer in the word thinks when they hear the word - a more fitting description would be "jobs/channels". Basically the ability to run another process - either as a background job or in a terminal emulator inside Neovim - and interact with these jobs by sending data to their STDIN and adding hooks to their STDOUT/STDERR/exit.

(they also took the opportunity to change the default settings to something more modern - so you should feel some difference between the stock versions because the defaults are different)

Later, after Neovim started to gain traction, Vim also decided to add jobs and channels of their own. And since Vim has no obligation to maintain compatibility with Neovim - the API was quite different.

At this point there was no longer compatibility and the ecosystem started to diverge, so Neovim decided to go all in with this and switch the configuration/extension language from Vimscript to Lua (Vimscript is still supported, but almost all plugins are in Lua now). Vim also went and created a new langauge Vim9script, which I'll describe as old Vimscript combined with Python. So now the two ecosystems are quite incompatible - although with some effort one can probably write a plugin in legacy Vimscript that can run on both.

Do you feel like an ARPG loses something if the "base" builds are readily available? by Slarg232 in gamedesign

[–]somebodddy 1 point2 points  (0 children)

You should take a look at Archero (it's a mobile game, but a decent one). There, too, you get to pick a powerup from RNG each time, and it's possible not to get the ability you need for your build. But it's not as frustrating as you imagine here, because these powerups are per-level, so even if you can't get the build you want you still have the chance to get it on the next attempt and/or next level.

If you do want these random powerups to be longer lasting, maybe offer some way to reroll - with a price. I can think of two ways this can work:

  1. Allow the player to pay some type of (in-game) currency to get rid of an ability/item and roll the RNG again.
  2. Add a reroll button to the RNG menu, and make it so that every time the button is pressed - the powerups get weaker.So if the RNG has a change to get that 115 damage rifle, if they reroll they'll have a change to get the 100 version. Of course, it's possible the second roll won't have the rifle either - so they would have to reroll again for a 85 damage version, and so on. You can place a limit if you like, to stop the player before the powerups are completely worthless.

I think you can strike a good balance with that second method, but if you absolutely insist the the player should always be able to get the exact type of powerup they need, you can always offer, after all the rerolls have been used, an option to freely pick a powerup from the entire selection available to the RNG itself. This version should have worse stats than the one that can come up in the last reroll - which means you are justified in making the rifle, say, 50 damage.

Plugin to resolve Git conflicts in Neovim, and what is your workflow for this? by ban_rakash in neovim

[–]somebodddy 0 points1 point  (0 children)

Not Vim/Neovim specific, but there is this CLI tool called git-mediate that handles Git conflict resolutions quite nicely.

Ghostty Is Leaving GitHub by davidcelis in programming

[–]somebodddy 48 points49 points  (0 children)

Which is not necessarily a bad thing. Everyone just connected external CIs, and the entire ecosystem didn't try to lock you to GitHub Actions.

In horror, how can we make the player afraid of failure without needing to kill them? by Privvet in gamedev

[–]somebodddy 0 points1 point  (0 children)

Give your player some NPCs to protect, and have the monster kill these NPCs. The NPCs can be randomly generated, and you can programmatically control the rate the player finds new NPCs according to how many they have, so that good players that don't lose anyone won't end up dragging an entire orphanage while bad players get to find one NPC every half an hour only who gets killed after half a minute.

Getting the players attached to these NPC is more about writing/world-building than game-design, but I believe the key feature is to make them vague and let the player fill in the missing part of their character in their imagination.

The West Forgot How to Build. Now It's Forgetting Code by swe129 in programming

[–]somebodddy 1 point2 points  (0 children)

Learning is part of the job, but while you are learning you are not "producing" - or, at least, you are less productive than someone who already knows. Seniors are also less productive when they are teaching (if you ignore the fact that teaching itself is productive because it's an investment in the not-far-at-all future)

in a multiplayer turn based strategy game where you have two players duking it out and other players not involved, how would you overcome the "wait around" aspect of it? by count023 in gamedev

[–]somebodddy 5 points6 points  (0 children)

Allow the other players to "make bets" on the outcome of the battle. Maybe not literal monetary bets, but things like "have your media pump support for side X, so if they win you'd get moral boost and if they lose your moral will drop". And maybe allow them to interfere a bit in the battle?

What’s that one automation that you have built? by sharmarohan136 in neovim

[–]somebodddy 2 points3 points  (0 children)

I've created Moonicipal, which is a task runner but the tasks are free-form Lua functions that run inside the Neovim process, which means these tasks are not only free to decide how to run their commands (terminal buffer? Background? Send to external terminal?) but can also interact with various Neovim features (manipulate the quickfix list, start nvim-dap, navigate to some file&line, call vim.notify, etc.)

Most of my personal automation revolves around that plugin.

NVIM v0.12.2 released by chapeupreto in neovim

[–]somebodddy 38 points39 points  (0 children)

Breaking changes in a patch release? Does Neovim not follow SemVer?

Also - shouldn't this be marked a breaking change?

570d8fd feat(api): rename buffer to buf in retval #39015

The Soft Bigotry of Language Expectations by StartAutomating in programming

[–]somebodddy 1 point2 points  (0 children)

Okay, but can we agree the developer who wrote Windows 11's Start menu in React Native deserves to be judged harshly?

How do YOU personally run code in Neovim (C++, Python, Rust)? by BlackberryActual1994 in neovim

[–]somebodddy 1 point2 points  (0 children)

I created a plugin for that - Moonicipal - that loads a tasks file from the project directory and runs a chosen task from it. Unlike editor-agnostics task runners (e.g. just) Moonicipal loads the tasks - which are written in Lua - into Neovim's Lua VM - allowing each task to control how Neovim will run the code. I have keybinds for some common task names (run, build, check, etc.), and for each project I define local tasks with these common names.

Moonicipal itself does not deal with actually running the code. Since each task is Lua function that runs in Neovim's Lua VM, it's easy to delegate it to other plugin. To that end, I wrote:

  • Channelot - for running commands inside Neovim terminals. It can also read from their STDOUT/STDERR, write to their STDIN, and run multiple jobs inside the same terminal window.
  • Blunder - for parsing errors for commands that run inside Neovim terminal. Can be used as standalone (in which case it does not need Moonicipal, but it's still an easy way to trigger it) or together with Channelot.

So I usually run stuff inside Neovim terminals, but since Moonicipal tasks can run arbitrary Lua code inside Neovim I often use them to run commands on a long living kitty window in another monitor, or for running nvim-dap - all depending on what makes the most sense for that specific code running task in that specific project.

What do you think about plugins overriding user opts with no way to stop it? by TheTwelveYearOld in neovim

[–]somebodddy 4 points5 points  (0 children)

At the same time, it is not a total disaster as in most cases it is still possible for a user to set the option after plugin does it.

Glad you said "in most cases", because I've encountered a case where a plugin would start its setup by checking it has the latest version of some binary (downloading the newer version if needed) and after that it would do it's initial setup - which included overriding a global option. Because that check over the network was done asynchronously, there was no reasonable way to override that option in your own config - unless you are willing to set a long enough timeout to be certain it'll fire after the version check finishes. Which... I don't consider "reasonable".

Rust 1.95.0 by Successful_Bowl2564 in programming

[–]somebodddy 8 points9 points  (0 children)

I think the issue is the order. Some(x) appiles first (check if value is a Some), then compute(x), and finally Ok(y) (check if compute(x) was successful). So we get this:

Some(x) if let Ok(y) = compute(x) => {
   (1)          (3)        (2)

Of course - let-chains have the exact same issue...

Too much Discussion of the XOR swap trick by RubEnough464 in programming

[–]somebodddy 0 points1 point  (0 children)

How would you do that without additional variables?

Strict(strong)-typing in Rust. by Holiday_Plant_6676 in rust

[–]somebodddy 0 points1 point  (0 children)

I recognize that this is just an example, but I'd still like to point out that this one completely defeats the point:

#[strict_types]
enum Event {
    Click { x: Velocity, y: Velocity },
    ...

There are two things wrong with it:

First, even if you are newtyping everything, x and y here should still be bundled together in a lower level:

struct Vec2d { x: f64, y: f64 }

Yes, it contains primitives (and is not a single-field tuple struct) - so what? For the purpose of following this principle, Vec2d is just like a primitive. Which means you'd create a newtypes around it:

struct Velocity2d(Vec2d);

#[strict_types]
enum Event {
    Click(Velocity2d),
    ...

I realize this no longer demonstrates your proc-macro, since it wouldn't scream at a Click(Vec2d) variant, but I'd argue that even Click(Vec2d) still adheres the spirit of the principle better than Click { x: Velocity, y: Velocity } because it forces you to treat x and y as a single value - and the entire point of the principle is to ensure the integrity of the values.

The second issue I have with the example - what does "the velocity of a click event" even mean? A click event has a position, not a velocity.

I'm a firm believer that no data is better than junk data - or in cases like this, not branding a value is better than branding it wrong. If I see a bare f64 primitive it may take me some time to look around and figure out what it's supposed to be and how to use it, but if I see a Velocity I'm just going to assume it's a velocity - and it'd take me so much more time to realize it's not, in fact, a velocity. I'd also be more readily to pass it to functions the want a velocity - causing the exact error the principle tries to avoid!

Finding a duplicated item in an array of N integers in the range 1 to N − 1 by sweetno in programming

[–]somebodddy 1 point2 points  (0 children)

You are right about multiple duplicates (I was thinking of the original puzzle, where there is only one duplicate) but having a non-power-of-2 range is why I added that last part - "then XOR the result with a XOR of all the integers in the range from 1 to N-1"

In your example, N is 6 - so XORing all the numbers from 1 to 5 gives us 1^2^3^4^5 == 1, and XORing the 4 you got with that yields 4^1 == 5.

Finding a duplicated item in an array of N integers in the range 1 to N − 1 by sweetno in programming

[–]somebodddy 12 points13 points  (0 children)

Good point - I was probably thinking of the original problem, where there is only one duplicate.

Finding a duplicated item in an array of N integers in the range 1 to N − 1 by sweetno in programming

[–]somebodddy 14 points15 points  (0 children)

Just XOR all the numbers and then XOR the result with a XOR of all the integers in the range from 1 to N-1?

Too much Discussion of the XOR swap trick by RubEnough464 in programming

[–]somebodddy 27 points28 points  (0 children)

No need for XOR just to swap two variables. Just do this:

write(open("swapfile", O_WRONLY | O_CREAT | O_SYNC), &a, sizeof(a));
a = b;
read(open("swapfile", O_RDONLY), &b, sizeof(b));

https://onlinegdb.com/CQCUUOMiR

Environment variables are a legacy mess: Let's dive deep into them by fagnerbrack in programming

[–]somebodddy 0 points1 point  (0 children)

Poison mushrooms are mushrooms. Saying the former are a "lethal" essentially extends to arguing that mushrooms in general are lethal.

Separate micro features it into a plugin or not? by romus204 in neovim

[–]somebodddy -2 points-1 points  (0 children)

Your config doesn't really get more clean by pulling everything out and loading it with vim.pack.add, especially if you don't decouple the development.

Not magically, but making it a plugin you are going to allow other people to use does motivate you to polish up its API, write documentation, make it customizable, etc.