00:18:23 | * | xet7 quit (Ping timeout: 240 seconds) |
00:18:54 | * | xet7 joined #nim |
00:54:42 | * | chemist69_ quit (Ping timeout: 255 seconds) |
00:59:18 | * | chemist69 joined #nim |
01:01:11 | * | handlex joined #nim |
01:11:19 | * | Nobabs27 joined #nim |
01:17:48 | * | yglukhov joined #nim |
01:18:07 | * | ipjk quit (Quit: Leaving) |
01:22:20 | * | yglukhov quit (Ping timeout: 268 seconds) |
01:34:16 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
01:47:02 | * | Nobabs27 quit (Quit: Leaving) |
01:52:45 | * | chemist69 quit (Ping timeout: 255 seconds) |
01:56:32 | * | libman joined #nim |
02:01:18 | * | NotSpooky_ joined #nim |
02:04:12 | * | NotSpooky quit (Ping timeout: 260 seconds) |
02:04:17 | * | NotSpooky__ joined #nim |
02:06:27 | * | chemist69 joined #nim |
02:07:28 | libman | dom96: heads up, https://www.youtube.com/watch?v=4D2ryw7tyBA about to start getting views ;) |
02:07:28 | * | NotSpooky_ quit (Ping timeout: 260 seconds) |
02:34:17 | * | jmkr quit (Ping timeout: 246 seconds) |
02:34:33 | * | Guest85780 quit (Ping timeout: 260 seconds) |
02:36:29 | * | jmkr joined #nim |
02:39:44 | * | gsingh93 joined #nim |
02:42:15 | * | arnetheduck joined #nim |
03:08:45 | * | handlex quit (Quit: handlex) |
03:17:48 | * | def-pri-pub joined #nim |
03:20:33 | * | yglukhov joined #nim |
03:24:46 | * | NotSpooky__ quit (Quit: Leaving) |
03:24:53 | * | yglukhov quit (Ping timeout: 240 seconds) |
03:27:27 | * | pilne quit (Quit: Quitting!) |
03:28:40 | * | Jesin quit (Quit: Leaving) |
03:45:56 | * | chrisheller quit (Ping timeout: 260 seconds) |
04:01:42 | * | def-pri-pub quit (Quit: leaving) |
04:03:40 | * | bahtiyar joined #nim |
04:06:41 | * | Jesin joined #nim |
04:08:23 | * | bahtiyar quit (Ping timeout: 240 seconds) |
04:10:37 | * | pydsigner is now known as aoui |
04:10:49 | * | aoui is now known as aoeu |
04:11:12 | * | aoeu is now known as pydsigner |
04:17:06 | libman | https://www.reddit.com/r/ProgrammingLanguages/comments/6jy41q/nim_intro_talk_a_young_systems_programming/ |
04:33:30 | * | jinshil joined #nim |
04:40:16 | * | jszymanski joined #nim |
04:50:02 | * | jinshil_ joined #nim |
04:53:22 | * | chrisheller joined #nim |
04:53:49 | * | jinshil quit (Ping timeout: 276 seconds) |
05:06:50 | * | aerx quit (Remote host closed the connection) |
05:22:34 | * | yglukhov joined #nim |
05:27:12 | * | yglukhov quit (Ping timeout: 260 seconds) |
05:27:30 | * | Vladar joined #nim |
05:43:03 | * | nsf joined #nim |
06:09:23 | * | user0 joined #nim |
06:51:53 | * | xet7 quit (Ping timeout: 240 seconds) |
07:05:28 | * | xet7 joined #nim |
07:13:25 | * | tankfeeder joined #nim |
07:21:14 | * | vlad1777d joined #nim |
07:25:46 | * | couven92 joined #nim |
07:26:49 | * | Andris_zbx joined #nim |
07:44:54 | * | yglukhov joined #nim |
07:46:18 | * | yglukhov quit (Remote host closed the connection) |
07:46:33 | * | yglukhov joined #nim |
07:51:13 | * | PMunch joined #nim |
07:53:32 | euantor | Nice, I think I'll watch that this morning |
08:03:32 | couven92 | Nice dom96, I'll watch it now :) |
08:03:59 | PMunch | Oh yeah, saw that over in r/nim. Watched the first half already :) |
08:05:50 | * | libman quit (Quit: Connection closed for inactivity) |
08:16:28 | * | chrisheller quit (Remote host closed the connection) |
08:17:36 | * | Arrrr joined #nim |
08:17:36 | * | Arrrr quit (Changing host) |
08:17:36 | * | Arrrr joined #nim |
08:21:16 | * | vlad1777d quit (Ping timeout: 260 seconds) |
08:29:05 | tankfeeder | morning |
08:29:23 | tankfeeder | i want add test over vector to blake2 |
08:29:24 | couven92 | tankfeeder, morning, how're u doing? :) |
08:29:25 | tankfeeder | https://github.com/BLAKE2/BLAKE2/blob/master/testvectors/blake2b-kat.txt |
08:29:34 | tankfeeder | couven92, good |
08:29:37 | * | skrylar joined #nim |
08:29:48 | tankfeeder | i need a hint how to parse |
08:30:08 | couven92 | RegExp! (Shoot me! :P ) |
08:30:58 | * | arnetheduck quit (Ping timeout: 260 seconds) |
08:31:29 | skrylar | morning |
08:31:48 | PMunch | tankfeeder, how to parse that format? |
08:31:58 | tankfeeder | yea, just a hint |
08:32:13 | tankfeeder | maybe pegs |
08:32:35 | couven92 | tankfeeder, I actually wasn't kidding :P |
08:32:39 | * | Matthias247 joined #nim |
08:33:03 | PMunch | Well you could just open the file, put in a loop three readlines (and one readline to skip the whitespace). Then do a substring from x to ^0 and use parseInt |
08:33:34 | tankfeeder | ok |
08:34:47 | PMunch | Oh wait, maybe not parseInt :P |
08:34:55 | PMunch | What do you want the values as? |
08:35:01 | tankfeeder | strings |
08:35:12 | PMunch | Well that's even easier :) |
08:36:03 | couven92 | or: Regular Expression matcher for line 1: "(in:)\s*([0-9a-bA-F]+)?", line 2: "(key:)\s*([0-9A-Fa-f]+)?" and so on |
08:36:34 | PMunch | in = f.readline()[4..^0] |
08:36:48 | PMunch | key = f.readline()[5..^0] |
08:37:01 | PMunch | hash = f.readline()[6..^0] |
08:37:06 | PMunch | discard f.readline() |
08:37:15 | PMunch | Throw that in a loop and voila |
08:37:40 | couven92 | and then you'd have to trim in, key and hash to strip whitespace at start and end |
08:37:53 | PMunch | 4, 5, 6 to match "in:\t", "key:\t", and "hash:\t" respectively |
08:38:13 | couven92 | ah, it's a tabstop? okay... nice |
09:03:26 | Araq | tankfeeder: https://nim-lang.org/docs/strscans.html |
09:04:21 | tankfeeder | ok |
09:09:43 | * | jinshil_ quit (Quit: Good-bye!) |
09:11:36 | * | skrylar quit (Quit: Textual IRC Client: www.textualapp.com) |
09:13:39 | couven92 | "Developers tend to be lazy, good developers anyways!" (Ian Cooper at NDC Oslo 2017) :D |
09:13:49 | couven92 | nice one! :D |
09:16:46 | tankfeeder | is there function to convert "FFFF" hex to string ? |
09:16:53 | tankfeeder | or should implement myself ? |
09:17:20 | couven92 | tankfeeder, https://nim-lang.org/docs/parseutils.html#parseHex,string,int,int,int |
09:17:32 | tankfeeder | ok |
09:18:17 | PMunch | To hex? |
09:18:25 | PMunch | parseHex is from hex isn't it? |
09:18:50 | tankfeeder | from hex to string |
09:18:50 | couven92 | PMunch, yeah he wanted to convert "FFFF" to a number! |
09:19:01 | tankfeeder | is there function to convert "FFFF" hex to string ? |
09:19:05 | tankfeeder | ^^^ |
09:19:13 | PMunch | He said convert to string.. |
09:21:43 | couven92 | in any case you can use https://nim-lang.org/docs/strutils.html#toHex,T to do the other way round, right? |
09:21:59 | Arrrr | can't you use `$0xFFFF` ? |
09:22:52 | tankfeeder | trying |
09:23:52 | PMunch | Arrrr, wouldn't that just create the string of the number? |
09:23:53 | PMunch | Not as hex |
09:25:03 | tankfeeder | another way: |
09:25:24 | tankfeeder | i read hex string from test vector, say "ff2a" |
09:25:40 | tankfeeder | how to pass it to getMD5 ? |
09:25:49 | tankfeeder | from import md5 |
09:26:13 | couven92 | tankfeeder, don't do MD5! :P |
09:26:44 | tankfeeder | i'm implementing test vectors for blake2 |
09:27:42 | couven92 | tankfeeder, hmm... getMD5 takes a string? wtf? |
09:29:03 | tankfeeder | but md5update takes cstring |
09:29:16 | PMunch | Arrrr, I looked at the switch question you posed yesterday by the way |
09:29:16 | tankfeeder | https://forum.nim-lang.org/t/716 |
09:29:25 | PMunch | But you had logged off before I got to answering you :P |
09:29:46 | couven92 | tankfeeder, yeah, and the only thing getMD5 does, is converting the input to a cstring and calling md5update :) |
09:30:21 | PMunch | Apparently it does have a C++ SDK, so you should be able to program it in Nim. But I haven't found any more information about this SDK other than it is supposed to exist.. |
09:31:08 | PMunch | But then again I haven't bothered to get a Nintendo developer account to check |
09:35:11 | PMunch | https://gamedev.stackexchange.com/questions/141291/how-to-get-access-to-nintendo-switch-development-environment |
09:37:09 | * | bjz joined #nim |
09:40:27 | Arrrr | That's quite interesting. I'll read it |
09:41:05 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:43:10 | * | bjz joined #nim |
10:10:19 | * | enthus1ast joined #nim |
10:14:50 | Trioxin | need someone to tell me what c2nim is complaining about on line 32 https://github.com/BLAKE2/libb2/blob/master/src/blake2.h : blake2.h(143, 30) Error: ';' expected. This is the first time I've used c2nim and I'm no C dev |
10:16:05 | Trioxin | c2nim is presumably what would make up for the lack of a large community and tons of packages so I have to get it going |
10:23:06 | FromGitter | <andreaferretti> you probably need this https://nim-lang.org/docs/c2nim.html#preprocessor-support-def-directive |
10:23:24 | FromGitter | <andreaferretti> `#def BLAKE2_API` |
10:23:28 | FromGitter | <andreaferretti> or something like this |
10:26:11 | * | PMunch quit (Quit: leaving) |
10:33:20 | Trioxin | c2nim can't convert a C implementation right? Just the .h? |
10:41:13 | Araq | Trioxin: it can convert a C implementation too |
10:43:46 | tankfeeder | i've implement hex to string |
10:43:50 | tankfeeder | back to file |
10:43:53 | tankfeeder | parsing |
10:49:20 | couven92 | tankfeeder, but why????? parseHex and toHex wok just fine, don't they? |
10:49:47 | * | themagician joined #nim |
10:49:59 | tankfeeder | i need convert "ff2a78" to string |
10:50:07 | tankfeeder | be back soon |
10:50:08 | * | tankfeeder quit (Quit: Leaving) |
10:55:01 | * | arnetheduck joined #nim |
11:04:07 | * | krux02 joined #nim |
11:09:56 | * | tankfeeder joined #nim |
11:12:56 | * | enthus1ast quit (Quit: Lost terminal) |
11:16:46 | * | krux02 quit (Disconnected by services) |
11:16:47 | * | krux02- joined #nim |
11:16:55 | * | krux02 joined #nim |
11:17:42 | * | krux02- quit (Remote host closed the connection) |
11:29:34 | * | Jesin quit (Read error: Connection timed out) |
11:34:48 | * | Snircle joined #nim |
11:34:52 | * | arnetheduck quit (Ping timeout: 276 seconds) |
11:40:34 | * | vlad1777d joined #nim |
11:41:07 | * | krux02 quit (Remote host closed the connection) |
11:45:27 | FromGitter | <girvo> Slightly crazy question: Anyone run Nim on POWER (specifically OpenPOWER/POWER8)? |
11:50:40 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
11:53:33 | euantor | Nope, I've never tried. I wanted to when OVH had their PWER8 servers, but I can't find anywhere else offering them at a decent price |
12:16:50 | * | NotSpooky joined #nim |
12:16:53 | * | eeproks quit (Ping timeout: 240 seconds) |
12:30:07 | * | xet7 quit (Ping timeout: 276 seconds) |
12:37:31 | tankfeeder | i give up no progress in several hours |
12:38:07 | tankfeeder | i need more help or hints in parsing this file |
12:38:08 | tankfeeder | https://github.com/BLAKE2/BLAKE2/blob/master/testvectors/blake2b-kat.txt |
12:43:32 | FromGitter | <ephja> were you not able to do it with strscans? |
12:44:34 | tankfeeder | Araq, told the same |
12:44:55 | tankfeeder | cant find example, hard entry point |
12:45:34 | couven92 | tankfeeder, PMunch actually gave you the three lines of code you need |
12:45:38 | * | xet7 joined #nim |
12:45:46 | tankfeeder | still trying |
12:47:02 | couven92 | if you'd tell us what the problem is, e.g. the error message Nim is spitting out or similar, we could actually be helpful. Else, your problem is one of the simplest things with reading a file, so it's kinda hard for us to know what your issue is |
12:49:04 | tankfeeder | 10x |
12:59:57 | * | PMunch joined #nim |
13:12:58 | tankfeeder | this is my current problem |
13:12:59 | tankfeeder | https://pastebin.com/qrrzkgWz |
13:13:13 | tankfeeder | i dont know why it happens |
13:13:27 | tankfeeder | in [3..^0] |
13:14:08 | * | planhths joined #nim |
13:16:00 | Araq | ^0 makes no sense, it's ^1 |
13:17:09 | PMunch | ^0 makes sense, it's 0 characters off from the end |
13:17:15 | PMunch | Isn't it? |
13:17:57 | tankfeeder | ^1 the same |
13:18:51 | PMunch | Hmm, that's weird.. |
13:19:18 | Araq | yes, 0 characters from the end is the \0 terminator |
13:19:29 | Araq | ^x is len-x |
13:19:50 | tankfeeder | nim 0.17 |
13:19:52 | Araq | ^1 is what you want, the last valid index |
13:20:30 | tankfeeder | [0..^1] returns char i |
13:21:30 | tankfeeder | trying in 0.16 |
13:22:11 | PMunch | Ah right, that makes sense Araq |
13:25:35 | * | yglukhov quit (Remote host closed the connection) |
13:25:48 | tankfeeder | 0.16 the same |
13:26:04 | PMunch | tankfeeder [0..^1] should return the string in it's entirety (technically without it's null terminator, but if you store it as a string it will get added back again AFAIK) |
13:26:42 | tankfeeder | in line in=123 |
13:26:46 | tankfeeder | i want get 123 |
13:26:57 | tankfeeder | [3..^1] ? |
13:27:02 | PMunch | Yes |
13:27:05 | PMunch | That should be right |
13:28:20 | tankfeeder | empty line and f |
13:28:27 | tankfeeder | as in pastebin link |
13:28:42 | tankfeeder | can anyone repeat ? |
13:29:51 | PMunch | Hmm, I just tried |
13:29:56 | PMunch | But I got some even weirder results |
13:30:13 | PMunch | I have a file, with two lines in it, in=123 and some random text |
13:30:27 | PMunch | I've got two f.readline() statements and everything works fine |
13:30:42 | PMunch | I throw a slice operation on one of them and get an EOFerror... |
13:31:43 | FromGitter | <ephja> huh |
13:31:50 | PMunch | http://ix.io/y4L |
13:31:55 | PMunch | That however works fine |
13:32:22 | PMunch | http://ix.io/y4N |
13:32:29 | PMunch | That doesn't (crash message included) |
13:32:36 | * | yglukhov joined #nim |
13:35:20 | Araq | don't use 0..x with a sideeffect |
13:35:43 | PMunch | ? |
13:36:29 | FromGitter | <ephja> oh I see |
13:38:41 | euantor | tankfeeder: This appears to work for me. Can probably be optimised a little: https://glot.io/snippets/er89kf0adi |
13:39:36 | tankfeeder | thanks. |
13:41:35 | euantor | Just change the "^0" stuff to "^1", having read the above :) |
13:42:02 | couven92 | tankfeeder, alternatively you could just get it directly from the raw on GitHub, which this code does: https://gist.github.com/couven92/ddc714bffc8078e0edf1b489b8340107 |
13:42:34 | FromGitter | <ephja> euantor: no, you also need to perform the slice separately |
13:42:49 | euantor | It works fine for me, note the string copy of the read line |
13:42:56 | PMunch | But why does it behave so weirdly with readline and slices? |
13:43:34 | tankfeeder | does issue exist ? |
13:43:37 | tankfeeder | known |
13:43:41 | euantor | Also note I'm using a FileStream to read the file |
13:43:50 | couven92 | PMunch, in my code https://gist.github.com/couven92/ddc714bffc8078e0edf1b489b8340107#file-blake2bkkatparse-nim-L12 you see I dropped the misleading ^1 and just used high instead |
13:43:55 | FromGitter | <ephja> does it evaluate to something like `f.readline()[x .. f.readline().len - 1]`? |
13:44:05 | PMunch | Misleading? |
13:44:22 | PMunch | Aaah, that would make sense ephja |
13:44:52 | couven92 | I don't want to thing or remember whether to use ^0 or ^1 or some other random number, so I'd use high instead, more explicit on the intention |
13:44:52 | PMunch | couven92, ^1 is only misleading if you haven't read the documentation :P |
13:45:06 | couven92 | s/thing/think |
13:45:23 | FromGitter | <ephja> I was talking rubbish about importc before. of course you need it if you don't want to use the proc name as the string |
13:46:02 | couven92 | PMunch, I cannot be bothered to walk around remembering tiny and basically irrelevant details like that in my head, even after I read the documentation |
13:46:28 | PMunch | Well that's your loss, it's a nice little shorthand |
13:46:39 | PMunch | Same as Pythons [0..-1] notation |
13:46:47 | PMunch | More or less |
13:47:22 | couven92 | PMunch, hard to read, hard to wrap your head around, no idea what it means at first glance... high is there for exactly that reason! |
13:48:54 | demi- | hey dom96 i seem to be having difficulty using choosenim to build 0.16.0 on ubuntu |
13:49:13 | demi- | also the initial setup for a non-priviledged user on linux is really bad |
13:49:24 | PMunch | I beg to differ, high is there for things like iterations and a shorthand for .len-1. In a slice it's so often the case that you want the last part to be relative to the end of the input that introducing ^ makes perfect sense. I can agree that maybe the symbol is a bit arbitrary but the concept is good |
13:49:32 | couven92 | PMunch, and honestly: looking at my keyboard to figure out where the cirumflex accent is, then remembering that you need to hit space afterwards and then typing 0 takes me much longer than writing "high" |
13:49:56 | PMunch | Well that is a question about keyboard layouts.. |
13:50:06 | FromGitter | <ephja> it's 'high' + a long prefix in some cases ;) |
13:50:23 | PMunch | ephja, exactly |
13:50:24 | couven92 | PMunch, no, circumflex is a combinator in any layout! |
13:50:41 | FromGitter | <ephja> maybe not that often in Araq's case. he likes them single-char identifiers :p |
13:53:22 | couven92 | and PMunch, if you're going down the road comparing to Python syntax: In python you'd do: `myFancyString[someIdx,]` |
13:53:30 | PMunch | No it's not couven92. That's only for international layouts |
13:53:48 | PMunch | Not if you wanted the end minus n characters |
13:55:05 | couven92 | PMunch, but we're not talking about the minus n characters (then high would just as confusing), we're talking about getting the rest (or right-side) of the string starting at a certain index |
13:55:44 | PMunch | I'm not, I'm taking about slicing in general and how ^ to denote the second slice parameter in relation to the end of a string.. |
13:56:54 | couven92 | getting the middle part of a string is messy in any case, and then you'll have to be careful with you index values anyways (taking 0-based and len vs. len-1 into consideration) |
13:58:35 | PMunch | Not necessarily the middle, maybe I want to grab everything but the last five characters [0..^6] |
13:59:07 | couven92 | PMunch, that's the middle! |
13:59:23 | PMunch | No, it's the beginning.. |
13:59:34 | PMunch | Middle would be cutting from both ends like [5..^6] |
14:01:55 | couven92 | so cutting at the end is complicated, and if you want to understand and/or error-check that, you'll have to think about the indexing anyways. However, when you get the rest of a string, you really could care less what the ending index is, and certainly don't care whether the slicing is exclusive, length based or inclusive! |
14:03:02 | couven92 | `high`, gives you the oppurtunity to simply not care and on German/Norwegian/English keyboards it's mostly even faster typing as well |
14:03:25 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:04:05 | PMunch | Yeah I'm not saying don't use high, I'm just saying that there's nothing wrong with using ^ |
14:04:37 | couven92 | PMunch, nothing wrong with it, but I'd never use it if I could use high instead |
14:04:51 | PMunch | And by the way it's "couldn't care less" |
14:05:39 | PMunch | Well consider you have 'var long_variable_name_for_a_pretty_regular_string = "Hello World!"', something I'm sure you can appreciate as a C# programmer :P |
14:05:57 | PMunch | echo long_variable_name_for_a_pretty_regular_string[5..^1] |
14:06:05 | couven92 | ah... yeah I see |
14:06:13 | PMunch | echo long_variable_name_for_a_pretty_regular_string[5..long_variable_name_for_a_pretty_regular_string.high] |
14:06:29 | couven92 | didn't think abou that actually... okay, point taken |
14:07:43 | PMunch | Where is the implementation of slices by the way? |
14:08:21 | PMunch | Having it rewrite to f.readline()[0..f.readline().len-1] is not the best.. |
14:08:46 | FromGitter | <ephja> the system module defines most of these constructs |
14:08:52 | couven92 | PMunch, especially since calling readline twice there, so you'd get two different strings? |
14:09:03 | PMunch | Yeah, that's the problem |
14:09:28 | PMunch | It really should create an intermediary string |
14:09:37 | Araq | PMunch: it's a frontend transformation that macros cannot do and unfortunately sideeffect analysis is done later |
14:09:48 | Araq | we used to error on this construct but now can't -.- |
14:09:54 | PMunch | Hmm, that's a shame.. |
14:10:24 | Araq | rewriting it to (let x = f(); x[^1]) should probably be done here |
14:10:57 | Araq | looks hard to implement, in fact, this feature is surprisingly difficult to implement |
14:11:02 | PMunch | Would it be preferable to always err on the side of caution and rewrite it to let :tmp3492834 = f.readline(); result = :tmp3492834[0..:tmp3492834.len-1] |
14:11:11 | PMunch | Ah yeha |
14:12:53 | PMunch | It really should be done that way though.. The current way is not how you normally would assume a slice works.. |
14:12:58 | couven92 | Araq, it would be nice to have utility functions for this in strutils, like a `left`, `right`, `cutRight` and `middle`? |
14:14:11 | couven92 | uhm... why `cutRight` when you have `left`? sorry... :P |
14:14:56 | Araq | why utilities? we have ..^ for that |
14:15:04 | Araq | bbl |
14:15:10 | couven92 | Araq, for verbosity? |
14:15:26 | PMunch | Hmm, but since you can do things like assign by slice as in the slices part of the tutorial: b[11..^2]="useful" I can see it being difficult to implement |
14:15:44 | Araq | Python's - is Nim's ^ |
14:15:54 | Araq | it's really not all that difficult to learn and accept |
14:16:18 | couven92 | yeah, okay you're probably both right... |
14:16:32 | Araq | Nim's way has the benefit that it moves the decision to compiletime |
14:16:39 | Araq | no nonsense like |
14:17:08 | Araq | let x = parseInt(stdin.readline); a[x] # last for -1 ? ugh |
14:17:09 | couven92 | Araq, so, a template then? :D |
14:17:12 | shmup | Anything in particular that made you think of the ^ syntax? |
14:17:16 | shmup | does it relate to something |
14:17:57 | Araq | it looked better than ~ or @ and we didn't have all that many symbols to choose from |
14:19:20 | Araq | ^ can be seen as an arrow upwards and the usual reading direction is downwards, so it's ok as "change direction" symbol |
14:19:34 | Araq | ymmv |
14:20:00 | shmup | sure, that's fair |
14:21:04 | * | stvc quit (Quit: WeeChat 1.5) |
14:21:08 | * | yglukhov quit (Remote host closed the connection) |
14:23:07 | PMunch | But yeah, slices should be rewritten to something which can later be checked by the compiler against side effects and such. |
14:24:30 | couven92 | why does this not work: https://pastebin.com/Hr4U9Ct9 |
14:24:37 | subsetpark | Araq can you explain what you mean about moving the decision to compile time |
14:25:02 | PMunch | So begin with rewriting it to a template/macro invocation or something, and then later (when the template/macro is evaluated) it should check if that is actually "legal". |
14:26:59 | couven92 | PMunch, just for sake of argument `f.readline()[0..^f.readline().len]` is perfectly okay. Imagine the case that the following line contains a placeholder characters that state how many of the character of line above a relevant! |
14:27:25 | * | bjz joined #nim |
14:27:27 | Arrrr | If you change typed to string, it works |
14:27:44 | couven92 | Arrrr, nope |
14:28:02 | * | bjz quit (Client Quit) |
14:28:12 | Arrrr | Well, that and leave a space between 0, ^ and .. |
14:28:17 | * | krux02 joined #nim |
14:28:43 | couven92 | woah! okay... that DID work, why? |
14:28:43 | PMunch | I assume you mean `f.readline()[0..f.readline().len]` couven92? |
14:29:01 | couven92 | PMunch, yeah, whatever |
14:29:19 | Arrrr | Can you actually return typed in templates? |
14:29:33 | PMunch | Not really, what you wrote would be rewritten as: `f.readline()[0..f.readline().len-f.readline().len]` |
14:29:43 | PMunch | Which is something else entirely :P |
14:30:07 | couven92 | Oh crap! Shit, you're right |
14:30:27 | PMunch | But I get your point, and while that would be a legitimate scenario I don't think f.readline()[0..^1] should be the way to achieve that :P |
14:30:56 | couven92 | no, agreed |
14:31:08 | couven92 | what about my cutRight template? |
14:31:12 | PMunch | Or rather, what you wrote should do what you think it does, read two lines and use the second for slicing |
14:31:41 | couven92 | should I PR that to add to strutils (just to make verbose people like me happy)? :P |
14:31:59 | PMunch | Well, since it takes it in a string I think it would be okay. If it took it as untyped then it would probably have the same problem, although I'm not 100% sure.. |
14:32:25 | * | yglukhov joined #nim |
14:32:51 | * | enthus1ast joined #nim |
14:33:19 | Arrrr | I'd like to see this in strutils: `proc pad*(str: string, space: int, by: char = ' '): string = str & repeat(by, space - len(str))` |
14:33:28 | Arrrr | quite useful for console purpouses |
14:34:39 | Arrrr | I could make a nimble package |
14:35:02 | euantor | https://nim-lang.org/docs/strutils.html#align,string,Natural,Char |
14:35:17 | euantor | Like that you mean? ;) |
14:35:29 | Arrrr | Expect the opposite |
14:35:33 | Arrrr | *except |
14:35:34 | euantor | THough it would be nice to have a version that adds the padding to the right rather than the end |
14:36:06 | Arrrr | Yeah, maybe `ralign` |
14:36:14 | couven92 | euantor, like in C# where we have PadLeft and PadRight? |
14:36:23 | euantor | Yeah, exactly |
14:36:40 | euantor | Same as we have Trim, TrimStart and TrimEnd |
14:37:10 | shmup | are those in strutils? |
14:37:18 | * | yglukhov quit (Ping timeout: 260 seconds) |
14:37:32 | couven92 | `strip` has bool arguments for left and right stripping |
14:37:48 | euantor | Yeah, which is a nice way to handle it, thanks to named arguments |
14:37:56 | couven92 | or `trailing` and `leading` as they are called |
14:38:16 | couven92 | euantor, yup, I thought so, too |
14:40:57 | * | onionhammer1 joined #nim |
14:42:27 | shmup | hm kidna want to see a nice nim example on here https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax |
14:42:42 | shmup | just because it only lists D and Rust and Nim there, but only has Rust and D example |
14:42:50 | shmup | i'd have a much simpler example than the other 2 |
14:42:57 | * | onionhammer quit (Ping timeout: 240 seconds) |
14:43:36 | PMunch | Just write one shmup :) |
14:44:12 | shmup | how about one for adding two vectors together or something |
14:44:32 | shmup | i'll show here first whatever i do |
14:44:35 | PMunch | Yeah that would be nice :) |
14:44:40 | Arrrr | If i were you i'd write something that requires a few lines. I don't know why they need so many for such a simple concept |
14:44:49 | shmup | i completely agree, yeah |
14:44:53 | PMunch | x.add(y); add(x,y), y.add x |
14:45:14 | shmup | yeah, exactly. altho i might spend 2 lines on writing my own proc |
14:45:14 | PMunch | Arrr, they use most of that to define the procedures :P |
14:45:33 | PMunch | You should, it's nice to have a self-containe example |
14:45:45 | couven92 | so how about this: I could imagine this to be found in strutils... It wouldn't hurt, right? |
14:45:50 | couven92 | https://pastebin.com/s2kaKN8M |
14:46:40 | * | krux02 quit (Remote host closed the connection) |
14:47:00 | PMunch | Maybe a "template cut(s: string, left: Natural = 0, right: Natural = 0): string"? |
14:47:02 | * | Calinou is now known as CALINOU |
14:47:47 | couven92 | PMunch, or `slice`? |
14:48:26 | PMunch | Well I guess the cut template would be the same as a slice :P |
14:48:26 | couven92 | no, actually `cut` is better, since you away the specified number of chars... |
14:48:49 | euantor | `slice` is already used: https://nim-lang.org/docs/tut1.html#advanced-types-slices |
14:49:19 | Arrrr | D example done in nim https://pastebin.com/gMqBtweD |
14:49:23 | couven92 | okay... cut it is then... rather a single template than two separate ones? |
14:50:27 | * | aerx joined #nim |
14:50:41 | PMunch | Well, "Hello".cut(left=5) is almost the same as "Hello".cutLeft(5).. |
14:51:45 | couven92 | PMunch, I agree |
14:54:07 | couven92 | Hmm... that didn't work: https://pastebin.com/xT7Ge6fC |
14:54:52 | shmup | ok would y'all name arguments any differently? adding convention a and b? https://gist.github.com/shmup/e912ca6ccfc4ae86dfd135ef78af95fc |
14:55:10 | shmup | style guide for x,y: int, does it have a space between x, y |
14:55:56 | couven92 | shmup, spaces between is definitely nicer to look at |
14:57:10 | shmup | oh, chaining is nice for the example |
14:57:39 | Arrrr | also you could include `add v1, v2` maybe |
14:59:38 | couven92 | Uhm, anyone know why mine failed? I got nothing here... :O |
14:59:59 | Nikky | in c2nim with #defines in structures is there any good way to handle that withouzt manually editing the .h files ? as ihave a script to cppp that stuff |
15:00:05 | couven92 | Do templates not ilke optional args? |
15:01:29 | Arrrr | Natural -> int |
15:02:29 | couven92 | Arrrr, okay that works... why? |
15:03:07 | Arrrr | Seems like `[]` doesn't accept natural, but i'm not sure |
15:03:37 | couven92 | okay... will have to live with it being ints :P |
15:03:43 | * | dom96|w joined #nim |
15:04:01 | dom96|w | When people find your talk before you, you know they're excited :) |
15:04:17 | dom96|w | Slides aren't very visible unfortunately. |
15:04:44 | couven92 | dom96|w, and the sound was not the greates either... |
15:04:49 | PMunch | Yeah, the code examples are a bit weird :P |
15:04:57 | PMunch | And the clapping ridiculously loud.. |
15:05:12 | dom96|w | lol. Well, it is a Northern Irish conference :P |
15:05:13 | PMunch | s/weird/unreadable |
15:05:16 | dom96|w | and the first of its kind |
15:05:25 | shmup | Arrrr: come again re: add v1, v2 (that is valid syntax?) |
15:05:27 | dom96|w | They used iPads to do the recordings |
15:05:33 | dom96|w | and they were placed right beside the audience |
15:05:34 | shmup | Arrrr: not compiling, and maybe i'm doing something wrong |
15:06:00 | PMunch | They could've also cut the information about the day from the video. Watching it online I don't really care that things are running behind schedule or if there is something going on downstairs later :P |
15:06:01 | dom96|w | Anyway, here are the slides https://picheta.me/nidevconf/reveal/ |
15:06:01 | Arrrr | It should work. |
15:06:04 | shmup | it's saying got (Vector), but expected a, b: Vector |
15:06:20 | PMunch | Yeah I guessed it was something like that :) |
15:06:29 | dom96|w | I also asked them to let me view the video before they published it... |
15:06:33 | dom96|w | Heard nothing |
15:06:46 | PMunch | And me and couven92 might steal some of those slides :) We're probably going to do a talk on Nim after the summer |
15:07:25 | Arrrr | It is working ok in play.nim |
15:08:29 | couven92 | PMunch and I were talking about it earlier today... We're thinking about using our never-used video recording infrastructure in our auditoriums to actually record our talk :P |
15:08:39 | dom96|w | demi- what issue were you having? |
15:08:54 | shmup | Arrrr: adjust my add to return a `var Vector` so that you can chain them |
15:09:06 | dom96|w | couven92, PMunch: awesome, feel free to use it. The source is on GitHub as well :) |
15:09:09 | shmup | indeed playground does work with add v1, v2 if I don't return anything in add |
15:09:10 | PMunch | couven92, how's the audio on that though? |
15:09:24 | dom96|w | Bonus points for showing the snake game as well. I think people were impressed. |
15:09:38 | PMunch | Yeah, people seemed to like that |
15:09:43 | shmup | https://gist.github.com/shmup/e912ca6ccfc4ae86dfd135ef78af95fc |
15:09:49 | dom96|w | I was rushed though so I don't think it had as much impact as it could have had |
15:09:50 | couven92 | Well have to try it out... we could actually test that now, when there are no student to distrib |
15:09:50 | PMunch | And it's cool that server and client can share code |
15:09:55 | shmup | in that example `add v1, v2` does not compile |
15:10:13 | couven92 | Arrrr, euantor, PMunch okay, so I'm creating a PR for the `cut` template to be added to strutils... I can throw in `alignLeft` as well, if you like? |
15:10:16 | shmup | i kinda wanna leave out discard and var syntax in the example, hm |
15:10:21 | dom96|w | PMunch: yep, glad that's what you picked out of that, it was exactly my intention :) |
15:10:27 | Arrrr | For that example you don't need Vector to be var |
15:10:39 | Arrrr | probably it doesnt work because of discard |
15:10:51 | * | yglukhov joined #nim |
15:11:00 | Arrrr | not using parenthesis does weird things when you are returning something |
15:11:03 | euantor | couven92: Align left would definitely be nice :) |
15:11:26 | shmup | sorry Arrrr yeah you're right, in _this_ example I need var https://gist.github.com/shmup/e912ca6ccfc4ae86dfd135ef78af95fc |
15:11:48 | Arrrr | Maybe use {.discardable.} |
15:11:59 | Arrrr | Or just ignore it |
15:13:04 | shmup | yeah, don't really wanna throw that {..} syntax in it. uh. hm. |
15:14:45 | * | Andris_zbx quit (Remote host closed the connection) |
15:14:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
15:16:30 | * | krux02 joined #nim |
15:20:40 | * | bjz joined #nim |
15:21:10 | shmup | would you remove my comment regarding discard-statement bc not relevant to UFCS https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax#Nim_programming_language |
15:22:45 | Arrrr | I think it is not worth it, either remove discardable and the comment or let it be |
15:23:19 | shmup | so just to clarify: remove it and let it compile error? |
15:23:21 | Arrrr | But the snippet is small, so i don't think it is a nuisance |
15:23:33 | PMunch | I think it's fine with the {.discardable.} |
15:25:15 | Arrrr | remove the example that makes the discardable needed or just leave it without commenting it |
15:25:50 | Arrrr | Let it be, the example looks good. |
15:26:05 | Arrrr | btw, shouldn't it color the syntax? |
15:26:28 | shmup | you mean more than it is? http://i.imgur.com/wlYIe4w.png |
15:27:23 | * | NotSpooky quit (Quit: Leaving) |
15:27:28 | shmup | discardable is needed in all 5 of those examples, by the way. not just the add v1, v2 |
15:27:42 | shmup | ok. i'm going to remove the comment, but i do think it's kinda nice :P |
15:27:48 | Arrrr | Doesn't look green in my screen. Maybe because i use wikiwand |
15:28:30 | Arrrr | Btw, your example doesn't return a thing. It should read `(a.x + b.x, a.y + b.y)` |
15:28:50 | shmup | !! |
15:29:09 | Arrrr | Well, it is currently returning (0, 0) |
15:29:31 | shmup | yeah |
15:31:12 | Arrrr | Maybe you want to add a second proc that actually returns the sum of both |
15:31:14 | shmup | if I'm not mistaken, I need to create a new Vector in that proc, right? |
15:31:16 | shmup | a mutable one |
15:34:41 | Arrrr | or `result.x = a.x + b.x` etc |
15:35:30 | shmup | huh. wow. I didn't know that would work |
15:35:31 | * | enthus1ast quit (Quit: Lost terminal) |
15:35:42 | shmup | I know about result so little I didn't know it would `be` the return type |
15:35:46 | shmup | out of the box |
15:35:55 | shmup | thanks, I like this |
15:36:14 | shmup | although now it's even more `magical` to non-nim readers, lol |
15:38:01 | Arrrr | https://nim-lang.org/docs/manual.html#statements-and-expressions-return-statement |
15:40:41 | shmup | Arrrr: can you maybe help me understand why SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
15:40:59 | shmup | in the case of line 16 https://gist.github.com/shmup/f2fd90559545b1fdceb4dffc34fed33f |
15:41:00 | * | Trustable joined #nim |
15:42:55 | Arrrr | lel |
15:43:52 | Arrrr | Because : var Type actually returns a pointer |
15:45:04 | shmup | ok, yeah, no, I thought I needed var because when first doing this compiler was talking about immutability but perhaps I was.. doing something different then. I don't know. I pull it out, all is well. |
15:45:42 | * | tankfeeder quit (Quit: Leaving) |
15:46:38 | shmup | I'm losing my mind, var _is_ needed for chaining. I'm being scatter brained as heck right now. Need to actually focus on work lol. I'll think about this later. I just want a nice example that compiles. |
15:47:51 | Arrrr | If i were you i'd leave the example similar to this https://pastebin.com/g982uzRp |
15:48:27 | Arrrr | (there was a v3 that i removed) |
15:49:26 | * | yglukhov joined #nim |
15:51:38 | shmup | thanks. lol. yes. that is good |
15:53:10 | * | vlad1777d quit (Remote host closed the connection) |
15:54:22 | couven92 | PMunch, euantor, https://github.com/nim-lang/Nim/pull/6023 |
15:54:31 | krux02 | when I start my nim program it fails with the message "out of memory" |
15:54:36 | krux02 | but in gdb I don't have a stack trace |
15:54:41 | krux02 | how do I get the stack trace? |
15:54:57 | * | v17d joined #nim |
15:56:12 | krux02 | the progam just quits with a non informative message "out of memory" |
15:56:18 | krux02 | and quits |
15:56:32 | Arrrr | What if it happens because of global vars? |
15:57:07 | FromGitter | <ephja> yay more vectors |
15:57:43 | FromGitter | <ephja> some things are indeed confusing for beginners, but of great help to those who are more experienced |
15:59:09 | * | Matthias247_ joined #nim |
15:59:25 | * | Matthias247 quit (Ping timeout: 276 seconds) |
16:00:56 | * | v17d quit (Remote host closed the connection) |
16:01:09 | * | yglukhov quit (Remote host closed the connection) |
16:02:30 | * | v17d joined #nim |
16:02:32 | Arrrr | From that article i think the nim example is the clearest one |
16:03:00 | * | EastByte quit (Read error: Connection reset by peer) |
16:03:13 | * | EastByte joined #nim |
16:05:15 | * | krux02 quit (Remote host closed the connection) |
16:06:46 | FromGitter | <Varriount> Nikky: You could try implementing handling in C2Nim, but it's not easy |
16:07:23 | FromGitter | <Varriount> Or rather, it requires knowledge about parsers and such. |
16:07:54 | FromGitter | <Varriount> (I'm assuming you mean 'ifdefs' in structure definitions. |
16:08:07 | * | nhywyll joined #nim |
16:13:08 | FromGitter | <ephja> now I can't pass some undefined identifier to an untyped parameter for some reason |
16:18:15 | Nikky | well the ifdefs i solved by using cppp |
16:18:55 | Nikky | c2nim is stumbling over #defines like in here.. https://github.com/nim-lang/c2nim/issues/73 |
16:19:14 | * | chrisheller joined #nim |
16:19:31 | Nikky | which cppp does nto preprocess apparently |
16:19:36 | FromGitter | <ephja> yeah I think there are some issues related to using untyped in macros |
16:20:47 | Nikky | but i cannot really ruse gcc -E unless i somehow mess with the rather complex configure and makefile.. |
16:21:31 | Nikky | another option might be to manually fix it in the .h files but i would have to repeat that every time i run cppp again , and that is assuming i know what the right thing to do is.. |
16:23:27 | FromGitter | <ephja> regex preprocessing is viable in some cases |
16:28:50 | * | cspar_ joined #nim |
16:31:34 | * | cspar quit (Ping timeout: 255 seconds) |
16:35:47 | * | Matthias247_ quit (Read error: Connection reset by peer) |
16:39:27 | * | NotSpooky joined #nim |
16:45:14 | * | yglukhov joined #nim |
16:45:59 | * | nsf quit (Quit: WeeChat 1.7.1) |
16:50:21 | ehmry | hey, I'm getting``Error: illegal capture 'strWrapper'`` with a nested proc in a template, but I'm not sure why its illegal or what is being captured https://gist.github.com/ehmry/60201d4cabef4d0a87bdcdb5f3a56f3b#file-rom-nim-L32 |
17:00:30 | * | johnny_b quit (Ping timeout: 240 seconds) |
17:01:58 | FromGitter | <Varriount> Nikky: I'd just move them around. |
17:02:53 | * | johnny_b joined #nim |
17:03:02 | Nikky | i am not that knowledgeable in C and .h files.. could i move all defines that make problems out of their scopes ? |
17:03:12 | Nikky | like type definitions and enumes etc.. |
17:03:17 | Nikky | *enums |
17:03:17 | FromGitter | <Varriount> Just move them outside the structure definition |
17:03:35 | Nikky | does it make a logical difference if its before or after it ? |
17:04:05 | Nikky | otherwise i would probably write a script that keeps trying to compile and moves the lines to the end of the file |
17:04:17 | FromGitter | <Varriount> Only if you move the define after a point it's been used. |
17:04:45 | FromGitter | <Varriount> Nikky: Can you show me a file? |
17:05:35 | * | yglukhov quit (Remote host closed the connection) |
17:08:01 | * | dom96|w quit (Ping timeout: 255 seconds) |
17:08:45 | Nikky | same i showed you yesterday would work as a example.. the line numbers are all messed up though.. because i just leave out all uneeded features.. |
17:09:39 | Nikky | ah well here.. partially preprocessed https://gist.github.com/NikkyAI/f3dcc740478ffe3c31e79c492acd5f5c |
17:10:45 | FromGitter | <raydf> Hi everyone |
17:11:24 | FromGitter | <raydf> i'm following karax framework, any idea on how to animate with velocity? |
17:13:06 | Araq | raydf: cool. but no, what do you mean? |
17:14:50 | * | Trustable quit (Remote host closed the connection) |
17:15:31 | FromGitter | <raydf> http://velocityjs.org/ |
17:15:46 | FromGitter | <raydf> how to call external javascript libraries |
17:16:24 | FromGitter | <raydf> maybe i'm missing some documentation |
17:18:27 | FromGitter | <raydf> This is a simple call in Velocity ``` Velocity(document.getElementById("dummy"), { opacity: 0.5 }, { duration: 1000 });``` |
17:19:00 | Araq | look at examples/mediaplayer/mediaplayer.nim |
17:19:10 | FromGitter | <raydf> OK, thanks |
17:20:02 | Araq | or at kdom.nim |
17:20:09 | * | NotSpooky quit (Quit: Leaving) |
17:20:22 | Araq | importc and importcpp pragmas do the import from JS |
17:20:52 | Araq | (yes, I know these are misnamed and hardly documented. please create a PR) |
17:22:54 | FromGitter | <raydf> Nice! |
17:27:13 | FromGitter | <raydf> Done, https://github.com/nim-lang/Nim/issues/6024 |
17:28:32 | FromGitter | <raydf> The correct way to make web components is the structure displayed in the mediaplayer example? |
17:33:01 | FromGitter | <raydf> sorry, already saw Carousel example, kudos for the framework, i love the speed of compiling and that i can keep using nim for the frontend part. |
17:33:41 | Araq | yeah, carousel is the example to look at. keep in mind we're designing a 'component' macro so these things will get easier. |
17:34:06 | Araq | for now we focussed on getting the algorithms right. and well... it's still ongoing but progress is good |
17:34:07 | Trioxin | there needs to be a team of people dedicated to pumping out wrappers. I think that would greatly expand the community |
17:34:50 | Araq | Trioxin: maybe, or maybe we need to make c2nim smarter |
17:34:58 | Trioxin | that would do it too |
17:35:03 | Nikky | i am trying :P currently trying to understnad how Arayq did it on wxWindgets |
17:35:30 | Trioxin | I keep being forced to use damn Go for things |
17:35:31 | FromGitter | <raydf> I'll try to contribute with any wrapper i can develop, is there any example of a wrapper for any javascript library? |
17:36:41 | Trioxin | hell I could wrap JS stuff easy but C libs are what's really needed |
17:37:30 | FromGitter | <raydf> right @Trioxin |
17:37:59 | FromGitter | <raydf> i tried to use the redis lib, but it doesn't implement some features. |
17:38:57 | Trioxin | I started a blake2 wrapper earlier just because I thought it would be cool https://github.com/TomAshley303/BLAKE2 |
17:39:42 | FromGitter | <raydf> Nice |
17:40:06 | Trioxin | pretty sure it can't quite be used yet. idk. i'll get back to it later |
17:45:49 | Trioxin | who made nimx? each time I run the example, the window content glitches |
17:48:11 | shmup | raydf: https://github.com/andreaferretti/react.nim |
17:50:23 | * | PMunch quit (Ping timeout: 260 seconds) |
17:52:25 | * | v17d quit (Remote host closed the connection) |
17:54:17 | * | PMunch joined #nim |
17:56:26 | * | dom96|w joined #nim |
17:56:36 | FromGitter | <raydf> @shmup, thanks, a great example, i really need to learn a lot about pragmas and the macro system. |
17:56:50 | Trioxin | hrm. no way to make nim gui easy without nimx |
17:57:00 | shmup | this might be useful too, raydf: https://github.com/nim-lang/Nim/issues/4873 |
17:57:06 | shmup | raydf: as in learning about jsffi |
17:57:50 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
17:59:40 | * | bjz joined #nim |
18:02:37 | FromGitter | <raydf> @shmup, excellent, a lot of goodies :). |
18:08:12 | FromGitter | <ephja> Araq: this seems to work https://gist.github.com/ephja/6124deeff204a32f9b02d207e648211a |
18:09:13 | FromGitter | <ephja> it's a nice typedesc shortcut btw, but maybe I shouldn't use it |
18:11:10 | * | Trioxin quit (Ping timeout: 240 seconds) |
18:15:39 | FromGitter | <ephja> reporting it now |
18:16:12 | * | nhywyll quit (Quit: nhywyll) |
18:16:32 | Araq | ephja: what do you mean "it works and I'm reporting it" ? |
18:17:06 | shmup | do we tag github projects `nim` or `nim-language` :P |
18:17:47 | FromGitter | <ephja> Araq: well, should it? the second overload is never called for the array case, but called when typedesc[int] is passed and when the occurences of array are replaced with int |
18:19:13 | FromGitter | <ephja> btw, is the presence of the generic arguments I and T from a time when they couldn't be omitted? |
18:19:19 | Araq | not sure I can follow you. do you ask about overloading and typedesc or about .magic? |
18:19:41 | Araq | yes to your btw |
18:22:49 | Nikky | the #dynlib directive in c2nim, does it autogenerate the code that picks the names for the fiels on the different platforms ? or do i hvar to copy that into the generated nim file ? |
18:23:37 | Nikky | and i assume putting it into the c2nim file would not help .. |
18:25:09 | dom96|w | shmup 'nim' |
18:25:14 | Araq | Nikky: #dynlib produces .dynlib for procs |
18:28:13 | PMunch | Aww, Trioxin quit. Should've told him about wxnim :) |
18:28:52 | * | pilne joined #nim |
18:28:59 | * | yglukhov joined #nim |
18:29:47 | Araq | yglukhov: Trioxin reported an issue with 'nimx' |
18:30:14 | Araq | "who made nimx? each time I run the example, the window content glitches" |
18:30:53 | FromGitter | <ephja> Araq: the issues are related to overloading |
18:31:06 | FromGitter | <ephja> also: `proc p(x: array) = discard`: "Error: invalid type: 'T' in this context: 'proc (x: array)'" |
18:31:19 | yglukhov | Araq: right, thanks. |
18:32:47 | FromGitter | <ephja> yglukhov: is nimx still broken on devel? |
18:33:13 | yglukhov | ephja: no, its good. |
18:33:20 | FromGitter | <ephja> great |
18:33:51 | FromGitter | <ephja> btw, have you considered including an OOP macro for simplifying inheritance? |
18:34:34 | yglukhov | ephja: i'm not sure i'm following. which macro are you talking about? |
18:36:19 | FromGitter | <ephja> yglukhov: just one that cuts down on some of the boilerplate related to inheriting from widgets |
18:37:48 | FromGitter | <ephja> I wonder if that nakefile can be replaced with nimscript now |
18:37:48 | yglukhov | ephja: can you please point me exactly at the boilerplate which can be reduced? =) |
18:38:41 | yglukhov | nakefile runs jester when building js/emscripten. jester is compiled right into the nalefile. nims can't do that. |
18:38:49 | FromGitter | <ephja> I can't remember exactly, but you need to type certain things for every widget that you inherit from. I'll try nimx again btw |
18:40:30 | yglukhov | sure, thanks. feel free to ping me with feedback =) |
18:44:18 | Nikky | so i managed to convert libtorrent.h using c2nim and it seems to work but their simple_client makes me run into problems where it does not know fprintf |
18:44:28 | Nikky | i probably just overlooked some stuff |
18:45:19 | FromGitter | <ephja> just use 'echo' instead |
18:45:23 | FromGitter | <ephja> ls |
18:45:31 | FromGitter | <ephja> oops |
18:46:24 | Nikky | well this is just the first error i am worried about which other c std lib functions will not work because i overlooked something |
18:54:29 | * | tankfeeder joined #nim |
18:54:55 | FromGitter | <ephja> yglukhov: the scrolling workaround might not work anymore. are you able to scroll windows at all? |
18:55:28 | FromGitter | <Varriount> Nikky: is the converted code posted anywhere? |
18:55:30 | tankfeeder | https://bitbucket.org/mihailp/blake2/src/default/blake2.nim |
18:55:41 | Nikky | i can gist it.. |
18:55:49 | tankfeeder | still cant get working test vectors |
18:56:07 | Nikky | https://gist.github.com/NikkyAI/9ed8c99997e89e36cf61a66ce2291d5f |
18:56:28 | tankfeeder | question: in the code you see group of asserts working on getBlake2b |
18:56:35 | Nikky | it fails to compile because it does not know fprintf and probably all over c functions it uses |
18:56:53 | tankfeeder | getBlake2b generates different results, its ok :) |
18:56:59 | Nikky | i could probably rewrite that.. but there should be a solution for that right ? |
18:57:13 | FromGitter | <ephja> yglukhov: repeatedly appending text seems to cause delays, but I dunno if I'm responsible for that |
18:57:27 | tankfeeder | when i run on test vectors it generates the same result for every vector of two |
18:57:59 | tankfeeder | problem somewhere data variable and proc hex2str |
18:59:10 | FromGitter | <Varriount> Nikky: Oh wow, you actually translated code that does something. |
18:59:11 | tankfeeder | maybe while loop |
18:59:19 | FromGitter | <Varriount> Usually C2Nim is just passed header files. |
18:59:35 | FromGitter | <ephja> you are discarding the pre-allocated strings btw |
19:00:05 | Nikky | @Varriount i switched from ffmpeg which just did not work to libtorrent which i might need as well which is a whole lot less complex and has a test_client in c code i can test with |
19:00:41 | Nikky | the name of c2nim seems to imply it is for c.. otherwise would it not be h2nim ? |
19:00:55 | FromGitter | <ephja> also, you can do: `result = @[]` |
19:01:20 | FromGitter | <Varriount> Nikky: Technically it can convert all C code, however in practice it's usually used on just header files. |
19:01:22 | FromGitter | <ephja> Nikky: it can handle bodies too to some extent |
19:01:29 | tankfeeder | ephja: i will tru |
19:01:31 | tankfeeder | try |
19:01:40 | FromGitter | <Varriount> It's easier to wrap a library, then manually write the logic in Nim |
19:01:50 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:02:17 | subsetpark | wake me up when c2nim can process nimbase.h |
19:02:17 | yglukhov | ephja: i don't have windows. are you saying that scrolling doesnt work at all? |
19:02:34 | Nikky | well it tried .. but i am missing the fprintf and other function imported from stdlib (or whatever it was called) can i do that in embedded nim code when converting ? |
19:03:35 | FromGitter | <Varriount> Nikky: Replace fprintf with echo. |
19:03:37 | FromGitter | <ephja> yglukhov: nah. I think it did before after minimizing and possible clicking on the window |
19:03:56 | Nikky | will that fowork with echo(stderr, ...) |
19:03:59 | Nikky | ? |
19:04:01 | FromGitter | <Varriount> Nikky: c2nim just does dumb translation, it doesn't check that the code actually works. |
19:04:03 | Nikky | *work |
19:04:05 | FromGitter | <ephja> the other bug remains, so I'll just work around it somehow |
19:04:09 | FromGitter | <Varriount> Nikky: For stderr, use stderr.write() |
19:04:21 | yglukhov | ephja: about text lagging? |
19:04:40 | Nikky | ok thanks.. gonna rewrite and come back on the next non obvious errors |
19:05:00 | yglukhov | ephja: which language are you using? |
19:05:02 | yglukhov | for typing |
19:05:35 | * | dom96|w joined #nim |
19:05:55 | yglukhov | ephja: english? |
19:05:57 | FromGitter | <ephja> yglukhov: no, scrolling. if only profiling worked with threads, but I could try a minimal example |
19:06:05 | FromGitter | <ephja> yes |
19:06:19 | FromGitter | <ephja> it's not like I need to hold enter anyway |
19:08:01 | yglukhov | ephja, sorry, it's hard for me to understand whats going on there. what is the common way of reporting ui lib event handling bugs? =) |
19:08:27 | yglukhov | maybe a video would help =) |
19:09:25 | * | jszymanski quit (Quit: computer sleeps...) |
19:18:28 | * | dom96|w quit (Ping timeout: 240 seconds) |
19:18:35 | FromGitter | <ephja> yeah |
19:27:57 | * | yglukhov quit (Remote host closed the connection) |
19:34:55 | Nikky | what would be the nim equivalent of this ? |
19:35:02 | Nikky | `~(cat_progress | cat_port_mapping | cat_debug | cat_performance_warning | cat_peer)` |
19:35:21 | Nikky | c2nim translated it with not and or |
19:35:30 | Nikky | but nim throws some weird type errors |
19:36:09 | Nikky | those are enum values btw |
19:36:37 | FromGitter | <ephja> yglukhov: great lib in any case. the only problem is that a lot of people are picky when it comes to native looks |
19:36:50 | FromGitter | <ephja> I don't see why, because every website is like a different UI |
19:38:49 | Nikky | thiese are the values .. https://gist.github.com/NikkyAI/9ed8c99997e89e36cf61a66ce2291d5f#file-libtorrent-nim-L100-L112 |
19:39:16 | * | jordonbiondo joined #nim |
19:42:46 | * | SusWombat quit (Remote host closed the connection) |
19:44:53 | * | Arrrr quit (Read error: Connection reset by peer) |
19:45:38 | Nikky | so nim cannot do bitwise operations on the type of category_t |
19:46:34 | * | libman joined #nim |
19:46:41 | * | SusWombat joined #nim |
19:47:45 | * | v17d joined #nim |
19:49:06 | * | enthus1ast joined #nim |
19:49:12 | enthus1ast | hi |
19:49:40 | enthus1ast | are you aware of a http byte range implementation for asynchttp? |
19:50:04 | * | jordonbiondo quit (Ping timeout: 260 seconds) |
19:57:02 | * | nsf joined #nim |
20:01:44 | * | yglukhov joined #nim |
20:06:20 | * | Matthias247 joined #nim |
20:13:53 | * | Vladar quit (Quit: Leaving) |
20:21:05 | FromGitter | <Varriount> Nikky: Hm |
20:22:41 | FromGitter | <Varriount> Nikky: `not (cint(cat_progress) or cint(cat_port_mapping) or cint(cat_debug) or cint(cat_performance_warning) or cint(cat_peer))` |
20:23:03 | * | Snircle joined #nim |
20:23:15 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:23:16 | FromGitter | <Varriount> There's probably a less verbose way to do it using the built-in set type, but that's the most obvious way. |
20:23:19 | * | enthus1ast quit (Ping timeout: 276 seconds) |
20:24:35 | * | tankfeeder quit (Quit: Leaving) |
20:25:31 | * | bjz joined #nim |
20:29:40 | * | enthus1ast joined #nim |
20:30:40 | * | couven92 quit (Ping timeout: 260 seconds) |
20:31:24 | Nikky | i tried using set but i have no idea how to convert that to cint then.. trying out your suggestion |
20:32:46 | Nikky | oh yeah well the types are still incorrect.. i think.. lets just wrap it all in cint then |
20:45:53 | * | ipjk joined #nim |
20:50:52 | Nikky | when i create a array is there a way to not define the length and infer that from the amount of strings on the righthand side ? |
20:51:31 | LyndsySimon | Anyone using vim and have syntax highlighting working? |
20:54:28 | * | enthus1ast quit (Ping timeout: 260 seconds) |
20:54:42 | LyndsySimon | Ahh... baabelfish/nvim-nim works. |
20:54:47 | PMunch | LyndsySimon, yeah |
20:54:52 | PMunch | I have it working :) |
20:54:53 | Araq | Nikky: var x = [1, 3, 4] |
20:55:09 | PMunch | Even shows errors when I save the file |
20:56:00 | LyndsySimon | Woot :) |
20:56:15 | LyndsySimon | Have a .vimrc or init.vim to share? |
20:56:48 | PMunch | http://ix.io/y5m |
20:56:53 | PMunch | Not all that much tbh |
20:57:22 | LyndsySimon | Ah, TY :) |
20:57:51 | LyndsySimon | zah/nim.vim wont' work for me. I'm using neovim without a python provider. |
20:58:02 | PMunch | Ah, Windows user? |
20:58:11 | LyndsySimon | Nope, on a Mac atm. |
20:58:18 | LyndsySimon | Just an odd setup. |
20:58:26 | PMunch | Haha, okay :P |
20:58:31 | LyndsySimon | I'm trying to keep vim as fast as possible |
20:59:09 | Nikky | thise call of the c libarary wants a value of type "ptr cint" and the original test_client just passed in 0.. how can i cast that ? |
20:59:12 | PMunch | Hmm, can't say I've even thought vim was slow :P |
20:59:22 | PMunch | But I see what you mean |
20:59:34 | Nikky | i will look into simplifying the cint string madness later if its possible at all |
20:59:48 | PMunch | Nikky, addr? |
21:00:06 | Nikky | oh so that is the keyword.. thanks |
21:00:34 | PMunch | No problem :) |
21:00:45 | Nikky | except it tells me the expression has no adress so i guess it expects a variable or such |
21:01:00 | PMunch | What are you trying to pass it? |
21:01:20 | * | enthus1ast joined #nim |
21:01:23 | PMunch | Oh yeah, I think only vars have an addr. Const and let doesn't |
21:01:25 | PMunch | IIRC |
21:01:26 | Nikky | literally 0 |
21:01:30 | * | CALINOU is now known as Calinou |
21:01:41 | PMunch | Ah, in that case you can just pass it nil |
21:01:57 | PMunch | If you want NULL |
21:01:58 | Nikky | but will the types match ? |
21:02:35 | PMunch | What signature are you trying to call? |
21:02:46 | LyndsySimon | PMunch: vim can be very slow if you have it set up badly, lol. I moved away from it because of that. |
21:02:54 | PMunch | Ah right |
21:03:02 | LyndsySimon | PMunch: Here's my current vimrc: https://github.com/lyndsysimon/dotfiles/blob/master/nvim/init.vim |
21:03:03 | Nikky | just from seeing how often i have to cast things to cint and cstring using this seems to be a pain in the ass.. i hope there is a way to implicetly convert that later |
21:03:23 | Nikky | proc session_pop_alert*(ses: pointer; dest: cstring; len: cint; category: ptr cint): cint {. |
21:03:25 | Nikky | cdecl, importc: "session_pop_alert", dynlib: libname.} |
21:03:51 | Nikky | category: ptr cint is the one causing issues |
21:04:17 | Nikky | but i saved zero as a cint and passed it addr(category) seems to work now |
21:05:22 | PMunch | Well, it depends on what you want. Typically in C when it asks for a pointer to something it wants to save some value there |
21:05:48 | PMunch | So nil and var x:cint = 0 have two quite different meanings :P |
21:06:15 | PMunch | Often times when passed NULL these functions will not store something, maybe saving the execution of a branch |
21:07:33 | PMunch | Ah: if (category) *category = a->category(); |
21:07:49 | * | dexterk quit (Read error: Connection reset by peer) |
21:07:58 | Nikky | ah so it tries to call that ? |
21:08:02 | * | dexterk joined #nim |
21:08:24 | Nikky | and i thought this wuld be easier than ffmpeg.. well it probably is but C sucks |
21:08:38 | PMunch | No, it checks if category, which is a NULL check essentially. So if category != NULL |
21:09:01 | Nikky | ok i think i understand |
21:09:10 | PMunch | And then in writes a->category() to that location |
21:09:27 | PMunch | So after you run session_pop_alert you category value should have changed to something |
21:10:09 | Nikky | i see |
21:10:17 | PMunch | Which is defined in an enum category_t |
21:10:30 | Nikky | well in the test_client it was not used at all but good to know |
21:11:22 | PMunch | Ah yeah, they pass 0. In Nim that would be nil |
21:11:35 | PMunch | C doesn't distinguish between 0 and NULL |
21:12:02 | PMunch | You could type 1 there as well, but that would lead to an illegal storage access fault |
21:12:22 | PMunch | As it would try to write it to memory position 1 :P |
21:14:14 | Nikky | i get that |
21:15:22 | PMunch | So whenever you see 0 passed to a pointer field just use nil in Nim :) |
21:15:55 | Nikky | so the converted main proc has a header like this.. `proc main*(argc: cint; argv: ptr cstring): cint {.cdecl.} =` |
21:15:56 | PMunch | Unless you actually want that value passed back |
21:16:20 | Nikky | ptr ctring is a string array is my guess ? |
21:16:28 | PMunch | Yes |
21:16:51 | PMunch | https://stackoverflow.com/questions/3024197/what-does-int-argc-char-argv-mean |
21:16:59 | PMunch | Basically they are the command line arguments passed in |
21:17:09 | Nikky | well i could either try to create a array and then get the addr of the first element or just change the definition |
21:17:37 | Nikky | but afaik nim does not like uknown length of array does it ? |
21:17:48 | PMunch | Wait, do you want to call a main proc? |
21:17:51 | Nikky | i need a varargs pragma there ? |
21:18:03 | Nikky | well main is in the test_client |
21:18:18 | PMunch | Yeah |
21:18:37 | PMunch | In C main(int argc, char* argv[]) is the procedure called when you run the program |
21:18:43 | Nikky | so i can modify it .. as long as i can convert the passed filenames to cstring i think |
21:19:25 | PMunch | So if you compiled it and wanted to run it you could do "./test_client --help" for example. Then argc would be 2 (1 is the program name) and argv would be ["test_client", "--help"] |
21:19:37 | Nikky | which is converted to that.. how do you get commandline arguiments in nim btw ? have not looked that up.. can you convert to ptr ctring somehow ? |
21:19:42 | PMunch | In Nim the entire file just runs from the beginning |
21:20:36 | PMunch | commandLineParams() |
21:20:43 | PMunch | That would give you the parameters |
21:22:17 | PMunch | So in your nim program running "./nimprogram --help" commandLineParams() would return @["--help"] and getAppFilename() would return "nimprogram". |
21:22:49 | PMunch | So if you wanted to port the test_client to Nim you would use that instead |
21:22:56 | * | Pisuke quit (Quit: WeeChat 1.6-dev) |
21:23:19 | Nikky | i see.. thanks that helps a lot.. |
21:23:28 | PMunch | No problem :) |
21:30:39 | libman | https://warosu.org/g/?task=search&ghost=&search_text=nim+programming - that site came up in my Nim news search |
21:30:41 | * | nsf quit (Quit: WeeChat 1.7.1) |
21:30:53 | * | xet7 quit (Quit: Leaving) |
21:40:40 | * | planhths quit (Ping timeout: 260 seconds) |
21:50:59 | * | ipjk quit (Quit: Leaving) |
21:51:59 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:12:56 | * | v17d quit (Ping timeout: 268 seconds) |
22:14:57 | * | bjz joined #nim |
22:19:35 | * | PMunch quit (Quit: leaving) |
22:24:55 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:25:42 | FromGitter | <zacharycarter> is it just like an aggregator? |
22:29:26 | * | couven92 joined #nim |
22:31:31 | * | bjz joined #nim |
22:35:45 | * | themagician quit () |
22:40:17 | * | shashlick joined #nim |
22:41:29 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:47:28 | * | enthus1ast quit (Ping timeout: 268 seconds) |
22:48:04 | shashlick | running into a weird issue - am using secureHashFile() to get the SHA of files and am running out of memory - appears the memory from the readFile() doesn't get garbage collected |
22:49:25 | * | enthus1ast joined #nim |
22:50:59 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:51:53 | libman | Are there any English-language Nim videos missing from https://www.youtube.com/playlist?list=PLXIivpcMlfwAevvA4IvLIiYOujqSuyyKY (not counting that one-minute teaser of Rumpf in Kiev). |
22:52:29 | libman | s/.$/?/ |
22:56:48 | LyndsySimon | I need some advice: I'm playing with building a roguelike to learn Nim, and I want to represent a map as a type. The map will be an two-dimensional dense array of Tiles (another type), the dimensions of which will not be known at compile-time, but will be known at runtime and will not change. Must I use a sequence, or is there a better type of which I'm unaware? |
23:00:22 | LyndsySimon | I fear I'm thinking of this in too much of an OOP-centric mindset. |
23:04:22 | FromGitter | <zacharycarter> oooo |
23:04:27 | FromGitter | <zacharycarter> my kind of question |
23:04:33 | FromGitter | <zacharycarter> why not just an array |
23:04:55 | FromGitter | <zacharycarter> oh you said the size is variable |
23:05:19 | FromGitter | <zacharycarter> LyndsySimon: I would use a sequence |
23:05:35 | FromGitter | <zacharycarter> single dimension |
23:06:54 | FromGitter | <zacharycarter> also you should consider using https://github.com/zacharycarter/blt-nim :P |
23:10:03 | LyndsySimon | zacharycarter: Thanks! I'll read up on that. |
23:11:00 | LyndsySimon | zacharycarter: I'm really trying to stay super simple. I'm less concerned with it getting done that I am with thoroughly learning nim. |
23:11:24 | FromGitter | <zacharycarter> LyndsySimon: blt is pretty simple to use it's like a opengl version of ncurses |
23:11:39 | LyndsySimon | I've never used either either of those :) |
23:11:55 | LyndsySimon | My background is mostly backend webdev, with some scientific computing thrown in for spice. |
23:12:02 | FromGitter | <zacharycarter> ah okay - I kind of love programming roguelikes so these are all roguelike things :P |
23:12:32 | FromGitter | <zacharycarter> gotcha - ncurses is a library a lot of roguelikes are programmed with it's a unix terminal friendly library for graphical terminal output |
23:13:16 | FromGitter | <zacharycarter> bearlibterminal uses opengl and sdl I believe for windowing / rendering respectively, but it has a very high level api similar to ncurses |
23:14:00 | FromGitter | <zacharycarter> if you need some way of rendering graphics for your roguelike blt is a great fit |
23:14:08 | * | LyndsySimon nods |
23:14:23 | FromGitter | <zacharycarter> also if you want any advice on how to code roguelikes there are a few good channels on irc |
23:14:29 | FromGitter | <zacharycarter> ===rgrd on irc.quakenet.org=== |
23:14:49 | LyndsySimon | Yeah, on second thought that's a good idea. I need to learn environment management and how to navigate a foreign codebase, too. |
23:15:40 | LyndsySimon | I'm following this series: https://www.reddit.com/r/roguelikedev/comments/6jqemp/roguelikedev_does_the_complete_python_tutorial/ |
23:16:06 | FromGitter | <zacharycarter> yeah that's not a bad tutorial |
23:16:16 | FromGitter | <zacharycarter> I did the C++ version years ago |
23:16:33 | FromGitter | <zacharycarter> it doesn't lead to very good game code but if you just want to learn the language it should suffice I'd think |
23:16:53 | FromGitter | <zacharycarter> it uses libtcod which there also exist bindings for, for Nim, but I think you could get away with using bearlibterminal |
23:18:26 | LyndsySimon | I'm not trying to follow it exactly, so much as just give myself some ongoing motivation to continue. |
23:18:40 | LyndsySimon | I was originally planning on doing it all from scratch, lol. |
23:18:51 | FromGitter | <zacharycarter> roguelikes are a black hole :P so if you actually start liking the game you're writing you could get really into it, I know I have |
23:18:55 | LyndsySimon | I figured I'd lose interest about the time I was starting to flesh out map generation. |
23:18:59 | FromGitter | <zacharycarter> they're extremely algorithm heavy |
23:19:02 | * | LyndsySimon nods |
23:19:16 | FromGitter | <zacharycarter> what kind of maps are you looking to generate? |
23:19:18 | LyndsySimon | I lose Monday and Tuesday nights to playing Dwarf Fortress. |
23:19:25 | LyndsySimon | s/lose/lost |
23:19:46 | * | LyndsySimon shrugs |
23:19:49 | FromGitter | <zacharycarter> I barely play games anymore I spend so much time trying to write them / things for them |
23:19:59 | * | yglukhov quit (Remote host closed the connection) |
23:20:02 | FromGitter | <zacharycarter> well you can get very creative with map generation |
23:20:08 | LyndsySimon | No idea :) I was going to hardcode a simple map and hide it behind a `generateDungeon` proc, then go back later. |
23:20:51 | FromGitter | <zacharycarter> example: https://github.com/zacharycarter/mapgen |
23:21:08 | LyndsySimon | So... blt-nim isn't on nimble, is it? How do I go about including it in my project properly? |
23:21:22 | FromGitter | <zacharycarter> you can just include the github url |
23:21:31 | LyndsySimon | Yep, I definitely found the right person to talk to :) |
23:21:38 | LyndsySimon | Do I remember you being from NoVA? |
23:21:43 | FromGitter | <zacharycarter> yup! |
23:21:48 | FromGitter | <zacharycarter> I work in Centreville |
23:22:21 | FromGitter | <zacharycarter> so require "https://github.com/zacharycarter/blt-nim.git" should work |
23:22:44 | FromGitter | <zacharycarter> were you from Charlottesville? |
23:24:32 | FromGitter | <zacharycarter> or are you rather haha |
23:26:35 | LyndsySimon | Yep, I am :) |
23:26:41 | LyndsySimon | That's awesome. |
23:27:02 | LyndsySimon | I'm going on vacation in OBX all next week, and hope to have enough time to really sink my teeth into this stuff. |
23:27:27 | FromGitter | <zacharycarter> Awesome :D, good place to do it, nice and relaxing |
23:28:02 | FromGitter | <zacharycarter> definitely ping me / ask in here if you have any questions, the community is generally very helpful |
23:31:01 | LyndsySimon | I've been very happy thus far. |
23:31:08 | LyndsySimon | Do you have a repo somewhere that's using blt-nim? |
23:32:31 | LyndsySimon | I'm trying to figure out how to get bearlibterminal.dylib :) |
23:32:38 | * | couven92 quit (Quit: Client Disconnecting) |
23:33:40 | FromGitter | <zacharycarter> I don't, but it should be pretty simple to compile, one sec |
23:34:11 | LyndsySimon | Nope, got it :) |
23:34:24 | LyndsySimon | It feels weird to be so new to things. |
23:34:52 | FromGitter | <zacharycarter> awesome :D yeah I know what you mean |
23:35:31 | FromGitter | <zacharycarter> Nim comes quick though and it enables crazy productivity |
23:35:51 | FromGitter | <zacharycarter> I built https://github.com/fragworks/frag in not very much time although now I'm abandoning it |
23:42:52 | LyndsySimon | LOL, this is so frustrating. |
23:42:53 | LyndsySimon | https://gitlab.com/lyndsysimon/roguelike-nim/tree/blt |
23:43:03 | LyndsySimon | all I'm doing is importing blt and trying to open a terminal. |
23:43:36 | LyndsySimon | I keep getting an error, which reads in part: "main(16957,0x7fffa483c3c0) malloc: *** error for object 0x7fa149855800: pointer being freed was not allocated" |
23:45:38 | * | bjz joined #nim |
23:47:07 | LyndsySimon | Oh. |
23:47:19 | LyndsySimon | That error is happening on exit, not on terminal_open(). |
23:47:24 | LyndsySimon | I can ignore it for the moment then. |
23:48:45 | FromGitter | <zacharycarter> sorry, took my dog out let me see |
23:49:23 | LyndsySimon | No worries, IRC is async and you're not getting paid. |
23:49:34 | FromGitter | <zacharycarter> :P trut |
23:49:37 | FromGitter | <zacharycarter> truth* |
23:52:47 | FromGitter | <zacharycarter> strange I don't get that error - I just downloaded and copied the default binary too |
23:52:52 | FromGitter | <zacharycarter> what OS are you on? |
23:53:08 | LyndsySimon | macOS Sierra |
23:53:14 | FromGitter | <zacharycarter> same |
23:53:43 | FromGitter | <zacharycarter> ah nevermind I do get the error |
23:54:55 | FromGitter | <zacharycarter> I'm guessing it has something to do with Nim's GC trying to collect memory that hasn't been allocated after the program terminates |
23:55:14 | LyndsySimon | Someone was getting it in Python a few months ago. |
23:55:26 | LyndsySimon | https://www.reddit.com/r/roguelikedev/comments/5ewmrp/sharing_saturday_130/dafpd7f/ |
23:55:49 | FromGitter | <zacharycarter> ah good find |
23:58:37 | LyndsySimon | My current suspicion is that the version of Nim I'm using differs from the one you used to write blt-nim, or your environment is different. |
23:59:16 | LyndsySimon | I'm getting some odd stuff - like the fact that `terminal_open()` returns an int, but blt's API reference says it returns a bool. `terminal_close()` throws an error. |