00:02:15 | * | der-landgraf joined #nim |
00:11:13 | * | kulelu88 joined #nim |
00:12:58 | * | yglukhov joined #nim |
00:17:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
01:03:12 | * | gugugaga is now known as punisher |
01:03:53 | onionhammer | when will nim compile to web assembly? |
01:03:55 | onionhammer | ;) |
01:16:25 | * | punisher quit (Quit: thinking about getting a znc) |
01:47:47 | * | zodiak joined #nim |
01:49:30 | * | ics joined #nim |
02:15:02 | * | yglukhov joined #nim |
02:20:18 | * | yglukhov quit (Ping timeout: 244 seconds) |
02:21:30 | * | zodiak quit (Ping timeout: 258 seconds) |
02:33:02 | * | zodiak joined #nim |
02:52:19 | * | PMunch quit (Quit: leaving) |
03:05:30 | * | filwit quit (Quit: Konversation terminated!) |
03:16:24 | * | kulelu88 quit (Quit: Leaving) |
03:36:12 | * | kseg joined #nim |
03:38:12 | * | yglukhov joined #nim |
03:40:33 | * | kseg quit (Ping timeout: 240 seconds) |
03:43:06 | * | yglukhov quit (Ping timeout: 276 seconds) |
04:59:57 | * | yglukhov joined #nim |
05:05:00 | * | yglukhov quit (Ping timeout: 276 seconds) |
05:10:51 | * | Demon_Fox quit (Remote host closed the connection) |
05:21:34 | * | bjz joined #nim |
05:21:37 | * | bjz_ quit (Ping timeout: 244 seconds) |
05:44:00 | * | gugugaga joined #nim |
05:48:42 | * | arnetheduck joined #nim |
05:54:30 | * | bjz_ joined #nim |
05:55:40 | * | bjz quit (Ping timeout: 264 seconds) |
06:00:54 | * | bjz joined #nim |
06:03:22 | * | bjz_ quit (Ping timeout: 252 seconds) |
06:04:26 | * | fastrom joined #nim |
06:12:36 | * | fastrom quit (Quit: Leaving.) |
06:23:06 | * | yglukhov joined #nim |
06:28:04 | * | yglukhov quit (Ping timeout: 264 seconds) |
07:04:49 | * | ics quit (Quit: Connection closed for inactivity) |
07:13:57 | * | yglukhov joined #nim |
07:15:24 | * | sheerun joined #nim |
07:18:14 | * | yglukhov quit (Ping timeout: 244 seconds) |
07:30:36 | * | sheerun quit (Read error: Connection reset by peer) |
07:37:47 | * | kseg joined #nim |
07:42:50 | * | kseg quit (Ping timeout: 272 seconds) |
07:43:30 | * | TheLemonMan joined #nim |
07:51:11 | * | Arrrr joined #nim |
08:03:11 | * | gugugaga is now known as TheGreatGudsby |
08:10:20 | * | der-landgraf quit (Ping timeout: 258 seconds) |
08:15:44 | * | gokr joined #nim |
08:30:28 | * | Matthias247 joined #nim |
08:31:07 | * | der-landgraf joined #nim |
08:31:40 | * | gokr quit (Ping timeout: 264 seconds) |
08:32:57 | * | der-landgraf quit (Excess Flood) |
08:35:17 | * | der-landgraf joined #nim |
08:40:16 | * | der-landgraf quit (Excess Flood) |
08:42:37 | * | der-landgraf joined #nim |
08:47:56 | * | rok joined #nim |
08:48:06 | * | rok is now known as rok_ |
09:01:20 | * | TheGreatGudsby is now known as LowLifePerv |
09:09:05 | * | LowLifePerv quit (Quit: thinking about getting a znc) |
09:31:39 | * | nsf quit (Quit: WeeChat 1.4) |
09:35:58 | * | rok_ quit (Quit: rok_) |
09:41:32 | * | rok joined #nim |
09:41:42 | * | rok is now known as rok_ |
09:45:32 | * | rok_ quit (Client Quit) |
09:48:05 | * | rok joined #nim |
09:48:15 | * | rok is now known as rok_ |
09:56:51 | * | der-landgraf quit (Ping timeout: 244 seconds) |
10:01:53 | * | der-landgraf joined #nim |
10:11:34 | * | rok_ quit (Quit: rok_) |
10:15:14 | * | rok joined #nim |
10:15:24 | * | rok is now known as rok_ |
10:18:41 | * | der-landgraf quit (Ping timeout: 240 seconds) |
10:21:44 | * | rok_ quit (Quit: rok_) |
10:23:21 | * | rok joined #nim |
10:23:32 | * | rok is now known as rok_ |
10:27:43 | Araq_ | onionhammer: I cannot een figure out how to allocate a struct on the stack in WebAssembly. |
10:28:04 | Araq_ | This thing is just too immature for anything. |
10:28:29 | Araq_ | would love to write a codegen for it though once it's more fleshed out, seems really sweet |
10:29:02 | Araq_ | I see lots of good design in it. |
10:29:48 | dom96 | Yeah, until its design is finalised I don't think there is a point to writing a code gen for it. |
10:31:52 | Araq_ | ah no I'm wrong: https://github.com/WebAssembly/design/blob/master/Rationale.md |
10:32:12 | Araq_ | explains the codegen is supposed to implement a stack on its own ... hmmm |
10:32:14 | dom96 | This is pretty cool https://webassembly.github.io/demo/ |
10:32:21 | dom96 | The asm.js fallback works pretty well |
10:33:11 | dom96 | Now that Araq_ is excited I bet this won't take long :P |
10:38:04 | Araq_ | you know what's most exciting about it? that it's not fucking text, this means no dumb string munging in the compiler which got tiresome |
10:40:01 | TheLemonMan | is the webassembly bitcode re-processed and optimized ? |
10:45:55 | Araq_ | TheLemonMan: it's compressed in 2 or 3 layers |
10:46:11 | Araq_ | and yeah, it's re-processed and optimized |
10:46:39 | Araq_ | but if the compiler needs to manage the stack pointer, how can there be interop between the languages? |
10:47:23 | TheLemonMan | why do you need to manipulate the SP ? |
10:47:40 | Araq_ | seems like a big oversight, I need to use the same compiler for every library |
10:47:58 | Araq_ | the SP is required to pass structs to functions, for example. |
10:48:19 | Araq_ | and the caller and callee better agree on what the SP *is* |
10:48:34 | Araq_ | WebAssembly seems silent about it. |
10:49:03 | TheLemonMan | everything's heap allocated and everything's passed byref :D |
10:49:07 | dom96 | Might be a good idea to go to w3's IRC and ask them about this |
10:58:23 | * | rok_ quit (Quit: rok_) |
10:59:16 | * | rok joined #nim |
10:59:27 | * | rok is now known as rok_ |
11:04:13 | * | Sembei joined #nim |
11:26:52 | * | der-landgraf joined #nim |
11:37:32 | * | der-landgraf quit (Ping timeout: 260 seconds) |
11:39:14 | * | kseg joined #nim |
11:40:11 | * | der-landgraf joined #nim |
11:43:47 | * | aziz joined #nim |
11:44:06 | * | kseg quit (Ping timeout: 276 seconds) |
11:51:54 | * | aziz quit (Ping timeout: 258 seconds) |
11:53:08 | * | der-landgraf quit (Quit: WeeChat 1.5) |
11:54:08 | * | der-landgraf joined #nim |
12:26:37 | * | |meta joined #nim |
12:52:40 | * | der-landgraf quit (Ping timeout: 260 seconds) |
12:56:09 | * | der-landgraf joined #nim |
13:18:45 | * | mcc joined #nim |
13:21:49 | mcc | Hello... I'm starting to look at nim... I will probably have some questions... my main question atm is I am trying to understand the difference between a line which ends with a colon and is followed by an indented line, and a line which just cuts off and is followed by an indented line... |
13:22:24 | mcc | what is "var\n\tx\n\ty" equivalent to? |
13:22:35 | mcc | oh wait i forgot tabs are banned. hopefully you get what i meant. |
13:25:04 | kier | I believe it's equivalent to "var x\nvar y" (though I could be wrong) |
13:25:30 | flyx | mcc: more indented blocks after colons are statement lists. i.e. after an if statement with a colon, the following more indented block is a child of that if statement |
13:26:10 | flyx | mcc: more indented blocks without a colon are special constructs. e.g. `var` starts a block where only variables can be declared, and `type` starts a block where only types can be declared |
13:26:16 | mcc | kier: okay. can i do that with any statement or are "var" and "const" special? Like if the function "listAdd" has side effects, could I say "listAdd\n\t3\n\t4" ? |
13:26:28 | flyx | these do not introduce statement lists and therefore are not started with a colon |
13:27:10 | mcc | flyx: okay. can user-created constructs ever take advantage of either the "indent, no colon" or "indent, with colon" syntax? |
13:27:28 | mcc | flyx: and would you say then my heuristic for "do i need a colon?" is "is the thing inside the indented block ordinary code"? |
13:27:32 | kier | mcc: you can only do this behaviour with the language constructs like 'var', 'let', 'const', 'type', not user created methods |
13:28:01 | kier | s/methods/procs/ |
13:28:06 | flyx | mcc: no. you can create user-defined macros which can be called with a more indented statement block, but this is not possible for blocks without colon |
13:28:43 | mcc | this helps a lot, thanks |
13:33:08 | mcc | one unrelated question. if i filed a github issue on the nim project suggesting the main site should use HTTPS, do you think this would come off as a jerky thing to do? :) it is just a little alarming to be downloading binaries from an HTTP site, there is no way to tell if they are getting modified in transit. |
13:34:07 | mcc | or would there be a better way to send in comments on the *website* than the github issues page? |
13:34:27 | flyx | mcc: I believe the right place to discuss something like this would be the forum, not the github issue tracker |
13:35:36 | kier | is the site backed by a github repo? |
13:39:09 | * | der-landgraf quit (Ping timeout: 276 seconds) |
13:39:34 | mcc | ok |
13:40:18 | mcc | hopefully it's not backed by a github repo since github pages doesn't do ssl :( |
13:49:43 | * | rok_ quit (Quit: rok_) |
13:49:58 | flyx | mcc: they don't? https://flyx.github.io/NimYAML |
13:50:41 | mcc | oh! sorry. you can't use a custom URL on github pages with HTTPS. |
13:51:11 | mcc | but https directly to github.io like that works, yeah, i'd forgotten |
13:51:21 | flyx | well you can still have your page's source on github, but host it yourself |
13:51:25 | * | rok joined #nim |
13:51:36 | * | rok is now known as rok_ |
13:51:54 | flyx | but afaik nim-lang.org is not no github |
13:55:19 | * | nsf joined #nim |
13:57:35 | mcc | is nimble distributed with nim or is it separate |
13:58:46 | mcc | looks like separate sorry |
13:59:29 | mcc | weird why does nimble need its own checkout of nim |
14:07:41 | federico3 | mcc: yep, that's unfortunate |
14:08:02 | mcc | does it install its custom-built nim into .nimble or something? |
14:08:34 | federico3 | nope |
14:12:18 | mcc | will nimble freak out if nim is not in PATH? its build script complained that it was not |
14:19:50 | mcc | eh, i added it anyway |
14:26:42 | * | PMunch joined #nim |
14:38:34 | * | TheLemonMan quit (Remote host closed the connection) |
14:53:34 | * | rok_ quit (Quit: rok_) |
15:00:11 | * | fastrom joined #nim |
15:00:16 | * | TheLemonMan joined #nim |
15:08:45 | mcc | don't suppose you'd know-- the sdl2 nimble package when run on mac seems to want to load dylibs, but sdl2 is distributed as a bunch of frameworks last i checked. any idea where to get the dylibs from? |
15:18:31 | flyx | mcc: homebrew or nix |
15:19:08 | flyx | possibly also fink or macports if you prefer those |
15:19:20 | flyx | (and they're still alive, I haven't checked for a long time) |
15:37:25 | dom96 | hello mcc! Regarding SSL for the website: it's on our todo list :) |
15:38:31 | mcc | dom96: ah ok, good to hear |
15:39:21 | mcc | dom96: if you run your own server the letsencrypt tools make it really easy, it took me like one evening to set it up on mine |
15:40:42 | J3RN | I can also vouch for the ease of using the Letsencrypt tools, FWIW |
15:40:46 | * | kseg joined #nim |
15:42:02 | * | yglukhov joined #nim |
15:42:31 | dom96 | Yep. I plan to use that. |
15:45:21 | * | kseg quit (Ping timeout: 258 seconds) |
15:45:21 | * | yglukhov quit (Read error: Connection reset by peer) |
15:45:37 | * | yglukhov joined #nim |
15:47:50 | mcc | I mean I had to fight with bizarre error messages for three hours or so, but |
15:47:56 | mcc | I only had to do it once ^_^ |
15:59:51 | dom96 | "really easy" might be a bit of an exaggeration then? :P |
16:10:31 | * | xet7 joined #nim |
16:17:51 | mcc | "easy by linux standards" |
16:18:14 | mcc | "when i googled the error messages i found results" |
16:18:19 | * | yglukhov quit (Remote host closed the connection) |
16:27:46 | tautologico | there's a letsencrypt client by the EFF that's supposed to be good |
16:27:52 | * | yglukhov joined #nim |
16:34:03 | * | PMunch_ joined #nim |
16:34:05 | * | PMunch quit (Read error: Connection reset by peer) |
16:35:17 | * | PMunch_ is now known as PMunch |
16:36:11 | * | vendethiel joined #nim |
16:40:45 | * | Demon_Fox joined #nim |
16:58:05 | * | filwit joined #nim |
17:00:18 | * | yglukhov quit (Remote host closed the connection) |
17:18:04 | * | yglukhov joined #nim |
17:34:11 | * | yglukhov quit (Remote host closed the connection) |
17:41:37 | * | kseg joined #nim |
17:46:16 | * | kseg quit (Ping timeout: 252 seconds) |
18:23:31 | * | flyx uses acmetool, a go letsencrypt client that's really painless to use. |
18:29:36 | * | vendethiel quit (Ping timeout: 246 seconds) |
18:47:13 | * | LowLifePerv joined #nim |
18:55:01 | mcc | okay. so i have the line: render.setDrawColor( frame mod 256, 0, 0, 255 ) , using the sdl2 nimble |
18:55:19 | mcc | and i get the error: main.nim(29, 9) Error: type mismatch: got (RendererPtr, range -255..255(int), int literal(0), int literal(0), int literal(255)) … but expected one of: … sdl2.setDrawColor(renderer: RendererPtr, r: uint8, g: uint8, b: uint8, a: uint8) … sdl2.setDrawColor(renderer: RendererPtr, c: Color) |
18:55:35 | mcc | how do i interpret this? |
18:56:50 | mcc | n/m i added a uint8() and it got less unhappy |
18:59:38 | * | rok joined #nim |
18:59:49 | * | rok is now known as rok_ |
19:02:22 | mcc | okay, here is a question though |
19:02:26 | mcc | i have the line: needDelay = targetTpf - (tick-lastFrameAt) |
19:06:14 | dom96 | mcc: what's the question? : |
19:06:15 | dom96 | :) |
19:06:56 | * | dom96 wonders why there are so many letsencrypt clients out there |
19:07:03 | mcc | well |
19:07:24 | mcc | so tick and lastFrameAt are both uint32s |
19:07:30 | mcc | and targetTpf is an int |
19:07:31 | mcc | but |
19:07:37 | mcc | What if I *want* targetTpf to be an int? |
19:07:43 | mcc | Like, what if I want the difference between two unsigned ints |
19:07:58 | mcc | and then i want to change it to an int? |
19:08:13 | mcc | basically, if you say int (someUnsignedInt), how does it do the conversion? |
19:08:23 | mcc | dom96: also part of the problem is that the most popular letsencrypt client changed its name, i think |
19:09:19 | dom96 | after you do the conversion I think it just interprets the data differently |
19:09:57 | dom96 | I don't think it costs much |
19:09:59 | mcc | Also, if I do the casting it wants, i later say : if need_delay > 0: |
19:10:18 | mcc | and it says: lib/system.nim(357, 5) Error: type mismatch: got (int literal(0), uint) but expected one of... |
19:10:27 | mcc | wait, what, you can't do > on an unsigned integer? D: |
19:11:41 | dom96 | I think you need to do: if need_delay > 0'u: |
19:13:06 | dom96 | I do think that this shouldn't be necessary though. I don't think Araq_ agrees though. |
19:13:22 | mcc | guh |
19:13:25 | mcc | okay, one more question |
19:13:31 | mcc | so i wind up doing: needDelay:uint32 = uint32(targetTpf - (tick-lastFrameAt)) |
19:13:46 | dom96 | You don't need the ':uint32' |
19:14:25 | dom96 | it might be easier for you to just use ints everywhere |
19:17:23 | mcc | well, i'm using a library which uses uints |
19:17:30 | mcc | so i don't necessarily have that choice |
19:17:43 | mcc | it would be nice if there were just a auto-cast operator or something |
19:18:03 | mcc | like the type solver already knows uint32 is needed in a particualr place, say !ticks to automatically cast to whatever the type solver figures is needed there |
19:21:42 | * | gokr joined #nim |
19:25:03 | * | Sembei quit (Quit: WeeChat 1.5-dev) |
19:30:51 | filwit | mcc: you can define your own auto-cast operators using 'converter' |
19:31:54 | mcc | ok, cool |
19:32:18 | filwit | mcc: reference: http://nim-lang.org/docs/intern.html#frontend-issues-methods-and-type-converters |
19:40:22 | mcc | thanks |
19:41:25 | * | Arrrr quit (Quit: WeeChat 1.4) |
19:51:54 | tautologico | how can I allocate an unsigned char array and pass the pointer to a C function? |
19:53:37 | filwit | tautologico: var x = newSeq[char](someSize); someCFunc(addr x[0]) |
19:54:54 | tautologico | filwit: thanks |
20:10:21 | tautologico | where is the documentation about interfacing with C? the backend integration doc has too little information |
20:11:49 | mcc | Let's say my program has the line "var evt = sdl2.defaultEvent". How can I find out what type evt is? |
20:12:49 | fowl | import typetraits; echo evt.type.name |
20:14:24 | mcc | ok |
20:14:37 | filwit | tautologico: http://nim-lang.org/docs/manual.html#foreign-function-interface |
20:14:44 | mcc | i wonder how hard it would be to add that to nimlime or whatever this sublime text plugin is called... |
20:15:41 | tautologico | a bit scarce on details but ok |
20:15:54 | tautologico | I think I'll install c2nim |
20:18:16 | mcc | so i say: var onDraw : proc(); if onDraw != nil: onDraw() |
20:18:24 | mcc | This gives me the warning "Not GC safe [gcUnsafe]" |
20:18:26 | mcc | what do I make of this? |
20:20:19 | filwit | mcc: a guess: You're passing a GC'ed seq to a C function? That's a potential memory bug, since the GC can't know if the C end of things maintains that pointer for longer than the object lives |
20:20:42 | mcc | those were the only uses of onDraw in the application |
20:22:10 | filwit | sorry, I'm confused about what your code looks like.. and I'm not entirely sure about the details of that warning either.. so just guessing |
20:25:19 | mcc | ok |
20:25:36 | mcc | so in module A i have "var onDraw : proc()" |
20:26:18 | mcc | and "var onEvent : proc(evt:Event)" |
20:26:26 | mcc | and in module B i import module A then say "onEvent = proc(evt) = [newline, indent] echo (evt)" |
20:26:29 | mcc | it doesn't like that |
20:27:24 | dom96 | I think that warning only matters when using threads http://nim-lang.org/docs/manual.html#threads-gc-safety |
20:28:19 | mcc | what is the correct way to assign a procedure value to a variable? |
20:29:24 | fowl | proc(evt) is a generic function |
20:29:46 | filwit | ^ you need to do: proc(evt:Event) = ... |
20:29:59 | mcc | ok |
20:30:18 | filwit | or perhaps it's not 'needed'.. i'm not sure.. |
20:30:26 | mcc | it's now complaining about modules... if i put it in module A it works fine... in module B it says "onEvent cannot be assigned to" |
20:30:27 | filwit | but could be :P |
20:31:32 | filwit | hmm.. yeah i forgot.. i think there's a pragma you need.. like .procvar? or .threadlocal? anyone know? |
20:33:00 | dom96 | mcc: can you gist your code? |
20:34:10 | Araq_ | mcc: export the var via * |
20:34:28 | Araq_ | and annotate the proc type with {.gcsafe.} |
20:35:46 | mcc | That did it thanks! |
20:59:04 | tautologico | how can I get ptr cuchar from a seq[cuchar] ? |
21:01:12 | Araq_ | tautologico: seq[cuchar] is already wrong, most of the time. just use a 'string'. 'ptr cuchar' is also wrong, it should be 'cstring'. |
21:02:15 | tautologico | ok, I was using c2nim to help me interface with some C code |
21:02:27 | tautologico | I have a function that expects a unsigned char * |
21:05:02 | tautologico | I have a seq[Rgb] in the nim code, where Rgb is a tuple of floats representing a color |
21:05:48 | tautologico | I have to convert the floats to a 0-255 value anyway (and add an alpha channel, expected by the C code), but I still don't know how to create the data to pass to the C function |
21:06:53 | * | fastrom quit (Quit: Leaving.) |
21:07:09 | * | LowLifePerv quit (Quit: thinking about getting a znc) |
21:08:03 | Araq_ | addr(s[0]) |
21:08:29 | Araq_ | that's widely know. :P |
21:08:46 | Araq_ | *known |
21:09:11 | tautologico | yeah, that's what filwit told me earlier, so I created a seq[cuchar] |
21:09:30 | cheatfate | what is best way to check if header available or function in headers present? |
21:09:35 | cheatfate | with nim |
21:10:06 | tautologico | now I get "expression has no address" |
21:10:31 | Araq_ | tautologico: then use unsafeAddr |
21:10:46 | Araq_ | but consider to change your code :P |
21:11:29 | Araq_ | cheatfate: there is no way. Nim doesn't know. you can 'staticExec' GCC with small C programs like autoconf does. |
21:11:51 | Araq_ | and staticExec even supports caching for this use case. |
21:14:46 | cheatfate | because solaris before version 10 has only "/dev/poll" but after 10 it received event ports... |
21:17:29 | Araq_ | just let solaris die :P |
21:17:44 | cheatfate | :) |
21:17:58 | cheatfate | i like name "solaris" :) |
21:18:22 | tautologico | it works :) |
21:19:25 | * | filwit_ joined #nim |
21:20:12 | * | filwit_ quit (Client Quit) |
21:22:30 | * | filwit quit (Ping timeout: 260 seconds) |
21:22:35 | dom96 | nah guys, we need to support everything. How's our RISC OS/Haiku/Plan 9 support? :P |
21:22:45 | tautologico | BeOS |
21:23:05 | tautologico | I guess Haiku originated from BeOS? |
21:23:21 | Araq_ | I ported it to Haiku once :P |
21:24:01 | Araq_ | wasn't hard, just had to patch some configs and to add Haiku to the list of known OSes |
21:24:36 | * | der-landgraf joined #nim |
21:24:55 | tautologico | so, for random numbers, should I just use the mersenne module? |
21:26:07 | dom96 | the random/math module |
21:27:00 | * | Trustable joined #nim |
21:27:56 | tautologico | there's math/mersenne, I don't see random |
21:28:25 | tautologico | in the stdlib docs |
21:30:47 | dom96 | it's not in 0.13.0 |
21:31:12 | tautologico | devel then? |
21:31:36 | dom96 | just use math for now |
21:32:21 | dom96 | the random procs were recently moved into a random module, but they are the same |
21:32:30 | kier | anyone know of any existing tools for writing structured parsers (along the lines of lex/yacc or parser combinators)? |
21:33:53 | Araq_ | kier: I wrote 'lexim' to generate lexers but it's not tested well |
21:34:23 | Araq_ | had no use for it for now |
21:35:46 | * | rok_ quit (Remote host closed the connection) |
21:37:10 | kier | Araq_: looks interesting, might have a play around with it |
21:37:44 | Araq_ | there is also the new undocumented strscans.scanp |
21:40:31 | Araq_ | cheatfate: can you fix this please? https://github.com/nim-lang/Nim/issues/3059 I got no bsd to test on |
21:41:25 | cheatfate | Araq_, ok |
21:43:10 | * | kseg joined #nim |
21:47:04 | Araq_ | ty |
21:47:23 | Araq_ | we also need to talk about memory management |
21:47:24 | * | kseg quit (Ping timeout: 250 seconds) |
21:48:03 | Araq_ | cause once async is multi-core ready we can replace the GC with --gc:stack, I think and gain further speed |
21:59:12 | cheatfate | Araq_, right now i can't invent test unit to test multithreading... |
21:59:26 | cheatfate | to test structures |
22:02:52 | * | gokr quit (Ping timeout: 260 seconds) |
22:04:54 | cheatfate | Araq_, about #3059 looks like FreeBSD and OpenBSD dont have "timezone" as integer... but they have function `char* timezone(int zone, int dst)` |
22:05:25 | Araq_ | I don't remember why we need to mess with timezones |
22:05:36 | cheatfate | if i'm correct `timezone` is number of seconds from UTC |
22:05:45 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
22:06:22 | Araq_ | just hack something together that works and/or leaves me alone with this non-standardized archaic bullshit |
22:06:57 | Araq_ | even a 'when not defined(bsd)' is fine with me. :P |
22:11:03 | cheatfate | The Single UNIX Specification carried this forward, but implementations were weak and defective. POSIX.1-2001/SUSv3 said that the contents of the timezone and dstflag fields are unspecified and should not be relied on. POSIX.1-2008/SUSv4 removed ftime(3) entirely. The archaic tzset(3) interface remains. |
22:11:03 | cheatfate | Final warning: some BSD Unixes do not implement timezone at all! |
22:11:09 | cheatfate | I like unix :) |
22:17:00 | Araq_ | as much as I like DOS ;-) |
22:17:05 | * | filwit joined #nim |
22:19:37 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:30:36 | * | Trustable quit (Remote host closed the connection) |
22:32:04 | cheatfate | dont blame on DOS it was the most hackable OS |
22:32:08 | cheatfate | :) |
22:33:03 | cheatfate | i loved programming TSR programs |
22:34:03 | tautologico | int 21h |
22:34:19 | tautologico | TSR programs, now there's something I didn't hear in ages |
22:46:17 | * | bjz joined #nim |
22:49:05 | filwit | anyone know what the Nim equivalent of PHP's $_FILES[...] would be? |
22:55:41 | * | der-landgraf quit (Ping timeout: 240 seconds) |
22:58:00 | * | der-landgraf joined #nim |
22:58:00 | * | der-landgraf quit (Changing host) |
22:58:01 | * | der-landgraf joined #nim |
22:58:41 | Araq_ | filwit: ? how come you know about PHP? |
22:59:42 | dom96 | filwit: are you using Jester? |
23:00:17 | filwit | dom96: no, asynchttpserver |
23:00:23 | filwit | Araq: eh? |
23:00:46 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:00:55 | dom96 | filwit: I would suggest using Jester if you can: https://github.com/dom96/jester/blob/master/tests/fileupload.nim |
23:01:13 | filwit | trying to see if I should serialize an JS image and pass that across myself, or if I should use the <input type="file" ...> way |
23:01:45 | filwit | dom96: okay I'll look into that more |
23:01:55 | filwit | thanks |
23:02:28 | filwit | okay, cool :) That looks very nice |
23:02:45 | filwit | what's the performance of Jester these days? |
23:03:07 | dom96 | Good question :P |
23:04:02 | filwit | I was trying to avoid Jester as a database backend because I read somewhere it's performance wasn't as good as some others (not sure where, or how accurate that was, or even what kind of tests they where doing) but was thinking I'd try to avoid as much overhead as possible. |
23:04:36 | dom96 | I don't think it adds much overhead |
23:04:47 | dom96 | the problem is that asynchttpserver could use a speed up itself |
23:04:48 | filwit | However, getting this done fast is more a priority for me then getting it done perfect, so I guess go with Jester for this |
23:04:55 | dom96 | but then again, I haven't done any proper benchmarks |
23:05:16 | dom96 | and yes, premature optimisation is the root of all evil :) |
23:06:05 | Araq_ | there have a couple of iterations on async http server's performance |
23:06:19 | Araq_ | it's not something to concerned about, IMHO. |
23:06:31 | dom96 | yeah, it should be good. |
23:06:37 | Araq_ | benchmarks these days mostly test for "what if I were Google" |
23:06:45 | filwit | yeah, it's just we have an existing product running on C#/MSSQL servers and I didn't want it to be _slower_ when I make my argument for going this rout to my partner |
23:07:27 | filwit | but in general I'm in total agreement with you, and I doubt I'll loose much of any performance using Jester |
23:07:42 | Araq_ | MSSQL is so slow, it's not hard to beat |
23:07:50 | filwit | good to here :) |
23:08:01 | Araq_ | but I guess you will stick to that? |
23:08:35 | filwit | not if I can help it |
23:09:03 | Araq_ | and it's spelt "hear". why did you make this mistake? because you use the *sound* of words in your head, esp as a native speaker. |
23:09:11 | dom96 | filwit: feel free to ping me (or even email me) if you have any questions about jester/async |
23:09:31 | Araq_ | and that's why case sensitivity is so very much against how human brains work. |
23:09:43 | Araq_ | but that's a story for another time :P |
23:09:50 | dom96 | Araq_: don't be rude |
23:09:55 | filwit | Araq: yes, i often try to type too quickly and just type the more commonly used word for the sound |
23:10:06 | Araq_ | I am not rude, am I? |
23:10:14 | dom96 | you are a bit :P |
23:10:28 | filwit | dom96: thanks, I'll will ping you when i have questions |
23:10:45 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:11:13 | filwit | Araq: I don't find you rude, personally.. I don't mind direct questions like that |
23:11:35 | Araq_ | I can see no rudeness. I just use your typo to make a point. |
23:12:07 | filwit | yep. |
23:12:18 | dom96 | well then perhaps I am rude, apologies |
23:12:44 | filwit | god dom.. so rude :P |
23:13:59 | mcc | so i tried to echo() a C struct and I got "main.nim(5, 8) template/generic instantiation from here… lib/system.nim(2301, 19) Error: undeclared field: 'padding'" ... I don't think I necessarily *expect* that to have worked... but it seems *close* to working, is there a trick to this that would allow it to print out a c struct of my choice? |
23:14:00 | filwit | jester is on Nimble, or should I use Github/master? |
23:14:07 | filwit | ^ dom96 |
23:14:10 | dom96 | nimble |
23:14:13 | filwit | k |
23:14:20 | dom96 | you can grab master using nimble too |
23:14:43 | dom96 | and Nimble will grab it automatically because I haven't tagged a version of Jester yet |
23:14:45 | filwit | yeah i was mostly just asking which version i should be using with a devel compiler |
23:14:51 | dom96 | (something which I really need to do) |
23:14:59 | filwit | oh, okay |
23:15:34 | Araq_ | mcc: unfortunately not, but it has been requested, so please create a feature request |
23:15:45 | Araq_ | I have an idea of how to make it work |
23:15:59 | Araq_ | *has been requested a few times |
23:16:25 | mcc | Cool. Are feature requests filed on the github? |
23:17:01 | * | LowLifePerv joined #nim |
23:17:07 | Araq_ | why do you think we have 750 open issues? :P |
23:17:22 | Araq_ | Nim has no bugs, only feature requests. *cough* |
23:17:56 | filwit | dom96: does Jester support caching? or is that not something more relevent to nginx? |
23:18:01 | mcc | Thanks |
23:19:04 | dom96 | filwit: more to do with nginx, although I think there is some caching support |
23:20:37 | mcc | one more very silly question... is there a good "noop" statement in nim, analagous to python "pass"? i'm currently using "discard 0" |
23:20:50 | def- | mcc: just discard |
23:21:07 | mcc | 'k |
23:21:09 | def- | (without a parameter) |
23:21:12 | filwit | oh, and how do I properly shutdown a running Jester/asyncHttpServer process? I've tried the close() method but doesn't seem to stop every stop the async dispatch event loop |
23:21:13 | mcc | ohh |
23:21:20 | filwit | dom96 ^^ |
23:21:49 | dom96 | filwit: why do you want to shut it down? |
23:21:51 | filwit | er.. *ever* stop the async.. |
23:22:03 | filwit | to close the db connection? |
23:22:19 | filwit | I guess there could just be a rout for that.. |
23:22:26 | filwit | or maybe it doesn't matter? |
23:22:40 | filwit | Just wanted to know if there was a better way then just killing the process |
23:23:12 | * | fastrom joined #nim |
23:24:36 | Araq_ | use addQuitProc to ensure the db connection is closed at shutdown |
23:24:42 | Araq_ | that's the best you can do. |
23:24:55 | filwit | ah, okay thanks |
23:28:41 | filwit | Araq: question about that in general actually, how much overhead does a db open/close step take? Should I open the db once in the beginning and shutdown on quitMsg? or open/close per rout command? |
23:32:05 | filwit | guess I should just benchmark it to be sure.. |
23:32:17 | dom96 | open once |
23:32:30 | dom96 | What benefit would opening/closing have? |
23:33:17 | filwit | i can't imagine any, but my experience managing SQL tables is limited.. so I want to know if there's any pitfalls with doing that is all |
23:33:29 | filwit | sounds like there isn't, which is good. thanks |
23:34:19 | Araq_ | good question, I never benchmarked it. the overhead cannot be too high, the database runs all the time anyway |
23:34:33 | Araq_ | and keeps its caches for other connectors |
23:35:58 | filwit | k |
23:55:30 | * | kseg joined #nim |