On Monday, 25 November 2019 at 19:48:46 UTC, GreatSam4sure wrote:
On Monday, 25 November 2019 at 18:28:55 UTC, H. S. Teoh wrote:
On Mon, Nov 25, 2019 at 12:15:42PM +0000, Joseph Rushton
Wakeling via Digitalmars-d-announce wrote: [...]
[...]
I'm probably not the intended audience here, but just so it's
out there, here's a list of dub showstoppers for me:
[...]
I am interested in D/java project. Can you help me with
material or link on that. I Will be happy to use javafx as
front end and D as back end for a desktop App.
I have looking on GraalVm but no luck yet. Just need a good
tutorial for a start-up
I once got a php/D bridge proof of concept, that should have
worked with Java as well:
- create some D utility code,
- make an extern (C) API,
- write the C headers of the API,
- use swig (http://www.swig.org/) to wrap the C API to the
language of choice.
- Once loaded, the module has to initialize the D runtime, by a
call to core.runtime.rt_init() or
core.runtime.Runtime.initialize()
(https://dlang.org/phobos/core_runtime.html).
Swig generates shared objects. This worked well on Linux. I am
not sure how the dll support is on Windows though: it could get
more difficult.
Back then, the extern (C++) wasn't as extensive as it is now, so
today it might be more pertinent to create an extern (C++) API to
conveniently wrap extern (C++) D classes/interfaces to Java
classes/interfaces.
These pages of the documentation detail how to interface with C
and C++:
https://dlang.org/spec/interfaceToC.html
https://dlang.org/spec/cpp_interface.html
Maybe the extern (C/C++) API approach can be used with GraalVM, I
haven't researched that yet. When I tried GraalVM (for ahead of
time native compilation) I got into difficulties with libraries
using the java reflection API. One need to get the "pro" GraalVM
distribution if I recall correctly. It seemed too much of a
hurdle for what I was evaluating. I did eventually did fine
without GraalVM.
The C/C++ API from D process is quite involving. If I were to get
Java and D together I would explore a D server communicating with
a Java client over a TCP socket or HTTP, maybe using json:
- Adam D. Ruppe wrote a D socket tutorial not long ago:
https://forum.dlang.org/post/ciiiskgfeyhqfkfux...@forum.dlang.org
- I used asdf (http://code.dlang.org/packages/asdf) for JSON
serialization and deserialization with success. There is also
std.json already available in phobos.
- Maybe a small http server with vibe.d could be started with
even less code.
For a desktop app, I would rather use dlangui
(http://code.dlang.org/packages/dlangui). There are other
maintained GUI libraries for D.
Ron Tarrant has written many tutorials an GtkD on his blog page:
- https://gtkdcoding.com/
- http://code.dlang.org/packages/gtk-d
There is also DWT, a D port of the SWT Java GUI library:
http://code.dlang.org/packages/dwt
TKD is a binding over the Tcl/Tk toolkit:
- http://code.dlang.org/packages/tkd