digitalmars.D - D repl
- cal (10/10) Jun 25 2013 I uploaded a small demo of a D repl i've been playing with, might
- Tyro[17] (17/27) Jun 25 2013 cal... thank you for working on and posting this. I could definitely
- cal (5/8) Jun 25 2013 I think a better solution IMO is to hook up a D front-end to
- bearophile (39/39) Jun 26 2013 It looks very nice. I like the interactive shell in Python and
- =?UTF-8?B?U8O2bmtlIEx1ZHdpZw==?= (14/18) Jun 26 2013 not a property fail
- bearophile (10/15) Jun 26 2013 I have installed it right to try the D repl. I have installed the
- cal (8/19) Jun 26 2013 No, when it first compiles a user-defined type, the repl
- bearophile (6/8) Jun 26 2013 I am using dmd, and I compile it almost daily. I suspect it's not
- cal (4/12) Jun 26 2013 With dmd built from git-head I can reproduce this. It will take a
- David (3/15) Jun 26 2013 This is really cool.
- bearophile (12/13) Jun 30 2013 In past I have seen D repls, they come and then they fade away,
- MattCoder (3/16) Jun 30 2013 +1
- SomeDude (5/18) Jun 30 2013 It's cool, but it's yet another tool to maintain. Thus their lack
- bearophile (9/13) Jun 30 2013 I understand and I agree, thank you for putting me back on the
- SomeDude (6/19) Jun 30 2013 Sorry for that. ;)
- deadalnix (2/23) Jun 30 2013 Compiler as a library, usual rant, no need to repeat.
- Jacob Carlborg (4/5) Jun 30 2013 Agree.
- David (3/17) Jun 30 2013 Crazy idea... CTFE is basically done with a D interpreter isn't it?
- bearophile (7/10) Jun 30 2013 In a REPL you want persistent state too. CTFE deletes its state
- Dicebot (2/4) Jun 30 2013 Can you link his comment? That sounds weird.
- bearophile (11/12) Jun 30 2013 It was years ago, maybe more than three years ago. It's not easy
- Dicebot (6/11) Jun 30 2013 Well, at least point about testing does not really matter anymore
- Daniel Murphy (4/13) Jul 01 2013 Things have changed a lot since 2009. This is definitely the way things...
- David (3/10) Jun 30 2013 Yeah I know, but having a complete D interpreter as basis, this
I uploaded a small demo of a D repl i've been playing with, might be of some interest. It's not a robust bit of code, and is not my idea of a proper repl, but shows some possibilities. The video shows the repl running as a web server (using vibe) with a browser client which adds some pretty. Video is at: http://youtu.be/6Ycr4N1jb_g Code is at: https://github.com/callumenator/dabble Note: the repl is windows only, as it uses Dll's and some custom loading code. When full dynamic loading support comes along, i guess it could run under linux, and probably be a bit more stable.
Jun 25 2013
On 6/25/13 10:47 PM, cal wrote:I uploaded a small demo of a D repl i've been playing with, might be of some interest. It's not a robust bit of code, and is not my idea of a proper repl, but shows some possibilities. The video shows the repl running as a web server (using vibe) with a browser client which adds some pretty. Video is at: http://youtu.be/6Ycr4N1jb_g Code is at: https://github.com/callumenator/dabble Note: the repl is windows only, as it uses Dll's and some custom loading code. When full dynamic loading support comes along, i guess it could run under linux, and probably be a bit more stable.cal... thank you for working on and posting this. I could definitely using something like this to get more understanding of what goes on under the hood. Unfortunately I made a switch to *nix OSes (MAC OSX and and more recently Ubuntu) back in 2011 and have never looked back. Can't wait for *nix support to be implemented. You suggest that it is not your idea of a proper repl. Is there plans of returning to the drawing board to develop that idea from scratch? Eagerly, -- Andrew Edwards -------------------- http://www.akeron.co auto getAddress() { string location = " ", period = "."; return ("info" ~ location ~ "afidem" ~ period ~ "org"); }
Jun 25 2013
On Wednesday, 26 June 2013 at 04:29:31 UTC, Tyro[17] wrote:You suggest that it is not your idea of a proper repl. Is there plans of returning to the drawing board to develop that idea from scratch?I think a better solution IMO is to hook up a D front-end to LLVM's jit compiler, but I don't have any plans to do this. The method I used (compiling to Dll's and stuff) was simply the most expedient for me, I just wanted to see if it could work.
Jun 25 2013
It looks very nice. I like the interactive shell in Python and Haskell. Even languages like Scala enjoy it. The importance of a good REPL can't be underestimated. I'd like a good repl in the standard D distribution (despite the installation with dub is easy). Notes: - Regarding the input and output lines, I suggest to take a look at Mathematica and Sage. I think it's better to give numbers only to the inputs (or separate numbers to inputs and outputs), and to denote inputs and outputs differently. So there's no need for the "=>". - print stringNums: very nice. - .map!(a => a.to!string) and .map!(a => S(a)) can also be written like this: import std.stdio, std.algorithm, std.range, std.conv; void main() { 10.iota.map!text.writeln; static struct S { int x; } 10.iota.map!S.writeln; } - is type x the same as print typeof(x) ? - line 29: foreach that prints the last result of the iteration: it's interesting. I have followed the instructions: git clone https://github.com/callumenator/dabble cd dabble dub build --config=console But the compilation stops with the errors: Running dmd (compile)... ...\dub\packages\pegged-master\pegged\dynamic\grammar.d(245): Error: not a property eps ...\dub\packages\pegged-master\pegged\dynamic\grammar.d(418): Error: not a property fail I think DUB should print _where_ it copies files, and it should use a less hard to find place to stores them. (An optional idea is to store inside the directory of dub a link to the directory where dub stores those files). Bye, bearophile
Jun 26 2013
Am 26.06.2013 14:19, schrieb bearophile:Running dmd (compile)... ...\dub\packages\pegged-master\pegged\dynamic\grammar.d(245): Error:not a property eps...\dub\packages\pegged-master\pegged\dynamic\grammar.d(418): Error:not a property fail Do you have the latest version of DUB installed? It looks like -property was specified on the compiler command line (checkable with "dub -v"). This was removed recently after Jonathan convinced me that it is worthless to support, since all recent property related DIPs make parenthesis optional and it seems pretty clear that this will be the way forward.I think DUB should print _where_ it copies files, and it should use aless hard to find place to stores them. (An optional idea is to store inside the directory of dub a link to the directory where dub stores those files). I agree. You can look it up using "dub list-installed", but it should also print that at installation time.
Jun 26 2013
Sönke Ludwig:Do you have the latest version of DUB installed?I have installed it right to try the D repl. I have installed the latest Windows version here, precompiled binaries (I think that it's better to show only the latest versions in a table, and all the older versions in a different and less visible table): http://registry.vibed.org/downloadThis was removed recently after Jonathan convinced me that it is worthless to support, since all recent property related DIPs make parenthesis optional and it seems pretty clear that this will be the way forward.I have stopped compiling my code with -property since some months, despite as Jonathan I kind of liked it :-) Bye, bearophile
Jun 26 2013
On Wednesday, 26 June 2013 at 12:19:35 UTC, bearophile wrote:- is type x the same as print typeof(x) ?No, when it first compiles a user-defined type, the repl recursively maps out the type's structure. It does this to allow using 'print/type' without needing to do a compile, since these are done fairly often.I have followed the instructions: git clone https://github.com/callumenator/dabble cd dabble dub build --config=console But the compilation stops with the errors: Running dmd (compile)... ...\dub\packages\pegged-master\pegged\dynamic\grammar.d(245): Error: not a property eps ...\dub\packages\pegged-master\pegged\dynamic\grammar.d(418): Error: not a property failWhat compiler version are you using? I'm not seeing any problems with 2.063, I haven't tried a more recent version yet. Thanks for comments!
Jun 26 2013
cal:What compiler version are you using? I'm not seeing any problems with 2.063, I haven't tried a more recent version yet.I am using dmd, and I compile it almost daily. I suspect it's not a matter of compiler version, but it's a matter of dub using or not using -property in compiling code. Bye, bearophile
Jun 26 2013
On Thursday, 27 June 2013 at 00:13:29 UTC, bearophile wrote:cal:With dmd built from git-head I can reproduce this. It will take a little while to resolve, and push this to Pegged master. DMD 2.063 release works ok in the meantime.What compiler version are you using? I'm not seeing any problems with 2.063, I haven't tried a more recent version yet.I am using dmd, and I compile it almost daily. I suspect it's not a matter of compiler version, but it's a matter of dub using or not using -property in compiling code. Bye, bearophile
Jun 26 2013
Am 26.06.2013 04:47, schrieb cal:I uploaded a small demo of a D repl i've been playing with, might be of some interest. It's not a robust bit of code, and is not my idea of a proper repl, but shows some possibilities. The video shows the repl running as a web server (using vibe) with a browser client which adds some pretty. Video is at: http://youtu.be/6Ycr4N1jb_g Code is at: https://github.com/callumenator/dabble Note: the repl is windows only, as it uses Dll's and some custom loading code. When full dynamic loading support comes along, i guess it could run under linux, and probably be a bit more stable.This is really cool. Nothing more to say!
Jun 26 2013
cal:I uploaded a small demo of a D repl i've been playing with,In past I have seen D repls, they come and then they fade away, regardless how much work they have required to be created, or how much refined they are. The fact they have appeared more than once shows some persons desire them. Yet, I see no comments from Walter or Andrei. I think a repl needs to be inside the standard D distribution, it's not an external toy meant to be forgotten, it's one essential tool for D development, like a profiler, debugger, or rdmd :-) Bye, bearophile
Jun 30 2013
On Sunday, 30 June 2013 at 13:31:02 UTC, bearophile wrote:cal:+1 Matheus.I uploaded a small demo of a D repl i've been playing with,In past I have seen D repls, they come and then they fade away, regardless how much work they have required to be created, or how much refined they are. The fact they have appeared more than once shows some persons desire them. Yet, I see no comments from Walter or Andrei. I think a repl needs to be inside the standard D distribution, it's not an external toy meant to be forgotten, it's one essential tool for D development, like a profiler, debugger, or rdmd :-) Bye, bearophile
Jun 30 2013
On Sunday, 30 June 2013 at 13:31:02 UTC, bearophile wrote:cal:It's cool, but it's yet another tool to maintain. Thus their lack of enthusiasm I guess. Unless someone comes forward and is ready to maintain the repl, in which case I think everyone would applaud.I uploaded a small demo of a D repl i've been playing with,In past I have seen D repls, they come and then they fade away, regardless how much work they have required to be created, or how much refined they are. The fact they have appeared more than once shows some persons desire them. Yet, I see no comments from Walter or Andrei. I think a repl needs to be inside the standard D distribution, it's not an external toy meant to be forgotten, it's one essential tool for D development, like a profiler, debugger, or rdmd :-) Bye, bearophile
Jun 30 2013
SomeDude:It's cool, but it's yet another tool to maintain. Thus their lack of enthusiasm I guess. Unless someone comes forward and is ready to maintain the repl, in which case I think everyone would applaud.I understand and I agree, thank you for putting me back on the ground. Also, I remember that today they add things to the Python standard library only when they are already widely used (unless they are created by people like Hettinger). So maybe it's better to see one D repl used a lot in the wild a lot, and only then add it to the standard distribution. Bye, bearophile
Jun 30 2013
On Sunday, 30 June 2013 at 15:35:11 UTC, bearophile wrote:SomeDude:Sorry for that. ;) I just saw the video and it looks really awesome indeed. Also, I remember that today they add things to theIt's cool, but it's yet another tool to maintain. Thus their lack of enthusiasm I guess. Unless someone comes forward and is ready to maintain the repl, in which case I think everyone would applaud.I understand and I agree, thank you for putting me back on the ground.Python standard library only when they are already widely used (unless they are created by people like Hettinger). So maybe it's better to see one D repl used a lot in the wild a lot, and only then add it to the standard distribution. Bye, bearophileYeah, it probably needs a little testing before being included once for all.
Jun 30 2013
On Sunday, 30 June 2013 at 15:31:19 UTC, SomeDude wrote:On Sunday, 30 June 2013 at 13:31:02 UTC, bearophile wrote:Compiler as a library, usual rant, no need to repeat.cal:It's cool, but it's yet another tool to maintain. Thus their lack of enthusiasm I guess. Unless someone comes forward and is ready to maintain the repl, in which case I think everyone would applaud.I uploaded a small demo of a D repl i've been playing with,In past I have seen D repls, they come and then they fade away, regardless how much work they have required to be created, or how much refined they are. The fact they have appeared more than once shows some persons desire them. Yet, I see no comments from Walter or Andrei. I think a repl needs to be inside the standard D distribution, it's not an external toy meant to be forgotten, it's one essential tool for D development, like a profiler, debugger, or rdmd :-) Bye, bearophile
Jun 30 2013
On 2013-06-30 20:00, deadalnix wrote:Compiler as a library, usual rant, no need to repeat.Agree. -- /Jacob Carlborg
Jun 30 2013
Am 30.06.2013 15:31, schrieb bearophile:cal:Crazy idea... CTFE is basically done with a D interpreter isn't it? Can't this be used as library to implement a REPL?I uploaded a small demo of a D repl i've been playing with,In past I have seen D repls, they come and then they fade away, regardless how much work they have required to be created, or how much refined they are. The fact they have appeared more than once shows some persons desire them. Yet, I see no comments from Walter or Andrei. I think a repl needs to be inside the standard D distribution, it's not an external toy meant to be forgotten, it's one essential tool for D development, like a profiler, debugger, or rdmd :-) Bye, bearophile
Jun 30 2013
David:Crazy idea... CTFE is basically done with a D interpreter isn't it? Can't this be used as library to implement a REPL?In a REPL you want persistent state too. CTFE deletes its state once it's done. And in a past request of mine I've seen that Walter is against Bye, bearophile
Jun 30 2013
On Sunday, 30 June 2013 at 16:36:42 UTC, bearophile wrote:And in a past request of mine I've seen that Walter is againstCan you link his comment? That sounds weird.
Jun 30 2013
Dicebot:Can you link his comment? That sounds weird.It was years ago, maybe more than three years ago. It's not easy to find. I have found discussions about this topic, but not comments from Walter: http://www.digitalmars.com/d/archives/digitalmars/D/D_Compiler_as_a_Library_164027.html http://www.digitalmars.com/d/archives/digitalmars/D/Compiler_as_a_service_in_C_4.0_104405.html Later I have found this (from 2009), where Walter gives me an answer, about D compiler as a DLL: http://www.digitalmars.com/d/archives/digitalmars/D/Compiler_as_dll_82715.html Bye, bearophile
Jun 30 2013
Well, at least point about testing does not really matter anymore - it is automated ;) I wonder what Walter does think about it now - libclang has pretty much proven how awesome compiler front-end as library can be. Was one of main reasons for me to switch from gcc for daily C++ stuff. On Sunday, 30 June 2013 at 16:59:12 UTC, bearophile wrote:Later I have found this (from 2009), where Walter gives me an answer, about D compiler as a DLL: http://www.digitalmars.com/d/archives/digitalmars/D/Compiler_as_dll_82715.html Bye, bearophile
Jun 30 2013
"bearophile" <bearophileHUGS lycos.com> wrote in message news:aknmrnhodledtmfyphwd forum.dlang.org...Dicebot:Things have changed a lot since 2009. This is definitely the way things are headed. First step: port the compiler to D.Can you link his comment? That sounds weird.It was years ago, maybe more than three years ago. It's not easy to find. I have found discussions about this topic, but not comments from Walter: http://www.digitalmars.com/d/archives/digitalmars/D/D_Compiler_as_a_Library_164027.html http://www.digitalmars.com/d/archives/digitalmars/D/Compiler_as_a_service_in_C_4.0_104405.html Later I have found this (from 2009), where Walter gives me an answer, about D compiler as a DLL: http://www.digitalmars.com/d/archives/digitalmars/D/Compiler_as_dll_82715.html
Jul 01 2013
Am 30.06.2013 18:36, schrieb bearophile:David:Yeah I know, but having a complete D interpreter as basis, this shouldn't be too hard to implement.Crazy idea... CTFE is basically done with a D interpreter isn't it? Can't this be used as library to implement a REPL?In a REPL you want persistent state too. CTFE deletes its state once it's done.
Jun 30 2013