<< 20-04-2020 >>

00:01:18FromDiscord<__ibrahim__> can nim be used as a purely functional language?
00:02:31leorize@KingDarBoja: hmm, a question, do you ever throw the base error?
00:02:45leorize__ibrahim__: no
00:03:02leorizeeventually you gotta do I/O and you can't do that "pure"
00:03:58FromDiscord<KingDarBoja> Yes
00:04:08FromDiscord<KingDarBoja> I will but haven't reached that module (execution)
00:04:40FromDiscord<KingDarBoja> Still thinking about my approach, seems like shorter
00:04:50FromDiscord<KingDarBoja> seems shorter*
00:05:12FromDiscord<KingDarBoja> https://imgur.com/b8pXb5l the "messy" one but now I have changed my mind lol
00:05:21FromDiscord<__ibrahim__> so can do everything pure func but I/O
00:05:32leorizeI'm not sure about that
00:05:40leorizememory allocation is not really "pure"
00:05:54leorizebut most functional prog lang just assume that it is pure
00:06:34FromDiscord<__ibrahim__> yes
00:07:26FromDiscord<exelotl> @__ibrahim__ I guess you can use nim in a purely functional style if you really want to. See e.g. https://github.com/zevv/aoc2019/blob/master/08/main.nim
00:09:02FromDiscord<__ibrahim__> thats very interesting thank you @exelotl
00:09:41FromDiscord<exelotl> np :) it's not my cup of tea but it can be done haha
00:10:11*Hideki_ joined #nim
00:11:38FromDiscord<__ibrahim__> not mine either, paradigms can-o-worms got me curious
00:12:04FromGitter<sealmove> disruptek: I worked on the official implementation (in Scala). So we don't have it in CT. You have to generate your parser using the official Kaitai Struct compiler with the argument `-t nim`.
00:13:10FromDiscord<__ibrahim__> but i think as leorize said, it maybe not pure functional.
00:14:49*Hideki_ quit (Ping timeout: 265 seconds)
00:15:58FromDiscord<__ibrahim__> https://min-lang.org
00:17:21Yardanicoyes
00:17:33Yardanicothere's also http://sprylang.se/
00:17:56Yardanicoor https://github.com/liquid600pgm/rod but it's in relatively early state
00:19:41FromDiscord<__ibrahim__> fascinating
00:21:05FromDiscord<__ibrahim__> funny question: could you theortically make nim's keywords use another language? (russian, chinese, etc...)
00:23:27FromGitter<sealmove> theoretically? of course, why not?
00:24:01FromDiscord<__ibrahim__> xD
00:24:18FromDiscord<__ibrahim__> how bout in reality?
00:25:08FromGitter<sealmove> depends on what you are thinking
00:25:15FromGitter<sealmove> like a fork on the language?
00:25:20FromGitter<sealmove> or do it within it?
00:26:12*Hexeratops quit (Remote host closed the connection)
00:28:00FromDiscord<__ibrahim__> like replace the keywords so that u can program it in a different language
00:28:10FromDiscord<__ibrahim__> like translating nim from english to x
00:28:33FromDiscord<__ibrahim__> same exact functionality, just different unicode characters
00:29:58*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:30:06*njoseph joined #nim
00:32:04FromDiscord<__ibrahim__> إكو "hello world"
00:32:09FromDiscord<__ibrahim__> xD
00:38:34FromGitter<sealmove> You would have to fork the language and change keywords.
00:39:18FromGitter<sealmove> They are no overridable
00:42:30FromDiscord<__ibrahim__> that's coool
00:42:41FromDiscord<__ibrahim__> thanks sealmove
00:42:58*ryan__ joined #nim
00:45:45*ryan_ quit (Ping timeout: 265 seconds)
01:00:35FromDiscord<Skaruts> how to access the elements of a pointer array from C? (in my case a `ptr Color` retrieved by `GetImgeData()`, from Raylib)
01:02:24*chemist69_ joined #nim
01:02:31*Hideki_ joined #nim
01:02:44*Hideki_ quit (Remote host closed the connection)
01:04:39leorize[m]cast it to ptr UncheckedArray[Color]
01:05:18*chemist69 quit (Ping timeout: 256 seconds)
01:08:30FromDiscord<Skaruts> seems to work
01:08:35FromDiscord<Skaruts> but how do iterate it?
01:09:20FromDiscord<KingDarBoja> leorize
01:09:42FromDiscord<KingDarBoja> What is the reasoning behind exception not being `ref` but raise statement requires it lol
01:10:43leorize[m]Skaruts: uhmm, you got the size, right? then iterate from 0 to size - 1
01:11:51leorize[m]@KingDarBoja: historical reason lol
01:12:31FromDiscord<Skaruts> ah ok, I was thinking in terms of `for x in data`
01:12:40FromDiscord<Skaruts> thanks
01:12:51PrestigeElegant Beef: I was able to do this for masks: https://0x0.st/i1_p.txt
01:13:17PrestigeWe convert TXEvent.xkey.state and the Mask with this function and compare them
01:13:46FromDiscord<KingDarBoja> lol ok
01:14:38FromDiscord<KingDarBoja> At the end, I stick to my first approach, easier IMO
01:14:41FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/error/syntax_error.nim and works 😄
01:15:20FromDiscord<KingDarBoja> I have to admit that not having a `super` call got me out of place
01:15:34disruptekthere's a super call.
01:16:53disruptekhttps://nim-lang.github.io/Nim/system.html#procCall%2Cuntyped
01:18:42FromDiscord<Elegant Beef> Yea i know
01:18:49FromDiscord<Elegant Beef> I already use them prestige
01:19:38PrestigeI thought ealier you said you used a map for modifiers Elegant Beef
01:19:49FromDiscord<Elegant Beef> For serializing/deserializing
01:20:03FromDiscord<Elegant Beef> I have this function, albiet pretty silly
01:20:03FromDiscord<Elegant Beef> https://hatebin.com/qfmoqheisd
01:20:21FromDiscord<Elegant Beef> Which is getting key.keycode and key.state
01:20:30FromDiscord<KingDarBoja> WHAT !??
01:21:02FromDiscord<KingDarBoja> Woah woah... I need some example with that procCall
01:21:10FromDiscord<Elegant Beef> Has to be the worst url on a documentation site
01:21:10FromDiscord<Elegant Beef> https://cdn.discordapp.com/attachments/371759389889003532/701603334511001671/unknown.png
01:21:27Prestigeah I'm using a table instead of iterating over the bindings Elegant Beef
01:21:57FromDiscord<Elegant Beef> I will probably do the same but i couldnt be arsed to find a nice hash and didnt want to use a string
01:22:22FromDiscord<Elegant Beef> You also dont need to put my name at the end, im on discord that does fuck all 😛
01:22:47FromDiscord<KingDarBoja> https://nim-lang.org/docs/manual.html#multiminusmethods-inhibit-dynamic-method-resolution-via-proccall
01:23:20PrestigeLol oh rip
01:23:39FromDiscord<Elegant Beef> Sadly this bot doesnt even mention someone if you do @ followed by the persons name
01:26:56disruptekhuh?
01:27:02FromDiscord<Mask> what is the best way to do this... for abstraction purposes?
01:27:02FromDiscord<Mask> https://cdn.discordapp.com/attachments/371759389889003532/701604805705203862/unknown.png
01:27:21FromDiscord<Mask> i tried `let sizeboard = 5`
01:27:34disruptekconst sizeboard
01:27:38FromDiscord<Mask> ah
01:27:39FromDiscord<Mask> thaks
01:28:25FromDiscord<KingDarBoja> Mmmm no idea how to use it to be honest, the procCall
01:28:42disruptekwhy do you think you want inheritance?
01:28:46disruptek(usually, you don't)
01:31:49FromDiscord<KingDarBoja> Well it is supposed to provide shared props between several inherited types from the base type
01:32:43FromDiscord<KingDarBoja> And provide the same base logic for those
01:32:52FromDiscord<KingDarBoja> That's why I needed the super call
01:33:19*couven92 quit (Ping timeout: 260 seconds)
01:33:26FromDiscord<KingDarBoja> So my inherited type calls the newParentType proc and perform some setup, then use that for my inherited type setup
01:33:28disrupteknot a good reason, but if you want the complexity, it's there for you.
01:33:57FromDiscord<KingDarBoja> Once again, making a 1:1 port probably is a complex approach but well, so far so good D:
01:34:12*ryan__ is now known as number_one
01:34:17FromDiscord<KingDarBoja> And tbf, I am used to OOP
01:35:56disrupteksure, but you will have more success if you exploit nim's strengths rather than those of another language.
01:36:26FromDiscord<KingDarBoja> What do you recommend when dealing with things like inheritance?
01:36:51FromDiscord<Mask> how can i use operator overloading on `echo`? In python, `print` implicitly calls the parameter's `__str__` function.
01:37:04disruptekin my experience, it adds needless complexity and subtle bugs.
01:37:14disruptekecho implicitly applies $ to its arguments.
01:37:25FromDiscord<KingDarBoja> declare some proc like -> proc `$` ()
01:37:30FromDiscord<Mask> awesome thanks again.
01:37:34FromDiscord<Mask> very cool
01:37:34FromDiscord<KingDarBoja> Oops, wait
01:37:55FromDiscord<Mask> `$`
01:37:59FromDiscord<Mask> i know
01:38:02FromDiscord<Mask> `
01:38:06FromDiscord<KingDarBoja> Okay... darn formatting
01:38:10FromDiscord<Mask> yeah lol
01:38:15disruptekyou can impl your own such feature with a varargs[someTypeDesired, someTransformingProc]
01:38:20disruptekthis is how echo is impl.
01:38:37FromDiscord<Mask> hmmm
01:38:42FromDiscord<Mask> okay i will look into that
01:38:45disruptekyou can also use converters, but they are a loaded gun to be wielded sparingly.
01:38:54FromDiscord<Mask> gotcha
01:39:33lmariscal@dom96 are you there?
01:40:16FromDiscord<KingDarBoja> What are Nim's strengths (besides macros) ?
01:40:25FromDiscord<KingDarBoja> Just to keep that in mind
01:40:41disruptekking: basically, the advice is to try to use variant objects instead. with templates, macros, concepts... variant objects are likely the fastest and slickest solution.
01:41:58disrupteka strength is that the language is large and powerful and fast. the stdlib doesn't always exploit this, but if the stdlib had what you wanted, you wouldn't be here.
01:42:32disruptekso, you build a thing. it runs fast. when you are ready to optimize it, it will run like greased lightning.
01:42:46disruptekmake it work, make it correct, make it fast.
01:43:06FromDiscord<KingDarBoja> That last stmt is true
01:43:15FromDiscord<KingDarBoja> I am probably missing the make it correct and fast part
01:43:41disruptekstart with stdlib. make it work. everyone goes through a period of chafing against the language. it's normal.
01:43:48leorizeI'm hating windows so much now
01:44:09leorizetheir piping system can only do synchronous i/o
01:44:11FromDiscord<KingDarBoja> That's what I am doing... but not sure how large is the stdlib
01:44:22leorizeand it errors out if you close one end of the pipe :)
01:44:26PrestigeI'm surprised you use windows
01:44:27FromDiscord<KingDarBoja> And don't get me wrong, I am taking notes of every advice
01:44:38FromDiscord<KingDarBoja> Bro, I use Windows too 😛
01:44:43leorizenot that I use windows, but my library has to support windows
01:44:47disruptekleorize: i think you need ParentStreams.
01:44:49Prestigeah
01:45:32leorizenah, the well known "walkaround" is to create a randomly named named pipe
01:45:35leorizeand I hate that
01:45:59leorizebecause it's named now I gotta worry about it's access control
01:46:17FromDiscord<KingDarBoja> But disruptek advice to switch to object variant is giving me the energy to use it lol
01:46:29disrupteki've been here a year. i'm not a good programmer, but you cannot help but to soak up a knowledge of the language's geography. traps and pitfalls as well as smooth routes.
01:47:25disruptekleorize: did you try asynctools?
01:47:43disruptekbecause it's probably what you want.
01:47:51leorize[m]yes, but it doesn't have what I want
01:47:58disrupteki don't believe it.
01:47:58leorize[m]so I'm building one from scratch
01:48:32disruptekbad news, good news, i guess.
01:48:36leorize[m]well I need a piping system that can do both synchronous i/o and async i/o
01:48:57FromDiscord<KingDarBoja> You speaking to me disrupt?
01:49:01*lritter joined #nim
01:49:03leorize[m]I'm making an alternative to osproc, it has to work properly and cover whatever osproc has
01:49:35leorize[m]and I don't want to pull in deps because I don't trust nimble
01:49:35disruptekking: not since i pinged leorize.
01:49:51FromDiscord<KingDarBoja> lol ok 😄
01:50:10disruptekyou will be fine; just stick to what works.
01:50:21FromDiscord<KingDarBoja> Wise advice
01:50:37leorize[m]also asyncpipes doesn't have the kind of api that I want :P
01:50:38FromDiscord<KingDarBoja> I just tend to seek what's the best approach but you're right, better make it work first then optimize
01:51:00FromDiscord<KingDarBoja> You can raise issues an all you want 😄
01:51:01disruptekit's good to know what's out there, but it's even better to know what works.
01:52:16leorizeAraq: how does `=destroy` attachment work? do I have to export my `=destroy`?
01:52:25FromDiscord<KingDarBoja> Neither Python nor JS/TS deals with ptr or ref, that's a big game changer for me.
01:53:05disruptektrue.
01:54:05FromDiscord<Mask> can i create a derivative type of int whose values must be within a certain range
01:54:14disruptekrange[4 .. 6]
01:54:37disruptekeg. type Foo = range[4 .. 6]
01:54:46FromDiscord<Elegant Beef> if that huh was to me a while ago disruptek, if an irc uses @Elegant Beef it doesnt ping me in discord
01:54:52FromDiscord<Mask> wow
01:54:58FromDiscord<Mask> that was easy
01:55:17FromDiscord<Mask> i've tried nim before but this is refreshing
01:55:44disruptekit's nice having all the answers; keep lobbing the easy pitches across the plate and i'll keep crushing them.
01:56:03disruptekbeef: use irc.
01:56:20FromDiscord<Elegant Beef> None of the clients look good
01:56:22FromDiscord<Elegant Beef> So no
01:56:23FromDiscord<Elegant Beef> 😄
01:56:24FromDiscord<Mask> yeah i didn't have the discord server last time
01:56:27FromDiscord<Mask> this is a big help
01:56:45FromDiscord<Elegant Beef> Go make me a good looking irc client in nim disruptek, and ill consider it
01:56:55disruptekenums are also a very strong type in nim.
01:56:58leorizewhat do you consider good looking?
01:57:51FromDiscord<Elegant Beef> I dont know something that's not an affront to my retinas
01:57:52disrupteki thought about it but despite my heavy use, i don't really /need/ a better client.
01:58:12Prestigehow about weechat?
01:58:24disrupteki might do it on stream; it's the sort of thing that people like to watch for some reason.
01:59:13FromDiscord<Elegant Beef> Isnt weechat text only?
01:59:35FromDiscord<Elegant Beef> TUI isnt very nice imo for something that has multimedia support
02:00:09disruptekmultimedia support isn't very nice imo for something that is text-only.
02:00:15Prestige^
02:00:20Prestigeirc is text only isnt it?
02:00:33disruptekyes.
02:00:38FromDiscord<Elegant Beef> Well i mean images,and videos get shared
02:00:52disruptekhowever, i wouldn't use text-mode in my client.
02:00:54FromDiscord<Elegant Beef> Be it links or not, seems quite silly to constantly open links in a browser to just close the tab
02:01:16disruptekthat's how i browse.
02:01:39leorizeany web irc client would work for you then
02:01:54leorizethe lounge is the most powerful one, but requires hosting
02:01:55FromDiscord<Elegant Beef> Also imgui for status bar is silly as hell but is working
02:01:55FromDiscord<Elegant Beef> https://cdn.discordapp.com/attachments/371759389889003532/701613588191772682/unknown.png
02:02:01disruptekwhy would i want that?
02:02:31disruptekthat dog has /seen some shit/
02:02:31FromDiscord<Elegant Beef> But with the imgui status bar my wm crashes
02:02:38*chemist69_ quit (Ping timeout: 256 seconds)
02:02:39FromDiscord<Elegant Beef> Lol
02:03:25FromDiscord<Elegant Beef> Can Xephyr emulate a multiple monitor setup?
02:03:29disrupteki'm glad i gave bentley a run. he'd have been barking his head off if he were awake.
02:04:39FromDiscord<Mask> can i implicitly cast this integer array to the polyomino array of `Direction`?
02:04:42FromDiscord<Mask>
02:04:42FromDiscord<Mask> https://cdn.discordapp.com/attachments/371759389889003532/701614285239091210/unknown.png
02:04:48*chemist69 joined #nim
02:05:24FromDiscord<KingDarBoja> How many dogs do you own dis?
02:05:38disruptekuse enums.
02:05:45FromDiscord<Mask> okay
02:05:47disruptekone dog is enough when you live in an rv.
02:05:54FromDiscord<KingDarBoja> Hey Mask, use imgur to upload images 😄
02:05:59FromDiscord<KingDarBoja> rv?
02:06:04FromDiscord<Mask> is it easier to see on gitter or smth?
02:06:04FromDiscord<KingDarBoja> I have 4 dogs and 2 cats
02:06:20FromDiscord<KingDarBoja> Images don't get into IRC I think
02:06:21FromDiscord<Elegant Beef> I mean it sends the discord url AFAIK
02:06:34FromDiscord<Elegant Beef> It sends the discord upload url, im 99% certain
02:06:40FromDiscord<Mask> i'll just copy paste the code next time
02:06:46FromDiscord<Mask> thanks for the tip i was wondering about that
02:06:47FromDiscord<KingDarBoja> Nooo xD use the playground
02:06:49FromDiscord<Elegant Beef> *that's even worse*
02:06:54disruptek~paste
02:06:54FromDiscord<Mask> hmm why
02:06:55disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
02:07:08FromDiscord<KingDarBoja> 😄
02:07:11FromDiscord<Elegant Beef> Muliline messages on irc is cancer afaik
02:07:17FromDiscord<Mask> lmao
02:07:25FromDiscord<KingDarBoja> Don't worry bro, welcome 😄
02:07:52FromDiscord<KingDarBoja> And yeah, use enums as disrupt3k said
02:07:52disruptekit's not a big deal.
02:08:08disruptek3 lines are fine, five starts to be excessive.
02:08:11FromDiscord<Mask> how do i get a link from the nim playground
02:08:14FromDiscord<Mask> to show code
02:08:17FromDiscord<KingDarBoja> Anyone has used Elixir lang? Man, that's the top notch of Enumerables and pipes
02:08:22disruptekthere's a button.
02:08:31disruptekShare to ix
02:08:44FromDiscord<Elegant Beef> Any clues how i should debug my WM crashing on startup? Doesnt crash using xephyr but when using it as a proper wm it crashes
02:08:48FromDiscord<Mask> i tried i get 502 error
02:08:51disruptekgdb
02:09:07disruptekmaybe ix is misbehaving.
02:09:26FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=25Cj
02:09:26disruptektry again; it just worked for me.
02:09:45FromDiscord<Elegant Beef> But how would i use GDB if i dont exactly have a way to attach it to the wm
02:10:01FromDiscord<Mask> i think it's because i had nothing written in
02:10:02FromDiscord<Mask> lmao
02:10:04disruptekyou run your wm from gdb.
02:10:18Prestigeyou can attach the PID as well
02:10:58disruptekenums can have ordinal and string values at the same time.
02:11:57disruptekthey can have holes (though it's generally a bad idea), you can easily type-convert them, iterate over their range, and they compose beautifully with sets and case statements.
02:12:46disruptekcase statements can consume sets and ranges as clause determinants.
02:13:09disruptekranges work great with enums, too, of course.
02:15:38leorize[m]@Elegant Beef: https://srain.im/
02:15:45FromDiscord<Varriount> I really like sets in Nim. Sure, they are limited in what kinds of data types they can hold, but you usually get very good performance
02:16:22*endragor joined #nim
02:16:34FromDiscord<Mask> sets have no duplicates?
02:16:39disruptekcorrect.
02:16:41FromDiscord<Mask> how do you have efficient insertion
02:16:49disrupteklots of lube.
02:16:52FromDiscord<Mask> since you have to check every element to make sure no duplicates
02:16:54FromDiscord<Mask> lol
02:17:14leorizethey are designed as bitsets
02:17:23disruptekthey aren't arrays underneath.
02:17:33FromDiscord<Elegant Beef> In most cases they're hashmaps
02:17:36FromDiscord<Mask> ah
02:17:44*muffindrake quit (Ping timeout: 246 seconds)
02:18:05leorizefound you an IRC client @Beef
02:18:05disrupteki don't think that's right.
02:18:12leorizealso Nim sets are not hash maps
02:18:18leorizewe have hashsets if you're into that
02:18:18disruptekiirc, they are a series of integers.
02:18:35FromDiscord<Elegant Beef> Hey i know nothing of this nim you speak,
02:19:23FromDiscord<KingDarBoja> Oh god, found another bug due to Python using None for string variable
02:19:24FromDiscord<KingDarBoja> x.x
02:19:35FromDiscord<Mask> back to the enum thing. You are saying to use an enum instead of the range[0..4] type?
02:19:41FromDiscord<KingDarBoja> Yeah
02:20:04FromDiscord<KingDarBoja> https://nim-lang.org/docs/tut1.html#advanced-types-enumerations
02:20:05FromDiscord<Mask> does that have any bonus features besides just being more standard?
02:20:06FromDiscord<Elegant Beef> Never ever use magic unnamed numbers
02:20:14FromDiscord<KingDarBoja> I feel like you want that
02:20:14*muffindrake joined #nim
02:20:20disruptekyes; i just listed the bonus features.
02:20:26FromDiscord<Mask> oh
02:20:37FromDiscord<Mask> oh i see
02:20:38FromDiscord<KingDarBoja> It's basically what you wanted Mask lol
02:20:42FromDiscord<Mask> the ordinal types things
02:20:46FromDiscord<Mask> yeah but that wasn't really my issue
02:20:51FromDiscord<Mask> this is good i will use enums instead
02:21:01disruptekthey are what you want.
02:21:15disrupteklightweight typed ordinals.
02:21:15FromDiscord<Mask> but i mean how do i cast the array of `[0, 0, 1]` into the polyomino thing.. Will it do that?
02:21:49disrupteklemme find the code.
02:21:50FromDiscord<KingDarBoja> the ord proc can convert it to its underlying integer value.
02:22:27FromDiscord<KingDarBoja> So `South.ord` yields its integer
02:23:16FromDiscord<Mask> is there a way to do those things and still use numbers instead of words for the directions?
02:23:17disruptekthat code should work fine.
02:23:27FromDiscord<Mask> i don't see anything is it going through
02:23:51disrupteknumbers are accepted if they are valid for the type.
02:24:11FromDiscord<Elegant Beef> Why would you want to use numbers?!
02:24:17disrupteka /cast/ is a separate thing from mere assignment in nim.
02:24:39disrupteka cast is you saying, "look, just copy the value without regard to type"
02:24:48disruptekgenerally, you won't use a cast.
02:25:21FromDiscord<Elegant Beef> ~~Unless you use glfw + xlib and have to convert a raw pointer to a TWindow~~ 😄
02:26:41FromDiscord<KingDarBoja> @Mask Can you share the code?
02:26:57disruptekbbiab, i wanna see if this hardware works.
02:27:05FromDiscord<Mask> yeah i'm reading the anum thing to try to understand what you guys are talking about
02:27:08FromDiscord<Mask> one moment
02:27:49FromDiscord<Mask> https://play.nim-lang.org/#ix=2iKU
02:28:17FromDiscord<Mask> https://play.nim-lang.org/#ix=2iKV
02:28:27FromDiscord<Mask> i realized the int thing was wrong mb
02:29:49FromDiscord<KingDarBoja> Gotcha
02:30:08FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2iKV
02:30:22FromDiscord<Mask> don't you have to share again?
02:30:25FromDiscord<Mask> it hasn't changed for me
02:30:26FromDiscord<speckledlemon> Is there really no better way to represent a sum type than this? https://pastebin.com/raw/mE4fujx9
02:31:03leorizeuse discard for that branch if you don't need it
02:31:27leorizealso we have Option[T]
02:31:38FromDiscord<KingDarBoja> Oh crap
02:31:49FromDiscord<speckledlemon> I had been trying `discard ""`, didn't know you could have bare discard, thanks
02:32:11FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2gcb
02:32:16FromDiscord<speckledlemon> I'm not sure yet if Option makes sense, it might, it might not
02:32:36leorize!repo nim-result
02:32:46leorizedisbot?
02:32:52FromDiscord<Mask> isn't it tilda
02:33:01FromDiscord<Mask> ~repo nim-result
02:33:14leorizefor commands it's `!`
02:33:20FromDiscord<Mask> ah
02:33:21leorizedisruptek probably broke the bot again
02:33:26FromDiscord<Mask> amh
02:33:30FromDiscord<Mask> s*
02:35:37FromDiscord<Mask> so can i do this implicit casting thing?
02:37:36FromDiscord<Mask> or if it's not called casting then something else
02:39:00skrylar[m]hmm someone sending me patches for 1.2... guess its time to do the rounds and see what broke this time
02:40:04FromDiscord<speckledlemon> ah screw it, option is a better solution for now, good call
02:40:43leorizethere's also the nim-result package if you ever need something more complex
02:40:54leorizeI think in nimble it's called results
02:43:04FromDiscord<speckledlemon> found it https://nimble.directory/pkg/result
02:44:04FromDiscord<KingDarBoja> It is possible that string can be nuil?
02:44:21FromDiscord<KingDarBoja> Nil* I know it could be done if using ref (for types for example)
02:44:22leorizenope
02:44:29leorizeuse Option[T] :P
02:44:33FromDiscord<KingDarBoja> fffffff
02:48:13*FromDiscord <KingDarBoja> hangs himself
02:48:36FromDiscord<Mask> could i override nnkBracket to accomplish this?
02:48:51leorizewhat are you trying to do?
02:49:10FromDiscord<Mask> make an array of integers construct an array of range[0..4]
02:49:12FromDiscord<KingDarBoja> Who?
02:49:40leorize@Mask: `let arr = [0.Type, 1, 3, 2]`
02:50:02leorizespecify the type for the first element, and everything after will follow suit
02:50:52FromDiscord<Mask> i don't think that's exactly what i'm looking for
02:50:52FromDiscord<Mask> https://play.nim-lang.org/#ix=2iL7
02:51:48leorizewhy would you wanna do this?
02:51:58FromDiscord<Mask> so i can create the polyominoes easier
02:52:03FromDiscord<Mask> it just looks nicer
02:52:10leorizeyou already gave them a name
02:52:14leorizeyou can just use the enum names
02:52:30leorizeif you don't wanna use them then why do you even use enums?
02:53:05FromDiscord<Mask> if i use for example `[n, n, e]` instead the code still won't work
02:53:14FromDiscord<Mask> `Error: type mismatch: got <array[0..2, Direction]> but expected 'Polyomino[system.int]'`
02:55:06leorize[m]https://play.nim-lang.org/#ix=2iLa
02:55:29*xcm quit (Remote host closed the connection)
02:55:34leorize[m]the static int part is a bit of a gotcha, but you used the `array` part wrong :P
02:55:53FromDiscord<Mask> oh so i was declaring the array wrong to begin with?
02:56:12leorize[m]yea, arrays are `array[Idx, T]`
02:56:25FromDiscord<Mask> i thought that's what i was doing?
02:56:25leorize[m]you did it the other way around :P
02:56:33FromDiscord<Mask> bruh
02:56:41FromDiscord<Mask> i knew that it was just a dumb dumb mistake
02:56:41FromDiscord<Mask> lol
02:56:50FromDiscord<Mask> i even wrote it correctly elsewhere in the code
02:56:50FromDiscord<Mask> thanks
02:56:58leorize[m]np
02:57:45*xcm joined #nim
02:57:56*endragor quit (Remote host closed the connection)
03:12:00*disruptek quit (Quit: Bye)
03:12:00*disbot quit (Quit: Bye)
03:16:12*disbot joined #nim
03:17:14*disruptek joined #nim
03:21:16leorizedisbot: alive?
03:21:24leorize~arc
03:21:25disbotarc: 11a new memory manager for Nim; see https://forum.nim-lang.org/t/5734
03:21:28leorizenice
03:24:20disrupteki should really move the bot offsite.
03:25:41leorizemaybe you can ask dom96 for a spot on Nim's server?
03:25:56disrupteki have servers.
03:26:15disruptekit's just that the bot also throws my notifications and stuff.
03:26:20leorizewhy does everyone have a server or two
03:26:24disruptekso it's convenient to have just one bot local, etc.
03:26:49disruptekanyone can have a server; just pay a few bucks to amazon or w/e.
03:27:04disrupteki think a nano is like $45 for 3y.
03:27:28disruptekthat's what i paid, anyway.
03:32:14disrupteki used to have lots of bigger boxen but i've moved everything to lambda. i only use servers for vpc'ing compiled code into neptune or w/e.
03:32:58skrylar[m]i used to have one for a site until i couldn't afford it anymore
03:33:19FromDiscord<Chiqqum_Ngbata> So maybe nimble doesn't have a post-install hook of some kind ?
03:33:37skrylar[m]theres also places that rent pis/arm so the cost of microservers is really going down
03:35:43disruptekhmm i cannot build version-1-0 with 0.20.0 because pure/collections/setimpl.nim(41, 24) Error: undeclared identifier: 'isFilledAndValid'
03:36:48FromDiscord<Mask> https://play.nim-lang.org/#ix=2iLn
03:36:48FromDiscord<Mask> https://forum.nim-lang.org/t/703
03:36:48FromDiscord<Mask> can someone help me understand this template posted here?
03:36:57FromDiscord<Mask> what does the star in `new*` do?
03:37:01FromDiscord<Mask> is that like regex or something?
03:37:10FromDiscord<Mask> i couldn't find anything in the manual or anything
03:37:26FromDiscord<Mask> and also the difference between the two he has posted
03:37:36disruptekit's pointless afaict.
03:37:45FromDiscord<Mask> the star?
03:38:11disruptekthe template.
03:38:14FromDiscord<Mask> right
03:38:21FromDiscord<Mask> i got that but what is the point of the star
03:38:30disruptekthe star exports the symbol.
03:38:45disrupteka la oberon.
03:39:03FromDiscord<Mask> i'm confused
03:39:05FromDiscord<Mask> what does export mean in this context. and what symbol?
03:39:07disruptekelse it will be invisible outside the module.
03:39:13FromDiscord<Mask> oh right
03:39:17disrupteknew is a symbol.
03:39:17FromDiscord<Mask> i read that somewhere
03:39:20disruptekan identifier.
03:39:33FromDiscord<Mask> what is expr
03:39:38FromDiscord<Mask> is that like `untyped`?
03:39:49disruptekan expression, yes.
03:39:55disruptekuntyped literally has no type.
03:39:59disruptekcould be anything.
03:40:03disruptekor nothing.
03:40:06FromDiscord<Mask> i thought it was just text
03:40:10FromDiscord<Mask> basically
03:40:18disruptekcould be a block of code.
03:40:50disruptekwell, i shouldn't say it could be nothing.
03:41:59*FromDiscord <KingDarBoja> socialism? yes
03:43:29disrupteki wouldn't put much stock in forum posts from 2015.
03:43:35disruptekthe language has changed a lot since then.
03:44:29disruptekexpr is deprecated afaik, for example.
03:47:11disruptekanyway... i feel like we should be able to bootstrap 1.0.
03:59:11*waleee-cl quit (Quit: Connection closed for inactivity)
04:00:12nisstyreI actually find a lot of old results on google and it's annoying
04:00:25nisstyreeven the date filtering thing on google doesn't work reliably sometimes
04:00:48disrupteki don't read the forum. 🤷
04:01:18*Romanson joined #nim
04:04:51FromDiscord<UNIcodeX> Duckduckgo !date
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:43*supakeen joined #nim
04:09:32*nsf joined #nim
04:11:03*dadada quit (Remote host closed the connection)
04:15:46*dadada joined #nim
04:16:11*dadada is now known as Guest82611
04:16:28FromDiscord<Varriount> disruptek: typed/untyped was such an improvement over expr/stmt. So much easier to understand
04:16:49FromDiscord<KingDarBoja> How can I simulate passing arguments like Python partial? I know we dealt with this before but forgot the part of passing another param
04:17:28FromDiscord<KingDarBoja> I had this -> "let partialValueLiteral = proc(self: Parser): ValueNode = parseValueLiteral(self, false)"
04:17:47FromDiscord<KingDarBoja> But should provide the bool on the proc argument
04:18:01leorizewdym?
04:18:04FromDiscord<KingDarBoja> The idea is calling the function inside another function
04:18:36FromDiscord<KingDarBoja> You know that Python Partial let's you pass an argument to the function without evaluating
04:18:59leorizeI still don't understand :P need examples
04:19:42FromDiscord<KingDarBoja> From leorize: _looks like you're having trouble separating functions call and functions as a value_
04:19:50*FromDiscord <KingDarBoja> so here's the rule: function name without arguments and/or () = a value
04:19:57*FromDiscord <KingDarBoja> otherwise it's a call
04:20:33*endragor joined #nim
04:20:44*endragor quit (Remote host closed the connection)
04:20:54*endragor joined #nim
04:21:13FromDiscord<KingDarBoja> https://imgur.com/RiDpF3Q a refresher
04:21:56FromDiscord<KingDarBoja> I remember when we tackled this but forgot the other param until I made a test right now
04:23:18FromDiscord<KingDarBoja> The idea was (still is) pass a proc as argument to another proc BUT only call it on the body of second proc
04:23:36FromDiscord<KingDarBoja> The idea works if there is no other param besides `self: MyType`
04:24:13FromDiscord<KingDarBoja> But doesn't seems to work if I try to pass an argument to the proc (being passed as argument to the second proc) 🤔
04:33:02FromDiscord<Varriount> @KingDarBoja Their are two ways. The fastest is to create a closure function, the most efficient is to create a callable type containing the parameters required
04:33:19FromDiscord<Varriount> *fastest as in fastest to write
04:34:05FromDiscord<KingDarBoja> The callable sounds like what we did that day
04:34:48*mwbrown quit (Ping timeout: 256 seconds)
04:34:53FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/parser.nim#L143
04:35:14FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/parser.nim#L723 Used here
04:35:35FromDiscord<KingDarBoja> But `isConst` param isn't being passed
04:35:42FromDiscord<KingDarBoja> Which should be...
04:35:45FromDiscord<Varriount> In pseudocode: `proc wrapFoo(a, b): auto { return proc(): auto { return foo(a, b) } }`
04:37:51FromDiscord<Varriount> With that method, the compiler creates the data structure required to hold the parameters captured by the inner procedure, and passes it along with a pointer to the inner procedure behind the scenes.
04:38:09FromDiscord<KingDarBoja> 🤔
04:39:07*mwbrown joined #nim
04:43:40FromDiscord<KingDarBoja> Ok, I declared that
04:44:21FromDiscord<KingDarBoja> Then in order to pass it to the other proc as param, just use `outerProc(param1: int, param2: wrapFoo(), ...)`?
04:51:26FromDiscord<Varriount> https://play.nim-lang.org/#ix=2iLL
04:51:52FromDiscord<KingDarBoja> Checking right now
04:52:29FromDiscord<Varriount> That is a brief snippet which shows (generally) what the compiler translates closures to.
04:54:38FromDiscord<Varriount> Note that is an estimation. It gets a lot more intricate when you have scenarios involving closures that share the same parent scope.
04:55:44FromDiscord<KingDarBoja> Mate, thanks, solved the issue by looking at your sample
04:55:46FromDiscord<KingDarBoja> 😄 😄
04:56:09FromDiscord<KingDarBoja> I almost got the same, but was missing the correct types on the second Proc
04:58:20FromDiscord<KingDarBoja> I will keep that example somewhere on my project
05:02:30FromDiscord<KingDarBoja> Quick question, what does auto do?
05:04:25*narimiran joined #nim
05:07:58FromDiscord<InventorMatt> according to the nim manual "The auto type can only be used for return types and parameters. For return types it causes the compiler to infer the type from the routine body:"
05:12:17Prestigenim-lang.org down atm?
05:12:33FromDiscord<Rika> yes
05:12:46FromDiscord<KingDarBoja> Thank you
05:12:55FromDiscord<Rika> oh. no
05:12:58FromDiscord<Rika> its not down
05:13:10Prestigeseems to be spotty
05:13:28FromDiscord<Rika> loads just fine for me, switch dns to either googles or cloudflares
05:20:56*rockcavera quit (Remote host closed the connection)
05:42:16FromDiscord<Mask> how do i test if a number is within a certain range and return a boolean
05:43:31leorizenum in a..b
05:43:58FromDiscord<Mask> oh okay i was close
05:44:04FromDiscord<Mask> num in range[a..b]
05:45:28FromDiscord<Rika> range[] is a type
05:51:43PrestigeHaving a strange issue using a table declared in another file, can anyone take a quick look? https://0x0.st/i19-.png
05:52:31Prestigesame code outside of the file doesn't work as the same code inside the file (where the table is declared)
05:54:30FromDiscord<Rika> you didnt import tables
05:54:44FromDiscord<Rika> prestige ^
05:55:02Prestigeoh I need to also import tables from this file, that makes sense. Thanks Rika
05:56:18FromDiscord<Rika> classic "forgot that procs arent bound to type" 😛
06:10:01*dddddd quit (Ping timeout: 256 seconds)
06:13:18*solitudesf joined #nim
06:14:41*chemist69 quit (Ping timeout: 272 seconds)
06:15:30*chemist69 joined #nim
06:17:47*opal quit (Remote host closed the connection)
06:18:02*opal joined #nim
06:23:24FromDiscord<Varriount> @Rika I like your avatar
06:28:25*zacharycarter joined #nim
06:29:25*xcm quit (Remote host closed the connection)
06:31:29*xcm joined #nim
06:32:47*zacharycarter quit (Ping timeout: 265 seconds)
06:34:00FromDiscord<Rika> thanks
06:34:23*filcuc quit (Ping timeout: 256 seconds)
06:52:15skrylar[m]i ended up just not using tables and wrote my own hashmap ._.
06:53:30Araqskrylar[m], why?
06:55:26skrylar[m]well mine exports the hash function, so you set if you need a security or a speed hash
06:57:57skrylar[m]i haven't crosstested against stdlib yet https://git.sr.ht/~skrylar/skmap
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:36*kungtotte quit (Ping timeout: 256 seconds)
07:02:07skrylar[m]although right now it just uses blakes which is overkill because i haven't fixed spooky or finished the xxhash port :/
07:04:05FromDiscord<Milerius> nimsh died few hours ago
07:04:05FromDiscord<Milerius> the installer for linux
07:04:05FromDiscord<Milerius> ./init.sh
07:04:05FromDiscord<Milerius> curl: (22) The requested URL returned error: 522
07:04:06FromDiscord<Milerius> choosenim-init: Downloading choosenim-_linux_amd64
07:04:06FromDiscord<Milerius> curl: (22) The requested URL returned error: 404 Not Found
07:04:43*gmpreussner joined #nim
07:08:16Araqskrylar[m], ok well. at least in Nim you can write your own hash tables ;-)
07:08:47skrylar[m]i feel like you are saying something about javascript here
07:09:01skrylar[m]beans are for drinking not scripting :leers:
07:09:08*kungtotte joined #nim
07:09:37*narimiran quit (Quit: leaving)
07:11:00skrylar[m]on an unrelated note my poking at the haxe toolchains from the other day lead me on to this gem https://github.com/mapbox/earcut and i see nimble does not list an earcut package. :ponders:
07:11:06*narimiran joined #nim
07:22:23*PMunch joined #nim
07:25:10livcdis nto nimforum today a bit slow?
07:25:17livcdhttps://forum.nim-lang.org/t/6236 this took my to open like 6s
07:25:40Araqlivcd, it's slow for me too
07:41:54*Romanson quit (Quit: Connection closed for inactivity)
08:08:06FromDiscord<Benumbed> I gotta say, I don't have many gripes with Nim at all, but needing to import something like 'tables' in a module when I'm importing another module that imports it, is not a happy
08:09:24FromDiscord<Benumbed> The compiler errors if I don't also tend to slow me down and give me pause when it happens. I end up in "What the hell are you talking about?" territory when the proc signatures don't have the expected type (but that is also how I end up remembering to import the other module)
08:09:30skrylar[m]isn't that only true if you want to interact with the table directly
08:09:48*Faulander_ quit (Read error: Connection reset by peer)
08:10:08FromDiscord<Benumbed> It's true in cases where I have a type defined in the other file using a table, then want to assign to that type
08:10:17FromDiscord<Benumbed> That's really the big bit that throws me
08:10:54skrylar[m]i *have* gotten bit by it saying there was no `[]=` alternative because i didn't import the robin hash module along with the object using a robin hash, which was a bit derpy... you can export the module explicitly but i dunno
08:11:18FromDiscord<Benumbed> So `type MethodMap* = Table[uint16, DispatchMethod]` in one module, and the other one imports that module and does `var channelMethodMap* = MethodMap()
08:11:19FromDiscord<Benumbed> channelMethodMap[11] = channelOpenOk`
08:11:36FromDiscord<Benumbed> and that will throw weird compiler errors unless you import tables
08:11:38AraqBenumbed: I agree but don't have a good solution
08:11:47Araqthe module can do 'export tables' though
08:11:55FromDiscord<Benumbed> Okay, I'll stop bitching then 😄
08:12:11AraqIMO it's caused by Nim's childish "let's not attach procs to types" stance
08:12:28skrylar[m]but i like that part of nim :eyes:
08:12:45Araqskrylar[m], I know and it's currently very fashionable
08:12:57FromDiscord<Benumbed> I'm not entirely certain if that's humor or not, given you're the Father of Nim haha
08:13:05Araqlanguage design is fashion driven
08:13:29skrylar[m]well, since c# and haxe got extension methods and extension methods aren't uncommon it sort of implies types owning their procs is warm and bad
08:13:53skrylar[m]hell none of the original OOPs even did that, it was some dumbo bolted on by java
08:14:02skrylar[m]to make vtables easier i guess
08:14:18FromDiscord<Benumbed> I'm just used to C/C++ where #include brings the world in from the other file
08:14:21Araqa hash table is an "abstract data type" and ADTs have little to do with OOP, in fact they are opposites
08:15:05Araqthere is an excellent paper about this from Cook iirc
08:15:06FromDiscord<Benumbed> TBH I don't even mind needing to import, I think better compiler errors would suffice
08:15:15Araqfair enough
08:15:29FromDiscord<Recruit_main707> imho it would be nicer not needing to though
08:16:10FromDiscord<Benumbed> If I can improve my experience with the core, that's something I'd like to contribute to, clearer compiler errors
08:16:29FromDiscord<Benumbed> Although that may be a maze of twisty passages I'm talking about getting myself into 😄
08:16:31skrylar[m]well. all i'm saying is types owning their procs don't really show up in the classical literature. and 'even' the classical OOPs you didn't even own it, since CLOS you define methods that belong to no-one and objects simply provide implementations for those, and in smalltalk you can bolt any new receiver to any object, i'm not entirely sure if haskell and ocaml even do it, but i haven't used the last two in a long while
08:17:48Araqhttps://www.cs.utexas.edu/users/wcook/papers/OOPvsADT/CookOOPvsADT90.pdf this is it.
08:18:09skrylar[m]could just use a factory method to get around importing table to construct it, but you still need the import to get access to `[]` and `[]=`
08:18:58Araqwell just because we attach procs to types doesn't mean we cannot just leave the Nim syntax as it is
08:19:28Araqit would solve quite some problems of Nim's design, I suppose I should write an RFC...
08:20:04Araqfor example, it would solve the common gotcha of "gah, I used system.$ instead of the custom $ by accident"
08:20:47skrylar[m]i'll be verily surprised when i see a time you aren't tripping over your own creation trying to undo it
08:21:26FromDiscord<Recruit_main707> its not undoing, its maturing i guess
08:21:55Araqskrylar[m], I call it "progress"
08:22:02PrestigeHow do I import modules relative to another in a directory hierarchy?
08:22:05FromDiscord<Gary M> Hey Araq
08:22:09FromDiscord<Gary M> https://i.imgur.com/kFACdMq.png
08:22:29FromDiscord<Gary M> all of these are functionally the same but syntax highlighting it consistently seems impossible...
08:22:53PrestigeI have two sibling directories with a module in each, and I'm trying to import one into the other
08:23:17FromDiscord<Benumbed> Prestige: Same way you'd ref it on the command line '../<otherdir>/<othermodule'
08:23:32Araqskrylar[m], and what I have in mind is pretty tame, please relax
08:23:54*konvertex joined #nim
08:23:54skrylar[m]i'm not firing up the haxe compiler and porting code just yet
08:24:22Araqread the article btw, it's good
08:24:27skrylar[m]it's just that if one wanted a language that was like the others, we'd just use the others. and often times i see you trying to walk back things in to being like all the others. and then eventually fall over and decide not to do it
08:24:46PrestigeThanks Benumbed I had no idea we could do that
08:24:56*Vladar joined #nim
08:25:00skrylar[m]i did, and it just seems like pedantry
08:25:21skrylar[m]tl;dr just make all the members private and declare the class final, now its an adt
08:25:41FromDiscord<Gary M> yikes, I came in at the wrong time to ask questions 😅
08:25:58FromDiscord<Recruit_main707> Nim is not like the other langs, and Araq has said that could not affect the syntax.
08:26:29AraqGary M: care that 'addr x' highlights well, the other syntaxes are not idiomatic
08:26:51FromDiscord<Recruit_main707> but there is no point in reinventing the wheel now, theres nothing wrong with taking concepts from other languages
08:27:12skrylar[m]the syntax highlighting looked ok to me, although `addr` shoul dhave been highlighted in the top line
08:27:46FromDiscord<Gary M> Araq: but isn't addr a procedure technically, or should it be treated as a keyword specifically at all times
08:28:04Araqskrylar[m], it's an ADT if it lacks inheritance and dynamic method resolution but ok
08:30:19skrylar[m]yes but in java terms a final class is excluded from being inherited from, and unless it has a parent class the method resolution is not dynamic, and i think hotspot will even recognize this, so in my mind the thesis is to just slap `final class Blah { private: all the shit public: bleh }` ... so basically agreement
08:38:07FromDiscord<Gary M> https://i.imgur.com/XXEtp6R.png
08:38:15FromDiscord<Gary M> so this is with addr as a keyword
08:38:34FromDiscord<Gary M> however echo isn't a keyword in the manual. Should it be left uncolored?
08:39:06skrylar[m]looks okay
08:40:17skrylar[m]lucky person getting to play with vulkan :p gles2 here ._.
08:42:57FromDiscord<Gary M> ha, well only a little bit so far. It really takes a lot just to make anything at all happen
08:43:08FromDiscord<Gary M> I think I need to define $ as an operator
08:43:10FromDiscord<Recruit_main707> im gonna say echo should be colored anyway.
08:43:33Araqargh, don't color 'echo' in any special way, it's not special
08:43:39FromDiscord<Gary M> lol
08:43:45Araqcolor the keywords as they are defined in the manual
08:43:49FromDiscord<Gary M> I'm going to side with Mr. Araq on this on, sorry Recruit
08:44:05Araqdon't overdo the coloring, right now VSCode gets it super wrong
08:44:09FromDiscord<Recruit_main707> i might change it in my side then :P
08:44:19FromDiscord<Gary M> Araq: that's why I'm working on changing it
08:44:36Araqah, great!
08:44:49FromDiscord<Gary M> and so far so good, probably just going to miss a lot of things at the start but people should bug me about it once I get it released
08:45:32FromDiscord<Gary M> idk if it'll be able to work alongside the current one because I'm not sure if the dev for the current extension is active and/or open to fixes
08:45:43FromDiscord<Gary M> well less of a fix and more of a full replacement of the textmate grammar file
08:47:17FromGitter<Vindaar> @Araq Your recent commit that disallows `for a in EnumWithHole` also broke `parseEnum` for enums with holes, since it depends on `low(T) .. high(T)`. Should we add a `listFields` macro to use for this or do you have a different idea?
08:48:33AraqVindaar: dammit
08:48:33FromGitter<mratsim> Why was "-gnu++14" added in 1.2.0 for C++? It brokes cuda compilation for me?
08:48:59FromGitter<Vindaar> :|
08:49:13Araqmratsim: we cannot map Nim's exceptions to C++'s effectively otherwise and ensure you can catch C++ based exceptions without .emit
08:49:18FromDiscord<Gary M> I think what I'll end up doing is just uploading it as a fork, because people might prefer the original albeit messed up syntax highlighting
08:55:41skrylar[m]hah. --gendeps output format is directly what `redo` likes. (although.. not ninja.)
08:56:01*skrylar[m] should get back to that nim redo port someday ._.
08:56:22AraqI cannot see how anybody can like 'proc' having a different color than 'when'
08:56:53skrylar[m]proc is part of the bedrock, when is a macro?
08:58:14Araqboth are keywords
08:58:29Araqand 'when' is not exactly "control flow" either
09:00:32FromDiscord<Benumbed> @Gary M If you fork the existing one, I'd probably contribute... the autocomplete for imports drives me nuts, it's very wrong 🙂
09:03:30FromDiscord<Gary M> @Benumbed can you tell me why it's wrong so I can look out for it 😄
09:03:46FromDiscord<Benumbed> Sure let me get you a concrete example, 1 sec
09:04:07Araqcan you also change it so that it opens a single nimsuggest instance?
09:04:34FromDiscord<Gary M> I'm not familiar with the nimsuggest side of things
09:04:49FromDiscord<Gary M> but I'll look into it
09:05:01FromDiscord<Gary M> I'm guessing it's opening more than one for some reason?
09:05:03FromDiscord<Benumbed> So if I start typing 'conn' after 'classes' in the following line, it completes it very incorrectly: `import nim_amqp/classes/src.nim_amqp/classes.connection`
09:05:37FromDiscord<Benumbed> That's trying to import a module for the tests in the same project
09:06:02FromDiscord<Gary M> https://i.imgur.com/1nYEcYp.png
09:06:16FromDiscord<Gary M> this is kinda not very easy to read rn
09:06:30FromDiscord<Benumbed> Well... gotta kinda give Vulkan some credit for that too 😉
09:06:36FromDiscord<Benumbed> Man it is bloody verbose
09:06:47skrylar[m]i wonder if doing up a thin faceplate for gl would be a waste of time. i use a tiny one (mostly to distinct some glints and replace a lot of gl_stupid_whatever with just id.use) but i could sit and do the whole thing as a nimble package
09:07:11FromDiscord<Gary M> https://i.imgur.com/ZAZWcqL.png
09:07:22FromDiscord<Gary M> nevermind it's a little better with a proper : operator highlight
09:12:02FromDiscord<such father that father not> ...imagine if you were using rust
09:12:03FromDiscord<such father that father not> lol
09:12:36skrylar[m]what about rust
09:12:44FromDiscord<such father that father not> about "not being very easy to read"
09:12:59FromDiscord<such father that father not> nim is *poetry* in comparison to nim
09:13:03FromDiscord<such father that father not> rust*
09:13:47FromDiscord<Recruit_main707> i can read basically any langugage even though i dont know it and understand what it does, except with rust.
09:14:00FromDiscord<such father that father not> yep
09:14:13FromDiscord<such father that father not> i feel like it complicates a whole lot of things that don't have to be complicated
09:14:20FromDiscord<such father that father not> except people love it
09:14:26FromDiscord<such father that father not> ¯\_(ツ)_/¯
09:14:32skrylar[m]to be fair krhonos apis are ugly in every language. its why i do a faceplate :\
09:14:42FromDiscord<such father that father not> yeah, that makes sense
09:15:05FromDiscord<Gary M> yeah I'm just making a vklayer so I never have to look at that fuckin code again
09:15:06FromDiscord<such father that father not> i mean i'm writing a lexer, right
09:15:35FromDiscord<such father that father not> tried to write it in rust—didn't finish after 3 hours of hair-pulling over type casts, obscure method chaining and weird syntax
09:15:38FromDiscord<Gary M> I want to keep it 6 feet under the ground and just poke the api
09:15:39FromDiscord<such father that father not> wrote it in nim—30 mins
09:16:00skrylar[m]i could read rust for a while but its obnoxiously verbose
09:16:07FromDiscord<such father that father not> that's what i mean
09:16:10skrylar[m]their addiction to keeping floats verbose is gonna keep em out of games
09:16:28FromDiscord<such father that father not> but i feel that's why people love it
09:16:33FromDiscord<such father that father not> *because* it's so verbose
09:16:38skrylar[m]"we did it on purpose" -- rust devs
09:16:38skrylar[m]"we actually need to use floats all the time" -- game devs
09:16:38skrylar[m]t o o b a d
09:16:48FromDiscord<such father that father not> lmao
09:17:40FromDiscord<such father that father not> **for now** i don't see how rust is better than nim
09:17:45FromDiscord<such father that father not> but i'll continue writing both
09:17:48FromDiscord<Gary M> how verbose are floats in Rust?
09:17:52FromDiscord<such father that father not> but i'll continue writing code in both
09:18:04FromDiscord<Gary M> I'm used to just doing 5.389f if I have to 😄
09:18:07FromDiscord<Recruit_main707> try not to edit messages in discord, it spams irc
09:18:12FromDiscord<such father that father not> oh, okay
09:18:12FromDiscord<such father that father not> sorry
09:18:19FromDiscord<such father that father not> didn't know that 😅
09:18:27FromDiscord<Recruit_main707> np
09:18:42skrylar[m]i would rather deal with haxe's convoluted toolchain of an ocaml compiler building bytecode getting translated to straight c than go back to rust, if only because between those two communities only one of them cares about problems that occur outside of browser code
09:18:50FromDiscord<Gary M> I think the discord api pushes it as a new message event and if so there's no way to filter a new message from an edited message
09:19:06FromDiscord<such father that father not> yeah, i guess so
09:19:21skrylar[m]but the nice parts of rust is the borrow checker does prevent you from doing unsafe code, which can lead you to learn better data structures than trees with pointers everywhere
09:20:01FromDiscord<such father that father not> i'd still use c if i were to deal with manual memory management and such
09:20:28FromDiscord<such father that father not> but if i had to use that *and* utilize some new tools, like wasm, i think i'd have to turn to rust
09:25:33AraqI don't understand why 'unsafe {}' isn't good enough for manual MM
09:26:45*liblq-dev joined #nim
09:26:58FromDiscord<such father that father not> i'm not saying it's good enough
09:27:11FromDiscord<such father that father not> what i mean is i prefer c because it's been through a whole lot more than rust
09:27:16FromDiscord<such father that father not> (at least i think so)
09:27:29FromDiscord<such father that father not> also c *is* prettier than rust...? for me at least
09:27:38FromDiscord<such father that father not> prettier as in more readable
09:28:36FromDiscord<mratsim> Ironic :p
09:28:36FromDiscord<mratsim> https://cdn.discordapp.com/attachments/371759389889003532/701726001415192576/unknown.png
09:28:59FromDiscord<Recruit_main707> lmao
09:29:19FromDiscord<such father that father not> oof
09:29:20FromDiscord<mratsim> @skrylar but Rust makes it a pain to implement trees and DAGs
09:29:26FromDiscord<such father that father not> +1
09:30:11FromDiscord<such father that father not> i mean i'm not hating on rust
09:30:20FromDiscord<such father that father not> it's an amazing piece of software, as every is
09:30:40FromDiscord<such father that father not> it's just me that's not really fond of writing code with it
09:31:13FromDiscord<such father that father not> but the work on rust alone—error reporting, amazing extensibility—deserves a huge applause
09:32:21FromDiscord<mratsim> My issue with Rust was the ceremony, "Derive Clone" is OK, "Derive PartialOrd" is OK, but having to implement Debug or Print for every single type before being able to use my best debugging tool, the debug echo/println is such a huge pain
09:33:14FromDiscord<such father that father not> yessss
09:33:16FromDiscord<mratsim> especially for arrays. They still don't have integer generics for arrays bigger than 32 elements ....
09:33:34FromDiscord<such father that father not> implementing everything for everything is a pain
09:33:48FromDiscord<such father that father not> *though* yes, that is an advantage in some cases
09:34:09FromDiscord<such father that father not> actually in most of them if one uses rust for what it's actually made for—low-level, to-the-metal programming
09:34:53FromDiscord<mratsim> but sometimes you want to whip up a quick low-level script but as soon as you want to add more structure via an object, you start having to "impl" everything
09:35:46FromDiscord<such father that father not> yeah
09:35:59FromDiscord<mratsim> the "to-the-metal" improved a lot since I used it in 2016 but at the time I couldn't access SIMD
09:36:08FromDiscord<such father that father not> i love how this is a nim server and we're discussing rust lol
09:36:44FromDiscord<mratsim> also that was because I was not familiar with programming concepts but I was completely lost in references, lifetimes and borrow mut and ended up cloning everything
09:37:02FromDiscord<mratsim> though I guess programming in Nim made me a better Rust dev if needed :p
09:37:26FromDiscord<mratsim> well we also have andrewrk from Zig and GingerBill from Odin coming saying hi from time to time
09:38:00*xcm quit (Remote host closed the connection)
09:40:34*xcm joined #nim
09:41:28Araqmratsim: what's ironic about it?
09:42:23FromDiscord<mratsim> Font missing and last commit is about unicode
09:43:34Araqthe best thing about unicode is that there is only one of it
09:43:59FromDiscord<mratsim> isn't there UTF-8 and UTF-16?
09:44:31FromDiscord<mratsim> Unicode is probably the last thing I want to deal with. It seems like a mess from the outside
09:45:09Araqmratsim: yes but it's better than the "code pages" stuff it replaced
09:46:55FromDiscord<mratsim> oh sure
09:47:26FromDiscord<mratsim> When I was in China, dealing with codepages was a pain.
09:59:49FromDiscord<Gary M> should built-in types be colored or not?
10:00:54FromDiscord<Gary M> for instance: https://i.imgur.com/2y1DCLB.png
10:01:27FromDiscord<Recruit_main707> yes, ofc (am i wrong?)
10:01:41Araqno. they are still just types
10:01:46FromDiscord<Gary M> well, you were wrong about echo 😄
10:01:59Araqin general I'm a friend of this rule:
10:02:19Araqhighlighting should only care about how the language's lexer operates
10:02:25FromDiscord<Recruit_main707> lel, nim is gonna look grayscaled
10:02:29Araqabout tokens
10:02:41FromDiscord<Gary M> https://i.imgur.com/iJ0b0V6.png
10:02:47FromDiscord<Gary M> this is hardly grayscaled, my friend 😄
10:03:17Araqnot about "semantics" because semantics are harder and unreliable inside an editor
10:03:27FromDiscord<Recruit_main707> you dont statically type their types though
10:03:38FromDiscord<Gary M> what do you mean
10:03:49FromDiscord<Recruit_main707> let a: int = 2
10:03:49FromDiscord<Recruit_main707> let a = 2 <-
10:04:39FromDiscord<Gary M> I don't see the issue
10:04:46*nullwarp quit (Ping timeout: 256 seconds)
10:05:12FromDiscord<Gary M> https://i.imgur.com/EWsgo9B.png
10:05:14*nullwarp joined #nim
10:22:53FromGitter<gogolxdong> Any library to build application on mobile phone?
10:32:46*tane joined #nim
10:35:09livcdgogolxdong: yglukhov's libs
10:36:02*inv2004 joined #nim
10:37:49inv2004Hello, are there any way to do variant objects based on C-struct, where kind is not the first field ?
10:38:52*Vladar quit (Quit: Leaving)
10:38:58PMunchinv2004, kinda
10:39:27PMunchWhat is the memory layout you need to wrap?
10:40:48Araqhttps://www.youtube.com/watch?v=W3aieHjyNvw good insights into entity component systems
10:40:58*solitudesf quit (Read error: Connection reset by peer)
10:42:49skrylar[m]admittedly i do like webassembly wasm
10:45:39skrylar[m]altho re: using c again... for a while i wondered about just having a thin layer that turned s-exps in to raw c code, since you could then just start stacking stuff on top of that. i do use a system like this for an unrelated scripting system (where you have to use a very terrible proprietary language) and its working so far... but i'm sure there is a reason we don't write compilers like this -shrug-
10:46:03*solitudesf joined #nim
10:46:26FromDiscord<mratsim> there are plenty of tutorial or codegolf challenge to write a Lisp interpreter in C
10:46:26Araqhint: it has to do with types
10:46:56Araqtype systems are better when they didn't outgrow a system that started as a typeless language
10:47:23skrylar[m]@mratsim: it's not a lisp interpreter in c; its a C AST in lisp
10:49:01FromDiscord<mratsim> I'm pretty sure someone wrote a Lisp LLVM frontend and you could output some C
10:49:19skrylar[m]yes some lispers have done c code gen in ages past, it just always seems to get buried somewhere
10:49:48skrylar[m]the point is its more like terra/lua where the lisp/lua is 'just' building ASTs it tosses to terra to actually build
10:50:11Araqdoes it get more buried than the rest of stuff wirtten in Lisp though?
10:51:30FromGitter<mratsim> Does Terra still get developed? The main author is working at Facebook on PyTorch since about 2 years ago.
10:51:50skrylar[m]i dunno, but the concept keeps re-appearing and then getting acquihired away
10:53:38Araqmaybe "small core + macros on top of it" isn't really as easy to do when the end result has to convince consumers
10:54:05skrylar[m]if i had to guess i'd say its because it melts the brains of average developers whom IBM demonstrated can't even code binary searches
10:55:06skrylar[m]simple macros have been a persistently hard sell, let alone "so the language is literally a tower of macros."
10:55:28Araqwell not everybody is a fool, yes, it's awesome you can build your own 'async' as a library. it's less awesome that the error messages are weird and stack traces are messed up
10:55:56*tribly quit (Quit: WeeChat 2.8)
10:57:37*tribly joined #nim
10:57:43skrylar[m]well macroexpand at a repl isn't hard to use
10:57:54skrylar[m]especially macroexpand-1
10:59:00Araqyou don't have to sell me macro systems, I still like them, but priorities differ among programmers
11:00:01Araqand "others are just too stupid for Lisp" is not a very useful insight ;-)
11:00:08Araqbbl
11:02:24*liblq-dev quit (Quit: WeeChat 2.7.1)
11:06:02skrylar[m]for me its more c isn't too bad but i wish the preprocessor was more amenable to things like "just assume every time i declare a function, i want to add these tracers to it."
11:06:33skrylar[m]but scripts adding magic to code gives a lot of people problems, so meh.
11:08:50skrylar[m]@mratsim hey how are you with crazy signal math
11:17:46skrylar[m]saw some interesting synthesis patents expired recently. slogging through them slowly
11:18:55*lritter quit (Ping timeout: 265 seconds)
11:20:34*Vladar joined #nim
11:21:57inv2004Is it possible to define proc for one object-variant kind ?
11:22:20FromGitter<mratsim> I don't know, I can deal with implementing math if I have a reference to test against because quite often papers are completely skimming on the implementation details (looking at you deep learning and crypto papers ...)
11:22:44*krux02 joined #nim
11:23:05skrylar[m]inv2004: i don't believe so, you might have to assert the type in the function, since types do not own procs
11:23:21FromGitter<mratsim> AFAIK it's possible to do it for NimNodes with proc foo(x: untyped{nkIdent}): untyped so the base code is here
11:23:32FromGitter<mratsim> sorry macros*
11:23:44FromGitter<mratsim> and there was a RFC to have that
11:23:46skrylar[m]interesting
11:24:52inv2004I still not sure should I use object variants or better to avoid it. Because they looks too duck-typing
11:25:30FromDiscord<clyybber> if you need them use them
11:25:41inv2004:)))
11:27:24skrylar[m]@mratsim it seems to explain most of it, i just have to take the time to map it all out :/ but he does some interesting stuff breaking samples in to harmonics with filters, then stores 'just' the residuals, and then trains a tiny neural network to re-produce the original dominant frequencies, so it's able to to pitch glide between different samples of the same instruments
11:27:24skrylar[m]<https://patentimages.storage.googleapis.com/53/c7/69/65c921a09da6d7/US6298322.pdf>
11:33:22*lritter joined #nim
11:37:09*filcuc joined #nim
11:42:31inv2004is it possible to make enum ord-number to byte ?
11:43:51FromDiscord<mratsim> yes enum less than 255 are represented as byte in the backend
11:44:18FromDiscord<mratsim> @skrylar, why is this patentable? this seems like mp3 or AAC which are prior art
11:48:07*tane quit (Quit: Leaving)
11:57:00inv2004A bit confused: the first field after case kind has not the same offset like in plain structure
11:58:31inv2004object m: cchar, a: cchar, case kind of kT: tu: cchar . Without kind tu offset is 3, with kind tu offset is 8
11:59:49*dddddd joined #nim
11:59:50PMunchinv2004, because the kind needs space, and because of alignment
12:00:10inv2004PMunch, I have kind like byte in plain structure
12:00:22PMunchWhat do you mean?
12:01:12inv2004I mean - that it uses some space in plain structure, the question is about alignment only or size of enum
12:02:11inv2004so, anyway is a bit unclear why there are not aligned the same way
12:03:37*filcuc quit (Ping timeout: 256 seconds)
12:05:37PMunchDoes this make any of it clearer? https://play.nim-lang.org/#ix=2iNY
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:35*Guest82611 quit (Ping timeout: 260 seconds)
12:06:42*supakeen joined #nim
12:07:19inv2004PMunch, No, I mean it is clear that offset is not the same, but why
12:08:04*dadada joined #nim
12:08:15PMunchSo in the first example you can see everything alignment as you expect. Adding a simple enum with two fields (Nim is able to detect that this could be stored in a single byte) you end up with the two branches sharing the same memory, and the kind taking one byte. Defining that the kind is 4 bytes leads to it triggering alignment (to speed up the reading of the field, CPU/memory performance reasons) so that enum is now aligned in the struct,
12:08:15PMunchotherwise nothing changed.
12:08:26*dadada is now known as Guest65896
12:08:37PMunchWhat offset do you expect to be the same?
12:09:19PMunchObj1.offsetOf(c) and Obj2.offsetOf(c), or Obj2.offsetOf(kind) and Obj3.offsetOf(kind)?
12:10:17inv2004PMunch, https://play.nim-lang.org/#ix=2iO3
12:10:22inv2004I did not know about size
12:11:08inv2004but if I remove it is still correct
12:11:12PMunchYes
12:11:21PMunchBecause it only has two values, so it fits in a byte
12:12:03FromDiscord<mratsim> Nim uses the same alignment as C
12:12:50FromDiscord<mratsim> if you want packed fields use the {.packed.} pragma but unaligned loads are slower and might not work at all on some architectures
12:12:52PMunchSo if your enum takes more than one byte to store (either because it has too many fields, or some fields have specified values: https://play.nim-lang.org/#ix=2iO6
12:13:25FromDiscord<mratsim> and if you work with the raw byte representation of a type for serialization for example, use "offsetOf" to get the field position
12:14:29inv2004In your example everything is fine, let me try to copy my code
12:14:51PMunchHuh, why does Obj3 grow to 6 bytes? https://play.nim-lang.org/#ix=2iO6
12:15:04PMunchc and d should share memory..
12:16:24inv2004because looks like 255 is too much
12:17:11*couven92 joined #nim
12:18:03FromDiscord<clyybber> Araq: I rebased https://github.com/nim-lang/Nim/pull/12220, should I remove the style changes too (they rely on typeof(typedesc) being a noop and they only look more ugly?
12:18:06disbotallow generic typedesc field access ; snippet at 12https://play.nim-lang.org/#ix=2iO7
12:19:40Araqyou need to remove them so that we see the old variant still works
12:20:29inv2004PMunch, https://play.nim-lang.org/#ix=2iO9 sorry, full structure is a bit bigger, I tried to remove a lot
12:20:48inv2004anyway you can see that tu and u are not the same offset, which I expected
12:20:51Araqbtw there is network outage which is why the forum is slow
12:22:55PMunchinv2004, ah, that is because the other fields in the struct force alignment
12:23:32PMunchThe `l` wants to be aligned, and so it forces alignment of the entire memory region
12:24:13*NimBot joined #nim
12:24:34*lritter quit (Ping timeout: 256 seconds)
12:25:11PMunchYou can around this if you add {.packed.} to your object
12:25:34PMunchBut keep in mind that `l` will now be unaligned and cause reading to be slower
12:26:45inv2004PMunch, ah, I just put something to the l, because I have not converted the type yet :)
12:27:12inv2004can I dismiss any fields for variant ?
12:27:23PMunchWhat do you mean?
12:27:46inv2004I want just remove l:int and make kList ampty
12:27:48inv2004empty
12:28:04PMunchAh, use `discard`
12:28:23PMunchSo `of kList: discard`
12:29:12PMunchThose other integers in the struct will likely force alignment still though
12:29:34PMunchHmm, they would already be aligned though since you have four bytes ahead of them
12:30:39FromDiscord<clyybber> Araq: Done
12:31:42inv2004I discarded l, but still not aligned :(
12:33:26FromDiscord<clyybber> @mratsim https://github.com/nim-lang/Nim/issues/14021#issuecomment-616516089 `Tensor` is not the same as `Tensor[int]`?
12:33:28disbot`sameType` magic doesn't work for seq (and generics?) ; snippet at 12https://play.nim-lang.org/#ix=2iOf
12:33:37*zacharycarter joined #nim
12:35:18inv2004PMunch, https://play.nim-lang.org/#ix=2iOh
12:36:13inv2004How do you detect which field cause the misalign ?
12:40:35Araqclyybber: merge it once it's green
12:48:20*rockcavera joined #nim
12:52:27FromDiscord<clyybber> K
12:53:02FromDiscord<clyybber> Araq: Btw, does https://github.com/nim-lang/Nim/pull/14028/commits/e8759c44ea65d34c96f205edb8194ac1cfc6c181 mean that we can't catch segfaults anymore?
12:53:03disbotrefactor system.$ for objects a little; refs #13398
12:53:36Araqthe segfaults module keeps existing
12:54:00FromDiscord<clyybber> Ok, nice
12:54:05Araq--nilchecks:on was something else
12:55:30FromDiscord<clyybber> @arnetheduck What should be fixed in segfaults.nim ?
13:00:26FromDiscord<arnetheduck> @clyybber uh well, I don't know where to start even 😉 I mean, what's the objective of `segfaults.nim`? why would you want to use it?
13:01:22FromDiscord<clyybber> to catch segfaults obviously; Yeah its a bad idea generally, but its still interesting
13:01:36FromDiscord<clyybber> to catch segfaults obviously :p ; Yeah its a bad idea generally, but its still interesting
13:03:15FromDiscord<arnetheduck> well, `nilchecks` takes a behaviour and defines it, ostensibly: if you deref a pointer, you can hopefully handle it and the compiler can ensure it works by inserting `if not nil` checks or statically analyze the code
13:03:23FromDiscord<mratsim> @clyybber, no because I want to handle Tensor[bool] specifically and have a fallback for Tensor and then for the rest
13:04:02FromDiscord<arnetheduck> raising from inside a segfault handler? you're taking undefined behaviour and use undefined behaviour (raising, allocating and a whole bunch of things that you're not supposed to do in a signal handler) to define it?
13:04:03FromDiscord<clyybber> @mratsim You should use `is` then and check via sameType for Tensor[bool] specifically
13:04:14FromDiscord<mratsim> that's what i'm doing
13:04:46FromDiscord<mratsim> and that's what I said in my first message, currently the solution is to delegate the type processing to "runtime" and `when is` instead of trying to work with types in macros
13:05:17FromDiscord<arnetheduck> ie `nilchecks` has a chance of being well-defined and therefore a tool that you can rely on - `segfaults`? not so
13:05:56FromDiscord<mratsim> look at this beautiful type handling that I have to do since I can't do it in macros: https://github.com/mratsim/Arraymancer/pull/434/commits/46d32d98740d5adc3a9092ff2ad4510c1d0e6444#diff-0a37ef587fec15ad8eb65962b6f01f88R253
13:05:57disbotImplement Numpy fancy indexing
13:06:05FromDiscord<clyybber> @mratsim I'm referring to your last reply in the issue, you are using sameType there to check `Tensor` against `Tensor[int]`, and I'd argue it should return false like it does
13:06:19FromDiscord<mratsim> `is` returns true
13:06:37FromDiscord<mratsim> i.e. for the canonical type comparator this should be true
13:07:04FromDiscord<clyybber> is returns true, but sameType is intuitively true when a is b and b is a
13:07:31FromDiscord<mratsim> then I need a `is` that works on NimNode
13:08:31PMunchinv2004, that is a bit strange indeed. It seems like in isn't able to detect that the kind+tu would mean that tr is aligned and thus aligns the whole thing to the next border
13:08:59FromDiscord<Chiqqum_Ngbata> `when FancyType is (array or seq):`
13:09:06FromDiscord<Chiqqum_Ngbata> *presses record button on forehead*
13:09:41PMunchProbably nothing you can do about that though, you might need to use {.packed.} to force it and then just manually verify that it isn't out of alignment (or by some compile-time assert checking)
13:13:18Araqarnetheduck: I know you don't care but the customer is always right and I was paid to write segfaults. it's also useful during code reviews. if the code contains 'import segfaults' you can fire the person who used it :-)
13:13:36*liblq-dev joined #nim
13:14:08FromDiscord<mratsim> "The customer is always right", looks at RFC/feature rebuttal ... --> doesn't compile 😉
13:14:58FromDiscord<arnetheduck> well, we're not using it 🙂 it breaks core dumps, and I get no valuable feature in return - I'm a bit sad at seeing `nilchecks` go away though - like I wrote, the compiler _could_ generate the code necessary to allow me to catch nil dereferences at runtime
13:15:33AraqI want nil checking at compile-time
13:15:42Araqthe run-time mechanisms all suck
13:16:04FromDiscord<mratsim> btw where is the DrNim repo?
13:16:05FromDiscord<arnetheduck> so do I, but not all cases can be resolved at compile time, so I'll settle for runtime and defined behaviour
13:16:37FromDiscord<clyybber> @mratsim DrNim is inside the nim repo afaik
13:16:51Araqmratsim: it currently lives in the Nim repo as a separate tool, it requires a compiler API extension
13:17:29FromDiscord<mratsim> looking, looksgood
13:17:42FromDiscord<mratsim> so it's a DLL that can be added to the compiler?
13:18:04Araqmratsim: the build is simply 'koch drnim', works for all OSes I tried
13:18:07*PMunch quit (Quit: leaving)
13:19:41*PMunch joined #nim
13:21:40Araqhmmm with the new exception handling impl we could actually turn signals into exceptions
13:22:19FromDiscord<clyybber> \o/
13:22:39FromDiscord<clyybber> Araq: Phi nodes, do they help with reassignments?
13:23:27Araqclyybber: it's standard SSA
13:24:48Araqthe only difference is that I don't store it in the AST nor in an IR but compute it on-the-fly for the static analyser
13:26:19Araqbut the next step is to intergrate it into our CI and use it for the nim compiler
13:26:54FromDiscord<clyybber> Cool, I like the on-the-fly approach, and were just read phi node somewhere and figured you had plans to bake it into the ast
13:27:38FromDiscord<clyybber> The current approach is really nice IMO
13:31:30Araqthe way I do the "versionization" of variables is still wrong
13:34:31FromDiscord<Gary M> it doesn't mean all that much, but I made the Nim extension go from over 300 files and over 1mb to 14 files and 218kb by properly packing the js 😄
13:34:39FromDiscord<Gary M> it doesn't mean all that much, but I made the VS Code Nim extension go from over 300 files and over 1mb to 14 files and 218kb by properly packing the js 😄
13:34:46FromDiscord<Gary M> sorry for the edit oops
13:35:25FromDiscord<clyybber> Oh, btw did you try nimlsp?
13:35:33FromDiscord<Gary M> no
13:35:44FromDiscord<Gary M> microsoft's lsp doesn't support syntax highlighting
13:36:02FromDiscord<Gary M> I ended up rewriting the syntax highlighting for the extension anyways.
13:36:14FromDiscord<Gary M> A lot of things are now uncolored but it's more idiomatic, I think
13:36:27PMunchThere is an unofficial extension to LSP that offers this. So I'm looking into implementing that in nimlsp
13:36:34FromDiscord<clyybber> \o/
13:37:58FromDiscord<Gary M> https://i.imgur.com/644FlKJ.png
13:38:11FromDiscord<Gary M> it's not public yet but it should be soon
13:38:25FromDiscord<clyybber> nice!
13:38:43*couven92 quit (Quit: Client Disconnecting)
13:39:13FromDiscord<Gary M> https://i.imgur.com/tBD5tKh.png
13:39:41FromDiscord<Chiqqum_Ngbata> Link to VS Code Nim extension?
13:41:54*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
13:42:25*pbb joined #nim
13:44:36FromDiscord<Gary M> the original or mine?
13:45:24*kenran joined #nim
13:45:36FromDiscord<Chiqqum_Ngbata> Damn there's a lot it looks like
13:45:47FromDiscord<Chiqqum_Ngbata> Yours
13:45:49*kenran quit (Client Quit)
13:45:58FromDiscord<Gary M> I said it's not public yet.
13:46:07FromDiscord<Gary M> I'm making sure it's not all borked before publishing
13:46:32*kenran joined #nim
13:49:03FromDiscord<Gary M> @Chiqqum_Ngbata ok I published it but the browser page is currently a 404 😄
13:49:11FromDiscord<Gary M> but you might be able to find it searching Nim or Nim alt
13:49:15*inv2004 quit (Ping timeout: 260 seconds)
13:49:55FromDiscord<Gary M> if not, it's probably just going to take time to verify the package
13:50:17FromDiscord<Gary M> https://marketplace.visualstudio.com/items?itemName=garym.nim-alt looks like it's here
13:52:34Araqoh sorry I was wrong, Clyybber. the way I do PHI nodes is entirely different because ordinary PHI nodes lose information
13:55:13FromGitter<gogolxdong> @livcd, haha , nimx again
13:56:52*kenran quit (Quit: leaving)
13:57:44*kenran joined #nim
14:00:34FromDiscord<mratsim> now we just need a LLVM IR mapping and we can generate code on GPU
14:01:08Araqnlvm is that IR mapping you're talking about
14:01:58FromGitter<bung87> how to pass `ENABLE_STRICT_OBJC_MSGSEND` flag, I googled someone using it in xcode build config, dont know how to pass it during nim build
14:03:14Araq--passC:-DENABLE_STRICT_OBJC_MSGSEND
14:05:49FromGitter<bung87> `--passC="-DENABLE_STRICT_OBJC_MSGSEND=0"` I can see it in result command
14:07:00FromGitter<bung87> but it still static type check msg send
14:20:07FromDiscord<Recruit_main707> @Gary M why is self highlighted in your plug in?
14:20:23FromDiscord<Gary M> What?
14:20:29FromGitter<bung87> I found the solution.
14:20:36FromDiscord<Recruit_main707>
14:20:36FromDiscord<Recruit_main707> https://cdn.discordapp.com/attachments/371759389889003532/701799480445370460/unknown.png
14:21:03FromDiscord<Gary M> Give me a sec to take a look
14:21:11*companion_cube quit (Quit: WeeChat 2.3)
14:21:15FromDiscord<Gary M> As noted colors are going to be different from the other plugin
14:21:20FromDiscord<Gary M> But I'll look into that
14:21:26FromDiscord<Recruit_main707> also, the * symbol to determine a function is public is not being highlighted, i dont know if thats not done yet
14:21:57FromDiscord<Gary M> That's not done at the moment.
14:22:17FromDiscord<Recruit_main707> ok
14:22:17FromDiscord<Recruit_main707> the theme is dark+ (i think it comes installed)
14:22:24FromDiscord<Gary M> I need to do some extra regex magic
14:22:30FromDiscord<Gary M> Dark+ isn't very good.
14:22:52FromDiscord<Gary M> Most themed will give you an extra color or two is any given file over the pre-installed themes
14:23:04FromDiscord<Gary M> Most custom themes*
14:26:30FromDiscord<Recruit_main707> another big issue ive found, do you have a github for this so that i dont fill the channel?
14:26:30FromDiscord<Recruit_main707> https://cdn.discordapp.com/attachments/371759389889003532/701800966789398538/unknown.png
14:27:42FromDiscord<Gary M> DM me
14:27:52FromDiscord<Recruit_main707> ok, i will
14:30:51FromDiscord<clyybber> lol, my github dark theme triggers when searching for github on duckduckgo
14:31:26FromGitter<gogolxdong> nimx requires Android Studio as far as I know, I remembered someone said he can pack android apk in Nim without Android Studio.
14:32:09FromGitter<gogolxdong> generate apk
14:32:18zacharycarteryeah you can
14:32:27zacharycarterbut you still need the android NDK
14:32:37zacharycarterand cross compilation toolset
14:32:43zacharycarterwhich the NDK includes
14:34:56*abm joined #nim
14:36:14zacharycarterhttps://github.com/fragworks/frag-android
14:36:16zacharycartermight help
14:36:37*polypoid[m] joined #nim
14:36:47zacharycarterthere's also this - https://forum.nim-lang.org/t/4840
14:37:06*kenran quit (Quit: leaving)
14:38:51*waleee-cl joined #nim
14:39:44*nsf quit (Quit: WeeChat 2.8)
14:46:20shashlick@Recruit_main707: did you see my comments on the nimterop group?
14:54:37FromDiscord<Gary M> ok so my alternate Nim extension for VS code is up so if anyone wants to bug test it go ahead and install it and shoot me some DM's where your syntax coloring isn't what you expect 😄 I haven't covered everything, yet.
14:56:37FromDiscord<Gary M> and araq or someone is going to have to explain what the problem is with nimsuggest apparently opening more than one instance
14:59:43FromGitter<bung87> ```code paste, see link``` ⏎ ⏎ what am I missing when I using thread runs a webview? [https://gitter.im/nim-lang/Nim?at=5e9db8dfd240da24338a0fee]
15:01:32FromDiscord<EdgyNerd> I wanna create a simple compiler in Nim, is there a good library for that?
15:01:55FromDiscord<mratsim> Do you want it to work at compile-time or runtime?
15:02:17FromDiscord<EdgyNerd> compile-time probably
15:04:02FromDiscord<mratsim> I'm certainly not a compiler dev but I have a proof-of-concept of a compiler implemented as macros for an embedded DSL here: https://github.com/numforge/laser/tree/master/laser/lux_compiler
15:04:37FromDiscord<mratsim> and various experiments that gradually led me to that here: https://github.com/mratsim/compute-graph-optim
15:05:13FromDiscord<mratsim> if using an embedded DSL, you can skip all the lexing/scanning/tokenizing/parsing and just let Nim macros do it.
15:05:22FromDiscord<mratsim> you only need to work on the AST.
15:07:40*Trustable joined #nim
15:08:31zacharycarterquestion - I want to be able to mutate a pointer inside of a procedure but `var pointer` seems wrong... Also, I'm unable to pass `nil` to a proc with a `var pointer` parameter - any ideas?
15:08:55FromDiscord<mratsim> This may also be seen as a compiler. It takes a state machine in a declarative syntax and produces the code: https://github.com/mratsim/Synthesis
15:09:24FromDiscord<mratsim> I suggest you use `var ptr T`
15:09:52FromDiscord<mratsim> "pointer" is problematic because it gets implicitly converted and upon conversion it misses the "mutable"/var tag
15:10:17FromDiscord<mratsim> I've had that issue when implementing channels in Weave
15:10:39zacharycartergotcha, I'll do that thanks mratsim!
15:12:19FromDiscord<mratsim> otherwise you can use ptr pointer or use cast[var pointer](p.addr), there are ways around that be just be aware of the implicit conversion
15:14:29*inv2004 joined #nim
15:14:40zacharycartermakes sense
15:15:24*uvegbot quit (Ping timeout: 258 seconds)
15:18:52*bra-ket joined #nim
15:20:00*liblq-dev quit (Ping timeout: 258 seconds)
15:20:45disruptek~stream
15:20:46disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
15:24:53disrupteki need a recommendation for a zoom replacement.
15:25:03disruptek3 party video chat.
15:31:00FromGitter<matrixbot> `Zoom` Jitsi?
15:31:15disruptekjitsi?
15:32:02disrupteklooks promisin.
15:32:04disruptekthanks.
15:32:22disruptekhave you used it?
15:32:30disruptekthis has to be used by old people.
15:37:16*tane joined #nim
15:37:23zacharycarterwe just tried Jitsi lol because zoom was so laggy today and Jitsi noworki
15:37:32disruptekugh.
15:40:41FromGitter<matrixbot> `Zoom` It had some issues with FF so I had to use ungoogled chromium for it. Worked fine. Hope they'll make it work with Firefox
15:40:45FromDiscord<Recruit_main707> shashlick: right now, thank you, i will have a look at it when i can
15:40:58zacharycarterI was using the native app
15:43:23shashlickokay no problem
15:53:50FromGitter<brentp> this: https://github.com/brentp/somalier/blob/master/somalier.nimble#L5-L10 used to work, but doesn't seem to any longer, apparently due to order in which files are sent to the .nimble install location (?). Is there a reliable way to get the version in a .nimble file without copying it?
16:00:52*liblq-dev joined #nim
16:01:37FromDiscord<mratsim> I've noticed that nimble used to use this trick and removed it recently
16:03:27FromGitter<brentp> exactly. that's where i originally copied it from and also noticed it is now gone.
16:11:34zacharycarterI want to create an object pool with 16 bit alignment - should I just use alloc / dealloc and pointer arithetic? or is there a better way?
16:12:41zacharycarterI can specify a capacity for the pool at runtime
16:12:53zacharycarterand ideally the pool is growable
16:13:04*nsf joined #nim
16:18:16FromDiscord<mratsim> use the {.align 16.} pragma
16:18:51FromDiscord<mratsim> example on my static preallocated pool: https://github.com/mratsim/weave/blob/master/weave/memory/persistacks.nim#L15-L51
16:19:00zacharycarterthanks
16:19:06FromDiscord<Gary M> Gpu stuff?
16:19:26FromDiscord<mratsim> and my growable pool: https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L133
16:20:13zacharycarterperfect
16:20:19FromDiscord<mratsim> in my case the pool design is somewhat complexified by the need to make them thread-safe
16:20:28zacharycarterthanks mratsim
16:20:52FromDiscord<mratsim> well "complex", because the only multithreaded part is things that use remoteFree: https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L115
16:21:30FromDiscord<mratsim> you also have an example of using LLVM/GCC Asan (Address Sanitizer) to make sure you don't introduce memory bugs
16:22:15FromDiscord<mratsim> https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L174-L182 with the wrapper proc here: https://github.com/mratsim/weave/blob/master/weave/instrumentation/sanitizers.nim#L11-L37
16:22:53zacharycarterah cool - I'm just compiling my entire program with those compiler / linker flags
16:22:58FromDiscord<mratsim> the design is here: https://github.com/mratsim/weave/tree/master/weave/memory#how-does-that-work
16:23:13zacharycarterbut that is nice - I'll use that
16:23:44FromDiscord<mratsim> one thing of interest to you is that the pool has a "heartbeat" and can trigger heavy/maintenance after a deterministic amount of allocation
16:25:10FromDiscord<mratsim> so to deal with trillions of tasks allocated in a couple of milliseconds I have a second layer of caching on top of the memory pool, and regularly it calls a heavy maintenance proc to release some of the cached memory to the pool if needed: https://github.com/mratsim/weave/blob/master/weave/memory/lookaside_lists.nim#L101-L102
16:25:33FromDiscord<mratsim> (I'm supposing you need that for a game engine that needs to deal with particles for example)
16:26:04FromDiscord<mratsim> the field is called "hook": https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L153-L162
16:26:29zacharycarterniceee
16:27:08zacharycarterright now I'm implementing a job system similar to the one described in naughty dog's slidedeck using fibers as job contexts
16:27:26zacharycarterbut I should just see if the fix for --gc:arc that worked to allow me to use threads also works with weave
16:28:07FromDiscord<mratsim> I yes I saw that one
16:29:03shashlickbrentp: you might be able to get around that nimble issue with a nim.cfg and a --path:
16:29:11FromDiscord<mratsim> mmmh having Weave more optimized for games shouldn't be too hard, I've outlined what would be needed here: https://github.com/mratsim/weave/issues/88
16:29:12disbotLatency-optimized / job priorities / soft real-time parallel scheduling
16:30:26FromDiscord<mratsim> also if you look there: https://github.com/numforge/laser/blob/master/research/runtime_threads_tasks_allocation_NUMA.md I've linked to 2 implementations of Naughty Dogs fibers - https://github.com/RichieSams/FiberTaskingLib, https://github.com/SergeyMakeev/TaskScheduler
16:30:59FromDiscord<mratsim> I suggest you also look into Intel task scheduler for games: https://github.com/GameTechDev/GTS-GamesTaskScheduler
16:32:32zacharycarterthanks for the protips
16:32:38*filcuc joined #nim
16:33:30zacharycarterbtw mratsim: weave seems to work with `--exceptions:setjmp` with `--gc:arc`
16:33:45FromDiscord<mratsim> if you can comment in the Weave issue about what you care about in games that would help me as well
16:34:18zacharycartersure
16:35:42FromDiscord<mratsim> Weave used to work with arc for all the benchmarks/test suite, the main unknown is Nim seq/strings
16:36:25FromDiscord<mratsim> well I'm pretty sure they don't work know because I use copyMem without following pointers but, would support be easy enough to add
16:37:57*Sembei joined #nim
16:38:34*endragor quit (Remote host closed the connection)
16:39:30*Intensity quit (Quit: Ping timeout (120 seconds))
16:59:28*Intensity joined #nim
17:14:48*edge joined #nim
17:14:58edgeexit
17:15:05*edge quit (Client Quit)
17:15:27Yardanicolol
17:17:52*konvertex quit (Quit: quit)
17:29:28*msmorgan quit (Ping timeout: 245 seconds)
17:30:01*msmorgan joined #nim
17:41:47FromDiscord<treeform> What is the state of GC arc now? Does it support async stuff?
17:41:59disruptekyes, but not without leaks.
17:42:02Yardanicoyou can *run* async with it, but it'll leak because async has cycles :)
17:42:07Yardanicoor something like that
17:42:20FromDiscord<Recruit_main707> therefore, not production ready we will call it
17:42:58disruptekdon't count on it working with this async impl.
17:43:26FromDiscord<Recruit_main707> wdym? async wont work in a close future with arc?
17:43:39disrupteknot in its current form, no.
17:43:48Yardanico4raq himself said so, disruptek is right
17:44:09Yardanicowe'll probably need another async impl or really rework this one (which will mean basically the same) :P
17:44:51disruptekarc is the much more valuable property in nim.
17:45:01*xcm quit (Remote host closed the connection)
17:45:13*filcuc quit (Ping timeout: 264 seconds)
17:45:17FromDiscord<treeform> how well does gc arc work with threads?
17:45:37disruptekbetter than gc:ref afaik.
17:45:42disruptekand improving, still.
17:46:14Yardanico@treeform you can access GC'd global data from threads :) but it's still not perfect, there are some regressions over refc
17:46:37Yardanicolike https://github.com/nim-lang/Nim/issues/13935
17:46:39disbotSIGSEV encountered when creating threads in a loop w/ --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2ioe
17:47:49*xcm joined #nim
17:49:19*Vladar quit (Quit: Leaving)
17:57:02leorize[m]#13201 is merged!
17:57:03disbothttps://github.com/nim-lang/Nim/pull/13201 -- 6Make file descriptors from stdlib non-inheritable by default
17:59:21Araqfwiw I'm continuing my work on the cycle collector
17:59:31leorizeorc?
17:59:35Araqyeah
17:59:55disruptekAraq: why can't we use the TInstantiation seq to figure out when new generic type instances are created?
18:00:00leorizethinout didn't work out?
18:00:06disruptekthinout works.
18:00:10disruptekit's just not automagic.
18:00:20disruptekpeople hate that.
18:00:28Araqwell currently both thinout and orc have the same underlying bugs
18:00:56Araqso it doesn't really matter what I work on, the bugs must be fixed
18:01:22leorizeorc can have a flag like -d:printCycles to tell us where to put thinout() :P
18:01:59Araqhmm
18:02:14Araqmaybe, it's a new idea, congrats
18:02:37disruptekmaybe i should have started here.
18:03:22*Faulander joined #nim
18:03:35Faulanderhi guys
18:03:57Yardanicohello
18:03:59disruptekor maybe that was a response to leorize.
18:05:44FaulanderI have a quick question: i am trying to convert the content of a header to a string, i get it like this var tmpCookie = response.headers["set-cookie"], its of type HttpHeaderValues or something. How to i get the values?
18:06:09leorizerun a for loop on response.headers
18:06:31Araqthere is also a converter to string or something
18:06:42Faulanderi know that its set-cookie, i just need the value :)
18:06:46*Intensity quit (Ping timeout: 256 seconds)
18:07:15*nsf quit (Quit: WeeChat 2.8)
18:07:28Yardanico@Faulander .headers is not a string, it's a sequence by the way
18:07:32Faulandervar tmpCookie = response.headers["set-cookie"]
18:07:33Faulanderecho $tmpCookie, ":", $tmpCookie.type.name
18:07:34Yardanicobecaue there might be more than 1 header of the same name
18:07:43Faulanderand i get:
18:08:00FaulanderSID=AS8q6lmkBLQM6Wg/1uTe2/QpxckqroVl; HttpOnly; path=/HttpHeaderValues
18:08:04Yardanicofor header in response.headers["set-cookie"]: echo header
18:08:25Faulanderyes, then i get exactly that output
18:08:40Faulanderas you see, the type = "HttpHeaderValues"
18:09:01Yardanicoyes, that's "distinct seq[string]"
18:09:53FromDiscord<Recruit_main707> how can you avoid the ugly error lines when working with threads
18:09:53FromDiscord<Recruit_main707> https://cdn.discordapp.com/attachments/371759389889003532/701857177689784340/unknown.png
18:10:15Yardanicoadd switch("threads", "on") to your .nims config file
18:10:19Yardanicoor --threads:on to your .cfg file
18:10:21Yardanicofor the project
18:10:55Yardaniconim.cfg for .cfg, yourfilename.nims for nims (same name as the main file in your project)
18:11:08FromDiscord<Recruit_main707> i dont have a .nims file, nor a .cfg
18:11:14Yardanicoyou need to create one :)
18:11:35disruptekAraq: ???
18:12:27disruptekhttp headers should be unique UNLESS they are cookies.
18:12:33disruptekper RFC.
18:12:47Yardanicodisruptek: well sorry but when I made a PR 3 years ago I didn't know about that :P
18:13:02disrupteki believe it's fixed in 1.2.
18:14:22FromDiscord<Recruit_main707> Yaradinco: errors at compile time also
18:14:22FromDiscord<Recruit_main707> https://cdn.discordapp.com/attachments/371759389889003532/701858310722420807/unknown.png
18:14:42Yardaniconot literally
18:14:55FromDiscord<Recruit_main707> oh
18:14:55Yardanicojust switch("threads", "on")
18:15:00FromDiscord<Recruit_main707> i see :P
18:15:00Yardanicowithout "just" word ofc
18:15:10FromDiscord<Recruit_main707> xD
18:16:39Araqdisruptek: we probably can use TInstantiation seq, I simply never tried
18:16:58disruptekokay. i will mess with it.
18:32:17Faulanderyeah, if i would understand that: Error: implicit object field construction requires a .partial object, but got HttpClientBase:ObjectType
18:33:05Yardanicoцрфе фку нщг екнштп ещ вщ,
18:33:11Yardanicowhat are you trying to do?*
18:33:42leorizedoes it mean exactly that in russian? :P
18:34:01Faulanderno, theres the question mark missing
18:34:09Yardanicoleorize: nothing, I just forgot to switch kbd layout
18:34:20FromDiscord<Generic> I was about to ask
18:34:26Faulanderlet client.headers = newHttpHeaders({ "set-cookie": self.cookie })
18:34:33FromDiscord<Recruit_main707> leorize:
18:34:33FromDiscord<Recruit_main707> https://cdn.discordapp.com/attachments/371759389889003532/701863393304510554/unknown.png
18:34:47FromDiscord<Generic> even russian there aren't so many words without vocals
18:35:08Faulanderself.cookie is a string, which i got from the login method by parsing the set-cookie from there.
18:35:38Yardanico"let client.headers " not like that
18:35:53Yardanicoyou shoudl first have a client like "var client = newHttpClient()" and then do "client.headers = stuff"
18:36:03Faulanderyes, i have that
18:36:08FromGitter<brentp> @shashlick, can you expand on that? not sure how to do it
18:37:09Faulanderhttps://play.nim-lang.org/#ix=2iQU
18:37:12Faulanderpart of the code
18:37:32Yardanicoas i said "let client.headers = newHttpHeaders({ "set-cookie": self.cookie })" is not corrent
18:37:40Yardanicocorrect* :P
18:37:48Yardanico"let" or "var" or "const" are for declaring new variables, not modifying existing ones
18:37:55Yardanicoyou should remove "let" from this line
18:38:10FromDiscord<Recruit_main707> happens to the best of us :P
18:42:13shashlick@brentp so when you install the package, you just need import x/y
18:42:28shashlickProblem is only when it is not installed and the src directory is present
18:43:04shashlickSo you can create a nim.cfg with --path:src in your project root
18:43:20shashlickSo when you run without install, the same import x/y will work
18:43:36shashlickNo need for any special code in the nimble file to import version
18:43:46Faulanderthanks yardanico, but now i get no connection anymore :) But continue to dig into it.
18:47:06*Intensity joined #nim
18:55:17leorizeI need help choosing the direction to implement async anonymous pipes for windows
18:55:47FromGitter<brentp> @shashlick. of course. thank you! will give it a try
18:55:57leorizeI can either implement it using true asynchronous pipes, but then I'll need to use threadpool to implement the async part since those stuff are blocking only
18:56:24leorizeor I can make named pipes and use overlapped i/o for normal async
18:56:51leorizethe bad part of named pipes is that they are inherantly insecure compared to asynchronous pipes
18:57:06leorizeanonymous*
18:57:23leorizebut threadpool will certainly be slower :/
18:57:46leorizeso it's performance vs security I suppose
18:58:09FromDiscord<Recruit_main707> who needs security, risk it for the biscuit
19:00:43*filcuc joined #nim
19:17:49nerdrat[m]dom96: Just for the record. I just had updated to nim 1.2.0 through choosenim 0.5.1 which I have in the laptop. Choosenim issue #194 does not seem apply to choosenim v0.5.1
19:18:12leorizeping shashlick
19:19:01nerdrat[m]Is shashlick in charge?
19:20:16leorizeI'd say so, dom hasn't been active in development
19:20:49*abm quit (Quit: Leaving)
19:28:16shashlicksup
19:28:27shashlickthis is the extraction issue right?
19:29:18shashlickwhat's interesting is that nimarchive was introduced in 0.5.0 and nothing was changed in 0.6.0 related to extraction
19:30:03FromDiscord<Rika> maybe its not triggered in certain cases
19:30:33FromDiscord<Varriount> leorize: https://stackoverflow.com/questions/60645/overlapped-i-o-on-anonymous-pipe
19:30:54leorizewell I know that
19:31:09leorizemy problem is what approach to go on
19:31:22leorizewhether I value security or performance more
19:31:36leorizenot security but "correctness" or performance
19:31:53FromDiscord<Varriount> Yeah, but I'm not sure anonymous pipes are intrinsically more secure
19:32:20FromDiscord<Varriount> They may just be named pipes with a generated name
19:32:24leorizethey are, anon pipes can only be accessed by whoever got the handle
19:32:32leorizenot anymore since windows 7
19:32:45leorizenamed pipes can be accessed by whoever got the rights
19:33:08leorizeheck it can even be accessed over the network
19:33:27leorizeand named pipes also make the distinction of "server" and "client"
19:34:09FromDiscord<Varriount> https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipe-security-and-access-rights
19:34:46FromDiscord<Varriount> Oh, hm. The owning account has full control of the pipe
19:35:05FromDiscord<Varriount> By default, anyway
19:35:17leorizeyep, meaning any process can access the pipe knowing the name
19:35:21leorizethere's a walkaround for that
19:35:45leorizeyou can make a pipe bound once
19:36:06leorizebut any user with admin context will be able to modify that :)
19:36:07FromDiscord<Varriount> leorize: Do you know offhand what rights are required to read process memory or inject a thread into a remote process?
19:36:25dom96nerdrat[m], yeah, as shashlick said, that doesn't make sense. Are you sure it happens with 0.6.0 and not 0.5.1 on the same machine?
19:36:35FromDiscord<Varriount> (read another processes memory under the same user)
19:37:19leorizenot sure, but administrative rights are required
19:38:34dom96leorize: what are you using pipes for btw?
19:38:43dom96I'd avoid threadpool as hard as I could fwiw
19:39:00leorizeimplementing an osproc replacement
19:39:24dom96you are aware of the asynctools package right?
19:39:46leorizeit's based of osproc and face the same restrictions
19:40:03dom96fork it? AFAIK it implements pipes
19:40:03leorizeand asyncpipe for windows is designed using named pipe
19:40:18leorizeand network access to those pipe is not disabled as well
19:40:55leorizeI can borrow code from it when I need it
19:41:07leorizebut I aim for different things than that project, it's better to start fresh
19:41:37*filcuc quit (Ping timeout: 256 seconds)
19:42:35*filcuc joined #nim
19:44:35nerdrat[m]<shashlick "what's interesting is that nimar"> The thing is, am I the only one getting this choosenim behavior?
19:44:42FromDiscord<Varriount> leorize: It _seems_ (though I can't test this, so I'm not sure) that a user has full rights to access their own processes
19:44:44PMunchHmm, is there a way to turn off "Spacing" warnings in a DSL?
19:45:49Yardanicowell you can always add {.push hint[Something]:off.} and then {.pop.}
19:45:57FromDiscord<Varriount> And since a process, by default, inherit's a user's rights, one process can call read/witeprocessmemory on another of the user's processes.
19:46:01FromDiscord<Varriount> https://devblogs.microsoft.com/oldnewthing/20040312-00/?p=40273
19:46:12leorizeniceeeeee windows
19:46:36ZevvPMunch: Not that I know of. I need to do {.push warning[Spacing]: off.} all the time :/
19:46:46leorizeI'd still want to do this thing correctly though, it's better to have less vuln than more
19:47:00YardanicoZevv: well if he has a DSL he can put that push to be automatically inserted :P
19:47:08leorizeI think I might have a good enough compromise to use named pipe, but I'm not sure :/
19:47:52ZevvYardanico: I don't think so. Wrong compiler phase. But I'd love to be proven wrong because NPeg also suffers from this
19:47:52PMunchYardanico, well the code the macro generate doesn't have the spacing warning, so it wouldn't help to expand to something with the push pragma..
19:48:08PMunchZevv :(
19:48:15FromDiscord<Varriount> leorize: yeah, but if an enemy process can read another process's memory, it's a moot point
19:49:58*NimBot joined #nim
19:50:17leorizeit's easier to read from a pipe than from memory :)
19:50:35leorizebut I think I'll settle with named pipes
19:50:53leorizetrue anon pipes for synchronous ops
19:51:04leorizeand pseudo anon for async
19:51:10leorizeseems like a good compromise
19:51:35leorizefor short and simple things most people would use synchronous pipes anyway
19:53:45leorizethanks for the help @Varriount
20:00:01FromDiscord<Varriount> leorize: Again, I'm not 100% certain. Normally I would test this, but my personal laptop barely stays up for 5 minutes before panicking
20:00:18FromDiscord<Varriount> I think the hard drive had failed
20:00:29*Jesin quit (Quit: Leaving)
20:00:49leorize[m]that's bad
20:01:36leorize[m]looking at Rust's implementation, I can see that they care about who get the "server" side of the pipe
20:02:16leorize[m]hmm, what exactly does the owner of the server side of the named pipe have that the client doesn't
20:02:38disruptekdata
20:03:23leorize[m]not that, I mean whether they have any additional rights or smt like that
20:03:47PMunchTurned my HackerNews Q&A reply into a post on my site: https://peterme.net/nim-qa-originally-a-hn-reply.html
20:04:16Zevvhn q&a? Link?
20:04:28Zevvoh it's in your post :)
20:04:33FromDiscord<Varriount> PMunch: Should we submit it to HackerNews? 😉
20:04:54PMunchVarriount, haha that would be great :P
20:04:58*Jesin joined #nim
20:05:11PMunchA HN reply turned article, turned HN post
20:05:47dom96ooh submit it :D
20:07:11PMunchVarriount, you want the honors? :P
20:07:36*xcm quit (Remote host closed the connection)
20:07:37*rockcavera quit (Remote host closed the connection)
20:10:02*xcm joined #nim
20:12:03shashlicknerdrat[m]: i think this is the second time someone has reported an extraction issue but last time, stuff was not extracted at all
20:12:13shashlickor maybe i'm misremembering
20:12:28shashlickregardless, we need your help to root cause this if you can make it fail consistently
20:12:34*rockcavera joined #nim
20:12:46shashlickcould definitely use the help cause i'm not able to recreate the issue locally
20:18:12*D_ quit (Ping timeout: 260 seconds)
20:18:23*D_ joined #nim
20:19:09disruptekAraq: this is gonna work.
20:27:19*filcuc quit (Ping timeout: 260 seconds)
20:27:30*PMunch left #nim ("leaving")
20:27:47*PMunch joined #nim
20:35:02*narimiran quit (Ping timeout: 264 seconds)
20:35:04FromGitter<brentp> anyone got a docker image with the zig CC set up and working for nim static builds?
20:35:06FromGitter<sealmove> guys would you recommend BSON?
20:41:54Zevvif you pay enough, sure
20:42:00ZevvI would recommend anything
20:42:09disruptekwut
20:42:20disruptekwhore.
20:45:02YardanicoD:
20:45:13FromDiscord<Rika> bson sounds good
20:45:29disruptekwhat, whores don't sound good?
20:49:00FromDiscord<IanIAnIAN> I use BSON every day
20:49:07FromDiscord<IanIAnIAN> it keeps my hair soft any shiny
20:54:53FromGitter<sealmove> pay enough?
20:55:09disruptekyou don't have to pay much for a whore.
20:55:10FromGitter<sealmove> sorry Zevv, didn't get your joke :3
20:55:37disruptekwell, depends on the customer, i guess.
20:57:01PMunchWow, that question derailed at record speed :P
20:57:47FromDiscord<Varriount> @IanIAnIAN I use the all-in-one cant-decide-if-its-a-string-or-a-number YAML
20:57:47*PMunch quit (Quit: leaving)
20:58:44FromDiscord<Rika> oh man not yaml
20:59:02FromDiscord<Rika> easy for humans to read horrible for humans to code a parser
20:59:11Yardanicoreally?
20:59:16PrestigeI think yaml is hard to read
20:59:18Yardanicoisn't it just indentation
20:59:44Yardanicoif I need a config for my project I just use TOML
20:59:53Yardanicoit's quite easy to understand and has "parsetoml" nim lib :P
21:00:05disruptekit cannot read what it writes.
21:00:08disruptekalso it looks like shit.
21:01:03*inv2004 quit (Read error: Connection reset by peer)
21:05:21FromDiscord<Varriount> Yardanico: The thing I dislike about TOML is that it's less-than-ideal for storing arbitrarily nested data
21:05:48FromDiscord<Varriount> For example, a Cloudformation or Terraform template.
21:07:31FromDiscord<Varriount> (Although I guess those aren't examples of arbitrarily nested data, just heavily nested data)
21:08:19FromDiscord<Varriount> And the big thing YAML has that I've only ever seen XML have is support for non-native (to the configuration language) data types.
21:08:44disrupteklua
21:09:15FromDiscord<Varriount> Lua is a data format?
21:09:20disruptekdhall
21:09:27*xet7 quit (Quit: Leaving)
21:09:33disrupteklua has non-native (to the configuration language) data types.
21:11:29FromDiscord<Varriount> Oh, this is neat: https://dhall-lang.org/#
21:12:55FromDiscord<Varriount> I'm not super excited about some of the syntactic constructs, but I guess you have to make tradeoffs somewhere.
21:17:56Araqah that again
21:18:21FromDiscord<Varriount> Oh dear. I'm sure you're going to point out some horrible flaw, aren't you?
21:18:40disruptekhe loves to comment on the whole Turing Complete thing.
21:18:46Araq^^ :D
21:19:04Araqif you bring it up, you have no clue about it.
21:19:22disrupteknot such a hard concept.
21:19:29Araqapparently it is
21:19:50FromDiscord<Varriount> Should I care whether it's turing-complete or not?
21:20:27disruptekit's a bothersome "feature" of a configuration language.
21:20:32disruptekalso, who gives a shit.
21:20:58Araqyou shouldn't care.
21:21:14disruptekthere are better reasons not to use dhall. 😁
21:22:51Araqthere are instruction sets with 1 instruction that are turing complete. Easy to write an interpreter for. now write "Doom" in it. you can't, why not? because turing completeness doesn't mean you can access the graphical subsystem, for example. TC is not about "arbitrary code execution", that's the job of so called "sand boxing".
21:23:23disruptekno, the point in dhall is that you can be sure your config will complete execution.
21:24:15disrupteki'll take "Problems We Don't Have" for $400, Alex.
21:24:25Araq:-) yes, that's the only thing that is really related to TC. same you can do with other mechanisms though
21:24:48Araqand arguably via better mechanisms
21:24:59disrupteksuch as?
21:25:08FromDiscord<Rika> what the hell, that hash thing they have in the main page
21:25:11FromDiscord<Rika> thats funky as fuck
21:25:24Araqjust stop running the VM after N processed instructions, disruptek
21:25:40disruptekyou always fall back on that.
21:26:00Araqit's the best mechanism, otherwise I can give you the ackermann function
21:26:19Araqit does terminate. eventually.
21:26:22disruptekit doesn't feel like the best.
21:26:38disruptekit feels like it requires knowledge of the code/env that i may not have or be able to presume.
21:26:45disruptekpractically, sure, but impractically? no.
21:27:10Araqwell it's not an important problem to begin with
21:27:31Araqplenty of systems use Lua for configuration and "omg, does this ever stop" is rarely a problem
21:27:32disruptekas evidenced by the occassion of your solution in the compiler. 🤣
21:27:49disrupteklike i said... $400.
21:28:04FromDiscord<Elegant Beef> Then there is me planning on using nims for configurating my window manager
21:28:19Araqmy solution works well and the VM is used for programming, not for configuration
21:28:22disruptekuse the simplest possible thing.
21:28:34disrupteknim ships with several config formats.
21:28:58FromDiscord<Varriount> > nim.cfg, nimble, nimscript...
21:29:10FromDiscord<Elegant Beef> Yea but none are as fun as using nims for configuring values inside the wm
21:29:23disruptek"fun"
21:30:12FromDiscord<Varriount> Elegant Beef: What WM is this?
21:30:16disruptekknow what's fun about wm?
21:30:21disruptekmanaging windows.
21:30:25FromDiscord<Rika> ok
21:30:27FromDiscord<Elegant Beef> im making my own WM
21:30:34disruptekembedding the nim vm in your wm... not so much.
21:30:40*xet7 joined #nim
21:30:53FromDiscord<Elegant Beef> If only i wasnt forcing the usage of a status bar
21:31:02FromDiscord<Elegant Beef> Damn, my wm has a forced shitty status bar
21:31:49FromDiscord<Elegant Beef> Not that it couldnt use another status bar with about 60 seconds of changes
21:32:13FromDiscord<Varriount> Elegant Beef: What about pluggable toolbars, like internet explorer.
21:32:24FromDiscord<Elegant Beef> eh?
21:32:31FromDiscord<Varriount> Just imagine, the fun of misc. toolbars, but for every window.
21:33:20FromDiscord<Varriount> https://i.stack.imgur.com/pOAAU.jpg
21:33:28FromDiscord<Elegant Beef> Lol sounds great!
21:33:40FromDiscord<Rika> make sure you enforce at LEAST 20
21:33:47FromDiscord<Elegant Beef> My current issue is with my status bar being silly crashes my wm if i have two open
21:33:57FromDiscord<Elegant Beef> so dual monitor a no go
21:34:17FromDiscord<Elegant Beef> *Use imgui, it'd be funny i said*
21:34:25disrupteklol
21:34:45FromDiscord<Elegant Beef> But i mean it doesnt look abohrrent
21:34:45FromDiscord<Elegant Beef> https://cdn.discordapp.com/attachments/371759389889003532/701908739917348946/unknown.png
21:35:10FromDiscord<Rika> i have a feeling this is abuse of imgui
21:35:14FromDiscord<Elegant Beef> psh
21:35:17FromDiscord<Elegant Beef> Totally
21:36:55FromDiscord<Varriount> Elegant Beef: Of course. Don't you know imgui isn't supposed to be used near cute pictures of dogs?
21:37:56FromDiscord<Elegant Beef> Cmon guys how could i be abusing imgui it's not like it takes 1.8% of my cpu to draw a single bar
21:38:27Yardanicolimit FPS to like 5
21:38:29Yardanicoyou won't need more anyway
21:38:34FromDiscord<Elegant Beef> yea i know
21:38:52*krux02 quit (Remote host closed the connection)
21:39:23FromDiscord<Elegant Beef> Im only drawing if i get an xevent and if it hasnt drawn within the last x seconds
21:40:30Yardanicoand how do you check if you got an xevent? :D while true?
21:40:47FromDiscord<Elegant Beef> XCheckMaskEvent, so i dont block
21:40:59FromDiscord<Elegant Beef> So yes
21:41:40FromDiscord<Elegant Beef> Anyone else here the screeching of disruptek reading how im handling this status bar?
21:41:44FromDiscord<Elegant Beef> hear*
21:43:14FromDiscord<Elegant Beef> Yea im at less or equal to awesomewm now
21:43:35FromDiscord<Elegant Beef> Also considering how daft i am i dont think ill suggest this to anyone
21:44:19*opal quit (Excess Flood)
21:44:32FromDiscord<Varriount> Elegant Beef: What is the 1-9? PTYs?
21:44:39FromDiscord<Elegant Beef> They're workspaces
21:44:41*opal joined #nim
21:44:42*opal quit (Excess Flood)
21:45:01*opal joined #nim
21:45:02*opal quit (Excess Flood)
21:45:21*opal joined #nim
21:45:23*opal quit (Excess Flood)
21:45:36FromDiscord<Elegant Beef> Mostly everything there is a button so i can test stuff in xephyr easier
21:45:43*opal joined #nim
21:45:44*opal quit (Excess Flood)
21:45:51FromDiscord<Elegant Beef> since i have the keybinds setup manually, and dont have config loading yet
21:46:03*opal joined #nim
21:46:05*opal quit (Excess Flood)
21:46:23*opal joined #nim
21:46:25*opal quit (Excess Flood)
21:46:26FromDiscord<Elegant Beef> And truthfully i do want to use nims for configs, but i do realize how silly it'd be
21:46:42*opal joined #nim
21:46:44*opal quit (Excess Flood)
21:47:02FromDiscord<Varriount> Eh, I don't think its silly. Isn't there a lisp-powered WM out there that essentially does the same thing?
21:47:02*opal joined #nim
21:47:04*opal quit (Excess Flood)
21:47:09FromDiscord<Rika> 5 fps? why not 1
21:47:21FromDiscord<Elegant Beef> well there is button highlighting
21:47:22*opal joined #nim
21:47:24*opal quit (Excess Flood)
21:47:25FromDiscord<Elegant Beef> so that will feel a little bad
21:47:42*opal joined #nim
21:47:43*opal quit (Excess Flood)
21:47:46FromDiscord<Elegant Beef> roughly 3-10 fps should be intuitive
21:48:01*opal joined #nim
21:48:03*opal quit (Excess Flood)
21:48:11*hax-scramper joined #nim
21:48:19*opal joined #nim
21:48:21*opal quit (Excess Flood)
21:48:25FromDiscord<Elegant Beef> But my main issue right now is this imgui context shit crashing hard 😄
21:52:09*inv2004 joined #nim
21:55:41*opal joined #nim
21:55:44*opal quit (Excess Flood)
21:56:03*opal joined #nim
21:56:08*opal quit (Excess Flood)
21:56:58*liblq-dev quit (Quit: WeeChat 2.7.1)
21:57:05*opal joined #nim
21:57:07*opal quit (Excess Flood)
21:57:51*opal joined #nim
22:02:24*inv2004 quit (Read error: Connection reset by peer)
22:04:05*tane quit (Quit: Leaving)
22:04:14*zacharycarter quit (Ping timeout: 240 seconds)
22:04:43FromDiscord<Varriount> This is probably a stupid question, but has anyone written a WM in javascript?
22:07:42Yardanicowell yes there's that thing..
22:09:14YardanicoeDEX-UI it's not really a DE though
22:09:20Yardaniconot a WM either
22:10:47Yardanicofound https://github.com/rlamana/Ventus https://github.com/mixu/nwm
22:11:07Yardanicoah the first one is a wrong one
22:14:34skrylar[m]@mratsim its from 1999 so it probably would have been the prior art of aac if anything :p
22:19:22*xcm quit (Remote host closed the connection)
22:20:15*solitudesf quit (Ping timeout: 260 seconds)
22:21:36*xcm joined #nim
22:25:43*companion_cube joined #nim
22:27:23*opal quit (Ping timeout: 240 seconds)
22:33:44disruptekhearts and minds, people; hearts and minds!
22:35:20companion_cubeseems like I came back at an inspiring moment
22:53:21Yardanicoyes
22:57:36FromGitter<sealmove> Sorry this has been asked 3985299 times but what's the best Nim GUI package atm?
22:59:54*skrylar[m] wonders if nfltk still works
23:00:42skrylar[m]araq has a libui wrapper if you don't need anything complicated
23:01:13FromDiscord<InventorMatt> NiGui is pretty good but it missing quite a few widgets still
23:01:29leorizethe libui wrapper is one of the higher quality ones
23:01:36leorizeit feels like native
23:04:19skrylar[m]it is native
23:04:29Yardanico@sealmove I think gintro
23:04:39Yardanicoyes its gtk but it's really complete
23:04:47leorizeskrylar[m]: I mean it feels like native Nim
23:04:55skrylar[m]nfltk works if you don't need to subclass any widgets, but its non-native
23:05:03FromGitter<sealmove> how about imGui?
23:05:17Yardanicoyeah there are quite good bindings
23:05:21leorizePMunch/wxnim is there if you want all the features
23:05:22Yardanicobut it doesn't look native either
23:05:29YardanicoI'd prefer gintro over imgui for GUI apps :P
23:06:03leorizeand wxnim if you need cross-platform
23:06:10leorizebecause gtk is terrible cross platform
23:08:09FromDiscord<Elegant Beef> The best surprisingly depends on you and what you're making 😄
23:08:18FromGitter<sealmove> I want something like this: https://ide.kaitai.io/
23:08:35Yardanico@Beef, for you gintro might be actually quite a nice choice IMO
23:08:47Yardanico@sealmove for that imgui will be pretty good
23:09:02FromGitter<sealmove> Basically turning this to a native app in order to add editting (because hex editing can get pretty heavy for large files)
23:09:26Yardanicohttps://github.com/ocornut/imgui#demo
23:09:35Yardanicohttps://github.com/ocornut/imgui#gallery
23:09:42FromGitter<sealmove> Should I use C++ or Nim?
23:09:53YardanicoNim, ther is an cimgui wrapper
23:10:39Yardanicohttps://github.com/nimgl/imgui
23:11:04FromGitter<sealmove> Good, thanks guys
23:11:18Yardanicohttps://github.com/nimgl/nimgl is a superset, it includes bindings to other libs too
23:11:36Yardanicolike glfw, opengl or vulkan (you'll need at least one of those for imgui)
23:11:43FromDiscord<Elegant Beef> a gtk based status bar, hmm
23:11:48FromDiscord<Elegant Beef> Would make widgets easier
23:12:45FromGitter<sealmove> So how do I approach this? I only have a little experience in Java Swing. Do I start by reading the C++ imGui docs?
23:12:58FromDiscord<Elegant Beef> I started by using the imgui example
23:13:08FromDiscord<Elegant Beef> Then just ramming my head into imgui and getting something that works
23:13:10FromGitter<sealmove> the Nim one?
23:13:14FromDiscord<Elegant Beef> yeaa
23:13:21Yardanicosee https://github.com/nimgl/nimgl/blob/master/examples/timgui.nim
23:13:24FromDiscord<Rika> what a big brain move
23:13:32FromDiscord<Elegant Beef> Im a person that prefers to learn through ramming my head into a wall over reading how to
23:13:36Yardanicoit's not the most high-level wrapper but it's pretty nice nonetheless
23:13:38FromDiscord<Rika> tbh its what i do for most of my "learning xxx lib" projects
23:13:51FromDiscord<Rika> though i read docs
23:13:59FromDiscord<Elegant Beef> I mean it works extrodinarly well for technical art
23:14:04FromDiscord<Elegant Beef> Breaks down on graphics programming
23:14:13FromDiscord<Elegant Beef> Since things have to be done in a specific way or it implodes
23:14:13Yardanicoalthough I've only used imgui once in a C++ program (it was a hack for a game)
23:14:22Yardanicoit worked nicely :P
23:14:36FromDiscord<Elegant Beef> My status bar works well for 1 monitor 😛
23:15:59FromDiscord<Elegant Beef> I was also using imgui for my funky terminal, but that is dead in the water until i learn how pty works
23:16:30FromDiscord<Elegant Beef> Who would've thought that things like vim dont just use stdin for controls?
23:16:41Yardanicoterminal stuff is really complicated
23:16:51Yardanicoand has a lot of backwards compat stuff you need to deal with :P
23:16:57FromDiscord<Elegant Beef> Yea another thing you cant exactly just ram you head to get to work
23:17:26FromDiscord<Elegant Beef> I have a fair bit of vt100 support but the whole properly managing inputs for cli applications is a nogo since i didnt realize i needed a pty
23:18:25FromDiscord<Elegant Beef> It's a fairly good prototype as it sits
23:18:26FromDiscord<Elegant Beef> https://streamable.com/5pzu7
23:18:51Yardanicobut WhY iTsS nOT OpEnSoUrCe?! or is it?
23:19:02FromDiscord<Elegant Beef> I dont like opening source before it's functional
23:19:10FromDiscord<Elegant Beef> Weird thing of me
23:19:28FromDiscord<Elegant Beef> I love OSS but i dont like broken software 😛
23:19:45Yardanicowell the point of this is that your code might help others :P
23:19:58FromDiscord<Rika> and vice versa 😛
23:20:01FromDiscord<Elegant Beef> A fair bit of my unity technical art stuff is OSS, but that is cause i can wrap it up in a day
23:20:22FromDiscord<Elegant Beef> Does funky thing, add comments and publish, easy
23:20:40Yardanicoeasier: don't add any readme, comments or description :D
23:21:01FromDiscord<Elegant Beef> Lol, nah i prefer my public repos be a bit more nice looking
23:21:18Yardanicowell I kinda try to do it too
23:21:42FromDiscord<Elegant Beef> For instance for anything technical art related i tend to include a gif of it in action
23:21:42FromDiscord<Elegant Beef> https://github.com/beef331/stringlights
23:22:11FromDiscord<Elegant Beef> My WM is OSS right now cause prestige and i were volleying back and forward in talking about xlib and x
23:23:04Yardanicowell yeah, also I don't like publishing small stuff in separate repos, but for this thing I had to :P https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim
23:24:58FromDiscord<Rika> oh hey its that
23:25:07Yardanicoyes
23:25:16FromDiscord<Rika> haha, gaEE
23:25:18FromDiscord<Elegant Beef> Yea i suppose i could have a single repo of "Shaders and shiz" and push there, but eh
23:25:23Yardanico@Rika that was fully random though :P
23:25:31FromDiscord<Rika> i was jokin
23:25:33YardanicoI mean I just mashed on the keyboard a bit
23:25:41FromDiscord<Elegant Beef> Not truely random
23:25:42FromDiscord<Rika> it sounds korean tbh
23:25:48Yardanicoalthough the lib is pretty useless if someone knows a bit of IDA or Ghidra
23:25:51FromDiscord<Elegant Beef> It's your sub concious coming out
23:26:05Yardanicojust breakpoint where stuff is being printed, find this function and see that it's just simple xor
23:26:09FromDiscord<Rika> how do you determine whether a string is random or not, given nothing but the string itself
23:26:09Yardanicostill very cool
23:26:27FromDiscord<Elegant Beef> Well if the string exists it's not random
23:26:38FromDiscord<Elegant Beef> At most pseudo random 😛
23:26:52Yardanicoalso see https://godbolt.org/z/nyeELQ for the generated assembly
23:27:22Yardanicoand try to remove {.noinline.} from that proc - the assembly listing will become like 3x larger
23:27:29FromDiscord<Rika> well what i mean is how do you determine whether some value given (by anything, we're in theory world rn) is random or not
23:27:57FromDiscord<Elegant Beef> Well if someone is giving me value, they surely dont know me
23:28:40FromDiscord<Elegant Beef> Well you look at the source, if the person is named R. N. Gesus it might be a random valu
23:29:11Yardanico@Rika https://en.wikipedia.org/wiki/Randomness_tests
23:29:51FromGitter<sealmove> Elegant Beef wow! looks nice
23:30:07FromDiscord<Elegant Beef> The console?
23:30:35FromDiscord<Elegant Beef> Well if anyone wants to do the pty stuff for nim i'll gladly OSS my console 😛
23:30:43FromDiscord<exelotl> I can't use `|` to insert a blank line in nim doc :(
23:31:12Yardanicoyou just do an empty string
23:31:16Yardanico##
23:32:04Yardanicoor two empty lines, I don't exactly remember
23:33:07FromGitter<sealmove> imgui says: could not load: cimgui.so but in the README.md it doesn't state anything about dependencies. What do I have to install?
23:33:16Yardanicoyou have to compile cimgui
23:33:22Yardanicohttps://github.com/cimgui/cimgui
23:34:03Yardanicoand since you're on linx you'll have to do LD_LIBRARY_PATH=. ./myapp or LD_PRELOAD=./cimgui.so ./myapp or something like that
23:34:15Yardanicosince library search path doesn't include the current directory on *nix
23:34:16FromDiscord<Elegant Beef> or if you're a twat copy it to your lib folder
23:34:27FromGitter<sealmove> sounds complicated
23:34:32FromDiscord<Elegant Beef> It's rather easy
23:34:39Yardanicoyeah it's really not hard
23:35:04FromDiscord<Elegant Beef> I mean i copied the .so to my lib folder since im silly and prefer it over having a .so in my git directory
23:35:18FromDiscord<Elegant Beef> ~~Git ignore's exist~~
23:36:00Yardanicobtw this simple 6-line string encrypting/decrypting function got compiled into 200 lines of assembly when I added --passC:"-march=native" on godbolt :P
23:36:14Yardanico it's ~25 lines of assembly without that
23:36:42Yardanicohttps://godbolt.org/z/Av2oCV you can scroll a bit down and see a lot of SIMD stuff
23:38:48FromGitter<sealmove> Yardanico can you elaborate on LD_LIBRARY_PATH=. ./myapp?
23:38:57FromGitter<sealmove> I compiled cimgui
23:39:02FromDiscord<exelotl> Yardanico: I mean like this
23:39:02FromDiscord<exelotl> https://cdn.discordapp.com/attachments/371759389889003532/701940018998149130/unknown.png
23:39:15*Trustable quit (Remote host closed the connection)
23:39:56Yardanico@sealmove LD_LIBRARY_PATH specifies additional paths for the OS to try to find libraries in
23:40:06Yardanicoso after you compile your app (and assuming it's in the same folder as cimgui.so) you do
23:40:11YardanicoLD_LIBRARY_PATH=. ./myapp
23:41:05FromGitter<sealmove> how comes I have to specify myapp in LD_LIBRARY_PATH instead of imgui?
23:41:15Yardanicoplease read it closer
23:41:38YardanicoLD_LIBRARY_PATH=. ./myapp as in LD_LIBRARY_PATH=<dot><space><dot><slash>myapp
23:41:56FromGitter<sealmove> ah lol
23:42:01FromDiscord<exelotl> I wanted to put extra space between the two paragraphs. It seems like `|` is the standard reStructuredText way to do things, but when I put `|` on a line with no text, it gives me a literal `|`
23:42:01FromDiscord<exelotl> https://cdn.discordapp.com/attachments/371759389889003532/701940768046055454/unknown.png
23:42:03Yardanicowith LD_LIBRARY_PATH=. you specify that the OS should also try to search in the current dir
23:42:12Yardanicoand then just launch your app like ./myapp
23:42:38FromGitter<sealmove> ohh I see, thanks
23:43:17FromGitter<sealmove> ok it works
23:44:12FromDiscord<Elegant Beef> Yea that was an issue i ran into also when starting to us it
23:44:13FromDiscord<Elegant Beef> Yea that was an issue i ran into also when starting to use it
23:45:28Yardanicobtw your edits on IRC are just sent as new messages :P
23:47:56FromDiscord<Rika> are
23:48:00FromDiscord<Rika> they?
23:48:14FromDiscord<exelotl> lol
23:48:27FromDiscord<exelotl> quality bridge
23:48:32Yardanicohow would you do it otherwise?
23:48:44Yardanicodiff'ing between text is not easy, and IRC doesn't support any kind of edits
23:50:53FromDiscord<Elegant Beef> Yea i know they are
23:50:57FromDiscord<Elegant Beef> It's instinctive to me
23:51:06Yardanico?
23:51:24Yardanicowell it's instinctive to me on Telegram too, but I restrain myself when I use Discord for Nim :P
23:51:34FromDiscord<Elegant Beef> I dont proofread so i instinctively hit up and correct issues
23:51:56FromDiscord<Elegant Beef> I do attempt to prevent it here but it happens
23:52:09FromDiscord<exelotl> Yardanico: hmm that's a fair point, could get the bot to give you a notice that edits are ignored
23:53:11Yardanicogood night everyone
23:53:19FromDiscord<exelotl> is it possible for bots to post messages that only 1 person can see (like Discord's own Clyde messages?)
23:53:20FromDiscord<Elegant Beef> buh bye
23:53:33Yardanico@exelotl no, on irc that's not possible
23:53:34FromDiscord<exelotl> cya
23:53:53FromDiscord<exelotl> oh I meant on discord
23:54:09FromDiscord<Yardanico> Ah then it might be possible, I'll check it maybe
23:54:27FromDiscord<Elegant Beef> If you're suggesting to tell people not to edit, bots can pm users
23:54:44FromDiscord<Elegant Beef> So a bot could pm a user on their fist edit
23:55:00FromDiscord<exelotl> Yeah, it could work. I generally don't like being PM'd by bots though x)
23:55:01FromDiscord<Elegant Beef> Since people dont read 😄
23:55:18FromDiscord<exelotl> so an inline message would be much preferred
23:55:32FromDiscord<Elegant Beef> Yea, i dont know if that's possible
23:56:29FromDiscord<exelotl> At least a discord bot could post a warning only in the discord channel, and not on IRC. I guess that would be acceptable
23:56:38FromDiscord<Elegant Beef> > Some people here use an ancient communication service which lacks features, dont do anything but send messages 😄
23:57:35FromDiscord<Yardanico> On the other hand it's completely open and has a lot of clients for any possible platform, OS and editor (like emacs)
23:58:10FromDiscord<Elegant Beef> Yea i dislike discord as much as the next person, but the alternatives arent as fancy imo, riot.im is interesting but still from my understanding video/voice is trash
23:58:41FromDiscord<Rika> imagine using discord for games
23:58:43FromDiscord<Elegant Beef> inb4 Use a different application for different services
23:59:05FromDiscord<Yardanico> And Nim IRC channel was here long before Discord even appeared
23:59:22FromDiscord<Elegant Beef> Hey i said ancient
23:59:47FromDiscord<exelotl> I don't mind the lack of features in IRC... except for missing out on messages when you're offline
23:59:51FromDiscord<Yardanico> You misspelled "battle tested"
23:59:58FromDiscord<Yardanico> @exelotl for that I have Quassel