I looked into this lately - Discord needs to use the Global Shortcuts Portal to do it properly but how is unclear. Discord is based on Electron which is based on Chromium. Chromium has support and Electron kind of has support since https://github.com/electron/electron/pull/45171 but this seems to be rather unknown and unused. Although somewhere in this API chain keyup events are lost, meaning that only "normal" shortcuts would work but no push-to-talk. There are multiple options for Discord to implement this: implement Global Shortcuts Portal directly, go via Electron global shortcuts API, hook into Chromium shortcuts API, maybe others - with the caveat that some of those don't support keyup events. Vesktop devs are currently stuck in same dilemma: https://github.com/Vencord/Vesktop/issues/18
Can someone explain how banning ad blockers from Firefox would bring in money for Mozilla? I can see how it would bring in money for other actors such as news outlets, YouTube, etc., but Mozilla doesn't have a big website where they are showing ads.
My coworker recently showed me this plugin [1] that fades out all Rust code that is unrelated to the variable under the cursor. Think of it as a more powerful version of the "click to highlight all appearances" you can do in most IDEs but it actually does information flow analysis on the code.
It can't. It uses ownership types in Rust to do the analysis. It can be fooled by Rust's interior mutability. Other languages don't have a type system that enables this.
If Eclipse's archaic(!) variable renaming feature for C++ can distinguish between related and unrelated variables which have the same name, you can implement this thing in almost any language.
Eclipse CDT has a real-time static analyzer for the code you're working on though. It's not as naive as it looks from a distance.
Are you adding one to an integer and adding two to another integer, or are you adding three to a single integer?
In other words are the two pointers actually pointing to the same variable? There's no way to know. When you select one pointer, should the other also be highlighted?
But in Rust you cannot have two mutable references to a single variable so the above cannot happen.
Variable renaming is a much much simpler task than this. Of course it is archaic and has existed for a long time.
> In other words are the two pointers actually pointing to the same variable?
This statement is incorrect. You can't have pointers to a variable. You can have pointers to a memory address, and most people would be fine with a tool that is correct up to the level of being unable to differentiate that.
This is a disingenuous redefinition of what the GP is looking for in order to shill Rust.
honestly I'd be ok with a being treated as different than b in this colorized use case. sure, maybe it'd be "bug inducing" or be a subconcious push toward human brains to forget they produced two aliases etc but I think what you're proposing with the c colorizing is impractical and yes I get it, "the tools caused the crash that brought down civilization" but c'mon, if you're still using c, folks have already talked you out of safety nets lol
From thinking about it and merely looking at the gif example... I think you could actually get there via language server alone - at least mostly?
It just highlights parts that interface with a symbol, right? And that's information the language server is supposed to expose.
You'd "just" have to make a x+1 mapping to highlight anything that's touching the symbol
To be clear, I'm just speculating here and not speaking with authority on the topic. It's possible I'm missing something which makes this approach infeasible in practice
It's not exactly rare to avoid mutability/use a functional style in application code, and even in mutable code, IME aliasing is rare. In some ways Rust's rules are kind of a formalization of what was already good practice in C. Variable scope is also usually small. Turns out things that are easier for the computer to analyze are also easier for people to analyze, so it's long been good practice to structure your code in easy to analyze ways.
LLMs are getting better and cheaper. It's ridiculous overkill for the task, but they could potentially do something like this and more sophisticated versions highlighting related code on other dimensions.
Programming languages are built upon mathematically defined and deterministic syntax. You can analyze them with formulae, take concrete and deterministic actions on the syntax tree.
There's no need to unleash a fuzzy and inefficient network on something designed to be deterministic and parseable.
Yes but he was saying other languages weren't in this aspect.
And I said the same as you but that also it could highlight on more abstract things that aren't in the parse tree, I meant things like feature-relatedness etc. These variables are only used for intermediate logging stuff and get greyed out etc.
It's not so much syntax as semantics here. And programming languages are often described and implemented with rather vaguer ideas than fully formally specified semantics. (Even Haskell doesn't have fully formalised semantics.)
Visual Studio is irritatingly doing the opposite. If it detects unused methods/variables it will make them darker (which in general is quite useful), but it also does so when you're still busy creating new methods and just haven't linked them to anything yet.
"Color distinguishes things. And we just use it to distinguish syntax. Nothing wrong with distinguishing syntax. It's the "just" that bothers me. Highlighting syntax is not always the most important thing to us. The information we want from code depends on what we're trying to do."
It then goes on to talk about rainbow parentheses, which is information multiplexed on the color channel with the syntax highlighting.
Unless you have spaghetti code or have built an abstraction tower, a variable is probably scoped/namespaced neatly. Often, it's just a quick grep to find it. In Emacs, if a variable is only used within a file, you can just `M-x occur` and do the editing there. Where those tools fail, is when you have ecosystems that tries to be clever (JavaScript with its transpilers, Java with its annotations)
Thanks! So I learned something new about Emacs again. It never ends.
Aliasing something to make it easier to M-x sounds like the next step after running out of letters to use with C-c? I have not reached that point yet, but that was another thing I never considered that could be useful to remember.
Yes, but not everyone uses features like this to make code easier to read. Instead, features like this make less readable code become tractible. The same can be said about autocomplete and documentation popups too. I remember Uncle Bob saying once that his 5 line function limit was facilitated by an editor feature he had that could easily display the code of functions that are called. So it stands to reason that the recommendation should be 25 lines if you don't have such a feature, I think. We don't need to go back to Hungarian notation but certainly using a bunch of fancy features to read the code makes it inherently less readable on the surface level (unless you are very anal and also self-aware and can stick to clean principles).
I'm surprised my comment was downvoted so bad for making an astute observation. It happens to me all the time. A lot of the users of this site suck.
Lol well where else am I supposed to talk about it? I get irritated about this stuff daily, so I don't really care if my short quips bore a person here or there. Being interesting is what gets me downvoted!
Well, I guess you're not supposed to talk about it haha.
But since it's irritating you I had a quick look at your comment history.
I would say that the downvotes are because a high percentage of your comments are argumentative, and occasionally just flat out insulting. Within that your tone is often condescending and dismissive.
Disagreement alone should not result in downvotes but I guess that's what happens when you do it among jerks lol. As for being condescending, I really like reductio ad absurdum and I think that rubs people wrong. Also somehow, the downvotes seem to pile up the more I reply, as a quirk of how they are calculated...
Yes, this is it. The idea that LLMs somehow write this deceptive code that magically looks right but isn't is just silly. Why would that be the case? If someone finds they are good at writing code (hard to define of course but take a "measure" like long term maintainability for example) but they fail to catch bad code in review it is just an issue with their skill. Reviewing code can be trained just as writing code can be. A good first step might be to ask oneself: "how would I have approached this".
I'm kind of happy that I did my maths courses just about before LLMs did become available. The math homework was the only thing in my CS studies where I sat sometimes 6+ hours on the weekly exercises and I always allocated one day for them. I sometimes felt really tempted to look stuff up and also rarely found an answer on Metroid Mathplanet forums. But it's really hard to Google math exercises and if the teachers are motivated enough to write new slightly altered questions each year they are practically impossible to Google. With LLMs I'm sure that I would have looked up a lot more. In the end getting 90% of the points and really struggling for it was rewarding and taught me a lot - although I'll probably never need these skills.
I built my own web app to listen to full albums while allowing me to take breaks and switch devices. I really like to listen to albums from front to back but I found that at least YouTube Music doesn't remember playback position and you can't just switch devices without pulling up the album again on the other device and finding the position where you left off. My web app lets me paste a URL that is then downloaded to the server using yt-dlp and can be streamed from there. It always remembers playback position so I can listen from the phone in my car and then continue on the laptop at work from where I left off. It also works great for adding mixes from other sources such as NTS Radio - one of my favorites.
I miss Songwhip as well. We used to have a bot in our music sharing Discord channel that looks for links to any streaming platform and convert them to Songwhip links via the Songwhip API. The good thing about Tidal is that, like Songwhip, it provides you with a list of links to various streaming platforms when you're not logged in.
Wish it had been open sourced, it worked so well. Or even better, if Bandcamp offered an API, so sites likes SW wouldn’t need to (probably) scrape that information.
> The good thing about Tidal
Can’t confirm, it’s worse than spotify for me, as I get an unclosable modal that asks me to sign up or login.
It was such a beautiful ui and ux , elegant really. It’s a shame yet I wonder how could it have been profitable. There’s really not a whole lot to monetize unless I’m missing something.
Songwhip allowed artists to claim and customize their page for a fee. Back then I looked into why Songwhip closed but couldn't find a definitive answer. I found a Reddit post where the original creator shared their site many years ago, so it looks like Songwhip started as a personal project. When it closed down though that decision was made by Sony. So it seems like the original creator got bought out by Sony and then Sony decided to close the service. Just speculation though.
I'm graduating with a Master's degree in Computer Science at the end of September and am looking for a SWE role to start around then or later. I've been programming long before university and worked as a part-time developer for a year during high school. My GitHub (https://github.com/timakro) features several projects that are actively used and contributed to by others. For many years, I've contributed to https://github.com/ddnet/ddnet, where I learned to work on a large code base with a team.
Unfortunately Ryanair left Frankfurt Airport. They consistently offered flights an order of magnitude cheaper than other airlines and I could reach Frankfurt airport directly by bus for free with my student ticket. This was the ideal way to go on vacation for me. I don't mind clicking "no thanks" a few times when it saves me 500 euros.
I'm pretty sure this is syntax highlighting. It's a known issue to be slow for large files in Vim because it is synchronous. Try starting Vim with syntax highlighting off:
This makes sense. I recently learned that VSCode is clever enough to automatically disable some features (which includes syntax highlighting among I guess other things) when it detects that the file is too big according to some heuristics (like probably, length of the longest line, or maybe just total size of the file).
So IMO I think vim is being "too dumb" here and should be able to adapt like VSCode does. But, meanwhile, if you want to test under equal conditions, you can disable VSCode's optimization by disabling this setting: