Thread overview | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 26, 2013 D repl | ||||
---|---|---|---|---|
| ||||
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. |
June 26, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to cal | 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"); } |
June 26, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tyro[17] | 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.
|
June 26, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to cal | 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 |
June 26, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | 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 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). I agree. You can look it up using "dub list-installed", but it should also print that at installation time. |
June 26, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sönke Ludwig | 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/download > 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 have stopped compiling my code with -property since some months, despite as Jonathan I kind of liked it :-) Bye, bearophile |
June 26, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | 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 fail > What 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! |
June 27, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to cal | 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!
|
June 27, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to cal | 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
|
June 27, 2013 Re: D repl | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Thursday, 27 June 2013 at 00:13:29 UTC, bearophile wrote:
> 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
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.
|
Copyright © 1999-2021 by the D Language Foundation