00:15:58 | * | vendethiel quit (Ping timeout: 248 seconds) |
00:17:17 | * | desophos quit () |
00:17:47 | * | enthus1ast quit (Read error: No route to host) |
00:19:13 | * | enthus1ast joined #nim |
00:58:36 | * | desophos joined #nim |
01:03:47 | * | alexsystemf_ quit (Quit: Connection closed for inactivity) |
01:21:30 | * | vendethiel joined #nim |
01:31:42 | * | brson quit (Quit: leaving) |
01:42:54 | * | vendethiel quit (Ping timeout: 248 seconds) |
01:54:04 | * | oceanpollen quit (Ping timeout: 244 seconds) |
01:55:03 | * | oceanpollen joined #nim |
02:11:40 | * | vendethiel joined #nim |
02:27:11 | * | veganskaway is now known as vegansk |
02:33:34 | * | vendethiel quit (Ping timeout: 240 seconds) |
02:44:08 | * | ephja quit (Ping timeout: 244 seconds) |
03:03:59 | * | chrisheller quit (Remote host closed the connection) |
03:11:12 | * | chrisheller joined #nim |
03:32:23 | * | Jesin quit (Quit: Leaving) |
04:02:47 | * | vendethiel joined #nim |
04:24:03 | * | vendethiel quit (Ping timeout: 246 seconds) |
04:33:56 | * | endragor joined #nim |
04:43:29 | * | vendethiel joined #nim |
05:05:11 | * | vendethiel quit (Ping timeout: 250 seconds) |
05:21:22 | * | desophos quit (Read error: Connection reset by peer) |
06:03:06 | * | gokr joined #nim |
06:22:30 | * | endragor_ joined #nim |
06:26:45 | * | endragor quit (Ping timeout: 276 seconds) |
06:43:01 | * | endragor_ quit (Remote host closed the connection) |
06:43:30 | * | endragor joined #nim |
06:43:59 | * | vendethiel joined #nim |
07:12:22 | * | Trustable joined #nim |
07:18:22 | * | vendethiel quit (Ping timeout: 248 seconds) |
07:37:51 | * | PMunch joined #nim |
07:44:31 | * | Demon_Fox quit (Quit: Leaving) |
07:45:37 | * | yglukhov joined #nim |
07:46:37 | * | dorei joined #nim |
08:15:12 | cheatfate | we have troubles with atomic operations on bsd |
08:15:18 | cheatfate | we have troubles with atomic operations on openbsd |
08:16:22 | cheatfate | https://gist.github.com/cheatfate/390ec948a29525543b3ddb71122fb204 |
08:18:23 | cheatfate | any compilation with "--threads:on" on openbsd results in an error |
08:22:13 | cheatfate | github is down? |
08:31:31 | * | wuehlmaus quit (Read error: Connection reset by peer) |
08:32:19 | cheatfate | github is down: We are experiencing connectivity issues and are currently investigating. |
08:48:19 | vegansk | cheatfate, hi. you are not alone :-) |
08:54:46 | cheatfate | github: |
08:54:46 | cheatfate | 11:48 FLE Standard Time |
08:54:46 | cheatfate | Major service outage. |
08:59:59 | gokr | hum |
09:12:10 | * | ephja joined #nim |
09:16:46 | * | yglukhov quit (Ping timeout: 248 seconds) |
09:17:23 | cheatfate | github is fine now |
09:18:34 | * | yglukhov joined #nim |
09:19:01 | * | yglukhov quit (Remote host closed the connection) |
09:31:36 | vegansk | cheatfate, please check this comment: https://github.com/nim-lang/Nim/pull/4000#issuecomment-205639867 |
09:31:39 | * | elrood joined #nim |
09:32:23 | cheatfate | vegansk, i think github is down again |
09:33:20 | vegansk | cheatfate, the PR #4000 is too hard for github :-) |
09:33:36 | vegansk | github works for me |
09:34:03 | vegansk | but so slooooow |
09:34:07 | gokr | Yup |
09:35:09 | cheatfate | vegansk, the main problem of 4000 is that some code used in program stub |
09:35:17 | cheatfate | so it was included... |
09:36:08 | cheatfate | but in program stub used only simple acquire/release SystemLock |
09:36:22 | cheatfate | so all other staff can be moved out |
09:39:55 | cheatfate | but you dont want to do this :( |
09:42:01 | * | enthus1ast quit (Read error: No route to host) |
09:44:34 | * | enthus1ast joined #nim |
09:45:28 | * | baff1e quit (Ping timeout: 252 seconds) |
09:46:59 | vegansk | for now, stub uses only small parts of syslocks. what if it will need another parts of it? so we will move the parts from syslocks to locks and back. i think it's a bad idea. it's not a public API, it's an internal part of stdlib and i think that here we can apply hints hiding |
09:48:08 | cheatfate | vegansk, for what reason stub will need more? |
09:49:14 | cheatfate | i dont think stub will be modified in future |
09:49:40 | cheatfate | but i dont want dispute on that, because its Araq's area... |
09:50:10 | * | gokr1 joined #nim |
09:50:31 | cheatfate | i'm just propose to move out all staff not needed for current stub code to avoid this annoying warnings |
09:51:06 | Araq | just disable the warning and move on. work on something more important please. |
09:52:41 | elrood | hm, interestingly dom chose to update nimble's version in the changelog but not in its source |
09:53:36 | cheatfate | Araq, could you please check https://github.com/nim-lang/Nim/issues/4046 |
09:55:23 | Araq | https://people.freebsd.org/~emaste/stdatomic.h ? |
09:55:46 | Araq | maybe it's in some different header. |
09:55:57 | * | pandada8 quit (Ping timeout: 260 seconds) |
09:58:45 | cheatfate | Araq, i did searching for ATOMIC_RELAXED on all headers and there nothing found... |
09:58:57 | dom96 | hello guys |
09:59:16 | cheatfate | dom96, ahoy |
10:00:07 | cheatfate | Araq, it looks like you are using g++ staff... for ATOMIC_RELAXED |
10:00:18 | dom96 | elrood: Not so much "chose" as forgot. |
10:01:03 | dom96 | elrood: 0.7.0 and 0.7.2 are practically the same anyway |
10:02:16 | * | yglukhov joined #nim |
10:02:17 | * | yglukhov quit (Remote host closed the connection) |
10:03:48 | cheatfate | Araq, only staff for atomic operation on openbsd is here [sys/atomic.h] https://github.com/lattera/openbsd/blob/master/sys/sys/atomic.h |
10:05:44 | * | gokr1 left #nim (#nim) |
10:05:44 | Araq | cheatfate: please check what the C and C++ standards say and try to use that |
10:05:56 | * | gokr quit (Remote host closed the connection) |
10:07:37 | cheatfate | Araq, while googling i found only information that openbsd using old libstdc++ so there no atomic staff you using in atomic.nim... other opensource projects just adding [not defined(openbsd)] |
10:08:22 | Araq | time to upgrade your OpenBSD? |
10:10:24 | * | yglukhov joined #nim |
10:10:29 | * | irrequietus joined #nim |
10:10:53 | dom96 | yglukhov: replied to your comments on github |
10:12:08 | * | enthus1ast quit (Read error: No route to host) |
10:12:49 | cheatfate | Araq, https://bugzilla.mozilla.org/show_bug.cgi?id=876156 [libc++ is not ported to openbsd yet] |
10:16:22 | * | fredrik92 joined #nim |
10:17:28 | * | arnetheduck joined #nim |
10:20:43 | Araq | cheatfate: can you use clang on BSD? |
10:22:10 | cheatfate | Araq, i dont think i can use clang because its "OPEN"bsd |
10:23:54 | * | pandada8 joined #nim |
10:25:58 | yglukhov | dom96: i really can't see the reasoning in #3107. The problem is mostly in echo + len i would say. Also there's no ambiguity in Json[], since it returns Json ref only, it can't return 0 or string(nil) or anything that table returns. Anyways, even if you feel like changing this behavior, you could easily add "when not defined(preserveObsoleteJsonBehavior): echo "WARNING! Returning nil in case of missing field is deprecated!" else: do_th |
10:25:58 | yglukhov | e_new_behavior_and_raise |
10:27:05 | yglukhov | to give some time to migrate, and provide some way to catch the remaining bugs |
10:27:40 | dom96 | Sure, I can do that. |
10:28:18 | dom96 | And yes, you're right. There is no ambiguity with Json's `[]`, but I still think we should make it consistent with table's `[]` |
10:31:22 | vegansk | yglukhov, hi. jnim exports imported classes and doesn't export imported methods. i want to create one more ``jnimport`` macro, so one of them will import without reexport, and another with. what do you think? |
10:31:26 | * | pandada8 quit (Ping timeout: 248 seconds) |
10:37:47 | * | ephja quit (Quit: WeeChat 1.4) |
10:40:03 | Araq | dom96: not sure I agree with that consistency requirement. tables.[] mostly raises an exception because of the 'var T' requirement |
10:40:34 | Araq | this way we could get rid of 'mget' which was a constant gotcha |
10:41:14 | Araq | what does Python's Json module do? |
10:41:29 | dom96 | pretty sure it raises an exception |
10:42:01 | dom96 | I think it's also more user-friendly to raise an exception. |
10:47:58 | yglukhov | vegansk: I'm not sure what you mean. Wouldn't it be enough just to handle * appropriately in proc defs? Also i'm a bit concerned with the fact that current class import syntax doesn't account for generated visibility. |
10:49:20 | * | fredrik92 quit (Quit: Moving around between university Wi-Fi Hotspots... :P) |
10:51:11 | yglukhov | Araq, dom96: I don't think python is a good example in our case. Afaik, python uses builtin arrays/dicts to work with json, and all json does is python_obj_to_string_and_back. So the reasoning in obj[] throwing is not dictated only json, but rather the overall language semantics. |
10:51:17 | vegansk | yglukhov, i thought about it. the problem is that in that case (* for procs) i must use something like ``export`` for classes. Wait, i'll create a gist for example |
10:53:29 | * | girvo quit (Ping timeout: 260 seconds) |
10:56:05 | yglukhov | but in nim json is a distinct entity that has nothing to do with tables/arrays. And nim is more typed then python as well. So the only reasoning i can see really is consistency with tables, but here's the thing. Tables are a general purpose data structure, that in many cases may imply existance of a key. While json is not! normally jsons are generated from external (malicious) input, and when working with them you should always(!) acco |
10:56:05 | yglukhov | unt for missing fields. |
10:56:11 | * | girvo joined #nim |
10:58:34 | vegansk | yglukhov, here it is: https://gist.github.com/vegansk/68af805063e50f0d673caa00efbce2d0 . There is a problem for the first option: it's not that fast to refactor all of the imports to export them :-) |
10:58:54 | yglukhov | while key lookup is done more naturally and intuitively with [] operator and not {} or 'getOrDefault', it should be the common pattern as well to account for missing field right after you get it with [] operator |
11:00:07 | * | pandada8 joined #nim |
11:01:18 | yglukhov | vegansk, btw fyi, one of my dreams is doing another jnimportAll (or alike) directive to provide just the qualified class name, and it would automatically import the proc defs in compile time =) |
11:02:59 | * | girvo quit (Ping timeout: 248 seconds) |
11:03:48 | Araq | yglukhov: raising an exception seems to be more convenient than having to handle 'if x != nil' everywhere though. |
11:04:21 | * | fredrik92 joined #nim |
11:04:39 | Araq | and since JSON is the foundation for most REST APIs that are not as dynamic as people think they are, I think I favor raising an exception. |
11:05:36 | vegansk | yglukhov, it's a good idea, and i think that i'll do it. i have some pojos that has dozens of properties and i don't want to write imports manually :-) |
11:08:07 | * | fredrik92 quit (Client Quit) |
11:08:30 | * | fredrik92 joined #nim |
11:08:33 | vegansk | yglukhov, and what about the exports syntax? |
11:08:44 | yglukhov | vegansk, just pushed some of my experiments, maybe take a look when you have some time. |
11:08:55 | yglukhov | 2 mins, commenting your gist |
11:12:50 | yglukhov | commented |
11:13:23 | dom96 | Just added some nice new things into the readme on Github: https://github.com/nim-lang/Nim#readme :) |
11:13:45 | * | girvo joined #nim |
11:16:25 | dom96 | That crown should be an emoji |
11:16:51 | yglukhov | Araq: ok i will not argue a lot about that. I'm fine as long as there remains some short syntax to get nils in case of missing. And thats because most of my code will use it + check for nil, because in most of my cases missing field is a perfectly valid case, and if not, i would like to handle the case right in my deserialization code, and not upstairs through exception. |
11:17:38 | Araq | yglukhov: I agree we need a decent migration strategy though. |
11:17:48 | dom96 | yglukhov: You should be able to just replace `[]` with `{}`. |
11:18:14 | yglukhov | btw, nil dereference exception is one of the killer features im eagerly waiting for ;) |
11:18:39 | yglukhov | it should be optional compilation flag, of course =) |
11:19:00 | yglukhov | then we can do truly unbreakable servers in nim. |
11:19:01 | dom96 | wouldn't better 'not nil' checking be better? |
11:19:30 | yglukhov | dom96: maybe. cant say for sure. have to play with it to understand =) |
11:20:03 | dom96 | yay, a crown emoji exists. This is our official emoji guys: http://emojipedia.org/crown/ |
11:22:08 | Araq | yglukhov: patch the C codegen then. it's not hard (tm) |
11:22:24 | Araq | --nilChecks:on|off used to exist |
11:25:39 | dom96 | Araq: Want me to add what yglukhov suggested (the `when not defined(preserveObsoleteJsonBehavior)`)? |
11:33:33 | * | fredrik92 quit (Read error: Connection reset by peer) |
11:34:21 | endragor | Araq: have you considered allowing {.this.} pragma in proc scope? either as proc pragma or statement in a proc. that probably is not convenient for end-users, but that would allow writing macros such as OO macro without spoiling global scope. |
11:37:13 | * | ozra joined #nim |
11:37:29 | * | ozra left #nim (#nim) |
11:38:22 | Araq | endragor: the current plan is to make .this: self the *default* and .this can only be used to override the default (and may disappear in the longer run) |
11:38:58 | dom96 | hah, I love gratipay https://twitter.com/Gratipay/status/717315428045991936 |
11:39:07 | endragor | Araq: oh, interesting. thanks |
11:48:45 | * | krux02 joined #nim |
11:49:35 | * | enthus1ast joined #nim |
11:53:31 | Araq | dom96: I think it should be done the same way we did for the tables upgrade |
11:53:41 | dom96 | how was that done? |
11:53:55 | Araq | via a .deprecated in a 'when' iirc |
11:54:11 | Araq | git log -p tables.nim |
11:55:48 | Araq | the idea is that the compiler lists every usage of the [] operator and so the programmer can easily review these code sections |
12:08:36 | * | irrequietus quit (Read error: Connection reset by peer) |
12:11:19 | arnetheduck | Araq, any ideas for why https://github.com/nim-lang/Nim/pull/4015 is failing? initallocator is needed for nogc to avoid sysAssert, but tests fail when it's enabled |
12:17:57 | * | BitPuffin joined #nim |
12:18:17 | krux02 | I just would like to ask, if there is effort or at least interest for nim to have move semantics at some point in the language? |
12:19:11 | BitPuffin | krux02: the idea is that you'll overload = to implement moves or something |
12:19:45 | krux02 | ButPuffin, but an assignemnt is not a move |
12:20:11 | BitPuffin | hmm usually in rust an assignment is a move |
12:20:15 | BitPuffin | iirc |
12:20:18 | BitPuffin | unless it has the copy trait |
12:20:25 | dom96 | hey BitPuffin, how's things? |
12:20:31 | BitPuffin | hey dom96! |
12:20:34 | krux02 | in rust, but nim is not rust, and in c++ an assignment is not a move |
12:20:45 | krux02 | it's only a move, when the object, that is used to assign from is disposable |
12:21:00 | BitPuffin | krux02: I don't think they'll add rvalue overloading to nim |
12:21:16 | BitPuffin | dom96: I'm doing ok I guess, how are you? I saw you published more chapters, haven't gotten around to reading them yet |
12:21:52 | dom96 | BitPuffin: Good. Been working on lots of Nim stuff lately, mainly got Aporia working on OS X. |
12:21:53 | krux02 | can you pleas not use rvalue, I hate that name, it's just a bad name. |
12:22:17 | dom96 | (Which was a bitch to figure out) |
12:22:20 | krux02 | move semantic don't need c++ like rvalues |
12:22:21 | BitPuffin | krux02: xvalue? :P |
12:22:35 | BitPuffin | krux02: just make a macro then that explicitly moves |
12:22:43 | krux02 | it just needs a distinction between a copy assignment and a move assignment, and deterministic destructors. |
12:22:51 | BitPuffin | dom96: I saw you tweet about that! |
12:23:02 | dom96 | BitPuffin: :D |
12:23:11 | BitPuffin | did you do write objective c code, or did you use wrappers around the native code |
12:23:14 | BitPuffin | native api |
12:23:15 | BitPuffin | whatever |
12:23:16 | BitPuffin | obj-c backend |
12:23:29 | dom96 | BitPuffin: I used the gtk-mac-integration library. |
12:23:41 | dom96 | BitPuffin: But the annoying thing was compiling GTK+ on OS X |
12:24:31 | BitPuffin | dom96: ah, I thought you used cocoa |
12:24:59 | BitPuffin | believe gtk+ is pretty easy to install with brew, but it's a little fucked or something unless I remember wrong |
12:25:19 | dom96 | BitPuffin: It is, but I wanted an easy to install Bundle :) |
12:25:43 | BitPuffin | I guess you could have copied the libs from where brew installs them :P |
12:27:46 | dom96 | BitPuffin: nope |
12:27:52 | dom96 | BitPuffin: first thing I tried ;) |
12:28:13 | BitPuffin | ah okay lol |
12:28:50 | BitPuffin | krux02: you can implement a move really easily if you have already declared the variable first |
12:28:51 | dom96 | it worked on my Mac, and on my girlfriend's but failed on flyx's Mac |
12:29:01 | BitPuffin | but you'd probably want a macro that declares and moves |
12:29:20 | BitPuffin | moveTo a: b |
12:29:52 | BitPuffin | though I guess it should only declare it if it isn't already |
12:29:54 | BitPuffin | or something like that |
12:30:02 | BitPuffin | it's implementable, if you want it that way |
12:30:06 | Araq | arnetheduck: I don't know. don't enable the allocator for nimscript |
12:30:19 | BitPuffin | and then you can just create a moveImpl for the types you wanna move |
12:32:26 | Araq | krux02: I am looking into memory regions instead. Free your stuff in O(1) rather than micromanaging every single allocation with "move semantics, copying, RCs and destructors" |
12:36:02 | BitPuffin | Araq: you mean like jai? |
12:36:36 | Araq | not sure what jai's current take on it is, but yes I can imagine it uses that. |
12:36:41 | arnetheduck | hey dom96, any luck with LD_LIBRARY_PATH? |
12:36:56 | krux02 | I was hoping, that I could bind resorces to an object, and when the object get's freed, the resources get freed, too. |
12:37:15 | dom96 | arnetheduck: haven't tried it yet, will do later :) |
12:37:44 | Araq | BitPuffin: I copied the design from GCC's deprecated obstacks though ;-) |
12:38:16 | Araq | krux02: that's already possible and done with a finalizer. |
12:38:24 | arnetheduck | any easy way to create a set with all values from an enum? |
12:39:31 | Araq | {low(e)..high(e)} |
12:39:40 | BitPuffin | Araq: I believe it worked something like you allocate a big chunk of memory and push a sort of allocator for that memory in a pointer that gets passed to every function, and when you call the allocation function it will allocate from there, and then you batch-free the shit later |
12:40:29 | arnetheduck | thanks |
12:40:46 | Araq | BitPuffin: yeah but you don't need to pass it to "every function", you can use thread local storage instead ;-) |
12:42:38 | BitPuffin | krux02: last time I asked about this I think there was a static destructor thing that wasn't implemented fully yet |
12:43:06 | BitPuffin | Araq: nah that's true, I'm not even sure if that's how he'll implement it, it was just an example of how it could be implemented |
12:43:13 | krux02 | am am reading about the finalizer at the moment |
12:43:43 | BitPuffin | finalizer runs when the gc collects I think |
12:44:59 | krux02 | yes of course |
12:45:38 | BitPuffin | ah so you weren't actually looking for move semantics, just finalizers |
12:45:47 | krux02 | but according to the documantation it sounds, that I only need to pass the finalizer once to `new` afterwards I can just use `new` without the finalizer argument |
12:45:51 | krux02 | but I am not sure about that |
12:49:39 | Araq | krux02: you should use a constructor proc anyway. |
12:54:11 | krux02 | ok, that's true |
12:55:02 | krux02 | I wonder what the best solution is to wrap a c pointer with a destructor function |
12:55:47 | krux02 | having a gc-ed object, which is itself just a pointer seems not right |
12:59:23 | krux02 | btw, I tried to write some better gdb support for nim, and while I was trying to get help I accidentially motivated someone of the official qt-creator team to write some nim support for nim debugging |
13:07:42 | * | irrequietus joined #nim |
13:12:37 | Araq | yay. that's impressive. |
13:13:20 | Araq | you inspired me to write a nimgdb module that simply translates C-ish output to Nim-ish output and can be used by every editor |
13:13:41 | Araq | unfortunately for us "inspired" here means that I didn't write a single line of code for it. |
13:13:46 | Araq | :-) |
13:20:45 | * | gokr joined #nim |
13:22:04 | * | elrood quit (*.net *.split) |
13:22:05 | * | lqdc quit (*.net *.split) |
13:22:05 | * | flyx quit (*.net *.split) |
13:22:07 | * | JStoker quit (*.net *.split) |
13:22:07 | * | kier quit (*.net *.split) |
13:22:08 | * | StarBrilliant quit (*.net *.split) |
13:22:08 | * | Guest67762 quit (*.net *.split) |
13:24:10 | * | flyx joined #nim |
13:24:11 | * | JStoker joined #nim |
13:24:11 | * | kier joined #nim |
13:24:11 | * | StarBrilliant joined #nim |
13:24:11 | * | Guest67762 joined #nim |
13:24:28 | * | saml quit (Remote host closed the connection) |
13:26:32 | * | M-max quit (Ping timeout: 258 seconds) |
13:26:50 | * | M-max joined #nim |
13:27:36 | * | lqdc joined #nim |
13:28:00 | * | elrood joined #nim |
13:28:30 | * | darkf quit (Quit: Leaving) |
13:28:31 | * | saml joined #nim |
13:37:25 | * | krux02 quit (Quit: Verlassend) |
13:37:40 | * | krux02 joined #nim |
13:40:52 | * | silven quit (Ping timeout: 244 seconds) |
13:41:56 | * | silven joined #nim |
14:23:42 | * | pregressive quit (Remote host closed the connection) |
14:25:13 | * | enthus1ast1 joined #nim |
14:25:42 | * | enthus1ast quit (Ping timeout: 246 seconds) |
14:26:55 | * | pregressive joined #nim |
14:48:07 | * | pregressive quit (Read error: Connection reset by peer) |
14:48:23 | * | pregressive joined #nim |
14:49:52 | * | pregressive quit (Client Quit) |
14:54:10 | yglukhov | vegansk, so what do you think about my coment in your gist? ugly? |
14:58:30 | * | wuehlmaus joined #nim |
15:01:46 | yglukhov | Araq, dom96: I'm concerned about the json.{} op. It seems more complex than i need. What do you think about term rewriting to do the trivial stuff in case when i pass one key to `{}`? |
15:01:48 | * | fredrik92 joined #nim |
15:02:20 | Araq | yglukhov: fine with me, it's high time the stdlib uses some term rewriting |
15:02:37 | yglukhov | nice |
15:02:41 | dom96 | Yeah, go for it. |
15:02:50 | yglukhov | kk |
15:03:51 | * | dorei quit (Quit: Page closed) |
15:03:53 | yglukhov | do i call the trivial proc 'getOrDefault*' to be consistent with tables? |
15:04:26 | Araq | yes |
15:15:55 | * | irrequietus quit (Remote host closed the connection) |
15:16:37 | * | irrequietus joined #nim |
15:27:48 | * | PaulDj joined #nim |
15:28:48 | * | PaulDj quit (Client Quit) |
15:29:34 | * | vendethiel joined #nim |
15:32:53 | yglukhov | Araq: strange, but i can't get term rewriting to work for some reason. can anyone see the mistake? https://gist.github.com/yglukhov/ea40a8dbe495ce8fd84d36a69f5815b1 |
15:42:54 | * | krux02 quit (Quit: Verlassend) |
15:50:52 | * | Jesin joined #nim |
15:52:54 | * | vendethiel quit (Ping timeout: 276 seconds) |
15:57:23 | yglukhov | Araq: so it seems somwhow related to vararg thing. How can i write the correct pattern. kinda single vararg or smth? |
15:57:55 | Araq | use f([x]) in the pattern |
15:58:08 | Araq | as varargs constructs an array |
16:09:09 | * | yglukhov quit (Ping timeout: 276 seconds) |
16:20:12 | * | silven quit (Ping timeout: 276 seconds) |
16:20:44 | * | silven joined #nim |
16:25:34 | * | arnetheduck quit (Ping timeout: 248 seconds) |
16:25:38 | * | federico3 quit (Ping timeout: 260 seconds) |
16:25:56 | * | pleiosaur quit (Remote host closed the connection) |
16:26:05 | * | pleiosaur joined #nim |
16:28:06 | * | federico3 joined #nim |
17:01:10 | * | yglukhov joined #nim |
17:05:39 | * | yglukhov quit (Ping timeout: 248 seconds) |
17:10:10 | * | Demon_Fox joined #nim |
17:23:26 | * | endragor_ joined #nim |
17:25:03 | * | desophos joined #nim |
17:26:39 | * | endragor quit (Ping timeout: 244 seconds) |
17:27:42 | * | endragor_ quit (Ping timeout: 246 seconds) |
17:34:57 | niv | dom96: playing around with jester, attempting to write a json api. two thoughts: a) possible to install a global exception handler for requests? b) possible to auto-handle content-type application/json and attempt to parse body as such? |
17:36:00 | dom96 | a) is on my todo list |
17:36:08 | dom96 | (https://github.com/dom96/jester/issues/27) |
17:36:14 | dom96 | not entirely sure what you mean by b) |
17:36:27 | niv | oo, right. the issue for a would be exactly my usecase |
17:37:40 | niv | b) is easily explained by example. other api frameworks, like ruby-grape (since you're modelling after sinatra) allows to pre-specify content-type parsers/generators. so if the client sends header "content-type: app/json", the framework parses the body as a json and gives the user a hash, instead of string/binary. same goes the other way, returning a hash from your handler auto-generates json and sends that to the client |
17:38:27 | niv | this is traditionally done through some kind of middleware layer, i guess |
17:39:36 | dom96 | hrm. I think I know what you mean. Might implement it some day, but it really doesn't sound like a priority I'm afraid. |
17:40:40 | niv | i understand, just throwing out ideas. some kind of middleware/transform framework would allow stuff like content transforms, but also parameter validation, request validation, throttling, etc |
17:41:11 | niv | sinatra gets that stuff for "free" since it builds on rack, which has middlewares |
17:44:44 | dom96 | I'm not sure how middlewares work in the likes of Sinatra, but can't you simply call some libraries procedure in your route to perform those tasks? |
17:46:20 | dom96 | Araq: Why is this {.deprecatedGet.} pragma defined in system/inclrtl? |
17:47:26 | Araq | dom96: no idea. |
17:47:46 | Araq | because many stdlib modules include it. |
17:47:50 | * | enthus1ast1 quit (Ping timeout: 244 seconds) |
17:47:59 | Araq | and it can savely be included by the stdlib. |
17:48:06 | Araq | so that's what JSON should use too. |
17:48:13 | * | Matthias247 joined #nim |
17:48:18 | dom96 | yeah, but why can't it just be defined in the tables module? |
17:48:43 | Araq | it could be. |
17:48:47 | niv | dom96: yes, you can call it in the routes. the point of the middleware is to reduce boilerplate, since it runs automatically for all requests |
17:48:47 | fredrik92 | When I write my makefile (or visual studio project template) for Nim, do you think I should just call nim for the code generation (with the -c flag) and then use Visual Studio makefiles / projects to set the C compiler flags? |
17:48:58 | Araq | dom96: fyi you broke the testsuite. please fix it. |
17:49:08 | dom96 | Araq: Yeah. I know. |
17:49:36 | dom96 | Araq: Not sure how this pragma works, where does nimTableGet get defined? |
17:50:58 | dom96 | niv: I see. Make an issue for it :) |
17:51:18 | Araq | dom96: nowhere, you compile via -d:nimTableGet to activate it |
17:51:38 | Araq | but yeah we should name it -d:nimOldJson ? |
17:51:47 | Araq | or something like that. |
17:52:41 | * | yglukhov joined #nim |
17:52:54 | dom96 | right, and then by compiling with the define you get the old behaviour back? |
17:53:17 | cheatfate | dom96, middlewares made some complex tasks like session handling, json handling to be under the hood... |
17:54:44 | niv | yeah, auth & auth is another. you can keep your logic in one place that way; it prevents overlooking routes and similar mistakes, apart from reducing boilerplate |
18:00:41 | yglukhov | Araq: still no match with [key]. Gist updated: https://gist.github.com/yglukhov/ea40a8dbe495ce8fd84d36a69f5815b1 |
18:01:47 | Araq | yglukhov: educated guess: you need to do a skipConv in the pattern matching process |
18:02:10 | Araq | in other words some internal conversion is produced that prevents it from matching |
18:02:55 | niv | dom96: https://github.com/dom96/jester/issues/60 as requested, made an issue. hope its clear what it should do. please let me know if there's more you need from me |
18:03:01 | yglukhov | To put it in other words. Can we revert the breaking change for now until we have an adequate alternative? |
18:03:32 | yglukhov | cc dom96 |
18:04:29 | dom96 | niv: looks good |
18:05:14 | dom96 | yglukhov: I'd rather leave the change in, this is just an optimisation right? |
18:05:50 | yglukhov | yup |
18:08:22 | Araq | yglukhov: patterns.nim, line 131 let n = skipConv n |
18:08:32 | Araq | or something like that, please fix it |
18:09:13 | yglukhov | cool. i feel like i'm an oldschool lucasarts quest game hero! :D |
18:16:22 | * | boopsiesisaway is now known as boopsies |
18:25:05 | * | Demon_Fox quit (Quit: Leaving) |
18:34:28 | * | wade_ joined #nim |
18:34:31 | fredrik92 | why does nimsuggest look exactly like the nim executable?? |
18:37:56 | Araq | because it uses the whole compiler to do its work? |
18:38:55 | fredrik92 | ok, but `nimsuggest --help` outputs the same as `nim --help` |
18:39:06 | * | vendethiel joined #nim |
18:39:35 | Araq | yeah. kind of unfortunate :P |
18:39:48 | Araq | it outputs something different without the --help |
18:39:58 | fredrik92 | ah! :D |
18:47:26 | * | wade_ quit (Quit: Leaving) |
19:31:48 | yglukhov | Araq: are there any tests for term rewriting? Your suggestion works, but a test would be nice right? |
19:32:15 | * | brson joined #nim |
19:35:53 | yglukhov | ah ok found some. |
19:39:08 | Araq | if you enjoy it, you can think about what nkStmtListExpr implies for TR matchings |
19:39:52 | Araq | foo((x; y; a), b) matches foo(a, b) ? |
19:40:13 | Araq | but then this opt would remove the (x; y) part? |
19:40:39 | Araq | so you need to write it to (x; y; foo(a, b)) |
19:45:19 | * | brson quit (Quit: leaving) |
19:50:17 | * | enthus1ast joined #nim |
19:50:25 | Araq | *rewrite |
19:55:35 | * | BitPuffin quit (Read error: Connection reset by peer) |
20:05:40 | * | yglukhov quit (Remote host closed the connection) |
20:19:09 | * | brson joined #nim |
20:19:25 | * | yglukhov joined #nim |
20:19:45 | * | yglukhov quit (Remote host closed the connection) |
20:28:30 | * | yglukhov joined #nim |
20:33:34 | * | chrisheller quit (Remote host closed the connection) |
20:45:09 | * | Trustable quit (Remote host closed the connection) |
20:53:25 | dom96 | github is having some serious issues today |
20:58:36 | * | McSpiros joined #nim |
20:59:18 | dom96 | hello McSpiros |
20:59:37 | McSpiros | Hello Dominic! |
21:03:35 | dom96 | McSpiros: what brings you to #nim? :) |
21:04:00 | McSpiros | I started looking at Nim |
21:04:09 | McSpiros | really liked it |
21:04:09 | gokr | Ok, idiotic question: I should be able to define -d:release in the .cfg file, right? No matter what I do it keeps making me a fat file. |
21:04:29 | McSpiros | actually i was just reading nim in action :) |
21:06:20 | McSpiros | and i decided to come take a look at the irc channel, say hello |
21:08:13 | gokr | Ooohhh... perhaps... ok, so... nim seems to read the global cfg first (and in it, it sets various things depending on the value of "release") - and its after that it reads my local cfg (too late!). |
21:08:46 | gokr | That's why it behaves differently if I give it -d:release on the command line, or in the cfg. Hmmm. |
21:09:10 | gokr | Is this universally known? Am I daft? |
21:10:22 | dom96 | McSpiros: That's brilliant. What are your thoughts about the book so far? |
21:10:46 | dom96 | gokr: it's a common gotcha ;) |
21:10:46 | McSpiros | It's really nice |
21:11:05 | gokr | dom96: Ok, "good" ;) |
21:11:15 | dom96 | gokr: so much so that it may just be worth creating an issue for on Github to discuss it. |
21:11:38 | dom96 | McSpiros: Glad you like it :D |
21:11:39 | McSpiros | it's got a nice learning curve |
21:12:04 | McSpiros | keeps things challenging (for my level at least :) ) |
21:12:48 | dom96 | That's nice to hear. I'm currently working on corrections based on reader feedback from chapter 1 to 3, so I will hopefully make it even better :) |
21:13:21 | McSpiros | looking forward to it |
21:13:28 | McSpiros | I am still at chapter 3 |
21:13:40 | * | boopsies is now known as boopsiesisaway |
21:14:39 | McSpiros | trying to wrap my head around async stuff |
21:21:09 | * | thotypous quit (Ping timeout: 276 seconds) |
21:22:44 | dom96 | Yeah, it is a bit tough to understand at first. Of course the best way is to write some software using it, hence the large-ish example in the book. |
21:28:46 | McSpiros | I really appreaciate that you used a real, working example |
21:29:14 | McSpiros | maybe taka a little more time to get all the ins and outs of the example |
21:29:34 | McSpiros | but i believe you learn more this way |
21:32:04 | dom96 | yeah, I mainly picked it because I thought it would be fun. Before I learned how sockets work I always wanted to be able to write something like that for fun. |
21:36:42 | McSpiros | learning more about sockets is a bonus in that example too |
21:41:44 | * | Demon_Fox joined #nim |
21:42:06 | * | krux02 joined #nim |
21:42:39 | * | krux02 quit (Read error: Connection reset by peer) |
21:43:27 | * | krux02 joined #nim |
21:44:13 | * | krux02 quit (Read error: Connection reset by peer) |
21:44:57 | * | krux02 joined #nim |
21:45:43 | * | krux02 quit (Read error: Connection reset by peer) |
21:46:44 | * | krux02 joined #nim |
21:46:47 | * | krux02 quit (Read error: Connection reset by peer) |
21:47:40 | * | krux02 joined #nim |
21:47:48 | McSpiros | Gotta go |
21:48:01 | McSpiros | Hey Dom, nice talking to you! |
21:48:27 | dom96 | See you McSpiros! |
21:48:27 | * | krux02 quit (Read error: Connection reset by peer) |
21:48:47 | * | McSpiros quit (Quit: Page closed) |
21:49:19 | * | irrequietus quit () |
21:49:45 | * | krux02 joined #nim |
21:49:57 | * | krux02 quit (Read error: Connection reset by peer) |
21:50:45 | * | krux02 joined #nim |
21:51:08 | * | krux02 quit (Read error: Connection reset by peer) |
21:52:25 | * | krux02 joined #nim |
21:52:36 | * | krux02 quit (Remote host closed the connection) |
21:53:47 | Araq | gokr: yeah the config system should REALLY catch that. |
21:53:54 | Araq | it's hard to fix but easy to report |
21:54:19 | gokr | yeah |
22:07:21 | cheatfate | Araq, i think there some problems in exception handling on windows when "threads:on" |
22:08:44 | cheatfate | Araq, https://gist.github.com/cheatfate/66eec463b8f286288d41ea4988bdf823 |
22:12:09 | dom96 | Araq: Happy with this? https://github.com/nim-lang/Nim/compare/tester_ignore_output |
22:13:35 | cheatfate | Araq, and this error only happens with gcc, vcc is working good |
22:15:18 | Araq | dom96: no because I don't understand it. |
22:15:48 | Araq | cheatfate: didn't we fix thread local storage with GCC? |
22:16:01 | Araq | tried with --tlsEmulation:off ? |
22:16:12 | cheatfate | wait a moment i will try |
22:16:53 | cheatfate | Araq, it helps |
22:17:05 | Araq | actionRunNoSpec ... hmmm I guess your code is fine, dom96 |
22:17:25 | cheatfate | Araq, with --tlsEmulation:off it works without any exceptions |
22:17:29 | dom96 | ok :P |
22:24:48 | cheatfate | Araq, do i need to make an Issue on this? |
22:27:04 | Araq | cheatfate: yes. |
22:27:29 | Araq | would be nice if --tlsEmulation can default to 'off' on win/Gcc now. |
22:27:39 | Araq | this would make this a "minor issue". |
22:28:17 | * | chrisheller joined #nim |
22:39:27 | * | elrood quit (Quit: Leaving) |
22:43:34 | * | yglukhov quit (Remote host closed the connection) |
22:45:19 | * | yglukhov joined #nim |
22:45:43 | * | yglukhov quit (Remote host closed the connection) |
22:53:27 | * | vendethiel quit (Ping timeout: 276 seconds) |
23:01:34 | * | BitPuffin|osx joined #nim |
23:06:50 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:09:23 | * | darkf joined #nim |
23:10:30 | * | saml_ joined #nim |
23:17:56 | * | PMunch quit (Read error: Connection reset by peer) |
23:48:06 | * | Jesin quit (Quit: Leaving) |
23:52:53 | * | Jesin joined #nim |