www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - What about high level D API Classes?

reply WB <wb sapo.pt> writes:
Hello,

I am new to D. I was looking for something like this for a long time.
IMHO D provides the best of C and C++, improving it. So if D could
also provide the best of Java it would be perfect.

The best of Java is the Java API. In Java you open a window and draw a
picture from an input stream of pixels with 10 lines of code, because
of the Java API Class library:

java.awt.Frame
java.awt.Image
java.io.InputStream
etc.

D could provide it's own API Class library providing classes for
windowing, io, etc. at some high abstraction level in Java fashion,
something like

d.awt.*
d.xml.*
d.crypto.*
...

as a part of the language, along with the low level std.* Phobos
runtime library.

Platform versioning makes it easy (well...) to have such a class
library platform independent, and if a class is not ported at least
you let the compiler know that it is not supported on that platform.

I know that this is a HUGE feature request that can't be done for next
month.

But if something like this would be known to be under construction it
could be another good argument for people switching to D.

Most probably  this is not a new topic at all, but I couldn't find
anything about it in recent discussion threads and forums and i would
like to know if somebody else has n opinion about this.
Sep 07 2004
next sibling parent reply Joey Peters <Joey_member pathlink.com> writes:
In article <n3mrj0971vo0q4ju9eo0gfmu9k69tc2v1l 4ax.com>, WB says...
Hello,

I am new to D. I was looking for something like this for a long time.
IMHO D provides the best of C and C++, improving it. So if D could
also provide the best of Java it would be perfect.

The best of Java is the Java API. In Java you open a window and draw a
picture from an input stream of pixels with 10 lines of code, because
of the Java API Class library:
Java is pretty different, IMHO. It has a very different philosophy (write once, run it everywhere).
java.awt.Frame
java.awt.Image
java.io.InputStream
etc.

D could provide it's own API Class library providing classes for
windowing, io, etc. at some high abstraction level in Java fashion,
something like

d.awt.*
d.xml.*
d.crypto.*
...
It could, but it shouldn't be part of the actual language standard. There are things like phobos and template libraries that could be standard though. But I don't think anything like a windowing toolkit should be standard, since who would make that standard? What about the platforms? It would be 'so' hard to maintain.
as a part of the language, along with the low level std.* Phobos
runtime library.

Platform versioning makes it easy (well...) to have such a class
library platform independent, and if a class is not ported at least
you let the compiler know that it is not supported on that platform.

I know that this is a HUGE feature request that can't be done for next
month.

But if something like this would be known to be under construction it
could be another good argument for people switching to D.

Most probably  this is not a new topic at all, but I couldn't find
anything about it in recent discussion threads and forums and i would
like to know if somebody else has n opinion about this.
I don't think D needs this, D is revolutionary enough in most of it's features. More 'in box' functionality is always fun, but only abstract functionality, and D provides this. Concrete functionality, such as windowing toolkits, are just not top priority or really a language responsability. What is more important is abstract functionality, things the language provides to achieve things as windowing toolkits, or managing big projects better, debugging etc. -Joey
Sep 07 2004
parent WB <wb sapo.pt> writes:
On Tue, 7 Sep 2004 16:19:44 +0000 (UTC), Joey Peters
<Joey_member pathlink.com> wrote:

Java is pretty different, IMHO. It has a very different philosophy (write once,
run it everywhere).
Right. But it's concept of a class library API might fit in the philosophy of a native compiled language. It may even help D to approach C's "write once, compile it everywhere" on a much higher level than C.
don't think anything like a windowing toolkit should be standard, since who
would make that standard? What about the platforms? It would be 'so' hard to
maintain.
Following Java, that would be made standard by inclusion in the class tree. The code must be platform versioned, of course.
Concrete functionality, such as windowing toolkits, are just
not top priority 
I agree about priority
or really a language responsability. 
Define "language responsability". Or better don't :), it's pretty clear how you define it. But you have to agree that you can define it the other way as well, like Java does. But ok, Java needs to, since the API is your only way out of the VM sandbox, besides writing native methods.
Sep 08 2004
prev sibling next sibling parent Ilya Minkov <minkov cs.tum.edu> writes:
There are application frameworks in development. For example, a 
wxWidgets wrapper and a library designed after IBM's SWT.

Talk also has been that there would be something like a common 
distribution with most needed libraries, which could become de-facto 
standard.

-eye
Sep 07 2004
prev sibling next sibling parent J C Calvarese <jcc7 cox.net> writes:
WB wrote:
 Hello,
 
 I am new to D. I was looking for something like this for a long time.
 IMHO D provides the best of C and C++, improving it. So if D could
 also provide the best of Java it would be perfect.
 
 The best of Java is the Java API. In Java you open a window and draw a
 picture from an input stream of pixels with 10 lines of code, because
 of the Java API Class library:
 
 java.awt.Frame
 java.awt.Image
Various GUI libraries are being developed by different people. In case you might be interested in a particular project, here's a list: http://www.prowiki.org/wiki4d/wiki.cgi?AvailableGuiLibraries When one of them breaks out as being the "best", Walter might ship it with the compiler (probably as a semi-official library). -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Sep 07 2004
prev sibling next sibling parent reply Arcane Jill <Arcane_member pathlink.com> writes:
In article <n3mrj0971vo0q4ju9eo0gfmu9k69tc2v1l 4ax.com>, WB says...

d.awt.*
d.xml.*
d.crypto.*
Many of those things are already in development by various people. I'm partway through writing etc.crypto, for example. (I got sidetracked by Unicode, but cryptography remains my passion). GUI libraries are, I believe, under development by other folk (that's probably a frequently asked question). Not sure about XML, though I'm fairly sure there's a D wrapper around expat floating around somewhere. Arcane Jill
Sep 07 2004
parent reply WB <wb sapo.pt> writes:
On Wed, 8 Sep 2004 06:51:19 +0000 (UTC), Arcane Jill
<Arcane_member pathlink.com> wrote:

Many of those things are already in development by various people. I'm partway
through writing etc.crypto, for example. (I got sidetracked by Unicode, but
cryptography remains my passion). GUI libraries are, I believe, under
development by other folk (that's probably a frequently asked question). Not
sure about XML, 
though I'm fairly sure there's a D wrapper around expat floating
around somewhere.
I already found most of the GUI libraries pointed out in the replies to my posting, thank you for your attention. Of course, if I need a library for something i come here and ask if one exists before starting to write it by myself. But my question was about your opinion about making those libraries part of the language (searching for GUI libraries brought up that thoughts about a java-like standard library in the first place). Until now, I got 4 "Bad Idea" against 1 "Good Idea" (my own :).
Sep 08 2004
next sibling parent Ilya Minkov <minkov cs.tum.edu> writes:
WB schrieb:

 Until now, I got 4 "Bad Idea" against 1 "Good Idea" (my own :).
You are seeing it way too negative. I think we rather agree a standard of a sort will establish itself, and it is necessary. On the other hand, it's not "one size fits all" so it was decided not to make non-elementary features part of the standard. It's a compromise. And Walter has been cooperative in bundling his compiler. So if anyone creates a complete development system with an application framework, he can probably get permission tu bundle the compiler. -eye
Sep 08 2004
prev sibling next sibling parent Arcane Jill <Arcane_member pathlink.com> writes:
In article <nottj056b4hcrng6i3t00g0r074lcj5fsh 4ax.com>, WB says...

But my question was about your opinion about making those libraries
part of the language (searching for GUI libraries brought up that
thoughts about a java-like standard library in the first place). 

Until now, I got 4 "Bad Idea" against 1 "Good Idea" (my own :).
Bad idea. Jill
Sep 08 2004
prev sibling parent J C Calvarese <jcc7 cox.net> writes:
WB wrote:
 I already found most of the GUI libraries pointed out in the replies
 to my posting, thank you for your attention. Of course, if I need a
 library for something i come here and ask if one exists before
 starting to write it by myself. 
 But my question was about your opinion about making those libraries
 part of the language (searching for GUI libraries brought up that
 thoughts about a java-like standard library in the first place). 
 
 Until now, I got 4 "Bad Idea" against 1 "Good Idea" (my own :).
I'm fuzzy on what you mean by "Java-like". If you mean "everything is a class", I don't want D to go down that route. What do you think of "Python-like"? :) Also, I don't know if any of the XML or GUI libraries are mature enough yet to add to the D standard library. Only recently has the syntax of the language been stabilizing. Soon, the major bugs will be squashed and the libraries will grow up. Then we can start adding to std.xml.* or std.ext.xml or whatever it is. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Sep 08 2004
prev sibling next sibling parent WB <wb sapo.pt> writes:
Thank you again for your time. Your replies have pointed out that the
issue I brought up is not an issue at all, at least not at this time,
as those things are evolving naturally, and I agree upon that.  I
started to write some code to get me connected to my databases, so I'm
gonna work into it and maybe come up with some more practical issues
about coding.
Sep 08 2004
prev sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
WB wrote:

 Hello,
 
 I am new to D. I was looking for something like this for a long time. 
 IMHO D provides the best of C and C++, improving it. So if D could 
 also provide the best of Java it would be perfect.
 
 The best of Java is the Java API.
<snip>
 D could provide it's own API Class library
In general, operating systems have APIs. Languages have standard libraries. D already has one, called Phobos. I suppose Java isn't so much an exception as having a VM to complicate the terminology. By the Java API, I guess what's really meant is the Java VM API. Though it probably isn't quite as simple as that.... <snip>
 Platform versioning makes it easy (well...) to have such a class 
 library platform independent,
<snip> And to enable apps to follow the differing UI mechanisms and conventions between platforms. For example, in Windows, windows have menus. In Mac OS, applications have menus. Nearly all Mac apps can be still running with no windows open. PCs and Macs (and moreover, different Macs) also have quite different keyboards, and there are different shortcut key conventions. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Sep 09 2004