Jump to page: 1 2
Thread overview
A Mathematician looks at D
Feb 18, 2013
Joshua Niehus
Feb 18, 2013
Joshua Niehus
Feb 19, 2013
Jacob Carlborg
Feb 18, 2013
bearophile
Feb 18, 2013
Nick Sabalausky
Feb 18, 2013
bearophile
Feb 19, 2013
Nick Sabalausky
Feb 19, 2013
FG
Feb 19, 2013
Joshua Niehus
Feb 19, 2013
bearophile
Feb 19, 2013
Paulo Pinto
Feb 20, 2013
so
Feb 19, 2013
Sönke Ludwig
Feb 20, 2013
so
Feb 20, 2013
Paulo Pinto
Feb 20, 2013
so
Feb 20, 2013
Paulo Pinto
Feb 20, 2013
so
February 18, 2013
http://www.reddit.com/r/programming/comments/18r7zk/a_mathematician_looks_at_d/

No "REPL", I guess we are rubbish?
February 18, 2013
Personally I find REPLs super annoying, especially when you need to "import" or "require" something or like to use multiple lines.  Serious how hard is it to just do:

### Ruby
#!/usr/bin/ruby
require "pp"

puts "do stuff"

// D
#!/usr/bin/rdmd
import std.stdio;

void main() {
    writeln("do stuff");
}

then press "Command+b" (Sublime text) and watch it work/fail?

February 18, 2013
Joshua Niehus:

> Serious how hard is it to just do:
> then press "Command+b" (Sublime text) and watch it work/fail?

With a REPL you don't need to repeat the precedent computations every time you add something. You keep building on what you have already done. This saves you time (beside saving you the time of hundreds of compilations).

A REPL is handy when you don't know the correct usage of something: you try something, read the error it gives you, ask for some help to the system, and try again, etc.

A REPL is very handy when you are doing
http://en.wikipedia.org/wiki/Exploratory_programming

If your interactive system also has some cumulative graphics output this is very handy, you can rotate and change plot parameters interactively until you find some good ones (this is possible in Mathematica).

Bye,
bearophile
February 18, 2013
On Mon, 18 Feb 2013 23:37:00 +0100
"bearophile" <bearophileHUGS@lycos.com> wrote:
> 
> A REPL is handy when you don't know the correct usage of something: you try something, read the error it gives you, ask for some help to the system, and try again, etc.

I can do that just as easily without a REPL.

> 
> If your interactive system also has some cumulative graphics output this is very handy, you can rotate and change plot parameters interactively until you find some good ones (this is possible in Mathematica).
> 

This, however, is certainly not a bad benefit of REPL.
February 18, 2013
Nick Sabalausky:

> I can do that just as easily without a REPL.

With a much reduced interactivity and more slowly.

In Python you have full run-time introspection available from the REPL. You have commands like dir() and help(). Plus the error messages. If you are using iPython or a graphical shell things gets even better. Combined with the time you save not compiling & running your whole proggy again, it allows you a different flow of work. And when you do exploratory programming such saved time is important, because it helps you to not lose your current train of thoughts.

Most exploratory mathematics systems have a REPL, because for some people and for some kinds of problems, it's much better to have it. It's not for everyone nor for every kind problem.

Bye,
bearophile
February 19, 2013
On Tue, 19 Feb 2013 00:55:44 +0100
"bearophile" <bearophileHUGS@lycos.com> wrote:

> Nick Sabalausky:
> 
> > I can do that just as easily without a REPL.
> 
> With a much reduced interactivity and more slowly.
> 

Slightly so. I wouldn't say "much".

But of course, I'm not saying that a REPL wouldn't be nice to have. Just saying that "edit, re-compile/run" really isn't all *that* bad.

February 19, 2013
On Monday, 18 February 2013 at 23:55:46 UTC, bearophile wrote:
> Most exploratory mathematics systems have a REPL, because for some people and for some kinds of problems, it's much better to have it. It's not for everyone nor for every kind problem.

I'll take your word for it, in my narrow experience, I've found REPLs slow me down.
And as for graphing math problems, I found MatLab, Mathematica or even OSX's "Grapher" to be sufficient for my usages (when I was a student).

In any event, I wouldn't consider a language "rubbish" because it doesn't have a REPL.

February 19, 2013
Joshua Niehus:

> I'll take your word for it, in my narrow experience, I've found REPLs slow me down.

Thankfully in most cases you are not forced to use it. I have met several persons that don't like to use a REPL, for unknown reasons. Different persons have a brain shaped in different ways.

And for some kind of problems it's not so good. So it's not for everyone everytime.

But from the presence of a REPL in many languages (Python, Ruby, C, Haskell, Scala, Lisp-like languages, and so on) and in most mathematics systems, clearly it's appreciated by some others.

Bye,
bearophile
February 19, 2013
On 2013-02-18 23:13, Joshua Niehus wrote:
> Personally I find REPLs super annoying, especially when you need to
> "import" or "require" something or like to use multiple lines.  Serious
> how hard is it to just do:
>
> ### Ruby
> #!/usr/bin/ruby
> require "pp"
>
> puts "do stuff"
>
> // D
> #!/usr/bin/rdmd
> import std.stdio;
>
> void main() {
>      writeln("do stuff");
> }
>
> then press "Command+b" (Sublime text) and watch it work/fail?

In general I agree with you. But since I've found the Pry REPL for Ruby I'm pretty sold on it:

http://pryrepl.org/

Scroll down to the features list below the screencast.

-- 
/Jacob Carlborg
February 19, 2013
On 2013-02-19 01:28, Nick Sabalausky wrote:
>>> I can do that just as easily without a REPL.
>>
>> With a much reduced interactivity and more slowly.
>>
>
> Slightly so. I wouldn't say "much".
>
> But of course, I'm not saying that a REPL wouldn't be nice to have.
> Just saying that "edit, re-compile/run" really isn't all *that* bad.

If you're processing a significant data set in an exploratory way, with many intermediate calculations, then Python with gluplot or whatever beats the productivity of edit-compile-run. As another example of interactive vs. recompiled approach, I'm fine with using TeX for writing - it is quite comfortable even without seeing final formatting when writing (or thanks to that) - but making graphics in it using PGF/TikZ instead of an interactive illustration program becomes rather painful and is the example of much reduced interactivity and speed.

Edit-compile-run way would be quite good (assuming a very fast compiler) if processing blocks could be added incrementally and state from the previous runs could be _easily_ restored in the next one. Then the difference between a scripting language and a compiled one would be blurred.

Coming back to the TeX example. It's a fast typesetting system - can compile some books in under a second (up to a few seconds if using XeLaTeX and TTF fonts). Yet it's way to slow for testing many small changes or generating documents like invoices en masse. It would make a great invoicing system if it was possible to save the state of it using an empty document and all necessary packages loaded and then only restore that and add the body on each run.

« First   ‹ Prev
1 2