00:00:11 | Araq | vbtt_: but yes, the things are stable or getting stable |
00:00:20 | * | taesoo joined #nim |
00:00:52 | Araq | reactormonk: like gokr showed on his blog |
00:00:59 | * | vikaton joined #nim |
00:01:05 | vikaton | https://www.irccloud.com/pastebin/2AuJ4vL1 |
00:01:13 | reactormonk | People read blogs? ^^ |
00:01:27 | vikaton | I'm getting an assertion failed with that code sniipet right there :/ |
00:01:45 | * | dddddd quit (Ping timeout: 240 seconds) |
00:01:57 | vikaton | node.kind == JObject |
00:02:07 | vikaton | NOt quite sure why im getting it :[ |
00:02:30 | Araq | vikaton: data["score"] doesn't work for a json array |
00:02:35 | Araq | cause it makes no sense |
00:02:40 | Araq | data[0] would make sense |
00:02:44 | vikaton | o |
00:02:56 | vbtt_ | ok, great |
00:03:02 | vbtt_ | signing out.. ttyl |
00:03:06 | * | vbtt_ quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
00:04:14 | vikaton | Araq, yeah that seemed to work, but when I open output.json, it has nothing in it :( |
00:04:47 | def- | vikaton: you read output.json, you don't write it |
00:05:00 | Araq | good night |
00:05:04 | def- | oh wait |
00:05:20 | vikaton | I have a wrtieFile in it |
00:05:52 | Araq | zdsa: it's actually disturbing that he invented a "context" that's implicitly passed around for every function without realizing that it is the same as a thread local variable |
00:06:37 | def- | vikaton: works for me |
00:06:56 | vikaton | when u open the file in some other text editor it shows? |
00:07:00 | def- | yes |
00:07:27 | def- | maybe the output.json is in another directory than you expect? |
00:07:47 | vikaton | ... |
00:07:58 | vikaton | I was looking in the wrong folder -.- |
00:08:25 | vikaton | def- how do I append to a file? |
00:08:40 | Araq | good night |
00:08:52 | vikaton | night Araq |
00:08:52 | def- | vikaton: you open the file with mode fmAppend |
00:09:43 | def- | there is no convenience proc like writeFile for appending |
00:11:06 | vikaton | def-, docs on opening file with fmAppend? cuz I have no clue |
00:11:34 | def- | http://nim-lang.org/docs/system.html#open,File,string,FileMode,int |
00:12:05 | def- | var file = open("output.json", fmAppend) |
00:13:12 | vikaton | ah |
00:15:03 | * | vendethiel joined #nim |
00:15:39 | vikaton | def-, now im kinda confused, how can I utilize writeFile with file? |
00:15:42 | vikaton | or I cant? |
00:15:47 | def- | you can't |
00:16:13 | * | gokr quit (Quit: Leaving.) |
00:16:19 | def- | write(file, $foobar) |
00:16:24 | def- | and finally close(file) |
00:16:39 | vikaton | ah |
00:17:45 | dtscode | Instructions unclear def-. Dick got caught in fan. |
00:18:52 | * | boydgreenfield joined #nim |
00:34:07 | * | boydgreenfield quit (Quit: boydgreenfield) |
00:35:55 | * | vendethiel quit (Ping timeout: 256 seconds) |
00:36:27 | * | Jesin quit (Quit: Leaving) |
00:43:07 | jackv | what's the best detailed breakdown available of how to wrap a C library using c2nim? |
00:44:43 | def- | jackv: http://nim-lang.org/docs/c2nim.html and http://goran.krampe.se/2014/10/16/nim-wrapping-c/ and http://hookrace.net/blog/what-makes-nim-practical/#wrapping-libraries-with-c2nim are the ones I remember |
00:44:59 | jackv | ah thanks |
00:45:10 | jackv | yeah, I've seen yours |
00:57:50 | * | Jesin joined #nim |
00:59:17 | * | vikaton quit () |
01:08:11 | * | darkf joined #nim |
01:12:09 | jackv | well shit, c2nim doesn't like variadic macros apparently |
01:14:46 | * | dhasenan quit (Remote host closed the connection) |
01:15:32 | * | intra joined #nim |
01:18:12 | bassa | is there a high precision timer in the standard library? |
01:22:14 | jackv | what would be the best way to fix this line of code? https://gist.github.com/anonymous/df8c9714142c6a88d2dd |
01:26:54 | * | taesoo quit (Ping timeout: 252 seconds) |
01:28:31 | fowl | jackv, var unsupported_term_p: array[4,cstring] = ["dumb".cstring, "cons25", "emacs", nil] |
01:28:32 | fowl | var unsupported_term* = unsupported_term_p[0].addr |
01:35:16 | jackv | thanks fowl! |
01:35:26 | jackv | on to the next problem lol |
01:37:13 | * | Sembei quit (Ping timeout: 250 seconds) |
01:43:56 | * | shodan45 quit (Quit: Konversation terminated!) |
01:46:12 | * | gsingh93_ quit (Ping timeout: 276 seconds) |
01:51:58 | * | taesoo joined #nim |
01:54:45 | * | vendethiel joined #nim |
01:56:57 | * | allan0 quit (Ping timeout: 256 seconds) |
01:58:17 | * | brson joined #nim |
02:10:14 | * | allan0 joined #nim |
02:10:32 | * | BitPuffin|osx joined #nim |
02:21:52 | * | vendethiel quit (Ping timeout: 255 seconds) |
02:31:31 | * | BitPuffin|osx quit (Ping timeout: 256 seconds) |
02:53:11 | * | brson quit (Quit: leaving) |
03:18:51 | * | datanoise joined #nim |
03:24:16 | * | Jesin quit (Quit: Leaving) |
03:29:00 | * | Jesin joined #nim |
03:32:21 | * | Jesin quit (Client Quit) |
03:37:26 | * | tamtaradam joined #nim |
03:38:58 | tamtaradam | Hello! Anyone try to write pogramms for arduino or raw avr on nimrod? If yes: what performance did you get? |
03:43:58 | dtscode | Its nim now. Not nimrod |
03:48:23 | * | gsingh93_ joined #nim |
03:58:30 | ggVGc | my rod of nim |
03:59:34 | Varriount | tamtaradam: I believe it's been done, although I can't remember any links to specific examples. |
04:04:46 | tamtaradam | Russian community is lag. I have recently read article that use a "nimrod" name :) |
04:06:33 | * | boydgreenfield joined #nim |
04:10:42 | * | endragor joined #nim |
04:16:37 | * | zahary quit (Read error: Connection reset by peer) |
04:16:50 | * | datanoise quit () |
04:17:27 | * | ddl_smurf quit (Quit: ddl_smurf) |
04:27:56 | * | iamd3vil joined #nim |
04:30:39 | federico3 | tamtaradam: do you have any docs on nim for arduino? |
04:31:38 | * | iamd3vil quit (Remote host closed the connection) |
04:32:31 | tamtaradam | No. I don`t find some goods yet. |
04:36:41 | * | endragor quit (Remote host closed the connection) |
04:41:10 | * | jbomo left #nim (#nim) |
04:43:23 | * | datanoise joined #nim |
04:49:42 | reactormonk | federico3, tried it, gave up |
04:49:47 | reactormonk | too much heap stuff |
04:50:46 | * | datanoise quit (Quit: WeeChat 1.1.1) |
04:52:26 | * | endragor joined #nim |
04:55:13 | reactormonk | Araq, what do you think tossing the JS backend and go via emscripten instead? |
04:55:33 | tamtaradam | Okay. Is a good practic to use a raw C/C++ library via nim? I want to use a gameplay game engine. What problems I will solve? |
04:55:37 | * | taesoo quit (Ping timeout: 264 seconds) |
04:56:42 | reactormonk | tamtaradam, sure, not a problem. Via importc, or you can even use c2nim on the header file. |
04:57:09 | reactormonk | tamtaradam, less toothpicks, more expressive, still fast. |
04:58:41 | reactormonk | "but these are my 2mBTC anyhoo" ^^ |
04:59:40 | tamtaradam | reactormonk, thank you :) If we go to one country, i`ll get some cookie to you :) |
05:00:25 | tamtaradam | I love coockies :) |
05:04:20 | * | tribalNerd joined #nim |
05:05:56 | * | tribalNerd quit (Quit: Leaving) |
05:07:10 | * | gsingh93_ quit (Ping timeout: 272 seconds) |
05:13:06 | reactormonk | tamtaradam, working out so far? |
05:15:19 | tamtaradam | Gameplay? Yes, recently they upgrade gameplay`s site |
05:16:10 | reactormonk | your nim adventures. |
05:20:04 | tamtaradam | In siberia :) |
05:24:07 | tamtaradam | May be I don`t understand you, my english is bad :) |
05:35:55 | * | yglukhov___ joined #nim |
05:40:20 | * | yglukhov___ quit (Ping timeout: 246 seconds) |
05:54:20 | * | tamtaradam quit (Quit: Page closed) |
05:57:38 | * | johnsoft quit (Ping timeout: 256 seconds) |
05:58:23 | * | johnsoft joined #nim |
06:14:20 | reactormonk | Araq, btw, where's the file cache logic? The stuff which reads the cached files, so you don't compile a project again |
06:38:29 | * | IronY quit (*.net *.split) |
06:50:11 | * | zahary joined #nim |
07:01:10 | * | xcombelle joined #nim |
07:04:40 | * | endragor_ joined #nim |
07:07:50 | * | endragor quit (Ping timeout: 246 seconds) |
07:17:13 | * | IronY joined #nim |
07:19:01 | * | endragor_ quit (Remote host closed the connection) |
07:19:50 | * | endragor joined #nim |
07:21:07 | * | BlaXpirit joined #nim |
07:24:13 | * | Ven joined #nim |
07:24:20 | * | yglukhov___ joined #nim |
07:25:38 | * | endragor quit (Remote host closed the connection) |
07:39:44 | * | gokr joined #nim |
07:42:28 | * | shodan45 joined #nim |
07:49:37 | * | xcombelle quit (Ping timeout: 264 seconds) |
08:02:39 | * | xcombelle joined #nim |
08:05:22 | * | coffeepot joined #nim |
08:09:57 | * | xcombelle1 joined #nim |
08:10:37 | * | xcombelle quit (Ping timeout: 264 seconds) |
08:11:19 | * | xcombelle joined #nim |
08:18:26 | * | xcombelle2 joined #nim |
08:18:33 | * | xcombelle_ joined #nim |
08:19:04 | * | xcombelle1 quit (Disconnected by services) |
08:19:11 | * | xcombelle2 is now known as xcombelle1 |
08:20:39 | * | xcombelle quit (Ping timeout: 250 seconds) |
08:20:58 | * | dtscode quit (Ping timeout: 255 seconds) |
08:24:26 | * | Sembei joined #nim |
08:27:29 | * | endragor joined #nim |
08:28:18 | * | Trustable joined #nim |
08:28:26 | * | xcombelle joined #nim |
08:28:27 | * | xcombelle__ joined #nim |
08:28:53 | * | xcombelle_ quit (Ping timeout: 250 seconds) |
08:29:08 | * | xcombelle1 quit (Ping timeout: 265 seconds) |
08:29:40 | * | boydgreenfield quit (Quit: boydgreenfield) |
08:29:40 | * | kokozedman joined #nim |
08:30:50 | kokozedman | hey guys, is there a kind of way to multiple TChannel for inputs, that is: waiting for multiple messages from multiple TChannel... similar as in Golang |
08:30:55 | kokozedman | ? |
08:36:32 | * | xcombelle1 joined #nim |
08:37:16 | * | xcombelle_ joined #nim |
08:37:21 | * | xcombelle quit (Ping timeout: 240 seconds) |
08:37:26 | * | xcombelle__ quit (Ping timeout: 246 seconds) |
08:38:35 | * | bluenote quit (Quit: Page closed) |
08:38:50 | * | bluenote joined #nim |
08:39:22 | * | boydgreenfield joined #nim |
08:51:07 | * | xcombelle_ quit (Ping timeout: 255 seconds) |
08:53:18 | * | xcombelle1 quit (Ping timeout: 265 seconds) |
08:54:07 | * | xcombelle joined #nim |
08:55:37 | * | boydgreenfield quit (Quit: boydgreenfield) |
09:01:00 | * | johnsoft quit (Ping timeout: 272 seconds) |
09:01:08 | * | johnsoft joined #nim |
09:01:42 | * | xcombelle quit (Ping timeout: 276 seconds) |
09:02:41 | * | xcombelle joined #nim |
09:02:49 | * | xcombelle_ joined #nim |
09:09:01 | * | xcombelle1 joined #nim |
09:10:55 | * | xcombelle quit (Ping timeout: 250 seconds) |
09:11:37 | * | xcombelle_ quit (Ping timeout: 258 seconds) |
09:12:24 | * | xcombelle_ joined #nim |
09:17:43 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:21:34 | * | shodan45 quit (Quit: Konversation terminated!) |
09:22:58 | * | xcombelle1 quit (Quit: WeeChat 1.2) |
09:25:17 | * | Kingsquee quit (Remote host closed the connection) |
09:48:52 | * | boopisaway quit (Ping timeout: 252 seconds) |
09:58:23 | * | Kingsquee joined #nim |
10:08:04 | dom96 | kokozedman: Don't think there is. Create a github issue for that :) |
10:15:36 | * | bjz joined #nim |
10:20:28 | * | bjz quit (Ping timeout: 244 seconds) |
10:21:13 | * | BlaXpirit-UA joined #nim |
10:21:52 | * | BlaXpirit quit (Ping timeout: 252 seconds) |
10:29:48 | * | ddl_smurf joined #nim |
10:31:29 | * | xcombelle__ joined #nim |
10:32:19 | * | xcombelle_ quit (Ping timeout: 264 seconds) |
10:40:26 | * | xcombelle__ quit (Ping timeout: 272 seconds) |
10:42:30 | * | dddddd joined #nim |
10:52:23 | * | xcombelle__ joined #nim |
10:54:27 | coffeepot | what types do people use as buffers when interfacing with C? array of bytes? cstring? |
10:55:06 | coffeepot | specifically I want to be able to write data such as int, bool or strings to the buffer for a C call |
10:56:45 | * | bjz joined #nim |
11:00:24 | * | ddl_smurf quit (Quit: ddl_smurf) |
11:00:29 | dom96 | coffeepot: depends what the C function expects, cstring most of the time. |
11:00:42 | * | Ven joined #nim |
11:00:47 | * | TEttinger joined #nim |
11:01:39 | coffeepot | that's what I've been using, so when writing, say, an int to a cstring, how do I do that? I gather there's a cast involved somehow |
11:02:28 | * | xcombelle__ quit (Ping timeout: 272 seconds) |
11:02:29 | coffeepot | also when reading, cast[float](buffer) would work? or do I need to do cast[float](buffer[0]) |
11:03:27 | coffeepot | when writing, if buffer is cstring, do I do buffer[0] = cast[cstring](data)? |
11:03:49 | coffeepot | if there's some doc somewhere that deals with this, i'll read that :) |
11:04:51 | dom96 | hrm |
11:05:49 | * | dom96 isn't sure anymore heh |
11:06:36 | coffeepot | yeah I kinda just hit this and was like... um hang on I dunno what I'm doing here |
11:06:55 | coffeepot | gotta be careful methinks, as this is gonna be unsafe |
11:06:59 | dom96 | what are you interfacing with? |
11:07:11 | coffeepot | odbc |
11:07:32 | coffeepot | specifically SQLBindParameter |
11:07:40 | * | xcombelle__ joined #nim |
11:09:34 | dom96 | What does it expect? an untyped pointer for the data? |
11:09:43 | coffeepot | yeah :/ |
11:10:00 | dom96 | I think you should do something like this then: |
11:10:20 | dom96 | var f = 0.56; sqlBindParam(addr(f)) |
11:11:12 | dom96 | but then I'm not sure how long `f` has to live for |
11:11:15 | dom96 | so that might be wrong |
11:11:15 | coffeepot | trouble is, odbc doesn't copy the data, so I have to retain a buffer for it until after the query's executed :/ |
11:11:21 | dom96 | ahh yes |
11:11:26 | coffeepot | yeah I think i'll need to keep hold ofit |
11:11:28 | coffeepot | of it |
11:11:39 | coffeepot | odbc is such a PITA |
11:12:53 | dom96 | var floatDataPtr = alloc0(sizeof(float)); floatDataPtr[] = 0.56; sqlBindParam(floatDataPtr) |
11:13:21 | coffeepot | that looks like the job :) |
11:13:39 | dom96 | actually, you probably have to cast[ptr float](alloc0(sizeof(float))) |
11:13:54 | dom96 | but I would get a second opinion |
11:13:57 | coffeepot | so one last question, hows about reading in multi byte values like float or int from a buffer? |
11:13:58 | dom96 | I could be entirely wrong lol |
11:14:25 | coffeepot | I'll be glad when I can stop tinkering with c intf stuff and get back to pure nim tbh :) |
11:15:35 | * | xcombelle__ quit (Read error: Connection reset by peer) |
11:15:38 | coffeepot | for eg; on the read I can do cast[int](buffer[0]) to get the correct int, but I'm not sure if that'd work for longer ints? |
11:15:39 | * | xcombelle_ joined #nim |
11:15:42 | dom96 | let bufferPtr = sqlGetBuffer(); let floatData = cast[ptr float](bufferPtr)[] |
11:15:44 | dom96 | I think |
11:15:56 | coffeepot | ah ok that makes sense :) |
11:16:08 | dom96 | Depends what ODBC returns really I guess |
11:16:32 | dom96 | but do get a second opinion because my code may work, but it may still be wrong. |
11:16:42 | dom96 | also, make sure to dealloc your stuff :P |
11:16:51 | coffeepot | odbc tells me the type as a standard c type so I can interpret it to a nim type |
11:16:56 | coffeepot | ah how do I dealloc? |
11:20:08 | coffeepot | looks like it's just dealloc :) |
11:20:27 | coffeepot | many many thanks for your help dom96, i'll try it out and ask if I get any problems :) |
11:20:45 | dom96 | ^^ yep |
11:20:47 | dom96 | np :) |
11:21:29 | coffeepot | i just found more info here for anyone else wondering http://nim-lang.org/docs/manual.html#types-reference-and-pointer-types |
11:21:58 | coffeepot | storing a tuple in a buffer :) |
11:22:22 | coffeepot | going to assume that the floating point format of C is the same as nim :) |
11:40:21 | * | strcmp1 quit (Ping timeout: 258 seconds) |
11:46:54 | Araq | coffeepot: keep in mind that C's float is float32 in Nim and double is Nim's float |
11:47:52 | Araq | also what dom suggests is essentially correct but I prefer ptr array[Arbitrary, float] over ptr float |
11:50:27 | * | Ven quit (Read error: No route to host) |
11:54:45 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:55:29 | coffeepot | ok Araq, thanks very much for the info :) |
11:56:22 | * | xcombelle_ quit (Quit: Leaving) |
11:56:30 | * | xcombelle_ joined #nim |
11:56:53 | coffeepot | although I'm not auite sure what you mean by Arbitary in this context |
11:57:19 | Araq | const Arbitrary = 50_000 # Araq's way |
11:57:22 | coffeepot | quite |
11:57:35 | coffeepot | ah ok :) cheers! |
11:57:41 | Araq | or you use .unchecked arrays but these are more cumbersome to use |
11:57:52 | Araq | mostly because system.nim lacks a type for it |
11:57:54 | Araq | bbs |
11:58:22 | coffeepot | I might post a code snippet when I feel it's working in case there's any gotchas I'm not aware of |
11:59:53 | * | ddl_smurf joined #nim |
12:03:29 | * | Ven joined #nim |
12:04:17 | * | taesoo joined #nim |
12:12:44 | * | xcombelle_ quit (Ping timeout: 245 seconds) |
12:19:08 | * | xcombelle_ joined #nim |
12:22:47 | * | banister quit (Read error: Connection reset by peer) |
12:25:04 | * | banister joined #nim |
12:31:19 | Araq | coffeepot: interfacing with sql server is important, please put this stuff in Nimble as soon as it's useful enough |
12:32:02 | * | xcombelle_ quit (Ping timeout: 252 seconds) |
12:34:34 | * | xcombelle_ joined #nim |
12:36:31 | * | zahary quit (Read error: Connection reset by peer) |
12:43:54 | coffeepot | Araq, yes for sure, when we have sql server support it makes business use of Nim much more feasible. Once I've got parameters sorted it'll probably be useful enough for most things and I'll put it in nimble. I'll probably be pestering you and others here about various things to make it more idiomatic :) |
12:44:03 | * | zahary joined #nim |
12:44:42 | coffeepot | for instance atm to set a parameter I have "setParam[int](qry, "id", 4)" but I think that could be improved |
12:45:29 | coffeepot | I have already got it running queries and returning results, and managed to couple it with http server so that it returns the query results in json |
12:46:01 | coffeepot | I haven't replaced my main data storage object with the json one yet though |
12:50:18 | coffeepot | running at 550 lines of nim atm! Compared with 237 for mysql (although I'm not just returning strings in the results, got a composite object) |
13:11:14 | * | BitPuffin|osx joined #nim |
13:20:28 | * | kokozedman_ joined #nim |
13:22:17 | * | drewsrem joined #nim |
13:22:41 | * | kokozedman quit (Ping timeout: 250 seconds) |
13:24:41 | * | phira quit (Excess Flood) |
13:25:12 | * | phira joined #nim |
13:25:14 | * | phira quit (Excess Flood) |
13:25:44 | * | phira joined #nim |
13:25:44 | * | phira quit (Excess Flood) |
13:26:48 | * | phira joined #nim |
13:26:49 | * | phira quit (Excess Flood) |
13:27:17 | * | phira joined #nim |
13:29:17 | * | xcombelle_ quit (Ping timeout: 265 seconds) |
13:32:06 | * | kokozedman_ quit (Ping timeout: 276 seconds) |
13:41:43 | * | xcombelle joined #nim |
13:45:05 | * | BlaXpirit_UA joined #nim |
13:46:21 | * | gokr quit (Quit: Leaving.) |
13:47:34 | * | BlaXpirit-UA quit (Ping timeout: 252 seconds) |
13:50:14 | * | xcombelle quit (Ping timeout: 244 seconds) |
13:52:35 | * | yglukhov___ quit (Ping timeout: 250 seconds) |
13:54:10 | * | kumul joined #nim |
13:54:41 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:55:05 | * | bjz joined #nim |
14:01:34 | * | xcombelle joined #nim |
14:08:46 | * | saml joined #nim |
14:14:57 | * | pregressive joined #nim |
14:16:10 | * | Jesin joined #nim |
14:19:28 | * | ingsoc quit (Ping timeout: 252 seconds) |
14:28:36 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:30:43 | * | darkf quit (Quit: Leaving) |
14:33:24 | * | banister joined #nim |
14:37:21 | * | xcombelle quit (Ping timeout: 240 seconds) |
14:52:46 | * | banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:56:21 | * | pregressive quit (Remote host closed the connection) |
15:02:47 | * | endragor quit (Ping timeout: 250 seconds) |
15:04:48 | * | pregressive joined #nim |
15:09:26 | * | banister joined #nim |
15:09:29 | * | zahary quit (Quit: Leaving.) |
15:18:36 | * | BlaXpirit_UA quit (Remote host closed the connection) |
15:20:34 | * | BlaXpirit joined #nim |
15:23:24 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:26:03 | * | pregressive quit (Remote host closed the connection) |
15:27:17 | * | Gonzih quit (Ping timeout: 258 seconds) |
15:29:12 | * | gsingh93 joined #nim |
15:30:32 | * | pipeep quit (Quit: Bye!) |
15:33:00 | * | Joe-T quit (Ping timeout: 276 seconds) |
15:33:26 | * | Ven joined #nim |
15:34:11 | * | Joe-T joined #nim |
15:36:35 | * | Ven_ joined #nim |
15:40:48 | * | Ven quit (Ping timeout: 276 seconds) |
15:44:42 | * | gsingh93 quit (Ping timeout: 276 seconds) |
15:47:58 | * | pregressive joined #nim |
15:50:46 | * | boop joined #nim |
15:54:53 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:58:05 | boop | can i use channels with async? |
15:58:21 | * | boydgreenfield joined #nim |
16:01:28 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:02:41 | boop | or.. hm |
16:02:58 | boop | i need to pass a message from one thread to another, the other thread is in a runForever() async loop running an ircbot |
16:03:03 | boop | what's the best way to do that? |
16:06:38 | * | kumool joined #nim |
16:08:02 | dom96 | boop: async with threads isn't really supported at the minute |
16:08:14 | boop | crud. |
16:08:18 | dom96 | boop: what are you using multiple threads for? |
16:08:18 | boop | any other solutions? |
16:08:36 | boop | dom96: forking stuff away from a call from DM that needs to not block |
16:08:43 | boop | can't get around it as far as I know :( |
16:09:15 | dom96 | DM? |
16:09:29 | boop | some silly little language/game engine :) |
16:09:41 | boop | it has a proc to call C dlls |
16:09:54 | boop | but it needs to return control to DM |
16:09:58 | dom96 | I guess you could create an async proc which checks the channel periodically |
16:10:01 | * | gsingh93 joined #nim |
16:10:10 | boop | hm |
16:10:15 | * | kumul quit (Ping timeout: 244 seconds) |
16:10:21 | boop | feels a bit icky |
16:10:45 | dom96 | proc pollChannel() {.async.} = while true: await sleepAsync(1000); if chan.peek > 0: ... |
16:10:50 | dom96 | something like that |
16:10:56 | * | boop nod |
16:11:04 | dom96 | yeah, that's the only way I can think of unfortunately. |
16:11:07 | boop | that'll work i suppose |
16:11:08 | boop | thanks! |
16:13:32 | * | brson joined #nim |
16:14:30 | bluenote | anyone aware of the exact hash function behind !& and !$ in hashes? |
16:14:55 | bluenote | I mean: Is it some famous hash function? |
16:34:11 | flaviu | bluenote: Nope. |
16:35:18 | flaviu | And it needs to be changed, it's absolutely terrible. |
16:38:49 | * | Matthias247 joined #nim |
16:43:50 | * | taesoo quit (Ping timeout: 272 seconds) |
16:44:29 | * | skyfex_____ joined #nim |
16:45:01 | bluenote | flaviu: oh, I didn't know, I thought it must be something fancy |
16:45:44 | * | kokozedman_ joined #nim |
16:46:29 | * | skyfex____ quit (Ping timeout: 265 seconds) |
16:49:31 | * | kokozedman_ quit (Client Quit) |
16:59:18 | * | Guest72 joined #nim |
17:01:44 | * | Guest72 quit (Quit: Textual IRC Client: www.textualapp.com) |
17:02:09 | * | Zerthis joined #nim |
17:09:03 | * | yglukhov____ joined #nim |
17:09:08 | * | ChrisMAN quit (Remote host closed the connection) |
17:10:25 | * | johnsoft quit (Ping timeout: 256 seconds) |
17:10:48 | * | johnsoft joined #nim |
17:14:22 | * | xcombelle joined #nim |
17:15:56 | * | johnsoft quit (Ping timeout: 256 seconds) |
17:16:09 | * | johnsoft joined #nim |
17:18:58 | * | ChrisMAN joined #nim |
17:20:49 | * | jbomo joined #nim |
17:20:51 | * | strcmp1 joined #nim |
17:30:51 | * | xcombelle quit (Ping timeout: 244 seconds) |
17:31:59 | * | Cyberfunk joined #nim |
17:34:47 | Cyberfunk | Hello. I'm trying to make HTTP requests with the net module. Here's my first attempt : https://pastee.org/6fw8k . But it doesn't work, I don't receive any response from Google. Could someone help me, please ? |
17:40:05 | BlaXpirit | Cyberfunk, maybe u need some more \r\n |
17:40:26 | * | xcombelle joined #nim |
17:41:14 | BlaXpirit | nvm |
17:41:21 | BlaXpirit | it should probably be \r\l |
17:42:01 | def- | Cyberfunk: s.recv blocks until it received 1024 bytes |
17:42:15 | Cyberfunk | It works with \r\n\r\n. But as Google redirects to something like https://www.google.fr/webhp?gfe_rd=cr&ei=F2pfVZbgIcXH8geBzYDoBw, I need to parse the response, looking for "Location: []" |
17:42:30 | Cyberfunk | Thanks! |
17:44:05 | * | xcombelle_ joined #nim |
17:44:17 | * | kumool quit (Ping timeout: 244 seconds) |
17:45:48 | Cyberfunk | <p>Your client has issued a malformed or illegal request. <ins>That’s all we know.</ins> |
17:46:31 | Cyberfunk | Looks like it's missing something... |
17:46:42 | BlaXpirit | no idea what 'Host: google.com' is supposed to mean |
17:47:20 | BlaXpirit | well it's correct though, don't mind me |
17:48:11 | Cyberfunk | You're right, I just removed the line sending this and it works |
17:48:25 | Cyberfunk | "HTTP/1.1 200 OK" |
17:49:10 | * | kumul joined #nim |
17:51:13 | * | filcuc joined #nim |
17:51:31 | * | xcombelle_ quit (Ping timeout: 244 seconds) |
17:52:11 | * | xcombelle1 joined #nim |
17:52:11 | * | xcombelle_ joined #nim |
17:52:22 | * | xcombelle quit (Ping timeout: 272 seconds) |
17:54:00 | * | kumool joined #nim |
17:55:30 | * | xcombelle1 quit (Client Quit) |
17:55:35 | * | xcombelle joined #nim |
17:57:10 | * | Zerthis quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
17:57:47 | * | xcombelle1 joined #nim |
17:58:01 | * | kumul quit (Ping timeout: 265 seconds) |
17:58:22 | * | tamtaradam joined #nim |
17:58:29 | * | xcombelle_ quit (Ping timeout: 246 seconds) |
17:58:37 | * | xcombelle_ joined #nim |
17:58:40 | * | bluenote quit (Ping timeout: 246 seconds) |
18:00:14 | * | xcombelle quit (Ping timeout: 258 seconds) |
18:00:36 | * | boydgreenfield quit (Quit: boydgreenfield) |
18:05:38 | * | xcombelle_ quit (Quit: Leaving) |
18:05:46 | * | xcombelle_ joined #nim |
18:05:46 | * | xcombelle joined #nim |
18:05:58 | * | xcombelle1 quit (Read error: Connection reset by peer) |
18:11:04 | * | xcombelle_ quit (Ping timeout: 265 seconds) |
18:11:22 | * | xcombelle quit (Ping timeout: 272 seconds) |
18:12:32 | * | pregressive quit (Remote host closed the connection) |
18:14:31 | * | endragor joined #nim |
18:14:39 | * | xcombelle joined #nim |
18:16:03 | * | xcombelle quit (Read error: Connection reset by peer) |
18:16:12 | * | xcombelle1 joined #nim |
18:18:50 | * | endragor quit (Ping timeout: 256 seconds) |
18:19:47 | * | xcombelle joined #nim |
18:20:49 | * | xcombelle1 quit (Ping timeout: 255 seconds) |
18:23:09 | * | xcombelle quit (Client Quit) |
18:23:10 | * | xcombelle_ joined #nim |
18:23:17 | * | xcombelle joined #nim |
18:24:32 | * | xcombelle quit (Client Quit) |
18:24:38 | * | xcombelle joined #nim |
18:31:06 | * | xcombelle quit (Ping timeout: 276 seconds) |
18:31:26 | * | xcombelle_ quit (Ping timeout: 265 seconds) |
18:39:54 | * | tamtaradam quit (Quit: Page closed) |
18:45:40 | * | gsingh93 quit (Ping timeout: 252 seconds) |
18:46:02 | * | boydgreenfield joined #nim |
18:50:37 | * | fizzbooze joined #nim |
19:03:45 | * | endragor joined #nim |
19:04:35 | * | kumul joined #nim |
19:05:50 | * | endragor_ joined #nim |
19:06:06 | * | noneofmynickswor joined #nim |
19:06:52 | * | endragor quit (Read error: Connection reset by peer) |
19:06:57 | * | kumool quit (Ping timeout: 240 seconds) |
19:07:18 | Cyberfunk | How do I get the len of a string, please ? Like with len() in Python |
19:09:18 | * | endragor_ quit (Remote host closed the connection) |
19:09:21 | * | ddl_smurf quit (Quit: ddl_smurf) |
19:09:32 | * | kumul quit (Ping timeout: 246 seconds) |
19:10:06 | * | filcuc quit (Ping timeout: 265 seconds) |
19:11:09 | strcmp1 | has anyone worked on something similar to bundler in ruby land for nim? if you arent familiar, it can lock down packages and their dependencies to specific versions, so its like a snapshot of packages at a specific time, and supports installing packages relative to your apps root |
19:14:25 | reactormonk | strcmp1, nope, because dependency management is a bitch |
19:14:39 | reactormonk | but it should be easier with nimble because there's no global namespace |
19:20:05 | fowl | strcmp1: we dont need it because nimble can live with multiple versions of the same package without blowing up |
19:20:29 | Araq | Cyberfunk: use len() |
19:22:47 | * | boop is now known as boopisaway |
19:23:09 | * | boopisaway is now known as boop |
19:24:08 | * | drewsrem quit (Quit: Leaving) |
19:25:40 | strcmp1 | fowl, bundler lets you specify dependencies for a project as well as install them. i guess a shell script could work too |
19:26:46 | fowl | strcmp1: nimble handles that |
19:27:49 | strcmp1 | cool ill check it out |
19:33:22 | reactormonk | ok, so I was misinformed. |
19:33:32 | * | boop is now known as boopisaway |
19:33:49 | * | boopisaway is now known as boop |
19:37:12 | * | boop is now known as boopisaway |
19:37:29 | * | boopisaway is now known as boop |
19:39:36 | * | ingsoc joined #nim |
19:40:06 | Araq | fowl: http://forum.nim-lang.org/t/1252 |
19:42:41 | fowl | I'll reply |
19:42:57 | * | boop is now known as boopisaway |
19:43:19 | * | boopisaway is now known as boop |
19:43:45 | * | ddl_smurf joined #nim |
19:44:37 | * | boop is now known as boopisaway |
19:44:49 | * | boopisaway is now known as boop |
19:45:04 | Araq | ty |
19:46:45 | Cyberfunk | Thanks Araq ! |
19:46:46 | * | gsingh93 joined #nim |
19:47:42 | * | boop is now known as boopisaway |
19:47:54 | * | boopisaway is now known as boop |
19:49:01 | reactormonk | fowl, I mean xeq would make a decent PR |
19:50:39 | * | saml quit (Quit: Leaving) |
19:52:46 | * | jbomo quit (Ping timeout: 252 seconds) |
19:54:58 | * | fizzbooze quit (Ping timeout: 252 seconds) |
19:59:28 | reactormonk | Araq, btw, where's the code that reads cache files, nimsuggest gets the correct results the first time after all |
20:00:12 | Araq | compiler/modules.nim has the caching logic |
20:00:34 | Araq | it's based on CRC checksums (yes, flaviu, take that! ;-) ) |
20:01:07 | * | boop is now known as boopisaway |
20:01:49 | * | boopisaway is now known as boop |
20:01:58 | * | Jehan_ joined #nim |
20:04:21 | reactormonk | not even md5? ^^ |
20:05:19 | * | noneofmynickswor quit (Ping timeout: 264 seconds) |
20:05:20 | Araq | reactormonk: the compiler predates md5 (just kidding) |
20:12:08 | * | dtscode joined #nim |
20:17:21 | Jehan_ | Heh. :) |
20:17:54 | Araq | Jehan_: I've never been more excited about a Nim enhancement proposal ... *wink* |
20:18:19 | Jehan_ | Araq: I'll try to get it done this weekend, but I've been sick all week. |
20:18:32 | Araq | ugh, bummer |
20:19:08 | Quora | Is there a way to make nimble query a different URL for package lists? |
20:19:22 | Jehan_ | Just a very nasty cold, but it did lay me out flat. |
20:19:24 | def- | Quora: yes, nimble update <list> |
20:19:28 | Quora | ah okay |
20:19:44 | Quora | Nim so far has been an amazing language for my needs. Thank you to all who work on it! |
20:19:58 | Quora | it's just the perfect balance between Python, Haskell and C |
20:20:31 | Araq | thanks, always nice to hear. :-) |
20:20:57 | Quora | that idea for html templates to just be nim code |
20:21:00 | Quora | that is just amazing |
20:22:02 | Quora | so far though I've been doing as much of a clean MVC-style isolation as I can |
20:23:58 | * | vikaton joined #nim |
20:26:22 | Quora | the explicit discard though |
20:26:42 | vikaton | does Nim's IRC module have some sort of sleep function when they send messages? |
20:26:48 | * | gsingh93 quit (Ping timeout: 276 seconds) |
20:27:05 | Quora | vikaton: it has flood protection yes |
20:27:34 | vikaton | no wonder it took some time to send 10 messages at once :P |
20:27:57 | def- | Quora: you can make your proc {.discardable.} |
20:28:09 | Quora | def-: I prefer the explicit "I am ignoring this" |
20:28:49 | * | Cyberfunk quit (Ping timeout: 246 seconds) |
20:32:09 | Araq | Quora: IMHO the explicit discard has improved the quality of error checking in the stdlib tremendously |
20:32:57 | Quora | Araq: I bet! |
20:33:15 | Araq | not sure what's not to like about this feature |
20:34:52 | * | kumul joined #nim |
20:35:24 | * | ingsoc quit (Ping timeout: 256 seconds) |
20:37:34 | fowl | I think it should only be required for ref types |
20:38:24 | Araq | why? posix returns cint error codes |
20:38:59 | fowl | They're safe to ignore |
20:39:34 | * | kumul quit (Ping timeout: 272 seconds) |
20:42:12 | Araq | what? |
20:42:26 | Araq | posix's return values are safe to ignore? |
20:45:34 | * | kumul joined #nim |
20:47:28 | * | pregressive joined #nim |
20:52:08 | * | Jesin quit (Quit: Leaving) |
20:52:45 | Jehan_ | For what it's worth, I'd really love for Scala to borrow Nim's discard feature. And I know I'm not the only person who thinks this way. |
20:55:52 | fowl | Nobody actually checks return values |
20:56:11 | Jehan_ | fowl: Umm, I do? If only for >= 0. |
20:58:25 | * | Jesin joined #nim |
21:00:56 | Matthias247 | Jehan_: f# has something similar with ignore |
21:01:50 | zdsa | explicit discard is a must imo |
21:02:02 | Jehan_ | Matthias247: it's not new. I had an "ignore (x: ANY)" routine in Eiffel decades ago, and I'm pretty sure I didn't come up with the idea myself. :) |
21:02:26 | zdsa | just today i had to debug someone code, and the error was |
21:02:37 | Jehan_ | And Eiffel was the one language that arguably needed it the least, because functions with side effects were discouraged in Eiffel. |
21:02:42 | zdsa | merging 2 things, and forgetting to assign to a variable the resuult |
21:02:55 | zdsa | so no change on the merge |
21:03:01 | Matthias247 | I need it there even more often - because I still try to mutate things with = |
21:03:13 | Matthias247 | But I agree that it's a good feature in general |
21:03:36 | zdsa | just like explicit mutability imo |
21:04:08 | zdsa | i just wish nim could inforce a big more immutability, even on ref types |
21:04:11 | Jehan_ | It's really just a typechecking thing. Statements should be of type Unit. |
21:04:14 | zdsa | bit more* |
21:04:54 | Jehan_ | zdsa: That might be a nice thing to have, at least as an option. |
21:05:16 | zdsa | Jehan_: for now i just try to never pass refs |
21:05:21 | zdsa | let the compiler optimize it away |
21:05:54 | Jehan_ | zdsa: Well, as soon as you've got heap-allocated objects, you can't. |
21:06:10 | Jehan_ | make do without refs, I mean. |
21:06:47 | zdsa | what i mean is when i want a function to act on immutable, never accept a ref |
21:06:55 | zdsa | and pass it as ref[] |
21:07:07 | zdsa | im pretty sure its probably passing the pointer anyway |
21:07:09 | zdsa | or not |
21:07:14 | zdsa | i should look at the compiled code |
21:08:01 | Jehan_ | zdsa: It should, unless sizeof(ref[]) is small. |
21:08:24 | Jehan_ | Returning objects can be a different story. |
21:08:25 | zdsa | yes of course, |
21:08:57 | Jehan_ | I still haven't worked out exactly when Nim uses a result pointer in the C code and when it doesn't. |
21:09:16 | zdsa | i read that in nim if you do: var x = proc f() |
21:09:25 | zdsa | and you use the result variable |
21:09:36 | zdsa | it just passes a pointer |
21:10:26 | zdsa | but yes its hard sometimes to know exactly what happens compared to be explicit with ptr or refs etc |
21:10:51 | zdsa | for now i mostly try to play with values and not try to optimize with ref |
21:10:56 | fowl | There are byref bycopy pragmas to control that |
21:11:05 | zdsa | o cool |
21:12:26 | Jehan_ | zdsa: Not always. It usually does for types where it matters. |
21:12:44 | Jehan_ | I'm just not sure what the heuristic is. |
21:13:10 | boydgreenfield | Araq: I spent a bit of time digging into the inheritance + generics issue (#88, the oldest open issue!: https://github.com/Araq/Nim/issues/88). But, I don’t think I’m going to be able to fix it w/o a fairly massive investment in getting up to speed on the compiler code, which is… formidable. Is `zah` (assigned on Github) actively working on this, or is that stale? Still happy to help however I can. |
21:13:23 | zdsa | yeh as long as it doesnt returns a 10k value array lol |
21:14:03 | zdsa | i really like nim, if i wouldnt have found nim i would still be programming in rust :D |
21:14:21 | zdsa | nim is more pragmatic imo |
21:14:29 | zdsa | for everyday programming |
21:15:13 | zdsa | i just hope nim doesnt get too much OOP centric with crazy inheritance |
21:15:47 | Jehan_ | zdsa: Heh, I'd like Nim to be just a tad more OOP crazy. :) |
21:15:54 | Jehan_ | But I think Araq is on your side there. :) |
21:16:09 | zdsa | i like the struct + functions on structs |
21:16:11 | zdsa | with traits |
21:16:16 | zdsa | like rust |
21:16:21 | zdsa | or like nim :) |
21:16:38 | zdsa | but the extra oop is ok right now |
21:17:15 | fowl | zdsa: you know about concepts right? |
21:17:19 | zdsa | yes |
21:17:25 | zdsa | thats why i said :like nim |
21:17:35 | zdsa | trait aka concepts |
21:17:40 | zdsa | im just used to the word |
21:17:44 | * | vbtt_ joined #nim |
21:18:40 | fowl | zdsa: we can use a concept to generate a detached type that holds a vtable with the relevant functions |
21:19:21 | Jehan_ | fowl: Yeah, that's something that I'd like to so. |
21:19:25 | Jehan_ | see* |
21:19:27 | zdsa | the only major thing needed right now for oop i think is just a .privateConstructor. |
21:19:33 | zdsa | for the type constructor |
21:19:34 | fowl | Jehan_: https://bitbucket.org/fowlsoft/interfaces/wiki/Home |
21:20:26 | zdsa | but its not that bad imo if you just always use a named constructor |
21:20:37 | * | golinuxer joined #nim |
21:21:26 | golinuxer | I'm new to nim. Are there any nim modules for resizing images like jpgs or pngs? |
21:21:40 | Jehan_ | fowl: That's sort of what I'd been getting at, except with structural typing and less boilerplate. |
21:21:58 | * | saml_ joined #nim |
21:22:04 | zdsa | structural typing is so much fun |
21:22:13 | zdsa | have you tried Elm? |
21:22:19 | golinuxer | Elm? |
21:22:35 | zdsa | http://elm-lang.org/ |
21:22:39 | fowl | Jehan_: the boilerplate is hidden behind a macro |
21:22:42 | Jehan_ | zdsa: I've only looked at it, but the application domain is not something I need much. |
21:22:59 | Jehan_ | zdsa: Structural typing is a lot older than that, though. |
21:24:17 | golinuxer | Does anyone know of a nim package that supports resizing images like jpgs or pngs? |
21:25:09 | zdsa | Jehan_: im not using it myself, but after playing with it, the structural syntax + the record update method is so much more practical than in haskell |
21:25:17 | zdsa | structural typing* |
21:25:51 | zdsa | no need for lenses in nim because of it |
21:26:09 | zdsa | of course its not on the same level but i like the idea |
21:26:25 | golinuxer | This IRC channel does not seem to be as friendly as Go langs. Wow. |
21:26:26 | zdsa | in elm* |
21:26:34 | Jehan_ | fowl: There's still more noise than needed in writing out the adapter rather than having the compiler inferring it. |
21:27:04 | golinuxer | Nim seems to be an interesting language with no community. |
21:27:26 | zdsa | golinuxer: http://nim-lang.org/docs/lib.html |
21:27:40 | zdsa | there is probaly 20 of them |
21:28:22 | fowl | Lol...nobody answered my question immediately. The community must not be friendly |
21:28:55 | zdsa | dat trollin masterbait |
21:29:01 | golinuxer | What's the name of them? |
21:29:08 | golinuxer | I only see libpng |
21:29:09 | zdsa | any graphic library |
21:29:10 | zdsa | devil |
21:29:12 | zdsa | sdl |
21:29:13 | zdsa | sfml |
21:29:15 | zdsa | etc etc |
21:29:25 | Jehan_ | golinuxer: It's a smaller community. There are fewer people who will know the answers off the top of their heads. |
21:29:43 | golinuxer | Okay, I see. |
21:29:45 | zdsa | search for a popular C library that can do it |
21:29:53 | zdsa | and its probably wrapped in nim |
21:30:30 | fowl | Jehan_: yea ideally it would be created on demand, I wrote this to figure out the logistics first (what do we need to ensure that it doesn't break, for ex if a varargs function is used to fulfill a behavior it will have a different function sig) |
21:31:11 | zdsa | golinuxer: Devil, FreeImage, sdl, sfml |
21:31:16 | zdsa | there is probably others |
21:31:24 | golinuxer | Okay. I noticed freeimage. |
21:31:38 | golinuxer | Have you actually used anyone of the listed? |
21:31:48 | golinuxer | Which one is simplest to use? |
21:31:58 | Jehan_ | fowl: The concept that I worked out for my own language basically had signature declarations that had their dispatch tables auto-inferred for this, plus a concept of views that allowed you to adapt a type to a different signature. |
21:32:04 | zdsa | no idea im mostly doing that stuff in opengl ;) |
21:32:20 | golinuxer | k |
21:32:32 | * | Matthias247 quit (Read error: Connection reset by peer) |
21:32:38 | Jehan_ | golinuxer: I haven't used any of them, image processing is not what I normally do. |
21:33:00 | golinuxer | I'm asking because I want to re-write one of my go programs--using nim instead. |
21:33:07 | * | gsingh93 joined #nim |
21:33:17 | zdsa | you could even just call a command line from nim |
21:33:27 | zdsa | imagemagik is ez to use |
21:33:28 | zdsa | convert rose.jpg -resize 50% rose.png |
21:33:32 | dom96 | golinuxer: which library does your go program use? |
21:34:10 | golinuxer | image/jpeg |
21:34:19 | fowl | Jehan_: the macro would be a lot smaller if concepts just consisted of function signatures |
21:34:33 | Jehan_ | fowl: Heh. :) |
21:34:39 | golinuxer | and ... github.com/nfnt/resize |
21:35:06 | Jehan_ | fowl: I have also wondered if some of the old generic stuff at least isn't overkill. |
21:35:26 | * | mmn_ joined #nim |
21:35:29 | golinuxer | zdsa...the thing is that I want for the binary to have no dependencies |
21:36:07 | Jehan_ | I mean, there may be applications, but it might be simpler to have a straightforward way to do concepts and then have the opportunity to attach metaprogramming checks if you need anything fancy. |
21:36:49 | dom96 | golinuxer: I don't think there are any pure nim image resizing libraries unfortunately. |
21:37:17 | dom96 | golinuxer: writing your own might be fun :) |
21:38:00 | zdsa | golinuxer: you might try to static link against some library, but im not sure which one would be ez to to do |
21:38:00 | fowl | Jehan_: any time you do something with a generic argument, there can be a concept to constrain that behavior. That covers 99% of generics usage |
21:38:12 | def- | golinuxer: dependency-less libraries for this stuff would be really nice. |
21:39:21 | Jehan_ | fowl: Yeah. Concepts as a constraint on types are for static dispatch, as a constraint on variables for dynamic dispatch. |
21:43:34 | * | nande joined #nim |
21:43:55 | * | filcuc joined #nim |
21:48:56 | golinuxer | True, Def. |
21:50:27 | * | jbomo joined #nim |
21:53:30 | * | Kingsquee joined #nim |
21:55:07 | * | pregressive quit (Remote host closed the connection) |
21:55:48 | * | golinuxer quit (Quit: Konversation terminated!) |
21:56:12 | * | kumul quit (Ping timeout: 272 seconds) |
21:57:12 | reactormonk | Araq, btw, any reason why ref types aren't immutable by default? |
21:57:43 | * | boydgreenfield quit (Quit: boydgreenfield) |
22:00:34 | * | boydgreenfield joined #nim |
22:02:06 | * | yglukhov____ quit (Read error: Connection reset by peer) |
22:02:40 | * | yglukhov____ joined #nim |
22:07:38 | zdsa | ref are immutable |
22:07:44 | zdsa | but what they point to arent |
22:07:54 | Jehan_ | I think that's what reactormonk meant. |
22:08:03 | Jehan_ | I.e. when passed as a non-var parameter. |
22:08:08 | * | kumul joined #nim |
22:09:04 | Jehan_ | If I had to guess, one problem is that you then different ways of saying `r` is mutable and `r[]` is mutable. |
22:09:12 | zdsa | you might want to have a mutable ref |
22:09:17 | zdsa | but not whats under it |
22:09:22 | Jehan_ | When `r[]` is always mutable, using `var` works for the other case. |
22:09:30 | zdsa | aka change the pointer value, not the valued pointed to |
22:10:32 | zdsa | i would prefer to be able to choose both, aka immutable r and mutable r[] |
22:10:41 | zdsa | or mutable r and immutable r[] |
22:10:58 | Jehan_ | zdsa: The thing is, at this point, the signature of a function can get really, really noisy. |
22:11:04 | fowl | So const* and *const? |
22:11:07 | Jehan_ | And the question is how much you actually gain. |
22:11:38 | * | boydgreenfield quit (Quit: boydgreenfield) |
22:12:18 | zdsa | f(var x: ref var T) |
22:12:37 | zdsa | not that noisy imo |
22:13:23 | zdsa | f(var x: ref T); f(x: ref var T); f(var x: ref var T) |
22:14:10 | zdsa | it wouldnt be backward compatible tho |
22:15:04 | zdsa | f(var x: ref <something not var qualifer> T) would be backward compatible tho |
22:16:50 | Jehan_ | zdsa: ref will usually be a part of the type, not an extra qualifier, and I think that's noisy. |
22:17:04 | Jehan_ | it's also really easy to confuse x: var T and var x: T. |
22:17:23 | zdsa | i think its pretty easy to diferenciate |
22:18:19 | zdsa | imo |
22:18:19 | Jehan_ | In any event, I'm pretty sure Araq will not break almost every existing Nim module. :) |
22:18:34 | * | Sembei quit (Ping timeout: 245 seconds) |
22:18:44 | zdsa | like i said, to be backward compatible, it would need to be a immutable qualifer |
22:18:48 | zdsa | mutable by default |
22:19:03 | zdsa | that way everything stays the same with no qualifier |
22:19:31 | Jehan_ | Or you'd do something different, such as having an {.immutable.} annotation for types. You'll just have to figure out how to do initialization. |
22:19:59 | zdsa | that would be too, but you have to do type gymnastic a lot |
22:20:08 | Jehan_ | zdsa: Hmm? |
22:20:25 | zdsa | to mutate something, then make it immutable again |
22:20:44 | zdsa | aka have 2 types, 1 mutable 1 immutable, then cast between the 2 |
22:21:09 | Jehan_ | zdsa: Something like distinct types and casting between them might work. |
22:21:42 | Jehan_ | It'd be more about types that you don't really want to change after initialization. Granted, that's only part of the problem you want to solve. |
22:22:09 | zdsa | yes, thats part of it |
22:22:16 | zdsa | the immutable would be good on the type itself |
22:22:29 | zdsa | but for actually passing refs to functions, while being immutable |
22:22:52 | zdsa | witouth having to make a new immutable type |
22:22:54 | * | brson quit (Quit: leaving) |
22:23:13 | zdsa | or use the immutable pragma on the function too i guess? |
22:23:20 | zdsa | or parameter or whatever |
22:25:00 | reactormonk | zdsa, \n != , |
22:25:17 | zdsa | in php yes |
22:25:25 | zdsa | lol |
22:25:43 | * | mmn_ quit (Ping timeout: 246 seconds) |
22:26:19 | reactormonk | Jehan_, well yeah, you're correct. need to introduce some kind of deprecation warning... |
22:27:21 | * | Jehan_ quit (Quit: Leaving) |
22:29:42 | zdsa | ',' is harder to type :( |
22:32:52 | * | zdsa left #nim (#nim) |
22:32:55 | * | boydgreenfield joined #nim |
22:33:14 | Araq | reactormonk: immutable refs is hard design problem. My favourite idea is to make 'func' deeply immutable for all its parameters |
22:33:24 | Araq | boydgreenfield: zah is not working on anything |
22:33:32 | reactormonk | Araq, so for refs too? neat idea. |
22:33:47 | reactormonk | but then how do you propagate the immutability to procs being called by the func? |
22:33:57 | Araq | you don't |
22:34:10 | boydgreenfield | Araq: Got it. Is there anyone else that’s been helping out w/ compiler stuff? Happy to do some other gruntwork-like fix in exchange… :) |
22:34:12 | Araq | you rather have all your procs renamed to 'func' by then |
22:34:54 | Araq | boydgreenfield: activity is rather low afaict, will get back to the heavy bugfixing in a couple of days though |
22:35:17 | reactormonk | Araq, so a func calling a proc is what, a warning? |
22:35:21 | reactormonk | or a compiler error |
22:35:39 | Araq | dunno, usual design is: warning first, later error |
22:36:37 | Araq | boydgreenfield: generic type parametrization in combination with subtyping has some subtle issues, you should read some papers/books about this |
22:36:45 | boydgreenfield | Araq: OK, sounds good. Sorry I couldn’t knock this one down myself. |
22:37:47 | boydgreenfield | Araq: Hmm – well maybe it’s overkill for what I need. The alternative was variant types (case kind of…), which is just inelegant because then you have to check the case all over the place as the typed object field needs to have a different field name in each variant |
22:37:47 | Araq | boydgreenfield: why is it so important for you? usually you either use generics or inheritance |
22:37:52 | boydgreenfield | (e.g., store, store_int32) |
22:38:25 | Araq | I don't think that's a tough problem to abstract over via templates |
22:39:13 | boydgreenfield | Araq: I have a distributed store that’s set up to behave in a variety of different ways (e.g., count cumulative data sent to it, reduce it across some graph, etc., etc.) – which I had done with inheritance and they just were identical except for a single `reduce` proc. Unfortunately, in extending it some of them need to store different types (e.g., more than a seq[int]). |
22:39:54 | boydgreenfield | I’ll have to take a look back at some templates for this – I haven’t used them extensively for actual type and proc declarations |
22:41:17 | * | boop is now known as boopisaway |
22:42:36 | boydgreenfield | Araq: Any specific template examples / other places you’d recommend looking at for best practices here? |
22:43:26 | boydgreenfield | (I want to have, e.g., a ReduceMethod1Store[int32] and a ReduceMethod2Store[int64], etc.) |
22:44:08 | Araq | sounds to me you want the specialization of templates/generics rather than subtyping, but I have no concrete suggestions |
22:44:36 | * | Trustable quit (Remote host closed the connection) |
22:45:11 | * | yglukhov____ quit (Quit: Be back later ...) |
22:48:54 | * | boopisaway is now known as boop |
22:51:06 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:52:39 | boydgreenfield | Araq: Ok, I’ll look into that. |
22:59:12 | onionhammer | hm weird. nim is sigsegving while compiling parseutils |
23:00:15 | onionhammer | oop |
23:00:23 | onionhammer | accidentally up+entered |
23:09:42 | * | brson joined #nim |
23:10:28 | * | tdc joined #nim |
23:11:35 | * | filcuc quit (Quit: Konversation terminated!) |
23:11:56 | * | dddddd quit (Ping timeout: 264 seconds) |
23:13:33 | * | vikaton quit (Quit: Connection closed for inactivity) |
23:15:00 | * | tdc quit (Quit: Leaving) |
23:15:05 | * | silven_ joined #nim |
23:15:14 | * | silven quit (Ping timeout: 272 seconds) |
23:15:26 | * | kumool joined #nim |
23:16:29 | * | kumul quit (Ping timeout: 256 seconds) |
23:19:22 | * | taesoo joined #nim |
23:21:22 | * | boop is now known as boopisaway |
23:22:12 | * | CARAM__ quit (Ping timeout: 272 seconds) |
23:25:52 | * | CARAM__ joined #nim |
23:39:30 | jackv | is it ok to include C files in nimble packages? (e.g. for wrapped libraries) |
23:40:21 | fowl | jackv, it should work, unless you're asking if its morally ok? |
23:40:47 | fowl | morally it should also fine |
23:40:48 | jackv | nah, it's a BSD licensed lib, I think it's morally ok |
23:57:58 | jackv | also, is it frowned upon to not include the Requires: "nim >= whatever"? |
23:58:16 | Araq | yeah pretty much given Nim's development |
23:59:04 | jackv | ok |