00:03:46 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:09:11 | * | vendethiel quit (Ping timeout: 264 seconds) |
00:22:55 | * | vendethiel joined #nim |
00:35:45 | dom96 | def-: ooh, nice |
00:38:30 | * | Salewski quit (Quit: Page closed) |
00:44:08 | * | lompik joined #nim |
00:44:35 | * | vendethiel quit (Ping timeout: 264 seconds) |
00:44:55 | dom96 | Good night! |
00:45:18 | niv | nighty :) |
00:45:55 | gokr | def-: Very nice article! As always |
00:46:35 | * | vendethiel joined #nim |
00:47:28 | def- | gokr: thanks! |
00:50:23 | * | desophos quit (Read error: Connection reset by peer) |
01:07:30 | * | vendethiel quit (Ping timeout: 260 seconds) |
01:18:14 | * | ephja quit (Ping timeout: 256 seconds) |
01:45:49 | * | Trustable quit (Remote host closed the connection) |
01:49:44 | * | gokr quit (Quit: Leaving.) |
01:54:25 | * | vendethiel joined #nim |
02:07:14 | * | brson quit (Quit: leaving) |
02:13:37 | * | junw_ joined #nim |
02:14:15 | * | junw quit (Ping timeout: 245 seconds) |
02:17:15 | * | vendethiel quit (Ping timeout: 240 seconds) |
02:26:36 | * | vendethiel joined #nim |
02:35:00 | * | mountaingoat quit (Ping timeout: 260 seconds) |
02:47:00 | * | mountaingoat joined #nim |
03:10:59 | * | vendethiel quit (Ping timeout: 264 seconds) |
03:18:16 | * | vendethiel joined #nim |
03:35:48 | * | jryan joined #nim |
03:39:10 | * | vendethiel quit (Ping timeout: 260 seconds) |
03:41:38 | * | endragor joined #nim |
03:43:20 | * | xtagon quit (Quit: Connection closed for inactivity) |
03:43:58 | * | jryan quit (Quit: Page closed) |
03:44:04 | * | endragor quit (Remote host closed the connection) |
03:50:23 | * | desophos joined #nim |
03:54:37 | * | endragor joined #nim |
03:57:06 | * | endragor quit (Remote host closed the connection) |
04:03:56 | * | vendethiel joined #nim |
04:09:43 | * | yglukhov joined #nim |
04:14:18 | * | yglukhov quit (Ping timeout: 250 seconds) |
04:21:17 | * | endragor joined #nim |
04:25:05 | * | vendethiel quit (Ping timeout: 245 seconds) |
04:31:15 | * | vendethiel joined #nim |
04:34:39 | wuehlmaus | def-: wonderful article! |
04:35:40 | * | vangroan joined #nim |
04:49:37 | def- | wuehlmaus: thanks! |
04:52:35 | * | junw_ quit (Ping timeout: 240 seconds) |
04:53:58 | * | pregressive joined #nim |
05:16:50 | * | vendethiel quit (Ping timeout: 272 seconds) |
05:24:36 | * | vendethiel joined #nim |
05:36:30 | * | AMorpork quit (Remote host closed the connection) |
05:45:45 | * | vendethiel quit (Ping timeout: 260 seconds) |
05:48:48 | * | qazwsx joined #nim |
06:11:52 | * | pregressive quit () |
06:21:31 | * | pregressive joined #nim |
06:24:18 | * | vendethiel joined #nim |
06:32:07 | * | darkf joined #nim |
06:33:47 | * | pregressive quit (Remote host closed the connection) |
06:42:31 | * | qazwsx quit (Quit: qazwsx) |
06:47:16 | * | vendethiel quit (Ping timeout: 276 seconds) |
06:58:42 | * | wuehlmaus quit (Quit: Lost terminal) |
06:58:56 | * | wuehlmaus joined #nim |
07:04:53 | * | vendethiel joined #nim |
07:14:07 | * | qazwsx joined #nim |
07:26:05 | * | vendethiel quit (Ping timeout: 260 seconds) |
07:28:25 | * | vendethiel joined #nim |
07:30:08 | * | vendethiel quit (Client Quit) |
07:30:56 | * | endragor quit (Remote host closed the connection) |
07:34:01 | * | darkf_ joined #nim |
07:34:28 | * | darkf quit (Ping timeout: 265 seconds) |
07:44:06 | * | darkf_ quit (Ping timeout: 240 seconds) |
07:45:17 | * | darkf joined #nim |
07:45:44 | * | yglukhov joined #nim |
07:48:25 | * | endragor joined #nim |
07:49:17 | * | junw joined #nim |
07:50:06 | * | yglukhov quit (Ping timeout: 250 seconds) |
07:54:40 | * | darkf quit (Ping timeout: 260 seconds) |
07:57:42 | * | junw quit (Ping timeout: 272 seconds) |
08:01:22 | endragor | Is there a way to {.emit.} code (C or C++) that calls Nim procedure? |
08:01:26 | * | darkf joined #nim |
08:10:43 | * | Demon_Fox quit (Quit: Leaving) |
08:15:30 | * | gour joined #nim |
08:15:57 | * | darkf_ joined #nim |
08:19:12 | * | darkf quit (Ping timeout: 250 seconds) |
08:19:35 | * | bjz joined #nim |
08:24:56 | * | bjz quit (Ping timeout: 240 seconds) |
08:26:23 | * | gokr joined #nim |
08:26:28 | * | bjz joined #nim |
08:27:33 | Araq_ | endragor: use backticks in the .emit |
08:27:41 | * | qazwsx quit (Quit: qazwsx) |
08:27:44 | Araq_ | but watch out that the proc is not overloaded |
08:31:45 | * | darkf_ is now known as darkf |
08:47:19 | endragor | That worked, thanks! |
08:47:28 | * | qazwsx joined #nim |
08:55:12 | * | qazwsx quit (Quit: qazwsx) |
09:06:08 | * | coffeepot joined #nim |
09:14:42 | * | yglukhov joined #nim |
09:25:21 | * | ephja joined #nim |
09:27:20 | * | gokr quit (Quit: Leaving.) |
09:27:24 | * | gokr1 joined #nim |
09:34:44 | * | derka joined #nim |
09:47:03 | * | Dildosan joined #nim |
09:47:15 | * | derka quit (Quit: derka) |
10:16:34 | vegansk | Hi to all! |
10:16:57 | Dildosan | sup vegansk |
10:17:21 | coffeepot | yo :) |
10:17:49 | * | desophos quit (Read error: Connection reset by peer) |
10:18:00 | vegansk | When I want to use closure as callback for c library, do I need to handle the lifetime of environment manually? gc_ref/gc_unref works with refs but not with pointers |
10:19:06 | dom96 | good morning everyone :) |
10:19:18 | Araq_ | dunno, I guess you need to cast the result of 'system.rawEnv' |
10:19:45 | Araq_ | usually C apis only support one void* so you need to wrap the .closure in another ref |
10:20:05 | Araq_ | that's what we do for wxWidgets (soon to be released ...) |
10:22:23 | coffeepot | >wxWidgets (soon to be released ...) Awesome! |
10:23:27 | coffeepot | and good morning dom96, how's your book meap feedback going? |
10:23:35 | vegansk | Araq_, i.e. I need to store some object that contains closure as callback's void* param, gc_ref it before c library call and gc_unref it after the call. Correct? |
10:24:06 | Araq_ | no. |
10:24:09 | Araq_ | you do: |
10:24:19 | Araq_ | type Foo = ref object |
10:24:28 | dom96 | coffeepot: Good. HN has given really nice feedback so far. |
10:24:36 | Araq_ | callback: proc () {.closure.} |
10:24:46 | dom96 | I'm impressed by how long it stayed on the front page |
10:25:01 | Araq_ | proc wrapper(x: pointer) {.cdecl} = |
10:25:08 | dom96 | (It's still in the "Show" section, one of the mods turned it into a "Show HN" post) |
10:25:17 | coffeepot | great! I bought a copy too, looking forward to digging in when it's released :) |
10:25:23 | Araq_ | cast[Foo](x).callback() |
10:25:41 | Araq_ | # somewhere: |
10:25:44 | coffeepot | wow that's good news. Seems like Nim is definitely something people are keeping an eye on! |
10:25:47 | Araq_ | var f = Foo(...) |
10:25:51 | Araq_ | GC_ref(f) |
10:26:14 | Araq_ | cfunction(wrapper, cast[pointer](f)) |
10:26:20 | Araq_ | GC_unref(f) |
10:26:40 | vegansk | Araq_, thanks! |
10:26:49 | Araq_ | you sometimes can eliminate the 'ref object' wrapping |
10:26:57 | Araq_ | but not if you don't know what you're doing :P |
10:27:15 | dom96 | coffeepot: nice, thank you for the order! :) |
10:27:23 | dom96 | coffeepot: read much of it yet? |
10:27:35 | coffeepot | np, thanks for taking the time to write it :) |
10:27:42 | wuehlmaus | nim is such that if i read the source code i get happy, i really love its looks :) Thank you , Araq_ :) |
10:28:09 | coffeepot | I'm reading the first few chapters fleetingly in downtime atm but not dug in properly yet :) |
10:28:58 | Araq_ | wuehlmaus: you're welcome |
10:29:00 | coffeepot | the interesting stuff for me is further into the book :) |
10:29:37 | dom96 | coffeepot: which parts interest you the most? |
10:30:08 | * | Sembei quit (Read error: Connection reset by peer) |
10:31:12 | * | Sembei joined #nim |
10:31:36 | coffeepot | concurrency, building a twitter clone (and any web stuff as it's my weak area), metaprogramming (I use templates a lot but want to dig into the more powerful features as I have a strong need to DRY when coding) and interfacing with hardware (want to try nim with RPi & Arduino) |
10:32:10 | * | Trustable joined #nim |
10:32:36 | dom96 | coffeepot: Cool. I'm working on the concurrency chapter right now. |
10:33:18 | dom96 | Are you interested in sockets too by any chance? |
10:33:32 | coffeepot | i'm not too firm on the metaprogramming 'rules' so to speak: using expressions in templates still seems kind of magical to me aside from using them as 'super generics', so I only use them in a basic sense, but I'd like to know more about this so I'm not bumbling about |
10:34:18 | dom96 | Yeah, explaining metaprogramming will be challenging. |
10:34:34 | coffeepot | not that interested in sockets but good thing to learn. I'm interested in building json and/or rest api's for work, concurrently and with as few locks as possible, and serving web pages |
10:35:45 | dom96 | Well, you might find Chapter 3 fun in any case. It includes JSON parsing, async sockets, a bit of multi-threading (to read from stdin without blocking) and more. |
10:37:47 | * | shevy joined #nim |
10:44:29 | coffeepot | will check out cp3, is it available to view? Can imagine MP will be hard to explain, but in terms of showing off nim things like creating operator overloading with templates like the graphics module does is cool. Anything that creates procedures automatically really :) |
10:45:10 | coffeepot | also {.borrow.} - saves so much boilerplate |
10:45:46 | * | RG92 joined #nim |
10:49:41 | coffeepot | the json module is really nice actually, i tacked it onto my odbc lib so you can convert db records to json for easy transport. One line of code XD |
10:57:43 | * | derka joined #nim |
11:00:18 | * | RGeisel joined #nim |
11:03:10 | dom96 | coffeepot: That's good, especially since I wrote much of its API :D |
11:03:49 | federico3 | def-: I'm working on an async logger as well |
11:04:33 | dom96 | I wonder if sharing news about my book on slashdot would be a good idea :P |
11:05:30 | flyx | only if the distributor has a good server infrastucture. |
11:07:04 | dom96 | Is Slashdot really still that popular? |
11:08:35 | flyx | I don't know the numbers, but most of the folks I know read it |
11:11:49 | dom96 | Awesome |
11:14:23 | * | RGeisel quit (Quit: leaving) |
11:14:37 | * | RG92 quit (Quit: ChatZilla 0.9.92 [Firefox 44.0/20160123151951]) |
11:15:26 | * | RGeisel joined #nim |
11:17:42 | * | RGeisel_ joined #nim |
11:18:55 | * | RGeisel__ joined #nim |
11:19:00 | * | RGeisel_1 joined #nim |
11:22:40 | * | RGeisel__ quit (Client Quit) |
11:22:57 | * | RGeisel__ joined #nim |
11:23:16 | * | RGeisel_1 quit (Client Quit) |
11:23:20 | * | RGeisel_ quit (Quit: leaving) |
11:23:24 | * | RGeisel quit (Quit: leaving) |
11:23:32 | * | RGeisel joined #nim |
11:23:36 | * | RGeisel_ joined #nim |
11:23:47 | * | RGeisel_1 joined #nim |
11:24:53 | * | RGeisel_2 joined #nim |
11:25:00 | * | RGeisel_3 joined #nim |
11:25:03 | * | RGeisel_4 joined #nim |
11:25:08 | * | RGeisel_5 joined #nim |
11:26:07 | * | lcm quit (Quit: Page closed) |
11:26:24 | * | RGeisel_4 quit (Client Quit) |
11:26:27 | * | RGeisel_3 quit (Client Quit) |
11:26:30 | * | RGeisel_2 quit (Client Quit) |
11:26:32 | * | RGeisel_5 quit (Client Quit) |
11:27:40 | * | RGeisel_2 joined #nim |
11:28:20 | * | filcuc joined #nim |
11:28:27 | * | RGeisel_3 joined #nim |
11:28:49 | * | RGeisel_3 quit (Client Quit) |
11:28:53 | * | RGeisel_2 quit (Client Quit) |
11:29:44 | * | RGeisel_2 joined #nim |
11:29:50 | * | RGeisel_3 joined #nim |
11:30:10 | * | RGeisel_2 quit (Client Quit) |
11:30:14 | * | RGeisel_3 quit (Client Quit) |
11:30:41 | * | RGeisel_2 joined #nim |
11:30:46 | * | RGeisel_3 joined #nim |
11:31:06 | * | mountaingoat quit (Ping timeout: 240 seconds) |
11:39:27 | * | RGeisel_4 joined #nim |
11:39:41 | * | RGeisel_4 quit (Client Quit) |
11:40:20 | * | dashed quit (Quit: Connection closed for inactivity) |
11:45:02 | * | mountaingoat joined #nim |
11:59:54 | * | lcm joined #nim |
12:00:03 | * | RGeisel_4 joined #nim |
12:01:00 | * | RGeisel_4 quit (Client Quit) |
12:01:26 | * | RGeisel_4 joined #nim |
12:04:41 | * | RGeisel_4 quit (Client Quit) |
12:06:17 | * | derka quit (Quit: derka) |
12:17:05 | niv | hello nim! i have a question about echo'ing objects |
12:17:43 | niv | when i do echo myObjInstance, it prints all fields. all fields need to be marked with *; if i make a field private, instead of not printing it, the echo fails with "undeclared field: 'xxx'". what gives? |
12:18:34 | dom96 | echo doesn't have access to private fields, same way you don't :) |
12:18:48 | niv | yeees, but shouldnt it just skip them instead of breaking? |
12:19:09 | dom96 | hrm, good point |
12:19:11 | dom96 | bug report ;) |
12:22:23 | niv | done |
12:23:13 | niv | oh, wait. i think there's a different issue at play |
12:23:28 | Araq_ | no bug report. |
12:23:38 | Araq_ | it's as it should be. |
12:24:51 | niv | but .. isnt that really inconvenient? why would you want to error on private fields when echoing a object? no other language i know of does it this way |
12:25:26 | Araq_ | it's consistent. |
12:25:40 | Araq_ | $ for objects uses the fieldPairs iterator |
12:25:51 | Araq_ | fieldPairs doesn't silently skip private fields |
12:26:01 | Araq_ | that would be a desaster for serialization |
12:26:25 | niv | ah, right. got it. i still think though that echo should just work(tm), not make the user write a custom $ just to print his object |
12:26:52 | Araq_ | it's not clear what "just work(tm)" means in this context |
12:27:05 | Araq_ | you currently want it to ignore private fields |
12:27:13 | Araq_ | tomorrow you might want something else |
12:27:24 | Araq_ | like: to just print them ffs for debugging |
12:27:48 | niv | well, obviously there would need to be a spec, but is erroring and making the user do more work really the best option? |
12:28:06 | Araq_ | it's the Go option. |
12:28:48 | niv | hey, well, it's your language :) im just saying, it was/is an annoyance for me atm |
12:28:49 | Araq_ | when we are as successful as Go, we can depart from Go's strategy and actually provide something useful. |
12:31:09 | Araq_ | wink! |
12:31:33 | def- | niv: for debugging you can use repr(), it works with private fields as well |
12:32:03 | Araq_ | niv: more control would be cool, but the current behaviour is not a bug. it tells you you violate your data abstraction. or something. |
12:32:04 | niv | def-: thanks |
12:32:42 | niv | Araq_: yeah got it and im all for a good data model. im just speaking from a enduser standpoint - didn't *expect* echo() to break on some objects |
12:34:09 | niv | would it be terribly wrong to make echo just print all the fields it has access to, from whereever it's called? |
12:34:43 | def- | niv: i guess it would be confusing if `$` behaved differently depending on where it's called from |
12:35:43 | niv | yeah. |
12:35:52 | coffeepot | isnt the common practice to provide a proc`$`*(a: Mytype):string = |
12:36:00 | niv | then again, a library user that just prints objects from somewhere else should be bothered about private fields in the first place |
12:36:03 | def- | coffeepot: yeah, that's what you should do |
12:36:29 | niv | should = shouldn't |
12:38:36 | Araq_ | C# up to version 4 at least didn't have a useful default toString implementation. C++ has none. C has none. Python outputs memory addresses iirc |
12:39:02 | Araq_ | what are all the other languages that get right? |
12:39:56 | niv | alright, fair point. maybe it's just me mis-thinking about objects like tuples |
12:40:36 | niv | js or ruby might not be the best design goal for nim, i guess |
12:43:00 | Araq_ | I'm always willing to steal from Ruby if you can tell me what its default to_s does with private fields |
12:44:57 | niv | ruby actually doesnt print any fields at all with to_s, you have to use #inspect. #inspect prints all fields, regardless of access - then again, ruby isnt too strict on that in the first place |
12:45:18 | Araq_ | then again, we do have repr :P |
12:45:57 | niv | i'll see about writing my own helper i guess that just prints public fields :) |
12:49:59 | niv | don't suppose there's a way to query if a field is public/private at runtime? |
12:55:08 | def- | niv: there is! |
12:55:59 | def- | well, at least if you're outside of the module: https://gist.github.com/def-/8a53578315edf5b2b885 |
12:56:18 | niv | nice. thanks! |
12:56:24 | niv | appreciate your help |
12:57:43 | flyx | while reading this discussion, I'm wondering if my YAML serializer really needs its „serializable“ macro |
12:58:00 | gokr1 | Araq_: Smalltalk prints "a User" (class being a User). |
13:01:12 | flyx | does fieldPairs iterate over fields of parent objects? |
13:01:48 | def- | flyx: i would assume so |
13:03:23 | flyx | indeed |
13:03:32 | * | flyx didn't know about fieldPairs |
13:03:45 | * | flyx might need to rewrite custom object YAML serialization |
13:04:31 | * | qazwsx joined #nim |
13:10:48 | * | AMorpork joined #nim |
13:11:35 | * | AMorpork left #nim (#nim) |
13:11:48 | * | AMorpork joined #nim |
13:15:57 | * | endragor quit (Remote host closed the connection) |
13:17:27 | * | endragor joined #nim |
13:17:35 | * | junw joined #nim |
13:17:35 | * | huonw_ quit (Ping timeout: 240 seconds) |
13:19:30 | * | huonw joined #nim |
13:22:41 | * | qazwsx quit (Quit: qazwsx) |
13:46:39 | * | qazwsx joined #nim |
13:49:24 | * | BitPuffin joined #nim |
13:51:26 | * | RGeisel_4 joined #nim |
13:51:46 | * | apotheon quit (Ping timeout: 240 seconds) |
13:51:49 | * | RGeisel_4 quit (Client Quit) |
13:54:10 | * | BitPuffin quit (Ping timeout: 256 seconds) |
13:55:49 | * | pregressive joined #nim |
13:56:46 | * | apotheon joined #nim |
14:04:09 | * | BitPuffin joined #nim |
14:04:54 | coffeepot | will nim allow overriding of '=' in the future? If so, what kind of challenges will this bring with it? |
14:05:20 | Araq_ | coffeepot: it already supports it but I'm not happy with the results |
14:05:49 | coffeepot | that's good news, I can imagine it's tricky to get right in all circumstances |
14:06:21 | coffeepot | I'm assuming it'd be used like this proc `=`*(a: type) = |
14:06:42 | coffeepot | seems like it'd be complex with the gc interactions but idk |
14:12:36 | * | pregressive quit (Remote host closed the connection) |
14:20:24 | * | pregressive joined #nim |
14:26:51 | * | sparrk joined #nim |
14:30:55 | * | lompik quit (Ping timeout: 240 seconds) |
14:37:20 | * | Varriount_ joined #nim |
14:39:06 | * | Varriount__ joined #nim |
14:39:47 | * | Varriount quit (Ping timeout: 264 seconds) |
14:41:22 | * | Varriount joined #nim |
14:41:46 | * | Varriount_ quit (Ping timeout: 256 seconds) |
14:42:19 | * | sparrk quit (Quit: Leaving) |
14:42:54 | * | Varriount_ joined #nim |
14:43:28 | * | Varriount__ quit (Ping timeout: 256 seconds) |
14:43:52 | * | qazwsx quit (Quit: qazwsx) |
14:44:08 | * | Varriount__ joined #nim |
14:46:23 | * | Varriount quit (Ping timeout: 264 seconds) |
14:47:37 | * | Varriount_ quit (Ping timeout: 276 seconds) |
14:48:17 | * | Varriount joined #nim |
14:48:32 | * | pregressive quit (Read error: Connection reset by peer) |
14:48:48 | * | pregressive joined #nim |
14:49:08 | * | Varriount__ quit (Ping timeout: 256 seconds) |
14:49:19 | * | Varriount_ joined #nim |
14:50:32 | * | pregressive quit (Client Quit) |
14:50:58 | * | vangroan_ joined #nim |
14:52:26 | * | junw quit (Ping timeout: 240 seconds) |
14:52:50 | * | bozaloshtsh quit (Ping timeout: 276 seconds) |
14:53:10 | * | Varriount quit (Ping timeout: 272 seconds) |
14:53:23 | * | Varriount joined #nim |
14:54:15 | * | vangroan quit (Ping timeout: 245 seconds) |
14:54:28 | * | Varriount__ joined #nim |
14:55:42 | * | vangroan_ quit (Ping timeout: 272 seconds) |
14:56:43 | * | Varriount_ quit (Ping timeout: 276 seconds) |
14:57:04 | * | Varriount_ joined #nim |
14:58:40 | * | Varriount quit (Ping timeout: 276 seconds) |
15:00:05 | * | Varriount__ quit (Ping timeout: 245 seconds) |
15:03:52 | * | Varriount_ quit (Ping timeout: 276 seconds) |
15:04:54 | * | qazwsx joined #nim |
15:07:00 | * | endragor quit (Remote host closed the connection) |
15:13:33 | dom96 | http://slashdot.org/submission/5509649/early-access-version-of-nim-in-action-now-available |
15:15:04 | coffeepot | nice. Incidentally, I've not been to slashdot for ages, love the irony that they now have crossposting to reddit, etc :) |
15:17:11 | coffeepot | huh... did not know slashdot and sourceforge were owned by the same company (and has now been sold). I actively avoid SF now since that adware scandal |
15:19:14 | coffeepot | new SF owners "We disagree with some of the previous monetization strategies from an industry and business perspective" well, that's something... |
15:19:18 | * | junw joined #nim |
15:23:08 | dom96 | Yeah, that surprised me as well |
15:27:03 | gmpreussner | love the "Writing an Async Logger in Nim" tutorial |
15:27:11 | gmpreussner | that's why nim is so awesome :) |
15:27:49 | gmpreussner | those who haven't seen it: http://hookrace.net/blog/writing-an-async-logger-in-nim/ |
15:33:01 | * | bozaloshtsh joined #nim |
15:35:20 | coffeepot | brilliant, cheers gmpreussner, interesting read |
15:35:55 | gokr1 | Yeah, Dennis has brilliant articles there |
15:36:30 | coffeepot | things like this are one of the many reasons I love coding in nim: const module = instantiationInfo().filename[0 .. ^5] |
15:37:20 | coffeepot | i wrote a multithreaded logger in pascal for use in services, and... well I just had to pass the name of the function as a string :( |
15:38:24 | coffeepot | also: writeStackTrace() ... so useful for debugging |
15:41:57 | Araq_ | def-: just read your article. superb. |
15:41:59 | coffeepot | this is a great article that has a nice example of channels :D |
15:46:33 | coffeepot | actually it'd be nice if this kind of logger was in the stdlib |
15:51:15 | gmpreussner | logging requirements differ widely. might be too specific for the stdlib, unless it becomes even more generic |
15:51:37 | * | pregressive joined #nim |
15:51:45 | gmpreussner | for example, i would demand the ability to send logs over the network. not sure if that would be a good fit for the file based setup |
15:54:55 | coffeepot | true. Having a threadded logger is pretty useful to have. I mean, it's almost inevitable that you'll need logging somewhere if only in debug code |
15:55:54 | coffeepot | how i've handled the generic aspect before is to have various standard channels; console, file, etc and a custom proc to hook into for say, network output |
15:56:38 | gmpreussner | that sounds reasonable. then you'd have one thread per log sink, i suppose? |
15:56:48 | coffeepot | i'd want to be able to say logger.logTo({llFile, llConsole, llCustom}); logger.custom = proc ... |
15:58:00 | coffeepot | yeah one thread per sink usually, but I've done it before with one thread in total and a queue with a struct that details where to send it |
15:58:37 | coffeepot | ultimately it's easier to keep the log in order if you just have one logger thread |
16:00:26 | coffeepot | and it doesn't really matter if, say, sending to the network takes 2ms and a file 0.1ms if they're in order, as it's not blocking other threads, you just have a queue for messages. Having said that, I'm not sure how channels work if you have multiple threads sending data to a single logger thread |
16:03:28 | coffeepot | thinking about it one thread for the logger is probably best |
16:03:57 | coffeepot | even with multiple outputs |
16:04:01 | gmpreussner | yep |
16:04:48 | gmpreussner | btw how do you detect --threads:on in code? |
16:05:05 | coffeepot | defined(threads)? |
16:05:28 | gmpreussner | is that it? |
16:05:39 | coffeepot | that reminds me, currently not possible to get the thread handle as it's private Thread.sys |
16:07:41 | coffeepot | i think that's it, yeah. defined will tell you if a cmd line param is passed, but not sure how to get the 'on' or 'off' bit |
16:07:59 | * | endragor joined #nim |
16:09:45 | * | gokr1 quit (Quit: Leaving.) |
16:10:07 | dom96 | http://nim-lang.org/docs/system.html#compileOption,string |
16:11:41 | * | pregressive quit (Remote host closed the connection) |
16:12:10 | * | endragor quit (Ping timeout: 245 seconds) |
16:12:13 | coffeepot | ahh nice one dom96, now i learn defined is for "-d:" params |
16:15:43 | * | Varriount joined #nim |
16:16:48 | def- | gmpreussner, Araq_: glad to hear that you like it :) |
16:18:45 | gmpreussner | def-: your website needs a RSS summary feed :) |
16:18:54 | * | bozaloshtsh quit (Ping timeout: 250 seconds) |
16:18:57 | gmpreussner | right now the entire articles are included |
16:19:47 | gmpreussner | are you on twitter? i started using twitter... again |
16:20:00 | * | bozalosh1sh joined #nim |
16:20:09 | * | AMorpork quit (Remote host closed the connection) |
16:21:56 | * | AMorpork joined #nim |
16:22:35 | federico3 | def-: I have an async logging lib close to release |
16:23:02 | federico3 | Initially it was meant to be part of the duke's lib, but he disappeared |
16:23:58 | dom96 | hnwatcher.com is really handy for getting alerts when anybody mentions Nim |
16:24:49 | * | Dildosan left #nim ("Leaving") |
16:27:51 | * | AMorpork left #nim ("Leaving") |
16:29:10 | * | pwernersbach joined #nim |
16:33:46 | def- | dom96: i wish there was a more general way of being informed when something is referenced somewhere on the internet |
16:34:13 | Araq_ | google? |
16:34:34 | coffeepot | specifically https://www.google.co.uk/alerts |
16:36:07 | def- | coffeepot: tried that, didn't work reliably at all |
16:36:35 | coffeepot | you're right, nice idea google, but not so great |
16:38:12 | * | lcm quit (Quit: Page closed) |
16:38:25 | coffeepot | having said that it did just inform me that sdtimes makes mention of nim 0.13 coming out http://sdtimes.com/microsoft-announces-minecraft-education-edition-nim-0-13-0-is-out-and-google-allows-developers-to-create-promo-codes-sd-times-digest-jan-19-2016/ |
16:38:28 | coffeepot | i'd not seen that |
16:39:37 | dom96 | sdtimes seems like a poor site |
16:39:42 | dom96 | that simply reposts news |
16:40:21 | coffeepot | yeah it does, still nice to see nim in the news |
16:40:57 | coffeepot | free press innit :) |
16:46:51 | dom96 | wow, I'm amazed that def's post on HN is on the front page with 4 upvotes. |
16:47:54 | gmpreussner | when creating wrappers for C libraries, i often deal with enums whose values are computed, i.e. C = A + B. c2nim generates equivalent code for this, but it doesn't actually compile, because we can't perform arithmetic unless casting to ordinals. |
16:48:03 | gmpreussner | how do you guys usually deal with this? |
16:48:39 | * | pwernersbach_ joined #nim |
16:48:50 | gmpreussner | i also struggle will aliased enum value names. those always have to be declared as separate constants, which means they can't be used with pure enums |
16:49:06 | * | pwernersbach quit (Ping timeout: 252 seconds) |
16:51:11 | Araq_ | gmpreussner: I usually map C enums to consts |
16:51:29 | Araq_ | C enums just have nothing to do with any kind of type safety |
16:53:06 | gmpreussner | oh, i see, so you don't have enums at all. everything is just consts. hmm.... |
16:53:35 | gmpreussner | i don't know, i think i'd like to have at least some level of safety |
16:53:50 | gmpreussner | even tough it's not perfect, it would already help to catch the most common mistakes at compile time |
16:54:16 | gmpreussner | accidentally using a wrong prefix might be a very hard to find bug otherwise |
16:54:32 | gmpreussner | especially if that same value's ordinal has meaning in the used context |
16:55:05 | * | AckZ joined #nim |
16:58:59 | * | qazwsx quit (Quit: qazwsx) |
17:00:43 | * | filcuc quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) |
17:05:29 | gmpreussner | i'll think about it some more. it's probably ok the way it is |
17:05:43 | gmpreussner | we don't want C junk/limitations leak into Nim :) |
17:06:46 | * | bozalosh1sh quit (Ping timeout: 240 seconds) |
17:06:54 | * | aziz joined #nim |
17:08:35 | * | endragor joined #nim |
17:10:06 | * | CcxCZ quit (Ping timeout: 240 seconds) |
17:11:49 | * | CcxCZ joined #nim |
17:12:20 | * | pregressive joined #nim |
17:14:40 | * | endragor quit (Ping timeout: 245 seconds) |
17:17:27 | * | Salewski joined #nim |
17:18:51 | Salewski | gmpreussner: >how do you guys usually deal with this? |
17:19:34 | Salewski | I think we can use sets of enums -- it was my plan for do that for some enums in GTK |
17:22:34 | Salewski | I think I had done some basic tests already on year ago, I think it was ok. But one has to identify for which C enums one really needs sets. Of course plain (distint) int constants are simpler, but I like pure enums |
17:22:56 | gmpreussner | yeah, me too |
17:23:11 | gmpreussner | imho pure should be default, but that's another discussion :) |
17:23:33 | * | pregressive quit (Remote host closed the connection) |
17:25:15 | * | Salewski quit () |
17:30:30 | * | Jesin quit (Quit: Leaving) |
17:52:26 | * | qazwsx joined #nim |
17:57:11 | * | Jesin joined #nim |
17:57:28 | * | yglukhov quit (Ping timeout: 272 seconds) |
17:58:29 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
18:09:57 | * | pwernersbach_ quit (Ping timeout: 252 seconds) |
18:11:22 | * | endragor joined #nim |
18:15:50 | * | endragor quit (Ping timeout: 250 seconds) |
18:25:20 | * | qazwsx quit (Quit: qazwsx) |
18:35:31 | * | Matthias247 joined #nim |
18:36:36 | * | pregressive joined #nim |
18:37:49 | * | yglukhov joined #nim |
18:42:10 | * | yglukhov quit (Ping timeout: 260 seconds) |
18:44:33 | * | brson joined #nim |
18:50:40 | * | gokr joined #nim |
18:51:10 | * | gokr1 joined #nim |
18:54:46 | * | gokr quit (Ping timeout: 240 seconds) |
18:55:27 | * | lompik joined #nim |
18:56:07 | * | yglukhov joined #nim |
18:56:54 | * | aziz quit (Remote host closed the connection) |
18:59:23 | * | derka joined #nim |
19:00:37 | * | pwerner joined #nim |
19:12:08 | * | endragor joined #nim |
19:12:33 | derka | Hi guys |
19:12:40 | derka | got a simple question for you |
19:12:57 | derka | Python lovers are called pythonist or pythonistas |
19:13:05 | derka | how do you call Nim programmers |
19:13:16 | derka | Nimrodian ? |
19:14:00 | ldlework | Nimian |
19:14:02 | derka | Nimrodian aspirations is the term used to denote an endeavor of materialistic philosophies to unite all society, nations, and/or humankind under .. |
19:14:06 | derka | Nimian ? really |
19:14:06 | derka | ok |
19:14:33 | * | Demon_Fox joined #nim |
19:14:36 | Varriount | I prefer Nimster |
19:14:49 | * | gokr1 quit (Quit: Leaving.) |
19:14:49 | derka | is there the equivalent of python import this somewhere in the code |
19:15:01 | ldlework | Nimdiot |
19:15:21 | ldlework | derka: have you written any Nim yet? |
19:15:23 | derka | Nimocrat |
19:15:32 | derka | I did a little little bit unfinished code |
19:15:45 | derka | check it here https://github.com/aallamaa/desirnim |
19:16:38 | * | endragor quit (Ping timeout: 272 seconds) |
19:19:17 | derka | has a bit of meta programming in it |
19:19:32 | derka | the library self generate the function at compile |
19:19:47 | derka | functionS |
19:20:39 | * | pregressive quit (Remote host closed the connection) |
19:22:29 | * | gokr joined #nim |
19:28:59 | * | lompik quit (Ping timeout: 264 seconds) |
19:29:40 | def- | derka: https://gist.github.com/def-/a72b39a25cd95252c464 import logo |
19:29:56 | derka | thx |
19:43:31 | * | yglukhov quit (Remote host closed the connection) |
19:44:09 | * | yglukhov joined #nim |
19:45:12 | * | vqrs quit (Max SendQ exceeded) |
19:45:30 | * | vqrs joined #nim |
19:59:48 | * | Varriount quit (Read error: Connection reset by peer) |
20:02:17 | * | pregressive joined #nim |
20:02:24 | * | yglukhov quit (Remote host closed the connection) |
20:06:40 | pwerner | derka: We're called Go deniers |
20:06:46 | pwerner | If you believe HN ;) |
20:06:49 | * | gour quit (Quit: WeeChat 1.3) |
20:07:02 | reactormonk | pwerner, more like type lovers |
20:08:45 | Sornaensis | hey guys why is Nim so amazing |
20:08:49 | * | Sornaensis cuddles Nim-lang |
20:09:28 | * | yglukhov joined #nim |
20:11:32 | * | BitPuffin quit (Ping timeout: 250 seconds) |
20:20:11 | derka | Nim is beautiful |
20:20:23 | pwerner | reactormonk: ha nice |
20:20:24 | derka | i have the same feeling i had when i’ve discovered python |
20:20:27 | derka | i just lack the REPL |
20:20:34 | Araq_ | 'nim secret' |
20:20:42 | Araq_ | but I heard it's still unusable |
20:21:17 | reactormonk | Araq_, could probably tinker one with readline, and a tempfile via nim -r c |
20:22:55 | * | junw quit (Ping timeout: 240 seconds) |
20:27:39 | derka | Araq you are good |
20:29:24 | def- | reactormonk: you mean like this? https://github.com/wheineman/nrpl |
20:30:36 | reactormonk | def-, neat. |
20:31:23 | * | bjz_ joined #nim |
20:31:46 | * | bjz quit (Ping timeout: 240 seconds) |
20:32:07 | derka | Nimian or Nimonk ? |
20:37:27 | * | tinAndi joined #nim |
20:44:18 | * | derka quit (Quit: derka) |
20:46:06 | * | xificurC joined #nim |
20:46:57 | gmpreussner | dom96: how do install local packages with nimble again? i don't have that package published on github yet. it's only on my PC right now. |
20:47:12 | gmpreussner | was it just nimble install localpath? |
20:47:53 | * | derka joined #nim |
20:55:25 | * | xtagon joined #nim |
20:58:02 | * | dom96_mobile joined #nim |
20:58:37 | dom96_mobile | Gmpreussner: just cd into the directory of your local pkg then run 'nimble install' |
20:59:03 | gmpreussner | awesome, thanks |
21:05:06 | * | dom96_mobile quit (Ping timeout: 240 seconds) |
21:10:00 | * | qazwsx joined #nim |
21:14:09 | * | Varriount joined #nim |
21:26:40 | * | darkf quit (Quit: Leaving) |
21:28:12 | * | jaco60 joined #nim |
21:34:34 | * | desophos joined #nim |
21:56:16 | * | bjz joined #nim |
21:56:50 | * | bjz_ quit (Ping timeout: 250 seconds) |
21:58:43 | * | bjz quit (Client Quit) |
22:01:05 | * | junw joined #nim |
22:01:29 | * | junw_ joined #nim |
22:01:54 | ldlework | Anyone hiring for Nim? |
22:02:22 | * | junw quit (Read error: Connection reset by peer) |
22:06:07 | wuehlmaus | derka: try tnim, i got used to it |
22:07:36 | * | derka quit (Quit: derka) |
22:08:23 | wuehlmaus | i use tnim together with tcc which speeds up compiling a lot |
22:09:53 | * | gmpreussner quit (Quit: kthxbye) |
22:10:05 | * | derka joined #nim |
22:13:20 | * | gmpreussner joined #nim |
22:14:02 | * | theduke joined #nim |
22:14:05 | theduke | exit |
22:14:09 | * | theduke left #nim (#nim) |
22:19:27 | dom96 | ooh, somebody just submitted this on HN http://programmingthomas.com/blog/2015/1/27/nim-on-ios |
22:20:35 | derka | thx member:wuehlmaus |
22:24:14 | wuehlmaus | derka: don't get confused, if you got an error, you have to hit \c to start anew. that was difficult for me to get used to. but it DOES help me a lot to try stuff of nim. |
22:24:33 | derka | ok |
22:24:35 | ldlework | I just write /tmp/test.nim |
22:24:36 | derka | cool |
22:24:43 | ldlework | and then nim c -r /tmp/test.nim |
22:24:45 | ldlework | pretty easy |
22:25:00 | ldlework | helps me test stuff with nim ;) |
22:25:38 | wuehlmaus | there is another project done in python that helps to try out languages, it's called hsandbox |
22:25:45 | wuehlmaus | i used that before. |
22:41:04 | * | Dildosan joined #nim |
22:41:14 | * | quark1 joined #nim |
22:42:26 | * | quark1 quit (Read error: Connection reset by peer) |
22:42:28 | * | junw joined #nim |
22:43:06 | * | quark1 joined #nim |
22:43:55 | * | junw_ quit (Ping timeout: 240 seconds) |
22:46:45 | * | junw quit (Ping timeout: 245 seconds) |
22:46:46 | * | bjz joined #nim |
22:48:00 | gmpreussner | dom96: i see that dashes (-) in package names are deprecated in nimble. i got two questions: 1) is it ok to rename the package and repo on github and update the package.json, 2) what is the recommendation for package naming to make them unique? |
22:53:57 | * | saml quit (Remote host closed the connection) |
22:55:04 | dom96 | gmpreussner: 1) Yes, but keep the old entry with the dash as an alias. 2) There isn't really one, do other package managers have one? |
22:55:27 | gmpreussner | noidea |
22:55:44 | gmpreussner | but package names have to be unique in the package list, right? |
22:55:51 | gmpreussner | or does it distinguish by URL? |
22:56:08 | gmpreussner | i.e. can there be three different packages named 'opengl'? |
22:56:25 | gmpreussner | or would i have to come up with some sort of prefix or postfix? |
22:58:26 | gmpreussner | Perl, Python and Java use namespaces |
22:58:57 | gmpreussner | would foo.bar.opengl be a valid package name? |
22:59:14 | gmpreussner | i don't think anyone uses any sort of namespaces for packages right now |
23:00:25 | Araq_ | foo_bar_opengl ? |
23:00:58 | Araq_ | why is everybody obsessed with dots? |
23:01:06 | * | yglukhov quit (Read error: Connection reset by peer) |
23:01:13 | gmpreussner | just an example. it can be anything, of course |
23:01:22 | gmpreussner | from what i understand, Perl uses :: |
23:01:42 | gmpreussner | underscores work for me |
23:01:50 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:03:49 | dom96 | package names have to be unique |
23:05:31 | * | derka quit (Quit: derka) |
23:05:33 | dom96 | I don't think namespaces add that much |
23:17:26 | * | Dildosan quit (Quit: Leaving) |
23:18:43 | * | qazwsx quit (Quit: qazwsx) |
23:19:53 | * | yglukhov joined #nim |
23:34:09 | * | derka joined #nim |
23:39:46 | * | bjz joined #nim |
23:40:39 | * | xificurC quit (Quit: WeeChat 1.3) |
23:40:46 | * | derka quit (Quit: derka) |
23:41:38 | * | ehaliewicz joined #nim |
23:41:38 | * | ehaliewicz quit (Remote host closed the connection) |
23:45:35 | * | bjz_ joined #nim |
23:45:36 | * | bjz quit (Ping timeout: 250 seconds) |
23:54:21 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:56:53 | * | bjz joined #nim |
23:59:52 | * | zaquest quit (Ping timeout: 240 seconds) |