<< 29-05-2020 >>

00:01:20FromDiscord<codic> leorize[IRC] ^
00:01:29FromDiscord<Technisha Circuit> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715716406796353567
00:01:58FromDiscord<Technisha Circuit> Preferably using the do method like i did with the on ready event
00:02:00FromDiscord<codic> ```nim↵client.on "message", proc(msg) = ↵ if msg.content == "ping": msg.reply("pong!")↵```
00:02:09FromDiscord<Technisha Circuit> Thanks :P
00:02:49FromDiscord<codic> or ↵```nim↵client.on "message", do(msg) = ↵ if msg.content == "ping": msg.reply("pong!")```
00:03:09FromDiscord<Technisha Circuit> Thanks man
00:03:14FromDiscord<codic> (edit) '"message", do(msg) = ↵' => '"message" do(msg):↵'
00:03:29FromDiscord<codic> (edit) '↵```nim↵client.on "message"' => '↵```nim↵client.on("message")'
00:06:33FromDiscord<codic> I'm pretty sure my syntax is right, is it not?
00:06:38FromDiscord<codic> (Not talking abotut hed js thing)
00:06:43FromDiscord<codic> *about the js
00:06:55leorizecodic: well you will know why it failed to parse if you got an editor with good syntax highlighting :P
00:07:20FromDiscord<codic> ? https://media.discordapp.net/attachments/371759389889003532/715717875553271838/unknown.png
00:07:48FromDiscord<Technisha Circuit> I need a type for it
00:07:54leorizenotice how it stopped looking like a string? :P
00:07:54FromDiscord<Technisha Circuit> For the msg
00:08:05FromDiscord<codic> what did?
00:08:11FromDiscord<codic> the \n inside the {}?
00:08:18leorizeyea
00:08:19FromDiscord<Technisha Circuit> > For the msg
00:08:41FromDiscord<codic> msg:string
00:08:48FromDiscord<Technisha Circuit> Thanks
00:08:52FromDiscord<codic> Np
00:09:09FromDiscord<Technisha Circuit> Don't work
00:09:33leorizecodic: it's simple, the string ended at the first `"` :p
00:09:38FromDiscord<codic> What's the error?
00:09:43FromDiscord<codic> OHHHH I'M SO STUPID AAAAAAAAARGH
00:10:01FromDiscord<Technisha Circuit> https://media.discordapp.net/attachments/371759389889003532/715718552178655242/Screenshot_20200529_010954_com.termux.jpg
00:10:03*xet7 joined #nim
00:10:03leorizealso styledWrite can take multiple parameters
00:10:05FromDiscord<Yardanico> @codic in your case it's because you didn't escape "
00:10:15leorizeor just use triple-quoted literals
00:10:20FromDiscord<codic> So like this?
00:10:21FromDiscord<codic> `n{dep.split(", ").join(\"\n")} `
00:10:33FromDiscord<Yardanico> For all "
00:10:34FromDiscord<codic> still fails, 'invalid indentation'
00:10:35FromDiscord<codic> Ah
00:10:41FromDiscord<Yardanico> Except the starting and ending
00:10:42leorizeuse triple quoted strings
00:10:44leorizemuch easier
00:10:48FromDiscord<Yardanico> Yeah
00:11:03FromDiscord<Yardanico> Or just make a separate variable
00:11:08FromDiscord<codic> Alright, got that. Now it's saying expression join is of type string and has to be discarded?
00:11:25FromDiscord<codic> But I'm using it in the string..
00:11:29*ftsf joined #nim
00:11:31FromDiscord<Yardanico> Show full code
00:12:00FromDiscord<codic> sure
00:12:02FromDiscord<codic> https://play.nim-lang.org/#ix=2nEK
00:12:35FromDiscord<codic> (It's a tool to install debs on non deb)
00:13:21leorizewell you didn't escape enough `"` lol
00:13:27*xet7 quit (Remote host closed the connection)
00:13:32leorizelook at your code on the playground
00:13:39FromDiscord<codic> oh
00:13:41FromDiscord<codic> frick it
00:13:52FromDiscord<codic> will just use another variable
00:14:20leorize&"""string""" <- use that then you can have `"` inside the string
00:14:38FromDiscord<codic> I know, but a variable is useful for other stuff as well
00:17:40FromDiscord<codic> This is turning out well (and it works!) https://media.discordapp.net/attachments/371759389889003532/715720476634120252/unknown.png
00:18:19FromDiscord<Technisha Circuit> Anyone able to help? :P
00:18:27FromDiscord<Technisha Circuit> https://cdn.discordapp.com/attachments/371759389889003532/715718552178655242/Screenshot_20200529_010954_com.termux.jpg
00:18:33FromDiscord<Technisha Circuit> I need a type
00:18:43FromDiscord<Technisha Circuit> I tried using JsObject but that didn't work
00:19:03FromDiscord<Technisha Circuit> And Codic said to use a string
00:19:06leorizewithout looking at the code there isn't much that we can reason about :P
00:20:03FromDiscord<Technisha Circuit> sent a code paste, see http://ix.io/2nEL
00:20:07FromDiscord<Technisha Circuit> Wait, can you see it?
00:30:04leorize[m]the error doesn't seem to match that code
00:32:15FromDiscord<Technisha Circuit> I've edited
00:32:30FromDiscord<Technisha Circuit> Fixed
00:32:31FromDiscord<Technisha Circuit> (edit) 'http://ix.io/2nEL' => 'http://ix.io/2nEN'
00:32:39FromDiscord<Technisha Circuit> @leorize
00:36:23leorize[m]use a JsObject there?
00:45:47*bjorob_ quit (Ping timeout: 260 seconds)
00:50:58*lritter quit (Ping timeout: 272 seconds)
00:51:07*lritter_ joined #nim
00:53:10*casaca quit (Remote host closed the connection)
00:53:48*casaca joined #nim
00:57:15*Trustable quit (Remote host closed the connection)
00:58:31FromDiscord<codic> Pretty sure `c` types get translated into the js ones but idk
00:59:23FromDiscord<codic> But ya should try JsOject first, yea
01:05:44*casaca quit (Remote host closed the connection)
01:06:29*dadada quit (Ping timeout: 265 seconds)
01:09:27*theelous3 quit (Ping timeout: 246 seconds)
01:12:15*casaca joined #nim
01:13:30FromDiscord<Technisha Circuit> JsObject didn't work for some reason
01:13:32*theelous3 joined #nim
01:14:00*Tongir joined #nim
01:14:01*theelous3 quit (Read error: Connection reset by peer)
01:15:30*dadada joined #nim
01:15:50*dadada is now known as Guest81643
01:16:35*Maxwell_Pound quit (Ping timeout: 260 seconds)
01:19:15*chemist69 quit (Ping timeout: 246 seconds)
01:21:16*chemist69 joined #nim
01:23:05FromDiscord<Zed> you actually did it @Technisha Circuit you are coding on your phone
01:29:40FromDiscord<Technisha Circuit> XD
01:39:12*Guest81643 quit (Ping timeout: 246 seconds)
01:43:36skrylar[m]i read that link from earlier about the caps bikeshed
01:43:52skrylar[m]kind of agree though with the guy who said the real problem is just a lack of apps
01:45:23*dadada__ joined #nim
01:50:03*opal quit (Ping timeout: 240 seconds)
01:58:19FromDiscord<Technisha Circuit> > you actually did it @Technisha Circuit you are coding on your phone↵@Zed I've done this for 3 years now sooooo
01:58:39FromDiscord<Technisha Circuit> @codic JsObject didn't work, and neither did cstring
01:59:07FromDiscord<Technisha Circuit> I need to be able to use `discord.message` as a type
01:59:16FromDiscord<Zed> you've been coding on your phone for 3 years?? that deserves a medal
01:59:38FromDiscord<codic> idk then
01:59:42FromDiscord<codic> JsString if that's a thing?
01:59:54FromDiscord<Technisha Circuit> Nvm
01:59:58FromDiscord<Technisha Circuit> Not a valid tyoe
02:00:00FromDiscord<Technisha Circuit> Type*
02:00:03FromDiscord<Technisha Circuit> And ok
02:00:03FromDiscord<codic> Oof
02:00:10FromDiscord<codic> What did you say nvm to?
02:00:14FromDiscord<Technisha Circuit> > you've been coding on your phone for 3 years?? that deserves a medal↵Haha
02:00:33FromDiscord<Technisha Circuit> > I need to be able to use `discord.message` as a type↵To this
02:00:41FromDiscord<Technisha Circuit> I said not a valid type
02:01:00FromDiscord<codic> does anyone know how to get the response signal code (eg 0 success, 1 standard failure, so on) AND command output (as execprocess does ootb)? preferably as a seq or something
02:01:06FromDiscord<codic> Oh, ok
02:02:46FromDiscord<Technisha Circuit> I need to use `discord.Message` as a type somehow :/
02:03:22FromDiscord<codic> Idk
02:03:30FromDiscord<codic> `JsObject(discord.Message)`?
02:03:34FromDiscord<codic> There must be something like that
02:04:20FromDiscord<Technisha Circuit> Ok
02:05:40FromDiscord<Technisha Circuit> https://media.discordapp.net/attachments/371759389889003532/715747655778828308/Screenshot_20200529_030532_com.termux.jpg
02:06:20*opal joined #nim
02:08:33bungI got `Error: cannot open file: stdprivatesince` where is the slash?
02:09:19*dadada__ quit (Ping timeout: 265 seconds)
02:09:45FromDiscord<flywind> what's your nim version, it's in devel.
02:10:17bungI using 1.3.5
02:10:56bungI meaning the error reported file path without slash
02:11:33*Tlanger joined #nim
02:14:06FromDiscord<flywind> have no problem in windows/ubuntu, maybe report it in github.
02:14:18*Tongir quit (Ping timeout: 260 seconds)
02:15:01bungok
02:15:20*dadada joined #nim
02:15:43FromGitter<phdye> Error: expression ' {.emit: "(&_Py_NoneStruct)".}' has no type (or is ambiguous) ⏎ ⏎ Anyone have an idea how to give this a type ? I tried casting it but that givens the same error message.
02:15:45*dadada is now known as Guest81102
02:17:32*endragor joined #nim
02:22:49FromDiscord<Technisha Circuit> We need to see the code @phdye
02:27:30*muffindrake quit (Ping timeout: 246 seconds)
02:28:07FromGitter<phdye> template Py_None*() = ⏎ castptr PyObject ({.emit: """(&_Py_NoneStruct)""".})
02:28:29FromGitter<phdye> Weird it strips a bit of the code.
02:28:54FromGitter<phdye> Is there a code quoting feature ?
02:30:00*muffindrake joined #nim
02:32:12FromGitter<phdye> ```template Py_None*() = ⏎ cast[ptr PyObject]({.emit: """(&_Py_NoneStruct)""".})``` [https://gitter.im/nim-lang/Nim?at=5ed0742c7da67d06fadaf401]
02:32:45leorize@phdye: {.emit.} are type-less
02:33:06leorize@Technisha: why doesn't JsObject work?
02:33:31FromGitter<phdye> Hmm, what JsObject ?
02:33:52leorizethat message wasn't meant for you :P
02:34:28FromDiscord<Technisha Circuit> No idea @leorize[IRC]#0000
02:34:31FromDiscord<Technisha Circuit> ;-;
02:34:45leorizewhat I meant is: what's the error message?
02:34:47leorizelol
02:34:50FromDiscord<Technisha Circuit> Oh
02:35:03*opal quit (Ping timeout: 240 seconds)
02:36:10FromDiscord<Technisha Circuit> Getting the error rn
02:36:46*opal joined #nim
02:37:12leorizemy guess is that the error will be that you can't `==` between a JsObject and a string
02:37:13bungyou just need import from c using c global None variable
02:37:19FromDiscord<Technisha Circuit> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715755618031632425
02:37:33*waleee-cl quit (Quit: Connection closed for inactivity)
02:37:33leorizesorry, it's a discord link now, I can't read it :P
02:37:39FromDiscord<Technisha Circuit> Oof okay
02:37:47FromDiscord<Technisha Circuit> ~~Why not make it hastebin?~~
02:37:58FromDiscord<Technisha Circuit> https://media.discordapp.net/attachments/371759389889003532/715755782314131496/Screenshot_20200529_033751_com.cutthecord.base.jpg
02:38:12leorizeYardanico: we need something better than ix.io lol
02:38:26leorize@Technisha my guess was spot on :)
02:38:40leorizeuse `.to(cstring)`
02:38:48FromDiscord<Technisha Circuit> Oh okay :P
02:38:52FromDiscord<Technisha Circuit> On what exactly?
02:39:01leorizeon `.content`
02:39:03*Guest81102 quit (Ping timeout: 246 seconds)
02:39:06FromDiscord<Technisha Circuit> Oki
02:39:49FromDiscord<Technisha Circuit> Eyyy, it works!
02:39:52FromDiscord<Technisha Circuit> Thanks!
02:40:58leorizeI know a bit too much nim at this point :P
02:41:32FromDiscord<Technisha Circuit> Hahaha
02:41:42FromDiscord<Technisha Circuit> No such thing as too much nim
02:41:55*opal quit (Excess Flood)
02:43:55*opal joined #nim
02:45:23*dadada__ joined #nim
02:47:53*mono joined #nim
02:48:30*avatarfighter joined #nim
02:49:02FromDiscord<Technisha Circuit> Who else wants this?
02:49:03FromDiscord<Technisha Circuit> https://thepihut.com/products/raspberry-pi-4-model-b?variant=31994565689406
02:50:14*monokrom quit (Ping timeout: 246 seconds)
02:54:25FromDiscord<Yardanico> @leorize any good recommendations?
02:54:43*opal quit (Ping timeout: 240 seconds)
02:55:19FromDiscord<Yardanico> hastebin is instantly no because of JS
02:55:28leorize0x0.st
02:55:40leorizewe can even self-host our own pastebin :P
02:56:51FromDiscord<Technisha Circuit> Why not make your own paste service then @Yardanico?
02:56:59FromDiscord<Technisha Circuit> Or port the JS to another lang
02:57:14leorizelol, that's not the prob
02:57:23leorizethe prob was that to interact with hastebin you need js
02:58:11FromDiscord<Technisha Circuit> Oh?
02:58:18FromDiscord<Yardanico> Yes, that's really stupid in my opinion
02:58:24FromDiscord<Technisha Circuit> There's a client for it in Ruby though
02:58:30FromDiscord<Yardanico> Pastes are text first of all
02:58:38FromDiscord<Yardanico> @Technisha Circuit we mean the website
02:58:41FromDiscord<Yardanico> Not API
02:58:43FromDiscord<Technisha Circuit> Oh
02:59:27FromDiscord<Technisha Circuit> So what will you use?
03:00:04leorizeI don't see why we can't just store everything on our servers :P
03:00:07leorizelack of space?
03:00:08FromDiscord<Yardanico> That's what I'm asking, there are good services, but it's better to not use a lot
03:00:18FromDiscord<Technisha Circuit> :p
03:00:25FromDiscord<Yardanico> @leorize it's possible, yes, but that's kinda out of scope :)
03:00:33FromDiscord<Yardanico> Even Nim playground uses ix.io
03:00:33FromDiscord<Technisha Circuit> Maybe make the bot send it as an image somehow?
03:00:40FromDiscord<Yardanico> No, that's even worse
03:00:46FromDiscord<Technisha Circuit> :p
03:01:10FromDiscord<Technisha Circuit> I was thinking of the bot processing it to look like a discord message
03:01:14FromDiscord<Technisha Circuit> Or something
03:01:44leorizediscord has the weirdest architecture
03:01:59leorizeyou need to login to see messages, but you don't have to if you just wanna see the pics
03:02:42FromDiscord<codic> since they are just hosted on the cdn
03:02:49FromDiscord<codic> used to be cdn.discordapp.com
03:02:51FromDiscord<codic> now media.discord.com
03:03:18FromDiscord<codic> it'd be a big pain to have login require for simply accessing the cdn
03:03:34FromDiscord<codic> plus, it'd make viewing images in browser harder for people not logged in
03:06:56*rockcavera quit (Remote host closed the connection)
03:07:49*sagax quit (Remote host closed the connection)
03:09:41*dadada__ quit (Ping timeout: 272 seconds)
03:14:03*sagax joined #nim
03:15:21*dadada joined #nim
03:15:47*dadada is now known as Guest82240
03:18:33*opal joined #nim
03:18:36*oneark joined #nim
03:38:54*Guest82240 quit (Ping timeout: 246 seconds)
03:39:26FromDiscord<Technisha Circuit> ~~JSGrant~~
03:39:49FromDiscord<Technisha Circuit> I think we have a lurker-
03:42:48*endragor quit (Remote host closed the connection)
03:45:01FromDiscord<JSGrant> @Technisha Circuit I'd be a lot more interested in a RPi with 8gb of ram; If the "laptop kit" story was a LOT better. Unless maybe-maybe using it to host heavy web-apps I don't know what the use-case for it would be at this point over a regular tbh
03:45:27*dadada__ joined #nim
03:45:31FromDiscord<Technisha Circuit> You could totally use it as a Minecraft server
03:45:34FromDiscord<Technisha Circuit> :P
03:46:05FromDiscord<JSGrant> Like it's crazy how the pi-top is like 300usd for a case, keyboard, and screen when a Pinebook Pro is like 200usd total and "close enough" to a regular pi
03:46:35FromDiscord<Technisha Circuit> Oof
03:46:55FromDiscord<Technisha Circuit> I'd just use a PC monitor and DIY a case for the monitor and a keyboard area
03:47:28FromDiscord<JSGrant> @Technisha Circuit Eh, I guess; But like idk seems weird to dedicate a pi to that (minecraft server) when I could run it on my homeserver and have a bunch of room to spare still
03:48:12FromDiscord<Technisha Circuit> I don't have anything else i could use to host except for my 3b
03:48:23FromDiscord<Technisha Circuit> And it's definitely not powerful enough for a pi
03:48:34FromDiscord<JSGrant> Also, @Technisha Circuit let's move to #offtopic so we don't spam #main :^)
03:48:41FromDiscord<Technisha Circuit> Oki haha
03:53:32*endragor joined #nim
03:55:51*nsf joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:03*Tlanger is now known as GG_Ping
04:06:40*supakeen joined #nim
04:08:59*dadada__ quit (Ping timeout: 246 seconds)
04:15:25*dadada joined #nim
04:15:49*dadada is now known as Guest62177
04:18:01skrylar[m]yeh i don't know why arm chipsets always ship with so little memory
04:18:53skrylar[m]although i put kanboard on an rpi3 and its not very quick
04:19:38skrylar[m]would kind of expect it to be since its running alpine-arm with basically nothing else active, but maybe that's just how php works and it would be fine with a go/nim server
04:26:35*muffindrake quit (Quit: muffindrake)
04:28:23FromDiscord<Rika> @Technisha Circuit someone wants to do haxe to nim (replying to something a few hours ago)
04:29:17FromDiscord<Technisha Circuit> Oh no
04:29:37leorize!repo py2nim
04:29:38disbothttps://github.com/metacraft-labs/py2nim -- 9py2nim: 11A Python-to-Nim transpiler 15 115⭐ 8🍴 7& 1 more...
04:29:51leorizethe bot is back :)
04:29:52FromDiscord<Technisha Circuit> https://github.com/RapidFingers/Craxe↵RapidFingers/Craxe: Haxe to nim transpiler - GitHub
04:30:19FromDiscord<Technisha Circuit> Old
04:30:32leorize!repo languist
04:30:33disbothttps://github.com/metacraft-labs/languist -- 9languist: 11a framework for automated translation of high level langs 15 32⭐ 1🍴 7& 1 more...
04:31:50*avatarfighter quit (Remote host closed the connection)
04:32:05FromDiscord<Technisha Circuit> Oo
04:34:20*avatarfighter joined #nim
04:35:12*muffindrake joined #nim
04:38:45*Guest62177 quit (Ping timeout: 246 seconds)
04:45:22*dadada__ joined #nim
04:49:33*Tongir joined #nim
04:51:36skrylar[m]well thats just.. weird.
04:52:00skrylar[m]what do you even gain by doing a haxe-to-nim?
04:52:17FromDiscord<Rika> its just a fun experiment
04:52:20FromDiscord<Rika> it doesnt have to be useful
04:52:22*GG_Ping quit (Ping timeout: 256 seconds)
04:52:30FromDiscord<Rika> i mean, it might not look useful to you
04:52:42FromDiscord<Rika> but someone might find it great for learning if you already know haxe
04:53:03*leorize quit (Ping timeout: 240 seconds)
04:53:46avatarfighterHaxe-to-nim sounds fun!
04:53:53*leorize joined #nim
04:54:04*xet7 joined #nim
05:06:34*Tlanger joined #nim
05:08:56*Tongir quit (Ping timeout: 246 seconds)
05:09:07*dadada__ quit (Ping timeout: 265 seconds)
05:09:20avatarfighterWhich way is considered more correct for finding out if a string is empty? string.len == 0 vs. string == "" vs. bool(string.len) ?
05:09:51avatarfighterSecond question based on that one, is string.len == 0 the same as bool(string.len) ?
05:10:00*Brandon__ quit (Ping timeout: 272 seconds)
05:10:20FromDiscord<Rika> Personally I use len == 0
05:14:04FromDiscord<Technisha Circuit> I'd think so @avatarfighter[IRC]#0000
05:14:52FromDiscord<Technisha Circuit> For your second question
05:15:20*dadada joined #nim
05:15:33*bbarker joined #nim
05:15:46*dadada is now known as Guest87417
05:19:23*opal quit (Ping timeout: 240 seconds)
05:22:27FromDiscord<Elegant Beef> Depends on what im doing but i tend to do use isEmptyOrWhiteSpace
05:23:04FromDiscord<Rika> But what if whitespace is not equivalent to empty!
05:28:58FromDiscord<Yardanico> @avatarfighter 1) you can use any of the first two, I really never seen anyone use bool(str.len) in libraries
05:29:41FromDiscord<Yardanico> 2) it's the other way
05:30:10FromDiscord<Yardanico> str.len == 0 is same as "not bool(str.len)"
05:30:13*bbarker quit (Ping timeout: 264 seconds)
05:30:25FromDiscord<Yardanico> But as I said, I really don't think anyone uses it this way :)
05:30:34avatarfighterI totally forgot that 0 evaluates to false lmao
05:34:02*opal joined #nim
05:39:05*Guest87417 quit (Ping timeout: 265 seconds)
05:42:06*bbarker joined #nim
05:45:16*dadada__ joined #nim
05:46:33*SeanOMik joined #nim
05:47:12SeanOMikHello, I'm new to nim and I wondering if I could create a table of a custom type?
05:48:36FromDiscord<Elegant Beef> Do you mean have a custom type of the key?
05:48:40FromDiscord<Elegant Beef> (edit) 'of' => 'as'
05:49:08SeanOMikYeah
05:49:11FromDiscord<Yardanico> @SeanOMik yeah of course, you'll have to define a hash proc for your type first though
05:49:24SeanOMikOh theres a discord?
05:49:26FromDiscord<Elegant Beef> https://nim-lang.org/docs/tables.html#basic-usage-hashing
05:49:28FromDiscord<Elegant Beef> Yes
05:49:29SeanOMikLet me switch to discord real fast
05:49:32FromDiscord<Yardanico> See https://nim-lang.org/docs/hashes.html
05:49:35FromDiscord<Elegant Beef> We're all bridged and a big happy family
05:49:37*SeanOMik quit (Remote host closed the connection)
05:49:52FromDiscord<SeanOMik> Oh, its hidden at the bottom of the page
05:50:20FromDiscord<SeanOMik> Okay so i have to use hashes then?
05:50:24FromDiscord<Elegant Beef> Yea
05:50:36FromDiscord<Elegant Beef> Isnt there a macro in a module that has a has macro?
05:50:37FromDiscord<Yardanico> @SeanOMik well it's not really are the bottom :)
05:50:44FromDiscord<Elegant Beef> (edit) 'a has macro?' => 'auto hases?'
05:50:48FromDiscord<SeanOMik> Just about
05:50:56FromDiscord<Yardanico> There's the documentation of all procs below the
05:50:59FromDiscord<Yardanico> *that
05:51:36FromDiscord<SeanOMik> Okay, I'll try this
05:51:40FromDiscord<SeanOMik> Thanks!
05:51:45FromDiscord<Elegant Beef> I mean i do feel like it should say something like↵> To use a Custom type as a key you need a custom has proc see here(Insert hyperlink)
05:51:54FromDiscord<Elegant Beef> hash*
05:51:58FromDiscord<Elegant Beef> Man i wish i could spell
05:52:27FromDiscord<SeanOMik> Yeah it should
05:53:37FromDiscord<Yardanico> Well it's just different phrasing, you can create a PR to fix that :)
05:54:12FromDiscord<Elegant Beef> It's not different phrasing as much as explictly stating within the first paragraph
05:54:19FromDiscord<Elegant Beef> of the tables module
05:54:28FromDiscord<SeanOMik> If I have an table with the key being a custom type, lets call the type `A`, could I add other custom types to it that inherit from type `A`?
05:54:42FromDiscord<SeanOMik> (edit) 'an' => 'a'
05:54:52FromDiscord<Elegant Beef> You'd have to convert to i'd believe
05:55:04FromDiscord<Rika> i think so but it would conform to the hashing proc of type A
05:55:11FromDiscord<SeanOMik> Hmmm
05:55:12FromDiscord<Rika> unless its a method
05:55:26FromDiscord<SeanOMik> Okay, thats a lot of hash procs then
05:55:34FromDiscord<Elegant Beef> This is where a macro is nice
05:55:46FromDiscord<Elegant Beef> Which i've been meaning to do for fun, but i know already exists somewhere
05:56:25FromDiscord<SeanOMik> A macro that would get all the members of the type and hash them?
05:56:28FromDiscord<Elegant Beef> Yea
05:56:29FromDiscord<SeanOMik> So I dont have to hash them
05:56:30FromDiscord<SeanOMik> Hm
05:56:41FromDiscord<SeanOMik> I'm pretty new but I could take a shot at it
05:56:49FromDiscord<Elegant Beef> I mean i've been meaning to
05:56:49FromDiscord<Elegant Beef> 😄
05:56:57FromDiscord<SeanOMik> Yeah
05:57:20FromDiscord<Yardanico> @Elegant Beef you don't exactly need a macro for that
05:57:37FromDiscord<Yardanico> fieldPairs exists
05:57:59FromDiscord<Yardanico> You can check how % for object is defined in the json module for example
05:58:05FromDiscord<Elegant Beef> oh
05:58:20FromDiscord<Elegant Beef> Did not know that existed
05:58:26FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/json.nim#L349
05:58:50FromDiscord<Elegant Beef> yea i got that as soon as you said it
05:59:08FromDiscord<Elegant Beef> if it's a hashable type hash and add to the current running hash
06:00:04*Tongir joined #nim
06:02:15FromGitter<bung87> len is finr
06:02:21FromGitter<bung87> fine
06:02:37FromDiscord<SeanOMik> Well I made this: ```nim↵proc hashEvent[T: object](o: T): Hash =↵ for k, v in o.fieldPairs: v.hash```
06:02:43FromDiscord<SeanOMik> From that json example
06:02:46*Tlanger quit (Ping timeout: 265 seconds)
06:02:53FromDiscord<SeanOMik> But I have no idea how I would use it
06:04:51FromDiscord<Rika> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715807851309957140
06:05:53FromDiscord<SeanOMik> Okay, but I still get the same issue with trying to create a table
06:05:56FromDiscord<SeanOMik> with my custom type
06:06:03FromDiscord<SeanOMik> I get a bunch of weird errors
06:06:28FromDiscord<SeanOMik> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/715808258694316064
06:06:53FromDiscord<SeanOMik> Could I just rename it `hash`
06:07:00FromDiscord<SeanOMik> Or could that mess with standard lib?
06:07:10FromDiscord<SeanOMik> Renaming it hash seemed to work
06:07:21FromDiscord<SeanOMik> I dont want it to mess with standard lib though.
06:07:32FromDiscord<SeanOMik> (edit) 'hash' => '`hash`'
06:07:35FromDiscord<Yardanico> it won't really mess with the stdlib
06:07:41FromDiscord<SeanOMik> Okay cool
06:07:59FromDiscord<Elegant Beef> All objects will use that so really it just makes it better 😄
06:08:04FromDiscord<Yardanico> It might mess with other modules if you export that hash proc though
06:08:17FromDiscord<Yardanico> @Elegant Beef and that's not really good
06:08:21FromDiscord<SeanOMik> Okay, I'll keep it "private" then
06:08:33FromDiscord<SeanOMik> Thanks for the help
06:08:42*dadada__ quit (Ping timeout: 246 seconds)
06:08:54FromDiscord<Elegant Beef> I mean it is if you want to use objects as keys, except if the object has it's own hash already
06:09:47FromDiscord<SeanOMik> Okay, back to my old question
06:09:49FromDiscord<SeanOMik> > If I have a table with the key being a custom type, lets call the type A, could I add other custom types to it that inherit from type A?
06:10:00FromDiscord<Yardanico> you don't always want to use all object fields in the hash @Elegant Beef
06:10:03FromDiscord<SeanOMik> Would I be able to do that with the new proc we just made?
06:10:05FromDiscord<Elegant Beef> Yea i know
06:10:22FromDiscord<Yardanico> @SeanOMik well you'll need to convert all objects to the type they inherit from
06:10:22FromDiscord<Elegant Beef> You'd have to convert it to the base type believe
06:10:30FromDiscord<Yardanico> Or use object variants :)
06:10:32FromDiscord<SeanOMik> Would I loose data?
06:10:34FromDiscord<Elegant Beef> No
06:10:35FromDiscord<Yardanico> No
06:10:40FromDiscord<SeanOMik> Ooo thats cool
06:10:45FromDiscord<Elegant Beef> It works like a C# conversion where it's reversible
06:10:45FromDiscord<Yardanico> You'll be able to convert it back later
06:10:48FromDiscord<SeanOMik> Coming from C++ I would loose data
06:10:50*tdc joined #nim
06:10:59FromDiscord<SeanOMik> Okay, then how could I convert to and from?
06:11:03FromDiscord<Elegant Beef> `T(val)`
06:11:07FromDiscord<SeanOMik> Oh
06:11:09FromDiscord<SeanOMik> Thats pretty simple
06:11:11FromDiscord<Elegant Beef> Yea
06:11:24FromDiscord<Elegant Beef> The raw bit conversion which you very rarely use is `cast[T](val)`
06:11:33FromDiscord<Elegant Beef> But that's bit per bit converted as the other type
06:11:40FromDiscord<Elegant Beef> Seldomly used
06:12:00FromDiscord<Elegant Beef> When working in nim only*
06:12:12FromDiscord<Yardanico> cast in Nim is like reinterpret_cast in C++ but yeah, you rarely need it
06:12:36FromDiscord<Yardanico> And mostly you only need it for FFI or lower level stuff
06:15:26*dadada joined #nim
06:15:49*dadada is now known as Guest1410
06:23:01*gxt quit (Quit: WeeChat 2.8)
06:39:08*Guest1410 quit (Ping timeout: 246 seconds)
06:45:18*dadada__ joined #nim
06:53:01*PMunch joined #nim
06:54:09avatarfighterIs there a way of converting an iterator to a sequence ? I'm about to do a for loop and add the values to result but I'm curious to know if there is a better way
06:54:42avatarfighterseems that toSeq in sequtils might be what I'm looking for
06:56:01PMunchYes, that is what you're looking for
06:56:38avatarfighterIndeed :D
06:56:58avatarfighterI had to take a double take with what you said I thought you quoted a jedi for a second there :P
07:00:18PMunchHmm, I got this error in nimlsp today: http://ix.io/2nH7
07:02:03livcdMy wife's family got infected and 2 of them are in hospital on ICU :(
07:02:32FromDiscord<Technisha Circuit> Damn, i hope they get better soon livcd
07:02:41FromDiscord<Technisha Circuit> Must suck really bad
07:02:46PMunchlivcd, oh shit, sorry to hear that..
07:03:37FromDiscord<Technisha Circuit> I wish them well
07:03:41livcdsorry for the offtopic :/
07:03:46livcdthx guys
07:03:51FromDiscord<Technisha Circuit> No worries
07:04:15avatarfighterlivcd I wish them a swift recovery :L
07:05:31livcdThanks I hope so as well...although 1 person is really old :/
07:07:01FromDiscord<Technisha Circuit> Covid is just a nightmare come true
07:07:14FromDiscord<Technisha Circuit> And some people don't even believe in it :/
07:07:42livcdI honestly still believe we cant really do much about it.
07:07:50livcdBasically everyone in the flat got infected.
07:08:03livcdI honestly believe most of the numbers of infected reported are wrong.
07:08:08livcdOr seriously underestimated.
07:08:19PMunchProbably, a lot of non-symptomatic people
07:08:33PMunchMaking it of course very hard to detect..
07:08:42avatarfighteryeah I bet a lot of people don't show symptoms
07:09:42livcdWell they are in one of the best countries to be when it comes to healthcare so I hope they will be fine.
07:10:04PMunchWhere are you?
07:10:32PMunchGot it
07:13:32*Tlanger joined #nim
07:15:54*Tongir quit (Ping timeout: 246 seconds)
07:17:11voltistshashlick o/
07:17:26*disruptek quit (Ping timeout: 256 seconds)
07:18:35*disbot quit (Ping timeout: 272 seconds)
07:18:48skrylar[m]A disease so horrifying the majority of people show no symptoms and fully recover. :sagenods:
07:20:28*disbot joined #nim
07:21:15*disruptek joined #nim
07:23:14PMunchskrylar[m], well the horrifying part about it is when you don't show symptoms and go to visit your grand-parents. Then they catch it and die, later you discover you had it. Now you have to live with having potentially killed someone you love for the rest of your life..
07:23:17PMunchhttps://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/lists.nim#L113
07:23:24PMunchWhat is this <//> thing?
07:24:33*Tongir joined #nim
07:26:04livcdskrylar[m]: the disease is horrifying because of its infection rates.It reaches people that are fragile and vulnerable to what it causes (pneumonia etc).
07:26:06FromDiscord<flywind> <//> is just for being compatible with old Nim version.
07:26:41PMunchflywind, how old?
07:27:13*Tlanger quit (Ping timeout: 264 seconds)
07:27:31FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/715828654617133136/unknown.png
07:31:48FromDiscord<Technisha Circuit> Anyone know a way to get a virtual credit card without ID verification? I need to link it to my paypal so i can start earning money
07:32:08skrylar[m]governments tend to crack down on payment accounts that aren't tied to names
07:32:14skrylar[m]something about money laundering and muh terrorism
07:32:23avatarfighterHave you tried privacy.com?
07:32:37avatarfighterI think they provide VCC
07:32:53avatarfighteralso most banks allow you to generate a VCC iirc at least that is the case in the US
07:32:59PMunchflywind I see
07:33:23*disbot quit (Ping timeout: 246 seconds)
07:33:37avatarfighterso to make something async I can in theory just label what I want to be async with the {.async.} pragma
07:33:38avatarfighter?
07:33:43skrylar[m]avatarfighter: ey doesn't want to have an ID attached to it. that's something entirely different.
07:33:47*disruptek quit (Ping timeout: 272 seconds)
07:34:29FromDiscord<Recruit_main707> cant you win money even though you dont have virtual credit card linked?
07:35:30*disruptek joined #nim
07:36:01*disbot joined #nim
07:36:08PMunchavatarfighter, well yes that would make it async
07:36:23PMunchBut it wouldn't do anything particular async-y unless you have an await in there
07:36:29avatarfighterperfect time to make it all async muhaha
07:36:49*dadada__ quit (Ping timeout: 264 seconds)
07:36:57skrylar[m]Recruit_main707: you can have credit on accounts but they can't give you the fiat currency without knowing who you are (AML and KYC laws.)
07:37:37*clemens3 joined #nim
07:38:34FromDiscord<Recruit_main707> and what if i have a bank account (i dont know how it works, its some kind of special thing bc i am underaged, but its mine)
07:39:01skrylar[m]that's fine. the bank knows who you are.
07:39:31PMunchHmm, this crashes the compiler without any error message: `import options; type Test = iterator (): Option[Test]`
07:41:23skrylar[m]you can typedef an iterator?
07:45:25*dadada joined #nim
07:45:45PMunchCan't you?
07:45:48*dadada is now known as Guest19852
07:47:45skrylar[m]what would that even do? you cant store it anywhere, its not even a closure iterator
07:49:02PMunchThe one I was actually trying to use was a closure iterator
07:49:23PMunchBut {.closure.} wasn't required for the compiler to crash
07:52:40PMunchHmm, the compiler really doesn't like what I'm trying to do here..
07:52:48PMunchIt keeps crashing
07:53:54PMunchThis also crashes it: `type NewTestCB = proc (x: iterator (newcb: NewTestCB) {.closure.})`
07:55:13*Trustable joined #nim
07:58:22FromDiscord<Recruit_main707> sent a code paste, see http://ix.io/2nHo
08:03:55voltistCould someone remind me how to pass arguments to the C compiler through the nim compiler?
08:04:38FromDiscord<Recruit_main707> passC
08:05:00voltistCool thanks
08:05:13FromDiscord<Recruit_main707> `--passC:` and it can be done with a pragma i think
08:05:38FromDiscord<Recruit_main707> (from within your code)
08:06:45*team\andinus left #nim (".")
08:07:30skrylar[m]PMunch: does that have anything t odo with it trying to reference itself in the typedef?
08:09:24*Guest19852 quit (Ping timeout: 265 seconds)
08:13:12*idf joined #nim
08:13:34*Tlanger joined #nim
08:15:22*dadada joined #nim
08:15:45*dadada is now known as Guest85459
08:15:54*Tongir quit (Ping timeout: 258 seconds)
08:16:48PMunchskrylar[m], probably
08:21:26*disruptek quit (Ping timeout: 246 seconds)
08:21:42*disbot quit (Ping timeout: 256 seconds)
08:23:53*disbot joined #nim
08:24:41*disruptek joined #nim
08:39:07*Guest85459 quit (Ping timeout: 256 seconds)
08:39:36*neceve joined #nim
08:45:24*dadada__ joined #nim
08:59:08*dddddd quit (Ping timeout: 246 seconds)
09:02:15*Vladar joined #nim
09:09:20*dadada__ quit (Ping timeout: 265 seconds)
09:11:36FromDiscord<Rika> ngl i kinda wish nim had a package level access level but i understand why it doesnt
09:12:22FromDiscord<Rika> (like where would a package start and end? we cant rely on a nimble file being at top level can we?)
09:15:30*dadada joined #nim
09:16:02*dadada is now known as Guest30689
09:18:22PMunch@Rika, what do you mean?
09:18:52FromDiscord<Rika> pmunch: a way to expose types or procs in the package level without needing to `export except`
09:18:57FromDiscord<Rika> for the non-package level
09:19:24FromDiscord<Recruit_main707> when iterating over a seq, eg:↵`for idx, val in aseq:`↵idx and val correspond to the index and the value? or value its yielded before index
09:21:14*dcmertens joined #nim
09:21:23PMunchIndex and value
09:21:37FromDiscord<Recruit_main707> ok thanks
09:21:57PMunchWell, it's actually dependent on if it has a `pairs` iterator
09:23:46PMunchFor example a table will have key/value pairs when you do that
09:39:33Zevvdisbot: !last varriount
09:41:53PMunchZevv, you don't have to ping him:P
09:41:57PMunch!last varriount
09:41:57disbotVarriount spoke in 12#nim 4 days ago
09:42:46Zevv"it"
09:42:51Zevvnot "him". Don't go there
09:42:53Zevvit frightens me
09:44:55*NimBot joined #nim
09:47:11PMunchHaha, sorry
09:48:35*Guest30689 is now known as dadada
10:03:17PMunchIs there a way to undefine a variable?
10:03:33*lritter_ quit (Quit: Leaving)
10:03:41PMunchLike if there was an exported global variable in a library, could I somehow un-export that in my code?
10:08:49FromGitter<apahl> Isn' t there "import <module> except <thing>"?
10:13:03*opal quit (Ping timeout: 240 seconds)
10:15:57PMunchYes, but that's not quite what I'm talking about
10:16:39*Demos[m] quit (Quit: Idle for 30+ days)
10:17:49FromGitter<apahl> Sorry, then I misunderstood.
10:19:52*abm joined #nim
10:21:09*nerdrat[m] quit (Quit: Idle for 30+ days)
10:25:50*tml[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days")
10:28:10*opal joined #nim
10:29:01*yassen[m] quit (Quit: Idle for 30+ days)
10:29:01*wiltzutm[m] quit (Quit: Idle for 30+ days)
10:29:01*polypoid[m] quit (Quit: Idle for 30+ days)
10:33:55FromDiscord<Recruit_main707> can you append an string inside anotehr string?
10:34:34FromDiscord<Recruit_main707> var a = "abce"↵var b = a.append(3, "d")
10:34:36FromDiscord<Recruit_main707> for example
10:36:37dadadais there a Table in nim that can sort string keys?
10:36:57dadadaie. aaa should come before aba, should come before aca ?
10:37:12*nphg joined #nim
10:37:12*nphg quit (Client Quit)
10:37:44*nphg joined #nim
10:39:16PMunchRecruit_main707, insert from strutils is what you're after
10:39:28PMunchappend specifically means "add to the end of"
10:40:02*nphg quit (Read error: No route to host)
10:40:17PMunchdadada, not a table, but you can use algorithms.sort to sort a sequence of keys
10:42:15*nphg joined #nim
10:43:06*dcmertens quit (Ping timeout: 265 seconds)
10:47:44*letto_ joined #nim
10:48:54*letto quit (Ping timeout: 265 seconds)
10:48:57*avatarfighter quit (Ping timeout: 260 seconds)
10:56:52PMunchHmm, could nimsuggest support giving a range instead of just a line/column?
10:57:19PMunchNimLSP struggles a bit with showing a nice range since it's trying to extrapolate it from the error message..
10:58:58*theelous3 joined #nim
11:04:49FromDiscord<Recruit_main707> cant you have two enums with the same field names?????
11:08:00PMunchNot any more after pure got removed AFAIK
11:08:42FromGitter<rishavs> is "case of" compile time evaluated?
11:09:13FromDiscord<Recruit_main707> wtf, why
11:09:39FromDiscord<Recruit_main707> (about the enums, case of will be evaluated at compileTime if possible i guess)
11:10:40FromDiscord<Recruit_main707> {.pure.} does work though
11:11:44PMunchOh it does? It might've just been the restriction that you had to use EnumName.EnumValue that got relaxed then
11:11:59PMunchrishavs, depends on what you put in it
11:12:02*dadada quit (Ping timeout: 256 seconds)
11:12:19PMunchIf it's a const or a compile-time variable I believe it should be compile-time evaluated like when
11:13:06FromGitter<rishavs> thanks. its a variable which gets its value from a for loop.
11:13:41*dadada joined #nim
11:14:05*dadada is now known as Guest42915
11:14:26PMunchHmm, rudimentary test shows that it doesn't in fact get evaluated at compile-time
11:15:10PMunchWell, not by the Nim compiler anyways
11:18:26PMunchAs you can see: http://ix.io/2nIq
11:19:34PMunchI manually checked the generated Nim file and the switch/case in C is there in both cases, but the optimisations enabled with -d:release removes it from the final binary.
11:19:44PMunchBut yeah, Nim doesn't evaluate it
11:19:55PMunchFrom a for loop?
11:21:07*Kaivo quit (Quit: WeeChat 2.8)
11:21:26*Kaivo joined #nim
11:22:22*rockcavera joined #nim
11:27:08voltistI'm getting the very much unhelpful error message `/usr/lib/nim/core/macros.nim(1502, 16) Error: undeclared identifier: 'cn'`. Any ideas as to how I could track down the cause?
11:28:38FromGitter<bung87> poor way regex \bcn\b
11:30:03voltistThis 'nc'
11:30:13voltistCould be coming from anywhere in the opencv codebase
11:30:24voltistSo probably not very easy to find
11:30:31voltist'cn'*
11:31:46FromGitter<bung87> it is idenrifier or string?
11:32:01FromGitter<bung87> sring must double quote
11:33:13voltistIt seems to work if I put it in cSkipSymbol (I'm wrapping stuff with nimterop)
11:33:20voltistThat might come back to bite me though
11:34:40voltistGreat, now I'm getting an error on line 1775 of macros.nim, a 1687 line long file :/
11:34:58FromGitter<bung87> the way is simple but takes long
11:36:45FromGitter<bung87> why affected to macros.nim
11:45:11*tane joined #nim
11:49:31FromGitter<apahl> (https://files.gitter.im/nim-lang/Nim/k7iy/image.png)
11:49:31FromGitter<apahl> (https://files.gitter.im/nim-lang/Nim/k7iy/image.png)
11:51:16FromGitter<apahl> Sorry about that. Mouse handling failure.
11:55:53*Tlanger quit (Ping timeout: 256 seconds)
11:55:59*endragor quit (Remote host closed the connection)
11:56:06PMunchvoltist, are these error messages from the compiler? Or from an editor plug-in?
11:56:48voltistPMunch: Compiler. I've managed to work around them now though
11:57:24PMunchAh, okay
11:57:54alehander92guys
11:58:04alehander92i am struggling for like good amount of time
11:58:32FromDiscord<Rika> At?
11:58:40alehander92on how to find + and why + is US_EQUAL in monaco docs
11:59:30alehander92and why would keyboards use that weird convention: += in american keybaord
11:59:46alehander92i am like "probably there is a good historical reason but still weirrrrrd"
11:59:54alehander92and finally i manage to *look* at my keyboard
12:00:09alehander92and realize that all that time `=` is the actual key `+` is just a shift+the key
12:00:16FromDiscord<Rika> Lmao
12:00:25alehander92and my ctrl++ is just ctrl+= realistically
12:00:45alehander92always look for your own errors first people :D
12:02:08PMunchHaha, nice one
12:02:16PMunchFor me + is actually it's own key
12:02:24PMunchWith ? being it's shift option
12:02:28*nphg quit (Remote host closed the connection)
12:02:31PMunchAnd = being the shift option of 0
12:02:46*nphg joined #nim
12:03:21alehander92hm interesting
12:03:32alehander92have to really keep that in mind
12:03:39alehander92how do shortcut mappers do it?
12:05:39PMunchDo what?
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:40*supakeen joined #nim
12:07:25alehander92well define the shortcuts
12:07:41alehander92e.g. if you can just switch your keyboard layout suddenly
12:07:47*nphg quit (Ping timeout: 246 seconds)
12:07:58alehander92and your ide is set to do ctrl+=
12:08:06alehander92i guess that shortcut libs should deal with it somehow
12:08:23PMunchWell, what they should do is get the scancode of whatever = actually is
12:08:35PMunchProblem with that is if it's as shift option..
12:09:13PMunchWell, I guess what it should do is have scancodes, and then show you whatever is on that key
12:11:06PMunchSo instead of storing say "a" you should store keycode 38 and then use something like XLookupString to show "a".
12:11:29PMunchThat way all the keycodes will be in the same place as you defined when creating the shortcuts
12:13:40*endragor joined #nim
12:14:47*vqrs quit (Ping timeout: 246 seconds)
12:17:27*vqrs joined #nim
12:23:32PMunchHmm, given a PNode of a symbol or its value, how do I get the actual type?
12:24:02PMunchsym.typ.kind is just tyGenericInst, and I haven't been able to actually find the name of the type anywhere..
12:26:36FromGitter<rishavs> Is this wrong? I am trying to create a unique set of points; ⏎ ` var unVisitedNodes: set[seq[int]]` ⏎ The compiler is complaining that `ordinal type expected`
12:30:57FromDiscord<Rika> Use hashset
12:31:19FromDiscord<Rika> Sets are bitsets
12:33:04FromGitter<rishavs> thansk
12:38:35alehander92PMunch makes sense
12:38:50alehander92but on the other hand does one expect that : to be in the same place as defined
12:39:01alehander92maybe this would make it work e.g. on cyrillic
12:39:20alehander92e.g. i am often there and i dont think i expect most of the shortcuts to work
12:39:25alehander92but if i think about it i am not sure
12:39:38alehander92yeah in firefox it seems it doesnt matter
12:41:42PMunchWell at least it would make sure that all the keyboard shortcuts are accessible
12:42:01PMunchAnd things like WASD, HJKL, and other positional shortcut will work
12:42:33PMunchNot so good for mnemonic shortcuts though, like U to undo, C to copy, P to paste, etc.
12:42:47PMunchOr, well, V to paste :P
12:44:32*sacredfrog joined #nim
12:46:25*dcmertens joined #nim
12:47:01alehander92yeah :D well not a big deal right, but it is interesting to see different view angles!
12:48:01PMunchHaving a very non-standard I've been forced to think about this quite a bit :P
12:48:38alehander92probably ;)
12:49:01alehander92i am implementing
12:49:06alehander92zoom in / zoom out now
12:49:25alehander92and fixing other editor features and thats why i wondered about those kinds of questions
12:55:11PMunchAh yeah, for zoom in/out then a symbolic shortcut to + and - obviously makes the most sense
12:55:29PMunchBut mixing mnemonic/symbolic and positional shortcuts across layouts can be tricky
12:55:39*FromGitter quit (Remote host closed the connection)
12:55:39*oprypin quit (Quit: Bye)
12:55:56*oprypin joined #nim
12:56:08*FromGitter joined #nim
13:07:16*konvertex joined #nim
13:07:47*nsf quit (Quit: WeeChat 2.8)
13:12:45*Vladar quit (Quit: Leaving)
13:13:06FromDiscord<Recruit_main707> whats worth my time, create a flatbuffers nim code generator (which basically creates types, getters setters, etc for a given .fbs file), or transpile about 6000 lines of code (with a lot of spacing, so lets say its only 2500
13:21:03dcmertensI am working on interfacing with a C library. Is there a way to use the result of pkg-config for this library to set up compile-time parameters in nim?
13:21:20dcmertensI'm following along Nim in Action chapter 8
13:21:31dcmertensbut that assumes you know the explicit library, headers, etc
13:23:51dcmertensNote also that when I run pkg-config on my system, I get a *collection* of libraries that need to be linked
13:24:30dcmertensthe library I care about is only one of them, and so would probably be the dynlib
13:24:43dcmertensbut I need to dl_load the other libraries for the library I care about to function
13:24:53dcmertensso... how do we do that?
13:30:22dcmertensOh, and while we're at it, how would I set an additional include path, i.e. -I...
13:31:05dcmertensAgain, all of these bits of information are accessible from pkg-config, so if there is a generic way to execute pkg-config, that'd be great
13:35:19dcmertensBeen reading this, still not sure about these things, though: https://nim-lang.org/docs/manual.html#foreign-function-interface
13:38:50FromDiscord<SeanOMik> Is there a way I could make a proc that took any type as long as it inherits from a certain custom type. I tried this: ```nim↵proc registerListener[T: object of CustomType]``` but that doesn't compile
13:39:19FromDiscord<SeanOMik> `implementation of 'event_handler.registerListener() expected`
13:39:22FromDiscord<SeanOMik> Thats the error ^
13:39:31FromDiscord<SeanOMik> (edit) 'Thats the error ... ^' => 'Thats the errorfrom IntelliJ'
13:39:39FromDiscord<Rika> did you implement it
13:39:53FromDiscord<Recruit_main707> CustomType is enough iirc
13:40:07FromDiscord<Recruit_main707> `[T: CustomType]`
13:40:20FromDiscord<Rika> can you paste the whole proc though
13:42:28FromDiscord<SeanOMik> Oh sure
13:43:09FromDiscord<SeanOMik> `proc registerListener[T: CustomType]*(event: T, listener: proc())`
13:43:18FromDiscord<SeanOMik> Thats the whole definition
13:43:28FromDiscord<SeanOMik> I dont think you need the actual use of the proc
13:43:36FromDiscord<SeanOMik> (edit) 'use' => '"contents"'
13:44:07FromDiscord<SeanOMik> (edit) '`proc' => '```nim↵proc' | '```nim↵procregisterListener[T: ... CustomType]*(event:proc())```' => '```nim↵procregisterListener[T:object of' | 'proc())`' => 'proc())```'
13:45:14FromDiscord<SeanOMik> Oh
13:45:19FromDiscord<SeanOMik> I fixed it
13:45:38FromDiscord<SeanOMik> the `*` needs to be before the [`T: object of CustomType]`
13:45:44FromDiscord<Recruit_main707> try to not edit the messages, they get duplicated in irc
13:45:45FromDiscord<SeanOMik> (edit) '[`T:' => '`[T:'
13:45:51FromDiscord<SeanOMik> Oh oops
13:47:05alehander92dcmertens you can pass `--passC` to c compiler and `--passL` to the linker
13:47:10alehander92to pass options like include path
13:47:21dcmertensalehander92, great, thanks
13:47:23alehander92also i think `--gcc.exe` for custom path to gcc
13:47:34alehander92and something similar for custom path to linker
13:47:39alehander92useful for e.g. crosscompiling
13:49:43dcmertensis that the sort of thing that goes in the nims file?
13:50:23alehander92you can include it there yeah
13:51:04*narimiran joined #nim
13:58:21*fredrikhr joined #nim
14:06:05*Vladar joined #nim
14:16:03*a_b_m joined #nim
14:16:58*PMunch quit (Quit: leaving)
14:18:11*abm quit (Ping timeout: 265 seconds)
14:21:23*leorize quit (Ping timeout: 240 seconds)
14:22:07*solitudesf joined #nim
14:25:38*leorize joined #nim
14:28:48*a_b_m quit (Quit: Leaving)
14:29:14*Guest42915 quit (Ping timeout: 240 seconds)
14:30:20*dadada joined #nim
14:30:44*dadada is now known as Guest14602
14:31:25FromDiscord<Recruit_main707> how can i set a field/variable that expects an string or a seq to `nil`
14:32:31FromDiscord<Recruit_main707> and as a side-note, why the hell is `null` highlighted with nim, have it in mind @Gary M, this also happens with the default plugin
14:32:43FromDiscord<Recruit_main707> (in vscode)
14:43:39*haxscramper joined #nim
14:51:02*waleee-cl joined #nim
14:54:07*Guest14602 quit (Ping timeout: 246 seconds)
14:54:22Araqnobody knows why things are highlighted the way they are
14:54:50Araqa string or seq simply cannot be 'nil', you can use Option[string] instead
14:59:10FromGitter<rishavs> How would I define a variable as a hash set? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ doesnt works. [https://gitter.im/nim-lang/Nim?at=5ed1233e549761730b666b8a]
15:00:19*dadada__ joined #nim
15:01:05*FromDiscord quit (Remote host closed the connection)
15:01:19*FromDiscord joined #nim
15:11:45*oculuxe quit (Quit: blah)
15:12:00*oculux joined #nim
15:12:07*dddddd joined #nim
15:13:57FromGitter<kaushalmodi> How is Nimdoc defined internally?
15:14:40FromGitter<kaushalmodi> I am trying to understand this error when building docs on Travis: https://travis-ci.org/github/kaushalmodi/std_vector/builds/692596173#L1061
15:15:50FromGitter<kaushalmodi> I don't see that error when running it locally
15:25:56*endragor quit (Remote host closed the connection)
15:27:11*drewr quit (Ping timeout: 252 seconds)
15:31:45alehander92disruptek
15:31:49alehander92how is rocket going
15:38:42FromGitter<kaushalmodi> @timotheecour Would you have an insight why this error is happening on Travis (related to generating dochack.js): https://travis-ci.org/github/kaushalmodi/std_vector/builds/692596173#L1061 ⏎ ⏎ But not locally?
15:39:41FromGitter<kaushalmodi> Interestingly the same doc generation (using nim devel) is working fine on Travis for a different project: https://travis-ci.org/github/kaushalmodi/version/jobs/692535704#L519
15:40:12FromDiscord<Varriount> @Recruit_main707 The better question might be, why do you need the string/sequence to be nil?
15:41:21FromDiscord<Recruit_main707> i dont like checking for an empty string/seq as an uninitialised string/seq
15:41:24FromDiscord<Yardanico> @Recruit_main707 fake news, they don't get duplicated since at least a week
15:41:52FromDiscord<Yardanico> I mean edits are properly handled by ircord with edit diffing
15:41:52FromDiscord<Rika> use options then
15:42:01FromDiscord<Yardanico> ^^
15:42:12FromDiscord<Rika> doesnt change that the messages get spammed yardanico
15:42:27FromDiscord<Yardanico> Well there's no real difference
15:42:38alehander92 yardanico i love the edit functionality, good work
15:42:49FromDiscord<Yardanico> If you send a new message in discord to correct something it's still a new message
15:42:59FromDiscord<Yardanico> So what's the difference in the end?
15:43:12FromDiscord<Recruit_main707> there is
15:43:25FromDiscord<Recruit_main707> (edit) 'is' => '*is*'
15:43:28FromDiscord<Yardanico> What difference?
15:43:52FromDiscord<Recruit_main707> it gets updated in place in discord
15:43:57FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/715953584386080828/Screenshot_20200529-184348.jpg
15:44:08FromDiscord<Yardanico> @Recruit_main707 well that can't be done for IRC anyway
15:44:14FromDiscord<Yardanico> So this is out of the question
15:44:14FromDiscord<Recruit_main707> i know
15:44:21FromDiscord<Yardanico> I meant there's no difference for irc
15:44:37FromDiscord<Yardanico> If a user sends a correction message or the bot handles an edit properly
15:44:53FromDiscord<Recruit_main707> your solution s the best one available
15:59:27*zacharycarter joined #nim
15:59:48zacharycarterI'm wondering if going down this path of porting dear imgui to Nim was a good idea
16:00:12zacharycarterI mean I'm a couple thousand loc into the port at this point - so I almost have something that does the basics
16:00:33zacharycarterso I guess I'll keep going - but I'm not sure it was wise
16:02:28alehander92basically
16:02:56alehander92if you want to maintain your own UI lib as a full blown open source project
16:02:58alehander92it was wise
16:03:38alehander92if it was fun/you learned stuff: probably ok too
16:04:16zacharycarterwell I'm learning things as I go which is definitely a good thing
16:04:26zacharycarterI'm just not sure if I wanted to do the former haha
16:04:58zacharycarterbut I mean - I guess if people find it useful it will give me incentive to do so
16:05:09zacharycarteronce I get things drawing I think I'll have more motivation
16:19:25FromDiscord<Pixeye> @Zachary Carter dunno, I've just taken the lib from NIMGL for imgui. Works good: )↵https://i.gyazo.com/c1a92f164d34de02c19cf8517ebd59cf.mp4
16:19:32Amun_RaI'm writing my own retro image viewer just to learn nim, so far the adventure is quite nice
16:20:37zacharycarterwell yeah Pixeye - he's just wrapping cimgui
16:20:42zacharycarterthat's easy enough to do
16:20:52FromDiscord<Pixeye> ye, I've seen that
16:20:55zacharycarterand was the route I was going down
16:20:56Amun_Rahttps://retro.rocks/varez/atstneo.png https://retro.rocks/varez/jetpac.mp4 etc.
16:21:13FromDiscord<Pixeye> I also thought about porting it myself but it's not pragmatic )
16:21:25zacharycarterwhat's not pragmatic about it?
16:22:36FromDiscord<Pixeye> well, it's not an easy job. Moreover you will need to maintain it. And you have other parts of your engine/stuff to work on ↵+ games XDD
16:22:59FromDiscord<Pixeye> tons of work
16:23:58zacharycarterI don't think it's tons of work but yes there are other things I could work on other than this - what's more useful though and something that's deliverable?
16:24:17zacharycarterI stand a much better chance of delivering a immediate mode GUI library than a 3d game engine :P
16:24:20FromDiscord<mratsim> whats more useful is for Nim dev to not burn out 😉
16:24:50zacharycartertrue
16:25:30FromDiscord<Pixeye> why would you like to make a 3d engine?)
16:25:43zacharycarterwhat do you mean?
16:25:56FromDiscord<Pixeye> what is the purpose ?
16:26:14zacharycarterto make 3d games with?
16:26:18FromDiscord<Pixeye> btw I watched your previous attempts 🙂 learned a lot about nim from them 🙂 GG
16:26:29zacharycarteroh thanks - yeah me too haha
16:26:39zacharycarterI think only zengine was 3d
16:26:47zacharycarterbut yeah it's a good demonstration of how to write bad Nim code :P
16:27:19FromDiscord<mratsim> as long as it's pretty when rendering :p
16:27:19zacharycarterI don't think you really need an engine or much beyond opengl to write 2d games with Nim
16:27:27zacharycarterhaha
16:32:07FromDiscord<Pixeye> the thing is - would you make games with this engine?) sorry for that questions 🙂 ↵Its always good to "eat your own dog food" cause I've seen a lot engines that were made just to be made
16:32:28zacharycarterwell I don't think there's anything wrong with making something just to make it
16:32:36zacharycarteras long as you learn something during the process
16:32:42Amun_Raindeed
16:32:56FromDiscord<Pixeye> true
16:32:57zacharycarterI tend to try to make a game with every library / engine I make even if it's just something simple like space invaders or little demos of features
16:34:00zacharycarterbut yes my intention is to make a game with the project I'm working on now - so I'll probably end up shelving the imgui port and re-focusing on the game development part
16:34:06FromDiscord<Generic> this is the original meaning behind write games not engines
16:34:13FromDiscord<Pixeye> : )))
16:34:16FromDiscord<Pixeye> yes
16:34:23zacharycarteryeah and that advice IMO is bs
16:34:35zacharycarterit assumes everyone has the same goal
16:34:38FromDiscord<Generic> when people quote it they usually mean that you shouldn't make game engines
16:34:47zacharycarterI mean obviously
16:34:53FromDiscord<Generic> when the original context was, make game engines for games
16:35:12FromDiscord<willyboar> someone must
16:35:13zacharycarterwell I think having a game idea in mind gives your project direction for sure
16:35:40zacharycarterI don't plan on building an editor for this project - because I don't need one
16:35:41FromDiscord<Generic> https://geometrian.com/programming/tutorials/write-games-not-engines/
16:35:48zacharycartermost of the environments are going to be procedurally generated
16:35:59FromDiscord<Generic> " These “engines” tend to be little more than an inconsistent and messy amalgamation of random functionality that isn’t terribly practical, robust, or reusable. "
16:36:19FromDiscord<Generic> "The solution, even if you really want to make an engine, is to make a game instead"
16:39:09zacharycarterif you want to make a game just use UE4 or Unity or SDL2
16:39:14zacharycarteror Godot
16:39:21FromDiscord<mratsim> and C++?
16:39:24zacharycartersure
16:39:40zacharycarterI mean that's taking the blog post to its logical conclusion
16:39:57zacharycarterI just think the argument is flawed
16:40:16zacharycarterlike yes - game engines are complex and require a lot of domain specific knowledge to be functional
16:40:21zacharycarterbut you don't gain that knowledge by just writing games
16:40:21FromDiscord<mratsim> there is the same thing about cryptography, "don't roll your own crypto" then 20 years from now, no one knows how to write a crypto library
16:40:28FromDiscord<Pixeye> The thing is that many people who tries to write engine part ending trying to bit unity instead of focusing on the game
16:40:30zacharycarteryeah lol it's a dumb argument
16:40:42zacharycarterwell maybe they're not trying to write games!
16:40:51zacharycartermaybe they want to learn how to write a game engine
16:41:13FromDiscord<Generic> yeah the argument is you should make a game, to better understand what an engine needs
16:41:20FromDiscord<Generic> the engine you write for that game
16:41:31FromDiscord<mratsim> I would be interested to write a game engine, they I think I would need to write 1 or 2 games before to understand what is in the engine scope and what is so heavily custom that it shoud be on the game side
16:41:36zacharycarterbut he's saying don't write a game engine lol
16:41:40FromDiscord<mratsim> then*
16:41:47FromDiscord<Generic> no, he doesn't say that
16:42:14zacharycarterhe says write games and then by the time you're done writing the games you'll have a set of reusable software components that have practical applications
16:42:31zacharycarterokay - so I've written games with Unity or UE4 or whatever and I don't have any of that
16:42:44zacharycarterI guess it's time to start writing an engine
16:43:00FromDiscord<Pixeye> well to be honest to write GOOD game in Unity you will have to write like a lot of extra stuff : )
16:43:00FromDiscord<Generic> you should write the engine together with the game
16:43:12*thomasross_ joined #nim
16:43:12*thomasross quit (Killed (sinisalo.freenode.net (Nickname regained by services)))
16:43:12*thomasross_ is now known as thomasross
16:43:30zacharycarteryes and I agree with that assertion - it definitely helps to have a game project you're developing as you develop a game engine
16:43:52konvertexPlus, porting your own crappy engine to a console is hell.
16:44:10bungdoes js backend support `addr` ? I got `Error: internal error: genAddr`
16:44:12konvertexBtw. why isn't the sugar `=>` macro included in the prelude?
16:44:28FromDiscord<Generic> because it's sugar
16:44:36konvertexSo?
16:44:46konvertexfunc was included as well.
16:44:55FromDiscord<Generic> it's meant to be extra
16:45:11konvertexWhy? Are ther certain edge cases it can't handle?
16:45:15bungno func is differient
16:45:32FromDiscord<Clyybber> func isn't a macro
16:45:33FromDiscord<mratsim> @Bung there is no address on JS
16:45:38FromDiscord<Clyybber> but `=>` is
16:46:53bung@mratsim thanks, I check it from stream.nim it has ` when defined(js):var x = x;writeData(s, addr(x), x.len)`
16:47:09FromDiscord<mratsim> that's strange
16:47:26FromDiscord<mratsim> maybe that changed in the past 3 years? I almost never use the JS backend
16:47:36FromDiscord<Clyybber> AFAIK there is addr on js
16:47:59bungsome one create a numbers of fix in single PR
16:48:39bungthis month or last month I cant rember
16:48:44*Trustable quit (Remote host closed the connection)
16:48:49*tane quit (Quit: Leaving)
16:49:15bung@Clyybber do you have clue what cause `Error: internal error: genAddr`
16:49:43FromDiscord<zetashift> I feel like some people like working on engines more than working on games, and that's okay
16:50:21zacharycarterdamn no disruptek stream for 2 days now
16:50:23zacharycarteris he dead?
16:50:37konvertexHe's using perl6/raku now.
16:50:39FromDiscord<zetashift> I hope not, but the man moves in mysterious ways
16:50:40FromDiscord<Clyybber> bung: Hmm, it means there is some error in genAddr, so probably a request to generate addr, where the backend can't handle it yet
16:50:50FromDiscord<Clyybber> bung: Or is that error coming from the VM?
16:51:16FromDiscord<Clyybber> @timotheecour: Umm, did the doc fonts change somehow?
16:51:19bung`nim js src/nimpretty.nim ` this is full command I run
16:51:53FromDiscord<Clyybber> Hehe, trying to compile nimpretty with js ?:D
16:52:30bungyes, I seperate it to a new repo modified some code
16:52:38FromDiscord<Clyybber> ah, I see
16:53:15FromDiscord<Clyybber> you can try to use nim_temp js src/nimpretty.nim after doing ./koch temp
16:53:24FromDiscord<Clyybber> Then it will tell you where the error came from
16:54:43*opal quit (Ping timeout: 240 seconds)
16:54:43bungok , so finally I need use koch
16:55:03*leorize quit (Ping timeout: 240 seconds)
16:56:10*leorize joined #nim
16:56:57*opal joined #nim
17:00:07bungI got `.../nim-#devel/lib/pure/terminal.nim(943, 3) Error: undeclared identifier: 'writeStyled'`
17:00:25bung`../Nim/koch temp js src/nimpretty.nim ` am doing right ?
17:00:54Yardanicowhy "js"?
17:01:05Yardanicoi don't think nimpretty compiles with the js backend and you can clearly see that by the error message
17:01:13Yardanicoit's telling that writeStyled is undeclared for the js backend
17:01:30bungyeah but I dont import terminal module
17:01:40Yardanicobut nimpretty does
17:02:27Yardanicoalso nimpretty imports some compiler modules
17:02:34Yardanicoso I don't think it's easy to compile it with the js backend
17:03:00bungso `import ./nimpretty/compiler / [idents,lineinfos, msgs, syntaxes, options, pathutils, layouter]`
17:03:38bungI import using related path, the compiler import from Nim's ?
17:03:54Yardanicobung: I don't understand what you mean
17:04:06Yardanicowhat do you want to do? compile nimpretty with js backend? as I said it's not that easy
17:04:21bungI mean I've fully seperate nimpretty
17:04:30Yardanicoyou can't fully separate it from the compiler
17:04:36Yardanicosince nimpretty *depends* on some parts of the compiler
17:05:24alehander92<3
17:05:26bungI have all its imported from compiler dir in sub directory
17:05:26alehander92oh bung
17:05:27alehander92i get it
17:05:32alehander92no you cant do that
17:05:40alehander92if you want to use it to generate nim from your js tool
17:05:46alehander92you need to somehow use c backend code
17:06:16alehander92and renderer.nim iirc : not sure if nimpretty.nim is the newer renderer.nim (?)
17:06:27bungalehander92 then I need write node gyp , but I have no experience with it
17:07:03alehander92you're right i never thought about gyp
17:07:15alehander92you can always just invoke another binary compiled with c backend
17:07:20*ftsf quit (Ping timeout: 256 seconds)
17:07:42bungI modified almost all I need , then I checked my nim repo is old , that's so sad.
17:07:45alehander92and using json
17:07:56alehander92you can commit in a branch
17:07:57alehander92and rebase
17:08:10alehander92on the updated e.g. `devel`
17:09:17bungI just thought pretty is almost about string manipulation , so I trying to see if I can generate a js module
17:10:38alehander92well, nope it seems it is very hardly connected to the other compiler modules
17:10:53alehander92you need to use the c backend, sorry
17:15:06bunglet me change all import path to related
17:16:20dcmertensdumb question about for loops. How do I fix `for i in 0 .. ^N:` ?
17:18:38konvertexDid you mean `for i in 0 ..< N:`?
17:19:12*chemist69 quit (Ping timeout: 260 seconds)
17:19:25dcmertenskonvertex, yes! Thanks!
17:20:13*chemist69 joined #nim
17:22:12disruptek!last clyybber
17:22:12disbotclyybber spoke in 12#nim 28 minutes ago
17:26:01FromDiscord<Clyybber> disruptek: Sup!
17:26:24dcmertensI have constructed a cdouble array in nim and want to pass the "pointer to th array" in C parlance, to a C function that wants double*
17:26:39dcmertensdata.addr doesn't do it
17:27:02dcmertensthat gives an error: 'addr(data)' is of type: ptr array[0..100, cdouble]
17:27:12disrupteki'm working on this graph thing.. why don't we optimize any unique-node/unique-edge graph with ordinals into an array-based impl?
17:27:52dcmertensso, what's the most convenient way to build an array of C doubles and then hand them off to a C function that expects double * data?
17:30:35dcmertenshrm, do I need to do interesting type casting, as in this: https://nim-by-example.github.io/variables/type_casting_inference/
17:30:37Prestigedcmertens: like this? https://play.nim-lang.org/#ix=2nKd maybe
17:30:45*dcmertens checks
17:31:17dcmertensyeah, Prestige, you agree with the thing I found
17:31:24dcmertensI'll try!
17:33:51dcmertensPrestige, I think so
17:34:03dcmertensI'll know for sure after I figure out my linking issue. :-P
17:35:47bungoh I got the error where it comming from it calls `unSafeAddr`
17:37:50alehander92disruptek oh hi
17:38:04disruptekyeah, what do you think?
17:38:31alehander92isn't array*array a common repr for graphs in competition programming
17:39:08alehander92i wasn't good at all at that stuff but iirc "neighbour matrices" and stuff were popular
17:39:09disrupteki just dunno about the downsides. maybe it shouldn't be the default.
17:39:21alehander92adjacency*
17:39:54dcmertensnew question, I'm specifying --clib:ltdl but nim is translating that to a -l flag with an absolute path to my current working directory
17:40:14dcmertensso --clib:ltdl becomes -l/home/dcmertens/projects/2020/01-12-learning-nim/ltdl
17:40:35dcmertensbut it should just be -lltdl
17:41:31FromDiscord<Technisha Circuit> If i needed to name a proc with a double underscore, how would i do it?
17:43:42FromDiscord<Rika> i assume you do not
17:43:46FromDiscord<InventorMatt> I don't think you can. but in python that was for hidden variables which isn't a problem in nim
17:43:50FromDiscord<Rika> maybe stropping will work
17:46:49FromDiscord<Technisha Circuit> What's stropping?
17:48:02FromDiscord<Rika> backticks
17:50:42FromGitter<kaushalmodi> ~stropping
17:50:42disbotno footnotes for `stropping`. 🙁
17:52:22FromDiscord<Technisha Circuit> That didn't work when i tried it
17:56:11FromDiscord<Rika> then dont do it
17:56:50FromDiscord<willyboar> disruptek we have a conversation about docs in the nimconf channel
17:57:10*bung quit (Ping timeout: 246 seconds)
17:59:48FromDiscord<InventorMatt> @Technisha Circuit are you trying to create python magic methods syntax in nim?
18:00:43*avatarfighter joined #nim
18:02:01FromDiscord<Technisha Circuit> Maybe :p
18:02:19FromDiscord<Technisha Circuit> I don't want to transpile it though
18:12:32FromDiscord<queersorceress> hey so i'm tinkering with building a lua <--> nim bridge and i'm trying to figure out how to make a macro resolve a function pointer from the procdef nimnode, is that possible?
18:14:12*dadada__ quit (Ping timeout: 256 seconds)
18:15:19*dadada joined #nim
18:15:42*bjorob_ joined #nim
18:15:42*dadada is now known as Guest43919
18:18:37FromDiscord<dom96> You likely want to generate an AST corresponding to the code that will resolve the function pointer
18:20:44FromDiscord<SeanOMik> sent a code paste, see http://ix.io/2nKv
18:20:45FromDiscord<Clyybber> @queersorceress FYI disruptek is also building a lua <--> nim bridge
18:20:51*avatarfighter left #nim ("Leaving")
18:20:53*Avatarfighter_ joined #nim
18:21:20FromDiscord<dom96> @SeanOMik top-level procs aren't closures, I think that's the problem
18:21:29FromDiscord<SeanOMik> closures?
18:21:32FromDiscord<SeanOMik> What are closures?
18:22:12FromDiscord<dom96> https://nim-lang.org/docs/manual.html#procedures-closures
18:22:15Yardanicofunction with an environment
18:23:20FromDiscord<SeanOMik> Hm
18:23:21alehander92ooo
18:23:24alehander92nimconf!
18:23:27alehander92what are the talks
18:24:08FromDiscord<SeanOMik> So the only other way would be if I feed it "lambda" functions?
18:24:34FromDiscord<dom96> you can also mark your proc type with {.nimcall.}
18:24:42FromDiscord<dom96> (the one in the Table)
18:25:05FromDiscord<queersorceress> @Clyybber like, an actually bridge, not just wrapping the C header?
18:25:14FromDiscord<Clyybber> an actual bridge
18:25:21FromDiscord<SeanOMik> Awesome, its working now
18:25:23FromDiscord<SeanOMik> Thanks
18:26:01FromDiscord<Clyybber> @queersorceress Even had a macro that allowed you to write lua inline
18:26:08FromDiscord<Clyybber> Without quotes :p
18:26:19*bung joined #nim
18:26:20FromDiscord<Clyybber> obviously not completely possible since # is comment in nim
18:26:51FromDiscord<queersorceress> you have a link to it?
18:27:28FromDiscord<Clyybber> https://github.com/disruptek/lunacy
18:27:54FromDiscord<Clyybber> its WIP tho, but maybe you want to join forces
18:28:19FromDiscord<Clyybber> disruptek: ping :D
18:28:55disrupteksure, go nuts.
18:29:13zacharycarterno stream today disruptek?
18:29:23disruptekjob hunting.
18:29:27zacharycarteroooo
18:29:43Yardanicodisruptek: status.im :P
18:29:49Yardanico50% /s
18:30:09zacharycartersomeone pay disruptek to finish IC :P
18:30:20disrupteki need the kind of money that nim doesn't pay.
18:30:27zacharycarterI'll pitch in $100
18:30:36zacharycarteroh that kind of money...
18:30:51*bung quit (Ping timeout: 256 seconds)
18:30:59Yardanicodisruptek: then java? :P
18:31:18disruptekclojure if i can.
18:31:22Yardanicoor just write in Nim and pretend it's your own C code
18:31:25zacharycarterScala
18:31:27Yardanicoproblem solved
18:34:25Avatarfighter_Lmao yardanico
18:35:38FromDiscord<dom96> Hrm, at this point the biggest memory hog on my server is prometheus
18:35:42Yardanicoxd
18:36:10FromDiscord<SeanOMik> Is there a way I could feed a type into a proc, but not an actual variable of the type?
18:36:11FromDiscord<dom96> Anyone know how to limit its memory usage?
18:36:21Yardanico@SeanOMik typedesc[type]
18:36:26Yardanicoor just typedesc
18:36:59Yardanicohttps://play.nim-lang.org/#ix=2nKG
18:37:10Yardanicowhen comparing you have to use "when" instead of "if" because typedesc doesn't exist at runtime
18:37:33FromDiscord<Clyybber> @dom96 You can limit how much chunks it keeps in memory
18:37:43FromDiscord<dom96> how?
18:37:54Yardanico@SeanOMik or even stuff like that https://play.nim-lang.org/#ix=2nKJ
18:38:17FromDiscord<Clyybber> @dom96 `-storage.local.memory-chunks=XXX`
18:38:27FromDiscord<Clyybber> But maybe theres a better way with v2
18:38:49*Guest43919 quit (Ping timeout: 246 seconds)
18:39:07*abm joined #nim
18:39:13FromDiscord<Clyybber> AFAIR its about 2-3kiBs per chunk
18:39:21Yardanico@SeanOMik and for more info there's https://nim-lang.org/docs/manual.html#special-types-typedesc-t :)
18:39:40*Avatarfighter_ quit (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in)
18:40:01FromDiscord<dom96> Looks like `storage.local.target-heap-size` is the new hotness
18:40:39FromDiscord<Clyybber> I think thats gone in v2
18:41:33FromDiscord<SeanOMik> If it doesn't exist at runtime then I dont think it will work in my case
18:41:35FromDiscord<dom96> ffs
18:41:40Yardanico@SeanOMik what do you want to do?
18:41:51Yardanicoif you want heterogenous types you might try object variants
18:41:52FromDiscord<SeanOMik> I'm making an event system
18:42:01Yardanicoobject variants might work for your case :)
18:42:08FromDiscord<SeanOMik> Okay
18:42:17*Avatarfighter joined #nim
18:42:31FromDiscord<SeanOMik> But would that require a variable of the custom type?
18:42:35Yardanicoyes
18:42:39FromDiscord<SeanOMik> Hm
18:42:42Yardanicoif i understand you correctly
18:42:52Yardanicoor you can use inheritance
18:42:55Yardanicowith methods
18:43:04Yardanicobut many people prefer object variants :P
18:43:19FromDiscord<SeanOMik> I wanted something like this (from C++) ```cpp↵registerEvent<CustomEvent>(lambda)```
18:43:21Yardanicoe.g. see how a json tree is represented with an object variant
18:43:22Yardanicohttps://nim-lang.org/docs/json.html#JsonNodeObj
18:43:28FromDiscord<dom96> https://stackoverflow.com/questions/58697585/prometheus-2-x-limit-memory-usage no answers 😦
18:43:46*dadada joined #nim
18:44:10*dadada is now known as Guest75956
18:46:03*bung joined #nim
18:47:03AvatarfighterJust curious to know but its not possible to make a proc where one parameter can be multiple types right?
18:47:12YardanicoAvatarfighter: you can have generics
18:47:21Yardanicobut they're instantiated at compile-time of course
18:47:25AvatarfighterYeah hm
18:47:29Avatarfighterok thank you
18:47:33Yardanicohttps://nim-lang.org/docs/manual.html#generics
18:47:57*onionhammer joined #nim
18:48:16AvatarfighterYeah I've used generics before I just didn't make my proc to work as a generic which is going to be fun to do :P
18:50:28*bung quit (Ping timeout: 256 seconds)
18:53:41*bung joined #nim
18:53:44*Vladar quit (Quit: Leaving)
18:58:28*bung quit (Ping timeout: 256 seconds)
18:58:46*bung joined #nim
19:00:26*aeverr joined #nim
19:02:51*leorize quit (Remote host closed the connection)
19:03:17*leorize joined #nim
19:03:30*bung quit (Ping timeout: 256 seconds)
19:03:34*Guest75956 is now known as dadada
19:04:25dadadawhen getting JsonNodes that are strings and wanting them to be just strings
19:04:42dadadayou often get "string", so with quotes
19:04:52dadadais there some inbuilt easy quotes removal?
19:04:58FromDiscord<SoopaKhell> It seems that `os.setCurrentDir` is failing me (https://nim-lang.org/docs/os.html#setCurrentDir%2Cstring)↵I am rewriting my own version of `cd` in nim, but when i run `setCurrentDir(...)` on a directory it doesn't change the directory in my shell after the program execute (I am using zsh.)↵Any advice would be appreciated.
19:05:04dadadabecause I think I've rolled my own now multiple times and it is getting annoying now
19:05:34FromDiscord<SoopaKhell> (edit) 'execute' => 'executes'
19:06:38YardanicoI think setCurrentDir sets the cwd for the program itself
19:06:40dadadaSoopaKhell: I wouldn't expect the directory in your shell to change, when the program has done its job. I don't believe there are any programs that can do that, it's also a security measure
19:06:40Yardaniconot for the shell
19:06:48Yardanicodadada: "cd" :P
19:06:58Yardanicoah right it's builtin into shell
19:06:59Yardanicoim stupid :D
19:07:23Yardanicothere's a way you can do that though, but it's a bit hacky
19:07:35Yardanicorun a shell command from your program :D
19:07:35FromDiscord<SeanOMik> yardanico, I dont want to create a variable for the custom type that I would have to feed into the method.
19:07:42Yardanico@SeanOMik ??
19:07:51FromDiscord<SoopaKhell> Strange↵Is it possible to make a script that my program would invoke to change the dir
19:08:00FromDiscord<SeanOMik> We were talking about the event system I wanted to make
19:08:01FromDiscord<SeanOMik> Above
19:08:02FromDiscord<SoopaKhell> I also tried execShellCmd
19:08:22FromDiscord<SeanOMik> https://media.discordapp.net/attachments/371759389889003532/716005011225575434/unknown.png
19:08:23FromDiscord<SeanOMik> Not sure if irc can show images
19:08:29Yardanicoit can
19:08:30*bung joined #nim
19:08:30FromDiscord<SeanOMik> But there's a screen shot
19:08:33FromDiscord<SeanOMik> Okay cool
19:08:33dadadaSoopaKhell: you're creating a "subshell", that has no effect on the shell the program was executed from
19:08:47FromDiscord<SoopaKhell> Yeah, that seems to be the case
19:09:04Yardanico@SeanO well try inheritance then I guess? I really don't understand what you're trying to achieve (I mean how the code will look like)
19:09:14FromDiscord<SeanOMik> Uhhh
19:09:17FromDiscord<SeanOMik> I have it on github I think
19:09:22FromDiscord<Rika> dadada: use getStr instead of $
19:09:29FromDiscord<Rika> if the node is a string literal
19:09:46dadadaRika: thanks, I knew it had to be simpler!
19:10:04FromDiscord<SeanOMik> Okay here: https://gist.github.com/SeanOMik/9934b22981e7201b201193c9a70b33f5
19:10:06FromDiscord<Rika> $ gives the json representation of any json node 😛
19:10:13FromDiscord<Rika> yeah its confusing
19:10:38FromDiscord<SeanOMik> I want to be able to register an event listener
19:10:51FromDiscord<SeanOMik> I want to feed it a event type
19:10:57FromDiscord<SeanOMik> Actually, that gist is out of date
19:11:21FromDiscord<SeanOMik> Okay I just updated the gist
19:12:37Yardanicofor inheritance you need to have "ref object"
19:12:47Yardanicoif you want to runtime dispatch I mean
19:12:56*bung quit (Ping timeout: 258 seconds)
19:13:18FromDiscord<SeanOMik> Okay
19:14:05FromDiscord<SeanOMik> Wait, change the type to `ref object`?
19:14:10FromDiscord<SeanOMik> Like: ```nim↵type↵ BaseEvent* = ref object of RootObj↵ name*: string```
19:14:16Yardanicoyeah, but you also need to do more stuff
19:14:32YardanicoI don't exactly think it would be easily possible to do what you want with a table of procs
19:14:39Yardanicoprocs aren't runtime dispatch
19:14:50Yardanicowell there's a way around it I think
19:14:57FromDiscord<SeanOMik> runtime dispatch?
19:15:13Yardanicohttps://nim-lang.org/docs/manual.html#multiminusmethods
19:16:22FromDiscord<SeanOMik> So a table of methods instead of procs
19:16:30YardanicoI doubt that this is possible :D
19:16:50Yardanicodid you check other examples?
19:16:51Yardanicolike https://github.com/al-bimani/eventemitter
19:17:19FromDiscord<SeanOMik> Oh, I didn't see this example
19:17:21Yardanicoor https://gitlab.com/xomachine/metaevents or https://github.com/tulayang/asyncevents
19:17:52*bung joined #nim
19:19:59*haxscram` joined #nim
19:21:05*haxscramper quit (Ping timeout: 246 seconds)
19:22:12*bung quit (Ping timeout: 256 seconds)
19:22:53*bung joined #nim
19:24:14*haxscram` quit (Ping timeout: 246 seconds)
19:27:39*bung quit (Ping timeout: 260 seconds)
19:28:26*bung joined #nim
19:31:24PrestigeIs there a reason Nim doesn't have a do while? I know it is easy to implement, I'm just curious
19:33:34Yardanicodoes it make sense to have a lock if I know that only 1 thread will acquire that lock anyway?
19:33:39FromDiscord<Rika> because do is already a keyword 😛
19:33:45FromDiscord<Rika> i kid. i do not know
19:33:57PrestigeYardanico: if you know for a fact then no
19:34:03YardanicoPrestige: yeah I guess so
19:34:10Yardanicobecause spinny used a lock to write the spinner in a thread
19:34:19Yardanicobut since it's only 1 instance running at a time it doesn't make sense
19:34:28Yardanico(Unless I add ability to have multiple spinners at a time lol)
19:34:37Yardanicoor maybe I should add spinners to https://github.com/de-odex/suru
19:34:54PrestigeYeah, plan for the future but no need to over engineer it
19:35:00Yardanicoalthough spinny doesn't require you to update the spinner
19:35:04FromDiscord<Rika> :thonk:
19:35:05Yardanicosince it starts the spinner in a separate thread
19:35:10Yardanicoso you just do
19:35:19Yardanicospinner.start(); do work; spinner.success("all done!")
19:35:28FromDiscord<Rika> should i make suru also do that?
19:35:45YardanicoI mean you could if you use threads and channels I guess
19:35:49FromDiscord<Rika> also i kinda dont wanna touch it right now since i still have no solid idea on how to tackle formatting
19:36:31Prestige@Rika I'm probably just gonna go write a doWhile template that takes the condition up front, I was just surprised it didn't exist already
19:36:37PrestigeUnless I just am not finding it lol
19:36:43FromDiscord<Rika> we dont have one lol
19:37:01FromDiscord<InventorMatt> is there an easy way with existing nim to generate new nim files. like converting templates into a new expanded nim file?
19:37:05*bung quit (Ping timeout: 258 seconds)
19:37:06dom96it's an archaic construct that most of the time is not needed
19:37:22PrestigeYeah I very rarely need or want it
19:37:51FromDiscord<Rika> @InventorMatt i exploited macros' `repr` and file writing to do that lmao
19:38:38FromDiscord<Rika> basically generate the new code in a macro, then write the result of `result.repr` into a file. ez new nim file 😛
19:38:50FromDiscord<Rika> just make sure you dont have generated symbols 😛
19:39:30*bung joined #nim
19:39:32FromDiscord<InventorMatt> okay, thank I'll look into trying that
19:42:00Yardanico@Rika spinny is that
19:42:00Yardanicohttps://asciinema.org/a/RBw1S4LA5EzBzwU0YVwHZZbs6
19:42:18Yardanicothat's for https://gist.github.com/Yardanico/343154579666a62a82336385fd491737
19:42:29FromDiscord<Rika> spinny is what?
19:42:34Yardanicolink
19:43:24FromDiscord<Rika> yeah you;re demoing it
19:43:26FromDiscord<Rika> i can see
19:43:31FromDiscord<Rika> from tthe preview
19:43:51Yardanicoit's 1000% inspired by https://github.com/sindresorhus/ora
19:43:55*bung quit (Ping timeout: 246 seconds)
19:44:17FromDiscord<Rika> oraoraoraoraoraora
19:44:19YardanicoI mean even spinners in spinny are from https://github.com/sindresorhus/cli-spinners
19:44:33Yardanicoalthough I converted them into a native nim array from json in my fork
19:44:45Yardanicohttps://github.com/Yardanico/spinny/blob/master/src/spinny/spinners.nim
19:46:11FromDiscord<Rika> looking at cli spinners' gif made me a bit dizzy
19:46:19Yardanicolol
19:46:31*bung joined #nim
19:50:50*bung quit (Ping timeout: 246 seconds)
19:50:58*abm quit (Ping timeout: 272 seconds)
19:50:58*dcmertens quit (Ping timeout: 272 seconds)
19:54:24*bung joined #nim
19:57:59FromDiscord<Technisha Circuit> How would i use Nim with braces instead of indenting?
19:58:42Yardanicoyou can't
19:58:49FromDiscord<Technisha Circuit> Oof
20:00:56FromDiscord<Technisha Circuit> How hard would it be to make it so i can use braces instead of indentations in Nim?
20:01:00FromDiscord<Rika> you can if you can singlehandedly fix the syntax skin support
20:01:05FromDiscord<Pixeye> embrace yourself! : )
20:01:05Yardanicomaintain your own syntax @Technisha
20:01:09FromDiscord<Rika> it would probably extremely hard
20:01:14FromDiscord<Rika> be* extre...
20:01:19Yardanicosyntax skins were removed but you can maintain it yourself if you're willing to
20:01:23Yardanicoin your fork of Nim I suppose
20:01:30Yardanicoor some nim braces -> nim indentation transpiler
20:01:45FromDiscord<Pixeye> to be honest I don't see any reason why u need braces
20:01:50FromDiscord<Pixeye> in nim
20:01:53FromDiscord<Rika> matter of preference
20:02:06FromDiscord<Pixeye> ok then I don't want braces in C# : )
20:06:57FromDiscord<Gary M> Braces are fairly ugly
20:09:12FromDiscord<Rika> already said this but matter of preference
20:09:19FromDiscord<Pixeye> or language
20:09:26disruptekor sexual proclivity.
20:09:51*sschwarzer joined #nim
20:10:15FromDiscord<Technisha Circuit> Uh-
20:10:19FromDiscord<Technisha Circuit> Okay then-
20:10:48FromDiscord<Technisha Circuit> I think I am gonna be able to
20:12:57FromDiscord<Technisha Circuit> (edit) 'I think I am gonna be able to ... ' => 'I think I am gonna be able toimplement braces in Nim with enough effort'
20:13:24bung`ord` on string means what ?
20:13:31Yardanico@Tecnisha they already existed
20:13:45Yardanicobung: it doesn't exist for a string type
20:14:09Yardanicofor "char" it returns the integer value of an ascii character
20:14:15Yardanico!eval echo ord('A')
20:14:17NimBot65
20:14:28Yardanico!eval echo chr(65)
20:14:31NimBotA
20:15:08bungI got editor hint it as ` range 0..286(TSpecialWord)`
20:15:10FromGitter<sheerluck> !eval echo chr(128572)
20:15:12NimBotCompile failed: /usercode/in.nim(1, 10) Error: cannot convert 128572 to range 0..255(int)
20:15:19Yardaniconim chars are ascii chars
20:15:20Yardaniconot unicode
20:15:25FromGitter<sheerluck> :(
20:15:39Yardanico!eval import unicode; echo Rune(128572)
20:15:42NimBot😼
20:15:53FromDiscord<Rika> why.
20:15:58Yardanicowhy what
20:16:04FromDiscord<Rika> that emoji\
20:16:06Yardanicoask sheerluck
20:16:49Yardanicook figured out for spinny it would be better if I have each spinner as a different constant instead of an array of consts
20:16:56dom96!eval import unicode; echo Rune(128081)
20:16:59NimBot👑
20:17:01Yardanico:P
20:17:05Yardanicothis way dead code elimintation works in the nim compiler itself
20:17:27sschwarzerdom96 :-D
20:21:19FromDiscord<Elegant Beef> What is the nim version of stat?
20:21:39YardanicogetFileInfo ?
20:21:43Yardanicoos
20:21:50FromDiscord<Elegant Beef> danke
20:21:54Yardanicoyou can also use "stat" directly from the posix module
20:24:04*narimiran quit (Ping timeout: 265 seconds)
20:25:31bungI might have to give up the idea compile nimpretty to js , always give error that not easy to figure out.
20:25:34sschwarzerYardanico: Would that work on Windows?
20:25:40Yardanicosschwarzer: stat? no
20:25:42YardanicogetFileInfo? yes
20:25:47Yardanicowindows is'nt exactly posix :P
20:26:13sschwarzerYardanico: That's my point. I think if in doubt, a platform-neutral API should be preferred. :)
20:26:25Yardanicowell I know, but maybe they needed some stat-specific stuff
20:26:28*smitop joined #nim
20:27:30sschwarzerYardanico: By the way, I asked because some time ago I was surprised when someone told me that `mkstemp` in the `posix` module would also work on Windows.
20:27:32ZevvIn case anyone is interested in my async/coroutine adventures: I have a clean tiny async implementation based on ucontext coroutines that is working, and I'm no doing some experiments to see if I can make a macro for continuation passing transformations, which would allow very lightweight coroutines without closures, features or any support from the OS: https://github.com/zevv/nimcsp. It hurts my brain, so if
20:27:38Zevvanyone wants to help think about this stuff, more then welcome!
20:28:23FromDiscord<Clyybber> typo in the reponame :p
20:28:26Yardanicosschwarzer: yes, windows implements that
20:28:30Yardanico@Clyybber nah
20:28:37FromDiscord<Clyybber> oh, I'm blind
20:28:42FromDiscord<Clyybber> haha
20:28:44Yardanico"Continuation style passing tests" :P
20:29:03FromDiscord<Clyybber> oh
20:29:04Zevvyeah, I just re-read that
20:29:04FromDiscord<Clyybber> but
20:29:22FromDiscord<Clyybber> Hmm, I more commonly heard CPS for Continuation-passing style
20:29:27FromDiscord<Clyybber> since you are passing the continuation
20:29:32FromDiscord<Clyybber> and not the style :p
20:30:12Yardanicobtw is it a good thing to include license of https://github.com/sindresorhus/cli-spinners if I used https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json from there?
20:30:23YardanicoLike include the license in the while where I have nim version of the same .json file
20:30:27Yardanicos/while/file
20:30:28sschwarzerYardanico: But given it's in the `posix` module, I wouldn't have even looked there for a portable version. (Sorry for being nitpicky. :) )
20:30:31Zevvtitle fix0red :)
20:31:22bungwhy it ends with tests? thought like test framework..
20:31:33Yardanicobung: what exactly?
20:31:46bungI mean the csp repo
20:31:55Yardanicowell it's testing this idea
20:31:55bung`Nim CPS (Continuation Passing Style) tests`
20:31:59Yardanicohence "tests"
20:32:08*tdc quit (Ping timeout: 256 seconds)
20:32:08bungok
20:33:35Zevvcmon guys, stop making fun of me
20:33:38Zevvdo that when I'm not here
20:33:47bunghaha
20:33:50YardanicoZevv: i worship npeg :P
20:34:08Yardanicoe.g. https://github.com/Yardanico/nim-snippets/blob/master/pkgraph/parse.nim#L10
20:34:25Yardanicosimple parser to parse any type of .nimble (ini or nims) or .babel file for all require statements
20:34:56Yardanicoalso https://github.com/Yardanico/telenim/blob/master/src/telenim/types_gen.nim but it's uglier :P
20:35:03Yardanicohttps://github.com/Yardanico/telenim/blob/master/src/telenim/types_gen.nim#L78
20:35:05FromDiscord<Rika> i recommend the word "experiment" instead of "test"
20:35:26ZevvRika: done :)
20:35:39ZevvYardanico: Yeah, I've seen you mention that some times over the last weeks
20:36:00ZevvEvery time someone types 'npeg' on #nim my terminal goes *bip* and I get a yellow line in my logs
20:36:08Yardanicoyeah, also ircord uses it for handling mentions/emojis/channels
20:36:09Zevvgreat to hear it's working well for you!
20:36:26Yardanicoin ircord it's this https://github.com/Yardanico/ircord/blob/master/src/utils.nim#L22
20:36:28ZevvAnd you never even filed a bug report
20:36:34YardanicoZevv: because it worked :P
20:36:40Yardanicoalthough sometimes I was confused for a few mins by error messages
20:36:59Zevv*please* let me know about these cases
20:37:15ZevvI'm trying pretty hard to make these reliable
20:37:38Zevvbecause there is no explicit control flow, it's pretty hard to debug a grammar for a user
20:37:46YardanicoI think mostly I had issues with "repeat argument matches empty subject"
20:37:47Zevvso helpful error messages are pretty useful here
20:37:58Yardanicomaybe because I still don't fully understand PEGs :D
20:38:45ZevvAh good point; let me see if I have something about that in the docs
20:39:58ZevvNope, will add that. That error basically means that NPeg figured out in advance that your grammar would match something without consuming any input. If it's not consuming anyting, it will happily stall at the same place, successfulling matching the same thing forever
20:40:06Zevvcall it "hanging", if you will
20:40:11Yardanicooh
20:40:22Yardanicoendless loop, interesting :P
20:41:19ZevvIf you make a grammar and tell it to "match a number, a string or zero whitespace", it will do that. But if there is no number or digit, it will then match zero whitespace and not advance through the subject
20:41:57ZevvThis can happen in a lot of cases, but only a few are recognized by analysis beforehand.
20:42:00*abm joined #nim
20:42:27FromDiscord<SeanOMik> How would I use object variants and make sure that the object inherits from a certain custom type?
20:44:08FromDiscord<mratsim> the "kind" tag are set by yourself
20:45:07FromDiscord<SeanOMik> Well I guess i also need to find out how to use object variants
20:46:19ZevvThis can happen in a lot of cases, but only a few are recognized by analysis beforehand.
20:46:57FromDiscord<Rika> zevv is lagging
20:47:16Zevvno, zevv is doing history-up-enter in the wrong terminal
20:47:27Yardanico:D
20:51:35Avatarfighterhaha
20:52:20*sasamba joined #nim
20:52:23Prestigehm so I made a template for a do while construct, is there some way I could have `continue` return back to the condition?
20:52:47YardanicoPrestige: well if you map do/while to a while loop you have continue for free, no?
20:53:37Prestigemaybe it's just nimsuggest, wonder if it would compile
20:54:35YardanicoPrestige: isn't do while just this? https://gist.github.com/Yardanico/c310d016b9ace4e446ba5ed544e9dcf2
20:54:48sasambaWtf, i can't just make timeout in AsyncHttpClient, but can in HttpClient. How to make it myself?
20:54:53Yardanicowell there might be issues with scoping though
20:54:59Yardanicosasamba: you can use withTimeout from asyncdispatch
20:55:08Yardanicohttps://nim-lang.org/docs/asyncdispatch.html#withTimeout%2CFuture%5BT%5D%2Cint
20:55:50sasamba🤔
20:55:51sasambaThx!
20:55:56*sasamba left #nim (#nim)
20:56:05PrestigeYardanico: see https://play.nim-lang.org/#ix=2nLj
20:56:23Prestigecan't use continue
20:56:52Yardanicosacredfrog: something like https://gist.github.com/Yardanico/aa761852de6b32d8be623bc23b8171af
20:56:59Yardanicooh shiet he already left lol
20:57:10Yardanicosorry sacredfrog I didn't mean to ping you :P
20:57:53YardanicoPrestige: oh I see
20:58:01YardanicoI know how
20:58:52YardanicoPrestige: something like https://play.nim-lang.org/#ix=2nLk ?
20:59:13Yardanicoalthough it's not reliable either :D
20:59:41Prestigecan only continue once?
20:59:45Yardanicono?
20:59:55Yardanicoit's just that your code will looop forever
20:59:58Prestigeoh
21:00:01Yardanicosince you just continue if x == 3
21:00:04Yardanicoand don't increase x
21:00:07Yardanicoso you continue forever
21:00:26Prestigeyeah
21:01:32Prestigewas thinking of your example though, would that work as expected?
21:03:16Prestigehuh I guess it does
21:03:22PrestigeI thought it would break down at some point
21:03:28YardanicoPrestige: yeah i was surprised that it works too a bit :P
21:03:56Prestigeoh I found a weird way to break it actually
21:04:16Prestigehttps://play.nim-lang.org/#ix=2nLn
21:04:22Yardanicooh wait
21:04:29YardanicoPrestige: what should it output?
21:04:42PrestigeIn that case I would want it to not output anything
21:04:54YardanicoPrestige: https://play.nim-lang.org/#ix=2nLo
21:04:55Prestigebut the body is always executed twice
21:05:01*disbot quit (Ping timeout: 264 seconds)
21:05:04*disruptek quit (Ping timeout: 272 seconds)
21:05:09Prestigeoh nice
21:05:23Prestigethat's much better
21:05:34YardanicoI stole it from https://stackoverflow.com/questions/743164/emulate-a-do-while-loop-in-python :D
21:05:41Prestigehehe
21:05:42Yardanicofirst 4 lines of code in the first answer
21:05:47PrestigeI like it
21:05:57*abm quit (Quit: Leaving)
21:06:01*disbot joined #nim
21:07:01*disruptek joined #nim
21:07:40YardanicoPrestige: to be a bit more safe you can even do template doWhile(condition: bool, body: untyped)
21:07:46Yardanicoto check that the condition indeed returns a boolean
21:08:01Yardanicowell it'll error at compile-time either way
21:08:13Yardanicobut with that the error will be a bit better
21:08:34PrestigeThanks
21:08:54PrestigeMaybe we should have this added to the tutorial section for while loops
21:10:24Yardanicohttps://forum.nim-lang.org/t/1970
21:11:25Yardanicoexpr -> typed, stmt -> untyped btw
21:11:27Yardanico(mostly)
21:11:37Prestigeinteresting
21:17:20*bjorob_ quit (Quit: leaving)
21:17:43*bjornrob1rg joined #nim
21:17:44FromDiscord<dom96> @Yardanico hah, the amount of people that think you want to change syntax highlighting to yellow
21:17:50YardanicoXD
21:18:05Yardanicoguess I need to find an orangish yellow
21:19:37*Jesin quit (Quit: Leaving)
21:19:57FromDiscord<a2> Is there a discord library in Nim?
21:20:03Yardanicohttps://github.com/krisppurg/dimscord
21:20:23Yardanicothe bot which bridges IRC and Discord uses it
21:20:29Yardanico(FromIRC on discord)
21:20:35FromDiscord<a2> oo nice
21:21:28FromDiscord<a2> Is it finished though?
21:21:41Yardanicowell, nothing is finished in our world, but it works pretty well (devel branch)
21:21:44Yardanicobut no, it's not finished :P
21:21:47Yardanicoping @KrispPurg btw
21:21:53*Jesin joined #nim
21:22:55FromDiscord<a2> He seems offline.
21:23:08Yardanico@dom96 what do you think about #B8860B ?
21:23:16Yardanicoit passes the proximity test
21:23:27Yardanicoit's darkish yellowish orange :D
21:23:33Yardanico"Dark Goldenrod"
21:23:45Yardanico#DAA520 (Goldenrod) didn't pass the proximity test sadly :(
21:24:03FromDiscord<dom96> Send me what that looks like, too lazy to look it up 😛
21:24:14Yardanicoah right one sec
21:24:15FromDiscord<dom96> would be nice if Discord detected these
21:24:48*solitudesf quit (Ping timeout: 258 seconds)
21:25:40Yardanicoit looks similar to java though
21:25:41Yardanicohttps://i.imgur.com/OJADzJR.png
21:26:39FromDiscord<dom96> That's basically brown to me
21:26:46FromDiscord<dom96> Don't like it
21:27:01FromDiscord<Generic> I've said it the last time and I say it again
21:27:13FromDiscord<Generic> I don't see the point of changing something people are already familiar with
21:27:45FromDiscord<Generic> if there's no particular advantage of it
21:27:56Yardanicothe advantage is branding
21:28:29FromDiscord<Generic> to color needs to be shifted around to be distinct anyway
21:28:47Yardanicowell find a color which isn't already there :D
21:28:47Yardanicohttps://github.github.io/linguist/
21:29:13Yardanicoeven some "DM" language is really similar to current nim color
21:29:46FromDiscord<Generic> yes, exactly it's not ideal how ever you put it
21:29:59Yardanicobut that doesn't mean it should be kept the same
21:29:59FromDiscord<Generic> except the current situation has the advantage that it's established
21:30:58FromDiscord<Generic> also no language except maybe Go has a color consistent with their branding
21:31:03YardanicoJS does
21:31:14FromDiscord<Generic> ok, then JS too
21:31:20Yardanicoand quite a lot of other langs too
21:31:34FromDiscord<willyboar> ruby
21:31:38FromDiscord<Generic> a lot of the major languages have completely different colors
21:31:45YardanicoPython
21:31:47Yardanicoblue is the snake blue
21:31:56Yardanicohttps://www.python.org/ you can see it's mostly blue
21:32:10FromDiscord<willyboar> yeap
21:32:24FromDiscord<Recruit_main707> boolang also does
21:32:33FromDiscord<Recruit_main707> (despite being so unkown)
21:32:39Yardanicoyeah it's a cool little language
21:32:42Yardanicosad that unity dropped it
21:32:55FromDiscord<Generic> ok, I have to admit it's mostly the language I'm active in (the uncool ones like C++ or Java) which have colors which don't match it's branding
21:32:56Yardanicook lemme say this
21:32:56FromDiscord<willyboar> crystal too
21:32:58FromDiscord<a2> Zig has orange color just like the logo
21:33:12YardanicoV (sic!) has the consistent color with it's branding :P
21:33:18FromDiscord<Recruit_main707> i wouldnt have discovered nim if boo was actively supported though :D
21:33:24FromDiscord<a2> Language racist
21:33:37Yardanico@Generic I think Java color is pretty similar
21:33:42Yardanicocheck the logo https://www.oracle.com/java/
21:34:09Yardanicoit's a little more darkish on github though
21:34:17YardanicoC++ doesn't match, yes
21:34:19FromDiscord<Generic> it's similar but quite off, also I think the logo used to be more reddish
21:34:46Yardanicobut you know that most people ignore the color on github anyway? :P
21:35:01Yardanicowe just need to keep it separate from other languages most commonly used with nim together
21:35:04Yardanicowhich are C and C++
21:35:46FromDiscord<willyboar> #fecc06
21:36:06Yardanicotoo close to Parrot
21:36:25*opDispatch is now known as B4s1l3
21:36:27*bjornrob1rg is now known as bjornroberg
21:36:30FromDiscord<willyboar> #feeb26
21:36:33*B4s1l3 is now known as opDispatch
21:36:43Yardanicosame
21:36:50Yardanicotoo close to #FFEC25
21:37:01Yardanico(used by Dafny)
21:37:02Yardanicodamn Dafny
21:37:06Yardanicoif only they didn't submit their PR
21:37:26FromDiscord<willyboar> #fefba4
21:37:56FromDiscord<a2> Should nim have a logo remake?
21:38:01Yardanico@willyboar too close to Rascal
21:38:05Yardanico@a2 nah the logo is fine
21:38:15Yardanicoit represents the history of Nim
21:38:35FromDiscord<a2> I wonder why is it a crown?
21:38:39FromDiscord<a2> (edit) 'crown?' => 'crown'
21:38:41Yardanicobecause Nim was Nimrod
21:38:45FromDiscord<willyboar> because of nimrod
21:38:48Yardanicohttps://en.wikipedia.org/wiki/Nimrod
21:38:56Yardanicoalso Nimble was Babel (and yes it had that name before that JS babel)
21:39:47FromDiscord<a2> Wow js copycat
21:40:30FromDiscord<willyboar> lol how many greys
21:40:37Yardanicothey're not greys
21:40:40Yardanicothey're "no color"
21:40:40FromDiscord<willyboar> how all this pass the tests
21:40:44YardanicoData languages don't have a color
21:40:48Yardanicolike XML or JSON
21:40:52FromDiscord<willyboar> aaaaaa
21:42:01FromDiscord<willyboar> #c3b008
21:42:33FromDiscord<willyboar> lex i suppose
21:42:38Yardanicoworked fine :D
21:42:45Yardanicolol
21:42:47FromDiscord<willyboar> really?
21:42:50Yardanicoyes
21:42:58FromDiscord<willyboar> it's cool color
21:43:00YardanicoLex is #DBCA00
21:43:23FromDiscord<willyboar> well i think is a nice color
21:44:12Yardanico@dom96 https://i.imgur.com/gbYkYBr.png
21:44:16YardanicoI also have a slightly cheating idea
21:44:18*neceve quit (Ping timeout: 265 seconds)
21:44:26Yardanicomake a color bruteforcer in nim to automatically check against all other linguist colors :P
21:44:34Yardanicoto find yellowish colors which pass the proximity test
21:44:57FromDiscord<willyboar> I like it
21:45:03FromDiscord<willyboar> is better than green
21:47:02FromDiscord<Generic> if the color has to be changed I like this color too over the ones you presented before
21:47:10FromGitter<kaushalmodi> there's a `withFile` in the manual and tut2; it would be nice to have it in the stdlib too
21:47:16*agnem joined #nim
21:47:22Yardanicowe have a generic with
21:47:30Yardanicostd/with
21:47:35Yardanicoand it'll be improved with https://github.com/nim-lang/Nim/pull/14484 too
21:47:36FromGitter<kaushalmodi> yes, I saw that
21:47:51FromGitter<kaushalmodi> but `withFile` would do the auto open/close of the file handle
21:48:13Yardanicowe won't need auto closing when everyone uses arc btw :P
21:48:26Yardanicoafaik stdlib will be adapted to have `=destroy` for things like sockets or files
21:48:38Yardanicoto automatically close them then the compiler is sure they're not needed anymore
21:48:40Yardanicowhen*
21:49:47Yardanicoalthough destructors currently are not scope based
21:55:46*lritter joined #nim
22:02:26*fredrikhr quit (Read error: Connection reset by peer)
22:03:00*fredrikhr joined #nim
22:08:57*idf quit (Ping timeout: 265 seconds)
22:10:54*sschwarzer quit (Quit: leaving)
22:20:41FromDiscord<Technisha Circuit> You guys thought coding on a phone was bad...
22:21:55FromDiscord<a2> You code on mobile?
22:22:02Yardanicoit's just not productive, unless you at least have an external keyboard
22:22:10FromDiscord<a2> That's insane.
22:22:19FromDiscord<Technisha Circuit> My cousin is learning how to code on ps4
22:22:35Yardanicothat's still better
22:22:51FromDiscord<Technisha Circuit> Without a keyboard
22:22:51FromDiscord<a2> Imagine coding on nokia phone 3310
22:22:53Yardanicosince you can install linux on ps4
22:23:10FromDiscord<Technisha Circuit> He's not using a modded one
22:23:24Yardanicowell then how he's programming? in some game?
22:23:30FromDiscord<Technisha Circuit> Repl.it
22:23:35Yardanicook
22:23:41Yardanico@a2 reminded me of https://www.youtube.com/watch?v=Yuk46XbvwUY
22:24:21Yardanicoor https://www.youtube.com/watch?v=6vDAN3mnGig
22:24:24FromDiscord<a2> I just watched a day ago lol
22:36:21dadadahey
22:36:37dadadawhat's up dudes and dudettes
22:37:26FromDiscord<Rika> good, uh, day?
22:37:33dadadacould Nim some day be smart enough to figure out that a func, that has no side effects, and always returns the same values for the same inputs, could be completely precalculated at compile time for all possible inputs?
22:37:40Yardanico~ > dateSat 30 May 2020 01:37:34 AM MSK
22:37:46dadadaI know it could, so this is really a rhetorical question
22:37:58dadadawhat I really want to know is, has someone worked on this?
22:38:16dadadaof course we can do it manually using a macro or some other way to precalculate at compile time...
22:38:28Yardanicoyou can have a macro maybeConst :D
22:39:26dadadabut it would be awesome if Nim could just figure out that func someFunc(myEnum: AnEnum): string = ... with 20 possible values for myEnum could be precalculted/cached
22:39:38Yardanicowell that'll be quite computation heavy I think
22:39:39dadadawithout me the developer needing to spend time on it
22:40:45dadadaYardanico: right, it will
22:41:25dadadaYardanico: this is something that you could enable for release builds for best performance
22:41:31FromDiscord<InventorMatt> couldn't you do a const with a for loop and create a table for that?
22:41:39Yardanico@InventorMatt it's not about that
22:41:47zacharycarterhe wants the compiler to figure it out itself
22:41:55Yardanicoit's about figuring out in a call like "let a = calculateStuff()" if calculateStuff can be computed at compiletime
22:41:58Yardanicoand do that if it's possible
22:42:06zacharycarterI mean how long do you want your code to take to compile?
22:42:26dadadaInventorMatt: obviously yes, and I hinted at that, but I'm really about reducing the repetitive work as much as possible, smarter compilers sound nice to me
22:42:47bjornrobergLike idris?
22:43:02dadadabjornroberg: idris?
22:43:31bjornrobergIt's a language similar to haskell with quantitative types and whatnot
22:43:46FromDiscord<InventorMatt> a macro may be able to do that which would at least reduce some of the repetitive work
22:44:10zacharycarteris it really worth the effort is the question
22:44:57zacharycarterI think no
22:45:41dadadaInventorMatt: I believe you're right, I'll probably write one like that, the question is just if it shouldn't be a compiler option for release builds --preCalculateFuncsNProcsThatHaveConstantResultsWhenTheyHaveReasonableRangeOfPossibleInputsLikeEnumsOrUInt8OrChar
22:46:44Yardanicodadada: https://play.nim-lang.org/#ix=2nLP :D
22:48:16Yardanicouh
22:48:19dadadaYardanico: cool, I'm just looking for something that's less "hey I'm a special special call!" in your face style :D
22:48:20YardanicoI don't think it works correctly though
22:48:34dadadaall func/proc calls should just look as usual :D
22:48:39Yardanicodadada: well I think that might indeed be a nice feature, but a really low-priority one
22:49:51dadadaYardanico: completely understand :D I think I can do it in a macro/pragma, but before doing that I wanted to ensure that I don't do anything that already was done by someone else, so I asked here, and eventually (implies I don't hurry!) I think this would be a really cool optimization feature
22:52:18*abm joined #nim
22:52:54dadadacurrently I'm adding vscode theme support to moe :D
22:53:18Yardanicomoe as in https://github.com/fox0430/moe ?
22:53:24dadadayes
22:53:30Yardanicoare you fox0430 ?
22:53:32dadadano
22:54:34FromDiscord<willyboar> looks nice
22:55:00Yardanicothere's also https://github.com/paranim/paravim
22:55:19Yardanicowhich is the base of https://github.com/oakes/vim_cubed/ :D
22:57:03dadadaI want that moe becomes a great editor for Nim coding... this should be possible, because the bar is very low, I'm sorry, but most editors s uh c, I mean I like vim conceptual, but why do I need a to spend days learning about plugins before I can start to code, the same is true for emacs, and spacevim/spacemacs make it just worse by loading megabytes of plugins that randomly crash on you, and create bloat, my
22:57:09dadadahope is that you
22:57:26dadada'll be able to just USE moe without needing to spend days on howtos/manpages/readmes/downloading/config files
22:57:29Yardanicodadada: nimlsp already made the situation much better
22:57:32dadadajust install -> be productive
22:59:35dadadaYardanico: partially, also one reason for me not to really like vim is that I think VimScript is just an inferior choice, that was made out of tradition, which is bad reasoning, and the fact that it's written in C, which is in my opinion a maintenance nightmare and prevents people like me from ever even thinking about contributing
23:00:17FromDiscord<willyboar> I would give it a try tomorrow
23:00:23Araqdadada: revive NimEdit :-)
23:00:26Araqgood night
23:00:33Yardanicogood night!
23:01:44dadadaYardanico: it's not like I can't code in C, I have done that, I know enough about it, and that's exactly why I don't want to, it's making me frustrated to think that people still start new projects in C, ..., I know you CAN do everything in C, make some fine code, but I'm just like why would you torture yourself like that?! This is reason for me alone to develop moe a little as a hobby... fox0430 is very
23:01:50dadadaresponsive with the pull requests, so let's just see where this goes :D
23:03:58FromDiscord<willyboar> what moe means?
23:04:04Yardanicohttps://en.wikipedia.org/wiki/Moe_(slang)
23:04:29Yardanicousually something cute, nice, etc
23:04:33Yardanicomostly in anime culture :P
23:04:39dadadawillyboar: it's alpha software now, your impressions of it won't be fantastic, but there's path to really nice usability that's not very far, I'd say give it a try in around a year at the current pace, and you might even use it daily
23:05:35zacharycarterI like C
23:05:42zacharycarterI don't think C development is tortorous
23:05:49Yardanicodadada: I think he asked about the name and not the editor itself :)
23:05:59zacharycartertorturous
23:06:33zacharycarterbut I also enjoy writing Nim and I'm more productive in Nim
23:07:36bjornrobergmoe looks promising! Thanks for mentioning it.
23:08:18dadadaI like C for its history, but given the options that exist now, I think it starts to look like 80s cars look on the streets, yeah they have some cool designes sometimes, although most are bulky, and then you sit in the car and there's no servo for the steering, so when you leave the car again you feel exhausted
23:09:59zacharycarterI don't know - I interop with a lot of C and read a lot of C - maybe it's because I don't write much of it I don't mind it so much
23:10:17FromDiscord<dom96> I almost feel like I'm reading Araq's posts https://lkml.org/lkml/2020/5/29/1038
23:10:24Yardanicolol :D
23:11:07Yardanico"People with restrictive hardware shouldn't make it more inconvenient
23:11:07Yardanicofor people who have better resources."
23:13:08dadadasurprising I think I read/heard something about the kernel being very strict on enforcing 80 columns, must have heard wrong
23:13:22dadadas/surprising/surprising for me
23:15:54*smitop quit (Quit: Connection closed for inactivity)
23:16:33dadada"And yes, we do line breaks at some point. But there really isn't any
23:16:35dadadareason to make that point be 80 columns any more."
23:16:39dadada- Linus Torvalds
23:16:52dadadaso the question is, where is "some point" now for him?
23:22:31*abm quit (Remote host closed the connection)
23:23:41*abm joined #nim
23:24:37*abm quit (Client Quit)
23:31:18*NimBot joined #nim
23:33:01FromDiscord<willyboar> i really like moe
23:33:59PrestigeI agree with Linus here
23:42:04Yardanicoyeah, although you also have to take into the account the context he's talking about
23:42:11Yardanicoit's not just any development, it's kernel development specifically
23:49:10*fredrikhr quit (Ping timeout: 256 seconds)
23:52:30FromGitter<Knaque> I'm sure I've asked this before, but I can't remember what the answer was for the life of me. How would I permanently set an environment variable via Nim? (Specifically PATH on Windows, but cross-platform would be ideal.)
23:53:18Yardanicofor windows https://nim-lang.org/docs/winlean.html#setEnvironmentVariableW%2CWideCString%2CWideCString should work
23:54:01Yardanicoah wait
23:54:06Yardanicohttps://nim-lang.org/docs/os.html#putEnv%2Cstring%2Cstring
23:54:18codic`import os; putEnv("PATH", getEnv("PATH")&":newEntry(DoesWindowsUseColonForPath)")`
23:54:19codicSomething like that probably
23:54:23codicI'm not sure if that's permanent?
23:54:34Yardanicoah it's not
23:54:45codicah
23:54:48codicwell
23:55:08Yardanicofor windows you have to modify the registry
23:55:11codicin linux you can write to /etc/environment with root perms for all users or something similar (forgot path) for per user
23:55:15codicoof
23:55:18codicthe pains
23:55:26Yardanicohttps://docs.microsoft.com/en-gb/windows/win32/procthread/environment-variables?redirectedfrom=MSDN
23:55:31Yardanico"To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment". This allows applications, such as the shell, to pick up your updates."
23:55:39codicdoes nim let you access the reg?
23:55:50Yardanicohttps://nim-lang.org/docs/registry.html? :P
23:56:22codico
23:56:36Yardanicoalso https://github.com/miere43/nim-registry seems to exist
23:56:50codic;P
23:57:02codicwhy not use the stdlib version tho
23:57:37Yardanicocodic: also, about linux - it's not that simple
23:57:48Yardanicoif you want to set it for one user it's actually quite hard to set it for *all* apps
23:57:57Yardanicoyou can set it for the shell, sure, but not all stuff is started from the shell
23:58:46codicyeah, but /etc/environment is applied for everything on startup
23:59:07codicIt's quite hard to set it per user for all apps, that, yes
23:59:16Yardanicocodic: or /etc/profile on most distrods
23:59:20YardanicoI usually modify that
23:59:26codicfor example, if i use dri_prime to change my gpu as i do in /etc/environment (DRI_PRIME=1), it's applied to all apps
23:59:26codic/etc/profile also does that?
23:59:27codicdidnt know
23:59:42codicif it does ~/.profile should too
23:59:50Yardanico~/.profile doesn't do it for all apps
23:59:58Yardanicoonly for the shell I think