<< 12-05-2018 >>

00:09:28*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
00:23:01*CodeVance joined #nim
00:28:31*jrbrt quit (Quit: jrbrt)
00:30:51*NimBot joined #nim
00:48:33*CodeVance left #nim ("Leaving")
01:19:15*sz0 joined #nim
01:44:33*vivus quit (Quit: Leaving)
01:47:53*CodeVance joined #nim
02:01:11*CodeVance_ joined #nim
02:02:25*CodeVance quit (Read error: Connection reset by peer)
02:10:05*xkapastel joined #nim
02:36:35*brainpro1 quit (Ping timeout: 240 seconds)
02:37:36*arecaceae quit (Read error: Connection reset by peer)
02:38:00*arecaceae joined #nim
02:41:27*brainpro1 joined #nim
02:45:57*brainpro1 quit (Ping timeout: 240 seconds)
03:09:39*rauss quit (Quit: WeeChat 2.1)
03:10:35*rauss joined #nim
03:53:27*brainpro1 joined #nim
03:59:57*dddddd quit (Remote host closed the connection)
04:06:20FromGitter<zacharycarter> dom96: I guess we both made libsass wrappers :/
04:11:09*CodeVance_ left #nim ("Leaving")
04:35:09*brainpro1 quit (Ping timeout: 264 seconds)
04:40:29*darithorn quit (Quit: Leaving)
04:41:21*miran joined #nim
05:09:34*brainpro1 joined #nim
05:14:27*brainpro1 quit (Ping timeout: 255 seconds)
05:33:50FromGitter<CodeVance> I need to run nim with clang... but how to install...
05:48:15*brainpro1 joined #nim
06:01:33*brainpro1 quit (Ping timeout: 264 seconds)
06:05:29*yglukhov_ quit (Ping timeout: 246 seconds)
06:25:30FromDiscord<2vg> clang install ?
06:35:34*brainpro1 joined #nim
06:40:29*brainpro1 quit (Ping timeout: 246 seconds)
07:14:18*brainpro1 joined #nim
07:19:27*brainpro1 quit (Ping timeout: 240 seconds)
07:19:38*skrylar joined #nim
07:20:03skrylarwell, added support for also writing protobufs and recursion. can reuse parts of the macros to fix up flatbuffer writing also
07:21:09skrylarmildly interesting note: you have to pre-calculate the size of a protobuf so you can write an encoded integer of its size. flat buffers seem not to care, you just have to dump them in to memory and go back and write a fixed int. so. haven't benched to see the tradeoffs with that.
07:54:36*skrylar quit (Remote host closed the connection)
08:03:15FromGitter<narimiran> @mratsim do you maybe know what is the situation with numpy <-> nim? https://www.reddit.com/r/Python/comments/8imw2z/python_vs_numpy_vs_nim/dyu6sgt/
08:04:05*gmpreussner quit (Ping timeout: 256 seconds)
08:05:22*gmpreussner joined #nim
08:06:40FromGitter<dom96> @zacharycarter yeah. Please be sure to add your packages to nimble. I searched there and didn't see your package so I created one, only notice the existence of your package once I was mostly done :(
08:06:47FromGitter<dom96> *noticed
08:18:34FromGitter<mratsim> @narimiran I replied
08:18:58FromGitter<xmonader> @dom96 i keep getting ``` ⏎ {"data": [{"Field0": 0, "Field1": null, "Field2": null}, {"Field0": 0, "Field1": null, "Field2": null}, {"Field0": 33193760206252338, "Field1": "id*", "Field2": "9"}, {"Field0": 0, "Field1": null, "Field2": null}, {"Field0": 0, "Field1": null, "Field2": null}, {"Field0": 0, "Field1": null, "Field2": null}, {"Field0": 0, "Field1": null, "Field2": null}, {"Field0": 0, "Field1": null,
08:18:58FromGitter... "Field2": null}], "counter": 1} ⏎ ⏎ ```for serializing ``` ⏎ var respJson = $$({"id": $id}.toTable())``` [https://gitter.im/nim-lang/Nim?at=5af6a3722df44c2d062032ce]
08:28:50*nsf joined #nim
08:29:51FromGitter<dom96> Okay? That's not wrong.
08:31:32FromGitter<xmonader> @dom96 How is it not wrong?
08:31:53FromGitter<xmonader> I'm expecting to see data in the table {"id": id} serialized into a string
08:32:27*miran quit (Ping timeout: 240 seconds)
08:32:52FromGitter<dom96> Because it's the marshal module you're using. It can use whatever format it wants, as long as you can deserialise it.
08:33:10FromGitter<dom96> Use the JSON module instead.
08:33:48FromGitter<xmonader> @dom96 i tried using the json module and couldn't figure out how to serialize it
08:33:57FromGitter<xmonader> clearly $(%* didn't work
08:34:18FromGitter<xmonader> https://gitter.im/nim-lang/Nim?at=5af5ed69e1cf621dba11a881 check please
08:34:26*yglukhov joined #nim
08:35:18FromGitter<dom96> Ahh yes. Unfortunately there is a PR to fix this that's still not merged.
08:35:32FromGitter<dom96> You can copy the code from it to get the functionality though.
08:35:40*yglukhov quit (Read error: Connection reset by peer)
08:36:15*yglukhov joined #nim
08:36:31FromGitter<xmonader> i'm curious how did u do the json responses in the nim forum?
08:36:57FromGitter<xmonader> @dom96 can you link me the the PR?
08:41:35FromGitter<dom96> Or you could just get rid of the `toTable` in this instance.
08:44:34FromGitter<xmonader> @dom96 u mean like this? ⏎ ⏎ ``` var respJson = $(%*({"id": $id})) ⏎ echo "RESP JSON: ", respJson``` [https://gitter.im/nim-lang/Nim?at=5af6a971e0b50c2d05b798db]
08:46:00FromGitter<xmonader> also if i do it like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af6a9c85e8e2175e25cfc61]
09:03:44*brainpro1 joined #nim
09:04:26FromGitter<tim-st> does someone knows if there is a better way to treat int32 as unsigned int (e.g. -5 should be the same as +5) besides doing if x < 0: x = abs(x)? all my values are >= 0 and I want to save a bool information on the least significant bit so I can use unsigned int
09:04:54FromGitter<tim-st> *cant
09:05:49dom96xmonader: remove the parenthesis: %*{"id": $5}
09:05:56dom96Seems like a bug, report it.
09:06:35dom96tim-st: You can just call abs(x), you don't need that if
09:07:09FromGitter<tim-st> @dom96 yes, I would do it in worst case, I just thought there would some bit hacking way that is better than abs proc
09:07:39FromGitter<xmonader> @dom96 it works thank you i'll report a bug
09:07:59FromGitter<tim-st> @dom96 well I need the if check to find out if the lsb is set
09:08:25FromGitter<tim-st> this is the bit where I store the information and thus save the additonal 8bit bool
09:08:53FromGitter<tim-st> this saves 32k*8bit
09:09:20*Vladar joined #nim
09:12:37FromGitter<tim-st> Maybe `x & 31 == x ` does it
09:12:58FromGitter<mratsim> @tim-st castint32 (cast[uint32]((-5’i32).not + 1’u32)).
09:13:14FromGitter<tim-st> @mratsim that looks promising, thanks!
09:13:35FromGitter<mratsim> edited, Gitter ate my brackets
09:13:55FromGitter<tim-st> but I dont need a uint cast
09:14:13FromGitter<mratsim> basically negative number are two complement ie. positive = not(negative) + 1
09:14:15FromGitter<tim-st> my value is always >= 0 and always in range int32 (2**31)
09:14:44FromGitter<tim-st> that means always the lsb is the same, and because of this I want to use it as a bool flag
09:14:52FromGitter<mratsim> feel free to check the code I use here for signed arithmetic implemented from scratch in terms of unsigned int: https://github.com/status-im/nim-stint
09:15:09FromGitter<mratsim> don’t you mean the msb?
09:15:28FromGitter<mratsim> https://github.com/status-im/nim-stint/blob/master/stint/private/bithacks.nim#L28
09:15:33FromGitter<tim-st> hm, possible^^ I mean the bit responsible for minus or plus
09:15:56FromGitter<mratsim> that won’t work, what you are describing is not how it’s implemented in hardware
09:16:30FromGitter<tim-st> hm, ok, do you have an idea how this could work?
09:16:31FromGitter<mratsim> assuming a 4 bit integer, 1 is 0001, -1 is 1110.
09:16:58FromGitter<mratsim> 2 is 0010 -2 is 1101
09:17:09FromGitter<mratsim> (in big endian)
09:17:44*SenasOzys quit (Ping timeout: 260 seconds)
09:17:50FromGitter<tim-st> but using my way to explicitly check if val >= 0 else abs(val) does work
09:18:01FromGitter<tim-st> so I can store the information
09:18:03FromGitter<mratsim> ah you can just check the msb for that
09:18:06FromGitter<mratsim> indeed
09:18:09FromGitter<tim-st> yes
09:18:21FromGitter<mratsim> if 2^31 is indeed the max
09:18:23FromGitter<tim-st> but I'm not a bit hacker :(
09:18:44FromGitter<mratsim> https://github.com/status-im/nim-stint/blob/master/stint/private/int_comparison.nim#L22
09:18:53FromGitter<mratsim> https://github.com/status-im/nim-stint/blob/master/stint/private/bithacks.nim#L28
09:19:05FromGitter<mratsim> result = T(castUint (n) shr msb_pos)
09:19:21FromGitter<mratsim> for int32 only that’s 4 line of code ;)
09:19:40FromGitter<mratsim> let me wrap something for you
09:19:41FromGitter<tim-st> perfect, thank you very much, exactly what I needed
09:21:17FromGitter<mratsim> ```func isNegative(n: int32): bool = ⏎ result = bool(cast[uint32](n) shr 31)``` [https://gitter.im/nim-lang/Nim?at=5af6b20c9ad18967b9dcd8a2]
09:21:51FromGitter<mratsim> 2 lines!
09:21:51*salewski joined #nim
09:22:31FromGitter<tim-st> thank you! and for the other task to now handle the value as abs I should use `abs` proc?
09:23:01salewskitim-st, replace if val >= 0 else abs(val)
09:23:19FromGitter<mratsim> if you stay in int32 land use abs, GCC now how to optimize it
09:23:24FromGitter<mratsim> just abs(val) is enough
09:23:44salewskisorry, replace abs() by just -x
09:24:01FromGitter<mratsim> if you stay in uint land if val.isNegative: not(val) + 1 else: val
09:24:04FromGitter<tim-st> @mratsim thanks!
09:24:19salewskior use only abs() if possible. That prevent branching.
09:25:06FromGitter<tim-st> salweski: I need to know 1) is x.int32 < 0 and 2) abs(x.int32)
09:25:08FromGitter<mratsim> abs() is branching internally ;) but the compiler should optimize it the best (and hardware can deal with that just fine)
09:25:58FromGitter<mratsim> also not that if you check if it’s negative and use abs just after, a proper compiler will only do one comparison.
09:26:02FromGitter<mratsim> note*
09:26:13*nsf quit (Quit: WeeChat 2.1)
09:26:17FromGitter<tim-st> ah, cool, good to know
09:26:48salewskimratsin, abs() gives really fast code with gcc -O3, I recently checked at godbolt.org
09:27:09salewskiI did not see a real branch.
09:27:17FromGitter<tim-st> one other question regarding gcc and nim:
09:28:37FromGitter<tim-st> if I want gcc to use gperf algo 100% should I just copy my pair in a const array in nim and compare linear? Maybe if I put in a `Table` or a `case` gcc cannot understand that it can build a minimal perfect hash function using gperf
09:28:51FromGitter<tim-st> *pairs (~32k)
09:28:55FromGitter<mratsim> @salewski, apparently abs is done without branching with: (x XOR y) - y
09:29:58salewskiSee https://forum.nim-lang.org/t/3784
09:30:10FromGitter<mratsim> not to sure what y is but oh well
09:30:14salewskiBye.
09:31:45*Cthalupa quit (Ping timeout: 248 seconds)
09:31:54*salewski quit (Quit: WeeChat 2.0.1)
09:32:07*yglukhov quit (Remote host closed the connection)
09:33:03*Cthalupa joined #nim
09:33:52FromGitter<mratsim> one thing I still don’t understand is why can’t you just use normal int32 instead of having to check bits?
09:34:27*brainpro1 quit (Ping timeout: 240 seconds)
09:34:47FromGitter<mratsim> doing result.wasNeg = val < 0 is plain simpler @tim-st
09:35:20FromGitter<tim-st> yes, that was my first idea^^, I thought I can solve it in one step
09:36:29FromGitter<mratsim> working on individual bits is slower than working on machine words (int32 for 32-bit or int64 for 64-bit).
09:37:30FromGitter<mratsim> if you check the assembly produced for int8 or int16 for example, you will see a lot of movZBL instead of mov —> that’s moving a small integer and zero-extending it so that it matches the register size (32/64 bit).
09:38:21FromGitter<tim-st> I already thought this, but would you prefer saving const 32k * int64, if you can save it in 32k* int8 ?
09:38:33FromGitter<mratsim> This is assuming all your data fits in the CPU L1 cache.
09:38:58FromGitter<tim-st> ok
09:39:40FromGitter<mratsim> if you have 32k items it might be faster indeed.But the only way to know is benchmarking.
09:40:12FromGitter<tim-st> I remember that Araq told binary size is very important^^
09:40:17FromGitter<mratsim> For example for my go playing bot, simulating millions of move per second, using int32 indexes is faster than int16 indexes: https://github.com/mratsim/golem-prime/blob/master/src/datatypes.nim#L12
09:40:58FromGitter<tim-st> interesting, thanks! I will declare an alias type for the int and then test it for different alias int sizes
09:41:20FromGitter<mratsim> for my prime generator, bit packing (8 bool in one byte) made it more than 10x faster because I could fit more in cache: https://github.com/numforge/number-theory/blob/master/src/primes.nim#L6-L15
09:42:04FromGitter<mratsim> yeah type alias is a good way to easily switch for perf testing
09:43:06FromGitter<tim-st> Is there any downside if my tuple type is not mod 64bit like 48bit or is that packed efficiently next to next?
09:44:37FromGitter<mratsim> Nim and C compiler are aligning depending on the type I think, so if it’s a int64 it will be starting on a mod 64 address boundary
09:44:49FromGitter<mratsim> if it’s int16 it will be on a mod 16
09:45:16FromGitter<tim-st> I have (uint16, uint8, int8)
09:45:16FromGitter<mratsim> otherwise just use an object with the {.packed.} pragma.
09:45:27FromGitter<mratsim> that will be ok.
09:45:30FromGitter<tim-st> and (int32, int16)
09:46:16FromGitter<mratsim> !eval var a = (0’i16, 0’i8, 0’i8); echo a.sizeof
09:46:18NimBotCompile failed: in.nim(1, 11) Error: invalid token: ⠨\226)
09:46:52FromGitter<tim-st> !eval var a = (0i16, 0i8, 0i8); echo a.sizeof
09:46:54NimBot4
09:47:22FromGitter<mratsim> var a = (0'i32, 0'i16); echo a.sizeof
09:47:38FromGitter<mratsim> !eval var a = (0'i16, 0'i8, 0'i8); echo a.sizeof
09:47:41NimBot4
09:47:47FromGitter<tim-st> but it was unsigned not signed
09:47:59FromGitter<tim-st> maybe doesnt matter^^
09:48:19FromGitter<mratsim> !eval var a = ((0’u32, 0’u16),(0’u16, 0’u8, 0’u8)); echo a.sizeof
09:48:20NimBotCompile failed: in.nim(1, 12) Error: invalid token: ⠨\226)
09:48:38FromGitter<mratsim> !eval var a = ((0'u32, 0'u16),(0'u16, 0'u8, 0'u8)); echo a.sizeof
09:48:41NimBot12
09:48:49FromGitter<mratsim> I wonder why I produce invalid quote
09:48:58FromGitter<mratsim> mmm strange there is padding here
09:49:23FromGitter<mratsim> anyway, you know how to check now ;)
09:49:23FromGitter<tim-st> isnt 12 too large?
09:49:30FromGitter<tim-st> yes, thank you!
09:50:01FromGitter<mratsim> yes, it can be 8 if packed, but the compiler is aligning the second tuple I think
09:50:31FromGitter<mratsim> 10* not 8
09:50:34FromGitter<tim-st> ok, thanks for your help :)
09:51:08FromGitter<mratsim> you’re welcome.
10:09:57*rauss quit (Ping timeout: 240 seconds)
10:19:25*xkapastel quit (Quit: Connection closed for inactivity)
10:20:10FromGitter<xmonader> @dom96 I created an issue https://github.com/nim-lang/Nim/issues/7817
10:28:09*sz0 quit (Quit: Connection closed for inactivity)
10:28:38*brainpro1 joined #nim
10:33:14*brainpro1 quit (Ping timeout: 246 seconds)
10:51:44*CodeVance joined #nim
10:55:22*SenasOzys joined #nim
11:04:15*yglukhov joined #nim
11:04:18*CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
11:09:38*CodeVance joined #nim
11:10:56*jjido joined #nim
11:13:50*CodeVance left #nim (#nim)
11:14:56*brainpro1 joined #nim
11:19:27*brainpro1 quit (Ping timeout: 240 seconds)
11:24:14*derlafff quit (Remote host closed the connection)
11:24:30*derlafff joined #nim
11:26:56*Snircle joined #nim
11:27:06*dddddd joined #nim
11:28:05*sz0 joined #nim
11:31:23*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:35:08federico3a little help with this? https://ci.appveyor.com/project/FedericoCeratto/nim-lmdb
11:35:33federico3similar appveyor confs seem to work fine - I'm not sure why there an architecture mismatch here
11:44:53FromGitter<xmonader> Day 7 https://xmonader.github.io/nimdays/day7_shorturl.html#cid20
11:44:56FromGitter<tim-st> federico3: maybe this? https://github.com/nim-lang/Nim/issues/4460
11:46:54federico3if someone more familiar with appveyor could check/update https://github.com/nim-lang/Nim/wiki/BuildServices#appveyor it would help
11:47:17FromGitter<data-man> @federico3: Why in your appveyor.yml ```set path = ...;C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0;...``` i686?
11:47:48federico3I tried using other appveyor confs on github as examples
11:50:13*brainpro1 joined #nim
11:55:32*yglukhov quit (Remote host closed the connection)
11:58:25*brainpro1 quit (Ping timeout: 248 seconds)
11:59:59*yglukhov joined #nim
12:05:33*cspar joined #nim
12:25:27*brainpro1 joined #nim
12:30:56*CodeVance joined #nim
12:31:34FromGitter<mratsim> THis looks fun: https://github.com/olistic/warriorjs
12:33:05*CodeVance_ joined #nim
12:33:36*CodeVance_ quit (Read error: Connection reset by peer)
12:37:45*yglukhov quit (Remote host closed the connection)
12:41:22*miran joined #nim
12:44:57*CodeVance quit (Ping timeout: 240 seconds)
12:45:46*CodeVance joined #nim
12:54:57*CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
12:54:57*girvo quit (Ping timeout: 240 seconds)
12:55:54*CodeVance joined #nim
12:55:59*girvo joined #nim
13:04:35*CodeVance quit (Read error: Connection reset by peer)
13:04:49*CodeVance joined #nim
13:17:09*cspar quit (Ping timeout: 264 seconds)
13:21:48*Abnegation quit (*.net *.split)
13:23:08*nsf joined #nim
13:25:05*unclechu quit (Ping timeout: 246 seconds)
13:25:22*zielmicha[m]1 quit (Ping timeout: 240 seconds)
13:25:22*stisa quit (Ping timeout: 240 seconds)
13:25:26*hohlerde quit (Ping timeout: 246 seconds)
13:25:26*metaden92[m] quit (Ping timeout: 246 seconds)
13:25:26*TheManiac quit (Ping timeout: 246 seconds)
13:25:27*mgdelacroix[m] quit (Ping timeout: 246 seconds)
13:25:33*notdekka[m] quit (Ping timeout: 250 seconds)
13:25:34*solitudesf quit (Ping timeout: 250 seconds)
13:25:39*amp907[m] quit (Ping timeout: 255 seconds)
13:25:39*narimiran[m] quit (Ping timeout: 255 seconds)
13:25:43*petersjt014[m] quit (Ping timeout: 256 seconds)
13:25:43*endes[m] quit (Ping timeout: 256 seconds)
13:25:51*planetis[m] quit (Ping timeout: 255 seconds)
13:25:51*libman[m] quit (Ping timeout: 255 seconds)
13:25:58*Miguelngel[m] quit (Ping timeout: 250 seconds)
13:26:05*byteflame quit (Ping timeout: 255 seconds)
13:26:07*Demos[m] quit (Ping timeout: 260 seconds)
13:26:08*macsek1911[m] quit (Ping timeout: 246 seconds)
13:26:09*pqflx3[m] quit (Ping timeout: 256 seconds)
13:26:09*dyce[m] quit (Ping timeout: 256 seconds)
13:28:09*sz0 quit (Quit: Connection closed for inactivity)
13:28:57*CodeVance quit (Ping timeout: 240 seconds)
13:31:08*CodeVance joined #nim
13:32:36*skrzyp quit (Ping timeout: 255 seconds)
13:33:46*skrzyp joined #nim
13:41:16YardanicoCodeVance, wow, YAAIC :)
13:42:18*pqflx3[m] joined #nim
13:43:19FromGitter<CodeVance> gitter through irc
13:43:21FromGitter<CodeVance> :P
13:43:46*CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
13:44:04FromGitter<CodeVance> http://irc.gitter.im
13:44:13*CodeVance_ joined #nim
13:46:46YardanicoCodeVance_, btw, there's a relatively good IRC client for android - Revolution IRC (it's in beta, but it's available on google play)
13:47:22CodeVance_Yardanico, my android is very old (Why you think I use yaairc?
13:47:37YardanicoCodeVance_, Revolution IRC doesn't work for you?
13:48:50CodeVance_probably won't
13:49:01CodeVance_I mean... play store doesn't even work :|
13:49:23CodeVance_its on fdroid at least
13:50:11CodeVance_nope fdroid says incompatible XD
13:50:26CodeVance_anyway #nim-offtopic
13:51:22*cspar joined #nim
13:56:46*solitudesf joined #nim
13:56:47*Abnegation joined #nim
13:56:47*dyce[m] joined #nim
13:56:47*unclechu joined #nim
13:56:47*mgdelacroix[m] joined #nim
13:56:47*Miguelngel[m] joined #nim
13:56:48*Demos[m] joined #nim
13:56:53*narimiran[m] joined #nim
13:56:53*macsek1911[m] joined #nim
13:56:53*endes[m] joined #nim
13:56:53*TheManiac joined #nim
13:56:53*stisa joined #nim
13:56:54*notdekka[m] joined #nim
13:56:54*zielmicha[m]1 joined #nim
13:56:54*metaden92[m] joined #nim
13:56:54*planetis[m] joined #nim
13:56:54*libman[m] joined #nim
13:56:54*petersjt014[m] joined #nim
13:56:55*amp907[m] joined #nim
13:56:55*byteflame joined #nim
13:56:55*hohlerde joined #nim
13:58:12Yardanicowhy matrix irc bridge stops from time to time?
14:01:17*xkapastel joined #nim
14:01:19CodeVance_xmonader published the next nim-day
14:02:28YardanicoCodeVance_, I saw it
14:02:47Yardanicofor anyone who didn't see it -> https://xmonader.github.io/nimdays/
14:04:36Yardanicobut the code there isn't the best in some places (that's ok because afaik author is relatively new in nim)
14:05:19miranYardanico: you can post an issue in his repo.
14:05:24Yardanicomiran, oh :)
14:05:39mirani've learned a lot by writing a bad code and then someone correcting me :)
14:05:58miranif they didn't, i would probably still write code like that
14:07:04*PMunch joined #nim
14:11:36*CodeVance joined #nim
14:12:10*cspar quit (Ping timeout: 256 seconds)
14:13:04*CodeVance_ quit (Read error: Connection reset by peer)
14:15:57*SenasOzys quit (Ping timeout: 264 seconds)
14:22:04CodeVancehow to run nim with clang
14:22:09CodeVanceStill testing that
14:22:12CodeVanceGCC works
14:22:55YardanicoCodeVance, just change cc = gcc to cc = clang in config/nim.cfg (in compiler directory)
14:23:07Yardanicoor call nim like that: nim c --cc:clang yourfile.nim
14:23:23CodeVanceclang doesn't have the gcc headers
14:23:43CodeVancedoes this mean I need to install vcc to get the gcc headers
14:23:57miran...or just change/create nim.cfg inside of your project directory
14:24:12YardanicoCodeVance, maybe it's better to install mingw for gcc headers? :)
14:24:36CodeVanceI've tried this --passC: r"--include-directory C:\Users\Public\Documents\mingw64-6.3.0\mingw64\x86_64-w64-mingw32\include"
14:26:08Yardanicoand what happens?
14:26:39YardanicoCodeVance, did you try this - https://stackoverflow.com/a/47148526/5476128
14:28:39PMunchHmm, anyone remember where the call syntax table is?
14:28:57PMunchAs in the table in the documentation showing the different ways we can call a procedure
14:29:05CodeVanceYardanico, I'll try that in a bit
14:30:14miranPMunch: oh, i know what you're looking for. let me take a look
14:33:27miranit was something like this IIRC: https://nim-lang.org/docs/apis.html
14:33:48PMunchNo that's not the one I'm looking for
14:34:24miranyeah, i know, it was something *like that*. i think Araq has posted it in last week or so
14:34:52PMunchI meant the one that lists "f(a) == f(a); a.f() == f(a); a.f(b) == f(a, b); a.f b == f(a, b); f a, b == f(a, b)"
14:35:39miranyup, that's the one. i'm trying to find it. (and this is, once more, the evidence that nim needs much clearer documentation)
14:36:26mirannow the things are in five different locations, and good luck looking at the right place (on your first attempt)
14:37:11PMunchI have a feeling that it was here: https://nim-lang.org/docs/manual.html#procedures-method-call-syntax and in the following section command call syntax
14:37:47miranwhen i saw it, it was a separate, quite small, document
14:38:22*yglukhov joined #nim
14:41:16mirannope. can't find it.
14:41:53PMunchMe neither..
14:42:00PMunchI even remember seeing it a couple months back
14:42:27miranit was even more recent for me
14:42:48*yglukhov quit (Ping timeout: 255 seconds)
14:58:33*cspar joined #nim
14:58:54*SenasOzys joined #nim
15:00:38*SenasOzys quit (Remote host closed the connection)
15:01:40*SenasOzys joined #nim
15:03:40FromGitter<zacharycarter> @dom96 - yeah sorry - I haven't been as active / had as much free time as I would have liked to have lately
15:03:45FromGitter<zacharycarter> I'm working on the new version of the Nim playground now
15:03:55FromGitter<zacharycarter> and I"m using your libsass module :)
15:18:53*gokr joined #nim
15:31:01FromGitter<zacharycarter> I wrote an extension for the bundler - https://github.com/parcel-bundler/parcel - which will automatically bundle up all my js / css / html etc and resolve all my imports for me, with very little config
15:36:23CodeVancegoz did you make gulp.nim?
15:37:07FromGitter<zacharycarter> https://gist.github.com/zacharycarter/93776411cbebe94bd7078b74c48ee398
15:37:52FromGitter<zacharycarter> still tons of work to do
15:38:16FromGitter<zacharycarter> cool thing is - I can change a nim file and the project will hot reload in the browser
15:38:23FromGitter<zacharycarter> or hot module load or whatever
15:40:15FromGitter<zacharycarter> CodeVance: not quite gulp :P - I think parcel is like a much better webpack
15:41:03FromGitter<CodeVance> I can only vaguely remember my journey into js land
15:41:10*CodeVance left #nim ("Leaving")
15:41:21FromGitter<zacharycarter> I'm about to push up an initial commit to github
15:41:30FromGitter<zacharycarter> just so I don't lose this work :P
15:43:01dom96Do you even need parcel?
15:43:11FromGitter<zacharycarter> yes
15:43:19dom96The only reason I wrapped libsass is because I wanted to avoid the npm ecosystem
15:43:22dom96Why?
15:44:41FromGitter<zacharycarter> because I'm using ES6/2017 features and I don't want to deal with webpack
15:44:49FromGitter<zacharycarter> also I'm going to be using a ton of npm modules
15:45:17FromGitter<zacharycarter> parcel isn't really difficult to use either
15:45:27FromGitter<zacharycarter> it is pretty much zero config
15:45:30dom96Yeah, I would forgo those things to avoid npm
15:45:48FromGitter<zacharycarter> meh - npm isn't that bad
15:45:58FromGitter<zacharycarter> it's a lot faster in newer versions than it used to be
15:46:00dom96It's yet another dependency, and a big one at that
15:46:11FromGitter<zacharycarter> it's not like it's going into my binary
15:46:17FromGitter<zacharycarter> or being used at runtime
15:46:23FromGitter<zacharycarter> everything is dockerized anyway
15:46:31FromGitter<zacharycarter> so you don't have to install npm or node or anything anyway
15:46:43FromGitter<zacharycarter> hell you don't even have to install Nim
15:46:46FromGitter<zacharycarter> :P
15:47:02FromGitter<CodeVance> Is the nim playground written in nim?
15:47:06FromGitter<zacharycarter> yes
15:47:12FromGitter<CodeVance> full-stack?
15:47:13FromGitter<zacharycarter> all of it
15:47:16FromGitter<zacharycarter> mmhmm
15:47:35FromGitter<CodeVance> when it works add to reddit :|
15:47:49FromGitter<zacharycarter> hopefully I'll have something cool looking by the end of the weekend
15:48:00FromGitter<zacharycarter> but it will probably be a few more weeks before it's ready for a public beta
15:48:31FromGitter<CodeVance> More like everything is always in beta. nim is for devs, there is no beta
15:48:33dom96Lowering the barrier to entry for contributions is always a good idea too
15:48:38FromGitter<CodeVance> r/nim
15:48:47FromGitter<zacharycarter> dom96 - I'm trying to do that
15:49:00FromGitter<zacharycarter> thus the hot module reloading
15:49:08FromGitter<zacharycarter> being able to spin up the entire thing locally with one command
15:49:18FromGitter<CodeVance> is it fast?
15:49:22FromGitter<zacharycarter> the module reloading?
15:49:25FromGitter<CodeVance> ya
15:49:35FromGitter<CodeVance> compiling to js I guess
15:49:43FromGitter<CodeVance> reloading
15:49:44FromGitter<zacharycarter> I mean I can change a nim file and the page is refreshed in less than 0.2 seconds usually
15:49:48dom96Why the need for ES6/2017 features?
15:49:51FromGitter<zacharycarter> or sass
15:49:52FromGitter<CodeVance> that's fast
15:50:19FromGitter<zacharycarter> I'm just used to having them at my disposal
15:50:40FromGitter<zacharycarter> also for the editor I"m using - I need TS
15:50:51dom96but... you're writing this in Nim, no?
15:50:57FromGitter<zacharycarter> yes
15:51:05FromGitter<CodeVance> I think its fine, it might even attract node devs if they can still use npm
15:51:20FromGitter<zacharycarter> dom - please give me a chance before you poo all over it :P
15:51:28dom96Sorry, I just hate dependencies
15:51:31FromGitter<zacharycarter> let me get it up on github and maybe you can clone it and I can tell you how to run it
15:51:35FromGitter<zacharycarter> meh
15:51:41FromGitter<zacharycarter> it's JS man - I think they're inevitable
15:51:46FromGitter<zacharycarter> unless we replace all the npm tooling
15:51:49FromGitter<zacharycarter> and wrap every js lib
15:51:52dom96and I am very sceptical about the need for this
15:52:11FromGitter<zacharycarter> well you can take a look once I get it up
15:52:14FromGitter<CodeVance> dom96 why is there even a js backend?
15:52:17dom96we should replace all the tooling :)
15:52:22FromGitter<zacharycarter> well that takes time
15:52:23FromGitter<CodeVance> lol
15:52:26FromGitter<zacharycarter> so far we have a sass compiler :P
15:52:33dom96CodeVance: So you can target the browser :)
15:52:34FromGitter<CodeVance> ideal and practice
15:53:53FromGitter<CodeVance> dom96 you said "sceptical about all of this" it sounds like you think using node modules is a bad idea. Atm we don't really have a choice. Rolling your own comes with pitfalls too.
16:02:36dom96Node modules aren't the only way to add JS libraries to a web page
16:03:18dom96It's not node modules vs. rolling your own
16:05:22FromGitter<CodeVance> okay so download unzip copy paste?
16:05:56dom96Yes, or just use a CDN
16:07:39FromGitter<CodeVance> ok
16:18:24*zebralan joined #nim
16:19:34*zebralan quit (Client Quit)
16:24:58FromGitter<mratsim> somehow I read “we should replace all the trolling"
16:32:36*xet7 quit (Remote host closed the connection)
16:34:23*xet7 joined #nim
16:45:00federico3dom96: are the stickers drawing available somewere? in SVG perhaps?
16:47:50*yglukhov joined #nim
16:50:20*CodeVance joined #nim
16:51:56*yglukhov quit (Ping timeout: 246 seconds)
17:04:43FromGitter<dom96> Bah. Missed this train by mere seconds.
17:05:23FromGitter<dom96> I've got re-order link. I'll share it soon.
17:09:27*CodeVance quit (Ping timeout: 240 seconds)
17:11:59*CodeVance joined #nim
17:12:57*dddddd quit (Remote host closed the connection)
17:13:42*Hashirama joined #nim
17:14:03FromGitter<dom96> https://www.stickermule.com/artworks/1123185/shared
17:14:07*CodeVance quit (Read error: Connection reset by peer)
17:15:16HashiramaHeyo — I am running `nimble update` and keep getting a notice about openssl. However, I think ai already have latest openssl
17:15:17FromGitter<dom96> federico3: ^
17:15:43FromGitter<dom96> What version of openssl do you have? ``openssl version`` (IIRC)
17:17:10HashiramaHeres the output https://pastebin.com/cRszR3xa
17:17:17HashiramaOpenSSL 1.0.2o 27 Mar 2018
17:19:36FromGitter<dom96> What error are you getting?
17:19:48FromGitter<dom96> It's possible your openssl is so new it causes another issue :)
17:20:15Hashiramadom96: https://pastebin.com/raw/FrwxTHBW
17:22:37FromGitter<dom96> Weird. Are you sure you don't have an older version in your PATH?
17:22:44FromGitter<dom96> What OS is this on?
17:22:57HashiramaMac OSX
17:24:05FromGitter<dom96> In that case try something like this:
17:24:08FromGitter<dom96> `export DYLD_LIBRARY_PATH=/usr/local/opt/[email protected]/lib`
17:24:15FromGitter<dom96> But make sure the path is correct
17:24:57Hashiramahm, that allowed me to update nimble.
17:27:24FromGitter<dom96> Yeah, Nimble was using an older version that's probably bundled with macOS
17:27:26Hashiramadom96: Looks like additionally, following the https://medium.com/@katopz/how-to-upgrade-openssl-8d005554401 finished the issue (restarted shell s/t DYLD_LIBRARY_PATH no longer in path from previous run).
17:28:03Hashiramatyvm dom96
17:28:09*CodeVance joined #nim
17:28:39*CodeVance quit (Read error: Connection reset by peer)
17:28:50FromGitter<dom96> You can do that, but as homebrew mentions it might be dangerous :)
17:32:14HashiramaI had an unrelated question, nimble installs packages in my homedirectory instead of under the project (i.e: like `node_modules`)?
17:32:26Hashiramanot sure which of the two install methods i like
17:36:51FromGitter<dom96> indeed
17:37:44*PMunch quit (Quit: leaving)
17:39:51YardanicoHashirama, most nim packages always use latest version of other packages :)
17:40:06Yardanicoso this directory will be small anyway
17:41:52*CodeVance2 joined #nim
17:44:50*Sembei joined #nim
17:46:24*CodeVance2 quit (Ping timeout: 260 seconds)
17:46:59*Pisuke quit (Ping timeout: 260 seconds)
17:47:57*SenasOzys quit (Ping timeout: 240 seconds)
17:57:09FromGitter<brentp> am I missing a way to get the file path from a `File` in nim? can't seem to find this.
17:58:36*nsf quit (Quit: WeeChat 2.1)
18:02:14*Hashirama quit (Quit: Leaving.)
18:12:01*CodeVance joined #nim
18:12:44*CodeVance quit (Read error: Connection reset by peer)
18:14:09*SenasOzys joined #nim
18:18:53FromGitter<Varriount> @brentp Does getFileInfo do it?
18:21:02FromGitter<Varriount> Ah, no it doesn't.
18:21:32FromGitter<brentp> seems not. I got around it another way.
18:21:37FromGitter<Varriount> @brentp There is no reliable, cross-platform way to turn a file handle back into a party
18:21:43FromGitter<Varriount> *path
18:22:26FromGitter<brentp> @Varriount `getPartyFromFileHandle(f:File)` could be very useful.
18:26:25*max3 joined #nim
18:31:50FromGitter<data-man> @dom96: What's wrong with https://github.com/nim-lang/packages/pull/734 ?
18:34:10Yardanico@data-man: IDK, but pro tip: you can publish packages using nimble itself
18:34:19Yardanicoso you wouldn't do stuff like this - https://github.com/nim-lang/packages/pull/734/commits/31fc85f063ed7b663f409ff311df2b6ee9e7c521
18:35:49*cspar quit (Ping timeout: 265 seconds)
18:36:10FromGitter<data-man> I don't use Nimble.
18:36:37YardanicoWHY?
18:36:39Yardanicowhy do you add a package to nimble when? :D
18:36:49Yardanicofirst and second ones are separate questions*
18:38:23FromGitter<data-man> Because Nimble can't install a package if it not exists in the packages list.
18:41:05*rauss joined #nim
18:41:46Yardanicoit can lol
18:41:55Yardanicogo to folder with your package and run "nimble install"
18:42:28FromGitter<data-man> Can't install from a repo lol
18:42:40Yardanicoclone it and run nimble install :D
18:43:48FromGitter<data-man> Well, how you can install my package right now?
18:44:36YardanicoClone it and run nimble install?
18:44:58Yardanicowell, I have nothing against, it's good that there would be more nimble packages
18:45:07Yardanicobut yeah, there's still quite a lot of useful packages in nimble :)
18:59:27*gmpreussner quit (Ping timeout: 240 seconds)
19:00:17*gmpreussner joined #nim
19:05:54*cspar joined #nim
19:27:46FromGitter<tim-st> Is there any string search tree for nim that can be made constant? or do all of them use ref types?
19:28:39*Nim-noob joined #nim
19:37:15*athenot joined #nim
19:41:11*yglukhov joined #nim
19:42:13*athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:45:37*yglukhov quit (Ping timeout: 256 seconds)
19:52:33*cspar quit (Ping timeout: 248 seconds)
19:55:23*Nim-noob quit (Quit: Page closed)
19:57:23*Arrrr joined #nim
19:58:08ArrrrNimscript, is it possible to retrieve the output of an executed command?
19:58:19Arrrrosprocs is not usable
19:58:33*nsf joined #nim
19:59:56*Ven`` joined #nim
20:00:14*euantor quit (Ping timeout: 256 seconds)
20:00:36*euantor joined #nim
20:01:52Arrrrlike 'let output = exec("pwd")'
20:04:09*arecaceae quit (Remote host closed the connection)
20:04:16*xet7 quit (Remote host closed the connection)
20:04:45*SenasOzys quit (Remote host closed the connection)
20:05:13*SenasOzys joined #nim
20:05:34*arecaceae joined #nim
20:16:59*Ven`` quit (Read error: Connection reset by peer)
20:17:31shashlickI think you can do staticExec
20:18:38ArrrrWell you are right
20:21:10*Ven`` joined #nim
20:22:58ArrrrThis question deserves an update https://stackoverflow.com/questions/36103424/how-to-read-from-the-stdin-with-nim-script
20:44:57FromGitter<dom96> @data-man I didn't reject it?
20:46:19*vendethiel- joined #nim
20:48:41FromGitter<data-man> I don't know.
20:48:41ArrrrI leave now, thank you shashlick
20:48:44*Arrrr quit (Quit: Leaving.)
20:50:20*Ven`` quit (Ping timeout: 276 seconds)
20:59:58*jjido joined #nim
21:03:33*yglukhov joined #nim
21:04:00FromGitter<Varriount> @brentp it would actually be `getPartyFromFileHandle(f: File, kind: PartyKind)`
21:07:35*yglukhov quit (Ping timeout: 240 seconds)
21:18:27*miran quit (Ping timeout: 240 seconds)
21:23:48*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:24:22*athenot joined #nim
21:31:17*athenot quit (Ping timeout: 276 seconds)
21:34:41*athenot joined #nim
21:38:56*Vladar quit (Quit: Leaving)
21:38:56*athenot quit (Ping timeout: 246 seconds)
21:52:55*HYP3RBOR3A joined #nim
21:54:15*jjido joined #nim
21:56:43*Sentreen quit (Quit: WeeChat 1.6)
21:59:31*athenot joined #nim
22:04:01*Sentreen joined #nim
22:04:26*athenot quit (Ping timeout: 276 seconds)
22:10:18*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:11:21*Hashirama joined #nim
22:15:20HashiramaLong time Python user, I've also dabbled with Java and C99 but the latter were for school projects etc. I've dabbled with some other languages i.e: Elixir, Rust, Go but I never felt like "okay I am going to use this language now, I know enough". What can I do make sure something like that clicks (if thats even possible)
22:16:31HashiramaI think Nim and (Elixir or Pony) will be the two languages I'd like to learn. Going back to Niim though, I dont know how much value going through the tutorial will give. What did you folks to do to learn the langauge? I can def. spend an hour each day as a minimum
22:17:45shashlickDepends on your style hashirama
22:18:42HashiramaThats understandable, hence just assuming will be given feedback (things to pick from) rather than "here is the recipe to becoming a l33t h4x0r"
22:20:06HashiramaNot asking for a magical pill or anything, I am just wondering what are some things I can try to see which work for me. I have the time, juts need to sample some techniques and see what works for me. I am very surpised how this "learning new langauge" baffles me given that it didn't when I learned python. I guess I just need a project to work on...
22:20:21shashlickI ported some of my python code to get on board
22:20:52shashlickSome like doing specific projects, see xmonader's Nim a day effort
22:21:27HashiramaReference
22:21:45dom96I think it's fairly simple: you just have to continue building software in the language you want to learn.
22:21:48HashiramaErr, pressed enter by accident. I meant, Reference link for "Nim a day" would be appreciated.
22:22:02shashlickhttps://xmonader.github.io/nimdays/
22:22:20Hashiramatyvm
22:22:58shashlickI'm also a python guy who came to nim for performance
22:23:43shashlickI don't like doing practice projects, I prefer building things that are useful for me
22:23:54shashlickSo just depends if you have one handy
22:24:39shashlickOr you could simply read existing code to see how nim is being used, it's open source so lots to read 😊
22:24:42dom96Good point. Build things you need or find fun working on.
22:26:25dom96As they say though: practice makes perfect
22:27:03shashlickSo dom96, you back 100%?
22:27:27dom96Sure, I'm on my laptop
22:27:36dom96Watching Eurovision in the background though :)
22:28:48shashlick👍
22:29:17dom96Why? What's up?
22:29:19shashlickAraq been out for a few days looks like
22:31:23dom96Yeah, I think he's just spending time with family. There was a holiday in Germany recently.
22:32:16shashlickThat's cool
22:32:27shashlickI might travel to Munich in October
22:32:34*Hashirama quit (Quit: Leaving.)
22:34:16shashlickHave you had a chance to see if tissue is useful to you in debugging Nim issues?
22:35:06*Hashirama joined #nim
22:43:58FromGitter<mratsim> @Hashirama the best way to learn and keep the drive to learn is either curiosity or hunger, but I think the later only apply to COBOL devs.
22:44:43dom96shashlick: Afraid not.
22:45:15FromGitter<mratsim> In my case I wanted to learn deep learning by implementing it from scratch instead of using Numpy, so I thought why not learn that + a new language
22:48:05FromGitter<mratsim> Going on this project, I of course learned a lot about Nim, and deep learning, but also how memory work, assembly, cache optimization, pointers, ...
22:48:52*nsf quit (Quit: WeeChat 2.1)
22:49:20HashiramaYeah I am going to make a barebones static site generator.
22:50:31*Hashirama quit (Quit: Leaving.)
22:51:07*Hashirama joined #nim
22:51:24FromGitter<mratsim> ah that would be awesome
22:51:47FromGitter<mratsim> I played a bit with Gatsby recently and I really liked it.
22:52:58FromGitter<mratsim> A static website generator would be useful for documentation as well, I’m hitting the limit of nimdoc.cfg.
22:57:35*Hashirama quit (Quit: Leaving.)
23:12:17*tmm1 quit (Ping timeout: 265 seconds)
23:14:31*Hashirama joined #nim
23:17:59*darithorn joined #nim
23:24:08federico3uh?
23:24:49FromGitter<data-man> @dom96: I've the idea about tool for packages stats : by author, by tags, by license, etc. ⏎ Where it is better to add, as a separate tool in the packages repo or to add new command to Nimble?
23:26:16*vendethiel- quit (Quit: q+)
23:28:21FromGitter<Quelklef> hi guys, quick question: if I have a generic type e.g. `type X[N: static[int]]`, when I'm writing procs and methods for it is there any reason to write them like `proc fN: static[int (x: X[N])`, with a fully specified generic type, rather than just `proc fN (x: X[N])`?
23:28:52FromGitter<mratsim> you can but sometimes you get Cannot Instantiate Foo
23:29:18FromGitter<mratsim> another reason is documentation
23:29:33FromGitter<Quelklef> Documentation is a good point. Can you elaborate on the first
23:29:40FromGitter<mratsim> if you don’t use the N at all tou can just do proc f(x: X) by the way
23:29:54FromGitter<Quelklef> oh, cool
23:30:28FromGitter<Quelklef> but as for 'cannot instantiate', why's that happen? Shouldn't the supplied x: X[N] 'decide' what N is?
23:30:47FromGitter<mratsim> I don’t know, static bug :P
23:30:58FromGitter<Quelklef> damnit, static
23:31:05FromGitter<Quelklef> I actually haven't had any problems with static so far!
23:31:14FromGitter<mratsim> Nim can also infer the result N, for example: https://github.com/status-im/nim-stint/blob/master/stint/private/int_bitwise_ops.nim
23:31:41FromGitter<Quelklef> I thought this was done with `auto`?
23:32:39FromGitter<mratsim> auto is for the whole type, for subtype you can just not mention it and it will be auto
23:32:54FromGitter<mratsim> though Nim sometimes will complain with canont instantiate.
23:33:05FromGitter<Quelklef> oh, I see, IntImpl is generic then
23:33:35*Hashirama quit (Quit: Leaving.)
23:33:55FromGitter<mratsim> yes, and it’s used in probably the most complex static Nim library: https://github.com/status-im/nim-stint/blob/master/stint/int_public.nim#L22
23:34:26FromGitter<mratsim> See here for the type declaration: https://github.com/status-im/nim-stint/blob/master/stint/private/datatypes.nim#L143
23:34:45FromGitter<mratsim> I pass the N: static[int] to a macro to choose the implementation at compile-time
23:35:01FromGitter<Quelklef> ooh, this is exactly was I was looking for: before I found bigint, but that didn't work
23:35:02FromGitter<mratsim> uint64, or uint32 or 2xuint64 or 4xuint64