Re: Top Five World’s Most Underrated Programming Languages

2019-01-22 Thread germandiago via Digitalmars-d-announce

On Friday, 18 January 2019 at 08:55:23 UTC, Paulo Pinto wrote:
D really needs its killer use case if it is to move away from 
that list.


For me those would be superior metaprogramming and ability to
interface with C++, Objective-C and C in superior ways. But some
project must show those strong points.

I think migrating the critical point to migrate to another 
language
is usually compatibility. D does many things well and 
compatibility
and metaprogramming are two of those. But I think it is more a 
matter

of bad marketing than the fact that it does not do it well.


Now D supports semantic Web (RDF and SPARQL particularly)

2019-01-22 Thread Victor Porton via Digitalmars-d-announce

Now D supports semantic Web (RDF and SPARQL particularly):

I've created a D wrapper around C semantic Web library librdf.

Here is the code (it also supports several other programming 
languages, particularly I did also Ada2012 wrapper, the Ada 
wrapper is however somehow not stable):


https://github.com/vporton/redland-bindings

See also https://codereview.stackexchange.com/q/212017/189213 
about some future plans and probable some future API 
incompatibility.


Please participate in code review and adding more unittests.


Re: Bitblob (hash wrapper) & Minivariant (tagged union) dub packages

2019-01-22 Thread Paul Backus via Digitalmars-d-announce

On Tuesday, 22 January 2019 at 10:26:33 UTC, Mathias Lang wrote:

## Minivariant

https://github.com/Geod24/minivariant

Minivariant is a "works for me" replacement of `std.variant : 
Algebraic`.


[...]

I looked into fixing it, but given Variant's design (which 
relies heavily on `TypeInfo`) it would have been a wild goose 
chase. And I know I'm not the only one that needed his own 
tagged union (see e.g. 
https://github.com/s-ludwig/taggedalgebraic). It also has a 
`visit` method similar to std.variant, although not with 
delegates, as there is currently no way to merge delegates into 
an overload set, so you have to use an existing overload set 
(see the examples).


I've also been through this exact process. The resulting package 
is on dub as `sumtype` [1]. In addition to solving the problem 
you noticed with `immutable`, it also works with @safe, @nogc, 
pure, and nothrow, and supports both delegates and overload sets 
with its `match` method (the equivalent of `visit`).


[1] http://sumtype.dub.pm/


Bitblob (hash wrapper) & Minivariant (tagged union) dub packages

2019-01-22 Thread Mathias Lang via Digitalmars-d-announce

Hi everyone!
I usually don't post on the forums, but I got two small projects 
I developed as helpers for some other projects, and figured some 
people might have interest in them. They are registered on dub.


## Bitblob

https://github.com/Geod24/bitblob

Bitblob is a simple wrapper for hashes. While it was almost 
exclusively tested with 256 bits hash, it should work with any 
hash size.
It's a value type with 0 overhead (as in (Bitblob!256).sizeof == 
32), can be initialized from an hex string or the result of 
`std.digest.sha : shaXXXOf()` (which is an `ubyte[XXX/8]`).
It also provides allocation-less string representation via the 
`void toString(scope void delegate(const(char)[]))` method.



## Minivariant

https://github.com/Geod24/minivariant

Minivariant is a "works for me" replacement of `std.variant : 
Algebraic`.
I just wanted a simple tagged union that did the job, but the 
following code does not compile:

```d
import std.variant : Algebraic;

void main ()
{
immutable int a = 42;
Algebraic!(int, bool, string) var;
var = a;
}
```

```
dlang/dmd/std/variant.d(628): Error: static assert:  "Cannot 
store a immutable(int) in a VariantN!(16LU, int, bool, string). 
Valid types are (int, bool, string)"

wat.d(7):instantiated from here: opAssign!(immutable(int))
```

I looked into fixing it, but given Variant's design (which relies 
heavily on `TypeInfo`) it would have been a wild goose chase. And 
I know I'm not the only one that needed his own tagged union (see 
e.g. https://github.com/s-ludwig/taggedalgebraic). It also has a 
`visit` method similar to std.variant, although not with 
delegates, as there is currently no way to merge delegates into 
an overload set, so you have to use an existing overload set (see 
the examples).



The README of each repo contains more details and examples, and 
the code is usually documented.