Re: termcolor-d - Colors with writeln(...);

2018-11-22 Thread Shriramana Sharma via Digitalmars-d-announce
On Wednesday, 21 November 2018 at 18:36:06 UTC, Vladimirs 
Nordholm wrote:

https://github.com/vladdeSV/termcolor-d


https://github.com/jamadagni/textattr/

Saw a library recently which allowed you to color text, but it 
had an odd syntax.


Maybe the documentation, in trying to be exhaustive, hasn't 
showed how simple it can be. I'm not sure why it is perceived as 
odd. Can you clarify?


Since I already had some code for coloring text in terminals, I 
made this (hackish, POSIX only) project during lunch break. It 
in action:


import std.stdio : writeln;
import termcolor;


import textattr;


// Color → Green → Foreground
writeln(C.green.fg, "Green text", resetColor);


  writeln(ta("green"), "Green text", ta("off"));

*or* the shorter:

  writeln(ta("g"), "Green text", ta("f"));

*or* the even shorter:

  tawrite("@g", "Green text", "@f", '\n');

The @ indicates that it is an "at"tribute.

It's not an issue to add a tawriteln which adds the newline at 
the end. I first posted the basic library thinking to make 
additions as per demands later.



// Color → Red → Background
writeln(C.red.bg, "Red background", resetColor);


  tawrite("@/red", "Red background", "@off", '\n');

The / indicates that it's a background colour. This is stated in 
the HTML documentation, but maybe not clear within the 
limitations of the README.md. I'll see what I can do to improve 
it.


Having premade symbols in the library as you have done is easy 
enough for basic 16-colour or even attribute support, but adding 
256 colour or true colour support this way would unnecessarily 
use up too much memory.


Re: textattr library for text colors and attributes available in D

2018-11-22 Thread Shriramana Sharma via Digitalmars-d-announce

On Friday, 9 November 2018 at 22:28:28 UTC, JN wrote:
It looks to me like the textattr.d is all that is needed? 
Should be easy to put it in a separate package that could be 
uploaded to dub registry.


Yes indeed textattr.d is all that is needed! For C too 
textattr.c|h are all that are needed.


Re: LDC 1.13.0-beta2

2018-11-22 Thread Joakim via Digitalmars-d-announce

On Thursday, 22 November 2018 at 16:36:22 UTC, H. S. Teoh wrote:
On Thu, Nov 22, 2018 at 01:25:53PM +, Joakim via 
Digitalmars-d-announce wrote:

On Wednesday, 21 November 2018 at 10:43:55 UTC, kinke wrote:
> Glad to announce the second beta for LDC 1.13:
> 
> * Based on D 2.083.0+ (yesterday's DMD stable).

[...]
I've added native builds for Android, including Android/x86_64 
for the first time. Several tests for std.variant segfault, 
likely because of the 128-bit real causing x64 codegen issues, 
but most everything else passes.

[...]

What's the status of cross-compiling to 64-bit ARM?  On the 
wiki you wrote that it doesn't fully work yet.  Does it work 
with this new release?


It's been mostly working since 1.11. That note on the wiki links 
to this tracker issue that lists the few remaining holes, mostly 
just extending Phobos support for 80-bit precision out to full 
128-bit Quadruple precision in a few spots and finishing off the 
C/C++ compatibility:


https://github.com/ldc-developers/ldc/issues/2153






Re: LDC 1.13.0-beta2

2018-11-22 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Nov 22, 2018 at 01:25:53PM +, Joakim via Digitalmars-d-announce 
wrote:
> On Wednesday, 21 November 2018 at 10:43:55 UTC, kinke wrote:
> > Glad to announce the second beta for LDC 1.13:
> > 
> > * Based on D 2.083.0+ (yesterday's DMD stable).
[...]
> I've added native builds for Android, including Android/x86_64 for the
> first time. Several tests for std.variant segfault, likely because of
> the 128-bit real causing x64 codegen issues, but most everything else
> passes.
[...]

What's the status of cross-compiling to 64-bit ARM?  On the wiki you
wrote that it doesn't fully work yet.  Does it work with this new
release?


T

-- 
Never wrestle a pig. You both get covered in mud, and the pig likes it.


Re: D compilation is too slow and I am forking the compiler

2018-11-22 Thread Paolo Invernizzi via Digitalmars-d-announce
On Thursday, 22 November 2018 at 13:19:58 UTC, Andrej Mitrovic 
wrote:
On Thursday, 22 November 2018 at 11:16:26 UTC, Paolo Invernizzi 
wrote:
BTW, it's nice to see again the Secret Squirrel on the forum, 
in these days: welcome back Andrej!


/Paolo


Oh hey there too! I'm sorry if I can't recall you, though. 
¯\_(ツ)_/¯


Oh, no problem... eheh


I mostly lurk around here these days.


Yep, the same...


But I still use D heavily, at work.


Well, the same here; not so heavily right now, my CTO is not sure 
anymore about the "case for D", but well, we have just delivered 
a D (medical) codebase to one of our customer...


Let's see...

/Paolo



Re: LDC 1.13.0-beta2

2018-11-22 Thread Joakim via Digitalmars-d-announce

On Wednesday, 21 November 2018 at 10:43:55 UTC, kinke wrote:

Glad to announce the second beta for LDC 1.13:

* Based on D 2.083.0+ (yesterday's DMD stable).
* The Windows packages are now fully self-sufficient, i.e., a 
Visual Studio/C++ Build Tools installation isn't required 
anymore.

* Substantial debug info improvements.
* New command-line option `-fvisibility=hidden` to hide 
functions/globals not marked as export, to reduce the size of 
shared libraries.


Full release log and downloads: 
https://github.com/ldc-developers/ldc/releases/tag/v1.13.0-beta2


Thanks to all contributors!


I've added native builds for Android, including Android/x86_64 
for the first time. Several tests for std.variant segfault, 
likely because of the 128-bit real causing x64 codegen issues, 
but most everything else passes.


This means that if you have an x86 or x64 Chromebook that 
supports running Android apps, you can install the Termux app and 
compile D code on there:


https://nosarthur.github.io/coding/2018/01/15/termux.html


Re: D compilation is too slow and I am forking the compiler

2018-11-22 Thread Andrej Mitrovic via Digitalmars-d-announce
On Thursday, 22 November 2018 at 11:16:26 UTC, Paolo Invernizzi 
wrote:
BTW, it's nice to see again the Secret Squirrel on the forum, 
in these days: welcome back Andrej!


/Paolo


Oh hey there too! I'm sorry if I can't recall you, though. 
¯\_(ツ)_/¯


I mostly lurk around here these days. But I still use D heavily, 
at work.


Re: D compilation is too slow and I am forking the compiler

2018-11-22 Thread Paolo Invernizzi via Digitalmars-d-announce
On Thursday, 22 November 2018 at 10:51:45 UTC, Andrej Mitrovic 
wrote:




BTW, it's nice to see again the Secret Squirrel on the forum, in 
these days: welcome back Andrej!


/Paolo




Re: D compilation is too slow and I am forking the compiler

2018-11-22 Thread Andrej Mitrovic via Digitalmars-d-announce
On Wednesday, 21 November 2018 at 20:51:17 UTC, Walter Bright 
wrote:
Unfortunately, you're right. The title will leave the 
impression "D is slow at compiling". You have to carefully read 
the article to see otherwise, and few will do that.


Well comparative to itself sometimes it is. When you initially 
write D code you get used to the blazing fast speeds, but when 
eventually the compilation speed slows down as a project grows 
then this has a real effect on productivity.


Maybe a better title would have been "D compilation sometimes 
slows down too much", but it wouldn't get as many hits. On the 
upside, people who read the article - or even just read the 
comments section, will quickly realize that D's compilation speed 
is still miles faster than the competition. They might actually 
try the language. :)


Re: sumtype 0.7.0

2018-11-22 Thread Atila Neves via Digitalmars-d-announce

On Wednesday, 21 November 2018 at 00:38:25 UTC, Paul Backus wrote:
SumType is a generic sum type for modern D. It is meant as an 
alternative to `std.variant.Algebraic`.


[...]


Thanks for the kind words! My pleasure, SumType has been what 
I've been wanting in D for a while. Expect more annoyances from 
me in the near future ;)