Re: N-dimensional slices is ready for comments!

2015-06-15 Thread Denis Shelomovskij via Digitalmars-d-announce

16.06.2015 1:11, Denis Shelomovskij пишет:

15.06.2015 11:40, Ilya Yaroshenko пишет:

Hi All,

PR and Examples:
https://github.com/D-Programming-Language/phobos/pull/3397
DUB http://code.dlang.org/packages/dip80-ndslice

N-dimensional slices is real world example where `static foreach` would
be useful.
Corresponding lines was marked with //TODO: static foreach

Best regards,
Ilya



http://forum.dlang.org/post/l315jb$avg$1...@digitalmars.com



Sorry, this was the last one:
"Finally full multidimensional arrays support in D"
http://forum.dlang.org/thread/lg7c0t$jmg$1...@digitalmars.com

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: N-dimensional slices is ready for comments!

2015-06-15 Thread Denis Shelomovskij via Digitalmars-d-announce

15.06.2015 11:40, Ilya Yaroshenko пишет:

Hi All,

PR and Examples: https://github.com/D-Programming-Language/phobos/pull/3397
DUB http://code.dlang.org/packages/dip80-ndslice

N-dimensional slices is real world example where `static foreach` would
be useful.
Corresponding lines was marked with //TODO: static foreach

Best regards,
Ilya



http://forum.dlang.org/post/l315jb$avg$1...@digitalmars.com

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: DGui is alive

2014-05-30 Thread Denis Shelomovskij via Digitalmars-d-announce

26.05.2014 23:08, Andre пишет:

On Saturday, 24 May 2014 at 07:20:49 UTC, Denis Shelomovskij
wrote:

20.05.2014 17:46, FrankLike пишет:

DGui need some other controls,such as
imageButton,DataView,GridViewe.t.c.


There is no plan to add new controls and I don't see any lacking ones.

One can use `paint` event to draw image on button and there is
`GridPanel` (with usage example `grid.d`) so I don't understand why
`GridView` is needed and what is its purpose. Also I don't know what
is `DataView` for.


DGui is really fantastic, it is easy to use and without a big
overhead. What I experienced, developers coming from other
frameworks might miss a horizontal/vertical layout. This would be
much easier than using a grid for this purpose. Also some more
examples could boost the popularity of DGui. Especially, how can
I create create my own controls?


Horizontal/vertical layout can be achieved using `Control.dock` property.

I will think about examples and documentation improvements.



What would be really nice for business developer would be a
specific Stringgrid control (like delphi/lazarus has). Here an
example http://i.stack.imgur.com/FJFiN.gif


Use `ListView` and `TreeView` classes.



Do you accept pull requests if developers provide you new stuff
for DGui?


Yes, but I strongly recommend to contact me first to plan and 
synchronize activities to prevent useless time wasting.



--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: DGui is alive

2014-05-24 Thread Denis Shelomovskij via Digitalmars-d-announce

20.05.2014 17:46, FrankLike пишет:

DGui need some other controls,such as
imageButton,DataView,GridViewe.t.c.


There is no plan to add new controls and I don't see any lacking ones.

One can use `paint` event to draw image on button and there is 
`GridPanel` (with usage example `grid.d`) so I don't understand why 
`GridView` is needed and what is its purpose. Also I don't know what is 
`DataView` for.



--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: DGui is alive

2014-05-21 Thread Denis Shelomovskij via Digitalmars-d-announce

21.05.2014 15:05, Suliman пишет:

On Wednesday, 21 May 2014 at 08:25:20 UTC, Denis Shelomovskij wrote:

20.05.2014 22:46, Suliman пишет:

DGui need some other controls,such as
imageButton,DataView,GridViewe.t.c.

Thank you.

Frank


Yes, I very need imageButton. Is there any chance that they will be
developed in nearest time?


No, not in near future. General usage of buttons with images is a
`ToolBar` so there is a `ToolButton` with image. As for other
controls, e.g. a regular `Button`, one can draw everything in `paint`
event.


What is the difference between imageButton and ToolButton?



There is no `imageButton` objects in DGui. `ToolButton` is a button 
placed in `ToolBar` and it can have an image.



--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: DGui is alive

2014-05-21 Thread Denis Shelomovskij via Digitalmars-d-announce

20.05.2014 22:46, Suliman пишет:

DGui need some other controls,such as
imageButton,DataView,GridViewe.t.c.

Thank you.

Frank


Yes, I very need imageButton. Is there any chance that they will be
developed in nearest time?


No, not in near future. General usage of buttons with images is a 
`ToolBar` so there is a `ToolButton` with image. As for other controls, 
e.g. a regular `Button`, one can draw everything in `paint` event.




I need example how to draw line (small Paint) with this lib. Does DGUI
can do it? If not I would need to look for alternative...


Here is an example of button with image and lines drawn on it:
https://gist.github.com/denis-sh/56e2104dba7d9793f68d

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: DGui is alive

2014-05-20 Thread Denis Shelomovskij via Digitalmars-d-announce

20.05.2014 18:11, FrankLike пишет:

Can you put DGui into github.com  and code.dlang.org ?
Let all d's coders build on it!

Thank you.

Frank




It is already in code.dlang.org. As for Github I have already answered 
here [1].


[1] http://forum.dlang.org/post/llf00b$2pl5$1...@digitalmars.com

--
Денис В. Шеломовский
Denis V. Shelomovskij


DGui is alive

2014-05-20 Thread Denis Shelomovskij via Digitalmars-d-announce
DGui is a lightweight graphic library for Windows with API close to 
.NET's Windows Forms.


The library is written by Trogu Antonio Davide, but he isn't supporting 
it any longer so you can refer me as a current project manager.


One can get examples and OMF import libraries needed to build 
executables from "Downloads" section on project page.


Project repo page:
https://bitbucket.org/dgui/dgui/


Note:

The project API should be stable now, but lots of stylistic renames 
happened recently so if one has a huge codebase using old names and want 
to upgrade to current version you can contact me and I will prepare 
autorenaming scripts for you (I used it to do renaming anyway).


Sorry for API breakage, I just couldn't see all those C-style uppercased 
enums any more.



P.S.

I was waiting to be able to do planned API breaking changes before 
posting here so the announce is half a year later than the project 
resurrection date.


--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: Facebook open sources flint, a C++ linter written in D

2014-03-02 Thread Denis Shelomovskij

25.02.2014 16:48, Dicebot пишет:

On Tuesday, 25 February 2014 at 11:20:37 UTC, bearophile wrote:

Currently the D compiler catches several bugs that are caught only by
C lints. Clang shows that you can add lot of lint-like tests to the
compiler. I'd like some more tests in the D compiler.


Full stop. It should be other way around - remove all such arguable
warnings from compiler to dedicated lint tool and never add any single
one to compiler.


I'd say a good static code analysis require a full compiler frontend and 
I see no reasons why there can't be such thing in dmd as it is just as 
required as profiler, unittesting or documentation generation which are 
already in. Of course it has nothing to do with compiler warnings and is 
a separate thing. But looks like people aren't interested in it as 
enhancement request 9811 [1] still has no votes or discussion.


[1] https://d.puremagic.com/issues/show_bug.cgi?id=9811

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: std.signal : voting has begun

2014-01-15 Thread Denis Shelomovskij

06.01.2014 13:11, Dicebot пишет:

Some time ago there have been a review for `std.signal` Phobos proposal
(http://forum.dlang.org/thread/ujlhznaphepibgtpc...@forum.dlang.org#post-ujlhznaphepibgtpcoqz:40forum.dlang.org).
It have not received much feedback and I was a it too busy to proceed
with final voting at that moment but with no outstanding issues to
address nothing prevents that final step.

Let's put 2 week deadline to refresh memories about the proposal and
make some decision. Voting closes at January 20th 23:59 GMT 0

Please take some time and help make Phobos better ;)


No.

Any signals implementation is at least blocked by the fact closure 
delegates lifetime can't be determined (see issues [2] and [3]). 
Requirement to explicitly pass owning object is redundant and 
unacceptable, such code must work:

---
/// Usage: don't pass struct member function delegates as `del`.
void f(void delegate() del)
{
obj.event.connect(del);
}
---
Yes, I still don't see an elegant way to fix the language for struct 
member function delegates, but for closures there is issue [1].


Another way to make things work is a runtime support for weak 
references, see druntime pull 639 discussion [4].


Also see this thread for more discussion about signals problems: [5].

[1] https://d.puremagic.com/issues/show_bug.cgi?id=9601
[2] https://d.puremagic.com/issues/show_bug.cgi?id=9602
[3] https://d.puremagic.com/issues/show_bug.cgi?id=9603
[4] https://github.com/D-Programming-Language/druntime/pull/639
[5] http://forum.dlang.org/thread/kkdkh3$sft$1...@digitalmars.com

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: phobosx.signal version 0.3 released

2013-10-15 Thread Denis Shelomovskij

15.10.2013 0:07, Robert пишет:

Thanks to Denis Shelomovskij for pointing out that due to compiler
optimizations the "Heisenbug" was still present in my code, just very
unlikely to trigger in practice. It should be fixed for real now. I'll
sleep over it and check it more thoroughly again in the next days.
Denis, I would appreciate it if you might check if it looks good to you
now.


This implementation is also incorrect because of the same reason. Here 
is my post in appropriate NG:

http://forum.dlang.org/post/l3j6vm$1t62$1...@digitalmars.com

--
Денис В. Шеломовский
Denis V. Shelomovskij


Unstandard, a general purpose library

2013-10-12 Thread Denis Shelomovskij
*Unstandard* is a library for general purpose usage aimed to be an 
addition to the *D* standard runtime library *Phobos*.


The author would like to pull as much functionality as possible to 
Phobos but it's a rather difficult and slow work.


NOTE: It's a personal one-man library, not some experimental stuff for 
*Phobos*. There is nothing official in it.



Project page: https://bitbucket.org/denis-sh/unstandard
Documentation: http://denis-sh.bitbucket.org/unstandard/


Partial Unstandard brief content description
---
  * For string manipulation functions see unstd.c.string and unstd.utf.
  * For user-defined lifetime implementation see unstd.lifetime.
  * For various metaprogramming stuff see unstd.generictuple, 
unstd.templates, and unstd.traits.
  * For various GC and non-GC memory manipulation stuff see 
unstd.memory.allocation, unstd.memory.misc, unstd.memory.weakref, and 
unstd.windows.heap.
  * For functions to manipulate with multidimensional rectangular 
arrays see unstd.multidimarray.


Also see for other useful stuff unstd.array, unstd.casts, unstd.math, 
and unstd.typecons.



Read documentation for more information.


P.S.
---
The library is about one year old. It has been mentioned few times in 
digitalmars.D NG as "phobos-additions" library. The name was changed to 
prevent thinking it has a relation to the official library.


--
Денис В. Шеломовский
Denis V. Shelomovskij


[Remove SPAM] Re: Last day! 30% OFF Rip Blu-ray to M2TS with original quality

2013-09-05 Thread Denis Shelomovskij

Remove the spam please!


Re: New malloc() for win32 that should produce faster DMD's and faster D code that uses malloc()

2013-08-04 Thread Denis Shelomovskij

04.08.2013 1:55, Walter Bright пишет:

The execrable existing implementation was scrapped, and the new one uses
Windows HeapAlloc().

http://ftp.digitalmars.com/snn.lib

This is for testing porpoises, and of course for those that Feel Da Need
For Speed.


So I suppose you use `HeapFree` too? Please, be sure you use this 
Windows API BOOL/BOOLEAN bug workaround:

https://github.com/denis-sh/phobos-additions/blob/e061d1ad282b4793d1c75dfcc20962b99ec842df/unstd/windows/heap.d#L178

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: New malloc() for win32 that should produce faster DMD's and faster D code that uses malloc()

2013-08-04 Thread Denis Shelomovskij

04.08.2013 11:53, dennis luehring пишет:

Am 04.08.2013 09:35, schrieb Walter Bright:

On 8/4/2013 12:19 AM, Joseph Rushton Wakeling wrote:

On Sunday, 4 August 2013 at 06:07:54 UTC, dennis luehring wrote:

ever tested nedmalloc
(http://www.nedprod.com/programs/portable/nedmalloc/) or
other malloc allocators?


"Windows 7, Linux 3.x, FreeBSD 8, Mac OS X 10.6 all contain
state-of-the-art
allocators and no third party allocator is likely to significantly
improve on
them in real world results."

So there may be minimal returns from incorporating nedmalloc on
modern OS's ... ?


As I wrote earlier, Microsoft has enormous incentive to make Heap
as fast as
possible, as it will pay dividends for every Microsoft software
product and
software designed for Windows. I'm sure the engineers there know all
about the
various strategies available on the intarnets. Why not take advantage
of their work?


HeapAlloc is a forwarder to RtlHeapAlloc and C++ new does call
RtlHeapAlloc directly - would it be better to use this kernel32 api
directly? (maybe if used in druntime to reduce dll dependencies)



Up to Windows XP (at least) KERNEL32's HeapAlloc function is forwarded 
to RtlAllocateHeap [1] function exported by NTDLL so there is no runtime 
performance overhead.


There is no RtlHeapAlloc function on my Windows XP and I can't find any 
information about it on the web. Looks like a Windows 6.x stuff or a 
mistake in name.


Also note there are tons of errors because of such "slightly different" 
names. If we are talking about "Heap*" functions:

1. Incorrect "RtlAllocHeap" name here [2].
2. Incorrect "HeapFree" function signature (4-byte BOOL is returned but 
it is just a wrapper of RtlFreeHeap which returns 1-byte BOOLEAN) (fixed 
in Windows 6.x).


[1] 
http://msdn.microsoft.com/en-us/library/windows/hardware/ff552108(v=vs.85).aspx

[2] http://msdn.microsoft.com/ru-ru/magazine/cc301808(en-us).aspx

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: Crystal

2013-02-17 Thread Denis Shelomovskij

17.02.2013 10:28, Ary Borenszweig пишет:

Hello everyone :-)

...

(you might remember me: I'm the author of Descent)


A Hero is here! Let me kowtow to you, a Descent Creator!


... Let's save this world's energy.


It's pleasantly to see this point of view at efficiency.


But... do we really have to specify const pure safe nothrow and whatnot?
Can't the compiler be smarter? I'm sure there must be a better way. Most
new programming languages look like older ones. Newness comes slowly...

One time I asked in this newsgroup if it was possible to have an "auto"
keyword for function/method arguments. And... why not make all
functions/methods be templates on the type of its arguments?

I think nobody liked this idea. I said "Ruby is like this: you never
specify types in method definitions".

"But Ruby is not efficient". "Ruby is a dynamic language". "D is
compiled, so it's faster". "Don't make the mistake of comparing a
dynamic language with a static/systems programming language". This were
some of the answers I got.

I started thinking about this idea: a compiled language that looked like
a dynamic language. Is it possible?


Looks like it is, by what is the reason?

I'd like to specify function attributes explicitly because I do want to 
get a compilation error when I e.g. use non-safe stuff in safe function 
instead of a just compiler silently changing the function (and all 
functions which use it) to unsafe. I also don't use type inference 
everywhere because sometimes I do want to see exact types (yes, IDE 
problem) and sometimes I just don't want a type to be accidentally 
changed because of some function signature change as in the worst case 
the code will still compile but will work incorrect.


Now about argument types. I do not understand the purpose of dynamic 
typing at all and consider such languages too dangerous to use in real 
projects. You proposal is a bit better as it will give CT errors 
(instead of RT in dynamic typing case) but still bad as the code can 
accidentally compile and work incorrect. Also this looks as a step back 
as your proposal is like making from a function something like C's 
preprocessor macro. And I remember how somebody defended C's macros and 
told "you can do it with macro", then he gave his code where he made a 
fatal mistake by passing two parameters to a macro in a wrong order. And 
that code accidentally compiled. Same thing can happen with every high 
templated code where it is hard to predict every possible argument 
combination.


I also have seen a lot of mistakes of any types in D templated code so I 
consider such code almost as dangerous as pointer arithmetic and you 
proposal to make everything a template looks as insane.



...

Thanks for your comments,
Ary

P.S.: bin/crystal -e 'a = 0; 10.times { |i| a += i }; puts a' -O3 -ll


Sorry for such cruel comment, I it is just my opinion.

--
Денис В. Шеломовский
Denis V. Shelomovskij


A fix for Windows 5.x loader to correctly work with TLS data in dynamically loaded DLL-s

2013-02-10 Thread Denis Shelomovskij
It was supposed to be a New Year gift (which nobody needs of course) for 
all Windows XP users (not only D ones) but I finally have understood I 
have no time for good public announce with project page etc.


So I just want to tell there is a full fix for Windows 5.x loader.

It works on my Windows XP, probably will work on other similar systems 
and probably will not work on Windows Server 2003/Windows XP x64 as I 
have no time for test and finish off it now.


Done:
* Written in D.
* Compiles in DLL which fixes for owning process Windows 5.x loader to 
correctly work with TLS data in dynamically loaded DLL-s.
* So you have the ability to fix every program just with injecting a DLL 
in it (there is no administrator rights required for such operation on 
Windows 5.x).

* Doesn't use D runtime.
* DLL size is 52 KiB (thanks to previous point).

Undone:
* One mustn't unload fixing DLL as it will result in undefined 
behaviour. Auto-preventing unloading is trivial but isn't done yet. ((
* It also doesn't need C runtime, but I haven't managed to link it 
without snn.dll yet so buggy runtime from DigitalMars is included and 
executes its evil code. (
* There is also a utility for injecting a DLL into a process in same 
hooking project but I failed find enough time to fight all the 
regressions and link failures of dmd and optlink so the utility can't be 
built now (it worked fine some time ago...). (



P.S.
If somebody really needs this feel free to email me/post here to force 
me to find time to continue development and finish off the utility.



Links:
* Binary (7-zipped DLL):
http://deoma-cmd.ru/files/other/TLSFixerDLL.7z
* Source code:
https://github.com/denis-sh/hooking/tree/master/tlsfixer
* Information about implicit TLS and Windows loader:
http://www.nynaeve.net/?p=180
* Microsoft's KB article about the problem:
http://support.microsoft.com/kb/118816/en-us

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: wiki.dlang.org

2012-12-10 Thread Denis Shelomovskij

10.12.2012 4:29, Walter Bright пишет:

Is now pointing to the new media wiki setup.


Great news! Wiki matters!

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: Video: Generic Programming Galore using D @ Strange Loop 2011

2012-04-19 Thread Denis Shelomovskij

19.04.2012 4:11, Andrej Mitrovic написал:

On 4/18/12, SomeDude  wrote:

On Tuesday, 17 April 2012 at 08:00:36 UTC, Denis Shelomovskij
wrote:


It's pity that a video is read-only and it isn't easy to fix
slips of the tongue like this one. Maybe some notes can be
added?

Anyway, these (Andrei's and Walter's) videos are too good to
not list them on the site.


I've cleaned up the wiki a bit and added them:
http://prowiki.org/wiki4d/wiki.cgi?WhySwitch


Thank you, SomeDude.



You could actually add them here and link to it:
http://prowiki.org/wiki4d/wiki.cgi?Videos
I made that page a long while ago but I didn't really know where to
link it from, so I just put it in the first tab I found (The D
Community: http://prowiki.org/wiki4d/wiki.cgi?NeighborHood)


Damn, I didn't know about this page. And it looks like I'm not alone.

D wiki is really a maze for me (or I just don't understand something?). 
It contains lots of outdated info mixed with some up-to-date info. I 
thought that D wiki is only for experienced D developers who know what 
is outdated and what is not, what info does wiki contains and where is 
this info.


So I'd like to see videos on dlang.org.

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: Video: Generic Programming Galore using D @ Strange Loop 2011

2012-04-17 Thread Denis Shelomovskij

17.04.2012 7:55, Andrei Alexandrescu написал:

On 4/16/12 10:00 AM, Denis Shelomovskij wrote:

11.04.2012 20:23, Andrei Alexandrescu написал:

http://www.infoq.com/presentations/Generic-Programming-Galore-Using-D

Andrei


27:17
It's valid to pass an empty list. Compilation will fail when T.length =
1 for 'x[1]'.

Andrei is really looking embarrassed telling this like if he knows it's
a lie but he has to say it because something forces him to do it... He
waged somebody it? :)


I think "lie" would be pushing it. The point made is clear albeit I
rendered it clumsily - static if does not attempt to compile the branch
not taken.

Andrei



And I even haven't mentioned my point. These videos are great for D 
newbies (and also very good for other bastards like me too) and should 
be listed on dlang.org just like articles because it isn't obvious for a 
newbie to search through the NG for videos (and, maybe, some videos 
supersedes older ones).


It's pity that a video is read-only and it isn't easy to fix slips of 
the tongue like this one. Maybe some notes can be added?


Anyway, these (Andrei's and Walter's) videos are too good to not list 
them on the site.


--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: Video: Generic Programming Galore using D @ Strange Loop 2011

2012-04-16 Thread Denis Shelomovskij

11.04.2012 20:23, Andrei Alexandrescu написал:

http://www.infoq.com/presentations/Generic-Programming-Galore-Using-D

Andrei


27:17
It's valid to pass an empty list. Compilation will fail when T.length = 
1 for 'x[1]'.


Andrei is really looking embarrassed telling this like if he knows it's 
a lie but he has to say it because something forces him to do it... He 
waged somebody it? :)


--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: Russian TDPL is available for orders

2012-04-12 Thread Denis Shelomovskij

10.04.2012 15:17, Dmitry Olshansky написал:

On 03.04.2012 4:09, Denis Shelomovskij wrote:

02.04.2012 21:21, Oleg Kuporosov пишет:

There is good news for Russian D Developers, translated Andrey's
TDPL is available for pre-orders at some online stores

http://www.books.ru/books/yazyk-programmirovaniya-d-827252/

Hope it will definetelly increase Russian speaking community, so
far we don't have good localized resources on D.

Andrey, is it first translation?

Thanks,
Oleg.


I was afraid of it and it has finally happened. Sorry, but there is only
*bad* news for us.

I started reading translation of the foreword by Scott Meyers... The
translation is not verbatim (strange, because it's not a poems
translation), but readable... For some reason, a sentence


Update:
I'm not about to crack open a bottle of champagne but I want to point
out that the translation (in the provided preview) was fixed in the mean
time.
You might want to review your comment on the book :)



Very good, thanks.

--
Денис В. Шеломовский
Denis V. Shelomovskij


VBScript helper

2012-04-08 Thread Denis Shelomovskij
MS Windows is shipped with Windows Script Host (WSH), for every single 
malware developer to be able to do everything once he finally forced you 
to double-click on a small text file.


Now WSH works for D developer too by providing easy (but not very fast) 
access to system information (yes, and COM objects). See example in docs.


For now it only reads objects from VBScript. Writing data back and 
calling functions on VBScript objects can be added if someone really 
needs it (just contact me).


Sources: https://bitbucket.org/denis_sh/misc/src/tip/vbscripthelper.d
Docs: http://deoma-cmd.ru/d/docs/misc/vbscripthelper.html

--
Денис В. Шеломовский
Denis V. Shelomovskij


Re: Russian TDPL is available for orders

2012-04-02 Thread Denis Shelomovskij

02.04.2012 21:21, Oleg Kuporosov пишет:

There is good news for Russian D Developers, translated Andrey's
TDPL is available for pre-orders at some online stores

http://www.books.ru/books/yazyk-programmirovaniya-d-827252/

Hope it will definetelly increase Russian speaking community, so
far we don't have good localized resources on D.

Andrey, is it first translation?

Thanks,
Oleg.


I was afraid of it and it has finally happened. Sorry, but there is only 
*bad* news for us.


I started reading translation of the foreword by Scott Meyers... The 
translation is not verbatim (strange, because it's not a poems 
translation), but readable... For some reason, a sentence

---
The result can be thought of as C-based "productivity languages."
---
is thrown out. Why? A translator has'n understood it ("ниасилил")? 
Worse, but still readable because this sentence is not critical... All 
of a sudden!

---
"If you know how to write a function in current C++, you know nothing 
about how to write the corresponding C++ function that's evaluated 
during compilation. If you know how to write a function in D, however, 
you know exactly how to write its compile-time variant, because the code 
is the same."

---
Is translated as
---
Даже зная, как написать функцию на современном С++, вы и понятия не 
имеете о том, как эта функция выглядит после компиляции. Но если вы 
знаете, как написать функцию на D, вы в точности представляете, как 
написать ее скомпилированный вариант, потому что этот код выглядит точно 
так же.

---
which means:
---
Even knowing how to write a function in modern C++, you have no idea how 
this function looks after compilation. But if you know how to write a 
function in D, you know exactly how to write the compiled version of it, 
because this code looks exactly the same.

---

Can not read it any more after this... They even haven't engaged a 
single person who knows both D & English a bit or at least can use 
Google translator & Google search!...


I can only imagine what people will thing about D after reading such 
"translation"...


Re: CWrap - higher abstraction level for calling C functions

2012-02-22 Thread Denis Shelomovskij

22.02.2012 13:41, Gour пишет:

That would be nice and make the whole job of binding C functions and
providing customized D API easier...and let's not forget about extra
points for coordinating work. ;)


I'm open for emails about using/changing/fixing CWrap.


Re: CWrap - higher abstraction level for calling C functions

2012-02-22 Thread Denis Shelomovskij

20.02.2012 19:34, Gour пишет:

On Mon, 20 Feb 2012 18:02:49 +0400
Denis Shelomovskij  wrote:

Hello Denis,


D has complete (IMHO) compiler support for calling C functions (using
extern(C)). But there is a lack of library support.


I'm glad you're working on (another) bindings tool being aware that it's
not reasonable that D will cover all our library needs.

Otoh, I'm also concerned that using just wrappers over C code would
erode (potential) type-safety and advantage of using D in the first
place. (In our app we envision to use wXD for GUI, need bindings for 3rd
party C lib, using one of Sqlite3 wrappers...)


Once original function is properly described in IDL, CWrap gives the
fallowing advantages:


If we eliminate htod which is Windows only and considering that manual
wrapping is not very attractive option, along with your list which sound
quite goo, my question is what would be some of pro/cons of CWrap in
comparison with e.g. SWIG and it's D support as well as with dstep
(https://github.com/jacob-carlborg/dstep) if our main objective would be
to keep some of D's advantages such as having higher-level (D-ish) API,
exception handling (insted of error-checking), type-safety etc.
available in our D bindings of C lib(s)?


Sincerely,
Gour



OK, I'm here again. Jacob Carlborg is right - CWrap is a different tool 
so it's incorrect to compare it with SWIG/dstep. It's developed as a 
high performance backend for other tools or for manual wrapping a couple 
of functions, not for translating entire *.h files or creating class 
hierarchy.


Let's imagine there is no std.file, no std.windows.charset, and no 
std.windows.registry. Look at my WinAPI examples - it will be easier and 
more robust to write IDL descriptions by hands (because you should read 
specs for every WinAPI function at least once) and use generated 
wrappers than to write lots of boring code to converts strings/check 
errors. E.g. I did it already (CWrap WinAPI examples) and it wasn't too 
long compared with reading specs.


Or let's imagine one will have to finally revise Phobos to stop 
producing garbage and/or make D usable without GC. He will kill himself 
if he want to write optimal-performance garbage-less calls to WinAPI or 
will spend lot of time by writing non-optimal. Or he will just use CWrap 
generated code.


CWrap - higher abstraction level for calling C functions

2012-02-20 Thread Denis Shelomovskij
D has complete (IMHO) compiler support for calling C functions (using 
extern(C)). But there is a lack of library support. Microsoft .NET 
Framework has such support, but it's poor (see previous thread about 
CWrap in digitalmars.D NG).


Once original function is properly described in IDL, CWrap gives the 
fallowing advantages:
* [memory-corruption-safe] User works with arrays, not separate pointers 
and lengths.
* [memory-leak-safe] Original function allocated memory will be freed on 
any failure (NOTE: see "Original function restrictions" in documentation).

* [fail-safe] An exception will be thrown if original function fails.
* [usability] Much easier to work with arrays/preferred string types (it 
converts UTF-8/16/32 back and forth, see docs).

* [speed] No unnecessary GC (or other) allocations/copying/reading.
* [garbage-free] Look at, e.g. std.file - it leaves lots of garbage 
because of calling native platform functions. Generated wrappers don't 
even allocate GC memory (except for output parameters when user do want 
get GC allocated buffers).


Sources: https://bitbucket.org/denis_sh/cwrap
Docs (incomplete): http://deoma-cmd.ru/d/docs/src/cwrap.html

Phobos is needed.
Besides Phobos, the only file needed for generating: cwrap.d
The only file needed for generated wrappers to work: internal/cwraprt.d

Library state: almost every internal function is unittested, generated 
wrappers pass rather complicated test-suit in internal/cwrapunittests.d


"Examples" is the most informative section of the documentation. Other 
examples:

1. Original functions, all in one file:
https://bitbucket.org/denis_sh/cwrap/src/tip/examples/c.d
https://bitbucket.org/denis_sh/cwrap/src/tip/internal/cwrapunittests.d
2. Generated wrappers:
https://bitbucket.org/denis_sh/cwrap/src/tip/out

NOTE1: You need dmd 2.058 to generate wrappers at CT.
NOTE2: You can change `enum data` to `auto data` in examples/c.d, this 
will reduce compilation time.


Previous thread about CWrap in digitalmars.D NG:
http://www.digitalmars.com/d/archives/digitalmars/D/Higher_abstraction_level_for_calling_C_functions_156633.html


Re: http://dlang.org/bugstats.php

2012-01-23 Thread Denis Shelomovskij

22.01.2012 11:18, Andrei Alexandrescu пишет:

We just put together a page that counts the bugs per category. It's
linked from "Bug tracker" in the navigation panel.

http://dlang.org/bugstats.php

The format is sketchy. Looking forward to your suggestions for
improvements.


Andrei


https://github.com/D-Programming-Language/d-programming-language.org/blob/master/bugstats.php.dd#L24
width="48em" height="18em"

Font size is about 14px so these areas for few digits are very big: 
~700px x 250px. Opera and Chrome incorrectly displays it as if 1em = 
1px. Firefox displays correctly (and ugly) unless you rewrite it into 
`width="48.0em" height="18.0em"`.


So am I missing something? If no, why does Opera, Chrome and Firefox 
incorrectly display such a simple page? Why does Andrei use `em` in this 
case instead of px?


[OT] Why is that dirty, slow, hard-to-implement, hard-to-understand, and 
hard-to-write-in (error-prone) HTML used everywhere with it's dirty 
friend XML?!!! Let's, at least, remove XML support from D as a protest 
when D will became popular enough! (Sorry, just can't keep it in any more)


Re: Juno for D2 (Working status unknown)

2011-11-07 Thread Denis Shelomovskij

07.11.2011 3:21, Jesse Phillips пишет:

Disclaimer: Don't expect it to work.

I've made changes to the Juno Library such that it will compile into
a .lib with DMD 2.056. However this does not mean it will compile for the
examples or user code. It also does not mean that it will work once
compiled.

https://github.com/he-the-great/Juno-Windows-Class-Library

The worst changes I made come from this commit:

https://github.com/he-the-great/Juno-Windows-Class-Library/
commit/6b7c970ddf06921038d5ad3145cc835abb31dbf6

I couldn't understand how this compiled in the passed, so I just version
(none)'d the blocks. What does scope(failure) return; do?

Anyway I'm hoping to get something working with COM using it, but I
wouldn't hold my breath that I'd figure out how to get it working if it
didn't.


The more the better? I mean posts count. :)


Re: D2 port of Tango

2011-11-03 Thread Denis Shelomovskij

03.11.2011 1:29, Damian Ziemba пишет:

>1. Phobos has a better design (Tango is too complicated in some
>  places, has a lot of things I (and a regular programmer IMHO) don't use,
>  and has bad design decisions sometimes - both internal and user API)
>

I totally disagree:)  Show me example of such bad decision.



Tango often asks you a buffer (e.g. at tango.text.Unicode, 
tango.text.convert.Utf) that is not needed in a language with GC. But it 
isn't a main problem. Let's consider the cases:
* if you don't provide a buffer it will manually allocate an array 
instead of using an Appender and than reallocate it etc.
* the worst case, if you provide a large enough buffer, you are (I was) 
completely sure Tango will use it (you whant to do a manual memory 
management by some reason), *but* it will reallocate a new one from GC 
if it just don't like yours (if yourBuffer.length - minimalNeededLength 
< tangoSacredAdditionLength, and addition length it often nonzero, so 
Tango will not like your exactly enough buffer).


Re: D2 port of Tango

2011-10-18 Thread Denis Shelomovskij

18.10.2011 8:00, Caligo пишет:



On Mon, Oct 17, 2011 at 11:52 PM, SiegeLord mailto:n...@none.com>> wrote:

I just wanted to get the word out about a little project me and a
few other people been working on for the few past months, in case
anyone feels like helping out (or just as an FYI). This project is
the D2 port of the Tango framework library. You can read about it here:

https://github.com/haskelSiegeLord/Tango-D2


We are currently a little more than half way done in terms of
modules fiddled with. Currently there are 181 modules ported out of
approximately 343 (give or take 20). Currently only the dmd compiler
and Linux platform are supported... but obviously we want to get all
the other platforms/compilers as time goes on. I'm guessing at the
current rate of porting we'll be done in about half a year.

Now, the project is actually two projects in one.

The first project is a D2 port proper that tries to keep API
semantics the same as the D1 original. I preside over this aspect,
and you can see the rough porting guidelines in the repository. This
is the 'd2port' branch in my repository.

The second project is a more ambitious effort to rewrite some
aspects of Tango without preserving semantics or anything. mtachrono
presides over this aspect, so you can talk to him about the
motivations behind it. This is the 'master' branch in my repository.

That's all. Cheers.

-SiegeLord


Why?  What's the point?  Why not work on Phobos instead?


+1 to Caligo. I agree that Tango is a good library (and was the best one 
for D1) but, IMHO, porting it to D2 is a bad idea.
I'm the one who has a big D1+Tango project and I'd better rewrite it 
with D2+Phobos, because:


0. I don't want to have a "two standard libraries problem" with D2 
(which one to select?).


1. Phobos has a better design (Tango is too complicated in some 
places, has a lot of things I (and a regular programmer IMHO) don't use, 
and has bad design decisions sometimes - both internal and user API)


2. Phobos has less _critical bugs_ because of better code control 
(e.g. Tango has memory corruption bug for a very long time in Vector 
container (#2064)).


3. There is no Andrei Alexandrescu clone to generate that perfect 
ideas for Tango.


Re: GtkD 1.5 is released.

2011-08-27 Thread Denis Shelomovskij

Can anybody use GtkD with Win32 dmd 2.054+OPTLINK?
Some time ago I posted message "Building GtkD app on Win32 results in 
111 MiB file mostly from zeroes (compressed size - 324 KiB)", but no 
solution was found. I'll repeat some info:


Files (dmd 2.054 compiled) are here:
http://deoma-cmd.ru/files/other/huge-build.zip

library.lib:  Zero bytes:   3_505_980 of  16_175_616 (21.67%)
main.obj: Zero bytes: 248 of 832 (29.81%)

After linking with OPTLINK:
testGtkD.exe: Zero bytes: 115_666_207 of 116_759_068 (99.06%)