Re: REPL semantics

2018-07-16 Thread aliak00 via Digitalmars-d
On Thursday, 12 July 2018 at 22:17:29 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 21:51:18 UTC, aliak wrote: Cool, is there on going work to sprucing up the D repl in the dlang-community repo or is this a new attempt? Either way if something is happening here then awesome! Ah, that

Re: REPL semantics

2018-07-13 Thread Luís Marques via Digitalmars-d
On Friday, 13 July 2018 at 16:55:27 UTC, Seb wrote: Did you try the Docker image? No, I just ran it on my Ubuntu VM. Is it important that I try? I was just providing feedback that it doesn't seem to run with LDC either.

Re: REPL semantics

2018-07-13 Thread Seb via Digitalmars-d
On Friday, 13 July 2018 at 16:20:03 UTC, Luís Marques wrote: On Friday, 13 July 2018 at 06:22:41 UTC, Jacob Carlborg wrote: On Friday, 13 July 2018 at 02:26:28 UTC, jmh530 wrote: No Windows support. For drepl: "Works on any OS with full shared library support by DMD (currently linux, OSX,

Re: REPL semantics

2018-07-13 Thread Luís Marques via Digitalmars-d
On Friday, 13 July 2018 at 06:27:08 UTC, Jacob Carlborg wrote: Have you considered using LDC and JIT? [1] [2]. Found this [3] snippet as well, not sure what it is. [1] https://github.com/ldc-developers/ldc/pull/2293 [2] https://github.com/ldc-developers/ldc/releases/tag/v1.8.0 (mentions

Re: REPL semantics

2018-07-13 Thread Luís Marques via Digitalmars-d
On Friday, 13 July 2018 at 06:22:41 UTC, Jacob Carlborg wrote: On Friday, 13 July 2018 at 02:26:28 UTC, jmh530 wrote: No Windows support. For drepl: "Works on any OS with full shared library support by DMD (currently linux, OSX, and FreeBSD)." For macOS that means using LDC. It doesn't

Re: REPL semantics

2018-07-13 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 12 July 2018 at 22:17:29 UTC, Luís Marques wrote: Ah, that explains why my clone of drepl didn't compile: it was the Martin Novak's repo, not the D community one. Although on macOS it still doesn't compile, because of the lack of _rt_loadLibrary. Have you considered using LDC

Re: REPL semantics

2018-07-13 Thread Jacob Carlborg via Digitalmars-d
On Friday, 13 July 2018 at 02:26:28 UTC, jmh530 wrote: No Windows support. For drepl: "Works on any OS with full shared library support by DMD (currently linux, OSX, and FreeBSD)." For macOS that means using LDC. -- /Jacob Carlborg

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 22:17:29 UTC, Luís Marques wrote: I actually never tried the existing REPLs, what are your issues with them? No Windows support. For drepl: "Works on any OS with full shared library support by DMD (currently linux, OSX, and FreeBSD)."

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 22:24:19 UTC, Luís Marques wrote: Right. Hopefully there aren't too many weird cases once that is generalized to other corners of the language. I also never used REPLs for major development, only for debugging and minor tests, so I don't have experience with that

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Consider a D REPL session like this: Unlike cling, drepl doesn't seem to support overloading: Welcome to D REPL. D> import std.stdio; std D> void bar(long) { writeln("long"); } bar D> void bar(int) { writeln("int"); } bar D>

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 22:04:39 UTC, jmh530 wrote: I think the mental model of someone coming from a dynamic language would be as if bar is dynamically re-compiled when the foo(int x) is entered. Right. Hopefully there aren't too many weird cases once that is generalized to other

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 21:51:18 UTC, aliak wrote: Cool, is there on going work to sprucing up the D repl in the dlang-community repo or is this a new attempt? Either way if something is happening here then awesome! Ah, that explains why my clone of drepl didn't compile: it was the

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 21:15:46 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 20:33:04 UTC, jmh530 wrote: On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Most REPLs I've used are for languages with dynamic typing. Perhaps take a look at a C REPL and see what it

Re: REPL semantics

2018-07-12 Thread aliak via Digitalmars-d
On Thursday, 12 July 2018 at 21:15:46 UTC, Luís Marques wrote: On Thursday, 12 July 2018 at 20:33:04 UTC, jmh530 wrote: On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Most REPLs I've used are for languages with dynamic typing. Perhaps take a look at a C REPL and see what it

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 20:33:04 UTC, jmh530 wrote: On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Most REPLs I've used are for languages with dynamic typing. Perhaps take a look at a C REPL and see what it does? Well, cling calls the original function: [cling]$ #import

Re: REPL semantics

2018-07-12 Thread jmh530 via Digitalmars-d
On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Consider a D REPL session like this: void bar(long x) { writeln(x); } void foo() { bar(42); } 42 void bar(int) {} Assuming implementation complexity is not an issue, what do you feel is the more natural semantics for a

Re: REPL semantics

2018-07-12 Thread Luís Marques via Digitalmars-d
On Thursday, 12 July 2018 at 19:07:15 UTC, Luís Marques wrote: Assuming implementation complexity is not an issue, what do you feel is the more natural semantics for a REPL? Should foo now call bar(int), or should it still call bar(long)? (feel free to generalize the issue) BTW, this