Hi there.
While I'm here, I thought I'd mention something else that's been on my mind.
D lang has a very nice statement, "alias", which helps to shorten code. In Python we'd also tend to bind shorter names to otherwise pretty long names/identifiers/etc, for conveniance.
eg: foo = foomodule.bar.baz.FooFactory
The D syntax I'm refering to is over here:
https://dlang.org/spec/declaration.html#AliasDeclaration
So I'd like to borrow the "alias" statement from D lang for that kind of thing.
I suspect there's an easy way of implementing "alias" via Nim metaprogramming, but I haven't figured it out yet.
It might also be something nice to have in the standard lib.
Next thing I'd like to borrow from D would be a formal "design by contract" syntax, eg, described over here:
https://dlang.org/spec/contracts.html
I suspect that's also easy to add by Nim metaprogramming, but again, my metaprogramming-fu is very weak.
(assert statements are nice, but inline unit tests/doctests, contracts, etc are pretty nice from a code review/QA point of view).
vibe.d is also pretty awesome-looking:
And I also have some envy over C++'s "WT" web framework:
But those things are way past my C++/Nim/etc exc knowledge.
These also fall under my general "that would be awesome" wishlist.
Is there some kind of wishlist like that? Would be nice if there's something where people could add things like wanted third party bindings or libs, and be able to vote on them. Then interested bystanders could take a crack at working on some of those.
I'm thinking of something like a centralized feature request system for the Nim ecosystem. I think the Ubuntu project has something similar.
Slightly more centralized bug and requesting tracking (in general) on the ecosystem (eg: like Debian bug management) might be pretty handy too.
I can't implement any of this myself, mainly they're ideas I've had at the back of my mind. Please toss these onto the "might be nice"/"brain storming" heap.
I want to answer point no 1, Alias, Nim already have type alias such as
type
PMESSAGEPROC* = proc(Message: WINUINT, wParam: WPARAM, lParam: LPARAM): LRESULT {.cdecl.}
if you want to shorten something like foomodule.bar.baz.FooFactory,template can do that
template foo: expr =
foomodule.bar.baz.FooFactory
About DbC: The methodology is fairly intimately tied to classes, so it could only be adapted incompletely for Nim.
(And for what it's worth, DbC originated with Eiffel and is best understood in that context.)
Aliases, as jangko noted, are already supported by parameterless templates.