> Last time I checked Python's implementation, Python's slices also do copy, 
> but it's not a problem because people believe they don't copy and beliefs 
> tend to win over facts.

They do copy, as far as I know, but I'd not be so sure about make-it-true 
power.  For some time I was sure slicing makes a view in Python that I used: 
    
    
    arr[lb:hb].sort()
    

I was pretty sure it actually will sort a slice until tests failed. 

> I think submodules are a strange idea and most languages (Python included) do 
> fine without.

Please take a look at the thread about submodules I created. I wrote it after 
rewritting a project of mine to use import and export rather that include 
(which took me some time as it has many files) and saw the docs look nowhere 
like what I would like them to look like.

> Moving is actually easy enough in Nim but zero-copy slices cannot be moved in 
> any language since it's pretty much a logical impossibility.

If you mean shallowCopy, it'd love it to actually behave like moving. I was 
sure it does but recently I got a runtime error because of this assumption. 
Maybe a compiler bug though.

About not being able to move zero-copy slices: logical error here, actually. 
Zero-copy slices are views, either mutable or immutable. The view itself can be 
moved, it just doesn't move the data it points at. Alternatively, there can be 
three kinds of slices defined: immutable view, mutable view, slice-entry. The 
last one can do all the mutable view can do and also extend the slice or shrink 
it (even to zero length). Of course these operations actually affect original 
container, e.x. an seq has to move the data after the slice's end in memory.

Also, Python is not a good example here, I'd say. As you know, it's not really 
an efficiency-focused language. 

> More importantly, which libraries would you need?

As for now, not so many, actually.

Firstly, hdf5 (and h5part). I know it can be ported but as far as I know, Nim's 
VM can't handle non-pure code (or did it change?) and I tend to use 
metaprogramming a lot. Today I was frustrated that I couldn't find any way to 
access a const passed to a macro (so I could, e.x. access elements of a const 
array), so I guess it shows just how weird things I tend to use (maybe you know 
the solution?). Here, I'd like to be able to recursively build a type-safe data 
structure with fields named and typed after hdf5 files' groups.

Secondly, lots of optimization goodies, like advanced autovectorization. I had 
a look at qex ("A talk on HPC" thread) and hope jxy will publish some of his 
stuff as it seems a good base.

Reply via email to