@Udiknedormin: I meant right now, since VTable are not available of course.
@monster: It is not safe as is, you must ensure your chain of Msg and MsgBase
pointers have the same lifetime (by putting them in a seq for example).
Otherwise if they are created in different functions, the previous Msg
Yes, it's possible to have a Tensor of x, y, z points.
Sorting is not implemented yet. (And will not be implemented in terms of
map/parallel map but in terms of whatever algo I find the fastest/most memory
efficient).
I was going to talk about this on IRC but I figured out a post would be more
appropriate. This is also my first post on this forum so _hello,
nim-community_. I usually don't get involved in such stuff, but since Nim is
running towards 1.0 and I have huge expectations for it, I'm making an effor
I want to not only send those messages between threads, but also across the
network. Anything containing additional pointers would just make things more
complicated. Atm, I'm trying something like this (not entirely sure if
toMsgBasePtr() is safe):
type
QueueID* = distinct ui
That is not true. Vtable pointers can be elements of a seq, just like any ptr
or ref type.
What I mean is a vectorized structure-of-arrays for x, y, z (and possibly
others) for a set of particles. They should be ordered according to their place
in space grid. As I said, in numpy I can have a any-D numpy array and sort it,
no python lists involved. I imagine the same for tensors in Arr
I'm not sure we are speaking of the same thing.
In which case are we: a Tensor containing seqs or a pure rank 2 (matrix) or
rank 3 tensor?
import arraymancer
import sequtils, random
let p1 = newSeqWith(4, random(0..10))
let p2 = newSeqWith(4, random(0..10))
No, they are not, it would work only if seq[YourConcept] is not needed or only
of homogeneous concrete type.
@mratsim Vtptrs are not ready yet, as I've heard? If they were, I guess they
would solve the problem (it is how it would probably be solved in Rust,
actually).
Let's say I want to do some operations on particles. They should be vectorized
(and maybe parallelized, some calculations could also benfit from GPU) and it
would be really nice if particles from the same space grid would be in the same
place in the sequence, as they will need to access the same
This code works as desired in parallel. Thanks for the instructions.
proc column_load(prime, j, k, r: int) {.gcsafe.} =
{.gcsafe.}:
for ri in residues: # for each prime|residue pair
let prod = r * ri # compute res cross
Also could concepts fit your need?
As far as I know there is none.
I'm interested in a pure Nim implementation of R-tree and closely related
[Kd-tree](https://en.wikipedia.org/wiki/K-d_tree) for geospatial algorithms
(clustering especially).
I've added your suggestion to the "[Are we scientists
yet](https://github.com/nim-lang/
The number of message types is not fixed. I'm trying something else now, using
composition instead of inheritance.
In which cases would you need to store a seq or a list in a tensor or a Numpy
ndarray?
[https://en.wikipedia.org/wiki/R-tree](https://en.wikipedia.org/wiki/R-tree)
I assume not yet.
For Ruby I used my custom bindings to boost library for this. But as the RTree
algorithm is not too complex, a native Nim implementation may be preferable
over a Nim Boost-Rtree wrapper.
I guess we w
Thanks @hawk_king ; this worked with the addition of the extra line in your
earlier post
echo 'passL=" -landroid-glob "' >> config/nim.cfg
@monster Is the number of different kinds of messages fixed? If it is, you can
use variant types.
@mratsim Oh, really, you don't know any example of an operation the cost of
depends on values? Well, I easily know one: sorting.
It seems a little messy, I'd say. And not really too many examples. I think
you should make up your mind: do you want people to get interested in Nim (=>
you don't really have to explain things that much) or do you want to teach them
Nim (=> you make a "tutorial for experienced programmers").
I see what you're saying... but Nim's design is different.
There is no invisible synchronization for globals. They are unsafe if you
mutate them (usual "shared xor mutable" disclaimer). If you are going to mutate
shared state, you must take appropriate precautions (locks, memory barriers,
etc.)
21 matches
Mail list logo