43 ms·
Rust After the Honeymoon
- qaq 6y agoGuys please make a pizza box Oxide.Computer workstation :)
- fluffy87 6y agoWhat is Oxide computer? I saw the talks, but I still have zero idea of what it is they want to sell.
- steveklabnik 6y agoWe will be selling servers. Here's a thread from last time this came up: https://news.ycombinator.com/item?id=23979042 https://news.ycombinator.com/item?id=23979042
- mwcampbell 6y ago> We will be selling servers. Like you, I'm from the generation that grew up treating "computer" as synonymous with "personal computer", i.e. something on a desk or in one's lap. For some reason I can't quite articulate, it saddens me that a new company with "computer" in the name is focusing on those other things called computers in far-away buildings that we can't access. I hope that once Oxide starts making money from servers, it can branch out into workstations. Then, to me at least, it will more fully live up to the name "Oxide Computer". Yes, I know this association is more emotional than logical, but there it is.
- mlindner 6y agoOne of the things driving things into "the cloud" is because the hardware companies can buy can't compete on performance with the hardware that Google/Amazon/Microsoft/Facebook can make. That drives businesses to move things to the cloud. However some things _can't_ go to the cloud (legal reasons of all sorts for one) and so are stuck with an inferior situation. Assuming you had the money, there's nothing stopping you from putting a server rack in your house. If there was a company selling such hardware, maybe the trend to putting everything on the cloud would change.
- nix23 6y agoI just like Cantrill, he kicks butts and dtrace them afterwards. Great Speaker!
- deleted 6y ago[deleted]
- theshrike79 6y agoDo you mean great shouter? I enjoy the content of his talks very much, but the constant shouting is very tiring.
- ohazi 6y ago{:#x?} omg!
- deleted 6y ago[deleted]
- kibwen 6y agoIt's a formatting sublanguage based on the one from C#. In the formatting sublanguage, braces denote a value to be formatted: `format!("{foo}", foo=42)` Instead of a name you can identify values positionally, counting from zero: `format!("{0}", 42)` You can omit the identifier entirely and the arguments will likewise be interpreted as positional: `format!("{}", 42)` To tell the formatter the manner in which you would like to format the value, you can give format specifiers. These are separated from the value's identifier by a colon. An example of a format specifier is `b`, which prints the value in binary: `format!("{foo:b}", foo=42)` As before, you can leave out the name to refer to the value positionally: `format!("{:b}", 42)` Other format specifiers are `?`, which tells the formatter to print the "debug" output (i.e. autogenerated output useful for debugging by programmers), `#` which tells the formatter to insert line breaks and indentation for easier reading, and `x` which tells the formatter to print numbers as hex.
- masklinn 6y ago> autogenerated output useful for debugging by programmers Nit: not necessarily autogenerated, we can implement Debug by hand. It's just that, as the name indicates, this is aimed at debugging output rather than the possibly-user-facing output of Display.
- kibwen 6y agoIndeed, though it's worth driving home that the salient difference between Debug and Display is that the former, unlike the latter, can be autogenerated via derive (well, okay, I've seen crates that add the ability to derive Display based on doc comments, which is pretty cool: https://github.com/yaahc/displaydoc https://github.com/yaahc/displaydoc ).
- 6y ago
- furyofantares 6y agoThis is the kind of review I love to see. Not just for languages, everything. In my experience, reviews almost exclusively come while something is still novel to the reviewer, not battle tested, and worse, conflated with whatever situations the reviewer just happens to find themselves in at that period of time. What a wonderful post to be able to read and not have to wonder how much of it will hold up given a little time.
- saagarjha 6y agoOf course, since these often take months of up-front effort it’s obvious why they’re not as common :(
- bananaface 6y agoIt's a shame, though. Content aggregators at least should allow the ones that exist to bubble up.
- cxr 6y agoOn the other hand, if you wait too long, you run the risk of being afflicted with the kind of Stockholm syndrome/curse of expertise that explains how bad so much of everything is. When I start playing with something, once the number of papercuts I'm tracking in my head gets above 2–3, then I crack open a fresh notes.markdown file adjacent to the source repo (if there is one) and start recording all my thoughts in the vein of[1], including everything from outright bugs to opportunities for UI improvement. If the project has reasonable bugtracking infrastructure, I'll file them—or for small projects, I'll email the author along with any patches—but since most projects don't, I mostly don't end up doing anything with them. I've often thought that it would be nice if this exercise of "Let's Critique" became a thing, though. If nothing else, it could provide fuel for folks' blogs that have been lying dormant since that one post from 2017. 1. https://pointersgonewild.com/2019/11/02/they-might-never-tell-you-its-broken/ https://pointersgonewild.com/2019/11/02/they-might-never-tel...
- Waterluvian 6y agoYes!!! I was looking at exercise equipment this week and badly wanted to find reviews for when people had been using it for years. That’s where 98% of the useful info is. Otherwise reviews are pointless things like the packaging quality and shipment speed.
- Upvoter33 6y agogood article, one of the better ones I've seen around Rust and what is cool about it. I'd like to know what Oxide is up to...
- dochtman 6y agoTheir site is somewhat explicit about it? https://oxide.computer/ https://oxide.computer/ Also I can highly recommend their podcast, I can't wait for the next season. https://oxide.computer/podcast/ https://oxide.computer/podcast/
- yjftsjthsd-h 6y agoTheir website says what they intend to do, but not what they're up to lately; the last blog post is from July and is fairly meta (process for discussion, not ex. "we're working on firmware this week"). Similarly, podcast last posted in February.
- bcantrill 6y agoSorry if that's a bit thin; more detail on what we're doing and why can be found in a (pre-COVID) talk I gave at Stanford[1]. We're definitely not a Deep Stealth company, but we've also been very busy building; expect many more details over the coming year! [1] https://www.youtube.com/watch?v=vvZA9n3e5pc https://www.youtube.com/watch?v=vvZA9n3e5pc
- galonk 6y agoThat video is great, it was linked on HN a while ago and I watched the whole thing even though it's not my area at all. Really interesting :)
- deleted 6y ago[deleted]
- neolog 6y agoLooks like the honeymoon is still ongoing.
- saagarjha 6y agoA sign of a good marriage is that you never feel like you’ve come out of honeymoon, so I think they have likely made the right choice :)
- neolog 6y ago> A sign of a good marriage is that you never feel like you’ve come out of honeymoon Does that happen for some couples?
- rabidrat 6y agoApparently some small percentage of couples do experience this. I don't think it's some magical "marriage made in heaven"; my theory is that some small number of people have a superhealthy relationship with their ego, and so don't need to differentiate (which is what causes the honeymoon-leaving), and if you get two of them together, they can stay in the honeymoon state indefinitely.
- Drdrdrq 6y agoYes. Some fight on the honeymoon already.
- saagarjha 6y agoBetter early than late?
- blub 6y agoHoneymoon meets guerilla marketing. After a point the lines between a technical blog post, personal brand building and advertising for one's startup/new project become too blurry... Makes one long for the days when ads were shown in pop-ups and you could at least close them. And the ad people did warn us this would happen :-)
- mrits 6y agoI've jumped on plenty of hype trains of new languages over the last 20 years. Rust is the first one that made we actually worry that I might have to eventually switch back to different language in the future. In addition, it's the first language that doesn't have me use Python for quick shell scripting or small prototypes. It's a pleasure to code in.
- papaf 6y agoit's the first language that doesn't have me use Python for quick shell scripting or small prototypes How do you define quick? Python has a large standard library and so you don't have to hunt for functionality on crates.io and then download/compile -- I have written scripts faster than that.
- nicoburns 6y agoIf you know that a crate exists then you can simply `cargo add foo` and have it download in the background while you get on with writing your script. If you don't know that it exists then you'll have to find it the first time, but you have that problem with python standard library modules too. Writing scripts with Rust likely will be slower than Python, but I don't really buy that having functionality in crates is part of that.
- papaf 6y agoIf you don't know that it exists then you'll have to find it the first time, but you have that problem with python standard library modules too. Except that, if its in the standard library, you don't have to choose between multiple implementations. I have written scripts faster than I have chosen dependencies.
- deleted 6y ago[deleted]
- nicoburns 6y agoIf I want to make an HTTP request in Python, which module should I use? There is a built in one (more than one I believe), but the official docs link out to a 3rd party module https://docs.python.org/3/library/http.client.html https://docs.python.org/3/library/http.client.html
- kettro 6y agoGreat post, especially for the embedded crowd. I'm looking to start using Rust in FW development but hit a couple pain points. * First, bit field descriptors is a huge pain - where, in C, you would define an enum for the task, there isn't a real equal in vanilla Rust, other than a litany of constant variables. * Second, the over-reliance on nightly is a tough sell for - having inline asm gated makes it very hard. * Third, while format is great, it's also very heavyweight. Not having (AFAIK) variadic arguments is hard, and there isn't really an equal to printf. I would love to be proven wrong, because I have an OS to write, and would love to use Rust.
- masklinn 6y ago> First, bit field descriptors is a huge pain - where, in C, you would define an enum for the task, there isn't a real equal in vanilla Rust “A litany of constants” is exactly what your c enum is though. And you can define a "degenerate" Rust enum with explicit discriminant values: enum Foo { A = 1, B = 2, C = 4 } They are cast-able to integrals too: println!("{}", Foo::C as usize); // prints "4" Doesn’t work so well for flags however. > Second, the over-reliance on nightly is a tough sell for - having inline asm gated makes it very hard. The alternative would be to simply not make the feature available at all until it is done and ready, with even higher risk (as it would have been exercised even less). As is, if the feature is fine for you as-is you can use it, and if you can't or don't want to use nightly you can go and assist its shepherding to stable (https://github.com/rust-lang/rust/issues/72016 https://github.com/rust-lang/rust/issues/72016) > while format is great, it's also very heavyweight. Not having (AFAIK) variadic arguments is hard, and there isn't really an equal to printf. There are no safe Rust-level variadics, but Rust can call C variadic functions, and under RFC 2137 (not stable yet I think) define them as well.
- nicoburns 6y agoYou can assign numeric values to enum variants in Rust too like so: enum Field { Foo = 0b11111111, Bar = 0b10101010, } fn main() { println!("{}", Field::Foo as u8); println!("{}", Field::Bar as u8); } There is also the bitflags crate: https://docs.rs/bitflags/1.2.1/bitflags/ https://docs.rs/bitflags/1.2.1/bitflags/ For lighter weight formatting there is https://github.com/japaric/ufmt https://github.com/japaric/ufmt
- fizixer 6y agoRust, and Go, and Julia, and D, and Swift, and what not, should have a shouting and fighting match with one another. When they are done, they can let me know who won and then I'll take that language a bit more seriously. In the meantime I'm a humble coder sitting in the corner with Python + C + CUDA (plus some scheme and assembly), doing useless things like AI, robotics, IoT, etc.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- saagarjha 6y agoNone of them have to "win" for you to be able to use them. In fact, each excels in its own niche.
- fizixer 6y agoWow, thanks for opening my eyes. Time to clear out the next two years so I can learn half a dozen special snowflake randos that contribue ZERO to the problems and projects I'm working on.
- saagarjha 6y agoCondensed matter physics is unlikely to contribute anything to the problems and projects you're working on as well, but that doesn't mean it isn't useful or that we shouldn't be studying it. Whether it's something that you're interested in is an entirely separate question. Regardless, shallow dismissals are against the guidelines here, so we don't want to hear about it if you're not interested.
- strangeattractr 6y agoNobody cares about your problems, nobody cares if you learn a new language or not. The thread is about reflections on using rust - if you don't want to learn/use it fine, but being irritated that others are is just strange.
- Animats 6y agoNice. This is Rust for people programming machines of Arduino size.
- pjmlp 6y agoI disagree with the pleasure of asm macro. Nothing beats PC / Amiga inline Assembly code blocks / compiler intrisics.
- yjftsjthsd-h 6y agoCould you point to an example, or give a more precise thing for me to search for?
- pjmlp 6y agoThe PC / Amiga compilers used to allow for explicit inline syntax as part of the language. The frontend compiler is intelligent enough to understand Assembly, instead of blindly giving it to the backend, like it always happened on UNIX compilers with their separate phases as processes connected via pipes. Nowadays they have intrisics which are a mix of specific CPU ones, and others that are general purpose ones. Then the macro Assemblers that come with them are powerful enough to program almost C like code in Assembly. Check VC++ inline Assembly, intrisics and MASM. Borland had similar offerings with Pascal, C, C++ and TASM. Other PC and also on Amiga, had similar offerings.
- kibwen 6y agoDo you have a source for comparison?
- pjmlp 6y agoThese ones for example. Delphi/Free Pascal, VC++ inline Assembly and intrisics. https://www.freepascal.org/docs-html/prog/progch3.html https://www.freepascal.org/docs-html/prog/progch3.html https://docs.microsoft.com/en-us/cpp/assembler/inline/asm?view=vs-2019 https://docs.microsoft.com/en-us/cpp/assembler/inline/asm?vi... https://docs.microsoft.com/en-us/cpp/intrinsics/intrinsics-available-on-all-architectures?view=vs-2019 https://docs.microsoft.com/en-us/cpp/intrinsics/intrinsics-a...
- pitaj 6y agoThat's a huge tradeoff with compiler complexity. Not only can you have issues of syntax incompatibility, but you also have to implement the syntax for every assembly variant for every architecture you support.
- vaylian 6y ago> Steve is using Windows as his daily driver, in part because of his own personal dedication to keeping Rust multi-platform. Thanks Steve!
- steveklabnik 6y agoYou're welcome! We have a Windows working group that does far more work than I do; honestly, I mostly am just a visible person who uses Windows, more than an expert or someone who fixes a lot of big problems. I do file bugs and patch things where I can.
- brundolf 6y agoPersonally I used to think I couldn't develop comfortably on Windows, but Rust's tooling is so integrated under the Cargo umbrella that I've never run into a real issue getting it working there, and I rarely even find myself needing to do "real command-line" stuff while working with Rust. A single tool has it all covered, so I don't really have to write scripts or anything. I'm sure the story is less simple for embedded, but I'm not surprised it's totally doable.
- steveklabnik 6y agoIt's not that far off for embedded; Cargo's weaknesses here affect all platforms equally :)
- boulos 6y agoThis is a good list of positives. I'm surprised there's no mention of bitfields though. I like the u32::from_le_bytes and into() and so on, but I feel like Rust would be a perfect match for explicit "u3" types when dealing with low-level protocols. https://immunant.com/blog/2020/01/bitfields/ https://immunant.com/blog/2020/01/bitfields/ and similar articles show some options, but none of them feel as natural (ergonomics wise) or even as "safe" as a C bitfield checked by clang. bcantrill (or others): am I just missing something here?
- bcantrill 6y agoNo, you're not missing something -- this is an area that I would say is (to use a winter weather term) "unsettled." The Immunant blog entry you pointed to is quite good, and lays out all of the existing solutions and the issues with them. Better solutions are definitely possible here, and I'm confident that we'll see them over time. Especially given the incredible obstacles that Rust has overcome with respect to low-level software (e.g., no_std, asm!), making bitfields more ergonomic seems like a very reasonable aspiration, especially considering how many others see the same problem!
- boulos 6y agoRe-reading the end of that post, I’m reminded that Josh had a talk about potential improvements. I only return to Rust about once or twice a year (currently) and keep cutting myself on an ergonomics thing like this. But I’ve also seen it improve year over year at a remarkable pace. So I’m hopeful, but also always wondering “huh, am I holding the phone wrong?”.
- steveklabnik 6y ago(I work with bcantrill) We use https://crates.io/crates/bitfield https://crates.io/crates/bitfield, and some of our dependencies use https://crates.io/crates/bitflags https://crates.io/crates/bitflags. They're not perfect, but they get the job done.
- boulos 6y ago
- djmips 6y agoDoes Rust have first class support for fixed point number formats? If not, is there a proposal for that?
- deleted 6y ago[deleted]
- JoshTriplett 6y agoDo you mean something like decimal floating-point? No. There are several crates that provide such types, though: https://crates.io/search?q=decimal https://crates.io/search?q=decimal We've talked about having support for user-defined literals, so that you could have decimal literals; in the meantime, a macro works for that.
- tbirdz 6y agoI don't want to speak for djmips, but I believe he was referring to something more like https://en.wikipedia.org/wiki/Q_(number_format) https://en.wikipedia.org/wiki/Q_(number_format)
- djmips 6y agoThat's pretty cool. I hadn't seen that before. I knew DSPs have used fixed point for decades but not aware of this format.
- djmips 6y agoThanks for the crates search link! It looks like decimal floating point is something used for financial calculations. Fixed point is where say in a 32 bit word, 16 bits is used for the integer part and 16 bits for the fraction or any combination that you can declare. Usually notated like 16.16 or 16:16. Another format example in 32 bits could be 8.24 and also formats in other word sizes. I found some crates using 'fixed' as the search term. https://crates.io/search?page=1&per_page=10&q=fixed%20point https://crates.io/search?page=1&per_page=10&q=fixed%20point It's been my desire to have a language for embedded to have first class support for fixed point just from the ability to work with them like you would a floating point number and not have to worry about macros.
- Const-me 6y ago> Rust addresses this gap with the same “0b” prefix as found in some non-standard C compiler extensions. In C++ that’s part of C++/14 standard, well-specified. > we have u8, u16, u32, u64, etc It’s indeed nice to have fundamental types like that, but <stdint.h> header is required by the standard since C99, in C++ since C++/11. It provides typedefs like uint32_t and the rest of them, thus the same UX. > DWARF support Yeah, but no PDB. Ship a Windows program written in Rust, and when it crashes or hangs on end-user’s PC you’re pretty much screwed. You need WinDBG to analyze these memory dumps written by the OS, and for that you need pdb symbols as opposed to dwarf.
- Diggsey 6y agoRust generates PDB files by default when using the MSVC toolchain...
- shepmaster 6y ago> Yeah, but no PDB Can you expand on this? C:\rust>cargo new demo Created binary (application) `demo` package C:\rust>cd demo C:\rust\demo>cargo build Compiling demo v0.1.0 (C:\rust\demo) Finished dev [unoptimized + debuginfo] target(s) in 2.28s C:\rust\demo>dir target\debug Volume in drive C is Windows 10 Volume Serial Number is B4A6-FEC6 Directory of C:\rust\demo\target\debug 10/11/2020 02:03 PM <DIR> . 10/11/2020 02:03 PM <DIR> .. 10/11/2020 02:03 PM 0 .cargo-lock 10/11/2020 02:03 PM <DIR> .fingerprint 10/11/2020 02:03 PM <DIR> build 10/11/2020 02:03 PM 61 demo.d 10/11/2020 02:03 PM 152,064 demo.exe 10/11/2020 02:03 PM 1,101,824 demo.pdb 10/11/2020 02:03 PM <DIR> deps 10/11/2020 02:03 PM <DIR> examples 10/11/2020 02:03 PM <DIR> incremental 4 File(s) 1,253,949 bytes 7 Dir(s) 15,995,387,904 bytes free `demo.pdb` is readily available.
- loeg 6y ago> It’s indeed nice to have fundamental types like that, but <stdint.h> header is required by the standard since C99. ... It provides typedefs like uint32_t and the rest of them, thus the same UX. C99 requires stdint.h, but does not require that fixed-width types exist; they're optional. In practice, every architecture you'd care to write C on (amd64, aarch64, ...) has fixed-width types.
- throwbackThurs 6y agoI've begun coding with embedded rust, it's actually really refreshing to use a modern toolset & language in an embedded environment
- bsaul 6y agoHas there been any news on exporting a lib to be used by an android app ? Last time i checked, it was still painful to generate jni bindings. I’m dying to find a tech that would let me easily write a shared lib that targets web , android and ios, but so far everything seems very experimental wherever i look. Rust seemed to be the closest, but still a bit raw.
- steveklabnik 6y agoNothing specific has changed here recently, no. I believe Cloudflare is doing this with the 1.1.1.1 app; maybe someone who is there will see this and chime in.
- jynelson 6y agoI find it interesting the article didn't mention compile times at all. Maybe since Oxide mostly works with embedded, they have few dependencies and their compile times aren't very bad? I know my primary complaint after working with the language for about a year is that most projects take over a minute to build. Of course, it doesn't help that I keep moving onto larger projects xD but even small things like cargo-deadlinks and ripgrep take a while.
- steveklabnik 6y agoFunny story, I've actually been working on reducing our compile times lately. We had a conversation about this when I started the work, Brian just doesn't have a ton of sensitivity to this in general. I apparently have more :) There are details that matter, but on the codebase I work on, the current worst case (before the work I've been doing) means a compile takes a couple of minutes; more like two than five. I'm not sure how other codebases at the company are with regards to this, but I don't think they're super long. What I've been doing drops it to under thirty seconds in basically all cases. So yeah, it hasn't been a super pain for us specifically. We'll see as time goes on :)
- swsieber 6y agoCan you share approaches you've used to drop compile times? I'm wondering if there's anything beyond avoiding macros and generics.
- steveklabnik 6y agoHonestly, it's stuff that's very specific to "writing a whole operating system in Rust," and so unlikely to be broadly useful. Basically, we were doing a lot of "spurious" re-builds of crates, because we were changing flags between compilations, and with some creativity, we didn't actually need to do that. If you're not building a bunch of things multiple different times in slightly different ways, it's not relevant. I will say that I recently discovered that putting a bunch of crates into a workspace is inherently slower than compiling them all separately, which is pretty surprising. I haven't dug into the exact reason yet, but it makes 4x the syscalls, so I'm assuming that it's checking every single dep of every single member and that has significant overlap. https://users.rust-lang.org/t/complex-build-advice/48779?u=steveklabnik https://users.rust-lang.org/t/complex-build-advice/48779?u=s... is probably closest to what I can currently say :)
- matheusmoreira 6y agoThe awesome inline assembly macro doesn't seem to be stable though. Isn't it only available in nightly builds of Rust?
- steveklabnik 6y agoYes. We are using nightly Rust for this reason.
- estebank 6y agoHave you considered using The Flag That Shall Not Be Named? I find it that it is a reasonable thing to do as long as none of the code that depends on it escapes your private workspace.
- steveklabnik 6y agoI just checked, we use asm and naked_functions. We haven't considered it, really, and that's mostly just because it well, feels wrong. We're just pinned to a specific nightly for now. It's no biggie. This is also just for one repo, I should say too; we use stable for everything else. Operating systems stuff on stable Rust will be a glorious day...
- dilippkumar 6y agoA little unrelated - but can we have an update on season 2 of the “On the Metal” podcast?
- musicale 6y ago> A great strength of Rust is its safety — but something I also appreciate about it is the escape hatch offered via unsafe, whereby certain actions are permitted that are otherwise disallowed. I guess so, but I'd kind of prefer to be able to do everything I want in safe mode.
- timClicks 6y agoSometimes you need to work with pre-written libraries. The Rust compiler is unable to reason about anything on the other side of the FFI boundary.
- adwn 6y ago> I guess so, but I'd kind of prefer to be able to do everything I want in safe mode. Different people have different needs and want to do different things. It is impossible to satisfy everyone's needs – "do everything I want in safe mode" – both from a practical perspective (the language and the compiler would become incredibly complex and therefore buggy) as well as from a theoretical perspective (you would solve the halting problem, among other impossible feats).
- moonchild 6y ago> language and the compiler would become incredibly complex and therefore buggy Ats[1] isn't in such bad shape. Its type system is much more complex, sure; idiomatic ats proves many interesting programming attributes that rust doesn't. But if you write ats in the same style as rust, the only additional complexity you'll notice is you have to manually drop. > you would solve the halting problem, among other impossible feats ...what? I don't see what the halting problem has to do it. Safe rust programs aren't required to halt; nontermination is safe, even if not necessarily desirable (like memory leakage, which is also allowed for the same reason). 1. http://www.ats-lang.org/ http://www.ats-lang.org/
- adwn 6y ago> I don't see what the halting problem has to do it. Is the following code safe? function_xyz(); let p = 0x1234 as *mut u32; p.write(5); It is safe iff function_xyz() does not terminate. To determine whether the code is safe in the general case, the Rust compiler would have to solve the halting problem. Since that is impossible, the compiler uses a heuristic, which defaults to "not safe". It could use a better heuristic, like "Does function_xyz() contain an infinite loop? If yes, the code is safe." But that's of dubious value.
- hvasilev 6y agoI'm not using this language because the syntax is really heavy and definitely not my cup of tea. I'm puzzled by the ambitions to market this language for the embedded world. The embedded world is full of electronics engineers that are writing code as part of their job. If experienced developers are finding this language overwhelming, how are you going to convince the electronics guys to adopt it instead of using plain old C? Also in this world all major HALs and SDKs are written in C. The toolchains usually are very fixed, since doing embedded systems is hard...
- leafario2 6y agoI am an embedded software dev and Rust would fit my job well, but I see what you are saying. However, embedded is not all for Rust and not all embedded is done by EEs. Systems programming goes from bare metal up to things like browsers and databases...
- dataking 6y agoRust's type system is complicated for a reason. It makes explicit the reasoning that is necessary to allocate and access memory correctly without reference counting or garbage collection. Sure it is easier to start writing C but I believe it is overall faster to write and debug a Rust program because C requires additional sanitization and fuzzing to catch errors. To quote Grissom from CSI: I've learned that sometimes you can go faster by going slow ;-)
- msie 6y agoI don’t know. Rust has all these high level features that also contribute to it’s complexity too. Strip those out and you may have a simpler language.
- hvasilev 6y agoI think this profession is hard enough as it is. I don't think you need another daily source of annoyance like reading code with a difficult syntax or fighting meaninglessly with the borrow checker. I understand the motivations for this language, but I don't like the tradeoffs on a personal level. Definitely not my cup of tea.
- axilmar 6y agoAbout newlines and string literals: why do languages allow newlines in source code to be part of strings? is there some hidden wisdom behind that? Personally, I would expect that the string "the quick brown fox jumps over the lazy dog" Would be like this in runtime: "the quick brown fox jumps over the lazy dog" Whereas this: "the quick brown fox\n jumps over the lazy dog" would be like this in runtime: "the quick brown fox jumps over the lazy dog"
- sergeykish 6y agoI have same question, it is easy to solve in rich text environment [1]. But it is also possible to solve quotes in quotes. Browser solves it beautifully — we never think how <>& escaped while reading the page, it just works in contenteditable. let encoded = this.textContent.replaceAll("\n", "\\n") .replaceAll('"', '\\"') return `"${encoded}"` [1] http://sergeykish.com/c-multiline-string http://sergeykish.com/c-multiline-string
- int_19h 6y agoThe spaces are already significant in strings, so why not other whitespace? If you try to exclude newlines specifically, it becomes messy when you have to deal with indentation. E.g. how should this parse? foo = "this is a multiline string"; If you simply ignore the newlines, you'll end up with a bunch of spaces. If you start collapsing whitespace, detecting indentation levels etc, parsing becomes a lot more complicated, and harder to explain (which you still need to do, because it won't always "just work").
- axilmar 6y agoThe newline character plays a very important role in formatting source code: long declarations/statements are usually broken up into several lines of code using hidden newlines. These newlines do not alter the meaning of code. The same hidden newlines though in a string will alter the string: they will make the string multiline. So, in order to be more consistent with how code is formatted, I'd prefer hidden newlines in strings to not modify the strings.
- sergeykish 6y agoI can't believe C binary constant is non standard. It is so easy to solve. Why can't we extend source transformation? The feature is useful - lisp known for macros, javascript recently got string transformation: b = s => parseInt(s, 2) b`101010` 42 Of course this requires changes to the language. Can we solve it with markup [1]? [1] http://sergeykish.com/c-binary-constants http://sergeykish.com/c-binary-constants
- Const-me 6y ago> I can't believe C binary constant is non standard They are part of C++14 standard: https://en.wikipedia.org/wiki/C%2B%2B14#Binary_literals https://en.wikipedia.org/wiki/C%2B%2B14#Binary_literals
- sergeykish 6y agoThe one without ++
- SAI_Peregrinus 6y agoC++ is a different language. They're non-standard in C. Even in C2x. Probably worthy of a feature proposal though.