Re: vibe.d 0.8.0 and 0.7.31 beta releases

2017-02-03 Thread yazd via Digitalmars-d-announce
On Friday, 3 February 2017 at 12:25:42 UTC, Dominikus Dittes 
Scherkl wrote:

On Friday, 3 February 2017 at 09:28:26 UTC, yazd wrote:
Is it possible to have non-@safe callbacks be part of the 
non-deprecated API?

Why?
A @safe API allows you to use it within @safe code, but it 
doesn't require you to also write @safe code.
Especially if you don't like to annotate your code to be @safe, 
even if you think it is safe, this doesn't hinders you to use 
other peoples @safe code.
Only the reverse is a problem (other people, who like to 
annotate their code @safe, can't use your code if it is not 
annotated - so they start to ignore your code even if it would 
be @safe only because you don't bother).


What you are saying is true when you are the caller, but in this 
case, the callbacks provided to the API are what is required to 
be @safe and accordingly my code is required to be @safe.


For example, this is the signature for `setTimer`:
Timer setTimer(Duration timeout, void delegate() nothrow 
@safe callback, bool periodic = false) @safe nothrow;


I can't even use `logInfo("%s", ex)` where `ex` is an `Exception` 
in @safe code, because `Exception.toString()` isn't @safe and it 
can't be @safe because it is a virtual function, and there are 
many cases of such problems.


Re: vibe.d 0.8.0 and 0.7.31 beta releases

2017-02-03 Thread yazd via Digitalmars-d-announce

On Tuesday, 31 January 2017 at 11:11:28 UTC, Sönke Ludwig wrote:
The first release of the revamped core module [1] is nearing, 
and along with that, a compatible vibe.d release (0.8.0). The 
new core module is still opt-in in this release and can be 
activated using a `subConfiguration "vibe-d:core" "vibe-core"` 
directive in dub.sdl (`"subConfigurations": {"vibe-d:core": 
"vibe-core"}` in dub.json).




I am always excited to see a new release of vibe-d. Thank you!



- Large parts of the API are now annotated with nothrow and 
@safe. In
  case of APIs that depend on callbacks, these can be breaking 
changes,

  but the most prominent places have deprecation paths in place.



Is it possible to have non-@safe callbacks be part of the 
non-deprecated API? Personally, I think @safe adds very little 
value compared to the headaches it causes and the time and 
efforts required to have every piece of your code properly 
annotated (it is sometimes impossible when using dependencies or 
even phobos and druntime without going into the lengthy process 
of doing upstream changes and waiting for new versions).


I don't think it adds value because I write my code in idiomatic 
D, which is mostly safe in reality but not necessarily @safe 
compliant.


On the other hand, I am all for nothrow changes.


Re: D 2.067.0-b3

2015-03-06 Thread yazd via Digitalmars-d-announce

On Wednesday, 4 March 2015 at 00:49:04 UTC, Martin Nowak wrote:
Glad to announce the third 2.067.0 beta, this time with 
installers and

documentation.

https://dlang.dawg.eu/downloads/dmd.2.067.0-b3/

Soon to be mirrored and available on Travis-CI.
http://downloads.dlang.org/pre-releases/2.x/2.067.0/
http://ftp.digitalmars.com/

This beta comes with 7 dmd and 2 phobos fixes on top of 
2.067.0-b2.


https://github.com/D-Programming-Language/dmd/compare/v2.067.0-b2...v2.067.0-b3
https://github.com/D-Programming-Language/phobos/compare/v2.067.0-b2...v2.067.0-b3

- -Martin
- --

To check the *.asc signatures, you can import
https://dlang.dawg.eu/downloads/d-keyring.gpg or compare them 
with

this key.

pub   4096R/0xAB8FE924C2F7E724 2014-09-01 [expires: 2018-03-03]
  Key fingerprint = AFC7 DB45 693D 62BB 472B  F27B AB8F 
E924 C2F7 E724

uidMartin Nowak (dawg) 
uidMartin Nowak

uidMartin Nowak 
sub   4096R/0xA78068C444E12E4D 2014-09-01 [expires: 2018-03-03]
  Key fingerprint = 0D91 720A 3DA5 F106 CEB0  7070 A780 
68C4 44E1 2E4D

sub   4096R/0xB273811612BB1939 2015-02-27 [expires: 2018-03-03]
  Key fingerprint = A734 4DAD 3C34 1EA1 2D13  C4E6 B273 
8116 12BB 1939


The changelog is missing notes about this: 
https://github.com/D-Programming-Language/dmd/pull/3651


Re: DCD 0.3.0-beta1 and DScanner 0.1.0-beta1

2014-03-03 Thread yazd

On Sunday, 2 March 2014 at 10:58:04 UTC, Suliman wrote:

I tried a lot of times, but without result.

One man report that for him all works fine, but I do not 
understand what's wrong in my situation.


I originally thought that the issue was with the autocompletion. 
Now I understand that it's with the compilation of a 
multiple-file project. The sublime build file provides three 
variants for building. The first one uses dmd, the second rdmd, 
and the third is dub. For multiple-file projects, use the rdmd 
build variant, by instead of building, just run. You can press 
ctrl-shift-b for that or goto Tools -> Run.
To use the dub build, press ctrl-alt-p, then type dub. You'll get 
a command that says `Build: dub`


Re: DCD 0.3.0-beta1 and DScanner 0.1.0-beta1

2014-02-05 Thread yazd

On Wednesday, 5 February 2014 at 11:55:59 UTC, Suliman wrote:

On Tuesday, 4 February 2014 at 20:09:18 UTC, yazd wrote:

On Tuesday, 4 February 2014 at 10:19:46 UTC, Suliman wrote:
It's look like Sublime do not understand from which folder 
module should be imported.


It's do not colorized
import readconfig;
if readconfig.d are putted in folder with main file.


Try running 'DKit: Update Import Paths' command in Sublime. If 
that doesn't resolve it, please submit a bug 
https://github.com/yazd/DKit.



Should I past it's here? http://snag.gy/h6b0f.jpg


Use Sublime's Command Palette. Press Ctrl+Shift+P, and start 
writing 'update import paths', you'll get it in a drop-down list.


Re: DCD 0.3.0-beta1 and DScanner 0.1.0-beta1

2014-02-04 Thread yazd

On Tuesday, 4 February 2014 at 10:19:46 UTC, Suliman wrote:
It's look like Sublime do not understand from which folder 
module should be imported.


It's do not colorized
import readconfig;
if readconfig.d are putted in folder with main file.


Try running 'DKit: Update Import Paths' command in Sublime. If 
that doesn't resolve it, please submit a bug 
https://github.com/yazd/DKit.


Re: DCD 0.3.0-beta1 and DScanner 0.1.0-beta1

2014-01-28 Thread yazd

On Wednesday, 29 January 2014 at 06:53:34 UTC, Suliman wrote:

Look like I was need to write
C:\\D\\dmd2\\windows\\bin\\
instead of C:\\D\\dmd2\\windows\\bin

Thanks! All work!


That's weird. Anyway, if you would like to help with Windows 
setup, please submit your difficulties in a pull request to 
update the README, or point in them in the issue tracker on 
github as I have not personally run the plugin on a Windows 
machine.


Re: DCD 0.3.0-beta1 and DScanner 0.1.0-beta1

2014-01-28 Thread yazd

On Tuesday, 28 January 2014 at 09:58:27 UTC, Brian Schott wrote:
New DCD and DScanner betas are  ready for testing. The tags can 
be found here:


https://github.com/Hackerpilot/DCD/tree/0.3.0-beta1
https://github.com/Hackerpilot/Dscanner/tree/0.1.0-beta1

DCD Changes:
* Uptake new lexer/parser/ast code from DScanner
* Add new --symbolLocation switch that instructs the server to 
return the

  declaration location of the symbol at the cursor
* Add new --doc switch that instructs the server to return any 
documentation

  comments associated with the symbol at the cursor
* Fixed #89: Template declarations not included in autocomplete
* Fixed #88: Fully qualified names not working
* Fixed #82: Unable to generate calltips for methods called on 
variables

* Fixed #79: Unable to build with both DMD and GDC
* Fixed #75: Vim plugin doesn't work?

DScanner changes:
* Now actually tagged with version numbers!
* Implemented experimental --styleCheck option that will run 
some basic

  static analysis checks on the files provided.
** Warns when opCmp, toHash, toString, and opEquals are not 
const

** Warns on implicit concatenation of string literals
** Warns on catching the base exception types (i.e Exception, 
Throwable, etc)

** Warns when the deprecated floating-point operators are used
** Warns when the deprecated "delete" keyword is used
** Warns when large enum constants such as array literals are 
created.
** Warns when using old-style alias declarations (i.e. alias 
type identifier

   instead of alias identifier = type)
** Warns when using deprecated complex number literals.
** Warns on empty statements (i.e. spare semicolons)
** Warns when using large number literals without underscores
** Warns on violations of the Phobos naming conventions (e.g. 
mixed case

   package names, lowercase class names, etc)
* Fixed many issues in the parser
* Fixed issues with the AST dump not correctly printing several 
expression node

  types
* Rewrote lexer, parser, and AST code. The new lexer generator 
should be ready

  for another Phobos review very soon.

About DCD:

DCD is the D Completion Daemon, a text editor and IDE-neutral 
autocompletion engine for the D programming language. DCD has 
plugins for several editors such as Textadept, Kate, Vim, 
Emacs, Zeus, and Sublime Text 3.


About DScanner:

DScanner is a Swiss army knife for D source code. It can 
perform various tasks such as

* Source line of code counting
* Import listing
* HTML syntax highlighting
* Syntax checking
* Some basic static analysis
* Generating CTAGS
* Generating an outline of a D file
* Dumping the AST of a D file into an XML file.

P.S. Only the Textadept module has support for the new 
--symbolLocation and --doc switches. If you're one of the 
excellent people who wrote one of the other plugins, I'd 
appreciate your help adding support for these features to your 
favorite editor before a non-beta release is tagged.


You're work is filling an important gap. Thanks.

I have just finished updating Sublime Text 3 plugin to use Goto 
Definition feature. But I'm still wondering on how to approach 
the documentation preview feature as Sublime doesn't provide much.


https://github.com/yazd/DKit


Re: New debugger for D!!!

2014-01-27 Thread yazd
On Tuesday, 28 January 2014 at 05:19:13 UTC, Andrei Alexandrescu 
wrote:


This does sound very interesting - and don't forget to submit a 
talk on the topic to DConf!!!


Andrei


Yes please, it would be a very interesting talk.


Re: Temple: Compile time, embedded D templates

2014-01-01 Thread yazd

On Thursday, 2 January 2014 at 01:12:24 UTC, Dylan Knutson wrote:
On Wednesday, 1 January 2014 at 13:04:27 UTC, Jacob Carlborg 
wrote:

On 2013-12-31 07:05, Dylan Knutson wrote:

Hello,

A few months ago I had posted a project of mine, templ-d. It 
was an
experiment in writing a template engine for embedding D code 
in
arbitrary text files, a-la Vibe.d's Diet templates, but 
without the

requirement of generating HTML.

So, I've revamped templ-d, and written Temple in its place. 
It supports
all the neat stuff that a template engine should, including 
(but not

limited to!)


Does it support any kind of helpers, like Rails do?


It didn't before, because of how the semantics of eRuby syntax 
works, but now it does! It seemed like an important thing to 
support...


Here's an example mimicking a subset of Rails' `form_for` 
helper:


```d
<%
import std.string;
struct FormHelper
{
string model_name;

auto field_for(string field_name, string type="text")
{
if(model_name != "")
{
field_name = "%s[%s]".format(model_name, field_name);
}

		return ``.format(type, 
field_name);

}

auto submit(string value = "Submit")
{
return ``.format(value);
}
}

auto form_for(
string action,
string name,
void delegate(FormHelper) block)
{
auto form_body = capture(block, FormHelper(name));
return `

%s
`.format(action, form_body);
}
%>

<%= form_for("/shorten", "", (f) { %>
Shorten a URL:
<%= f.field_for("url") %>
<%= f.submit("Shorten URL") %>
<% }); %>

<%= form_for("/person", "person", (f) { %>
Name: <%= f.field_for("name") %>
Age: <%= f.field_for("age") %>
DOB: <%= f.field_for("date_of_birth", "date") %>
<%= f.submit %>
<% }); %>
```

Renders:
```

Shorten a URL:





Name: 
Age: 
DOB: 


```

This change is present in the latest release of Temple


How much of this is done at compile-time? I would guess that the 
code is compiled but it is evaluated on each render. Is that 
correct? Is there a way to force compile-time evaluation of at 
least part of the template which does not depend on a runtime 
value? Or is it completely dependant on an optimizing compiler to 
do this work?


backtrace-d

2013-11-07 Thread yazd

Hello all,

I've been working on getting some better backtrace support for D 
on Linux. And I've got something to show:


http://code.dlang.org/packages/backtrace-d
https://github.com/yazd/backtrace-d

It is currently working, but there is still some bugs that might 
be due to inaccurate debug symbols emitted by the compiler or 
inaccurate backtrace addresses found.


Either way, destroy.