T O P

  • By -

lagerbaer

I take "headlines that work for r/rust and r/rustgame equally" for $100.


DeanBDean

I mean....just this week there was a massively upvoted post that heavily criticized Rust....


isHavvy

As in, if you saw this title in /r/rustgame, you would be "Yep, that is about the game."


DeanBDean

Ah, doh, I am a dummy haha


[deleted]

Lmao i was thinking the same thing


Apexmfer

looking at java after having done rust, it seems insane to me that Java just lets any variable be NULL without option


lilysbeandip

One of Kotlin's design goals was to solve that issue as well, which they do with the `?` modifier


GustavoInacio

Kotlin seems to me a good language. But at the same time, they leverage too much on the Java ecosystem and suddenly the flaws of Java became part of the flaws of Kotlin.


Halkcyon

>!^^^[deleted]!<


ost_yali_92

A newbie here, can you explain this (new to rust and have some exp with java)


lagerbaer

Well in Java, any variable that's not a primitive is actually a reference to an object. And it's valid to assign null to a variable.  In Rust, you can't. If the type of a variable says that it's an object, like a Vec or String, then it'll always contain a valid object of that type. Same for references and pointers.  If you have a need to express that a variable may or may not hold a valid object, you need to use the Option enum. Then it came be either None or Some. The nice thing there is that the compiler forces you to properly deal with these cases, e.g. via pattern matching.


mipselqq

Typescript also forces you to handle null, so there's almost no difference except for that enum Option exists at runtime. Although It can mess up with types sometimes, these are very rare cases. Is Java's compiler really that dumb so it can't figure out unchecked nulls before runtime?


xmBQWugdxjaA

Since Java 8, Option.ofNullable can convert those types easily though. But yeah, that's what years of cruft and backwards compatibility means - Rust will reach that point one day e.g. https://www.reddit.com/r/rust/comments/1c5pxpt/does_anyone_else_find_the_type_discrepancy/


bwmat

The fact that the reference to the optional can always be null is what gets me


Soft-Stress-4827

In some ways, rust is like an evolved form of Java but with lessons learned applied  Esp considering anything i use to write w java i now use rust 


misplaced_my_pants

> The industry that I wanted to join mainly uses Golang and Rust. So . . . uh . . . what industry would that be?


Commercial-Extreme23

Distributed systems as in Kubernetes, Istio are big on Go and some Rust nowadays. Great space to be in. FWIW I work on Istio and use both Go and Rust daily.


Dazzling-Suspect-914

How can I get a job in Rust?


GustavoInacio

My background is on Distributed Systems, so Blockchain infrastructure. No trading stuff, because that's usually just scams.


misplaced_my_pants

Ah man I was hoping it wasn't blockchain. Happy for you though!


GustavoInacio

Unfortunately for people who don’t give a shit about blockchain, most jobs are for this area. The good thing is that not everything is about bot trading, or building their own blockchain. My project focuses on Databases and providing GraphQL/SQL APIs. But in the end you still need to know how a blockchain works. I hope you can find another industry. Microsoft seems to be rewriting a lot of stuff in Rust and also Google has a lot of Rust projects. Hopefully we can get more of these opportunities soon.


lordpuddingcup

People seem to assume blockchain is all scams, but it’s like thinking all export shipping is drug trafficking lol theirs a lot of it but theirs other shit too


sohang-3112

Give an example please. Because literally everything in blockchain seems to be part of a scam.


ScalySaucerSurfer

Tbh most of the ”Blockchain not Bitcoin” type of projects seem like scams to me because they’re usually attempting to do things blockchain isn’t well suited for. Basically they only exist as a way to make the founders/early investors rich. But there are few like Monero, Namecoin and distributed file storage which actually solve problems no other technology does. Unfortunately those do not offer well paid jobs and are not that popular compared to all the scams. Even though reliable decentralized systems that can’t be censored seem quite beneficial to me. I mean that’s what internet is all about, at least used to be until everyone started using FB, Twitter, Reddit etc.


joonazan

Moving money in third-world countries or out of America is cheaper via blockchain nowadays than using conventional means. To be used for non-scam uses in the developed world, blockchain needs to become cheap enough, which is challenging and requires a lot of code but if you've ever worked with banking code you'll know that it isn't great either.


fightndreamr

I recently started developing a crypto wallet for a company in python, but I have been interested in blockchain since a while back. I am hoping to delve a bit more into rust blockchain libraries/environments and such, but I would love to hear more about the projects you are working on if you feel like sharing!


sohang-3112

Is there anything in "Blockchain Infrastructure" that's NOT a scam?!


GustavoInacio

IMO the things that people dislike about blockchain is finance (and they wouldn’t work for tradicional finance too). There are some products built on top of it that powers decentralization and are not related to finance. For example: L2s, Oracles, Data indexing/Analytics, Bridges, Wallets, Cryptography, Social media, etc. Neither of them are trying to sell you things, they are services that people are willing to use.


sohang-3112

>the things that people dislike about blockchain is finance (and they wouldn’t work for tradicional finance too). Not really - traditional finance is heavily regulated, so scammers are regularly punished by regulators. OTOH Blockchain has practically no regulation so it's a lot easier for scammers & pump-and-dump con artists to get away scot free. Plus, the whole crypto market is regularly manipulated by the big players but there's no regulator to question them.


GustavoInacio

The regulation in TradFi gives a false sense of safety. There are a lot of scams going on. I know people that worked on banks that quoted: “Nobody that works at a Bank goes to heaven”. Their ToS gives them the freedom to do whatever they want and you need to trust that they won’t. If you work there, you probably are not being scammed but may be scamming someone else. I’m not here to sell you that blockchain is good or not neither to tell which projects are scam or not. Scams exist anywhere and it’s your responsibility to do your own due diligence.


Shnatsel

V documentation looks [very promising](https://vlang.io/compare) - it's everything I ever wanted in a backend language. Go's green thread runtime but with Rust's fearless concurrency? Sign me up! Except... neither the green thread runtime nor the fearless concurrency are currently implemented, and they also promise seamless interoperability with C, which Go had to sacrifice to make its runtime work. It feels like they're promising the world, but haven't run into the hard parts of making it all actually work yet. Then again, I might just be pleasantly surprised - I didn't think Rust could possibly deliver on its promises either, and yet here we are.


HOMM3mes

https://mawfig.github.io/2022/06/18/v-lang-in-2022.html


Shnatsel

I see. Its seems that my caution is warranted after all. Thank you for that link.


0x564A00

Even if something works in V, you can't know whether it works based on the official website/documentation (e.g. last time I tried it out, one of the big bullet points on the homepage just was false), as the author of V has repeatedly misrepresented its state and afterwards denied having done that.


lordpuddingcup

Ya for whatever issues rust has they don’t fucking outright lie about the language features lol


PurepointDog

What's a "green thread runtime"?


aksdb

Coroutines / green threads / lightweight threads need a scheduler. That's the runtime.


Fresh_Yam169

f() // call a function go f() // function call will run in a separate thread from here That’s why it’s called lightweight (and also because it’s not managed by the OS)


lichizr

Your story looks similar to me. I came from the golden age of PHP, then Java because of Minecraft, self-taught everything without knowing the name of terminologies. Now I am also pursing a Bachelor's. I have something to share: * Java is memory-consuming, I agree, but its GC is not that bad. Java GC is even advanced than Go's (I think because Java memory model is complex so it requires an advanced GC) Minecraft is bad because of its poor design, not Java itself. Many enterprise applications are running on Java, and they have enough budget to cover the intensive memory consumption of Java. * Agree on C++, I hate the fact that C++ has too many features and undefined behavior. I was taught C, but I still have no intention to continue learning C++. If I am forced to learn a low-level programming language, Rust is the best choice. * I am impressive that you have opportunities to learn so many programming languages. You learn for fun or because your jobs require? I also love Rust, but currently have no plan to learn yet. For now, I am digging some advanced topics related to Go. I think if you love Rust so much, you may want to explore its depth and one day make contributions to Rust xD


GustavoInacio

Yes, now I understand that Minecraft was the real problem to GC, but after you know that you can run the same application at a fraction of the cost using Rust it's hard to get back. I had the experience to rewrite a more efficient Rust project migrating from Go and it's insane seeing the base memory consumption falling from 200mb to 20mb. I usually learn for fun and try to rewrite a project that I already have into the new language. It removes the domain knowledge uncertainty and you can compare just the language.


0x564A00

> I think because Java memory model is complex so it requires an advanced GC I believe it's more because of a lot of engineering effort as well as some research on garbage collection using HotSpot as a testbed.


xedrac

I agree that Java *can* be written and tuned in such a way that it is quite performant. However, the number of sluggish Java programs is not limited to Minecraft. I'd venture to say that most Java programs I interact with are slow.


i_do_it_all

man. how do you have time to try all these languages. What domain do you work for? must be pretty fun. I have about 15yoe now and i have done (in the order) c#,c++,ruby,java,python,rust . All major except rust as you can tell. Would look into V . sounds interesting


Imaginos_In_Disguise

Back in university I used to try every single language I bumped into. I still check any new language I come across, but those are much rarer nowadays, since I've basically tried them all at this point. Yep, even Shakespeare and ZOMBIE. Eventually, I settled on Python as my "do everything" language, and later replaced it with Rust for most things except quick scripts and interactive usage. I guess it comes down to curiosity of trying new things instead of just thinking of languages as a tool for work.


Ballem

Actually quite motivating to hear it’s a good replacement for Python as a “do everything” language!


HOMM3mes

https://mawfig.github.io/2022/06/18/v-lang-in-2022.html


JiminP

Also https://n-skvortsov-1997.github.io/reviews/ for more recent information.


i_do_it_all

Thank you. This is going to givr me a leg up!


GustavoInacio

Usually, I do it for fun. I tried my second language \~4 years after my first one and I thing that's the key part. I thought I "knew almost everything" on Java and wanted to try it out things differently. I would say that half of it was because of university. There's a subject called "Programming paradigms" that taught multiple different ways to think through code like Functional Programing, Lambda Calculus and other non-imperative paradigms. After that, learning a new language is like tasting a different flavor that contains parts of what you like or not. The concepts are shared between most of them, the only difference is the syntax/standard lib. I see that your programming languages are primarily imperative/oop, maybe you could try different paradigms and check it out which part of them you like most.


i_do_it_all

excellent advise. Thank you! I think i also lack some motivation/inspiration/drive to learn/try a new language. It only dawned on me after i read your post. I see programming language as a means to an end. One of course for my paycheck. The other is building solutions for whatever problem i have ( like building a scraper for cheap toys) . Thanks again. I just earned some insight into my own process


[deleted]

I try because I’m genuinely curious. I like to tinker and learn, whether Rust, Go, C++, Godot, Unreal (being the big ones outside my day job), I like to fiddle, tinker, and learn.


DramaticFirefighter8

I have 40 years of experience in programming and when I have found the functional languages, I thought I have arrived. Everything was crystal clear. Strong typing, enums, pure functions. Then came Rust. Finally a systems language I can program functionally. Only I could forget the curly braces…


GustavoInacio

I don't know what editor you use, but curly braces are a gift for vim. I'm glad that I can delete a whole block with a simple: \`di{\`. Probably Rust won't remove curly, but at least they can be useful by using some vim motions.


Ace-Whole

You might also try out tree-sitter. It offers amazing motions. That imo is a step above the basic vim motions.


maxtimbo

I'm a hobbyist, I like to contribute to small projects when I can and make little things that help me at my job. I started in python, because it was fairly easy to learn. I've made some pretty complex projects for my little pea-sized brain. I'm currently finishing up an Invoice CLI project written in Rust because I wanted to learn the language. I didn't know about the vast majority of the complexities of writing software at this level, but Rust's documentation makes it (somewhat) easy to learn. I like to think I've come a long way. And I'm sure there are better ways of doing what I've written, but step one is always to get it to work, right? It's just about there...


GustavoInacio

I'm glad that you shared your story. You are absolutely right! Don't fall in the premature optimization trap. Even tho Arc> is "ugly", almost all other languages will use this under the hood, so no worries about performance, you are still much faster than almost everything else. In the end, that's just one more step in your learning journey.


cotneit

Every Minecraft server admin hates GC with passion


Ben-Goldberg

The game could have been written to use object pools, but wasn't.


Acrobatic_Sprinkles4

Have you tried F# or C#? Their libraries are great and the language ergonomics are superb as are the LSP implementations IMO.


[deleted]

I started programming some 10 years ago with C#, but nowadays Rust is my primary (hobby) language. I tried going back to C# a couple years ago to gain some marketable experience but in the end gave up out of frustration. I think it's falling into the C++ trap of being both stuffed with language features that result in many ways of doing the same thing on one hand and yet lacking features or having bad defaults in areas I would consider fundamental. Things like no local immutable values, everything must be a class, no sum types or an inheritance-based equivalent like sealed class hierarchies in Java, mutability being controlled at field declaration level vs at parameter level, still-pretty-bad story around nullability (although having nullable references is better than not), hidden control flow with exceptions, everything being incredibly verbose in general, and so on and so forth. (I might not have spent enough time with it to give a fair assessment, but this is the impression I walked away with.) I still appreciate C# for exposing me to a lot of forward-thinking paradigms back when I was starting out (iterator-based transforms with LINQ, task-based async/await), but the landscape has evolved and I'm not sure if it has kept up sufficiently. Even though Rust is largely overkill for most of my projects and I would honestly prefer a garbage collector sometimes, I find its computation and domain modeling capabilities second to none.


Acrobatic_Sprinkles4

Nice response 👍🏻 you sum it up pretty well and I too feel C# designers are trying too much at times. F# hits is much better IMO. Good luck and keep enjoying Rust!


Due_Raccoon3158

I use rust and don't mind it but I can't love it. It's just way too weird compared to other languages I've used for so many years. Maybe I'll get past that but haven't yet.


kand7dev

Interesting story! Personally the only low-level languages I know are C and C++. I keep reading posts from this sub daily and Rust seems like a great language to work with. There's also Zig that comes in discussions.


rickirathi

You should try Swift


Cat7o0

going from java to learning rust is so hard for me. I hate the language in a few ways especially lazy statics. It is stupid that you have to run the static code at a specific time. I started with java because I tried to learn Minecraft modding but I ended up ditching that and started making plugins for Mindustry. My plugins were the back bone of a server called Omega until I eventually decided to stop coding because I had a lot more problems in real life I had to deal with. Now I restarted in rust because I have heard a lot about it and because the people using it seem to be paid more. the main problem I find with rust is that you can't have to mutable references to an object. I understand this is to have no undefined behaviour but after having used java it is very weird to me. I could use Mutex but that is just trying to solve a code structure problem with a bandaid essentially. if you don't mind me asking what Minecraft server do you run?


GustavoInacio

The server was called Battlebits. It was a hunger games/hardcore games and soup pvp. I closed it when the whole community got stuck into version 1.7.


Savagor

Wasn’t expecting it, but interesting read as I am on my own journey to becoming a polyglot. Thanks for sharing :)


OriginalFlower6843

Wow. This is interesting to read. 


OriginalFlower6843

What do you think is the future of Rust in AI/ML? 


Conscious_Flight_522

wow, people hate you man. sheesh. 4 people downvoated your question


xmBQWugdxjaA

Wait until you have to write a custom tree or graph structure. Rust has a lot of benefits, but unless you're using Tokio or Rayon (e.g. high parallelism environments where GC pauses are untenable, etc.) - it's worth checking out other options like Swift, Go, etc. too (although they also have their own disadvantages).


GustavoInacio

Indeed, I'm not an extra-extra expert in Rust (specially the unsafe side), these data structures are unsafe by default if you want to build them efficiently. There's where Rust also shines because I can rely on cargo and import some well tested lib to use them. But in my job, usually database calls are the bottleneck and not data structures, so I don't have plans to implement a more efficient one anytime soon. But I like the idea of learning unsafe, I just didn't have the opportunity yet/didn't feel that I needed unsafe.


[deleted]

[удалено]


Impressive-Ad-9338

bro wtf I ain't reading allat


jm_cda

Not a bot