00:05:52 | * | v17d quit (Ping timeout: 260 seconds) |
00:07:55 | * | couven92 quit (Quit: Client Disconnecting) |
00:13:19 | FromGitter | <zacharycarter> o/ |
00:32:09 | * | handlex joined #nim |
00:32:47 | * | handlex quit (Client Quit) |
00:59:42 | * | sz0 quit (Quit: Connection closed for inactivity) |
01:01:20 | * | vendethiel joined #nim |
01:25:35 | * | vendethiel quit (Ping timeout: 240 seconds) |
01:31:16 | * | chemist69 quit (Ping timeout: 276 seconds) |
01:44:14 | * | chemist69 joined #nim |
02:36:14 | * | skrylar joined #nim |
02:45:59 | * | skrylar quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
02:49:25 | * | skrylar joined #nim |
02:59:28 | * | pilne quit (Quit: Quitting!) |
03:25:18 | * | girvo joined #nim |
03:25:38 | girvo | So, I have a 160-core POWER8 computer with 256GB of RAM that IBM gave me... and compiling Nim worked perfectly on it :O |
03:27:13 | skrylar | swig. |
03:27:30 | * | def-pri-pub quit (Quit: leaving) |
03:27:41 | girvo | It's so incredibly fast lol |
03:28:28 | skrylar | is that a baby mainframe or one of those rack mount units they're selling to AI labs |
03:28:56 | girvo | Rack-mount, in their Innovation Lab in sydney. Dedicated to my work, "free" too lol |
03:29:17 | girvo | It's a pretty interesting competitor to like mid-to-high end Xeon servers. Really interesting hardware |
03:29:41 | girvo | Most tests are passing, except the |
03:29:43 | skrylar | i looked in to those because POWER doesn't have the black box management engine |
03:29:48 | skrylar | but its hard to get a quote on buying one |
03:29:51 | girvo | "tests/dll" ones |
03:30:12 | girvo | Yeah they're not easy to buy as a normal business from what I've seen :( |
03:30:39 | girvo | Though a little birdy told me that the new POWER9 arch servers are going to be aiming a lot more at getting proper marketshare, making it much simpler to buy |
03:31:38 | girvo | I'm going to be working with their hardware and optimisation teams to see I can expose some of the unique features it has to Nim properly :) |
03:34:34 | girvo | Interesting, the asyncmacro test fails |
03:34:53 | girvo | Actually a few of the async tests did |
03:42:10 | girvo | Araq: is it worth me sending PRs with fixes for POWER8? I'm guessing it's likely to obscure to bother with hey |
04:29:38 | Araq | girvo: we try to target as many cpus/archs as possible so go ahead please |
04:30:02 | * | sz0 joined #nim |
04:31:38 | ftsf_ | hmm so I keep having this issue and I still haven't figured out what causes it. type mismatch with proc types. got (proc (event: Event): bool{.closure, locks: <unknown>.}) but expected one of proc setEventFunc(ef: proc(event: Event): bool) |
04:32:30 | ftsf_ | is the problem being that it's a closure? or that the locks is unknown? or something else? |
04:37:46 | girvo | Araq: awesome, I'll work through the failing tests this week |
04:38:03 | girvo | dom96 asked me on HN to write up a blog post on running it on POWER8 too, which I'll try to find time for! |
04:38:40 | Araq | ftsf_: or maybe it's 2 different Event types |
04:40:02 | ftsf_ | Araq, hmm ahh i didn't consider that |
04:40:28 | ftsf_ | wouldn't that cause an ambiguity error? |
04:42:01 | Araq | depends |
04:50:47 | FromGitter | <Varriount> Araq: I can now say, from experience, that I really dislike C++ |
04:51:05 | FromGitter | <Varriount> Possibly as much as I dislike Java |
04:51:22 | ftsf_ | Araq, I think that was the cause, thanks! |
04:51:42 | FromGitter | <Varriount> At least Java makes sense. |
04:52:16 | girvo | Varriount: I have to do a heap of C++ at my new job, and christ is it painful |
04:52:31 | ftsf_ | do fully qualified identifiers exist in Nim? could they be shown in error messages? |
04:52:45 | girvo | There's a really nice language hidden inside it, screamign to be let out, but it dies under the weight of all the bullshit |
05:01:13 | Araq | ftsf_: they are shown, but there is some logic attached to it |
05:01:27 | Araq | to keep the msgs concise. in your case, the rule failed |
05:48:53 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:58:27 | * | Vladar joined #nim |
06:06:27 | Araq | varriount: to me C++ makes much more sense than Java |
06:06:51 | * | nsf joined #nim |
06:06:58 | Araq | C++ = good ideas held back by stupid ones (C compatibility) |
06:07:42 | Araq | Java = stupid ideas (embraced the wrong paradigm and implements it poorly) |
06:13:45 | * | Vi- joined #nim |
06:38:13 | * | vendethiel joined #nim |
06:51:23 | FromGitter | <mratsim> I found this game programming language yesterday, by the author of CryScript for CryEngine scripting http://strlen.com/lobster/ ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ http://strlen.com/img/lobster/sierpinski.png ... [https://gitter.im/nim-lang/Nim?at=596323ea89aea4761d81ba6d] |
06:56:45 | * | couven92 joined #nim |
07:05:38 | * | couven92 quit (Quit: Client Disconnecting) |
07:12:50 | * | vendethiel quit (Ping timeout: 268 seconds) |
07:15:51 | * | sz0 quit (Quit: Connection closed for inactivity) |
07:24:45 | * | yglukhov joined #nim |
07:27:07 | * | Arrrr joined #nim |
07:29:17 | * | arnetheduck joined #nim |
07:30:28 | * | xet7 joined #nim |
07:47:31 | * | nightmared joined #nim |
07:48:34 | FromGitter | <ephja> a "game programming language" seems very specific |
07:56:56 | * | Trioxin joined #nim |
07:57:15 | Trioxin | is there anything I can do to figure out what's going on with the nimx example? http://storage3.static.itmages.com/i/17/0710/h_1499673400_9325380_5ee0e02d8d.png |
07:57:38 | Trioxin | oops, wrong screenshot |
07:58:00 | Trioxin | actually it's correct. the window is glitching and showing other content |
08:00:35 | * | ShalokShalom joined #nim |
08:13:44 | * | couven92 joined #nim |
08:17:32 | * | ARCADIVS quit (Quit: ARCADIVS) |
08:22:46 | skrylar | ephja wouter likes to play |
08:23:17 | skrylar | I think he also did Wren and another language, unless i'm mixing up names |
08:23:58 | skrylar | that being said, game programmers have separate needs to systems programmers. so it's not unreasonable to have their own things. ex. gdscript needs to attach tiny scripts to many objects, something that doesn't work with lua and others because those weren't designed to be embedded in nodes but run as a full context and manage those objects themselves |
08:25:05 | * | arnetheduck quit (Ping timeout: 248 seconds) |
08:27:22 | * | sz0 joined #nim |
08:28:25 | * | rokups joined #nim |
08:49:27 | Trioxin | what would really kick ass would be if we could wrap Go |
08:49:39 | Trioxin | go2nim |
08:50:33 | Trioxin | actually I'm just being lazy and want an easier c2nim |
08:50:58 | Araq | easier? how? |
08:52:19 | Trioxin | not having to modify anything. traversing multiple files |
08:52:33 | Trioxin | mostly the former |
08:55:26 | Araq | you can pass it multiple files at the same time |
08:57:46 | euantor | girvo: POWER8 has always looked like an interesting platform to me, but I was never sure how much adoption it's gotten. OVH were running a beta program where they were providing POWER8 based cloud servers, but I never got a chance to check them out. Online.net run their cloud database system on POWER8 too I believe |
09:02:09 | * | yglukhov quit (Remote host closed the connection) |
09:03:49 | * | yglukhov joined #nim |
09:10:11 | * | yglukhov quit (Remote host closed the connection) |
09:16:53 | FromGitter | <zacharycarter> o/ |
09:17:23 | FromGitter | <zacharycarter> c2nim is already pretty easy Trioxin |
09:17:37 | FromGitter | <zacharycarter> plus you can always use gcc's preprocessor to make things easy |
09:17:41 | FromGitter | <zacharycarter> easier* |
09:18:42 | FromGitter | <zacharycarter> does anyone know how to take an array of rgb values and create an sdl2 surface from it? |
09:20:03 | FromGitter | <zacharycarter> also is there a quick / easy way to detect the endianness of the device someone is using? |
09:22:17 | FromGitter | <zacharycarter> nevermind found cpuEndian |
09:25:53 | * | girvo quit (Ping timeout: 248 seconds) |
09:31:17 | FromGitter | <zacharycarter> my tour of lisp / scheme came to a short end |
09:31:53 | FromGitter | <zacharycarter> when just setting up a dev environment / getting a simple sdl2 example running requires hours of fooling around / trying to get things working |
09:32:03 | FromGitter | <zacharycarter> it's a bad thing |
09:36:41 | * | yglukhov joined #nim |
09:36:41 | FromGitter | <TiberiumN> @trustable are you here? I want to ask you about NiGui - how to make text area view-only? |
09:36:50 | FromGitter | <TiberiumN> @trustable-code are you here? I want to ask you about NiGui - how to make text area view-only? |
09:37:33 | FromGitter | <zacharycarter> also, nm about the sdl2 pixel array to image thing I figured that out |
09:37:55 | * | NimrodBot joined #nim |
09:37:57 | FromGitter | <zacharycarter> Araq: I'd like to start a NimGames community, Lisp has one and I think it'd be good for Nim too |
09:38:25 | * | NimrodBot quit (Read error: Connection reset by peer) |
09:38:57 | FromGitter | <zacharycarter> would you be cool with the creation of a gitter / IRC channel for it? |
09:41:13 | * | yglukhov quit (Ping timeout: 258 seconds) |
09:42:53 | * | skrylar quit (Quit: Textual IRC Client: www.textualapp.com) |
09:50:28 | * | v17d joined #nim |
09:52:34 | * | Vi- quit (Ping timeout: 246 seconds) |
09:56:19 | * | ShalokShalom quit (Ping timeout: 276 seconds) |
10:05:30 | * | Trioxin quit (Ping timeout: 240 seconds) |
10:09:25 | * | yglukhov joined #nim |
10:22:07 | * | girvo joined #nim |
10:25:27 | FromGitter | <TiberiumN> Why this doesn't work? ⏎ const print = echo |
10:25:48 | FromGitter | <TiberiumN> I want to create an alias for "echo", so the only way to do it is to copy "echo" definition from system.nim? |
10:26:39 | * | girvo quit (Ping timeout: 255 seconds) |
10:27:52 | * | girvo joined #nim |
10:28:23 | * | Vi- joined #nim |
10:28:54 | ftsf_ | TiberiumN, make a template that replaces it with "echo" ? |
10:29:38 | FromGitter | <TiberiumN> ah, probably :) |
10:30:35 | FromGitter | <TiberiumN> like this? |
10:30:51 | FromGitter | <TiberiumN> ```template print(x: untyped): typed = ⏎ echo(x)``` [https://gitter.im/nim-lang/Nim?at=5963575bc101bc4e3a6d82e4] |
10:30:59 | FromGitter | <TiberiumN> because this doesn't work |
10:32:24 | ftsf_ | "doesn't work", what happens? |
10:32:54 | FromGitter | <TiberiumN> I can't use it like "print 1, 2" |
10:33:38 | FromGitter | <TiberiumN> lib\system.nim(266, 31) Error: invalid expression: '[T]' |
10:33:54 | FromGitter | <TiberiumN> ah sorry |
10:33:55 | ftsf_ | template print(x: varargs[untyped]) = |
10:33:55 | ftsf_ | echo(x) |
10:34:10 | FromGitter | <TiberiumN> thanks, this works! |
11:01:04 | * | Vi- quit (Ping timeout: 260 seconds) |
11:17:31 | * | Arrrr quit (Read error: Connection reset by peer) |
11:27:46 | Araq | zachary: sure I would be fine with it |
11:51:56 | * | yglukhov quit (Remote host closed the connection) |
11:53:03 | * | yglukhov joined #nim |
11:55:41 | * | yglukhov quit (Remote host closed the connection) |
12:02:39 | * | yglukhov joined #nim |
12:03:08 | * | Snircle joined #nim |
12:42:59 | * | gokr joined #nim |
12:43:10 | * | girvo quit (Quit: leaving) |
12:46:00 | * | zahary quit (Quit: Connection closed for inactivity) |
13:28:20 | shmup | that was a v quick lisp hiatus, zacharycarter |
13:28:28 | shmup | well nim haitus, rather, zacharycarter |
13:51:31 | * | oaao1 quit (Quit: Leaving) |
13:51:43 | * | oaao joined #nim |
13:51:46 | * | oaao1 joined #nim |
14:15:10 | * | couven92 quit (Quit: Client disconnecting) |
14:28:27 | * | Jesin joined #nim |
15:01:42 | * | ShalokShalom joined #nim |
15:10:24 | * | Trustable joined #nim |
15:51:57 | * | couven92 joined #nim |
16:01:19 | FromGitter | <zacharycarter> shump: I wasn't necessarily taking a hiatus, was more of exploring what else is out there game wise |
16:01:23 | FromGitter | <zacharycarter> game programming wise |
16:01:27 | FromGitter | <zacharycarter> Nim is still my favorite language |
16:20:15 | * | yglukhov quit (Remote host closed the connection) |
16:20:32 | * | yglukhov joined #nim |
16:21:04 | * | yglukhov quit (Remote host closed the connection) |
16:23:35 | * | yglukhov joined #nim |
16:27:50 | FromGitter | <cabhishek> Hi everyone! A noob question. It is possible to have an object with compile time type determination ? ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5963ab053230e14f3a44fcd1] |
16:29:12 | Araq | no, use a sum type or 2 different fields |
16:29:21 | * | yglukhov quit (Ping timeout: 255 seconds) |
16:30:59 | * | chriswakare joined #nim |
16:40:19 | * | v17d quit (Ping timeout: 246 seconds) |
16:43:02 | FromGitter | <cabhishek> @Araq Thanks. I guess I could also use object variants here! |
16:43:20 | Araq | yeah that's what I meant by "sum type" |
16:44:20 | FromGitter | <cabhishek> @Araq thanks for the clarification |
16:48:46 | * | Trustable quit (Remote host closed the connection) |
16:48:56 | * | ShalokShalom quit (Remote host closed the connection) |
16:50:30 | * | nsf quit (Quit: WeeChat 1.7.1) |
16:55:05 | * | ShalokShalom joined #nim |
16:59:29 | * | couven92 quit (Ping timeout: 276 seconds) |
17:03:23 | * | couven92 joined #nim |
17:05:52 | * | shashlick joined #nim |
17:33:36 | * | rokups quit (Quit: Connection closed for inactivity) |
17:33:54 | koppeh | Daww.. I can use "bind" as a proc name. |
17:34:11 | koppeh | I was hoping that if I named it `bind` I could still use it like buffer.bind() |
17:34:52 | * | Matthias247 joined #nim |
17:35:45 | Araq | hmmm that's actually reasonable |
17:36:11 | Araq | feature request please. it would also make 'type' as a field name useful |
17:36:21 | koppeh | Indeed. |
17:36:36 | koppeh | I'll try to formulate it as an issue. |
17:38:23 | Araq | in fact, 'addr' and 'type' are special cased o.O |
17:38:29 | Araq | and do work as object fields |
17:38:43 | koppeh | Ew. |
17:43:09 | Araq | still, very easy to do. 5 line parser change or something |
17:44:16 | * | Jesin quit (Ping timeout: 260 seconds) |
17:51:08 | * | pilne joined #nim |
17:51:37 | * | yglukhov joined #nim |
17:55:10 | Araq | koppeh: https://github.com/nim-lang/Nim/tree/allow-keywords-after-dots :-) |
17:55:18 | Araq | let's see how many tests it breaks |
17:55:23 | Araq | good night |
17:55:39 | koppeh | Oh, cool. |
17:55:44 | koppeh | Should I still create the issue? |
17:56:17 | * | yglukhov quit (Ping timeout: 248 seconds) |
17:56:28 | koppeh | Either way, have a good night, Araq! |
17:56:30 | Araq | no |
17:56:52 | koppeh | Same should be true for fields then. |
17:57:00 | Araq | hmm? |
17:57:16 | Araq | no, only after a dot it works out |
17:57:38 | koppeh | As long as you can have a field called `type` and access it using .type that works. |
17:58:03 | flashmozzg | What is complexity of add for Nim's sequences? Is it amortized O(1)? Is there a way to specify a capacity when creating a sequence? Or it resizes on every add operation? |
17:59:06 | def- | flashmozzg: https://github.com/nim-lang/Nim/blob/devel/lib/system/sysstr.nim#L18-L21 |
17:59:44 | def- | flashmozzg: https://nim-lang.org/docs/system.html#newSeqOfCap,Natural |
18:00:39 | Xe | why can't cap be an optional argument of `newSeq`? |
18:00:59 | def- | Xe: because len is already the optional argument of newSeq, but it could be added |
18:01:42 | flashmozzg | def-: thanks! I was sure I searched for thin and didn't find, but I might've confused it with something else. |
18:03:09 | * | captainkraft quit (Ping timeout: 240 seconds) |
18:04:27 | * | v17d joined #nim |
18:09:35 | * | Jesin joined #nim |
18:12:53 | subsetpark | What does that do, capacity? If i create a seq with Cap N, I can add items past N |
18:15:34 | * | arnetheduck joined #nim |
18:15:57 | koppeh | Would it be the initial capacity? |
18:16:24 | FromGitter | <ephja> the capacity will increase if you try to add an element when it has been reached |
18:16:42 | koppeh | Yeah, it's only an optimization thing. |
18:16:44 | FromGitter | <ephja> by allocating a new buffer |
18:17:08 | koppeh | If you intend to fill a sequence to a certain known capacity anyway, you can already tell it what that capacity will be. |
18:17:39 | subsetpark | hm - at that point, what's the difference between initializing with a cap and using `add`, and initializing with a length and assigning at indices? |
18:20:53 | flashmozzg | subsetpark: it will fill sequence with zeroes, which may be unnecessary and could impact perfomance. |
18:21:23 | * | PMunch joined #nim |
18:21:53 | * | ShalokShalom quit (Remote host closed the connection) |
18:21:58 | flashmozzg | and also, If I understood correctly, subsequent adds would add to the end (past those zeroes). So you'd need to initialize with index too. |
18:22:06 | subsetpark | true... my intuition is that `add` still has to "do more", but maybe i'm wrong |
18:22:56 | flashmozzg | Btw, it's not uncommon when you know the capacity that will cover 95% cases (not length, though). |
18:25:43 | subsetpark | so is `add` is essentially free under the capacity? |
18:29:33 | * | v17d quit (Ping timeout: 260 seconds) |
18:30:12 | koppeh | Not free, but it doesn't allocate a new buffer to put the data in. |
18:30:36 | koppeh | Which is a relatively costly operation from what I know. |
18:31:06 | koppeh | Compare it with putting a fork into a drawer versus having to switch out the drawer for a bigger one because it's full. |
18:31:35 | koppeh | You have to move / copy all the old forks into the new, bigger drawer. |
18:31:57 | * | koppeh giggles. |
18:32:08 | subsetpark | oh for sure - i'm more interested in the tradeoffs between initializing a zero'd seq, and initializing one with a bigger capacity |
18:32:29 | subsetpark | assuming you know the target length in both cases |
18:32:37 | koppeh | Zero'd seq? |
18:33:06 | subsetpark | koppeh: between `newSeq[T](N)` and `newSeqOfCap[T](N)` |
18:33:16 | koppeh | I'm sure there is a default capacity for newly created sequences. |
18:33:38 | subsetpark | well yes, but presumably it is N or greater :) |
18:34:53 | koppeh | newSeqOfCap would also be "zero'd" though. |
18:35:35 | koppeh | At least I'd assume so. |
18:35:59 | flashmozzg | koppeh: why? |
18:36:40 | PMunch | subsetpark, as I understand it a seq is a regular calloc. When you add to it it runs a realloc, which if there is space will simply grow the allocated space, and if not then do as koppeh said and copy everything somewhere else. The benefit of initialising a bigger seq is that you won't have to realloc, just a simply insert. |
18:36:50 | koppeh | Because newSeq explicitly mentions this and, if newSeqOfCap doesn't explicitly mention the opposite, that'd be how I expect it to work. |
18:36:52 | flashmozzg | koppeh: you just need to init a buffer of specified length (simple malloc/new) and and set len to 0, cap to n |
18:37:52 | koppeh | My zero'd I mean the contents / bytes of the buffer would all be initialized to 0. |
18:38:21 | flashmozzg | koppeh: it's because when you init with length n you get seq of n elements. So in order to not get undefined behavuiour a lot of languages init them to some default value. But if you init with capacity where are no elements to begin with. |
18:38:22 | subsetpark | PMunch: definitely. But what we're discussing is: you can either newSeq[T](n), creating a seq of length n, and then insert into it; or you can newSeqOfCap[T](n), which creates a seq of len 0 but with a capacity of n, and then add new items to it. In both cases, adding n items would not require a reallocation. |
18:38:54 | flashmozzg | Can someone explain me what's wrong with this example http://ideone.com/KiItO4 ? If I change bar to 42 it works. And If I cast it to int explicitely it also works. |
18:39:22 | * | nsf joined #nim |
18:40:25 | PMunch | I think they probably do the same but one sets len = cap and the other len = 0 |
18:40:28 | * | PMunch quit (Quit: leaving) |
18:40:47 | subsetpark | Here's a quick benchmark I ran - if it's to be believed, newSeq is twice as fast as newSeqOfCap https://www.irccloud.com/pastebin/F0FCDYLz/ |
18:42:03 | subsetpark | so it seems that newSeqOfCap might only be preferable in situations where the len of the seq is not a given |
18:43:05 | koppeh | You're comparing seq[i] with seq.add() though. |
18:43:12 | subsetpark | exactly :) |
18:43:31 | subsetpark | the question being, what's the cost of add() if you don't have to reallocate? |
18:44:00 | * | ShalokShalom joined #nim |
18:44:09 | koppeh | Mhh.. |
18:44:24 | * | flyx just released NimYAML 0.10.1 which *actually* adds support for Nim 0.17.0 |
18:44:25 | koppeh | Well, your length might fluctuate. |
18:44:54 | koppeh | If you use a fixed length seq it would always be the same length. |
18:45:00 | koppeh | flyx: Oh, thank you! |
18:45:04 | FromGitter | <ephja> the only additional overhead might be writing to the length field |
18:45:33 | koppeh | And checking if length < capacity |
18:45:46 | koppeh | I'd assume..? |
18:46:27 | flyx | iirc demi- wants to get a mention for that, as does andreaferetti |
18:46:35 | koppeh | subsetpark: Can we have a comparison with "zeroed" .add() ? |
18:47:03 | subsetpark | What do you mean? |
18:47:40 | koppeh | toFill.add() instead of toFill[i] just to get a sense of the kind of ballpart we're talking about. |
18:47:55 | koppeh | ballpark* |
18:48:59 | koppeh | Also still unsure why you're calling it "zeroed". |
18:49:17 | flashmozzg | koppeh: it'll add past first m zeroes, wouldn't it? Also I think the checks and maybe even len writes should be eleminatable by a good compiler/optimizer. Not sure how that'd work with Nim though, due to double compilation steps. |
18:49:23 | koppeh | At first I though your meant a seq with 0 length. |
18:49:27 | subsetpark | because newSeq[float](4) -> @[0.0, 0.0, 0.0, 0.0] |
18:49:53 | flashmozzg | I know that LLVM does that for Rust (i.e. it removes a lot of checks when it can prove that loop variable won't go out of array bounds) |
18:50:14 | flashmozzg | any help with http://ideone.com/KiItO4 ? I find Nim's behaviour very strange, since I though I can index sequences with any Ordinal (not to mention that int should be synonimous to int64 on x64). |
18:50:19 | koppeh | I'd assume the buffer of newSeqOfCap would also be zeroed for security reasons. |
18:50:51 | koppeh | But I guess I see what you mean. |
18:51:30 | subsetpark | Rather unintuitive results: not setting any capacity at all is actually faster than setting a capacity of m. Maybe the compiler is too smart for us... https://www.irccloud.com/pastebin/5Moil4yd/ |
18:53:21 | koppeh | Mhhh.. what is m in that benchmark? |
18:54:13 | subsetpark | a tuning variable set by the bench framework |
18:55:00 | koppeh | Odd. |
18:56:01 | * | krux02 joined #nim |
19:14:15 | * | chriswakare quit (Quit: Leaving...) |
19:15:56 | FromGitter | <platypython> I have an off-the-wall question. If I wanted to write a program in nim that managed its own memory (i.e. I never want it to go over 512M of ram) and swapped its own objects to disk if it met its limit, where would I start? I'm happy to google, but not sure what paradigm/techniques to search for. |
19:15:56 | * | Trustable joined #nim |
19:16:28 | * | yglukhov joined #nim |
19:22:27 | Araq | platypython: hmm, if getOccupiedMem() >= 512 * 1024 * 1024: swapToDisk() |
19:23:52 | FromGitter | <platypython> :O those are seriously built-ins? |
19:25:54 | FromGitter | <platypython> Wow thats amazing |
19:29:58 | flashmozzg | So why can't I use int64 to index sequences but int works just fine? |
19:32:10 | Araq | sorry, no. swapToDisk() is not builtin |
19:34:26 | FromGitter | <platypython> Well getOccupiedMem is good enough introspection |
19:34:50 | FromGitter | <platypython> I'd want to choose my own swapping mechanism anyway |
19:44:37 | flashmozzg | Araq: can you please explain the error http://ideone.com/KiItO4 isn't int64 Ordinal? |
19:45:31 | Araq | flashmozzg: the compiler is picky, so convert the index to 'int' |
19:46:59 | shashlick | Araq: presume getOccupiedMem() tracks memory allocated with alloc() and friends, and not what the OS considers the process is using? Suppose I use malloc() directly, it won't account for that right? |
19:47:11 | Araq | yup |
19:48:44 | FromGitter | <gokr> @zacharycarter So you chatted with the Atomic guys or? |
19:50:01 | FromGitter | <zacharycarter> @goker I did |
19:50:05 | FromGitter | <zacharycarter> @gokr |
19:50:33 | FromGitter | <gokr> Tried to find it scrolling upwards, but didn |
19:50:37 | FromGitter | <gokr> 't see it |
19:50:51 | FromGitter | <zacharycarter> they don't seem to be too keen on a Nim wrapper |
19:51:00 | FromGitter | <gokr> Ok, any arguments? |
19:51:10 | FromGitter | <zacharycarter> let me try to find the argument |
19:51:54 | FromGitter | <gokr> Hey, I found a log they have |
19:52:49 | FromGitter | <zacharycarter> ah cool :D |
19:52:58 | FromGitter | <zacharycarter> yeah just search for y name and nim and you should find the convo |
19:55:18 | * | Trustable quit (Remote host closed the connection) |
19:57:13 | FromGitter | <gokr> @zacharycarter But... can you define "not too keen"? |
19:57:50 | FromGitter | <gokr> I mean, did they say they don't want you to work on it? Or were they simply not throwing themselves over you with joy ;) |
20:31:48 | flashmozzg | Araq: I only saw a mention that uint/uint64 are not Ordinal for implementation reasons. So why isn't int64 not counted as Ordinal? Also, I couldn't find what the Ordinal types were except the vague definition that all integral types (types without "holes") are ordinal, and the mentioned exception in system doc. Does it exist somewhere? Kinda pointless to have concept of Ordinals but no real |
20:31:48 | flashmozzg | definition (couldn't find it in linked source either) with some very not obvious exceptions. |
20:33:06 | Araq | int64 is ordinal |
20:33:14 | Araq | but seq's index type is defined as 'int' |
20:33:29 | Araq | which is smaller than int64 and narrowing conversions need to be explicit in Nim. |
20:35:31 | FromGitter | <zacharycarter> @gokr I'd say that if we worked on it we'd receive minimal help |
20:36:37 | FromGitter | <gokr> @zacharycarter probably true |
20:36:56 | FromGitter | <gokr> We didn't really get any interest with Urhonimo either |
20:37:02 | FromGitter | <zacharycarter> :/ |
20:37:09 | FromGitter | <zacharycarter> I'm working on a port of raylib right now it's going well |
20:37:12 | FromGitter | <gokr> People just have a hard time to "see it" |
20:37:46 | FromGitter | <gokr> But I chatted a bit on that channel as you can see. |
20:37:46 | FromGitter | <zacharycarter> but as you've pointed out raylib is lacking compared to urho3d / atomic |
20:38:07 | FromGitter | <gokr> And there are some people there that do have Nim on their radar. |
20:38:25 | FromGitter | <zacharycarter> well that's good |
20:38:36 | FromGitter | <zacharycarter> still at work atm but I'll check atomic's logs in about 20 mins :D |
20:47:54 | * | Vladar quit (Remote host closed the connection) |
20:52:46 | * | ShalokShalom quit (Remote host closed the connection) |
21:00:51 | flashmozzg | Araq: what is this overload for? proc `[]`[I: Ordinal, T](a: T; i: I): T Also, why int is smaller than int64? It can be, but on x64 system wouldn't it be the same? Though yeah, if the error message was clearer I probably wouldn't be as confused. |
21:20:01 | FromGitter | <mratsim> They do have the same size ⏎ ⏎ echo sizeof(1) ⏎ echo sizeof(1'i64) [https://gitter.im/nim-lang/Nim?at=5963ef80bf7e6af22cc53a4d] |
21:21:26 | FromGitter | <mratsim> but I guess it’s simpler to just require an explicit conversion instead of adding a check for x86 or ARM 32 bit or MIPS …. |
21:27:54 | flashmozzg | What is the proper way to create a new string as a copy of an old one + new char added to the end? |
21:28:47 | flashmozzg | I currently do var new = old.copy(), new.add(ch) but I get warning that copy is deprecated. |
21:32:49 | FromGitter | <stisa> isn't that just `var new = old & ch`? |
21:35:38 | * | yglukhov quit (Remote host closed the connection) |
21:40:16 | * | gokr quit (Ping timeout: 246 seconds) |
21:43:56 | * | krux02 quit (Remote host closed the connection) |
21:51:12 | FromGitter | <indy9000_twitter> ```var texts:seq[string] ⏎ texts.add("blah") ⏎ echo texts[0]``` ⏎ ⏎ Would be nice for the compiler to warn or fail saying that no allocation has been done for the sequence. @Araq [https://gitter.im/nim-lang/Nim?at=5963f6d01c8697534a0edae7] |
21:55:55 | FromGitter | <zacharycarter> back |
21:57:01 | FromGitter | <zacharycarter> @gokr sounds like there is some interest |
21:57:19 | FromGitter | <zacharycarter> but I still think it's a huge effort and I'm not sure how / where to begin honestly |
21:57:35 | FromGitter | <zacharycarter> besides staring at Araq's Urhonimo code until "get it" |
22:01:36 | * | rkjx joined #nim |
22:01:47 | * | rauss joined #nim |
22:12:07 | * | arnetheduck quit (Ping timeout: 276 seconds) |
22:24:55 | * | deep-book-gk_ joined #nim |
22:26:05 | * | deep-book-gk_ left #nim (#nim) |
22:29:51 | * | rauss quit (Quit: WeeChat 1.9) |
22:31:12 | * | rkjx quit (Quit: ChatZilla 0.9.93 [Firefox 52.2.0/20170613225334]) |
22:33:22 | * | chemist69 quit (Ping timeout: 255 seconds) |
22:37:51 | * | chemist69 joined #nim |
22:47:01 | FromGitter | <cryptotoad> hey all, was curious if there's a convenient way to read and write resources in nim? |
22:53:49 | shashlick | is it possible to statically link PCRE into Nim generated EXEs? I built libpcre.a but not sure how to get Nim to link it in |
22:56:47 | * | nsf quit (Quit: WeeChat 1.7.1) |
23:12:15 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:36:14 | * | yglukhov joined #nim |
23:41:03 | * | yglukhov quit (Ping timeout: 260 seconds) |
23:52:06 | * | couven92 quit (Quit: Client Disconnecting) |