AstraKernel, (edited ) to rust

🦀

Will it print Hello World?

A. No, it will give compilation error

B. Yes, it will print Hello World

C. No, it will panic at runtime but prints 1

This challenge was brought to you by @tuxmain

rust, to rust
gfxstrand, to rust
@gfxstrand@mastodon.gamedev.place avatar

Can I just say I really love . 😍 Not only was I able to eliminate an entire category of bugs today thanks to rust reference semantics but I also love the little language features.

Today's programming joy came from loops being expressions and break with a value. I can't count the number of times I've hand-rolled that in C or made an entire function just for one loop so I could use early returns. Having loop expressions as a language feature is really nice. 😁

epage, to rust
@epage@hachyderm.io avatar

Been giving some thought to how to improve testing in : https://epage.github.io/blog/2023/06/iterating-on-test/

ecton, to rust
@ecton@fosstodon.org avatar

Another episode of The Way of the Crab has been released, where @togglebit and I chat about our testing philosophies, evaluating crates, and more. https://wayofthecrab.com/episodes/006/

AstraKernel, (edited ) to rust

🦀 what is the output

A.
0
1
2
3

B. Compilation error

C.
2
1
3

D.
2
3
1

E. None of the above

Credits to @orhun

eurorust, to rust

Former Rust Core team member, Founding Executive Director of the Rust Foundation, and Founder of axo, Ashley Williams will be joining EuroRust 2023 as a speaker! 🚀

It’s great to have you on board Ashley!

Stay tuned for updates!

➡️ https://eurorust.eu/

davy, to rust
@davy@hachyderm.io avatar

ezno - a JavaScript compiler and TypeScript checker written in Rust with a focus on static analysis and runtime performance

https://github.com/kaleidawave/ezno

thisweekinrust, to rust
@thisweekinrust@mastodon.social avatar
ManningPublications, to rust

📣New in MEAP📣

Looking to take your Rustlang skills to the next level?

Go beyond the basics by studying design patterns & find tips and tricks that help speed up delivery and make full use of Rust’s lesser-known features: http://mng.bz/GymA

TheSteve0, to rust
@TheSteve0@data-folks.masto.host avatar

Fun for all the cRUSTaceans - you can now write embedded code in with PL/Rust. AND it's a trusted language!

https://github.com/tcdi/plrust

0xor0ne, to rust

Excellent blog post explaining the Cow (clone-on-write) type in Rust

https://blog.logrocket.com/using-cow-rust-efficient-memory-utilization/

image/jpeg

orhun, to rust
@orhun@fosstodon.org avatar

🦀 quiz

what is the output of this program?

eurorust, to rust

Our first speaker is confirmed! 🚀

Niko Matsakis, Senior Principal Engineer at AWS and member of the Rust Compiler team, will be a speaker at EuroRust 2023! 🎉

Follow us for updates on the talks, and get your tickets at: https://eurorust.eu/

mo8it, to rust
@mo8it@fosstodon.org avatar

PhantomData of a slice vs a slice of PhantomData?

For example:

PhantomData<(T, U)>

vs

(PhantomData<T>, PhantomData<U>)

Is one variant more friendly to the compiler? 🤔

MadMike77, to rust German
@MadMike77@chaos.social avatar

So I wrote this program where I read and write a fixed size vec!. My algorithm doesn't always work like I want, so I added code to track where I read and write from it step by step to debug it.

The problem is that this tracking "pollutes" my code and I'd like to use a library or a macro to track get and set of this array so I can cleanly switch this tracking on and off.

Does anyone know a library that does this or do I need to write my own?

Boost for range appreciated. 😃

orowith2os, to programming

folks: Any tips for learning it, coming from ?

I'm kind of reliant on the strictness of Rust, especially when it comes to using the wrong types and everything. Some way to force me to follow a similar style would be appreciated.

I'm also very reliant on Cargo, it's so clean and integrates everything nicely. I'm not sure if there's an equivalent for Python that matches Cargo.

also seems interesting for this, I just saw a toot from @airtower that might be useful: https://queer.af/@airtower/110480293814667017

Tips for how to occasionally easily sprinkle in some actual Rust would be nice too.

I will only be developing for .

xgranade, to programming
@xgranade@wandering.shop avatar

New newsletter post! I wrote about 2500 words expanding on my thread a few days ago about values, types, and typeclasses, and explaining why I find it confusing that object-oriented languages conflate types with typeclasses.

https://buttondown.email/xgranade/archive/subclasses-and-typeclasses/

mgorny, to programming

If anyone's up for a challenge, we'd use some help figuring out why importing cryptography on 3.10 causes errors to appear on the error stack.

https://github.com/pyca/cryptography/issues/9010

larsmb, to rust
@larsmb@mastodon.online avatar

$Someone should rewrite in

The rationale given in https://spdk.io/doc/concurrency.html for why it "needs" to be in C no longer holds up in 2023, I'd venture.

jbzfn, to rust
@jbzfn@mastodon.social avatar

🦀 Effective Rust: 35 Specific Ways To Improve Your Rust Code
➥ David Drysdale


https://www.lurklurk.org/effective-rust/

soller, to random
@soller@fosstodon.org avatar

Graydon Hoare: The Rust I Wanted Had No Future

https://graydon2.dreamwidth.org/307291.html

balthasar,

@soller imagine this must be quite special to you as BDFL of @redox . I actually don't remember if i discovered redox or first, anyways coding some rust on a based @system76 device running redox is what I am hoping for. might the best of you and the community converge!

imperio, to rust

Just published the 8.3.0 version of the geos crate.

It prevents the compute_voronoi function to panic by adding new variants in the geos::Error enum.

https://crates.io/crates/geos

Jdreben, to javascript

I regularly use and love #Typescript. I used to use #Python the most – it’s what I learned in and I am more interested in backends than frontends. I also am regularly using and really enjoying #Kotlin (so much better than #Java). But truly Typescript is bae.

#Julia is a joy to work with. Very much like Python but more powerful. If it had the library support Python or #JVM has I would probably prefer to use Julia for backends.

But Typescript really changed the game and now that’s probably my favorite language not just because of the language itself but because it has web dominance. Until I can write #WASM with Python or Kotlin or Rust, and I’m building #web applications, TS is my lingua franca.

I want to try #Rust because it’s the new hotness.

janriemer,

@Jdreben @guardiarris @maegul Yes, at least takes the approach of using signals to update only the minimal amount of DOM that actually changes.

Regarding JS: you don't need to touch it explicitly in those frameworks, BUT: it is still used to manipulate the .

For this to work, a lib called wasm-bindgen is used (awesome piece of technology!), which basically bridges <-> :

https://rustwasm.github.io/docs/wasm-bindgen/

leptos_dom depends on it:
https://github.com/leptos-rs/leptos/blob/4ade062cd8cdbe9128aa7a2c8169c17c9d3e874c/leptos_dom/Cargo.toml#L28

cxiao, to rust

In the new Rust Windows kernel GDI code, there is a new global allocator registered named gdi_alloc::Win32Allocator . It calls Win32AllocPool with a fun new pool tag name, "Rust"!

cxiao,

The Rust code in the new win32kbase_rs.sys in the Windows Kernel can also panic. What happens when it does?

There are several places where a panic is invoked in the code - they include bounds check failures (core::panicking::panic_bounds_check), indexing into a slice outside of the length of that slice (core::slice::index::slice_start_index_len_fail_rt), and assertion failures (core::panicking::assert_failed). These all eventually take a common code path through the following series of function calls:

core::panicking::panic_fmt::hd60a775b92204b91<br></br>-> rust_begin_unwind<br></br>--> seh_unwind::implementation::raise_exception::hc52a1220c03bdc19<br></br><br></br>

This calls into a custom panic handler, seh_unwind::implementation::raise_exception, which calls RtlRaiseException, imported from the main ntoskrnl binary!

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