Jump to page: 1 24  
Page
Thread overview
early alpha of D REPL
Feb 11, 2014
Martin Nowak
Feb 11, 2014
deadalnix
Feb 11, 2014
Martin Nowak
Feb 11, 2014
extrawurst
Feb 11, 2014
extrawurst
Feb 11, 2014
Martin Nowak
Feb 12, 2014
Martin Nowak
Feb 12, 2014
Sönke Ludwig
Feb 12, 2014
Martin Nowak
Feb 11, 2014
thedeemon
Feb 11, 2014
thedeemon
Feb 12, 2014
cal
Feb 12, 2014
thedeemon
Feb 12, 2014
Martin Nowak
Feb 12, 2014
cal
Feb 11, 2014
The Guest
Feb 11, 2014
deadalnix
Feb 12, 2014
MattCoder
Feb 12, 2014
Timothee Cour
Feb 12, 2014
MattCoder
Feb 12, 2014
Brad Anderson
Feb 13, 2014
Kelet
Feb 13, 2014
John Colvin
Feb 21, 2014
Martin Nowak
Feb 13, 2014
Tourist
Feb 13, 2014
Rory McGuire
Feb 14, 2014
Tourist
Feb 16, 2014
Martin Nowak
Feb 17, 2014
Rory McGuire
Feb 21, 2014
Martin Nowak
Feb 14, 2014
Asman01
Feb 14, 2014
John Colvin
Feb 14, 2014
Martin Nowak
Feb 14, 2014
cal
Feb 16, 2014
Martin Nowak
February 11, 2014
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
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
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
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
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
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
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
> 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
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
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
« First   ‹ Prev
1 2 3 4