Rustlang

RL_Dane,
@RL_Dane@fosstodon.org avatar

Why is it that people's reaction to is either cult-level positive or Ted Cruz-level disgust?

I don't think I've heard more than a single person basically say, "Yeah, Rust is ok, but I like X better because Y." ;)

pixelherodev,

@RL_Dane Hell, my personal opposition to Rust only exists because of the cult.

I, for one, have no real basis to have a strong opinion on Rust. It seems like it might have good ideas, but it uses LLVM so it's not worth looking into. The centralized package management is a mistake, IMO; Go got the package management model pretty much right.

Saying "I prefer C" has attracted negative attention (and moral judgements!).

My opposition to Rust is entirely a result of the insane undeserved hype.

janriemer,

@RL_Dane @jbowen
If you make 145 line additions and 129 line removals in one of your core algorithms of 313 lines and all your ~50 tests pass on the first try you just fall in with . It's inevitable at that point. ¯_(ツ)_/¯

ekuber,
@ekuber@hachyderm.io avatar

If there were an opt-in lint you could run on #Rust code to assert a function you've written will never panic, how would you want (the default) to be when handling method calls on trait objects where some impls might panic? Error given that it could panic or downgrade to warning given that we don't know for sure?

ekuber,
@ekuber@hachyderm.io avatar
janl,
@janl@narrativ.es avatar

@ekuber nice!

janriemer,

Currently in the process of rewriting my from v4.2 to v1.0.0-alpha.6 🤓

It is a lot of fun so far, but I have to say these type signatures are wild!😄

I'm still struggling with it far more than I'd like, but I guess it is just a matter of time until intuition kicks in and it will become more and more natural.

Exciting project ahead!🙂

I'm even able to parse string literals with escape sequences - something I haven't even achieved with nom!

niklaskorz,
@niklaskorz@rheinneckar.social avatar

@janriemer don't forget to box now and then to keep your build times sane 🫠

jsbarretto,
@jsbarretto@social.coop avatar

@janriemer Nice! If you ever find the type signatures confusing, remember that you can use .boxed() pretty much anywhere to massively simplify things: https://docs.rs/chumsky/1.0.0-alpha.6/chumsky/guide/_00_getting_started/index.html#advice

Also, the examples in the docs are quite numerous and should be fairly helpful. The crate examples show you how to grow everything into a more non-trivial design.

josiah,

Stop staying you can't put R in prod. :rstat:

I made a blog post with my thoughts and reactions.

#rstats #rust #putRinprod

https://josiahparry.com/posts/2023-07-06-r-is-still-fast.html

rmflight,
@rmflight@mastodon.social avatar

@josiah I mean, we had @jnolis writing about using R in prod at T-mobile 5 (!) years ago! And the context there implies that it's getting hit a bunch, if it's being used to classify customer responses.

https://opensource.t-mobile.com/blog/posts/r-tensorflow-api/

PointyFluff,

@josiah

Wonderful!

Would you be interested in working for my submersible company in Everett?

Looking for a “pilot".

:blobcatgoogly:

ekuber,
@ekuber@hachyderm.io avatar

#RustConf 2023
@nellshamrell's "Rustacean Community Interfaces" talk in full swing, talking about the many hats rustaceans wear.
#rust #rustlang

image/jpeg
image/jpeg
image/jpeg

ekuber,
@ekuber@hachyderm.io avatar
ekuber,
@ekuber@hachyderm.io avatar

Joannah Nanjekye from the @ThePSF project talks garbage collection at @rustconf

https://rustconf-2023.sessionize.com/session/476372

d_k_bo,
Stark9837,
@Stark9837@techhub.social avatar

@diazona @Makeavoy @d_k_bo

I thank is te best one: (excuste my mistaked, havent done it in a way)

A ? TRUE : B

Makeavoy,

@Stark9837 @diazona @d_k_bo ?: Is best girl for sure. Lots of languages use it that way since C/algol/smalltalk set the stage for it. Kind of hate any alternative tbh. Lua even has an unused ? Token and they still opted out. Rust at least does this amazing thing with it for error bubbling so I'll forgive it.

ekuber,
@ekuber@hachyderm.io avatar

Request for feedback: how would you change this compiler error? Can you tell what's going on? What the problem is? Do you get a sense of how you might be able to solve it?

kornel,
@kornel@mastodon.social avatar

@ekuber I'm not saying it should be disallowed. I'm saying it has bad UI. People get into such situation by accident, are unaware when it happens, and a simple cargo update can add dupes to a no-dupes project without informing the user, and without straightforward ability to undo that.

pierstoval,
@pierstoval@mastodon.social avatar

@ekuber yeah, that's the "it's possible" case that bothers me, because two different versions of one dependency at the same time shouldn't be possible in the first place.
Disallow this, and the entire ecosystem has to adapt, and will adapt.
Allow it, and every project will be susceptible to having that, and endure the side effects...

markuswerle, German
@markuswerle@nrw.social avatar

Because is a secure language you can set RUSTFLAGS to "-zsanitizer =address". I begin to understand.

xfix,

@markuswerle @laund Bjarne Stroustrup in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2739r0.pdf said that "C++ Core Guidelines specifically aims at delivering statically guaranteed type-safe and resource-safe".

It's a 475 rule document where many rules aren't statically verifiable, and even if you follow it you still have problems because of issues like https://github.com/isocpp/CppCoreGuidelines/issues/1038.

Meanwhile ensuring safety in is much simpler. Even if you do use unsafe, compiler helps, & tools like Miri are much better than what C++ has.

TehPenguin,
@TehPenguin@hachyderm.io avatar

@markuswerle @laund Well, it's nice that you get to work on your own code that has no bugs.

When you have some practical advice on how to reduce the number of bugs in a codebase that is 30+ years old, billions of LOC and worked on by 10,000+ engineers let me know.

In the meantime I'm going to use the empirical results of my own team's porting efforts and efforts like Google's (https://security.googleblog.com/2022/12/memory-safe-languages-in-android-13.html) to continue to push towards Rust and away from C++

pete_wright,
@pete_wright@nlogic.systems avatar

Honest question for the developers out there. I've observed several pretty high profile OSS projects recently, which are written in rust but are not cross platform. Well at least as far as Unix is concerned, it's Linux or nothing.

This is super unfortunate, not only as a user it locks me out from using these tools...but it also introduces a pretty big blind spot in terms of development which can lead to fragile and/or insecure systems. The whole "monoculture is bad" thing.

So folks hacking on - what do you feel is lacking that makes it easier to write portable code?

chrysn,
@chrysn@chaos.social avatar

@whynothugo @pete_wright Same for pidfd. AFAIK it's the only way to signal processes w/o risking ToC/ToU races.

whynothugo,
@whynothugo@fosstodon.org avatar

@chrysn @whynothugo @pete_wright Yes, these APIs that use file descriptors are great. They’re ergonomic to use, unix-like and race-free.

strypey,
@strypey@mastodon.nzoss.nz avatar

Hey @xmpp folks, if I was to encourage the devs of a messaging server/client written in Rust to implement XMPP, with MUC and OMEMO, what would be the best links to send them for guidance?

EndlessMason,
@EndlessMason@hachyderm.io avatar
pep,

@strypey @xmpp We've released https://xmpp.rs 0.4. There's still a long way to go but we'd like to get feedback.

That's a client library, even though it may be possible to use parsers for the server side as well. And there's a patch pending for OMEMO too.

ekuber,
@ekuber@hachyderm.io avatar

What would you take out of this diagnostic? Is this too much information? Would you prefer to have a shorter message at the cost of needing multiple cycles of the compiler telling you you're missing a change?

sgued,
@sgued@pouet.chapril.org avatar

@ekuber what's the current error message for comparison?

ekuber,
@ekuber@hachyderm.io avatar

Here is the last version of the diagnostic. First is the case people are realistically going to encounter, second is the "worst" possible case. Last one is what it looks like now. Feel free to give feedback!
The code that produces it is at https://github.com/rust-lang/rust/pull/121274

ekuber, (edited )
@ekuber@hachyderm.io avatar

Meet Red Pen, a rudimentary linter: https://github.com/estebank/redpen
I cleaned things up to the point where you can actually use this, but it is v0.1 and I mean it. It most likely won't work when you first try it (linux only for now), but I'm really happy with the first useful lint it has: assert that a function cannot call panic.

PRs very welcome.

ekuber,
@ekuber@hachyderm.io avatar

@brk @tuckersiemens the lint has full compiler internal access, there's very little you can do to hide if we want to look for it 😉

onelson,
@onelson@mastodon.social avatar

@ekuber congratulations 🎉🎉

janriemer,

C++ will be taken over by .

What will be the Rust-equivalent for ?

I mean is a very good first step, but it's basically the C++ for C.

So in short:
C => C++
JavaScript ≈> TypeScript
C++ =>
JavaScript => ???

I think it will be a looong way to go, but maybe, maybe we'll see more and more in the , but not quite sure yet.

#C

mo8it,
@mo8it@fosstodon.org avatar

@janriemer Currently, TS is the best available option. WASM is the future, but it is not there yet. I mean, you get problems if you try to launch a thread…

funnylookinhat,

@mo8it @janriemer honestly... Dart?

It solved all of the problems with JavaScript a long time ago, and has had a remarkable staying power due to Flutter.

Crell,
@Crell@phpc.social avatar

This video is about , but it's comments about error handling are valid for anyone in any language. PHP friends especially, this is the kind of stuff I've been ranting about for a while now. :-)

https://youtu.be/sbVxq7nNtgo

psycodepath,

@heiglandreas @Crell models vs reality:

Be me: waiting for a bus at a bus stop next to a greek diner. A homeless guy steals a beer from the diner. The owner chases him and demands his money. A brawl starts. Me calls the police. The operator: "Did some of the participants said they want the police. Could you ask? That is nothing for the police until someone is seriously injured"

I experienced a segfault in my brain whilst invoking $police->call($violentSituation);

heiglandreas,
@heiglandreas@phpc.social avatar

@psycodepath Police in Germany....🤦

Usually it's for the police when someone calls the police.

But it's also the reason why I took the firebrigade as example. 'Cause WHEN they are called, there is no holding back. They don't ask whether someone actually wants them. They will be there!

/cc @Crell

Crell,
@Crell@phpc.social avatar

Thought experiment:

We have languages without null (eg, ), and it's been a good thing.

What would a language without booleans look like? Force things to be context-specific enums or similar.

Something to think about this weekend while avoiding your inlaws...

dgoosens,
@dgoosens@phpc.social avatar

@Crell @maxtappenden @syntaxseed

TBH, I see no reason why Rust’s Result that you phpized already (I’m using it!) would not be able to deal with binary

All you’d need is multiple types of Success or an additional property to it to make them more specific

— For this interested, Larry wrote about null here:

https://peakd.com/hive-168588/@crell/much-ado-about-null

cebe,

@Crell
How does if/else work in a language without booleans?

If you can not write expressions that evaluate to true/false that would be a very big limitation.

Or maybe you disallow assigning boolean expression to variables. But still that would feel very weird to write code in that language.

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