Re: better c fibers

2021-09-28 Thread Kagamin via Digitalmars-d-learn

On Tuesday, 21 September 2021 at 09:37:30 UTC, Abby wrote:

Hi there,
I'm new in dlang I specially like betterC. I was hoping that d 
fibers would be implemented in without using classes, but there 
are not.


On windows you can use the fiber api 
https://docs.microsoft.com/en-us/windows/win32/procthread/fibers 
just as you would do in C.


Re: Modules ... "import" vs. "compilation" ... what is the real process here?

2021-09-28 Thread Steven Schveighoffer via Digitalmars-d-learn

On 9/28/21 1:59 AM, james.p.leblanc wrote:

On Tuesday, 28 September 2021 at 05:26:29 UTC, Ali Çehreli wrote:

On 9/27/21 10:38 AM, james.p.leblanc wrote:




In addition to what Mike Parker said, templates do complicate matters 
here: Templates are instantiated (i.e. compiled for a specific set of 
template arguments) by modules that actually use those templates.





Ali, this is great! ...I had been tempted to also ask about how templates
figure into this, but realized that including this in my question would be
over complicating the question, so it remained unasked.

But, now I have this part answered as well.  I very much appreciate the
mind-reading tricks going on here on the forum!



Be aware that the compiler might not include the code for the template 
in the instantiating module if it detects that the instantiation could 
already have been generated in an imported module (not one passed on the 
command line).


For example, if Ali's module `a` contained an alias:

```d
module a;

auto doubled(T)(T value) {
   return value * 2;
}

alias doubleInt = doubled!int;
```

Now the compiler might say "hey, a.d already has instantiated that one, 
and it's not being built by me, so I'll assume it has already generated 
the code" and doesn't do it.


-Steve


Re: Loading assimp

2021-09-28 Thread Eric_DD via Digitalmars-d-learn

I am trying to use a newer version of Assimp.
I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to 
assimp.dll


When running my executable it throws a 
derelict.util.exception.SharedLibLoadException:


"Failed to load one or more shared libraries:
assimp.dll - %1 is not a valid Win32 application.
Assimp64.dll - The specified module could not be found"

Any idea what's going on? Are 64bit dlls not supported?


Re: Loading assimp

2021-09-28 Thread russhy via Digitalmars-d-learn

On Tuesday, 28 September 2021 at 16:30:09 UTC, Eric_DD wrote:

I am trying to use a newer version of Assimp.
I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to 
assimp.dll


When running my executable it throws a 
derelict.util.exception.SharedLibLoadException:


"Failed to load one or more shared libraries:
assimp.dll - %1 is not a valid Win32 application.
Assimp64.dll - The specified module could not be found"

Any idea what's going on? Are 64bit dlls not supported?


try to rename it to Assimp64.dll


Re: Loading assimp

2021-09-28 Thread Eric_DD via Digitalmars-d-learn

On Tuesday, 28 September 2021 at 19:59:09 UTC, russhy wrote:

On Tuesday, 28 September 2021 at 16:30:09 UTC, Eric_DD wrote:

I am trying to use a newer version of Assimp.
I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to 
assimp.dll


When running my executable it throws a 
derelict.util.exception.SharedLibLoadException:


"Failed to load one or more shared libraries:
assimp.dll - %1 is not a valid Win32 application.
Assimp64.dll - The specified module could not be found"

Any idea what's going on? Are 64bit dlls not supported?


try to rename it to Assimp64.dll


Nah :) Already tried that. It just swaps the file names in the 
error message.


Understanding range.dropBackOne

2021-09-28 Thread Tim via Digitalmars-d-learn

I'm doing the following:

```D
int[25] window = 0;

// Later in a loop
window = someInteger ~ window[].dropBackOne;
```

But I'm struggling to understand why the following doesn't work
```D
window = someInteger ~ window.dropBackOne;
```

What does the `[]` do exactly? Is an array not a bidirectional 
range?


Re: Understanding range.dropBackOne

2021-09-28 Thread Tim via Digitalmars-d-learn

On Tuesday, 28 September 2021 at 23:12:14 UTC, Adam Ruppe wrote:

On Tuesday, 28 September 2021 at 22:56:17 UTC, Tim wrote:

[...]


Note that this array has a fixed size.


[...]


Here the window[] takes a variable-length slice of it. Turning 
it from int[25] into plain int[]. Then you can drop one since 
it is variable length. Then appending again ok cuz it is 
variable. Then the window assign just copies it out of the 
newly allocated variable back into the static length array.



[...]


But over here you are trying to use the static array directly 
which again has fixed length, so it is impossible to cut an 
item off it or add another to it.



[...]


It takes a slice of the static array - fetching the pointer and 
length into runtime variables.


Perfect answer. Thanks for clearing that all up mate


Re: Understanding range.dropBackOne

2021-09-28 Thread Adam Ruppe via Digitalmars-d-learn

On Tuesday, 28 September 2021 at 22:56:17 UTC, Tim wrote:

I'm doing the following:

int[25] window = 0;


Note that this array has a fixed size.


window = someInteger ~ window[].dropBackOne;


Here the window[] takes a variable-length slice of it. Turning it 
from int[25] into plain int[]. Then you can drop one since it is 
variable length. Then appending again ok cuz it is variable. Then 
the window assign just copies it out of the newly allocated 
variable back into the static length array.



window = someInteger ~ window.dropBackOne;


But over here you are trying to use the static array directly 
which again has fixed length, so it is impossible to cut an item 
off it or add another to it.


What does the `[]` do exactly? Is an array not a bidirectional 
range?


It takes a slice of the static array - fetching the pointer and 
length into runtime variables.


Re: Loading assimp

2021-09-28 Thread Mike Parker via Digitalmars-d-learn

On Tuesday, 28 September 2021 at 16:30:09 UTC, Eric_DD wrote:

I am trying to use a newer version of Assimp.
I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to 
assimp.dll


When running my executable it throws a 
derelict.util.exception.SharedLibLoadException:


"Failed to load one or more shared libraries:
assimp.dll - %1 is not a valid Win32 application.
Assimp64.dll - The specified module could not be found"

Any idea what's going on? Are 64bit dlls not supported?


I'm not maintaining the package anymore, but this is an error 
from the system loader and has nothing to do with the binding 
itself. It's the sort of error that usually pops up when trying 
to load a 32-bit DLL into a 64-bit program, or vice versa. Are 
you sure it's a 64-bit DLL?


Using D "rocket" logo in outside presentation

2021-09-28 Thread Chris Piker via Digitalmars-d-learn

Hi D

I'm to give a presentation to a combined NASA/ESA group in a few 
hours and would like to include a copy of the D "rocket" logo 
when mentioning new server side tools that I've written in D.  Is 
such use of this particular [D 
logo](https://i0.wp.com/dlang.org/blog/wp-content/uploads/2021/08/logo_256.png?w=750&ssl=1) permissible?


Thanks,


Re: Using D "rocket" logo in outside presentation

2021-09-28 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 29 September 2021 at 04:24:13 UTC, Chris Piker 
wrote:

Hi D

I'm to give a presentation to a combined NASA/ESA group in a 
few hours and would like to include a copy of the D "rocket" 
logo when mentioning new server side tools that I've written in 
D.  Is such use of this particular [D 
logo](https://i0.wp.com/dlang.org/blog/wp-content/uploads/2021/08/logo_256.png?w=750&ssl=1) permissible?


Thanks,


Yes!


Re: Using D "rocket" logo in outside presentation

2021-09-28 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 29 September 2021 at 04:24:13 UTC, Chris Piker 
wrote:

Hi D

I'm to give a presentation to a combined NASA/ESA group in a 
few hours and would like to include a copy of the D "rocket" 
logo when mentioning new server side tools that I've written in 
D.  Is such use of this particular [D 
logo](https://i0.wp.com/dlang.org/blog/wp-content/uploads/2021/08/logo_256.png?w=750&ssl=1) permissible?


Thanks,


it's [Attribution-ShareAlike 4.0 International (CC BY-SA 
4.0)](https://creativecommons.org/licenses/by-sa/4.0/) so it's 
freely usable (give appropriate credit, dunno if saying it's the 
D logo is enough credit giving, but don't think I have seen that 
artwork been used with any other credit in context of dlang 
before)


see https://github.com/dlang-community/artwork