digitalmars.D.announce - early alpha of D REPL
- Martin Nowak (13/13) Feb 10 2014 Barely running but already fun and a little useful.
- deadalnix (3/16) Feb 10 2014 As I understand it, you are executing dmd in the background to
- Andrei Alexandrescu (3/22) Feb 10 2014 But then how is it saving context?
- Martin Nowak (8/14) Feb 11 2014 It's using shared libraries to do so. Each new deck/stmt/expr is
- extrawurst (2/18) Feb 11 2014 Thats a nifty trick!
- extrawurst (4/25) Feb 11 2014 Did I just kill it ?
- Martin Nowak (4/7) Feb 11 2014 No problem :), it's the most important TODO right now to prevent
- Martin Nowak (4/7) Feb 11 2014 I wish SELinux was simpler, but it isn't. So instead of using a TCP
- =?UTF-8?B?U8O2bmtlIEx1ZHdpZw==?= (4/12) Feb 12 2014 BTW, if you (can) use the latest vibe.d beta version, there is also the
- Martin Nowak (2/5) Feb 12 2014 Nice, will try.
- thedeemon (4/5) Feb 11 2014 Have you seen Dabble?
- thedeemon (6/8) Feb 11 2014 Just found out its author added Linux support. I was able to
- cal (3/11) Feb 11 2014 I don't have a 64-bit tool-chain to play with, could submit those
- thedeemon (5/15) Feb 12 2014 I've just submitted a pull request for compiling dabble repl in
- Martin Nowak (9/13) Feb 12 2014 I will try it again, there is a lot of recent activity.
- cal (4/6) Feb 12 2014 Dabble allows both of these things, if I understand your comment
- The Guest (4/17) Feb 11 2014 http://dpaste.dzfl.pl/1969487a
- deadalnix (6/27) Feb 11 2014 SDC is capable to JIT whatever D it support. That mean you can
- MattCoder (10/11) Feb 12 2014 Interesting!
- Timothee Cour (3/15) Feb 12 2014 already added a bug report in github for that
- MattCoder (5/6) Feb 12 2014 Hmmm I should have checked the "issue list" first!
- Brad Anderson (2/15) Feb 12 2014 I'm kind of amazed how well this works. Awesome.
- Kelet (7/20) Feb 12 2014 Excellent, I've been waiting for this. Even better than I
- John Colvin (3/16) Feb 13 2014 It would be nice if in the online sandbox the window width could
- Martin Nowak (2/4) Feb 21 2014 https://github.com/MartinNowak/drepl/issues/23
- Tourist (2/15) Feb 13 2014 http://i.imgur.com/LNYMNYw.png
- Rory McGuire (2/21) Feb 13 2014
- Tourist (4/29) Feb 14 2014 Looks like you're being sarcastic.
- Martin Nowak (3/4) Feb 16 2014 How about reporting a bug?
- Rory McGuire (4/7) Feb 17 2014 hehe, sorry. I use GMail and your comment was the last comment so I ende...
- Martin Nowak (5/9) Feb 21 2014 Please file bug reports.
- Asman01 (6/19) Feb 13 2014 Very nice! thanks. I tried the following code but it print
- John Colvin (2/25) Feb 14 2014 Drop the semicolon after twice(2)
- Martin Nowak (4/9) Feb 14 2014 Yeah, with a semicolon it's a statement, so it doesn't have any
- cal (5/18) Feb 14 2014 This approach with separate modules is far superior to what I did
- Martin Nowak (5/7) Feb 16 2014 Yes, we'll improve the Windows DLL support.
Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/
Feb 10 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/As I understand it, you are executing dmd in the background to repl. Simple and clever :D
Feb 10 2014
On 2/10/14, 9:01 PM, deadalnix wrote:On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:But then how is it saving context? AndrieBarely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/As I understand it, you are executing dmd in the background to repl. Simple and clever :D
Feb 10 2014
On Tuesday, 11 February 2014 at 05:37:45 UTC, Andrei Alexandrescu wrote:It's using shared libraries to do so. Each new deck/stmt/expr is compiled in a shared library. This library imports and links against all previous libraries to make the context available. I still need to implement a few rewrites, i.e. `auto var = val;` should become `typeof(val) var; shared static this() { var = val; }` too support runtime initialization.As I understand it, you are executing dmd in the background to repl. Simple and clever :DBut then how is it saving context? Andrie
Feb 11 2014
On Tuesday, 11 February 2014 at 08:15:55 UTC, Martin Nowak wrote:On Tuesday, 11 February 2014 at 05:37:45 UTC, Andrei Alexandrescu wrote:Thats a nifty trick!It's using shared libraries to do so. Each new deck/stmt/expr is compiled in a shared library. This library imports and links against all previous libraries to make the context available. I still need to implement a few rewrites, i.e. `auto var = val;` should become `typeof(val) var; shared static this() { var = val; }` too support runtime initialization.As I understand it, you are executing dmd in the background to repl. Simple and clever :DBut then how is it saving context? Andrie
Feb 11 2014
On Tuesday, 11 February 2014 at 08:49:56 UTC, extrawurst wrote:On Tuesday, 11 February 2014 at 08:15:55 UTC, Martin Nowak wrote:Did I just kill it ? After playing around the site is not responding anymore :( I am sorry....On Tuesday, 11 February 2014 at 05:37:45 UTC, Andrei Alexandrescu wrote:Thats a nifty trick!It's using shared libraries to do so. Each new deck/stmt/expr is compiled in a shared library. This library imports and links against all previous libraries to make the context available. I still need to implement a few rewrites, i.e. `auto var = val;` should become `typeof(val) var; shared static this() { var = val; }` too support runtime initialization.As I understand it, you are executing dmd in the background to repl. Simple and clever :DBut then how is it saving context? Andrie
Feb 11 2014
On Tuesday, 11 February 2014 at 08:51:50 UTC, extrawurst wrote:Did I just kill it ? After playing around the site is not responding anymore :( I am sorry....No problem :), it's the most important TODO right now to prevent this. https://github.com/MartinNowak/drepl/blob/master/examples/server.d#L34
Feb 11 2014
On 02/11/2014 04:24 PM, Martin Nowak wrote:I wish SELinux was simpler, but it isn't. So instead of using a TCP socket, I quickfixed this issue by polling non-blocking process pipes https://github.com/MartinNowak/drepl/commit/1aef9acedb4ee4ee7cdcceda56796aba6d460cbe.No problem :), it's the most important TODO right now to prevent this. https://github.com/MartinNowak/drepl/blob/master/examples/server.d#L34
Feb 11 2014
Am 12.02.2014 03:49, schrieb Martin Nowak:On 02/11/2014 04:24 PM, Martin Nowak wrote:BTW, if you (can) use the latest vibe.d beta version, there is also the vibe.core.core.createFileDescriptorEvent function, which should work for waiting on the non-blocking pipes instead of busy-waiting with yield().I wish SELinux was simpler, but it isn't. So instead of using a TCP socket, I quickfixed this issue by polling non-blocking process pipes https://github.com/MartinNowak/drepl/commit/1aef9acedb4ee4ee7cdcceda56796aba6d460cbe.No problem :), it's the most important TODO right now to prevent this. https://github.com/MartinNowak/drepl/blob/master/examples/server.d#L34
Feb 12 2014
On 02/12/2014 10:29 AM, Sönke Ludwig wrote:BTW, if you (can) use the latest vibe.d beta version, there is also the vibe.core.core.createFileDescriptorEvent function, which should work for waiting on the non-blocking pipes instead of busy-waiting with yield().Nice, will try.
Feb 12 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful.Have you seen Dabble? https://github.com/callumenator/dabble It works pretty well on my Win 7.
Feb 11 2014
Have you seen Dabble? https://github.com/callumenator/dabbleJust found out its author added Linux support. I was able to build an x86 version but it didn't work properly in a 64 bit system: it assumes dmd makes x86 binaries by default while it really makes 64-bit ones. And for 64 bits Dabble doesn't compile: as it often happens, it's too easy to forget that array.length is not always uint.
Feb 11 2014
On Tuesday, 11 February 2014 at 11:33:53 UTC, thedeemon wrote:I don't have a 64-bit tool-chain to play with, could submit those 64 bit build errors on github?Have you seen Dabble? https://github.com/callumenator/dabbleJust found out its author added Linux support. I was able to build an x86 version but it didn't work properly in a 64 bit system: it assumes dmd makes x86 binaries by default while it really makes 64-bit ones. And for 64 bits Dabble doesn't compile: as it often happens, it's too easy to forget that array.length is not always uint.
Feb 11 2014
On Wednesday, 12 February 2014 at 04:43:00 UTC, cal wrote:On Tuesday, 11 February 2014 at 11:33:53 UTC, thedeemon wrote:Have you seen Dabble? https://github.com/callumenator/dabbleJust found out its author added Linux support. I was able to build an x86 version but it didn't work properly in a 64 bit system: it assumes dmd makes x86 binaries by default while it really makes 64-bit ones.I don't have a 64-bit tool-chain to play with, could submit those 64 bit build errors on github?I've just submitted a pull request for compiling dabble repl in 64 bits and created an issue on github with the linking problem arising when it tries to work. My diagnosis of the problem might be absolutely wrong though.
Feb 12 2014
On 02/11/2014 11:32 AM, thedeemon wrote:I will try it again, there is a lot of recent activity. Last time it didn't work. https://github.com/callumenator/dabble/issues/1 I think it still misses an essential part. To make a real REPL one has to support importing of modules and linking, otherwise one can only imitate certain language constructs. For example it should be possible to call a function or inherit from a class that were defined earlier.Have you seen Dabble? https://github.com/callumenator/dabble It works pretty well on my Win 7.
Feb 12 2014
On Wednesday, 12 February 2014 at 18:08:11 UTC, Martin Nowak wrote:For example it should be possible to call a function or inherit from a class that were defined earlier.Dabble allows both of these things, if I understand your comment correctly.
Feb 12 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/http://dpaste.dzfl.pl/1969487a Works for me when playing around. Not sure we'll ever see a real D repl.
Feb 11 2014
On Tuesday, 11 February 2014 at 13:11:06 UTC, The Guest wrote:On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:SDC is capable to JIT whatever D it support. That mean you can create a REPL fairly easily. This has been in my TODO list for a while, but supporting more feature is higher priority. Feel free to contact me is that is of interest for you (Martin, please do as well if you think it is worth it).Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/http://dpaste.dzfl.pl/1969487a Works for me when playing around. Not sure we'll ever see a real D repl.
Feb 11 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful.Interesting! I was playing around: D> write("test"); => undefined identifier write D> import std.stdio; => std D> write("test"); D> Shouldn't code above print "test"?
Feb 12 2014
already added a bug report in github for that On Wed, Feb 12, 2014 at 11:56 AM, MattCoder <somekindofmonster email.com.br>wrote:On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful.Interesting! I was playing around: D> write("test"); => undefined identifier write D> import std.stdio; => std D> write("test"); D> Shouldn't code above print "test"?
Feb 12 2014
On Wednesday, 12 February 2014 at 21:07:27 UTC, Timothee Cour wrote:already added a bug report in github for thatHmmm I should have checked the "issue list" first! Thanks for the info, Matheus.
Feb 12 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/I'm kind of amazed how well this works. Awesome.
Feb 12 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/Excellent, I've been waiting for this. Even better than I expected as it has a nice web interface. All of my initial bugs have already been reported. Once this project (or perhaps dabble) is more mature, something like http://tryhaskell.org/ or http://tryruby.org/ may be a good idea.
Feb 12 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/It would be nice if in the online sandbox the window width could be changed.
Feb 13 2014
On 02/13/2014 10:40 AM, John Colvin wrote:It would be nice if in the online sandbox the window width could be changed.https://github.com/MartinNowak/drepl/issues/23
Feb 21 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/http://i.imgur.com/LNYMNYw.png
Feb 13 2014
very cool On Thu, Feb 13, 2014 at 12:27 PM, Tourist <gravatar gravatar.com> wrote:On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/http://i.imgur.com/LNYMNYw.png
Feb 13 2014
On Thursday, 13 February 2014 at 20:18:39 UTC, Rory McGuire wrote:very cool On Thu, Feb 13, 2014 at 12:27 PM, Tourist <gravatar gravatar.com> wrote:Looks like you're being sarcastic. What I meant is that sending comments twice disconnects the server. I can reproduce it every time. Looks like a bug to me.On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/http://i.imgur.com/LNYMNYw.png
Feb 14 2014
On 02/14/2014 03:33 PM, Tourist wrote:I can reproduce it every time. Looks like a bug to me.How about reporting a bug? https://github.com/MartinNowak/drepl/issues
Feb 16 2014
hehe, sorry. I use GMail and your comment was the last comment so I ended up commenting on your comment instead of the announcement. On Fri, Feb 14, 2014 at 4:33 PM, Tourist <gravatar gravatar.com> wrote:Looks like you're being sarcastic. What I meant is that sending comments twice disconnects the server. I can reproduce it every time. Looks like a bug to me.I too could reproduce that bug.
Feb 17 2014
On 02/14/2014 03:33 PM, Tourist wrote:Please file bug reports. https://github.com/MartinNowak/drepl/issues https://github.com/MartinNowak/drepl/commit/7ec687ba342a04bff040630957bb10876d0ebb78 https://github.com/MartinNowak/drepl/commit/3eb953e91b29546a89c222cb4f9e8b9341dc1a47Looks like you're being sarcastic. What I meant is that sending comments twice disconnects the server. I can reproduce it every time. Looks like a bug to me.
Feb 21 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/Very nice! thanks. I tried the following code but it print nothing: auto twice = (int a) => 2*a; twice(2); What's wrong with that?
Feb 13 2014
On Friday, 14 February 2014 at 05:32:12 UTC, Asman01 wrote:On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Drop the semicolon after twice(2)Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/Very nice! thanks. I tried the following code but it print nothing: auto twice = (int a) => 2*a; twice(2); What's wrong with that?
Feb 14 2014
On Friday, 14 February 2014 at 11:58:43 UTC, John Colvin wrote:Yeah, with a semicolon it's a statement, so it doesn't have any result value to print. Without the semicolon it's an expression.auto twice = (int a) => 2*a; twice(2); What's wrong with that?Drop the semicolon after twice(2)
Feb 14 2014
On Tuesday, 11 February 2014 at 04:46:41 UTC, Martin Nowak wrote:Barely running but already fun and a little useful. Example: D> import std.algorithm, std.array, std.file; => std D> auto name(T)(T t) { | return t.name; | } => name D> dirEntries(".", SpanMode.depth).map!name.join(", ") => ./drepl_sandbox D> https://github.com/MartinNowak/drepl http://drepl.dawg.eu/This approach with separate modules is far superior to what I did with dabble, and much simpler. My target was windows initially, where I guess this won't work currently. Hopefully the situation there will improve soon.
Feb 14 2014
On 02/15/2014 12:29 AM, cal wrote:My target was windows initially, where I guess this won't work currently. Hopefully the situation there will improve soon.Yes, we'll improve the Windows DLL support. At some point shared libraries should work equally well on all platforms. I also had a skype call with Benjamin about DIP45 yesterday. http://wiki.dlang.org/DIP45
Feb 16 2014