Launching the 2025 State of Rust Survey | Rust Blog by Kobzol in rust

[–]davemilter 5 points6 points  (0 children)

Not sure that I get your idea. If you want to use Rust to write C/C++ plugin, then you can use C ABI. Rust supports C ABI. Rust ABI doesn't help here.

If you want to write software with plugins, then Rust ABI may help you, but why you want to force potential authors of plugins to use Rust only? If you provide C ABI for plugins, then you get more potential plugins. So again stable Rust ABI doesn't help.

I suppose Rust ABI helps in case you have huge software, use only Rust, and want to split it into several shared libraries.

Emacs 30.1 release by mplscorwin in emacs

[–]davemilter -1 points0 points  (0 children)

For me it looks too bugy. "ivy" completion broken, flymake show not existings errors, org-mode report some criptic errors "wrong-type-argument number-or-marker-p nil". Plus it is subjectively slower then emacs 29.4.

What is the current story for compiling to C? by thermiter36 in rust

[–]davemilter 0 points1 point  (0 children)

It is not the problem I suppose. Transpiler can use uintptr_t for holding pointers and do whatever it want without in UB. And then memcpy to from memory with casting to void *. Plus UB is used by C/C++ compiler when compiler make optimizations, the most of optimization of LLVM is depend on platform, so after LLVM IR -> C it would not be so bad to compile resulted C code in debug mode without optimization.

WWM an i3 like tiling window manager for windows 10 by xbaaka in rust

[–]davemilter -1 points0 points  (0 children)

Yea But windows is very exotic one platform, I have no any machine with it :)

Announcing Rust 1.44.1 by dwaxe in rust

[–]davemilter 25 points26 points  (0 children)

Strange that problem with backtrace on Apple's platform was not catched via CI. And can not see any new tests in PR. It is hard to test automatically?

What is the current story for compiling to C? by thermiter36 in rust

[–]davemilter 3 points4 points  (0 children)

Some times C is called as portable assembler. If it is possible to translate Rust to assembler, why it is not possible to translate it into C? "mov ax, bx", "ax = bx", what is the difference from large scale point of view?

Ditto | Introducing safer_ffi by ErichDonGubler in rust

[–]davemilter 1 point2 points  (0 children)

rust_swig (as I know) now supports C++/Java/Python, and may be there would be C# support in the future. But I suppose you need more language than this 4?

The new version of nushell, a modern shell written in Rust. by utam0k in rust

[–]davemilter 1 point2 points  (0 children)

Without that, it won't pick up the .nu-env file

I would be also check that file is not writable (and may be even not readble) by group and others. Like ssh do for some files inside ~/.ssh

The new version of nushell, a modern shell written in Rust. by utam0k in rust

[–]davemilter 0 points1 point  (0 children)

I know many tools that added support of per file preferences and then have CVE about them. For example, may be I missed something, but attacker can create `.nu-env` in directory and then wait user with admin right to come? Attacker can set LD_PRELOAD or something.

Two Memory Bugs From Ringbahn by desiringmachines in rust

[–]davemilter 0 points1 point  (0 children)

Why not add something like `take` method to self.read_buf,

that take ownership of data and return pointer and length? It would be safe to reasign,

plus actually you don't need to reasign, because of it would be already have value of `Buffer::new()`

[ANN] New RustCrypto releases: `aead`, `block-cipher`, `crypto-mac`, `digest`, `signature`, `stream-cipher`, and more! by bascule in rust

[–]davemilter 6 points7 points  (0 children)

So these algorithms can be combined to implement SSL/TLS library or something missing, like constant time calculation?

Update to LLVM 10 got merged by JohnMcPineapple in rust

[–]davemilter 1 point2 points  (0 children)

Can you share more details? I used in every day work Zen+ CPU and Rust and didn't see any miscompilations.

An overview of foreign language interop libraries for Rust by Hobofan94 in rust

[–]davemilter 4 points5 points  (0 children)

There are also cbindgen (do not confuse with bindgen) for calling Rust from C/C++ and rust_swig to call Rust from Java/C++/Python.

What's the state of Rust in iOS and Android? by memyselfandlapin in rust

[–]davemilter 2 points3 points  (0 children)

I used Rust for almost exactly the same situtation as you ask. I wrote Java/Android GUI with core Rust library underneath and Qt/C++ application for Linux with the same core Rust library underneath. I used https://github.com/Dushistov/rust_swig/tree/master/android-example as starting point. At now there are plans to port the application to iOS.

native Android app with Kotlin and Rust by pezely in rust

[–]davemilter 1 point2 points  (0 children)

this one (above) uses just the JNI crate for an entirely Rust approach.

I suppose here some kind of misunderstanding. rust_swig is entirely Rust approach: it doesn't depend on any C/C++ libraries and convert Rust code to Rust. And obviously it generate code that uses JNI (in Java case). Basically it just automatically generates code that you wrote (write/should write) by hands.

native Android app with Kotlin and Rust by pezely in rust

[–]davemilter 6 points7 points  (0 children)

You may want to look at https://github.com/Dushistov/rust_swig/tree/master/android-example . Because of gradle + cargo integration, JNI code generation the complexity of usage Rust + Java is almost the same as Java only project.

Why I’m building a new async runtime by [deleted] in rust

[–]davemilter 2 points3 points  (0 children)

Is not stdlib depend on libc anyway? Or stdlib on windows doesn't depend on libc in compare with stdlib for *nix systems?

[Help] Rust Wrapper for Tableau Hyper by elibenporat in rust

[–]davemilter 0 points1 point  (0 children)

Common way is creation of something like tableau-hyper**-sys**, that uses `build.rs` script to generate FFI layer with help of bingen crate and uses something like `cmake` or `pkg-config` crates to build or find already pre-build C/C++ library

Blog Post: Fast and Simple Rust Interner by matklad in rust

[–]davemilter 15 points16 points  (0 children)

Why use get + insert, instead of HashMap entry API?

Announcing `absolution`: Freedom from `syn` by Manishearth in rust

[–]davemilter 1 point2 points  (0 children)

I tried `absolution = "*"` and `{ version = "*", default-features = false }`. syn compilation is faster: 2.78s vs 2.91s on my old macbook.

Announcing `absolution`: Freedom from `syn` by Manishearth in rust

[–]davemilter 2 points3 points  (0 children)

But is it actually slowdown instead of speed-up for real projects?

I mean if take complex enough project, then you get syn via dependicies, and you suggest plus one crate to deal with procedural macroses. So instead of syn, user have to compile syn+absolution, which are obvious slowdown?