May bug with ``ptr ref`` combine closure?

2023-05-25 Thread slangmgh
Thank you, that make sence. :) I have a real world bug related this, it is troubled me for long time, please give me some hints if possible. The real world program like this: I have an big ref object named as BigObj, which I pass to several children thread with pointer, because I don't want it

PyPI was subpoenaed. Should Nim prepare a process in place?

2023-05-25 Thread PMunch
Playground manager here. The playground tries it's very best to clear everything from the disk. It has very limited hard drive space so it doesn't store anything apart from the code and the images containing the various Nim versions. The only thing that could be possible to share is the access l

May bug with ``ptr ref`` combine closure?

2023-05-25 Thread slangmgh
Look at the following code: ## nim c --mm:refc a.nim type Foo = ref object a: int proc unsafe_ref_count(x: ref): int = let p = cast[ptr UncheckedArray[int]](x) p[-2] shr 3 proc main(px: ptr Foo) = let x = px[] proc p1(

PyPI was subpoenaed. Should Nim prepare a process in place?

2023-05-25 Thread Araq
I don't manage the playground so I don't speak for its manager. Would I comply and give away forum user data to some government? I cannot imagine.

DLL Terms

2023-05-25 Thread sls1005
I think the documentation for [nimrtl](https://nim-lang.org/docs/nimc.html#dll-generation) is not clear enough. The first time I saw it, I thought it's something Windows-only, as it only mentions DLL. It took me a few time to figure out that DLL means shared library, and that `nimrtl.dll` is ca

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-25 Thread bung
maybe you can find some useful projects in

PyPI was subpoenaed. Should Nim prepare a process in place?

2023-05-25 Thread ElegantBeef
Playground hosts data on ix.io. So that's a non-issue. Nimble is decentralized so there is none of those statistics. So the best anyone could get is a list of IPs.

Best Web Framework Features?

2023-05-25 Thread termer
I agree almost 100% with what @Isofruit brought up. I would like to be specific and say that I'd like .NET-style validation, with controller methods mapping to routes, their arguments being used to generate JSON validators automatically, and the ability to use annotations to customize it further

PyPI was subpoenaed. Should Nim prepare a process in place?

2023-05-25 Thread terrygils
The full story: Who is in charge of managing Nim infrastructure and would you comply with the DOJ if presented with such a situation? What would be the process if, for example, the BMJ (I assume it’s Germany’s DOJ) asked for all the l

Platonic: core math concepts

2023-05-25 Thread Araq
> Though my context is graphics/game engineering, not ML/numeric processing, so > my comments are not going to be very helpful here What I tried to say. These are just too different domains and require different types even though in math they use the same types.

Platonic: core math concepts

2023-05-25 Thread elcritch
For actual usable pieces, a set concepts for dynamic math types should be doable I'd think. Though I'm not sure how you'd do a non-generic Tensor/Matrix/Vector type. How would you implement say a basic `sum` operator without knowing the data type? proc sum*[T](m1: Matrix[T]): T =

Platonic: core math concepts

2023-05-25 Thread elcritch
@mratsim thanks for the info dump! And I'd agree about the friction with static types. > Using static dimensions generate significant frictions for both the developer > and the user. There are very annoying or unsurmontable challenges like: Definitely, static types aren't doable (yet). Though t

NIM code compile to executable does not run on other systems.

2023-05-25 Thread awr1
Try compiling with `--app:gui`. If you have DLL errors it will show up as a dialog box instead of popping in an command line which might vanish very fast if you launch from explorer. I took a look at your deps and I would concur with @Yardanico, however, looking at the deps for `dimscord`, I wo

Platonic: core math concepts

2023-05-25 Thread awr1
FWIW I've been using static ranged dimensions for a while in my own (short, 2-4 dimensions) vectors + matrixes plus distinct types for unit vectors, colors, etc. and I really find it quite easy to deal with. (Though my context is graphics/game engineering, not ML/numeric processing, so my commen

Platonic: core math concepts

2023-05-25 Thread mratsim
When I first came to Nim, I was very excited about the `static` capabilities. After playing with `linalg` (the ancestor of `neo`) which already had static dimensions () and comparing with my experien

Alternative to powmod in Nim

2023-05-25 Thread mratsim
> The fundamental problem with stint currently is a consequence of its > unfortunate recursive design which renders every single operation > exponentially slower than it has to be in the number of bytes used for the > size of the integer. Actually, the main slowness issue is currently the carry

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-25 Thread PMunch
> Interesting idea, maybe, it would be possible to put docs into buckets of N, > and create bloom filter for the whole bucket, and then check for potential > ngram presence in the whole N docs at once. Bloom filters are easily combinable, so it would be fairly trivial to make a tree structure o

Platonic: core math concepts

2023-05-25 Thread elcritch
P.S. an example of a 1001 vs 1000 element square matrix might be deleting the boundary conditions for a CFD or FEA simulation. That'd usually not be good. ;)

Platonic: core math concepts

2023-05-25 Thread elcritch
> but who cares about the difference between a 1001x1001 matrix and a 1000x1000? Actually that's precisely it. Those are incompatible matrices for most useful operations. It'd be much nicer to know that upfront because you messed up a slice rather than at runtime. Being able to lift that into t

Platonic: core math concepts

2023-05-25 Thread Araq
> Running an ML program only to discover an off by one issue after running for > 10 minutes sucks. How can we do better? Use slices and make them lenient, using 0.0 for missing values or similar. For small matrixes like 4x4 or 3x3 is makes sense to encode them in the type and use the type syste

Platonic: core math concepts

2023-05-25 Thread elcritch
Introducing [Platonic](https://github.com/elcritch/platonic), a repo for developing a set of Concepts for core math types like Matrices, Vectors, and Tensors. Ideally if it works well something like this could be added to SciNim for a common interface. Currently it's mostly experimental to lear

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-25 Thread alexeypetrushin
> One alternative is the bitap algorithm > > You can also have a look at other fuzzy finder tools around, for example fzf Thanks for links, I checked `agrep` with tre algo, but didn't knew about these two ^ you mentioned. > The first algorithm takes about 30ms, and the second takes about 3ms.

Install Nimble package from specific branch and subdri?

2023-05-25 Thread alexeypetrushin
I want to publish package [ftext](https://github.com/al6x/nim/tree/releases/releases/ftext) in github repo in branch `releases` and subdir `releases/ftext`. But I can't download it with Nimble, commands failed: nimble install https://github.com/al6x/nim@#releases?subdir=releases/ft

Best Web Framework Features?

2023-05-25 Thread blackmius
have you seen ? I have done several projects on it and I can say that in general this is enough in most cases for my tasks. I have mainly used it on projects where there is a separation of frontend and backend, so this story is not about SSR. but this framework sol

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-25 Thread PMunch
Just realised that one big performance benefit you could get if you have a structure with all your documents is to use a bloom filter over the N-grams of the document. This would mean you only scan documents which have an opportunity of containing a hit. Of course this would mean you would need

Alternative to powmod in Nim

2023-05-25 Thread arnetheduck
The fundamental problem with stint currently is a consequence of its unfortunate recursive design which renders every single operation exponentially slower than it has to be in the number of bytes used for the size of the integer. The first step to any stint work is to replace the implementatio

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-25 Thread PMunch
Just did some tiny benchmarking, generated a 10Mb file with `cat <(tr -dc A-Za-gi-z' '

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-25 Thread PMunch
You can also have a look at other fuzzy finder tools around, for example fzf has pretty readable sources: . I implemented a simplified version of their V1 algorithm: proc fuzzyMatchV1(text: string, pattern: string): tupl

Alternative to powmod in Nim

2023-05-25 Thread dlesnoff
I have read your post, but I have not much time to answer you. Barret and Montgomery techniques improve the reduction, which is crucial indeed. Unsigned integer arithmetic is slow, but 256 primes does not fit on floating point types, so it is basically our only solution. I am surprised that Ope

Any fuzzy or trigram substring search library, with index, so it's instant?

2023-05-25 Thread PMunch
One alternative is the bitap algorithm, you give it two strings and the amount of errors you accept. It creates a bit pattern which it then uses to scan through the text pretty fast. Here is a sample implementation adapted from [here](https://www.programmingalgorithms.com/algorithm/fuzzy-bitap-a

Complexity of nim vs other languages in creating a simple back-of-the-envelope tool.

2023-05-25 Thread mratsim
Assuming you have 10 dist, your optimization makes the Nim code do 10x less work than C, meaning your figures are extremely misleading.

Alternative to powmod in Nim

2023-05-25 Thread mratsim
Since implementing fast powmod comes back every few months, I've written an issue to explain the high to medium level details on how to implement high-performance powmod here: