Re: D jobs?

2017-11-25 Thread qznc via Digitalmars-d

On Saturday, 25 November 2017 at 13:16:19 UTC, Tofu Ninja wrote:
Are there any places to look for D jobs? It seems really hard 
to find anything online.
I got a really crappy job doing C++ and hate it to bits. Also 
if anyone is in the bay area and is in a position to higher 
maybe check out this project I have been working on in my free 
time, its a small game engine in D that I have been working on 
https://github.com/tofuninja/DGraphics.


I have an interview scheduled with Funkwerk, but that is in 
Germany. I knew about them because on of their devs wrote an 
article on the D blog. I contacted him directly and he relayed me.


You could contact Andrei and ask for some contact at Facebook. 
What happened to warp?


https://github.com/facebookarchive/warp


Re: TickDuration deprecation

2017-11-19 Thread qznc via Digitalmars-d
On Saturday, 18 November 2017 at 16:17:00 UTC, Jonathan M Davis 
wrote:
Folks have asked for the ability to create Durations from 
floating point values too, and I rejected that for the same 
reason - using floating point values with time is just begging 
for bugs, and Walter backed me up on that one.


Makes me think about my money library. It does accept floating 
point values and it has lead to at least one confused user [0]. 
Hm.


[0] https://github.com/qznc/d-money/issues/3




Re: Platform to make any programming language interactive & explorative (http://jupyter.org)

2017-11-12 Thread qznc via Digitalmars-d
On Sunday, 12 November 2017 at 12:12:43 UTC, Robert M. Münch 
wrote:
Hi, that might be some interesting project to add D to, for 
interactive exploration.


http://jupyter.org

Project Jupyter exists to develop open-source software, 
open-standards, and services for interactive computing across 
dozens of programming languages.


Last change 2 years ago, so probably some update needed.
https://github.com/DlangScience/PydMagic


Re: Advice requested for fixing issue 17914

2017-10-24 Thread qznc via Digitalmars-d

On Monday, 23 October 2017 at 16:56:32 UTC, Brian Schott wrote:

Context: https://issues.dlang.org/show_bug.cgi?id=17914

I need to get this issue resolved as soon as possible so that 
the fix makes it into the next compiler release. Because it 
involves cleanup code in a class destructor a design change may 
be necessary. Who should I contact to determine the best way to 
fix this bug?


Looking at git blame [0], I guess Martin Nowak and Nemanja Boric 
seem to be pretty involved. Not sure how deep Petar Kirov and 
Sean Kelly are into Fibers.


My question wrt to the bug: Why is munmap/freeStack called in the 
destructor? Could be done right after termination?


[0] 
https://github.com/dlang/druntime/blame/ec9a79e15d446863191308fd5e20febce2053546/src/core/thread.d#L4077


Re: D for microservices

2017-10-22 Thread qznc via Digitalmars-d

On Sunday, 22 October 2017 at 02:48:57 UTC, Joakim wrote:
This is a niche that D and all newer languages should target.  
How do we do it?


Optimize the TechEmpower benchmark? Vibe.d looks quite weak there.

https://www.techempower.com/benchmarks/



Re: What is the Philosophy of D?

2017-10-16 Thread qznc via Digitalmars-d

On Monday, 16 October 2017 at 00:25:32 UTC, codephantom wrote:
D's overview page says "It doesn't come with  an overriding 
philosophy."


Is philosophy not important?

I'd like to argue, that the problem of focusing on getting the 
job done quickly and reliably, does *not* leave behind 
maintainable, easy to understand code, but rather it leads to 
unintended outcomes ...


If the philosophy of C, is 'the programmer is in charge', what 
might the philosophy of D be?


e.g. Maximum precision in expression, perhaps?


The frontpage says "It combines efficiency, control and modeling 
power with safety and programmer productivity."


The three big words are: Convenience, Power, Efficiency.

What are the "philosophies" we are talking about? Probably the 
usual paradigms, like object-oriented, functional, etc. D 
supports them, but none of them is overriding or dominant. 
Maximum safety is another philosophy. D allows you to enhance 
safety (@safe) or diminish it (inline assembly).


Re: Why Physicists Still Use Fortran

2017-10-16 Thread qznc via Digitalmars-d

On Monday, 16 October 2017 at 00:26:20 UTC, H. S. Teoh wrote:
On Sun, Oct 15, 2017 at 03:09:21PM -0700, Walter Bright via 
Digitalmars-d wrote:

http://moreisdifferent.com/2015/07/16/why-physicsts-still-use-fortran/

Some good information there!


1-based array indexing...  I don't know, but I've become so 
accustomed to 0-based indexing that I doubt I'll ever be able 
to get used to a language with 1-based indexing.  Or whether D 
will ever be able to challenge Fortran in this respect. :P


Dijkstra made a good argument for zero-based:
https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html




Re: My first experience as a D Newbie

2017-10-11 Thread qznc via Digitalmars-d

At least on Ubuntu, this gives me an IDE:

  dub run dlangide

I have not used it much and I don't know if it works on Windows, 
but it might be the easiest way once you installed dmd and dub.


Re: D on quora ...

2017-10-07 Thread qznc via Digitalmars-d

On Saturday, 7 October 2017 at 05:19:21 UTC, Adam Wilson wrote:
I saw we ditch the lot and focus on the large languages where D 
can get some traction (C#/Java).


I don't see a chance to attack C# unless Microsoft officially 
adopts D.


Java is facing some uncertainty at the moment. The Java 9 module 
feature (Jigsaw) was forced against community/committee 
consensus. Oracle seems to let go (See EE4J). Java people are 
fine with GC, but really care for their IDE and D is lacking 
there.


With respect to GC, I consider performance a red herring. 
Everybody who really cares for performance has enough 
possibilities in D to achieve it. My short answer wrt D and GC is 
"It is not really an issue" which admittedly does not sound very 
convincing. There is a long answer which is basically the article 
series in the D blog and I believe it is convincing enough. 
People looking for a short convincing answer are just chasing 
some hype, ignore them.


I see opportunities for D in the web backend world. Microservices 
and serverless architectures make it (relatively) easy to 
introduce new languages. D needs more framework stuff for "easy 
and quick" microservices. D needs better IDE support, for example 
in hipster editors like VSCode.


I see opportunities for D in the embedded world. The people who 
try to use Java for embedded would be served very well with D. 
Crosscompiling and architecture support needs improvement though. 
I recently heard some praise for Go, which allegedly makes it 
easier than C or Rust.


I'm not sure about performance critical stuff. Maybe marketing 
C++-integration more could be helpful to get the people who rely 
on stuff like OpenCV, are forced to use C++ and dream about 
something better. We are fighting the C++ renaissance cool-aid, 
though. C++21 will surely solve all problems...


Re: Request for conference talk

2017-10-05 Thread qznc via Digitalmars-d

On Tuesday, 11 April 2017 at 21:29:15 UTC, Vasudev Ram wrote:

On Monday, 10 April 2017 at 07:32:15 UTC, qznc wrote:

And accepted :)
https://www.topconf.com/conference//duesseldorf-2017/talk/abstractions-from-c-to-d/
Abstractions: From C to D


That talk sounds interesting. If the slides and/or video are 
available after the conf, please post about it here.


Slides are available now:
http://beza1e1.tuxen.de/talks.html

Unfortunately, there is no recording. I need to find another 
opportunity to give this talk and have it recorded.


Re: Known reasons why D crashes without any message?

2017-09-14 Thread qznc via Digitalmars-d
On Wednesday, 13 September 2017 at 10:20:48 UTC, Thorsten Sommer 
wrote:
Right now, we are done with the development and ready to start 
experiments. Until now, almost anything runs fine with our unit 
tests.


Besides the unit tests, the main program is now able to startup 
but crashes after a while without any message at all. No stack 
trace, no exception, nothing. Obviously, this makes it hard to 
debug anything...


I assume you see a return code which is nonzero, because you say 
it "crashes". Which one?


Most likely would be a segmentation fault (invalid memory access, 
stack overflow, null pointer dereferenced, etc). Use a debugger. 
Compile with debug info and execute wrapped in gdb. It should 
stop right where it crashes and can show you a stack trace. If 
necessary, inspect the value of variables.


If gdb does not stop on its own, someone is calling exit to 
terminate prematurely. Set a breakpoint at exit to get a stack 
trace.


If you cannot use gdb on your server and you cannot trigger the 
crash on your desktop, maybe you can let it coredump on the 
server? Then use gdb to inspect the dump.


Did you try to annotate your code with @safe? It helps to avoid 
errors leading to segmentation faults.




Re: Let's paint those bikesheds^Werror messages!

2017-06-27 Thread qznc via Digitalmars-d
On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev 
wrote:
- Yes, not everyone likes colors. You can turn all colors off 
with a command-line switch.


Is there a way to do this globally? For example, a config file or 
an environment variable?


I'm one of the rare people who use a light background in my 
terminal (like 99% of websites). It seems only dark backgrounds 
are considered, which is understandable.


Re: What is your favorite D feature?

2017-06-22 Thread qznc via Digitalmars-d

On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote:

Hi,

I am currently trying to modernize the D code example roulette 
on the dlang.org front page [1]. Hence, I would love to hear 
about your favorite feature(s) in D.

Ideas:
- favorite language construct
- favorite code sample
- "only possible in D"

Before you ask, yes - I want to add a couple of cool examples 
to dlang.org (and yep the roulette rotation is currently broken 
[2]).


[1] 
https://github.com/dlang/dlang.org/pulls?q=is%3Apr+is%3Aopen+label%3A%22Frontpage+example%22

[2] https://github.com/dlang/dlang.org/pull/1757


H. S. Teoh calendar: 
https://wiki.dlang.org/Component_programming_with_ranges


/**
 * Formats a year.
 * Parameters:
 *  year = Year to display calendar for.
 *  monthsPerRow = How many months to fit into a row in the 
output.

 * Returns: A range of strings representing the formatted year.
 */
auto formatYear(int year, int monthsPerRow)
{
enum colSpacing = 1;
return
datesInYear(year) // Start by generating all dates for 
the given year

.byMonth() // Group them by month
.chunks(monthsPerRow) // Group the months into horizontal 
rows

// Format each row
.map!(r =>
r.formatMonths() // By formatting each month
 .array() // Storing each month's formatting in a 
row buffer
 // Horizontally pasting each respective month's 
lines together

 .pasteBlocks(colSpacing)
 .join("\n"))
// Insert a blank line between each row
.join("\n\n");
}


Re: sqlite3 vs. sqlite-d

2017-06-09 Thread qznc via Digitalmars-d

On Thursday, 8 June 2017 at 08:44:56 UTC, Russel Winder wrote:
But what is D's equivalent to Python's SQLAlchemy? C++ now has 
sqlpp11.


There is HibernateD.

http://code.dlang.org/packages/hibernated

For my own project, I used handwritten SQL. It is still on my 
todo list to replace that with HibernateD. So, no practical 
experience, yet.


Re: Phobos 2

2017-06-02 Thread qznc via Digitalmars-d

On Thursday, 1 June 2017 at 18:40:05 UTC, Brad Anderson wrote:
A (surely controversial) idea popped into my head while talking 
in #d on Freenode. The C++ guys are making an STL2 (the 
highlight of it being that it is range based). What about 
taking all the lessons learned from Phobos and creating a 
Phobos 2? It wouldn't replace the current version. You could 
import either in one program. It also wouldn't be a radical 
redesign. Most of Phobos could be used as is. What it would do 
is allow fixing some hard or impossible problems without losing 
backward compatibility.


We could do away with auto-decoding. Design it around using 
Andrei's allocators throughout. Make the GC optional from the 
start. Fix a few important naming conflicts and discrepancies.


There are problems, of course. Rampant code duplication is 
probably the biggest (though maybe public imports of identical 
code would help a lot).


I don't really expect this to go anywhere but I am curious to 
hear what changes you'd all like to see made to Phobos that 
can't happen because of backward compatibility. Also, how would 
you approach doing this? An on disk copy of Phobos with changes 
would not be an acceptable approach, I think.


Frankly, I do not see the need for Phobos2. If you want to build 
alternative packages, just go ahead and publish them via dub like 
Mir, for example. You can even make a meta package, if you find 
yourself using the same group of packages all the time. Still, 
why would you call that meta package "Phobos2"? It only confuses 
people.


If you want to rewrite parts of the standard library, build the 
alternatives first and then we can adopt them piecewise.


Nevertheless, I would love to read a detailed analysis of Phobos 
and what should be improved. Please, write a blog post somewhere. 
However, do not mention "Phobos2".


D has a painful history with two competing standard libraries. If 
you seriously propose this path, I hope Andrei and Walter will 
publicly and vehemently oppose it. Otherwise that ghost from the 
past becomes a PR disaster for D.


Re: Built-in RAII in D

2017-05-30 Thread qznc via Digitalmars-d

On Sunday, 28 May 2017 at 18:50:02 UTC, Nerve wrote:

On Sunday, 28 May 2017 at 18:38:21 UTC, Moritz Maxeiner wrote:
All in all, I see little to no benefit to what you propose, 
while requiring significant work on the language spec.


Point taken. My only remaining reservation then is the 
communication problem D has with the wider prospective 
programming world in conveying that the GC has alternatives 
that work.


I agree.

Currently, a good answer is to direct people to the "Don't fear 
the reaper" [0] article, but I feel it does not really address 
all concerns of people. Concerns like:


* How much of Phobos does not work with @nogc? A good answer 
would probably be case studies of larger programs/companies. Does 
Weka use @nogc a lot?
* How to work around the GC? The reaper article does not mention 
RefCounted.
* Limitations of @nogc? It does not prevent *another* thread to 
call the GC, which might then stop the world. We have to mention 
the trick to create threads which are not tracked by GC.
* How good is the D GC? Will it improve in the foreseeable 
future? Information about the performance of the current GC is 
quite dated, although I guess not much has changed.


Also, p0nce has some more GC tricks: 
https://p0nce.github.io/d-idioms/


[0] https://dlang.org/blog/2017/03/20/dont-fear-the-reaper/


Re: Another "D is cool" post

2017-05-30 Thread qznc via Digitalmars-d

On Tuesday, 30 May 2017 at 05:14:21 UTC, H. S. Teoh wrote:
On Tue, May 30, 2017 at 01:44:58AM +, Mike Parker via 
Digitalmars-d wrote:

On Monday, 29 May 2017 at 19:51:26 UTC, David Gileadi wrote:
> On 5/29/17 12:07 PM, H. S. Teoh via Digitalmars-d wrote:
> > [snip an excellent post]
> I think a longish post like this would make an excellent 
> shortish post for the D blog.


Yes, please.


OK, this is the 3rd or 4th time somebody asked about this.  
What exactly is involved in making a post on the D blog?  
Hopefully it would not require too much more effort, because I 
usually wouldn't have much time to spend on top of the time I 
already spent writing the original post. If it's just a matter 
of copy-n-pasting the text somewhere, then perhaps somebody 
could do that for me?


For a more general audience, I would suggest to expand the first 
paragraph and tell more about your pet project.


Some parts should be extended, so non-D-programmers can 
understand it. For example, the mention of `pragma` is probably 
confusing for C/C++ people.


Inserting  a few links would be nice (e.g. for std.array.split).

If you really want to put in work, insert lots of code examples 
with C and D versions.


Finally, a question: Did you count lines of code C vs D? Or 
better yet, number of tokens?


Anyways, I was tempted to send the forum link around, so it is 
already a nice blog post as it is.


Re: Weak Eco System?

2017-05-22 Thread qznc via Digitalmars-d

On Thursday, 18 May 2017 at 05:43:48 UTC, Manu wrote:
On 17 May 2017 at 00:51, Benro via Digitalmars-d < 
digitalmars-d@puremagic.com> wrote:



[...]

4 Hours work. Discouraged and gave up after this.



Visual Studio proper is the only IDE that 'just works' well, 
VisualD is

very good.
MonoDevelop also has good 'just works' support last I checked, 
but

debugging is much better in Visual Studio.


We could use a more precise statement than "just works".

Here is someone who likes IntelliJ IDEA's Rust support [0]. What 
I can see:


* Show documentation in tooltip
* Inline renaming of local variable (What about project-wide?)
* Completion (with semantics, I assume)
* Find all uses (of a local variable? What about project-wide?)
* One-click dependency resolution (I guess)
* Folding

What I do not see (might or might not be available):

* Advanced refactoring, like "extract function" or "converted 
lambda to named function"

* Clicking on build errors/warnings and showing them inline
* Displaying unit test status
* Integrated debugger (which should probably have various 
sub-items...)

* Integrated profiling
* GUI builder
* Color picker

[0] https://twitter.com/kot_2010/status/865861074360426496


Re: Weak Eco System?

2017-05-19 Thread qznc via Digitalmars-d

On Thursday, 18 May 2017 at 05:43:48 UTC, Manu wrote:
On 17 May 2017 at 00:51, Benro via Digitalmars-d < 
digitalmars-d@puremagic.com> wrote:



[...]

4 Hours work. Discouraged and gave up after this.



Visual Studio proper is the only IDE that 'just works' well, 
VisualD is

very good.
MonoDevelop also has good 'just works' support last I checked, 
but

debugging is much better in Visual Studio.


Maybe there should be a more precise description what works.

I guess Syntax Highlighting works nearly everywhere. Formatting 
mostly works, but people need to configure dfmt. I would assume 
refactoring works nowhere, not even VisualD.


I have no Windows, I cannot try VisualD, so do not really know. 
It would require an integrated parser instead of using the usual 
external tools (dftm, etc).


Re: Fantastic exchange from DConf

2017-05-14 Thread qznc via Digitalmars-d

On Sunday, 14 May 2017 at 02:11:36 UTC, bachmeier wrote:

On Sunday, 14 May 2017 at 00:05:56 UTC, Dibyendu Majumdar wrote:


(a) Trust the programmer.


I don't understand this point. C doesn't offer the programmer 
much to work with. If you trust the programmer, shouldn't that 
mean you provide a large set of tools and let them decide which 
parts to use? C is pretty much "here are some pointers, go have 
fun".


The C99 Rationale also says: "The Committee is content to let C++ 
be the big and ambitious language. While some features of C++ may 
well be embraced, it is not the Committee’s intention that C 
become C++."


I read that as: C is mostly in preservation and fossilization 
mode. If you want new features look elsewhere. We will not rock 
the boat.


That is probably a good thing. C has its niche and it is 
comfortable there. If you want to beat C, it will not fight back. 
The only problem is to convince the C programmers to move.


Re: Thank You DConf 2017

2017-05-06 Thread qznc via Digitalmars-d

On Saturday, 6 May 2017 at 16:44:00 UTC, Stanislav Blinov wrote:
Fantastic three days of presentations. A big Thank You to all 
presenters, organizers and sponsors, and a special Thank You to 
the team that made the livestream possible, so even those of us 
who couldn't make it to Berlin could not only learn from the 
conference but actually participate.
An awesome event and lots of food for thought, exploration, 
experimentation and implementation. Thank You!


I completely agree! :)

Now I wish the remaining people a lot of fun at the hackathon and 
wait for some talks I missed to be published.


Re: On Andrei's Keynote / checkedint

2017-05-06 Thread qznc via Digitalmars-d
On Saturday, 6 May 2017 at 14:14:25 UTC, Andrei Alexandrescu 
wrote:

[0] http://beza1e1.tuxen.de/leaky_abstractions.html


Nice job writing a post so quickly!


It was a coincidence. It took longer. That post is part of my 
preparation for another conference [0], but that talk will be 
strongly influenced by DbI and other tidbits from DConf. ;)


[0] 
https://www.topconf.com/conference//duesseldorf-2017/talk/abstractions-from-c-to-d/


Re: Adding D code to a C++ codebase

2017-05-06 Thread qznc via Digitalmars-d

On Saturday, 6 May 2017 at 11:44:28 UTC, Russel Winder wrote:
CLion, IntelliJ IDEA, Eclipse/CDT, Xcode, and Visual Studio 
seem to be the IDEs of the moment. There is effort to get D 
support in IntelliJ IDEA, but CLion is where the C++ folk are. 
Eclipse/CDT appears to have lost all activity on the D support. 
I'm on Linux so Visual Studio is not an possibility.


There is a plugin for IntelliJ [0], but I have not tried it. I 
don't know the Jetbrains products. Is Clion and IntelliJ IDEA the 
same core with different plugins and branding or is it really 
different?


[0] https://github.com/intellij-dlanguage/intellij-dlanguage




Re: On Andrei's Keynote / checkedint

2017-05-06 Thread qznc via Digitalmars-d

On Saturday, 6 May 2017 at 10:45:56 UTC, qznc wrote:
I just watched Andrei's Keynote slightly delayed so I could not 
ask live via chat. One question and one remark:


1. ...

2. ...


3. Checkedint has the same problem as std::string in C++, which 
Scott Meyers highlighted in his keynote the day before: Literals 
are not wrapped, so `checked_x + 42 + 42` may behave differently 
to `42 + 42 + checked_x`.


On Andrei's Keynote / checkedint

2017-05-06 Thread qznc via Digitalmars-d
I just watched Andrei's Keynote slightly delayed so I could not 
ask live via chat. One question and one remark:


1. Is there any reason to restrict this to integrals? Why not use 
Checked!(float,H) or Checked!(complex,H) or 
Checked!(polynomial,H)? If it is more general, then we should 
change the name as long as we still can (it is experimental).


2. With respect to "Where did you steal all this money?": I 
recently [0] read about the Metaobject Protocol (MOP) and I 
noticed some similarities. MOP comes from the Lisp world, where 
things are more dynamic, but also compile-time and run-time are 
not that clearly separated. At least the intention of Gregor 
Kiczales and Andrei's DbI match. In Kiczales words from 1992 [1]: 
"for those cases where the underlying implementation is not 
adequate, the client has a more reasonable recourse. The 
meta-level interface provides them with the control they need to 
step in and customize the implementation to better suit their 
needs"


[0] http://beza1e1.tuxen.de/leaky_abstractions.html
[1] 
https://pdfs.semanticscholar.org/39ea/ec97dde6db7e2245e9b8dc662652a3cefa64.pdf


Re: Fantastic exchange from DConf

2017-05-06 Thread qznc via Digitalmars-d

On Saturday, 6 May 2017 at 06:26:29 UTC, Joakim wrote:
Walter Bright: I firmly believe that memory safety is gonna be 
an absolute requirement moving forward, very soon, for 
programming language selection.


Scott Meyers: For, for what kinds of applications?

Walter: Anything that goes on the internet.

Scott: Uh, let me just, sort of as background, given the 
remaining popularity of C, unbelievable popularity of C, which 
is far from a memory-safe language, do you think that that... 
I'm having trouble reconciling the ongoing popularity of C with 
the claim that you're making that this is going to be an 
absolute requirement for programming languages going forward.


Walter: I believe memory safety will kill C.

Scott: ... Wow.
https://www.youtube.com/watch?v=_gfwk-zRwmk#t=8h35m18s

The whole exchange starts with a question at the 8h:33m mark 
and goes on for about 13 mins, worth listening to.


I agree with Walter that safety will be big going forward, 
should have been big already.


Hm, Sociomantic removes the live captures the next day?

One request: Chop the panel discussion into one clip per 
question/topic, please. Alternatively, provide some means to 
easily jump to the start of each question.


Re: DConf 2017 Berlin - Streaming ?

2017-05-05 Thread qznc via Digitalmars-d

On Friday, 5 May 2017 at 06:33:13 UTC, Joakim wrote:

On Friday, 5 May 2017 at 06:32:31 UTC, Joakim wrote:

They were posted to reddit, Mike will probably do it again.


Whoops, forgot to give the reddit link:

https://www.reddit.com/r/programming/comments/696310/d_programming_language_conference_2017_day_1_live/


I guess the best link every time is: 
https://www.youtube.com/user/sociomantic/live


Re: Thoughts from newcommer

2017-04-12 Thread qznc via Digitalmars-d

On Wednesday, 12 April 2017 at 19:31:06 UTC, thedeemon wrote:

On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote:


http://benchmarksgame.alioth.debian.org/

Why D is not there?


Because maintainer of that site doesn't want D there, as I 
remember from previous discussions. At some point (years ago) D 
was present there, then removed. C and C++ programs are 
trivially translatable to D and compiled with the same LLVM 
backend with LDC, so whatever speed is shown by C and C++ there 
can usually be repeated in D.


No. Isaac is very cooperative. He usually pops up quickly, if 
someone mentions benchmarksgame.


https://forum.dlang.org/post/wcownwoteiownrtni...@forum.dlang.org
https://forum.dlang.org/post/rrfbuokpyhjsusuxq...@forum.dlang.org
https://forum.dlang.org/post/iskkpwaaaqlcgjymh...@forum.dlang.org


Re: Walter and Andrei and community relationship management

2017-04-12 Thread qznc via Digitalmars-d

On Wednesday, 12 April 2017 at 07:51:28 UTC, Joakim wrote:

On Tuesday, 11 April 2017 at 19:18:32 UTC, H. S. Teoh wrote:
On Tue, Apr 11, 2017 at 10:24:01AM -0700, Walter Bright via 
Digitalmars-d wrote:

On 4/11/2017 2:18 AM, qznc wrote:
> It usually comes down to charismatic and visionary leaders. 
> Walter and Andrei are good with that, otherwise D would 
> have faltered long ago.


For a socially inept nerd such as myself, with all the 
charisma of a lamppost, I think D has done very well.


You underestimate yourself. While you're no charismatic hero 
by any stretch of imagination, you do carry quite some weight 
in what you say simply by your history of achievements, as 
well as your technical expertise and wealth of experience in 
computer-related issues. It's no surprise that in this crowd 
full of like-minded nerds who respect technical expertise, 
you're doing none too badly.  It might be a completely 
different story if you were in a more "typical" social 
setting, though. :-P


I was going to say something similar.  I have seen responses in 
reddit/HN threads where devs were in awe that Walter Bright 
responded to them.  In the tech community, which has 
_completely_ different ideas of what constitutes charisma and 
vision, Walter and Andrei, with his distinguished history and 
very entertaining talks, are pretty much the definition.  That 
is not the issue, D has those in spades.


+1

I'm not sure if Walter can claim to have written a complete C++ 
compiler all by himself. Even if not, he is probably the one 
person on this planet, who is closest.


Walter is also pretty good with nerd-sniping [0]. ;)

[0] Example: 
https://forum.dlang.org/post/mg13tc$2ptk$1...@digitalmars.com


Re: Request for conference talk

2017-04-11 Thread qznc via Digitalmars-d

On Tuesday, 11 April 2017 at 21:29:15 UTC, Vasudev Ram wrote:

On Monday, 10 April 2017 at 07:32:15 UTC, qznc wrote:

And accepted :)
https://www.topconf.com/conference//duesseldorf-2017/talk/abstractions-from-c-to-d/
Abstractions: From C to D


That talk sounds interesting. If the slides and/or video are 
available after the conf, please post about it here.


Sure. The last TopConf conferences were published to Youtube.

I have a plan for the content, but it is not final. If you have 
any suggestions, I'd like to hear them. :)


Re: Thoughts from newcommer

2017-04-11 Thread qznc via Digitalmars-d

On Tuesday, 11 April 2017 at 19:57:19 UTC, Piotr Kowalski wrote:
Two other important things to change people minds about D 
performance:


http://benchmarksgame.alioth.debian.org/

Why D is not there?


I worked on that [0] and decided its not worth it. It is 
literally a "game". You can have some fun tuning benchmark 
programs. You should not let it influence your decision making.


If you want to talk about performance, articles like the one on 
Mir GLAS [1] provides better information.


[0] https://github.com/qznc/d-shootout
[1] 
http://blog.mir.dlang.io/glas/benchmark/openblas/2016/09/23/glas-gemm-benchmark.html




Re: The D ecosystem in Debian with free-as-in-freedom DMD

2017-04-11 Thread qznc via Digitalmars-d

On Tuesday, 11 April 2017 at 12:56:59 UTC, Jonathan M Davis wrote:
But if we just use dub - which _is_ the official packaging and 
build tool - then we avoid these issues. Ideally, the compiler 
and dub would be part of the distro, but libraries don't need 
to be. And it sounds like that's basically how the Go and Rust 
folks want to function as well. So, it would make sense for 
these languages to simply not have their libraries be included 
in distros. The build tools are plenty.


This is not compatible with Debian. Debian requires to include 
*everything*. You must be able to build every package without 
network access only from source packages.


Essentially, somebody must fix this dub issue: 
https://github.com/dlang/dub/issues/838





Re: Walter and Andrei and community relationship management

2017-04-11 Thread qznc via Digitalmars-d

On Tuesday, 11 April 2017 at 02:20:07 UTC, Walter Bright wrote:

On 4/10/2017 6:04 PM, Jonathan M Davis via Digitalmars-d wrote:
LOL. IIRC, there have been cases where you and/or Andrei have 
actually tried
to get folks to do specific stuff, and it generally hasn't 
worked. Pretty
much everything that gets done around here is because someone 
steps and does

it.


It pretty much totally doesn't work, even when the person asks 
"what can I work on?"


It's an interesting management problem, one I've never seen 
covered in management books, which never seem to cover 
volunteer organizations.


I'd say it is more about politics than management theory. At 
least in the lower ranks of politics. Local affairs are driven by 
volunteer work as well.


It usually comes down to charismatic and visionary leaders. 
Walter and Andrei are good with that, otherwise D would have 
faltered long ago.


Re: The D ecosystem in Debian with free-as-in-freedom DMD

2017-04-10 Thread qznc via Digitalmars-d

On Monday, 10 April 2017 at 11:40:12 UTC, Matthias Klumpp wrote:
  1) Is there some perspective on D getting a defined ABI that 
works with all major D compilers?
  2) What would the D community recommend on how to deal with 
the ABI issues currently? A Linux distribution is a bunch of 
tightly integrated software, and changing one piece in an 
incompatible way (e.g. by building it with LDC instead of DMD) 
will have consequences.
  3) Will DMD support more architectures in the near future? 
How should the architecture issue be handled?


My prediction for Walters reply:

1) No. Not worth it, because templates, ctfe, etc.
3) No. Not worth it, because D frontend stuff is more important.

Also: If you want to help out Debian's D team, feel free to 
ping me or any other D team member (we are very short handed 
and are only two active people right now). See 
https://wiki.debian.org/D (caution, wiki page is very outdated, 
last touched in 2012)


Tentative ping, but that Wiki page is not helpful. The linked svn 
repo is empty. Where and how do you work?


I guess the issue are still the same as you wrote here (except 1. 
is solved):

https://gist.github.com/ximion/fe6264481319dd94c8308b1ea4e8207a

So, mostly dub needs work, I guess.


Re: The D ecosystem in Debian with free-as-in-freedom DMD

2017-04-10 Thread qznc via Digitalmars-d

On Monday, 10 April 2017 at 11:40:12 UTC, Matthias Klumpp wrote:

So, in summary:
  1) Is there some perspective on D getting a defined ABI that 
works with all major D compilers?
  2) What would the D community recommend on how to deal with 
the ABI issues currently? A Linux distribution is a bunch of 
tightly integrated software, and changing one piece in an 
incompatible way (e.g. by building it with LDC instead of DMD) 
will have consequences.
  3) Will DMD support more architectures in the near future? 
How should the architecture issue be handled?


I am interested in some feedback here, since I currently can't 
see a good way to address these issues.


How do Debian and C++ go along? There is no ABI compatibility 
between GCC and Clang afaik.


I general, I would favor to build stuff with LDC instead of DMD, 
because of performance.


Re: Request for conference talk

2017-04-10 Thread qznc via Digitalmars-d

On Friday, 3 February 2017 at 12:08:44 UTC, qznc wrote:
Topic idea two: A more general talk about abstractions. 
Starting from the basics (procedures) up to 
Design-by-Introspection techniques which are quite D specific. 
In between stuff like the "magic" D Lua bindings. This topic is 
probably interesting for C++ and Java programmers as well. 
Other TopConf talks and thus the audience seem to be quite 
mainstream.


And accepted :)

https://www.topconf.com/conference//duesseldorf-2017/talk/abstractions-from-c-to-d/

Abstractions: From C to D

Abstraction is about hiding the irrelevant to focus on the 
relevant.


A master in the art of abstraction will find the right balance 
between the over-engineered swiss army knife and the tedious 
boilerplate. This talk starts at common ground for many people: 
The C programming language. Then we explore more powerful 
techniques of abstraction enabled by the D programming language 
with its unique meta programming techniques.


Reading on D safety?

2017-03-30 Thread qznc via Digitalmars-d
Safety of C has been in the (hacker) news lately [0]. When I 
tried to tell people about D, I had no good link to share on the 
topic.


The spec for @safe [1] is not comprehensive.

The article of SafeD [2] is fluffy and without much meat.

The C to D comparison is too much irrelevant stuff.

I found nothing on the blog.

The topic of safety is an important one imho. It comes up again 
and again. D has a good story to tell about being easier than 
Rust and safer than C++. How should this be addressed? A blog 
article?


[0] https://news.ycombinator.com/item?id=13966241
[1] https://dlang.org/spec/function.html#function-safety
[2] https://dlang.org/safed.html


Re: Zcoin implementation bug enabled attacker to create 548, 000 Zcoins

2017-03-09 Thread qznc via Digitalmars-d

On Tuesday, 7 March 2017 at 15:34:54 UTC, ketmar wrote:

Jack Stouffer wrote:


On Tuesday, 7 March 2017 at 15:05:45 UTC, ketmar wrote:

only for primitive types, sadly.

void main () {
Object a, b;
a == b;
}

oops. no more error messages. yes, i know that this invokes 
`opEquals()`, and `opEquals()` can have side-effects. but 
what are the chances of writing such code *intentionally*?


Hmm, I guess the compiler can (and should) output an error 
message if it knows that opEquals is `pure`.


https://issues.dlang.org/show_bug.cgi?id=17245


yet Object's `opEquals()` is not pure (and it cannot be, to 
allow non-pure overloads). still, the code i've written has no 
sense.


I'm curious. Where does it make sense for opEquals to be 
non-pure? Likewise opCmp, etc.


Maybe we want to support weird DSLs, where operators are reused 
with very different semantics? For example, the pyparsing parser 
generator allows you to write a grammar like [0] this:


  exp << Group(lparen + op + (number | exp) + (number | exp) + 
rparen)


[0] 
http://pyparsing.wikispaces.com/file/view/pycalc.py/480674428/pycalc.py


Re: Spotted on twitter: Rust user enthusiastically blogs about moving to D

2017-03-07 Thread qznc via Digitalmars-d

On Tuesday, 7 March 2017 at 03:04:05 UTC, Joakim wrote:

https://z0ltan.wordpress.com/2017/02/21/goodbye-rust-and-hello-d/


"A much much safer language than C++ while being much more 
programmer-friendly than Rust."


Nice quote. :)

I somewhat wonder about "Arrays (arguably the most important data 
structure) are actually sane, consistent, and very much logically 
intuitive in D unlike the mess that’s C (and C++)." At some 
points, people get bitten by the determinism issue [0]. Probably, 
z0ltan was lucky so far. Nevertheless, arrays/slices are the way 
they are for good reasons.


[0] https://dlang.org/d-array-article.html


Re: Range with lookaround

2017-03-02 Thread qznc via Digitalmars-d
On Thursday, 2 March 2017 at 01:44:19 UTC, Andrei Alexandrescu 
wrote:
May be worth discussing in here: 
https://issues.dlang.org/show_bug.cgi?id=17238 -- Andrei


I don't understand the use case. PR #5153 seems to be about 
getting the last element, not about some lookahead. When I think 
about lookahead, I always think of parsers. If the lexer provides 
an input range of tokens, my recursive descent parser might need 
3 tokens lookahead, for example. For the lexer input a "push back 
a character into my input" is more convenient.


Should it give some performance guarantees? I guess, we don't 
want to refresh the buffers at every popFront, so it would 
probably be as lazy as possible.




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

2017-03-02 Thread qznc via Digitalmars-d
On Thursday, 2 March 2017 at 09:45:40 UTC, Martin Tschierschke 
wrote:

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


Isn't it :C => :C++ => :D

Much better than :C# of course.


Life is better with community automation

2017-02-08 Thread qznc via Digitalmars-d
I just watched this talk "Life is better with Rust's community 
automation" by E. Dunham


Video: https://youtu.be/dIageYT0Vgg
Blog post: 
http://edunham.net/2016/09/27/rust_s_community_automation.html 
(Not the same talk, but very close and by the correct 
speaker/blogger)


Some of the 2017 H1 vision [0] concerns "Improve process 
(release, DIPs, deprecations/enhancements)" and "Improve 
operational efficiency". So community automation fits the agenda.


I guess most people are roughly aware of the Rust tooling (bors, 
highfive, etc). Somethings are replicated with D, but we don't 
anthropomorphize [1] our tools.


One thing, I did not know yet was the Servo Starters website [2]. 
Servo is not Rust itself, but its biggest "demo" project. The 
starters website is for newbies, who would like to contribute a 
little. It maintains a list of open issues for newbies and 
filters them a little.


With D, we just point people to the wiki [3]. Maybe this approach 
would be a little more inviting?


[0] https://wiki.dlang.org/Vision/2017H1
[1] https://auto-tester.puremagic.com/
[2] https://starters.servo.org/
[3] https://wiki.dlang.org/Get_involved


Re: Request for conference talk

2017-02-03 Thread qznc via Digitalmars-d
On Thursday, 2 February 2017 at 21:09:38 UTC, Chris Engelbert 
wrote:

Hey guys,

we organize a conference (TopConf) this year for the first time 
in Dusseldorf, Germany. I would like to see if there are 
interested speakers to give a talk about D. The conference is 
hold in English and is not specific to a single programming 
language but will feature multiple different ones as well as 
some more soft-skill like sessions / tracks.


I'm looking forward to see if there are interested people. The 
CFP page is available here: 
https://www.topconf.com/conference/duesseldorf-2017/callforpaper



I'm tempted and will think about it.

Topic idea one: Dust off my "Functional Programming in D" [0] 
talk. However, it is tight in 40 minutes for an audience, which 
probably does not know D at all.


Topic idea two: A more general talk about abstractions. Starting 
from the basics (procedures) up to Design-by-Introspection 
techniques which are quite D specific. In between stuff like the 
"magic" D Lua bindings. This topic is probably interesting for 
C++ and Java programmers as well. Other TopConf talks and thus 
the audience seem to be quite mainstream.


[0] http://beza1e1.tuxen.de/articles/functional_D.html


Re: Snap packages for D compilers and core projects

2017-02-03 Thread qznc via Digitalmars-d
On Monday, 30 January 2017 at 16:53:34 UTC, Joseph Rushton 
Wakeling wrote:
Snap packaging started as something Ubuntu were developing for 
their use-case, but started gaining cross-distro interest last 
year (probably because AFAICT its feature-set and simplicity of 
use is quite a bit ahead of alternatives like Flatpak).


I just tried FlatPak and Snap. Snap is actually useable.

FlatPak might be superior technology with its sandboxing, but I'm 
no expert. FlatPak has no central repository, which makes it 
unuseable for the layman at the moment. It feels like the PPA 
situation in Ubuntu.


Snap has stuff like pulseaudio (audio daemon) or ogre (rendering 
engine) in the repo. That seems weird, because these are not 
applications. The first belongs into the base system, the second 
into a development environment.


Re: Snap packages for D compilers and core projects

2017-01-30 Thread qznc via Digitalmars-d
On Sunday, 29 January 2017 at 20:07:50 UTC, Joseph Rushton 
Wakeling wrote:
The question is, (i) is this a welcome proposal? and (ii) if it 
is welcome, what do people see as the best way to go about this?


No comments? Well, there seems to be no downside (apart from the 
work).


So far, I considered Snap an Ubuntu-only initiative of 
yet-another-package-format. If it really gains cross-distro 
support, this is a great way for better D support on Fedora, 
Arch, etc. What is the evidence for cross-distro support? Can it 
be measured somehow?


Is it legally possible to distribute DMD this way? Afaik only 
dlang.org is allowed to distribute it publically due to the 
backend licence issue.


Re: A mini D book: Markdown or LaTeX?

2017-01-26 Thread qznc via Digitalmars-d

On Thursday, 26 January 2017 at 02:41:24 UTC, Walter Bright wrote:

On 1/24/2017 6:27 AM, aberba wrote:
Which one works well? I'm more concerned about syntax 
highlighting and line

numbering (in some cases). Support for custom fonts.


I've used Ddoc to publish a couple of Kindle books.


https://www.amazon.com/s/ref=dp_byline_sr_ebooks_1?ie=UTF8&text=Walter+Bright&search-alias=digital-text&field-author=Walter+Bright&sort=relevancerank

"The Historian's History of the World Vol. 1: Prolegomena: Egypt, 
Mesopotamia"


What about Vol. 2? ;)


Re: A mini D book: Markdown or LaTeX?

2017-01-24 Thread qznc via Digitalmars-d

On Tuesday, 24 January 2017 at 14:27:15 UTC, aberba wrote:
Which one works well? I'm more concerned about syntax 
highlighting and line numbering (in some cases). Support for 
custom fonts.


I used Sphinx here: https://qznc.github.io/d-tut/

The syntax "ReStructured Text" is more ugly than Markdown, but 
has more features (e.g. different kinds of blocks). Sphinx can 
generate HTML, LaTeX, EPub, and more.


http://www.sphinx-doc.org/


Re: Red Hat's issues in considering the D language

2016-12-22 Thread qznc via Digitalmars-d
On Wednesday, 21 December 2016 at 17:49:43 UTC, Johannes Pfau 
wrote:

Am Wed, 21 Dec 2016 08:18:48 -0500
schrieb Andrei Alexandrescu :


On 12/20/16 6:08 PM, Andrei Alexandrescu wrote:
> Hello, a few engineers at Red Hat are taking a look at using 
> the D language on the desktop and have reached out to us. 
> They have created a list of issues. We are on the top-level 
> ones, and of course would appreciate any community help as 
> well.

>
> https://gist.github.com/ximion/77dda83a9926f892c9a4fa0074d6bf2b

An engineer from Debian wrote down what's needed on the 
distribution side to give a green light to the D language:


https://gist.github.com/ximion/fe6264481319dd94c8308b1ea4e8207a


From a compiler dev point of view I think one of the most 
important issues is the stable ABI. Many of the compiler 
specific problems could be solved easily if we could mix code 
from different compilers.


Rust is considering to install packages as source code.

https://internals.rust-lang.org/t/debian-rust-packaging-policy-draft/4453

Not an ideal solution. Having a stable ABI would be better. A 
pragmatic idea, though.


Re: D future ...

2016-12-20 Thread qznc via Digitalmars-d

On Tuesday, 20 December 2016 at 10:18:12 UTC, Kelly Sommers wrote:
The things I really want from D to really sway me would be the 
following (some already exist):

1. Evolve the GC like Go has.
2. No overhead calling C libraries.
3. Easily composable libraries.
4. Good IDE support.


I agree.

1. takes surprisingly long. There is still no precise GC.

2. and 3. are already there. Well, libraries are never perfect, 
of course.


4. is proceeding, but slowly. Afaik no core dev uses an IDE.



Re: D future ...

2016-12-20 Thread qznc via Digitalmars-d

On Tuesday, 20 December 2016 at 08:41:21 UTC, Benjiro wrote:
F*ck this. Its like talking to walls. Anyway, do what you want. 
I have my own projects to deal with and i can write around the 
lacking libraries, documentation etc. Unfortunately, not 
everybody can and its those people you are hurting with that 
wiseass attitude. Good luck getting new people motivated in D 
like that.


What did you expect with a rant like that?

You vented your anger. This is fine. Some concrete actions were 
already taken (e.g. Andrei filed an issue about writeln). People 
should do this more often, because core-devs are blind to issues 
such as writeln documentation. They never look that up. Thanks 
for that!


However, into your rant mixed proposals in a "wiseass attitude" 
with lots of bikeshedding potential. Naturally, people react to 
that and shoot it down. If you want to do something like that 
again, my advice would be: Delay the proposals until the very end 
and write in a very humble way. Describing the problems precisely 
is worth more than coming up with ideas for a solution anyways.


Re: The Computer Language Benchmarks Game - no D

2016-12-19 Thread qznc via Digitalmars-d

On Sunday, 18 December 2016 at 22:50:36 UTC, Brad Anderson wrote:

On Sunday, 18 December 2016 at 21:29:05 UTC, jmh530 wrote:

On Sunday, 18 December 2016 at 21:26:36 UTC, Boston wrote:
Some days ago I'd been looking for comparisons between 
different programming languages, and I found this site:


It's been discussed on the forum before.


Yeah, many times. We'd all like to see D there but Isaac Gouy 
(the maintainer of the language shootout) has made it pretty 
clear D isn't getting on there but he welcomes anyone to use 
the shootout's infrastructure to run their own benchmarks for D 
and put it up on their own site.


I did this [0].

Eventually, I stopped because so many of the benchmark programs 
are not worth it these days. The most useful benchmark is 
regexdna. It compares D's stdlib regex engine with established 
C/C++ libraries. However, you could use the C/C++ libraries in D 
just as well. So, is that a meaningful comparison?


Where C/C++ wins over D (well LDC), it is usually about some 
builtins for SSE instructions. Those are not portable in C or D, 
though.


[0] https://github.com/qznc/d-shootout


Re: A betterC modular standard library?

2016-12-18 Thread qznc via Digitalmars-d

On Sunday, 18 December 2016 at 14:37:55 UTC, Radu wrote:

On Sunday, 18 December 2016 at 09:26:09 UTC, Ilya Yaroshenko

Who is interested in betterC _modular_* standard library?
I am planing to make libmir org a community for it.
Thought and concerns?


I hope this doesn't turn into a new Tango vs. Phobos war.


My first thought as well. Probably an irrational fear, but the 
question will pop up often.


Re: Making preconditions better specified and faster

2016-12-16 Thread qznc via Digitalmars-d
On Thursday, 15 December 2016 at 18:48:22 UTC, Andrei 
Alexandrescu wrote:

https://issues.dlang.org/show_bug.cgi?id=16975


Whenever I think about preconditions and speed, I think that they 
should actually be put into the caller instead of into the 
function/callee. The chance that intra-procedural optimization 
can remove the checks increases. Of course, inlining voids the 
discussion, but think about the non-inline case.


pragma(inline, false)
int twice(int x)
  in { assert(x < int.max / 2); }
  body { return x + x; }

void main() {
  int x = 42;
  int y = twice(x);
}

You can put the check at the front of twice, which makes it 
necessary to evaluate the check at runtime. Alternatively, put 
the check into the main function, where constant propagation and 
folding can easily remove the check.


Obviously, the downside is code size when precondition-functions 
are called from more than one point.


(This is probably off-topic for the issue, thus my comment here)


Re: [OT] Interesting blog post on disadvantages of the pure functional paradigm

2016-12-09 Thread qznc via Digitalmars-d

On Friday, 9 December 2016 at 10:25:49 UTC, Kagamin wrote:

On Friday, 9 December 2016 at 10:01:13 UTC, qznc wrote:

http://beza1e1.tuxen.de/articles/functional.html


What about python and javascript?


Python and Javascript are mixed paradigm languages. You could 
argue if purity and immutability are part of FP, then Python and 
Javascript lack essential parts of FP and are not mixed. That is 
a good point. It is also what hardcore FP programmers think about 
those languages. They pity them.


If FP is about being declarative, then logic programming (Prolog) 
is even more so.


Re: [OT] Interesting blog post on disadvantages of the pure functional paradigm

2016-12-09 Thread qznc via Digitalmars-d

On Friday, 9 December 2016 at 09:58:27 UTC, Kagamin wrote:

Functional doesn't imply purity and immutability


I disagree.

What is your definition of Functional Programming? Mine: 
http://beza1e1.tuxen.de/articles/functional.html




Re: Should we warn if we detect null derefernces or void value uses ?

2016-12-08 Thread qznc via Digitalmars-d

On Monday, 5 December 2016 at 04:41:55 UTC, Stefan Koch wrote:
 This requires data-flow analysis (The same kind that tells you 
if you are skipping a statement)
And will slow down compilation a little if we enable such a 
warning.



I would rather see a separate tool for stuff like this. It can be 
much slower and do much more analysis.


Compare: clang-analyzer http://clang-analyzer.llvm.org/



Re: Joe Duffy on concurrency

2016-12-01 Thread qznc via Digitalmars-d

On Thursday, 1 December 2016 at 12:17:46 UTC, Barry wrote:

http://joeduffyblog.com/2016/11/30/15-years-of-concurrency/





delegate void PureFunc() immutable;


This meant that a lambda conforming to the PureFunc interface 
could only close over immutable state.


Notice how powerful this has suddenly become! This PureFunc is 
precisely what we would want for a parallel task. As we will 
see shortly, these simple concepts alone are enough to enable 
many of those PFX abstractions to become safe.


That is an interesting idea. Afaik, D does not allow to limit 
closure like this?


ESA's Schiaparelli Mars probe crashed because of integer overflow

2016-11-24 Thread qznc via Digitalmars-d
Although, the article [0] does not say that literally, it sounds 
like an integer overflow:


After trawling through mountains of data, the European Space 
Agency said Wednesday that while much of the mission went 
according to plan, a computer that measured the rotation of the 
lander hit a maximum reading, knocking other calculations off 
track.


That led the navigation system to think the lander was much 
lower than it was, causing its parachute and braking thrusters 
to be deployed prematurely.


"The erroneous information generated an estimated altitude that 
was negative—that is, below ground level," the ESA said in a 
statement.


That is why we need CheckedInt, folks. Reminder End. ;)


[0] 
http://phys.org/news/2016-11-glitch-blamed-european-mars-lander.html


Re: Don't truncate forum titles, use multiple lines instead

2016-11-20 Thread qznc via Digitalmars-d

On Sunday, 20 November 2016 at 08:59:19 UTC, Tourist wrote:

Please implement the suggestion. Thanks.
http://imgur.com/X7fJLpF


For mobile I would prefer it to use the whole width for the title 
and convert the other two columns into "subtitle text" below.


Re: TechEmpower Web Framework Performance Comparison Round 13 -- vibe.d non-starter?

2016-11-18 Thread qznc via Digitalmars-d

On Friday, 18 November 2016 at 11:02:20 UTC, Daniel Kozak wrote:

Dne 18.11.2016 v 11:46 thedeemon via Digitalmars-d napsal(a):

On Thursday, 17 November 2016 at 18:24:05 UTC, Daniel Kozak 
wrote:

Dne 17.11.2016 v 18:49 sanjayss via Digitalmars-d napsal(a):



 Ubuntu 12.04 to 16.04 which has PIE enabled now, and there 
are problems with D on it.


Where can I learn more about it?



It has been typo, it should not be 16.04 but 16.10.


Why would you run a non-LTS Ubuntu on a server? Anyways, I could 
not find anything about the OS on the website. The only info 
about environment is:


Physical hardware environment for Rounds 13 and beyond. Provided 
by ServerCentral. Dell R910 (4x 10-Core E7-4850 CPUs) application 
server; Dell R420 (2x 4-Core E5-2406 CPUs) database server; 
switched 10-gigabit Ethernet


Re: PDF generation in D?

2016-11-11 Thread qznc via Digitalmars-d

On Thursday, 10 November 2016 at 22:30:34 UTC, Karabuta wrote:
Hello community, does anyone have on something for PDF 
generation in D? I may need a PDF generation library in a 
vibe.d project I'm working on. :)


You can pull in Gtk with Cairo and Pango. Cairo can generate pdf. 
Pango is necessary for advanced text rendering.


Re: [OT] web/desktop dying

2016-11-10 Thread qznc via Digitalmars-d
On Wednesday, 9 November 2016 at 16:00:45 UTC, Nick Sabalausky 
wrote:

On 11/05/2016 02:00 AM, Joakim wrote:


Nothing is ever "completely replaced"- somebody somewhere is 
still using

a mainframe or a UNIX workstation- but yes, PCs will basically
disappear, just as you never see those old computers anymore.  
Android
7.0 has a full multi-window mode, just dock your smartphone 
with a

monitor and keyboard/mouse and start working:

http://arstechnica.com/gadgets/2016/03/this-is-android-ns-freeform-window-mode/



But it probably will take over anyway, because, let's face it, 
when the fuck has being complete and utter fucking shit ever 
stopped a computing tech from becoming a runaway success?:


I don't believe that.

Software developers need a big machine, because these days you 
have to run a bunch of VMs to get anything done. Unless we 
migrate to Cloud-IDEs, we will use PCs in the foreseeable future 
and I don't see Cloud-IDEs happening.


Office Workers who are happy with MS Office alone could use 
Android. However, there is always this old internal app, which 
barely works on newer Windows versions. It will take a few 
decades until those are replaced.


Executives could move to pure mobile and probably already did. 
Reading reports and writing emails works well already.


I believe the PC is just as tenacious as the x86 architecture, 
which is still backwards compatible over the last three decades.


Re: Linux Kernel in D?

2016-11-02 Thread qznc via Digitalmars-d
On Tuesday, 1 November 2016 at 16:22:58 UTC, Andrei Alexandrescu 
wrote:

On 11/01/2016 09:41 AM, Wild wrote:

On Tuesday, 1 November 2016 at 12:12:29 UTC, Heisenberg wrote:
Just an idea. Do you think it would have any advantage 
compared to the

one that is written in C?


I think it wouldn't really be worth it.


I tend to think the same but for different reasons. Currently 
the Linux kernel is a large mature product that has its own 
evolution. It would be very difficult to reimplement it from 
first principles in any other language and get a competitive, 
timely product.


As an intellectual exercise, D's safety would help but at this 
point impart little advantage; the kernel has reached good 
stability and safety bugs are few and far across. This trend is 
likely for the foreseeable future.


Security is a big topic for Linux: 
https://lwn.net/Articles/662219/


Mostly the problem are drivers. They are produced hastily by 
careless companies without the scrutiny of the core kernel parts 
(like scheduler, file system, etc). I think D might help there, 
because it could enforce @safe or other properties onto the 
drivers.


Nevertheless, I don't see a successful D kernel in the 
foreseeable future. Building a kernel for IoT devices is trendy, 
but you want a lot more portability for that and C compilers are 
everywhere. On the server, you could build a hypervisor OS with 
D, but currently containers are hyped so much more. You'd only 
have a chance, if you also port the JVM onto your D-OS. Still, 
where is the advantage to Linux?


Re: Linus' idea of "good taste" code

2016-10-27 Thread qznc via Digitalmars-d

On Wednesday, 26 October 2016 at 09:54:31 UTC, Dicebot wrote:

On 10/26/2016 12:53 AM, Walter Bright wrote:
It's a small bit, but the idea here is to eliminate if 
conditionals where possible:


https://medium.com/@bartobri/applying-the-linus-tarvolds-good-taste-coding-requirement-99749f37684a#.nhth1eo4e


I find it both funny and saddening how many reddit commentators 
complained about Linus version of that code is over-complicated.


"Prefer clear code over smart code" principle is good in 
general but sometimes it is over-applied to the point where 
incompetence gets glorified. And this sucks.


I'm unsure about Linus' version. For this example, I agree that 
it is elegant. It is fine in this specific case, because 
everything is local within a single function. In general, the 
trick to use a pointer to the element probably not a good idea.


The article/Linus does not explain the tradeoffs properly, which 
makes it dangerous advice.


Re: gdc in Linux distros recommended?

2016-10-19 Thread qznc via Digitalmars-d

On Wednesday, 19 October 2016 at 00:07:12 UTC, bachmeier wrote:

According to this page
https://gdcproject.org/downloads/
there are only distro packages for Ubuntu, Debian, and Arch. If 
that's accurate, there really is no sense in which GDC is more 
available than DMD.


Yes it is. Installing gdc is just "apt install gdc" on Ubuntu 
without looking for any download sites.


Re: Idea for a new tool

2016-10-14 Thread qznc via Digitalmars-d
On Friday, 14 October 2016 at 13:13:16 UTC, Andrei Alexandrescu 
wrote:

https://issues.dlang.org/show_bug.cgi?id=5051 -- Andrei


Reminds me of Lisp, where they also have code generation wrapped 
in code generation wrapped in ... here is an example: 
http://stackoverflow.com/q/16579844/2361979


Lispers have a REPL and can expand interactively and 
specifically, though.


I guess the most awesome D use case would be inside an IDE. Click 
on a template/mixin call to expand exactly that one. An IDE would 
have access to all build and link parameters, which naturally 
influence this.


For example, click on "foo.find(bar)" and it opens a new 
buffer/tab/window, where the correct variant of find is 
instantiated according to foo and bar.


Click on "mixin Foo;" and it inlines the instantiated code.


Re: D, ZeroMQ, Nanomsg

2016-09-29 Thread qznc via Digitalmars-d

On Thursday, 29 September 2016 at 04:18:55 UTC, Nikolay wrote:
On Wednesday, 28 September 2016 at 11:53:05 UTC, Russel Winder 
wrote:



Has anyone wrapped Nanomsg?


Be aware - Nanomsg project is mostly dead now. See 
http://sealedabstract.com/rants/nanomsg-postmortem-and-other-stories/


That article was in February. There was a 1.0.0 release in June.


Re: Why D is not popular enough?

2016-09-01 Thread qznc via Digitalmars-d

On Thursday, 1 September 2016 at 08:04:00 UTC, Bienlein wrote:
D has a lot to offer with regard to functional programming. It 
has pure functions and true immutable classes (true = also sub 
objects become immutable), which Scala all doesn't have 
(because of restrictions of the JVM). Does D have tail call 
recursion optimization? I don't know, actually. If D had that 
and pattern matching, it would beat Scala with all it's hype by 
a big leap.


D does not guarantee tail calls, but the compiler might sometimes 
decide to do it. Functional programmer usually want to guarantee, 
so they don't have to write a loop. The downside of TCO is that 
the stack trace is missing frames, which can be very confusing.


D has no syntax for pattern matching, but some library support:
https://p0nce.github.io/d-idioms/#Recursive-Sum-Type-with-matching


Re: ISO D

2016-08-17 Thread qznc via Digitalmars-d

On Wednesday, 17 August 2016 at 08:02:42 UTC, eugene wrote:

will ISO D be in future or not?


What would be the benefits?


Re: [OT] The coolest (literally) desktop machine I've ever had

2016-08-16 Thread qznc via Digitalmars-d

On Sunday, 14 August 2016 at 17:30:21 UTC, Basile B. wrote:

On Sunday, 14 August 2016 at 16:27:51 UTC, qznc wrote:
On Saturday, 13 August 2016 at 14:52:06 UTC, Andrei 
Alexandrescu wrote:

On 08/13/2016 08:37 AM, Vladimir Panteleev wrote:

Friends don't let friends use Linux Mint

Good to know, thanks. So what should I use then? -- Andrei


I use Ubuntu LTS, because one breaking upgrade every two years 
is enough. I recently spent a few hours to get my laptop 
nvidia card back to work.


The "crash and back to login screen" bug I guess ? We're so 
many people to have encountered it. On OpenSuse 13.2 I cannot 
get G04 to work anymore since months but G03 is fine.


Yes. Although "crash and back to login screen" is probably the 
symptom for many graphics related problems and not a specific 
bug. In my case, the solution was to switch to the legacy 
nvidia-340 driver.


Re: [OT] The coolest (literally) desktop machine I've ever had

2016-08-14 Thread qznc via Digitalmars-d
On Saturday, 13 August 2016 at 14:52:06 UTC, Andrei Alexandrescu 
wrote:

On 08/13/2016 08:37 AM, Vladimir Panteleev wrote:

Friends don't let friends use Linux Mint

Good to know, thanks. So what should I use then? -- Andrei


I use Ubuntu LTS, because one breaking upgrade every two years is 
enough. I recently spent a few hours to get my laptop nvidia card 
back to work.


Re: D Github contributors - enable 2 factor authentification

2016-08-11 Thread qznc via Digitalmars-d
On Thursday, 11 August 2016 at 13:05:49 UTC, Steven Schveighoffer 
wrote:

There's also nothing
private in the dlang repository, but a malicious person could 
just
delete everything and it would be a major problem for us to 
recover from

that.


Well, the code will all be on everyone's system. The PRs should 
be pretty safe too, since they are all branches on everyone's 
private fork.


The code is pretty safe thanks to git. The comments get lost.

Likewise, deleting bugzilla would be ugly.

We could start signing git commits/tags for additional safety.




Re: D Github contributors - enable 2 factor authentification

2016-08-11 Thread qznc via Digitalmars-d
On Thursday, 11 August 2016 at 07:54:48 UTC, Jonathan M Davis 
wrote:
But I'd be even more worried about depending on an app on your 
phone (like is sometimes the case with two-factor auth), since 
that won't necessarily then work with another phone with the 
same number, in which case, changing phones could lose you 
access


I use Authy. They provide desktop apps and sync in addition. So 
if my phone fails, I can use my laptop and vice versa.


https://www.authy.com/



Re: D Github contributors - enable 2 factor authentification

2016-08-11 Thread qznc via Digitalmars-d
On Thursday, 11 August 2016 at 06:21:35 UTC, Jonathan M Davis 
wrote:
I just enabled it because of this thread, but in general, I'm 
paranoid about two-factor auth and don't use it for much. My 
domain registrar (and thus DNS) is one of the few places that I 
have it enabled. I'm just too worried about getting locked out. 
The very thing that makes it more secure significantly 
increases the risk of you having a problem that locks you out.


This thread pushed me to enable it for Google and Github. The 
fear of lock out plagues me as well.


However, I asked a few friends and so far I have found nobody who 
was actually locked out. The fact that they all give you a few 
backup codes for login helps.


Let us talk about error messages

2016-08-10 Thread qznc via Digitalmars-d

Rust changed their error message format:

https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html

Inspiration for D?


Re: Decimal/Currency Type

2016-08-09 Thread qznc via Digitalmars-d
On Tuesday, 9 August 2016 at 11:14:09 UTC, Edwin van Leeuwen 
wrote:

On Tuesday, 9 August 2016 at 10:48:50 UTC, Zane wrote:
Is there such a thing build into D? If not, is there any plans 
to add it? It seems like this would be something needed by 
many applications (especially anything dealing with currency).


I don't think there is anything in the standard library, but 
there is a dub library:

https://github.com/qznc/d-money


This is the "get by with long, but" approach. The downside is the 
limited range. The upside is (probably) speed.


Re: The Computer Language Benchmarks Game

2016-08-07 Thread qznc via Digitalmars-d

On Sunday, 7 August 2016 at 17:53:12 UTC, Isaac Gouy wrote:

On Sunday, 7 August 2016 at 05:04:29 UTC, Walter Bright wrote:

Ultimately, my opinion is that the benchmark is outdated and 
not useful today. I
ignore it, if anybody cites the benchmark game for 
performance measurements.


Yeah, I wouldn't bother with it, either.




Rather than only being dismissive, wouldn't it be more 
effective to say what you would bother with.


https://github.com/kostya/crystal-benchmarks-game

https://github.com/def-/nim-benchmarksgame

Where are the D comparison programs that people should bother 
with?


Comparing so many languages is too broad. We need more specific 
benchmarks which must be looked at in more detail.


For example, it makes sense to have a benchmark for regular 
expressions. It is interesting to compare Rust and D, because 
they both use compile-time tricks, which C cannot do. It makes no 
sense to compare them to an equivalent Python/Ruby/etc program, 
because they all use the same C library internally. More details: 
Regular expressions are used in very different scenarios, so one 
program might not be enough. Simple expression or complex 
expression? Find first or find all? ASCII or Unicode? Large 
haystack or small?


If you want to answer the big question of "how fast is D compared 
to C", the best answer is "roughly the same if you compare clang 
to LDC, because they use the same optimizer and code generator". 
Getting some numbers from a bunch of benchmark programs does not 
improve the answer. You can only get a better answer in the sense 
that it becomes more specific to your specific use case, but that 
requires you to build your own benchmark.


Re: Why doesn't dlang-bot use the GitHub conventions?

2016-08-07 Thread qznc via Digitalmars-d

On Sunday, 7 August 2016 at 20:08:48 UTC, Martin Nowak wrote:

On Sunday, 7 August 2016 at 20:03:45 UTC, Martin Nowak wrote:

BTW, dlang-bot got a logo and it's own home page today.

[Dlang-Bot](http://dlang-bot.herokuapp.com/)

Also since yesterday it cancels outdated Travis-CI builds to 
reduce our test load.


That logo is actually the first D-Man I like. :)


Re: The Computer Language Benchmarks Game

2016-08-05 Thread qznc via Digitalmars-d

On Thursday, 4 August 2016 at 20:15:35 UTC, Ali Çehreli wrote:

We don't hear about the following site here any more:

  http://benchmarksgame.alioth.debian.org/

How relevant is that site for us? Should D be represented there 
as well? Would someone (you? :p) be interested in adding D to 
the languages there?


There is the following page where the author may not be willing 
to add a new language but the measurement code is available for 
others to use:


  http://benchmarksgame.alioth.debian.org/play.html#misc

Ali


I did play with the benchmarks for a while: 
https://bitbucket.org/qznc/d-shootout


Ultimately, my opinion is that the benchmark is outdated and not 
useful today. I ignore it, if anybody cites the benchmark game 
for performance measurements.


Re: D safety! New Feature?

2016-08-03 Thread qznc via Digitalmars-d

On Tuesday, 2 August 2016 at 21:48:58 UTC, Mark Twain wrote:

global ImmutableArray!int Data;


MutableArray!int DataCopy = Data.Copy; // Creates a mutable 
copy of Data.

... Do work with DataCopy ...
Data.Replace(DataCopy); // Makes a copy of DataCopy.


I see the problem that you cannot compose this. Expand the 
example to two global arrays:


global ImmutableArray!int Data1;
global ImmutableArray!int Data2;

MutableArray!int DataCopy1 = Data1.Copy;
MutableArray!int DataCopy2 = Data2.Copy;
 ... Do work with DataCopy1 and DataCopy2 ...
Data1.Replace(DataCopy1);
// in between state is inconsistent => unsafe
Data2.Replace(DataCopy2);


Ideas for a "prototype" project? Germany provides funding

2016-08-02 Thread qznc via Digitalmars-d

You might have heard about the funding project from Germany.

https://prototypefund.de/ # often overloaded

https://okfn.de/en/projekte/prototypefund/ # basic information

https://news.ycombinator.com/item?id=12200777 # Hacker News 
discussion


The basic idea: 30k€ over six months to develop an open source 
prototype


Condition is that you have your primary residence in Germany. 
Since we have some germans in our community this might be 
interesting.


It reminds me of the Google Summer of Code. You need to have a 
project idea. The topics are digital tools for citizens, data 
literacy, data security, software infrastructure.


Re: [OT] Create more debt == earn more

2016-08-02 Thread qznc via Digitalmars-d

On Tuesday, 2 August 2016 at 08:07:38 UTC, Basile B. wrote:
I was thinking about the value of what we do in the life, 
daily, the jobs, etc


I've endend with this conclusion:

The more you're able to create debt, the more you'll earn.
example, CIO: hudge pay, because your 1000 salaries will create 
a lot of debt. Architect, huge pay: your client will create a 
debt on 20 years, etc...you see the logic.


The more your job maintains the system the more it'll be 
renumerated.
The amount of money you earn is actually not proportional to 
your work, the amount of money you earn simply represents your 
ability to create debts.


What do you think about that ?


According to Graeber [0], money = debt.

However, I assume your comment comes from a socio-critical 
position, where you want to associate overpaid bosses with 
negative words like "debt". Note that debt is not inherently a 
bad or evil thing, especially not for the rich. Debt is not 
something to be avoided. It is something to be managed. Likewise 
a programmer should not avoid technical debt completely. Instead 
it should be consciously taken, managed, and payed in due time.


[0] https://en.wikipedia.org/wiki/Debt:_The_First_5000_Years


Re: Overflows in Phobos

2016-07-28 Thread qznc via Digitalmars-d

On Thursday, 28 July 2016 at 00:17:16 UTC, Walter Bright wrote:

On 7/27/2016 3:47 PM, qznc wrote:
On Wednesday, 27 July 2016 at 07:59:54 UTC, Walter Bright 
wrote:
"The expression assert(0) is a special case; it signifies 
code that should be
unreachable. If it is reached at runtime, either AssertError 
is thrown or
execution is terminated in an implementation-defined manner. 
Any code after

the assert(0) is considered unreachable."


Why that last phrase about "considered unreachable"? If 
"AssertError is thrown
or execution is terminated" it implies that execution will not 
continue after

assert(0).


Yeah, you're right.


Another possibility would be "assert(0) never returns". This 
assumes that throwing an exception is not "returning", which is 
reasonable, since control flow does not leave via return 
statement.


Re: Overflows in Phobos

2016-07-27 Thread qznc via Digitalmars-d

On Wednesday, 27 July 2016 at 07:59:54 UTC, Walter Bright wrote:
"The expression assert(0) is a special case; it signifies code 
that should be unreachable. If it is reached at runtime, either 
AssertError is thrown or execution is terminated in an 
implementation-defined manner. Any code after the assert(0) is 
considered unreachable."


Why that last phrase about "considered unreachable"? If 
"AssertError is thrown or execution is terminated" it implies 
that execution will not continue after assert(0).


Also "Any code after the assert(0)" is somewhat ambiguous about 
"after". Consider:


if (random) goto twist;
assert(0);
twist: writeln("after assert(0)?!");

And also:

try { assert(0); }
catch (AssertError e) { writeln("after assert(0)?!"); }


Re: Documentation about concurrency and parallelism

2016-07-24 Thread qznc via Digitalmars-d

On Thursday, 21 July 2016 at 22:47:38 UTC, Seb wrote:

On Thursday, 21 July 2016 at 20:56:07 UTC, eugene wrote:

On Thursday, 21 July 2016 at 20:46:24 UTC, eugene wrote:

Hi everyone,
could you,please, point out where can i find in the 
"Documentation" sections info about concurrency and 
parrallelism preferably with examples?


i didn't find about it in "Language reference" and "Feature 
overview", but found in "Library reference"


It's entirely a library feature, the compiler doesn't need to 
know about it.


For clarification, the compiler does know about parallel and 
concurrent code, since threads cannot be implemented as a library 
[0]. In most cases though, you find all high-level stuff you need 
in the library.


[0] http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf




Re: The case for small diffs in Pull Requests

2016-07-21 Thread qznc via Digitalmars-d

On Thursday, 21 July 2016 at 06:04:24 UTC, default0 wrote:

On Thursday, 21 July 2016 at 03:30:34 UTC, Walter Bright wrote:

I've looked at many PRs that consisted of multiple commits.

The trouble with them is:

1. they often have nothing in particular to do with each other

2. I may want to pull a subset of the commits, but the only 
option I have is all or nothing


As far as I'm aware git offers the option of cherry picking 
commits. It will not mark the PR as merged or generally not be 
what you are looking for, but maybe it's a usable workaround :)


Git does, but Github does not.

D uses a bot [0] to do the merging. Afaik the process is that an 
authorized person (Walter, Andrei, etc) comment with "Auto-merge 
toggled on", then the bot toggles the merge after it ensures that 
tests pass.


In theory, the bot could be extended to merge only certain 
commits and exclude others. That might solve (2), but it muddles 
the review process.


(1) is not to be solved. If commits have nothing to do with each 
other then the should be in separate pull requests.


[0] https://github.com/braddr/d-tester


Re: Phobos doc anchors not friendly for keyboard-centric browsers

2016-07-19 Thread qznc via Digitalmars-d

On Tuesday, 19 July 2016 at 13:16:52 UTC, Jack Stouffer wrote:

On Tuesday, 19 July 2016 at 11:38:20 UTC, rcorre wrote:
Keyboard-centric browsers (e.g. qutebrowser [1], dwb [2], 
ect.) generally let you click on links via 'hinting'. You 
press a button (e.g. 'f' for 'follow'), every clickable 
element has a series of keys shown above it, and you press 
those keys to follow that link (just look at some of the 
screenshots for the linked browsers).


The (kinda) new anchor links in the phobos docs don't work 
well with this, as they require me to mouse over the element 
for them to show up (and having to use the mouse defeats the 
purpose of a keyboard-centric browser).


Is there any reason for this design? Would it hurt to show the 
anchor all the time? If nothing else it would make the anchors 
more discoverable.


I don't understand, the anchor link doesn't go anywhere. It's 
to provide a perma-link to that piece of documentation so you 
can direct link to it somewhere else.


My guess: "every clickable element has a series of keys shown 
above it". The permalinks are not clickable unless you hover 
above, thus no "hinting", thus not useable by keyboard-centric 
browsers.


Maybe have it always visible and float to the right?


Re: The case for small diffs in Pull Requests

2016-07-19 Thread qznc via Digitalmars-d

On Tuesday, 19 July 2016 at 06:29:05 UTC, Jacob Carlborg wrote:
Have you read the solution, linked at the bottom? [1]. As far 
as I can remember, I have not seen this used in the D projects 
at all.


[1] 
http://graysonkoonce.com/stacked-pull-requests-keeping-github-diffs-small/


This feels like a fight against the Github UI to me. The atomic 
unit is the pull request, not the commits.


I would like to see squashed commits in D. History looks polluted 
by merge commits to me. This is useless for single-commit pull 
requests at least.


Re: Our docs should be more beautiful

2016-07-19 Thread qznc via Digitalmars-d

On Monday, 18 July 2016 at 22:24:09 UTC, Adam D. Ruppe wrote:

The ddox ones are supposed to be made default eventually.


What is the state on this? I found no issue tracking this.


Re: Our docs should be more beautiful

2016-07-18 Thread qznc via Digitalmars-d
On Monday, 18 July 2016 at 15:56:29 UTC, Andrei Alexandrescu 
wrote:
I was proofreading 
http://dtest.thecybershadow.net/artifact/website-f26d7179b8449e89e1961391fde9f221813c707c-04d0496c2d8cecedc4d75c919646d564/web/phobos-prerelease/std_experimental_checkedint.html and there are a few ways in which our docs could look better.


* My pet dream was to work on a project with a beautiful 
justified and hyphenated website. After endless debates, 
ugliness has won - I'm looking at a eye-scratching ragged right 
edge.


The "ragged" left is more ugly. If you want a be beautiful, the 
left side should align, but every text is indented differently 
due to boxes/lines.



Literally all vertical spacing is larger than it should be.


I would disagree, but at this level it is bike shedding.

There should be more vertical space. For example, I would 
increase the line height a little and the lines are too wide.


Does it make sense to work on this soon-to-be-replaced styling?


Re: What is the current progress on "Safety and Memory Management"?

2016-07-16 Thread qznc via Digitalmars-d

On Saturday, 16 July 2016 at 21:45:17 UTC, maik klein wrote:
I was actually thinking of contributing something bigger as 
part of my bachelor thesis. (Not sure if I am allowed to do 
that)


What I wanted to do is to translate a big part of Rust's std to 
D. Stuff like Rc, Arc, Box, Optional + all the necessary tools 
for ownership semantics.


Also implement data structures that work with ownership 
semantics (Rc, Box, Arc etc)  like Vec, HashMap.


Add ownership semantics to phobos, for example a lot of stuff 
in phobos can't be used with non copyable types. (A lot of 
things rely on copying)


If I were your advisor, I would suggest not to think about 
Phobos. Just build your own library and publish via dub. Getting 
a contribution into Phobos is not a good use of time for a 
bachelor thesis.


Apart from that: Ownership semantics as a library is a great 
topic! Go for it.





Variables should probably not shadow parent methods

2016-07-12 Thread qznc via Digitalmars-d

Just seen on Reddit [0] and there are a few more examples.

  class Test
  {
string function() toString = function() { return "one"; };
  }

  void main()
  {
auto test = new Test;
writeln(test);
test.toString = function() { return "two"; };
writeln(cast(Object)test);
  }

Test has a delegate field `toString` which shadows the method 
`toString` inherited from Object. Could we make this an error?



[0] 
https://www.reddit.com/r/d_language/comments/4sfcv8/overriding_parents_member_function_with_anonymous/


Re: D is crap

2016-07-06 Thread qznc via Digitalmars-d

On Wednesday, 6 July 2016 at 01:30:46 UTC, ketmar wrote:
and i'm curious why everyone is so amazed by 64-bit systems. 
none of my software is using more than 2GB of RAM. why should i 
pay for something i don't need? like, all pointers are 
magically twice bigger. hello, cache lines, i have a present 
for you!


The advantage of compiling for AMD64 is that the compiler can 
assume a lot of extensions like the SSE bunch. If you want to 
distribute a binary for x86 you only have the 386 instructions. 
Ok, 686 is probably common enough today. For more special 
instructions, you could guard them and provide a fallback.


One example: To convert a floating point value to integer on 386, 
you need to store it to memory and load it again. Makes sense, if 
you floating point stuff is handled by a co-processor, but today 
this is completely integrated. SSE added an extra instruction to 
avoid the memory detour.


GCC has a switch (-mx32) to store pointers as 32bit on a 64bit 
system. That is probably very close to what you want.


Re: Blocking points for further D adoption

2016-07-06 Thread qznc via Digitalmars-d

On Wednesday, 6 July 2016 at 07:22:26 UTC, Tofu Ninja wrote:
Problem with that is ldc and gdc are always a few versions 
behind dmd.


LDC is quite close now.

LDC v1.0.0 was released June 6 with DMD 2.070.2 compatibility. 
DMD 2.070.2 was released Mar 3 and superseded by 2.071.0 on Apr 5 
(and 2.071.1 on June 27).


Re: Is dmd fast?

2016-07-05 Thread qznc via Digitalmars-d

On Wednesday, 22 June 2016 at 13:46:50 UTC, qznc wrote:
Walter and we as a community often claim that dmd is fast as in 
"compiles quickly". Go also claims this. Rust does not. They 
even state that compilation speed is one of the big tasks they 
are working on.


I found a comparison for D and Rust, which uses a bigger program: 
Compile the respective package manager dub/cargo. They are (very 
roughly) programs of the same complexity.


Short: DMD 21sec vs Rust 56sec

Longer:
➤ time dub build --force
Performing "debug" build using dmd for x86_64.
dub 1.0.0+commit.8.gcdfaf60: building configuration 
"application"...
source/dub/internal/sdlang/lexer.d(16,8): Deprecation: module 
std.stream is deprecated - It will be removed from Phobos in 
October 2016. If you still need it, go to 
https://github.com/DigitalMars/undeaD

Linking...
6.76user 0.96system 0:21.83elapsed 35%CPU (0avgtext+0avgdata 
1106000maxresident)k

141800inputs+84280outputs (225major+325767minor)pagefaults 0swaps
➤ time cargo build
   Compiling cargo v0.12.0 (file:///home/qznc/dev/rust/cargo)
54.02user 1.56system 0:56.00elapsed 99%CPU (0avgtext+0avgdata 
629400maxresident)k

1144inputs+297400outputs (6major+459076minor)pagefaults 0swaps

Even more drastic is the user time: DMD 7sec vs Rust 54sec. I'm 
not sure where DMD spends the rest of the time? Page faults?


Re: Properties for unittests

2016-07-02 Thread qznc via Digitalmars-d

On Saturday, 2 July 2016 at 11:27:57 UTC, Lodovico Giaretta wrote:
On Saturday, 2 July 2016 at 11:25:51 UTC, Lodovico Giaretta 
wrote:
What emerged in a previous thread[1], unittests that can't be 
@safe have to be explicitly marked @system, so that it is 
obvious to the reader that the functionalities tested are not 
@safe.


[1] http://forum.dlang.org/thread/nkn1g6$b00$1...@digitalmars.com


This post in particular:
http://forum.dlang.org/post/nkn25t$btk$1...@digitalmars.com


Thanks.

I added this to the wiki: 
https://wiki.dlang.org/Get_involved#Review_pull_requests


Properties for unittests

2016-07-02 Thread qznc via Digitalmars-d
In general, it is a good idea to make unittests @safe and @nogc 
in Phobos. When reviewing a pull request, we should check that.


There is a pull request [0] which annotates @system. Why would 
you do that? Is that somehow a desirable thing? Should a reviewer 
check for that?


The spec for @system [1] says:

System functions are functions not marked with @safe or 
@trusted and are not nested inside @safe functions. System 
functions may be marked with the @system attribute. A function 
being system does not mean it actually is unsafe, it just means 
that the compiler is unable to verify that it cannot exhibit 
undefined behavior.


[0] https://github.com/dlang/phobos/pull/4532
[1] https://dlang.org/spec/function.html#property-functions


Re: string encryption

2016-07-01 Thread qznc via Digitalmars-d

On Friday, 1 July 2016 at 22:23:23 UTC, Hiemlick Hiemlicker wrote:

It seems D won't replace

encrypt("This string will still end up in the binary");

with "skadf2903jskdlfaos;e;fo;aisjdfja;soejfjjfjfjfjfjfeij" or 
whatever the ctfe value of encrypt actually is.


This also seems like a bug in D because manifest constants used 
as sole arguments to ctfe'able functions should be replaced by 
the function result.



CTFE is explicit. You could make it `encrypt!"encrypted at 
compile-time"`. Then let encrypt return some struct, which 
decrypts at runtime.





Re: post 2.071 mixin template & import rules

2016-07-01 Thread qznc via Digitalmars-d

On Friday, 1 July 2016 at 05:42:30 UTC, captaindet wrote:
it appears that there had been an even more radical change as 
well with respect to the way mixin templates work. this has not 
been properly communicated yet. at least i could not find a 
write-up and a related thread conveyed rather guesswork than 
knowledge. ( 
https://forum.dlang.org/post/nl2bgi$2oim$1...@digitalmars.com )


The question is: Was it intentional?

Imho, it is weird that template mixin have different behavior 
than modules with respect to import visibility. I don't see a 
reason, why a public import should not be exported.


Re: DMD 2.071.1 and Issue 15925 - [REG 2.071] Import declaration from mixin templates are ignored

2016-06-30 Thread qznc via Digitalmars-d

On Thursday, 30 June 2016 at 11:40:38 UTC, Mathias Lang wrote:
2016-06-30 11:09 GMT+02:00 qznc via Digitalmars-d < 
digitalmars-d@puremagic.com>:




I don't see this properly documented [0].

It seems that imports in mixins are not visible even if 
declared public? This means mixin imports are special?


The issue also features a "protected imported". I guess nobody 
knows what that is supposed to mean?


[0] https://dlang.org/spec/module.html#ImportDeclaration



There's an issue for that ( 
https://issues.dlang.org/show_bug.cgi?id=16004 ) and an 
associated P.R. ( https://github.com/dlang/dlang.org/pull/1325 
). So far I haven't got any feedback on it. There's not much I 
can do short of pinging people.


I looked through the PR, but I guess Martin Nowak has to ok it.


  1   2   3   4   >