00:00:38 | FromDiscord_ | <deech> Araq: Yes, I'm just not sure where to look to fix template substitutions. |
00:01:16 | Araq | semtempl.nim checks the template, evaltempl.nim expands templates |
00:03:00 | FromDiscord_ | <deech> Thanks! |
00:21:19 | * | fthe quit (Quit: bye) |
00:21:21 | Araq | but it's likely really hard for a newcomer |
00:21:35 | Araq | you should start with a simpler compiler bug |
00:21:52 | Araq | but I have to sleep now, I can help you more tomorrow |
00:22:19 | * | martin1_ joined #nim |
00:26:18 | * | Pisuke quit (Ping timeout: 245 seconds) |
00:31:41 | * | bozaloshtsh_ quit (Quit: ZNC 1.7.1 - https://znc.in) |
00:31:52 | * | bozaloshtsh joined #nim |
00:31:52 | * | bozaloshtsh quit (Changing host) |
00:31:52 | * | bozaloshtsh joined #nim |
01:02:36 | * | martin1_ quit (Ping timeout: 250 seconds) |
01:09:31 | * | Pisuke joined #nim |
01:10:07 | * | martin1_ joined #nim |
01:17:59 | * | jakob0094 joined #nim |
01:36:32 | * | Jesin quit (Quit: Leaving) |
01:38:50 | * | Jesin joined #nim |
01:43:13 | * | jakob0094 quit (Remote host closed the connection) |
01:44:43 | * | Jesin quit (Remote host closed the connection) |
01:50:19 | * | Jesin joined #nim |
01:51:33 | * | theelous3_ quit (Ping timeout: 246 seconds) |
01:56:02 | * | zachk quit (Quit: Leaving) |
02:05:56 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
02:50:46 | * | tefter joined #nim |
02:56:25 | leorize | martin1_: mingw-w64 toolchain is what you need |
02:56:56 | leorize | just try compiling with `nim c -d:mingw` |
02:57:43 | leorize | the variables declaring what compiler to use and where is it is in the default nim.cfg |
02:57:50 | leorize | just look for the string "mingw" |
03:03:44 | leorize | shashlick: the backtrace from gdb does not provide any meaningful data? |
03:07:43 | * | banc quit (Quit: Bye) |
03:23:28 | * | banc joined #nim |
03:45:11 | * | Tyresc quit (Quit: WeeChat 2.3-dev) |
04:07:28 | * | shpx joined #nim |
04:34:52 | * | martin1__ joined #nim |
04:36:26 | * | martin1_ quit (Ping timeout: 244 seconds) |
04:44:12 | * | shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
04:46:44 | * | shpx joined #nim |
04:48:08 | * | shpx quit (Client Quit) |
04:49:11 | * | shpx joined #nim |
04:53:27 | * | shpx quit (Ping timeout: 240 seconds) |
04:56:16 | * | PrimHelios quit (Quit: Leaving) |
05:02:14 | * | lritter quit (Ping timeout: 250 seconds) |
05:03:08 | * | lritter joined #nim |
05:09:04 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:21:48 | * | nsf joined #nim |
05:29:59 | shashlick | martin1_: https://nim-lang.github.io/Nim/nimc.html#cross-compilation-for-windows - only on devel though |
05:30:11 | shashlick | leorize: nope, nothing useful at all |
05:36:57 | * | nc-x joined #nim |
05:39:03 | nc-x | shashlick: https://github.com/nim-lang/Nim/issues/9893 I am unable to `nim c -r tests/tscinfull.nim` It fails with `Implementation of Scintilla_registerclass expected` at scintilla.nim(1242, 5) |
05:40:52 | nc-x | Okay wait |
05:40:56 | nc-x | It works fine for me |
05:41:00 | nc-x | windows 10 1809 |
05:41:04 | nc-x | using clang |
05:41:47 | nc-x | I had to modify nimgen\src\globals.nim to use `clang` and `clang++` instead of gcc and g++ |
05:42:08 | * | martin1__ quit (Ping timeout: 245 seconds) |
05:42:13 | nc-x | and I ran `nim cpp -r tests/tscinfull.nim` (notice `nim cpp` instead of `nim c`) |
05:43:30 | nc-x | msvc linker barks up a lot of warnings. (clang on windows requires either msvc or mingw installed AFAIK). |
05:44:19 | nc-x | But then I get a small window opened and lots of 0's and a few 1's printed on the console. |
05:44:41 | * | endragor joined #nim |
05:44:50 | nc-x | Latest nim devel BTW |
05:45:51 | * | endragor quit (Remote host closed the connection) |
05:47:31 | * | nc-x quit (Quit: Page closed) |
05:49:17 | shashlick | thanks nc-x |
05:51:37 | shashlick | that |
05:52:08 | * | nc-x joined #nim |
05:52:32 | nc-x | BTW which gcc version are you on? Maybe try on some other gcc as well. |
05:53:07 | * | nc-x quit (Client Quit) |
05:54:03 | shashlick | i'm using mingw gcc 7.3.0 |
05:56:08 | shashlick | so I migrated from the code I have to using how it is in winim and it is working now for me |
05:56:50 | shashlick | something about how I have the wrapper is messing up nim |
05:57:02 | shashlick | but note that the same gcc works with nim 0.18.0, but not 0.19.0 |
05:58:00 | shashlick | unfortunately, I cannot simply import winim since scintilla's HanjaDic.cxx errors on compile if -DWIN32_LEAN_AND_MEAN is defined |
05:58:10 | shashlick | bizarre stuff but what can you do |
06:00:07 | shashlick | by the way, you can use $CC and $CPP env vars to use clang instead of gcc |
06:02:28 | * | leorize quit (Ping timeout: 250 seconds) |
06:06:21 | * | anamok joined #nim |
06:06:23 | anamok | hi |
06:07:49 | anamok | How to get a reference on an object? Like `&` in C. Ex.: `let node = Node(value: value)`, and later I want its memory address. |
06:08:16 | anamok | I'm trying to implement a linked list. |
06:09:23 | * | leorize joined #nim |
06:09:26 | anamok | I have a head pointer (of type ref Node) that I want to point on a newly created node object. |
06:10:47 | * | endragor joined #nim |
06:11:28 | * | endragor_ joined #nim |
06:14:14 | leorize | anamok: you can't get a ref of an object, only it's ptr |
06:14:30 | leorize | if you want a ref, you have to create one in the first place |
06:15:07 | * | endragor quit (Ping timeout: 244 seconds) |
06:18:24 | leorize | I'd recommend you make your node a ref object by default |
06:18:58 | anamok | leorize: Here is my first attempt of a linked list: http://ix.io/1vAJ/nim . Lines 15-20 are problematic. |
06:19:44 | leorize | `Node` by itself is already a ref object... |
06:19:55 | leorize | ref ref object is certainly not what you want I believe? |
06:20:55 | * | nc-x joined #nim |
06:21:09 | nc-x | anamok: you could look at how nim stdlib implements these data structures |
06:21:36 | nc-x | https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/lists.nim |
06:21:41 | shashlick | any idea how to prevent setting -DWIN32_LEAN_AND_MEAN for a specific c file during Nim compilation? |
06:22:32 | leorize | counter it with `-UWIN32_LEAN_AND_MEAN` |
06:22:47 | nc-x | shashlick: nope. I never tried interfacing with c/cpp. |
06:23:00 | * | nc-x quit (Client Quit) |
06:23:06 | shashlick | i don't get it - winim doesn't import winlean anywhere but still during compile you get the -D |
06:23:14 | shashlick | and the only place it gets set is winlean |
06:23:27 | leorize | maybe the compiler set it by default? |
06:23:57 | leorize | anyhow, using -UWIN32_LEAN_AND_MEAN should mitigate the effect of it's -D counterpart |
06:24:05 | * | dddddd quit (Remote host closed the connection) |
06:24:38 | anamok | leorize, I found it out, thanks for the tip: http://ix.io/1vAK/nim |
06:24:39 | shashlick | it seems to work |
06:25:15 | anamok | leorize, Is it possible to put lines 11-13 into one line? |
06:25:33 | leorize | anamok: you should make Node a ref object and change the type of .next -> Node |
06:26:25 | leorize | once you're done with that, line 11-13 could be: var node = Node(value: value) |
06:27:32 | leorize | if you want to keep it as it is now, then `var node = new Node; node.value = value` |
06:30:46 | anamok | leorize, Thanks, updated: http://ix.io/1vAN |
06:31:12 | anamok | nc-x, Thanks, but I wanted to try to do it manually. |
06:33:10 | shashlick | WIN32_LEAN_AND_MEAN is only set in winlean with passC, i don't see how winlean comes into this |
06:37:36 | leorize | anamok: I think LinkedList could just be an object instead? |
06:37:58 | leorize | shashlick: have you checked if the C compiler set WIN32_LEAN_AND_MEAN by default? |
06:38:07 | leorize | or if any C headers define it? |
06:49:00 | shashlick | well it shows up on the gcc command generated by nim which means nim put it there for some reason |
06:51:57 | leorize | check every processed modules? |
06:55:46 | * | lritter quit (Ping timeout: 250 seconds) |
06:59:15 | * | narimiran joined #nim |
07:01:50 | * | endragor_ quit (Remote host closed the connection) |
07:10:14 | * | Trustable joined #nim |
07:15:57 | Araq | shashlick: maybe you got .cdecl and .stdcall mixed up. |
07:16:18 | Araq | then it works sometimes as you described |
07:22:20 | shashlick | Araq: its the same stdcall in winim as well, just as in my snippet |
07:22:50 | Araq | scintilla uses stdcall iirc but who knows how it was built |
07:42:42 | shashlick | Ya is compiled in and wrapped with c2nim using stdcall |
07:59:58 | Araq | gist a stacktrace |
08:27:30 | * | nsf quit (Quit: WeeChat 2.3) |
08:43:29 | * | Trustable quit (Remote host closed the connection) |
08:45:27 | * | nc-x joined #nim |
08:45:47 | nc-x | Araq: How do I add two tests in same file? (for https://github.com/nim-lang/Nim/pull/9909) |
08:46:43 | nc-x | bcos well, the compiler quits after the first error being shown... |
08:50:42 | nc-x | Anyways I split it into 2 files for now. |
08:51:52 | * | nc-x quit (Quit: Page closed) |
08:52:46 | Araq | cmd: 'nim check $file' |
08:52:55 | Araq | nimout: '''stuff here the compile should report''' |
08:59:35 | FromDiscord_ | <Virepri> is it possible to convert a seq to an iterator, or something of that sort? |
09:03:24 | * | kapil____ quit (Quit: Connection closed for inactivity) |
09:05:50 | narimiran | @Viepri `for elem in mySeq` works |
09:12:27 | FromDiscord_ | <Virepri> ```proc part2*(): string = |
09:12:27 | FromDiscord_ | <Virepri> let freqs = sequtils.map(regex.split(input, re"\n"), (str: string) => strutils.parseInt(str)) |
09:12:27 | FromDiscord_ | <Virepri> var seen: HashSet[int] = initSet[int]() |
09:12:27 | FromDiscord_ | <Virepri> var freq = 0 |
09:12:27 | FromDiscord_ | <Virepri> while !seen.contains(freq): |
09:12:28 | FromDiscord_ | <Virepri> for freqchange in freqs: |
09:12:29 | FromDiscord_ | <Virepri> seen.incl(freq) |
09:12:31 | FromDiscord_ | <Virepri> freq += freqchange |
09:12:32 | FromDiscord_ | <Virepri> if seen.contains(freq): |
09:12:34 | FromDiscord_ | <Virepri> break |
09:12:35 | FromDiscord_ | <Virepri> $freq``` |
09:12:36 | leorize | please |
09:12:37 | FromDiscord_ | <Virepri> this is REALLY horrible performance |
09:12:39 | FromDiscord_ | <Virepri> I have to be doing SOMETHING wrong |
09:12:48 | leorize | don't paste directly to discord |
09:12:53 | FromDiscord_ | <Virepri> oh |
09:12:55 | FromDiscord_ | <Virepri> sorry |
09:13:00 | FromDiscord_ | <Virepri> here, I'll upload to hastebin |
09:13:15 | FromDiscord_ | <Virepri> https://hastebin.com/odadizohob.cs |
09:13:37 | FromDiscord_ | <Virepri> but like, that takes multiple seconds to run.... I'm surely doing something wrong, right? |
09:13:42 | narimiran | re: performance: use `intsets` instead of `HashSet` |
09:13:48 | FromDiscord_ | <Virepri> oh |
09:14:05 | leorize | also, use mapIt |
09:14:09 | leorize | map is slow |
09:14:34 | narimiran | leorize: mapIt is faster than map? i had no idea |
09:14:58 | leorize | yea, map use a closure, so it's always slower than mapIt, which is merely a template expansion |
09:15:04 | FromDiscord_ | <Virepri> alright |
09:15:22 | Araq | regex.split is also terrible given that we have a splitLines iterator |
09:16:39 | narimiran | `input.splitlines.map(parseInt)` is how i usually do it |
09:17:32 | Araq | and why does 'while !' even compile? use the 'not' operator |
09:18:03 | Araq | and use containsOrIncl() |
09:18:05 | FromDiscord_ | <Virepri> holy cow |
09:18:09 | FromDiscord_ | <Virepri> yeah that's way way faster |
09:18:29 | narimiran | `intsets` is where is at. you're 8 days behind us ;) |
09:19:06 | narimiran | (this is AoC day1, right? :)) |
09:19:28 | FromDiscord_ | <Virepri> yeah |
09:19:32 | FromDiscord_ | <Virepri> I know I'm a couple days behind |
09:19:37 | FromDiscord_ | <Virepri> I'm restarting in nim |
09:19:51 | FromDiscord_ | <Virepri> (Am i allowed to advertise my shitty stream here?) |
09:20:41 | narimiran | only if it is not very shitty :P |
09:21:25 | leorize | @Virepri: do you come to Nim from Python? |
09:21:27 | Araq | narimiran: we need something better than splitLines.map(parseInt), a variant of scanf would help |
09:22:22 | narimiran | Araq: i'm using scanf extensively in this year's AoC, but one line at time. you would like to see multiline version of scanf? |
09:22:52 | FromDiscord_ | <Virepri> leorize: I actually come from golang. I tried scala initially but wasn't a huge fan |
09:23:06 | FromDiscord_ | <Virepri> I was mostly just looking to use AoC as an opportunity to learn |
09:23:14 | leorize | oh, I saw you're qualifying symbols there :P |
09:23:17 | Araq | I don't know yet, but whenever somebody uses any variant of split() a baby dies |
09:23:23 | FromDiscord_ | <Virepri> anyway, https://twitch.tv/virepri |
09:23:27 | narimiran | Araq: lol |
09:23:36 | FromDiscord_ | <Virepri> y'all can come suffer with me |
09:23:56 | narimiran | @Virepri AoC is a great opportunity to learn Nim! this is what i did last year and it helped me immensely |
09:24:09 | Araq | split is the poor man's lexing framework, always slow, almost always wrong |
09:25:49 | Araq | here split "this command" for me |
09:25:52 | Araq | ^ oops. |
09:31:58 | FromDiscord_ | <Virepri> ok, now, here comes the next dumb question |
09:32:10 | FromDiscord_ | <Virepri> is it possible to make a seq into a looping linked list for the purpose of iteration? |
09:32:17 | FromDiscord_ | <Virepri> because that'd be a neat performance hack |
09:32:35 | leorize | no, and why would it be a performance hack? |
09:33:04 | narimiran | @Virepri i've used `itertools.cycle`, mostly because that is my nimble package :) |
09:34:06 | narimiran | if you're asking because of the second part where you iterate multiple times through the list |
09:34:16 | FromDiscord_ | <Virepri> yup |
09:51:33 | Araq | the cost of a seq is its materialization, once you have it, iteration over it is as fast as it can get |
09:51:53 | * | nc-x joined #nim |
09:51:56 | Araq | "seq to iterator" is possible but slower |
09:52:14 | nc-x | Araq: Any idea re https://travis-ci.org/nim-lang/Nim/jobs/465546822#L3886 |
09:53:49 | Araq | no but it should be easy to reproduce locally |
09:54:25 | FromDiscord_ | <Virepri> https://nim-lang.org/docs/tables.html is there something more efficient than this for mapping a set of characters to a set of integers? |
09:54:40 | FromDiscord_ | <Virepri> because last time I got caught up using hashset, when intset was more efficient |
09:54:52 | FromDiscord_ | <Virepri> and I mostly just want to make sure I'm not seeing one thing and getting distracted |
09:55:02 | narimiran | @Virepri you can use arrays ;) |
09:55:17 | leorize | array of tuples :P |
09:55:19 | nc-x | Araq: I don't have linux/mac and it passes on windows locally/appveyor both. |
09:56:23 | Araq | nc-x: ask narimiran to run it ;-) |
09:56:39 | Araq | I'm busy with the bloody testament refactorings |
09:56:42 | nc-x | Anyone with linux can try https://github.com/nim-lang/Nim/pull/9911 and run `koch tests c modules`? |
09:56:54 | nc-x | narimiran: ^^^ |
09:57:02 | narimiran | nc-x: i'll do it :) |
09:57:10 | nc-x | thanks! |
10:00:41 | FromDiscord_ | <Virepri> `var seen: array[char, int]` does this technically initialize the array? I mean, I doubt it does, but I don't know the "proper" way to do it. |
10:00:42 | Calinou | I'll test it too |
10:00:51 | narimiran | nc-x: maybe you know how do i easily pull your branch? |
10:00:56 | FromDiscord_ | <Virepri> it doesn't error out when I'm compiling 👀 |
10:01:03 | FromDiscord_ | <Virepri> it feels sketch man |
10:01:06 | leorize | Virepri: yes, it initialize by default |
10:01:09 | Calinou | an easy way is to install hub (https://hub.github.com/) and run "hub checkout <PR URL>" |
10:01:09 | FromDiscord_ | <Virepri> o |
10:01:12 | FromDiscord_ | <Virepri> aight |
10:01:13 | narimiran | @Virepri it will create an array with zeros |
10:01:15 | FromGitter | <mratsim> > *<Araq>* I don't know yet, but whenever somebody uses any variant of split() a baby dies ⏎ ⏎ I killed a baby yesterday. Was trying to do a sentiment analysis example on 50k IMDB reviews, it was too damn slow. I need to build a custom string parser/tokenizer: https://github.com/mratsim/Arraymancer/blob/example-sentiment-analysis/examples/ex06_helpers.nim#L108-L127 |
10:01:15 | Calinou | it will automatically switch to the branch |
10:01:36 | leorize | Virepri: wouldn't that array be a bit... too big? |
10:01:53 | leorize | are you gonna use all of the 255 possible values? |
10:02:22 | narimiran | @Verpri leorize: `array['a'..'z', int]` or something like that should be enough |
10:02:23 | Calinou | I find myself using split since I don't know enough about lexers :P |
10:02:23 | FromGitter | <mratsim> @Virepri, just use countTable https://nim-lang.org/docs/tables.html#CountTable |
10:02:50 | nc-x | narimiran: https://stackoverflow.com/a/30584951 |
10:02:56 | leorize | Calinou: scanf is supposed to make it simple :P |
10:03:13 | FromGitter | <mratsim> @Calinou, I want something that is reasonably fast on the 1 billion words dataset: http://www.statmt.org/lm-benchmark/ |
10:03:24 | FromGitter | <mratsim> using split would be crazy :D |
10:03:28 | narimiran | nc-x: thanks! |
10:04:36 | Calinou | one failure, https://hastebin.com/izahoyubup.txt |
10:04:58 | Araq | mratsim: Maybe some nice guy will revive my Lexim project |
10:05:00 | FromGitter | <mratsim> @Calinou, if you want an easy weekend project to learn about lexer, just try to do a brainfuck VM. For example this is my lexer: https://github.com/mratsim/jitterland/blob/master/bfVM_v02.nim#L30-L58 |
10:05:01 | Calinou | I don't know if this is related to my system, I use GCC 8.2.1 on Fedora 29 |
10:05:32 | leorize | try running it by hand? |
10:05:43 | nc-x | Calinou: thanks. can you manually try `nim c tests/modules/t9627.nim` |
10:05:43 | Calinou | I had a class on grammars like EBNF but I didn't understand it much since we didn't implement anything using it :| |
10:05:58 | Araq | mratsim: seem a terrible lexer to me ;-) |
10:06:18 | Calinou | https://hastebin.com/ojacivuqat.txt |
10:06:44 | FromGitter | <mratsim> a generator would take lots more space;) |
10:07:06 | Araq | lexbase is a stdlib module |
10:07:10 | FromGitter | <mratsim> @Calinou I think this is a good example of what lexers are supposed to do: http://www.craftinginterpreters.com/scanning.html#the-scanner-class and you can check the JSON module as well |
10:07:45 | leorize | nc-x: you should rename your modules folder... |
10:08:18 | nc-x | Ah ok... **** linux and mac -.- |
10:08:20 | narimiran | nc-x: http://ix.io/1vBy |
10:09:13 | FromDiscord_ | <Virepri> narimiran: no I wasn't, and yeah, your suggestion was good |
10:09:28 | FromDiscord_ | <Virepri> didn't know I could get fancy like that |
10:09:32 | FromDiscord_ | <Virepri> thanks for pointing it out |
10:09:49 | nc-x | narimiran: Thanks but found the issue. |
10:10:04 | narimiran | nc-x: ok, ping me later if needed |
10:10:41 | nc-x | Araq: Can we implement your executable_name.elf idea on linux and similar for mac? ;) |
10:11:37 | leorize | no, linux users will kill you :P |
10:13:23 | nc-x | :P |
10:14:09 | FromDiscord_ | <Virepri> any good way to find the intersection between two strings? |
10:15:07 | * | nc-x quit (Quit: Page closed) |
10:16:18 | leorize | my overly complex way: split the strings by words, then feed them to a HashSet |
10:17:38 | FromDiscord_ | <technicallyagd> Does the order matter? |
10:17:50 | Araq | mratsim: he puts every token in a list. that's not required by any parser I've ever written |
10:17:51 | FromDiscord_ | <Virepri> yes |
10:18:15 | FromDiscord_ | <Virepri> it has to be in the same order as the first string. The strings are the same length |
10:18:15 | FromDiscord_ | <Virepri> so |
10:18:34 | Araq | you can "stream" these things easily |
10:18:34 | FromDiscord_ | <Virepri> abcde |
10:18:34 | FromDiscord_ | <Virepri> abcee |
10:18:34 | FromDiscord_ | <Virepri> would give |
10:18:34 | FromDiscord_ | <Virepri> abce |
10:18:51 | FromDiscord_ | <Virepri> my current solution just zips them together, filters, and then folds |
10:18:58 | FromDiscord_ | <Virepri> :P |
10:19:27 | FromDiscord_ | <technicallyagd> I went with for loop hell lol |
10:19:29 | FromGitter | <mratsim> @Araq, Ah you’re right |
10:19:51 | Calinou | thanks for the link to Crafting Interpreters by the way, I should try following it |
10:21:04 | Araq | no, read this instead, https://sites.google.com/site/lccretargetablecompiler/ |
10:22:11 | Araq | or "Modern compiler construction in ML/Java/C" |
10:23:48 | Araq | or this one http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf |
10:25:08 | FromGitter | <mratsim> I need a fast lexer/parser for English/French/Chines/ … not for programming language ;) |
10:26:19 | Araq | lexbase can do it, it's just an efficient way to handle an input buffer |
10:26:35 | FromGitter | <mratsim> Yeah, I’ve used it a bit before. |
10:26:50 | FromGitter | <alehander42> Araq, split might be often the wrong choice, but splitLines is extremely normal: a huge amount of stuff is naturally separated by newlines |
10:26:52 | Calinou | the test works by the way now |
10:26:57 | Calinou | (the one that failed above) |
10:27:10 | FromGitter | <alehander42> now, having it as an iterator might be often more useful |
10:27:14 | FromGitter | <alehander42> but that's a different problem |
10:27:21 | Araq | alehander42: two points |
10:27:41 | * | nc-x joined #nim |
10:27:56 | nc-x | Calinou: thanks for checking. |
10:27:57 | Araq | firstly, \n remains a separator in your input stream, no need to preprocess that step |
10:28:39 | Araq | secondly, many things have the backslash as a line continuation character |
10:29:24 | Araq | and then you have splitLines + mergeLinesWithBackslashesIntoOne + codeThatGoesOverEveryCharacterAnyway |
10:29:32 | FromGitter | <alehander42> Araq, well e.g. for all kind of competition/test outputs you dont have anything complicated |
10:29:46 | FromGitter | <alehander42> continuation characters come in full blown languages/formats |
10:29:55 | FromGitter | <alehander42> obviously you need lex/parsers for those |
10:30:17 | FromGitter | <alehander42> for example "you have n lines with 3 numbers on each" |
10:30:47 | Araq | I dunno, I can just iterate over the input and after every 3rd number I do something |
10:30:50 | FromGitter | <alehander42> here you do need to produce n "objects" with 3 "subobjects" |
10:31:04 | FromGitter | <alehander42> so its natural to do 2 "mappings" |
10:32:05 | Araq | it's natural but the alternative is usually much better |
10:32:12 | Araq | and not more code. |
10:32:20 | FromGitter | <alehander42> what is shorter than a.splitLines.mapIt(it.splitWhitespace) |
10:32:28 | leorize | a macro? :P |
10:33:05 | FromGitter | <alehander42> it.splitWhitespace.mapIt(it.parseInt) * |
10:33:08 | FromGitter | <alehander42> you can have probably |
10:33:30 | FromGitter | <alehander42> a.splitWhitespace.mapIt(it.parseInt).group_n(3) |
10:34:49 | FromGitter | <mratsim> splitWhispace is not an iterator though? |
10:34:54 | Araq | ok, it's not *much* more code. and in addition to that you learn how program instead of relying a never ending list of builtins |
10:35:22 | FromGitter | <mratsim> I feel like we need an iterator/range base strutils otherwise we will be plagued by strings allocations |
10:35:24 | FromGitter | <alehander42> grammar: ⏎ Input => *(Data nl) ⏎ Data => 3 (Number ws) |
10:36:03 | FromGitter | <alehander42> Araq, that doesnt make any sense, simple tasks should be simple to write |
10:36:10 | FromGitter | <alehander42> and still perform well |
10:36:22 | FromGitter | <alehander42> composing builtins is good design |
10:36:45 | FromGitter | <alehander42> now, you might want a more powerful builtin, like some kind of lexer/parser dsl |
10:37:54 | Araq | "er, sorry, we now have data with ';' in it, so we added some escaping mechanism to the CSV file" |
10:38:13 | Araq | your approach: you need to throw away your code. |
10:38:21 | FromGitter | <alehander42> well yes |
10:38:25 | FromGitter | <alehander42> still better than |
10:38:29 | Araq | my approach: I tweak the parser slightly. |
10:38:38 | FromGitter | <alehander42> lets overcomplicate our code just in case in the future we might need X feature |
10:39:13 | FromGitter | <mratsim> ah CSV … when simple “specs” lead to bloat hell |
10:39:17 | FromGitter | <alehander42> the point is that the first version would've taken 20 seconds to write, so you're not really losing anything if you rewrite it |
10:39:30 | Araq | usually I agree with YAGNI but these toy input formats are all terrible |
10:39:31 | FromGitter | <alehander42> the sunk cost fallacy doesn't work here |
10:40:00 | Araq | it takes 20 seconds to write and then it doesn't work in a production setting |
10:40:05 | FromGitter | <alehander42> they are, but my point is people often have such things, which are always going to be very simple to process |
10:40:09 | Araq | when the amount of data increases |
10:40:12 | FromGitter | <alehander42> of course for more complicated formats |
10:40:18 | FromGitter | <alehander42> you should use a proper parser |
10:40:21 | Araq | or when somebody figures out his data can actually contain semicolons... |
10:40:21 | FromGitter | <mratsim> I always think of those links when parsing CSV: http://secretgeek.net/csv_trouble, http://thomasburette.com/blog/2014/05/25/so-you-want-to-write-your-own-CSV-code/ |
10:41:16 | anamok | I read the previous comments and people suggested not to use split. What to use instead? |
10:41:32 | FromGitter | <mratsim> split the iterator is probably OK |
10:41:53 | FromGitter | <mratsim> split the one that allocates seq[string] is too slow. |
10:42:39 | anamok | mratsim, "split the iterator is probably OK" What do you mean? Do you have a small example? |
10:42:46 | FromGitter | <mratsim> well it depends on your scale, but in my case i work with millions to billions of words: https://github.com/karpathy/char-rnn/blob/master/data/tinyshakespeare/input.txt |
10:43:40 | FromGitter | <mratsim> https://nim-lang.org/docs/strutils.html#split.i%2Cstring%2Cset%5Bchar%5D%2Cint |
10:44:10 | FromGitter | <alehander42> @anamok honestly depends on your usecase, if you really need a list of substrings that are really separated by X, split is fine |
10:45:00 | anamok | mratsim, OK, take your input. How do you iterate over the words one by one? I would use text.splitWhitespace() . |
10:45:06 | FromGitter | <alehander42> if you have huge amounts of data , whatever you do should be optimized anyway, not only splitting |
10:45:22 | Araq | and it's not about high level vs low level code, split and friends are the wrong tools, they don't *compose* well. your combination of splitLines + splitWhitespace happens to work because newlines are not substrings of spaces |
10:45:56 | FromGitter | <alehander42> no? |
10:46:19 | FromGitter | <mratsim> I think the string processing story in Nim is at kindergarten level :/ |
10:46:25 | FromGitter | <alehander42> you split on newlines: now you dont have any newlines, it doesnt matter if they are in WhitespaceChars |
10:46:29 | FromGitter | <mratsim> (maybe it’s in C in general) |
10:46:56 | FromGitter | <mratsim> It’s too easy to create something super slow. |
10:47:06 | Araq | mratsim: How so? scanf is pretty good, lexbase is elegant IMO |
10:47:22 | FromGitter | <mratsim> well, strutils is the first thing people will look into |
10:47:33 | FromGitter | <mratsim> and it’s ladden with pitfalls |
10:47:47 | FromGitter | <mratsim> I agree with @Krux02 when he said the pretty radical, we should get rid of it. |
10:48:00 | FromGitter | <mratsim> (and rebuild from the ground up) |
10:48:16 | Araq | I don't agree. String processing done by programmers is at the kindergarten level. |
10:49:24 | FromGitter | <mratsim> Anyway I guess that’s my future lib. A string processing library that scales. |
10:49:34 | anamok | What is advanced level of string processing? How to do it correctly? |
10:50:45 | Araq | use flex or re2c, unfortunately Nim only has 'lexim' which I don't have time to maintain |
10:50:50 | FromGitter | <mratsim> I don’t know yet but I want to parse and tokenize books and web pages to feed AI |
10:52:02 | FromGitter | <alehander42> there is no reason for splitLines.mapIt(Obj.init(it.splitWhitespace(3))) to not work very quickly except for the fact that splits are not iterators and that we cant chain iterators well |
10:52:04 | FromGitter | <mratsim> and it should deal with English, French, Chinese, HTML tags like <br /> |
10:52:32 | FromGitter | <alehander42> if you chain several iterators you can have your deferred "lex and process without an intermediate seq" thing |
10:52:40 | Araq | alehander42: No that is wrong. |
10:52:49 | FromGitter | <alehander42> its wrong for some usecases |
10:52:53 | FromGitter | <alehander42> its ok for others |
10:53:01 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/issues/4516 |
10:53:05 | FromGitter | <alehander42> not everything needs a lexer |
10:53:20 | FromGitter | <alehander42> obviously @mratsim needs it |
10:53:21 | Araq | if your primitives are incapable of describing "a list of words is separated by whitespace unless in quotes" |
10:53:32 | Araq | then you throw away the primitives. |
10:53:54 | FromGitter | <alehander42> no, you use the primitives for the thousands of cases where you dont actually have quoted strings |
10:54:00 | FromGitter | <alehander42> and when you do have |
10:54:13 | FromGitter | <alehander42> you use other primitives (e.g. lex dsl-s to handle those) |
10:54:45 | Araq | the other primitives are all you need though. |
10:54:58 | FromGitter | <alehander42> i'd even argue that lexers suck |
10:55:06 | FromGitter | <alehander42> if you need a lexer, most of the time you need a parser |
10:55:17 | FromGitter | <alehander42> because rarely everything is just a flat list of data |
10:55:28 | FromGitter | <alehander42> (lexers as an end user dsl) |
10:55:59 | Araq | not in my experience. a lexer can go a long way |
10:56:04 | Araq | and split can't. |
10:56:18 | * | nc-x quit (Quit: Page closed) |
10:57:01 | FromGitter | <alehander42> right tool for the job: if split can do X correct and efficiently, do it ⏎ if else: use lexing, if you need to directly generate a hierarchical structrue, use parsing |
10:57:16 | FromGitter | <alehander42> its like saying "use macros ALWAYS because often functions are not sufficients" |
10:58:09 | FromGitter | <alehander42> how would "generate a list of Coord from text file with n X Y lines" work with a lex DSL |
10:58:36 | Araq | no it's like saying "I don't need a roller, I have a bike". |
11:02:45 | FromGitter | <alehander42> its like saying "i dont need a car to go the shop, its 50 feet away, I can go by feet man" |
11:02:53 | Araq | const input = "(1,2,4)" |
11:02:53 | Araq | var x, y, z: int |
11:02:53 | Araq | if scanf(input, "($i,$i,$i)", x, y, z): |
11:02:55 | Araq | echo "matches and x is ", x, " y is ", y, " z is ", z |
11:03:13 | Araq | ^ scanf can do it |
11:05:29 | Araq | alehander42: well yes, you can go by car or by foot. but not by a broken bike. |
11:06:12 | Araq | and for me split is broken, for you it's acceptable. |
11:06:36 | FromGitter | <alehander42> eh the input is "(1,2,4)\n(2,5,7)\n(4,3,1)\n" |
11:06:54 | * | nsf joined #nim |
11:07:07 | Araq | still works but requires a loop, but that's beside the point. |
11:07:47 | Araq | scanf is not good enough, we need a lexer generator :P |
11:09:42 | FromGitter | <alehander42> or you can just have ⏎ ⏎ grammar: ⏎ __ Input as seq => *(Coord nl) ⏎ __ Coord => "(" int "," int ")" [https://gitter.im/nim-lang/Nim?at=5c0cf7f611bb5b250488895b] |
11:10:06 | FromGitter | <alehander42> this now look absolutely fucked in gitter |
11:10:24 | FromGitter | <alehander42> but you see my point, we need parser generators :D |
11:12:55 | Calinou | I didn't know about scanf |
11:13:15 | Calinou | for simple use cases, it looks far more elegant than a bunch of splits :p |
11:13:49 | Calinou | that's what I wrote a few weeks ago for instance https://github.com/Calinou/escape-space/blob/master/menu/update_checker.gd#L68-L80 |
11:17:01 | FromGitter | <alehander42> that requires proper parsing indeed, I dont argue that split is always a good option |
11:17:54 | FromGitter | <alehander42> Araq: however your logic is very similar to "we should pattern match everywhere, if/case are broken and work only for very simple cases" ⏎ scanf is literally pattern matching inside a string |
11:22:16 | * | narimiran quit (Ping timeout: 250 seconds) |
11:36:03 | * | stefanos82 joined #nim |
11:45:38 | * | martin1__ joined #nim |
11:45:48 | Araq | not really, it's just that split is a bad tool for lots of reasons. |
11:47:07 | Araq | and it is frequently misused. proof: it has grown a 'maxsplits' parameter |
12:05:03 | * | Snircle joined #nim |
12:06:17 | FromGitter | <arnetheduck> Araq, what are you doing to testament? |
12:08:49 | Araq | arnetheduck: we join the tests into one big one to save about 20minutes of testing time |
12:11:16 | FromGitter | <arnetheduck> Right.. Seen that.. Would be nice if the tests were included together they can still be run individually.. Same think as blocks, just using include |
12:12:50 | FromGitter | <arnetheduck> Hehe, getting closer to c++ problems and solutions.. Compiler times getting fixed by unity builds |
12:15:30 | Araq | yeah, I'm doing that |
12:15:44 | Araq | if you run a single category it processes them individually |
12:18:07 | FromGitter | <Varriount> Araq: What about failures that crash the executable? |
12:19:18 | Araq | well testament gives you an "expected but got" diff for the "megatest" |
12:20:21 | Araq | crashes lead to incomplete output and/or an exit code != 0, nothing hard about them |
12:20:41 | FromGitter | <alehander42> Araq: I agree, sorry if I sounded dismissive, lexing/parsing is better most of the time, but the maxsplit arg is not perfect: you need something like that in lexing/parsing too |
12:22:59 | Araq | yes and no, the problem description in lexing/parsing doesn't state "split by ':' but stop after N splits", it more like "in this state, the next token is from ':' until the end of the line" |
12:24:17 | Araq | which is the difference between a hack and a real solution. |
12:25:22 | FromGitter | <alehander42> eh, sometimes you know you need =/<= n repetitions |
12:27:34 | FromGitter | <alehander42> also, I am talking about a declarative definition, e.g. grammer("Line => (Number ';'){9}") |
12:28:32 | FromGitter | <alehander42> not very often needed, I agree |
12:32:28 | * | rockcavera quit (Read error: Connection reset by peer) |
12:33:21 | Araq | that says 9 numbers are in it. it doesn't say "join all the rest together into a token and ignore the error" |
12:33:36 | * | rockcavera joined #nim |
12:33:36 | * | rockcavera quit (Changing host) |
12:33:36 | * | rockcavera joined #nim |
12:33:42 | Araq | which is what split(maxsplit=9) does |
12:40:25 | FromGitter | <alehander42> ah this is maxsplit |
12:40:50 | FromGitter | <alehander42> well, how would you describe with a lex dsl the same, its often useful |
12:45:43 | * | dddddd joined #nim |
12:50:29 | FromGitter | <arnetheduck> @Araq nice, high granularity is very useful for pinpointing stuff |
12:52:50 | FromGitter | <arnetheduck> brw, I saw `allPathsAsgnResult` in cgen.. isn't that more of a `sem`thing? |
12:55:45 | * | hwallann joined #nim |
12:58:28 | FromGitter | <Varriount> Araq: Yes, but won't this mega test make finding what caused the crash difficult? |
13:04:27 | * | martin1__ quit (Quit: WeeChat 2.1) |
13:04:29 | * | EastByte quit (Quit: WeeChat 2.2) |
13:11:04 | * | theelous3_ joined #nim |
13:14:26 | * | bitstoppa[m] left #nim ("User left") |
13:20:56 | * | EastByte joined #nim |
13:23:00 | * | EastByte quit (Client Quit) |
13:24:41 | * | fthe joined #nim |
13:27:48 | * | endragor joined #nim |
13:36:16 | * | kapil____ joined #nim |
13:38:06 | * | jakob0094 joined #nim |
13:46:45 | * | EastByte joined #nim |
13:50:51 | * | EastByte quit (Client Quit) |
13:51:03 | * | EastByte joined #nim |
13:51:45 | * | noonien quit (Quit: Connection closed for inactivity) |
13:58:33 | edcragg | i see there is the module lists, i see it has doubly linked lists, etc, but these only have append() and prepend() functions, and iterators over nodes, this seems to make it very cumbersome to insert a node in the middle of the list, for example |
14:00:26 | * | banc quit (Ping timeout: 250 seconds) |
14:01:44 | * | banc joined #nim |
14:11:15 | * | narimiran joined #nim |
14:13:08 | fthe | edcragg: seqs have insert() |
14:15:19 | narimiran | edcragg: AoC day9? :) |
14:16:38 | narimiran | fthe: `seq.insert` is quite expensive, and if you have to do it that much time as in AoC day9, you gonna have a bad time ;) |
14:17:19 | fthe | ah, not on day 9 yet, I'm late :) |
14:18:31 | narimiran | fthe: when you come to it, seq.insert might give you the result for part1, but for part2 you need to be smarter than that :) |
14:18:37 | Zevv | narimiran: yeah that was a nice surprice, part II telling you to basically "throw away and think again" |
14:19:05 | Zevv | funny is that my part II solution is much simpler and smaller then part I |
14:20:44 | edcragg | :) aoc, indeed |
14:22:05 | narimiran | edcragg: you're on a right path with your idea ;) |
14:23:10 | fthe | curious: does nim have a way of marking an object field immutable? (like c# readonly, java final) |
14:24:26 | dom96 | nope, but you can make it private and create an accessor proc that's exported |
14:24:43 | fthe | makes sense! |
14:29:11 | * | PMunch joined #nim |
14:52:03 | * | endragor quit (Ping timeout: 246 seconds) |
14:54:15 | * | endragor joined #nim |
14:55:05 | M37[m] | Today's AoC was great. Finally got to try nim's implementation of insert spoiler. |
14:55:57 | M37[m] | Does that jamie guy on the leaderboard hang around here? He got 5th today for part 1. |
14:56:44 | M37[m] | Pretty impressive. |
14:58:09 | * | endragor_ joined #nim |
14:58:39 | narimiran | M37[m]: agreed that today was great. i also liked yesterday's task and day5 |
15:01:32 | * | endragor quit (Ping timeout: 250 seconds) |
15:04:54 | * | endragor_ quit (Remote host closed the connection) |
15:06:46 | M37[m] | narimiran: same. So far, those days have seemed the most elegant. |
15:08:03 | M37[m] | I did today's part 1 the lazy way, hoping that I'd be forced to do it properly for part 2 :) |
15:10:00 | FromGitter | <zacharycarter> hmm - trying to build with `-d:useNimRtl` and getting the error - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c0d30485e409525033cff75] |
15:10:29 | M37[m] | I also liked day 6. And day 4 is memorable. |
15:11:10 | FromGitter | <zacharycarter> ah I found an issue on it - I think I understand why |
15:13:11 | narimiran | M37[m]: i had trouble with day6, i don't remember exactly what it was, but i know it took me way too long to get the correct solution |
15:13:46 | narimiran | hmmm, or was that day7? |
15:17:19 | FromGitter | <zacharycarter> what are the disadvantages of using the C++ backend over the C backend? just portability? |
15:17:31 | FromGitter | <zacharycarter> and performance? |
15:19:22 | FromGitter | <zacharycarter> also - if I'm using dlopen / close and thus using `useNimRtl` - do both the main application (the one calling dlopen / close), and the shared library need to be linked against nimrtl.dll - or just the plugin? |
15:19:28 | FromGitter | <zacharycarter> slightly confused on that part |
15:21:54 | PMunch | I think it's both |
15:22:05 | PMunch | But I've never gotten that to work properly |
15:22:10 | narimiran | M37[m]: what is your memory consumption for day9? |
15:22:43 | FromGitter | <zacharycarter> it sounds maybe - like it's only the plugin |
15:23:07 | FromGitter | <zacharycarter> `This means that every generated Nim DLL depends on nimrtl.dll` |
15:23:21 | FromGitter | <zacharycarter> going to play around with it |
15:23:50 | dom96 | bah, feel like I missed out on this whole thing. Starting on day 9 seems far too late |
15:24:22 | PMunch | day9 part 2.. It's Sunday, that's no day for optimizing code.. |
15:24:43 | PMunch | I consider just leaving it to run for a couple hours.. |
15:25:02 | PMunch | Or however long this will take.. |
15:25:05 | narimiran | dom96: start with day5, then day8 and day9 |
15:25:15 | narimiran | others are not as fun as those |
15:25:38 | fthe | ...I'm late, just finished day 7. Day 6 took way longer than I care to admit :/ |
15:26:24 | dom96 | narimiran: Might do that, but skipping days makes me feel uncomfortable heh |
15:26:41 | narimiran | PMunch: wait, i thought sunday was *the* day for optimizing :) |
15:27:04 | narimiran | dom96: heh, start with those to get going and after that solve your OCD :D |
15:27:13 | PMunch | I'm hungover and lazy.. |
15:29:04 | narimiran | my memory consumption for day9 is over 300MB! i feel very dirty |
15:29:20 | M37[m] | narimiran: I'll investigate in a little bit. I didn't optimise it yet - it looked like everything would fit in uint32. But part 2 runs in 3 ms on an old laptop. |
15:29:41 | M37[m] | How are you profiling it? |
15:29:56 | M37[m] | valgrind? |
15:30:13 | narimiran | M37[m]: wait what? your day9, part2 runs in 3ms!? wow! mine takes 0.8 s! |
15:30:13 | * | endragor joined #nim |
15:31:13 | narimiran | M37[m]: nah, just a ruby script i found somewhere which measures time and memory. and i usually measure time by running a program 100 times and then divide by 100 |
15:33:31 | FromGitter | <zacharycarter> if I generate a shared library with Nim and then want to call it - do I call it using the nimcall calling convention? |
15:33:32 | FromGitter | <zacharycarter> or stdcall? |
15:39:15 | M37[m] | narimiran: Haha, I thought my runtime was too good to be true. It's actually 500 ms. After I finished I wrote "assert answer == " at the end instead of doAssert :p |
15:39:38 | M37[m] | So it's probably the same speed as yours, if I remember our runtime differences from last week. |
15:40:14 | FromGitter | <zacharycarter> got my stupid example working finally - just compiled the dylib with `-d:useNimRtl` and used `nimcall` as the calling convention and made sure to `exportc` the proc in the shared lib |
15:40:26 | FromGitter | <zacharycarter> and I was able to call a proc declared inside of it without having anything blow up |
15:40:30 | narimiran | M37[m]: oh ok, you scared me there! i thought i need to spend the rest of the sunday heavily optimizing :D |
15:40:46 | FromGitter | <zacharycarter> now to work on progressing to the point where nothing works :) |
15:42:29 | * | endragor quit (Remote host closed the connection) |
15:42:49 | * | endragor joined #nim |
15:44:37 | FromGitter | <zacharycarter> I guess I should really use cdecl and not nimcall |
15:44:43 | M37[m] | narimiran: But today I was puzzled for a while because I had `--gc:markAndSweep` set somewhere. Try that with part 2 and you'll have a bad time. |
15:55:44 | narimiran | when i try to use `nimprof`, i'm greeted with "system/profiler.nim(91, 23) Error: undeclared identifier: 'framePtr'" anybody knows what's going on? (cc dom96 ) |
15:55:47 | * | Trustable joined #nim |
15:56:15 | dom96 | narimiran: have you tried following: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#profiling-your-code ? |
15:56:24 | Zevv | dom96: not sure about the getaddrinfo |
15:56:56 | narimiran | dom96: yes, i'm using nimprof the same way as i used to before: i import nimprof, and compile with --profiler:on --stacktrace:on |
15:56:56 | Zevv | because just below getAddrString() is the getSockName() |
15:57:04 | Zevv | which seems a better fit to implement getsockname() :) |
15:57:51 | dom96 | Zevv: I'm not sure myself, I'm not the author of the code :) |
15:58:09 | dom96 | narimiran: it's a regression then |
15:59:39 | Zevv | Hm i'll take a second look, but I wasn't sure the first time, thus my naive implemnetation. |
15:59:58 | narimiran | dom96: it might be because Araq removed this line "{.deprecated: [TStackTrace: StackTrace, TProfilerHook: ProfilerHook].}" 3 weeks ago |
16:00:02 | Zevv | another (stupid?) question: why does the CI fail? |
16:00:13 | dom96 | narimiran: should be an easy fix then :) |
16:00:34 | Zevv | nativesockets.nim(487, 37) Error: undeclared identifier: 'nativeAfUnix' on the linux build? |
16:01:17 | * | kapil____ quit (Quit: Connection closed for inactivity) |
16:05:45 | narimiran | dom96: hmmm, even stable throws the same error. i guess this goes way back then.... |
16:08:54 | stefanos82 | Araq and dom96: will you inform me via ticket reply (#9889) when a fix is provided for the crashing? |
16:09:08 | narimiran | can anybody please try to reproduce? does nimprof work at your end? |
16:13:04 | * | nsf quit (Quit: WeeChat 2.3) |
16:13:51 | * | nc-x joined #nim |
16:14:00 | nc-x | narimiran https://github.com/nim-lang/Nim/issues/8991 |
16:14:20 | narimiran | nc-x: yup, that's it |
16:14:31 | narimiran | thanks! |
16:14:39 | leorize | I guess you can always resort to gprof? |
16:16:45 | FromGitter | <zacharycarter> dom96: would you be interested in expanding that blog post to talk about instrumenting / profiling tools on macOS? |
16:16:51 | FromGitter | <zacharycarter> or having someone expand it for you |
16:17:00 | FromGitter | <zacharycarter> because valgrind really isn't a viable option for macOS |
16:17:08 | FromGitter | <zacharycarter> if you're using clang / llvm |
16:17:14 | dom96 | Why not? I've used it on macOS IIRC |
16:17:33 | dom96 | It might be better if you create a new article, this one is now quite old |
16:17:37 | FromGitter | <zacharycarter> lots and lots of false positives - making it so you have to get deep into exclusion rule crap to really make it useful |
16:17:58 | FromGitter | <zacharycarter> maybe I should ask if there's interest on the forum first |
16:18:11 | FromGitter | <zacharycarter> the tools I'm speaking to are like address sanitizer, leaks, etc |
16:18:38 | nc-x | narimiran: try this https://github.com/nim-lang/Nim/issues/4446#issuecomment-239356177 |
16:19:36 | FromGitter | <zacharycarter> I'm not even sure how many people are using Nim + macOS - could be an interesting survey question to see what operating systems Nim is running on |
16:20:15 | nc-x | there are atleast 3 issues open regarding this framePtr |
16:21:10 | narimiran | nc-x: removing confing.nims solves the issue, thank you! |
16:21:42 | nc-x | :D |
16:30:04 | * | nc-x quit (Quit: Page closed) |
16:32:34 | * | theelous3_ quit (Quit: is outty) |
16:44:37 | * | endragor quit (Remote host closed the connection) |
16:56:22 | Araq | stefanos82: I fixed that one yesterday? |
16:56:44 | stefanos82 | OK, let me fetch the latest updates and check it again then |
17:01:50 | * | Vladar joined #nim |
17:03:59 | stefanos82 | Araq: still crashes |
17:05:47 | stefanos82 | Araq: http://paste.debian.net/1055040/ |
17:18:00 | * | crem quit (Ping timeout: 252 seconds) |
17:20:05 | * | crem joined #nim |
17:20:30 | shashlick | dom96: adding packages to the nimble directory has become way too much of a chore |
17:31:47 | Araq | it doesn't crash |
17:31:50 | Araq | ../../GIT_CODES/Nim/lib/system.nim(467, 10) Error: 'nil' is now |
17:31:50 | Araq | invalid for 'string'; compile with --nilseqs:on for a migration period; |
17:31:50 | Araq | usage of '==' is a user-defined error |
17:32:04 | Araq | the code doesn't compile because it's outdated. |
17:32:31 | Araq | ... utils.nim(289, 11) template/generic instantiation of `!=` from |
17:32:31 | Araq | here |
17:44:34 | Zevv | Araq, I feel stupid: why does my job CI job break on 'undeclared identifyier: native |
17:44:38 | Zevv | AfUnix'? |
17:45:10 | Zevv | It's declared at the same place as nativeAfInet |
17:48:46 | Araq | you can usually do 'nim doc blah.nim' to reproduce locally |
17:49:06 | Zevv | ah thanks |
17:54:02 | Zevv | ooh 'nimdoc' enables 'useWinVersion'. That's kind of unexpected |
18:23:39 | * | nsf joined #nim |
18:26:46 | stefanos82 | Araq: should I add this flag in front of nimble? |
18:33:48 | Araq | stefanos82: I doubt nimble supports this flag. but fixing the code is usually not hard and should be done |
18:34:00 | stefanos82 | I see |
19:02:22 | * | shashlick quit (Ping timeout: 244 seconds) |
19:16:48 | * | lritter joined #nim |
19:16:54 | * | Jesin quit (Quit: Leaving) |
19:18:09 | * | lritter quit (Read error: Connection reset by peer) |
19:21:32 | * | anamok quit (Remote host closed the connection) |
19:22:58 | * | lritter joined #nim |
19:28:56 | stefanos82 | Araq: the aforementioned flag is supported with nimble as well |
19:30:24 | * | nsf quit (Quit: WeeChat 2.3) |
19:35:10 | stefanos82 | dom96: I have managed to compile it with nimble build --nilseqs:on, but fails miserably during execution lol. |
19:35:39 | stefanos82 | http://paste.debian.net/1055063/ |
19:37:58 | * | martin__ joined #nim |
19:46:21 | * | lucasb joined #nim |
19:48:10 | * | shashlick joined #nim |
19:51:09 | * | tefter quit (Remote host closed the connection) |
19:58:45 | * | Jesin joined #nim |
20:06:48 | xace | when i `import <lib>` how does nim find <lib>? in this case i installed it with nimble, but i would like to add my own local/personal commonly used proc do I just add a ~/.nimble/mylib-0.0.1 ? |
20:08:30 | Zevv | I believe 'nim dump' gifs a list of searched paths |
20:10:24 | xace | yeah, it seems like it mentions the ~/.choosenim/ paths but no reference to the ~/.nimble directory |
20:18:33 | * | Trustable quit (Remote host closed the connection) |
20:25:00 | * | martin__ quit (Read error: Connection reset by peer) |
20:25:17 | * | martin__ joined #nim |
20:44:14 | * | narimiran quit (Remote host closed the connection) |
21:00:37 | * | platoff joined #nim |
21:02:36 | * | Vladar quit (Remote host closed the connection) |
21:37:58 | dom96 | xace: If you have my book the chapter on Nimble has a good figure for that |
21:38:09 | dom96 | otherwise: Nim searches through each --path it gets |
21:38:52 | dom96 | nim also gets --nimblePath:~/.nimble/pkgs which just searches through ~/.nimble/pkgs and adds each (latest) package in there with --path |
21:39:26 | dom96 | In any case, you likely want to create a package and install it (or use `develop`, search for this in the Nimble readme to learn more) |
21:47:32 | * | stefanos82 quit (Remote host closed the connection) |
22:06:14 | * | Lavos joined #nim |
22:12:36 | * | Jesin quit (Quit: Leaving) |
22:14:35 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:17:37 | * | Lavos quit (Remote host closed the connection) |
22:37:33 | * | martin__ quit (Ping timeout: 245 seconds) |
22:50:18 | * | kapil____ joined #nim |
22:58:42 | * | martin__ joined #nim |
23:05:28 | * | platoff joined #nim |
23:16:03 | * | fthe quit (Ping timeout: 246 seconds) |