<< 14-04-2020 >>

00:00:56leorizethanks
00:01:20dadadawhat's with the [m] ?
00:02:10FromGitter<zetashift> specifies that the user is using Matrix I think
00:02:24dadadaah
00:02:31*dadada is now known as dadada[irssi]
00:02:51dadada[irssi]hereby I specified
00:02:55*dadada[irssi] is now known as dadada
00:03:09dadada:-)
00:03:16FromGitter<zetashift> vscode is so damn slow with the vim plugin damnit
00:03:26dadadazetashift: vim or nvim?
00:03:28Cadeywelcome to why i use emacs
00:03:45dadadazetashift: there's a native neovim plugin for vscode, but I haven't tried it
00:03:54FromGitter<zetashift> @Cadey I love me some spacemacs but Nim support is the only thing stopping me :(
00:04:04FromGitter<zetashift> or well doom-emacs
00:04:22FromGitter<zetashift> dadada it's still kind of slow
00:04:34*dwdv quit (Ping timeout: 240 seconds)
00:04:53dadadalove emacs for elisp, but vscode is not too shaby, considering how young the project is, will be exciting to see where it is in a few years
00:05:08FromGitter<zetashift> VSCode is nice and it runs a lot smoother without the vim plugin
00:05:21FromGitter<zetashift> But I can't go back to normal keybindings now D:
00:05:50dadadazetashift: me neither, I haven't noticed much of the slowness
00:08:11*MightyJoe joined #nim
00:09:34*cyraxjoe quit (Ping timeout: 256 seconds)
00:12:00*videofile quit (Quit: Going offline, see ya! (www.adiirc.com))
00:12:28dadadahttps://github.com/fox0430/moe
00:12:39dadadahas anyone here used this?
00:14:06dadadathe project has high activity
00:17:03FromGitter<zetashift> I have not for command line I usually use vi or nano
00:17:28FromGitter<zetashift> Nim does not have a flatten proc for collections?
00:18:37*cyraxjoe joined #nim
00:20:37*MightyJoe quit (Ping timeout: 264 seconds)
00:35:48leorize@zetashift: too bad neovim is unstable on windows :P
00:38:03leorizeave you tried that plugin that turns vscode into a neovim frontend?
00:39:54FromDiscord<Avatarfighter> I have a stupid question for you guys, what would be the equivalent to a cpp "define" in nim would it be const?
00:41:10leorizetechnically we don't have anything like that
00:41:17leorizebut usually you'd mean `const`
00:42:09FromGitter<awr1> i use emacs but with nimsuggest disabled
00:42:17FromDiscord<Avatarfighter> I didn't think there was a direct equivalent so I've just been using "const" for the time being lol
00:42:19FromGitter<awr1> it's been broken for some time
00:43:05leorize@Avatarfighter: ah, template is pretty much the equivalent
00:43:13leorizeactually templates are much much more powerful
00:43:27leorizebut for your use case then `const` is what you want I think
00:44:11FromGitter<awr1> Templates are a smarter version of C macros
00:44:36FromGitter<awr1> e.g. they're hygenic by default (which you can disable with `{.dirty.}`)
00:45:01FromDiscord<Varriount> Hm, what is the most intuitive behavior for `split(<empty string>, <empty separator string>)`?
00:45:09FromGitter<awr1> and they are typechecked
00:45:37FromGitter<awr1> @Varriount return empty string
00:45:40leorize@Varriount: empty seq
00:45:48FromGitter<awr1> i mean empty seq yeah
00:45:49leorizeor a seq with one empty string
00:46:08leorizeyea seq with one empty string is better
00:46:13FromDiscord<Varriount> Because the implementation in strutils just returns an (infinite) stream of empty strings (it's an iterator)
00:46:36FromDiscord<Varriount> Which somewhat caught me off guard.
00:46:47FromGitter<awr1> sounds like a bug
00:46:51leorizenow that's a bug
00:47:20FromDiscord<Varriount> And what do you think the behavior should be for `split(<a non-empty string>, <empty separator string>)`?
00:47:37FromGitter<awr1> one seq containing the whole strin
00:47:37FromGitter<awr1> g
00:47:39leorize[m]depends on who you ask
00:47:48FromGitter<awr1> *seq with one element containing just the original string
00:48:16FromDiscord<Varriount> Python and Java at least appear to raise an exception. Go splits the string into UTF-8 runes. I don't know what C# does.
00:48:19leorize[m]either that ^ or seq containing every character (this is a pcre thing)
00:48:23leorize[m]iirc we actually have an issue debating this
00:49:30FromDiscord<Varriount> Do you interpret `''` as "containing no matching separators", or "matching between every character"?
00:49:46leorizeI interpret it as the former
00:53:24FromDiscord<Varriount> I somewhat favor the idea of raising an exception, because it's clearly ambiguous enough to cause discussions.
00:54:26leorize[m]you can PR it and we can discuss there
00:58:10*zacharycarter joined #nim
00:59:04PrestigeHm I think I agree with leorize[m] here
00:59:36FromDiscord<Varriount> leorize: It would break backwards compatibility, so I won't propose it.
01:01:08*MightyJoe joined #nim
01:02:55*cyraxjoe quit (Ping timeout: 258 seconds)
01:03:28leorize[m]with the `--useVersion` thing it's not too bad anymore
01:05:58leorize[m]though you should fix the infinite loop problem
01:06:21*cyraxjoe joined #nim
01:07:51*MightyJoe quit (Ping timeout: 250 seconds)
01:08:29*chemist69_ joined #nim
01:11:19*chemist69 quit (Ping timeout: 250 seconds)
01:18:58shashlickawr1: just pushed a fix for nimterop#172
01:22:06FromGitter<zetashift> Anybody got some tips for me making this type definition less shitty: https://play.nim-lang.org/#ix=2hWT ?
01:27:29*krux02 quit (Remote host closed the connection)
01:28:14*lritter quit (Ping timeout: 240 seconds)
01:29:01*icebattle quit (Ping timeout: 264 seconds)
01:29:10*lritter joined #nim
01:40:34*rockcavera quit (Read error: Connection reset by peer)
01:40:52*rockcavera joined #nim
01:40:52*rockcavera quit (Changing host)
01:40:52*rockcavera joined #nim
01:57:07*Tlongir joined #nim
01:57:47*ftsf joined #nim
01:58:38ftsfhi, has anyone got an example of how to use htmlgen in a more complete way? the examples in https://nim-lang.org/docs/htmlgen.html are super minimal.
02:02:58FromGitter<zetashift> like the docs says aren't you better off using Karax then, it has more examples too?
02:04:10ftsf"Note: The Karax project (nimble install karax) has a better way to achieve the same, see https://github.com/pragmagic/karax/blob/master/tests/nativehtmlgen.nim for an example.
02:04:11ftsf" hmm seems to suggest it's a better way of importing some things, not how to use. I'm not sure what karax is, but if it obsoletes htmlgen it should probably say that.
02:05:23ftsfseems like karax is a lot bigger than htmlgen
02:06:11FromGitter<zetashift> @ftsf : https://forum.nim-lang.org/t/5851 see araq's response
02:06:20FromGitter<zetashift> oh fuck I hope I didn't ping him
02:06:52*zacharycarter quit (Ping timeout: 256 seconds)
02:07:18ftsfzetashift, thanks
02:07:47FromGitter<zetashift> yea karax is bigger but I don't think it'll hurt if you only focus on the htmlgen part
02:08:32FromGitter<zetashift> I don't know htmlgen so I'd still wait for a second opinion on using htmlgen
02:09:06ftsfok, htmlgen seems more what i'm looking for, but i'm not really sure how to get started with it other than the examples given where it's pretty much a single tag in isolatin,
02:11:02*Guest85 quit (Quit: My Mac Pro has gone to sleep. ZZZzzz…)
02:11:36*zacharycarter joined #nim
02:13:42FromGitter<zetashift> I can't find the test suite for htmlgen
02:16:40*endragor joined #nim
02:21:12FromDiscord<Gary M> I'm pulling my hair out trying to figure out a way to interface with a large C++ library, or at least with a C API.
02:21:48FromDiscord<Gary M> and trying to do so with a dynamic linked library
02:23:21*MightyJoe joined #nim
02:24:54*cyraxjoe quit (Ping timeout: 240 seconds)
02:25:26*muffindrake quit (Ping timeout: 265 seconds)
02:26:05*waleee-cl quit (Quit: Connection closed for inactivity)
02:27:14*muffindrake joined #nim
02:43:19FromGitter<zetashift> Who knew comparing floats would be this troublesome
02:45:02*audiofile joined #nim
02:45:12FromDiscord<Rika> are you trying to == them?
02:47:42FromGitter<zetashift> yep
02:48:01FromGitter<zetashift> ` (4, [20.0, 22.0, 50.0, 48.0, 44.0, 54.0, 114.0, 108.0, 40.0, 58.0, 110.0, 102.0, ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ 0, 108.0, 40.0, 58.0, 110.0, 102.0, 16.0, 26.0, 46.0, 42.0]) ` [https://gitter.im/nim-lang/Nim?at=5e952461c52b6a38abe4412d]
02:48:30FromGitter<zetashift> that errors out for me, but I have a separate test for equality ( == ) that runs fine
02:49:16FromDiscord<Rika> never do == for floats, you ofc need a ~= operator
02:49:24FromDiscord<Rika> well i assume you already do
02:50:38FromGitter<zetashift> I mean I have an operator `==` defined that calls a proc named `equal(a, b: float): bool`
02:50:49FromGitter<zetashift> I don't know if that counts I can rename ~=
02:54:12leorize@Gary M unless it's Qt, I'd say it's not too hard
03:00:19*Hexeratops quit (Read error: Connection reset by peer)
03:15:36FromGitter<zetashift> man it wasn't the floats I'm multiplying this array like an idiot
03:16:59*zacharycarter quit (Ping timeout: 250 seconds)
03:22:02*zacharycarter joined #nim
03:28:42FromGitter<zacharycarter> Gary M: as leorize said - shouldn't be that difficult. What are you pulling your hair out over?
03:48:27*nsf joined #nim
04:02:50*rockcavera quit (Remote host closed the connection)
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:07:08*supakeen_ joined #nim
04:32:36*def-- joined #nim
04:34:16*federico3_ joined #nim
04:38:56*Araq_ joined #nim
04:40:19*federico3 quit (*.net *.split)
04:40:20*def- quit (*.net *.split)
04:40:20*Araq quit (*.net *.split)
04:40:33*def-- is now known as def-
04:41:04*zacharycarter quit (Ping timeout: 265 seconds)
04:43:19FromDiscord<Gary M> https://github.com/DiligentGraphics/DiligentEngine
04:43:25FromDiscord<Gary M> This is what I've been looking at.
04:44:01*Mister_Magister quit (Ping timeout: 264 seconds)
04:44:47*cyraxjoe joined #nim
04:46:39*MightyJoe quit (Ping timeout: 260 seconds)
04:46:53FromDiscord<Gary M> I've tried using c2nim and nimterop and nimline but I'm misunderstanding how any of this is done.
04:47:07FromDiscord<Gary M> I'd be happy with doing this manually, but even linking to a dll isn't working
04:48:06*narimiran joined #nim
04:52:54*Mister_Magister joined #nim
04:53:20FromDiscord<Gary M> I just have zero idea of what the proper workflow is for any of this and documentation/guides are very few and far between or outdated.
04:54:10shashlickThat's a big repo, what specifically do you want to use
04:58:28FromDiscord<Gary M> https://github.com/DiligentGraphics/DiligentCore/blob/4c73f2d3fd5305b82d3413ebeab74cc566b57f33/Graphics/GraphicsEngineVulkan/interface/EngineFactoryVk.h
04:58:38FromDiscord<Gary M> here's the Vulkan interface
04:59:56FromDiscord<Gary M> so there's part of the C interface exposed under DILIGENT_C_INTERFACE
05:06:41FromDiscord<Gary M> but it seems like there's a fair number of things I'd have to wrap just to reproduce one of the samples in the samples repo
05:06:49shashlickNimterop might be able to pull it off, have to bed though
05:07:12FromDiscord<Gary M> I did try nimterop but got an error for a missing bash executable
05:07:16shashlickYou can nimble install nimterop and then use toast to wrap it - command line is documented online
05:07:37FromDiscord<Gary M> I have bash with git but it's not seeing that
05:07:41shashlickYou on windows?
05:07:44FromDiscord<Gary M> yes
05:07:57shashlickIf project supports cmake, just install cmake instead
05:08:11shashlickElse make sure git bash is in the path
05:08:33shashlickGit ships with bash.exe
05:08:37FromDiscord<Gary M> Yeah, I made sure it's in the path. It's just not seeing it.
05:08:50shashlickfindExe needs to find it
05:09:22FromDiscord<Gary M> the path to Git\bin is in my User Path
05:12:35*audiofile quit (Quit: Going offline, see ya! (www.adiirc.com))
05:48:13PrestigeIs there a standard way to document procs?
05:49:11ZevvUse double ## after the proc opening
05:49:37PrestigeBut the rest doesn't really matter?
05:49:59PrestigeAlso, same question for wrappers
05:50:24Zevvfor the rest there's no formal rules. There's nothing like javadoc with explicit description of all arguments, for example
05:51:05Zevvbut it all depends on your context. Nim stdlib encourages runnableExample blocks in the docs, for example
05:51:37PrestigeI'm mostly looking at documenting the x11 wrapper
05:53:25ZevvFor pure wrappers often it does not make too much sense to document everything at the proc level, since these are just FFI calls into the originals. It might make sense to just point to the original docs instead.
05:54:41Zevvif I want to call XChangeDeviceKeyMapping from nim x11, I can jus lookup the XChangeDeviceKeyMapping man page, right
05:54:52PrestigeI'm just used to having docs in the editor so I was going to copy the docs over and maybe rename the parameters
05:55:16ZevvThe X11 API is *huge*
05:55:28Prestigeah I didn't know there were man pages, that's handy
05:55:48Zevvsure, for X11 the man pages are the go-to docs
05:56:06Zevvand my editor knows about that. I can just hit a key when the cursor is over a function and it finds the man page for me
06:08:48*supakeen_ is now known as supakeen
06:09:08*supakeen quit (Changing host)
06:09:08*supakeen joined #nim
06:09:18*supakeen quit (Quit: WeeChat 1.9.1)
06:09:41*supakeen joined #nim
06:12:42*PMunch joined #nim
06:15:06*solitudesf joined #nim
06:15:08FromGitter<jfilby> I have a problem with nimble terminating with a SIGILL on Mac: https://github.com/nim-lang/nimble/issues/792
06:15:35FromGitter<jfilby> can anyone advise what to do? it looks like it dies on trying to call an OpenSSL function
06:17:28leorize[m]you need to replace your openssl, maybe
06:19:02FromGitter<jfilby> I have openssl 1.1 which was installed by brew
06:19:17FromGitter<jfilby> so I can look into it, but it should work
06:20:19*silvernode joined #nim
06:27:49*lbart quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
06:28:09*lbart joined #nim
06:39:05*silvernode quit (Ping timeout: 256 seconds)
06:46:19*filcuc joined #nim
06:49:43*leorize quit (Ping timeout: 240 seconds)
06:58:04*couven92 joined #nim
06:58:12*filcuc quit (Ping timeout: 256 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:11*leorize joined #nim
07:04:44*gmpreussner joined #nim
07:09:41*dddddd quit (Ping timeout: 256 seconds)
07:09:55PrestigeFound the proc for bitor, but is there a way to do this to many values (built in)?
07:11:05PrestigeLike if I wanted to or 3 ints, would I just have to invoke bitor multiple times?
07:11:17Araq_a or b or c
07:11:27Prestigeah didn't know about `or`, thanks
07:13:01Araq_'bitor' is the future though :-) and should have/get varargs support
07:13:59Prestigevery neat - I'm really liking this language, have a lot to learn
07:22:53*NimBot joined #nim
07:32:01FromGitter<awr1> wasn't aware `bitor` got added
07:37:45*arecaceae quit (Remote host closed the connection)
07:39:38*arecaceae joined #nim
07:40:35FromGitter<jfilby> fixed my issue... had to specify OpenSSL v1.1 when compiling nimble
07:47:52PrestigeCan you use logic/code blocks to define a variable at run time? e.g. if you had an array of ints you wanted to add together and assign to a variable
07:53:13PrestigeOh you can use a block to do it, that's so cool
07:56:00*natrys joined #nim
07:58:47*jjido joined #nim
08:04:44FromGitter<alehander92> morning.
08:04:49FromGitter<alehander92> how are you guuyys
08:05:13FromGitter<alehander92> ftsf karax can be used to generate it
08:05:18FromGitter<alehander92> using `$` on a vnode
08:06:00FromGitter<alehander92> e.g. something like `$(buildHtml(tdiv()))`
08:06:04FromGitter<alehander92> i guess?
08:07:45PMunchPrestige, some more fun with using code in assignments: https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html
08:08:04PrestigeThanks :)
08:08:55PrestigeI'm looking for a blog post I was reading yesterday, I think about macros.. being able to use something -> "foo"
08:09:01PrestigeCan't remember where I saw it
08:09:15PMunchsomething -> "foo"?
08:10:58PrestigeYeah, maybe I'll run into it later. Was calling a proc to perform something with "foo" as a param
08:11:43*silvernode joined #nim
08:12:35PMunchLike this? https://play.nim-lang.org/#ix=2hY8
08:13:12narimiranhttps://nim-lang.github.io/Nim/sugar.html#->.m%2Cuntyped%2Cuntyped ?
08:13:21PrestigeYeah, exactly
08:14:41PMunchOooh, that syntax :P
08:15:03PMunchThat's to define a proc return type
08:15:09FromGitter<alehander92> nicee
08:15:25PMunchAnd => can be used to create anonymous procedures
08:15:39FromGitter<alehander92> hm, can one pass iterators actually
08:15:58PMunchHuh?
08:16:04FromGitter<alehander92> like, to a function
08:16:12PMunchYou can pass closure iterators
08:16:21FromGitter<alehander92> e.g. `toList[T, U](a: iterator[T]: U)`
08:16:33FromGitter<alehander92> `iterator(t: T): U` probably
08:16:45FromGitter<alehander92> hm, makes sense
08:17:20FromGitter<alehander92> maybe if `toList` was a template it would make sense to pass inline ones
08:19:49PMunchAs in, you can do this: https://play.nim-lang.org/#ix=2hYa
08:20:42PMunchI mean, this also works: https://play.nim-lang.org/#ix=2hYb
08:20:54PMunchNim automatically creates closure iterators in that scenario
08:21:14PMunch(This is how async is implemented by the way)
08:21:35PrestigeInteresting, the example of closure iterators I saw was an iterator that returned another - but just using the closure pragma does that for you?
08:21:48PMunchYes
08:21:54PrestigeDang that's cool
08:22:09PMunchWait, an iterator that returned an iterator?
08:22:27PMunchYou can make a procedure that returns an iterator to create a closure iterator
08:22:38PrestigeAh maybe that was what I saw
08:23:19PrestigeI'll have to dig through the tutorial again
08:23:23PMunch(just by the same logic that the inline iterator I used there is automatically converted to a closure iterator an iterator created within a procedure will also be a closure iterator)
08:25:10FromGitter<alehander92> huhh
08:25:12FromGitter<alehander92> interesting
08:25:19FromGitter<alehander92> so there is a `finished()` function !
08:25:38PMunchYes, it checks if closure iterators are done
08:25:49PMunchCalling the iterator after that will just return the last value
08:25:54FromGitter<alehander92> ah so yeah it turns it to it
08:26:05FromGitter<alehander92> have you used channels btw
08:26:21FromGitter<alehander92> i wonder about one debugging feature for things like them in my job
08:26:35FromGitter<alehander92> and wondered how do people usually use them
08:26:46PMunchYes I have
08:27:54ftsfwill give a karax a try =)
08:27:56PMunchWhat do you mean how people usually use them?
08:27:59FromGitter<alehander92> do people always do `send` `recv` `send`
08:28:10FromGitter<alehander92> or do they like batch many things with several `sends`
08:28:20FromGitter<alehander92> i am not entirely sure how are they idiomatically used
08:28:34PMunchDepends on your usage
08:28:35FromGitter<mytxd> @alehander92 you mean network programming?
08:29:04FromGitter<alehander92> and do people usually know `X channel sends from this line in the code and receives on this line of the code` or do they often get selected/received in many locations (similar to calls)
08:29:16FromGitter<alehander92> @mytxd more like language-level channel primitives
08:29:22FromGitter<alehander92> e.g. something like nim / go channels
08:29:26PMunchWell it really depends on what you use them for
08:29:30FromGitter<mytxd> @alehander92 I get it
08:29:44FromGitter<mytxd> @alehander92 you can impl it by yourself
08:29:54FromGitter<alehander92> yeah but i dont want to
08:30:14FromGitter<alehander92> i don't need them in my code
08:30:19PMunchIf you're doing a producer/consumer pattern where some threads create work and others perform it I would say it's fairly normal to have a single place in either thread where you recv/send
08:30:21FromGitter<alehander92> (maybe)
08:30:34FromGitter<alehander92> ok, great
08:30:51FromGitter<alehander92> (actually i maybe use some, but not the reason for my question :))
08:31:19FromGitter<alehander92> and how do people synchronize stuff without "awaiting"
08:32:09PMunchAnother is of course something like a tree traversal thing where all workers can create more work, then it might be multiple paths to `send` but typically only one `recv` at the start
08:32:36PMunchWhat do you mean? Channels are used with threads, so you don't have await..
08:35:11*krux02 joined #nim
08:39:11*unclechu quit (Quit: killed)
08:39:11*BitPuffin quit (Quit: killed)
08:39:11*Demos[m] quit (Quit: killed)
08:39:11*watzon quit (Quit: killed)
08:39:12*GitterIntegratio quit (Quit: killed)
08:39:13*khanate[m]0 quit (Quit: killed)
08:39:14*k0mpjut0r quit (Quit: killed)
08:39:14*planetis[m] quit (Quit: killed)
08:39:15*tml[m] quit (Quit: killed)
08:39:35*vycb[m] quit (Quit: killed)
08:39:36*sirikon quit (Quit: killed)
08:39:36*dzamo[m] quit (Quit: killed)
08:39:36*reversem3 quit (Quit: killed)
08:39:37*skrylar[m] quit (Quit: killed)
08:39:38*lqdev[m] quit (Quit: killed)
08:40:14*silvernode quit (Ping timeout: 240 seconds)
08:42:42FromGitter<alehander92> ok, so
08:43:12FromGitter<alehander92> yeah, you just wait and let the `os` schedule everything
08:43:41PMunchPretty much
08:43:46FromGitter<alehander92> and with fibers
08:43:53FromGitter<alehander92> you just wait for your own language runtime to do so
08:44:13PMunchYeah
08:44:13*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:44:17Araq_PMunch, if you think it helps nimlsp, we can add it to Nim like we integrate Z3
08:44:46PMunchSure, as long as I can still push to it
08:47:56Zevvleorize[m]: Yeah, sorry. I think I asked this before but not sure: would it be possbile to '*' and '#' to the next occurence of an identifier, properly handling style-insensitiveness?
08:48:02*Araq_ is now known as Araq
08:48:23ZevvI find I use that a lot, but when navigating code that is not strict that misses occurences
08:53:07*Demos[m] joined #nim
08:56:04PMunchBy the way alehander92, fibers/coroutines cooperatively scheduled like async
09:00:18FromGitter<alehander92> yes indeed
09:02:59FromGitter<alehander92> so how do people synchrronize fibers?
09:03:24PMunchPretty much the same way you do with async
09:04:12FromGitter<alehander92> so you can "wait" for them?
09:04:25FromGitter<alehander92> that's what tips me off
09:04:43PMunchYes
09:05:07PMunchSee for example Go's WaitGroup
09:05:21PMunchThat allows you to wait for multiple goroutines to finish
09:06:25*liblq-dev joined #nim
09:13:20PMunchHmm, would be nice to have something like Go's select in Nim
09:13:55dom96definitely, someone "just" needs to implement it :)
09:14:00PMunchHaha
09:15:12*dwdv joined #nim
09:21:21Yardanicois it better to use `.add` or `&=` when adding stuff to a string variable?
09:21:32YardanicoI almost always used &= but maybe that's wrong 🤔
09:21:34dom96.add
09:22:37YardanicoI guess because &= will create a new string and concat two of my strings, and .add will add a string to an existing one so less allocations?
09:22:55dom96no, both are the same
09:23:04dom96it's just that .add has been around for longer and so I consider it more idiomatic
09:23:15Yardanicoah ok
09:25:14FromGitter<alehander92> and its more "generic"
09:25:31FromGitter<alehander92> as you use `add` for e.g. seq
09:26:13Yardanicotime to replace &= with .add in all code I have :P
09:27:06*Trustable joined #nim
09:27:09PMunchdom96, got any better way of doing it than this? http://ix.io/2hYA
09:29:44Araq &= is more flexible as it also supports files and sockets too iirc
09:30:29dom96lol, I remember arguing against allowing that, and I still hold that view
09:30:35zedeusmaybe a silly rule but personally I use &= for strings and .add for seqs, feels natural to me
09:30:37dom96PMunch, hrm, not sure
09:30:56Yardaniconever knew there's &= for sockets :D
09:31:05dom96just use `send` please
09:31:18PMunchSo it would look something like this: https://play.nim-lang.org/#ix=2hYG
09:32:24PMunchzedeus, I follow the same "rule"
09:32:40PMunchdom96, that link was for you
09:33:30PMunchI'm not too stoked about having the completed sequence, but deleting things from a sequence is tricky..
09:33:49PMunchI guess I could have a set of indexes for the completed futures..
09:34:36liblq-devdom96: agreed, operators look weird
09:34:41liblq-devfor IO
09:34:41*jjido joined #nim
09:35:12FromGitter<awr1> I prefer `&=`
09:35:24FromGitter<alehander92> you just reassign
09:35:33FromGitter<alehander92> futures to futures[1..^1] should be quick and safe imo
09:35:55FromGitter<alehander92> ah nvm sorry
09:36:05FromGitter<alehander92> i didnt see you delete those on each cycle anyway
09:36:44FromGitter<awr1> idk how to put it but denoting such a common operation with an operator sigil helps for readability
09:36:58PMunchThere dom96, I like this solution better: https://play.nim-lang.org/#ix=2hYP
09:37:29PMunchAlthough it will go through all the futures even though they are completed..
09:37:42*BitPuffin joined #nim
09:37:42*khanate[m]0 joined #nim
09:37:42*GitterIntegratio joined #nim
09:37:42*lqdev[m] joined #nim
09:37:42*k0mpjut0r joined #nim
09:37:42*reversem3 joined #nim
09:37:42*tml[m] joined #nim
09:37:42*unclechu joined #nim
09:37:42*watzon joined #nim
09:37:48*sirikon joined #nim
09:37:48*vycb[m] joined #nim
09:37:48*planetis[m] joined #nim
09:37:48*dzamo[m] joined #nim
09:37:49*skrylar[m] joined #nim
09:37:56liblq-devholy moly
09:38:14liblq-devWelcome to Matrix™, I guess
09:38:17dom96PMunch, shouldn't this `select` work inside async procs not outside them?
09:38:32dom96liblq-dev, why I don't use matrix :P
09:38:47PMunchHmm, I guess..
09:38:57liblq-devdom96: I stopped using matrix because of its horribly high latency (at least on the official homeserver)
09:39:05liblq-devIRC feels sooooo snappy
09:39:07PMunchWhat I'm doing should be called something like waitSelect
09:39:20Yardanicoliblq-dev: well matrix bridge on freenode is written in nodejs :P
09:39:21FromGitter<Clyybber> @timotheecour Damn good job on https://github.com/nim-lang/Nim/pull/13976 !
09:39:46Yardanicohttps://github.com/matrix-org/matrix-appservice-irc
09:39:47liblq-devYardanico: that's why it's so horrible.
09:39:57FromGitter<Clyybber> I wanted to fix that bug too, but I was under the assumption that sigmatch relies on this mutation to work
09:40:02liblq-devrewrite it in Nim, problem's gone.
09:40:04FromGitter<Clyybber> Good to see thats not actually the case
09:40:22FromGitter<alehander92> PMunch love it
09:40:40FromGitter<alehander92> can i use something like this example to test my async stepping
09:41:48FromGitter<Clyybber> @timotheecour It should fix https://github.com/nim-lang/Nim/issues/12713 too afaict
09:42:17*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:42:33PMunchalehander92, yeah, that's what I wanted it for :P
09:43:50PMunchHmm..
09:43:56PMunchCan I inject a block label?
09:44:50PMunchI want to be able to break out of the select statement before all the futures complete
09:50:25FromGitter<alehander92> hm, are you modelling it after the go select: i also looked at go/crystal goroutine/fibers
09:50:35FromGitter<alehander92> thanks for the explanations PMunch
09:50:47PMunchKinda
09:51:13PMunchThe go select has a case statement kind of syntax
09:51:25PMunchHmm, I guess I should do that instead..
09:52:25FromGitter<alehander92> but do you need to do `of fut1:`
09:53:48PMunchYeah that would be how it would work
09:53:58FromGitter<alehander92> how would you make it fast
09:54:06PMunchWhat do you mean?
09:57:17PMunchHmm, can't you make a template that uses await?
09:58:17*ryan_ joined #nim
09:59:07YardanicoPMunch: you mean with current async implementation?
09:59:15PMunchYes
09:59:21Yardanicohttps://github.com/nim-lang/Nim/pull/12085
10:00:10FromDiscord<kodkuce> am i retarded cuz i cant get simple sort to work
10:00:11FromDiscord<kodkuce> https://play.nim-lang.org/#ix=2hZ3
10:00:40Yardanico@kodkuce .sort is in-place
10:00:40*Tlongir quit (Ping timeout: 256 seconds)
10:00:49Yardanicoit modified the original variable and doesn't return anything
10:00:49PMunchAh..
10:01:03FromDiscord<kodkuce> oh
10:01:04Yardanicoif you want it to return instead, use "sorted" instead
10:02:09PMunchI really dislike the pattern of rewriting idents in a macro.. Good that async will (hopefully) get this fix soon.
10:02:19FromDiscord<kodkuce> yep that kinda solved it, tought error "ambiguous" i was thinking i am pasing wrong args whole time
10:03:18Yardanicowell it says "no type"
10:03:44Yardanicoso you're trying to assign something which has no type (because sort procedure doesn't return anything) to a variable
10:06:36Yardanicoalso it helps when you know a lot of stdlib :P
10:08:29*neceve joined #nim
10:14:34PMunchHmm, why do callbacks to async procedures need to be gcsafe?
10:20:01FromGitter<alehander92> PMunch yes, i can fix this tomorrow
10:20:13FromGitter<alehander92> i am using a version of it from a long time in our codebase
10:21:14FromGitter<alehander92> good thing is one can add "no waitFor in async" after that
10:21:20FromGitter<alehander92> maybe
10:23:15PMunchdom96, not quite as pretty, but was it something like this you had in mind? https://play.nim-lang.org/#ix=2hZe
10:23:49dom96I suppose
10:24:07PMunchalehander92, why would you disallow that?
10:24:12dom96tbh I don't really see what I would use `select` for :)
10:24:34YardanicoI wonder if we'll be able to use threads GC'd memory with async with --gc:ard
10:24:37Yardanico*arc
10:24:51PMunchRead multiple files and start processing them as soon as any of them are read?
10:24:53YardanicoI mean using global GC variables with threads and async or something like that with arc
10:25:16PMunchI guess adding callbacks to them would work as well
10:25:20PMunchBut eh..
10:27:11*lritter quit (Ping timeout: 258 seconds)
10:27:14PMunchIt's a bit annoying that `of` can't be used without a case. Would be cool for macros
10:29:19*abm joined #nim
10:29:25FromGitter<alehander92> PMunch because .. its a bad idea?
10:29:28FromGitter<alehander92> async shouldn't block
10:29:53FromGitter<alehander92> https://github.com/nim-lang/Nim/issues/11911
10:30:10PMunchWell, just because it's a bad idea doesn't mean it doesn't have some use-case..
10:30:27PMunchA warning sure, but just making it an error seems a bit too much
10:30:29FromGitter<alehander92> i think we argued about that before :P but i might misremember
10:30:52PMunchHaha, yes this does ring a bell
10:31:06FromGitter<alehander92> also https://forum.nim-lang.org/t/3920
10:31:18FromGitter<alehander92> i dont know, people ignore warnings easily
10:31:40FromGitter<alehander92> they have their place, but sometimes i enjoy go's idea of "no warnings only errors"
10:32:57FromGitter<alehander92> i'd say an error for waitFor and if really needed an escape hatch which always produces a warning might be nice
10:34:03PMunchYeah that would be fine
10:34:24PMunchI just feel like if it isn't something that would break anything it should be possible to do
10:35:28FromGitter<alehander92> it breaks a basic assumption of how async is used
10:36:52PMunchWell yes, but it doesn't break the code
10:37:01FromGitter<alehander92> but it can break code
10:37:14FromGitter<alehander92> it can lead to hard to diagnose weird behaviors
10:37:19PMunchOh, for sure
10:37:38PMunchBut it won't cause asyncdispatch to crash for example
10:37:39FromDiscord<Rika> You can say that for many things can't you
10:37:54FromGitter<alehander92> iirc i had some of those problems exactly because i thought waitFor is a good workaround
10:37:59PMunchMaybe my use-case requires some weird behaviour
10:38:18FromGitter<alehander92> and finally i managed to use await: it took some pain, but i am happy about it now
10:38:39FromGitter<alehander92> do you have a usecase where you can only use waitFor ? very interested in any such case
10:38:54PMunchCan't think of anything off the top of my head
10:42:16FromGitter<alehander92> i have to admit i cant think of an obvious example of waitFor breaking code
10:42:21FromGitter<alehander92> but i'll try these days :PO
10:42:33FromGitter<alehander92> breaking expectations maybe8
10:43:16dom96alehander92: agree with you 100%
10:43:24dom96we need to disallow waitFor in async contexts
10:44:13Yardanicowait why people use waitFor in async anyway?
10:45:29*xet7 quit (Read error: Connection reset by peer)
10:46:05*xet7 joined #nim
10:51:38*Vladar joined #nim
10:55:47*xet7 quit (Ping timeout: 260 seconds)
11:00:14*xet7 joined #nim
11:03:12*waleee-cl joined #nim
11:03:44stefantalpalaruTo run the event loop until a certain future is finished: https://github.com/nim-lang/Nim/blob/1e3bdf04d8db35f4ec6c697f0bb812d9903d1368/lib/pure/asyncdispatch.nim#L1883
11:07:54dom96Sure, but why would you want to run the event loop from inside the event loop?
11:16:03FromGitter<faulander> howdy ho guys. anybody know what a benc list is? From an RPC Documents: qa JSON array is equivalent to a benc list, a JSON object is equivalent to a benc dictionary, and a JSON object's keys are the dictionary's string keys.q
11:16:56Yardanicowhere is that from?
11:16:59Yardanicoseems to be context-dependent
11:17:05Yardanicomaybe byte-encoded? just a wild guess
11:17:26FromGitter<faulander> "The JSON terminology in RFC 4627 is used."
11:17:43Yardanicothat RFC doesn't mention benc
11:18:16YardanicoErlang BEncode ?
11:18:19Yardanicoseems so
11:18:23FromGitter<faulander> it's here: https://github.com/transmission/transmission/blob/master/extras/rpc-spec.txt
11:18:27Yardanicoyeah I found that
11:18:30FromDiscord<Recruit_main707> leorize, you told me i could create a static sequence of strings, how would i do it?
11:18:31Yardanicoit's BEncode
11:18:32FromGitter<faulander> in 1.1
11:18:38Yardanicohttps://github.com/jlouis/benc
11:18:42Yardanicohttps://github.com/notpeter/benc
11:19:41FromGitter<faulander> so i have to write a bencoder/decoder in nim aswell ... i thought my nim-transmission library would be easy to do :)
11:19:58*hipoint-yc9 quit (Killed (Sigyn (Stay safe off irc)))
11:20:05FromGitter<alehander92> huh i have written bencode libs
11:20:22FromGitter<alehander92> in elixir
11:20:41FromGitter<alehander92> it seems as a common thing to do there, i had bad reasons tho :(
11:22:32FromGitter<faulander> @alehander92 so you want to convert it to nim? :)
11:23:19FromGitter<alehander92> no, i dont like torrent tech anymore
11:25:05FromGitter<faulander> the rpc specs say: " JSON is fairly common now, but for the benefit of ⏎ torrent developers familiar with benc: ⏎ a JSON array is equivalent to a benc list, ⏎ a JSON object is equivalent to a benc dictionary, ⏎ and a JSON object's keys are the dictionary's string keys." ... [https://gitter.im/nim-lang/Nim?at=5e959d91e24b4d6c4408fe38]
11:26:17*xcm quit (Killed (livingstone.freenode.net (Nickname regained by services)))
11:26:31FromGitter<Yardanico> no, it doesn't say so
11:27:00Yardanicoit just means that benc is fairly similar to JSON in usage
11:28:07*xcm joined #nim
11:28:19FromGitter<faulander> ok, thats a language issue. my english is pretty good, but sometimes i am not sure.
11:28:41FromDiscord<Recruit_main707> can i cast an string into an static strning??
11:28:56Yardanicouhh
11:29:02Yardanicois that an "x y" problem?
11:29:05Yardanicowhy do you want to do that?
11:29:25Yardanicoa static string is a string known at compiletime and you specify that type if you want to ensure that a proc/macro/etc gets a string which is known at compile-time
11:29:29FromDiscord<Recruit_main707> cImport wants an static string, and i want to automate it a bit
11:31:14YardanicocImport is a macro
11:31:25FromDiscord<Recruit_main707> yep
11:31:29Yardanicoand it needs that string at compile-time
11:31:30Yardaniconot runtime
11:31:35FromGitter<alehander92> @dom96 stefantalpalaru PMunch is right
11:31:54FromDiscord<Recruit_main707> Yaradinco: cant i do it then?
11:32:14FromDiscord<Recruit_main707> creating a const array?
11:32:22Yardanicoidk, try
11:32:30Yardanicobut is it worth the effort?
11:33:03FromDiscord<Recruit_main707> not at all probably :P my lazyness is what makes me work for some reason
11:36:13FromGitter<alehander92> @dom96 stefantalpalaru PMunch we do need an example of valid usecase waitFor
11:36:19FromGitter<alehander92> before going with that error
11:36:32FromGitter<alehander92> i think i remember discussing with someone (zah?) if we need waitFor at all
11:36:47FromGitter<alehander92> if you think about it, with the proposed error, one would use waitFor asyncCall only in sync mode
11:36:53FromGitter<alehander92> and await asyncCall only in async mode
11:37:04FromGitter<alehander92> then why not just use the same name
11:37:15PMunchMy point is that we don't need a valid usecase, but that we shouldn't explicitly disallow things just because we can't think of a usecase for them..
11:37:19FromGitter<alehander92> `await asyncCall` everywhere and do the corresponding thing
11:38:27FromGitter<alehander92> PMunch that's not true, at the very least having un-useful choice is a bad thing
11:38:38PMunchThat would definitely lead to errors with the current implementation..
11:38:40FromGitter<alehander92> why does one need to choose between waitFor, await, discard, asyncCheck
11:38:58FromGitter<alehander92> it doesnt make sense to offer so many "keywords" for only 2 possible cases
11:39:02PMunchThe async as template PR must be merged for that
11:39:10FromGitter<alehander92> you either wait or you start it in the background
11:39:43FromGitter<alehander92> you can combine waitFor and await into just `await` overloaded differently in sync and in async
11:39:46PMunchSo you want to default have the asyncCheck callback, and then overwrite it if you await it?
11:40:05FromGitter<alehander92> and discard future/asyncCheck future to just asyncCheck
11:40:27FromGitter<alehander92> no, i want to also disable `discard future` inside `async`
11:41:26FromGitter<alehander92> so e.g. your programs just do ⏎ proc run {.async.} = await stuff(); # toplevel => ; await run()
11:41:30stefantalpalarualehander92: https://github.com/status-im/nim-beacon-chain/search?q=waitfor&unscoped_q=waitfor
11:42:02FromGitter<alehander92> stefantalpalaru i am talking about waitFor inside `async`
11:43:18FromGitter<alehander92> basically the point is that the existence of both `waitFor` and `await` keywords is a problem as it creates the artificial "what if i use waitFor inside `{.async.}` situation
11:44:14FromGitter<alehander92> and they could just be the same keyword with different overloads in both contexts
11:44:37FromGitter<faulander> i have found a c implementation of bencode here: https://github.com/transmission-remote-gtk/transmission-remote-gtk/blob/master/src/bencode.c ⏎ how would i include that in my program?
11:44:56FromGitter<alehander92> (but i guess then this would be confusing because people expect `await` only in async .)
11:45:44FromGitter<faulander> sorry, but i am a complete newbie when it comes to compiling and dealing with c code.
11:57:06FromDiscord<Rika> im up for a warning for waitFor, but not an error
11:58:02FromDiscord<Rika> an error sounds too extreme, and if people wanted it to error, they'd set the warning into error anyway
11:58:41FromGitter<alehander92> sorry, but you can have a warning for 1 & @[2] using that logic
11:59:35FromGitter<alehander92> the default for many things should be an error, and if there is an escape hatch, users should opt-in to use that/to turn the error into warning
12:00:42FromGitter<alehander92> turning X into Y requires work and time and its basically a roadblock
12:01:11FromGitter<alehander92> you should put roadblocks for people when they try to escape errors, not when they try to get those
12:01:39FromGitter<alehander92> (of course backward compat changes everything :D )
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:45*supakeen joined #nim
12:08:15*zyklon quit (Ping timeout: 250 seconds)
12:11:30*dadada quit (Ping timeout: 256 seconds)
12:11:31*liblq-dev quit (Read error: Connection reset by peer)
12:13:08*dadada joined #nim
12:13:30*dadada is now known as Guest15541
12:14:38*bra-ket joined #nim
12:17:33*hipoint-yc9 joined #nim
12:18:18dom96alehander92: yeah, to be honest it's good that this is called out: that you cannot use await outside {.async.} because then it would be more confusing
12:18:46dom96and yeah, `waitFor` inside async should be an error
12:18:55dom96not a warning
12:19:05dom96You should never block inside an async proc
12:20:15*Guest15541 is now known as dadada
12:20:22dadadahey
12:20:32Yardanicohallo
12:21:04FromGitter<alehander92> @dom96 yeah
12:21:35FromGitter<alehander92> i also want to find a way to detect stuff like blocking syscalls inside async
12:21:49dadadawhy do unittest unittests default to success? Isn't that illogical? An empty test being successful? Shouldn't there always be a check() or something to that liking be required be successful before a test as a whole can be?
12:21:51FromGitter<alehander92> it almost seems to be workable with tags
12:22:05dadadas/be/to be
12:22:55FromGitter<alehander92> well, maybe its a bit like a `SKIP` test
12:23:05FromDiscord<Rika> `You should never block inside an async proc` (disclaimer: im kidding) so are we banning all non-async procs in async procs too now?
12:24:14dom96Rika: not all non-async procs block
12:24:26dom96if we could annotate the ones that do then yes, banning them would be ideal
12:24:41dom96(and I have considered doing this using the effect system, it's just a lot of effort)
12:24:46*dddddd joined #nim
12:25:15dom96regarding `asyncCheck` too, we should get rid of it, I also considered what alehander92 suggested: to make it implicit. IIRC there were some blockers for that
12:26:44FromGitter<alehander92> @dom96 yeah exactly, but we can add a bit to the tags system, so it becomes quite easy
12:27:03FromGitter<alehander92> to annotate something like `{.tags: [not Blocking].}`
12:27:16Yardanicoyeah, we already have IO tags
12:27:26FromGitter<alehander92> the problem is different imo
12:27:36FromGitter<alehander92> we need to be able to check for the absense of tags
12:27:43FromGitter<alehander92> not to have to write down all found ones
12:27:50FromGitter<alehander92> in all cases
12:28:04FromGitter<alehander92> iirc Araq thought `not tag` might be ok to add
12:28:13dom96if you do that then you'll end up needing to annotate a lot of procs which are just doing CPU work
12:28:22dom96indeed, what Yardanico said, we may be able to reuse IO tags
12:28:30FromGitter<alehander92> but we still need `not`
12:28:40FromGitter<alehander92> because otherwise you need to annotate all other effects
12:28:43dadadauh, are tags a new Nim feature? :-)
12:28:44dom96yeah, the effects/exception tracking system always needed this expansion
12:28:45FromGitter<alehander92> which often people dont care about
12:28:55FromGitter<alehander92> in their own code
12:29:06dom96I've always wanted to be able to state "raises anything but MyExceptionType"
12:30:14FromGitter<alehander92> about the cpu work: that's very true, and it would be perfect if was possible to somehow annotate on base of some kind of limit (e.g. this function call costs "X", i want my async-s to call only up to Y)
12:30:18FromDiscord<Rika> `if we could annotate the ones that do then yes, banning them would be ideal` if only the halting problem were solvable 😛
12:30:27FromGitter<alehander92> but this is very very far for now
12:30:46dadadaif Nim didn't use # for comments, given that this symbol is known as hashtag all around and generally used for tagging things, we could #notblocking , which would be a lot of shorter (and IMO better looking)
12:30:51dom96Rika: we're talking about IO here, not CPU taking forever
12:31:00FromDiscord<Rika> hey, im still joking
12:31:25dom96dadada, let's not derail into a syntax discussion :)
12:31:42FromGitter<alehander92> at least the cpu taking forever ones are probably easy to detect/debug
12:32:32FromGitter<alehander92> and indeed one can move that to profile-like tools: "report all sync calls taking >x ms in async functions"
12:32:54FromDiscord<Skaruts> is there not a proc to empty a sequence?
12:33:04dadadadom96: I'm sorry, for derailing
12:33:27FromGitter<alehander92> and finally one can always add a `Blocking` or `CPUHeavy` tag for his own function that does a lot of calculations etc
12:33:39FromGitter<alehander92> if e.g. he wants it to be forced in another thread
12:33:44FromDiscord<Skaruts> or maybe simply doing `a = newSeq[T]()` will be enough?
12:34:07dadadas/of shorter/sharter
12:34:11dom96Skaruts: you can setLen(0) on the seq or just assign @[] to it
12:34:12dadadashoter
12:34:13FromGitter<alehander92> @dom96 hm the `raises but` seems interesting
12:34:17FromDiscord<Rika> setlen is better
12:34:20dadadashorter .. what's up with my typing skills
12:34:25FromDiscord<Skaruts> ah thanks
12:34:31FromDiscord<Skaruts> didn't think of that
12:34:49FromDiscord<Skaruts> (didn't know about setLength either)
12:34:49dom96alehander92: let's lobby Araq to make it happen :)
12:35:52FromGitter<alehander92> @dom96 i am ok with that, (i have to admit i start to like result types more and more tho :P)
12:36:02FromGitter<alehander92> but we push for `not tag` as well :P
12:39:02FromDiscord<Recruit_main707> shashlick: i have an issue with nimterop, i wrote it in gitter
12:39:23AraqIMHO we should use the type system to encourage correctness and profilers to encourage efficiency
12:39:45dom96tags are part of the type system :)
12:40:34Araqand in my code a[i] can be "blocking" and yet I don't want to write 'await a[i]', go figure
12:42:40dom96the purpose of this is to know that something is blocking
12:43:04dom96it would be a very useful feature and of course we can make it possible to disable it if you just don't care
12:44:58Yardanicojust fyi (I don't feel this is a better approach, but still) - zig chose to enable/disable async "globally"
12:45:17Yardanicoif you enable async in your app everything in stdlib (where possible) will be used in async mode
12:46:20Yardanicobut of course async in zig is implemented in the compiler :)
12:46:56FromGitter<alehander92> Araq well we wouldn't annotate stuff like `a[i]` as blocking
12:47:16*tane joined #nim
12:47:35FromGitter<alehander92> its more about a limited set of known calls+codebase-specific calls which every user can decide on himself
12:49:25dom96It's about annotating things like Socket.send as blocking
12:49:26*Vladar quit (Quit: Leaving)
12:49:34FromGitter<alehander92> and it is about correctness Araq
12:49:37dom96the compiler can the infer anything that calls into that proc as blocking
12:49:50dom96that may in fact be a `[]` proc which for some reason calls `send`
12:50:12FromGitter<alehander92> i did have an actual bug once where i didnt realize a future running in the background cant be woken up because of a long syscall somewhere
12:54:28*rockcavera joined #nim
12:58:09*Vladar joined #nim
13:01:00*inv2004 joined #nim
13:01:02Araqalehander92: interesting
13:04:35*zacharycarter joined #nim
13:16:54*hipoint-yc9 quit (Quit: FREENODE IS FUCKING GAY)
13:16:59Yardanicolol
13:17:16*hpyc9 joined #nim
13:39:45FromGitter<sealmove> that's weird, I get "Error: type mismatch: got <int literal(0), uint32>" when doing `a > b`
13:40:06FromGitter<sealmove> `a > 0` actually, and `a` is a `uint32`
13:40:10Yardanicohuh
13:40:39narimirando `a > 0'u32`
13:40:58*krux02 quit (Remote host closed the connection)
13:40:58Yardanicowell yeah that's understandable
13:41:12Yardanicobut people might expect a > 0 to work :P
13:41:21FromGitter<sealmove> why doesn't it work?
13:42:15Yardanicobecause by default number literals are assumed to be of type "int:
13:42:16Yardanico"
13:42:55dom96`import lenientops` may help you out here
13:43:00*xcm quit (Remote host closed the connection)
13:43:21FromGitter<sealmove> so `<` is not defined for `(x: SomeUnsignedInt, y: SomeSignedInt)`
13:43:34Yardanico!eval import lenientops; let a: uint32 = 5; echo a > 0
13:43:37NimBottrue
13:43:42dom96yay
13:44:04FromGitter<sealmove> wow! I didn't know about lenientops, this looks like exactly what I need, thanks! <3
13:44:54*xcm joined #nim
13:46:38*salotz[m] joined #nim
13:46:52Yardanicoyeah, some modules get less attention sadly
13:47:00Yardanicolike strscans, parseutils, etc
13:47:25dom96What would be cool is if the compiler could suggest imports based on type mismatches
13:47:42dom96or at least have it hard coded to suggest lenientops for these kinds of situations
13:48:02AraqI thought about an error message filter
13:48:21Araqit would translate error messages into helpful URLs/wiki pages
13:48:39Araqcould be an external tool even
13:48:53dom96that would be cool too
13:49:11dom96that way we could improve the compiler's error messages without new Nim releases
13:49:28dom96the tough part would be ensuring the URLs stay the same between Nim versions
13:49:32dom96but I love this idea
13:50:02Araqhmm I need a persistent data structure
13:50:20FromDiscord<Rika> strscans, parseutils, strtabs, lexbase, a lot of stdlib modules pretty much unknown to anyone
13:50:28Araqany experience here about these?
13:50:50AraqI usually use a 'seq' with another seq stack
13:51:07Yardanico@Rika parseutils are actually very cool
13:51:13Yardanicowhen you need to parse things :P
13:53:10FromDiscord<skyhawk172> hello, can someone help with re-sending email confirmation email for the nim forum?
13:54:14Yardanicodom96: ^
13:54:54AraqPMunch, didn't you implement a "persistent" lookup table once?
13:55:06Yardanico@skyhawk172 what's your forum nickname?
13:55:15FromDiscord<skyhawk172> martinc
13:55:41FromDiscord<skyhawk172> the original email never came and I can't find any way to re-send it myself 😦
13:55:53companion_cubeAraq: give a try to the "HAMT" structure maybe?
13:56:08companion_cube(and if you have access to the refcount internally and it's 1, you can mutate)
13:57:37companion_cube(if you want a persistent map)
13:58:10*endragor quit (Remote host closed the connection)
14:06:41FromDiscord<Krey> Are different versions of the compiler gcc/clang a concern for nim runtime?
14:06:41FromDiscord<Krey>
14:06:41FromDiscord<Krey> ```
14:06:41FromDiscord<Krey> choosenim-init: Downloading choosenim-0.6.0_linux_amd64
14:06:41FromDiscord<Krey> Prompt: Can choosenim record and send anonymised telemetry data? [y/n]
14:06:42FromDiscord<Krey> ... Anonymous aggregate user analytics allow us to prioritise
14:06:44FromDiscord<Krey> ... fixes and features based on how, where and when people use Nim.
14:06:46FromDiscord<Krey> ... For more details see: https://goo.gl/NzUEPf.
14:06:47FromDiscord<Krey> Answer: Forced Yes
14:06:49FromDiscord<Krey> Tip: 1 messages have been suppressed, use --verbose to show them.
14:06:51FromDiscord<Krey> Error: No C compiler found. Nim compiler requires a C compiler.
14:06:53FromDiscord<Krey> ... Install clang or gcc using your favourite package manager.
14:06:54FromDiscord<Krey> ##[error]Process completed with exit code 1.
14:06:54FromDiscord<Krey> ```
14:06:56FromDiscord<Krey> *me is processing https://github.com/RXT0112/Zernit/pull/101*
14:06:58Yardanicopls don't paste in irc
14:07:07YardanicoI mean don't paste in discord
14:07:10Yardanicoin irc it's split in messages
14:07:16FromDiscord<Krey> Yardanico: Sorry didn't know it's bridged on IRC
14:07:50FromDiscord<Krey> Yardanico: paste: http://dpaste.com/3ZSKAVT
14:08:21FromDiscord<Rika> Yardanico: do you use lexbase too?
14:09:29Yardaniconot yet, might try late r:P
14:11:10FromDiscord<Yardanico> @Krey I don't know how your package manager handles dependencies, but nim needs a C compiler to be available
14:11:21FromDiscord<Yardanico> either clang or gcc (well, a lot of others are supported but these are the main ones)
14:11:32FromDiscord<Krey> @Yardanico this is CI running on debian:stable docker
14:11:45FromDiscord<Yardanico> does it have a C compiler though?
14:11:53FromDiscord<Krey> i figured as much but are different versions of gcc/clang a concern for nim runtime?
14:11:58FromDiscord<Krey> if so -> i need to implement CI for it
14:12:03euantorTry installing `build-essential`: `apt-get install -y build-essential`
14:12:07FromDiscord<Yardanico> not really, nim supports most GCC versions
14:12:09FromDiscord<Yardanico> and clang
14:12:11FromDiscord<Krey> @Yardanico It doesn't have anything by default
14:12:22FromDiscord<Yardanico> if it's newer than 3.x
14:12:49FromDiscord<Krey> @Yardanico Noted version >=3.X
14:12:57FromDiscord<Yardanico> well, not equal, just > 3.x
14:13:03FromDiscord<Krey> can you elaborate on other compilers?
14:13:05FromDiscord<Krey> noted
14:14:21FromDiscord<Rika> Yardanico, which is more recommended to use or smth, parseutils or npeg?
14:14:24FromDiscord<Yardanico> full list of compilers can be found there https://github.com/nim-lang/Nim/blob/devel/compiler/extccomp.nim#L66
14:14:49FromDiscord<Yardanico> gcc, clang, tcc, icc, vcc (visual studio c compiler), etc
14:14:55FromDiscord<Yardanico> @Rika depends on your usecase
14:15:10FromDiscord<Rika> what do you mean?
14:15:19FromDiscord<Rika> what factors would it depend on
14:15:55FromDiscord<Yardanico> on what do you need it for? why would you use npeg if you, say, want to parse a simple string of 4 ints separates by a comma fast
14:16:38Araqcompanion_cube, thanks, for now I'm trying my hacky solution which is likely to be fast enough anyway
14:17:03FromDiscord<Yardanico> my mathexpr lib uses parseFloat and parseIndent from parseutils
14:18:18FromDiscord<kodkuce> can i concant string whit terary in it
14:18:20FromDiscord<kodkuce> echo "Running on " & $pnumber & " uploading:" & if uAllowed: "enabled" else: "disabled"
14:18:28FromDiscord<kodkuce> it crys error
14:18:32FromDiscord<Yardanico> yes you can
14:18:58FromDiscord<Yardanico> just put if expression into parens
14:19:05FromDiscord<Yardanico> echo "Running on " & $pnumber & " uploading:" & (if uAllowed: "enabled" else: "disabled")
14:19:05FromDiscord<kodkuce> oh
14:19:21FromDiscord<Yardanico> also check out strformat for string formatting 🙂
14:19:22FromDiscord<Recruit_main707> why is this not printing all the subfolders and only the first one? https://play.nim-lang.org/#ix=2i0T
14:19:42FromDiscord<Yardanico> @Recruit_main707 you need walkDirRec
14:19:48FromDiscord<Yardanico> walkDir is not recursive
14:20:03FromDiscord<Recruit_main707> ok
14:20:28FromDiscord<Yardanico> also check out splitPath if you want to check extension 🙂
14:20:44FromDiscord<Yardanico> ah sorry splitFile
14:20:55FromDiscord<Recruit_main707> ok, thank you
14:21:13FromDiscord<kodkuce> ty
14:21:33FromDiscord<Rika> i guess npeg is for more complicated structured formats
14:22:34Yardanicowell I can rewrite my whole mathexpr using npeg probably, but idk if I need that
14:23:09Yardanicoright now lexer and evaluator are glued together in mathexpr :) I remember I did a version with AST and then evaluation of that AST later but there was a lot of code duplication
14:24:16FromDiscord<Yardanico> maybe I should just write an interpreter for my own language to learn how to properly do AST stuff
14:24:24FromDiscord<Yardanico> seems simple enough
14:24:26FromDiscord<Yardanico> xd
14:25:31Yardanicohttps://github.com/search?q=language%3Anim+interpreter
14:25:54*jjido joined #nim
14:27:10FromDiscord<Rika> got any tutorials or books on parsing and lexing? i got no fuckin clue where to start
14:27:21Yardanicomaybe you want to build a compiler instead? :DD
14:28:08FromDiscord<Rika> nah i just wanna parse files into data (see: the osu library) i wanna move it from some hacky shit to something more "professional" or something
14:28:32FromGitter<zetashift> @Rika http://craftinginterpreters.com/ and https://interpreterbook.com/
14:29:01FromGitter<zetashift> A long time ago I also read a tutorial where they used OCaml to make a parser combinator but I can't seem to find it :/
14:29:17FromDiscord<Yardanico> Well you don't always need to use stuff like npeg. People do manual lexers (so you do all parsing manually) for performance or sometimes to understand better
14:29:29FromDiscord<Krey> @Yardanico Thanks
14:29:38FromDiscord<Yardanico> If I'm not mistaken Nim compiler uses manual lexing too
14:29:41FromDiscord<Krey> How is nim on security? Do i need to implement valgrind or something?
14:30:24FromDiscord<Recruit_main707> as safe as you want it to be (almost sure)
14:31:03FromDiscord<Krey> As safe as i want it to be does not seem very comforming for the end-users..
14:31:29*Guest85 joined #nim
14:31:49FromDiscord<Yardanico> Well you can use valgrind with Nim, yes. Usually Nim is safe unless you do FFI or low level stuff like raw pointers and manual memory allocation
14:32:01FromDiscord<Yardanico> There's no null safety by default though
14:32:18FromDiscord<Recruit_main707> essentially, if you dont want to mess with very low level stuff, safe, thats what i meant
14:33:34FromDiscord<Yardanico> Well it all depends on what you mean by "safe"
14:34:57FromDiscord<Recruit_main707> id say, based on the meaning ive been hearing Nim is very safe (and also allows you to not be safe if you really want to) but you wont get something pointing to null if you dont want to
14:35:13FromDiscord<Krey> @Yardanico Not leaking any memory and doesn't do anything unexpected in such a way that can't be influenced by random 3rd parties
14:36:30FromDiscord<Recruit_main707> The default garbage collector doesnt have any known memory leaks, arc only leaks when used with async, about the random libraries, i dont even know how that works
14:37:41FromDiscord<Krey> > The default garbage collector doesnt have any known memory leaks,
14:37:41FromDiscord<Krey>
14:37:41FromDiscord<Krey> Is there any tracking for known bugs? i.e Vlang implemented this for me: https://github.com/vlang/v/issues/3972
14:37:45FromGitter<alehander92> Yardanico you can really do it easily
14:38:00FromDiscord<Yardanico> I know
14:38:06FromDiscord<Yardanico> @Krey well kinda
14:38:07FromGitter<alehander92> what i mean is that
14:38:12FromGitter<alehander92> there are many places to start
14:38:16FromGitter<alehander92> e.g. you can start from existing AST
14:38:25FromGitter<alehander92> like importing the nim parser module
14:38:26FromDiscord<Yardanico> https://github.com/nim-lang/RFCs/issues/4
14:38:32FromDiscord<Krey> @Yardanico Ideally i would like to implement a logic in a software that warns the end-users about known issues
14:38:47FromDiscord<Yardanico> ? What does that mean
14:39:34FromDiscord<Krey> @Yardanico i.e using Github API to fetch issues with specific label and if any is fetched -> Output huge security message for the end-user every time they use the software
14:39:50FromDiscord<Krey> prompting to update or providing logic to hotfix
14:40:16FromDiscord<Yardanico> What's the point then?
14:40:29FromDiscord<Yardanico> I'm not sure how that can be useful
14:40:38FromDiscord<Krey> if there is anything done on nim that can be used this way in software logic
14:43:00FromDiscord<Krey> Assuming that provided software is beeing rewritten in all other languages to provide options in case major security issue is discovered
14:45:07*moerm joined #nim
14:45:19moermHello everybody
14:47:07FromGitter<zetashift> hiya
14:48:58FromGitter<zetashift> @Krey you might be looking for Ada and not Nim, though I don't see any 'security risks' using Nim and it's current GC
14:49:35FromDiscord<Krey> How do i make `nim check` to die on code-quality issues? (https://github.com/RXT0112/Zernit/pull/101/checks?check_run_id=586025506#step:7:23) -- It returns 0 on failure..
14:49:39*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:50:05FromDiscord<Krey> @FromGItter what do you mean by Ada?
14:50:14*icebattle joined #nim
14:50:14*jjido joined #nim
14:50:30FromGitter<zetashift> @Krey https://www.adacore.com/about-spark this is what I ment
14:50:50moermKrey wait a little (weeks rather than months) and you'll find nim having a static analyser akin to SPARK for Ada
14:51:17FromDiscord<Krey> zetashift: All languages are expected to be supported by Zernit project so Ada is irelevant for the implementation of Nim atm
14:51:21companion_cubethis kind of thing takes a long time to mature, though
14:51:26companion_cubestatic analysis is hard
14:51:40FromGitter<zetashift> ah okay then I misunderstood
14:52:19moermKey Expected by *whom*?
14:53:21moermAnd btw, do have a link "Zernit project"?
14:53:30moerm-Key +Krey
14:53:47FromGitter<zetashift> @moerm he posted it a bit ago I think: https://github.com/RXT0112/Zernit
14:53:58FromDiscord<Krey> Relevant https://github.com/RXT0112/Zernit/pull/101
14:54:11moermThx
14:54:34FromDiscord<Krey> How can i make nim to use different compiler?
14:54:42FromDiscord<Krey> *me wants to force it to use different compiler for tests*
14:55:11Yardanico--cc:clang
14:55:14dom96@skyhawk172 activated it for you
14:55:18Yardanico--cc:zig
14:55:29dom96Yardanico, also, note I'm not the only one that can do that ^ Araq can too :P
14:55:40Yardanicolol
14:56:05*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:56:36FromDiscord<Krey> @Yardanico `nim --cc:clang path/to/file` ?
14:56:43Yardanico yes, if you have clang installed
14:56:47FromDiscord<Krey> thanks
14:56:49Yardaniconim c --cc:Clang
14:56:54FromDiscord<Recruit_main707> ^
14:56:54Yardaniconim c --cc:clang path/to/file *
14:57:04Yardanicoalso nim has c++, objective c and JS backends
14:57:12Yardanicothe C backend being the main one
14:57:31FromDiscord<Krey> Can `nim check` with different compiler output different results ?
14:57:47Yardanicouhh, nim check doesn't compile your code
14:57:49*icebattl1 joined #nim
14:57:57FromDiscord<Krey> it checks the code afaik
14:58:20FromDiscord<Krey> i meant if it can find different problems depending on compiler user
14:58:21FromDiscord<Krey> i meant if it can find different problems depending on compiler used
14:58:34FromGitter<zetashift> No it shouldn't
14:58:40*hax-scramper quit (Ping timeout: 256 seconds)
14:58:51FromDiscord<Krey> > shoudn't ? -> Implement CI just to be sure?
14:58:52FromDiscord<Recruit_main707> syntax will be the same despite the backend (except backned exclusive things obv)
14:59:13FromDiscord<skyhawk172> @dom96 it works now, thank you! 🙂
14:59:41*hax-scramper joined #nim
15:00:10FromGitter<zetashift> the code you feed to the C compiler will first be nim `check`'d so the output will always be the same and then it will be fed to a compiler so it's a separation
15:00:36*icebattle quit (Ping timeout: 256 seconds)
15:01:09FromDiscord<Recruit_main707> being c the chosen backend i guess right?
15:01:57FromGitter<zetashift> yea if you have JS as a backend it'll still nim check but since the output are just js files it doesn't really matter
15:02:00*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
15:02:25*kitech1 joined #nim
15:02:45FromGitter<zetashift> So it cannot find different problems depending on (C) compiler used, ofcourse the C compiler might output some different stuff
15:03:25FromGitter<zetashift> AFAIK there is a clear separation between `nim check` and `nim c/js`
15:04:54*hax-scramper quit (Read error: Connection reset by peer)
15:05:08*hax-scramper joined #nim
15:05:19Yardanico@zetashift thanks for http://www.craftinginterpreters.com/ , I guess I'm gonna disappear from the real world for some time XDD
15:06:16FromGitter<zetashift> haha I've been following it using Scala it's an absolute delight
15:06:32FromGitter<alehander92> awesome
15:06:59FromGitter<alehander92> yardanico better come more often to share with us your progress :P
15:07:23YardanicoI wonder if there's pdf for that book
15:07:36Yardanicoor epub
15:07:43PMunchAraq, sorry I was at the store. I did make persistent vectors, but not lookup tables
15:08:15moermAraq is here and actually present?
15:08:19FromDiscord<Rika> i kinda only wanted parsing and lexing, im not looking into creating a programming language
15:08:29Yardanicomoerm: unbelievable right?
15:08:31YardanicoxD
15:08:34FromDiscord<Rika> i'll look into some other resources
15:08:47Yardanicomoerm: without joking 4raq is almost always in IRC
15:09:56FromGitter<zetashift> @Yardanico from the books github issue the author states "Hi, I plan to create and sell a PDF version once the book is complete, like I did with my previous book. :)"
15:10:27FromGitter<zetashift> @Rika I mean you can just read the chapters about parsing and lexing?
15:10:46PMunchI was meaning to do the trees as well, but never got around to it
15:10:47moermYardanico No, that's not my point but rather why I can't see anythin from him
15:10:55Yardanicowell he's busy you know :D
15:11:13moermSo he's here but not present?
15:11:23Yardanicowell if you ping him he'll probably reply
15:11:37*chemist69_ quit (Ping timeout: 260 seconds)
15:12:07FromGitter<zetashift> he watches over us like Batman
15:12:13Yardanicothe overlord
15:12:29moermYardanico Nuh, I don't want to disturb him
15:12:53moermBtw is there some trick to avoiding to have to type the Names in IRC?
15:12:58Yardanico?? wdym
15:13:09Yardanicoif you want to ping someone you have to write their name, since pinging is client-side, not server-side
15:13:31*chemist69 joined #nim
15:13:34Yardanicothe IRC client checks all messages and makes a notification if it matches your nicknames or whatever lines you might add in your config
15:14:22moermThx
15:15:38PMunchmoerm, if you want to avoid having to type the name your client might support tab completion (at least HexChat does)
15:16:17supakeenAlso in general people leave their clients open just so they can read backlogs when they get back to a computer and/or any mentions of their name they have missed.
15:16:42PMunchirclogs.nim-lang.org can help you there for this specific channel though
15:16:53Yardanicosupakeen: I use Quassel so yeah :P
15:16:57YardanicoI'm *always* online
15:18:16moermPMunch, A big Thx! I happen to use Hexchat and that was exactly what I was looking for. Nice.
15:18:20*federico3_ is now known as federico3
15:18:33PMunchNo problem :) It's a great feature
15:19:39Yardanicodamn, just from the start of this book "was enough to convince me language hackers were a different breed of human. Some sort of wizards granted privileged access to arcane arts." I feel the same really :P
15:20:02moermAs for reading backlogs etc. I know that, but as for myself I feel it to be impolite to seem to be present but not really be. That is no criticism of anyone, just my personal and possibly too oldschool view
15:20:17Yardanicomoerm: IRC has Away status
15:20:43moermYardanico, Ho can I activate that?
15:20:53moermor toggle
15:21:20Yardanicomoerm: it's not a toggle, it's a status in IRC
15:21:25Yardanicoyou can check it by whois
15:21:29Yardanicolike /whois nickname
15:21:52Yardanicoor maybe i'm wrong
15:22:13moermYardanico, Yes, but how can I set it for myself?
15:22:19PMunchAlt+A to toggle it in HexChat
15:22:19FromDiscord<Rika> so the wiki article on lexing and parsing is what actually helped me the most lmao
15:22:21Yardanicomoerm: /away i'm gone
15:22:25FromDiscord<Rika> pretty funny stuff
15:22:43Yardanicoor there are some automatic tools like I just enabled in my Quassel client that I'll have away status once all quassel clients close
15:22:53Yardanicoi'm back
15:23:03PMunchI think you then get a message as well when being pinged? Try now
15:23:06moermYardanico, Uh, OK, thx.
15:23:22moermPMunch, Thx again
15:23:30PMunchNo problem
15:23:40PMunchAs soon as you type something you will be marked as active
15:23:48Yardanicoor sometimes you have to type /away again without any reason
15:23:54Yardanico(I mean without any arguments)
15:24:01Yardanicohttps://bisqwit.iki.fi/jutut/away.html
15:24:14PMunchYou can set your away message in Chatting -> General
15:24:36inv2004Anyone tried to to clone benchmarkgame ?
15:24:55Yardanicothere's https://github.com/kostya/benchmarks but I don't know about benchmarkgame in Nim really
15:25:12*couven92 quit (Read error: Connection reset by peer)
15:25:37*couven92 joined #nim
15:25:40inv2004Yardanico, Yes, I saw it, but I saw it is just few benches there
15:25:55Yardanicowell benchmarkgame author himself refused addition of quite a few languages
15:27:44FromDiscord<Rika> damn, nim's still slaying
15:28:31Yardanicoyeah, and json is slow because languages implement JSON parsers differently
15:28:44YardanicoI mean in this benchmark, not in real life
15:28:48Yardanico(for nim)
15:29:01FromDiscord<Rika> json is slow tho
15:30:08Yardanico"I know a lot of language hackers whose careers are based on this. You slide a language spec under their door, wait a few months, and code and benchmark results come out." lol
15:30:12*couven92 quit (Read error: Connection reset by peer)
15:30:39*couven92 joined #nim
15:32:09FromDiscord<Recruit_main707> has this been tested with Arc?
15:32:30FromDiscord<Rika> they dont try it
15:32:48Yardanico@Recruit_main707 arc performance is not that great for these benchmarks currently
15:33:00Yardanicolike I tested bf benchmarks there and with arc they were like 2x slower
15:33:22FromDiscord<Recruit_main707> :/
15:33:24Yardanicoit all depends on the concrete example of course,
15:33:42Yardanicoarc can beat default nim GC but as you know this default GC has been around for a lot of years
15:33:46Yardanicoand ARC is not even a year old
15:34:08FromDiscord<Recruit_main707> yeah, i was thinking about that rn
15:34:32FromDiscord<Recruit_main707> i have a lot of hope in arc still
15:34:46FromDiscord<Recruit_main707> i think its definetely the way to go
15:35:15Yardanicothe main advantage is that it's _deterministic_
15:35:27Yardanicoit inserts all calls to freeing objects at compile-time
15:35:34Yardanicoso it should always behave the same
15:36:36Yardanico@zetashift do you think I can follow it with Nim? :)
15:36:41YardanicoI mean the first part at least
15:40:36Araq*why* is our JSON slow though? the parser hardly allocates and is a state machine...
15:40:52FromDiscord<Recruit_main707> slower than python smh
15:41:20Araqlet me blame the stupid benchmark :P
15:41:26Yardanicohttps://github.com/kostya/benchmarks/blob/master/json/test.nim#L24
15:41:29Yardanicothis line seems stupid
15:42:09FromDiscord<Recruit_main707> `defer: socket.close()` whats this for at the beggining?
15:42:23Yardanicothese benchmarks use sockets to notify the "master" program of completion
15:42:32moermPossibly Python uses a C module (we might want to look into that)
15:42:44FromDiscord<Recruit_main707> python does use a c module
15:42:51AraqYardanico, is that the benchmark I used for packedjson?
15:42:57Yardanicoidk, probably
15:43:09Yardanicoah yes it is
15:43:44Araqif so, that benchmark is flawed... but my packedjson was faster than everything else anyway
15:43:58FromDiscord<Avatarfighter> lmao the json section of that benchmark
15:44:25moermAraq Wouldn't be the first time some result turned out to be due to the test rather than to the testee ...
15:44:29Yardanicowell it's really not a good example of a json usage
15:44:43Yardanicoit parses one huge json file
15:45:01Yardanicoalmost everywhere else nim is on the top or near the top
15:45:09FromDiscord<Avatarfighter> its a terrible example of json usage imo
15:45:49YardanicoI really wonder how they did implementations if Vala (!!) is faster than C in bf benchmarks
15:45:54Araqthe benchmark mostly tests floating point parsing which is hard to optimize
15:45:54*xet7 quit (Ping timeout: 240 seconds)
15:46:04inv2004I like the nim-chat, just asked one question, and you descussed all the results and ~ fixed halh of them :)
15:46:09YardanicoI mean Vala compiles to C anyway but how it can be faster than C :D
15:46:23AraqYardanico, same as Nim can be faster
15:46:26FromDiscord<Avatarfighter> inv2004: we gotta be number one 😛
15:46:36FromDiscord<Recruit_main707> no pain no gain
15:46:40YardanicoAraq: well yeah, but the point of these benchmarks to use the same implementation
15:46:41FromDiscord<Avatarfighter> ^
15:46:44Yardanicoand that doesn't seem to be the case
15:46:50FromGitter<zetashift> @Yardanico yes absolutely!
15:47:01supakeenI suggest to hash the inputs and compare to a known set of benchmark results then just short circuit the parsing.
15:47:04supakeenEveryone in favour?
15:47:04FromDiscord<Recruit_main707> where is the used json file?
15:47:27YardanicoIt's generated by https://github.com/kostya/benchmarks/blob/master/json/generate_json.rb
15:47:54Araqproduced C code can be better than hand-written C code. hand-written C code is usually written by cargo cultists who cannot look at the produced assembler and instead bath in their manhood
15:47:57FromDiscord<Recruit_main707> thats huge lol
15:48:08FromGitter<zetashift> I wanted to do it in Nim but I wanted to get better at Scala that's why I didn't go for it, but it's really easy to follow and when in doubt you can always peek at https://github.com/cabhishek/nimlox
15:48:13moermYardanico, HOW "huge" ist that test file?
15:48:18Yardanicoyeah but I'll try not to :P @zetashift
15:48:26FromGitter<zetashift> yeah major spoilers :D
15:48:44Yardanicomoerm: I just ran it manually and it made a 107mb json file
15:48:48Yardanico...
15:49:11moermAraq, Careful there. While you are right generally I found that I still get faster code for critical stuff by hand
15:49:18supakeenI guess a large file is also a valid thing to optimize for.
15:49:21supakeenIt's a common usecase.
15:49:25Yardaniconot really
15:49:30Yardanicosmall JSON is a much more common usecase IMO
15:49:31FromDiscord<Recruit_main707> i have an app that uses python nim and json, sending about 9000 characters on average and i cant get it to more than 20 fps :p
15:49:54supakeenYardanico: But large files are definitely not uncommon and where you might get larger gains :)
15:50:11moermYardanico, About 100 MB? That's not frightingly large. I suspect the error could be with the test rather than with Nim
15:50:21Yardanicomoerm: there's no error
15:50:32Yardanicoit's just that nim stdlib json module is not tuned for that kind of usage really
15:50:37moermSorry, I meant the poor result
15:50:39FromDiscord<Recruit_main707> moerm: thats probably because compilers are made to be used by the people Araq described, and optimised thinking in them (i guess)
15:50:40Yardanicopackedjson will use much less memory in that case
15:50:56FromDiscord<Avatarfighter> Do you guys know if there is anywhere you can get stickers of the Nim logo? Just curious
15:51:24Yardanicowell there's this on stickermule
15:51:25Yardanicohttps://www.stickermule.com/artworks/1123185?token=bb1e25bf6e79678069238604d8101454
15:52:12FromDiscord<Avatarfighter> that's cooler than the one I had just found imo https://www.redbubble.com/i/sticker/Nim-Programming-Language-by-korsfarer/34701567.EJUG5
15:52:23Yardanicothat is meh
15:52:39Yardanicoand why list languages it's influenced by
15:52:44Yardanicobetter show a smol code example
15:53:31FromDiscord<Recruit_main707> jajaja, that always looks great, and with nim it will look greater
15:53:49Yardanicowhere does https://nim-lang.org/sponsors.html get list from?
15:53:58PMunchHmm, is telebot broken? http://ix.io/2i1C
15:54:07PMunchThis is the echo_bot example from examples/
15:54:15*endragor joined #nim
15:54:30PMunchUpdateCallback is defined in private/types.nim as UpdateCallback* = proc(bot: Telebot, update: Update): Future[bool] {.gcsafe.}
15:54:59FromGitter<zetashift> Yardanico maybe a mix of BountySource OpenCollective and paypal donations?
15:55:48YardanicoWell I'm asking because i was donating a bit to Nim on OpenCollective but it doesn't show on the website :P maybe it's not updated oftenly
15:56:38Yardanicoah last update 9 months ago https://github.com/nim-lang/website/blob/master/jekyll/_data/sponsors.csv
15:57:16supakeenOn that page the link to the 'salt campaign' (yellow button) ends up with NXDOMAIN as well.
15:57:26supakeenOr is that me?
15:57:34Yardanicosalt?
15:57:48Yardanicoah yeah same for me
15:58:27FromGitter<alehander92> well json is a pretty popular
15:58:45FromGitter<alehander92> so people write very well optimized libs about it, not so surprising
15:59:16FromGitter<zetashift> what happened to that simdjson for nim thing?
16:00:29*endragor quit (Remote host closed the connection)
16:08:16Yardanicowait wat
16:08:22Yardanicocraftinginterpreters mentions nim "It doesn’t have negative connotations across a number of cultures. This is hard to guard for, but it’s worth considering. The designer of Nimrod ended up renaming his language to “Nim” because too many people only remember that Bugs Bunny used “Nimrod” as an insult."
16:08:27*couven92 quit (Quit: Client Disconnecting)
16:10:50zacharycarterif I need to define a preprocessor for the C compiler - should I use `emit`? Or is there some other way of doing this?
16:11:16zacharycarterI know I can use `--passC` but I don't want to have to type that in every time
16:11:27zacharycarterI guess I could also use the `passC` pragma?
16:11:28Yardanicoyou can put it in the config instead :P
16:11:58zacharycarterbut wouldn't that just be a Nim define? not a preprocessor define?
16:12:06YardanicoI mean --passC
16:12:08zacharycarteroh
16:12:17zacharycarteryeah that's probably the cleanest way, thanks
16:17:48FromGitter<zetashift> naming is hard tho yardanico
16:17:54Yardanicoyeah I know that myself
16:18:14inv2004Could please someone remind how to clean nimble cache?
16:18:14Yardanicojust name your language Yet Another Useless Language :P
16:18:25Yardanicoinv2004: it's in ~/.nimble
16:18:30inv2004I remember that on windows it does not recompile all the times
16:18:34Yardanico~/.nimble/pkgs specifically
16:18:39Yardanicobut Nim and Nimble cache are different things
16:18:51supakeenI once wrote a tiny post on naming things but the gist of it is: think of 5 things that you want to think about related to your project, then think of 5 things for each of those 5 things, then pick from this second or third row of things and combine words.
16:18:53inv2004pretty sure there was special nimble command
16:19:02supakeenNot that I use it myself but people sometimes find it useful.
16:19:03inv2004probably I am about nim - not sure
16:20:04inv2004-f should help
16:20:10FromGitter<zetashift> I'd use the wutang name generator cause why not
16:20:25supakeenI usually just pick words in another language.
16:20:30supakeenThat are related to the project.
16:20:59supakeenAll my python projects are german words, for c it's dutch, and of course, always have 1 exception for each ;)
16:21:03FromGitter<zetashift> I don't think nimble has a command to clean cache btw
16:21:26FromGitter<zetashift> I like the 5 things approach
16:22:12supakeen@zetashift: Here it is with a few more words written: https://supakeen.com/weblog/how-to-name-a-project.html
16:24:21FromGitter<faulander> https://play.nim-lang.org/#ix=2i1S
16:24:40FromGitter<faulander> a more sophisticated question this time. questions are in the playground
16:26:54Yardanico"I declare the decode_fuc after the procs, the procs do not know of the decode_func" use forward declaration
16:27:13Yardanicooh, not if it's a variable
16:27:41FromDiscord<kodkuce> i think i finished my simple http.server ptyhon alternative + upload
16:27:47FromGitter<faulander> note to myself (what is forward declaration, read it up!)
16:28:48leorizeZevv: it already does?
16:29:12leorizedid you map <Plug>NimStar and <Plug>NimGStar?
16:29:41companion_cubekodkuce: care to share the code? :)
16:30:45*letto quit (Quit: Konversation terminated!)
16:31:25FromGitter<faulander> @Yardanico : ok, so i forward declare both procs, is there any problem with that?
16:32:07FromGitter<faulander> and how would i call a proc where i get the name from a table-keys, value?
16:33:14FromGitter<zetashift> you mean how to get a value out of a table?
16:33:33FromGitter<zetashift> or get the key and value out of a table?
16:35:19FromGitter<faulander> no. i want to call a proc, lets call it "decode_string" and in the table i have ⏎ key: "s", value: "decode_string"
16:35:28FromGitter<zetashift> `decode_func['l'] = decode_list` also is this even possible? You declare decode_func as `[int, int]`
16:36:11FromGitter<faulander> yes, thats wrong, there are alot of mistakes still
16:36:14Yardanicohttps://github.blog/2020-04-14-github-is-now-free-for-teams/
16:36:14*Yardanico quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:36:16FromGitter<faulander> i need to get the basics right
16:36:41FromGitter<zetashift> will the proc put the value in the table or something else?
16:36:46*Yardanico joined #nim
16:37:26Yardanicogithub scared of gitlab now :D
16:37:28Yardanico"We’re happy to announce we’re making private repositories with unlimited collaborators available to all GitHub accounts. All of the core GitHub features are now free for everyone. 🎉"
16:37:34FromGitter<faulander> its a bencoded string(https://de.wikipedia.org/wiki/Bencode)
16:37:38companion_cubeahaha nice
16:37:45*letto joined #nim
16:37:49FromGitter<zetashift> aber ich bin nicht deutsch
16:37:59FromGitter<zetashift> dull joke but I'll check what bencode is
16:38:02FromGitter<faulander> me neither ;)
16:38:22FromGitter<faulander> its a long string, like a json in one line
16:39:13FromGitter<faulander> a integer looks like: i29410e
16:39:19FromGitter<faulander> and the int proc is:
16:39:49*hax-scramper quit (Ping timeout: 264 seconds)
16:39:59FromGitter<faulander> https://play.nim-lang.org/#ix=2i22
16:40:13FromGitter<zetashift> I think I saw bencode in Nim Days
16:40:18FromGitter<zetashift> are you trying to make a parser for it?
16:40:27*hax-scramper joined #nim
16:40:46Araqhmm we could use a streaming approach for JSON
16:41:16FromGitter<faulander> i look it up in nim days
16:41:35FromGitter<zetashift> Sorry faulander I'm not sure what you're trying to do, maybe return a tuple one containg the proc and one containg the string representation?
16:41:43Araqthen we use less memory and can optimize parseFloat in order to look good on this benchmark. if streaming is allowed, I don't remember
16:41:44FromGitter<zetashift> also: https://github.com/xmonader/nim-bencode
16:42:34FromGitter<faulander> no this is a more general question let me ask it again
16:42:56FromGitter<faulander> can i call a proc which name i get from a variable?
16:44:17FromGitter<zetashift> so you'd have something like `let foo = "bar"` and you want to 'convert' that to 'bar()' which is a proc
16:44:55FromDiscord<Rika> Huh.
16:45:05FromDiscord<Rika> Bencode doesn't have float support
16:45:50FromDiscord<Rika> faulander: no, unless you mean converting the string on compile time, in which case you can, but it would be hacky
16:46:36*jjido joined #nim
16:51:17*jjido quit (Client Quit)
16:51:44Yardanicoanother question - s == "" or s.len == 0
16:51:51Yardanicowhich one is better to use for empty strings? :)
16:51:54leorizes.len == 0
16:52:13leorizebecause in the end, s == "" still have to compare the len first :)
16:52:26FromDiscord<Varriount> faulander: What are you trying to achieve?
16:52:31FromDiscord<Recruit_main707> s.len == 0 becuase it looks better
16:54:45PrestigeI think he meant invoking a proc by its name at runtime?
16:55:23leorize@faulander: you can't, runtime reflection is not a thing in Nim
16:55:40Araqleorize, we optimize s == "" to s.len == 0
16:55:43leorizehowever you can store a "string" -> proc pointer table
16:58:08FromDiscord<kodkuce> hmm if i take someones code (my example dom96/jester parser) and on his github he licenced it with MIT do i have to licence it too on my github as MIT or can i put CC0 licence ?
16:58:28Yardanicoyou need to have a copy of MIT license for the code you used
16:58:32Yardanicobut you can license your project in CC0
16:59:01FromDiscord<kodkuce> ye in my file i have part of his code and i copyed his licence text there
16:59:06Yardanicoyeah that's ok then
16:59:14dadadahope Nim will have an empty method for all collection types, cause questions about s == "" or s.len == 0 should really be answerd with s.empty IMO
16:59:52dadadait's not only shorter, it also looks nicer, but I guess stuff like that is a matter of taste
16:59:56*inv2004 quit (Ping timeout: 256 seconds)
17:00:14leorizeback in the old days, `isNilOrEmpty` was how it's done
17:00:21leorizeso maybe we can now have `isEmpty` :P
17:00:34dadadaI think we could drop the is
17:00:46leorizeit's better to have it
17:00:51dadadawhy?
17:00:58leorizesince isEmpty(string) is a thing too
17:01:00dadadawe don't use getLen either
17:01:11leorizeempty(string) looks like you're trying to empty a string :P
17:01:19dadadano, that would be clear
17:01:27dadadabut, I do see your point
17:01:45Zevvleorize: oooh no i didnt!
17:01:53PrestigeEmpty is also a verb so yeah that looks confusing
17:02:16dadadaif s.empty: <- can in my mind only man that you want to know a state (is it empty?)
17:02:19PrestigeImagine empty(seq)
17:02:21dadadas/man/mean
17:02:50*waleee-cl quit (Quit: Connection closed for inactivity)
17:03:15dadadaPrestige: I can't remember that word empty being used in that way anywhere, most of the time it's something like clear, or even deleteAll
17:03:28leorizeZevv: lol I literally implemented that feature because you asked
17:03:42leorizedadada: it's still a verb
17:04:25leorize"can you empty the bottle?" is still a sentence people use
17:04:35dadadaleorize: it can be a verb, but it can also be an adjective, empty on its own is an adjective, to empty is a verb
17:05:02leorizeI'd say verbs don't really cut out for property name
17:05:52dadadaleorize: https://www.dict.cc/?s=empty
17:06:21dadadaif I'm reading this table right, empty is used more than 10 times more commonly as adjective, compared to it being used as verb
17:07:06leorizeI don't even know what the table mean :)
17:07:36leorizeisn't this just an english -> deutsch table?
17:07:51dadadaleorize: I'm using this site regularly, so I have a feel for it, and I'm pretty sure the english words on the left are ordered by their occurances in regular English usage
17:07:52*icebattl1 quit (Quit: leaving)
17:07:57leorizeand highlighting how empty in english can be translated to various forms in deutsch?
17:08:08dadadaleorize: it's a very advanced translation site
17:08:13*icebattle joined #nim
17:08:15dadadadictionary site
17:09:29dadadaleorize: yes, but it's most common translation by far is (see number 6120) is the adjective form, and the other adjective forms also are all in all more common than the verb form
17:10:06PrestigeEither way I think it's best to prevent any ambiguity
17:10:27PrestigeIf we were to use empty at all I think we'd want to use it as isEmpty
17:13:06dadadait's extremely common for English words to have both verb and adjective form, we would always have to use isAdjective...
17:13:37leorizein practice it appears that we don't have to :) because they are not that common
17:14:09dadadaleorize: did you check them all with a dictionary? name a random adjective that you believe not to have a verb analog?
17:14:21FromGitter<zetashift> I like how Elixir does it for functions that return true or false, they add '?' to the function name e.g. `Enum.empty?(collection)`
17:14:57dadadazetashift: I believe Crystal does also use ? for something like hta
17:14:58dadadatthat
17:15:09FromDiscord<kodkuce> why github has no Zero-Clause BSD in options for licence 😦
17:15:10FromGitter<zetashift> maybe it's a Ruby thing then
17:15:21leorizedadada: my bad, noun is what we use 99% of the time :P
17:15:47leorizeand for adjectives we do use `isAdjective`
17:16:09dadadaokay, I appreate if it's consistent
17:16:10leorize@kodkuce: it's just a shortcut to have a license in your repo
17:16:13dadadaappreciate
17:16:30dadadaleorize: would you accept something like if s.empty?:
17:16:43leorizesure, but we don't have that kind of syntax
17:17:11dadadamaybe I can wrote a macro that enables this...
17:17:14dadadawrite
17:17:53leorizesorry, but macros don't magically make invalid syntax work :)
17:17:54FromGitter<zetashift> NEP-1 doesn't mention proc naming huh
17:18:03dadadasimply rewite .whatever? to .isWhatever , but honestly even I think it might not be worth saving one character
17:18:32leorize@zetashift: yea it's in apis.html instead
17:18:52leorizehttps://nim-lang.org/docs/apis.html
17:19:59FromGitter<zetashift> yea I had it :p
17:20:06*chemist69 quit (Quit: WeeChat 2.7)
17:20:09leorize@kodkuce: if you want to use a license that's not in the license selector, then just go and download the license.txt you want and add to your repo
17:20:16FromGitter<zetashift> I would be surprised if apis.html wasn't under docs
17:20:22*chemist69 joined #nim
17:20:32leorizenep-1 is still the only nim enhancement proposal
17:20:39FromGitter<zetashift> handy reference I didn't know about, saved iit
17:20:50leorizebecause we don't have any process for writing more :P
17:21:08FromGitter<zetashift> but didn't know `?` was an illegal char for a name
17:21:27FromGitter<zetashift> weird error tho: `Error: invalid visibility: '?'`
17:22:12leorizethe identifier set consists of `[a-zA-Z][a-zA-Z0-9_]`
17:22:23leorizefor ascii
17:22:35leorizeif utf-8 then it can be anything
17:23:02FromGitter<zetashift> I'll keep it ascii
17:31:16*audiofile joined #nim
17:35:04*ftsf quit (Ping timeout: 256 seconds)
17:35:30*jjido joined #nim
17:42:57Yardanicowow, probably the single longest error message (I mean single line) I've ever seen in Nim
17:42:58Yardanico"Error: A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature."
17:43:10audiofilewheres the recipe
17:43:29AraqYardanico, it wasn't written by me, maybe that's why :P
17:43:33Yardanicohaha
17:43:59FromDiscord<Recruit_main707> does somebody know why nimporter generates something that doesnt exist?
17:44:16FromDiscord<Recruit_main707> (it tries, it obv errors)
17:44:25Yardanicowdym "doesn't exist"?
17:44:26Araqwhy would generate somethingt that already exists though?
17:44:32Araq*would you
17:44:42FromDiscord<Recruit_main707> i mean, not existing in the header
17:44:58Yardanicowhat exactly does it make?
17:44:59FromDiscord<kodkuce> https://github.com/kodkuce/nimple.http.server hmm, i hit a doom, is asynchttpserver limited to 8mb post request
17:45:06Yardanicowhy not jester
17:45:22FromDiscord<Recruit_main707> well, the problem is not that it creates it, its that it doesnt, but it uses it
17:45:31Yardanicowell nimterop isn't perfect
17:45:41companion_cubeoh, multipart?
17:45:44Yardanicoit might fail to generate something so you'll need to use c2nim or translate it from headers manually
17:45:51companion_cubekodkuce: have you looked at the chunked encoding?
17:46:09FromDiscord<kodkuce> nah newer heard of it, i can google it
17:46:43Yardanicoaudiofile: if you're still wondering
17:46:46Yardanico!eval var prc = (proc (a: auto): int = 5)
17:46:48NimBotCompile failed: /usercode/in.nim(1, 12) Error: A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature.
17:46:52companion_cubeit's how you can upload a 10G file onto a machine with 200MB of ram :)
17:47:02companion_cubestreaming content, in http
17:47:37audiofilethanks!
17:49:17*inv2004 joined #nim
17:51:25FromDiscord<Recruit_main707> its very weird, `NSbuilder_t` doesnt appear in my whole project, neither in nimterop's source
17:51:52FromGitter<sealmove> this incopatibility issue with ints and uints is getting on my nerves!
17:52:08FromGitter<sealmove> I even define the `<` op and still doesn't work
17:52:35FromDiscord<kodkuce> hmm i have 16gb or ram but still it wont let moe more then 8mb, i think asynchttp is limiting it of 5 freezes it responed 1 time with file limit error
17:52:52FromGitter<sealmove> also lenientops is just for `float <-> int` not for conversions betweens different kind of integer types
17:53:19FromGitter<faulander> @leorize
17:53:28FromGitter<faulander> @leorize: thanks for the clarification
17:58:52FromDiscord<kodkuce> and have one more question, writeFile from IO its not async right, i am atm calling it from async proc that will block whole async thingy right?
17:59:15Yardanico yes
17:59:31Yardanicoone way to solve that is to use THREADS (yes :DDDD)
17:59:31FromDiscord<kodkuce> any suggestion how to fix this?
17:59:37leorizeYardanico: or use asyncfile
17:59:42Yardanicooh right forgot about that sorry
18:00:34FromDiscord<kodkuce> ok so TODO is adding asynchfile and figure out this upload thingy 🙂
18:00:49*Vladar quit (Quit: Leaving)
18:01:59*narimiran_ joined #nim
18:02:19*narimiran quit (Ping timeout: 260 seconds)
18:10:44moermThe goal of an error message is not to be a short as possible but to provide a *useful and helpful* message. Or at least that should be the goal
18:11:42Yardanicowell yeah I understand why that happens
18:11:49Yardanicothe error message is pretty clear
18:14:32moermrelated to *readibility*. Do not underestimate it. well readible code is code that is easily maintainable and likely contains less bugs in the first place.
18:14:52moermOne of the many things I like about Nim
18:15:48*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:17:16*abm quit (Quit: Leaving)
18:22:36Yardanicolol
18:22:37Yardanicohttps://play.nim-lang.org/#ix=2i2Q
18:23:42*inv2004 quit (Ping timeout: 265 seconds)
18:26:49FromGitter<sealmove> when did we re-enabled += op?
18:26:58Yardanico?
18:27:08FromGitter<sealmove> x += 1 always worked?
18:27:11leorize[m]@sealmove: it's always been there?
18:27:12Yardanicoyes?
18:27:36AraqYardanico, I have an RFC in the works for taming 'converter'
18:27:45Yardanicooh no :P
18:27:53FromGitter<sealmove> hmm, for some reason I thought it wasn't, maybe because we don't have `++` (well we have the better `inc` of course)
18:28:31Yardanicosome stuff in nimpylib wouldn't be possible without converters (yes I implicitly convert values to bool like Python does to mimic some behaviour) but it's just a fun and kinda stupid project :P
18:28:31leorize[m]Araq: so finally it's gonna be clearer when a converter will apply?
18:28:40Yardanicoif that means less bugs in the compiler I'm all for it
18:30:24FromGitter<sealmove> so I am working on Nim 1.0.0, this works on devel https://play.nim-lang.org/#ix=2i2U but doesn't on 1.0.0. I wondered what changed, and if there is a workaround for 1.0.0 which doesn't require convertion or adding suffixes to literal (maybe define some proc, but I couldn't make it work)
18:30:57leorizeone thing for sure it does work on nim 1.2.0
18:31:48leorizeI think you should move to 1.2.0 and use --useVersion:1.0 :P
18:31:51FromGitter<sealmove> yeah, I can use 1.0.6 max because of study travis using ancient gcc Search Results ⏎ Web results ⏎ ⏎ 🤦 [https://gitter.im/nim-lang/Nim?at=5e960197e7ca460b065eaae1]
18:32:22FromGitter<sealmove> (oops copy pasted more stuff than just emoji 🤦)
18:32:41FromGitter<sealmove> (also study = stupid*)
18:32:44Araqleorize, version 1 has --useVersion:1.0
18:32:55FromGitter<sealmove> (no I am not drunk, despite the looks)
18:33:30Araqleorize, yeah
18:34:50Araqthe RFC is mostly "instead of converter let's have a convert[T, toT] type like varargs" plus some special mechanism for 'distinct' types
18:35:30FromGitter<sealmove> hmm what exactly does --useVersion:1.0?
18:35:57*onionhammer quit (Quit: WeeChat 2.6)
18:36:44Yardanicowait I can simplify that macro to a simple template
18:36:46Yardanicotemplate `:=`*(name, value: untyped): untyped = (var name = value; name)
18:36:55Yardanicothis behaves roughly like a simple version of walrus operator in Python
18:37:04Yardanicoif (a := 5) > 3: echo a
18:37:25Yardanicobasically saves a few characters and shows that nim is cool :P
18:37:53companion_cubedon't you need a `block` in there?
18:38:00Yardanicono lol, it just works (TM)
18:38:02companion_cubeor do the () act like one
18:38:05companion_cubeah cool.
18:38:39Yardanicoit's the same as writing
18:38:48Yardanicoif (var a = 5; a) > 3: echo a
18:38:50leorize@sealmove: here's your 1.2.0 fix: https://play.nim-lang.org/#ix=2i2Z
18:38:55leorizesave it in your config.nims
18:38:59moermLet us leave looking cryptic (and a short-cut operator zoo to the curly braces languages ...
18:40:14companion_cubeYardanico: just tried it, it's pretty cool indeed
18:40:44*onionhammer joined #nim
18:43:27AraqYardanico, well as you noticed, there is 'if (var a = 5; a) > 4'
18:44:55Yardanicocompanion_cube: if you sell your soul to Nim compiler you can do stuff like https://play.nim-lang.org/#ix=2i33
18:45:34YardanicoAraq: well, I know, := is just to mimic Python, I don't really use this if expression in code anyway
18:45:57moermDon't we have better and more important things to work on than creating "cool" sugaring?
18:46:21Yardanicomoerm: yeah, but I don't really do any nimpylib stuff anymore, just pushed a few fixes today because I was bored
18:46:23moermYardanico, And that's good, because that's poor coding
18:46:36companion_cubeahahah jeez
18:46:45Yardanicocompanion_cube: it's not a theoretical example btw
18:47:00companion_cubeshowing off your macro-fiu
18:47:02companion_cubefu
18:47:27FromDiscord<Yardanico> tonim is a simple macro, the real magic is in projects like nimterop
18:47:32moerm"Mom, I saved a line!" (but oh well, my program is actually of worse quality now ...)
18:47:34FromDiscord<Yardanico> Or async or jester
18:48:00companion_cubedid you suddenly move to discord?!
18:48:20Araqmoerm, be gentle, people are allowed to have fun and play syntax games
18:48:24FromDiscord<Yardanico> I just got out of my room and I carry my phone with me
18:48:26moermNo, he is using NSA tech * whisper
18:48:48Araqit's not like 'pylib' is for a production setting
18:49:31AraqI mean, maybe some fool uses it in production but then it's still better than not using Nim :D
18:49:39moermNot to lack modesty but why would I care about Python when there is Nim? (Python has become fat)
18:50:19FromDiscord<Yardanico> Hmmm, seems like Juan removed a bold warning I had on the top of README to not use pynim in real code
18:50:32moerm*g
18:50:34Araqbecause Python still has more libraries
18:50:54moermAraq hmmm ...
18:51:31FromDiscord<Yardanico> We can already use them with nimpy anyway :D
18:51:43moermSaturn is way bigger than earth. I'll stay here anyway
18:52:41moermI'm probably a victim of my field. Pardon me
18:53:55Araqyou wouldn't believe how many, many people approach "programming". Search on stack overflow for a snippet, copy it into your "Program", done.
18:55:56moermAraq And the result is: OS is buggy, libraries are buggy, and even critical stuff like openssl is buggy
18:56:08moermWelcome to the "programming is fun" world!
18:56:31companion_cubenot sure openssl's state is caused by stack overflow copy pasting, really
18:56:50FromGitter<sealmove> hmm 1.2.0 brought some very nice improvements, I hadn't noticed
18:57:06Araqmoerm, well one gets for what one paid for
18:57:33*companion_cube didn't pay anything for the nim compiler
18:57:34FromGitter<sealmove> collect is here too :)
18:57:36moermcompanion_cube, probably not. But by the "programming is fun" attitude (and when it turns un-funny "1000 eyes" turn into "not even 4 eyes" ...
18:58:32Araq> Hmmm, seems like Juan removed a bold warning I had on the top of README to not use pynim in real code
18:58:35moermWhenever I interview a developer candidate and I hear anything about developing being "fun" he's out of the race
18:58:52companion_cubethat sounds… a bit rigid
18:58:55supakeen`k
18:59:27FromGitter<alehander92> guys
18:59:36FromGitter<alehander92> i am trying to call a magic
18:59:39FromGitter<alehander92> copyLineInfo
18:59:46moermcompanion_cube, Oh gawd! "rigid" ... well, rigid happens to also describe what I want. Solid ("rigid") code. Thank you
18:59:52FromGitter<alehander92> from a macro but it seems like .. it just isnt invoked from vmgen!
19:00:05FromGitter<alehander92> which is strange, as it seems defined correctly
19:00:15FromGitter<alehander92> i tried to debug it in many ways
19:00:21companion_cubemoerm: what's your fiekd?
19:00:23companion_cubefield*
19:00:24FromGitter<sealmove> I think Nim 1.2.0 deserves an Araq youtube video
19:00:46moermcompanion_cube, security, vaguely
19:00:56*inv2004 joined #nim
19:01:07Araqmoerm, my litmus test is more like "imagine a language where array indexing starts at 1" if the reaction is "wtf" I become skeptical. if the reaction is "I don't care" I'm happy.
19:01:38moermAraq Let me guess ... not many pass the test ...
19:02:09companion_cubeAraq: what if it's "ugh"?
19:02:28moermcompanion_cube, I don't need "cool" people. I need engineers, preferably ones for whom coding starts with proper modelling (incl. verification)
19:02:29Araqmoerm, indeed
19:03:08moermBut, but ... "C is THE language and in C arrays start at zero!"
19:03:21FromGitter<sheerluck> Araq Julia is a language where array indexing starts at 1
19:03:27Araqcompanion_cube, "ugh" is like "wtf", but don't take it too serious, it's not the only question I care about
19:03:38Araqsheerluck: I know
19:03:41FromGitter<matrixbot> `donpdonp` for i in 0 .. <arglist.len-2: ... proc `<`(x, y: int): bool missing parameter: y
19:03:42FromGitter<alehander92> *writes down notes for a nim interview
19:03:44moermIn other words: that poor guy still has to re-discover what people like Wirth, Dijkstra et al. knew decades ago ...
19:03:46FromGitter<zetashift> hehe
19:04:04FromGitter<matrixbot> `donpdonp` i just upgraded to nim 1.2 and any project with random-0.5.6 is failing with that error :(
19:04:20companion_cube(that 0-indexing is indeed better? :D)
19:04:23FromGitter<alehander92> is it possible that the compiler just ignores some magic calls or that it somehow skips them
19:04:34FromGitter<zetashift> @donpdonp can you post your snippet on play.nim-lang.org and maybe include the full codeblock ?
19:04:35FromGitter<awr1> if i had my way boolean procs would end in `?` a la Ruby
19:04:40companion_cubeI mean, I hear you about well designed, thoughtful code
19:04:46FromGitter<zetashift> we just talked about that awr1 :P
19:04:47Araqmoerm, no, it's actually not about Wirth's designs, for me it's about keeping a flexible mind
19:05:05Araqmaybe I should instead ask "Imagine the indexing starts at 3"
19:05:06FromGitter<alehander92> "what if indexes start at sqrt(2) man "
19:05:21moermAraq And for me it's about the same PLUS engineering rigorosity
19:05:23FromGitter<matrixbot> `donpdonp` zetashift (Gitter): its not my snippit its https://github.com/oprypin/nim-random/blob/master/src/random.nim#L83
19:05:31FromGitter<zetashift> I do agree, I feel like those posts that complain about Julia for 1 indexing are the same plague that moan about Nim case insensitivity
19:06:06FromGitter<matrixbot> `donpdonp` zetashift (Gitter): im trying to make a similar case in the playground but havent been able to reproduce it yet
19:08:13Araqmoerm, btw do you know Wirth's later designs make arrays start at 0 and he also nuked 'enums' from Oberon?
19:08:20FromGitter<awr1> yeah people tend not to look big picture with languages
19:09:31moermBut I concede when I started I felt the compiler (complaining) to be my enemy too. It took some maturing to understand that "-Werror -pedantic" is a GOOD setting and that a strict compiler is my FRIEND
19:10:15moermAraq I highly likely have that somewhere in the depths of m head but I haven't touched Oberon since 2 or 3 years
19:10:16FromGitter<zetashift> @donpdonp can you try replaceing `..<` with `..` and change it to arglist-3
19:10:20companion_cube-Werror is good, except in releases, it'll break your code in the future when compilers become more strict
19:10:57moermBut who care anyway what an array starts with. After all compilers are good at transposing
19:11:42FromGitter<iffy> What's the right way to add to a sequence which has itself been added to another sequence: http://ix.io/2i3d <-- doesn't work
19:12:13*icebattle quit (Ping timeout: 264 seconds)
19:12:24companion_cubeiffy: group[^1].add("hi") ?
19:12:25moermbtw I think it should be obligatory in CS to force students to look (and plus/minus understand) at the ASM code produced
19:13:11FromGitter<zetashift> @donpdonp I think you're hitting https://github.com/oprypin/nim-random/pull/25 and w/e library you're using is using an old version of random
19:13:42FromGitter<iffy> companion_cube: That works! I guess I'm also asking: "What do I not understand correctly that makes me think the code I pasted would work?"
19:13:42moermcompanion_cube, "production code" not surviving '-Werror -pedantic' is not production code. Period.
19:14:08FromGitter<awr1> @iffy sequences are deep copied
19:14:14FromGitter<zetashift> moerm how *pedantic* of you........................... ba dum tsh
19:14:14*Guest85 quit (Ping timeout: 256 seconds)
19:14:29FromGitter<zetashift> I'll let myself out now
19:14:36moermzetashift Thanks for the compliment :)
19:15:24FromGitter<matrixbot> `donpdonp` zetashift (Gitter): nod. though 0.5.6 is the latest published
19:15:34moermSo I am actually a compiler? * attempt at being funny
19:16:16companion_cubemoerm: but -Werror on what compiler? :)
19:16:26companion_cubecan you be sure you have 0 warning in 2025 gcc?
19:16:46FromGitter<zetashift> one hella complex compiler then
19:18:20FromGitter<zetashift> @donpdonp that would be correct: https://github.com/oprypin/nim-random/commits/master I think you need to do something like `nimble install random@#head`
19:18:28moermcompanion_cube, Quite. But even if I had an error then I wouldn't disable -Werror but correct my code
19:18:40FromGitter<zetashift> or nim-random w/e it's name is
19:19:08FromGitter<matrixbot> `donpdonp` zetashift (Gitter): that will work for my immediate dependency, but i depend on 'ulid' for example which depends on random 0.5.6 o^O
19:19:57*hpyc9 quit (Killed (Sigyn (Stay safe off irc)))
19:20:12companion_cubemoerm: which is why I said "except in a release"
19:20:16FromGitter<matrixbot> `donpdonp` zetashift (Gitter): for this case im happy with going into ~/.nimble/pkg and hand-editing (horrors). thx for the help.
19:20:51FromGitter<zetashift> you could also open an issue on nim-random to cut a new release or change ulid's nimble file
19:21:04FromGitter<zetashift> I don't know enough about nimble to know what the correct procedure is :P
19:21:07*icebattle joined #nim
19:22:56*hpyc9 joined #nim
19:23:10FromGitter<matrixbot> `donpdonp` zetashift (Gitter): bug filed with nim-random.
19:23:34Araq> I don't know enough about nimble to know what the correct procedure is
19:23:58Araquh oh, <insert my usual complaints about package managers in general here>
19:25:48*icebattle quit (Ping timeout: 256 seconds)
19:26:06*icebattle joined #nim
19:26:22moerm* laughing
19:26:56FromDiscord<Asmodeus> "<FromGitter> <matrixbot> donpdonp zetashift (Gitter): ..."
19:26:56FromGitter<zetashift> Araq I can assure you this time it's not the package manager who is lacking, it's me hehe
19:26:57FromDiscord<Asmodeus> good heavens
19:27:26FromGitter<zetashift> you just added discord to that "*<FromDiscord>* <Asmodeus> "<FromGitter> <matrixbot> donpdonp zetashift (Gitter): ..."
19:27:55NorthstriderHow many layers of indirection are too many heh
19:28:10YardanicoPlease use IRC->Matrix and then Matrix->Gitter and then Gitter->IRC
19:28:10moermmoerm can I talk to myself in IRC
19:28:13Yardanicowe've come full circle
19:28:16moermYay!
19:28:56moermmoerm, I can even auto-complete my name.
19:29:18FromGitter<awr1> we need a ICQ, MSN messenger, and AIM bridge
19:29:26Yardanicowhat about Skype
19:29:37Yardanicoalso don't forget facebook
19:29:58Araqzetashift: for me it's always the PM because PMs are bad
19:30:20moermYes, Skype and facebook PLUS javascript based <whatever if only it's fat and bloated>!!!
19:31:28moermIt's a shame anyway that todays fat fat fat super-bloated browsers still don't have a built in OS!
19:31:39YardanicoI have bad news for you
19:31:48FromGitter<iffy> Araq: what's the alternative?
19:31:50Yardanicohttps://copy.sh/v86/
19:32:13FromGitter<zetashift> I mean the web has become so big, is it really bloat
19:32:29Yardanicoyeah
19:32:34FromGitter<zetashift> some sites take it too far sure
19:32:48*nsf quit (Quit: WeeChat 2.8)
19:33:29moermYardanico, Ts those surely are std. OS versions. *My* FreeBSD is smaller
19:33:29*opal joined #nim
19:33:38Yardanicomoerm: some of them are
19:33:42YardanicoReactOS is really small
19:33:56FromGitter<zetashift> reactOS is that windows clone no?
19:34:05Yardanicoit is, an open-source one
19:34:10moermWhat I found amazing is that Oberon is relatively large. Larger than FreeBSD for example
19:34:13Yardanicofor userspace it's mostly wine, but they have their own NT kernel
19:34:23Yardanicoit's still active
19:34:41moermYeah ... and in 2054 they'll be at 1.0
19:34:48Yardanicowell there's no one to blame them
19:34:53Yardanicoit's just that nobody is interested in it :)
19:34:56FromGitter<iffy> Araq: and if you want to just point me to something to read, that's fine -- I'm genuinely curious, but I haven't had problems with nimble (I have with npm/yarn though)
19:35:01Yardanicobtw maybe I should try to check if Nim works on it
19:39:19dom96iffy: with the little development that Nimble's getting, that's a miracle :)
19:39:38FromGitter<iffy> :)
19:39:42Yardanicolet's just use npm for nim, even the name is almost the same!
19:39:56Araqiffy: glad to hear it
19:41:31Araqiffy: dunno good articles about it but the one talk from Rich Hickey about it is good
19:42:32moermYardanico, Why not take dog poop right away? It's almost the same as npm and it's less ugly
19:44:37*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
19:46:39FromGitter<zetashift> Every big package manager/build tool gets complaints
19:46:52FromGitter<zetashift> Is it even possible to make the perfect PM?
19:47:06moermI like nimble
19:47:35FromGitter<zetashift> I like it too, it just werks
19:47:41moermAnd I like non-bloat
19:47:42FromGitter<zetashift> but I admit I don't maintain big projects
19:48:37leorize[m]anyone want a DSL for spawning processes like this? https://play.nim-lang.org/#ix=2i3S
19:49:10moermI'm gone. Have a good time everyone
19:49:18Yardanicosee ya
19:49:25FromGitter<zetashift> bye
19:49:33leorize[m]o/
19:49:38*moerm quit (Quit: Leaving)
19:49:51FromGitter<zetashift> @leorize looks nice
19:50:56Araqiffy: https://www.youtube.com/watch?v=oyLBGkS5ICk
19:51:01*Lord_Nightmare joined #nim
19:51:22*FromGitter * iffy 14minutes in :)
19:52:31leorize[m]@zetashift: thanks
19:53:14leorize[m]I figured that instead of adding more options to createProcess, I can just invent a DSL instead :)
19:53:35Yardanico^any nim user when they discover the power of macros
19:55:12FromGitter<zetashift> yes I looked at that and I was like why wasn't a function enouugh
19:55:34FromGitter<zetashift> and then I remembered it's Nim
19:57:37Yardanicowell yeah Nim "spoiled" be a lot :P
19:57:46Yardanico*me
19:58:20Northstriderleorize[m]: What's the [m] in your name?
19:58:35Yardanicomatrix
19:58:46Yardanicohe's using freenode matrix->irc bridge
19:59:23NorthstriderAh gotcha, thanks
19:59:24leorizeyep
19:59:28*Northstrider is now known as Northstrider[m]
19:59:31Northstrider[m]o
19:59:36Northstrider[m]or it could just be a nick thing
19:59:57Yardanicono :D
19:59:58*Northstrider[m] is now known as Northstrider
20:00:07leorize[m]yea I use both matrix and logging into freenode directly :)
20:01:05NorthstriderSo in this chat we have irc, gitter, discord, and matrix users
20:01:06Northstrider:D
20:01:15Northstriderhttps://xkcd.com/1782/
20:02:57leorize[m]we also have a telegram channel, but we don't bridge that one to irc
20:03:26Yardanicoyeah
20:03:34Yardanicohttps://t.me/nim_lang
20:03:54FromDiscord<Avatarfighter> We have a telegram too!? we have everything
20:04:44Yardanicoyes and I'm quite active there too :P
20:05:05NorthstriderWhat's the purpose of having so many? This is the only community I've seen that has so many
20:05:15YardanicoNorthstrider: not really, most languages are like that
20:05:22Yardanicopeople prefer different messaging platforms
20:05:34Yardanicopython has multiple IRC, Telegram, Discord, Gitter chats
20:05:39FromDiscord<Avatarfighter> Its to provide the motivation to make a bridge between all the messengers 😛
20:05:46Yardanicoyeah, rewrite matterbridge in nim
20:06:01leorize[m]I could bridge them all via matrix if the freenode bridge wasn't so terrible
20:06:08FromDiscord<Avatarfighter> lmfao
20:06:26Northstriderleorize[m]: why is it terrible?
20:06:41YardanicoJS
20:07:15Yardanicoand it's pretty "stable" in crashing every few days
20:07:25Yardanicowhen you see 30-50 matrix users leave and then reconnect after a few hours
20:07:25leorizecrashing isn't the problem
20:07:39leorizethe problem is that it chokes for a few weeks before it crashes
20:08:20leorizethis is due to how overloaded matrix.org is
20:08:26leorizeand how overloaded that bridge is
20:09:05leorize[m]I'm currently on a KDE-hosted bridge
20:09:16NorthstriderIs it a nim specific bridge or something offered by your matrix network?
20:09:49leorize[m]but to bridge between networks I gotta use the matrix.org one, because kde don't expose the tools needed to create a plumbed room
20:10:03FromDiscord<Avatarfighter> I'm curious to know but if I have a func with the same name as an attribute of a type will and I access the attribute will it call the func or get the value directly from the type? E.g: https://dsh.re/74428
20:10:16*jjido_ joined #nim
20:10:18YardanicoNorthstrider: it's offered by freenode
20:10:23leorize[m]@Avatarfighter: attribute
20:10:26Yardanicoand matrix
20:10:27Yardanicohttps://github.com/matrix-org/matrix-appservice-irc
20:10:29Yardanicothat's the source
20:10:38FromDiscord<Avatarfighter> leorize thank you, I was about to try my thing
20:10:46NorthstriderYardanico: I imagine it would just be for a specific network though?
20:11:08leorize[m]the matrix.org bridge used to bridge to all networks
20:11:17leorize[m]now they just do freenode
20:11:23Yardanicoleorize[m]: really? lol
20:11:23NorthstriderOh, why? Abuse?
20:11:59leorize[m]because centralization isn't good :)
20:12:16NorthstriderHm, might give matrix a go. Is riot still the go to?
20:12:18leorize[m]and with just freenode the bridge already kinda stalled
20:12:25leorize[m]imagine bridging all networks :p
20:12:37leorize[m]I use riot and weechat-matrix
20:12:56FromDiscord<Avatarfighter> is riot good?
20:13:06leorize[m]ok-ish
20:13:12Yardanicoin the browser? ok
20:13:16Yardanicoon desktop? electron
20:13:28FromDiscord<Avatarfighter> tbh anything is better than xmpp for me atm
20:13:58leorize[m]xmpp is too fragmented
20:14:08leorize[m]go on matrix, it's already performing better
20:14:45leorize[m]just make sure you never use the matrix.org home server
20:14:50Northstriderwhy?
20:14:54Yardanicotoo overloaded
20:15:11Northstriderah
20:15:18leorize[m]https://www.anchel.nl/matrix-publiclist/
20:15:53leorize[m]^ either pick a public one or just host one yourself
20:16:01NorthstriderIf you start your own server, is it hard to "link" to other servers? i.e. will you get filtered out for being a small network?
20:16:03leorize[m]I'm using a public one though :P
20:16:24leorize[m]nope, in fact people do it all the time :)
20:17:02*sz0 quit (Ping timeout: 246 seconds)
20:18:09FromGitter<kennymalac> how to escape " in regex?
20:18:10FromGitter<kennymalac> csvd.replace(re"\".*\"", "")
20:18:19FromGitter<kennymalac> 12, 21) Error: undeclared identifier: '.*\'
20:18:24Yardanicowhy are you using regex for something like that? :(
20:18:27*Spy653 quit (Ping timeout: 260 seconds)
20:18:33FromGitter<kennymalac> it doesn't matter
20:18:36*sz0 joined #nim
20:18:56leorize[m]`csvd.replace(re "\".*\"", "")`
20:19:17leorize[m]yes I literally just added a space :)
20:19:30FromGitter<kennymalac> thanks
20:19:43Northstriderwelp, guess I'm setting up a matrix server then
20:19:54FromGitter<kennymalac> examples online say re"" no space though ,
20:19:57FromGitter<kennymalac> interetsing
20:20:15leorize[m]@kennymalac: it's a nim syntax sugar
20:20:18*sz0 quit (Max SendQ exceeded)
20:20:24leorize[m]`re""` == `re(r"")`
20:20:35leorize[m]and `r""` is a raw string, you can't escape anything in there
20:20:42*Spy653 joined #nim
20:21:06FromGitter<kennymalac> rip
20:21:17FromGitter<zetashift> what a small mistake lol
20:21:25leorize[m]it's useful when you want to type `re"\t"`
20:21:37*sz0 joined #nim
20:21:42leorize[m]since `\t` won't turn into an actual Tab
20:23:56FromGitter<kennymalac> yep
20:24:09FromGitter<kennymalac> wish it were clearer from the error I suppose
20:28:03FromDiscord<Varriount> Hm, is there a way to construct/allocate a returned object value to a reference of the object type?
20:28:41FromDiscord<Varriount> I tried doing something like `var x = (ref objectType)(functionReturningObject(...))`, but that doesn't seem to work...
20:29:12leorize[m]var x = new(ObjectType); x[] = functionReturningObject()
20:29:19leorize[m] * `var x = new(ObjectType); x[] = functionReturningObject()`
20:29:25FromDiscord<Varriount> Hm, no one-liner?
20:29:48leorize[m]well a template and you got your one-liner
20:30:09leorize[m]looks like edits on matrix don't translate well to irc
20:54:01*narimiran_ quit (Ping timeout: 265 seconds)
20:55:49*filcuc joined #nim
20:59:35*filcuc quit (Client Quit)
21:00:16*inv2004 quit (Ping timeout: 256 seconds)
21:01:15*filcuc joined #nim
21:04:04FromDiscord<Gary M> Part of a C api I'm working with requires passing a pointer to an array, but in nim I have to type the parameter as a fixed length
21:04:18Yardanico?
21:04:24Yardanicoyou want to get a pointer to a nim array?
21:04:33FromDiscord<Gary M> is there a better way of handling this? I tried using ptr openArray instead but that sure didn't work
21:04:51Yardanicothe C function accepts an array or returns an array?
21:05:02FromDiscord<Gary M> it accepts a pointer to an array
21:05:04Yardanicoaddr yourarr[0]
21:05:08Yardanicoto get a pointer to an array
21:05:20Yardanicoit should be "var"
21:05:24FromDiscord<Gary M> yes but as the parameter
21:05:49Yardanico?
21:05:54FromDiscord<Gary M> proc(instance: VkInstance, pPhysicalDeviceCount: ptr uint32, pPhysicalDevices: ptr array[2, VkPhysicalDevice])
21:06:06Yardanicoyou can just say "pointer"
21:06:22Yardanicoand call this proc like myinstance(myarr.len, addr myarr[0])
21:06:26FromDiscord<clyybber> @Gary M Take the address of the nim array
21:06:26leorize[m]does physical device count has any relation to the array?
21:06:41FromDiscord<Gary M> @clyybber I was, and it works if everything is fixed
21:06:47FromDiscord<clyybber> Yeah
21:07:07FromDiscord<Gary M> but that means fixed size in the wrapper which isn't really correct
21:07:24FromDiscord<clyybber> Yeah, which wrapper are you using?
21:07:29leorize[m]is this a raw wrapper?
21:07:39FromDiscord<clyybber> You could use mine: https://github.com/Clyybber/vulkanim ?
21:07:41FromDiscord<clyybber> 😄
21:08:28FromDiscord<Gary M> it's the nimsl vulkan wrapper
21:08:31*natrys quit (Ping timeout: 265 seconds)
21:08:37*ljoonal quit (Quit: ljoonal.xyz)
21:08:42FromDiscord<Gary M> which previously only accepted a pointer to a single VkPhysicalDevice
21:08:48FromDiscord<Gary M> instead of an array
21:09:03FromDiscord<clyybber> Which is the right way here
21:09:16FromDiscord<clyybber> Give it addr thearray[0]
21:09:44FromDiscord<clyybber> The address to the first array element so to say
21:09:53FromDiscord<clyybber> You can do that for seqs too
21:10:26*ljoonal joined #nim
21:11:23FromDiscord<Gary M> ah, thank you 😄
21:11:28FromDiscord<clyybber> np
21:11:34FromDiscord<Gary M> does your wrapper cover 1.2 spec?
21:11:53FromDiscord<clyybber> Ah, not yet. Let me update it
21:12:17FromDiscord<Gary M> cool, I'll see about switching over then
21:14:24*inv2004 joined #nim
21:16:33FromGitter<sealmove> kill this guy https://www.youtube.com/watch?v=DCfDLWfPqiA
21:17:19Yardanicohe just used "Nim" to make his video more popular
21:17:30Yardanicotoo long to watch
21:18:24*liblq-dev joined #nim
21:19:10*EvergreenTree left #nim ("The Lounge - https://thelounge.chat")
21:19:21FromGitter<sealmove> he does it with all languages and finishes each video with something like "learning X is a waste of time because PHP will get you more money"
21:19:36YardanicoI quickly skimmed over the video and it's just "python is popular" and "money matters the most"
21:19:55FromGitter<sealmove> pretty accurate
21:20:08FromGitter<sealmove> (description of the video content)
21:21:25FromGitter<sealmove> also the article he refers to is garbage! it says Nim is a scripting language
21:21:27*natrys joined #nim
21:21:50FromGitter<sealmove> I don't know, this guy is toxic to programming community
21:21:57FromGitter<kaushalmodi> yeah, that was a garbage article; I commented on Twitter
21:23:05Yardanicowhat would you recommend for a personal blog guys? I mean software
21:23:43FromGitter<kaushalmodi> Hugo
21:29:14zacharycarterHmm - I have a cpp file in my project that I need to compile as well as an objective-c source file
21:29:23zacharycarternot quite sure how to do this...
21:31:10*NimBot joined #nim
21:31:17FromDiscord<clyybber> @Gary M updated `:)`
21:31:28zacharycarteranyone have any suggestions?
21:32:14zacharycarterI don't need my Nim code compiled to cpp, but I do need to compile a cpp source file when building my project
21:32:29companion_cubeis there a way of imitating C's `struct foo { int n; char c[] }` where the array has size n?
21:32:41companion_cube(in one block, I mean)
21:33:22FromGitter<kaushalmodi> zacharycarter: https://nim-lang.github.io/Nim/manual.html#implementation-specific-pragmas-compile-pragma ?
21:33:55zacharycarterthanks
21:34:21zacharycarterwell I"m using that in one of my files with the cpp source
21:34:43zacharycartermaybe it's nimterops fault :P let me try replacing `cCompile` with a compile pragma in my nimterop module
21:35:40FromGitter<kaushalmodi> zacharycarter: hmm. I'd think that nimterop should be then doing the Right Thing here
21:37:19zacharycarterhere's what happens - I have one file in my lib folder named `cr.cpp` which contains a preprocessor directive - `#define CR_HOST CR_SAFEST` and then includes a header file - that's it
21:37:28*leorize[m] sent a long message: < https://kde.modular.im/_matrix/media/r0/download/kde.org/KwkGYOebBgFfkuBABqsmTnoN >
21:37:36leorizecompanion_cube: ^
21:38:16zacharycarterthen I have a `nim` file named `cr.nim` which contains a Nim wrapper for this lib as well as `{.compile: "./lib/cr.cpp".}
21:38:42zacharycarterthen I have another file named `sokol.nim` which uses nimterop to wrap the sokol_gfx and sokol_app single header files
21:39:11companion_cubeleorize: oh cool, and it will have the same layout in one block then?
21:39:16zacharycarterand in that file I call `cCompile` to a `.m` file which does essentially the same thing as the cpp source file, just with sokol preprocessor directives / includes
21:39:23companion_cubeI haven't really found how to display the generated C in a nice way
21:39:33zacharycarterand I end up with this error - `error: invalid argument '-std=gnu++14' not allowed with 'Objective-C`
21:39:35leorize[m]you can't :P
21:39:47companion_cubesad :D
21:40:19leorize[m]zacharycarter: I don't think the compiler support multiple backend in one module
21:40:43zacharycarterooph
21:41:23zacharycarterI guess I'm screwed then
21:42:32FromDiscord<exelotl> Trying to use nimterop's toast and I keep getting errors such as `Identifier '__NEWLIB__' (nskConst) contains leading/trailing underscores '_' [AssertionError]`
21:42:46Yardanicoyou need to use onSymbol
21:43:02Yardanicohttps://github.com/Yardanico/nim-libvlc/blob/master/src/libvlc.nim#L31 see like I for example replace libvlc_ with ""
21:43:29FromDiscord<exelotl> ah so I have to give toast a plugin source path?
21:43:57Yardanicooh idk how to do it directly with toast
21:44:22FromDiscord<Gary M> @Clyybber cool, and do you mind me bugging you in DM's about your API?
21:44:40FromDiscord<exelotl> I want to write a program that generates bindings
21:45:05Yardanicowhy not use nimterop itself?
21:45:50FromDiscord<clyybber> @Gary M go bug ahead!
21:46:35FromDiscord<exelotl> I don't understand how to troubleshoot nimterop issues, it could really do with a tutorial or something
21:48:18zacharycarterleorize[m]: the restriction doesn't even appear to be per-module but instead for the entire source tree
21:48:33zacharycarterI just split my imports into different modules, and I get the same error
21:48:49zacharycarterso there's no workaround for this? this kind of stinks
21:49:12inv2004Are there any way to disable overflow check just for one function? my proc hash.
21:50:12leorizezacharycarter: sadly, nope
21:50:35leorizeinv2004: yes, but wouldn't a hashing function use uint instead?
21:50:38FromDiscord<clyybber> inv2004: Use uint
21:51:14zacharycarterugh well I guess I'm just going to use Nim for game code only then
21:52:02companion_cubeleorize: it'd be nice to see at least type declarations in C
21:52:20leorizeyou can see them, they are just not pretty
21:53:31leorizezacharycarter: doesn't nimterop let you build using the target library build system?
21:53:36*fputs joined #nim
21:54:18zacharycarteryes but these are both single header files
21:54:28*Yardanico_ joined #nim
21:54:35zacharycarterone of the projects does have a build system, but it's fips which I'm guessing nimterop doesn't support
21:54:45leorizewouldn't emit `#include` work?
21:55:02zacharycarterthe implementation still has to be compiled
21:55:48leorizewrite some nimscript to setup the target build system then
21:55:52*Yardanico quit (Read error: Connection reset by peer)
21:57:22zacharycarterI'm not sure I follow - I am not compiling anything to a shared library - I'm just compiling these sources when I compile the Nim source that depends on them
21:57:50zacharycarterI'm pretty sure you get that - but I'm not understanding what I can do with Nimscript to fix the need for multiple backends during compilation
22:01:26FromDiscord<exelotl> can anyone see what I'm doing wrong here? https://github.com/exelotl/nimterop-test
22:03:30FromDiscord<exelotl> oh... is it just because set_n is an inline function?
22:04:31*tane quit (Ping timeout: 250 seconds)
22:04:41inv2004leorize, it did not help, but ok, will check it later :)
22:07:49*lritter joined #nim
22:08:33inv2004While chat is not sleeping, can I ask another question: https://gist.github.com/inv2004/74b7067050f3d1421e95b967f493d377
22:09:23inv2004Its about: Error: cannot create a flowVar of type: CountTable[system.int]
22:09:48leorizetry using the threadpool at https://github.com/yglukhov/threadpools instead
22:11:58inv2004Cannot find it in nimble
22:12:16leorize[m]yea it's not on nimble
22:12:27leorize[m]you can just clone it as a submodule
22:13:00inv2004can I somehow include it .nimble file from git ?
22:14:02*filcuc quit (Quit: Konversation terminated!)
22:18:22*natrys quit (Quit: natrys)
22:18:43shashlickyou can use -E and -F on the command line to strip leading and trailing chars
22:18:52shashlickor pass it to the flags param for cImport
22:19:04shashlickexelotl, will check out your issue in 30 mins
22:19:07shashlickz as well
22:19:13Northstridertest
22:19:57leorize[m]are you on matrix now?
22:20:08NorthstriderCan you see my messages on matrix?
22:20:17Northstrider@chance:carey.sh
22:20:54leorize[m]I'm not in the matrix.org bridge :p
22:20:57NorthstriderI see messages, but can't seem to send them
22:20:58leorize[m]but if you're on IRC then matrix sees you
22:21:43*leorize[m]1 joined #nim
22:23:03dadadais æ easy to produce on an English keyboard? it's easy with Alt Gr + a on a German one
22:23:53leorize[m]1chance: yep I see you
22:23:57leorize[m]1welcome to the matrix.org bridge
22:24:08inv2004are there any way to apply some operation to varible and immidiately pass it like var ?
22:24:17leorize[m]1now you know why I said it's trash :)
22:24:31leorizeinv2004: wdym?
22:24:41FromGitter<zacharycarter> shashlick: thanks but I think this might be a mom limitation and not an issue with nimterop
22:24:42leorize[m]1#_freenode_#nim:kde.org <- join that instead
22:25:00leorize[m]1 * `#_freenode_#nim:kde.org` <- join that instead
22:25:05*leorize[m]1 left #nim (#nim)
22:25:07Northstrider#_freenode_#nim ?
22:25:11NorthstriderUnderscores like that?
22:25:25leorizeyea, it's the KDE freenode bridge
22:25:26*chance-M joined #nim
22:25:38leorize[m]it's not on matrix.org and less people use this one
22:25:42leorize[m]so it's much more responsive
22:25:43chance-MOh wow, that was a good bit faster
22:25:57FromGitter<zacharycarter> https://github.com/nim-lang/Nim/issues/2748
22:26:00chance-MWas wondering if it was my synapse server killing itself
22:26:10chance-MRan into the weirdest issues and, as always, it was fucking DNS
22:26:13chance-MWasn't sure I'd solved them all
22:28:18FromDiscord<exelotl> ok so I got `toast` to load my plugin... how do I tell it to throw away the symbol?
22:28:44FromDiscord<exelotl> ```proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} = #something```
22:29:03*chance-M is now known as Northstrider[m]
22:30:11FromDiscord<InventorMatt> did you try using discard?
22:30:15Northstrider[m]Alright, seems to be all set up, wonder how stable this will be. Have to say, riot isn't the most responsive of clients, and joining medium sized rooms takes absolutely forever
22:31:23*opal quit (Ping timeout: 240 seconds)
22:31:24*hpyc9 quit (Killed (Sigyn (Stay safe off irc)))
22:31:53*Northstrider[m] quit (Quit: authenticating)
22:32:00*Northstrider[m] joined #nim
22:33:44leorize[m]chance: it depends on what server the room is on :P
22:33:55leorize[m]but yea, the riot client UX is terrible for this
22:34:55Northstrider[m]hoho, setting a different nick to my matrix name was a mistake, as you'll see me as @chance, and irc will see northstrider[m]
22:35:44leorize[m]use /nick to change it here
22:36:40*hpyc9 joined #nim
22:36:40*opal joined #nim
22:38:48*Northstrider[m] quit (Disconnected by services)
22:38:55*Northstrider[m] joined #nim
22:39:54shashlickexelotl: set it to blank to discard
22:41:01FromDiscord<exelotl> It doesn't like that: `Blank identifier, originally 'Override:_NEWLIB_VERSION_H__' (nskConst), cannot be empty`
22:41:56FromDiscord<exelotl> that's if I do `sym.name = ""`, or `sym = Symbol()`
22:46:15*pbb joined #nim
22:47:07*solitudesf quit (Ping timeout: 265 seconds)
22:50:28*xcm quit (Remote host closed the connection)
22:52:40*xcm joined #nim
22:53:38dadadais there a std proc for reading the nth line of a file?
22:54:22dadadaie. the 700th line, without having to go through 1-699
22:54:48leorizethe sad story is that to do so you still gotta read through the other ones :P
22:55:15dadadaya, it's for convenience
22:55:47Prestigehm so compilation doesn't seem to fail if I make incorrect calls to external libs? I passed extra params of incorrect types to XGrabButton and compilation succeeded. Is there a way to check for these kinds of issues?
22:56:09shashlick@exelotl can you point to the code you are wrapping
22:57:17leorize[m]dadada: https://play.nim-lang.org/#ix=2i5n this for now
22:58:11dadadathanks, I'll use it :-)
22:58:51*Yardanico_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
22:59:21dadadaleorize[m]: should there not be a inc i somewhere?
22:59:23*Yardanico joined #nim
22:59:53dadadaan inc i
23:00:02leorizeoh yea I forgot :P
23:03:39*liblq-dev quit (Quit: WeeChat 2.7.1)
23:05:20*jjido_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:07:27*Northstrider[m] quit (Disconnected by services)
23:07:33*Northstrider[m] joined #nim
23:10:43*PMunch quit (Quit: leaving)
23:11:02dadadathere a macros/pragmas specifically for forstmts? am I right?
23:11:15dadadaif so, does somebody have examples?
23:14:20inv2004Any ideas how to improve getSeq here? https://github.com/inv2004/knucleotide_nim/blob/master/src/knucleotide_nim.nim#L61
23:14:43inv2004Because it takes x4 more times than my rust implementation
23:15:17Yardanicohow are you compiling it ? :)
23:15:33inv2004??? nimble build -d:danger
23:16:00*xet7 joined #nim
23:17:08leorizewhat's your rust implementation?
23:18:16inv2004leorize, its here: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/knucleotide-rust-9.html
23:18:31Yardanicothat is what encrypted message
23:18:47inv2004It was on the first place, but looks like they broke something again and it is on the second now.
23:19:37leorizeomg this is spaghetti
23:19:56inv2004I can translate :)
23:19:56leorizeis this how idiomatic rust supposed to look like? :P
23:20:46inv2004leorize, you see, I am in the nim-chat, even after I created the fastest Rust implementation :)
23:20:56leorizeI can see why
23:21:58FromDiscord<KingDarBoja> videofile: you there bro?
23:24:32FromDiscord<Gary M> so uh, I'm linking to a vulkan dll on windows like {.link: """C:\Windows\System32\Vulkan-1.dll""".} but hard coding the path feels wrong
23:24:47Araqinv2004, try with --gc:arc and somehow fight the seq implementation not to auto-initialize the memory
23:24:49*neceve quit (Ping timeout: 264 seconds)
23:24:58Araqgood night
23:25:19leorizeadd {.noInit.} to the function and see if it's faster
23:36:57*dwdv quit (Ping timeout: 246 seconds)
23:37:01*chance[m] joined #nim
23:37:59leorize@Gary M: I don't think you even have to link
23:38:22inv2004--gc:arc has some conflict with threads. .noinit. to the var line did not help also, and I did not expect it would help
23:39:34leorizeI mean `{.noInit.}` to the function declaration itself :)
23:39:49leorizeit will prevent the `result` variable from auto initializing
23:40:34inv2004ah, ok, but I am not sure that one allocation takes all the time
23:40:43Yardanicodid you profile it?
23:40:55Yardanicoto see which takes the most time
23:40:58Yardanico*what
23:41:17inv2004not yet, did not profile in nim anything
23:41:29inv2004but pretty sure it is readline
23:41:31Yardanicowell the simplest way is to just use "perf" if you're on linux
23:41:32leorizeinv2004: genericReset is a creepy performance killer
23:41:45leorizeand it's implicit for result variables
23:42:08leorizethough we should probably ping @mratsim, as he is the perf king
23:42:35inv2004leorize, just googled it "Always use a main proc" interesting
23:44:21leorizeI consider it really wrong when the C++ version is more readable than the rust one
23:46:32inv2004leorize, a-ha-ha, I pointed it also. My main "rust" idea was to use generics for primitive types, for hashtable for u8 u16 and u32 is a bit more affective than plain u64 solution. And it worked.
23:46:50inv2004... effective ... irc :(
23:48:00inv2004C++ do this optimization for hash by templates, I am pretty sure it is very hard to beat it with any other's languages' hashtables
23:48:34inv2004anyway generics helped a bit even in rust's implementation
23:48:44leorize[m]well Nim can do that kind of optimization too :)
23:48:46FromGitter<awr1> is `export <module_name> except <symbol>` valid
23:48:53YardanicoI think so
23:48:54FromGitter<awr1> i know `export <module_name>` is valid
23:49:08Yardanico!eval import sequtils; export sequtils except mapIt
23:49:09inv2004leorize[m], wrapping in main did not help, but it would be too easy
23:49:10NimBot<no output>
23:49:35FromGitter<awr1> thanks!
23:50:22FromGitter<awr1> bitops disappoints me...no varargs bitor/bitand
23:51:03leorize[m]maybe write one and pr it in? :)
23:52:31FromGitter<awr1> good idea
23:52:33leorize[m]inv2004: you should try to profile the Nim version. Build with debuginfo `-g` and -d:release and you can use pretty much any C profiler to profile the program
23:52:55inv2004yes, thank you, it is clear, I will try
23:53:01FromGitter<zacharycarter> does anyone have any idea how difficult it would be to make the compile pragma invoke different backends based on file extension?
23:53:36shashlickit should already right?
23:54:00FromGitter<awr1> if it doesn't already, you could do a macro
23:54:02leorize[m]it probably doesn't know about objc
23:54:38*Yardanico quit (Read error: Connection reset by peer)
23:54:47FromGitter<awr1> ahhhhh
23:54:48FromGitter<awr1> i see
23:54:50FromGitter<awr1> hm
23:54:50*inv2004 quit (Quit: Leaving)
23:55:04FromGitter<awr1> you should raise an issue imo
23:55:04FromGitter<zacharycarter> yeah apparently it does not
23:55:52FromGitter<zacharycarter> I will - I'll see if I can fix it first though
23:55:54shashlickyou could just compile it manually and add it to the link call
23:57:17zacharycarterlink the object file?
23:57:25zacharycarterI don't want to actually build any library from the code
23:58:00zacharycarterit's like three single header libs - two need to be compiled with objc and the other needs to be compiled with cpp
23:59:51*ftsf joined #nim
23:59:51*Yardanico joined #nim