Re: Module Introspection

2020-03-11 Thread Lomar
Thank you for taking the time to share these with me! I'll have a look and reply my feedback as to whether these options are close to the reflectivity I'm referring to. Nim is truly a unique, useful and very powerful language, it has some great potentials to become one of the leading ones in pr

Re: Module Introspection

2020-03-11 Thread Lomar
As I can see Araq is quite against this feature, due to its exposure of non-local ASM's? At least if this feature is implemented through macros. I quite don't understand why this is bad. I mean how is python achieving it through OOP and not meta? It's just a private function in each object and s

Re: Another state of generating Android APK thread...

2020-03-11 Thread yglukhov
I wouldn't say everything is that experimental. I've been using nimx for android in production since 4 years ago, and I've got crashlytics integrated, so I kinda have some idea :). Java-nim memory model is pretty well defined in jnim, and it just works with nim default GC. The only thing experim

Re: [Noob Question] : Persistent http sessions in nim

2020-03-11 Thread enthus1ast
http is a state less protocol so`connection open` is kind of a wrong term. There is something like http connection reuse though, but afaik the authentication process is the same. So save the cookie data somewhere, maybe in a file. Then on a new http request, read it in and set it to the http he

Re: [Noob Question] : Persistent http sessions in nim

2020-03-11 Thread gevacrt
Could you please give me the link to the relevant doc to parse and save cookies to a file?

Re: [Noob Question] : Persistent http sessions in nim

2020-03-11 Thread enthus1ast
A simple example code for doing by hand: # index.php (sorry for php here but i was lazy) # import httpClient var client = newHttpClient() # our "login", index.php just sets a cookie let resp = client.get("http://127.0.0.1:80/ttt/index.php";)

Re: [Noob Question] : Persistent http sessions in nim

2020-03-11 Thread gevacrt
Thanks a lot!

Multithreading: still .running after joinThreads()

2020-03-11 Thread nroach2
Hi all, Relatively new to nim, very new to multithreading in nim. I'm attempting to run a program on a bunch of files I have the file paths for. The relevant code at the moment is the following: var t1 : seq[Thread[(string,string,string,uint16,uint16)]] for file in files:

Re: Multithreading: still .running after joinThreads()

2020-03-11 Thread nroach2
Also, not sure if it's relevant, but I think it might be. The function I'm calling is launching processes with the osproc module. Processes that in some case may take a while to run.

Casting basics (a few questions)

2020-03-11 Thread mantielero
I am trying to read c-array into a sequence. If somebody could confirm if my understanding is correct. In one hand, I have in C world: an address, the array size and the type. Something like: bufferptr, size and uint8 (it contains an image). In order to load the buffer into the seq, is the foll

Re: Module Introspection

2020-03-11 Thread Araq
It's been 4 years, I cannot count how often I got this feature request. What does that mean? If a really suitable implementation comes along I won't fight it as hard anymore. Maybe.

Re: Casting basics (a few questions)

2020-03-11 Thread dawkot
In your example let value = cast[uint8](address) Run should be let value = cast[uint8](address[]) Run You should use UncheckedArray here for nicer syntax: const size = 3 var buf = cast[ptr UncheckedArray[uint8]](cre

Performance improvement suggestions for small program

2020-03-11 Thread adnan
Hi, I came across this simple programming task (notice Bonus 2): [https://www.reddit.com/r/dailyprogrammer/comments/ffxabb/20200309_challenge_383_easy_necklace_matching](https://www.reddit.com/r/dailyprogrammer/comments/ffxabb/20200309_challenge_383_easy_necklace_matching)/ Here's my solution and

Unknown performance pitfall in tables?

2020-03-11 Thread adnan
Recently in response to [https://www.reddit.com/r/dailyprogrammer/comments/ffxabb/20200309_challenge_383_easy_necklace_matching](https://www.reddit.com/r/dailyprogrammer/comments/ffxabb/20200309_challenge_383_easy_necklace_matching)/ I came up with my nim solution which was pretty identical to th