<< 16-09-2021 >>

00:03:38FromDiscord<leorize> @auxym\: you on arch linux?
00:03:50FromDiscord<auxym> ...yes
00:04:07FromDiscord<auxym> well, manjaro, but yes
00:04:20FromDiscord<leorize> blame their maintainer for modifying compile flags when they don't understand it
00:04:42FromDiscord<leorize> you just have to edit /etc/nim/nim.cfg to change the cflags
00:04:58FromDiscord<auxym> maintainers of the nim package?
00:05:33FromDiscord<auxym> alright. Or I'll use choosenim I guess. thanks a lot for the info
00:05:42FromDiscord<leorize> yea, if you look at the pkgbuild, it overrides the default with whatever was the cflags at makepkg time
00:06:15FromDiscord<auxym> wow. any idea if anyone filed a bug? Otherwise I might look into it
00:06:26*lucerne quit (Quit: Ping timeout (120 seconds))
00:06:53FromDiscord<leorize> I think I saw one before, but not sure
00:07:24*lucerne joined #nim
00:17:26FromDiscord<leorize> https://bugs.archlinux.org/task/67092
00:21:57FromDiscord<auxym> good find, my search didnt turn it up
00:23:45*Pyautogui quit (Quit: Connection closed)
01:01:37nrds<Prestige99> would `=destroy` be called on a ref object if it were assigned to `nil`?
01:01:44nrds<Prestige99> or is it only scoping
01:04:16FromDiscord<Elegantbeef> I believe it's any destruction, make a test and use orc/arc to see 😀
01:19:46*arkurious quit (Quit: Leaving)
01:29:06*neurocyte6 joined #nim
01:29:06*neurocyte6 quit (Changing host)
01:29:06*neurocyte6 joined #nim
01:30:29FromDiscord<gogolxdong (liuxiaodong)> Does nim-eth include evm?
01:31:11*neurocyte quit (Ping timeout: 268 seconds)
01:31:11*neurocyte6 is now known as neurocyte
01:33:35nrds<Prestige99> Hm if it does @Elegantbeef it'd be very useful for c libs
01:33:46nrds<Prestige99> looking at sdl_mixer atm
01:33:54nrds<Prestige99> Have to free loaded audio files
01:36:23FromDiscord<impbox [ftsf]> ergh sdl_mixer is terrible
01:36:27FromDiscord<impbox [ftsf]> wish they'd kill that library
01:36:36FromDiscord<impbox [ftsf]> better off just using sdl audio and mixing yourself
01:36:38nrds<Prestige99> Should I be using something else?
01:36:42nrds<Prestige99> :o
01:37:15nrds<Prestige99> I've been learning and setting up sdl mixer for the last ~hour lol
01:38:26FromDiscord<impbox [ftsf]> maybe it's fine if your requirements are really basic
01:38:45FromDiscord<Gumber aka Zachary Carter> you could check out SoLoud
01:38:57FromDiscord<Elegantbeef> soloud, openal, ...
01:39:00nrds<Prestige99> Just playing sfx and music for games, nothing fancy (yet?)
01:39:02FromDiscord<Gumber aka Zachary Carter> https://github.com/jarikomppa/soloud
01:39:05nrds<R2D299> itHub: 7"Free, easy, portable audio engine for games"
01:39:29FromDiscord<Gumber aka Zachary Carter> I had problems with SoLoud several years ago when I was working on Frag
01:39:36FromDiscord<Gumber aka Zachary Carter> but tmk the author has done a ton of work on it since then
01:39:40FromDiscord<Elegantbeef> Seems prestige yea it's only scope based afaik
01:39:40FromDiscord<Varriount> _notes that no-one mentions Allegro_
01:39:55FromDiscord<Gumber aka Zachary Carter> so I'm sure the situation has improved quite a bit - it was already a good library when I picked it up
01:39:57FromDiscord<Gumber aka Zachary Carter> Allegro is good
01:40:09nrds<Prestige99> Ah that's unfortunate Beef, could've been very useful lol
01:40:28nrds<Prestige99> SoLoud looks pretty neat
01:40:35FromDiscord<impbox [ftsf]> Allegro, i haven't heard of that for years
01:40:43FromDiscord<impbox [ftsf]> I liked it back in the day
01:41:11FromDiscord<Varriount> My college game development course used it.
01:41:58FromDiscord<Gumber aka Zachary Carter> I wrote like five lines of code for my game today before my covid made me want to go lay down and take a nap lol
01:42:09FromDiscord<Varriount> 😦
01:42:16FromDiscord<Gumber aka Zachary Carter> I'm almost over it I think but my god it's annoying how long it's lasting - been almost a week now since I started feeling crappy
01:42:45FromDiscord<Gumber aka Zachary Carter> tried to take a hot shower this evening and had to sit down on the bench in the shower because I was having trouble breathing and getting dizzy lol
01:43:18nrds<Prestige99> 'If you're planning to make a multi-million budgeted console game, this library is (probably) not for you' well I guess SoLoud is out :P
01:43:24FromDiscord<impbox [ftsf]> maybe i'll split out nico's audio mixer to a separate module
01:43:29nrds<Prestige99> jk lol but I'll probably stick with sdl for now
01:43:39nrds<Prestige99> What are you using for audio in nico?
01:43:42FromDiscord<Gumber aka Zachary Carter> yeah I mean SoLoud might very well be over / under kill
01:43:46FromDiscord<impbox [ftsf]> sdl2
01:43:50FromDiscord<impbox [ftsf]> but not sdl_mixer
01:43:53nrds<Prestige99> ah
01:44:05FromDiscord<Gumber aka Zachary Carter> there's also - https://github.com/yglukhov/sound
01:44:08nrds<R2D299> itHub: 7"Cross-platform sound mixer library"
01:44:12FromDiscord<Gumber aka Zachary Carter> and uh I guess - https://github.com/treeform/slappy
01:44:15nrds<R2D299> itHub: 7"3d sound api for nim."
01:44:17FromDiscord<Gumber aka Zachary Carter> I've only used `sound` before
01:44:50nrds<Prestige99> I'm making a little wrapper for sdl mixer to make the api simple for my engine, we'll see how it goes
01:44:56nrds<Prestige99> could always change it I suppose
01:45:14FromDiscord<auxym> `arm-none-eabi/bin/ld: cannot find -ldl` ring a bell for anyone? Nim is adding `-ldl` to linker args, I'm trying to cross compile for ARM using arm-none-eabi-gcc (maybe @PMunch ?)
01:47:06FromDiscord<Gumber aka Zachary Carter> the only time I ever cross compiled anything for ARM for Nim was for this project -https://github.com/fragworks/frag-android/blob/master/Dockerfile
01:47:27FromDiscord<Gumber aka Zachary Carter> and uh, I don't believe I was using `arm-none-eabi-gcc`
01:47:59FromDiscord<auxym> yeah arm-none-eabi-gcc is for bare metal MCUs, no linux
01:48:49FromDiscord<Gumber aka Zachary Carter> gotcha
01:49:00FromDiscord<auxym> pretty sure I don't want `-ldl` (something to do with dynamic linking, correct?), but not sure why nim is adding it
01:49:04FromDiscord<Gumber aka Zachary Carter> yeah
01:49:16FromDiscord<Anuke> In reply to @Gumber "I had problems with": I've been using Soloud for a while now and it still has some pretty major bugs
01:49:18FromDiscord<Elegantbeef> Prestige something like this may work for if you dont have multiple references to an object https://play.nim-lang.org/#ix=3z1a
01:50:09FromDiscord<Varriount> Prestige: If you're willing to give a flat-rate portion of revenue for any commercial game, you could use https://fmod.com
01:50:34FromDiscord<Elegantbeef> Obviously for best experience of the GC hooks use orc/arc
01:51:02nrds<Prestige99> Probably not @Varriount but thanks for the link
01:52:32FromDiscord<Gumber aka Zachary Carter> In reply to @auxym "pretty sure I don't": maybe cause of - https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127?
01:52:34FromDiscord<Gumber aka Zachary Carter> (edit) "https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127?" => "https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127 ?"
01:53:08FromDiscord<Gumber aka Zachary Carter> can probably override those in your own `nim.cfg`
01:53:11FromDiscord<Gumber aka Zachary Carter> sorry
01:53:15FromDiscord<Gumber aka Zachary Carter> `config.nims` is what I meant
01:53:19FromDiscord<auxym> yes, probably, I'm thinking I have to override `gcc.options.linker` in my nim.cfg
01:53:23FromDiscord<Gumber aka Zachary Carter> yeah exactly
01:53:26FromDiscord<impbox [ftsf]> Prestige, what are you making?
01:53:47nrds<Prestige99> Just a simple 2d game engine, for fun
01:53:48FromDiscord<auxym> I'm wondering though why `@if unix` is hit? bug?
01:53:56nrds<Prestige99> Trying to get it ready to participate in game jams
01:54:02FromDiscord<impbox [ftsf]> cool, those are fun =)
01:54:18nrds<Prestige99> Yeah - I've only done one (with Godot) but I had a lot of fun
01:56:08FromDiscord<Gumber aka Zachary Carter> In reply to @auxym "I'm wondering though why": I'm trying to figure out where `unix` is defined
01:56:10FromDiscord<impbox [ftsf]> more nim game jammers =)
01:56:18FromDiscord<impbox [ftsf]> LD49 coming up soon
01:56:34nrds<Prestige99> oh how soon? I haven't thought about it
01:56:40nrds<Prestige99> I just started on this engine lol
01:56:48FromDiscord<impbox [ftsf]> oct 2-5
01:57:05FromDiscord<Anuke> wonder if I'll have my framework functional again by the time ld49 comes up
01:57:09nrds<Prestige99> hm yeah I don't think this'll be ready unless I really grind away at it
01:57:40FromDiscord<impbox [ftsf]> just use whichever bits work at the time
01:57:57FromDiscord<Gumber aka Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3z1d
01:58:10FromDiscord<Gumber aka Zachary Carter> I guess those are the operating systems that are considered unix
01:58:47FromDiscord<auxym> In reply to @Gumber "I'm trying to figure": FYI overriding `gcc.options.linker` with `-static` does get rid of the error. Getting a whole crapton of linker errors now (https://pastebin.com/90feh27T), but that'll be for another time, getting tired.
01:58:48FromDiscord<impbox [ftsf]> usually i use jams as an excuse to add new features to my framework
01:59:05nrds<Prestige99> That's my plan as well :)
01:59:05FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=3z1e
02:01:44FromDiscord<Gumber aka Zachary Carter> huh...
02:01:51FromDiscord<Gumber aka Zachary Carter> yeah this is out of my realm of expertise I think
02:02:02FromDiscord<Gumber aka Zachary Carter> I haven't tried to do much with SBCs / MBCs and bare metal
02:02:07FromDiscord<impbox [ftsf]> `--os:none` ?
02:03:37FromDiscord<auxym> `Error: unknown OS: 'none'. Available options are: DOS, Windows, OS2, Linux, MorphOS, SkyOS, Solaris, Irix, NetBSD, FreeBSD, OpenBSD, DragonFly, AIX, PalmOS, QNX, Amiga, Atari, Netware, MacOS, MacOSX, iOS, Haiku, Android, VxWorks, Genode, JS, NimVM, Standalone, NintendoSwitch, FreeRTOS, Any` 🙂
02:04:21FromDiscord<impbox [ftsf]> sorry
02:04:32FromDiscord<impbox [ftsf]> @auxym are you importing a package that'd trying to link something?
02:04:47FromDiscord<impbox [ftsf]> other than -ldl is it passing any other -l arguments?
02:04:57FromDiscord<impbox [ftsf]> actually no that won't tell you nm
02:04:58FromDiscord<auxym> nah, really just trying to get a "hello world" trivial thing going
02:05:40FromDiscord<auxym> The root seems to be that Nim, or the default nim.cfg, seems to consider os:any as unix
02:05:57FromDiscord<impbox [ftsf]> when you build it should tell you which config files are used
02:06:05FromDiscord<impbox [ftsf]> check those config files for linker options being passed
02:06:30FromDiscord<impbox [ftsf]> i've encountered distros putting weird stuff in /etc/nim/ config files
02:11:39FromDiscord<auxym> Yeah, I did have an issue with the /etc/nim/nim.cfg file on arch, I cp'd the file from nim git in there
02:13:12FromDiscord<impbox [ftsf]> nothing about -ldl in there?
02:14:07FromDiscord<auxym> only this https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127 which is under `@if unix`, so it seems that nim considers any as unix
02:41:44*stkrdknmibalz joined #nim
02:50:10FromDiscord<cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3z1j
03:24:29FromDiscord<cabboose> Ok if I make a distinct int and shove it inside of an Atomic
03:24:35FromDiscord<cabboose> can I still use fetchAdd etc
03:24:49FromDiscord<cabboose> or will I have to define/borrow the procedures for arithmetic
03:32:46FromDiscord<cabboose> If I cast a uint32 to uint16 will it truncate the top 16 bits for me? or is it safer to apply a mask first
03:33:44FromDiscord<impbox [ftsf]> it'll just be looking at the first 16 bits
03:33:50FromDiscord<cabboose> huzzah
03:34:13FromDiscord<Elegantbeef> Cast is a bit reintepretation so it matches from the first bit to the end of the new type
03:34:38FromDiscord<Elegantbeef> So casting a large value from a small type is very very dangerous 😀
03:34:55FromDiscord<impbox [ftsf]> surprise data!
03:34:57FromDiscord<cabboose> Yeah that's the idea though
03:35:10FromDiscord<impbox [ftsf]> casting from a larger type to smaller type should be safe
03:35:14FromDiscord<cabboose> it's either that or apply a mask to get the first 16 bits anyway
03:35:15FromDiscord<impbox [ftsf]> at least for uints
03:35:26FromDiscord<cabboose> yeah no sign stored
03:35:29FromDiscord<cabboose> surely right
03:35:44FromDiscord<Elegantbeef> Well it's always safe large -\> small just a question of if the data modified is sensible
03:35:55FromDiscord<impbox [ftsf]> yep, depends how you then use that data whether it's safe
03:36:14FromDiscord<impbox [ftsf]> but uints will be less surprising
03:36:27FromDiscord<cabboose> It's pretty well controlled; it won't exceed the high(uint16)
03:36:43FromDiscord<cabboose> it's just an atomic counter, but it's storing two counts within one 32 bit uint
03:36:52FromDiscord<Elegantbeef> Well it cannot exceed
03:37:30FromDiscord<Elegantbeef> `cast[uint16](321321u32)` is only the first 16 bits `uint16(321321u32)` is a type conversion and runs a procedure to convert
03:37:37FromDiscord<cabboose> ah
03:37:39FromDiscord<Elegantbeef> the former will not error the latter will
03:37:48FromDiscord<cabboose> Yep yep the former is what I need
03:37:53FromDiscord<cabboose> coolio
03:37:54FromDiscord<cabboose> cheers
03:38:03FromDiscord<Elegantbeef> cast is a type system thing of saying "This is now X"
03:39:07FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3z1q
03:39:10FromDiscord<impbox [ftsf]> if you wanna split it into 2 uint16s
03:40:35FromDiscord<cabboose> and if I want to add to the high 16 in the Atomic uint32 i'd add 1 shl 16? or 1 shl 15
03:40:51FromDiscord<impbox [ftsf]> you don't need to bother if you use the array method above
03:41:02FromDiscord<cabboose> the Atomic though
03:41:09FromDiscord<cabboose> won't be able to do fetch adds that way
03:42:11FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3z1s
03:42:25FromDiscord<impbox [ftsf]> (edit) "https://play.nim-lang.org/#ix=3z1s" => "https://play.nim-lang.org/#ix=3z1t"
03:42:58FromDiscord<cabboose> that's not wrapped in atomic operations though right?
03:42:59FromDiscord<impbox [ftsf]> now the split is a uint16 "view" of the uint32
03:43:06FromDiscord<impbox [ftsf]> inc is atomic?
03:43:24FromDiscord<cabboose> but I mean data would be Atomic[uint32]
03:43:35FromDiscord<cabboose> can I do the cast etc?
03:43:35FromDiscord<cabboose> cool
03:43:40FromDiscord<cabboose> I had no idea
03:43:40FromDiscord<impbox [ftsf]> ok, i'm not familiar with Atomic type
03:43:41FromDiscord<cabboose> lol
03:43:50FromDiscord<Elegantbeef> Yea you should be able to do the cast
03:43:51FromDiscord<cabboose> rip
03:44:04FromDiscord<cabboose> Aw sick
03:44:07FromDiscord<Elegantbeef> since the first/only field is `T`
03:45:02FromDiscord<cabboose> I see; I guess I'm used to locks and thinking that that memory is somehow protected, but it's not really then. It's just the Atomic[T] provides access to guaranteed atomic procedures right?
03:45:03FromDiscord<cabboose> otherwise it's all the same shit
03:45:20FromDiscord<Elegantbeef> I do not know i'm only giving answers on the type/cast safety
03:45:34FromDiscord<impbox [ftsf]> if you cast then you'll be circumventing the type safety checks
03:45:48FromDiscord<impbox [ftsf]> so if Atomic is doing special stuff it'll be bypassing them
03:47:06FromDiscord<impbox [ftsf]> trying to look up nim atomics https://en.wikipedia.org/wiki/Nuclear_Instrumentation_Module
03:47:09FromDiscord<cabboose> Hmmm. Guess there's no way to know without throwing a threads at it
03:47:09FromDiscord<cabboose> mratsim would actually be a good source
03:47:25FromDiscord<impbox [ftsf]> or just try it and see
03:47:26FromDiscord<cabboose> hahahaha
04:06:02*supakeen quit (Quit: WeeChat 3.2.1)
04:06:31*supakeen joined #nim
04:10:53FromDiscord<codic> ah yes, the nuclear instrumentation module
04:11:10FromDiscord<codic> absolutely perfect nim atomics
04:19:28*rockcavera quit (Remote host closed the connection)
04:57:20FromDiscord<gogolxdong (liuxiaodong)> Is startdust opensourced?
04:57:46*crem quit (Ping timeout: 268 seconds)
05:12:49arfytoday's random question. how does one convert a single character string to a char? I think variable[0] would be one way.
05:13:07FromDiscord<impbox [ftsf]> that should be fine
05:13:21FromDiscord<impbox [ftsf]> if you're sure it has one character in it
05:13:31FromDiscord<impbox [ftsf]> and it's ascii
05:14:38arfya char in nim is the same as a char in c. uint8_t
05:15:07FromDiscord<Elegantbeef> a char in nim is a type safe uint8 practically yes
05:18:56FromDiscord<impbox [ftsf]> is there something like tmpfile(3) in nim?
05:19:17FromDiscord<impbox [ftsf]> or mkstemp
05:19:54FromDiscord<Elegantbeef> Could use a memory mapped file?
05:20:39FromDiscord<Elegantbeef> Quite possibly those two functions are wrapped in one of the hidden unix/posix libraries
05:21:16FromDiscord<impbox [ftsf]> hmm seems like there's std/tempfiles
05:21:19FromDiscord<impbox [ftsf]> in devel maybe
05:21:20FromDiscord<Elegantbeef> https://nim-lang.org/docs/posix.html#mkstemp%2Ccstring
05:21:36*sagax joined #nim
05:21:41FromDiscord<Elegantbeef> Indeed
05:21:50FromDiscord<Elegantbeef> https://nim-lang.github.io/Nim/tempfiles.html devel docs to the rescue!
05:22:10FromDiscord<impbox [ftsf]> i guess i'll use the posix stuff for now
05:22:50FromDiscord<Elegantbeef> There are even nicer APIs in `posix_utils`
05:23:21FromDiscord<impbox [ftsf]> oh good, the posix ones are ugly with cstring
05:26:56FromDiscord<impbox [ftsf]> dang, of course, doesn't work on windows shakes fist
05:27:06FromDiscord<Elegantbeef> Ah that was a given due to `posix`
05:27:44FromDiscord<Rika> who needs windows
05:27:45FromDiscord<Rika> smh
05:27:47FromDiscord<Elegantbeef> Memory mapped file might be the easiest
05:27:59FromDiscord<Elegantbeef> They're pretty good to look outside
05:28:30FromDiscord<impbox [ftsf]> figured windows would have implemented posix by now =p
05:29:23FromDiscord<Elegantbeef> There is a tempfile package in nimble
05:32:34FromDiscord<impbox [ftsf]> \o/ that works
05:42:50FromDiscord<impbox [ftsf]> hmm `execProcess("foo.exe", args = [tmpFilename], options={poEchoCommand, poUsePath})` -> `foo.exe C:\Users\user\AppData\Local\Temp\tmpmDcEG4UO.foo`
05:43:02FromDiscord<impbox [ftsf]> unforuntately it doesn't quote the filename
05:43:08FromDiscord<impbox [ftsf]> but if i add quotes myself it quotes the quotes
05:47:42FromDiscord<Rika> i believe for that file name, quotes are not needed
05:48:00FromDiscord<impbox [ftsf]> they are for the \ s
05:48:23FromDiscord<Elegantbeef> Did you try single or double quotes?
05:48:28FromDiscord<impbox [ftsf]> double
05:48:57FromDiscord<impbox [ftsf]> will try single
05:49:01FromDiscord<Rika> when you run it, does the filename appear fucked in the application? i dont recall windows needing quotes
05:49:12FromDiscord<Elegantbeef> You know if nim just calls `$(arg)` it'd show double quotes
05:49:41FromDiscord<Elegantbeef> Saying that as in "ya know i just thought"
05:50:07FromDiscord<impbox [ftsf]> foo.exe returns `C:UsersuserAppDataLocalTemptmpCHqXkp8C.foo: No such file or directory`
05:50:13FromDiscord<impbox [ftsf]> when it's not quoted
05:50:48FromDiscord<cabboose> prefix the string with r
05:50:54FromDiscord<cabboose> r for raw dogging
05:51:02FromDiscord<impbox [ftsf]> single quotes seems to work
05:51:08FromDiscord<impbox [ftsf]> doesn't get double escaped
05:51:10FromDiscord<Elegantbeef> The args are passed to `quoteShell` so i imagine it shouldnt be needed
05:51:59FromDiscord<Elegantbeef> `let needQuote = {' ', '\t'} in s or s.len == 0`
05:52:19FromDiscord<Elegantbeef> That explains why it's' not quoting
05:56:55FromDiscord<Elegantbeef> Eh it's been fixed! https://github.com/nim-lang/Nim/issues/18670
05:57:31FromDiscord<impbox [ftsf]> whoa
06:02:41*blackbeard420 quit (Quit: ZNC 1.8.2 - https://znc.in)
06:11:12*blackbeard420 joined #nim
06:11:49FromDiscord<cabboose> image.png https://media.discordapp.net/attachments/371759389889003532/887943839082504212/image.png
06:11:52FromDiscord<cabboose> am I missing something
06:11:54FromDiscord<cabboose> because in C6
06:12:01FromDiscord<cabboose> aren't they just obliterating the value
06:12:09FromDiscord<cabboose> since they've shifted a uint16 by 16 bits to the left...
06:12:27FromDiscord<cabboose> I think they cooked their pseudocode
06:12:48FromDiscord<cabboose> oh wait
06:12:49FromDiscord<cabboose> I get it
06:12:50FromDiscord<cabboose> nvrm
06:12:53FromDiscord<cabboose> fuck
06:13:02FromDiscord<cabboose> v is a uint32
06:13:16FromDiscord<cabboose> so i should cast finalcount to uint32 first
06:13:20FromDiscord<cabboose> rip
06:13:40FromDiscord<Elegantbeef> well convert
06:13:41FromDiscord<cabboose> I AM CONVERTING
06:13:42FromDiscord<cabboose> ;\_;
06:14:00FromDiscord<Elegantbeef> Sorry but in Nim cast != conversion so i get a bit nervous hearing casting 😛
06:14:13FromDiscord<Rika> cab did u even sleep
06:14:19FromDiscord<cabboose> Oh; no I am casting
06:14:20FromDiscord<cabboose> I am cast lord
06:14:26FromDiscord<cabboose> I did rika; it was beautiful
06:14:37FromDiscord<cabboose> I am just losing my mental state
06:14:39FromDiscord<cabboose> \<3
06:14:39FromDiscord<Rika> its not obvious with how ur behaving
06:14:55FromDiscord<cabboose> this is me rika; just love me for who I am
06:14:57FromDiscord<Elegantbeef> this is just cabboose in my experience
06:30:49*crem joined #nim
06:39:07FromDiscord<impbox [ftsf]> trying to use dimscord to post messages on a timer rather than in response to users, has anyone done this?
06:40:46FromDiscord<Elegantbeef> Do you still need the messageCreate event handler?
06:41:16FromDiscord<impbox [ftsf]> probably not
06:41:43FromDiscord<Elegantbeef> Well eitherway you can probably have an async started from in `onReady` that loops and sends the message
06:41:54FromDiscord<Elegantbeef> async loop\
06:42:10FromDiscord<impbox [ftsf]> hmmm /me has to lern to async
06:43:12FromDiscord<Elegantbeef> Well i dont know async much either, but if you just ping rika they're all about async 😛
06:43:28FromDiscord<cabboose> use cps
06:43:34FromDiscord<Elegantbeef> I knew you were going to say that
06:43:48FromDiscord<impbox [ftsf]> copy paste style, yeah i do that
06:43:53FromDiscord<cabboose> xxx
06:43:59FromDiscord<cabboose> hahahaha rip
06:44:01FromDiscord<impbox [ftsf]> (edit) "copy paste style," => "Copy Paste from Stackoverflow ,"
06:44:06FromDiscord<Elegantbeef> continuation passing style \:D
06:44:25FromDiscord<impbox [ftsf]> yeah i know, i don't get that shit yet
06:44:36FromDiscord<impbox [ftsf]> just gimme while true and sleep =p
06:44:42FromDiscord<Elegantbeef> I dont much myself either
06:44:43FromDiscord<Rika> It’s almost as effortless as normal async so
06:44:58FromDiscord<cabboose> https://github.com/shayanhabibi/cpslearning/blob/main/cpsdrive.nim
06:44:59FromDiscord<Elegantbeef> Yea but impbox and I dont do async
06:45:12FromDiscord<Rika> Is that yours can
06:45:15FromDiscord<Rika> Cab
06:45:22FromDiscord<cabboose> yis
06:45:39FromDiscord<Rika> Just think of “await” as “switch to another thread”
06:45:49FromDiscord<Rika> If you don’t have await, nothing will switch
06:46:02FromDiscord<cabboose> except you have to poll it eventually
06:46:16FromDiscord<cabboose> I mean that is unavoidable
06:46:23FromDiscord<Rika> It will come back to your thread after what you awaited completes
06:46:37FromDiscord<Rika> The delay can be short or long depending on what else is running
06:46:38FromDiscord<cabboose> oh is this your dimscord thing?
06:47:09FromDiscord<impbox [ftsf]> trying to make dimscord post a daily message
06:47:12FromDiscord<Elegantbeef> Is rika really explaining async? 😀
06:47:39FromDiscord<Rika> It depends on your level of async knowledge
06:47:46FromDiscord<Rika> It’s hard to tell
06:47:46FromDiscord<cabboose> wait is dimscord yours Rika?
06:47:50FromDiscord<Rika> No
06:47:58FromDiscord<cabboose> Because async isn't run on another thread
06:48:02FromDiscord<cabboose> and you have to eventually call poll
06:48:04FromDiscord<Rika> I say thread but
06:48:05FromDiscord<cabboose> or do a run forever
06:48:06FromDiscord<cabboose> or something
06:48:09FromDiscord<Rika> I don’t mean literal thread
06:48:10FromDiscord<cabboose> or waitFor
06:48:24FromDiscord<Rika> I know
06:48:27FromDiscord<Rika> I’m not stupid
06:48:31FromDiscord<cabboose> I know
06:48:34FromDiscord<cabboose> but this is my segway
06:48:37FromDiscord<cabboose> into advertisement
06:48:40FromDiscord<cabboose> here at CPS
06:48:47FromDiscord<Rika> Go away
06:48:55FromDiscord<cabboose> 🍝
06:48:56FromDiscord<Rika> Advertisement bad
06:49:14FromDiscord<Elegantbeef> Wait rika said go, they want us to use Go
06:49:26FromDiscord<Elegantbeef> See you i'm going to use one of the most terribly designed languages imo
06:49:43FromDiscord<cabboose> Isn't that a oriental board game
06:49:48FromDiscord<Rika> Good, you deserve it
06:49:48FromDiscord<cabboose> surely its not a language
06:49:59FromDiscord<Rika> I can’t tell if cab is joking or not
06:52:39FromDiscord<cabboose> Good
06:53:01FromDiscord<cabboose> But seriously; it's also a board game right?
06:53:10FromDiscord<Rika> Yes I know the board game
06:55:42FromDiscord<impbox [ftsf]> nim?
06:55:50FromDiscord<gogolxdong (liuxiaodong)> How to pass parameter for web3 contract constructor?
06:59:18*PMunch joined #nim
07:02:57*tdc joined #nim
07:22:42*Vladar joined #nim
07:23:56*max22- joined #nim
07:25:33*pro joined #nim
07:27:40*pro quit (Client Quit)
07:42:11*darwillim86d quit (Quit: Connection closed for inactivity)
07:50:38FromDiscord<impbox [ftsf]> so with async, i can do `discard await doThing()` can i do `await doThing() andThen doAnotherThing()` ?
07:52:33FromDiscord<dom96> You just call the second procedure with await after the first
07:54:40FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3z29
07:54:59FromDiscord<impbox [ftsf]> _goes and reads your book_
07:55:30FromDiscord<dom96> Yeah
07:55:35FromDiscord<impbox [ftsf]> awesome, thanks!
07:57:06FromDiscord<dom96> In reply to @impbox "trying to use dimscord": I’m on mobile but I’ve got a StardustAnnouncer repo on GitHub which does this
07:57:21FromDiscord<impbox [ftsf]> i've figured it out thanks! =)
07:57:35FromDiscord<impbox [ftsf]> running a while true: in onReady did the trick
07:58:17FromDiscord<dom96> Cool
08:05:57*federico3 quit (Ping timeout: 245 seconds)
08:11:21PMunchHmm, there is no newfangled way of calling a macro given a NimNode right?
08:21:09*max22- quit (Quit: Leaving)
08:21:49FromDiscord<Elegantbeef> What do you mean?
08:22:22FromDiscord<cabboose> [planetis](https://matrix.to/#/@planetis:matrix.org)\: I was told you can maybe help me with something
08:23:02FromDiscord<cabboose> I need a passover read of the algorithms and comments in this if you have a spare moment
08:23:16FromDiscord<cabboose> https://github.com/shayanhabibi/loony
08:23:19nrds<R2D299> itHub: 7"Experimenting to make a high throughput MPMC lock-free queue based on a paper by Giersch, Nolte et al."
08:24:30FromDiscord<gogolxdong (liuxiaodong)> https://stardust.dev/play/
08:29:20NimEventerNew thread by Hoijui: How to download at compile-time?, see https://forum.nim-lang.org/t/8430
08:34:19FromDiscord<planetis> @cabboose whats up?
08:34:48FromDiscord<planetis> note iam quite a noob myslef
08:35:15FromDiscord<cabboose> Disruptek said you might be interested in it
08:36:40FromDiscord<planetis> sure
08:37:30FromDiscord<planetis> what are the banned boys up to?
08:38:03FromDiscord<cabboose> Something about haemorrhoids
08:39:27FromDiscord<planetis> ahahahha
08:40:41FromDiscord<cabboose> Shit already noticed L97 on queue.nim hasn’t been updated with the procedure for allocating the node
08:40:47FromDiscord<cabboose> maybe that’s what’s corking me
08:41:11FromDiscord<planetis> 2022?
08:41:16FromDiscord<cabboose> and L109 lol
08:41:16FromDiscord<cabboose> yep
08:41:40FromDiscord<cabboose> It’s been published online but the journal is yet to be published in paperback
08:41:41FromDiscord<cabboose> thats the date of paperback publication
08:43:16FromDiscord<planetis> ok thx
08:49:41FromDiscord<planetis> was it by any chance already ported to other languages as well? (with sources opensourced that is)
08:49:52FromDiscord<cabboose> c++
08:49:56FromDiscord<cabboose> linked in the readme
08:50:04FromDiscord<cabboose> but as for ports to other languages I don'
08:50:06FromDiscord<cabboose> t believe so
08:50:12PMunch@ElegantBeef, I meant getting a piece of my NimNode tree that I know will return a value that I want if called. I want to call it
08:50:26FromDiscord<cabboose> it's only a couple months old
08:50:32PMunchNormally I would write one macro parsing the input and then rewriting it to be a new macro call
08:52:43FromDiscord<Elegantbeef> Seems like that's the only way if i understand rightly
08:53:04FromDiscord<Elegantbeef> Given you want to evaulate a tree
08:53:46PMunchIt has been the only way of doing it, I was just wondering if someone had made a new cool way of doing it
08:54:54FromDiscord<Elegantbeef> id have to ask if you bindsym the outer macro so you dont need to export it 😀
08:57:32FromDiscord<Elegantbeef> Something like this https://play.nim-lang.org/#ix=3z2j
08:59:25FromDiscord<Elegantbeef> it allows you do this chained macro emitting without exporting all the macros used if that's a something you care about
09:00:59PMunchIsn't that done automatically
09:01:05FromDiscord<cabboose> After reaching operation on L237 on queue.nim it SIGSEVS
09:01:37FromDiscord<Elegantbeef> It's done automatically if you use quote do or similar i guess
09:02:27PMunchAh right
09:04:52FromDiscord<cabboose> ok L70 and L71 are actually supposed to change the value of prev from the caller
09:05:00FromDiscord<cabboose> so I guess I should use a template?
09:05:12FromDiscord<cabboose> or pass the prev as a variable to be changed?
09:05:18FromDiscord<cabboose> on node.nim
09:05:47FromDiscord<cabboose> that doesnt make sense to me lol
09:11:58*max22- joined #nim
09:22:15*max22- quit (Remote host closed the connection)
09:23:03*max22- joined #nim
09:39:05*Vladar quit (Quit: Leaving)
09:43:52*max22- quit (Remote host closed the connection)
09:44:37*max22- joined #nim
09:51:24FromDiscord<cabboose> The enqueue operation consistently skips an index of like 133 and when the dequeue operation arrives at the index it dies
09:51:40FromDiscord<cabboose> This game sucks
09:52:41*max22- quit (Remote host closed the connection)
09:54:28*max22- joined #nim
09:54:46*max22- quit (Remote host closed the connection)
10:12:33*max22- joined #nim
10:14:31FromDiscord<enthus1ast> which function to use to get a aproximation of a float? 95.90000000000001 -\> 95.9
10:14:49FromDiscord<Rika> In string form?
10:14:56FromDiscord<enthus1ast> yeah
10:15:04FromDiscord<Rika> I don’t remember but there is a flag to enable dragon box
10:15:13FromDiscord<enthus1ast> in 1.4.8?
10:15:22FromDiscord<Rika> Not sure
10:15:24FromDiscord<Rika> Probably devel only
10:15:49FromDiscord<enthus1ast> mh ok then I'll quickly roll my own
10:15:56FromDiscord<enthus1ast> thanks @Rika
10:28:01FromDiscord<hmmm> holla :3
10:28:41FromDiscord<hmmm> I just made a toy app on wnim and it worked like a charm
10:28:52FromDiscord<hmmm> where is the wnim guy I want to congratulate
10:37:41arfyugh. that moment when you're happily working on your app, but have run into a roadblock.
10:38:57FromDiscord<hmmm> there is no roadblock nimchat can't help you with
10:39:01FromDiscord<enthus1ast> what is your roadblock
10:44:49arfywhat's the place to paste code here?
10:45:38FromDiscord<enthus1ast> https://play.nim-lang.org/
10:45:43FromDiscord<enthus1ast> "Share to ix"
10:46:48*PMunch quit (Ping timeout: 268 seconds)
10:49:53arfyok. so, I have a list... sorry, sequence of strings like this. @["option 1", "option 2"]. the program prints out those optoins like this. 1. option 1. 2. option 2. youthen select from those options. obviously these options can be dynamically generated. so, how to map from that list of options to the corresponding responses from the keyboard.
10:51:54arfyI thought of doing. of "1" .. $options.len in a case statement but not sure that works.
10:58:51FromDiscord<enthus1ast> https://play.nim-lang.org/#ix=3z2L
11:00:14FromDiscord<enthus1ast> must make it nice, can still crash when int is not parsable
11:00:52arfywhy... didn't I think of that? *slaps head* parseInt directly on the result of stdin.readLine()
11:02:40arfyactually, Can I apply this to the illwill library, for non-blocking keyboard input?
11:04:30*Vladar joined #nim
11:04:57FromDiscord<enthus1ast> sure why not
11:05:28FromDiscord<enthus1ast> have a look at my widgets for illwill, maybe you find something usefull\: https://github.com/enthus1ast/illwillWidgets
11:05:31nrds<R2D299> itHub: 7"mouse enabled widgets for illwill"
11:06:51*PMunch joined #nim
11:09:09FromDiscord<enthus1ast> and some examples of bigger apps i build with illwill\:↵https://github.com/enthus1ast/muk↵https://github.com/enthus1ast/trainingThing
11:10:18*neurocyte quit (Quit: The Lounge - https://thelounge.chat)
11:12:34*PMunch quit (Remote host closed the connection)
11:14:22*neurocyte joined #nim
11:14:22*neurocyte quit (Changing host)
11:14:22*neurocyte joined #nim
11:19:36FromDiscord<@hjarausch_gitlab-5fa43a7bd73408> building Nim devel on Termux \: how to set linker options? Linking the new koch fails since Termux/Android needs an additional `-landroid-glob` flag.↵How can I specify this since nim is invoked with `--skipUserCfg`.↵Many thanks for hint, Helmut
11:21:43NimEventerNew thread by R3c: Call Nim code from C (linking errors), see https://forum.nim-lang.org/t/8431
11:22:26arfywo. I just performed some black magic. parseInt($chr(ord(Key.One)))
11:26:49FromDiscord<Rika> “ord” already returns an integer doesn’t it?
11:27:29*PMunch joined #nim
11:28:15*rockcavera joined #nim
11:28:15*rockcavera quit (Changing host)
11:28:15*rockcavera joined #nim
11:29:51arfyit does, but I want to return 1, the label of the key, not 49, the ascii value of the key
11:31:14arfyoo. this is nicer. parseInt($Key.One.ord.chr)
11:31:37FromDiscord<Rika> Muh performance
11:32:18FromDiscord<haxscramper> can't you just add offset and convert it to int again/
11:32:41arfythat would work too
11:32:57FromDiscord<Rika> In reply to @haxscramper "can't you just add": Or just subtract the offset from the integer
11:33:54arfymeow. tired
11:34:03arfybeen coding on and off most of the day
11:34:05*PMunch quit (Quit: Leaving)
11:38:53arfythans for the offset suggestion. that looks far nicer. (Key.One.ord)-49
11:39:14arfyreturns index 0 for the list of options.
11:44:45*PMunch joined #nim
11:49:29FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=3z2S
11:49:47arfyright. flopping over. gn
11:49:58FromDiscord<Goel> (edit) "https://play.nim-lang.org/#ix=3z2S" => "https://play.nim-lang.org/#ix=3z2T"
11:50:17FromDiscord<Goel> (edit) "https://play.nim-lang.org/#ix=3z2T" => "https://play.nim-lang.org/#ix=3z2U"
11:59:22*federico3 joined #nim
12:00:17FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3z2Y
12:00:55FromDiscord<Goel> It doesn't work on my case, i don't know why, if i do it it tells me "need to be used or discarded" But nevermind, not a big deadl
12:00:59FromDiscord<Goel> (edit) "deadl" => "deal"
12:01:08FromDiscord<Rika> No
12:01:18FromDiscord<Rika> You have to reassign
12:02:06*rockcavera quit (Remote host closed the connection)
12:02:40FromDiscord<Goel> yeah but thats gonna be long too, so in the end i just go for the full long-inline once and thats it. I was just wondering if it was possible to do something like:↵`round(curZoom -= zoomFactor, 1)
12:02:44FromDiscord<Goel> (edit) "1)" => "1)`"
12:03:52*PMunch quit (Quit: Leaving)
12:04:01FromDiscord<Rika> No
12:04:13FromDiscord<Rika> That would still need a reassign
12:04:23FromDiscord<Rika> Round doesn’t take in a variable value
12:04:34FromDiscord<Rika> Rather it can but it won’t mutate
12:05:15*max22- quit (Ping timeout: 260 seconds)
12:06:01*supakeen quit (Quit: WeeChat 3.2.1)
12:06:31*supakeen joined #nim
12:06:45*PMunch joined #nim
12:25:40*arkurious joined #nim
12:30:01*neurocyte quit (Quit: The Lounge - https://thelounge.chat)
12:34:07*neurocyte joined #nim
12:34:07*neurocyte quit (Changing host)
12:34:07*neurocyte joined #nim
12:35:56arkanoidI'm finding ffi in JavaScript surprisingly easy. At the same time I feel the lack of existing js wrappers
12:37:40*Gustavo6046 quit (Ping timeout: 240 seconds)
12:42:14FromDiscord<tandy> do you have a git link i could look at? i think that would help me with some stuff↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
12:42:28*Gustavo6046 joined #nim
12:52:02FromDiscord<cabboose> this is silly, I can't use any of the manual memory allocation procs with the alignment pragma
12:57:30*pro joined #nim
13:05:06FromDiscord<cabboose> mofos there are aligned allocation procs in the source that isn't exported
13:05:11FromDiscord<cabboose> why
13:05:13FromDiscord<cabboose> whyyyyy
13:12:47FromDiscord<planetis> Well even if it was
13:13:31FromDiscord<planetis> It still holds a global lock
13:14:17FromDiscord<planetis> You can pbl do the alignment yourself though
13:17:29*PMunch quit (Quit: Leaving)
13:20:07*PMunch joined #nim
13:26:44*pro quit (Quit: WeeChat 3.2)
13:37:43FromDiscord<cabboose> What holds a global lock?
13:38:05FromDiscord<cabboose> I exported those procs and the queue actually works because it has aligned reserved memory
13:38:13FromDiscord<cabboose> which begs the question why they aren't available in the first place
13:38:37FromDiscord<cabboose> or using align pragma isn't smarter, like when it's used on a pointer variable
13:47:16FromDiscord<dom96> arkanoid: time for a js2nim 😄
13:47:34arkanoidIs it a thing?
13:47:57FromDiscord<planetis> the allocator, whereas the reference implementation uses mimalloc
13:48:07arkanoidts2nim would be easier, probably
13:49:00FromDiscord<cabboose> ahyi
13:49:23*max22- joined #nim
13:49:31FromDiscord<dom96> don't think it's a thing
13:49:35FromDiscord<dom96> but sounds like a fun project
13:49:56arkanoidNot sure where to start. Probably tree sitter
13:52:28FromDiscord<planetis> they arent public api cause of reasons. https://github.com/nim-lang/Nim/pull/18609
13:54:08FromDiscord<cabboose> I'll have to implement it locally for the library then
13:54:36FromDiscord<cabboose> The storage system doesnt work without aligned pointers
13:54:53FromDiscord<cabboose> cant manually allocate memory with alignment
13:55:08FromDiscord<cabboose> and the slots eventually get reallocated in every other circumstance
13:55:53FromDiscord<cabboose> Is there a risk or is it just a matter of ensuring people don't make it too crazy
14:04:05NimEventerNew thread by HJarausch: Building Nim Devel on Termux (Android), see https://forum.nim-lang.org/t/8432
14:05:05*PMunch quit (Quit: Leaving)
14:33:14FromDiscord<planetis> btw i would move to a bounded implementation https://github.com/rigtorp/MPMCQueue
14:33:17nrds<R2D299> itHub: 7"A bounded multi-producer multi-consumer concurrent queue written in C++11"
14:34:26FromDiscord<planetis> reclaiming the memory in this setting is very hard to do
14:35:07FromDiscord<planetis> bounded seems like a better choice, since i dont want to allocate all the time, just once
14:36:19FromDiscord<planetis> that algorithm is not lock-free for the consumer part
14:36:49FromDiscord<planetis> better yet use a spsc queue for each thread
14:48:16FromDiscord<cabboose> The algorithm provides a pretty safe reclamation though no?
14:48:49FromDiscord<cabboose> I mean; i'd rather really grind this out, a lock-free multiple consumer is exactly what I'm aiming for
14:49:01FromDiscord<cabboose> I want continuations shooting out of every hole at speed
15:09:41*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
15:17:47*Guest5552 joined #nim
15:21:22*Guest5552 quit (Client Quit)
16:02:14*asd quit (Ping timeout: 265 seconds)
16:03:55*asd joined #nim
16:10:36FromDiscord<planetis> maybe... last time I spent a week porting a new mpsc queue and then I tested it with tsan and it was complaining. Other people run into the same errors as well.
16:10:45FromDiscord<planetis> ime its a gamble
16:13:57FromDiscord<cabboose> eugh
16:21:05FromDiscord<reilly> Can someone provide me an example of how to use an image in Karax?
16:25:05*stkrdknmibalz joined #nim
16:27:53ZevvI have a queue of events that are implemented as enums; different event types have an enum variant, some have data. Now i'd like to register callbacks that get called when events of a certain kind are popped off the queue, but I can't seem to find how to refer to a certain "kind" of the enum without making a complete instance of that enum. I can statically match, but I need some kind of run time discriminant.
16:27:59ZevvIs there a way to do this, or did I pick the wrong representation?
16:28:36Zevvoh dang
16:28:40Zevvthis is totally the wrong channel
16:28:46Zevvbecause I am doing rust today
16:41:09FromDiscord<Gumber aka Zachary Carter> gross
16:42:49FromDiscord<reilly> Nevermind, I figured it out.
16:45:41FromDiscord<Gumber aka Zachary Carter> In reply to @Zevv "this is totally the": wrong server homie 😛
16:46:20Zevvnah proper server, wrong channel. stuff is bridged all over the place these days, i'm just on IRC
16:46:26Zevvhow is the zach these days
16:46:38FromDiscord<Gumber aka Zachary Carter> oh yeah true
16:46:59FromDiscord<Gumber aka Zachary Carter> I'm good thanks! Just getting over my second bout of COVID, how have you been?
16:49:18Zevvall over the place. I recently quit at activevideo, I was sooo done with the bureaucracy and layers of management
16:49:30Zevvbut now I ended up doing rust. from the fire into the flames, as they say
16:51:56FromDiscord<Rika> hows rust
16:51:58FromDiscord<Gumber aka Zachary Carter> oh wow
16:52:17FromDiscord<Gumber aka Zachary Carter> sorry to hear about that, but I'm glad you found something else that interests you 😄
16:53:10FromDiscord<Gumber aka Zachary Carter> I'm out of the games industry now, went back in for a bit and now I'm doing Elixir (and Nim if the opportunity arises - it was already approved)
16:53:40FromDiscord<Gumber aka Zachary Carter> been there since July - doesn't seem like it though... time flies...
16:54:26FromDiscord<Gumber aka Zachary Carter> and yeah... how is Rust?
16:54:37FromDiscord<Gumber aka Zachary Carter> I mean I already know, but your opinion would be cool to hear too 😛
17:02:54ZevvI prefer elixir :)
17:03:15FromDiscord<Gumber aka Zachary Carter> haha me too 😄
17:03:25ZevvI was honestly wondering how long it takes the average developer to stop shouting at their computer in rage when getting started with rust
17:03:34FromDiscord<Gumber aka Zachary Carter> months I think
17:03:41ZevvI get what they are trying to do and all, I really do. But it just is /so/ painful
17:03:43FromDiscord<Gumber aka Zachary Carter> borrow checker is a bitch
17:03:48FromDiscord<Gumber aka Zachary Carter> yaup
17:04:20FromDiscord<Gumber aka Zachary Carter> I don't get the game studios that are like full on embracing Rust like Embark
17:04:22ZevvI'm trying to do these basic simple things for embedded. I have one single instance of a thing. In normal language that would just live somewhere statically and be a singleton
17:04:27Zevvbut no no in rust we don't do singletons.
17:04:49FromDiscord<Gumber aka Zachary Carter> I mean they have some really talented and smart people there - but... it just seems like they're using Rust because it is popular and hyped, not necessarily because of its technical merits
17:05:10FromDiscord<Gumber aka Zachary Carter> heh, yeah all those lovely "zero-cost abstractions"
17:05:25ZevvI see the merits for some systems; when you're juggling with tons of dynamic data and don't want GCing, it can prbly do a nice job and all
17:05:32ZevvIt's a better C. sure.
17:05:39FromDiscord<Rika> zero cost in performance massive cost in dev time 😛
17:05:41FromDiscord<Gumber aka Zachary Carter> yeah but so is Zig
17:05:52FromDiscord<Gumber aka Zachary Carter> and I don't know if it's a bettter C
17:05:55FromDiscord<Gumber aka Zachary Carter> (edit) "bettter" => "better"
17:05:56FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=3z4F
17:05:57ZevvAnd so is Nim, even.
17:06:02FromDiscord<Gumber aka Zachary Carter> safer sure, but better I dunno that's arguable
17:06:13FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3z4G
17:06:19Zevvwell, the thing is, on this deep embedded stuff I hardly do any memory management at all
17:06:29FromDiscord<Gumber aka Zachary Carter> yeah
17:06:35Zevvstuff just lives somewhere and you ref it. done. 99% of my bugs are not related to stuff rust would prevent
17:06:42Zevvbut hey, $customer wants rust because it's a good show
17:06:53Zevvthey pay me to do the work, they pay me to learn rust. who am i to complain
17:06:53FromDiscord<Gumber aka Zachary Carter> the whole single allocator thing I never got
17:07:00FromDiscord<Gumber aka Zachary Carter> yeah - I think it's a good deal
17:07:10FromDiscord<Gumber aka Zachary Carter> never hurts to broaden your knowledge and get paid for it at the same time, that's for damn sure
17:07:24ZevvI advised against it, so I can always reach out with a fat "told ya so" one day
17:07:37FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3z4H
17:07:45FromDiscord<Gumber aka Zachary Carter> 😄
17:07:49FromDiscord<Gumber aka Zachary Carter> smart move
17:08:41ZevvThe rust embedded book tells me to do it like this
17:08:42ZevvMY_GPIO.borrow(cs).borrow().as_ref().unwrap().odr.modify(|_, w| w.odr1().set_bit());
17:08:45ZevvI am /not/ making this up
17:08:57FromDiscord<Rika> you have to use normal `proc(): ...` syntax for multiline i believe?
17:08:58Zevvthis is the alternative for the C 'MY_GPIO.set_bit()'
17:09:02FromDiscord<leorize> fwsgonzo#9652\: `proc (iter: iterator(): Token): string = return ""`↵(@fwsgonzo)
17:09:07FromDiscord<Rika> yup
17:09:28FromDiscord<fwsgonzo> many thanks 👍
17:09:34FromDiscord<Rika> In reply to @Zevv "MY_GPIO.borrow(cs).borrow().as_ref().unwrap().odr.m": how fun
17:09:38FromDiscord<Rika> that is one hell of a line
17:09:43FromDiscord<Gumber aka Zachary Carter> yeah kill me
17:10:00FromDiscord<leorize> alternatively `sugar.()` exists, too
17:10:01FromDiscord<Rika> do you think rust programmers are human
17:10:12ZevvI'm not sure, I never met one in real life
17:10:16ZevvI'm on my own in this project
17:10:22FromDiscord<fwsgonzo> they are more human than me as a C++ programmer
17:10:36FromDiscord<Gumber aka Zachary Carter> I mean C++ is sane if you don't use C++17 or 20
17:10:37ZevvIt makes me wonder if this is some kind of self inflicted masochism to show of ones smarts
17:10:46Zevvor if people honestly think this is a good idea all the way down
17:11:05Zevvbut the same goes for elixir of course. That pure functional state juggling is silly as hell as well
17:11:11FromDiscord<Gumber aka Zachary Carter> yeah
17:11:21FromDiscord<Gumber aka Zachary Carter> well take anything to an extreme and you end up with this kind of stuff
17:11:46FromDiscord<Gumber aka Zachary Carter> I mean games are not operating system kernels or missile defense systems
17:11:50Zevvand for elixir I see why this is - it's collateral damage, the price you pay for the share-nothing threading model
17:11:56FromDiscord<Gumber aka Zachary Carter> or software powering critical infrastructure
17:12:19Zevvnasa went to the moon on C
17:12:27FromDiscord<Gumber aka Zachary Carter> so I don't get the whole everything must be safe philosophy in that context, but in other contexts I do
17:12:28FromDiscord<Gumber aka Zachary Carter> and forth
17:13:18FromDiscord<Gumber aka Zachary Carter> people just buy into stuff with too much hype and not even speculation
17:13:28FromDiscord<Gumber aka Zachary Carter> especially young people - I was like that when I was young and not jaded
17:13:29Zevvwell, rust is prbly here too stay, right
17:13:35FromDiscord<Gumber aka Zachary Carter> I probably would have been a huge rust fanboi like ten years ago
17:13:37Zevvbut I miss the golang pragmatism
17:13:56FromDiscord<Gumber aka Zachary Carter> yeah for sure, I mean it is popular for a reason, but I think it's a bit over hyped / praised
17:14:04FromDiscord<Gumber aka Zachary Carter> yeah golang was just a bit too pragmatic haha
17:14:09FromDiscord<Gumber aka Zachary Carter> or is I guess
17:14:22ZevvI should visit Zig, it's the last one on my list
17:14:34FromDiscord<Gumber aka Zachary Carter> zig is awesome
17:14:36FromDiscord<Gumber aka Zachary Carter> especially zigcc
17:14:38ZevvI'm still sticking with nim for some reason
17:14:55Zevvalthough it smells in the back alleys and blows up in my face every time I try to do something interesting
17:14:56FromDiscord<Gumber aka Zachary Carter> yeah same - I've touched all three and Nim is still my goto, although I do really like Zig
17:15:00FromDiscord<Gumber aka Zachary Carter> and I think a Zig backend for Nim would be amazing
17:15:16FromDiscord<Gumber aka Zachary Carter> once Zig matures ab it
17:15:20FromDiscord<Gumber aka Zachary Carter> (edit) "ab it" => "a bit more"
17:16:15Zevvanyway, I did some nice outings over the last year. I rewrote npeg in elixir in 1 day, which was pretty cool. I did some hefty lifting in golang for $customer, and now getting my hands dirty with rust
17:16:25Zevvthat's pretty impressive for someone my age, right
17:17:08FromDiscord<Rika> i want a mix of zig and nim ngl
17:17:15FromDiscord<Rika> would be funky
17:17:19FromDiscord<Rika> funky monkey
17:17:38FromDiscord<Rika> In reply to @Zevv "anyway, I did some": that sounds impressive yes
17:18:17FromDiscord<Gumber aka Zachary Carter> yeah I think so
17:27:38FromDiscord<Gumber aka Zachary Carter> Doing games as a hobby again is really refreshing, just being able to work on my own pace on things that interest me instead of working on stuff I'm directed to work on is nice again
17:27:55Zevvyeah, never forget that
17:28:00FromDiscord<Gumber aka Zachary Carter> I always bought into that whole, do what you love and it's not work thing but it's so not true... I think it only applies if you're your own boss and get to make your own decisions on what you want to work on
17:28:02Zevvcoding for work != coding for yourself
17:28:06FromDiscord<Gumber aka Zachary Carter> yeah
17:28:24Zevvand I'm so fucking spoiled as a mercenary. I just pick the jobs I like and go away when I'm bored
17:28:49FromDiscord<Gumber aka Zachary Carter> really enjoying game dev again and my project is really coming along - got all of the network plumbing code going, working on the renderer now, already prototyped a ton of stuff in previous iterations of the project
17:29:10FromDiscord<Gumber aka Zachary Carter> in the next six months or so I should actually have something playable
17:29:15FromDiscord<Gumber aka Zachary Carter> yeah that's pretty sweet
17:29:39Zevvwell, show early and show often, right
17:29:43Zevveven if it's not playable yet
17:30:03FromDiscord<Gumber aka Zachary Carter> although even my day job stuff isn't bad - I mean it's not the most interesting work in the world but the company mission is cool and programming in Elixir is nice
17:30:04Zevvthe problem I always see with solo game development is that coding and artwork are two so totally different things
17:30:19FromDiscord<Gumber aka Zachary Carter> yeah - I mean once I have stuff to show, the network stuff isn't really cool to see
17:30:35FromDiscord<Gumber aka Zachary Carter> yeah I mean I'm going 3d since I suck at art and 3d is much easier to get by with than 2d if that's the case I think
17:30:45FromDiscord<Gumber aka Zachary Carter> (edit) "if" => "when"
17:31:21FromDiscord<Gumber aka Zachary Carter> but my first prototype will just use primitives I think
17:31:46FromDiscord<Gumber aka Zachary Carter> and probably some models from blendswap with mixamo animations 🙂 It's just a prototype to get interest from potential artists anyway
17:32:07FromDiscord<Gumber aka Zachary Carter> already have some folks I've worked with in the past that have expressed interest in working with me on it once I'm ready for their help
17:35:59Zevvthat's nice
17:37:01FromDiscord<Gumber aka Zachary Carter> Yeah! Anyway, I'll shut up and let people talk about Nim now 😛
18:02:07FromDiscord<reilly> How can I loop over all states of an enum?
18:05:29Zevvfor i in T.low..T.high:
18:06:26Zevvgiven your enum has no gaps
18:07:36FromDiscord<Rika> enums need more love..
18:08:38Zevvdon't we all
18:09:16FromDiscord<reilly> In reply to @Zevv "for i in T.low..T.high:": Looks like that works, sweet.
18:10:23FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3z50
18:10:45FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3z51
18:17:10FromDiscord<reilly> Alright, here's a question that's a little out-of-the-box:↵Given that I'm looping over an enum, can I call a procedure called `do<EnumName>()`?
18:17:34FromDiscord<reilly> So, if the enum is `SomeEnum` at the moment, call a proc called `doSomeEnum()`.
18:17:48FromDiscord<Rika> use generics?
18:17:57FromDiscord<Rika> do[T: enum]()...
18:18:02FromDiscord<Rika> do[SomeEnum]()
18:18:18FromDiscord<Rika> do[GenericParameterContainingType]()
18:18:26FromDiscord<Rika> enum, not type
18:18:42FromDiscord<Rika> or do you mean enum value?
18:18:50FromDiscord<Rika> in which case no
18:18:51FromDiscord<reilly> No, I think that works...
18:21:33FromDiscord<reilly> Actually, no, because I don't need the enum type, I need the specific enum.
18:21:53FromDiscord<reilly> Is that what you mean by enum value?
18:22:37FromDiscord<reilly> I initially thought you meant value as in `Option1 = "asdf"`
18:24:52FromDiscord<Rika> enum values are runtime unless forced in static context
18:25:18FromDiscord<Rika> procedure call "generation" is compiletime only
18:25:27FromDiscord<Rika> please elaborate more on what you want
18:25:31FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3z56
18:25:54FromDiscord<Rika> oh you want a macro that generates handler?
18:26:05FromDiscord<Rika> i dont have one but i feel like someone here has made one at least
18:27:27*tdc quit (Ping timeout: 268 seconds)
18:27:54FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3z58
18:28:41FromDiscord<Rika> macro
18:28:45FromDiscord<Rika> no other way around it
18:29:02FromDiscord<reilly> I already knew that much... I just don't know how to write macros.
18:29:18FromDiscord<reilly> It goes completely over my head.
18:29:21FromDiscord<Rika> do you want the handler one? or the one you sent? they are different logically
18:29:38FromDiscord<Rika> actually i just realised it is 3 am
18:29:50FromDiscord<Rika> hope beef is awake and can answer you lmfao
18:29:59FromDiscord<Rika> i shall pass away temporarily
18:30:04FromDiscord<reilly> Yeah, don't worry about it. It's not a big deal, more of a party trick than anything else.
18:30:20FromDiscord<Rika> maybe you can make this your guide to learning macros
18:32:51NimEventerNew thread by Ingo: Db_sqlite prepared statement, see https://forum.nim-lang.org/t/8433
18:36:19FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3z5b
18:36:59FromDiscord<Rika> nope thats not where you start
18:37:05FromDiscord<Rika> the loop has to bee in the macro
18:37:14FromDiscord<Rika> otherwise the loop is runtime and you get what you just got
19:23:33*PMunch joined #nim
19:54:28*supakeen quit (Remote host closed the connection)
19:54:51*supakeen joined #nim
20:09:10*Gustavo6046 quit (Ping timeout: 240 seconds)
20:11:11*Gustavo6046 joined #nim
20:15:52nrds<Prestige99> Is there a way to pass a function call to a macro? E.g. I want to do myMacro(foo(123)) but I don't want foo(123) evaluated and passed in as a value, I want the macro to be able to invoke foo(123)
20:17:05FromDiscord<planetis> you need a typed macro then call getTypeImpl on x and loop over the enum type's ast
20:21:04NimEventerNew question by SlightlyKosumi: How to force a COM AddIn to be loaded?, see https://stackoverflow.com/questions/69214702/how-to-force-a-com-addin-to-be-loaded
20:30:33nrds<Prestige99> https://play.nim-lang.org/#ix=3z5F <-- an example
20:30:41nrds<Prestige99> maybe @Elegantbeef would know
20:33:16nrds<Prestige99> (or know if it's possible)
20:38:41*Vladar quit (Quit: Leaving)
20:54:53*PMunch quit (Quit: leaving)
20:58:16FromDiscord<Varriount> Zevv:, NASA went to space with Forth too.
20:59:01FromDiscord<Varriount> Zevv: Idea - Could NPeg be used to pattern match and process ASTs from a Nim macro?
21:00:34FromDiscord<Varriount> Prestige: I believe the macro should do that by default, as long as the type of the macro's parameter isn't static
21:02:43FromDiscord<ynfle (ynfle)> @Prestige can't you just pass the arguments to foo to the macro as well? like `@foo, 123`
21:03:29FromDiscord<ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3z5M
21:03:33FromDiscord<ynfle (ynfle)> And parse the untyped AST like that
21:04:22Zevvvarriount: well, no. Npeg takes a seq[T] as input, not a tree
21:20:05nrds<Prestige99> sure but I'm trying to avoid that if I can @ynfle
21:22:35*max22- quit (Quit: Leaving)
21:36:04FromDiscord<Elegantbeef> Prestige you have to make the parameter `typed`
21:37:14FromDiscord<Varriount> Zevv: Hm, true. Hypothetically, do you think something like tree traversal and validation could be implemented as a (viable) PEG-like DSL?
21:37:23FromDiscord<Varriount> (edit) "(viable)" => "(useful)"
21:37:48FromDiscord<Elegantbeef> Something like this prestige https://play.nim-lang.org/#ix=3z5P
21:38:22FromDiscord<Varriount> Woah, that's... interesting. Typing a SED subtitution pattern into Discord performs an edit on the previous message.
21:38:35nrds<Prestige99> oh that's neat. New feature?
21:39:19FromDiscord<Varriount> Or a hidden one.
21:39:32FromDiscord<Varriount> (edit) "hidden" => "secret"
21:39:38FromDiscord<Elegantbeef> It's secret
21:39:38FromDiscord<Varriount> O_o
21:39:45FromDiscord<ynfle (ynfle)> @Beef, you don't need the outer brackets, and `typed` can be `untyped`
21:39:45nrds<Prestige99> @Elegantbeef thanks btw
21:40:16FromDiscord<Elegantbeef> Typed can be untyped but it's better if it's typed since the symbol is looked up so you can do stuff with it if you wish
21:40:29FromDiscord<Elegantbeef> Instead of emitting `0.0` you can do `default(returnT)`
21:41:05FromDiscord<Elegantbeef> otherwise you have to use `typeof(`foo`)` and have 0 introspection
21:41:32FromDiscord<Elegantbeef> Like since it's typed you can check if it can raise and if not error
21:41:37nrds<Prestige99> Yeah I still need to figure out how to make this macro
21:43:14ZevvVarriount: I don't know. The theory behind PEG is pretty strong, pages full of math scribbles and all that shit
21:43:45ZevvI dont understand jack about the theory, so I have no clue if this could somehow map to parsing an AST
21:44:57Zevvmy hunch is that it /could/ work though; the grammar is basically a recursive tree itself, and it typically already parses recursive things
21:45:06nrds<Prestige99> so using `foo` in the macro actually runs the proc... interesting
21:45:14nrds<Prestige99> instead of foo()
21:45:15Zevvbecause this seq[T] you feed it already contains tree-like things.
21:45:29FromDiscord<Elegantbeef> Well you're emitting the call
21:45:30FromDiscord<Elegantbeef> vs calling the symbol
21:45:45FromDiscord<Elegantbeef> the backticks in the quote emit the code you passed
21:45:49nrds<Prestige99> ah okay
21:46:17nrds<Prestige99> last thing is, I need to get the type `foo` returns so I can use default(theType)
21:47:37nrds<Prestige99> or can I just use default(typeof(`foo`)) here, seems to work
21:49:09FromDiscord<Elegantbeef> You could
21:49:10FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3z5S
21:49:16FromDiscord<Elegantbeef> Is a good reference impl
21:49:26FromDiscord<Elegantbeef> Might not work with generics but i'll leave that to you to implement 😛
21:50:18nrds<Prestige99> oh you just used impl.params[0] instead? Any benefit there?
21:50:34nrds<Prestige99> maybe less overhead
21:50:40FromDiscord<Elegantbeef> Nah
21:51:00FromDiscord<Elegantbeef> It's the same thing really, just one will say `typeOf(foo(args))` if it ever errors vs `yourReturnType`
21:52:23FromDiscord<Elegantbeef> Atleast i think it will
21:52:32FromDiscord<Elegantbeef> Unlikely it'll error but yea
21:52:58FromDiscord<Elegantbeef> Mostly just did that + the raise lists stuff to show why you'd want to use `typed`
21:53:04FromDiscord<Elegantbeef> Just to really annoy ynfle 😛
21:53:18nrds<Prestige99> ah
21:58:47FromDiscord<Elegantbeef> Also why so lame and using `@` when you could use `?`
21:58:54nrds<Prestige99> https://play.nim-lang.org/#ix=3z5V I think this is good enough for my use
21:59:08nrds<Prestige99> like ?(foo(123)) ? idk looks weird to me
21:59:20nrds<Prestige99> maybe shouldn't use @ though
21:59:26FromDiscord<Elegantbeef> But but... you dont get a CT error when using it stupidly
21:59:48nrds<Prestige99> oh?
22:00:03nrds<Prestige99> Because of the check you did for raises?
22:00:10FromDiscord<Elegantbeef> Yea
22:05:26FromDiscord<Elegantbeef> I mean it's purely up to you but here's that in action 😀 https://play.nim-lang.org/#ix=3z61
22:05:30nrds<Prestige99> that error proc is neat
22:05:45FromDiscord<Elegantbeef> Notice it errors at line 32
22:06:08FromDiscord<Elegantbeef> Yea it's nice part of macros to give useful error messages CPS uses it a lot
22:06:08nrds<Prestige99> oh that's cool
22:07:09nrds<Prestige99> holy crap that's actually cooler than I thought, the error popping up in my editor lol
22:07:26nrds<Prestige99> https://i.imgur.com/hJ7ooZM.png
22:07:37nrds<Prestige99> I need to play with macros more
22:07:57FromDiscord<Elegantbeef> Yea it's the reason i use it, it actually handles errors properly
22:09:12FromDiscord<Elegantbeef> Feel free to steal my macro and expand it though, since like i said i dont think it works on generics
22:09:24FromDiscord<Elegantbeef> It might work on them didnt test
22:09:25nrds<Prestige99> Sure I'll keep at it
22:09:35nrds<Prestige99> Thanks 🙂
22:33:49*[R] quit (Ping timeout: 252 seconds)
22:41:26*[R] joined #nim
23:28:20FromDiscord<Varriount> Zevv: A tree structure can be flattened to a sequence structure by traversing the tree depth-first, and inserting marker symbols when descending and ascending a node.
23:32:10*Gustavo6046 quit (Ping timeout: 252 seconds)
23:32:49*Gustavo6046 joined #nim
23:38:54*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
23:41:18FromDiscord<Beans.> sent a code paste, see https://play.nim-lang.org/#ix=3z6e
23:41:33FromDiscord<Beans.> (edit) "https://play.nim-lang.org/#ix=3z6e" => "https://paste.rs/cg2"
23:41:35*Gustavo6046 joined #nim
23:43:01FromDiscord<Elegantbeef> should be `initTable[string, seq[float]()`
23:43:07FromDiscord<Elegantbeef> Otherwise you're just getting the procedure
23:44:14FromDiscord<Beans.> 🤦‍♂️
23:44:15FromDiscord<Beans.> You're right
23:44:39FromDiscord<Beans.> Dumb mistake lol
23:50:59FromDiscord<Yardanico> In reply to @Beans. "Dumb mistake lol": also you can shorten your code by 1 line by assigning directly to `result` :)
23:53:28FromDiscord<Elegantbeef> by one line? you mean you can make it one line \:P
23:53:41FromDiscord<Elegantbeef> `result["temperatures"] = @[]`
23:53:49FromDiscord<Yardanico> ah yeah, forgot that initTable isn't needed any longer
23:54:03FromDiscord<Yardanico> but @ElegantBeef you missed something
23:54:07FromDiscord<Yardanico> " # parse json data from api and deserialize into 'temps' seq"
23:54:11FromDiscord<Yardanico> so it still won't be 1 line :)
23:54:41FromDiscord<Elegantbeef> Oh
23:54:42FromDiscord<Elegantbeef> Indeed
23:55:01FromDiscord<Elegantbeef> Though it might be a simple parse function 😉