00:00:17 | * | BlaXpirit quit (Quit: Quit Konversation) |
00:05:28 | dom96 | reactormonk: I'd rather not make Nimble complex |
00:06:41 | reactormonk | dom96, how about split each wrapper library into two parts - one that's the pure interface wrapper, no actual nim code, which carries the upstream version number, and another one which depends on it? |
00:07:26 | reactormonk | that way you can theoretically mix & match and nimble stays simple |
00:12:19 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:21:34 | flaviu | dom96: What about 1.2.* and 1.*.* ? |
00:22:25 | flaviu | I mean as a nimble version specifier. |
01:03:56 | flaviu | gokr_: Dead link on http://goran.krampe.se/2014/10/29/nim-and-oo/ around UPDATE: See part IV about this |
01:04:20 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:19:31 | * | EXetoC quit (Quit: WeeChat 1.1.1) |
01:39:28 | * | Trustable quit (Quit: Leaving) |
01:39:30 | * | davidhq joined #nim |
01:42:47 | * | davidhq quit (Client Quit) |
01:50:24 | * | davidhq joined #nim |
01:56:29 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
02:16:47 | Demos | I would say a seperate package for each ABI break in the library |
02:32:24 | * | darkf joined #nim |
02:35:23 | * | bmaxa joined #nim |
02:48:53 | * | Demon_Fox quit (Ping timeout: 246 seconds) |
02:59:36 | * | Demon_Fox joined #nim |
03:10:11 | * | superfunc[mobile quit (Quit: Connection closed for inactivity) |
03:16:04 | flaviu | http://rigaux.org/language-study/syntax-across-languages/ should come in handy for "but x does things this way" arguments ;) |
03:24:33 | * | d3m1gd quit (Ping timeout: 265 seconds) |
03:36:51 | * | BitPuffin quit (Ping timeout: 246 seconds) |
03:56:06 | * | ehaliewicz quit (Ping timeout: 246 seconds) |
04:05:28 | * | Varriount_ joined #nim |
04:07:37 | * | Varriount quit (Ping timeout: 255 seconds) |
05:15:41 | * | BitPuffin joined #nim |
05:21:52 | * | BitPuffin quit (Ping timeout: 255 seconds) |
05:25:28 | * | johnsoft quit (Ping timeout: 255 seconds) |
05:45:34 | * | fizzbooze joined #nim |
06:13:17 | * | gsingh93 joined #nim |
06:16:39 | * | kapil__ joined #nim |
06:26:37 | * | fizzbooze quit (Quit: WeeChat 1.1.1) |
06:55:32 | * | VinceAddons joined #nim |
07:15:21 | * | gokr joined #nim |
07:16:51 | * | gokr_ quit (Ping timeout: 264 seconds) |
07:18:15 | reactormonk | def-, I think you killed the tests you have before |
07:19:16 | * | Demon_Fox quit (Quit: Leaving) |
07:25:09 | * | BitPuffin joined #nim |
07:25:55 | * | bjz joined #nim |
07:28:57 | * | JinShil joined #nim |
07:29:03 | * | bjz quit (Client Quit) |
07:29:41 | * | BitPuffin quit (Ping timeout: 250 seconds) |
07:39:06 | * | gokr quit (Quit: IRC for Sailfish 0.8) |
07:46:32 | * | bjz joined #nim |
08:13:19 | * | DemonOne quit (Ping timeout: 250 seconds) |
08:18:04 | * | BitPuffin joined #nim |
08:22:51 | * | BitPuffin quit (Ping timeout: 264 seconds) |
08:27:18 | * | Trustable joined #nim |
08:27:53 | * | gXen joined #nim |
08:37:55 | * | DemonOne joined #nim |
08:42:50 | * | gokr joined #nim |
08:42:54 | * | gXen left #nim (#nim) |
08:48:16 | * | VinceAddons quit (Read error: Connection reset by peer) |
08:49:46 | * | d3m1gd joined #nim |
08:54:25 | * | d3m1gd quit (Ping timeout: 264 seconds) |
08:58:09 | * | JinShil quit (Quit: Konversation terminated!) |
09:03:36 | * | sillesta joined #nim |
09:09:47 | * | Netfeed joined #nim |
09:16:46 | * | DemonOne quit (Ping timeout: 245 seconds) |
09:45:02 | * | dumdum joined #nim |
09:51:42 | * | grom358 joined #nim |
09:51:56 | grom358 | i have only just heard of this language |
09:52:06 | grom358 | how is nim's GC suitable for games? |
10:05:48 | def- | grom358: it's high performance, only runs when you allocate new data (so you can just avoid allocating data) and you can set when it may run and for how long: http://nim-lang.org/gc.html |
10:22:21 | * | d3m1gd joined #nim |
10:27:31 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
10:28:16 | * | gXen joined #nim |
10:31:46 | ekarlso | Araq: did you fix the code generator bug you said ? |
10:41:23 | reactormonk | ekarlso, is the issue closed? |
10:41:58 | ekarlso | reactormonk: I dunno, he just said there was a codgen bug that was the issue that I was seeing |
10:46:20 | reactormonk | ekarlso, github issues are our kind of bureaucracy |
10:48:02 | reactormonk | ekarlso, probably the best way to get it fixed is to make a test for the compiler tests/ directory |
10:49:30 | reactormonk | ekarlso, find anything? https://github.com/Araq/Nim/commits/devel |
10:50:05 | ekarlso | not even sure where to look at that list :p |
10:50:22 | ekarlso | sorry to say I'm not that familiar with the compiler stuff ;) |
10:50:45 | ekarlso | https://bpaste.net/show/dcdbf12f0084 |
10:56:33 | ekarlso | u got a clue reactormonk ? |
11:28:02 | * | MajorWork joined #nim |
11:28:36 | * | chemist69 joined #nim |
11:41:57 | ekarlso | oh well :p |
11:42:03 | ekarlso | I'll wait for a fix then |
11:53:36 | * | akiradeveloper joined #nim |
11:54:03 | akiradeveloper | how can I do formatted printing? couldn't find printf |
11:55:18 | akiradeveloper | should always use logging module? |
12:01:04 | dumdum | akiradeveloper: maybe this: http://nim-lang.org/strutils.html#%,string,openArray[string] |
12:02:38 | akiradeveloper | oh thanks. it's pythonistic |
12:12:35 | * | Jehan_ joined #nim |
12:15:49 | * | kashyap_ quit (Quit: Page closed) |
12:16:12 | * | kashyap_ joined #nim |
12:17:05 | kashyap_ | A quick question about javascript interop. How can I write code that generates window.alert("hello")? I am able to generate just alert("hello") by declaring proc with importc |
12:20:48 | * | kapil__ quit (Quit: Connection closed for inactivity) |
12:26:58 | * | BitPuffin joined #nim |
12:31:07 | Jehan_ | kashyap_: {.importc: "window.alert".} should work for that. |
12:31:11 | * | dumdum quit (Ping timeout: 256 seconds) |
12:31:35 | * | BitPuffin quit (Ping timeout: 250 seconds) |
12:31:37 | ekarlso | Araq: please ping when the codegen bug is fixed :p |
12:31:46 | kashyap_ | thanks Jehan_ |
12:32:14 | Jehan_ | kashyap_: No promises, but basically, the code generator does just a textual insertion for this. |
12:33:17 | kashyap_ | Error: invalid pragma: importc: "window.alert" |
12:35:01 | * | gXen quit () |
12:41:39 | Jehan_ | kashyap_: Huh. What's the exact code? It should be something like: proc alert(s: cstring) {.importc: "window.alert".} |
12:44:15 | * | dumdum joined #nim |
12:55:11 | * | Jehan_ quit (Remote host closed the connection) |
12:55:45 | * | Jehan_ joined #nim |
13:00:23 | * | akiradeveloper quit (Remote host closed the connection) |
13:11:19 | * | gunn quit (Ping timeout: 265 seconds) |
13:19:16 | * | gunn joined #nim |
13:32:32 | * | kapil__ joined #nim |
13:35:47 | * | dumdum quit (Ping timeout: 256 seconds) |
13:43:02 | * | darkf quit (Quit: Leaving) |
13:46:37 | * | akiradeveloper joined #nim |
13:49:01 | * | johnsoft joined #nim |
13:54:46 | Danjcla | I'm looking at the c2nim code and there isn't ./configure / a makefile / instructions / etc. Should I just try to compile stuff one by one, or is there something to do that's obvious if one has been using nim for a while? https://github.com/nim-lang/c2nim |
13:55:18 | * | davidhq joined #nim |
14:00:12 | * | bmaxa quit (Quit: Leaving) |
14:01:11 | def- | Danjcla: in Nim we generally use "nimble install" to install something. should work with nimble, but requires the nim compiler from git. nimble itself has instructions for how to install it: https://github.com/nim-lang/nimble |
14:05:45 | akiradeveloper | I want to release a resource on SIGINT. possible with try-finally? It doesn't work. I suppose it doesn't catch SIGINT as exception |
14:07:31 | Danjcla | Sweet, that worked (and nimble is pretty). Thanks! Off to play with C++ integration... |
14:08:26 | def- | akiradeveloper: you probably have to write your own signal handler that throws an exception (i hope that works). as a starting point C like signal handling should be possible with the posix module |
14:09:51 | def- | Danjcla: any idea where nimble should have been mentioned so that you would've known this already? In the tutorial? |
14:10:34 | akiradeveloper | def-, really? how cumbersome... |
14:11:32 | def- | akiradeveloper: i guess because signals work so differently on platforms. if you get it working, maybe it can go into the standard library? |
14:12:47 | akiradeveloper | def-, anyway I will try |
14:13:28 | akiradeveloper | I need more elegant way for loan pattern. |
14:14:02 | def- | akiradeveloper: wait, SIGINT was ctrl-c, wasn't it.. |
14:14:08 | def- | that actually causes an exception |
14:14:21 | akiradeveloper | yes, ctrl-c |
14:14:41 | akiradeveloper | what? so my finally clause actually works? |
14:14:49 | def- | Sorry for the confusion |
14:15:03 | akiradeveloper | which is correct? |
14:15:50 | akiradeveloper | yeah, code will tell |
14:16:23 | def- | The SIGINT is handled, but doesn't seem to throw an exception |
14:16:43 | * | MyMind joined #nim |
14:17:31 | akiradeveloper | I see |
14:17:47 | akiradeveloper | so that's correct my finally doesn't work actually |
14:17:56 | def- | Easy to fix though |
14:18:14 | * | dumdum joined #nim |
14:18:27 | def- | akiradeveloper: https://gist.github.com/def-/b52fa7a01d9b021873bb |
14:18:42 | * | Sembei quit (Ping timeout: 272 seconds) |
14:18:52 | akiradeveloper | I need something like this http://rustbyexample.com/drop.html |
14:21:01 | akiradeveloper | What is setControlCHook? |
14:21:29 | def- | it sets the proc to be called when a ctrl-c is received |
14:22:00 | akiradeveloper | defined in os module? |
14:22:11 | def- | system module i believe |
14:22:17 | akiradeveloper | I see |
14:22:18 | def- | sleep is from os |
14:23:59 | akiradeveloper | I want to sweep the resource when the wrapping object is gc-ed |
14:24:32 | akiradeveloper | Add some behavior when the object is gc'd... |
14:24:35 | gokr | Danjcla: You might want to read my article on c2nim "Nim Wrapping C" (or any of the others): http://goran.krampe.se/category/nim/ |
14:24:58 | def- | akiradeveloper: a destructor? http://nim-lang.org/manual.html#destructors |
14:25:21 | def- | (not sure what they do with GCed stuff) |
14:27:12 | akiradeveloper | when the program is killed, GC sweep all objects in heap? |
14:27:24 | gokr | Danjcla: There was another article recently on wrapping C libs, but... I can't recall where it is |
14:27:26 | akiradeveloper | I guess no |
14:27:44 | Jehan_ | akiradeveloper: signal handlers are very fragile things. Many system calls cannot be safely called from signal handlers and doing funky things with the stack (such as throwing exceptions) is generally a bad idea. |
14:27:55 | Danjcla | gokr: Thanks, that looks super-useful! I want to use C++ APIs, but I assume that's similar. |
14:28:06 | Jehan_ | akiradeveloper: No, the GC doesn't do that, that would be unnecessary overhead. |
14:28:26 | gokr | Danjcla: For C++ you should check with Araq since he is putting quite a lot of work into c2nim for that right now. |
14:28:37 | akiradeveloper | I see |
14:29:25 | Jehan_ | Imagine, for example, a large program that did swap out most of the memory. The GC would then have to page all of that back in before being allowed to terminate. |
14:29:48 | akiradeveloper | yes |
14:30:21 | Danjcla | gokr: I did, he gave me a pointer, a doc in the devel tree, but not that much detail; but I'm guessing your stuff will give me a feel for things, and then the doc he pointed to will make more sense. https://github.com/Araq/Nim/blob/devel/doc/nimc.txt ImportCpp pragma |
14:30:27 | akiradeveloper | I am looking for a nice way to free some resource when the program is killed |
14:31:23 | akiradeveloper | If I shouldn't throw exception on SIGINT what else can we do to do that? |
14:31:46 | Jehan_ | akiradeveloper: use addQuitProc() (which is basically an atexit() wrapper). |
14:32:20 | Jehan_ | akiradeveloper: The clean (but cumbersome) way to do advanced signal handling is to dedicate a separate thread to it. |
14:33:15 | Jehan_ | It's a bit tedious, because once you start with multiple threads, you have to worry about signals being delivered to the correct thread. |
14:33:46 | akiradeveloper | addQuitProc looks good |
14:35:51 | Jehan_ | Note that addQuitProc()/atexit() functions won't be called when the process is terminated by a signal. |
14:39:41 | Jehan_ | The basic problem with using a signal handler directly is that signals can interrupt the program at pretty much any time, including in the middle of an operation, where you may then be operating on undefined state. |
14:40:05 | Jehan_ | Hence, most signal handlers just set a variable that is then checked by the program or you use a multithreaded solution. |
14:40:16 | * | gunn quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:40:42 | akiradeveloper | addQuitProc won't be called when terminated by signal? |
14:40:48 | Jehan_ | No, it won't. |
14:41:19 | Jehan_ | That's just how the OS works. A signal that terminates a process will terminate the process without sending any notification. |
14:41:59 | Jehan_ | The process thus can't even know it's being terminated before it dies. |
14:42:49 | Jehan_ | Hence, when you intercept SIGINT, you have to do the termination part yourself. |
14:46:00 | * | BitPuffin joined #nim |
14:57:52 | Danjcla | gokr: Did the next post regarding impure intermediary libraries and make test green / declaring victory happen? Haven't been able to find so far. |
14:59:16 | gokr | Nah, didn't do any more posts yet |
14:59:30 | * | VinceAddons joined #nim |
15:00:34 | akiradeveloper | very very weird code is made https://github.com/akiradeveloper/nim-fuse/blob/develop/session.nim you see setControlCHook in mount proc |
15:01:29 | akiradeveloper | I am still looking for an elegant way to release resources when the program is terminated for some reason |
15:02:07 | Danjcla | gokr: Than I shall search for impurity elsewhere :) |
15:07:53 | * | akiradeveloper quit (Ping timeout: 245 seconds) |
15:10:19 | dumdum | proc takeproc(fn: proc(x: int): int) , 'x' seems unncessary ie it should be easy for nim to accept; proc takeproc(fn: proc(int): int) ..no? (less stuff to type for programmer) |
15:14:24 | dumdum | maybe even drop 'proc' and accept: fn: (int): int |
15:16:38 | Araq | dumdum: *shrug* usually parameter names are for documentation. you seem to want '->' from the future module |
15:20:57 | dumdum | '->' yes, exactly! thanks |
15:22:15 | ekarlso | Araq: did you get a fix for the codegen bug ? |
15:22:29 | Araq | ekarlso: no |
15:22:43 | ekarlso | Araq: boo :P |
15:22:44 | Araq | maybe I will be able to look into it tonight |
15:23:52 | * | Jehan_ quit (Quit: Leaving) |
15:25:07 | ekarlso | Araq: would be awesome |
15:25:45 | * | gunn joined #nim |
15:28:00 | dom96 | ekarlso: it seems to only happen for long URLs |
15:28:07 | dom96 | you might be able to workaround it temporarily |
15:28:10 | dom96 | if you're just testing |
15:28:30 | ekarlso | dom96: how ? |
15:29:16 | dom96 | shorten the url |
15:29:41 | ekarlso | dom96: meh, not possible really with nimble |
15:29:48 | ekarlso | since it's searcing for multiple tags at once |
15:30:05 | dom96 | work on different functionality :) |
15:30:23 | ekarlso | dom96: meh, rest is already working in nimble :P |
15:30:29 | ekarlso | search / list / install |
15:30:31 | ekarlso | towards registry |
15:31:16 | * | saml joined #nim |
15:33:18 | ekarlso | dom96: what else to do ? :D |
15:33:28 | dom96 | let me test it? |
15:33:44 | ekarlso | sure, i'll post up a branch to my gh |
15:39:03 | * | JohnReginald joined #nim |
15:39:22 | * | JohnReginald left #nim ("Leaving") |
15:46:25 | d3m1gd | is there a pragma to mark a procedure being protected from dead code elimination? |
15:47:05 | * | gunn quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:53:49 | Araq | d3m1gd: exportc does that |
15:55:08 | d3m1gd | Araq: oh, neat, thanks |
15:58:41 | * | Angry_ joined #nim |
16:06:16 | * | mytrile joined #nim |
16:10:11 | Araq | hi Angry_ welcome. I hope your name doesn't reflect your mood |
16:10:19 | Araq | hi mytrile welcome |
16:10:34 | Angry_ | Not at all. |
16:10:38 | mytrile | Hey Araq |
16:11:50 | Angry_ | Just hanging out about to start my first nim project. Since people are talking how strait forward is it to interface with c++ classes? |
16:16:09 | * | saml quit (Quit: Leaving) |
16:18:10 | Araq | depends on the C++ that is actually used |
16:18:26 | Araq | but support for it improved quite a bit, yeah |
16:18:54 | * | saml joined #nim |
16:19:33 | * | BlaXpirit joined #nim |
16:19:53 | * | EXetoC joined #nim |
16:20:51 | Angry_ | Araq: does the easy to use part include calling methods on c++ classes that I have full source code to? |
16:21:03 | ekarlso | dom96: hmm |
16:21:12 | ekarlso | so echoPackageVersions currently goes out to github |
16:21:17 | Araq | Angry_: yeah |
16:21:37 | ekarlso | could we make it support registry and github I guess ? |
16:23:28 | dom96 | ekarlso: yes. |
16:23:30 | dom96 | I can do that. |
16:23:42 | dom96 | All you need to do is expose a packages.json file. |
16:23:54 | ekarlso | dom96: it doesn't have one |
16:24:00 | ekarlso | registry is /pacakges/<id>/releases |
16:24:04 | dom96 | ekarlso: you need to generate one |
16:24:08 | ekarlso | :/ |
16:24:51 | ekarlso | dom96: the way I did it atm was to make nimble use the api |
16:25:53 | ekarlso | dom96: https://nim-pkg.svcs.io/api-docs |
16:26:41 | ekarlso | though I guess it wouldn't be that hard to make a new endpoint |
16:26:41 | dom96 | But you're generating it here: https://nim-pkg.svcs.io/packages |
16:26:47 | dom96 | That's what I want :) |
16:26:58 | ekarlso | dom96: but that doesn't include releases ;P |
16:27:13 | dom96 | also it's a slightly different format |
16:27:18 | dom96 | You just need to adjust it slightly |
16:27:48 | dom96 | but hrm |
16:27:58 | saml | that url doesn't work for me |
16:28:25 | dom96 | Perhaps it does make more sense to not grab a list of all the packages |
16:28:42 | dom96 | As long as you do it cleanly in Nimble then I have no problem with it. |
16:29:01 | ekarlso | saml: |
16:29:04 | ekarlso | how you mean ? |
16:29:11 | ekarlso | it's running in norway atm |
16:29:13 | saml | This server could not prove that it is svcs.io; its security certificate is from www.cloudistic.net. This may be an attacker intercepting your connection. |
16:29:45 | ekarlso | yeah, that's my bad haha |
16:29:46 | saml | don't use https:// |
16:30:14 | ekarlso | ideally it should be packages.nim-lang.org ;p |
16:31:21 | ekarlso | dom96: I dunno if it's bad to have to do GET /packages/<id>/releases to get releases also |
16:32:58 | dom96 | I would just include them in the output for /packages/<id> |
16:33:02 | dom96 | unless you have a reason not to do that |
16:33:07 | dom96 | I need to go. Bbl. |
16:33:16 | ekarlso | dom96: meh, rest api's and all that :p |
16:33:34 | ekarlso | dom96: u'd just grab /packages then the versions for the ones u need |
16:52:17 | * | Danjcla left #nim ("WeeChat 1.1") |
16:53:12 | * | Danjcla joined #nim |
16:53:22 | * | Varriount|Busy joined #nim |
16:56:04 | Varriount|Busy | reactormonk: One of your recent PR's broke builds for Windows. |
16:56:11 | * | superfunc joined #nim |
16:56:50 | Varriount|Busy | reactormonk: http://buildbot.nim-lang.org/builders/windows-x32-builder/builds/120 |
16:57:43 | superfunc | hey everyone |
16:57:52 | Varriount|Busy | I've no idea why it only affects Windows builds. Nothing in your commits looks to be Windows- or Linux-specific |
16:58:02 | Varriount|Busy | superfunc: Hi! |
17:01:33 | superfunc | I'm gonna try to see about getting that typedef added in BSD to fix building; I already put in a patch for csources to build. |
17:02:09 | superfunc | basically, BSD defines some type u_int32_t whereas most things look for uint32_t |
17:02:10 | Varriount|Busy | def-: I think your commits are responsible too. |
17:04:55 | * | chemist69 left #nim (#nim) |
17:17:21 | * | brson joined #nim |
17:21:23 | * | superfunc quit (Quit: leaving) |
17:35:36 | * | gmpreussner|work quit (Read error: Connection reset by peer) |
17:35:43 | * | gmpreussner|work joined #nim |
17:39:58 | * | Matthias247 joined #nim |
17:56:47 | * | gmpreussner|work quit (Ping timeout: 244 seconds) |
17:56:57 | * | MajorWork quit (Quit: Leaving) |
18:01:04 | * | BitPuffin quit (Ping timeout: 245 seconds) |
18:03:53 | * | mytrile1 joined #nim |
18:06:33 | * | mytrile quit (Ping timeout: 252 seconds) |
18:10:04 | * | sampwing joined #nim |
18:16:42 | * | Danjcla quit (Quit: WeeChat 1.1) |
18:29:13 | * | UberLambda joined #nim |
18:42:01 | * | gsingh93 joined #nim |
18:43:22 | * | superfunc joined #nim |
18:44:10 | def- | Varriount|Busy: i don't understand how my commits cause this: http://buildbot.nim-lang.org/builders/windows-x32-builder/builds/120/steps/Bootstrap%20Debug%20Version%20of%20Nim%20Compiler%20(With%20C%20Backend)/logs/stdio |
18:44:40 | def- | 1. Those commits didn't change algorithm.nim and 2. all changes were OS-independent |
18:59:20 | * | dapz joined #nim |
19:05:31 | * | threewood quit (Ping timeout: 245 seconds) |
19:09:31 | * | dapz quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:10:45 | reactormonk | Varriount|Busy, >:) |
19:11:14 | reactormonk | Varriount|Busy, got a windows VM somewhere for me to do some regression testing? |
19:11:47 | * | threewood joined #nim |
19:11:57 | * | gmpreussner|work joined #nim |
19:13:35 | reactormonk | Varriount|Busy, from what I see, my only commit is the merge-commit |
19:13:50 | def- | reactormonk: yeah, rest are my commits, but I don't have windows either |
19:14:00 | def- | i looked through all commits, can't see anything that causes this |
19:14:03 | reactormonk | time for some piratebay? |
19:14:27 | reactormonk | Hm, no windows image anymore |
19:25:31 | onionhammer | whats wrong w/ windows? |
19:25:34 | onionhammer | not working? |
19:25:35 | onionhammer | on devel? |
19:29:27 | def- | onionhammer: yes, bootstrap seems to fail after my commits |
19:29:40 | def- | according to the builder |
19:29:57 | dumdum | https://www.modern.ie/en-us/virtualization-tools lets you download a windows vm |
19:30:31 | dumdum | but not sure of its limitations |
19:35:53 | Angry_ | irrc they deactivate after a set amount of time |
19:47:31 | * | dumdum quit (Ping timeout: 256 seconds) |
19:49:04 | * | BlaXpirit quit (Quit: Quit Konversation) |
19:50:49 | * | BlaXpirit joined #nim |
19:59:07 | * | mwbrown joined #nim |
19:59:25 | * | Angry_ quit (Read error: Connection reset by peer) |
20:10:22 | mwbrown | Is there any way to specify array sizes at object construction time? For instance, define an object with "size" and have something like myArray : array[0..size, int] |
20:10:35 | mwbrown | to get size safety on a dynamic object |
20:11:43 | mwbrown | Specifically I'm trying to create an object with a nested array of ints, so array[0..height, array[0..width, int]] |
20:12:15 | EXetoC | T:static[int], which is experimental |
20:13:52 | EXetoC | you could also try T:range and then array[T, int] |
20:14:29 | mwbrown | the array size will only be known at runtime, unfortunately |
20:15:48 | mwbrown | although it doesn't look like there is an explicit constructor support for objects, instead relegating that to helper functions that call "new" and return the reference after doing necessary setup |
20:17:55 | EXetoC | then you must use a seq instead |
20:18:25 | EXetoC | constructor as in T(field1: x, field2: y)? |
20:19:07 | mwbrown | T(width: int, height: int) |
20:19:09 | EXetoC | and if T is a reference type then 'new' will be invoked automatically |
20:19:53 | EXetoC | but usually you'd to want to wrap your constructors in procs |
20:22:39 | mwbrown | alright, in that case is there a way I can preallocate a seq to be of a certain size? |
20:23:32 | mwbrown | I have a seq[seq[int]] and I want to make the outer one from 0..height and the inner one from 0..width |
20:24:12 | EXetoC | newSeq[T](len: int) |
20:25:08 | EXetoC | I wonder if calling setLen afterwards preserves the capacity |
20:25:13 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:27:24 | EXetoC | which is the size of the internal buffer (the length is always <= the capacity). if you set the *length* then you must keep track of how much has been intialized |
20:27:27 | EXetoC | perhaps it's obvious |
20:31:51 | mwbrown | looks like it's working, I had an off-by-one error because of the range syntax but otherwise I think I've got it |
20:32:40 | mwbrown | http://pastebin.com/zBEb6x1q |
20:33:19 | mwbrown | that code is working unless there is a better way to initialize a seq[seq] other than a for loop for the inner sequence |
20:35:17 | EXetoC | there are no such shortcuts |
20:36:53 | EXetoC | you can just use a single sequence of chars if the lengths are supposed to be uniform, but then you need to think about how to index it |
20:37:33 | mwbrown | right, you can always flatten a 2D array into a regular array. I was just trying different ways out in Nim |
20:38:04 | * | FusionGaming quit (Ping timeout: 255 seconds) |
20:42:20 | * | FusionGaming joined #nim |
20:43:38 | * | UberLambda quit (Quit: Leaving the Matrix) |
20:43:55 | * | UberLambda joined #nim |
20:44:18 | * | Varriount|Busy quit (Quit: Page closed) |
20:47:45 | * | FusionGaming quit (Ping timeout: 250 seconds) |
20:55:05 | * | bjz joined #nim |
20:56:02 | * | chemist69 joined #nim |
20:57:35 | ekarlso | .eval @[1,2] & @[3,4] |
20:57:38 | Mimbus | ekarlso: eval.nim(3, 7) Error: value of type 'seq[int]' has to be discarded |
20:58:25 | * | bjz quit (Read error: Connection reset by peer) |
20:58:52 | * | UberLambda quit (Quit: Leaving the Matrix) |
20:58:52 | * | FusionGaming joined #nim |
20:58:54 | * | bjz joined #nim |
21:00:41 | * | bjz quit (Client Quit) |
21:04:09 | * | dapz joined #nim |
21:06:20 | * | brson quit (Quit: leaving) |
21:06:27 | * | brson joined #nim |
21:06:57 | * | sampwing quit (Ping timeout: 252 seconds) |
21:08:40 | * | dapz quit (Ping timeout: 255 seconds) |
21:09:56 | ekarlso | dom96: around ? :D |
21:10:03 | ekarlso | https://github.com/ekarlso/nimble |
21:10:05 | ekarlso | initial |
21:11:55 | * | bjz joined #nim |
21:13:57 | * | mytrile1 left #nim (#nim) |
21:14:52 | * | bjz quit (Client Quit) |
21:15:01 | * | superfunc quit (Ping timeout: 252 seconds) |
21:23:03 | * | chemist69 quit (Quit: leaving) |
21:28:08 | * | Etheco joined #nim |
21:32:28 | * | nande joined #nim |
21:37:42 | * | DemonOne joined #nim |
22:03:31 | * | grom358 quit (Remote host closed the connection) |
22:06:51 | * | sampwing joined #nim |
22:16:40 | * | Demon_Fox joined #nim |
22:20:13 | * | dtscode quit (Quit: (dtscode.io)) |
22:21:22 | * | dts|pokeball joined #nim |
22:56:23 | * | mwbrown quit (Ping timeout: 246 seconds) |
22:59:34 | * | Trustable quit (Quit: Leaving) |
23:11:04 | * | Demon_Fox quit (Ping timeout: 255 seconds) |
23:19:19 | * | sampwing quit (Ping timeout: 252 seconds) |
23:20:03 | * | sampwing joined #nim |
23:22:40 | * | Angry joined #nim |
23:26:15 | * | sillesta quit (Ping timeout: 256 seconds) |
23:56:07 | * | davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |