<< 08-05-2018 >>

00:14:23*jrbrt quit (Quit: jrbrt)
00:33:48*darithorn joined #nim
01:08:16*max3 joined #nim
01:13:43skrylarffs. does one have to wrap the entirety of glib just to boot a gtk app
01:32:49*brainpro1 is now known as brainproxy
01:44:32*skrylar quit (Remote host closed the connection)
01:44:50*dddddd quit (Remote host closed the connection)
02:04:11FromDiscord<poi> Hi. I just start learning nim. Anyone know how to convert a seq to an array? (just inverse $)
02:09:33leorizepoi: I don't think that's possible since an array size has to be known at compile time. Why would you need to convert anyway?
02:12:11FromGitter<gogolxdong> @PMunch , what happened , protobuf-nim doesn't compile.
02:13:59FromDiscord<awr> poi what are you trying to accomplish? do you want like a non-GC'd dynamically allocated array or do you want like, a seq you can't modify?
02:15:28FromDiscord<poi> Just required by a interface: I have to take first 2 elements in a seq and return in ararry[2,int]
02:15:58FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af1085d59a0578004b15b5a]
02:16:04FromDiscord<awr> you probably want a tuple or an object instead
02:16:54FromDiscord<awr> with a tuple you can still use index syntax like an array
02:17:28FromDiscord<awr> alternatively you can just return another seq[int]
02:17:35FromDiscord<poi> But it's a question from codewars which the signature of soluction cannot be change
02:17:42FromDiscord<awr> what is the question
02:17:59FromDiscord<poi> proc twoOldestAges*(ages: seq[int]): array[2, int] =
02:18:26FromDiscord<poi> simply take first 2 elements
02:18:52leorizepoi: then a proc like this should work https://pastebin.com/fAyzqt8n
02:21:28FromDiscord<awr> you cannot directly convert a seq[int] of variable length to an array[n, int] of constant length n. but you still use arrays as a return type
02:22:40FromDiscord<poi> Copy data from heap to stack should not be impossible intuitionally
02:22:51FromDiscord<awr> you can take values from the seq and compose the constant length array like leorize said
02:24:49FromDiscord<awr> you can technically dynamically allocate an array on the stack in C with alloca() but that's not...really...relevant
02:26:05FromDiscord<poi> Thx. I understand. Nim version's array is much ''safer'' than c
02:26:39FromDiscord<awr> if the purpose of the proc, as i'm assuming, is to find the two largest ints in a seq, that shouldn't be a problem
02:27:56FromDiscord<poi> Yes. That's the easy part. I learned some C before.
02:29:15FromDiscord<poi> Thanks you all.
02:52:36*NimBot joined #nim
02:57:00*skrylar joined #nim
03:08:32skrylarweird. flatbuffers has a field for embedded data but then it still writes a pointer to the data
03:37:27*max3 quit (Quit: Connection closed for inactivity)
03:40:25*MypMyp joined #nim
03:56:09*endragor joined #nim
03:57:29*MypMyp quit (Remote host closed the connection)
03:58:10*vivus quit (Quit: Leaving)
03:58:11*leorize quit (Quit: WeeChat 2.1)
04:09:52*darithorn quit (Remote host closed the connection)
04:15:21*CodeVance quit (Quit: Leaving)
04:19:35FromGitter<citycide> I'm getting this error when trying to compile on windows 10 - where is this file expected to be? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ (trying to compile https://github.com/nim-lang/ui/blob/master/examples/toy.nim after `nimble install ui`) [https://gitter.im/nim-lang/Nim?at=5af1255697e5506e04a5de49]
04:20:40*skrylar quit (Remote host closed the connection)
04:27:48*xkapastel quit (Quit: Connection closed for inactivity)
04:36:37*citycide joined #nim
04:39:49FromGitter<Varriount> Hmm, sounds like someone expected Linux paths, I think
04:47:13FromGitter<genotrance> looking at the code, it is intentional
04:50:08*leorize joined #nim
04:51:20FromGitter<genotrance> cd examples, nim c toy.nim
04:52:24FromGitter<genotrance> of course, it doesn't compile for me since it doesn't recognize the format: ..\res\resources.o: file not recognized: File format not recognized cc dom96, araq
05:00:58*craigger quit (Quit: bye)
05:01:07*craigger joined #nim
05:02:21FromGitter<citycide> right so I see it here: https://github.com/nim-lang/ui/blob/5eddf8ffbf8cf07aa688247d9ef13362dc6382c4/ui/rawui.nim#L83
05:38:51FromGitter<gogolxdong> Does anyone got this undeclared field: 'toLower' after update the devel branch ? It used to compile for our project.
05:39:36leorizeI think the name changed to toLowerAscii, if you're talking about the strutils function
05:44:55*CodeVance joined #nim
05:46:33FromGitter<Varriount> Better to import Unicode
05:53:14*leorize quit (Quit: WeeChat 2.1)
06:02:13*skrylar joined #nim
06:03:38*Widdershins quit (Quit: WeeChat 2.0.1)
06:04:19*nsf joined #nim
06:11:30FromGitter<gogolxdong> @Leorize yes ,thanks.
06:12:33*leorize joined #nim
06:24:15FromGitter<gogolxdong> and @Varriount ,yes found the same name proc.
06:41:10*gokr joined #nim
06:44:46*citycide quit (Remote host closed the connection)
06:49:31*Widdershins joined #nim
06:51:07FromDiscord<poi> How does Nim deal Big number? which surpass the upper bound of int64 ( https://pastebin.com/9bE1zkFH)
06:52:17FromDiscord<poi> How does Nim deal Big number? which surpass the upper bound of int64 ( https://pastebin.com/9bE1zkFH
06:59:39FromDiscord<awr> nim does not have bignums in the standard library (yet, at least)
06:59:46FromDiscord<awr> in the meantime though you can use this
06:59:46FromDiscord<awr> https://github.com/FedeOmoto/bignum
07:00:33FromDiscord<poi> OwO. Thx.
07:03:44FromDiscord<awr> or this https://github.com/def-/nim-bigints
07:04:07FromDiscord<awr> since the other ones appear to bind to GMP
07:24:25FromDiscord<poi> Thanks.
07:34:14FromGitter<mratsim> Also: https://github.com/status-im/nim-stint for uint128, uint256, uint512, etc ..
07:34:39FromGitter<mratsim> and https://github.com/status-im/nim-decimal for a decimal library
07:40:08skrylarZacharyCarter: welp. got macros to write flatbuffer objects now
07:46:38skrylarmay dabble with protobuf or msgpack since those are easy to do and probably reuse the macros, but then likely done
07:50:11skrylarCBOR is slightly interesting in a sense that it seems to have an official RFC spec, so might dovetail with some embedded/industrial users of nim that we have hiding around
07:51:47skrylarflatbuffers are kind of neat AFAICT but nim isn't super compatible with them in the end. the big win of capnproto and flatbuffers are that you can pre-layout all of your memory and then blit that chunk as a full state update, which another client can just accept as-is. but the only way to really "win" with that in ex. nim is to use a custom string type for slices
08:10:14*xet7 quit (Ping timeout: 260 seconds)
08:23:13*xet7 joined #nim
08:24:40*xet7 quit (Max SendQ exceeded)
08:25:11*xet7 joined #nim
08:39:59*oprypin quit (Ping timeout: 260 seconds)
08:40:01*brainpro1 joined #nim
08:40:49*oprypin joined #nim
08:42:19*brainproxy quit (Ping timeout: 260 seconds)
08:47:38*PMunch joined #nim
08:54:47*alpha1220 joined #nim
08:54:57alpha1220why is https://github.com/nim-lang/Nim/pull/7793 merged into master and not devel?
08:56:48Araqouch, my bad
08:57:26Araqthe CIs should really prevent this
08:59:39*alpha1220 quit (Ping timeout: 260 seconds)
09:13:25FromGitter<survivorm> @Araq - is it possible to set a generic as a default? Or is it somewhat planned?
09:14:39FromGitter<survivorm> E.g. ⏎ ⏎ ```proc `+=`[T, V] (a:T, b:V) {default} = ⏎ a = a + b``` [https://gitter.im/nim-lang/Nim?at=5af16a7e6f9af87e044f57da]
09:14:45FromGitter<alehander42> do we have some genSeed function in stdlib
09:15:20FromGitter<survivorm> to make it work if no more specific function is set
09:16:09FromGitter<survivorm> It may come handy in more places than i can imagine
09:22:06Araqhow so? += can be a generic and if there is a more specific overlaod, that will be picked instead
09:23:07skrylarAraq, you did a gud (wrt. custom pragmas)
09:23:25Araqwhat is a 'gud'?
09:28:03skrylara moronic way of spelling "good"
09:29:06AraqI didn't implement it, I merely told them how it needs to be done
09:30:14*skrylar takes the compliment, crumples it and throws it in the garbage.
09:31:15FromGitter<survivorm> @Araq ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af16e636f9af87e044f6565]
09:31:40FromGitter<survivorm> That's the example there system failes to guess
09:35:40Araqso ... get your overload right?
09:37:02*wishi quit (Ping timeout: 260 seconds)
09:40:42FromGitter<mratsim> just use `[T,U: not SomeInteger]`
09:41:24Araqthat's terrible :P
09:42:23FromGitter<mratsim> it works and is maintainable ;)
09:42:35FromGitter<mratsim> I would say “That’s pragmatic"
09:44:43skrylarwho needs maintainable
09:44:47*skrylar slaps another few macros together
09:46:09*xet7 quit (Read error: Connection timed out)
09:46:47*xet7 joined #nim
09:48:04*xet7 quit (Max SendQ exceeded)
09:48:35*xet7 joined #nim
09:53:00FromGitter<alehander42> how do you do this whole * somebody does action :O
09:53:06FromGitter<alehander42> is it irc-only
09:53:29dom96yes
09:53:39dom96well, maybe it works in gitter too
09:53:44dom96/me does something
09:53:54*FromGitter * alehander42 slaps gitter
09:53:57*FromGitter * dom96 tests something
09:53:57FromGitter<alehander42> oh yeah
09:54:01*Vladar joined #nim
09:54:03FromGitter<alehander42> good stuff
09:57:04*skrylar covers dom96 in dry sponges
09:57:36dom96Nooo, I have an irrational fear of dry sponges
09:58:11*FromGitter * narimiran wonders if this works on gitter too
09:59:54*leorize quit (Ping timeout: 260 seconds)
10:00:34skrylartomorrow, have to write the deserializer for flatbuffers :\
10:01:59FromGitter<alehander42> :D
10:02:13FromGitter<alehander42> it's different on gitter, too blue
10:10:12FromGitter<survivorm> @Araq - so, the only way is to use that @mratsim said or smth similar? So, only exceptions?
10:10:53FromGitter<survivorm> That was why i've spoken on 'default' topic - the same idea as with case's default
10:11:23FromGitter<survivorm> if specified - use specified, else go with default
10:11:41FromGitter<survivorm> I don't see what's wrong with the idea
10:11:43*arecaceae quit (Read error: Connection reset by peer)
10:12:06*arecaceae joined #nim
10:17:53FromGitter<gogolxdong> How to turn the Hint off as compliation?
10:18:28skrylar--hints off
10:22:08FromGitter<mratsim> or {.push: hints=off.} or something like that
10:22:25FromGitter<mratsim> if it’s only for a specific part of your code
10:42:08skrylarweird. tried to do zigzag encoding in nim
10:42:16skrylarits working (kind of) but the sign bit seems to be misbehaving
10:42:46Araqproc sar(a, b: int64): int64 =
10:42:46Araq {.emit: [result, " = ", a, " >> ", b, ";"].}
10:42:46Araqproc sal(a, b: int64): int64 =
10:42:48Araq {.emit: [result, " = ", a, " << ", b, ";"].}
10:42:50Araqproc toU*(x: int64): uint64 {.inline.} =
10:42:52Araq uint64(sal(x, 1)) xor uint64(sar(x, 63))
10:42:54Araqproc toS*(x: uint64): int64 {.inline.} =
10:42:56Araq let casted = cast[int64](x)
10:42:58Araq result = (`shr`(casted, 1)) xor (-(casted and 1))
10:43:02Araqworks for me
10:43:23Araqwe still lack the signed shift operators
10:50:11skrylarwell the mysterious part is the absolute values are correct but the sign bit is being silly
10:53:26yglukhov_Araq, dom96, now how about CTFE async support? ;)
10:55:13dom96lol
10:55:14dom96but why?
10:55:36yglukhov_for fun?
10:56:26yglukhov_ok, just kidding. for now...
10:56:56yglukhov_but i think CTFE closure iters might be useful. and should be really easy to implement now.
10:58:27skrylardid zigzag through an emit
10:58:33skrylaralthough i have no clue why we have to do it that way *shrug*
11:25:41skrylarapparently cbor is used in some other thing that is supposed to mirror http. neat
11:25:49skrylarhttps://en.wikipedia.org/wiki/Constrained_Application_Protocol
11:29:44FromGitter<mratsim> Do you know of a stringified python dictionary to Nim JsonNode converter? The syntax is almost the same as JSON but sufficiently different that I can’t just replace-hack in the string: {'descr': '<i8', 'fortran_order': False, 'shape': (4,), } ⏎ ⏎ I need this to parse numpy files, it embeds a Python dictionary in the binary :/
11:29:47FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/oDLf/2018-05-08_13-27-10.png)
11:32:01FromGitter<50hz> hi there, I am looking to use redis in nim but somehow it does not compile - I see there is an issue created already but I am not sure I am doing the right thing to fix
11:32:02FromGitter<50hz> https://github.com/nim-lang/redis/issues/5
11:32:46FromGitter<50hz> "you can just move await out of seq constructor." ⏎ does above mean replacing ⏎ @[await r.parseBulkString(true,line)] ⏎ with ⏎ ... [https://gitter.im/nim-lang/Nim?at=5af18adeff26986d083fec3c]
11:33:45FromGitter<50hz> @yglukhov would you mind take a look of above? it was from your comment in the issue :)
11:34:15FromGitter<dom96> ```let bulkStr = await r.parseBulkString(true,line); @[bulkStr]```
11:35:53FromGitter<50hz> var res = case line[0] ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af18b9918d6bdde37253a6f]
11:36:10FromGitter<50hz> this is where the code originally from ... not sure how I should change it to ?
11:36:49dom96You should be able to just replace it with what I've written
11:41:01FromGitter<50hz> I am not sure I follow, I am a bit too new to Nim, could you please help me change in the following function? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af18ccdff26986d083ff2b5]
11:42:05FromGitter<dom96> Replace ``@[await r.parseBulkString(true,line)]`` with ``(let bulkStr = await r.parseBulkString(true,line); @[bulkStr])``
11:42:19FromGitter<dom96> I missed the extra parenthesis in my initial answer
11:42:26FromGitter<dom96> But that should work, if it doesn't let me know.
11:43:21FromGitter<50hz> thanks - it works now with the extra parenthesis
11:43:31FromGitter<50hz> but I am getting a different error in my example code
11:43:43dom96Show me :)
11:44:39*sz0 quit (Quit: Connection closed for inactivity)
11:45:01FromGitter<50hz> import redis, asyncdispatch ⏎ ⏎ ##Open a connection to Redis running on localhost on the default port (6379) ⏎ ⏎ let redisClient = openAsync() ... [https://gitter.im/nim-lang/Nim?at=5af18dbc40f24c4304600096]
11:45:16FromGitter<50hz> test.nim(7, 1) Error: undeclared identifier: 'await'
11:45:43dom96Your code needs to be inside an ``async`` proc
11:45:53dom96proc main() {.async.} = # put your code here
11:46:07dom96then call `main` like this: waitFor main()
11:48:53FromGitter<50hz> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af18ea559a0578004b30447]
11:48:58FromGitter<50hz> like this?
11:49:28FromGitter<50hz> test.nim(4, 18) template/generic instantiation from here ⏎ test.nim(10, 20) Error: type mismatch: got <Future[redis.AsyncRedis], string, string> ⏎ but expected one of: ⏎ proc setk(r: AsyncRedis; key, value: string): Future[void] ⏎ first type mismatch at position: 1 ... [https://gitter.im/nim-lang/Nim?at=5af18ec740f24c4304600429]
11:49:52FromGitter<50hz> I might be doing something very wrong :(
11:50:29dom96openAsync also returns a Future
11:50:57dom96on line 10 you're trying to pass `redisClient` which is a `Future[redis.AsyncRedis]`
11:51:07dom96to `setk`
11:51:22dom96To get the value out of a `Future` you just use `await` :)
11:51:34dom96So hopefully you can work out where to put that `await`
11:51:44FromGitter<50hz> it is the example from https://github.com/nim-lang/redis
11:52:08dom96That example should be updated too then :)
11:52:36dom96If you could create a PR to fix both of those issues that would be brilliant
11:53:00FromGitter<50hz> where shall I sue await ? :)
11:53:21dom96Think about it. ``openAsync`` returns a `Future`
11:53:22FromGitter<50hz> I thought I have await in front of setk and get
11:53:42dom96yes, those return futures too
11:55:25FromGitter<50hz> *<dom96>* So hopefully you can work out where to put that `await` ⏎ isntead of ?
11:55:31FromGitter<50hz> sorry
11:55:38FromGitter<50hz> *<dom96>* To get the value out of a `Future` you just use `await` :⁠) ⏎ instead of ?
11:55:56dom96Not instead of
11:55:58dom96in addition
11:56:47*yglukhov_ quit (Read error: Connection reset by peer)
11:57:01FromGitter<50hz> ah got you
11:57:09*yglukhov joined #nim
11:57:27FromGitter<50hz> I was missing the await for openAsync
11:58:16FromGitter<50hz> in this issue, @yglukhov mentioned there will be a PR for nim itself that can fix this problem ?
11:58:16FromGitter<50hz> https://github.com/nim-lang/redis/issues/5
11:58:37FromGitter<50hz> so shall I wait or I should put in PR now to fix the code we discussed above ?
11:58:52dom96Create the PR
11:58:56FromGitter<50hz> I mean will above fix compatible with what you are doing to merge ?
11:59:02dom96yep
11:59:20FromGitter<50hz> thanks - will do in a bit.
11:59:24FromGitter<50hz> thank you very much
12:00:06dom96thanks :)
12:01:49*leorize joined #nim
12:06:25*yglukhov quit (Ping timeout: 248 seconds)
12:08:00*yglukhov joined #nim
12:11:01*skrylar_ joined #nim
12:11:12FromGitter<50hz> @dom96 may I ask if we have built-in support for sftp ?
12:11:28FromGitter<50hz> tried google but only find ftp apparently ?
12:11:52dom96we don't
12:12:03dom96well
12:12:11dom96that's ftp over SSH, right?
12:12:18dom96FTP over SSL should work
12:12:20skrylar_ssl
12:13:29*skrylar quit (Ping timeout: 260 seconds)
12:24:01*yglukhov quit (Ping timeout: 256 seconds)
12:26:55*yglukhov joined #nim
12:27:41*xet7 quit (Read error: Connection timed out)
12:28:01FromGitter<50hz> probably ssh?
12:28:30FromGitter<50hz> with sftp, you can/need to specify a key etc
12:28:30*xet7 joined #nim
12:29:58*xet7 quit (Max SendQ exceeded)
12:30:29*xet7 joined #nim
12:31:23*yglukhov quit (Ping timeout: 256 seconds)
12:31:57*xet7 quit (Max SendQ exceeded)
12:32:26*xet7 joined #nim
12:38:24skrylar_well there is an sftp that runs over ssh and an sftp that runs over ssl
12:38:36skrylar_to make matters confusing i think they are both referred to as sftp
12:39:14FromGitter<data-man> My small celebration - the 40th PR. :-D
12:39:30PMunchCongrats
12:39:41*Snircle joined #nim
12:41:25FromGitter<data-man> Thanks! :)
12:41:46FromGitter<alehander42> good!
12:43:57xcmyep, SFTP is over SSH; FTPS is FTP over SSL/TLS
12:45:26xcmmnemonic for FTPS being "woops, we forgot to add the Security"
12:51:14FromGitter<data-man> @50hz: You can try the curl wrapper
12:52:44*yglukhov joined #nim
12:52:55*gokr quit (Ping timeout: 256 seconds)
12:55:13FromGitter<50hz> @data-man thanks - will give it a try :)
12:57:59*leru joined #nim
12:58:26FromGitter<Varriount> Araq: I've been looking at zah's recent commits - I never knew that templates and macros could be redefined. I don't recall seeing that behavior mentioned in the manual.
12:59:57*athenot joined #nim
13:05:18*athenot_ joined #nim
13:06:21*athenot quit (Ping timeout: 240 seconds)
13:07:48*yglukhov_ joined #nim
13:08:57*yglukhov quit (Ping timeout: 240 seconds)
13:26:04*endragor quit (Remote host closed the connection)
13:28:54*endragor joined #nim
13:30:24*dddddd joined #nim
13:32:57*endragor quit (Ping timeout: 240 seconds)
13:41:01FromGitter<50hz> how does the unboxing work in Nim? look like mimic python does not work ;o ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af1a8ec00dc488804a415e7]
13:41:40FromGitter<50hz> identifier expected, but found '('
13:41:42FromGitter<50hz> got this
13:43:21leorizeI think you have to do `for key, val in tbl.pairs`, then use `let` to unpack the tuples
13:46:11subsetparkyes you can't unpack a tuple in an iteration, unfortunately. the number of bound arguments in the iteration is a function of the procedure (items, pairs) rather than the structure of the elements returned in each call to the iterator.
13:49:04FromGitter<narimiran> @50hz that is unfortunately not (yet) implemented. i've raised an issue about it: https://github.com/nim-lang/Nim/issues/7486
13:51:20FromGitter<mratsim> @narimiran, did you have time to re-benchmark Arraymancer btw?
13:52:40FromGitter<narimiran> @mratsim i did some quick test with the latest nim devel and the latest AM, but didn't notice a big difference!?
13:52:44FromGitter<50hz> thanks guys
13:52:54FromGitter<50hz> I will just unbox it with let after
13:52:57FromGitter<narimiran> i guess i should (have) test(ed) it more thoroughly
13:53:45FromGitter<mratsim> normal it should be noticeable just with a plain nim c -r
13:54:36FromGitter<mratsim> normally*
13:55:26FromGitter<mratsim> I’m trying to add .npy saving/loading but it seems like it requires parsing Python dictionary :/
14:04:58*leorize quit (Ping timeout: 268 seconds)
14:04:58*fredrik92 joined #nim
14:05:19skrylar_the non-joys of writing parsers
14:06:39*couven92 quit (Ping timeout: 260 seconds)
14:06:49Araqsubsetpark: for a, b, c in items(...) does work
14:08:46FromGitter<alehander42> well parsing it shouldn't be too hard, but it all depends on what are the values: are they random python repr-s ?
14:11:27*xet7 quit (Read error: Connection timed out)
14:12:01*xet7 joined #nim
14:12:26FromGitter<mratsim> na it’s just that I have to learn how to write a lexer, but I can almost copy paste JSON
14:12:56FromGitter<mratsim> the only difficult part is if you have numpy arrays of numpy arrays.
14:15:42FromGitter<alehander42> but what kind of values can you have otherwise? e.g. only literals/arrays/dicts or also various objects? I still can't see where does it differ from JSON if the values are only dict/array/literals (except for ')
14:16:29FromGitter<alehander42> ah numpy arrays have no , ?
14:16:59skrylar_i still read that as "numpy" and not "num PY"
14:17:02*leorize joined #nim
14:17:48skrylar_anyway. time to swan dive in to a stargate
14:17:51*skrylar_ quit (Remote host closed the connection)
14:21:05FromGitter<mratsim> Only int, string and bool for non nested: {'descr': '<i8', 'fortran_order': False, 'shape': (4,), }
14:21:34FromGitter<mratsim> and there is this weird `(4,)`to describe the shape (I can modelize this as (4, JNull).
14:21:52FromGitter<mratsim> for nested I don’t know, I’ll just treat it as unsupported.
14:22:57FromGitter<mratsim> i.e. only simple Metadata are in a Python dictionary, but I need it to be able to parse the binary data.
14:23:25FromGitter<mratsim> the <i8 vs >i8 means little-endian vs bigEndian.
14:23:51*Vladar quit (Quit: Leaving)
14:24:08FromGitter<mratsim> anyway, I’m off to write a lever.
14:24:38*xkapastel joined #nim
14:28:29FromGitter<alehander42> I have this horrible hack for you ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af1b40d03cafa797b3710c5]
14:28:49FromGitter<alehander42> :D but it misses a lot of edge cases ofc, a lexer is the correct thing to do
14:30:03*xet7 quit (Read error: Connection timed out)
14:30:22FromGitter<alehander42> actually a parser, but with a lexer you can emit a correct json string, and reuse a parser yeah
14:30:31*xet7 joined #nim
14:30:45FromGitter<data-man> @alehander42: use multiReplace :)
14:31:24FromGitter<alehander42> yeah, nice ! (but still would be very buggy :D )
14:39:55FromGitter<Varriount> @mratsim If you know the input will be valid, you might be able to use a YAML parser.
14:40:16FromGitter<Varriount> or a JSON parser.
14:40:42FromGitter<mratsim> the input is almost valid JSON :P
14:41:00FromGitter<Varriount> Which is why YAML might work
14:41:03FromGitter<mratsim> but I think it’s a good opportunity to learn how to write a simple lexer so i’ll do that
14:41:25FromGitter<Varriount> If you need help, Python's documentation has the EBNF of the language
14:45:35enthus1astmratsim have a look at parseutils and strscan
14:47:55*xet7 quit (Read error: Connection timed out)
14:48:31*xet7 joined #nim
14:50:04FromGitter<mratsim> strscan is interesting thanks.
15:03:51*PMunch quit (Quit: Leaving)
15:05:40*xet7 quit (Read error: Connection timed out)
15:06:16*xet7 joined #nim
15:10:22*leru quit (Read error: Connection reset by peer)
15:11:59*leorize quit (Quit: WeeChat 2.1)
15:13:05*gokr joined #nim
15:25:17*citycide joined #nim
15:25:44*nsf quit (Quit: WeeChat 2.1)
15:27:57*vegax87 quit (Changing host)
15:27:57*vegax87 joined #nim
15:27:57*vegax87 quit (Changing host)
15:27:57*vegax87 joined #nim
15:34:57*gokr quit (Ping timeout: 240 seconds)
15:39:19*yglukhov joined #nim
15:40:23*miran joined #nim
15:41:09*yglukhov_ quit (Ping timeout: 264 seconds)
16:01:12*yglukhov quit (Read error: Connection reset by peer)
16:01:49*yglukhov joined #nim
16:02:16FromGitter<Varriount> @mratsim Worst case, you could call python using the '-c' argument
16:04:14FromGitter<mratsim> I’m trying to solve problems posed by Python, so if I can do without it, I will ;)
16:09:33*jrbrt joined #nim
16:12:31citycidewhat's the syntax for setting g++ path in nim.cfg? ie. the `amd64.windows.gcc.path` equivalent for g++ - trying to use mingw
16:14:23*xet7 quit (Read error: Connection timed out)
16:15:02*xet7 joined #nim
16:23:50FromDiscord<awr> if i had to guess it would be `amd64.windows.gcc.cpp.path`
16:27:58citycide@awr yep seems to be right, thanks
16:33:09*xet7 quit (Read error: Connection timed out)
16:33:47*xet7 joined #nim
16:34:05*xkapastel quit (Quit: Connection closed for inactivity)
16:36:15FromGitter<mratsim> I just use @if windows gcc.cpp.exe: “foo” https://github.com/mratsim/Arraymancer/blob/master/nim.cfg#L53
16:36:40FromGitter<mratsim> @citycide
16:38:18citycide@mratsim I did see some of those out in the wild too, will probably use that in the future
16:40:49citycideunfortunately it didn't help me get `nim-lang/ui` to compile due to the error I posted yesterday so I opened an issue over there
16:51:06*sz0 joined #nim
16:51:09*Trustable joined #nim
16:56:32*xet7 quit (Read error: Connection timed out)
16:57:02*xet7 joined #nim
17:00:33*dddddd quit (Ping timeout: 256 seconds)
17:04:04*xet7 quit (Max SendQ exceeded)
17:04:47*xet7 joined #nim
17:06:15*xet7 quit (Max SendQ exceeded)
17:06:42*xet7 joined #nim
17:13:35*dddddd joined #nim
17:34:34*xet7 quit (Read error: Connection timed out)
17:35:02*xet7 joined #nim
17:36:35*yglukhov_ joined #nim
17:39:14*yglukhov quit (Ping timeout: 246 seconds)
17:50:20*Trustable quit (Remote host closed the connection)
17:50:48*Hycryon quit (Remote host closed the connection)
18:00:49*yglukhov joined #nim
18:00:50*yglukhov_ quit (Read error: Connection reset by peer)
18:05:22*xkapastel joined #nim
18:12:31FromDiscord<deech> Hi all, a couple of noobie questions about extern'ing Nim procs, (1) is there a way to generate a C header file with generated headers for the extern'ed functions and (2) is there a recommended way to extern member functions?
18:13:22*nsf joined #nim
18:18:51FromGitter<mratsim> Is that a bug in the Json module? Array with nested object, are expecting array comma instead of object comma? https://github.com/nim-lang/Nim/blob/master/lib/pure/json.nim#L533-L534
18:20:19FromGitter<mratsim> @deech: https://nim-lang.org/docs/backends.html#backend-code-calling-nim-nim-invocation-example-from-c
18:22:06FromGitter<deech> @mratsim That's great thanks! Any suggestions on my second question about exposing object functions?
18:24:44*kier quit (Remote host closed the connection)
18:27:59FromGitter<mratsim> I don’t think there is a recommended way. you can choose the exported name if needed: https://nim-lang.org/docs/manual.html#foreign-function-interface-exportc-pragma
18:28:00FromGitter<mratsim> ideally I would add some extra formatter for generics so that it’s easy to append uint16, uint32, uint64 … but that can be done via a macro easily.
18:28:34*vuLgAr quit (Ping timeout: 264 seconds)
18:29:45*vuLgAr joined #nim
18:31:45FromGitter<deech> Thanks@!
18:41:38*jjido joined #nim
18:43:33*Sembei quit (Read error: Connection reset by peer)
18:44:27*Sembei joined #nim
18:48:16*themagician joined #nim
18:51:19*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:51:20*themagician_w quit (Ping timeout: 268 seconds)
19:02:56*CodeVance quit (Read error: Connection reset by peer)
19:03:21*CodeVance joined #nim
19:07:55*DarkArctic_ joined #nim
19:08:07*DarkArctic quit (Read error: Connection reset by peer)
19:10:23*DarkArctic__ joined #nim
19:13:57*DarkArctic_ quit (Ping timeout: 240 seconds)
19:16:21*xet7 quit (Quit: Leaving)
19:18:16*jjido joined #nim
19:25:42*endragor joined #nim
19:25:56*ketralnis quit (Remote host closed the connection)
19:28:02*gokr joined #nim
19:30:06*endragor quit (Ping timeout: 250 seconds)
19:34:01shashlicktrying to get jekyll running on ubuntu for the website, it's asking for so many ruby packages
19:35:26shashlickwhy isn't "apt install jekyll" enough
19:37:34*jrbrt quit (Quit: jrbrt)
19:44:29*athenot_ quit (Read error: Connection reset by peer)
19:44:34*athenot joined #nim
19:47:50dom96shashlick: because Ruby
19:49:18*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:10:43shashlickdom96: are we okay with updating the windows ZIP with the latest finish.exe? that way we don't need to wait until the next release for installer improvements to be distributed
20:14:23*nsf quit (Quit: WeeChat 2.1)
20:14:49*xkapastel quit (Quit: Connection closed for inactivity)
20:15:42*athenot_ joined #nim
20:17:05*athenot quit (Ping timeout: 246 seconds)
20:19:56*jjido joined #nim
20:28:53dom96shashlick: That's up to Araq
20:43:37*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:56:18shashlickcan we close this? https://github.com/nim-lang/nim/issues/7747
20:58:44*miran quit (Ping timeout: 246 seconds)
20:59:33FromGitter<data-man> @shashlick: done :)
21:02:46FromGitter<data-man> Why didn't you close it yourself?
21:03:28shashlicki was just asking on policy
21:13:57*athenot_ quit (Remote host closed the connection)
21:18:53*jrbrt joined #nim
21:24:30FromDiscord<awr> @shashlick if you're just making a github pages site you don't necessarily need a local copy of jekyll
21:24:46FromDiscord<awr> i mean it can be useful
21:26:55FromDiscord<awr> but you can still just fork a jekyll template or whatever and push changes to the markdown and compare against the site if you're lazy
21:37:28CodeVanceOr not even push... Just edit on github inside the browser
21:39:26shashlicktrue
21:39:46shashlicki just want to make sure the nim website still looks how it should
21:43:03gokrAnyone know... how am I supposed to use toHex in strutils (take a string, give a string)?
21:43:19gokrWhatever I do I get "Error: type mismatch: got (string) but expected 'BiggestInt = int64'"
21:43:34gokrIt seems to select the generic variant of toHex
21:48:47dom96!eval import strutils; echo(toHex("hello"))
21:48:50NimBot68656C6C6F
21:49:20shashlickjust tried on #head, works for me too
21:49:53FromGitter<data-man> And for me too
21:50:27*gokr quit (Ping timeout: 240 seconds)
21:52:47*gokr joined #nim
21:53:14shashlickdom96: https://github.com/nim-lang/Nim/pull/7802
21:55:28gokrHmmm, ok, perhaps I need to update nim
21:57:11shashlickwhat commit hash are you on?
21:58:02gokrI was on 0.17.3 - then I started a choosenim update and... my box went ... unresponsive so I had to reboot.
21:58:48*themagician quit ()
22:00:26shashlickokay cause toHex() hasn't changed in 7 months per git blame
22:06:09gokrWell, now it works. When I upgraded. I suspect the proc selection has changed since then.
22:06:16gokr(generics)
22:07:16FromGitter<mratsim> by the way @gokr, your spry-lang domain expired
22:07:27gokrYeah, I know.
22:07:51gokrI didn't renew because... they wanted such a hefty payment to just reactivate it.
22:08:15gokrI was hoping it was going to be released but... they seem to clutch onto it
22:08:34CodeVanceWhat?
22:08:42CodeVanceWho owns the domain
22:08:44FromGitter<mratsim> the example on the spry-lang page were better organized than on Github or on your blog.
22:08:53gokryeah.
22:09:18gokrI missed the payment, so the registrar wanted... $60 or whatever it was - to reactivate it.
22:09:31gokrAnd I got so pissed that I just ignored it.
22:10:03gokrI haven't had time fiddling with Spry
22:10:11CodeVanceChange domain on your github xD get a free domain
22:10:12gokrBeen busy building https://getcanoe.io
22:10:40gokrUnfortunately no Nim in that, the server side was Nim but... I had to switch to nodejs.
22:11:12gokrmratsim: Now I am for the moment playing with finding a really fast blake2b.
22:11:24CodeVanceTrue, but maybe you could provide analysis on *why* you had to switch
22:11:44gokrIt's old news, I was here talking about it at the time ;)
22:11:47FromGitter<mratsim> I like that for once, the team has no CEO and people actually doing stuff :P
22:12:19gokrIt's not a company, although people seem to think so because we actually got a decent design for the site ;)
22:12:48gokrIt's one of the most popular wallets right now for Nano, so it's going well. About 4000 users, 2000 on mobile.
22:12:49CodeVanceOh ive seen this before
22:13:12FromGitter<mratsim> The green looks bad when f.lux reduces the blue light by the way ;)
22:13:23CodeVanceLol
22:13:45gokrCodeVance: But ... basically it was the MQTT library wrapper in Nim that ... wasn't that well implemented.
22:13:56FromGitter<mratsim> it’s better when not deactivated yeah
22:14:36gokrCodeVance: That kinda turned into a major PITA, so ... switched to nodejs and well, no matter what you say about the js crap world - it's fairly good at "making shit that works".
22:14:55CodeVanceYa not arguing
22:15:00CodeVanceCause facts
22:15:05FromGitter<data-man> @gokr: blake2b in what language?
22:15:06gokrAlthough now I am moving towards Dart actually.
22:15:20CodeVanceStill node though
22:15:20FromGitter<mratsim> Getting thingd to production readyness is tough work, lots of building blocks and glue to create still.
22:15:22gokrblake2b in whatever you can bring that is FAST AS A BAT OUT OF HELL.
22:15:49gokrWhich AFAICT is mainly the OpenCL implementations coupled with a FAT Nvidia card.
22:16:15gokrOr AVX2 based code.
22:16:45gokrBut I just got curious and wanted to try the libsodium and the Nim native blake2b (which is ... ported from C I guess).
22:17:07gokrSo... in Nano blake2b is used to do Proof Of Work for transactions.
22:17:17FromGitter<data-man> https://github.com/BLAKE2/libb2 and https://github.com/BLAKE2/BLAKE2
22:17:38gokrCurrently our server at getcanoe.io performs this work for our users - but... the darn users are getting many so it's starting to choke on it.
22:18:09gokrSo we are throwing together a little "pow pool" thing, to offload the work into people's basements ;)
22:18:45CodeVanceCant do the pow on the mobile?
22:18:56CodeVanceI know itscrazy
22:19:13gokrCan, but... Canoe is a Cordova app - so... sure, a cordova plugin would be great to have.
22:19:29gokrI tried with some wasm stuff, but... nah, didn't fly that well, especially not on iOS
22:19:49CodeVanceWhatever works
22:20:10gokrdata-man: Yeah, so... that looks like the original code from Samuel Neves - no AVX2 I think.
22:20:21*jjido joined #nim
22:20:25gokrNim has a libsodium wrapper I am playing with now.
22:20:53dom96gokr: how have things with node been? :)
22:21:23gokrWell, you know, nodejs is... what it is. ;) It has actually been rock stable and it works fine.
22:21:37FromGitter<mratsim> until the next left pad ;)
22:21:58gokrIt has very good MQTT and Postgres and Redis support - which is basically what we use.
22:22:13dom96Your service hasn't crashed yet due to an 'undefined'? :)
22:22:19gokrOf course, I can see me rewriting it in Dart just for the hell of it.
22:22:22*yglukhov quit (Read error: Connection reset by peer)
22:22:35gokrNope, sorry, no crashes. ;) It's a small codebase.
22:22:57*yglukhov joined #nim
22:23:05gokrI like Nim a lot - but... you know, sometimes you hit a hard wall.
22:23:43gokrThe Nano core team writes the core Nano implementation in C++. I have now a good relation to several of them, including the creator Colin.
22:23:51dom96The issue describing the problems you ran into is still open sadly: https://github.com/nim-lang/Nim/issues/7134
22:24:00gokrBut... I do know some of them are now pushing towards Rust.
22:24:33gokrThe code base of the node is... well, one of the guys that knows it quite well mentioned "semaphore hell".
22:25:11gokrI would have pushed Nim ... but... I dunno what the concurrency story is these days.
22:25:28FromGitter<mratsim> Rust is exchanging one set of problem for another.
22:25:44gokrI know, I can imagine the codebase getting very complex under Rust.
22:25:51FromGitter<mratsim> (arguably Nim is the same too)
22:26:13gokrOne guy is writing an alternate node in C + Lua.
22:26:50dom96might work
22:27:07dom96by 'nano' you mean the text editor, right?
22:27:34gokrIt's a fairly complex piece of machinery operating with UDP and tons of peers, LMDB and a slew of crypto.
22:27:45gokrdom96: Hehe, no.
22:28:01gokrhttps://coinmarketcap.com/currencies/nano/
22:28:31gokrIt's IMHO the most promising crypto. Fast as hell, zero fees, no mining.
22:28:40FromGitter<mratsim> Oh I thought it was for the Ledger Nano
22:28:40FromGitter<data-man> @gokr: https://github.com/sneves/blake2-avx2 :)
22:29:04gokrmratsim: We have on our todo for Canoe - integrating with Ledger Nano S actually.
22:29:19gokrJust have no manpower to grab that one.
22:29:50dom96Ahh, so many cryptocurrencies. If only I had the time...
22:29:53gokrdata-man: Yeah, that's basically the fastest I think, for regular CPU.
22:30:04dom96Right now I'm improving our forum
22:30:07gokrdom96: Pick Nano.
22:30:32gokrdom96: It's very refreshing since it's very no-nonsense and deeply development focused. Very good core team.
22:30:42CodeVanceLol
22:30:45FromGitter<mratsim> What? We will have crypto on the Nim forum? ;)
22:31:01dom96mratsim: gotta make money somehow :P
22:31:19gokrCodeVance: Compared to other cryptos I mean. There is a LOT of... well, craziness.
22:31:27dom96gokr: But what about the memes?
22:31:32FromGitter<mratsim> "Money is overrated” (Famous hermit words)
22:31:41gokrdom96: What memes?
22:32:02dom96Cryptocurrency memes, they can make or break crypto :P
22:32:04CodeVanceGokr i like crypto, but not the wastefullness of mining, so i already like nanoo
22:32:25CodeVanceGokr, how you do pow in nano then?
22:32:27gokrCodeVance: Yup. If you read up on Nano (called Raiblocks previously) - you realize it has most of the checkboxes.
22:33:05gokrCodeVance: The PoW is just a counter measure for spam. So when you send a new block into the network - you need to accompany it with a "proof of work".
22:33:12CodeVanceGokr, hes talking about dogecoin
22:33:23gokrWhich is a blake2b based hash of the previous block hash.
22:33:40CodeVanceWhat spam would there be?
22:34:04gokrspam as in ... someone generating 1000s of itsy bitsy transactions - or ping pong between accounts.
22:34:16gokrIt needs to be costly.
22:34:32CodeVanceYa, so limit transaction frequency
22:34:34gokrThis POW is done with a server in say 10-20 seconds.
22:34:42dom96gokr: btw, if Nano's core implementation is C++ then Nim would be a perfect way to slowly migrate to a new language.
22:34:48gokrOr with a fat Nvidia you can do 1/sec
22:34:50dom96Nim's C++ support cannot be beat
22:34:56gokrdom96: I know.
22:35:05gokrWhich is why you should join up.
22:35:24gokrI am serious.
22:35:34CodeVanceSo its expensive but not wasteful
22:35:47gokrYeah, I mean... it's nothing compared to mining.
22:35:56CodeVanceOr gaming
22:36:01gokrNano has no mining at all.
22:36:22gokrIt's actually a damn brilliant system.
22:36:40gokrEach account has its own blockchain. Which is perfectly logical.
22:36:56FromGitter<mratsim> @dom96 At Status we celebrated when we removed the C++ lib :D
22:37:08CodeVanceWrap nim around it. Itd be interesting to see if nim could use nodejs backend for it
22:37:16dom96gokr: I'd love too. But Nim is my priority right now.
22:38:01gokrCodeVance: Mmmm, not sure what you said there.
22:38:03CodeVanceI like nims development community. Each day something new in the issues and prs
22:38:04dom96Maybe Status would be interested in adopting Nano too :)
22:38:43gokrThe Nano network consists of "nodes". The only node (well, discounting experimentals) today is the official node written in C++.
22:39:02CodeVanceGokr, nim can use nodejs as a backend, but im not familiar with it
22:39:02dom96mratsim: nice :D
22:39:05FromGitter<mratsim> Maybe, but we have like 20 open positions because too much work already >_>
22:39:22gokrCodeVance: Oh, you meant to compile to js. Sure, I know.
22:39:39gokrBut in this case - it's just our thin backend for the Canoe wallet that's written in Nodejs.
22:39:49gokrThe Nano network is C++.
22:40:22dom96mratsim: wow
22:41:45*Sembei quit (Ping timeout: 264 seconds)
22:41:49FromGitter<mratsim> (not on Nim yet but still: https://status.im/open-positions.html)
22:42:08CodeVanceStatus is made with nim? Mratsim
22:42:23FromGitter<mratsim> The future one will be
22:42:30FromGitter<mratsim> the current is Go
22:42:43CodeVanceInteresting
22:42:45FromGitter<mratsim> assuming our research is successful
22:43:08gokrmratsim: Awesome :)
22:43:08FromGitter<mratsim> The plan is detailed here: https://github.com/status-im/nimbus
22:43:29gokrWell, when Nano comes breathing down your neck - contact me ;)
22:43:31FromGitter<mratsim> Basically the UI is in Clojurescript, and the backend is Go at the moment.
22:43:59gokrThough Nano is purely for payments.
22:44:22CodeVanceGokr +1
22:44:52FromGitter<mratsim> It’s more like, when you’re tired of working in Node or Rust, ping me ;)
22:45:16gokrHaha! Yeah, well... I actually signed employment with another company... yesterday
22:45:27gokrCanoe is just night hacking so far.
22:45:28CodeVanceNoooo
22:45:41CodeVanceYour going to do rust?
22:45:46gokrNope, hell no
22:45:48FromGitter<mratsim> Night hacking can go pretty far.
22:46:05gokrYeah, and... Canoe has already made it quite far, it's fun.
22:46:28CodeVanceHowd you get the website??
22:46:36gokrgetcanoe.io?
22:46:36FromGitter<mratsim> I’ve been hacking for 1 year and 15 days on Arraymancer, and I can now do FizzBuzz. Milestone checked :D.
22:46:50CodeVanceThe websites design
22:47:08gokrIt was a guy in the community - Mike - he is good at that kind of thing.
22:47:34FromGitter<mratsim> @CodeVance, if you just want landing pages there are plenty, one of the easiest is this: https://kickofflabs.com/
22:47:45gokrIt's ... very interesting. These crypto projects have a completely different ... mix of people.
22:47:55FromGitter<mratsim> or https://unbounce.com/
22:48:18gokrThere are for example TONS of non developers. And a whole slew of sharp designers that make mockups and slick looking designs.
22:48:25gokrAnd... kinda few devs.
22:49:50CodeVanceYa
22:50:28CodeVanceIts not just a technical change its a cultural one... Something all projects need to take into account
22:53:29*CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
23:02:58*CodeVance joined #nim
23:07:30*yglukhov quit (Ping timeout: 256 seconds)
23:15:54gokrdom96: Familiar? /home/gokr/.nimble/pkgs/jester-0.2.0/jester/private/utils.nim(68, 15) Error: undeclared field: 'toLower'
23:16:08dom96gokr: Update your jester
23:16:17dom96nimble install jester@#head
23:16:57*xkapastel joined #nim
23:17:51FromGitter<mratsim> jester has been eaten by a beast by the way
23:21:18*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:24:39dom96oh? :)
23:50:42FromGitter<zacharycarter> @xmonader - sorry I've been dealing with some personal stuff - the Nim playground in its present forms requires some manual setup on the host - so it's not exactly a plug and play deal - I hope to improve this with the next release, I just haven't had a ton of time for Nim programming the past few weeks / months really.
23:51:57CodeVanceI've noticed ...
23:52:02CodeVanceBeen bust?
23:52:05CodeVancebusy*
23:52:30FromGitter<zacharycarter> well - I very nearly got myself fired from my job - but I think I managed to just get the sabbatical I was looking for
23:52:55CodeVanceI think the gitter irc bridge for gitter twitch is broken :|
23:53:36*CodeVance left #nim ("Leaving")
23:56:24*leorize joined #nim