Thread overview | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 11, 2014 early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
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/ |
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | 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
|
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On 2/10/14, 9:01 PM, deadalnix 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/
>
> As I understand it, you are executing dmd in the background to repl.
> Simple and clever :D
But then how is it saving context?
Andrie
|
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Tuesday, 11 February 2014 at 05:37:45 UTC, Andrei Alexandrescu wrote:
>>
>> As I understand it, you are executing dmd in the background to repl.
>> Simple and clever :D
>
> But then how is it saving context?
>
> Andrie
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.
|
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | 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:
>>>
>>> As I understand it, you are executing dmd in the background to repl.
>>> Simple and clever :D
>>
>> But then how is it saving context?
>>
>> Andrie
>
> 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.
Thats a nifty trick!
|
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to extrawurst | 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:
>> On Tuesday, 11 February 2014 at 05:37:45 UTC, Andrei Alexandrescu wrote:
>>>>
>>>> As I understand it, you are executing dmd in the background to repl.
>>>> Simple and clever :D
>>>
>>> But then how is it saving context?
>>>
>>> Andrie
>>
>> 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.
>
> Thats a nifty trick!
Did I just kill it ?
After playing around the site is not responding anymore :( I am sorry....
|
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | 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. |
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to thedeemon |
> Have you seen Dabble?
> https://github.com/callumenator/dabble
Just 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.
|
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | 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. |
February 11, 2014 Re: early alpha of D REPL | ||||
---|---|---|---|---|
| ||||
Posted in reply to extrawurst | 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 |
Copyright © 1999-2021 by the D Language Foundation