News for hackers. Stuff that matters.
Re:Two years of Rust by zzalpha on Monday May 15, 2017 @04:47PM (#14344957)
If your language doesn't have a REPL, your language is less productive. Deal with it.

Oh hardly.

As someone who's developed software in Perl, Python, C, Java, C#, Haskell, and a few others besides, a REPL is the one thing I use the least. I've honestly never understood the obsession with it.

Is a rapid compile-run-debug cycle important? Absolutely. If I want to test something in isolation, being able to rapidly turn out a UT to prove my code does what I think it does is incredibly important.

But a REPL is a nice-to-have. Nothing more. Treating its absence as some fundamental black mark on a language is completely absurd.

Re:Two years of Rust by derefr on Monday May 15, 2017 @06:08PM (#14345577)
> I've honestly never understood the obsession with it.

The true key to understanding REPLs is their role in consuming third-party libraries. While languages both with and without REPLs will have well-used packages in their package ecosystems that are well-documented; languages with REPLs will also manage to have well-used, poorly-documented packages: packages whose "documentation" consists only of the de-facto ability to reflect on the API in a REPL, doing the moral equivalent of exploring a filesystem using cd(1) and cat(1), until you figure out what functions—and what arguments—combine to produce an acceptable result for your use-case.

That may sound like a bad thing, but it's not! Those packages are packages that wouldn't exist otherwise; they're marginal packages, packages which people wouldn't have had time to write if they were required to also document them properly enough to make use of them without a REPL. They're needs being satisfied, that would otherwise—given the stricter requirement of useful API documentation—be going un-met.

If you look at e.g. Ruby's gem ecosystem, there are tons of packages that have more than a million downloads, and either no docs or awful docs. How? Because Ruby is extremely amenable to exploring APIs through a REPL. You take a module or class, ask it what its children are, what its class methods are, what its instance methods are. Find a class with instance methods that sound right, attempt to instantiate it. Figure out you can't do that, look around the class methods for something that sounds like a factory method. What arguments does said factory-function take? Well, feed it some at random and see what error you get. Etc.

Re:Two years of Rust by zzalpha on Monday May 15, 2017 @06:36PM (#14345782)
For (most) languages lacking a REPL, it's very similar. Instead of a REPL you write compiled unit tests and/or test programs to poke around at the API.

For languages with a reasonably sophisticated IDE, use the IDE itself to jump straight to the class/function declarations to understand the surface area of the API, and jump to the decompiled code for the implementation of those functions if you're the type to want to understand the machinery.

Other languages (like Haskell) may not have the IDE support but attempt to solve the problem with auto-generated docs so you can at least see the surface area of the API and can start prodding it.

Re:Two years of Rust by derefr on Monday May 15, 2017 @07:03PM (#14345971)
> What's your experience level with other languages?

~15 years experience across C, ARM assembler, Javascript, Lua, Ruby, Python, Erlang, Go, and Rust. Mostly doing Elixir these days.

Admittedly, I've never used an IDE; I write all my C in vim.

> ...you write compiled unit tests and/or test programs to poke around at the API.

That assumes you can get your tests to compile; or that the compilation errors are at-all helpful when they don't. If you've got a library that

1. ships as a binary blob + header files, and

2. most of its functions take handles to structs that are declared opaquely in the SDK headers; and yet

3. nothing you do with the badly-documented "create handle" parts of the API is giving you a struct that the "consume handle" parts of API will do anything with but crash...

...then you'll really wish that you had a REPL; or rather, a language runtime that enforced some level of introspect-ability on everything, so that a REPL could show you what's in the struct and whether your calls so far have failed to touch some obviously-necessary-to-fill-in part of it.

Without such support, you will have to rely on reading the decompilation results of both ends of the API to figure out what's really going on.

Re:Two years of Rust by zzalpha on Monday May 15, 2017 @09:38PM (#14346762)
or rather, a language runtime that enforced some level of introspect-ability on everything

And now we get to the real meat of it.

It's not a REPL you want.

It's reflection.

It just so happens that the latter is frequently paired with the former.

And I agree, that feature, which separates C#, Java, Ruby, Perl, Python, etc, from legacy languages like C make them significantly easier to use as a developer as the compiler, debugger, and IDE can do a much better job.

But as a feature it's orthogonal to a REPL.

Re:Two years of Rust by derefr on Monday May 15, 2017 @10:09PM (#14346869)
Reflection isn't orthogonal to a REPL; it's synergistic with a REPL. When you have a static language, yes, REPLs don't add much; reflection by itself is all you need and an IDE will suit you fine.

But when you are working in a language with runtime code generation—one where objects can build themselves new runtime-native function handles in response to messages—then a REPL will be able to do things for you that an IDE cannot†.

A REPL in a dynamic language (that takes advantage of its dynamicity) can be used to "explore" down CORBA/DBUS object trees; or fluently walk REST or SOAP endpoints without needing pre-baked WSDL descriptors to guide you to them. Heck, an Erlang REPL can hot-upgrade remote nodes. :)

† Or, at least, not a traditional IDE. You would need an IDE connected to a "live session" of your project—essentially a hybrid IDE-REPL. (Examples: Light Table; Emacs' CIDER extension for Clojure.)

Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @08:02AM (#14348884)
Lisp, Smalltalk and Mesa XDE at Xerox PARC are the genesis of what an IDE is supposed to be.

Two dynamic and one static languages.

Re:Two years of Rust by photojosh on Monday May 15, 2017 @08:15PM (#14346368)
> then you'll really wish that you had a REPL

Yes. I write roughly equal amounts of C (microcontroller firmware) and Python (overall system control, running on embedded Linux).

I absolutely wish I had a REPL for C. When implementing with a new library in Python, I'll usually use iPython to explore it, and if I need to run a decent amount of data through, I'll use a Jupyter notebook. I'd put the difficulty of grokking a C library somewhere between 10x and 100x harder.

Re:Two years of Rust by yorwba on Monday May 15, 2017 @11:33PM (#14347180)
I use gdb as a C REPL. You attach it to a binary that has the functions you need, then you can use them with the `p` (or `print`) command. Loops and new function definitions are not possible, but sometimes it's still good enough.
Re:Two years of Rust by RhysU on Tuesday May 16, 2017 @07:54AM (#14348858)
Gdb as REPL is a nice trick. Beaker Notebook might give the notebook parent wants for C work.
Re:Two years of Rust by photojosh on Wednesday May 17, 2017 @09:09PM (#14364155)
Thanks. It won't since all my C work is embedded and mainly systems programming rather than algorithms. But I'll keep it in mind for the next time I have to translate my Python explorations over to C for production.
Re:Two years of Rust by photojosh on Wednesday May 17, 2017 @09:04PM (#14364131)
Good point. I've only been working with AVRs for a few years since I've been at this job, but looks like it might be doable. Thanks for the tip.
Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:49AM (#14347829)
That is how I once developed a B+ Tree library for low level disk blocks back in 1996, it was quite helpful tracking down how the nodes were being used.
Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:47AM (#14347821)
C has had REPLs since the 90's, one just needs to search for them, and eventually buy them.

They were quite common advertising in The C User's Journal and Dr. Dobbs.

Re:Two years of Rust by Manishearth on Monday May 15, 2017 @07:18PM (#14346066)
Note that with strong typing this is less of an issue -- with Rust you can just go to http://docs.rs/<nameofcrate> and navigate the structured docs. They may lack explanatory text, but you can click around them and search and it's overall much nicer than fiddling around in a REPL.

(Still, doesn't fit all use cases of a REPL for this. REPLs are especially nice for when you want to fit together highly generic APIs)

Re:Two years of Rust by curun1r on Monday May 15, 2017 @08:04PM (#14346309)
Also, cargo doc --open for offline version of docs.rs :-)
Re:Two years of Rust by derefr on Monday May 15, 2017 @07:30PM (#14346130)
True; but also, "strong typing" on its own isn't a panacea for guidance; unless you're writing Coq or Agda, the API functions you're calling are still going to have preconditions that are not encoded in the type signature, so you're still (partially) reliant on having either good docs or a REPL [or clumsy REPL-equivalent, like exploratory unit tests] to inform you of those preconditions.

And if you are writing Coq or Agda—well, you certainly don't need a REPL at that point. The code writes itself. ;)

Re:Two years of Rust by Manishearth on Monday May 15, 2017 @08:55PM (#14346564)
Yeah, like I said, doesn't fit all use cases, but it does fit the primary one.
Re:Two years of Rust by oblio on Monday May 15, 2017 @06:18PM (#14345661)
Many languages have good IDE support, which is basically REPL on steroids.
Re:Two years of Rust by derefr on Monday May 15, 2017 @06:40PM (#14345801)
True, though "good IDE support" in the sense you're talking about (i.e. being able to discover an API through the IDE) mostly relies on strong typing in the language. (Non-inferred) type declarations are their own form of documentation, with a similar effect on likelihood of a "marginal" ecosystem package getting written.
Re:Two years of Rust by sillysaurus3 on Monday May 15, 2017 @05:03PM (#14345095)
I tend to agree, but being able to have a REPL at all is a symptom that your language is capable of an extremely fast compile-run-debug cycle.

In other words, if you can't implement a REPL, that's the definition of "less productive language." It's not about the REPL itself but the capability of implementing one.

Think about it like this: On your list of languages, which of them would you say is most productive? It depends on the context, certainly: libraries, familiarity, etc. But let's assume the languages had identical ecosystems, and that you were competent in all of them. Which of them would take the smallest amount of time to write your feature?

That'd probably be Python, Haskell, or even Perl. It seems very difficult to argue that Rust would top them. And the reasons why this is might be true are worth examining.

Here's another aspect. Is the Rust community claiming that the entire history of computing has lead up to this point, where Rust exists, and now nobody needs to write anything in not-Rust? Are people 200 years from now going to write Rust and nothing else? How about 20? 2?

It becomes very difficult to argue that your programming language is the lingua franca of the future. (And that's probably true for every language, not just Rust.)

Re:Two years of Rust by derefr on Monday May 15, 2017 @06:31PM (#14345744)
Why must productivity be measured in "smallest amount of time to write your feature"? Why not in "smallest Total Cost of Ownership [in man-hours] of the feature over the project lifecycle"?

Some projects are written as explorational prototypes or MVPs. I don't think anyone is saying Rust is much good for those.

But (numerous) other projects are written as "the first real Quality implementation of [well-known problem], using a decade's experience with other implementations." Much of the common software we use—{server daemons (HTTP, SSH, DNS...), parsers and encoding libraries (for XML or JSON; JPEG or PNG; MP4 or MKV...), databases, load-balancers, distributed queues, ...}—fits this paradigm.

If you're writing Nginx, or Redis, or djbdns, you aren't "adding features" out of some agile user-story kanban; you're carefully implementing a small, curated set of well-known, well-understood features, with much research done to ensure that you arrive at the best and least fraught implementation, the one that will make people prefer your software for its quality and reliability and set-and-forget nature.

Rust is for that kind of software. (Which makes sense, given that Mozilla's Servo rendering engine also has the goal of being that kind of software.)

Re:Two years of Rust by cwzwarich on Monday May 15, 2017 @07:51PM (#14346249)
> (Which makes sense, given that Mozilla's Servo rendering engine also has the goal of being that kind of software.)

Web browsers are not that kind of software. The web is evolving much faster than any of the other things you mentioned. New features get proposed every year, and you just have to deal with it and implement them, even if they complicate the implementation of the browser. Even if you cut that off, you still have to deal with the horrific mess that is the cumulative total of past web-related decisions.

Re:Two years of Rust by derefr on Monday May 15, 2017 @08:00PM (#14346285)
A rendering engine is not, itself, a web browser. (You might be thinking of a higher-level component, like Chromium's Embedded Framework? Not the same thing as a rendering engine.)

There's certainly a layer of a rendering engine—the part that translates a CSSOM into rendering pragmas—that changes a lot over time. But rendering the resulting pragmas itself doesn't change much, and features requiring new pragmas come about remarkably slowly.

Re:Two years of Rust by cwzwarich on Monday May 15, 2017 @08:17PM (#14346379)
I definitely know the difference between a browser and a browser engine; I worked on both WebKit and Servo. There's much more to a browser engine than rendering alone, and rendering isn't even the most complicated part of a browser engine. Outside of rendering and JS there's a steady stream of new DOM APIs, and that's the part that is similar to the "agile user-story kanban".
Re:Two years of Rust by derefr on Monday May 15, 2017 @09:44PM (#14346781)
Yes? It sounds like you're agreeing with me, and disagreeing with your own GP comment. Or maybe I misunderstood the point of your GP comment—it sounded like you were trying to use some sort of metonymy to equate Firefox/browsers in general with Servo, as an implicit counterargument to my GGP post in the sense of "it'd be bad to write a browser in Rust for [reasons you gave]; a rendering engine is part of a browser; a rendering engine thus has the same lifecycle as the browser itself; and thus, a rendering engine is not actually a good example of a good use-case for Rust, despite Mozilla's ambitions. QED."

Clearly, though, you know what a rendering engine is, so I'm not sure what your argument in the GP post was. Was it just a tangential statement (i.e. "rendering engines are well and good, but it'd be silly to write the browser itself in Rust, for [reasons]"), rather than a rebuttal...?

Re:Two years of Rust by kibwen on Monday May 15, 2017 @08:02PM (#14346304)
So we're in agreement that we should reimplement Chrome in Perl, then. :)
Re:Two years of Rust by kbenson on Monday May 15, 2017 @09:02PM (#14346608)
As a Perl programmer I'm not sure whether to laugh or cry. ;)
Re:Two years of Rust by nickpsecurity on Monday May 15, 2017 @07:23PM (#14346090)
"Why must productivity be measured in "smallest amount of time to write your feature"? Why not in "smallest Total Cost of Ownership [in man-hours] of the feature over the project lifecycle"?"

In the case of startups, their goal is to sell out way before the maintenance phase of the lifecycle. So, it doesn't really matter to them so much as quickly getting out working features. In other cases, esp long-lasting endeavors, then this is a good point to consider.

Re:Two years of Rust by kbenson on Monday May 15, 2017 @09:09PM (#14346640)
> In the case of startups, their goal is to sell out way before the maintenance phase of the lifecycle.

Or grow so quickly that replacing most the legacy code from a year or two ago is not a significant hurdle at their new size.

In this vein, I wonder if there's actually a third path that might be better than both. Using a low-level but fairly expressive and strongly typed language but very loosely, such that it allows you to iterate fact but with less performance, and you can come back later and replace chunks as needed, but with the same language. I don't have any real experience with that, and I could see it going either way for a number of reasons, but it seems like we have more languages that might fit that criteria now (or at least they are more popular now) than we have previously.

Re:Two years of Rust by tatterdemalion on Monday May 15, 2017 @05:21PM (#14345227)
> Is the Rust community claiming that the entire history of computing has lead up to this point, where Rust exists, and now nobody needs to write anything in not-Rust? Are people 200 years from now going to write Rust and nothing else?

Let's be clear - the person who said there'd be no reason to write in anything else is an enthusiastic Rust user, but they don't work on Rust & don't represent "the Rust community." They were speaking from their own experience, based on their own balancing of the trade offs as a user. Presumably a REPL doesn't rate very highly for them.

However, the reasons we don't have a REPL are mainly two: the compiler isn't architected for it and code doesn't compile fast. The solutions are:

* Re-architect the compiler to support incremental code input. This is pretty similar to what we need to support IDEs (which we're working on), so possibly this will solve the problem.

* Get a reimplementation of the backend which is a JIT interpreter instead of LLVM, which takes up most of our compiletime. Work is underway on a project called miri, though it isn't officially supported right now.

* Make the typechecking part of the compiler faster. This is underway through a project called chalk.

In other words, a REPL is not impossible, it just isn't a top priority right now. There are other lacking tools that we're working on - IDE integration and auto-formatting for example - maybe after those are done it will be the top of the docket.

Re:Two years of Rust by lacampbell on Monday May 15, 2017 @06:10PM (#14345596)
I'm no compiler writer, but presumably rust has some form of internal IR it compiles to before it gets turned into LLVM IR. Why not just write an interpreter for that layer and be done with it? The point of a REPL to me is to be responsive, not to run code amazingly quickly.
Re:Two years of Rust by steveklabnik on Monday May 15, 2017 @06:31PM (#14345746)
"Miri" is named such because Rust's IR here is called MIR.

It's a relatively recent addition though.

Re:Two years of Rust by tatterdemalion on Monday May 15, 2017 @08:04PM (#14346308)
Yes, thats what the second point is.
Re:Two years of Rust by sillysaurus3 on Monday May 15, 2017 @05:39PM (#14345355)
Let's be clear - the person who said there'd be no reason to write in anything else is an enthusiastic Rust user, but they don't work on Rust & don't represent "the Rust community."

Respectfully, the community has become increasingly vocal, and it's getting hard to separate the enthusiasm from realism. It's embedded in every HN thread. That's a good problem to have, but it can be a bit repellant to people who aren't Rust converts.

Thanks for the breakdown and future roadmap. I hope the compile times can be kept to a minimum in order to avoid C++'s fate.

Re:Two years of Rust by kibwen on Monday May 15, 2017 @08:05PM (#14346317)
The community is in every thread because the people here were HN users before they were Rust users. Look at how old my account is; I haven't quite been shilling Rust since December 2011. :P
Re:Two years of Rust by steveklabnik on Monday May 15, 2017 @08:27PM (#14346442)
And I've got a thousand days on you :p
Re:Two years of Rust by Ygg2 on Monday May 15, 2017 @11:03PM (#14347082)
Except one of tenets of Rust community is don't be a language zealot. Don't advocate for rewriting everything, etc.
Re:Two years of Rust by zzalpha on Monday May 15, 2017 @05:15PM (#14345192)
Think about it like this: On your list of languages, which of them would you say is most productive?

Define productive.

Are you measuring raw lines of code generated?

Or are we measuring amount of production-ready code?

My bet: with an experienced, diligent developer it's a wash. My gut says what you lose in a slow code-execute cycle of static, compiled languages you gain in lower defect rates from compile-time checks. Conversely, what you gain in a dynamic language, you lose in errors caught at run-time.

At that point I'd select for languages that are simpler with fewer surprising semantics (crossing Perl and Javascript off the list), with more built-in run-time and/or compiler safety (knocking things like C off the list). I generally also prefer compile-time safety over run-time safety, as I'd rather find problems on my workstation than in the field because I missed testing a codepath.

Re:Two years of Rust by kbenson on Tuesday May 16, 2017 @01:53PM (#14351696)
> with fewer surprising semantics (crossing Perl and Javascript off the list)

Actually, I think Perl has fairly few surprising semantics after you learn the major ones. The real problem is that the major one (or specifically the major one, context) is somewhat hidden in normal C-like usage until it jumps out at you and confuses you. Once you understand what it is, it's not all that surprising (but there are a few annoyances with it that still persist and cause problems). You can write Perl that looks almost exactly like C 95% of the time, but that 5% where it matters makes people that do this very confused. There are, of course, other parts of the language that are poorly chosen, but I maintain there are actually far less of them than many people seem to think.

As for JavaScript, I still can't get over all the different ways to check for equality and null or undefined. I understand a good portion of that is because I never have to use JS enough to become truly proficient, and some if it is just poor design.

Re:Two years of Rust by tannhaeuser on Monday May 15, 2017 @06:10PM (#14345595)
> It's not about the REPL itself but the capability of implementing one.

That definition excludes any bare-metal language, and use cases where you want to take advantage of cheap low-level memory protection features such as No-Execute bits. For me, a more interesting benchmark would be how well Rust fares in implementing the runtime of a higher-level language.

Re:Two years of Rust by sametmax on Thursday May 18, 2017 @05:30AM (#14365902)
As a Python dev with 12 years of experience, I still use the REPL every day.

When I wonder how something works or if I need my memory to be refreshed, I just fire up jupyter console and test quickly the code. I don't open the doc or search on the net. I have the live result immediatly.

When I want to debug my web server, I drop a REPL in the server and play with the code. It's more efficient that just debugging, because I can actually modify the code live and see what happens.

When I need to understand a format and how to manipulate / tranform data, I use the REPL (or jupyter notebook) because it's the most natural way to do it.

I don't know how much Python you have done, but you have been missing one of the greatest tool of the ecosystem.

It's like saying you don't see that much the benefits of an IDE for refactoring in Java. "yeah it's cool but how much do you use it hu ?".

Re:Two years of Rust by zambal on Monday May 15, 2017 @05:40PM (#14345372)
The usefulness of a REPL depends a lot on the language/interpreter/vm. In Erlang and Elixir the REPL is more than nice to have. Being able to connect to a production node and peeking around what is happening can be very valuable.

I guess it's one of those things that's imho hard to appreciate if you never experienced it.

Re:Two years of Rust by zzalpha on Monday May 15, 2017 @05:44PM (#14345413)
The usefulness of a REPL depends a lot on the language/interpreter/vm. In Erlang and Elixir the REPL is more than nice to have. Being able to connect to a production node and peeking around what is happening can be very valuable.

That's called a remote debugger, and it's hardly unique to languages supporting a REPL.

Re:Two years of Rust by dwaltrip on Monday May 15, 2017 @05:04PM (#14345106)
Just because you don't understand the benefits other people get from a REPL doesn't mean they don't exist.
Re:Two years of Rust by zzalpha on Monday May 15, 2017 @05:10PM (#14345154)
Just because there are benefits, doesn't make it a deal-breaker.
Re:Two years of Rust by dwaltrip on Monday May 15, 2017 @05:19PM (#14345212)
I didn't say it was a deal breaker?

Your post came off as implying REPLs don't have serious benefits for anyone, which felt a bit presumptuous to me.

Re:Two years of Rust by zzalpha on Monday May 15, 2017 @05:21PM (#14345234)
Yup, that's fair.

BTW, I actually stand by your interpretation. I challenge anyone to demonstrate significant productivity gains (as measured by number of lines of tested, production code written) that can be attributed to the availability of a REPL (which was the claim of the poster I was replying to).

I honestly don't buy it. I believe it's a very nice tool for learning a new language, and maybe for exploring an existing codebase, but I can't envision a workflow where a REPL provides significant productivity gains for an experienced, professional software developer that aren't realized in other ways (e.g. writing unit tests).

Re:Two years of Rust by dang on Monday May 15, 2017 @10:41PM (#14347001)
You're demanding the impossible here and elsewhere in the thread. Asking for the impossible is maybe ok, demanding it not so much.

No one can demonstrate productivity gains because productivity can't be measured. Lines of code can, and those are often a bad thing. Some of our most productive efforts make programs smaller.

Re:Two years of Rust by zzalpha on Monday May 15, 2017 @11:30PM (#14347170)
No one can demonstrate productivity gains because productivity can't be measured.

So then the OP shouldn't have made the claim. It ain't my job to prove it. :)

That said, I fundamentally disagree with the idea that one can't measure developer productivity. I agree that there are many potential measures, all of which have the potential to be flawed or distorted. But the idea that the productivity of a developer can't be measured at all is something I've never heard anyone seriously claim.

Re:Two years of Rust by dang on Tuesday May 16, 2017 @01:02AM (#14347476)
The fact that no one has come up with any plausible way of doing this is so commonly observed as to be a cliché. See for example https://martinfowler.com/bliki/CannotMeasureProductivity.htm....

> So then the OP shouldn't have made the claim

Come now, it was you who moved those goalposts and you moved them half a field or more. OP claimed REPLs "have benefits". Your response was (paraphrased) "demonstrable measurement of productivity improvement or GTFO". That sort of ante-upping just isn't that nice for good conversation, and certainly not when you're demanding a standard none of us can meet about anything.

Re:Two years of Rust by burntsushi on Tuesday May 16, 2017 @08:36AM (#14349050)
Not sure I buy that. I think you need to go further up the thread chain to see the OP on this[1], which, to be fair to your interpretation, wasn't written by dwaltrip:

> If your language doesn't have a REPL, your language is less productive. Deal with it.

That seems exactly like the kind of claim that everyone should view with a healthy dose of skepticism, and I think zzalpha's initial response[2] hit that right on the nose.

[1] - https://news.ycombinator.com/item?id=14344891

[2] - https://news.ycombinator.com/item?id=14344957

Re:Two years of Rust by zzalpha on Tuesday May 16, 2017 @09:53AM (#14349567)
Eh, here Fowler just falls into to the trap of the Perfect Solution fallacy.

I repeat: there are no perfect measures of productivity. But there are imperfect measures that have some utility. The idea that we cannot measure at all because we cannot measure perfectly is simply untrue.

In this case we could, for example, take 1000 individuals with similar years of programming experience and given them two languages and a non-trivial problem to solve and see how long they take to come to a working and correct solution.

Is that perfect? No. But it's still something that's measurable. Do that with a reasonably large sample and you can probably start making inferences.

Our industry suffers from a horrible lack of concrete, scientific studies to back common wisdom. We would all benefit from ignoring Fowler, here, and getting down to the nuts and bolts of finding solutions to that problem. Until we do, while we'll have lots of fun having pointless debates on HN that cannot be resolved because we have no real data, the industry simply won't move forward.

Re:Two years of Rust by dwaltrip on Monday May 15, 2017 @11:48PM (#14347242)
One example: REPLs can occasionally be a great way to implement​ helper methods or other well isolated functionality. I understand you might argue unit tests are better for this, but I would very strongly disagree they are better in every situation.

Unit tests provide some additional benefits, but are a heavier approach with a slower, clunkier feedback loop. There are times when those additional benefits are not worth the added cost. Unit tests are also additional code that must be maintained.

Re:Two years of Rust by goatlover on Monday May 15, 2017 @05:56PM (#14345495)
Lispers might be able to meet that challenge.
Re:Two years of Rust by nickpsecurity on Monday May 15, 2017 @07:27PM (#14346116)
I could probably have countered it, too, in the same language during the challenge back when I used it. I found the incremental, per-function compilation feature reduced compilation time of most changes to a fraction of a second. Most of time in programming is spent thinking, tweaking, debugging, dealing with 3rd-party libs, etc. I don't think a difference in the source-to-execution part of under 1 second is going to make a big deal.

It's high-speed iteration of code one is exploring that makes both REPL's and incremental compilation superior for productivity to full compilation.

Re:Two years of Rust by mcorbin on Monday May 15, 2017 @06:08PM (#14345580)
Try Clojure.
Re:Two years of Rust by wtetzner on Monday May 15, 2017 @07:31PM (#14346137)
At one point I wrote Clojure for my day job. I think having a REPL is actually more useful for untyped languages, especially Clojure, where most data "types" are maps/lists. By exploring in the REPL, you can get a good feel for what kinds of data a function works with.

In a statically typed language, a REPL can still be useful, but the gains from it are less than you'd get with an untyped language. It's easy to see what kinds of data a function works with by just looking at the types. There are exceptions of course, like when the type is very complicated, it can be helpful to see some examples of actual values of the type. And I suppose that's why languages like Haskell and OCaml have REPLs.

Re:Two years of Rust by fnord123 on Monday May 15, 2017 @07:23PM (#14346093)
That's hardly fair. Clojure is unusable without having a REPL already loaded.

    $ time lein run 
    Hello, World!

    real	0m5.683s
    user	0m5.981s
    sys	0m0.557s
Re:Two years of Rust by zzalpha on Monday May 15, 2017 @06:13PM (#14345623)
I have.

That's not even the beginnings of a useful reply. :)

Give me a highlight of your normal day-to-day with the language. What, exactly, does the REPL offer you that provides significant productivity gains that can't be had any other way?

Because clearly I've missed it.

And it should be pretty easy for you to describe if it's that common and/or obvious.

Re:Two years of Rust by pjmlp on Tuesday May 16, 2017 @02:45AM (#14347816)
I love using a REPL, but I kind of agree with you.

I happen to use more often the IDE's graphical debugger than the REPL.

Still Visual Studio has had immediate mode (aka REPL) since VB days, followed by .NET support.