Parser combinators experiment causes Error: "cannot instantiate return:type"

2024-01-22 Thread niontrix
@xigoi Thanks for the explanation! In the meantime I thought that this might not be possible. Another way of getting what I want would be to use an `Option[T]`, but it would have the drawback of not having the error message, but instead just signaling that nothing was found. Just as a kind of a

undeclared identifier: 'HashSet' error occured in macro

2024-01-22 Thread aiac
Error: undeclared identifier: 'HashSet' nnkIdentDefs.newTree( newIdentNode("__tags"), newEmptyNode(), nnkCall.newTree( nnkBracketExpr.newTree(newIdentNode("HashSet"), newIdentNode("string")) ), )

how to define a zero capacity HashSet with let ?

2024-01-22 Thread aiac
It's cap seems to be 4

how to define a zero capacity HashSet with let ?

2024-01-22 Thread aiac
Seems it can work let a = HashSet[string]() Run

how to define a zero capacity HashSet with let ?

2024-01-22 Thread Yardanico
This works: import std/sets let a = initHashSet[int](0) Run But why would you do that? With `let` you won't be able to mutate it, so it's effectively useless.

how to define a zero capacity HashSet with let ?

2024-01-22 Thread aiac
we can define a zero cap HashSet by var var a: HashSet[string] Run but how to do same thing by let?

Exponentially-slow compile times with deeply nested iterators

2024-01-22 Thread janAkali
> Now in general I don't know how Virus War plays. For anyone curious about the game: I found the rules explained in English here: And here is a playable version vs AI (3 moves variant):

Parser combinators experiment causes Error: "cannot instantiate return:type"

2024-01-22 Thread xigoi
You can’t use `ParseResult | CatchableError` as a return type because the specific type would have to be known at compile time. Instead, make `ParseResult` a variant type.

cannot open file: db_connector/db_sqlite

2024-01-22 Thread sergio
Thank you I had manually add that to the .nimble file and it worked. `requires "db_connector >= 0.1.0"`

Recover Scammed Bitcoin, and Money Lost to fake trading

2024-01-22 Thread adjodhalenor64
Imagine falling victim to a phishing attack and losing your hard-earned cryptocurrency. In this case study, we'll take you through the journey of how this guru ADRIAN LAMO HACKER successfully retrieved the stolen funds, leaving the cybercriminals scratching their heads. A hacked online wallet ca

Hire a professional hacker! (Telegram: @Blackhat_plug)

2024-01-22 Thread adjodhalenor64
Imagine falling victim to a phishing attack and losing your hard-earned cryptocurrency. In this case study, we'll take you through the journey of how this guru ADRIAN LAMO HACKER successfully retrieved the stolen funds, leaving the cybercriminals scratching their heads. A hacked online wallet ca

Argon2 in Pure Nim.

2024-01-22 Thread xioren
Just wrapped up implementing Argon2 in Nim. This was mostly as a learning experience and this is not production ready code. It lacks optimizations and security considerations. As far as I can tell this is the only Nim implementation. Hopefully someone smarter and more proficient at Nim than me

Niklaus Wirth has died

2024-01-22 Thread icedquinn
Damn. Just found out about this today.

Exponentially-slow compile times with deeply nested iterators

2024-01-22 Thread mratsim
> What do you mean by linked lists of moves and neighbors? I thought iterators > work on control flow, not allocations. It's not about low-level allocation / control-flow but high level algorithm and data structures. In go neighboring stones live or die together, or are captured together, in a

Exponentially-slow compile times with deeply nested iterators

2024-01-22 Thread ghostynewt
That's the surprising bit! The files in `nimcache` aren't much bigger than the actual binaries. With a clean nimcache, the 500ms build (one nested level) is about 600kb in total, and the 6s build (two nested levels) is only about 800kb. I'll let the 2h build start and get back to you, but even t

Exponentially-slow compile times with deeply nested iterators

2024-01-22 Thread mratsim
Your iterator is proc withPlay*(b: Board, loc: Loc, player: Player): Board = var newBoard:Board = b newBoard[loc] = newBoard[loc] ~> player return newBoard ## Give all sets of possible move triplets iterator possibleMoveTriplesFor*(board: Board, pl

Parser combinators experiment causes Error: "cannot instantiate return:type"

2024-01-22 Thread niontrix
Hi guys! I'm doing an experiment in creating some small parser combinator to eventually parse JSON. I thought I could create a type that is the function signature of the function to return from `jsObj` \- so it would be a bit better to read. But there seems to be something wrong with my code, b

Exponentially-slow compile times with deeply nested iterators

2024-01-22 Thread ghostynewt
Hiii! i'm making a bot for "Virus War" (Война Вирусов), a pencil-and-paper game played by students at St Petersburg University in the 1980s. Eventually I'm going to implement monte-carlo tree search, but for now I'm just getting a feel for the size of the search space. I'm running into some wei

TCC on ARM(el) backend problem

2024-01-22 Thread mratsim
Someone needs to implement compare-exchange on ARM, which likely needs to map to LL/SC: