1,194 karma · joined April 10, 2013
There's a poster upthread who seems to have done what you're describing: https://github.com/WilliamAGH/tui4j
Even funnier, this was all hypothetical and yet taken as gospel. We hadn't even written the tests yet, so it was impossible to say whether they were slow or not. Nothing had been measured, no performance budget had been defined, no prototype of the supposedly slow tests had been written to demonstrate the point.
We ended up writing - no joke - less than 100 tests total, almost all of which hit the database, including some full integration tests, and the entire test suite finished in a few seconds.
I'm all for building in a way that respects performance as an engineering value, but we got lost somewhere along the way.
I’ve been on projects where mocking _literally made the project less reliable_ because people ended up “testing” against mocks that didn’t accurately reflect the behavior of the real APIs.
It left us with functionality that wasn’t actually tested and resulted in real bugs and regressions that shipped.
Mocking is one of these weird programmer pop-culture memetic viruses that spread in the early 2000s and achieved complete victory in the 2010s, like Agile and OOP, and now there are entire generations of devs who it’s not that they’re making a bad or a poorly argued choice, it’s that they literally don’t even know there are other ways of thinking about these problems because these ideas have sucked all the oxygen out of the room.
For safety regulators, the incentives are all on the side of limiting acute downside (e.g. a plane crashing), not maximizing potential aggregate upside (e.g. millions of tons of fuel saved per year and millions of tons of C02 not in the atmosphere).
Society punishes regulators that approve products that kill people, so regulators adapt to this and as a result tend to be very conservative.
Regulators don't capture any of the upside (reputational or otherwise) when a new product enters the market and cures disease, makes cars more efficient, helps planes land on their own in an emergency, etc.
I don't know what "right" should be here, but you've hit on a good point. It's complicated.
> If I call a function which returns an object of type T, I can safely assume the object lasts forever. It cannot be mutated by any other code (since its mine). And I'm not going to break anything else if I mutate the object myself. These are really nice properties to have when programming at scale.
I rarely see this mentioned in the way that you did, and I'll try to paraphrase it in my own way: Rust restricts what you can do as a programmer. One can say it is "less powerful" than C. In exchange for giving up some power, it gives you more information: who owns an object, what other callers can do with that object, the lifetime of that object in relation to other objects. And critically, in safe Rust, these are _guarantees_, which is the essence of real abstraction.
In large and/or complicated codebases, this kind of information is critical in languages without garbage garbage collection, but even when I program in languages with garbage collection, I find myself wanting this information. Who is seeing this object? What do they know about this object, and when? What can they do with it? How is this ownership flowing through the system?
Most languages have little/no language-level notion of these concepts. Most languages only enforce that types line up nominally (or implement some name-identified interface), or the visibility of identifiers (public/private, i.e. "information hiding" in OO parlance). I feel like Rust is one of the first languages on this path of providing real program dataflow information. I'm confident there will be future languages that will further explore providing the programmer with this kind of information, or at least making it possible to answer these kinds of questions easier.
No. I’m genuinely curious, because I agree with you about how critical these components are. I ask because it doesn’t seem to me like the answers are immediately straightforward and wanted to hear serious replies to those questions.
The connections you allow or disallow are basically the main interesting thing about microservices. Arbitrarily connected services become mudpits, in my experience.
> Think more actors/processes in a distributed actor/csp concurrent setup.
A lot of actor systems are explicitly designed as trees, especially with regard to lifecycle management and who can call who. E.g. A1 is not considered started until its children A2 and A3 (which are independent of each other and have no knowledge of each other) are also started.
> Also for many system designs, you would explicitly want a different topology, so you really shouldn't restrict yourself mentally with this advice.
Sometimes restrictions like these are useful, as they lead to shared common understanding.
I'd bet an architecture that designed with a restricted topology like this has a better chance of composing with newly introduced functionality over time than an architecture that allows any service to call any other[1]. Especially so if this tree-shaped architecture has some notion of "interface" services that hide all of the subservices in that branch of the tree, only exposing the public interface through one service. Reusing my previous example, this would mean that some hypothetical B branch of the tree has no knowledge of A2 and A3, and would have to access their functionality through A1.
This allows you to swap out A2 and A3, or add A4 and A5, or A2-2, or whatever, and callers won't have to know or care as long as A1's interface is stable. These tree-shaped topologies can be very useful.
Agreed! I'd go so far as to say hiring is irrational in the aggregate.
The usual "rational" artifacts, if we can call them that (coding challenges, resumés, etc.) serve almost exclusively to eliminate candidates rather than boost good candidates. Firms are generally ok with false negatives from these artifacts as simply the cost of doing business.
> From there, it follows that meeting someone and letting them know you exist increases the chances (however small) that they can and will assist you on your career path.
I've seen this described as "people hire who they vibe with", and I've yet to see it play otherwise in my career. I'm not saying this is good, or fair, or desirable. It just is.
The folks who get offers are the ones who can meet people, tell stories (even true ones!), listen, and demonstrate that they can empathize with and contribute to messy, flawed organizations.
Humans have yet to invent a technology more powerful than social relationships, and I think technologists downplay this at their own peril.
I've been writing Rust professionally and personally since at least 2018 and this has never happened to me.
There are plenty of real criticisms one can make about Rust (I've made and will continue to make plenty) but I think your argument would be more compelling if you updated your experience with the present-day Rust toolchain. The Rust project takes stability very seriously.
How do you figure?
The essence of FP is functions of the shape `data -> data` rather than `data -> void`, deemphasizing object-based identity, and treating functions as first-class tools for abstraction. There's enough dynamic FP languages at this point to establish that these traits are held in common with the static FP languages. Is Clojure not an FP language?
> It takes more than just having immutable values to be functional, and forcing users to leave varibles as immutable was a mistake, which Elixir fixes.
All data in Elixir is immutable. Bindings can be rebound but the data the bindings point to remains immutable, identical to Erlang.
Elixir just rewrites `x = 1; x = x + 1` to `x1 = 1; x2 = x1 + 1`. The immutable value semantics remain, and anything that sees `x` in between expressions never has its `x` mutated.
> Erlang code in practice is just imperative code written with immutable values, and like a lot of other modern languages, occasional callouts to things borrowed from functional programming like "map", but it is not a functional language in the modern sense.
I did a large amount of Scala prior to doing Erlang/Elixir and while I had a lot of fun with Applicative and Monoid I'm not sure they're the essence of FP. Certainly an important piece of the puzzle but not the totality.
This is an amazing point that I haven't seen anyone else make about languages in this way.
As someone who got into the industry right after Perl's heyday and never learned or used it but learned programming from some former Perl power users, Perl has a pre-corporate/anarchic/punk feel about it that is completely opposite to something like Golang that feels like it was developed by a corporation, for a corporation. Perl is wacky, but it feels alive (the language itself, if not the community). By contrast, Golang feels dead, soulless.
I wish bash was the thing that was dying. As an industry, we need to make better choices.
I keep seeing folks with this "when will Rust be ready" sentiment and it feels a bit dated to me at this point.
At my last job we built machine control software for farm equipment (embedded Linux, call it firmware if you like). The kind of thing that would have been in C or C++ not long ago. Worked great, Rust itself was never the issue. Code from the very first versions continued to work with no problems over years of feature additions, bugfixes, rewriting, edition upgrades, etc.
The job before that, my team wrote a large library of 3D geometry analysis algorithms code that powered some fun and novel CAD manufacturing tools. In Rust. Worked great. It was fast enough, and crucially, we could run it against user-provided data without feeling like we were going to get owned by some buffer overrun. 10 years earlier it 100% would have been in C or C++ and I would have been terrified to throw externally generated user data at it. We were able to do what we needed to do and it served real paying users. What more do you need?
Rust is everywhere. It's in the browser. It's in databases. It's in container/VM runtimes. It's in networking code. It's in firmware. It's in the OS. It's in application code. It's in cryptography. It's in Android. Rust is all over the place.
The only other thing I can think of with a similar combined breadth and depth of deployment to Rust on "real" projects (other than C/C++) is Java.
If I needed something to both work and be maintainable by somebody in 2055, Rust is one of the few things I'd bother to put on the list, alongside C, C++, Java, Python, and Javascript.
It's complicated.
The library/framework situation is much better than it used to be. There isn't much that's glaringly missing anymore. Some things have lighter maintenance than one might like, but most stuff is there.
I think Elixir and the BEAM have a weird problem in that it's somewhat hard to understand their benefits until you use them. This is not the case with a lot of other stuff. If you were coming from Java in the 90s and you saw Ruby, you didn't have to use Ruby to realize just how much less code it took to do similar things. You could just see code examples.
If you used Perl back in the day, you didn't have to actually use Python to see how much easier it was to read Python as a novice compared to Perl's eccentricities.
The BEAM is tough to sell because its benefits are not something you can easily see on a screen at a meetup, for example. "What if you had a VM that was designed for the ground up for concurrency" doesn't sell. People respond with "well my language already has threads and promises". "What if your language gave you a builtin toolkit to partition and restart the various different subsystems in a rigorous, well-defined way?" People say, "I already have systemd and it restarts my services."
Having done it for some years now, the BEAM kinda has "the quality without a name"[0]. It feels "whole" in a way that other environments don't, and that's difficult to show. This is not something that shows up trivially on a slide deck or a landing page, and most people don't want to take a gamble on a smaller language community that's seen as different and weird compared to the more mainstream language they already know, especially when the most positive things they hear are "it's a functional language that does concurrency better". For most people, this just isn't a compelling enough pitch to get them to leave Python or Javascript or Java (or Ruby).
By the way, I'm not blaming folks, this is both a rational and normal way of evaluating risk when faced with an unintelligible upside and an immediately apparent downside (small community, uncertain career prospects, questionable library coverage, etc.). I think as a community, we (Elixir) have done a poor job in making Elixir seem less risky.
> Somewhat of a tangent, but TFA doesn't mention python and I would think for rubyists this is (still) the elephant in the room. It kind of won to the extent they target the same niches and same audiences, for better or worse.
IMHO Python won the war. Ruby won server-side webapps battle with Rails, which is still going strong, but Python won literally everything else by a landslide. And Python still even has Django. Python is _everywhere_. There's no stats on this that I know of, but I bet 90%+ of Ruby usage is Rails. This is not the case with Python.
To be clear, this is all in the context of adoption. Ruby may never have Python's adoption, but Ruby has been hugely influential. Tons of other technology can trace its lineage to Ruby, whether it's Elixir as a language, or Rust's tooling (Cargo), etc.
> I know it's kinda naive, but I was really hoping elixir would get all of the ruby crowd excited, and they'd move the best parts that they can't live without into elixir. Why didn't they / don't they?
Rails still has a large amount of inertia, both technically and culturally. It's still very good at its niche. Getting Rails folks to move away from Rails would take something as better as Rails was than the Java stuff that came before it. Plus, some people just love Ruby! Elixir isn't Ruby. Elixir is more explicit, doesn't have mutability, doesn't have objects, etc. The similarity really ends at syntax, and I think a lot of Ruby folks are happy with what Ruby is, which is totally fine.
Sorry for the long answer.
[0] - https://onluminousgrounds.wordpress.com/2010/04/24/the-quali...
It's the native format Erlang nodes use to serialize data to communicate with each other, but it's just a simple Type-Length-Value binary format, so anything can implement it.
It's small enough that you can create a reasonably complete and fast implementation of it for your language in an afternoon. It's self-describing, so if you can read ETF you can read any ETF message, as there are no out of band schemas. I love it.
[0] - https://www.erlang.org/doc/apps/erts/erl_ext_dist.html
Elixir is funny. I've done Elixir for years now, and did some Ruby at the beginning of my career. A ton of people come to Elixir for the familiarity of the Ruby-like syntax but with a functional programming basis. They like Ruby but get tired of OOP and mutable state and want to try something else. They tend to stay for the runtime/VM, called the BEAM.
Don't get me wrong, the Elixir language is nice, but the BEAM and its operational characteristics feel night-and-day compared to Ruby and most other languages that were designed for a world of single-threaded programming.
When you're using the BEAM (any language - there are a few now) there's this amazing sense that you're using something that was _designed to be operated_. You can instrument anything. You can trace anything. You can see the live state of anything. You can restart anything. It's a holistic _system_ for building systems, not just a language.
I think your argument would be more effective if you dropped this angle.
Unwrap is assert. No more, no less. It's tremendously useful to have it in the language for situations when the cost of encoding some invariant in your program's types is far larger than the benefit you'd gain from doing so. It's not some vestigial thing from way back before anyone received enlightenment that they could use sum types to discriminate errors. It's just a different tool.
I completely agree there are systems and situations where you want to be able to statically verify an absence of panics, but the way you're describing the situation sounds similar to when I hear folks describe anything that came before as "legacy" with a denigrating inflection.
- https://rust-lang.github.io/rust-clippy/master/#unwrap_used
- https://rust-lang.github.io/rust-clippy/master/#indexing_slicing
- https://rust-lang.github.io/rust-clippy/master/#string_sliceFor example, in Erlang, `receive` _is_ a blocking operation that you have to attach a timeout to if you want to unblock it.
You're correct about identity/names: the "queue" part of processes (the part that is most analogous to a channel) is their mailbox, which cannot be interacted with except via message sends to a known pid. However, you can again mimic some of the channel-like functionality by sending around pids, as they are first class values, and can be sent, stored, etc.
I agree with all of your points, just adding a little additional color.