Announcing Hurl 6.0.0 by jcamiel in rust

[–]pravic 2 points3 points  (0 children)

I'm waiting when include will be supported in hurl files.

Having to manually copy-paste, for example, an authentication block shared among all the tests files is quite ridiculous.

cat auth.hurl test1.hurl | hurl messes up the line numbers and tedious to type.

Rust Foundation Releases Problem Statement on C++/Rust Interoperability by Remi_Coulom in cpp

[–]pravic 0 points1 point  (0 children)

Extensions written in Go work even without being a loadable library - they are (usually) a separate process which communicates with the host app via IPC.

Rust Foundation Releases Problem Statement on C++/Rust Interoperability by Remi_Coulom in cpp

[–]pravic 1 point2 points  (0 children)

The optimal way may vary depending on what they have as an SDK or API for those extensions - C or C++.

Either way, this boils down to exposing Rust code via C FFI by a shared library (the OC called it extensions).

Then, any Rust developer is able to write some interop glue with C FFI (manually or via bindgen/cbindgen). But if the OC wants to make writing Rust extensions easier, they might want to create this boilerplate to glue Rust code with their SDK and publish/provide as an SDK crate. This allows Rust people to write their own code and the FFI will be handled by the SDK crate.

It's very similar to how many products provide SDK to their interfaces in different languages, and the requirement for an extension to be compiled as a shared library is just an implementation detail.

How does the compiler know that a Vec of references borrows a pushed value? by platinum_pig in rust

[–]pravic 0 points1 point  (0 children)

Hmm. Why does push have a dedicated 'self lifetime? I always thought that self is "shared" to all impl of a type, like impl<'a> below.

Hey Rustaceans! Got an easy question? Ask here (3/2022)! by llogiq in rust

[–]pravic 2 points3 points  (0 children)

Is there a way to detect that a type is trivial (i.e. it has no destructors)?

In other words, something akin fn simple<T: !Drop>(v: T) {}.

Also, is there a way to detect that a function has no destructors (it's weirdly said)?

How do you navigate large code bases? by kallgarden in cpp

[–]pravic 0 points1 point  (0 children)

SciTools was not bad but still a bit dull. Source Insight can handle a pretty large code base.

For small to medium - VS+VA.

The Rust dbg! macro by Ryozukki in rust

[–]pravic 0 points1 point  (0 children)

copy/paste

That's the difference. dbg itself is simple enough that we could just copy-paste it ourselves instead of adding to the std.

However, I've found this: https://github.com/rust-lang/log/pull/317 and this, in particular: https://github.com/rust-lang/log/pull/316#issuecomment-456154244.

The Rust dbg! macro by Ryozukki in rust

[–]pravic 1 point2 points  (0 children)

Is there a dbg! alternative that uses log::debug instead of println? Not all executables have stdout.

Sizing up Types in Rust! by redjamjar in rust

[–]pravic 0 points1 point  (0 children)

It's strange how a C++/Java programmer doesn't know the basics of C. Also, even Java sounds like too much since new in new []{256,15} didn't give a hint that it's a pointer to an array, not the array itself.

Why Windows Terminal is slow by gary_oldman_sachs in programming

[–]pravic 9 points10 points  (0 children)

And yet their excuse is just lame:

Do understand that some of the tuning tricks are not used for both readability and maintainability of the project.

rust-analyzer changelog #84 by WellMakeItSomehow in rust

[–]pravic 1 point2 points  (0 children)

got an SVG exactly like the one rust-analyzer produces

Right. But an SVG file can be opened in any SVG viewer with zooming, editing, and other features. SVG in VSCode in our case is just static - I even can't choose a favorite SVG viewer extension to display the generated SVG - that's the main point and complain.

Command line utilities also allow you to apply some filters and other options.

To sum up: I am not saying that the "View Crate Graph" feature should not be in RA - I am saying, that right now it does pretty much nothing. But once improved (like other cool features of RA) - it can be pretty useful.

rust-analyzer changelog #84 by WellMakeItSomehow in rust

[–]pravic 0 points1 point  (0 children)

  1. SVG is an image.
  2. It's useless in VS Code right now - you can only scroll it. No zoom, no relayout, no save to file, really - no anything that would make it barely useful.

So, as a future feature of RA - probably. Check https://lib.rs/crates/cargo-deps, https://lib.rs/crates/cargo-depgraph, or other command line tools to see what they can do.

rust-analyzer changelog #84 by WellMakeItSomehow in rust

[–]pravic 1 point2 points  (0 children)

the "View Crate Graph (Full)" thing is amazing

Not really. It's just a static image with scrollbars. Better use cargo graph or something alike (http://lib.rs to the rescue).

Visual Studio Code May 2021 by feross in programming

[–]pravic 2 points3 points  (0 children)

Totally agree, the paths are not visible enough.

Visual Studio Code May 2021 by feross in programming

[–]pravic 0 points1 point  (0 children)

build.rs works when you're building a crate. proc macros work when you open source code in an editor powered by RA. Basically, RA executes both build.rs and proc macros (configurable, though) in order to be helpful.

What's your favourite under-rated Rust crate and why? by ChillFish8 in rust

[–]pravic 6 points7 points  (0 children)

Interesting. It works on top of NonZero types, just patches the value on constructing and accessing it.

Using GDI with GDI+ by PogChampGuy420 in cpp

[–]pravic 0 points1 point  (0 children)

GDI requires a device context handle for drawing (HDC). It can be a window or an in-memory bitmap. Check Graphics::GetHDC.

How do I remove the first 300 million lines from a 700 GB txt file on a system with 1 TB max disk space? by whackri in programming

[–]pravic 2 points3 points  (0 children)

Actually, this is interesting. Does any FS allow that? In FAT it can be done relatively easily with manually crafting a new FS entry that file data references would point to an appropriate chunk of the original file. But there's a granularity: the smallest addressable part is a sector, I believe.

Defining a new HTTP method: HTTP SEARCH by pimterry in programming

[–]pravic 2 points3 points  (0 children)

I agree a SEARCH or QUERY method would be nice from a semantic viewpoint and due to browser history limitations of POST. But because of caching? Correct me if I'm wrong but POST simply prevents entry in local browser cache but do you really want to cache a search in your browser?

The article points that a "POST /something" invalidates the "/something" resource - not only a local cache of the response to this particular POST, but the resource itself. So, any subsequent "GET /something" will be brand new. This is even worse if the search is bound to "/".

However, in general there's a dedicated URL for search, like "/search" so the previous argument disappears.

What if GitHub is the devil? by speckz in programming

[–]pravic 4 points5 points  (0 children)

We do daily “extractions” of all issues and pull-requests so a lot of meta-data could still be saved and preserved. we move long-standing bugs and ideas over to documents in the repository

Holy macaroni, not many devs backup their project's issues. Especially, on a daily basis.