@ssokolow@lemmy.ml avatar

ssokolow

@ssokolow@lemmy.ml

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

[SOLVED] Rust-analyzer only somewhat working? (lemmy.blahaj.zone)

The autocompletion works (mostly) but for example Vec::new() doesn’t highlight anything at all. I do get errors when not putting a semicolon, but things like passing too many arguments into the println macro doesn’t throw an error. Or how shown in this example, it did not autocomplete the clone method, while also just...

ssokolow,
@ssokolow@lemmy.ml avatar

That’s not how it’s supposed to be.

but for example Vec::new() doesn’t highlight anything at all.

If I do Vec::new(foo, bar), I get expected 0 arguments, found 2 (rust-analyzer E0107).

but things like passing too many arguments into the println macro doesn’t throw an error.

I don’t get that either, but I’m still running with the Vim configuration I setup on my previous PC from 2011, where I turned off checks that require calling cargo check or cargo clippy in the background. From what I remember, a properly functioning default rust-analyzer config should pick up and display anything cargo check will catch and you can switch it to cargo clippy for even stricter results.

Or how shown in this example, it did not autocomplete the clone method, while also just accepting .clo; at the end of a String (it also didn’t autocomplete “String”).

I get clone(), clone_into(), and clone_from() as proposed completions for .clo on my as-you-type completions for foo where let foo = String::new(); and it proposed a whole bunch of things, with String at the top when I typed Stri. (eg. the stringify! macro, OsString, mixed in with various results from other crates in the project like serde)

ssokolow,
@ssokolow@lemmy.ml avatar

Ahh, yeah. In the beginning, Rust was built around the idea that individual files and invoking rustc are internal details, only relevant for integration into some other build system like Bazel, and that “normal” Rust projects need to be inside a Cargo project structure.

There is in-development work to have official support for something along the lines of rust-script, but it’s still just that… in development. If you want to keep an eye on it, here is the tracking issue.

ssokolow,
@ssokolow@lemmy.ml avatar

…and I could just as easily disparage those frameworks and give concrete reasons, but I don’t. If you don’t have something constructive to say, please be courteous and say nothing.

ssokolow,
@ssokolow@lemmy.ml avatar

Signal to noise ratio.

Aside from possibly making them feel better, it doesn’t benefit anyone for them to drop into a topic about thing X and say nothing but “I use thing Y. I don’t like thing X.” and it wastes other people’s time either scrolling past it or clearing out their RSS reader, depending on how they follow things.

ssokolow,
@ssokolow@lemmy.ml avatar

Fair. That would have been more constructive… I think I didn’t do that because it still would have felt like encouraging off-topicness.

ssokolow,
@ssokolow@lemmy.ml avatar

Depending on your preferences, there’s also Nom if you prefer parser combinators, or lalrpop or grmtools if you prefer LR(1) parsing.

Since reading Which Parsing Approach by Laurence Tratt (author of grmtools), my plan for my own parsing projects has been to use an LR(1) parser generator for the stronger compile-time guarantees.

ssokolow, (edited )
@ssokolow@lemmy.ml avatar

I’ll try to fit in sampling it at some point in the near future as a candidate for building on.

I just decided to finally double down and do the work to switch away from WordPress to GitHub Pages and:

  • Jekyll is still hell to get running locally for testing without erroring out during the install
  • Pelican seems like it’d be more trouble than it’s worth to get what I want
  • I insist that no links be broken in the switchover (Doing this to my standards was a big part of what I wound up procrastinating, since I basically need to install WordPress locally and then write something which spiders the entire site and verifies that each path is also present in the new site and the page’s contents are identical when run through a filter to cut away the site template and normalize any irrelevant rendering differences.)
  • I already have a pulldown-cmark-based CLI that I wrote a couple of years ago to render single documents and it’d be nice to retrofit it (or at least its features) onto something Rust-based for my blog. (Hell, just a couple of days ago, after implementing support for shortcodes, I got carried away implementing a complete set of shortcodes for rendering depictions of gamepad buttons like :btn-l-snes: within passages of text. Bit of a shame, though, that I’d have to either patch pulldown-cmark or maintain the smart punctuation and strikethrough extensions externally, if I want to hook in shortcodes early enough in the pipeline to be able to implement Compose key-inspired ones like :'e:/:e’: → é or :~n:/:n~: → ñ without breaking things.)
  • Since my plans for comments are, to the best of my knowledge, unique, I need something in a language I’m willing to hack on and potentially maintain my own fork of. (Jekyll would have been achieved via a preprocessor.)
  • I want something where I’m at least willing to port the internal broken link detection from one of my old bespoke Python static site generators, which means either Python or Rust. (Ideally, I’ll also re-create the support for performing HTML and CSS validation on the generated output.)
  • Given how many things I either have in my existing single-page renderer (eg. automatic ToC generation with a bespoke scrollspy implementation, Syntect integration, ````svgbobfenced code blocks which produce rendered diagrams,<price></price>` tags which provide currency-conversion estimation tooltips with the exchange rate defined in a central location, etc.) or have plans for (eg. plotters-generated charts with some kind contributed extension equivalent to matplotlib’s xkcd mode because it’s important, Wikipedia-style infobox sidebars, etc.), I want to experiment with a WebAssembly-based plugin API so I’m not throwing the kitchen sink in.
ssokolow,
@ssokolow@lemmy.ml avatar

Thanks. Being the biggest name, Zola is definitely on my list of things to investigate.

ssokolow,
@ssokolow@lemmy.ml avatar

He recently did one about how he and his team set up a fake bitcoin site that would direct scammers to a fake support hotline when they try to withdraw the fake bitcoin, where they’d get stuck running in circles in a voice mail menu maze chasing the illusory bitcoin payout.

I Trapped 200 Scammers in an Impossible Maze

As one commenter put it, “I love how Kit has evolved over the years to find out the best way of making scammers go crazy is to treat them basically the same way Comcast treats their customers.”

ssokolow,
@ssokolow@lemmy.ml avatar

Lemmy hangs whenever I try to post my response (I suspect it doesn’t like the length), so here’s a link to it on Github Gist:

gist.github.com/…/16c9311573eabc7343ff7ff2cc3513b…

It begins as follows and I’ve tried to hyperlink my sources as often as possible:

I’ll try to fill in some of the knowledge gaps and respond to some of your answers from a more user-centric perspective.

Proton Mail CEO Calls New Address Verification Feature 'Blockchain in a Very Pure Form' (tech.slashdot.org)

Proton Mail, the leading privacy-focused email service, is making its first foray into blockchain technology with Key Transparency, which will allow users to verify email addresses. From a report: In an interview with Fortune, CEO and founder Andy Yen made clear that although the new feature uses blockchain, the key technology...

ssokolow,
@ssokolow@lemmy.ml avatar

Moxie Marlinspike’s My first impressions of web3 is also a very relevant thing to share.

As a sampler of the points made, web3 is already re-centralizing around gatekeepers because the average person doesn’t want to run their own server (or, in the blockchain case, host their own full copy of the blockchain) and, if the supermajority of users can’t see you because the gatekeepers block you, then it doesn’t really matter that you’re technically still up.

The takeaway on that particular point is that pushing for more and easier data portability is probably the best route in the face of how real-world users behave. (eg. anything stored in a git repository, including GitHub project wiki contents, is a great example of that. You’ve got your data locally with a simple git clone and you can upload it to a competing service with a simple git push.)

ssokolow,
@ssokolow@lemmy.ml avatar

I know what they mean. It may not be enormous, functionality-wise, but just the Iterator trait alone feels enormous when you’re trying to figure out which method does what you want.

I think it’s indicative of a need for more work put into making the UI teach people how to search by function signature.

Is it worth it using Rust+Axum for backend instead of Node.js? In which situations would you do so?

In practical perspectives, I’m mostly concerned about computer resources usage; I have computer resources constraints. So using Rust would benefit on that. But it is for a Web application backend. So, is it worth it having to learn Rust + Tokio + Axum, … in this specific situation? Also, that this is mostly for initially...

ssokolow,
@ssokolow@lemmy.ml avatar

There was a post on Reddit from 2019 that I loved to link to which was about how the poster rewrote a NodeJS service into Rust.

The original was taken down in response to Reddit enshittifying, but it’s still up on the wayback machine and the graphs were hosted on Imgur, where they’re still up without needing the Wayback machine:

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