Re: Many documentation examples can now be run online

2016-12-19 Thread Seb via Digitalmars-d-announce

On Tuesday, 20 December 2016 at 02:25:06 UTC, Joakim wrote:
When all tests pass, would be better if it said that, rather 
than "No output," which it says now.


Excellent idea -> https://github.com/dlang/dlang.org/pull/1527 :)




Re: Many documentation examples can now be run online

2016-12-19 Thread Seb via Digitalmars-d-announce

On Tuesday, 20 December 2016 at 06:16:23 UTC, Timothee Cour wrote:

is it properly sandboxed / hacking proof?

quick tests:

```
import std.process;
auto msg="sleep 10";
executeShell(msg).output.writeln;
```

 correctly results in `Application output (9: Killed)`

"ls -al .."  => permission denied

"ls /usr/bin/ld" => -rwxr-xr-x 2 0 0 834648 Jan  3  2013 
/usr/bin/ld


"ps -auwx" => ...



It uses DPaste (https://dpaste.dzfl.pl/) as backend - in fact I 
tried to re-use most of the code for the example snippet on 
dlang.org


Re: Many documentation examples can now be run online

2016-12-19 Thread Seb via Digitalmars-d-announce

On Tuesday, 20 December 2016 at 01:34:30 UTC, Soulsbane wrote:
On Monday, 19 December 2016 at 19:11:26 UTC, Picaud Vincent 
wrote:
On Monday, 19 December 2016 at 18:54:56 UTC, Jakub Szewczyk 
wrote:


It looks great, but I think that the source code should not 
be hidden when pressing the Run button, instead the 
application output box should appear above/below the source 
code :-)


+1

Otherwise that is great!


+1 also.


Thanks a lot for your feedback! This will hopefully soon be 
online:


https://github.com/dlang/dlang.org/pull/1527


Re: Many documentation examples can now be run online

2016-12-19 Thread Timothee Cour via Digitalmars-d-announce
is it properly sandboxed / hacking proof?

quick tests:

```
import std.process;
auto msg="sleep 10";
executeShell(msg).output.writeln;
```

 correctly results in `Application output (9: Killed)`

"ls -al .."  => permission denied

"ls /usr/bin/ld" => -rwxr-xr-x 2 0 0 834648 Jan  3  2013 /usr/bin/ld

"ps -auwx" => ...



On Mon, Dec 19, 2016 at 6:25 PM, Joakim via Digitalmars-d-announce <
digitalmars-d-announce@puremagic.com> wrote:

> On Monday, 19 December 2016 at 17:50:17 UTC, Seb wrote:
>
>> On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu wrote:
>>
>>> Take a look e.g. at https://dlang.org/phobos-prere
>>> lease/std_algorithm_iteration.html. Examples now have "Edit" and "Run"
>>> buttons that allow you to play with them online and see what they output.
>>> Changes for the ddox version forthcoming.
>>>
>>> Related: https://github.com/dlang/dlang.org/pull/1297,
>>> https://issues.dlang.org/show_bug.cgi?id=16984,
>>> https://issues.dlang.org/show_bug.cgi?id=16985.
>>>
>>> Many thanks to Sebastian Wilzbach who took this to completion, and to
>>> Damian Ziemba for working on the online compiler code!
>>>
>>>
>>> Andrei
>>>
>>
>> I would like to add that this is in an experimental/testing stage and
>> hopefully will get stable with the next release ;-)
>>
>
> When all tests pass, would be better if it said that, rather than "No
> output," which it says now.
>


Re: [your donation here]

2016-12-19 Thread Andrei Alexandrescu via Digitalmars-d-announce

On 12/19/2016 09:26 PM, Joakim wrote:

On Monday, 19 December 2016 at 19:39:25 UTC, Andrei Alexandrescu wrote:

The D Language has had a great year! Among the many highlights, we are
very proud to offer scholarships to four exceptional graduate students
(https://dlang.org/blog/2016/12/05/the-d-language-foundations-scholarship-program/).
With your help, more great graduate students could pursue research in
Computer Science and Engineering.

[...]


Would be worthwhile to add a Bitcoin address too, lot of techies have it
and easy to use.


Thanks, I've opened a discussion internally. -- Andrei


Re: [your donation here]

2016-12-19 Thread Joakim via Digitalmars-d-announce
On Monday, 19 December 2016 at 19:39:25 UTC, Andrei Alexandrescu 
wrote:
The D Language has had a great year! Among the many highlights, 
we are very proud to offer scholarships to four exceptional 
graduate students 
(https://dlang.org/blog/2016/12/05/the-d-language-foundations-scholarship-program/). With your help, more great graduate students could pursue research in Computer Science and Engineering.


[...]


Would be worthwhile to add a Bitcoin address too, lot of techies 
have it and easy to use.


Re: Many documentation examples can now be run online

2016-12-19 Thread Joakim via Digitalmars-d-announce

On Monday, 19 December 2016 at 17:50:17 UTC, Seb wrote:
On Monday, 19 December 2016 at 17:44:29 UTC, Andrei 
Alexandrescu wrote:
Take a look e.g. at 
https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming.


Related: https://github.com/dlang/dlang.org/pull/1297, 
https://issues.dlang.org/show_bug.cgi?id=16984, 
https://issues.dlang.org/show_bug.cgi?id=16985.


Many thanks to Sebastian Wilzbach who took this to completion, 
and to Damian Ziemba for working on the online compiler code!



Andrei


I would like to add that this is in an experimental/testing 
stage and hopefully will get stable with the next release ;-)


When all tests pass, would be better if it said that, rather than 
"No output," which it says now.


Re: Many documentation examples can now be run online

2016-12-19 Thread Soulsbane via Digitalmars-d-announce

On Monday, 19 December 2016 at 19:11:26 UTC, Picaud Vincent wrote:
On Monday, 19 December 2016 at 18:54:56 UTC, Jakub Szewczyk 
wrote:


It looks great, but I think that the source code should not be 
hidden when pressing the Run button, instead the application 
output box should appear above/below the source code :-)


+1

Otherwise that is great!


+1 also.


Re: Linker-hacking out the D runtime

2016-12-19 Thread Iain Buclaw via Digitalmars-d-announce
On 19 December 2016 at 12:41, Mike via Digitalmars-d-announce
 wrote:
> On Sunday, 18 December 2016 at 12:57:08 UTC, Iain Buclaw wrote:
>>
>> On 18 December 2016 at 03:37, Mike via Digitalmars-d-announce
>>  wrote:
>>>
>>> On Sunday, 18 December 2016 at 00:04:54 UTC, sarn wrote:
>>>
 I thought I'd write something up to help other people experiment with
 this
 stuff:
 https://theartofmachinery.com/2016/12/18/d_without_runtime.html
>>>
>>>
>>>
>>> Thanks for this.
>>>
>>> I abandoned D sometime ago largely because of
>>> https://issues.dlang.org/show_bug.cgi?id=14758 (but there were other
>>> reasons), so your blog post is interesting to me.  It is unfortunate that we
>>> have to resort to such hackery, but its nice to have such tools at our
>>> disposal regardless.
>>>
>>
>> As a response to my last message in that thread, the changes for classinfo
>> generation is now ready to go in master.
>
>
> Just built GDC from the gdc-6 branch.  The commit history says master was
> merged in 24 hours ago, so I'm assuming your ClassInfo changes are there.
>
> Anyway the build produces the same result:  TypeInfo strings for each an
> every type in the .rodata section.  The binary should be about 6K, but is
> instead about 600K.  Perhaps I'll try again at a later date.
>
> Mike
>
>

Yeah, I'm just wrapping up the last touches, PR will land for master
in days, or tonight maybe...

May be a delay before it gets merged into the gdc-6 branch.


Re: Linker-hacking out the D runtime

2016-12-19 Thread Iain Buclaw via Digitalmars-d-announce
On 19 December 2016 at 01:36, Mike via Digitalmars-d-announce
 wrote:
> On Sunday, 18 December 2016 at 12:57:08 UTC, Iain Buclaw wrote:
>
>> As a response to my last message in that thread, the changes for classinfo
>> generation is now ready to go in master.
>
>
> Ok, I'll give it a test in the next week or so.
>
>> However I already have ideas for future implementation that is not so
>> naive when it comes to looking up fields to assign data.  How does a kind of
>> tagging system sound?
>>
>> i.e:
>>
>> class TypeInfo_Class
>> {
>> @name
>> string classname;
>>
>> @init
>> byte[] initializer;
>> }
>
>
> I'm assuming this idea addresses the issue with porting druntime and leaving
> some features unimplemented.  If I understand your intention, this looks
> akin to Rust's Lang Items feature
> (https://doc.rust-lang.org/book/lang-items.html).  Please correct me if I'm
> wrong.
>

Heh, I've never looked into Rust, so I didn't know that.  But in a
way, yes, it is quite similar.

> I'm not sure what you're envisioning here, so I'd like to hear more.  Would
> the user get compile-time errors if they used a D feature that required a
> druntime implementation, but the implementation did not exist?
>
> Mike
>

The compiler doesn't actually generate any code that peeks inside
TypeInfo.  It only generates the reference to the right typeinfo to
pass to library runtime functions -  or on request via typeid().  It
doesn't actually care about the data stored inside.  And that's the
angle I've taken when laying out the actual data - if you provide the
fields we want to populate, then we'll populate them.  If you omit a
few, then the compiler won't bother with them.  Because at the end of
the day, it's druntime library that uses and makes sense of the
TypeInfo data provided.  The compile just says: "Well, this is as much
as I'm willing to tell you about the type."

Iain


[your donation here]

2016-12-19 Thread Andrei Alexandrescu via Digitalmars-d-announce
The D Language has had a great year! Among the many highlights, we are 
very proud to offer scholarships to four exceptional graduate students 
(https://dlang.org/blog/2016/12/05/the-d-language-foundations-scholarship-program/). 
With your help, more great graduate students could pursue research in 
Computer Science and Engineering.


Please consider making a personal donation, and also bring the word to 
the responsible people at your employer. We have no overheads and no 
conflict of interest because all of our officers are unpaid volunteers. 
So every $5 you donate go straight to one hour of scholarship! Use 
paypal safely and securely. We will provide you with a thank you letter 
that you can use for tax (and bragging) purposes. Many thanks to 
Sebastian Wilzbach who has put together this campaign.


https://dlang.org/donate.html


Thanks,

Andrei


Re: Many documentation examples can now be run online

2016-12-19 Thread Picaud Vincent via Digitalmars-d-announce

On Monday, 19 December 2016 at 18:54:56 UTC, Jakub Szewczyk wrote:

It looks great, but I think that the source code should not be 
hidden when pressing the Run button, instead the application 
output box should appear above/below the source code :-)


+1

Otherwise that is great!


Re: Many documentation examples can now be run online

2016-12-19 Thread unDEFER via Digitalmars-d-announce

Excellent work, thank you!


Re: Many documentation examples can now be run online

2016-12-19 Thread Jakub Szewczyk via Digitalmars-d-announce
On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu 
wrote:
Take a look e.g. at 
https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming.


Related: https://github.com/dlang/dlang.org/pull/1297, 
https://issues.dlang.org/show_bug.cgi?id=16984, 
https://issues.dlang.org/show_bug.cgi?id=16985.


Many thanks to Sebastian Wilzbach who took this to completion, 
and to Damian Ziemba for working on the online compiler code!



Andrei


It looks great, but I think that the source code should not be 
hidden when pressing the Run button, instead the application 
output box should appear above/below the source code :-)


Re: Many documentation examples can now be run online

2016-12-19 Thread Seb via Digitalmars-d-announce
On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu 
wrote:
Take a look e.g. at 
https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming.


Related: https://github.com/dlang/dlang.org/pull/1297, 
https://issues.dlang.org/show_bug.cgi?id=16984, 
https://issues.dlang.org/show_bug.cgi?id=16985.


Many thanks to Sebastian Wilzbach who took this to completion, 
and to Damian Ziemba for working on the online compiler code!



Andrei


I would like to add that this is in an experimental/testing stage 
and hopefully will get stable with the next release ;-)


Many documentation examples can now be run online

2016-12-19 Thread Andrei Alexandrescu via Digitalmars-d-announce
Take a look e.g. at 
https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. 
Examples now have "Edit" and "Run" buttons that allow you to play with 
them online and see what they output. Changes for the ddox version 
forthcoming.


Related: https://github.com/dlang/dlang.org/pull/1297, 
https://issues.dlang.org/show_bug.cgi?id=16984, 
https://issues.dlang.org/show_bug.cgi?id=16985.


Many thanks to Sebastian Wilzbach who took this to completion, and to 
Damian Ziemba for working on the online compiler code!



Andrei


Re: concepts v0.0.1

2016-12-19 Thread Atila Neves via Digitalmars-d-announce
On Saturday, 17 December 2016 at 04:00:32 UTC, Nicholas Wilson 
wrote:
On Friday, 16 December 2016 at 23:49:18 UTC, Nicholas Wilson 
wrote:

On Friday, 16 December 2016 at 20:51:19 UTC, Atila Neves wrote:

@models!(Foo, isFoo)



What happened to the __UDA_ATTACHMENT__ proposal?


Nothing AFAIK.



Also are UDAs legal after the symbol? i.e. with 
__UDA_ATTACHMENT__ could you do struct Foo @models!isFoo

{
void foo();
}

 ?


Nope.




Re: concepts v0.0.1

2016-12-19 Thread Atila Neves via Digitalmars-d-announce
On Saturday, 17 December 2016 at 14:58:24 UTC, Jacob Carlborg 
wrote:

On 2016-12-16 21:51, Atila Neves wrote:

[...]


It's not very well tested ;). When a check fails I get this 
error:


Oops!

Fixed it now. Look, now it's version 0.0.2! :P

Atila


Re: Linker-hacking out the D runtime

2016-12-19 Thread Mike via Digitalmars-d-announce

On Sunday, 18 December 2016 at 12:57:08 UTC, Iain Buclaw wrote:
On 18 December 2016 at 03:37, Mike via Digitalmars-d-announce 
 wrote:

On Sunday, 18 December 2016 at 00:04:54 UTC, sarn wrote:

I thought I'd write something up to help other people 
experiment with this

stuff:
https://theartofmachinery.com/2016/12/18/d_without_runtime.html



Thanks for this.

I abandoned D sometime ago largely because of 
https://issues.dlang.org/show_bug.cgi?id=14758 (but there were 
other reasons), so your blog post is interesting to me.  It is 
unfortunate that we have to resort to such hackery, but its 
nice to have such tools at our disposal regardless.




As a response to my last message in that thread, the changes 
for classinfo generation is now ready to go in master.


Just built GDC from the gdc-6 branch.  The commit history says 
master was merged in 24 hours ago, so I'm assuming your ClassInfo 
changes are there.


Anyway the build produces the same result:  TypeInfo strings for 
each an every type in the .rodata section.  The binary should be 
about 6K, but is instead about 600K.  Perhaps I'll try again at a 
later date.


Mike