View mode: basic / threaded / horizontal-split · Log in · Help
August 01, 2011
DWT in Phobos? was [Re: What library functionality would you most like to see in D?]
Andrei Alexandrescu Wrote:

> On 8/1/11 4:35 PM, Nick Sabalausky wrote:
> > "Johann MacDonagh"<johann.macdonagh.no@spam.gmail.com>  wrote in message
> >> 2. DWT fixed up and merged into Phobos.
> >
> > That'd certainly be nice.
> 
> Interesting. What platforms does DWT work on? What is the general 
> community opinion on integrating it within Phobos? Is there anyone 
> willing to take on this task?
> 
> Thanks,
> 
> Andrei

I think DWT for D2 worked with Windows and Linux (tested on).

The port is very Java style, it doesn't have a D layer to make it work nicely with ranges (err last time I used it 3 yrs ago). All the packages are org.eclipse... The library itself is huge and the port isn't complete.

It probably isn't a good idea to bring it into Phobos since it needs to be easy to keep up with SWT development. However it might be reasonable to take DWT, mold it into a D like library and continue development separate from SWT. I don't know if that is easier than developing a D2 GUI library from scratch, but having such a library in Phobos is probably a *great* idea.
August 01, 2011
Re: What library functionality would you most like to see in D?
Jonathan M Davis wrote:
> I think that it would be useful to query the community for what piece of
> library functionality they don't currently have in D and would most like to
> see. For instance, there is no official logging framework in D or any 3rd party
> libraries which do it AFAIK. So, that could be one type of functionality that
> you may like to see. Now, there is a prospective implementation for std.log
> which shouldn't be all that far away from being reviewed, so listing that here
> wouldn't be all that useful, since it's on its way. But what other major
> functionality do you miss in D that other languages' that you use have
> available in their libraries?
>
> My hope here would be that we could get some good ideas going here such that
> we have can have a better idea what type of functionality it would be
> particularly useful to be working on for Phobos or 3rd party D libraries for
> the community, and maybe it'll even get some people to actually go and work on
> these ideas so that we can improve the libraries that we have to work with in
> D. We can always use more help, and we definitely need a richer library
> ecosystem for D. But even just discussing ideas could be of benefit.
>
> So, what major functionality which we don't currently have would you like to
> see in either Phobos or in a 3rd party library so that you could use it in
> your D programs?
>
> - Jonathan M Davis

1. Cryptography (I already wrote all SHA hash implementations and HMAC, 
they will be open sourced under Boost license, I'm also working on 
Rijndael/AES impl.)

some of the proposed namespaces (just thinking loud):

std.crypto.cipher - block and stream ciphers
std.crypto.hash - message digests (SHA1, RIPEMD, ...)
std.crypto.mac - message auth codes like HMAC, CMAC, UMAC
std.crypto.mode - block cipher modes like CBC, GCM, ...
std.crypto.padding - padding schemes
std.crypto.pki - asymmetric cryptography (RSA), PKI
std.crypto.x509 - certificate support

2. Easy to use non-GC threads for soft real time support. Non-GC threads 
must not be suspended by the GC and they must support some kind of 
reliable communication with normal (GC) threads. This should be similar 
to IPC, where there's no shared memory between GC and non-GC threads.

Consider running two separate programs, one written in D with GC support 
and one written in plain C. These programs communicate with each other 
using some IPC mechanism. The latter is never suspended.
The whole point is to make equivalent of this configuration in a single 
executable using mixture of GC and non-GC threads.
August 02, 2011
Re: What library functionality would you most like to see in D?
On Mon, 1 Aug 2011, Andrei Alexandrescu wrote:

> On 8/1/11 4:35 PM, Nick Sabalausky wrote:
> > "Johann MacDonagh"<johann.macdonagh.no@spam.gmail.com>  wrote in message
> > news:j1501g$tbs$1@digitalmars.com...
> > > 
> > > 1. Database interface. Should support sqlite, mysql, postgres, etc...
> > > 3. Some kind of web framework.
> > 
> > Agreed, but fortunately Adam's stuff for that is shaping up nicely:
> > 
> > https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
> > 
> > > 2. DWT fixed up and merged into Phobos.
> > 
> > That'd certainly be nice.
> 
> Interesting. What platforms does DWT work on? What is the general community
> opinion on integrating it within Phobos? Is there anyone willing to take on
> this task?
> 
> Thanks,
> 
> Andrei

I don't think that any gui library belongs in phobos because there's 
essentially no agreement about what cross-platform library is standard.  
Pick any random 10 gui developers about what library they used (assuming 
they do anything cross-platform) and you'll get more than 1 answer.  I'd 
be shocked if you get a clear enough majority to suggest 1 that'd make a 
big set of people happy.

Sorry, the gui library landscape just doesn't approach being obvious 
enough to be in the standard library.

My 2 cents,
Brad
August 02, 2011
Re: What library functionality would you most like to see in D?
On 8/1/11 7:51 PM, Brad Roberts wrote:
> On Mon, 1 Aug 2011, Andrei Alexandrescu wrote:
>
>> On 8/1/11 4:35 PM, Nick Sabalausky wrote:
>>> "Johann MacDonagh"<johann.macdonagh.no@spam.gmail.com>   wrote in message
>>> news:j1501g$tbs$1@digitalmars.com...
>>>>
>>>> 1. Database interface. Should support sqlite, mysql, postgres, etc...
>>>> 3. Some kind of web framework.
>>>
>>> Agreed, but fortunately Adam's stuff for that is shaping up nicely:
>>>
>>> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
>>>
>>>> 2. DWT fixed up and merged into Phobos.
>>>
>>> That'd certainly be nice.
>>
>> Interesting. What platforms does DWT work on? What is the general community
>> opinion on integrating it within Phobos? Is there anyone willing to take on
>> this task?
>>
>> Thanks,
>>
>> Andrei
>
> I don't think that any gui library belongs in phobos because there's
> essentially no agreement about what cross-platform library is standard.

Python has something and as far as I can tell people are fine with that.

Andrei
August 02, 2011
Re: What library functionality would you most like to see in D?
On Monday, August 01, 2011 7:31:13 PM, Andrei Alexandrescu wrote:
> On 8/1/11 7:51 PM, Brad Roberts wrote:
>>
>> I don't think that any gui library belongs in phobos because there's
>> essentially no agreement about what cross-platform library is standard.
> 
> Python has something and as far as I can tell people are fine with that.
> 
> Andrei

It has something _in the base library_?  It has wrappers for all/most 
of the popular libraries?  The standard distributions install some 
combination of those?

I don't use python so I'm ill equipped to discuss, but my guess is that 
it's not the first but rather the last.
August 02, 2011
Re: What library functionality would you most like to see in D?
I've been thinking about a minimalist drawing library for
phobos - just basic 2d stuff, but with easy enough hooks to
add more (native api events and handles.

Nobody is likely to agree on a widget set, but basic drawing
functions give a little usability with pretty small cost.

I had a decent start a month or two ago but have since stalled out
as my schedule became more ridiculous.
August 02, 2011
Re: What library functionality would you most like to see in D?
Andrei Alexandrescu:

Brad Roberts:
> > I don't think that any gui library belongs in phobos because there's
> > essentially no agreement about what cross-platform library is standard.
> 
> Python has something and as far as I can tell people are fine with that.

The situation is quite complex, some notes:
- CPython indeed has a GUI toolkit in the standard distribution, it's not native, it's a whole different interpreter with its GUI toolkit (Tcl-Tk), with a thin Python wrapper around it (tkinter). Despite looking like a card castle this somehow works and some people (like me) use this GUI toolkit to write simple GUIs. Scientific programs sometimes enjoy such simple GUIs.
- For a lot of time the GUIs created with tkinter didn't look native at all (the GUI were almost ugly (recently Tk has improved a lot on this, now it looks much more native)). And Tk despite having some qualities (efficiency, compactness, flexibility and more), was also limited and "strange" in its usage (it's like working with soft rubber). So people that want to create serious GUIs for Python programs never use tkinter. They use GTK, Wx and lately Qt. So using Python as comparison point for D GUI toolkits in the std library is not the best thing to do, because in a sense the Python std library GUI toolkit is not used by serious people.
- I like the idea of having a wide D standard library. But GUI toolkits are large, and they change a lot with time, so I accept to have them as external libraries.
- Delphi has a good enough built-in GUI toolkit, and people use it a lot. I have used it plenty. This seems a better comparison point for D.
- I'd like a simple graphics module in Phobos, to show simple graphics. It's handy in many situations, and it's useful to establish *standard D-wide* method/function names to plot a point, a line, circle, box, ecc. The same names can later appear in non-Phobos GUI toolkits.
- I'd also like a std.image module to load and save images in png, gif, jpeg, ppm, bmp. This is a very common need, even more common than a GUI toolkit, and there are far less ways to load a PNG than to create the API of a GUI toolkit.

Bye,
bearophile
August 02, 2011
Re: What library functionality would you most like to see in D?
Am 02.08.2011, 04:48 Uhr, schrieb Adam D. Ruppe  
<destructionator@gmail.com>:

> I've been thinking about a minimalist drawing library for
> phobos - just basic 2d stuff, but with easy enough hooks to
> add more (native api events and handles.
>
> Nobody is likely to agree on a widget set, but basic drawing
> functions give a little usability with pretty small cost.
>
> I had a decent start a month or two ago but have since stalled out
> as my schedule became more ridiculous.

I used a few drawing APIs: Delphi/Win32, Java2D, HTML5 Canvas, Gtk+ and  
recently Cairo. If there was a drawing API in Phobos I wish it was like  
Cairo. While some basic APIs have some special ability (like shadows in  
the HTML canvas) they often lack some essential functions. Java2D offers a  
lot, but I consider it bloated, YMMW. When I was writing a tool I came to  
need more and more advanced features:
- fonts and text drawing
- clipping
- scaling (part of matrix manipulation)
- transparency
- measuring of the extents of what is about to be drawn
I was using GtkD, the D wrapper for Gtk and Gtk lacked a lot of this.  
Fortunately Gtk comes with Cairo bindings which offered all that. This is  
just one example and just me, but I really think Cairo's API is very well  
designed, similar to Java2D and HTML5 Canvas and would be my reference for  
a drawing API in D. It doesn't need to offer bezier curves and  
anti-aliasing in the first version, but the idea of filling and stroking  
shapes or drawing surfaces that can be rendered into each other are kind  
of a standard now that can be built upon :)

- Marco
August 02, 2011
Re: What library functionality would you most like to see in D?
On 2011-08-01 21:03, Jim Hewes wrote:
> I didn't mean to criticize the D compiler installation, which seems to
> install pretty well on Windows. That is, after you install it you're
> ready to go without additional setup or needing to install other things.
> I was referring more to the peripheral projects and also just to open
> source in general.

Ok.

> If DWT is the standard GUI in the same sense that MFC is for Microsoft
> C++, then I thought it would be nice if it were included in the
> installer for the D compiler. It could be an optional feature during
> installation. But if you do choose to install it, then right after
> installation you should immediately be able to build included sample GUI
> code projects.

There is no standard GUI for D. Well, actually, as I think it says on 
the wiki is that DWT is the standard GUI library, but that's referring 
to an older, windows only, version of DWT.

>> DWT works with D2 (Phobos) as well. It's statically linked so the
>> hello world application gets quite large. But that's because it pulls
>> in a lot of the library, meaning even if you start using other parts
>> of the library it won't increase the size of the executable at the
>> same rate.
>
>
> Yeah, the main GUI library page on the wiki says that it works with
> Phobos, but the Windows installation guide says to download Tango. So I
> wasn't sure it was really updated to support Phobos. Thanks, I will try
> to check it out next weekend.
>
> Jim

I guess the DWT project page could use some updating.

-- 
/Jacob Carlborg
August 02, 2011
Re: What library functionality would you most like to see in D?
On 2011-08-01 23:35, Nick Sabalausky wrote:
> "Johann MacDonagh"<johann.macdonagh.no@spam.gmail.com>  wrote in message
> news:j1501g$tbs$1@digitalmars.com...
>>
>> 1. Database interface. Should support sqlite, mysql, postgres, etc...
>> 3. Some kind of web framework.
>
> Agreed, but fortunately Adam's stuff for that is shaping up nicely:
>
> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
>
>> 2. DWT fixed up and merged into Phobos.
>
> That'd certainly be nice.

That would be an enormous addition (in code) to Phobos. I would guess 
that the code base of DWT, for just one platform, is larger than the 
whole Phobos.

-- 
/Jacob Carlborg
4 5 6 7 8 9 10 11 12
Top | Discussion index | About this forum | D home