Re: Updating D beyond Unicode 2.0

2018-09-24 Thread Martin Tschierschke via Digitalmars-d
On Monday, 24 September 2018 at 14:34:21 UTC, Steven 
Schveighoffer wrote:

On 9/24/18 10:14 AM, Adam D. Ruppe wrote:
On Monday, 24 September 2018 at 13:26:14 UTC, Steven 
Schveighoffer wrote:
Part of the reason, which I haven't read here yet, is that 
all the keywords are in English.


Eh, those are kinda opaque sequences anyway, since the 
meanings aren't quite what the normal dictionary definition is 
anyway. Look up "int" in the dictionary... or "void", or even 
"string". They are just a handful of magic sequences we learn 
with the programming language. (And in languages like Rust, 
"fn", lol.)


Well, even on top of that, the standard library is full of 
English words that read very coherently when used together (if 
you understand English).


I can't imagine a long chain of English algorithms with some 
Chinese one pasted in the middle looks very good :) I suppose 
you could alias them all...


-Steve

You might get really funny error messages.

🙂 can't be casted to int.

:-)

And if you have to increment the number of cars you can write: 
🚗++; This might give really funny looking programs!


Re: dlang download stat should be updated

2018-09-12 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 11 September 2018 at 07:25:22 UTC, Suliman wrote:

On Sunday, 9 September 2018 at 09:05:33 UTC, Suliman wrote:
Last update was long time ago 
http://erdani.com/d/downloads.daily.png


UP


+1


Re: This is why I don't use D.

2018-09-05 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 5 September 2018 at 05:44:38 UTC, H. S. Teoh wrote:
On Wed, Sep 05, 2018 at 01:18:17AM +, James Blachly via 
Digitalmars-d wrote:

[...]

[...]

[...]


To me, this strongly suggests the following idea:
- add *all* dlang.org packages to our current autotester / CI
  infrastructure.
- if a particular (version of a) package builds successfully, 
log the
  compiler version / git hash / package version to a database 
and add
  a note to dlang.org that this package built successfully with 
this

  compiler version.
- if a particular (version of a) package fails to build for 
whatever
  reason, log the failure and have a bot add a note to 
dlang.org that

  this package does NOT build with that compiler version.
   - possibly add the package to a blacklist for this compiler 
version
 so that we don't consume too many resources on outdated 
packages

 that no longer build.
- periodically update dlang.org (by bot) to indicate the last 
known

  compiler version that successfully built this package.
- in the search results, give preference to packages that built
  successfully with the latest official release.

[...]
I think this idea was suggested before and I hope this will be 
done.
And when the compilation yield some warnings, about deprecation, 
the owner of the package should be notified and asked for update, 
too.


Regards MT.


Re: DMD, Vibe.d, and Dub

2018-07-18 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 18 July 2018 at 15:21:29 UTC, Russel Winder wrote:

On Wed, 2018-07-18 at 14:20 +, Seb via Digitalmars-d wrote:
On Wednesday, 18 July 2018 at 12:56:05 UTC, Russel Winder 
wrote:

> [...]

You have openssl 1.1 installed, but vibe.d tries to link with 
openssl 1.0 by default.


See 
https://github.com/vibe-d/vibe.d#switching-between-openssl-versions


tl;dr: use

dub --override-config vibe-d:tls/openssl-1.1


I went for the:

dependency "vibe-d:tls" version="*"
subConfiguration "vibe-d:tls" "openssl-1.1"

in the dub.sdl file. I now have a build.

I believe 1.1 should be the default if available, falling back 
to 1.0, 0.9,…
It would be very useful if dub would be able to check for missing 
libs.
It seams stupid, that after successful compilation you get the 
linker error.


Even if the needed libs are named different on different systems, 
it would be cool to collect the information what is needed in the 
dub.sdl/dub.json file.


So directly at the beginning you get a hint what is missing. And 
how to fix it,

especially if you use a system like Debian (/Ubuntu)

I ran into the exactly same chain of error messages, fixing them 
with the help of others,
and some search, this is not the most convenient experience if 
you start with vibe.d.


Regards mt.






Re: DIP 1015--removal of implicit conversion from integer and character literals to bool--Community Review Round 1

2018-06-21 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 20 June 2018 at 08:16:21 UTC, Mike Parker wrote:
This is the feedback thread for the first round of Community 
Review for DIP 1015, "Deprecation and removal of implicit 
conversion from integer and character literals to bool":


https://github.com/dlang/DIPs/blob/7c2c39243d0d747191f05fb08f87e1ebcb575d84/DIPs/DIP1015.md


The arguments are clear and convincing, so: Yes!




Any comments about the new Ruby JIT Compiler

2018-06-13 Thread Martin Tschierschke via Digitalmars-d

The compilation is done by using the C compiler in the background.

https://www.ruby-lang.org/en/news/2018/05/31/ruby-2-6-0-preview2-released/

Could D be an better choice for that purpose?


Any comment?


Re: dub subpckages and how to depend on them internally

2018-05-31 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 29 May 2018 at 23:41:59 UTC, aliak wrote:
Hi, I'm trying to get dub working with subpackages and I just 
can't quite seem to hit the nail on the head. Any help would be 
greatly appreciated.


This is the current setup is like this, and there's a shared 
source folder as well called "common" and "sub2" depends on 
"sub1".


lib
 |-- dub.json
 |-- source/
| -- sub1/
 | -- package.d
 | -- dub.json
| -- sub2/
 | -- package.d
 | -- dub.json
| -- common/


[...]

Halp!


I had a similar struggle, may be the version is the missing hint:

"dependencies": {
"diet-ng": "~>1.4",
 ,

 mylib":{
"versions": "~master",
"path": "/home/mt/d/mylib"
},
  
}

Try to place "versions": "~master", beside your path.






Re: ! No alerts ! code.dlang.org

2018-05-24 Thread Martin Tschierschke via Digitalmars-d

On Monday, 14 May 2018 at 08:24:37 UTC, Martin Tschierschke wrote:


Pingdom Weekly Report
2018-04-30 to 2018-05-06

CHECK NAME  UPTIME  DOWNTIMEOUTAGES RESPONSE TIME
code.dlang.org  99.95%  0h 05m 00s  1   524 ms


Last week (2018-05-07 to 2018-05-13) again: Uptime 100%!


Re: ! No allerts ! code.dlang.org

2018-05-14 Thread Martin Tschierschke via Digitalmars-d

On Friday, 11 May 2018 at 12:13:49 UTC, Sönke Ludwig wrote:



@Martin Nowak, please make a post about the new server 
infrastructure @ announce!


Hi Martin, just wanted to note that the registry currently 
still runs on a VPS of mine, although on a different one that 
has a lot more free resources (memory). Martin Nowak's setup is 
still work in progress, but at least we have something stable 
until then.
Yes, it is quite stable now, so I thought the new proposed 
infrastructure was already in place.

=> Thank you Sönke!

Pingdom Weekly Report
2018-04-30 to 2018-05-06

CHECK NAME  UPTIME  DOWNTIMEOUTAGES RESPONSE TIME
code.dlang.org  99.95%  0h 05m 00s  1   524 ms


! No allerts ! code.dlang.org

2018-05-07 Thread Martin Tschierschke via Digitalmars-d
I just want to send a big thank you to Martin Nowak and Sönke 
Ludwig and every one else running the infrastructure of DUB 
behind the scene!



This is the list of Weekly Reports from pingdom.com for 
code.dlang.org:



Pingdom Weekly Reports

2018-04-02 to 2018-04-08 (partly)
CHECKS WITH DOWNTIME
UPTIME  DOWNTIMEOUTAGES RESPONSE TIME
Code90.00%  2h 45m 00s  9   725 ms


2018-04-09 to 2018-04-15
CHECKS WITH DOWNTIME
UPTIME  DOWNTIMEOUTAGES RESPONSE TIME
Code94.49%  9h 15m 00s  43  694 ms

2018-04-16 to 2018-04-22
CHECKS WITH DOWNTIME
UPTIME  DOWNTIMEOUTAGES RESPONSE TIME
Code97.12%  4h 50m 00s  4   571 ms

2018-04-23 to 2018-04-29
OUTAGES: None

CHECKS WITHOUT DOWNTIME
UPTIME  DOWNTIMEOUTAGES RESPONSE TIME
Code100.00% 0h 00m 00s  0   564 ms
^^^

@Martin Nowak, please make a post about the new server 
infrastructure @ announce!








Re: D, Parasail, Pascal, and Rust vs The Steelman

2018-03-21 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 21 March 2018 at 16:19:35 UTC, H. S. Teoh wrote:
[...]
I do not understand the meaning of "subscript ranges"? Isn't 
this slicing?


AFAICT, "subscript" in the spec just means the range of valid 
array indices (it's old terminology from the 70's / 80's).


In which case, it is not true that subscript ranges are not 
accessible in D (I don't know about Rust); all D arrays have 
indices from 0 to .length-1, so the callee can always access 
the range of allowed indices, and the caller never has to pass 
.length explicitly.



T
With this D fulfills, 95% of the "Steelman requirement" partially 
or better :-)




Re: D, Parasail, Pascal, and Rust vs The Steelman

2018-03-21 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 21 March 2018 at 12:52:19 UTC, Paulo Pinto wrote:
An article comparing the above languages as per the DoD 
language requirements [0].


http://jedbarber.id.au/steelman.html

[0] - 
https://en.wikipedia.org/wiki/Steelman_language_requirements


Interesting!

Do you understand this:

7H. Formal Array Parameters. The number of dimensions for formal 
array parameters must be specified in programs and shall be 
determinable during translation. Determination of the  subscript 
range for formal array parameters may be delayed until 
invocation and may vary from  call to call. Subscript ranges 
shall be accessible within function and procedure bodies without 
being passed as explicit parameters.



Subscript ranges are not accessible in D or Rust.


I do not understand the meaning of "subscript ranges"? Isn't this 
slicing?


Re: Bachelor level projects

2018-03-20 Thread Martin Tschierschke via Digitalmars-d
On Tuesday, 20 March 2018 at 14:44:39 UTC, Alexandru Jercaianu 
wrote:

Hello,

At the Polytechnic University of Bucharest we are organizing a 
special program called CDL[1], where Bachelor students are 
mentored to make their first open source contributions.


I think it's a great idea to involve D in this program, but for 
this to be successful, I need your help in finding ideas for 
Bachelor level projects, which can be solved until the end of 
May (anything from new features to more impactful bugs).


If there is anything on your wish list which matches the 
criteria above, feel free to share.


Thanks,
Alex J


Make a complete analysis of all existing database connectors for 
D.


https://code.dlang.org/?sort=updated&limit=40&category=library.database

And propose a std.database solution, derived of the existing ones 
allowing to connect to Mysql/MariaDB,Postgres,SQlite and probably 
more.


With a certain focus on not blocking i/o to keep it vibe.d 
compatible.


I just realized again how important an "official" D database 
connector is.


Regards mt.


Re: D course material

2018-03-14 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 14 March 2018 at 08:53:17 UTC, Andre Pany wrote:
On Tuesday, 13 March 2018 at 12:39:24 UTC, Dmitry Olshansky 
wrote:

[...]


Hi Dmitry,

for presenting D to my team I used following example. It 
highlights
some features of D: Meta programming, templates, CTFE, UFCS, 
OOP in D,

Functional programming in D and ...

It is a compile time i18n library in ~50 lines.

import std.experimental.scripting;

[...]
Just came across this: It has been changed to:
   std.experimental.all

https://dlang.org/changelog/2.079.0.html#std-experimental-all

Regards mt.


Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 13 March 2018 at 14:13:02 UTC, jmh530 wrote:
[...]

https://en.wikipedia.org/wiki/Row-_and_column-major_order


I think for mathematics it is more important for easy handling,
to be able to get the element of a matrix a_ij by a(i,j) and not 
only by a[i-1,j-1].


The underlying storage concept is less important and depends just 
on the used libs, which should be the best (fastest) available 
for the purpose.


Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-13 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 13 March 2018 at 03:37:36 UTC, 9il wrote:
[...]

5. Clever `=` expression based syntax. For example:

   // performs CBLAS call of GEMM and does zero memory 
allocations

   C = alpha * A * B + beta * C;


[...]
My answer is: Yes.

If D with Lubeck would have such a convenient way to write matrix 
algebra,
using well designed operator overloading, this might attract more 
users.


Unfortunately my own time using this kind of math daily is long 
ago,

but I would like to help as a tester.

I will look in my master thesis and see if I may use Lubeck for 
the calculation done.
I was doing eigenvalue with FEM and in an other project partial 
differential equation with a matrix based approximation schema... 
so this may bring my "gray cells" to work again :-)


I was using a C++ lib with operator overloading resulting in 
quite convenient expressions.
The point that Java has no operator overloading, was the trigger 
for me to dislike the language.  :-)




Re: DConf hotel poor QoS

2018-03-12 Thread Martin Tschierschke via Digitalmars-d

On Saturday, 10 March 2018 at 04:55:02 UTC, Mike Parker wrote:

On Friday, 9 March 2018 at 18:08:58 UTC, Ali Çehreli wrote:

[...]


I booked both legs directly through Lufthansa and decided to 
fly into Frankfurt since it's cheaper than the direct flight to 
Munich. The flight there is costing us about $450 ea. for Basic 
Economy, non-stop. The BE seats on the way back are $600+, so 
we booked premium economy for a little over $800 ea. instead. 
For my wife and I together, $2700 round trip. Then I planned 
our trip around that: 5 nights in Frankfurt, 7 in Munich, and 3 
in Berlin, with two Deutsche Bahn rides and an EasyJet flight 
in between.
Sorry to say this, but you are missing the most beautiful German 
city: Hamburg :-)

Have a got journey!
p.s. I am dreaming of the day DConf being in Hamburg...
This is the location of our annual event:
http://www.hotel-hafen-hamburg.de/uploads/pics/hhh_tagungsraeume_elbkuppel_visual_03.jpg





Re: Embedded Linux really needs Dlang for the IOT market

2018-03-10 Thread Martin Tschierschke via Digitalmars-d

On Friday, 9 March 2018 at 12:41:52 UTC, Binghoo Dang wrote:

On Friday, 9 March 2018 at 09:12:28 UTC, Radu wrote:

[...]


I'm working in BAS(Building Automation System) sector, and I 
use Dlang daily for some advance products targeting ARM/Mips 
boards.


[...]


That's great, it looks that what I need to do is just try! And, 
I would write a paper after I get everything working. thanks!


Yes, please write down your steps to success and place it 
somewhere it can be found :-)

(https://wiki.dlang.org/) There is not to much documentation!


Re: Slow code, slow

2018-02-27 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 27 February 2018 at 13:35:14 UTC, ketmar wrote:

Martin Tschierschke wrote:

On Tuesday, 27 February 2018 at 08:49:15 UTC, Stefan Koch 
wrote:

On Monday, 26 February 2018 at 21:38:09 UTC, ketmar wrote:

H. S. Teoh wrote:

On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via 
Digitalmars-d wrote:

[...]

When looking at the problem of compilation times I think: 
Wouldn't it speed up the development process, if spiting your 
code in modules would automatically results in creating small 
libs which are - if possible - compiled only once?


The idea of using a caching mechanism, is an other general way 
not to compile the same over and over again. Part of the 
discussion is here: 
https://github.com/dlang/dmd/pull/7239#issuecomment-340256110


basically, compilation of a code without templates is FAST. 
500+ KB of source almost without templates often compiles in 
less than a second (on not-so-bleeding-edge i3, not even i7).


but throw templates in a mix, and BOOM! coffee and cigarettes.


My negative experience was, when using ctRegex and normal regex.
But it was no problem to separate the functions using regex in a 
lib and compile

them separately. (app saving 3 seconds)

The same approach was working with .dt (diet template in vibe.d) 
and the function(s) instantiating it, put both together in an own 
lib. And define it as a local external dependency. In the moment 
I am thinking about a way to do this automatically.
So that every new build of my vibe.d app, only needs to compile 
the changes.


(p.s. I am aware of this: 
https://github.com/rejectedsoftware/diet-ng#experimental-html-template-caching)






Re: Slow code, slow

2018-02-27 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 27 February 2018 at 08:49:15 UTC, Stefan Koch wrote:

On Monday, 26 February 2018 at 21:38:09 UTC, ketmar wrote:

H. S. Teoh wrote:

On Mon, Feb 26, 2018 at 10:12:25PM +0200, ketmar via 
Digitalmars-d wrote:

[...]

When looking at the problem of compilation times I think: 
Wouldn't it speed up the development process, if spiting your 
code in modules would automatically results in creating small 
libs which are - if possible - compiled only once?


The idea of using a caching mechanism, is an other general way 
not to compile the same over and over again. Part of the 
discussion is here: 
https://github.com/dlang/dmd/pull/7239#issuecomment-340256110


Re: Postgres and other database interfaces

2018-02-24 Thread Martin Tschierschke via Digitalmars-d
On Saturday, 24 February 2018 at 15:44:49 UTC, Paolo Invernizzi 
wrote:
On Saturday, 24 February 2018 at 15:32:32 UTC, Adam D. Ruppe 
wrote:

On Saturday, 24 February 2018 at 14:13:18 UTC, Joe wrote:

[...]

You can try going to

http://any-dub-package.dpldocs.info

[...]


:-O

Adam, you are the man!
I'll never stop of being surprised by your way of coding!

Great Job!

+1
Fascinating!

Please make a post to announce and place the direct link to it 
inside code.dlang.org :-)


Would it be possible to use it for calculating/evaluating a 
measure for inlined documentation?





Re: Postgres and other database interfaces

2018-02-24 Thread Martin Tschierschke via Digitalmars-d

On Saturday, 24 February 2018 at 14:13:18 UTC, Joe wrote:

On Saturday, 24 February 2018 at 10:13:35 UTC, Paolo Invernizzi

[...]


As I said, I'm new and still not familiar with those facilities 
although I saw those things and they looked like embedded HTML 
and was wondering what they were for.


Again, coming from Python, I'm familiar with RTD 
(https://readthedocs.org, my own open source Python/Postgres 
project is hosted there) and Sphinx 
(http://www.sphinx-doc.org/en/master/). Although it started 
with Python, RTD now hosts many other kinds of projects 
(Javascript, PHP, Ruby, etc.). There's even a project named 
'dlang' (it's not what you expect!), but I did find "D Tips" 
and "Quick Start with D" which appear to be standalone 
Markdown. In any case, it would be nice to have such 
automatically generated docs available in a public site/repo of 
some kind, like RTD, so a potential user doesn't have to clone 
the code and run the compiler to see it.

+1
I would even go so far 'force' people publishing to dub, to 
provide documentation.
If no docs, present, than the libs should be marked as *docs 
missing*. (Beside the number of Github stars)




Re: Postgres and other database interfaces

2018-02-24 Thread Martin Tschierschke via Digitalmars-d

On Saturday, 24 February 2018 at 07:57:47 UTC, aberba wrote:

On Saturday, 24 February 2018 at 05:33:56 UTC, Joe wrote:
Back on 13 January, I posted in the Learn forum some questions 
regarding using Postgres and got a reply that stated the 
following:


On Monday, 15 January 2018 at 02:28:29 UTC, Matthias Klumpp 
wrote:
In any case, please don't start another Postgres library and 
consider contributing to one of the existing ones, so that we 
maybe have one really awesome, 100% complete library at some 
point.


I'm revisiting this because I now have had the chance to look 
at the various libraries and IMHO the "really awesome, 100% 
complete library" depends on the users' goals and their 
definition of awesome and complete.


Aside from ddbc which is like ODBC/JDBC and thus supports 
multiple db's (not my interest), I've found five 
Postgres-specific libraries worthy of further exploration:


1. derelict-pq. This is the most downloaded one and is simply 
a binding over libpq, so AFAICT it's nearly 100% complete. 
It's also well-documented, in part because the Derelict 
libraries provide overall guidance, but mainly because a D 
user can refer directly to the comprehensive libpq 
documentation and (C) examples. The only strange fact is that 
it's been stuck in a beta.3 release for the last five months.


2. dpq2. Second most downloaded and built on top of 
derelict-pq. The "documentation" consists of a README listing 
the features and a single example, which appears to focus on 
support for JSON/BSON.


3. vibe-d-postgresql. Third most downloaded and built on top 
of dpq2. Docs consist of a single example program.


4. ddb. About the same number of downloads as the above. 
Implemented on top of front/backend protocol. No documentation 
although repository has a folder with two sample programs.


5. dpq. Implements its own wrapper over libpq and has some ORM 
functionality. Docs are a README with example program.


The main issue is that, other than derelict-pq, using any of 
these libraries involves reading the library code and 
understanding the sui generis interfaces implemented by each.


I'm new to the D community, but coming from Python, the 
contrast is significant. First there is the well-documented 
PEP 249 (https://www.python.org/dev/peps/pep-0249/) 
promulgated by the Python DB-SIG (and note that 249 is v.2), 
which led to the implementation of psycopg (also 
well-documented including various extensions to the API) and 
many other adapters to Postgres and other databases.
Some developers spend hours writing code but don't feel the 
need to speed minutes documenting or at least showing how to 
use their code. Part of the reason others roll their own (one 
they will understand).  Goes on and on.


If its for their personal use,  then they shouldn't put it on 
dub to saturate the ecosystem.


I sometimes go around sending pull requests to some with sample 
I got from their unittests or "example"  folder. Worst case,  
they send you a link to the C library they wrote bindings 
for... "oh its easy to know by looking at the C docs". Some 
don't even border... this is common with C libraries. C has 
libs but hard to figure out how to use without going through 
code.


Laugh at,  as one may,  Javascript npm libraries are well 
documented so there's high adoption. OP even agrees derelict-pq 
is well documented so it has a higher usage. All Dub libraries 
with good docs are those that are downloaded. Most importantly, 
a description of package and a sample/demo is the README.md 
file. A link to generated docs may follow to more info. Only 
generated docs don't cut it.



If you document your code well,  others will use and contribute 
to it without rolling their own. Docs on library purpose and 
sample usage at least.



"The most used Dub libraries are those well documented."

+1
I want to subscribe to this.
To improve the D ecosystem it would be a plus point to mark all 
libs at code.dlang.org having documentation with a special sign.


Most people want a solution for their problems, they don't want 
to make an analysis,
which of n available libs is best to use. Most more widely 
adopted languages offer

the needed DB connectors in their std.

The medium step between expanding the std lib and having nothing 
official might be,
to try to adopt more for the dlang git repro. 
(https://github.com/dlang-community)

(As mentioned before)

Even if the first choice might be not the best of all available 
libs for one problem,
if the community has started to develop _one_ solution for a 
problem, the value of contributing to this increases 
dramatically. I think the community is not big enough to support 
five different well documented, well designed and understood libs 
for solving the same problem.

Regards mt.




Re: Multiple Alis

2018-02-13 Thread Martin Tschierschke via Digitalmars-d
On Tuesday, 13 February 2018 at 11:05:03 UTC, Andrea Fontana 
wrote:

On Tuesday, 13 February 2018 at 00:47:42 UTC, Ali Çehreli wrote:
Nothing serious but in case you are confused, there are at 
least three separate and awesome Alis frequenting these 
newsgroups. :)


From: Ali Çehreli
Email: acehr...@yahoo.com
Almost always ends posts simply with "Ali"

From: Ali
Email: fakeem...@example.com
Usually does not use any signature

From: aliak
Email: someth...@something.com
Usually ends with "Cheers", occasionally with an added "- Ali"

Ali
"me"


I read this thread just because it was so strange that Ali was 
calling "Multiple Alias This" in this way.
LOL +1,  + @ Ali Çehreli (trying to use a Gravatar picture would 
be cool, you may use a picture of your wonderful book, if you are 
to shy :-)




Re: proposal: heredoc comments to allow `+/` in comments, eg from urls or documented unittests

2018-02-11 Thread Martin Tschierschke via Digitalmars-d

On Friday, 9 February 2018 at 03:06:56 UTC, Timothee Cour wrote:
same exact idea as motivation for delimited strings 
(https://dlang.org/spec/lex.html#delimited_strings)


```

auto heredoc = q"EOS
This is a multi-line
heredoc string
EOS"
;

/"EOC
This is a multi-line
heredoc comment allowing
/+ documented unittests containing nesting comments +/
and weird urls like 
https://gcc.gnu.org/onlinedocs/libstdc++/faq.html

EOS"/

```
I thought about it,  what if you define, that the /+  +/ comment, 
is not started by
'/+'  alone but by '/+ ' that means that the char behind the plus 
defines the ending of the comment.

So that /+my_special_block  has to end with  my_special_block+/
And '/+ '  with ' +/' where all whitespace characters should be 
allowed (\newline \tab \space).


I know that this might be a somehow breaking change, but it would 
not require a totally different kind of syntax.

And the mentioned URL-Strings lib++/  will not match for '/+ ' .
Would be interesting how often people write /+directly followed 
by the comment, without a space or the same at the end+/





Re: Quora: Why hasn't D started to replace C++?

2018-02-08 Thread Martin Tschierschke via Digitalmars-d
On Thursday, 8 February 2018 at 15:29:08 UTC, Ralph Doncaster 
wrote:
On Wednesday, 7 February 2018 at 22:31:58 UTC, John Gabriele 
wrote:
I'm not sure how long dub has been around, but having an easy 
to use CPAN-alike (online module repo) is HUGE. Dub is great 
for sales. The better dub and the repo gets, the more 
attractive D gets.


I completely agree that the availability of libraries is a huge 
factor.  I almost gave up on D because of the limited amount of 
3rd party libs.

I think just improving the search function would help.
http://code.dlang.org/search?q=keccak
Comes up with nothing, so I started porting a sha3/keccak lib 
from C to D.  Then someone pointed out botan has sha3 support, 
which can be found if you search for "crypto"

http://code.dlang.org/search?q=crypto

The opposite situation you may see, when searching for mysql:

You will get 9 packages listed. Which should I take?
If you click on everyone, you will realize, that some of them are 
forks of other.
And the version number of mysql-native at the top, just recently 
increased so strong, that it makes a different.
The minimum additional information which should be listed - I 
think - is the number of downloads and GitHub stars.


I know that there is work behind the scene to find some kind of 
weighted sort, this would be cool, but just displaying the GitHub 
voting might help a lot.








Re: Bye bye, fast compilation times

2018-02-08 Thread Martin Tschierschke via Digitalmars-d

On Monday, 5 February 2018 at 21:27:57 UTC, H. S. Teoh wrote:
One of my D projects for the past while has been taking 
unusually long times to compile.  This morning, I finally 
decided to sit down and figure out exactly why. What I found 
was rather disturbing:


--
import std.regex;
void main() {
auto re = regex(``);
}
--

Compile command: time dmd -c test.d

Output:
--
real0m3.113s
user0m2.884s
sys 0m0.226s
--

Comment out the call to `regex()`, and I get:

--
real0m0.285s
user0m0.262s
sys 0m0.023s
--

Clearly, something is wrong if the mere act of compiling a 
regex causes a 4-line program to take *3 seconds* to compile, 
where normally dmd takes less than a second.



Thank you for this finding!

I was wondering why my little vibe.d project started to take 
approximately twice the
time to compile, and because of making a mistake in my test 
setup, even my minimal
program still included the file containing the regex. So that 
even reducing the used
code to a minimum the compilation time was ~7 sec compared to 
less than 4 seconds.


Would be cool if we could get fast compilation of regex.

I am coming from using scripting languages (perl and ruby) using 
regex a lot, so that this is really disappointing for me.


Beginner question:
How to split my project, to compile the regex part separately as 
a lib and just link them?




Re: !Alert! dlang.org SSL Error

2018-02-06 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 6 February 2018 at 14:57:27 UTC, Jan Knepper wrote:
[...]


Will keep an eye on it. Everybody else who hits the website 
regularly who experiences the problem, please report ASAP.


Thanks!
Jan
Thank you, no SSL error! But some missing text: In the News 
section:


  Stay updated with lastest article in the Official D Blog from : 
by .


  From : by .

+ my browser just highlights "lastest" .


Re: !Alert! dlang.org SSL Error

2018-02-06 Thread Martin Tschierschke via Digitalmars-d
On Tuesday, 6 February 2018 at 13:42:18 UTC, Martin Tschierschke 
wrote:

Please contact the owner of the website to inform him of

this issue.


Same for me.


I don't have any issues on my machine with Chrome and Firefox..
Hmm, my phone with chrome on android7 and chrome on ipad2 no 
problems,too.

@forum.dlang.org and @code.dlang.org everything ok.



Re: !Alert! dlang.org SSL Error

2018-02-06 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 6 February 2018 at 13:31:23 UTC, Seb wrote:

On Tuesday, 6 February 2018 at 13:18:26 UTC, Jakub Łabaj wrote:
On Tuesday, 6 February 2018 at 10:05:52 UTC, Martin 
Tschierschke wrote:

Chromium: ERR_SSL_PROTOCOL_ERROR


[...]
Please contact the owner of the website to inform him of

this issue.


Same for me.


I don't have any issues on my machine with Chrome and Firefox..
Hmm, my phone with chrome on android7 and chrome on ipad2 no 
problems,too.




!Alert! dlang.org SSL Error

2018-02-06 Thread Martin Tschierschke via Digitalmars-d

Chromium: ERR_SSL_PROTOCOL_ERROR

With Firefox and Chomium and with different Ubuntu Versions 
(17.10 and 16.04.)


Firefox - Google translated:

Error: Secure connection failed

An error occurred while connecting to dlang.org. SSL has received 
an entry that has exceeded the maximum allowed length. Error 
code: SSL_ERROR_RX_RECORD_TOO_LONG


 The website can not be displayed because the authenticity of 
the received data could not be verified.
 Please contact the owner of the website to inform him of 
this issue.


Re: Quora: Why hasn't D started to replace C++?

2018-02-02 Thread Martin Tschierschke via Digitalmars-d
On Friday, 2 February 2018 at 08:39:58 UTC, Paolo Invernizzi 
wrote:

On Friday, 2 February 2018 at 08:21:33 UTC, Martin Tschierschke

[...]
Maybe there should be a blog post, with some kind of status 
report every .. weeks or .. month? Telling more about the 
focus of the D foundation, statistics of downloads, number of 
fixed bugs, partly similar to Adams week in D but more 
official. I think the content of such a post may find its way 
into more mainstream IT magazines, if marked as official d 
foundation  press release even more.


The best status report I've met is definitely the FreeBSD 
quarterly status report:


https://www.freebsd.org/news/status/status.html

I suggest to take a look at that, as an inspiration and 
yes, a quarterly report is enough.


/Paolo

Yes, looks very good!







Re: Quora: Why hasn't D started to replace C++?

2018-02-02 Thread Martin Tschierschke via Digitalmars-d

On Thursday, 1 February 2018 at 22:38:36 UTC, Walter Bright wrote:

On 2/1/2018 3:11 AM, Martin Tschierschke wrote:
Idea: There should be some kind of news ticker for all 
enhancements and important decisions, maybe at first just via 
twitter  with a special #tag  beside #dlang where all updates 
are announced. And a place on the homepage, where this feed is 
displayed separately.


It's already there on the right side of https://dlang.org/



with a special #tag  beside #dlang
The focus was on a feed with _two_ tags #dlang and #dfoundation 
for example.


In the feed on the homepage everything is mixed up and I am 
feeling a lot information about progress - made in the background 
- is missing.


Maybe there should be a blog post, with some kind of status 
report every .. weeks or .. month? Telling more about the focus 
of the D foundation, statistics of downloads, number of fixed 
bugs, partly similar to Adams week in D but more official. I 
think the content of such a post may find its way into more 
mainstream IT magazines, if marked as official d foundation  
press release even more.









Re: Quora: Why hasn't D started to replace C++?

2018-02-01 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 31 January 2018 at 18:35:50 UTC, Seb wrote:
[...]
Like: 
https://github.com/adamdruppe/arsd/blob/master/simpledisplay.d

And the examples from D-Lang Tour.

So you only push a button [try D], and get a running 
environment to play around.


Like this?

https://tour.dlang.org/tour/en/dub/mir

It's a small series since today. Any help with filling the 
blank content or new pages is welcome.


See 
https://forum.dlang.org/post/acovehcwaxjykmhek...@forum.dlang.org for adding new libraries to run.dlang.io


This looks very promising!
Have not been on the dang tour page for several month, it shows 
an amazing progress!!


Idea: There should be some kind of news ticker for all 
enhancements and important decisions, maybe at first just via 
twitter  with a special #tag  beside #dlang where all updates are 
announced. And a place on the homepage, where this feed is 
displayed separately.


On the other side a voting mechanism in the forum would be very 
useful, so readers can mark a post as valuable maybe to be be 
displayed in a special feed. I know this is difficult because the 
forum has more than only the web frontend.
But why not translate the [I recommend to read this]-Button into 
a mail or post, with the content ... **recommend** this. And 
probably back? from short mail only with **KEYWORD**.
It would fill up the mailboxes of the readers, but it would be 
easier to count than this "me too ++" posts.





Re: Quora: Why hasn't D started to replace C++?

2018-01-31 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 31 January 2018 at 11:42:14 UTC, Seb wrote:
[...]
This is about to change soon for D. There's WIP to use 
OpenCollective

The announcement should happen soon.
Stay tuned!

[...]

Here's a spoiler:

1) Andrei does an excellent job at managing his students [1] 
and there work over the last couple of months has been 
tremendous. As the experiment with UPB was very successful, 
there will be more projects like this one and global scholarship


2) The vision document will finally get updated (there have 
been a few delays due to holiday, illnesses etc.)


https://wiki.dlang.org/Vision/2017H2

3) More community input (I'm preparing a State of D survey atm)

4) More active voting by the community on important issues

5) Better documentation and overview on what the foundation is 
doing


Currently under discussion/work:

6) Using OpenCollective for tracking expenses openly
7) Offering membership packages for companies
8) Doing bi-annual Kickstarter compaigns for important issues 
to the community (e.g. "fix shared")

[...]


As mentioned above, there's. However, it's not very visible as 
a lot of work happens in stealth-mode atm and only a tiny bit 
makes it to the DBlog:


https://dlang.org/blog/category/core-team
https://dlang.org/blog/category/d-foundation


Thank you for your post, very interesting background information.

I like 7) and 8) very much! ( 8) needs 4) )



Re: Quora: Why hasn't D started to replace C++?

2018-01-31 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 31 January 2018 at 12:03:22 UTC, rjframe wrote:

On Wed, 31 Jan 2018 10:55:56 +, Benny wrote:


[...]

Anyway, mostly because of your recent posts I'm going to take a 
look at DlangIDE. If we can package a cross-platform 
IDE+compiler+dub as a single download and you're ready to go, 
that might make it easier to give D a try, even if most people 
would later set up something else; at least you'd only deal 
with the problems after you've decided it's worth it.


Yes, would be very good!

And than ad a series of short example programs, to this 
one-stop-download,

maybe party from Adam's arsd.

Like: 
https://github.com/adamdruppe/arsd/blob/master/simpledisplay.d

And the examples from D-Lang Tour.

So you only push a button [try D], and get a running environment 
to play around.







Has any body taken a look at monetdb?

2018-01-17 Thread Martin Tschierschke via Digitalmars-d
An old friend of mine is working in the database research group 
in Amsterdam, they have developed monetdb:



From https://www.monetdb.org/Home

The column-store pioneer

The column store technology  of MonetDB has found its way into 
the product offerings of all major commercial database vendors. 
Its pioneering role has been internationally recognized with the 
prestigious ACM SIGMOD Edgar F. Codd Innovation  Award and ACM 
SIGMOD Systems Award. The market for applications empowered by 
these techniques provide ample space for further innovation, e.g. 
as demonstrated by our ongoing projects. At the same time, the 
landscape for major innovations remain wide open. A peek preview 
is given in the award winning paper titled: The Researcher's 
Guide to the Data Deluge: Querying a Scientific Database in Just 
a Few Seconds.


I just found that there everything is now on Git hub, with 
clients written for:

Ruby, Perl, PHP, Python and Java.

https://www.monetdb.org/blog/monetdb-on-github

I just took a short look into the Ruby client code, I have not 
used Monetdb yet, but is there anybody interested in trying to 
make a D client?


I think it might give an interesting storage concept especially 
for people using D for Big Data.


Any comment? Regards mt.


Re: !Alert! code.dlang.org down

2018-01-11 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 10 January 2018 at 23:25:16 UTC, Guillaume Piolat 
wrote:
On Wednesday, 10 January 2018 at 10:10:22 UTC, Martin 
Tschierschke wrote:
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on 
the way...


Tips from the folks on Discord, for DUB outages:

1. If you have all required dependencies in your cache, and 
just want to avoid the network:


dub --skip-registry=all

Very useful on slow networks. However this won't help if 
you don't have the libraries in your cache.



2. If you wish to use a mirror

dub --skip-registry=standard -v 
--registry=http://code-mirror.dlang.io



3. If you need to fetch packages and mirror are down too

- git clone every repositery you need from GitHub
- $ dub add-local in every of these repositery
You might want to checkout older tags if you are not using 
the latest version of these repositeries.


Thank you for the hints, actually my problem was, that I wished 
to access the DUB docs.
And the strange thing was, that even the google cache tried to 
connect to code.dlang.org during delivery of the cached page, so 
that even looking on the cached google content took quite a long 
time before there was a timeout.


Therefore we should think about placing these kinds of infos 
about DUB not on the DUB server at code.dlang.org.





!Alert! code.dlang.org down

2018-01-10 Thread Martin Tschierschke via Digitalmars-d
In the moment I don't have access, hopefully this is only 
temporal problem and the rescue team for fixing is already on the 
way...




Re: vibe.d Error only with Firefox

2018-01-08 Thread Martin Tschierschke via Digitalmars-d
On Friday, 5 January 2018 at 16:47:53 UTC, Steven Schveighoffer 
wrote:

On 1/5/18 11:30 AM, Martin Tschierschke wrote:

Hello,
when starting my vibe.d service I get the message of failed 
address binding:

Failed to listen on 127.0.0.1:8030
Failed to listen on 10.0.0.1:8030
object.Exception@../../.dub/packages/vibe-d-0.8.2-rc.2/vibe-d/http/vibe/http/server.d(2035):
 Failed to listen for incoming HTTP connections on any of the supplied 
interfaces.


It's attempting to listen on localhost:8030, and 10.0.0.1:8030, 
but can't bind to either address. Then it looks like you get an 
exception. Does it actually continue running?
Yes it works, the only strange thing is, that firefox seams to 
handle the direct use of the ip-address in a strange way.


sudo netstat -nlp | grep 8030
tcp0  0 10.0.0.1:8030   0.0.0.0:* 
  LISTEN  31181/mysql-browse
tcp0  0 127.0.0.1:8030  0.0.0.0:* 
  LISTEN  31181/mysql-browse


looks o.k., (mysql-browse is my program).

I will try to minimize my program, to see if it has anything to 
do with my coding or if the error is caused by something else.


Thank you all (Steven, Webfreak and Crimaniak).

As mentioned before in "normal" environments, when using a name 
based request, there is no error, so I can work around it, but 
for people just starting with vibe + Firefox the first impression 
should not be: Oh, what the ... is that ... :-)






vibe.d Error only with Firefox

2018-01-05 Thread Martin Tschierschke via Digitalmars-d

Hello,
when starting my vibe.d service I get the message of failed 
address binding:

Failed to listen on 127.0.0.1:8030
Failed to listen on 10.0.0.1:8030
object.Exception@../../.dub/packages/vibe-d-0.8.2-rc.2/vibe-d/http/vibe/http/server.d(2035):
 Failed to listen for incoming HTTP connections on any of the supplied 
interfaces.

This has been mentioned here:
http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/3480/

The strange thing is now, that when using Chromium 
http://10.0.0.1:8030 works!

But with Firefox http://10.0.0.1:8030

gives the long Error:
400 - Bad Request

Bad Request

Internal error information:
object.Exception@../../.dub/packages/vibe-d-0.8.2-rc.2/vibe-d/stream/vibe/stream/operations.d(363):
 Reached maximum number of bytes while searching for end marker.

...
truncated

./../.dub/packages/vibe-d-0.8.2-rc.2/vibe-d/core/vibe/core/core.d:1269 void 
vibe.core.core.CoreTask.run() [0x94574a]
??:? void core.thread.Fiber.run() [0xa3c7ff]
??:? fiber_entryPoint [0xa3c562]
??:? [0x]

On the other side, when using http://localhost:8030/ or any other 
domain mapped to to 10.0.0.1 (in /etc/hosts) even Firefox works.


The error is relatively new since one of the last Firefox updates.



Re: Google alert for "dlang"

2017-12-04 Thread Martin Tschierschke via Digitalmars-d

On Sunday, 3 December 2017 at 05:12:44 UTC, Ex Nihilo wrote:
Google Search and its proxies (e.g. startpage) have also 
stopped trying to correct dlang as golang. This is a welcome 
change!

YES!!!



Re: [your code here] HexViewer

2017-08-03 Thread Martin Tschierschke via Digitalmars-d
On Thursday, 3 August 2017 at 08:47:12 UTC, Martin Tschierschke 
wrote:
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev 
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir 
Panteleev wrote:

Good idea! But I think it needs more ranges:


The format call can be substituted with writefln directly:

void main(string[] args)
{
import std.algorithm, std.format, std.stdio;
enum cols = 16;
args[1].File("rb").byChunk(16).each!(chunk =>
writefln!"%(%02X %)%*s  %s"(
chunk,
3 * (cols - chunk.length), "",
chunk.map!(c =>
c < 0x20 || c > 0x7E ? '.' : char(c;
}


Very cool!
Now you can remove: std.format,
and I would substitute: byChunk(16) with byChunk(col)

Error should be cols:  byChunk(cols)


Can you point me to the explanation of this: %(%02X %)%*s  %s  ?
Ah I found it myself: 
https://dlang.org/library/std/format/formatted_write.html

The %(  %) called "nested array formatting" was new for me.




Re: [your code here] HexViewer

2017-08-03 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 2 August 2017 at 22:02:49 UTC, Vladimir Panteleev 
wrote:
On Wednesday, 2 August 2017 at 21:59:23 UTC, Vladimir Panteleev 
wrote:

Good idea! But I think it needs more ranges:


The format call can be substituted with writefln directly:

void main(string[] args)
{
import std.algorithm, std.format, std.stdio;
enum cols = 16;
args[1].File("rb").byChunk(16).each!(chunk =>
writefln!"%(%02X %)%*s  %s"(
chunk,
3 * (cols - chunk.length), "",
chunk.map!(c =>
c < 0x20 || c > 0x7E ? '.' : char(c;
}


Very cool!
Now you can remove: std.format,
and I would substitute: byChunk(16) with byChunk(col)

Can you point me to the explanation of this: %(%02X %)%*s  %s  ?

Best regards mt.


Re: Dlang + compile-time contracts

2017-08-01 Thread Martin Tschierschke via Digitalmars-d

On Monday, 31 July 2017 at 17:54:04 UTC, Marco Leise wrote:
Coming from D.learn where someone asked for some automatism to 
turn runtime format strings to `format()` into the equivalent 
`format!()` form automatically to benefit from compile-time 
type checks I started wondering...


The OP wasn't looking for other benefits of the template 
version other than argument checking and didn't consider the 
downsides either. So maybe there is room for improvement using 
runtime arguments.


So let's add some features:
1) compile-time "in" contract, run on the argument list
2) functionality to promote runtime arguments to compile-time


This was the more precise question:
How to "promote runtime arguments to compile-time".

I forgot the exact error, but it was during using vibe.d, that 
there
was an error popping up at runtime, which I thought should have 
been detected as simple syntax violation already during compile 
time.


Making me feeling for some seconds being back at .php. :)

I think it was in a regex, where the use of ctRegex would have 
prevented me from

the runtime error.

And last but not least: Thank you Marco for sharing your thoughts 
and expertise!


Regards mt.



Re: D easily overlooked?

2017-07-14 Thread Martin Tschierschke via Digitalmars-d

On Friday, 14 July 2017 at 13:29:30 UTC, Joakim wrote:

On Friday, 14 July 2017 at 09:29:27 UTC, Wulfklaue wrote:

On Friday, 14 July 2017 at 09:02:58 UTC, Stefan Koch wrote:

The beauty of D lies in it's holistic approach.

[...]
But with tech nowadays, you need a good foundational design 
before all else.  Yes, someone else may get out of the gate 
faster with the bicycle they built out of spare parts, but once 
you get the Millenium Falcon going, it will blast by them. ;)


Off topic - but do you know this https://lilium.com/ :-)


Re: D Milestones

2017-07-12 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 12 July 2017 at 14:16:48 UTC, rikki cattermole 
wrote:

On 12/07/2017 3:14 PM, Martin Tschierschke wrote:


Please post events (even without date) you think are important.
First release of your IDE/Plugin or whatever made you more 
comfortable using D.


Since when is the IRC channel in use?


Since like 2003 when it was registered on Freenode.


Thanks. Just inserted it into the draft.


Re: D Milestones

2017-07-12 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 12 July 2017 at 13:18:54 UTC, jmh530 wrote:
On Wednesday, 12 July 2017 at 12:40:21 UTC, Martin Tschierschke 
wrote:
On Monday, 26 June 2017 at 18:16:12 UTC, Patrick Schluter 
wrote:

On Monday, 26 June 2017 at 12:58:00 UTC, Andrea Fontana wrote:

On Monday, 26 June 2017 at 10:14:08 UTC, Martin Tschierschke

[...]
So the first version 0.0.1 of this in the Wiki, please help to 
update!


https://wiki.dlang.org/Language_History_and_Future


I would recommend going through the changelogs and picking out 
some key developments. At a minimum, it provides information 
like D 2.0 was released June 17, 2007 (D 1.001 Jan. 23, 2007). 
I don't see much on the prior history.


http://dlang.org/changelog/
http://www.digitalmars.com/d/1.0/changelog.html


Thank you, will do so.

Please post events (even without date) you think are important.
First release of your IDE/Plugin or whatever made you more 
comfortable using D.


Since when is the IRC channel in use?


Re: D Milestones

2017-07-12 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 12 July 2017 at 13:11:47 UTC, Nicholas Wilson wrote:
On Wednesday, 12 July 2017 at 12:40:21 UTC, Martin Tschierschke 
wrote:
On Monday, 26 June 2017 at 18:16:12 UTC, Patrick Schluter 
wrote:

On Monday, 26 June 2017 at 12:58:00 UTC, Andrea Fontana wrote:

On Monday, 26 June 2017 at 10:14:08 UTC, Martin Tschierschke

[...]
So the first version 0.0.1 of this in the Wiki, please help to 
update!


https://wiki.dlang.org/Language_History_and_Future


If you're looking for more info Leandro's Keynote (DConf 2016?) 
has lots of history.


Yes, thanks: http://dconf.org/2016/talks/lucarella.pdf



Re: D Milestones

2017-07-12 Thread Martin Tschierschke via Digitalmars-d

On Monday, 26 June 2017 at 18:16:12 UTC, Patrick Schluter wrote:

On Monday, 26 June 2017 at 12:58:00 UTC, Andrea Fontana wrote:

On Monday, 26 June 2017 at 10:14:08 UTC, Martin Tschierschke

[...]
So the first version 0.0.1 of this in the Wiki, please help to 
update!


https://wiki.dlang.org/Language_History_and_Future



Re: CTFE Status 2

2017-07-12 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 12 July 2017 at 07:58:30 UTC, Stefan Koch wrote:
On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch 
wrote:

[ ... ]
long story short:
This is now fixed.
and
ABI bugs are HELL!

Cheers,
Stefan


As being a newbie, could you please point to a post describing 
what you are doing in more general terms. Answering the question, 
what will the new CTFE bring to us all and when should we start 
preparing a big celebration for the time it gets part of DMD?


Re: version=D_16

2017-07-12 Thread Martin Tschierschke via Digitalmars-d

On Monday, 10 July 2017 at 23:01:50 UTC, Luís Marques wrote:
On Monday, 10 July 2017 at 22:39:22 UTC, Petar Kirov 
[ZombineDev] wrote:
The problem Walter pointed to is that due to integer 
promotion, arithmetic operands of types smaller than int are 
converted to int, hence even if you use bytes and shorts you 
would end up using ints, which are expensive on CPUs with no 
native 32-bit registers. In theory, you could write your code 
so that it's easy for the optimizer to prove that you're only 
using 8 or 16 bits and variables would fit in single 
registers, so you would be able to get away without a 
performance penalty for using a language where ints are 32-bit.


Ah, that makes sense. Thanks for clarifying. For me it hasn't 
proved a problem, but I could see it being if you do a lot of 
arithmetic with 16-bit integers.


I just want to point out, that my impression is that the maker 
scene

using all this 16 bit Arm Arduino and what ever micro controllers,
would be happy to have D as an alternative for coding in C.
So BetterC and D_16 might attract a way bigger community than many
other might think. Even if this reduced language might need to be 
named D-- :-).


Re: D Milestones

2017-06-26 Thread Martin Tschierschke via Digitalmars-d

On Monday, 26 June 2017 at 12:58:00 UTC, Andrea Fontana wrote:
On Monday, 26 June 2017 at 10:14:08 UTC, Martin Tschierschke 
wrote:
I think it would be good for all which want to invest their 
time in learning D to know more about the history and probably 
the future of D.


D frontend written in d?

Yes this was exactly when I got aware of D!



D Milestones

2017-06-26 Thread Martin Tschierschke via Digitalmars-d
I think it would be good for all which want to invest their time 
in learning D to know more about the history and probably the 
future of D.


So I propose to make a new page for dlang.org:

History and Future of D.

Where the most important and interesting dates are collected, 
showing the progress of the last years.


If there is already such a page please tell me. (OK may be the 
Wikipedia page)


1999 Start of Development by Walter Bright
2007...Date? Release of D 1.0
201?...Date? Release of D 2.0
2009Release of:  The D Programming Language 1st Edition by 
Andrei Alexandrescu


2015-08-19 Release of:  Programming in D: Tutorial and Reference 
by Ali Cehreli


.  D Language Foundation setup.

2016 The D Language Foundation became a tax-exempt non-profit 
organization


2016 DLang Tour online?

2017 DMD 100% free

 DCompute (GPU-Computation) in LDC

2017 GDC to be included in GCC


What should be in the list:

New layout of dlang.org?

DUB + code.dlang.org official?

Vibe.d first public release?

First Dconf ?

The release Days of the other D books! Adam + Kai + Mike +?

New DIP Process?

D Blog since?

Adams Week in D since?

Forum = Mailinglist + Newsgroup + Website since?

Please post your dates, of exceptional occurrences which you 
think should be highlighted here.


I would try to collect this dates and put them in the D Wiki, 
with as many links to the different recourses as possible. If it 
is a good read it might get a direct link from the Dtour or the 
homepage.


Regards mt.










Re: dlang website design

2017-06-26 Thread Martin Tschierschke via Digitalmars-d

On Monday, 26 June 2017 at 08:47:46 UTC, Ecstatic Coder wrote:
Thanks for having taken the time to write this very enlighting 
post.


I think this is a very pragmatic analysis of the main roots of 
the problem, which clearly explains why D remains much less 
popular than Go, Python, Kotlin, etc despite the language 
itself is at least as modern and convenient (and even more 
IMHO).


I don't think the situation will change any time soon, so I 
feel exactly in the same mood as you.


Hence my suggession to simply make a few "cosmetic" changes to 
change D's perception on the web, to compensate for the lack of 
money and manpower.


But they won't probably be applied.

And I know that for the "do it yourself" I'm probably part of 
the problem...


I understand the frustration, brilliant language but not so well 
designed ecosystem around.
Please be aware, that even the setup of the D Foundation is still 
work in progress. So we are still waiting for the foundation to 
offer some kind of supporting memberships.


But as Andrei A. told us on DConf, the foundation already is 
paying some students (a small salary) for their work. So best 
thing we can do is to push the D Foundation (Andrei+Walter) to 
optimize the support structure.


The good thing behind these obvious missing parts is, that there 
is a strong focus on the language itself, so I am convinced, that 
D is here to stay, so that every effort in learning the language 
is a well made investment.


Regards mt. (still a bloody beginner, started with D Nov. 2015)


Re: dlang website design

2017-06-23 Thread Martin Tschierschke via Digitalmars-d

On Friday, 23 June 2017 at 08:29:33 UTC, cym13 wrote:

On Friday, 23 June 2017 at 07:44:36 UTC, Ecstatic Coder wrote:
Huh? You were asked about concrete action points that in your 
PoV would improve dlang.org. You can't just say "make it

[...]


Problem is, low profile programmers aren't the most interesting 
target for D right now

[...]
Two ideas:
A) place a changing slogan (like the changing code snippets) with
short arguments - sometimes a joke or. comic from the community.

Examples:

I think that I can safely say that nobody understands C++ 
template mechanics.
 (From the "famous" Richard Deyman 
https://dlang.org/spec/template.html)



Memory safety will kill C.
Walter Bright Link: 
https://www.youtube.com/watch?v=Lo6Q2vB9AAg&t=24m15s




The Evolution of Programmers:
:C
:C++
:D

(From the Forum + Alis talk 
https://www.youtube.com/watch?v=vYEKEIpM2zo)



Time is Money - Time is live ... Manu... (please make it complete)



80%-90% of the web is based on interpreting languages, is there 
no alternative to this waste of CPU, Time and Energy?  Vibe.d !

https://w3techs.com/technologies/details/pl-php/all/all
http://vibed.org/
EmTee

B) Idea please think about an explain flag / link beside the code 
examples,

because if you don't know the foo!baz(value) syntax.
The ! is uncommon, I first thought it is like in the "gsub!" 
expression in ruby...

but could not bring it together...:-)



Re: D needs to get its shit together!

2017-06-19 Thread Martin Tschierschke via Digitalmars-d

On Sunday, 18 June 2017 at 15:47:34 UTC, Vladimir Panteleev wrote:

On Friday, 16 June 2017 at 03:53:18 UTC, Mike B Johnson wrote:
Just try getting D installed on all 3 major systems for DMD, 
LDC, GDC, with an IDE, some utilities, possibly arm 
support(even though it's new and expected to have some 
issues), etc. The issues really start popping up when you are 
trying to use x86 + x64. Library issues that result in strange 
error messages instead of "This compiler is not compatible 
with the phobos v2.4324".


Might be worth considering something like the Android SDK 
installer. It looked like this:


http://cache.filehippo.com/img/ex/4515__android_sdk_1_8_5_15.png


+1


Re: Bad array indexing is considered deadly

2017-06-01 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 31 May 2017 at 13:04:52 UTC, Steven Schveighoffer 
wrote:
I have discovered an annoyance in using vibe.d instead of 
another web framework. Simple errors in indexing crash the 
entire application.

Is this option useful for you?

VibeDebugCatchAll 	Enables catching of exceptions that derive 
from Error. This can be useful during application development to 
get useful error information while keeping the application 
running, but can generally be dangerous, because the application 
may be left in a bad state after an Error has been thrown.


From: http://vibed.org/docs#compile-time-configuration




Re: DIP 1003 Formal Review

2017-05-12 Thread Martin Tschierschke via Digitalmars-d

On Friday, 12 May 2017 at 16:17:03 UTC, Mike Parker wrote:
The first stage of the formal review for DIP 1003 [1], "Remove 
body as a Keyword", is now underway. From now until 11:59 PM ET 
on May 26 (3:59 AM GMT on May 27), the community has the 
opportunity to provide last-minute feedback. If you missed the 
preliminary review [2], this is your chance to provide input.


At the end of the feedback period, I will submit the DIP to 
Walter and Andrei for their final decision. Thanks in advance 
to those of you who participate.


[1] 
https://github.com/dlang/DIPs/blob/fbb797f61ac92300eda1d63202157cd2a30ba555/DIPs/DIP1003.md


[2] 
http://forum.dlang.org/thread/qgxvrbxrvkxtimzvn...@forum.dlang.org

Option 3. just write //body
or /* body */ if you still want to mark the block.



Re: Fantastic exchange from DConf

2017-05-09 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 9 May 2017 at 09:22:13 UTC, Joakim wrote:

On Tuesday, 9 May 2017 at 06:15:12 UTC, H. S. Teoh wrote:
On Mon, May 08, 2017 at 06:33:08PM +, Jerry via 
Digitalmars-d wrote:

[...]


Is that a subtle joke, or are you being serious?

[...]


Heh, I saw you wrote the post and knew it would be long, then I 
kept scrolling and scrolling... :)


Please, please, please submit this as a post on the D blog, 
perhaps prefaced by the Walter/Scott exchange and with some 
links to the issues you mention and the relevant portions of 
the D reference.  I think it would do well.


+=1; Yes, good idea!


Re: Python : Pythonista / Ruby: Rubyist : / D : ?

2017-04-26 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 26 April 2017 at 15:38:16 UTC, Brad Anderson wrote:

On Friday, 21 April 2017 at 17:20:14 UTC, Vasudev Ram wrote:

[snip]

DLanger? DLangist? D'er? Doer? :)


Martian.


These seem to be all Dlighted programmers :D


Re: Interpolated strings

2017-04-20 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 19 April 2017 at 17:51:05 UTC, Nick Sabalausky 
(Abscissa) wrote:

On 04/17/2017 03:41 PM, Jonas Drewsen wrote:

[...]

   exho!"The number ${num} doubled is ${num * 2}!"
Also, it only works if you're just sending the string to 
writeln. It doesn't help the general case :(

you can define:

  auto mixinter(string x)(){return mixin(interp!x);}

(in the same scope as the vars used inside x)
 And use:

  string text = mixinter!"${name} and this are app ${age*365*24} 
hours!";



But can someone explain me why this works:

import scriptlike;
void main()
{

  auto name = userInput!string("Please enter your name");
  auto age = userInput!int("And your age");

  // The proposed notation for scriplike string interpolation

  writeln(mixin(interp!"${name} you are app. ${age*365} days 
old"));


  // with exho definition
  auto exho(string x)(){return mixin("writeln("~interp!x~")");}

  exho!"${name} and this are app ${age*365*24} hours!";
}


and this not?

import scriptlike;

// with exho definition outside the scope of the used vars

auto exho(string x)(){return mixin("writeln("~interp!x~")");}

void main()
{

  auto name = userInput!string("Please enter your name");
  auto age = userInput!int("And your age");

  writeln(mixin(interp!"${name} you are app. ${age*365} days 
old"));


  exho!"${name} and this are app ${age*365*24} hours!";
}

Can it be possible to allow a function to be defined outside the 
scope of use to return a "mixin object"?, than everything can be 
done in a lib outside, no need to add parsing complexity to the 
language?








Re: Interpolated strings

2017-04-19 Thread Martin Tschierschke via Digitalmars-d

On Monday, 17 April 2017 at 19:41:14 UTC, Jonas Drewsen wrote:
On Monday, 17 April 2017 at 19:12:37 UTC, Martin Tschierschke 
wrote:

defining a new method exho! (derived from echo + mixin...:-)

  auto exho(string x)(){
 return mixin("writeln("~interp!x~")");}

You can just write:

   exho!"The number ${num} doubled is ${num * 2}!"


It requires 'num' to be available to the exho function 
definition so will not

work in the general case.
Thats a pity, so shouldn't we than try to find a way to define a 
alias like 'shortcut'

for something like

mixin(compiletime_expresion!var)

so we can write just

shortcut!var ?

Or what about defining a new return type for functions allowing 
them to return a mixin  even if defined in a lib? (Because the 
code above is allowed but only working if exho is defined in the 
same scope as the var 'num'.)


Regards mt.





Re: Interpolated strings

2017-04-17 Thread Martin Tschierschke via Digitalmars-d
On Sunday, 16 April 2017 at 16:10:15 UTC, Nick Sabalausky 
(Abscissa) wrote:

On 04/15/2017 04:35 PM, crimaniak wrote:
On Saturday, 15 April 2017 at 20:04:13 UTC, Jonas Drewsen 
wrote:
The compiler will basically lower the $"..." string to a 
mixin that

concatenates
the expression parts of the (inside the {}) and the plain 
text parts.

It's easy implementable as a library (see
https://github.com/Abscissa/scriptlike#string-interpolation) 
so it does
not seem like a good idea to modify the language, only to 
change

interp!"" to $"".


Yea, and note, I'm still open to the idea of better names than 
"interp". I'm still not entirely happy with that name. I'm even 
half-tempted to use "_".


The only one problem I've found with doing it in library 
though: Far as I could tell, it seems to require the caller 
uses string mixins, which makes actually using it a little 
uglier and more verbose than I would like.


I was trying to get it shorter:
// From
// Output: The number 21 doubled is 42!
int num = 21;
writeln( mixin(interp!"The number ${num} doubled is ${num * 2}!") 
);


defining a new method exho! (derived from echo + mixin...:-)

  auto exho(string x)(){
 return mixin("writeln("~interp!x~")");}

You can just write:

   exho!"The number ${num} doubled is ${num * 2}!"

This now looks more like "normal" scripting than

   writeln( mixin(interp!"The number ${num} doubled is ${num * 
2}!") );


Maybe I'm overlooking something obvious, but I haven't been 
able to find a way to change it to either a template mixin or 
even just a plain template without sacrificing to whole point 
of interpolated strings: specifying the arguments 100% inline.


What I think would be ideal is a language enhancement to allow 
"interp" to do its job without the extra syntactical noise. 
That would not only give us good interpolates strings, but 
would likely have other applications as well.


I am not against the idea making string interpolations part of 
the language, in vibe.d diet templates the extrapolation is 
marked with #{var}, the ruby style, I like this too.

At the beginning I thought this is already part of d.

Regards mt.



Learning programming with D - optimizing the entry point / the environment?

2017-03-23 Thread Martin Tschierschke via Digitalmars-d

Hi,
after a year of learning D and using it for some small projects.

I think "we" should offer a Starter Kit like bundle designed to 
learn D.


My inspiration is from the Basic256 http://www.basic256.org/,
to have something similar for D, you would not need an complete 
IDE,

but it would be nice.

My last idea was, what about enhancing DUB to support the 
installation process of the different D compilers, (with DMD as 
default)?


So if we get DUB as free software in Debian -> Ubuntu & CO.

You have just one starting point (installing DUB).

Then a special option might be to install(download) the existing 
set of tutorial examples to explore the language.


Very important I think would be to add some graphics, especially 
to get the interests of kids, For example arsd.simpledisplay.d 
with its nice learning example Pong.


What do you think about this?

Regards mt.


Re: Why don't you advertise more your language on Quora etc ?

2017-03-02 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 1 March 2017 at 18:34:22 UTC, bachmeier wrote:
On Wednesday, 1 March 2017 at 17:09:51 UTC, Jared Jeffries 
wrote:


I think it should instead be advertised as the perfect 
language to learn programming and web development, because 
that's where it really shines, IMHO.


I agree, but we need an intro to programming class using D as 
the language in order to do that. Most of the materials for the 
language assume you have programming experience. You can't just 
say that D allows you to use pointers and other low-level 
constructs, you have to explain what a pointer is and what you 
do with it. The same goes for functional programming, OOP, 
contracts, compile time, and so on. That's a big task. Ali's 
book is great as an introduction to the language, but not 
really sufficient as a beginning programming tutorial.


???  I think the book is exactly written to work as an beginning 
programming tutorial.

May be my impression was wrong.

What would be very useful, would be to have one .deb learning 
package,
which including compiler an ide many simple tutorial like 
examples and

the ability to write simple programs with gui output.

Do you know basic256?
https://sourceforge.net/projects/kidbasic/
It offers a convenient programming experience for beginners.

I started to learn programming (BASIC) with an traditional home 
computer in the 80's

(Schneider/Amstrad CPC6128).

The best thing was, you only needed to switch it on and only with 
typing "DRAW 640,400" a line was drawn from the bottom left to 
the top right corner.


Now give someone a new computer and ask him to do the same?
How many years of computer experience will be needed?
How many tool would I need to install?


Regards mt.


Re: What about this logo ":D" to advertise the D language ?

2017-03-02 Thread Martin Tschierschke via Digitalmars-d

On Thursday, 2 March 2017 at 09:05:43 UTC, Jared Jeffries wrote:

I'm not completely joking ;)

D deserves a lot more fame, because it really allows 
programmers to "develop with a smile", so maybe the logo and 
slogan should reflect it...


With D you can get the job done, as with C++, Java, C#, Node.js 
etc, but easier, faster, safer and with a lot more pleasure !


D is really good at this, hence the logo :D


I like it!

The D evolution:  :-(  =>  :-| =>  :-)  =>  ;-)  => :D
Why D? Give your coding a smile :D


Re: Does anyone have a completed version of a d analogue to php's var_dump?

2017-02-27 Thread Martin Tschierschke via Digitalmars-d

On Saturday, 25 February 2017 at 06:22:02 UTC, Kevin Brogan wrote:

I can dump a struct easily enough with the following.

[...]

import std.traits;

[...]

dump!wsa;

[...]





A good addition, thank you!
To my question here: 
https://forum.dlang.org/post/foxuhcldegonvotch...@forum.dlang.org






Re: mysql user definde functions (UDF) in D

2017-01-13 Thread Martin Tschierschke via Digitalmars-d

On Friday, 13 January 2017 at 09:31:38 UTC, crimaniak wrote:
On Thursday, 12 January 2017 at 09:49:08 UTC, Martin 
Tschierschke wrote:

I am wondering has anybody tried to do it with D?

http://dev.mysql.com/doc/refman/5.5/en/adding-udf.html

By looking on the processing chain for rendering a web page, 
based on mysql data,
I thought it would be very efficient, to let mysql deliver the 
datasets already rendered as html using a template engine like 
vibe.d diet templates.

[...]

Any suggestion?


1. I don't see, why moving HTML rendering task from vibe.d 
thread to MySQL thread will give CPU benefit.
2. HTML usually bigger then data used to construct it 
(sometimes much more bigger) so it will be more traffic in 
pipe/socket between MySQL and vibe.d
3. MySQL database more hard to scale than WEB frontend so 
moving more work to MySQL makes application less scalable.

4. This will add complexity to maintain changes

So my resume: this is bad case for UDF. Really good case is 
then we have a lot of initial data to consider but relatively 
small result. For example, ForceAtlas2 UDF, I think, is more 
interesting idea.


Thank you for your thoughts!

My thought was that the main benefit of using the DB engine to do 
the layout rendering, would be that you do not need to convert db 
values to serialized data, and than convert them to values before 
you convert them to stings again.
My first idea was to make a not compiled stored procedure and 
just concat() the output together with some html, but I was told, 
that concat usually is quite ineffective, I tested it and the 
result was: It is really slow.


The second thought is: When you get the power of vibe.d inside 
mysql, than everyone who is using mysql could use vibe to do the 
dataset rendering and by this you may speedup every system using 
mysql without having to change the complete front end to vibe 
allowing a smooth migration. (?)


Now I will try to use vibe.d as a service layer between rails and 
mysql,

to do some time consuming rendering of partials.

Regards mt.




mysql user definde functions (UDF) in D

2017-01-12 Thread Martin Tschierschke via Digitalmars-d

I am wondering has anybody tried to do it with D?

http://dev.mysql.com/doc/refman/5.5/en/adding-udf.html

By looking on the processing chain for rendering a web page, 
based on mysql data,
I thought it would be very efficient, to let mysql deliver the 
datasets already rendered as html using a template engine like 
vibe.d diet templates.


At the end of this integration process even the web server could 
be integrated in the db engine. I know this has been done as 
prove of concept for an other (db) system to deliver json data 
via http.


Any suggestion?

Regards mt.


Re: Apparently there's some dlang action in spacemacs

2016-10-14 Thread Martin Tschierschke via Digitalmars-d
On Friday, 14 October 2016 at 06:26:45 UTC, Vladimir Panteleev 
wrote:
On Friday, 14 October 2016 at 06:23:15 UTC, Martin Tschierschke 
wrote:
Is there a good (emacs) mode for editing the vibe.d diet 
templates?


Not that I know of, but you could try your luck with 
https://github.com/brianc/jade-mode or 
https://github.com/ananthakumaran/jade-mode.


I tried around a while ago, but I ended with this in my .emacs,
I am not a lisp expert, to say it polite.

;; initial window
(setq initial-frame-alist
  '(
(width . 122) ; character
(height . 54) ; lines
))

(add-to-list 'load-path "~/elisp")

(add-to-list 'load-path "~/.emacs.d/vendor/jade-mode")

(require 'sws-mode)
(require 'jade-mode)
(add-to-list 'auto-mode-alist '("\\.dt\\'" . sws-mode))
(autoload 'sws-mode "sws-mode" "Major mode for editing jade 
code." t)


(autoload 'php-mode "php-mode" "Major mode for editing php code." 
t)

(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.d$" . d-mode))
(add-to-list 'auto-mode-alist '("\\.dt$" . d-mode))
(add-to-list 'auto-mode-alist '("\\.dt$" . whitespace-mode))

(setq-default tab-width 4)

So a real diet-mode would be cool :-)

Regards mt.


Re: Apparently there's some dlang action in spacemacs

2016-10-14 Thread Martin Tschierschke via Digitalmars-d
On Thursday, 13 October 2016 at 14:07:20 UTC, Vladimir Panteleev 
wrote:
On Thursday, 13 October 2016 at 13:32:42 UTC, Andrei 
Alexandrescu wrote:

https://github.com/syl20bnr/spacemacs/issues/7374

Anyone familiar with the editor? -- Andrei


The author posted here before, e.g.
http://forum.dlang.org/post/kmlorniwvjyivjyjn...@forum.dlang.org

BTW, Russel has given me commit access to the d-mode package a 
few days ago, and I've been doing some hacking on it. Among 
other things I'm pleased to say that test coverage is up to 90% 
(from 30%) :) 
https://coveralls.io/github/Emacs-D-Mode-Maintainers/Emacs-D-Mode?branch=master


Great!

Is there a good (emacs) mode for editing the vibe.d diet 
templates?


Regards

mt.


Re: CompileTime performance measurement

2016-09-06 Thread Martin Tschierschke via Digitalmars-d

On Sunday, 4 September 2016 at 19:36:16 UTC, Stefan Koch wrote:
On Sunday, 4 September 2016 at 12:38:05 UTC, Andrei 
Alexandrescu wrote:

On 9/4/16 6:14 AM, Stefan Koch wrote:
writeln and __ctfeWriteln are to be regarded as completely 
different

things.
__ctfeWriteln is a debugging tool only!
It should not be used in any production code.


Well I'm not sure how that would be reasonably enforced. -- 
Andrei


One could enforce it by defining it inside a version or debug 
block.
The reason I do not want to see this in production code is as 
follows:


In the engine I am working on, communication between it and the 
rest of dmd is kept to a minimum, because :


"The new CTFE engine abstracts away everything into bytecode,
there is no guarantee that the bytecode-evaluator is run in the 
same process or even on the same machine."


An alternative might be, to save your ctfe values in an static 
array and output them on startup of the compiled program. Same 
idea is used in vibe.d to make a caching of the templates 
evaluation possible. See: http://code.dlang.org/packages/diet-ng 
Experimental HTML template caching





D Meetup in Hamburg?

2016-09-06 Thread Martin Tschierschke via Digitalmars-d

Hi All,
anybody interested to meet in Hamburg, Germany?

Time and location will be found!

Regards mt.


Re: [DIP] In-place struct initialization

2016-08-03 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 2 August 2016 at 16:02:21 UTC, Jacob Carlborg wrote:

On 2016-07-30 23:42, cym13 wrote:
In accordance to the new DIP process you can find the full 
presentation

of the change here: https://github.com/dlang/DIPs/pull/22


I like it. I've already reported an enhancement request [1].

[1] https://issues.dlang.org/show_bug.cgi?id=15692


I am still a D newbie, but would like to vote it up!


Re: Please rid me of this goto

2016-06-24 Thread Martin Tschierschke via Digitalmars-d

On Thursday, 23 June 2016 at 23:18:03 UTC, H. S. Teoh wrote:
On Thu, Jun 23, 2016 at 11:14:08PM +, deadalnix via 
Digitalmars-d wrote:

On Thursday, 23 June 2016 at 22:53:59 UTC, H. S. Teoh wrote:
> This argument only works for discrete sets.  If n and m are 
> reals, you'd need a different argument.
> 


For reals, you can use limits/continuation as argument.


The problem with that is that you get two different answers:

lim  x^y = 0
x->0

but:

lim  x^y = 1
y->0

So it's not clear what ought to happen when both x and y 
approach 0.


[...]

First: lim  x^x = 1
   x->0

Second: Just look at Wikipedia and take the IEEE floating point 
standard:

https://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_power_of_zero


Regards mt.







Example on dlang.org // Round floating point numbers

2016-06-16 Thread Martin Tschierschke via Digitalmars-d

The example
// Round floating point numbers

with the floating point substitution using the Regex:

 reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`;

Is not so nice, because it would match for dates like 16.06.2016, 
too.


(I remember having a simmilar problem when trying to substitute 
123.44 Euro to
German format: 123,44 Euro ending up with a modified date: 
16,06.2016)


Sure this may be not the point of the example, but I dislike it 
therefore.


How to expand the Regex not to match dates?

Regards
martin


Re: Idea: swap with multiple arguments

2016-05-25 Thread Martin Tschierschke via Digitalmars-d

On Monday, 23 May 2016 at 20:01:08 UTC, Andrei Alexandrescu wrote:
So swap(a, b) swaps the contents of a and b. This could be 
easily generalized to multiple arguments such that swap(a1, a2, 
..., an) arranges things such that a1 gets an, a2 gets a1, a3 
gets a2, etc. I do know applications for three arguments. 
Thoughts? -- Andrei


A newbee question about language design:
When I looked first time at Ruby I liked the simple a,b = b,a 
syntax,

so swap. Would it be theoretically possible to allow this?

And if not, where does it breaks the general language design?

Best regards mt.


Re: Up-to-date DIPs list

2016-03-21 Thread Martin Tschierschke via Digitalmars-d

On Thursday, 17 March 2016 at 19:03:31 UTC, Seb wrote:
On Thursday, 17 March 2016 at 10:11:14 UTC, Martin Tschierschke 
wrote:
But you need both, the possibility to vote and an overview of 
threads and post with

highest votes.



Don't be offended, but I think we are a bit off-topic here - my 
suggestions were about better ways to manage DIPs. What do you 
think about putting them into a Github repo for a first start 
so that potential tooling or standardization gets a lot easier?

You are right, its getting off-topic, ;-)
unfortunately I am not very familiar with all Git tooling, but I
appreciate the idea that better tooling is needed and so Git 
should

be a good solution, because it is used anyway by the "D-crowd".
Regards mt.




Re: Up-to-date DIPs list

2016-03-19 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 16 March 2016 at 14:28:10 UTC, ZombineDev wrote:

On Saturday, 12 March 2016 at 12:49:42 UTC, Seb wrote:

Hey all,

tl;dr: D's DIPs seem not maintained. A couple of ideas are 
proposed to tackle this state.


[...]


+1

[...]
You also probably link it from the overview page 
(http://wiki.dlang.org/DIPs).


BTW all documents describing formal processes (review, 
release), design rational, etc. should be better organized.

+1

I think there should be the possibility to up-vote a post in the 
forum,

so that it gets more clear what topics are of high interest and
which not. Even if no additional comment is made.

So very useful threads can be found and used as information 
starting point even if
they get out of focus by time. Posts with high ranking, can be 
detected and used to optimize the general language documentation. 
And DIP discussions.



Same for DUB packages, my suggestion was to show the
GitHub Stars and the number of watchers and or number of 
downloads,

Sönke said he will look at it, if he finds the time...

Just my 2 cent. mt.



Re: Up-to-date DIPs list

2016-03-19 Thread Martin Tschierschke via Digitalmars-d

On Thursday, 17 March 2016 at 03:58:49 UTC, Mike Parker wrote:
On Wednesday, 16 March 2016 at 16:26:02 UTC, Martin 
Tschierschke wrote:




I think there should be the possibility to up-vote a post in 
the forum,

so that it gets more clear what topics are of high interest and
which not. Even if no additional comment is made.

So very useful threads can be found and used as information 
starting point even if
they get out of focus by time. Posts with high ranking, can be 
detected and used to optimize the general language 
documentation. And DIP discussions.


This is not an independent forum. It's a web interface to a 
newsgroup server, which also has a mailing list interface that 
many people use. Yes, it would be possible to implement 
something like that for the web interface alone, but I don't 
see how that would add any value.


The forum is sorted by time, latest first.
But what if you are new to the language? Like me.
Which threads are worth reading even if they are older?
Or if a discussion is going on since many month/years do I have 
to read all?

What are the best arguments?

Isn't the forum full of hints and best practice tips which should 
be available easier?
Keeping it in the way it is in the moment, makes it difficult to 
find the treasures

inside.

But you need both, the possibility to vote and an overview of 
threads and post with

highest votes.

Best regards mt.




Re: the most D-ish GUI library

2016-03-14 Thread Martin Tschierschke via Digitalmars-d

On Sunday, 13 March 2016 at 22:26:48 UTC, Saša Janiška wrote:


b) GtkD (https://github.com/gtkd-developers/GtkD and

There may be more or better, but I found this tutorial useful:
http://www.britseyeview.com/software/articles/ :

Getting Started with Gtkd:
http://www.britseyeview.com/software/articles/gsgtkd101.html
Regrads mt.


Re: Named arguments via struct initialization in functions

2016-03-09 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 9 March 2016 at 12:55:16 UTC, Idan Arye wrote:
[...]
An other point on my wish list would be to allow string symbol 
notation
like in ruby. Than using hashes (AA) for parameters gets more 
convenient:


:symbol <= just short for => "symbol"

h[:y]= 50; h[:x] = 100; // <=> h["y"] = 50; h["x"] = 100



String symbols are Ruby's(and many Lisps', and maybe some 
other, less popular languages) way to do untyped enums and 
untyped structs. It's a dynamically typed languages thing and 
has no room in statically typed languages like D. D mimics 
dynamic typing to some extent by creating types on the fly with 
it's powerful templates mechanism - but a new type still needs 
to be created. D is geared toward reflection on types at 
compile time, not towards type detection at run-time...

Thats true.


Allowing something like `auto params = [:y : 50, :x : 100]` 
won't really solve anything. It works nicely in Ruby, because 
Ruby has dynamic typing and with some syntactic sugar you get 
elegant syntax for dynamic structs. But in a structured 
language like D, you run into the problem that `[:y : 50, :x : 
100] is an associative array with a determined type for it's 
values, so you can't do things like `[:y : 50, :x : "hello"]` - 
which greatly limits the usability of this syntax.

Yes.Ok.
What I like about the :symbol notation is, that a string witch is 
used
only to distinguish between different objects in an Hash / AA has 
a complete different

purpose than a string used to be displayed for the user.

I think that
  writeln("Name", a[:name]); is easier to read, than
  writeln("Name", a["name"]);

especially if the structures are getting bigger, or you are in a 
vibe.d jade template string where you would have to use 
additional quoting to write:


  a(href="a[\"url\"]") a["link_text"]

  a(href="a[:url]") a[:link_text]

May be I should get rid of this by using a struct for my mysql 
results to display?

(=> a.url and a.link_text )

Just my 2 Cents :-)










Re: Named arguments via struct initialization in functions

2016-03-09 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 8 March 2016 at 18:46:02 UTC, Chris Wright wrote:

On Tue, 08 Mar 2016 13:52:09 +, Martin Tschierschke wrote:
What about this idea? A new word "as" or something similar. 
fun(ypos as y, xpos as x, radius as r); // different order!


The syntax isn't an issue.

There was one DIP about named parameters, but it was unpopular. 
It didn't change *anything* about overload resolution; it only 
had the compiler check that you provided arguments in the 
correct order, even if they were all of the same type.


Even if there were a DIP everyone liked, nobody is signing up 
to implement it. DDMD is a little scary and not reflective of 
good design in D (having been translated by machine from C++).


I might take a look, but I probably won't have the time to 
produce anything useful.


I have seen the "DIP about named parameters", and i liked the idea
of getting a easier to read code, because it gets more verbose.

My idea with the  "val as x" was to avoid the need to define the 
functions in a
different way. But as Idan Arye pointed out, it seems to be more 
difficult:


"As far as I understand, the main two problems with named 
arguments are overloading ambiguity and the fact that argument 
names are not part of the signature."


An other point on my wish list would be to allow string symbol 
notation
like in ruby. Than using hashes (AA) for parameters gets more 
convenient:


:symbol <= just short for => "symbol"

h[:y]= 50; h[:x] = 100; // <=> h["y"] = 50; h["x"] = 100

For calling a function:
auto params = [:y : 50, :x : 100] <=> auto params = ["y" : 50 , 
"x" : 100]


Especially when the code is nested in a string for mixin purpose. 
(vibe.d templates).


But maybe this crashes, because of
the ambiguity if no space after a ":" is used in this place:
auto hash = [ 1 :variable] meaning: auto hash = [ 1 : variable ]
not auto hash = [1 "variable" ] which would make no sense either.






Re: Named arguments via struct initialization in functions

2016-03-08 Thread Martin Tschierschke via Digitalmars-d

On Sunday, 6 March 2016 at 17:35:38 UTC, Seb wrote:

Hey all,

I wanted to relive the discussion on named arguments and ping 
for its current status.


There is a bunch of examples to show how needed a unified 
solution for this problem is, let me give you one from phobos 
[2].


```
// I want to allow downsizing
iota(10).sliced!(Yes.replaceArrayWithPointer, 
Yes.allowDownsize)(4);

```

There is of course the alternative solution that an author 
overloads his function to the utmost, but this results in 
complexity and duplicated code (see e.g. redBlackTree in phobos 
[3]).


Currently the best solution AFAICT is to use a struct to pass 
such flags, like


```
struct Options{int x; int y=1; int z=2;}
auto fun(Options options)
{
return options.x + options.y + options.z;
}

Options options = {x: 4, z: 3};
auto a=fun(options);
```

There are also other workarounds as discussed in [1] (e.g. with 
CTFE string analysis [4]).


I general there two solutions to this problem
1) get true named parameters support in D (probably complicated)
2) allow struct inits in functions - e.g. fun({x: 4})

For 2) Jacob Carlborg has proposed something similar three 
years ago. In his case he proposed anonymous structs which 
might be more generally applicable, however just created the 
struct seems easier and allows more
It doesn't seem that complicated to me as the compiler already 
knows the type of the argument.


Using structs is not ideal, because one can't require 
parameters, but this can be solved by having those parameters 
as normal ones like `sliced(4, {allowDownsize: true})` and it 
creates some maybe unnecessary overhead.

However it is probably the easiest solution right now.

What are your thoughts on this issue?

On a side note: many templated functions are also complicated 
and experiencing this issue, so it also might be worth to think 
about this issue too ;-)


Cheers,

What about this idea? A new word "as" or something similar.

You have defined:

int fun(int x=100, int y=100, int r=100){...}


int xpos=100;
int ypos=100;
int radius=50;


Now you are allowed to call:
fun(xpos,ypos,radius);  // normal nothing has changed!

Call with "as":

fun(ypos as y, xpos as x, radius as r); // different order!

or

fun(radius as r);  // defaults values are used.
<=>
fun(,,radius);

The compiler is looking for the right mapping?




Re: Pitching D to academia

2016-03-07 Thread Martin Tschierschke via Digitalmars-d

On Sunday, 6 March 2016 at 07:38:01 UTC, Ali Çehreli wrote:
Motivated by Dmitry's "Pitching D to a gang of Gophers" thread, 
how about pitching it to a gang of professors and graduate 
students?


I will be presenting D to such an audience at METU in Ankara. 
What are the points that you would stress? I am thinking that 
they would be interested more in whether D is better as a 
teaching tool. Do you agree?


Ali


Operator overloading!
To build and use the clean Matrix-Vector products syntax M * v 
and not:
mult_matrix_vec(M,v). Combined with all the cool templating to 
define

one function for many types.








Better Forum view.

2016-02-08 Thread Martin Tschierschke via Digitalmars-d

Hello,
it took me a while to discover, that there is a possibility to 
change the appearing of the Forum.
Stettings->View mode: Basic, Threadet, Horzontal Split, Vertical 
Split.


I like the "Vertical Split" option in general, but I dislike to 
have it on the Index Page,


So I am very much in favor for changing the behavior of the "View 
Modes" in this direction.


What do others think?
Regards mt.


Re: TIOBE February 2016.... 15 ?!

2016-02-03 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 3 February 2016 at 14:34:26 UTC, Ola Fosheim 
Grøstad wrote:

[..]
You know Comal? Isn't that a danish language that never got 
much traction outside Denmark? I remember reading danish 
computer magazines in the late 80s that devoted many pages to 
it.
Comal, Yes, it was one of our learning languages in 
School...~1984?

[...]
The voting purpose is exactly to see what are the improvements 
really needed, to get this focus.


If the D community wasn't spread out: economic/scientific, 
games, web, hobby, professional, educated, non-educated... 
There tends to be contention between those that want to see D 
strive to become a potent system level programming language and 
those that want to see D become a convenient compiled scripting 
language. Trying to move in both directions at the same time is 
bound to lead to a net slow down in progress IMHO.

Ok.






Re: TIOBE February 2016.... 15 ?!

2016-02-03 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 3 February 2016 at 12:21:05 UTC, Ola Fosheim 
Grøstad wrote:
On Wednesday, 3 February 2016 at 12:06:30 UTC, Martin 
Tschierschke wrote:

If something is around the corner, you must know!


There are many corners. Some, like the corner of compiled 
languages with automatic memory management and high level 
features have moved a lot in the past few years (Swift and Go). 
It is gone. There is no way for D to catch up with Swift and Go.
May be, I did not start to learn anything about these languages 
yet,

so I just looked on the Wikipedia pages, and I am not convinced.
Why? Syntax not C compatible, but for me this is a very strong 
argument, because everybody is defining his own similar elements 
and after "learning" some
Languages 
(Basic,Z80Asm,Pascal,Comal,Prolog,(x86Asm),C,C++,Perl,Php,Ruby 
(RoR))

I am quite happy, that D offers a 'known' syntax.
And the opportunity to use it for scripting - compiling very fast 
(#!-rdmd Execution).


By learning D, I can write a super fast web applications (vibe.d) 
+

stand alone programs for any purpose and even do scripting tasks.

Is there any other language candidate offering the same?

The other corner, taken by C, C++ and now also Rust, moves a 
lot slower and is in some areas incapable of moving. So I think 
the current focus on interfacing with C++ is the right focus, 
just keep focused on it. D needs to reach parity with common 
C++ features and then do it better across the board.

Sounds right.

[...]

And a special second list, where people can vote, which topic 
of D (language or environment) need to be improved most?


The historical challenge for D is a tendency to spread out. 
Voting is no good, it takes away focus. Then you are back to 
hunting down many corners, and D will remain one step behind.


The voting purpose is exactly to see what are the improvements 
really needed, to get this focus. I think, it is not so useful, 
that there are already min. 4 different DUB modules to access 
MySQL/MariaDB).


Re: TIOBE February 2016.... 15 ?!

2016-02-03 Thread Martin Tschierschke via Digitalmars-d
On Wednesday, 3 February 2016 at 10:43:44 UTC, Ola Fosheim 
Grøstad wrote:
On Wednesday, 3 February 2016 at 10:41:40 UTC, Martin 
Tschierschke wrote:
open for more people. Like me, frustrated from ever faster 
computers becoming slower by scripting languages and Browsers 
doing the job, where a real alternative is around the corner: 
D.


D has been around the corner for a D-ecade. The corner is 
constantly moving so that is obviously not a winning strategy.

If something is around the corner, you must know!

So I got it via this:
http://www.heise.de/developer/meldung/Programmiersprache-D-Compiler-ist-jetzt-selbst-in-D-geschrieben-2869589.html

The most read IT News Ticker in Germany, pointing to D, saying 
that the D compiler now is written in D, and what made me 
interested, the reference to C++ and Ruby.

So I started to read Wikipedia and in the end I gave it a try.

What about making a special voting list/page, where every one 
registered to the forum, can
put in, why he/she is using D and vote for other arguments giving 
+ or maybe - points.


And a special second list, where people can vote, which topic of 
D (language or environemt) need to be improved most?








Re: TIOBE February 2016.... 15 ?!

2016-02-03 Thread Martin Tschierschke via Digitalmars-d

On Wednesday, 3 February 2016 at 07:06:47 UTC, cym13 wrote:
[...]
I don't quite know what the leading factor for that change was 
but it sure will be great for its image.


Oh, I am sure I caused it myself, I am new on D and all my 
searching for it and than Bang  ! :-)


So, don't try to understand Tiobe, just be happy D is a new entry 
for top 20, and work hard to improve DMD, GDC, LDC, DUB, vibe.d 
etc... to make this real cool programming experience open for 
more people. Like me, frustrated from ever faster computers 
becoming slower by scripting languages and Browsers doing the 
job, where a real alternative is around the corner: D.


Re: How to simplyfy "getting started" ? Installation desciption at dlang suboptimal.

2016-01-26 Thread Martin Tschierschke via Digitalmars-d

On Tuesday, 26 January 2016 at 16:34:29 UTC, H. S. Teoh wrote:
[...]
Unfortunately dmd will never be part of Debian's main 
repository, because the backend has an incompatible license.


However, gdc, a gcc-based D compiler that uses the same 
frontend as dmd, is already in Debian, and probably has

[...]


As for including dub in Debian, somebody just has to do the 
packaging, and we could file an ITA and upload the package to 
Debian.

Would be cool.

When I started playing around I even installed gdc, but exactly 
these info from you should be on a download page, I think.


How to simplyfy "getting started" ? Installation desciption at dlang suboptimal.

2016-01-26 Thread Martin Tschierschke via Digitalmars-d
As an new D user but old Linux/Ubuntu user, I am used to install 
nearly everything which is possible via sudo apt-get install, so 
I searched for "Installing D with Ubuntu", because
I didn't wanted to use the package link offered on the website 
dlang.org.


I came to: http://d-apt.sourceforge.net/

where the additional hints to dub and  gtkd are very usefull.
(Not mentioning what can be done via dub)

And here: http://ljdelight.com/installing-dlang-dmd-dub-on-ubuntu/

the layout is better and libevent-dev libssl-dev for vibe.d
are mentioned, too.

So making an update at dlang.org, with a optimized page where all 
of the most important elements are described and in which order 
it is best to install would still be useful.


I think probably the best would be if "sudo apt-get install 
dmd/dub", out of the box would deliver, without the need to use 
an external repository which, is not included as default in 
Debian/Ubuntu.


Does anybody know how to form a "petition" for getting the always 
latest stable releases of D included in Debian (=>Ubuntu)?


Regards Martin T.


Re: TIOBE Januar 2016 - D rose 2 positions

2016-01-08 Thread Martin Tschierschke via Digitalmars-d

On Friday, 8 January 2016 at 13:22:07 UTC, JohnCK wrote:
On Friday, 8 January 2016 at 10:40:14 UTC, Martin Tschierschke 
wrote:

D rose again from 23th to 21th!

[...]
Old news... and there is already a topic about this: 
http://forum.dlang.org/post/orlolqpivjpddwyyh...@forum.dlang.org


JohnCK.


Sorry, missed that.


TIOBE Januar 2016 - D rose 2 positions

2016-01-08 Thread Martin Tschierschke via Digitalmars-d

D rose again from 23th to 21th!
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

The rating is now more than 1% same as many other languages in 
the ~15+ range.


Explore the history here:
http://web.archive.org/web/20150101033933/http://www.tiobe.com/content/paperinfo/tpci/index.html?lm:1417992224
Its an quite interesting.

regards mt.