00:00:57 | * | yglukhov joined #nim |
00:05:10 | * | yglukhov quit (Ping timeout: 250 seconds) |
00:29:55 | dyce_ | anyway to take a iterator and convert it do a sequence by using some function (or list comprehension) |
00:37:07 | * | yglukhov joined #nim |
00:38:53 | ephja | dyce_: yes http://nim-lang.org/docs/sequtils.html#toSeq.t,expr |
00:41:42 | * | yglukhov quit (Ping timeout: 260 seconds) |
00:47:24 | * | ftsf joined #nim |
00:57:54 | * | brson quit (Quit: leaving) |
01:13:22 | * | yglukhov joined #nim |
01:15:04 | * | chemist69_ quit (Ping timeout: 272 seconds) |
01:18:33 | * | yglukhov quit (Ping timeout: 276 seconds) |
01:28:31 | * | chemist69_ joined #nim |
01:49:17 | * | yglukhov joined #nim |
01:52:37 | * | wh1t3r0s3 quit (Ping timeout: 250 seconds) |
01:54:02 | * | yglukhov quit (Ping timeout: 260 seconds) |
02:04:28 | * | GangstaCat joined #nim |
02:13:49 | * | yglukhov joined #nim |
02:19:00 | * | yglukhov quit (Ping timeout: 276 seconds) |
02:50:04 | * | yglukhov joined #nim |
02:54:45 | * | yglukhov quit (Ping timeout: 276 seconds) |
03:14:21 | * | yglukhov joined #nim |
03:19:12 | * | yglukhov quit (Ping timeout: 260 seconds) |
03:45:12 | * | alexsystemf__ quit (Ping timeout: 258 seconds) |
03:47:37 | * | alexsystemf__ joined #nim |
03:50:30 | * | yglukhov joined #nim |
03:54:30 | * | brechtm quit (Read error: Connection reset by peer) |
03:54:35 | * | brechtm_ joined #nim |
03:55:12 | * | yglukhov quit (Ping timeout: 276 seconds) |
04:14:19 | * | brechtm_ quit (Read error: Connection reset by peer) |
04:14:38 | * | ephja quit (Read error: Connection reset by peer) |
04:15:04 | * | yglukhov joined #nim |
04:15:54 | * | brechtm joined #nim |
04:19:54 | * | yglukhov quit (Ping timeout: 276 seconds) |
04:51:13 | * | yglukhov joined #nim |
04:56:18 | * | yglukhov quit (Ping timeout: 276 seconds) |
05:06:44 | dyce_ | how would you secure a route using jester? is there a simple session implementation? |
05:27:32 | * | yglukhov joined #nim |
05:32:42 | * | yglukhov quit (Ping timeout: 276 seconds) |
05:32:56 | * | pdv joined #nim |
05:44:51 | * | alexsystemf__ quit (Quit: Connection closed for inactivity) |
06:03:33 | * | yglukhov joined #nim |
06:08:27 | * | yglukhov quit (Ping timeout: 276 seconds) |
06:25:04 | * | GangstaCat quit (Quit: Leaving) |
06:28:02 | * | yglukhov joined #nim |
06:32:52 | * | yglukhov quit (Ping timeout: 260 seconds) |
06:48:21 | * | Trustable joined #nim |
06:52:35 | * | Trustable quit (Remote host closed the connection) |
06:53:28 | * | Trustable joined #nim |
06:53:29 | * | zodiak_ joined #nim |
06:53:47 | * | Trustable quit (Remote host closed the connection) |
06:55:33 | * | zodiak quit (Ping timeout: 240 seconds) |
07:03:21 | * | yglukhov joined #nim |
07:07:52 | * | yglukhov quit (Ping timeout: 260 seconds) |
07:13:37 | * | pafmaf joined #nim |
07:32:51 | * | arnetheduck joined #nim |
07:42:03 | * | arnetheduck quit (Ping timeout: 276 seconds) |
07:44:15 | * | brechtm quit (Ping timeout: 264 seconds) |
07:44:53 | * | brechtm joined #nim |
07:51:55 | * | euantor joined #nim |
08:01:01 | * | yglukhov joined #nim |
08:19:32 | * | pafmaf quit (Quit: Leaving) |
08:25:14 | * | elrood joined #nim |
08:28:41 | * | pafmaf joined #nim |
08:45:13 | * | nicanaca0 joined #nim |
08:52:34 | * | nsf quit (Quit: WeeChat 1.5) |
08:59:51 | * | pafmaf quit (Ping timeout: 264 seconds) |
09:18:44 | * | pdv quit (Quit: Ex-Chat) |
09:18:44 | * | brechtm_ joined #nim |
09:18:59 | * | brechtm quit (Read error: No route to host) |
09:23:00 | * | fastrom joined #nim |
09:24:13 | * | fastrom1 joined #nim |
09:24:13 | * | fastrom quit (Read error: Connection reset by peer) |
09:25:26 | * | der-landgraf quit (Quit: WeeChat 1.5) |
09:34:02 | * | fredrik92 joined #nim |
09:41:46 | federico3 | RedMonk language ranking 2016 |
09:41:50 | federico3 | http://redmonk.com/sogrady/2016/07/20/language-rankings-6-16/ |
09:46:35 | euantor | Yeah, I noticed Nim on there, still pretty low down unfortunately |
09:49:09 | * | Trustable joined #nim |
09:49:19 | Flox42 | well, I am just guessing, but it might have something to do with the maturity of nim. At least that's one reason why we almost stopped using nim in our company. |
09:50:53 | ftsf | anyone know of a gif encoder in nim? or easily wrapped? |
09:52:23 | Flox42 | ftsf: nope, sorry |
09:55:01 | Araq | Flox42: please give some details. it is bugs? missing features? people discussing language breaks? |
09:57:17 | ftsf | Flox42, ahh well, good excuse to figure out how to write one i guess =) |
09:58:34 | * | gokr joined #nim |
10:00:54 | Flox42 | to be clear, I think nim is fantastic as a system language, but for us some bugs (memory leaks) related to async/await in conjunction with jester and threads not working well with async/await (asynchttpserver) are currently a game breaker. furthermore the standard library is nice and growing, but we are still missing some things like a good websocket implementation (I know niv's implementation, but that is not working well with |
10:00:55 | Flox42 | threads). |
10:03:21 | Flox42 | and yes, nim is open source and everyone is invited to contribute, but my daily business doesn't give me much spare time. |
10:05:21 | euantor | For me the biggest problems right now are a lack of libraries (though the standard library is great, there are some stuff very particular to what I do). |
10:05:46 | euantor | I also prefer static linking, but that's not exactly a deal breaker. |
10:06:13 | euantor | We're using Nim at work for some small tasks (see my migrate library/tool - we use it internally to manage all database changes at work). |
10:06:28 | * | pafmaf joined #nim |
10:07:02 | euantor | Ideally, we can extend that out, and perhaps write libraries in Nim that we can interface to from C# (should already be possible thanks to Nim's brilliant FFI) which is our current main language |
10:14:27 | Flox42 | currently we are mainly using C/C++, Java, JavaScript (node.js) and Go. right now we favour Go over nim for microservices and operating hardware ... and I am really missing nim's interopability with C stuff. |
10:14:53 | cheatfate | Flox42, why you need threads? for speed? |
10:17:07 | Flox42 | I had to use threads support when writing windows services, for instance |
10:19:21 | cheatfate | Flox42, still can't understand |
10:21:06 | cheatfate | You can write threads and talk to thread which run asynchttpserver via channels for example |
10:22:03 | cheatfate | windows version of asyncdispatch is more threadsafe then posix variant |
10:25:10 | Flox42 | Flox |
10:25:11 | Flox42 | I am trying to use an asynchttpserver in a thread and get the following compile error for the callback: 'cb' is not GC-safe as it accesses 'nameIterVar' which is a global using GC'ed memory. Is there any way around this? |
10:25:12 | Flox42 | Flox |
10:25:13 | Flox42 | I am using jester already in a thread, which works fine. now I want to start a asynchttp for websockets in the same thread, which gives me the above error. |
10:25:13 | Flox42 | Flox |
10:25:14 | Flox42 | so, I can't really use asynchttpserver or libraries that use asynchttpserver and async calls when using --threads:on? |
10:25:15 | Flox42 | dom96 (IRC) |
10:25:15 | Flox42 | Araq: ok, will add nodecl |
10:25:16 | Flox42 | Flox42: right now it's not officially supported I'm afraid. |
10:26:26 | euantor | We use Go a fair bit too, mostly when working with hardware (GPIO on a Raspberry Pi for example) |
10:26:49 | euantor | I am writing a Nim library to access the pins on a Pi though, so hopefully that piece of code will get ported accross soon-ish |
10:27:24 | cheatfate | Answer to your first question is - stop using global variables, try other technique |
10:27:38 | * | Trustable quit (Remote host closed the connection) |
10:29:20 | * | pdv joined #nim |
10:31:15 | * | ftsf quit (Quit: :q!) |
10:31:23 | * | brechtm_ quit (Read error: No route to host) |
10:31:33 | cheatfate | Flox42, and if you trying to use https://github.com/niv/websocket.nim, its mostly looks like PoC not by ready to use library |
10:31:43 | * | brechtm joined #nim |
10:32:00 | cheatfate | so its better to borrow some code from it and adopt your your server |
10:32:19 | Araq | Flox42: the known memory leaks were all gone with the latest release. is it still an issue? did you try it? |
10:32:26 | Flox42 | cheatfate: yes, but I only instantiated a asynchttpserver with a callback doing nothing in a thread |
10:32:51 | Flox42 | Araq: I have to check it, haven't done it yet |
10:35:54 | * | Trustable joined #nim |
10:36:14 | cheatfate | Flox42, could you show example of your callback setup and callback code? |
10:36:16 | Flox42 | this is what I am doing in a thread function: https://zerobin.tarakis.de/?32ee4bfad197993f#gWeII0CV37Gq73ofoYmJVDZfcf5eosR+QXcG723BTuI= |
10:37:07 | Flox42 | and this is the error I get when compiling: |
10:37:08 | Flox42 | lib/pure/asyncdispatch.nim(1596, 8) Error: 'cb' is not GC-safe as it accesses 'nameIterVar' which is a global using GC'ed memory |
10:38:14 | cheatfate | Flox42, so you have tried to instantiate 2 asynchttpserver's in one thread? |
10:38:28 | Flox42 | yes |
10:38:56 | Flox42 | I want to have one for my REST api and one for websockets on different ports |
10:41:39 | cheatfate | Flox42, try to use https://github.com/andreaferretti/rosencrantz/blob/master/rosencrantz/core.nim#L60-L85 this kind of conversion for your request handler proc |
10:44:45 | Flox42 | thanks, will try |
10:54:37 | * | brechtm_ joined #nim |
10:54:54 | * | brechtm quit (Read error: No route to host) |
10:56:13 | Flox42 | as I am not needing a context, the following should be sufficient? |
10:56:14 | Flox42 | proc handle*(): auto = |
10:56:14 | Flox42 | proc server(req: asynchttpserver.Request): Future[void] {.async.} = |
10:56:15 | Flox42 | discard |
10:56:16 | Flox42 | return server |
10:56:33 | Flox42 | ah, indentation got lost |
10:56:47 | Flox42 | it gives me the same error |
10:59:37 | Flox42 | https://zerobin.tarakis.de/?dff825b144eb3acd#2oXKohi0FsrvpgmS/pNHlZIrA7xpAHYGrd511A4SjpU= |
11:04:35 | cheatfate | could you give me exact output of nim compilation |
11:05:24 | cheatfate | because error you mentioned must not be alone |
11:15:51 | Flox42 | oh oh |
11:16:33 | Flox42 | my bad, error went away, even with standard asynchttpserver. the problem is really in the websockets library |
11:18:07 | Flox42 | so, all my bad. websocket libraray has some globals |
11:18:54 | * | fredrik92 quit (Quit: Shutting down . . .) |
11:19:43 | cheatfate | maybe we need to sanitize packages inside of nimble? |
11:21:14 | Flox42 | well, I forgot to remove the import for websocket |
11:23:44 | Flox42 | I guess for further tests I have to use the websocket library directly and change it according to my needs. however, I don't feel like I can really use this in production yet. maybe if I have some more time I can contribute to the websocket library. |
11:25:00 | Araq | Flox42: fair enough, thanks for the feedback. |
11:25:11 | cheatfate | Flox42, current websocket `library` is looks like PoC, so you need to write your own |
11:25:26 | Araq | cheatfate: your 'wanted' package needs websocket support :-) |
11:25:48 | flyx | SO starts Documentation today. sadly, it tells me that the nim tag „is too new or too low activity“. we should post more on SO ;) http://blog.stackoverflow.com/2016/07/introducing-stack-overflow-documentation-beta/ |
11:26:09 | cheatfate | Araq, it will have it in future... currently i'm stuck in parsers of http protocol |
11:26:59 | cheatfate | and wanted is not a package :) its PoC |
11:29:49 | cheatfate | Araq, and i'm already tired of it... :( |
11:30:32 | euantor | Just found wanted, looks interesting |
11:31:52 | cheatfate | euantor, currently `wanted` its just a way to speed up asynchttpserver 2x |
11:32:25 | euantor | Interesting. I've not played much with the HTTP server stuff in the stdlib yet. I've used the client a bit, but not the server |
11:32:48 | euantor | A x2 speed increase sounds like a pretty major enhancement though |
11:41:14 | * | ephja joined #nim |
11:49:38 | * | nsf joined #nim |
11:51:50 | * | ftsf joined #nim |
11:58:56 | * | pdv quit (Remote host closed the connection) |
13:00:03 | * | fredrik92 joined #nim |
13:28:47 | Flox42 | yeah, 'wanted' looks interesting |
13:59:35 | * | brechtm_ quit (Read error: Connection reset by peer) |
13:59:40 | * | brechtm joined #nim |
14:00:09 | * | yglukhov quit () |
14:01:19 | * | yglukhov joined #nim |
14:05:48 | * | namnguyen quit (Ping timeout: 250 seconds) |
14:09:10 | * | reactormonk quit (Quit: WeeChat 1.4) |
14:12:19 | * | reactormonk joined #nim |
14:13:20 | * | reactormonk quit (Client Quit) |
14:18:14 | * | namnguyen joined #nim |
14:21:57 | * | reactormonk joined #nim |
14:39:26 | * | desophos quit (Read error: Connection reset by peer) |
14:52:03 | * | trusion quit (Ping timeout: 264 seconds) |
15:09:36 | * | arnetheduck joined #nim |
15:16:46 | * | trusion joined #nim |
15:24:12 | * | yglukhov quit (Ping timeout: 276 seconds) |
15:25:58 | * | mtj_ quit (Ping timeout: 250 seconds) |
15:32:16 | * | arnetheduck quit (Ping timeout: 252 seconds) |
15:35:17 | * | hendi__ joined #nim |
15:45:39 | * | trusion quit (Ping timeout: 276 seconds) |
15:55:18 | * | euantor quit (Quit: Leaving) |
15:59:18 | * | hendi__ quit (Ping timeout: 276 seconds) |
16:24:16 | * | brson joined #nim |
16:32:08 | * | yglukhov joined #nim |
16:36:27 | * | yglukhov quit (Ping timeout: 264 seconds) |
16:41:27 | * | fredrik92 quit (Quit: Shutting down . . .) |
17:03:52 | * | euantor joined #nim |
17:16:30 | * | fastrom1 quit (Quit: Leaving.) |
17:28:01 | * | wuehlmaus quit (Quit: Lost terminal) |
17:31:56 | * | yglukhov joined #nim |
17:44:53 | * | euantor quit (Remote host closed the connection) |
17:48:03 | * | euantor joined #nim |
17:50:26 | ftsf | hmm no signum/sign/sgn function? |
17:51:56 | * | StarBrilliant quit (Quit: ZNC - http://znc.in) |
17:56:06 | * | mtj_ joined #nim |
18:03:46 | * | yglukhov quit (Remote host closed the connection) |
18:09:40 | * | euantor quit () |
18:14:08 | * | yglukhov joined #nim |
18:20:09 | * | yglukhov quit (Remote host closed the connection) |
18:32:02 | * | yglukhov joined #nim |
18:34:47 | * | yglukhov quit (Remote host closed the connection) |
18:35:04 | * | yglukhov joined #nim |
18:38:07 | * | fastrom joined #nim |
18:38:39 | * | fastrom1 joined #nim |
18:38:39 | * | fastrom quit (Read error: Connection reset by peer) |
18:39:51 | * | gokr quit (Ping timeout: 240 seconds) |
18:41:20 | * | kingofoz quit (Ping timeout: 272 seconds) |
18:42:25 | * | kingofoz joined #nim |
18:42:49 | * | Ven joined #nim |
19:10:56 | * | yglukhov quit (Remote host closed the connection) |
19:12:12 | * | yglukhov joined #nim |
19:14:23 | * | yglukhov quit (Remote host closed the connection) |
19:21:37 | * | icebattle joined #nim |
19:26:17 | * | yglukhov joined #nim |
19:30:27 | * | yglukhov quit (Ping timeout: 244 seconds) |
19:50:49 | * | yglukhov joined #nim |
19:55:32 | * | yglukhov quit (Ping timeout: 260 seconds) |
19:59:15 | * | brechtm quit (Ping timeout: 264 seconds) |
20:02:13 | * | brechtm joined #nim |
20:04:19 | * | fastrom joined #nim |
20:06:57 | * | fastrom1 quit (Ping timeout: 276 seconds) |
20:17:51 | * | chrisheller quit (Remote host closed the connection) |
20:17:57 | * | Trustable quit (Remote host closed the connection) |
20:19:13 | * | Trustable joined #nim |
20:19:28 | * | Trustable quit (Remote host closed the connection) |
20:19:56 | * | gokr joined #nim |
20:21:38 | * | Trustable joined #nim |
20:21:50 | * | chrishel_ joined #nim |
20:24:09 | * | chrishel_ quit (Remote host closed the connection) |
20:26:45 | * | yglukhov joined #nim |
20:27:51 | * | Trustable quit (Ping timeout: 240 seconds) |
20:29:31 | * | Trustable joined #nim |
20:31:39 | * | yglukhov quit (Ping timeout: 276 seconds) |
20:51:17 | * | yglukhov joined #nim |
20:54:50 | * | Matthias247 joined #nim |
20:56:14 | * | yglukhov quit (Ping timeout: 272 seconds) |
21:02:16 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:03:29 | * | Matthias247 joined #nim |
21:12:16 | * | fastrom quit (Quit: Leaving.) |
21:13:56 | * | pafmaf_ joined #nim |
21:17:15 | * | pafmaf quit (Ping timeout: 264 seconds) |
21:19:54 | * | der-landgraf joined #nim |
21:27:29 | * | yglukhov joined #nim |
21:28:41 | * | desophos joined #nim |
21:29:45 | * | chrisheller joined #nim |
21:32:06 | * | yglukhov quit (Ping timeout: 276 seconds) |
21:33:17 | * | brechtm quit (Read error: Connection reset by peer) |
21:33:23 | * | brechtm_ joined #nim |
21:49:57 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:53:12 | * | brechtm_ quit (Read error: No route to host) |
21:54:41 | * | brechtm joined #nim |
21:56:17 | * | pafmaf_ quit (Ping timeout: 260 seconds) |
21:59:59 | * | derlafff quit (Remote host closed the connection) |
22:03:39 | * | yglukhov joined #nim |
22:08:30 | * | yglukhov quit (Ping timeout: 276 seconds) |
22:15:53 | * | elrood quit (Quit: Leaving) |
22:16:50 | * | brechtm quit (Read error: Connection reset by peer) |
22:17:00 | * | brechtm_ joined #nim |
22:20:00 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:26:31 | * | chrisheller quit (Remote host closed the connection) |
22:28:06 | * | yglukhov joined #nim |
22:31:52 | dyce_ | what would be a simple pattern for simple authentication in jesteR? |
22:32:27 | * | yglukhov quit (Ping timeout: 260 seconds) |
22:34:06 | dom96 | dyce_: how simple is simple? :) |
22:34:24 | dom96 | You can take a look at NimForum's source for an example |
22:34:48 | dyce_ | dom96: http://flask.pocoo.org/snippets/8/ |
22:35:02 | dyce_ | does WWW-Authenticate do some magic? |
22:35:18 | dyce_ | so if you authenticate once, you get access to a few routes? |
22:35:37 | dyce_ | and also is it possible to see what ip the client is? |
22:35:55 | dom96 | jester doesn't deal with authentication at the moment |
22:36:01 | dom96 | but I think you can access everything you need via the headers |
22:36:23 | dom96 | as for IP: https://github.com/dom96/jester/blob/master/jester.nim#L56 |
22:36:42 | dyce_ | dom96: alright cool, lol i was looking at host |
22:38:09 | dyce_ | dom96: theoretically, how could you make a session? would you have a sessiontable and generate a session ID based off some client's useragent, ip, etc |
22:38:33 | dyce_ | would that be enough to prevent session hijacking? |
22:39:22 | dom96 | I would just hash the password + ip and store that in the client's cookie |
22:39:41 | dom96 | but I'm not sure what the best practices are |
22:39:55 | dyce_ | but then i will have to code a 'our site uses cookies' and i might goto jail :) |
22:40:00 | dyce_ | if i dont |
22:40:15 | dyce_ | yeah i dont know any best practices either |
22:40:29 | dom96 | I'm still fine and the nim forum doesn't show that stupid message. |
22:40:37 | cheatfate | hashing password is a bad practice |
22:40:59 | Xe | cheatfate: [citation needed] |
22:41:34 | dyce_ | well you should salt it and hash it again |
22:42:15 | dom96 | using a salt is a good practice when hashing in general |
22:43:25 | dyce_ | for my use, i think i will make a table of authenticated sessions, with ip+unique client info with a timestamp of when it was authenticated. and each request will do a lookup and verify the session is still valid (was auth'd within 1 hour) |
22:43:49 | dyce_ | not sure how secure that would be |
22:43:54 | dyce_ | any thoughts? |
22:44:02 | * | arnetheduck joined #nim |
22:47:38 | * | Trustable quit (Remote host closed the connection) |
22:48:30 | cheatfate | https://hueniverse.com/2015/07/08/on-securing-web-session-ids/ |
23:01:16 | * | arnetheduck quit (Remote host closed the connection) |
23:02:49 | * | arnetheduck joined #nim |
23:04:06 | * | yglukhov joined #nim |
23:07:46 | * | chrisheller joined #nim |
23:08:57 | * | yglukhov quit (Ping timeout: 276 seconds) |
23:09:47 | * | gokr quit (Quit: Leaving.) |
23:10:01 | * | gokr joined #nim |
23:11:36 | * | Sembei quit (Read error: Connection reset by peer) |
23:12:45 | * | Sembei joined #nim |
23:17:51 | * | gokr quit (Quit: Leaving.) |
23:18:03 | * | gokr joined #nim |
23:19:44 | * | cnu- quit (Ping timeout: 258 seconds) |
23:28:45 | * | yglukhov joined #nim |
23:33:39 | * | yglukhov quit (Ping timeout: 276 seconds) |
23:37:07 | * | brson quit (Quit: leaving) |