00:11:59 | * | mahasamoot joined #nim |
00:12:45 | * | philo joined #nim |
00:21:20 | * | gokr quit (Ping timeout: 244 seconds) |
00:24:56 | * | ephja quit (Ping timeout: 244 seconds) |
00:31:52 | * | yglukhov joined #nim |
00:37:57 | * | yglukhov quit (Ping timeout: 276 seconds) |
00:42:49 | * | desophos joined #nim |
00:45:03 | * | elrood quit (Quit: Leaving) |
00:46:16 | * | abruanese quit (Ping timeout: 272 seconds) |
01:24:35 | * | zds joined #nim |
01:26:00 | * | pregressive joined #nim |
01:38:57 | * | Varriount_ quit (Ping timeout: 246 seconds) |
01:46:34 | * | chemist69 joined #nim |
01:49:26 | * | chemist69_ quit (Ping timeout: 250 seconds) |
01:52:44 | * | girvo joined #nim |
01:52:51 | * | girvo waves hello |
01:54:10 | girvo | Aside from http://nim-lang.org/docs/gc.html are there any decent posts/documents around on using Nim for soft-realtime usages? Or even just how to leverage alloc/dealloc nicely? Working on a Pebble smartwatch app, and using Nim for the bulk of the logic in it |
02:02:21 | * | brson quit (Quit: leaving) |
02:16:11 | * | here2bang joined #nim |
02:34:09 | girvo | Also, are there any documents I should be looking at to do with allocations in Nim? |
02:35:02 | * | yglukhov joined #nim |
02:35:11 | girvo | well, to be clear, I mean the memory and cache performance of idiomatic Nim code and how to optimise it for real-time cases. If not, I'll go digging and see what I can find myself :) |
02:39:16 | * | yglukhov quit (Ping timeout: 244 seconds) |
02:43:25 | * | |2321 quit (Quit: Connection closed for inactivity) |
03:00:30 | * | freezerburnV quit (Ping timeout: 246 seconds) |
03:17:19 | * | philo quit (Ping timeout: 260 seconds) |
03:17:32 | * | mahasamoot quit (Ping timeout: 260 seconds) |
03:18:03 | zds | Is it considered idiomatic, as in Python, to rely on exceptions for control flow? For instance, when parsing a token that may be a number, and may not, is it idiomatic to attempt to parseFloat, and catch a ValueError and try a different branch if it's not a number after all? |
03:31:37 | girvo | zds: From what I've seen and written, yes, except that I personally find using Either[L, R] or Maybe[T] more useful in a lot of cases, as you can keep your type saftey. I find exceptions are an escape hatch, and very useful, but more useful for -actual- exceptional conditions |
03:32:02 | girvo | zds: https://github.com/vegansk/nimfp is an excellent implementation of Maybe and Either :) |
03:32:11 | girvo | (among other niceities) |
03:37:47 | zds | That's marvelous! I spent my first day writing out a lot of int | float and wondering why it didn't behavior like either. |
03:38:49 | * | edub4rt quit (Remote host closed the connection) |
03:42:51 | girvo | zds: One thing I found implementing my own Either[L, R] was that Nim v0.14 fixes a lot of generics bugs that were in previous versions, so I highly recommend upgrading! :) |
03:43:31 | girvo | Also, fp's "act" macro is quite neat, allowing you to leverage the Either/Maybe monads in a nicely procedural chained way, similar to "do" in Purescript or Haskell |
03:43:56 | girvo | If you've got some experience with functional type-safe languages, you'll likely enjoy it as much as I am! |
03:45:29 | zds | Yes, I think it will make things much smoother for me. Many thanks. |
03:57:16 | * | mnemonikk quit (Quit: ZNC - http://znc.in) |
03:59:19 | * | mnemonikk joined #nim |
03:59:19 | * | mnemonikk quit (Changing host) |
03:59:19 | * | mnemonikk joined #nim |
04:16:32 | girvo | Dumb q: easy way of getting the platform name at compile time? |
04:17:04 | girvo | Using it to generate a version string for a util I've got, so itll be "dup 0.1.0-linux" or something similar |
04:23:27 | * | pregressive quit (Remote host closed the connection) |
04:37:03 | * | yglukhov joined #nim |
04:38:30 | * | heretobang quit (Quit: soundcloud.com/wacastle) |
04:41:42 | * | yglukhov quit (Ping timeout: 276 seconds) |
04:53:20 | * | endragor joined #nim |
05:11:25 | * | der-landgraf quit (Quit: WeeChat 1.5) |
05:11:37 | * | s4 joined #nim |
05:49:20 | * | yglukhov joined #nim |
05:50:32 | fowl | girvo, http://nim-lang.org/docs/system.html#hostOS |
05:52:31 | * | ephja joined #nim |
05:53:09 | * | philo joined #nim |
05:53:32 | * | yglukhov quit (Ping timeout: 244 seconds) |
05:59:29 | * | philo quit (Ping timeout: 260 seconds) |
06:09:12 | * | Demon_Fox joined #nim |
06:18:27 | * | endragor quit (Read error: Connection reset by peer) |
06:18:50 | * | endragor joined #nim |
06:19:41 | * | yglukhov joined #nim |
06:20:20 | * | endragor_ joined #nim |
06:23:51 | * | endragor quit (Ping timeout: 264 seconds) |
06:34:53 | * | endragor_ quit (Remote host closed the connection) |
06:35:21 | * | endragor joined #nim |
06:38:20 | * | der-landgraf joined #nim |
06:55:12 | * | chemist69 quit (Ping timeout: 258 seconds) |
06:55:32 | * | chemist69 joined #nim |
07:05:06 | * | PMunch joined #nim |
07:11:25 | flyx | seems like the troll still hasn't given up |
07:11:30 | flyx | (in the forum) |
07:12:05 | PMunch | Hmm, link(s)? |
07:12:17 | PMunch | At least it seems like he has given up here |
07:12:20 | flyx | http://forum.nim-lang.org/t/2330 |
07:13:48 | PMunch | Hmm, that could be someone genuine though |
07:14:07 | * | yglukhov quit (Remote host closed the connection) |
07:16:49 | flyx | the troll used GPS as nick here. |
07:16:56 | * | mrat joined #nim |
07:20:46 | PMunch | Oh, must've missed that. They used a lot of nicks.. |
07:32:43 | * | Trustable joined #nim |
07:39:21 | girvo | fowl: Cheers! |
07:39:33 | vegansk | girvo, thanks for nice words about nimfp :-) |
07:39:49 | girvo | vegansk: thanks for the amazing library ;) |
07:40:06 | girvo | Though I was almost sad that my cute Either[L, R] impl became useless hehe |
07:40:36 | * | ryu0 joined #nim |
07:40:43 | girvo | vegansk: Also, Nim v0.14's generics fixes have made doing monadic type generics way easier. I was running into bugs when trying to tackle it on v0.13 |
07:40:50 | girvo | Then v0.14 rolled round and it all Just Worked™ |
07:41:43 | vegansk | girvo, i'm using devel branch of Nim |
07:42:55 | ryu0 | I have noticed that part of the posix API wrappers are fundamentally broken in how it is down. it uses hardcoded constants for macros which appear to only be valid on Linux. |
07:42:59 | vegansk | and for now, all the features are tested on devel only |
07:43:31 | ryu0 | i wonder how difficult it would be to get these "fixed". |
07:43:41 | vegansk | and it will be so until 1.0 is released |
07:43:57 | girvo | vegansk: Ah yeah, makes sense. Well, the basics are running beautifully in v0.14 at least :) |
07:44:48 | girvo | ryu0: Yeah that's something I've noticed too. POSIX is, well, fun at times, but honestly a lot of the stuff I came across just needs to be a little smarter about whether it's POSIX or Linux, heh. |
07:45:19 | ryu0 | girvo: the proper way appears to be unix platform specific constants. |
07:45:21 | girvo | The Unix socket support for example was easier to just check whether its linux or OSX, but what would be nicer is if its possible to tell whether some platform is POSIX instead |
07:45:43 | ryu0 | in particular FreeBSD uses different values for some stuff than Linux does. |
07:46:03 | girvo | ryu0: Yeah. though I wonder how that'll play with cygwin/msys on Windows as well. Like I said, proper POSIX can be fun ;) |
07:46:28 | * | gokr joined #nim |
07:46:29 | ryu0 | the constants are the main issue i see. POSIX defines the prototypes quite clearly.y |
07:46:58 | girvo | Well maybe it's worth adjusting them and testing it out? Does it look particularly difficult to try? |
07:47:16 | ryu0 | probably not, but i wonder if it would even get accepted. |
07:47:29 | ryu0 | last i heard Araq wasn't a big fan of the unix side. |
07:47:32 | ryu0 | :P |
07:47:32 | girvo | I'm sure it would, why would you think it wouldn't? |
07:47:35 | girvo | Hahaha :P |
07:47:47 | ryu0 | and he said something about compatibility. |
07:48:03 | ryu0 | it makes me want to rofl when the compatibility is for a broken API :P |
07:48:06 | girvo | Well, we got AF_UNIX socket support in, and as long as stuff is gated by proper when defined()'s, platform-specific stuff has been fine |
07:48:39 | ryu0 | i was thinking to refer to free pascal to get some ideas for how to handle some stuff. |
07:48:56 | ryu0 | they appear to have a working posix / unix module. |
07:49:01 | girvo | Not a bad idea. I've been referring to more and more FP/Delphi libs for cross-platform guidance |
07:49:02 | ryu0 | with platform specific bits. |
07:49:23 | ryu0 | some AP |
07:49:38 | ryu0 | some APIs like epoll shouldn't even be in the posix dir. they're an extension. |
07:49:45 | girvo | I think the main reason is that Linux and OS X are the main platforms for the bulk of the contribs, but I'd be very surprised if the team turned down more compatibility! :) |
07:50:10 | ryu0 | i think posix should be limited to APIs that most if not all unix clones have. |
07:50:18 | ryu0 | otherwise it seems kind of like a misnomer. |
07:50:26 | girvo | Definitely worth posting an issue on github or a thread on the forums perhaps, get some discussion going about what it should really look like (and seperating out the extensions from the core) |
07:50:34 | girvo | But thats just my opinion! :) |
07:50:46 | ryu0 | yea, i think i'd like to work on this. |
07:51:04 | ryu0 | it's one part that has bugged the shit out of me :P |
07:51:21 | ryu0 | may as well call it the LINUX module the way it is right now. |
07:51:31 | girvo | I'd love it, personally. |
07:51:54 | ryu0 | i like linux, but i really don't like to call something posix if it really isn't portable. :P |
07:51:56 | girvo | I'm currently working on using Nim for the Pebble, which is quite fun heh |
07:52:18 | ryu0 | okay time to try this. |
07:53:08 | girvo | I'd love to know how you go! |
07:54:50 | ryu0 | https://github.com/nim-lang/Nim/issues/4382 |
08:00:07 | vegansk | dom96, hi! can you review PR https://github.com/nim-lang/Nim/pull/4381 please? Araq is offline and i need to know, can i use features from this PR in my library |
08:20:29 | gokr | girvo: Pebble, interesting |
08:21:04 | gokr | I fiddled with Nim and Arduino, wrote an article about it and made a little project |
08:21:21 | gokr | girvo: http://goran.krampe.se/2016/02/25/nim-meets-arduino/ |
08:23:14 | gokr | girvo: Among other things there is a patch in there for Nim to use malloc. |
08:39:54 | Araq | hi vegansk. I don't think I can merge it :-) |
08:42:01 | vegansk | Araq, hi! Is the problem in the PR itselfor is this not the issue? |
08:42:41 | * | yglukhov joined #nim |
08:42:55 | Araq | often these things are subtly wrong and we find out months later when some code type checks that shouldn't |
08:43:21 | Araq | your bug report is about tyTypeDesc in combination with generic type classes |
08:43:39 | Araq | your bug fix doesn't touch tyTypeDesc |
08:45:50 | vegansk | Yes, I know. tyTypeDesc handler calls typeRel again for tyGenericBody |
08:48:47 | vegansk | Araq, do you want me to handle this situation in tyTypeDesc branch instead of recursive ``typeRel`` call? |
08:52:22 | * | MyMind joined #nim |
08:53:33 | * | desophos quit (Read error: Connection reset by peer) |
08:58:11 | Araq | vegansk: I think semtypes should have created a tyCompositeTypeClass from this tyGenericBody |
08:58:26 | Araq | and for some reason it doesn't. |
08:58:49 | Araq | semtypes, line 839 |
09:08:15 | * | yglukhov quit (Ping timeout: 264 seconds) |
09:19:02 | * | cheatfate_ joined #nim |
09:19:02 | * | cheatfate quit (Read error: Connection reset by peer) |
09:19:45 | * | cheatfate_ is now known as cheatfate |
09:21:06 | * | yglukhov joined #nim |
09:31:49 | * | girvo quit (Ping timeout: 260 seconds) |
09:49:50 | * | yglukhov_ joined #nim |
09:52:27 | * | yglukhov quit (Ping timeout: 246 seconds) |
09:52:35 | vegansk | Araq, so here is the problem. liftParamType is called with tyTypeDesc and it just use paramType.base to create new type. |
09:53:02 | Araq | sounds plausible, yes |
09:53:06 | * | Pisuke joined #nim |
09:53:07 | vegansk | liftParamType is nether called with tyGenericBody in that situation |
09:54:09 | * | MyMind quit (Ping timeout: 244 seconds) |
09:55:07 | Araq | when you fix, can you also rename tyCompositeTypeClass to tyContainer and tyUserTypeClass to tyConcept? it's just too confusing :-) |
09:55:38 | vegansk | Ok :-) |
09:59:33 | * | Pisuke quit (Ping timeout: 276 seconds) |
10:12:43 | * | yglukhov_ quit (Read error: Connection reset by peer) |
10:12:52 | * | yglukhov joined #nim |
10:24:44 | * | Demon_Fox quit (Quit: Leaving) |
10:25:53 | chemist69 | Can I change my profile picture in the forum? I am not able to find such an option. |
10:26:41 | def- | chemist69: on gravatar.com using the same email address as you used in forum |
10:27:04 | chemist69 | ah, cool. Thanks |
10:29:00 | * | here2bang quit (Ping timeout: 250 seconds) |
10:32:13 | gokr | Anyone know anything about this LB Stanza? http://lbstanza.org |
10:36:07 | Araq | "should feel at home with Stanza's syntax" well the example uses space before the colons ... |
10:38:55 | gokr | I know, that stood out for me too - but... the mix of features look kinda interesting though. |
10:39:15 | Araq | it surely looks nice |
10:39:22 | gokr | I had never heard of it. |
10:39:32 | Araq | Structure Through Indentation |
10:39:32 | Araq | Some of you may be concerned about Stanza's use of structure through indentation due to how this system has been implemented in the past. Don't worry. Stanza's indentation structuring mechanism is very simple and predictable. |
10:39:32 | Araq | The indentation structuring mechanism is governed by a single rule: a line ending colon automatically inserts parentheses around the following indented block. |
10:39:39 | Araq | <-- we need to steal this :-) |
10:40:03 | gokr | Yeah, there may be other good things to steal - I wonder about the coroutine stuff for example. |
10:53:36 | * | girvo joined #nim |
10:58:15 | * | girvo quit (Ping timeout: 260 seconds) |
10:59:04 | vegansk | Araq, if I create tyCompositeTypeClass from tyGenericBody like that (https://gist.github.com/vegansk/d89d9c01c5ef2b27be546666f3bfea2d#file-semtypes-nim-L796-L798) it doesn't help. typeRel implementation doesn't find overloaded function |
11:14:23 | Araq | dig deeper then. |
11:34:25 | * | zaquest quit (Ping timeout: 260 seconds) |
11:49:01 | * | elrood joined #nim |
11:53:08 | * | edub4rt joined #nim |
11:53:35 | * | girvo joined #nim |
11:55:24 | * | fredrik92 joined #nim |
11:58:03 | * | girvo quit (Ping timeout: 264 seconds) |
11:59:58 | * | fredrik92 quit (Client Quit) |
12:17:09 | * | girvo joined #nim |
12:18:43 | * | alexsystemf__ joined #nim |
12:21:40 | * | girvo quit (Ping timeout: 260 seconds) |
12:26:26 | * | nsf quit (Quit: WeeChat 1.5) |
12:37:06 | yglukhov | Araq: can i allocate a gc-managed cstring? |
12:37:44 | yglukhov | so that the only reference to it is of cstring type |
12:41:52 | cheatfate | yglukhov, you trying to save 8-16 bytes per string? |
12:45:04 | yglukhov | cheatfate: not really... |
12:57:45 | * | Gonzih quit (Quit: WeeChat 1.5) |
12:58:06 | * | Gonzih joined #nim |
13:02:22 | * | cnu- quit (Quit: Quit.) |
13:02:25 | * | zaquest joined #nim |
13:02:52 | * | cnu- joined #nim |
13:06:36 | * | MyMind joined #nim |
13:17:59 | * | girvo joined #nim |
13:21:00 | * | s4 quit (Quit: Konversation terminated!) |
13:22:14 | * | WickedShell quit (Read error: Connection reset by peer) |
13:23:00 | * | girvo quit (Ping timeout: 276 seconds) |
13:29:16 | * | gokr quit (Ping timeout: 258 seconds) |
13:46:10 | * | trusion joined #nim |
13:47:15 | * | MyMind quit (Ping timeout: 264 seconds) |
13:47:40 | * | M-Quora quit (Ping timeout: 258 seconds) |
13:47:54 | * | M-max quit (Ping timeout: 260 seconds) |
13:47:54 | * | Flox42 quit (Ping timeout: 260 seconds) |
13:50:04 | * | gokr joined #nim |
13:54:17 | * | MyMind joined #nim |
13:56:16 | * | Flox42 joined #nim |
14:01:02 | * | lautzu joined #nim |
14:04:30 | * | Flox42 quit (Remote host closed the connection) |
14:08:30 | * | Flox42 joined #nim |
14:14:44 | * | pregressive joined #nim |
14:15:00 | * | pregressive quit (Remote host closed the connection) |
14:15:37 | * | pregressive joined #nim |
14:17:25 | * | girvo joined #nim |
14:18:50 | * | pregress_ joined #nim |
14:18:58 | * | pregressive quit (Read error: Connection reset by peer) |
14:22:19 | * | girvo quit (Ping timeout: 260 seconds) |
14:23:29 | * | Gonzih quit (Quit: WeeChat 1.5) |
14:24:42 | * | Gonzih joined #nim |
14:31:17 | * | endragor_ joined #nim |
14:34:40 | * | endragor quit (Ping timeout: 260 seconds) |
14:35:44 | * | endragor_ quit (Ping timeout: 260 seconds) |
14:42:57 | * | kingofoz quit (Ping timeout: 276 seconds) |
14:44:04 | * | kingofoz joined #nim |
15:01:50 | * | PMunch quit (Quit: leaving) |
15:02:49 | * | |2321 joined #nim |
15:09:47 | * | MyMind quit (Ping timeout: 250 seconds) |
15:14:03 | * | yglukhov quit (Read error: Connection reset by peer) |
15:14:19 | * | yglukhov joined #nim |
15:15:27 | * | yglukhov_ joined #nim |
15:15:27 | * | yglukhov quit (Read error: Connection reset by peer) |
15:19:31 | * | girvo joined #nim |
15:24:05 | * | girvo quit (Ping timeout: 250 seconds) |
15:34:35 | * | edub4rt quit (Remote host closed the connection) |
15:37:19 | * | nsf joined #nim |
15:37:35 | * | KaiXBerg joined #nim |
15:43:48 | * | M-Quora joined #nim |
15:43:56 | * | M-max joined #nim |
15:44:47 | * | mrat quit (Read error: Connection reset by peer) |
16:01:13 | * | Demon_Fox joined #nim |
16:09:17 | * | GangstaCat joined #nim |
16:21:32 | * | girvo joined #nim |
16:21:37 | * | kingofoz quit (Read error: Connection reset by peer) |
16:22:41 | * | kingofoz joined #nim |
16:26:17 | * | MyMind joined #nim |
16:26:18 | * | girvo quit (Ping timeout: 276 seconds) |
16:35:57 | Araq | yglukhov_: allocate a Nim string, GC_ref it, pass it as cstring to C |
16:36:04 | Araq | GC_unref it when done |
16:37:23 | yglukhov_ | well.. i kinda need the opposite... i want to return gc-ed cstring from "c" function... |
16:37:58 | yglukhov_ | but i guess cstring type is not traced, right? |
16:41:15 | * | sp33der89 joined #nim |
16:44:02 | * | MyMind quit (Ping timeout: 244 seconds) |
16:50:36 | * | Demos joined #nim |
16:59:28 | * | GangstaCat quit (Quit: Leaving) |
17:00:52 | * | yglukhov_ quit (Ping timeout: 258 seconds) |
17:05:03 | Araq | C needs to invoke newString then |
17:18:21 | * | sp33der89 quit (Ping timeout: 246 seconds) |
17:18:26 | * | ryu0 left #nim ("WeeChat 1.4") |
17:21:12 | * | brson joined #nim |
17:23:33 | * | girvo joined #nim |
17:28:05 | * | gokr quit (Ping timeout: 258 seconds) |
17:28:42 | * | girvo quit (Ping timeout: 276 seconds) |
17:44:56 | * | sp33der89 joined #nim |
17:47:38 | * | yglukhov joined #nim |
17:52:16 | * | yglukhov quit (Ping timeout: 272 seconds) |
17:58:17 | * | Trustable quit (Remote host closed the connection) |
17:58:22 | * | ddl_smurf quit (Ping timeout: 258 seconds) |
18:03:15 | * | MyMind joined #nim |
18:15:13 | * | PMunch joined #nim |
18:18:10 | * | ddl_smurf joined #nim |
18:26:20 | * | girvo joined #nim |
18:28:46 | * | freevryheid joined #nim |
18:31:32 | * | girvo quit (Ping timeout: 272 seconds) |
18:37:31 | * | mostworst joined #nim |
18:40:27 | * | Matthias247 joined #nim |
18:41:02 | * | Senketsu quit (Read error: Connection reset by peer) |
18:50:05 | * | edub4rt joined #nim |
18:52:49 | * | yglukhov joined #nim |
18:55:39 | * | mostworst quit (Ping timeout: 264 seconds) |
19:04:23 | edub4rt | how to use await with a simple future instead of proc? "await fut" doesn't work |
19:05:22 | Araq | edub4rt: you need to wrap it in a proc {.async.} |
19:09:57 | edub4rt | it did work, but so many lines for a simple case https://gist.github.com/edubart/96fd9cc02e3b896cb09628502b9b7b1f |
19:15:19 | edub4rt | no, the first case didn't work, I will keep trying |
19:20:24 | elrood | edub4rt, to achieve less lines, have a look at tutorial 1, tut1.html#procedures-result-variable |
19:23:00 | * | TheLemonMan joined #nim |
19:24:47 | elrood | Araq, perhaps the manual's section on procs could mention result and its special meaning more explicitly and not just implicitly assume it is known from the tutorial |
19:25:01 | * | MyMind quit (Ping timeout: 250 seconds) |
19:25:45 | * | edub4rt quit (Ping timeout: 246 seconds) |
19:27:12 | * | girvo joined #nim |
19:28:40 | * | r4vi quit (Ping timeout: 264 seconds) |
19:29:16 | * | Satyajit quit (Ping timeout: 264 seconds) |
19:29:16 | * | lenstr quit (Ping timeout: 264 seconds) |
19:30:28 | * | vegansk quit (Ping timeout: 264 seconds) |
19:30:29 | * | dom96 quit (Ping timeout: 264 seconds) |
19:30:29 | * | SianaGea1z quit (Ping timeout: 264 seconds) |
19:30:51 | * | vegansk joined #nim |
19:31:01 | * | LeNsTR joined #nim |
19:31:20 | * | r4vi joined #nim |
19:31:47 | * | girvo quit (Ping timeout: 244 seconds) |
19:32:10 | * | SianaGearz joined #nim |
19:32:10 | * | SianaGearz quit (Changing host) |
19:32:10 | * | SianaGearz joined #nim |
19:36:04 | * | Satyajit joined #nim |
19:36:06 | * | dom96 joined #nim |
19:46:17 | * | brson quit (Ping timeout: 260 seconds) |
19:54:43 | * | edub4rt joined #nim |
19:58:34 | * | mostworst joined #nim |
20:18:18 | * | brson joined #nim |
20:23:08 | * | freevryheid quit (Quit: Leaving) |
20:27:41 | * | girvo joined #nim |
20:29:06 | cheatfate | i think we need something like python2nim :) |
20:30:24 | namnguyen | with python 3.6, perhaps, when the type annotation is in |
20:31:13 | * | LeNsTR quit (Changing host) |
20:31:13 | * | LeNsTR joined #nim |
20:31:50 | * | LeNsTR is now known as lenstr |
20:32:39 | * | girvo quit (Ping timeout: 276 seconds) |
20:33:27 | * | FreezerburnV_ joined #nim |
20:36:48 | * | FreezerburnV_ quit (Remote host closed the connection) |
20:39:37 | * | akamaus joined #nim |
20:50:06 | * | MyMind joined #nim |
20:51:23 | Demos | type annotations are in |
20:51:27 | Demos | I use them in 3.5 |
20:51:54 | Demos | but just because the syntax is similar does not mean that would actually work that well |
20:52:02 | * | mostworst quit (Ping timeout: 244 seconds) |
20:52:21 | Demos | now a set of macros to bind to a python library via actually calling python would be nice |
20:52:29 | * | GangstaCat joined #nim |
20:53:29 | * | KaiXBerg quit (Quit: Page closed) |
20:56:05 | * | gokr joined #nim |
20:57:25 | cheatfate | nah, interface with python is useless, but python to nim translator can attract more pythoners to nim |
21:03:23 | * | pregress_ quit () |
21:05:13 | * | FreezerburnV_ joined #nim |
21:05:57 | gokr | useless? |
21:12:01 | Araq | we have Nimborg but a compiler regression keeps it from working -.- |
21:12:28 | Araq | it's misusing 'converter' to its breaking point |
21:12:39 | cheatfate | yep, its like you try to adopt rocket engine to bike |
21:13:07 | * | FreezerburnV_ quit (Quit: Mutter: www.mutterirc.com) |
21:13:23 | * | FreezerburnV_ joined #nim |
21:17:36 | PMunch | Can I declare types as a type in a tuple? Eg. tuple[name:string, typ:<something?>] Where the tuples typ would actually be a type so you could do something like cast[tuple.typ](something else) |
21:19:29 | Araq | what? there is 'type(foo)' which is Nim's typeof operator |
21:19:44 | Araq | no idea if that's related to your question :P |
21:21:05 | PMunch | Hmm, not quite :P |
21:21:10 | PMunch | I'll try to explain again |
21:21:16 | * | FreezerburnV_ quit (Ping timeout: 272 seconds) |
21:22:22 | PMunch | Let's say you want to declare a sequence of types. So var seq = [int,string,bool], first off is it possible? Second, how? |
21:25:58 | namnguyen | what does that mean to be a sequence of types? |
21:26:46 | PMunch | A sequence of type descriptions |
21:26:54 | namnguyen | http://nim-lang.org/docs/manual.html#generics-type-classes and the next section on Concepts |
21:27:57 | Demos | idk calling python from nim could be useful |
21:28:20 | Demos | and a translator probably won't be faster than pypy |
21:28:30 | * | girvo joined #nim |
21:28:37 | * | itnex joined #nim |
21:28:48 | PMunch | namnguyen, okay. Real life example time (this is what I'm actually trying to achieve) |
21:29:09 | PMunch | I want to create dynamic modules (using dynlib). These modules should be able to request a configuration |
21:29:16 | ephja | Demos: bolted-on static typing? |
21:30:03 | cheatfate | Demos, calling python from nim is like using V90 modem :) |
21:30:26 | ephja | maybe more like simplified dynamic checking |
21:30:32 | ephja | it's better than nothing |
21:30:47 | namnguyen | PMunch, how about a sequence of any? |
21:31:13 | namnguyen | i don't think there is a public root type of types |
21:31:14 | PMunch | So the main program will load a module, then call a function to get which configuration options the module wants. Then it will read through the config looking for the variable names from the config. When it finds them it would try to convert it to the type requested, and if everything succeeds then it would be passed back to the module. Otherwise the module would not be initialized and an error thrown. |
21:32:51 | * | girvo quit (Ping timeout: 250 seconds) |
21:33:49 | PMunch | Hmm namnguyen Any holds a value though.. I only want to know what which type was requested |
21:34:20 | PMunch | Let's say the module gives me something like this: Table[string,tuple[typ:<something>, required:bool]] |
21:34:44 | namnguyen | PMunch, typedesc? |
21:34:52 | namnguyen | http://nim-lang.org/docs/manual.html#special-types-typedesc |
21:35:02 | PMunch | From that the main program will know what string to look for in the config file, it will know what type to try and convert it too, and if it is required or not. |
21:35:29 | PMunch | I tried to do: var test = tuple[name:string, typ:typedesc] |
21:35:38 | PMunch | That results in: 'typedesc' metatype is not valid here; typed '=' instead of ':'? |
21:37:58 | namnguyen | PMunch, how about a string? |
21:38:03 | namnguyen | then do a case :-D |
21:38:17 | PMunch | Okay, I'm an idiot.. |
21:38:25 | PMunch | var test:tuple[name:string, typ:typedesc] = (name: "test", typ: int) |
21:38:34 | PMunch | It was in fact what the suggestion was.. |
21:38:38 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
21:38:54 | namnguyen | oh, declaration and assignment |
21:39:14 | PMunch | -_- |
21:45:42 | Araq | PMunch: best way to do it is to store a list NimNodes in global compileTime var, each NimNode coming from macros.getType() |
21:47:39 | PMunch | Hmm, I'll have to look into this tomorrow, got to go to bed now.. But thanks for the help namnguyen and Araq |
21:50:15 | namnguyen | you're welcome |
21:51:35 | * | PMunch quit (Quit: leaving) |
21:55:30 | * | itnex left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.") |
22:07:49 | * | elrood quit (Quit: Leaving) |
22:23:55 | * | here2bang joined #nim |
22:27:46 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:28:56 | * | girvo joined #nim |
22:33:08 | * | girvo quit (Ping timeout: 244 seconds) |
22:33:26 | * | |2321 quit (Quit: Connection closed for inactivity) |
22:36:48 | * | MyMind quit (Ping timeout: 276 seconds) |
22:53:00 | * | girvo joined #nim |
22:53:06 | * | ephja quit (Ping timeout: 272 seconds) |
22:54:28 | * | bjz joined #nim |
22:57:00 | * | yglukhov quit (Remote host closed the connection) |
22:58:11 | * | girvo quit (Ping timeout: 240 seconds) |
23:00:24 | * | bjz quit (Read error: Connection reset by peer) |
23:02:42 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:06:03 | * | bjz joined #nim |
23:06:28 | * | girvo joined #nim |
23:07:55 | * | GangstaCat quit (Quit: Leaving) |
23:11:09 | * | desophos joined #nim |
23:17:51 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:26:37 | * | Demos quit (Ping timeout: 252 seconds) |
23:42:59 | * | saml_ joined #nim |
23:43:33 | * | bjz joined #nim |
23:46:32 | * | bjz quit (Client Quit) |
23:46:37 | * | sp33der89 quit (Remote host closed the connection) |
23:52:08 | girvo | Morning all! |
23:52:22 | girvo | Q: asynchttpserver is single-threaded, async event loop based? |
23:55:42 | def- | girvo: Hi and yes |