34 ms·
Why Rust?
- WesolyKubeczek 4y agoTL;DR — because the author loves it, followed by what can be described as multiple paragraphs of personal preferences.
- k__ 4y agoRetrospectively you might be right. The majority of software is slow and not safe to use and the majority of people do it anyway.
- WesolyKubeczek 4y agoThe majority of things in general is not safe to use, and yet somehow we do it anyway, and thrive.
- paulgb 4y agoThey seem pretty universal to me. For example, the tedious error handling in Go that is mentioned is a turn-off to a lot of developers. Safety and speed are both things most languages strive for, and if Rust is not THE fastest or THE safest language, it’s on the efficient frontier of the two.
- WesolyKubeczek 4y ago
- jakobnissen 4y agoIn which way is that incorrect? How can you, when reading Python code, know whether it may error? Or is your point that Rust code can panic too, without it being clear from reading the code?
- WesolyKubeczek 4y agoExcept for the maybe simplest variable initialization, I always assume that if it exists, it may error. “Won’t error ever” doesn’t exist in the real physical world. (See also: halting problem.) The “invisibility” of errors in languages that have first-class exceptions usually means that exceptions are being somehow swallowed without being handled properly. Shit happens, and the program happily chugs along regardless, sowing destruction. If you get down to reading the code, you can usually see if it is likely to error out or not. At the point where you get down to reading the code, it’s usually quite clear unless intentionally obfuscated. A better question is, can a machine show you if the code may error and how, given language X? In statically compiled languages, IDEs have been wickedly good at inferring the possible exception types on any line of code for the last decade, even if you don’t annotate them in the signature.
- marcosdumay 4y ago> See also: halting problem. The one that can be solved for the overwhelming majority of code people write on real life?
- chrismorgan 4y agoEmil has been working in Rust for eight years. Hardly a honeymoon phase. As for your accusation of lying: I cannot imagine where you’ve pulled that from. Emil’s description of unchecked exceptions as invisible errors insofar as you can’t see where errors might occur from the source code alone is objectively an accurate and reasonable description.
- hota_mazi 4y agoExcept Emil is talking about "Java exceptions", not "Java runtime exceptions". Because Java's checked exceptions have the exact same good qualities that Rust's question mark operator offers.
- jrpelkonen 4y agoAgreed, checked exceptions surface potential errors to the caller. In that regard Java fares better. However, handling exceptions still require a separate catch clause rather than being part of the normal flow. Furthermore, it is nigh impossible to rely on checked exceptions alone, most Java code may throw RuntimeExceptions such as NullPointerException or ArrayIndexOutOfBoundsException and there is no way to know it by just looking at the calling code.
- hota_mazi 4y ago> However, handling exceptions still require a separate catch clause rather than being part of the normal flow Only if you want to catch (handle) it. If you don't want to do that, just declare it in your "throws" clause and enjoy writing your code with the (guaranteed) assumption that you are using a valid value. > Furthermore, it is nigh impossible to rely on checked exceptions alone, most Java code may throw RuntimeExceptions such as NullPointerException or ArrayIndexOutOfBoundsException and there is no way to know it by just looking at the calling code. That's a bug, not a feature. These errors are often unrecoverable, hence why they are runtime and not checked.
- nicoburns 4y agoExceptions are invisible though? (unless you're using checked exception in Java, which nobody does and neither python nor C++ offer). I've personally found unexpected exceptions being thrown to be one of the main causes of unreliability in production applications I've worked on. Of course you can have a blanket catch statement so it doesn't entirely crash your app, but that doesn't compare to the Rust experience where those errors almost never happen.
- marcosdumay 4y ago> I've personally found unexpected exceptions being thrown to be one of the main causes of unreliability in production applications I've worked on. Python has a serious problems with this. Not only are exceptions not documented, they are also thrown by normal execution, so you can't just say "something serious happened here, go to the recovery".
- fellerts 4y agoThis is personal preference of course, but exceptions are essentially "on error GOTO foo". They never resonated well with me either, since the control flow is muddled once you introduce exceptions. > "invisible errors" If you read further on you get the author's justification for this claim: auto result = foo().bar(); > As a reader, I can't see where potential errors can occur. Even if I look at the function declaration for foo and bar I won't know whether or not they can throw exceptions [...] Do you disagree with the reasoning reasoning this?
- hsn915 4y ago> Safety and speed One thing I can't seem to find a quick answer to from the Rust crowed is how does Rust handle dynamic lifetimes? It seems like it does not; it simply prevents you from referring to objects that have a dynamic lifetime not known at compile time. You either have to use 'unsafe' or use the 'handles' pattern where you have what amounts to a custom allocator but the compiler does not know that it's an allocator so it can't prevent 'use after free' bugs. I suppose you can also use Rc, but isn't that essentially a garbage collection scheme, with similar performance characteristics? (AFAICT a reference counting scheme must be able to nullify all references to an object when it's deallocated, so deallocations can become arbitrarily expensive). Am I missing something?
- Fiahil 4y ago> dynamic lifetimes What do you mean ? If you refer to heap allocations, then you can use Box, Arc, Rc. They are not a "garbage collector" nor do they incur performance hits other than a regular heap allocation.
- eptcyka 4y agoAtomic reference counting does incur a slowdown.
- Fiahil 4y agoyes, but that's not a JVM-like slowdown. It's fairly well amortised and _clearly_ not a matter of consideration when writing an app or a library. If your issue is "atomics are slowing down my app", then I assume you already milked the code to the latest micro second of performances everywhere else. This is likely not the case here and not a general advice I would give to anyone. Remember, some dev in python where concurrency is inexistent, start-up time is horrendous and performances are abysmal compared to rust. (this is exaggerated: of course you can run stuff in parallel in python)
- selfmodruntime 4y agoWhich should be incredibly negligible unless you're counting literal millions of objects. Even then, I'm suspecting that refcounting will never be in the top spots of things that slow you down.
- amelius 4y agoThis must be how people felt about C++ in the beginning ...
- Keyframe 4y agoI actually remember that time! C++ rode on a wave of OOP hype. It was all about that, packaged into something people were kind of familiar with. OOP WAS THE FUTURE, MAN!
- marcosdumay 4y agoC++ was C with a better interface for GUI widgets and generic templates. There was a lot of hype about OOP too, but I am not sure it was ever adopted because of it.
- Keyframe 4y agoC++ was C with a better interface for GUI widgets and generic templates. That came a lot later in its life, like mid to late 90's.
- marcosdumay 4y agoGood point. I am not aware of how software was developed at the late 80s and early 90s... But was C++ widely adopted at that time? I remember C++ compilers being a huge pain by the middle 90s. I can't imagine everybody using them earlier. (But then, it wouldn't be the first time everybody just decides to do something I can't imagine.)
- nosequel 4y agoNo one thought C++ was safe in the beginning. It was very clear with all of the undefined behavior that we were not getting any safety.
- deathanatos 4y agoYeah? I was excited about C++, when I learned it. Basically all the performance of C, and the standard library included a vector class? And linked lists? And trees? And strings? I don't have to manually manipulate char pointers anymore, and can just say foo + bar to concat strings? Sign me up. (Does C++ have its warts? Absolutely. But it's a huge productivity boost over C.)
- losvedir 4y ago> Rust's enums and exhaustive match statement are just amazing, and now that I'm using them daily I can barely imagine how I could live without them for so long. I feel this! I absolutely love rust's fancy enums - i.e. not just a set of constants, but where each variant can be a full fledged type of its own, and how you have to handle every case whenever you're matching on it. It dovetails absolutely wonderfully with non-nullability and errors as values. This is probably the main nice-to-have in a language for me. Unfortunately, I don't really work in a low-level domain so I'm not sure the extra complexity of manually managing memory is worth it to me. Do any other higher-level languages have rust-style enums with exhaustiveness checking? I only know of Haskell and Ocaml. Actually, I suppose TypeScript has something kind of similar.
- mamp 4y agoF#, Swift
- pdpi 4y agoScala, Kotlin, Haxe, Swift, and several others. The search term you want is "Algebraic Data Types" Erlang has the superpowered version of this - binary pattern matching, that lets you pattern match on a bitstream directly.
- rad_gruchalski 4y agoErlang also has exhaustive pattern matching. To the extent of having to declare catch all arity for functions.
- masklinn 4y ago> Erlang has the superpowered version of this - binary pattern matching, that lets you pattern match on a bitstream directly. Erlang has a super-powered version of the pattern matching bit, but not of what GP actually likes about it: > you have to handle every case whenever you're matching on it because Erlang is dynamically typed. So partial patterns are acceptable, and not entirely uncommon.
- 4y ago
- pdpi 4y ago> Rust's enums and exhaustive match statement are just amazing ADTs + pattern matching are the killer feature set that makes the more popular functional languages so damn pleasant to use, and they're starting to spread to more and more languages. I suspect that, 50 years from now, we'll look back and see them as the key paradigm shift of this era.
- jmfldn 4y agoAs a Scala dev I agree.
- qaq 4y agoADTs is last missing piece that would make me fully content with Go :)
- kajaktum 4y agoI agree, I love that Go is simple but it is simply too...simple. It makes it hard to represent a much harder state transformations.
- deleted 4y ago[deleted]
- achenet 4y agoaren't interfaces technically an abstract data type? EDIT: ah, it's algebraic data types, my bad, apologies.
- xigoi 4y agoInterfaces are not closed, which is considered a big advantage of sum types (though it can also be a disadvantage).
- pjmlp 4y agoPity that it took people 50 years to discover them.
- pooya72 4y ago
- erk__ 4y ago> Floating point behavior Since 1.62 there have been a native way of doing it with the `total_cmp` method [0] on floating points which can be used to at least sort it quite easily, but cannot really use it in collections like BTreeMap. [0]: https://doc.rust-lang.org/std/primitive.f64.html#method.total_cmp https://doc.rust-lang.org/std/primitive.f64.html#method.tota...
- spoiler 4y ago> but cannot really use it in collections like BTreeMap Given the nature of floats, is this really a problem? Worst case scenario the floats can be represented differently, if one really needs to use them as keys.
- erk__ 4y agoYeah it was mostly to give a example of where a wrapped type would be better than `total_cmp`. E.g. something that needs the value to implement Ord.
- cageface 4y agoI've started working in Rust too and I too find it a tremendous breath of fresh air. It's the first time I've been excited about a new programming language in many years. C++ promised to be a language that was both high performance and very expressive but I always found it very difficult to work at a high level of abstraction in C++. The sharp details always stab through. Rust code, on the other hand, often doesn't look much more elaborate than code I write in much higher level languages but it's far, far faster and I feel more confident in its correctness. Too bad most of the Rust jobs right now seem to be in crypto.
- rvz 4y ago> Too bad most of the Rust jobs right now seem to be in crypto. What is the problem with that?
- rwaksmunski 4y agoPotential criminal liability and resume stench. Would you hire ex scammer/ponzi to maintain your backend? I wouldn't.
- rvz 4y agoYeah, I wouldn't hire someone from a company who caused mass genocide and ran a fake news propaganda machine and then and profited billions from it [0] and is also using Rust as well then. /s [0] https://www.globalwitness.org/en/campaigns/digital-threats/rohingya-facebook-hate-speech/ https://www.globalwitness.org/en/campaigns/digital-threats/r...
- black_puppydog 4y agoHaving FB on your resume can leave a stench indeed. Depends a bit on context though, it's a big place. Going into crypto today, that's a pretty clear lack of judgement.
- RestlessMind 4y ago> resume stench This is such a bogus argument. I am working in Crypto and have no trouble getting offers from non crypto companies. My resume also carries other evils such as the surveillance overlord and the evil empire, among others. I always found it easy to waltz into a new job with those names. I have also hired dozens of people coming from companies which were pinatas of du jour. Neither I nor any of the other people involved (sourcers, recruiters, execs, HR) gave even a minimal amount of shit regarding "resume stench". If a candidate passed our hiring bar, we hired them. So stop spreading this FUD.
- listenlight 4y agoDoes Rust have a webapp framework like Rails?
- rwaksmunski 4y agohttps://www.arewewebyet.org/ https://www.arewewebyet.org/
- foobarfoox4 4y agoThis is cool. Are there similar websites for other languages?
- bobajeff 4y agoAs someone who's not the biggest fan of Rust because of its complexity. There is a big reason to use it today. If you need to use something that has safety guarantees where it's possible to achieve acceptable performance in certain classes of programs where languages like golang, nim or crystal have trouble achieving then I just don't see any other options out there certainly not one with as many libraries available as rust. Maybe I can use a combination like c and lua to get the right trade offs between safety and performance in the necessary parts of my program but I'm not that confident that I can reach either safety or acceptable performance doing that. Maybe, I could use C and some kind of static analyzer to find all of my memory bugs. Again, I'm not confident I would succeed there. I might also need a fuzzer to do it. At this point I'm trading a complicated language for a easy fast language with extra complicated operations that may or may not give me the outcome of memory safety.
- selfmodruntime 4y agoWhat are the major points concerning complexity you have encountered?
- bobajeff 4y agoLanguage features. There are many features and language patterns, paradigms which I need to get used to in order to use libraries and read others code. (Similar to C++) I can't even begin to understand macros. So far it doesn't seem to be insurmountable but it's definitely not what I'd call simple.
- Existenceblinks 4y agoYeah even if I'm a big fan of ML family lang, complexity to solve memory safety is too much to the point Zig is more appealing in way that helps you do it yourself more easily.
- bobajeff 4y agoOh, I forgot about Zig. I haven't had a chance to really check it out yet. As far as memory safety do you think it would be a good idea to write something like say a http server or client in Zig?
- bjarneh 4y ago> A lot of people who are new to Rust struggle with the borrow checker Guilty as charged
- throwway989 4y ago
- azangru 4y ago> By using Rust for both our frontend and backend, we have a unified stack of Rust everywhere, simplifying our hiring. > I can write web apps in another language than JavaScript > I can write web apps that are fast Yeah, this is what's worrying me. If you look at rerun.io website, you will notice that it's built with Next.js, i.e. is using a React framework to build pages that have no interactivity whatsoever. Next.js is used for the blog, despite it being just a collection of simple static html pages. Meanwhile, the user has to download around 200kB of javascript for no reason whatsoever; and the only reward that they get for their trouble is an avalanche of javascript errors in the browser console [0]. Is the Rust/wasm future going to look like that? [0] - https://i.imgur.com/TpYW0Rj.png https://i.imgur.com/TpYW0Rj.png
- Thaxll 4y agoRust will never make it to the frontend at scale. There is a reason why JS was invented. People doing frontend dev don't want to bother with slow compile time or 3 strings implementation. And the fast argument is missleading at best, every modern language are "fast" enough, if Amazon and Google runs Java that mean it's fast enough for 99% of workload.
- flohofwoe 4y agoTypescript and React project build times are easily in the same ballpark as Rust or C++ for similar code base sizes though, yet they are used in the frontend 'at scale' ;)
- hsn915 4y agoYes but you can use esbuild to make it fast. My projects take less than a second.
- ttfkam 4y agoObviously not fast enough for Google since they literally invented a new programming language (Go) to address the compile time and runtime limitations of Java.
- richdodd 4y ago> There is of course some legitimate worry that the Rust crate ecosystem could devolve into the crazy left-pad world of npm, and it is something to be wary about, but so far the Rust crates keep an overall high quality. Note that the particular case of left-pad cannot happen with crates.io/cargo, because once published, you cannot unpublish a crate. You can 'yank' it, in which case it will not be resolved by Cargo.toml, but if you put it in Cargo.lock directly (IIUC) it will still work. So we can't have someone pulling a crate and crashing half the ecosystem. We can however still have lots of other problems that plague all package management systems. Check out `cargo-crev`!!!! It's an awesome idea I'm always plugging to solve the lack of trust in an open library repository. It requires people to participate though.
- kajaktum 4y agoWhat is the alternative to not having a crate ecosystem? Everyone roll their own smallvec implementations? How is that any better?
- cillian64 4y agoFrom my experience in C there are two ways libraries deal with not being able to easily pull in their own dependencies. Some of them include their own reimplementations of lots of things (data structures, logging, error handling, date-times). Others decide to keep it simple and only implement a minimal set of functionality which limits their need for dependencies or reinventing the wheel. Cargo letting libraries easily have their own dependencies means that many Rust libraries are very rich and fully featured. This has plenty of advantages, but the big dependency tree can be a problem in some circumstances. Crate features can sometimes help but usually not much in my experience. I’ve seen libraries appearing in Rust which are specifically very simple and minimise dependencies (ureq is an example I like). This gives the developer the choice whether they want libraries which just do a small basic job or whether they are okay with including lots of dependencies in exchange for rich functionality. There’s a risk of segmenting the ecosystem (see also async/tokio) but it seems to be working pretty well to me.
- 4y ago
- jmull 4y agoHonestly, this kind of breathless adulation is off-putting to me. > If I'm honest, the main reason is because I love Rust. That's nice if it works for you, but I'm looking to build and maintain software well and efficiently. I don't want a programming language I can love I want a tool. (BTW, old and tired but true: don't love things that can't love you back.)
- stefanka 4y agoThanks for the article? You are not still hiring per chance..?
- djha-skin 4y ago> We've had fast languages like C and C++, and then we've had safe languages like Lisp, Java, and Python. The safe languages were all slower. Them's fightin' words. SBCL (Lisp) totally screams with speed as far as I've been able to tell.
- stonemetal12 4y agohttps://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/sbcl-gcc.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Its runtimes are all like 5X C's. Not sure I would say "screams", it looks like it keeps up with Java though.
- dgan 4y agoI don't understand why everyone seems to ignore Ada? Granted I am completely new to it, but from what I see it is years ahead of Rust in terms of safety (it can prove correctness!! Rust is only heading into that direction). Yes syntax is verbose, but I dare to believe there must be another blocker than just syntax?
- maeln 4y agoI did some ADA in the past and yes, it is a nice language, but it lacks the modernity and a dynamic community like Rust. ADA did received some nice update to its specification, but, just like C++, it struggle / cannot really fit the latest innovation in programming language that easily. And to be fair, it is fine. ADA is very much a "committee" language (its spec are ISO/IEC) instead of a "community" language (all the spec and rfc of Rust are on github and anyone can easily discuss them). This makes it so that ADA doesn't get the attention, and the rapidity of innovation, that a language like Rust does, but ADA is mostly made for program that will need to be maintained in critical operations for decades with the code being maintainable and compilable far into the future.
- 0rzech 4y ago> I did some ADA in the past and yes, it is a nice language, but it lacks the modernity and a dynamic community like Rust. ADA did received some nice update to its specification, but, just like C++, it struggle / cannot really fit the latest innovation in programming language that easily. I'm still learning both Ada and Rust, so please keep that in mind. Nevertheless, I humbly disagree. The more I learn Ada and other "old" languages the more it looks to me like "modern" ones rediscover things that have been present in other languages for years. The really significant difference I can see for now is that Ada is not focused so strongly on functional programming paradigm and it has no async/await sugar. Rust borrow checker is a strong success of course and was another significant difference, but latest SPARK got borrow checking capabilities too, AFAIK. While Ada's open-source community is smaller, I find it as energetic and devoted to improving the ecosystem as Rust's. I have no idea about closed-source community, but in the past 4 years ArianeGroup [1], Airbus [2] and Nvidia [3] talked about choosing Ada for their high-integrity applications. > And to be fair, it is fine. ADA is very much a "committee" language (its spec are ISO/IEC) instead of a "community" language (all the spec and rfc of Rust are on github and anyone can easily discuss them). You can discuss Ada/SPARK RFCs on Github too. [4] I think I once saw on Ada forum or chat that someone proposing changes to the language was simply invited to talk to people working on the standard, so it doesn't look like the language is developed in isolation or something. > This makes it so that ADA doesn't get the attention, and the rapidity of innovation, that a language like Rust does, but ADA is mostly made for program that will need to be maintained in critical operations for decades with the code being maintainable and compilable far into the future. I think that Ada adopted quiet quickly to changing world with Rust as its inspiration: lower entry barrier toolchain, compelling licensing, library distribution, RFCs, etc. And in terms of language features, in many areas it's not only on par, but ahead of competition. So you're less likely to see lots of changes, but they do happen nevertheless. I'm not saying Ada is perfect, of course. There are parts of it that other languages do better. No shame in that. IMHO, the reason Ada is unknown to many people is a combination of its past, myths surrounding it, and general trend of people to follow trends. ;) But currently I find Ada/SPARK even more compelling option than Rust, even though I like both. [1] https://www.facebook.com/ArianeGroup/posts/2872955946126067 https://www.facebook.com/ArianeGroup/posts/2872955946126067 [2] https://www.manufacturing.net/aerospace/news/21175187/airbus-chooses-gnat-pro-ada-for-development-of-unmanned-aerial-system https://www.manufacturing.net/aerospace/news/21175187/airbus... [3] https://blogs.nvidia.com/blog/2019/02/05/adacore-secure-autonomous-driving/ https://blogs.nvidia.com/blog/2019/02/05/adacore-secure-auto... [4] https://github.com/AdaCore/ada-spark-rfcs https://github.com/AdaCore/ada-spark-rfcs
- trinovantes 4y agoI wish C++ has a universal dependency manager like crates. It feels like every external library I want to use requires their own exotic setup.
- UltraViolence 4y agoYes, but C/C++ is straightforward also. You simply need the source and link it or get a library object file (.lib or .so) and the header files. IDE's like Visual Studio hide this behind tons of settings and dialogs but in the end it's simple if you know the above.
- dureuill 4y agoThis simplicity translates to afternoons of work lost to CMake. cargo just works, and isn't really complex in design. just less anticated.
- commitpizza 4y agoAs a developer who mainly writes front end apps with Javascript (but with experience in a lot of other languages), I started to learn Rust for an app I want to build. The issue is that the app itself will not really be needing maximum performance and I much more concerned about the safety aspects Rust brings. But I guess the safety aspects would be the same with me using Python for example. Why I want to learn Rust is because it could help me in the front end aspect and I think it's a language that has a bright future. Am I crazy to spend the time to get effecient in Rust and write my app I want to write in Rust instead of Python? Is there any other benefits of using Rust that I don't see as a beginner? I am afraid that I'll just waste a bunch of time just because I want to learn Rust and think it's cool but ultimately it will slow me down to such an extent that my app never sees the light of day or that it increases general development time. Thanks in advance for all potential responses
- jmartrican 4y agoI saw a YT video about how safe Rust is. I want to give it a try but I do mainly web applications, where I use Spring Boot and front-end frameworks. From what I have read Rust is better for system level or regular applications (not web apps). Can modern web applications be built efficiently with Rust? And by efficiently I mean, is the ecosystem there (libraries and tools). I imagine the following would be needed.. 1) Spring MVC like library for interfacing with HTTP requests. 2) DB ORM or ORM like. DB libraries for any possible DB. 3) centralized logging. e,g, Logback that forwards all logs to ELK. 4) Dependency injection. 5) Versatile configuration system. Similar to Spring configurations. 6) AWS SDK. 7) Commons like libs like Guice or Apache Commons. stuff like that.
- insanitybit 4y agoWe use Actix for HTTP. Works fine. I don't use ORMs, I prefer sqlx, which gives me compile time checking of queries while still just writing plain old sql. I log via the tracing library to stdout, I let other services handle what's done at that point. I don't use DI frameworks, nor do I believe that they are good, I use dependency injection via construction, which works great. I don't do any fancy configuration. I use `clap` to take in values and ideally I'll never do any config anywhere else in my program. The AWS SDK from rusoto works well enough. AWS has a beta SDK out for Rust as well, seems good. I haven't found any need for libraries like Guice, there's metrics, collections, and everything else I've needed in crates.io.
- jmartrican 4y agoThanks for your reply. Can you disclose what web application this is you work on?
- insanitybit 4y agohttps://graplsecurity.com/ https://graplsecurity.com/ That's my company. The blog is hosted elsewhere. Our frontend is hosted via a rust service, which talks to other rust services via grpc.
- 4y ago
- cageface 4y agoFor someone like me that's an experienced programmer but relatively new to Rust, what are some open source Rust projects that could benefit from some help?
- artogahr 4y agoAlso me. Albeit probably not as experienced as OP, I still would like to help.
- insanitybit 4y agoCheck out 'This Week In Rust', which has some calls to action from various projects.
- bovermyer 4y agoHow does Rust do at random number generation? Is there (for example) a crate for seeding random number generators?
- mynameisash 4y agoI'm not sure if I understand your wording: "a crate for seeding random number generators"? Do you mean, "is there a RNG that you can seed in Rust"? There's a `rand` crate[0] which I believe was written by folks in the Rust project, though it's not part of std. You can seed the RNG[1]. [0] https://crates.io/crates/rand https://crates.io/crates/rand, https://github.com/rust-random/rand https://github.com/rust-random/rand [1] https://docs.rs/rand/latest/rand/rngs/struct.StdRng.html#method.from_seed https://docs.rs/rand/latest/rand/rngs/struct.StdRng.html#met...
- bovermyer 4y agoSorry, yes, that's kind of what I meant. Ultimately, I want to be able to seed an RNG with an alphanumeric string, and in other languages that means using a third-party library or writing one myself.
- oconnor663 4y agoThe `rand` crate in Rust is a de facto standard, but it's not an official standard, so that does technically mean trusting a third-party library. A lot of the Rust ecosystem is structured this way, in part because package management with Cargo is convenient.
- labrador 4y agoIn "Oral History of Bjarne Stroustrup" Bjarne describes his goal for C++, which was abstractions with zero runtime cost : https://www.youtube.com/watch?v=ZO0PXYMVGSU https://www.youtube.com/watch?v=ZO0PXYMVGSU I understand Rust is fast, but how does it do with complex abstractions?
- clemens3 4y agoI just bootstrapped Rustc 1.58 using only GCC and mrustc sources on an 8 core 16 thread machine with 32 GB memory and lot's of disk space. It took 20 hours. If you think Rust is bloated, I agree.
- insanitybit 4y agoIt's hard to even respond to this lol 1. You used an in-progress compiler to build a project and you're drawing conclusions about the language it compiles? 2. The compiler is huge, why does that imply any "bloat" of the language? Compilers do lots of things that aren't "visible" at the language level - optimizations, producing helpful errors, providing code completion/analysis assistance, etc. 3. What does "bloated" even mean? 4. What makes you think that 20 hours is very slow? Have you tried building Clang and llvm together from source? It can take quite a while, but it also depends heavily on how you build it (which build system, flags, etc), which you've not given any information on.
- cyber1 4y agoMost benefits of Rust are true, except in some cases it does not allow you to compile an absolutely valid and safe program like here https://github.com/rust-lang/rust/issues/47680 https://github.com/rust-lang/rust/issues/47680 - unfortunately you don't have freedom of code design decisions! I see some possible problems with refactoring, extending logic and functionality, and lots of issues with async code design and readability. For me, Rust looks like a temporary step before the next language.
- pie_flavor 4y agoYou have successfully linked to the only meaningfully loud bug in the borrow checker; declaring that as proof that Rust is a temporary step does not seem like the most cool-headed of evaluations, especially as it will be fixed by a new borrow checker in active development. These assertions are always made, and always alongside information suggesting the speaker has not actually spent very much time using Rust.
- 3836293648 4y agoEh, it might be the only meaningful issue with the borrow checker, but the language itself has more issues than just that. I adore rust and have done for years, but I also see it as a stepping stone language and worry about it gaining too much adoption
- pie_flavor 4y agoIt is a stepping stone language in the sense that nobody has ever done anything like it before but you could adapt some of its principles to a language where you don't have to care quite so much about the stack. (Things you could not jettison along the way include ownership and explicit lifetime annotations.) But the language has absolutely nothing I'd call an issue. Only things that could be made even better, and coincidentally always are.
- UltraViolence 4y ago
- quuuu 4y agoOne issue with egui and shoving the whole page into a canvas element is accessibility -- having just a canvas element is a screen reader's worst nightmare
- Gigachad 4y agoI don't imagine its that much worse than a regular GUI program outside of a browser. I assume text can still be selected/copied so screen readers should still be able to access something.
- auraham 4y agoI've heard about Web Assembly/Wasm many times. I thought it was a new kind of JS framework, so I did not pay attention since I am not a JS developer. However, after seeing the egui.rs demo [1], I was impressed! Now, I am interested in knowing more about programming languages that compiles to Wasm. Is it possible to create that sort of UI using other programming languages? [1] https://www.egui.rs/ https://www.egui.rs/