Static Parameter Function Specialization in D

2013-11-11 Thread Nordlöw
I've read somewhere that D supports specialization of functions 
to calls where arguments are compile-time constants. Typical use 
of this is in matrix power functions (if exponent is 2 `x*x` is 
often faster than the general case).


I want this in my member function

   bool opIndexAssign(bool b, size_t i) @trusted pure nothrow 
in {
assert(i < len);// TODO: Add static assert(i 
< len) when i is constant

} body {
b ? bts(ptr, i) : btr(ptr, i);
return b;
}

of a statically sized `BitSet` struct I'm writing. This in order 
to, when possible, get compile-time bounds checking on the index 
variable `i`. I thought


bool opIndexAssign(bool b, const size_t i) @trusted pure 
nothrow in {

static assert(i < len);
} body {
b ? bts(ptr, i) : btr(ptr, i);
return b;
}

would suffice but then DMD complains as follows

dmd -debug -gc -gs -unittest -D 
-Dd/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/justd/ 
-w -main  ~/Work/justd/bitset.d /home/per/Work/justd/assert_ex.d 
-of/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/justd/bitset
/home/per/Work/justd/bitset.d(58): Error: 
bitset.BitSet!2.BitSet.opIndexAssign called with argument types 
(bool, int) matches both:
	/home/per/Work/justd/bitset.d(49): opIndexAssign(bool b, 
ulong i)

and:
	/home/per/Work/justd/bitset.d(65): opIndexAssign(bool b, 
const(ulong) i)
/home/per/Work/justd/bitset.d(66): Error: variable i cannot 
be read at compile time
/home/per/Work/justd/bitset.d(66):while evaluating: 
static assert(i < 2LU)
/home/per/Work/justd/bitset.d(58): Error: 
bitset.BitSet!2.BitSet.opIndexAssign called with argument types 
(bool, int) matches both:
	/home/per/Work/justd/bitset.d(49): opIndexAssign(bool b, 
ulong i)


Do I have to make parameter `i` a template parameter, say using 
type `U`, and then use static if `someTypeTrait!U`. I tried this 
but isMutable!Index always evaluates to true.


import std.traits: isIntegral;
bool opIndexAssign(Index)(bool b, Index i) @trusted pure 
nothrow if (isIntegral!Index) in {

import std.traits: isMutable;
// See also: 
http://stackoverflow.com/questions/19906516/static-parameter-function-specialization-in-d

static if (isMutable!Index) {
assert(i < len);
} else {
import std.conv: to;
static assert(i < len,
  "Index " ~ to!string(i) ~ " must be 
smaller than BitSet length " ~  to!string(len));

}
} body {
b ? bts(ptr, i) : btr(ptr, i);
return b;
}


Re: Static Parameter Function Specialization in D

2013-11-11 Thread Nordlöw

On Monday, 11 November 2013 at 14:41:14 UTC, Dicebot wrote:
Please never post such questions to announcement list. There is 
a D.learn for that.


I'm very sorry. It was a mistake. Can I move or delete this post?



Re: Scott Meyers will deliver a keynote talk at DConf 2014

2014-02-04 Thread Nordlöw
Does this mean D has to get the r-value references situation in 
order before May? :P


That is funny :)


Re: std.serialization

2014-02-16 Thread Nordlöw
I believe it's worth the try to get Python-style serialization 
simplicity to D by default. We use Python cpickle at work and its 
fantastically simple and fast. It handles just about everthing 
you need by default as long as you have imported the modules that 
contain the types involved in the serialization.


It would attract more people from dynamical languages like Python 
if D got default-powers in std.serialization that does everything 
that msgpack does plus followings references.


This would make it possible to serialize arbitrary graph-likes 
structures with potential reference cycles. Resolving these 
cycles can be solved by using a map that contain a list of 
references/classs that already have serialized.


I'm however not sure how serialization of base and superclasses 
should be implemented in the most convenient way. Maybe somehow 
has a good suggestion for this.


My D code is now on Github at nordlow/justd!

2014-02-24 Thread Nordlöw

Hi!

I've just uploaded a bunch of D code I've been working the recent 
year at

https://github.com/nordlow/justd

It includes various kinds of
- Non-In-Place Radix Sort: intsort.d
- Clever Printing of Groups of arrays/slices: show.d
- Boyer Moore Hoorspool Search: horspool.d
- Symbol Regex (Structured Regular Expressions similar to Elisps 
rx): sregex.d

- extension to Phobos (often ending with _ex.d)
- A compile-time sized variant of bitarray.d i call bitset.d
- An N-Gram implementation (many nested for loops): ngram.d
- A wrapper for bounded types: bound.d
- Computer Science Units: csunits.d
- Enhanced NotNull: notnull.d
- A structured wrapper for sha calculations: sha.d
- a bunch of various D sample code starting with t_.
  It should probably moved to test directory.
- and more
- Copies for various extension I copied from other repos.
- Open/LibreOffice file that includes various kinds of comments 
and suggestions for improvements to D's build process.


Please tell me if did something wrong regarding copyright and 
ownership.



Enjoy!



Partial Fix for Issue 3882

2014-02-28 Thread Nordlöw
I just did a DMD & Phobos pull request for a partial fix of Issue 
3882.


https://d.puremagic.com/issues/show_bug.cgi?id=3882

/Per


Re: Livestreaming DConf?

2014-05-22 Thread Nordlöw

We at Facebook are very excited about the upcoming DConf 2014.


Will the videos be available afterwards at Andreis Youtube stream 
like last year?


Re: Livestreaming DConf?

2014-05-22 Thread Nordlöw
So if they can stick to that, there's no reason to livestream 
unless you really want to see it first. :)


That sounds promising!

Thx


Re: DConf 2014 Opening Keynote: State of the struct address - Andrei Alexandrescu

2014-05-29 Thread Nordlöw
Now also available at: 
https://archive.org/details/dconf2014-day01-talk01


Just one thing - what does the title refer to? - I thought you 
where going to discuss the ongoing discussions with memory 
allocations, GC, structs etc.


Inspiring anyhow.

Thx.


Re: Real time captioning of D presentations

2014-06-01 Thread Nordlöw
You're not alone. I can read a transcript far, far faster than 
watching a video.


I agree!


Re: core.checkedint added to druntime

2014-06-22 Thread Nordlöw
While being a very modest piece of code in and of itself, I 
believe this offers a significant opportunity that both D 
compilers and user defined types can exploit.


I did this in C/C++ a while ago, out of which I have forgotten 
most of it :)


https://github.com/nordlow/justcxx/blob/master/sadd.h
https://github.com/nordlow/justcxx/blob/master/ssub.h
https://github.com/nordlow/justcxx/blob/master/smul.h

Tests are here:
https://github.com/nordlow/justcxx/blob/master/t_ranged_and_saturated.cpp

Maybe there's something more here that could give further ideas.

Pick what you want.


Re: LDC 0.13.0 has been released!

2014-06-24 Thread Nordlöw
LDC 0.13.0, the LLVM-based D compiler, is available for 
download!


Great job!

Will there be Linux distribution (Ubuntu) packages available?


DUB Bash Completion

2014-07-07 Thread Nordlöw
So I put together something that works in the majority of cases 
even for sub command specific flags including package completion:


https://github.com/nordlow/scripts/blob/master/dub-completion.bash

Feedback appreciated!


Re: DUB Bash Completion

2014-07-07 Thread Nordlöw

On Monday, 7 July 2014 at 11:55:48 UTC, Nordlöw wrote:

BTW, corresponding GitHub issue:
https://github.com/D-Programming-Language/dub/issues/154


Do you fix the PR?


Re: DUB Bash Completion

2014-07-07 Thread Nordlöw

On Monday, 7 July 2014 at 10:58:02 UTC, Sönke Ludwig wrote:
Very nice, I'll try this out this later. If you don't mind, we 
should put this into the DUB main repository and also get in 
touch with the package maintainers to include it in the 
standard distribution.


Very ok with me :)


BTW, corresponding GitHub issue:
https://github.com/D-Programming-Language/dub/issues/154


Thx.


Re: Smile, you're on Wired

2014-07-07 Thread Nordlöw

On Monday, 7 July 2014 at 16:06:45 UTC, Andrei Alexandrescu wrote:

https://www.facebook.com/dlang.org/posts/880588921954790


Great!

Made some encouraging comments at the bottom the Wired article. I 
hope I got them right :)


Re: DConf 2014 Day 2 Talk 3: Designing an Aurora: A Glimpse at the Graphical Future of D by Adam Wilson

2014-07-08 Thread Nordlöw
On Tuesday, 8 July 2014 at 16:03:36 UTC, Andrei Alexandrescu 
wrote:

http://www.reddit.com/r/programming/comments/2a5ia9/dconf_2014_day_2_talk_3_designing_an_aurora_a/

Very intriguing.

First question for Andrew Wilson i reckon :)

Is the Immutable Scene Object (ISO) supposed to be an exact copy 
(same type and same contents) of the User Scene Object (USO) 
especially with regards to the Model-View-Controller pattern:


https://en.wikipedia.org/wiki/Model-View-Controller

I'm asking because I first thought that

- USO typically maps to the Model (data) and the
- ISO typically maps to the View (visual representation)


Re: DConf 2014 Day 2 Talk 4: Reducing D Bugs by Vladimir Panteleev

2014-07-09 Thread Nordlöw

On Wednesday, 9 July 2014 at 18:26:53 UTC, simendsjo wrote:

Would it make sense to add them to the dtools repository?


It's already included there as a submodule :)


Re: DUB Bash Completion

2014-07-10 Thread Nordlöw

On Wednesday, 9 July 2014 at 16:12:01 UTC, Sönke Ludwig wrote:
Shall I just commit the file (with you as the author of 
course), or do you want to open a pull request?


You can commit the file. That's ok with me :)


I've tried it now and it worked flawlessly so far.


I'm glad :)

Thx


Re: DUB Bash Completion

2014-07-13 Thread Nordlöw

On Sunday, 13 July 2014 at 20:15:06 UTC, w0rp wrote:
I suppose one extra step you could go would be to somehow 
complete --config= too, so you could tab complete --config=foo 
and --config=bar or something.


--config

is not documented by

dub -h

Is it a sub command flag?


Re: DUB Bash Completion

2014-07-14 Thread Nordlöw

On Monday, 14 July 2014 at 00:10:38 UTC, Mathias LANG wrote:

complete --config= too, so you could tab complete


Yeah, that would be nice. Need to add som json parsing to the 
bash logic. Any suggestions on how to most easily and portably do 
that?


Re: D 2.066 is out. Enjoy!

2014-08-18 Thread Nordlöw
On Monday, 18 August 2014 at 19:00:23 UTC, Andrei Alexandrescu 
wrote:


Support for new flag -vcolumns in Emacs FlyCheck is soon about to 
follow:


https://github.com/flycheck/flycheck/issues/460


Re: Eclipse D Development Tools (DDT) plug-in version 0.10.2 released

2014-08-30 Thread Nordlöw

On Thursday, 28 August 2014 at 21:20:48 UTC, Bruno Medeiros wrote:
- Mouse hovering over an auto keyword will show the resolved 
type


- How is this implemented?
- Will this expand to cover any expression at the cursor in the 
future? This would be a super promotor for introducing D to 
newcomers.


Re: Multiple alias this is coming.

2014-09-18 Thread Nordlöw
On Thursday, 18 September 2014 at 11:20:49 UTC, IgorStepanov 
wrote:

I've created pull request, which introduces multiple alias this.
https://github.com/D-Programming-Language/dmd/pull/3998
Please see the additional tests and comment it.


Exciting!

What more good things than a better behaving Nullable(T) with T 
being a polymorphic class will this enable?


Re: Multiple alias this is coming.

2014-09-19 Thread Nordlöw
On Thursday, 18 September 2014 at 22:13:14 UTC, IgorStepanov 
wrote:

Is Nullable!(T) with polymorphic type disallowed now?


Sorry, I meant

NotNull(T)

Here's a module

https://github.com/nordlow/justd/blob/master/notnull.d

a bit tweak from the original design by Adam D Ruppe.



Re: Multiple alias this is coming.

2014-09-19 Thread Nordlöw

On Friday, 19 September 2014 at 13:24:53 UTC, IgorStepanov wrote:
What does a troubles with your NotNull implementation you have 
with old alias this?
Do you want to implicit cast from NotNull!(T) to all other 
NotNull!(B) where B is basetype of T?


Yes, that is what I want, but last time I checked DMD didn't 
allow me to.


Re: Multiple alias this is coming.

2014-09-19 Thread Nordlöw
On Thursday, 18 September 2014 at 11:20:49 UTC, IgorStepanov 
wrote:

I've created pull request, which introduces multiple alias this.
https://github.com/D-Programming-Language/dmd/pull/3998
Please see the additional tests and comment it.


Further, could this also be used to somehow simplify 
hierarchically defined enumerators? Typically the enumerators and 
predicates related to the enumeration WordKind defined here


https://github.com/nordlow/justd/blob/master/languages.d#L485


Re: Digger 1.0

2014-09-23 Thread Nordlöw
On Saturday, 20 September 2014 at 20:07:46 UTC, Vladimir 
Panteleev wrote:

Yet another release ruined by a DMD -inline wrong-code bug :(


It seems like use of -inline is not recommended then?


Re: Blog Post - Reducing vibe.d turnaround time (Part 1 Faster Linking)

2014-11-01 Thread Nordlöw

On Thursday, 30 October 2014 at 01:02:40 UTC, Martin Nowak wrote:

https://code.dawg.eu/reducing-vibed-turnaround-time-part-1-faster-linking.html


Could you add a reference on how to DUB-build a library as 
dynamic instead of static library to easy the process for 
newcomers?


Re: dfix 0.2.0

2014-11-25 Thread Nordlöw

On Monday, 24 November 2014 at 19:22:52 UTC, Brian Schott wrote:
dfix is a tool for automatically upgrading the syntax of D 
source code.


Changes since 0.1.1:
* #1 dfix will now rewrite "const int foo() {}" to int foo() 
const {}"
* #6 The C-style array syntax fix is no longer incorrectly 
applied to

  certain ASM statements.
* #9 You can now provide directory names as arguments to dfix 
in case
  you're too lazy to run find and xargs. (And really, who 
isn't?)

* #11 dfix is now registered on code.dlang.org.
  http://code.dlang.org/packages/dfix
* Added tests.


When trying to build dfix with dmd git master as

dub -v

I get

Generate target libdparse (staticLibrary 
/home/per/.dub/packages/libdparse-0.1.1 libdparse)
Target 
'/home/per/.dub/packages/libdparse-0.1.1/.dub/build/library-debug-linux.posix-x86_64-dmd_2067-BB8147F4EBDBE336D187810BFAA258B4/liblibdparse.a' 
doesn't exist, need rebuild.
Building libdparse 0.1.1 configuration "library", build type 
debug.

Running dmd...
dmd -lib 
-of../../.dub/packages/libdparse-0.1.1/.dub/build/library-debug-linux.posix-x86_64-dmd_2067-BB8147F4EBDBE336D187810BFAA258B4/liblibdparse.a 
-debug -g -w -version=Have_libdparse 
-I../../.dub/packages/libdparse-0.1.1/src 
-I../../.dub/packages/libdparse-0.1.1/src/ 
../../.dub/packages/libdparse-0.1.1/src/std/allocator.d 
../../.dub/packages/libdparse-0.1.1/src/std/d/ast.d 
../../.dub/packages/libdparse-0.1.1/src/std/d/entities.d 
../../.dub/packages/libdparse-0.1.1/src/std/d/formatter.d 
../../.dub/packages/libdparse-0.1.1/src/std/d/lexer.d 
../../.dub/packages/libdparse-0.1.1/src/std/d/parser.d 
../../.dub/packages/libdparse-0.1.1/src/std/lexer.d
../../.dub/packages/libdparse-0.1.1/src/std/allocator.d(4229): 
Warning: instead of C-style syntax, use D-style syntax 
'Allocator[(max - (min - 1)) / step] buckets'
FAIL 
../../.dub/packages/libdparse-0.1.1/.dub/build/library-debug-linux.posix-x86_64-dmd_2067-BB8147F4EBDBE336D187810BFAA258B4/ 
libdparse staticLibrary

Error executing command run:

Why?

I guess one solution would be to make warnings non-errors right 
but that seems dumb concerning what dfix can do for us regarding 
auto-converting C-style arrays syntax to D-style :)


Re: dfix 0.2.0

2014-11-25 Thread Nordlöw

On Tuesday, 25 November 2014 at 23:45:17 UTC, Nordlöw wrote:
I guess one solution would be to make warnings non-errors right 
but that seems dumb concerning what dfix can do for us 
regarding auto-converting C-style arrays syntax to D-style :)


BTW: How do I specify that a dependency package (libdparse) 
should be compiled with -wi instead of -w?


Re: dfix 0.2.0

2014-11-26 Thread Nordlöw

On Tuesday, 25 November 2014 at 23:58:21 UTC, Brian Schott wrote:

On Tuesday, 25 November 2014 at 23:47:07 UTC, Nordlöw wrote:

On Tuesday, 25 November 2014 at 23:45:17 UTC, Nordlöw wrote:
I guess one solution would be to make warnings non-errors 
right but that seems dumb concerning what dfix can do for us 
regarding auto-converting C-style arrays syntax to D-style :)


The issue trackers for dfix and libdparse are on github.

BTW: How do I specify that a dependency package (libdparse) 
should be compiled with -wi instead of -w?


You can read DUB's documentation here: 
http://code.dlang.org/package-format


It would be nice if we could call DUB either as

dub -wi

or in a more generic way as

dub --dmd-flags="wi,..."

so I don't have to clone the top-level project and modify its 
dub.json myself in order to test dfix built using dmd git master. 
Should I register an DUB issue for this?


Re: dfix 0.2.0

2014-11-26 Thread Nordlöw

On Wednesday, 26 November 2014 at 13:11:28 UTC, Nordlöw wrote:

It would be nice if we could call DUB either as

dub -wi

or in a more generic way as

dub --dmd-flags="wi,..."

so I don't have to clone the top-level project and modify its 
dub.json myself in order to test dfix built using dmd git 
master. Should I register an DUB issue for this?



Note that

DFLAGS=-wi dub build -v

doesn't work here either because -wi is prepended to -w which 
still results warnings as errors.


Request for Recursive Warnings as Message DUB Flag

2014-11-30 Thread Nordlöw
I really think DUB lacks an important flag/option namely a 
variant of


allowWarnings

that *recursively* affects all the sub packages of a dub.json 
project description.


Otherwise developers who want to try out D will think its is 
broken because of warnings such as deprecated use of C-style 
arrays hinders them from building and trying out all the cool 
software currently packaged with DUB.


I don't think D's deprecation system was meant to have this 
affect on the developer.


Comments on that, please.


Re: Request for Recursive Warnings as Message DUB Flag

2014-12-01 Thread Nordlöw

On Sunday, 30 November 2014 at 15:48:14 UTC, Nordlöw wrote:
I really think DUB lacks an important flag/option namely a 
variant of


allowWarnings

that *recursively* affects all the sub packages of a dub.json 
project description.


Otherwise developers who want to try out D will think its is 
broken because of warnings such as deprecated use of C-style 
arrays hinders them from building and trying out all the cool 
software currently packaged with DUB.


I don't think D's deprecation system was meant to have this 
affect on the developer.


Comments on that, please.


Crap, I should of course have posted this on digitalmars.D.


Re: Concise Binary Object Representation (CBOR) binary serialization library.

2014-12-19 Thread Nordlöw

On Friday, 19 December 2014 at 18:26:26 UTC, MrSmith wrote:

Here is github link: https://github.com/MrSmith33/cbor-d
Destroy!


It would be nice to have a side-by-side comparison with 
http://msgpack.org/ which is in current use by a couple existing 
D projects, include D Completion Daemon (DCD) and a few of mine.


Re: Voting for std.experimental.allocator

2015-07-08 Thread Nordlöw

On Wednesday, 8 July 2015 at 11:33:03 UTC, Dicebot wrote:
Please respond to this post with a comment starting with a 
single "Yes"/"No"


Yes


Re: "Programming in D" paper book is available for purchase

2015-08-20 Thread Nordlöw

On Wednesday, 19 August 2015 at 00:57:32 UTC, Ali Çehreli wrote:

Enjoy, and go buy some books! ;)


Thank you!


Re: D-Day for DMD is today!

2015-08-24 Thread Nordlöw

On Sunday, 23 August 2015 at 05:17:33 UTC, Walter Bright wrote:

https://github.com/D-Programming-Language/dmd/pull/4923

We have made the switch from C++ DMD to D DMD!



Worth mentioning:

The final call to dmd that compiles 117 klines (~80 files) of D 
code in one show and links dmd takes 1.1 seconds on my laptop. 
Pretty darn cool. Thank you!


Re: v0.2.1 of EMSI's containers library

2015-09-12 Thread Nordlöw

On Tuesday, 1 September 2015 at 04:03:48 UTC, Brian Schott wrote:
Please report bugs on Github here: 
https://github.com/economicmodeling/containers/issues


Move semantics anyone?

https://github.com/economicmodeling/containers/issues/25


Re: Facebook is using D in production starting today

2013-10-14 Thread Per Nordlöw
On Friday, 11 October 2013 at 00:36:12 UTC, Andrei Alexandrescu 
wrote:
Today I committed the first 5112 lines of D code to Facebook's 
repository. The project is in heavy daily use at Facebook. 
Compared to the original version (written in C++) we've 
measured massive wins in all of source code size, build speed, 
and running speed.


In all likelihood we'll follow up with a blog post describing 
the process.



Andrei


Fantastic!

I've already distributed the news to everyone programmer I know 
of.


/Per


Re: reggae v0.5.0: new features in the D meta-build system

2015-09-25 Thread Nordlöw via Digitalmars-d-announce

On Thursday, 24 September 2015 at 15:04:49 UTC, Atila Neves wrote:
I you want any advice on this matter please contact me. I'd be 
glad to be of service.


Send me an email, I'm more than happy to waffle away about 
build systems.


BTW. I'm planning on visiting Berlin for DConf 2016. We could 
have a chat there.


Re: Fastest JSON parser in the world is a D project

2015-10-26 Thread Nordlöw via Digitalmars-d-announce

On Wednesday, 14 October 2015 at 07:35:49 UTC, Marco Leise wrote:

Example:

double x = 0, y = 0, z = 0;
auto json = parseTrustedJSON(`{ "coordinates": [ { "x": 1, 
"y": 2, "z": 3 }, … ] }`);


foreach (idx; json.coordinates)
{
// Provide one function for each key you are interested 
in

json.keySwitch!("x", "y", "z")(
{ x += json.read!double; },
{ y += json.read!double; },
{ z += json.read!double; }
);
}


How can `coordinates` member be known at compile-time when the 
input argument is a run-time string?


Re: Please vote for the DConf logo

2015-11-15 Thread Nordlöw via Digitalmars-d-announce
On Wednesday, 4 November 2015 at 09:30:30 UTC, Andrei 
Alexandrescu wrote:

Reply to this with 1.1, 1.2, 2, or 3:

1) by ponce:

Variant 1: 
https://github.com/p0nce/dconf.org/blob/master/2016/images/logo-sample.png
Variant 2: 
https://raw.githubusercontent.com/p0nce/dconf.org/4f0f2b5be8ec2b06e3feb01d6472ec13a7be4e7c/2016/images/logo2-sample.png


2) by Jonas Drewsen:

https://dl.dropboxusercontent.com/u/188292/g4421.png

3) by anonymous:

PNG: http://imgur.com/GX0HUFI
SVG: https://gist.github.com/anonymous/4ef7282dfec9ab327084


Thanks,

Andrei


3


Re: Three Cool Things about D

2015-12-22 Thread Nordlöw via Digitalmars-d-announce
On Monday, 21 December 2015 at 17:28:51 UTC, Andrei Alexandrescu 
wrote:

https://www.reddit.com/r/programming/comments/3xq2ul/codedive_2015_talk_three_cool_things_about_d/


Great motivation as always! Thx!


Re: Better docs for D (WIP)

2016-01-05 Thread Nordlöw via Digitalmars-d-announce

On Monday, 28 December 2015 at 20:15:30 UTC, Adam D. Ruppe wrote:
Last week, I posted in the general forum my dream for better D 
docs. Today, about 4 days of work later, I'm about 1/4 of the 
way there.


Still a long way to go, but I've already come so far.

First, behold my old dpldocs.info site. Yes, it is still up and 
now it ties into my new docs! You can use it to quickly jump to 
a doc given its name:


http://dpldocs.info/


This is awesome! I warmly welcome this approach. I just got a 
comment from a newbie D developer fellow who commented on the 
current unpleasant doc formatting of templated headers.


Re: Better docs for D (WIP)

2016-01-05 Thread Nordlöw via Digitalmars-d-announce

On Tuesday, 5 January 2016 at 15:43:30 UTC, Nordlöw wrote:
This is awesome! I warmly welcome this approach. I just got a 
comment from a newbie D developer fellow who commented on the 
current unpleasant doc formatting of templated headers.


The mouse-over behaviour of CT- and RT-parameters is just really 
really cool! Thanks!


Re: Andrei on Optimization

2016-01-08 Thread Nordlöw via Digitalmars-d-announce

On Friday, 8 January 2016 at 13:30:34 UTC, Walter Bright wrote:

https://www.reddit.com/r/programming/comments/400wpy/andrei_alexandrescus_amazing_150_minutes_course/

Part 1: https://www.youtube.com/watch?v=ph7FP0LnmcA

Part 2: https://www.youtube.com/watch?v=3_FXy3cT5C8


Try setting Youtube playback speed to 0.5. That gave me one heck 
of a laugh :)


Re: Beta D 2.070.0-b1

2016-01-14 Thread Nordlöw via Digitalmars-d-announce

On Sunday, 3 January 2016 at 19:24:57 UTC, Martin Nowak wrote:

http://dlang.org/changelog/2.070.0.html


I'm missing changelog entry for

- new algorithm `std.algorithm.comparison.either`
- update for return type of `findSplit*` enabling bool-conversion 
in for instance


if (const hit = haystack.findSplit(needle))
{
// use hit
}


Re: Beta D 2.070.0-b2

2016-01-19 Thread Nordlöw via Digitalmars-d-announce

On Monday, 18 January 2016 at 14:29:37 UTC, Martin Nowak wrote:

Fixed, I simply forgot to update the changelog from phobos.
https://github.com/D-Programming-Language/dlang.org/commit/128de6cce74b6fe8f98c35d2e3b44c44517152c8
http://dlang.org/changelog/2.070.0.html


I'm still missing entries for

- 
https://github.com/D-Programming-Language/phobos/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed++author%3Anordlow

- https://github.com/D-Programming-Language/phobos/pull/3288


Re: Airfares to Berlin for DConf 2016

2016-01-21 Thread Nordlöw via Digitalmars-d-announce
On Wednesday, 20 January 2016 at 09:04:07 UTC, Walter Bright 
wrote:
I saw on the news this evening that air fares for the next 3 
weeks will be at a 3 year low. It's a good time to book the 
flights to Berlin!


Is there a special hotel, nearby Semantic HQ, where most of the 
contenders plan to stay?


Further, when do contenders usually arrive (the day before)?


Re: Beta D 2.070.0-b2

2016-01-21 Thread Nordlöw via Digitalmars-d-announce

On Wednesday, 20 January 2016 at 09:03:50 UTC, Martin Nowak wrote:
Well, please write them (targeting stable). Changelog entries 
should nowadays be part of pull requests.

https://github.com/D-Programming-Language/phobos/blob/ca3b4c839770a02f2414b20aa11c38f79419871b/changelog.dd#L9


Ok, I'll look into it.


Re: dlang.org Re-Design Dark Theme

2016-03-14 Thread Nordlöw via Digitalmars-d-announce

On Monday, 14 March 2016 at 12:00:24 UTC, Jakob Ovrum wrote:
Suggestions, forks, uploads to Stylish and so forth are all 
welcome. The important part is that we have an alternative that 
is nice on the eyes for us who use dark-coloured UIs.


Looks great, apart from the red-flags on the bottom-right of the 
screen being a bit too dark.


Emacs dfmt wrapper

2016-03-22 Thread Nordlöw via Digitalmars-d-announce
I've hacked together a little Elisp magic that seems to work as 
wrapper around dfmt.


https://github.com/nordlow/elisp/blob/master/mine/dfmt.el

Improvements are very welcome!

Enjoy!


Re: 2016Q1: std.blas

2016-03-24 Thread Nordlöw via Digitalmars-d-announce
On Saturday, 26 December 2015 at 20:51:06 UTC, Ilya Yaroshenko 
wrote:

Related questions about LDC
http://forum.dlang.org/thread/lcrquwrehuezpxxvq...@forum.dlang.org


Sounds amazing. I can't wait either ;)

Thanks in advance.

I have some minimum square data fitting algorithms I would like 
to port to D and perhaps also to Phobos.


Re: 2016Q1: std.blas

2016-03-24 Thread Nordlöw via Digitalmars-d-announce
On Saturday, 26 December 2015 at 19:57:19 UTC, Ilya Yaroshenko 
wrote:

I will write GEMM and GEMV families of BLAS for Phobos.


Is there a repo where I can track progress?


Re: 2016Q1: std.blas

2016-03-24 Thread Nordlöw via Digitalmars-d-announce

On Thursday, 24 March 2016 at 09:30:04 UTC, 9il wrote:

I will post Level 1 to Mir during this week.


Great!


Re: Weak Purity Blog Post

2016-03-30 Thread Nordlöw via Digitalmars-d-announce

On Monday, 28 March 2016 at 01:44:02 UTC, sarn wrote:
I wrote a post about some of the practical benefits of this 
kind of purity:


https://theartofmachinery.com/2016/03/28/dirtying_pure_functions_can_be_useful.html


Great. It would be nice if you added a section that discusses 
purity in collaboration with allocators.


See discussions:

http://forum.dlang.org/post/yvwtjybwphxovrxav...@forum.dlang.org
http://forum.dlang.org/post/ejaarbdzcqgqhkxla...@forum.dlang.org

and

https://github.com/D-Programming-Language/druntime/pull/1183#issuecomment-202444315


Units of Measurement Library: units-d

2016-03-31 Thread Nordlöw via Digitalmars-d-announce

I've put David Nadlinger work together with my tweaks on top at

https://github.com/nordlow/units-d

to make it easier to experiment with.

PR are very welcome.


Re: Release D 2.071.0

2016-04-07 Thread Nordlöw via Digitalmars-d-announce

On Tuesday, 5 April 2016 at 22:43:05 UTC, Martin Nowak wrote:

Glad to announce D 2.071.0.


I read somewhere recently about performance regressions in DMD. 
Were these related the import and module fixes? Were they fixed? 
Do they depend on any dmd switches?


Thanks anyway!


New repo for my reusable D Phobos extensions

2016-04-09 Thread Nordlöw via Digitalmars-d-announce

I've packaged my reusable extensions to Phobos at

https://github.com/nordlow/phobos-next

PRs are very welcome.

There are lots of goodies here. Some of them should probably be 
moved to standard Phobos. I currently have lots of other D things 
to do, but you guys are welcome to try to integrate them into 
Phobos.


Enjoy or Destroy!


Re: New repo for my reusable D Phobos extensions

2016-04-10 Thread Nordlöw via Digitalmars-d-announce

On Saturday, 9 April 2016 at 18:25:54 UTC, Nordlöw wrote:

I've packaged my reusable extensions to Phobos at

https://github.com/nordlow/phobos-next


Also at http://code.dlang.org/packages/phobos-next


Re: New repo for my reusable D Phobos extensions

2016-04-10 Thread Nordlöw via Digitalmars-d-announce

On Saturday, 9 April 2016 at 23:49:14 UTC, ag0aep6g wrote:

,
:

Changing arbitrary bits in arbitrary types is the opposite of 
memory-safe.


These operate only on integer types thanks to isIntegral template 
constraint. Are you saying I need to limit to machine types 
u?int{8,16,32,64,12} to not include BigInt? If so is there a 
trait for this?


Re: New repo for my reusable D Phobos extensions

2016-04-10 Thread Nordlöw via Digitalmars-d-announce

On Sunday, 10 April 2016 at 20:24:41 UTC, Nordlöw wrote:
These operate only on integer types thanks to isIntegral 
template constraint. Are you saying I need to limit to machine 
types u?int{8,16,32,64,12} to not include BigInt? If so is 
there a trait for this?


Further, perhaps we could/should do range checking on the bit 
index parameter(s).


Re: New repo for my reusable D Phobos extensions

2016-04-11 Thread Nordlöw via Digitalmars-d-announce

On Sunday, 10 April 2016 at 20:54:31 UTC, ag0aep6g wrote:
No, these are the overloads for non-integer T. The constraint 
says `!(isIntegral!T)`. The integer overloads are above the 
ones I linked, respectively.


Ok. Thanks. Fixed.


Re: Computer Vision Library in D

2016-04-19 Thread Nordlöw via Digitalmars-d-announce
On Tuesday, 19 April 2016 at 17:01:12 UTC, Relja Ljubobratovic 
wrote:

[1] https://github.com/ljubobratovicrelja/dcv


Standard modules for color conversion already exists. See for 
instance


https://github.com/TurkeyMan/color
https://github.com/adamdruppe/arsd/blob/master/color.d

Great that you've made compatible with ndslice!


Re: Proposed: start DConf days one hour later

2016-04-28 Thread Nordlöw via Digitalmars-d-announce
On Wednesday, 27 April 2016 at 18:36:54 UTC, Andrei Alexandrescu 
wrote:
The folks at Sociomantic suggested to start at 10:00 AM instead 
of 9:00 AM, therefore shifting the end time by one as well. 
Please reply with thoughts on this! We're particularly 
concerned about folks who need to take off early on Friday. -- 
Andrei


+1


Re: xoroshiro128+ random number generator

2016-04-30 Thread Nordlöw via Digitalmars-d-announce
On Friday, 29 April 2016 at 21:40:49 UTC, Joseph Rushton Wakeling 
wrote:

Spotted this reddit post the other day:
https://www.reddit.com/r/programming/comments/4gtlfz/xoroshiro128_the_fastest_fullperiod_pseudorandom/


@nogc :)


Re: Battle-plan for CTFE

2016-05-09 Thread Nordlöw via Digitalmars-d-announce
On Monday, 9 May 2016 at 18:20:46 UTC, Robert burner Schadek 
wrote:

awesome news :-) thanks you


I very much agree.


Re: DustMite now has -j

2016-05-11 Thread Nordlöw via Digitalmars-d-announce
On Wednesday, 11 May 2016 at 19:53:54 UTC, Vladimir Panteleev 
wrote:

By popular demand.

https://github.com/CyberShadow/DustMite/compare/e175b95da070d84029f75ba8a15f5d900fb90704...15693cbd5a5c0f47ee9cc68be9dada39b99c3836


Great!


Re: Found on Reddit: Cache sizes with CPUID in C++ and D

2016-05-15 Thread Nordlöw via Digitalmars-d-announce

On Sunday, 15 May 2016 at 14:56:47 UTC, Ali Çehreli wrote:
Quote from the original article: "In D, there is a cpuid module 
that can retrieve cache information, but from what I've found 
it's incorrect."


Then the author provides a function that does it correctly.


But the article doesn't tell what's wrong with.

So what's wrong with:

import core.cpuid;
const(CacheInfo)[5] dc = dataCaches();

?


Re: My ACCU 2016 keynote video available online

2016-05-16 Thread Nordlöw via Digitalmars-d-announce

On Monday, 16 May 2016 at 13:46:11 UTC, Andrei Alexandrescu wrote:
Uses D for examples, showcases Design by Introspection, and 
rediscovers a fast partition routine. It was quite well 
received. https://www.youtube.com/watch?v=AxnotgLql0k


Andrei


Great! Your talks are always pushedFront in my view queue 😊

Did you manage to recruit any new D liutenants 😉


Re: Better Voldemort types

2016-05-25 Thread Nordlöw via Digitalmars-d-announce
On Tuesday, 24 May 2016 at 01:29:53 UTC, Steven Schveighoffer 
wrote:

http://www.schveiguy.com/blog/2016/05/have-your-voldemort-types-and-keep-your-disk-space-too/


Good read. I'll horcruxify my phobos-next ranges until compiler 
is fixed. Thanks!


Re: D Profile Viewer

2016-06-02 Thread Nordlöw via Digitalmars-d-announce

On Thursday, 24 March 2016 at 20:34:07 UTC, Andrew wrote:

Its here: https://bitbucket.org/andrewtrotman/d-profile-viewer
Please let me know if you find any bugs.


It's better to use backticks to produce raw string literals for 
all the quoted code. Then you don't have to backslash all the 
double-quotes in the HTML and JS here:


https://bitbucket.org/andrewtrotman/d-profile-viewer/src/b8292aad50dab5ceca6a9067f0d867f89d9c0d20/source/app.d?at=default&fileviewer=file-view-default

The for instance

"
	src=\"https://www.google.com/jsapi\";>

"

becomes

`
	src="https://www.google.com/jsapi";>

`

Thanks!



Re: Beta release DUB 1.0.0-beta.1


On Tuesday, 7 June 2016 at 09:54:19 UTC, Sönke Ludwig wrote:
DUB 1.0.0 is nearing completion. The new feature over 0.9.25 
is...


Great work! I've spread the news to all my hackish friends.


Re: NDC 2016 talk now online

On Friday, 24 June 2016 at 14:06:48 UTC, Andrei Alexandrescu 
wrote:

https://www.reddit.com/r/programming/comments/4pmsgu/andrei_on_algorithms_search_partition_fast/
 -- Andrei


Great talk, as usual, and great results.

Has Phobos been updated to make use of these improvements, 
typically sentinel-based searching and fast deterministic 
selection?


If not which Phobos algorithms should be?


Re: Battle-plan for CTFE


On Thursday, 30 June 2016 at 03:17:38 UTC, Stefan Koch wrote:
Until then you can see my progress at 
https://github.com/UplinkCoder/dmd/tree/newCTFE

I will try to always keep the branch in a healthy state.


I can't wait to see the benchmarks.

Keep up the good work!


Re: DIP1000: Scoped Pointers


On Wednesday, 10 August 2016 at 20:35:23 UTC, Dicebot wrote:
The first DIP has just landed into the new queue. It is a 
proposal from language authors and thus it bypasses usual 
nitpicking process and proceeds straight to requesting 
community (your!) feedback.


Thanks for all the work.

One remarks. I guess `RefCountedSlice` should infer access 
permissions of `payload` and `count` to allow


RefCountedSlice!(const(T))

right? Is that beyond the scope of the DIP?


Re: DIP1000: Scoped Pointers


On Thursday, 11 August 2016 at 07:48:18 UTC, Walter Bright wrote:

On 8/10/2016 11:36 PM, rikki cattermole wrote:

Perfect :)


The nice thing about this scheme is it can do some things that 
Rust can't (and Rust can do things that this can't). I suppose 
it will balance out.


If this is successfully implemented, what will D not be able to 
do, that Rust can/will?


Re: [GSoC] Mir.random.flex - Generic non-uniform random sampling


On Monday, 22 August 2016 at 15:34:47 UTC, Seb wrote:
I am proud to publish a report of my GSoC work as two extensive 
blog posts, which explain non-uniform random sampling and the 
mir.random.flex package (part of Mir > 0.16-beta2):


Fantastic work!


Re: [GSoC] Mir.random.flex - Generic non-uniform random sampling


On Monday, 22 August 2016 at 15:34:47 UTC, Seb wrote:

http://blog.mir.dlang.io/random/2016/08/19/intro-to-random-sampling.html
http://blog.mir.dlang.io/random/2016/08/22/transformed-density-rejection-sampling.html


Found at typo:

Search for "performance boost performance boost"


Re: Battle-plan for CTFE


On Monday, 29 August 2016 at 00:24:01 UTC, Stefan Koch wrote:
I feel that this can have a positive

I am happy for all comments or suggestions.


Incredible work! Keep up!


Flycheck DMD Coverage and Dscanner Support

I've added experimental support in Flycheck for highlighting all 
lines that have zero coverage at


https://github.com/nordlow/elisp/blob/master/mine/flycheck-d-all.el

Source is an extension of unittest add-ons in 
https://github.com/flycheck/flycheck-d-unittest.


I've also had Flycheck-support for Dscanner hanging around for 
some time at


https://github.com/nordlow/elisp/blob/master/mine/flycheck-d-dscanner.el

I haven't figured out how to have these active at once, thought. 
So pick one or the other but not both at the same time. Something 
wrong with my settings of the `:next-checkers` property I 
presume. Ideas?


Feedback is much appreciated. A key-question is how the coverage 
line count could be visualized aswell.


Destroy!


Re: Flycheck DMD Coverage and Dscanner Support


On Tuesday, 13 September 2016 at 18:55:31 UTC, Nordlöw wrote:
I haven't figured out how to have these active at once, 
thought. So pick one or the other but not both at the same 
time. Something wrong with my settings of the `:next-checkers` 
property I presume. Ideas?


Problem with multiple-checkers after dmd is solved. Se comment at

https://github.com/flycheck/flycheck/issues/1074


Re: LDC: Speed up incremental builds with object file caching

On Saturday, 17 September 2016 at 18:46:26 UTC, Johan Engelen 
wrote:

I just finished another post about LDC:
https://johanengelen.github.io/ldc/2016/09/17/LDC-object-file-caching.html


Great innovative work!

One thing: I'm missing an option for only doing time-stamp 
checking of the dependencies similar to how SCons checks if 
cached files are obselete.


See the Decider function documented here:

http://www.scons.org/doc/HTML/scons-user/ch06.html#idp1416061700

It can be either

- Decider('MD5')
- Decider('timestamp-newer')
- Decider('timestamp-match')
- Decider('MD5-timestamp')

As I see it the LDC-enhancement always does content hashing, that 
is, it is similar to SCons' `Decider('MD5')`. If so, it would be 
very worthwhile checking how much faster an approach similar to 
`Decider('MD5-timestamp')` would be. This approach only hashes 
content of dependencies if they have been modified since last 
hashing during last build of that object with the same compiler 
flags was done.


Re: Battle-plan for CTFE


On Monday, 19 September 2016 at 10:07:06 UTC, Stefan Koch wrote:

Compiling all of phobos does not crash my engine anymore!


Great work! Keep up still!


Re: Battle-plan for CTFE


On Monday, 17 October 2016 at 15:50:37 UTC, Uplink_Coder wrote:
The time llvm takes to build it's IR and execute the JITed code 
is absolutely too much! multiple milliseconds!


I will write a very simple x86 codegenerator tomorrow.


Great work.


Re: Battle-plan for CTFE


On Sunday, 25 September 2016 at 20:47:41 UTC, Stefan Koch wrote:
If all goes well there will be a separate nightly release build 
from the newCTFE branch,  sometime in October.


I hope to get alpha bug reports that way.


Have you benchmarked CTFE-heavy projects like Pegged?


Re: Comparing compilation time of random code in C++, D, Go, Pascal and Rust

On Wednesday, 19 October 2016 at 17:05:18 UTC, Gary Willoughby 
wrote:

crashed: "Error: more than 32767 symbols in object file".


Will that many symbols ever happen in real applications?

Anyway, nice!


Re: Dlang dynamic compilation


On Monday, 21 November 2016 at 18:59:17 UTC, Ivan Butygin wrote:

Hacked ldc sources are here:
https://github.com/Hardcode84/ldc/tree/runtime_compile


This could be used to accelerate genetic algorithms at run-time.


Re: Mir Random v0.0.1 release


On Friday, 2 December 2016 at 18:59:08 UTC, Ilya Yaroshenko wrote:

A replacement for std.random from stats professionals.


Nice work!


Re: Mir Blog: Writing efficient numerical code in D

On Monday, 12 December 2016 at 21:58:23 UTC, Relja Ljubobratovic 
wrote:

http://blog.mir.dlang.io/ndslice/algorithm/optimization/2016/12/12/writing-efficient-numerical-code.html


Awesome!


Re: Milestone - DMD front end is now 100% D!

On Thursday, 15 December 2016 at 01:04:54 UTC, Walter Bright 
wrote:

https://github.com/dlang/dmd/pull/6310


Great work!


Re: concepts v0.0.1


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

Atila


Surprisingly little code. Thx.


Re: Many documentation examples can now be run online

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


Nice!


Re: Many documentation examples can now be run online


On Monday, 19 December 2016 at 17:50:17 UTC, Seb wrote:
I would like to add that this is in an experimental/testing 
stage and hopefully will get stable with the next release ;-)


Great work, Seb!


Re: Reminder - DConf 2017 is May 4-6 !!


On Saturday, 7 January 2017 at 01:06:49 UTC, Stefan Koch wrote:

new CTFE engine or the future my plan for O(N log N) templates!


What do you mean?
A performance improvement?
From quadratic?


Re: GMP bindings for DLang


On Wednesday, 11 January 2017 at 12:53:13 UTC, Andrew Hall wrote:

https://code.dlang.org/packages/libgmp


See also 
http://forum.dlang.org/thread/imoaobpfaggyphjox...@forum.dlang.org


Re: Software Engineer at LinkedIn praises D


On Friday, 13 January 2017 at 15:42:59 UTC, extrawurst wrote:

Whoever has an Account there can like the Post here:

www.linkedin.com/hp/update/6224912211941298176


Inspiring!


Re: SmartRef: The Smart Pointer In D


On Friday, 13 January 2017 at 16:50:37 UTC, Dsby wrote:

I write the ref count pointer and the scoped point in D.


How do two of these differ from

- https://dlang.org/phobos/std_typecons.html#.RefCounted
- https://dlang.org/phobos/std_typecons.html#.Unique

under

https://dlang.org/phobos/std_typecons.html

?


  1   2   3   >