Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread Araq
Missed the classical: proc `=copy`(dest: var BitVector; source: BitVector) {.error.} Run Somebody needs to come up with better default rules with what happens if only a subset of the =hooks are defined. We can probably steal these from C++... :-)

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread blackmius
Also openarray is not a real type. Its used as parameter type to show what parameter is an array with length and subscript operator. So you don`t need to cast everything to it unless you need a generic proc accepting any array like. I can suggest you to make your own structure with overload subs

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread blackmius
you cannot access bitvector without bitwise operations so it's always not zero-copy. Unless you using machine with non-word memory access but nowadays its pretty uncommon.

One language to rule them all.

2023-08-26 Thread Araq
> unrelated but the time limit on being able to edit anything is kinda silly It is an anti-bot feature and it works. Bots would fail us and be considered to be human. Later on they edit their posts to be spam.

One language to rule them all.

2023-08-26 Thread awr1
unrelated but the time limit on being able to edit anything is kinda silly - would have preferred to be more concise.

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread ElegantBeef
You can define a `toOpenArray` template for any type that does this, but like I said you do not have a sequence of bools so it's mostly moot.

EZ Bkup: The easiest backup program on earth!

2023-08-26 Thread ITwrx
### [EZ Bkup](https://ezbkup.app): The easiest backup program on earth! EZ Bkup is a data backup program for the desktop, striving to be as quick and easy to use, as possible. EZ Bkup is a graphical frontend for Rsync, built with [Owlkettle](https://github.com/can-lehmann/owlkettle) and GTK, wr

One language to rule them all.

2023-08-26 Thread awr1
> However, a senior programming educator and a former engineer told me that > such a language is impossible due to the "Church-Turing thesis". In all honesty, this is a bad and unrelated answer (and kind of a cop-out). Nim is not trying to question conundrums of computability, Nim is questioning

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread giaco
would be interesting to be able to create an openArray like object from a proc that provides random access interface to T

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread ElegantBeef
I mean you could make a `openArray[byte]` but an `openArray[byte]` is incompatible with the zero copy, since the data is stored in a bitset and not sequential bools.

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread ElegantBeef
Since `bool`s are not bits you have to copy to make an `openarray[bool]`. What makes a bit more sense is to make the following then implement operations on the type. type MyBitset = object start: ptr UncheckedArray[byte] size: int Run

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread giaco
I was focusing on `openArray` for 2 reasons: 1- zero-copy access 2- make it work with all the things that already accepts `openArray` by following the new type `MyBitset` approach I would save point 1 but lose 2. Is there a workaround to have the best of both worlds?

Idiomatic way to zero-copy iterface with binary bitmap array

2023-08-26 Thread giaco
Hello I have a `pointer` to a memory region containing a binary bitmap array coded in LSB (from right to left) completed with the number of expected bools contained in it for example: byte 1: 0111 byte 2: 0011 num:1

Mastering Nim 2.0

2023-08-26 Thread elcritch
Heck yah! 5-stars all the way. ;)

One language to rule them all.

2023-08-26 Thread didlybom
You are right of course. Technically speaking "interactive programming" is not a programming domain but a particular way to use a programming language / environment :-) That being said, there are certain _application_ domains (specially in engineering and science) that pretty much require the k

Wishlist: Ideal UI library for Nim

2023-08-26 Thread elcritch
Thanks! Here's another video update: I particularly enjoy the "smooth fade" \-- and it's done in only a dozen lines of code! It's been really pleasing working on Figuro and the architecture is shaping up nicely. It's been easy to re-add major features like text (i

One language to rule them all.

2023-08-26 Thread didlybom
Nim is amazing and by far my preferred programming language but there is at least one thing that it is not very good for at the moment: interactive / notebook style programming (i.e. like using python with a Jupyter notebook). There is inim but it is terribly slow and often doesn't work very wel

One language to rule them all.

2023-08-26 Thread ingo
> "good for everything" "good for getting things done" would be enough for me.

Mastering Nim 2.0

2023-08-26 Thread giaco
Nice! Is there any options for the owners of the 1st Edition to access just the new chapter?

One language to rule them all.

2023-08-26 Thread Araq
So we need to prioritise things for you, got it. > make it too hard to use and in the end not better than TS/Kotlin/C#. Yawn. Feel free to use TS instead.

One language to rule them all.

2023-08-26 Thread alexeypetrushin
> "good for everything" Nim needs more pressure from higher level app development. It could do better than it does now. All those a) need to use `fmt` b) `{.base.}` c) `tdiv` d) no CopyOnWrite e) no infer for proc/lambda args f) no incremental g) poor IDE support h) no eval (poor VM support) i)