<< 12-10-2019 >>

00:00:29FromDiscord<krab4t> https://www.youtube.com/user/kiloneie/videos 😮
00:03:43*NicQ joined #nim
00:04:28*nif_ quit (Quit: ...)
00:04:37*nif joined #nim
00:12:17*nif quit (Quit: ...)
00:12:27*nif joined #nim
00:16:53*NicQ quit (Quit: Quit)
00:42:57*lritter joined #nim
00:55:51*me7 joined #nim
01:02:11*krux02_ quit (Remote host closed the connection)
01:07:44FromGitter<mratsim> @me7 “nim c myproject.nim"
01:08:05*NimBot joined #nim
01:08:10FromGitter<mratsim> it’s the same as any computer
01:12:35*skoude joined #nim
01:17:07*skoude quit (Ping timeout: 250 seconds)
01:21:59*doesntgolf quit (Read error: Connection reset by peer)
01:24:29*Hideki joined #nim
01:38:12*laaron joined #nim
02:06:45*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
02:11:30*laaron joined #nim
02:15:18*laaron quit (Client Quit)
02:15:45*laaron joined #nim
02:18:52*laaron quit (Client Quit)
02:19:16*laaron joined #nim
02:23:34*laaron quit (Remote host closed the connection)
02:40:14*laaron joined #nim
02:43:57*laaron quit (Client Quit)
02:44:30*laaron joined #nim
02:45:42*laaron quit (Client Quit)
02:46:05*laaron joined #nim
02:46:27*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
02:46:56*pbb joined #nim
02:51:47*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
02:52:55*doesntgolf joined #nim
02:53:50*laaron joined #nim
02:54:26*lritter quit (Ping timeout: 240 seconds)
02:55:16*lritter joined #nim
02:56:56*theelous3 joined #nim
03:00:19*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
03:00:36*laaron joined #nim
03:02:21*laaron quit (Remote host closed the connection)
03:41:51*chemist69 quit (Ping timeout: 250 seconds)
03:43:59*chemist69 joined #nim
04:34:09*zahary joined #nim
04:58:09*theelous3 quit (Ping timeout: 268 seconds)
05:05:09*rockcavera quit (Remote host closed the connection)
05:13:14*doesntgolf quit (Ping timeout: 240 seconds)
05:17:12*radsoc joined #nim
05:28:21*zahary quit (Quit: Leaving.)
05:31:24*solitudesf joined #nim
05:36:35*narimiran joined #nim
05:53:19*zahary joined #nim
06:11:22*thomasross quit (Read error: Connection reset by peer)
06:12:00*thomasross joined #nim
06:13:33*dddddd quit (Read error: Connection reset by peer)
06:18:32*me7 quit ()
06:19:45*me7 joined #nim
06:20:00*alexander92 joined #nim
06:20:43*me7 quit (Client Quit)
06:22:09*me7 joined #nim
06:24:14*solitudesf quit (Ping timeout: 246 seconds)
06:40:34*skoude joined #nim
06:47:55FromDiscord<arnetheduck> @me7 https://github.com/status-im/nimbus/#raspberry-pi for some tips to make nim itself compile
06:48:21FromDiscord<arnetheduck> (on arm/rpi)
06:49:15ZevvIf your image is already expanded to SD size you can make a swap file instead of increasing swap size
06:49:38Zevvworth mentioning that as well?
06:59:08FromDiscord<MeatPony> Hey, uh. Coincidentally, on the topic of compiling and nim, I'm trying to compile a nim file with nim in the same directory but its saying it cant find my .nim file.
06:59:08FromDiscord<MeatPony> https://cdn.discordapp.com/attachments/371759389889003532/632472300171689984/unknown.png
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:28AraqMeatPony: get your relative addressing right, it's downloader.nim, not ../../downloader.nim
07:01:39FromDiscord<MeatPony> ok
07:01:57FromDiscord<MeatPony> thank you
07:04:38*gmpreussner joined #nim
07:10:17*skoude quit (Ping timeout: 276 seconds)
07:14:28*radsoc quit (Quit: radsoc)
07:18:34*Trustable joined #nim
07:30:30*asymptotically joined #nim
07:33:15*Trustable quit (Remote host closed the connection)
07:33:15*alexander92 quit (Read error: Connection reset by peer)
07:47:49*nsf joined #nim
08:02:08*zahary quit (Quit: Leaving.)
08:05:54*filcuc joined #nim
08:08:53*narimiran quit (Ping timeout: 246 seconds)
08:08:54*me7 quit (Read error: Connection reset by peer)
08:47:56*lritter quit (Ping timeout: 240 seconds)
08:50:47FromGitter<mratsim> @Zevv afaik that’s what raspbian does
09:01:00*me7 joined #nim
09:01:34Zevvah ok
09:06:38*Traviss__ joined #nim
09:06:40*PMunch joined #nim
09:08:31*radsoc joined #nim
09:10:17*traviss quit (Ping timeout: 265 seconds)
09:12:44*me7 quit (Remote host closed the connection)
09:18:40*laaron joined #nim
09:20:30*sealmove joined #nim
09:30:14*radsoc quit (Quit: radsoc)
09:33:51*laaron quit (Remote host closed the connection)
09:38:16*laaron joined #nim
09:40:54*PMunch quit (Remote host closed the connection)
09:43:36*laaron quit (Remote host closed the connection)
09:53:45*Trustable joined #nim
10:04:35*filcuc quit (Read error: Connection reset by peer)
10:29:12federico3what happened with csize going from int to uint?
10:33:08Zevvwell, csize went from int to uint it seems :)
10:33:27federico3just after 1.0 tho
10:33:39Zevvhttps://github.com/nim-lang/Nim/issues/12187
10:33:40federico3this is breaking a lot of stuff
10:33:40Zevvyes
10:34:39Zevvdon't know the whole story - araq said 'no it will break too much', but still it got merged
10:40:00federico3...without any explanation. Maybe it was merged by mistake
10:43:37leorizeit's no mistake imo
10:44:04federico3what's the status with the new release?
10:44:20leorizeclyybber made a series of PRs to prepare for this
10:44:37leorizeand since the eventual switch passed CI, I guess that's why it was merged
10:45:22leorizesome new fixes has been picked up recently
10:49:59*asymptotically quit (Remote host closed the connection)
10:50:24*asymptotically joined #nim
10:52:26federico3leorize: any way to add build and jump-to-error to nim.nvim ?
11:02:07*radsoc joined #nim
11:11:05*krux02 joined #nim
11:11:58*radsoc quit (Quit: radsoc)
11:14:11FromGitter<sheerluck> may I have a slice of tuple? or maybe all slices have to be seq[T] so obv I can not put tuple of (int, float64, string) into seq[T] :^(
11:16:45FromDiscord<juan_carlos> Tuple is compile time fixed size.
11:17:41*zahary joined #nim
11:18:34lqdev[m]damn, python programmers have rather weird habits. glad I came from java
11:19:05lqdev[m]like, why would you even want to slice a tuple?
11:20:31ZevvI see use cases. A proc returning a tuple with 5 elements, but I'm only interested in the middle three
11:20:48ZevvI now need to assign to (a, b, c, d, e) and leave a and e unused
11:26:32FromDiscord<Rika> i dont see the weird habit here
11:26:32FromDiscord<juan_carlos> https://play.nim-lang.org/#ix=1Yp4
11:26:41*evilkhaoskat joined #nim
11:27:50*evilkhaoskat quit (Client Quit)
11:28:12*zahary quit (Quit: Leaving.)
11:33:34FromDiscord<juan_carlos> https://play.nim-lang.org/#ix=1Ypb
11:36:14*zahary joined #nim
11:39:34*radsoc joined #nim
11:44:51*krux02 quit (Remote host closed the connection)
11:54:09*solitudesf joined #nim
12:03:35*dddddd joined #nim
12:03:49*superbia joined #nim
12:04:06*skoude joined #nim
12:05:47*radsoc quit (Quit: radsoc)
12:08:03leorize[m]federico3: it's already there :make
12:08:25*skoude quit (Ping timeout: 250 seconds)
12:08:29*radsoc joined #nim
12:08:39leorize[m]see :h makeprg if you want to customize it
12:09:34federico3it's not nim-aware by default
12:09:49lqdev[m]Zevv: (a, b, c, , ) = someTuple
12:10:09lqdev[m]crap, riot.im is messing with my message
12:10:18leorize[m]federico3: wdym?
12:10:36*lqdev joined #nim
12:10:52lqdevI meant `(a, b, c, _, _) = myTuple`
12:14:30FromDiscord<juan_carlos> Black hole variable.
12:21:23FromGitter<sheerluck> @lqdev thank you
12:30:22FromDiscord<exelotl> I turned off unused variable warnings in my project, cause I hate seeing it complain about `(dir, name, ext) = splitPath(p)` when I'm only using `name`
12:31:09FromDiscord<exelotl> I don't want to change them into underscores because it's more readable this way, and maybe I'll want to use them later
12:31:38FromDiscord<juan_carlos> `{.used.}`
12:31:40*nsf quit (Quit: WeeChat 2.5)
12:34:08FromDiscord<exelotl> Hmm that makes things ugly but I it works
12:35:53sealmoveecho ^(1010_1010'u1)
12:35:58sealmove!eval echo ^(1010_1010'u1)
12:35:59NimBotCompile failed: /usercode/in.nim(1, 17) Error: invalid number: '1010_1010'u1'
12:36:12FromDiscord<juan_carlos> You get *used* to it. Badum-Tish
12:36:13FromDiscord<Rika> u1?
12:36:23sealmove!eval echo ^(1010_1010'u8)
12:36:25NimBotCompile failed: /usercode/in.nim(1, 8) Error: number out of range: '1010_1010'u8'
12:36:35sealmove!eval echo ^(0b1010_1010'u8)
12:36:36NimBotCompile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <uint8>
12:36:50sealmovebinary operator for inverting bits?
12:36:59FromDiscord<Rika> try not?
12:37:10sealmove!eval echo not(0b1010_1010'u8)
12:37:12NimBot85
12:37:20sealmoveoh great
12:37:49FromDiscord<Rika> its odd
12:57:35*crem quit (Quit: WeeChat 1.9)
12:57:54*crem joined #nim
13:03:26Zevvlqdev[m]: what, you can just omit vars between the commas!
13:06:26FromDiscord<Rika> ?
13:06:29FromDiscord<Rika> what do you mean?
13:07:10Zevv(a, b, c, , ) = someTuple
13:08:35FromDiscord<exelotl> :O
13:08:56*Hideki quit (Remote host closed the connection)
13:09:16FromDiscord<Rika> 😮
13:11:32FromDiscord<juan_carlos> 😱
13:13:39jkenKind of a general design question, I have a rendering system that I want to use native "nim types", and I want to have multiple rendering backends, opengl expects "opengl types" like GLuint, GLint, etc.
13:14:39jkenDoes anyone have any design suggestions regarding casting native nim types to the expected types or N number of other sysems without completely filling my code with conversions everywhere?
13:15:05jkenI am new to nim, still wrapping my head around macros, but I feel like the language can help me here and I just don't know how yet.
13:16:12FromDiscord<juan_carlos> overload some templates
13:18:50*solitudesf quit (Ping timeout: 240 seconds)
13:19:57*crem quit (Quit: WeeChat 2.6)
13:22:11*crem joined #nim
13:25:44*skoude joined #nim
13:28:22*stefantalpalaru joined #nim
13:32:27*skoude quit (Ping timeout: 268 seconds)
13:35:42jkenUnrelated, can anyone explain to me what is in this line:
13:35:50jkencast[pointer](0)
13:37:15disrupteknull pointer
13:39:44jkenIs that different than nil?
13:39:51Zevvlqdev[m]: why "Parse with prec = 9 to avoid any binary operators"
13:50:23*asymptotically is now known as mooman12
13:54:46lqdev[m]Zevv: you're looking at object defs right? because this `object Vec2 * Vec3 {}` doesn't make sense
13:54:55lqdev[m]and that's how types were parsed up to now
13:55:03lqdev[m]it's actually different from now on
13:55:19lqdev[m]I just haven't pushed the changes yet.
13:57:42*alexander92 joined #nim
13:58:56*fanta1 joined #nim
13:58:56*alexander92 quit (Read error: Connection reset by peer)
13:59:37*onionhammer joined #nim
14:02:26*ng0 joined #nim
14:04:00*alexander92 joined #nim
14:09:22*rockcavera joined #nim
14:10:18*solitudesf joined #nim
14:12:57*onionhammer quit (Quit: WeeChat 2.4)
14:14:23Zevvno that's vardefs IIRC
14:15:08ZevvI was using your grammar as a test case: http://ix.io/1YpP
14:15:43Zevvparsing expresions with recursive descent is nasty, so this is a nice time to see if I can get precedence climbing / Pratt supported at the grammar level
14:15:50*onionhammer joined #nim
14:15:57*nsf joined #nim
14:16:40Zevvbut my conclusion for today is that I lack brainpower for these things
14:16:49disruptekbummer.
14:18:32Zevvand here is this guy already figured that out at telling me "Pratt algorithm is very easy to embed into pretty much any kind of Packrat or any other PEG implementation"
14:20:12Zevvhttps://dev.to/combinatorylogic/peg-and-pratt-play-well-together-2i20
14:27:47*radsoc quit (Quit: radsoc)
14:28:26*gangstacat quit (Quit: Ĝis!)
14:30:55lqdev[m]Zevv: still doesn't matter, `var x: number * string = 10` still doesn't make sens
14:31:01lqdev[m]s/sens/sense/
14:32:38Zevvtrue, I mentally was somewhere else in the parse tree
14:40:10*ng0 quit (Quit: Alexa, when is the end of world?)
14:43:17*lqdev quit (Quit: Leaving)
14:48:40*gangstacat joined #nim
14:49:00*onionhammer quit (Quit: WeeChat 2.4)
14:49:01*D4663R joined #nim
14:49:08*D4663R left #nim ("WeeChat 2.6")
14:54:26leorizeZevv, disruptek, federico3, narimiran: please pull the latest commits from nim.nvim's master branch. I've merged the project finding feature as well as fixed a terrible bug.
14:55:45Zevv"a terrible bug"
14:56:02Zevvthis involves shame?
14:56:17leorizeyes, read the latest commit :P
14:56:44FromDiscord<juan_carlos> The walk of shame, `walkDir(shame)`
14:56:58Zevvleorize: well, pretty harmless
14:57:06Zevvit's not like, crashing my nvim or anything
14:57:13Zevvand if it did, I wouldn't even notice
14:59:23leorizecan someone merge #12419?
15:00:13leorizeactually, I'm gonna close it :P
15:02:09*Hideki joined #nim
15:02:16*Hideki quit (Remote host closed the connection)
15:02:31*Hideki joined #nim
15:16:26*rockcavera quit (Remote host closed the connection)
15:21:24*radsoc joined #nim
15:29:43disruptekZevv: your nvim is so buggy that you don't even attribute crashes?
15:32:37*zahary quit (Quit: Leaving.)
15:36:12*zahary joined #nim
15:40:34Zevv:)
15:42:40disruptekbtw i'm on 4.x and no issues yet.
15:42:53disrupteki don't suppose you have a repro?
15:47:01Zevvnah I'm still on 3.8. its not that bad, only when starting a new nim project when there is no file on disk yet. leorize pinned this down to a bug in nvim, i should just update
15:48:00disruptekah, well 0.4.2 +acl +iconv +tui is problem-free for me.
15:48:08leorizewell it can't be a bug elsewhere if its an assertion error lol
15:57:45*superbia1 joined #nim
16:01:07*superbia quit (Ping timeout: 265 seconds)
16:04:41*hami joined #nim
16:06:34FromGitter<Varriount> Hrm, what new feature should I add to my shell language...
16:07:53hamiHello everyone. Quick question: let f = 0.0; type(f) returns "float64" not "float". Is this the expected behaviour?
16:08:42*onionhammer joined #nim
16:09:01Yardanicohami: float is a arch-dependent type, it's float64 on 64bit, and float32 on 32bit
16:09:11YardanicoSo if you compile for 64-bit, "float" will be 64-bit by default - "float64"
16:09:32YardanicoIf you want to explicitly specify float32 or float64, use let f: float32 = 0.0 or let f: float64 = 0.0
16:09:49solitudesfis it? i thought that was the case only for ints
16:09:52*leorize quit (Remote host closed the connection)
16:09:55sealmoveVarriount: depends on what you want it to be
16:09:57solitudesfhttps://nim-lang.github.io/Nim/manual.html#types-preminusdefined-floating-point-types
16:10:02solitudesffloat is always float64
16:10:20Yardanicosolitudesf: oh
16:10:25YardanicoThen excuse me :P
16:10:33hamiTutorial says float is always float 64 in this implemantation
16:11:16hamibut consider this: let i = 0; type(i) always returns "int" not "int32" or "int64"
16:11:45solitudesfbecause int is arch dependant
16:12:00Yardanicohami: yeah, solitudesf corrected me, float is always float64 unless
16:12:09Yardanico*unless you explicitly specify float32
16:13:11*leorize joined #nim
16:13:46*superbia1 left #nim ("WeeChat 2.4")
16:14:05hamiOoh. I think I get it now. The difference is in being arch dependent for int but always being float64 independent of arch
16:14:16hamiThanks
16:17:33*narimiran joined #nim
16:18:06*hami quit (Quit: Leaving)
16:20:17*zahary quit (Quit: Leaving.)
16:25:13leorizenarimiran: please switch back to nim.nvim master branch :)
16:25:21leorizeI've fixed some bugs + merged find-project
16:25:21narimiranwill do
16:25:43*NimBot joined #nim
16:39:16leorizenarimiran: looks like norm is failing
16:39:25narimiranwhere?
16:41:47leorizemy PR to Nim
16:43:45narimiranmaybe it is on their side because there were some commits yesterday and today?
16:44:33*mooman12 quit (Remote host closed the connection)
16:44:58*mooman12 joined #nim
16:45:47leorizeprobably, can you give it a check?
16:46:09narimirannot before tomorrow morning, sorry
16:46:13*Hideki quit (Remote host closed the connection)
16:47:06*Hideki joined #nim
16:51:38*Hideki quit (Ping timeout: 268 seconds)
17:05:21*fanta1 quit (Quit: fanta1)
17:12:43FromGitter<Varriount> sealmove: I think I'll try adding job support
17:14:59ZevvIs there a shorthand for array slicing where the high end is 'X or array.len, whichever is smaller'?
17:15:55YardanicoZevv: I think not, only arr[0..min(X, array.len)] probably
17:16:44Zevvyeah, I though so - thanks!
17:17:41*mooman12 is now known as asymptotically
17:18:59FromDiscord<sealmove> Varriount: Meh, do you use job control in practice?
17:20:33FromDiscord<sealmove> Proper command logging is cool (for example sqlite or json files, like xonsh does it).
17:21:52FromDiscord<sealmove> As for the language itself, this depends on your goal. Some shells aim to be full fledged programming languages (with even exceptions), others want to be kept minimal.
17:23:54disruptekwhat would be cool is built-in process persistence using criu or similar.
17:25:12Zevvlike ^Z on steroids!
17:26:45*Hideki joined #nim
17:38:25*radsoc quit (Quit: radsoc)
17:40:12*Hideki quit (Ping timeout: 265 seconds)
17:41:01*literal_ is now known as literal
17:42:26disruptekit doesn't really seem so outlandish an idea.
17:50:43*Ekho- is now known as Ekho
17:53:15*krux02 joined #nim
17:59:07zedeusnarimiran: you can ignore norm failing, tests weren't updated after a recent change
17:59:18sealmovedoes the Nim compiler make use of https://nim-lang.org/docs/pegs.html ?
17:59:18narimiranleorize: ^
17:59:26narimiranthanks zedeus
18:05:19Zevvsealmove: no, only for generatinc some internal documentation
18:08:42sealmoveoh btw, is there nimgrep integration for VSCode?
18:08:53Yardanicosealmove: I think no
18:09:18sealmovethat's a bit surprising
18:09:24Yardanicowhy so?
18:09:40sealmoveseems useful enough, and Araq uses VSCode extensively
18:09:45Yardanicoit uses nimsuggest
18:17:21*minierolls quit (Ping timeout: 268 seconds)
18:17:47*minierolls joined #nim
18:23:33*solitudesf- joined #nim
18:25:14*solitudesf quit (Ping timeout: 246 seconds)
18:36:43*solitudesf- quit (Quit: Leaving)
18:37:00*solitudesf joined #nim
18:38:31sealmoveis there a way to convert each element of a seq easily?
18:38:33leorizeto be fair no Nim code around actually need nimgrep
18:39:04sealmovefor example if you have the literal @[1, 2, 3] it's a seq[int] by default, and seq[byte](@[1, 2, 3]) doesn't work.
18:39:34leorizesealmove: sequtils.map
18:39:37*FromGitter quit (Remote host closed the connection)
18:39:40disruptekyou can write a converter, but they are a little too magical for my tastes.
18:39:41Yardanicosealmove: map or mapIt
18:39:51sealmoveleorize: mine happened to need it :P but it's probably bad style and I should change it.
18:39:55*FromGitter joined #nim
18:40:12leorizesealmove: --styleCheck:error
18:40:30sealmove:O seems useful, ty
18:45:47sealmovewould be nice if seq[byte](@[1, 2, 3]) worked though
18:46:19*FromGitter quit (Remote host closed the connection)
18:46:37*FromGitter joined #nim
18:46:47sealmoveworth requesting it?
18:46:59leorizenope :P
18:47:26leorize@[1, 2, 3].mapIt(it.byte) should be around the same amount of characters
18:48:17sealmovebut you have to import sequtils :P
18:49:44leorizeworth it :P
18:49:52leorizealso @[1'u8, 2, 3] works too
18:49:59disruptekdo you really want your int literals to be typed as 8-bit?
18:52:06sealmovei have to be very specific with typing to avoid compile errors. the code is auto-generated with scala :S
18:52:18disruptekall the more reason...
18:53:59FromDiscord<Generic> don't use @[1,2,3].mapIt(it.byte)
18:54:08FromDiscord<Generic> it allocates a new seq
18:54:47FromDiscord<Generic> this code allocates a seq of ints, fills it with 1,2,3 and
18:54:55leorizesealmove: generate uint 8 literal
18:55:23FromDiscord<Generic> then allocates a new seq and casts individual members of the original seq to uint8
18:55:28FromDiscord<Generic> and places them in the new seq
18:55:53leorize@Generic it's the only way to do so on runtime
18:56:33sealmovethe problem I've been dealing with 1 week now is that I can't generate precise literals, so I rely on conversion
18:56:50leorizewhy can't you generate precise literals?
18:57:14leorizealright there's a way to avoid more runtime costs: assign them to consts
18:57:23sealmovethe type system of the language I map from doesn't have seperate types for 1, 2, 4 or 8 byte integers
18:58:04FromDiscord<Generic> oh, that's bad
18:58:17FromDiscord<Generic> if you're dealing with bytes isn't there even some kind of "blob" container
18:58:38FromDiscord<Generic> ?
18:59:20sealmovethere is. also I realized the equivelant implementation for C++ uses std::string everywhere :P
18:59:58leorizesealmove: what are you generating?
19:00:11leorizeis it too complex to be done completely in nim?
19:01:12sealmovenot sure, would be cool as a Nim project indeed, but for now it's part of https://kaitai.io/. you can track progress here: https://ci.kaitai.io/
19:01:33sealmovethere is a Nim 1.0.0 column
19:02:39leorizewhy does this feel like NESM? :P
19:03:33sealmoveit's not serialization, it's arbitary file format description
19:03:56sealmovetake a look here https://formats.kaitai.io/
19:04:48leorizeat first glance this looks like yaml
19:06:13sealmoveit is an extended version of yaml
19:06:21sealmovecalled ksy (Kaitai Struct Yaml)
19:07:19sealmovebut the catch is... for serialization you need less features because your format should be simple, so serializations tools like NESM don't suffice for describing complex (already-existing) formats.
19:09:26leorizeiirc someone managed to parse tcp packets with nesm
19:09:29*superbia joined #nim
19:10:16leorizewell but I don't work on binary things much so can't say much about it
19:12:22sealmoveyou can make do with serialization tools, there are even extendable ones. but they are not designed for this purpose so a specialized tool like KS is more sane in cases where you are trying to reverse engineer a weird format (say custom formats of a AAA game)
19:13:06leorizeif ksy is just yaml with extras then can't you just build the parser in nim?
19:13:30sealmovesure, would be cool.
19:14:18sealmovebut in KS i have this ready and my task is to simply generate the Nim code using already filled-in structures
19:14:43sealmovebut you are right, I might just implement the parser in Nim, sick of scala, lol
19:15:05leorizethere's already nimyaml, so you got a good starting point :P
19:26:08*gangstacat quit (Ping timeout: 245 seconds)
19:34:16*alexander92 quit (Read error: Connection reset by peer)
19:40:28*gangstacat joined #nim
19:48:40FromGitter<AiguyGary_twitter> @AiguyGary_twitter ⏎ Does anyone have an example of declaring an anonymous procedure (no name just address) saving a procedure pointer to it to a variable for later execution. I will have thousands of if conditions and will not know until I have matched against them all which function is the best match to execute so I'd like to store the address of the best fit so far in a variable as I progress through the
19:48:40FromGitter... tests. ⏎ I was going to post the question in the forum but even though I have a login it did not seem to be accepting new threads.
19:54:02*narimiran quit (Ping timeout: 240 seconds)
19:57:14Yardanico@AiguyGary_twitter well, there's manual moderation on the forum AFAIK (maybe it changed now, IDK). Check https://play.nim-lang.org/#ix=1Yrx
19:57:16leorize[m]!eval var function = proc (a: int): int = a + 1
19:57:18NimBot<no output>
19:58:05YardanicoAh, sorry, https://play.nim-lang.org/#ix=1Yry
19:58:34rayman22201https://play.nim-lang.org/#ix=1Yrz
19:59:20rayman22201@AiguyGary_twitter ^
19:59:34Yardanicorayman22201: check my example :P
19:59:35rayman22201Yardanico, same thing. You are just a bit faster than me :-P
20:00:22Yardanicorayman22201: although you don't really need to declare {.nimcall.} here I think, and no need for specifying seq type explicitly, but yeah, it's basically the same
20:00:39rayman22201I get an error if I don't specify nimcall
20:01:54rayman22201I think you don't because you don't specify the type of `data`, so Nim just infers the type.
20:02:00Yardanicorayman22201: yeah
20:02:17rayman22201I'm one of those people who likes to be extra explicit and specify all my types :-)
20:06:10FromGitter<AiguyGary_twitter> @yardanico Thanks!
20:08:14*ng0 joined #nim
20:21:45*sealmove quit (Quit: WeeChat 2.6)
20:42:34FromGitter<Lecale> Beginner question to bore y'all with. Is there an option to split strings by a string array, or can i only use by string, by char, by char array?
20:43:01Yardanicowell, there's multiReplace proc
20:43:10Yardanico(from strutils), which probably does what you want
20:43:22Yardanicoah, split
20:46:22FromDiscord<juan_carlos> The `split` of `re` takes a Regex, is easy to make a simple regex from string array.
20:46:22FromGitter<Lecale> I was parsing ply in an sgf file, really lazily. I wanted to split by ;B[ and ;W[ but had to just split by ; instead, which took a whole extra few lines of code
20:46:33*nsf quit (Quit: WeeChat 2.5)
20:47:38YardanicoYou can also try using scanf macro from strscans module
20:48:20FromGitter<Lecale> ok thanks
20:53:44*clyybber joined #nim
21:00:18*nsf joined #nim
21:05:04*superbia left #nim ("WeeChat 2.4")
21:07:48*Ven`` joined #nim
21:32:22*asymptotically quit (Quit: Leaving)
21:35:18*solitudesf quit (Ping timeout: 268 seconds)
21:37:05*Hideki joined #nim
21:41:17*Hideki quit (Ping timeout: 250 seconds)
21:44:25FromDiscord<juan_carlos> Whats the best way to check if string contains a float?. `try: parseFloat("42.0") except:...` ?.
21:46:13*fanta1 joined #nim
21:49:29*Trustable quit (Remote host closed the connection)
22:02:22*clyybber quit (Quit: Quit)
22:24:22*ng0 quit (Quit: Alexa, when is the end of world?)
22:26:09*fanta1 quit (Quit: fanta1)
22:27:13dom96How's everyone doing? Been away for a week, did I miss anything interesting?
22:29:22krux02dom96: I rewrote the json.to macro.
22:29:29krux02PR is still pending, but it is looking good.
22:29:35dom96cool
22:29:42krux02I thought you might be interested since you wrote the original version.
22:30:03dom96yeah, I'll try to take a look
22:30:11dom96Waiting for a flight so not sure how much time I'll have
22:30:16dom96also looking at rayman's PR
22:30:26rayman22201@dom96, check my async PR's if you can. I would appreciate it :-)
22:30:31dom96^^ :)
22:30:41krux02dom96: here is the PR https://github.com/nim-lang/Nim/pull/12391
22:30:46dom96tbh json.to is IMO the wrong approach to serializing in Nim
22:30:51krux02most important change, it is now based on overloads
22:30:54dom96but we're stuck with it now :)
22:31:00krux02not a single all generating macro
22:31:22krux02what is wrong with it?
22:31:51krux02apart from that it is json, I don't see it structurally wrong.
22:32:00krux02maybe the implementation, but that can be changed.
22:32:06krux02(as I did)
22:32:11rayman22201I have a fun bug... when I declare a `{.warning.}` pragma inside a stdlib module, it does not print the warning :/
22:32:22dom96oooh, if you used overloading then that is precisely what I meant
22:32:33dom96well, depends how you did it
22:32:53dom96I've got a thrift package I wrote (not open source) that doesn't use any macros and serialization using it works very nicely
22:33:01dom96it just uses the fields iterator plus some overloading
22:33:18dom96so I was thinking that the JSON `to` would work better if it used the same approach
22:33:21krux02rayman22201, it probably has to do with the fact that many messages from the standard library are prohibited. Pretty annoying if you ask me. It should be to not bother user with internal warning of the standard library, but it also prevents me from actually seeing them in the first place so they can be fixed.
22:34:09krux02yea that is exactly what I did.
22:34:22krux02assignFromJson is the magic proc that is overloaded for everything.
22:34:36rayman22201bah... Puts me in a tough spot... I was trying to redo this PR using a warning instead, but the warning never shows: https://github.com/nim-lang/Nim/pull/12231
22:34:42krux02I just had to to make it work with everything, object, distinct etc.
22:35:35krux02rayman22201, yea you should create an issue report for it.
22:35:43*thomasross_ joined #nim
22:35:43*thomasross quit (Killed (card.freenode.net (Nickname regained by services)))
22:35:43*thomasross_ is now known as thomasross
22:35:47krux02with a nice description of why it is bad the way it is.
22:36:46rayman22201😢 ok
22:37:36krux02thanks
22:41:14krux02dom96: I guess the thrift package doesn't support object variants.
22:45:35*Hideki joined #nim
22:49:12FromDiscord<treeform> I wrote my own json to that does not use macros
22:49:24FromDiscord<treeform> Just the field itarator
22:49:27dom96krux02, it does
22:50:35dom96It seems like your PR also has VM fixes?
22:50:47dom96If so, ideally that should be in a separate PR
22:51:18FromDiscord<speckledlemon> Is there a reason why some procs in `algorithms` can operate on slices, but `sort` can't?
22:54:09FromDiscord<treeform> Field pairs made the json to and from code very clean: https://github.com/treeform/jsutils/blob/de812327fa7dd6cd7851a11932de2ea9d41c71a0/src/jsutils/jsons.nim#L89
22:54:25krux02dom96, no it doesn't have any vm fixes
22:54:54dom96krux02, you've changed parseJson to check for `nimvm`.
22:55:21krux02ah, that's what you mean.
22:55:22dom96treeform: yep, that looks like how I've coded my thrift package
22:55:53*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:55:57krux02well the problem is, on the js target there was some disabled code, even though it was very usable at compile time.
22:56:29FromDiscord<treeform> Dom96, cool I also have a thrift parser. I don't like thrift.
22:56:38krux02dom96, here: https://github.com/nim-lang/Nim/issues/11988
22:56:47dom96treeform: I skipped that part :D
22:56:57dom96treeform: I just implemented the thrift binary protocol
22:57:12dom96and tried to keep things consistent so that in the future I can implement proper thrift
22:57:26dom96for my game serializing and deserializing using the `fields` approach works very well
22:57:42FromDiscord<treeform> I just needed to parse thrift, to get the type info out
22:58:07FromDiscord<treeform> We for some crazy reason store a ton of info in thrift comments
22:58:48FromDiscord<treeform> So I wrote a thrift comment parser.
22:59:01dom96krux02, looks like you've still got quite a bit of macro code in there
22:59:20krux02yep
22:59:23dom96maybe you could follow treeform's example? I think that will result in a much better implementation
22:59:34krux02the macro is basically the fieldPairs iterator
22:59:54FromDiscord<treeform> I did run into isses, generics cand do everything
23:00:15FromDiscord<treeform> Like distinct float types I still can't do
23:01:28krux02dom96: an you give me a link to thrift?
23:03:06krux02I can't find it
23:03:33Araqspeckledlemon: use toOpenArray and then 'sort' can do it too
23:06:55dom96krux02, it's not open sourced
23:09:43shashlickAny suggestions for a library that I should wrap as part of the wrapping article I'm working on?
23:11:06dom96shashlick, have a browse through needed-libraries
23:11:46FromDiscord<speckledlemon> thank you Araq! it works. one more question: is it memory-efficient, or does it do a copy under the hood?
23:12:17Araqit doesn't copy
23:13:42shashlickZevv suggests ffmpeg but it is probably too ambitious
23:13:55FromDiscord<speckledlemon> I'm obviously a beginner...is there a way to know that explicitly from the documentation?
23:15:58Araqhmm toOpenArray doesn't even have any doc comment, so ...
23:18:23disruptekshashlick: lz4
23:18:36disruptekor pigz
23:18:50disruptekor zstd
23:19:25shashlickCould then add those to nimarchive
23:19:32disruptekthat's the idea.
23:24:36*laaron joined #nim
23:29:26*laaron quit (Client Quit)
23:30:04*laaron joined #nim
23:32:13shashlickSneaky, but that's why I was thinking libssh2 since nimgit2 can get ssh support
23:32:26*krux02_ joined #nim
23:33:12disruptekthing is, libssh2 will probably be pretty challenging. i guess you can start off with it and if the going gets rough, abandon plans to document the process.
23:33:39disrupteki just see it as being burdensome from a x-platform angle.
23:34:49*krux02 quit (Ping timeout: 250 seconds)
23:36:22*luis_ joined #nim
23:38:48*luis_ quit (Remote host closed the connection)
23:39:16*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
23:39:35*laaron- joined #nim
23:40:49*laaron- quit (Client Quit)
23:41:19*laaron joined #nim
23:46:30*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
23:46:50*laaron joined #nim
23:48:44*laaron quit (Client Quit)
23:49:07*Hideki quit (Ping timeout: 268 seconds)
23:50:37*laaron joined #nim
23:55:32*stefantalpalaru quit (Quit: stefantalpalaru)