Re: Recommendation on plotting library

2023-07-20 Thread Chris Piker via Digitalmars-d-learn

On Friday, 21 July 2023 at 02:40:10 UTC, harakim wrote:

On Thursday, 20 July 2023 at 02:37:54 UTC, Chris Piker wrote:


If you happen upon a basic charting library for D during this 
hunt, please let me know! Last year, I rolled my own and it got 
the job done, but I wasn't concerned about how they looked. :D


Well, just for fun, if you have a plotting library on github or 
some other public place I wouldn't mind taking a look.  Given the 
state of things, it doesn't have to be awesome to be a good seed 
point.


As for plotting, I imagine it's c bindings only because there's 
no need to re-invent the wheel.


(Warning, possible ill-informed opinions ahead...)

In a way there is a need to reinvent the wheel.  With python I 
can run `pip install matplotlib` and get whatever binaries I need 
to get the job done.  D runs on dub, which I only see handling 
source code, and as far as I can tell, only D source code at 
that.  So unless it's D code, it can't be packaged and delivered 
easily within the D ecosystem.


If dub supports either pre-built binaries, or C code (such as 
libcairo2), I'd be interested in seeing how that's done.  With 
the wizardry I've see around here, it's probably easy, I just 
don't know about it.


Going wy out on a limb for a minute, I think D shines as a 
scripting language replacement.  Most of my programs are single 
file projects these days with dub set as the interpreter.  Also 
Rust seems to be crowding the system level space and so focusing 
on it's "compiled scripts" capability avoids that competition.


(If any of the statements above are faulty, I invite correction.)


Re: Recommendation on plotting library

2023-07-20 Thread harakim via Digitalmars-d-learn

On Thursday, 20 July 2023 at 02:37:54 UTC, Chris Piker wrote:

Hi D

One of my jobs is to release and maintain public data archives 
from long-running scientific instruments.  In order to help 
people understand how to process the data, sample code is often 
included with the archive. Recently this has been in the form 
of short programs that generate a plot of a representative time 
period.  Python works well for this task as matplotlib support 
is pretty much universal.  Matlab is also a reasonable choice 
for many.


Were I to also provide sample code in D, what library would you 
recommend for scientific plotting, especially for dynamic power 
spectral densities generated from time-series data (basically 
heatmaps)?


Since dub can pull down dependencies easily enough and since it 
supports single file projects it seems that D would be well 
suited to this task, but I've never plotted any data directly 
from a D program.  Many GUI libraries I see for D are wrappers 
around external C or C++ based libraries that would need to be 
installed separately.  I'd like to avoid such complications if 
that's possible.


Thanks for any advice,


If you happen upon a basic charting library for D during this 
hunt, please let me know! Last year, I rolled my own and it got 
the job done, but I wasn't concerned about how they looked. :D  
As for plotting, I imagine it's c bindings only because there's 
no need to re-invent the wheel.


Re: having troubles with D and Vulkan.

2023-07-20 Thread harakim via Digitalmars-d-learn

On Thursday, 20 July 2023 at 06:27:13 UTC, Danni Coy wrote:
ok found it, I am an idiot, (really not used to working with 
dynamic libraries).


erupted needs a call to load device level functions.

loadDeviceLevelFunctions(instance);

On Thu, Jul 20, 2023 at 4:22 PM Danni Coy  
wrote:


https://pastebin.com/Jc9ZaFFs
Redid the code as an almost exact translation of the C code.
should be easier to test and compare. Same issue is occurring.

On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via 
Digitalmars-d-learn  wrote:

>
> On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
> > https://pastebin.com/JxxJufNB
>
> What platform are you using, and how are you trying to build?
>
> I can try to replicate on my end.


Good work! Now I can rest in peace tonight. :D


Re: Pre-import version statements

2023-07-20 Thread bachmeier via Digitalmars-d-learn

On Thursday, 20 July 2023 at 15:45:04 UTC, Chris Piker wrote:
On Thursday, 20 July 2023 at 06:44:30 UTC, Jonathan M Davis 
wrote:


D has nothing equivalent to that. You compile your code with 
whichever version of dmd (or ldc, gdc, etc.) that you want, 
and it either compiles or it doesn't.


Thanks :)

As I developer that doesn't bother me too much, though I can 
imagine that management would be concerned.  For larger 
projects it's appreciated when I can point to a particular 
fixed standard that I'm following.  In addition to the 
`#define` statement above, my libraries were also compiled with 
`gcc -std=c99`.


I'll move over to a compiler specific area and broach the topic.


This is one of the arguments for a LTS release. If you know you 
can compile your code for, say, the next four years, including 
dependencies, it's not likely to be a problem. If there's a new 
compiler released eight times a year, there's no hope for that 
kind of stability, particularly when there are any dependencies.


Re: Pre-import version statements

2023-07-20 Thread Chris Piker via Digitalmars-d-learn

On Thursday, 20 July 2023 at 06:44:30 UTC, Jonathan M Davis wrote:

D has nothing equivalent to that. You compile your code with 
whichever version of dmd (or ldc, gdc, etc.) that you want, and 
it either compiles or it doesn't.


Thanks :)

As I developer that doesn't bother me too much, though I can 
imagine that management would be concerned.  For larger projects 
it's appreciated when I can point to a particular fixed standard 
that I'm following.  In addition to the `#define` statement 
above, my libraries were also compiled with `gcc -std=c99`.


I'll move over to a compiler specific area and broach the topic.



Re: Recommendation on plotting library

2023-07-20 Thread drug007 via Digitalmars-d-learn

20.07.2023 05:37, Chris Piker пишет:

Hi D

One of my jobs is to release and maintain public data archives from 
long-running scientific instruments.  In order to help people understand 
how to process the data, sample code is often included with the archive. 
Recently this has been in the form of short programs that generate a 
plot of a representative time period.  Python works well for this task 
as matplotlib support is pretty much universal.  Matlab is also a 
reasonable choice for many.


Were I to also provide sample code in D, what library would you 
recommend for scientific plotting, especially for dynamic power spectral 
densities generated from time-series data (basically heatmaps)?


Since dub can pull down dependencies easily enough and since it supports 
single file projects it seems that D would be well suited to this task, 
but I've never plotted any data directly from a D program.  Many GUI 
libraries I see for D are wrappers around external C or C++ based 
libraries that would need to be installed separately.  I'd like to avoid 
such complications if that's possible.


Thanks for any advice,


https://code.dlang.org/packages/ggplotd


Re: Print debug data

2023-07-20 Thread Dennis via Digitalmars-d-learn
On Wednesday, 19 July 2023 at 01:13:23 UTC, Steven Schveighoffer 
wrote:
It's kind of a terrible message, I wish it would change to 
something more informative.


As of https://github.com/dlang/dmd/pull/15430, there's a new 
message:


```
accessing non-static variable `freeSize` requires an instance of 
type `Stats`

```



Re: Pre-import version statements

2023-07-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, July 19, 2023 10:56:26 PM MDT Chris Piker via Digitalmars-d-
learn wrote:
> Hi D
>
> In my C code I used to typically put the line:
> ```
> #define _POSIX_C_SOURCE 200112L
> ```
> in the source before importing any standard library headers.  Is
> there something equivalent for phobos?  Say
> `version(phobos2.100)` or similar?
>
> I don't particularly need this functionality, just checking to
> see if there as a formal way to denote what library standard the
> application code is expect to work against.
>
> Thanks,

D has nothing equivalent to that. You compile your code with whichever
version of dmd (or ldc, gdc, etc.) that you want, and it either compiles or
it doesn't. The features of the compiler and the standard library go hand in
hand, and you can't do something like use dmd version X while saying that
you want Phobos version Y. They're both going to be the same version. The
compiler may have additional switches to turn features on and off (e.g. to
enable checks for functionality that's being added as part of a DIP but
isn't the default behavior yet), but the compiler and standard library are
versioned together.

The closest thing to what you're talking about that I can think of in D
would be __VERSION__, which simply gives you access to the version of the
compiler that you're compiling with. So, it's compiler-specific, and all it
gives you is an integer value. As such, outside of very rare cases, it would
likely be a bad idea to actually use it for any form of conditional
compilation.

https://dlang.org/spec/lex.html#specialtokens

Typically, the approach that people use it to just always use the latest
compiler. And outside of deprecations being removed or bad luck with bug
fixes, code usually just continues to work. And if they need to stick to an
older version of the compiler for some reason, they just use that version of
the compiler. But writing code that explicitly depends on a particular
version of the compiler is not something that many projects are likely to be
doing.

- Jonathan M Davis





Re: Recommendation on plotting library

2023-07-20 Thread anonymouse via Digitalmars-d-learn

On Thursday, 20 July 2023 at 04:41:48 UTC, Chris Piker wrote:

On Thursday, 20 July 2023 at 03:58:05 UTC, Andrew wrote:
I just tried ggplotd and it was easy to make it work on Linux, 
only one external apt command needed, but on Windows, even that 
is a deal breaker.  Package management on Windows seems to be 
wild-west/nonexistent.


Have you tried https://github.com/koji-kojiro/matplotlib-d? There 
is a slightly more updated fork out there but I can't remember 
exactly who maintains it.


Side musing... Since I've seen many people use anaconda on 
Windows, I wonder how hard it would be to make a conda package 
that provided dmd+dub?


Have you tried chocolatey.org? It's similar to homebrew for macOS 
but for Windows.


Re: having troubles with D and Vulkan.

2023-07-20 Thread Danni Coy via Digitalmars-d-learn
ok found it, I am an idiot, (really not used to working with dynamic libraries).

erupted needs a call to load device level functions.

loadDeviceLevelFunctions(instance);

On Thu, Jul 20, 2023 at 4:22 PM Danni Coy  wrote:
>
> https://pastebin.com/Jc9ZaFFs
> Redid the code as an almost exact translation of the C code.
> should be easier to test and compare. Same issue is occurring.
>
> On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via Digitalmars-d-learn
>  wrote:
> >
> > On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
> > > https://pastebin.com/JxxJufNB
> >
> > What platform are you using, and how are you trying to build?
> >
> > I can try to replicate on my end.



Re: having troubles with D and Vulkan.

2023-07-20 Thread Danni Coy via Digitalmars-d-learn
https://pastebin.com/Jc9ZaFFs
Redid the code as an almost exact translation of the C code.
should be easier to test and compare. Same issue is occurring.

On Thu, Jul 20, 2023 at 5:30 AM Mike Shah via Digitalmars-d-learn
 wrote:
>
> On Wednesday, 19 July 2023 at 07:39:35 UTC, Danni Coy wrote:
> > https://pastebin.com/JxxJufNB
>
> What platform are you using, and how are you trying to build?
>
> I can try to replicate on my end.