Re: D on android and d_android

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 13:36:29 UTC, burt wrote: Sorry, I must have misread this. My LDC version was 1.20.1, not 1.19. did that fix the linker error? The runtimes it downloads are specifically built against 1.19. But libs for the other versions are available too, you just need to

Re: D on android and d_android

2020-04-01 Thread burt via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 14:16:28 UTC, Adam D. Ruppe wrote: On Wednesday, 1 April 2020 at 14:13:32 UTC, burt wrote: I also wonder if there's a difference between the libphobos2-ldc and libphobos2-ldc-debug.a libraries? Do those mangle differently and could that cause the linker errors?

Re: dub sourceFiles

2020-04-01 Thread aliak via Digitalmars-d-learn
On Tuesday, 31 March 2020 at 15:23:48 UTC, Anonymouse wrote: I have a library package that I split up into subpackages, but I'm having to do mental gymnastics to make it only compile the files I want. The problem is that even if you specify some `sourceFiles`, it will build everything under

D on android and d_android

2020-04-01 Thread burt via Digitalmars-d-learn
Hi, I'm trying to compile a simple app with D code to Android and trying to use the d_android library for this. While trying to compile a basic sample, I found a README [0] that mentions an "android-dub-build.d" script, which should be a wrapper around `dub build`, but I cannot find this

Re: D on android and d_android

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 08:50:01 UTC, burt wrote: I found a README [0] that mentions an "android-dub-build.d" script, which should be a wrapper around `dub build` Ah, I forgot to update that file. There is no android-dub-build anymore, instead the android-setup changes the main

Re: Vibe.d navigation

2020-04-01 Thread GreatSam4sure via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 02:15:25 UTC, Steven Schveighoffer wrote: On 3/31/20 4:43 PM, GreatSam4sure wrote: [...] Vibe does not render templates automatically. You have to render them from a function. The function can be in a route that has nothing to do with the name of the template.

Re: D on android and d_android

2020-04-01 Thread burt via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 11:57:58 UTC, Adam D. Ruppe wrote: On Wednesday, 1 April 2020 at 08:50:01 UTC, burt wrote: I found a README [0] that mentions an "android-dub-build.d" script, which should be a wrapper around `dub build` Ah, I forgot to update that file. There is no

Re: Array fill performance differences between for, foreach, slice

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 06:48:09 UTC, Jacob Carlborg wrote: You have not enabled optimizations. You should compile with `-O -release -inline` to enable all optimizations. -release should *never* be used. You're trading memory safety and security holes for a few microseconds of execution

Re: How to deploy on GitHub pages

2020-04-01 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 31 March 2020 at 12:52:09 UTC, Ahmat wrote: Hi all, I want to use vibe.d for my personal website hosted on Github pages. I am not familiar with vibe.d and I am confused about how to approach this. Any suggestions, ideas ? I will appreciate your help. as Mathias said, GitHub

Re: dub sourceFiles

2020-04-01 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 31 March 2020 at 15:23:48 UTC, Anonymouse wrote: I have a library package that I split up into subpackages, but I'm having to do mental gymnastics to make it only compile the files I want. [...] how about targetType "none" if you don't have any source in the main package but

Re: Array fill performance differences between for, foreach, slice

2020-04-01 Thread Jacob Carlborg via Digitalmars-d-learn
On 2020-03-31 23:30, data pulverizer wrote: $ dmd fill.d && ./fill You have not enabled optimizations. You should compile with `-O -release -inline` to enable all optimizations. Without optimizations I get numbers like these: Slice: Mean time(usecs): 92.91, Standard Deviation: 49.8002

Re: Aborting from core/sync/mutex.d(147) Error: pthread_mutex_init failed.

2020-04-01 Thread mitchell via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 02:08:09 UTC, mitchell wrote: Hello, I've just finished migrating a project from GDC/Makefile to LDC with dub. The program now compiles and runs, and works fine until such time as the following error occurs: Aborting from core/sync/mutex.d(147) Error:

Re: D on android and d_android

2020-04-01 Thread burt via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 14:00:39 UTC, Adam D. Ruppe wrote: On Wednesday, 1 April 2020 at 13:36:29 UTC, burt wrote: Sorry, I must have misread this. My LDC version was 1.20.1, not 1.19. did that fix the linker error? The runtimes it downloads are specifically built against 1.19. But

Re: Array fill performance differences between for, foreach, slice

2020-04-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/1/20 11:23 AM, data pulverizer wrote: Thanks for all the suggestions made so far. I am still interested in looking at the implementation details of the slice assign `arr[] = x` which I can't seem to find. Before I made my initial post, I tried doing a `memcpy` and `memmove` under a `for`

Re: D on android and d_android

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 14:13:32 UTC, burt wrote: I also wonder if there's a difference between the libphobos2-ldc and libphobos2-ldc-debug.a libraries? Do those mangle differently and could that cause the linker errors? maybe. what are the errors?

Re: D on android and d_android

2020-04-01 Thread burt via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 15:01:02 UTC, Adam D. Ruppe wrote: On Wednesday, 1 April 2020 at 14:54:35 UTC, burt wrote: libphobos2-ldc.a and libphobos2-ldc-debug.a. Sizes are 2511 kB, 4792 kB, 10.010 kB and 17.378 kB respectively. Those latter two should be megabytes not kilobytes the

Re: D on android and d_android

2020-04-01 Thread burt via Digitalmars-d-learn
So the correct steps now: 1) get ldc 1.19 specifically and the android NDK 2) do `android-setup /path/to/your/android/ndk` 3) do normal `dub build` Sorry, I must have misread this. My LDC version was 1.20.1, not 1.19. Thanks

Re: D on android and d_android

2020-04-01 Thread burt via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 14:31:45 UTC, Adam D. Ruppe wrote: On Wednesday, 1 April 2020 at 14:20:25 UTC, burt wrote: Some examples of errors are: Those mean it isn't linking in the libs at all... ugh. do ldc2 -v and it will tell you where the config file is. open that up and see if it

Re: D on android and d_android

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 14:54:35 UTC, burt wrote: libphobos2-ldc.a and libphobos2-ldc-debug.a. Sizes are 2511 kB, 4792 kB, 10.010 kB and 17.378 kB respectively. Those latter two should be megabytes not kilobytes the download must have failed. can i come back to it in a few hours?

Re: Array fill performance differences between for, foreach, slice

2020-04-01 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 12:22:48 UTC, Adam D. Ruppe wrote: On Wednesday, 1 April 2020 at 06:48:09 UTC, Jacob Carlborg wrote: You have not enabled optimizations. You should compile with `-O -release -inline` to enable all optimizations. -release should *never* be used. You're trading

Re: Array fill performance differences between for, foreach, slice

2020-04-01 Thread data pulverizer via Digitalmars-d-learn
Thanks for all the suggestions made so far. I am still interested in looking at the implementation details of the slice assign `arr[] = x` which I can't seem to find. Before I made my initial post, I tried doing a `memcpy` and `memmove` under a `for` loop but it did not change the performance

Re: D on android and d_android

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 14:20:25 UTC, burt wrote: Some examples of errors are: Those mean it isn't linking in the libs at all... ugh. do ldc2 -v and it will tell you where the config file is. open that up and see if it has teh correct paths under a section that looks kinda like

Re: Array fill performance differences between for, foreach, slice

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 15:04:44 UTC, Jesse Phillips wrote: It is nice that bounds checks remain in place when using release and the code is @safe. Yeah, it used to be even worse than it is now, but it is still a terrible switch that should NEVER be used. There are always better ways

Re: Array fill performance differences between for, foreach, slice

2020-04-01 Thread lithium iodate via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 06:48:09 UTC, Jacob Carlborg wrote: I you care about performance you should really compile using LDC (with `-O5 -release -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto`), which usually produces much better code: Slice: Mean time(usecs): 50.58, Standard

Re: What does the [] operator do here?

2020-04-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/1/20 3:35 PM, Net wrote: from the below code, the expression "case [c]": void main() {     import std.stdio, std.string, std.algorithm, std.conv;     // Reduce the RPN expression using a stack     readln.split.fold!((stack, op)     {     switch (op)     {     //

Re: What does the [] operator do here?

2020-04-01 Thread Net via Digitalmars-d-learn
oh, i see. That was a dump question. I don't code in D has been a while and totally forget to create a new array was as simple as []

determine ldc version in static if or version?

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
I want to do like static if(__LDC_VERSION == 1.19) { // declaration } All the tricks I know that I have tried so far give the dmd numbers. Perhaps I could use that to identify a particular version as a hack, but I specifically am curious about the ldc version because of a change they made

Re: What does the [] operator do here?

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 19:35:30 UTC, Net wrote: from the below code, the expression "case [c]": That's just an array literal, so the same as like "" ~ c

[dmd] Types and ScopeDsymbol

2020-04-01 Thread drug via Digitalmars-d-learn
Is it true that user defined types are resolved to ScopeDsymbol and basic types aren't?

What does the [] operator do here?

2020-04-01 Thread Net via Digitalmars-d-learn
from the below code, the expression "case [c]": void main() { import std.stdio, std.string, std.algorithm, std.conv; // Reduce the RPN expression using a stack readln.split.fold!((stack, op) { switch (op) { // Generate operator switch cases statically

Re: determine ldc version in static if or version?

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 2 April 2020 at 01:27:26 UTC, Nicholas Wilson wrote: https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.di#L22-L34 ah excellent that will do. thanks!

Re: Why can meson find hunt-net but not hunt-proton in dependency resolution?

2020-04-01 Thread Heromyth via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 02:27:38 UTC, YD wrote: Thanks for the reply! BTW is hunt-amqp for AMQP 1.0 only? Because when I try it on an AMQP 0.9 server, it does not seem to connect. Thanks again! We are using RabbitMQ v3.8.2 for test. The hunt-amqp is based on AMQP 1.0, and is not tested

Re: determine ldc version in static if or version?

2020-04-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 21:19:54 UTC, Adam D. Ruppe wrote: I want to do like static if(__LDC_VERSION == 1.19) { // declaration } All the tricks I know that I have tried so far give the dmd numbers. Perhaps I could use that to identify a particular version as a hack, but I

How add all folders of a diretory using -J ?

2020-04-01 Thread Baby Beaker via Digitalmars-d-learn
Exemple: Inside folder Project I have ten folders. How can I add this ten folders using dmd and -J command? I don't want add one by one.

Re: D on android and d_android

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 1 April 2020 at 15:04:02 UTC, burt wrote: Well I'm European, so with 10.010 kB I mean 10010 kB = 10.010 MB in American/British. ah, of course. Well, I won't be able to finish it today anyway, so take your time. I rewrote the downloader so it goes straight from ldc releases