<< 04-10-2021 >>

00:03:28*rockcavera quit (Ping timeout: 252 seconds)
00:03:58*Schnouki quit (Ping timeout: 268 seconds)
00:10:22FromDiscord<Rika> In reply to @el__maco "by the way, I": yeah has been known for a whi;e
00:23:33*rockcavera joined #nim
00:23:33*rockcavera quit (Changing host)
00:23:33*rockcavera joined #nim
00:25:54FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3ALx
00:26:01FromDiscord<retkid> i ported the dice_coefficient to nim because i couldn't fine one
00:26:26FromDiscord<retkid> (edit)
00:26:36FromDiscord<retkid> directly from the python because reading the java made me cry
00:27:09FromDiscord<retkid> 😢 https://media.discordapp.net/attachments/371759389889003532/894380077800914944/unknown.png
00:36:59*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
00:51:28FromDiscord<Rika> funny enough i would say the java one is closer to nim than the python one
00:53:53FromDiscord<Gumber> ugh Python
00:53:59FromDiscord<Gumber> :shudders:
00:55:54FromDiscord<Gumber> having to use Python gives me a headache
00:58:56*rockcavera quit (Remote host closed the connection)
00:59:19*rockcavera joined #nim
00:59:19*rockcavera quit (Changing host)
00:59:19*rockcavera joined #nim
01:18:59FromDiscord<Jakes1403> What is the most commonly used SDL2 wrapper for Nim?↵And which one would support web? Ty!
01:19:41FromDiscord<Elegantbeef> https://github.com/Vladar4/sdl2_nim#attention this one following this attention
01:19:44nrds<R2D299> itHub: 7"Wrapper of the SDL 2 library for the Nim language."
01:20:50FromDiscord<impbox [ftsf]> @Jakes1403 can totally build it for web with emscripten
01:21:06FromDiscord<Elegantbeef> I still say use nico for what you're doing
01:21:37FromDiscord<impbox [ftsf]> i dunno what you're doing but using nico is good
01:22:07FromDiscord<Elegantbeef> They're looking for a library to display their chip-8 emulator's graphics
01:22:36FromDiscord<Elegantbeef> Given what nico offers to me it seems sensible to use for this
01:23:19FromDiscord<impbox [ftsf]> bribes?
01:23:50FromDiscord<Elegantbeef> Nico gives bribes?
01:24:00FromDiscord<Elegantbeef> Where's my money biatch
01:26:30FromDiscord<Jakes1403> Nico seems to be specialized for gaming
01:26:50FromDiscord<impbox [ftsf]> you could say the same for SDL, but you can use them for non game things
01:26:58FromDiscord<impbox [ftsf]> I've made non-game software in nico
01:27:08FromDiscord<impbox [ftsf]> eg. nimsynth
01:27:24FromDiscord<impbox [ftsf]> https://www.youtube.com/watch?v=kHomZLUE6As&t=602s
01:27:28nrds<R2D299> outube: 7"NimSynth building a synth with low level components"
01:27:39FromDiscord<Elegantbeef> You can mostly use nico like a sdl2 abstraction
01:28:09FromDiscord<Elegantbeef> setup a draw/update proc, and use `pset` like you'd do on sdl2
01:29:02FromDiscord<Elegantbeef> But yea you can just use sdl2 and disregard me
01:30:10FromDiscord<Jakes1403> If I run into a situation where, lets say I need to implement something that emulates a sound chip, would I be able to implement custom audio stuff with it? Like modify sound buffers directly?
01:32:03FromDiscord<acek7> does nico only do retro hardware emulation
01:32:22FromDiscord<Elegantbeef> Nico doesnt do emulation
01:32:40FromDiscord<acek7> well emulation was the wrong word to use my bad
01:33:04FromDiscord<Elegantbeef> It's a purposely software limited library
01:33:56FromDiscord<Elegantbeef> I dont know if you can jake, impbox would certainly know better
01:43:37*arkurious quit (Quit: Leaving)
02:14:54FromDiscord<impbox [ftsf]> Nico let's you do custom audio easily
02:15:31FromDiscord<impbox [ftsf]> It does audio mixing of channels and a channel can have a custom audio callback
02:15:48FromDiscord<impbox [ftsf]> Or do music streaming, or sfx playback or built in synth
02:16:24FromDiscord<impbox [ftsf]> And since nico is open source you can easily add new features if you need them
02:16:46FromDiscord<impbox [ftsf]> But it's pretty flexible out of the box
02:29:22*User11 joined #nim
02:35:30FromDiscord<NullCode> is it possible to break out of a `when` statement
02:35:45FromDiscord<NullCode> I'm trying break but "`Error: invalid control flow: break`"
02:35:52FromDiscord<NullCode> i think ill use discard now
02:36:12FromDiscord<Elegantbeef> when doesnt make scopes
02:36:20FromDiscord<Elegantbeef> One of the great features of it
02:37:39FromDiscord<NullCode> I'm sorry but i have no idea what a scope is/does
02:38:08FromDiscord<Elegantbeef> Ever heard of "local scope"? That's the scope i'm talking about
02:38:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ALW
02:38:58FromDiscord<Elegantbeef> When doesnt create a new scope, so you'd need to use `block scopeName` and `break scopeName`
02:39:19FromDiscord<NullCode> In reply to @Elegantbeef "Ever heard of "local": local variables?
02:39:40FromDiscord<Elegantbeef> Local variables are variables that are locally scoped
02:41:02FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#modules-scope-rules
02:41:07FromDiscord<NullCode> In reply to @Elegantbeef "Local variables are variables": ok it makes sense now
02:41:09FromDiscord<NullCode> thank you
02:41:39FromDiscord<NullCode> i see
02:41:46FromDiscord<NullCode> so a when statement doesn't make this scope
02:41:57FromDiscord<Elegantbeef> Indeed
02:43:10User11Hello, could I post some code and get guidance on this channel?
02:43:27FromDiscord<Elegantbeef> Most certainly
02:43:42FromDiscord<Elegantbeef> Idealy use https://play.nim-lang.org/
02:47:22User11okay here it is..
02:47:22User11https://pastebin.com/BHsHdtPi
02:48:36User11I'm trying to load a zipfile into memory and do things with it using libcurl...
02:50:07User11I used the code example from here https://github.com/Araq/libcurl with one modification
02:50:09nrds<R2D299> itHub: 7"Nim wrapper for libcurl."
02:50:45FromDiscord<Elegantbeef> Well the `cast[string](buffer)` isnt right
02:51:06FromDiscord<Elegantbeef> buffer is a cstring casting it to string is not correct
02:51:38FromDiscord<Elegantbeef> `cstring` is a `char` string is a pointer with size and capacity
02:51:59FromDiscord<Elegantbeef> guess i should say `ptr char` instead of `char`
02:52:18FromDiscord<Elegantbeef> Also writing to the zip file like that probably will not work
02:52:30User11OK it takes me a while to type this out but you seems to know where the problem is
02:52:46FromDiscord<Elegantbeef> I suggest using Zippy https://github.com/guzba/zippy to modify the zip
02:52:48nrds<R2D299> itHub: 7"Pure Nim implementation of deflate, zlib, gzip and zip."
02:56:13User11I couldnt figure out how to use openArray[byte] so I used string type to concatenate the buffer to the webData
02:57:21FromDiscord<Elegantbeef> casting `cstring` to `string` is just wrong, they're not the same data so bad things will happen
02:57:52FromDiscord<Elegantbeef> `cast` in nim isnt a type conversion it's a type reinterpretation, which means the data stays the same but the type system says "It's now X"
02:58:15FromDiscord<Elegantbeef> `buffer.string` is probably what you want, but there is a `&=` for `string &= cstring`
02:59:36User11Yes this brings me to this issue https://github.com/Araq/libcurl/issues/4
03:00:55User11That is why I switched to string concatenation with a range parameter
03:02:01User11How could I do the same with cstring ? To concat a cstring into a string variable?
03:03:05FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3AM4 probably the most sound method
03:03:18FromDiscord<Elegantbeef> Idk if `size` is the size of the buffer or if `count` is
03:04:29User11aha that makes more sense
03:05:50User11the size is the size of 1 unit of data, and the count is how many, I think
03:06:20User11so the real size is "size * count"
03:06:23FromDiscord<Elegantbeef> ah then replace size with `size count` where i used size of course
03:06:41FromDiscord<Elegantbeef> ah i see you actually understand what's going on 😛
03:06:51User11ok I'll try it out
03:06:55User11Thank you
03:07:04FromDiscord<Elegantbeef> That Zip stuff is still questionable though
03:07:17FromDiscord<Elegantbeef> Since iirc the header stores the information to files/entires
03:09:16User11I'll look up how to use Zippy if it still doesnt work. I have options now before I wasn't sure what was going on
03:10:13User11TY :))
03:11:21FromDiscord<Elegantbeef> No problem happy to help
03:41:15*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
03:41:42*Gustavo6046 joined #nim
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:47:40*rockcavera quit (Remote host closed the connection)
05:30:26*pch__ is now known as kinkinkijkin
06:36:50*PMunch joined #nim
06:40:27*naquad quit (Remote host closed the connection)
06:43:58*jjido joined #nim
06:51:04*PMunch quit (Quit: Leaving)
06:55:29*PMunch joined #nim
07:14:27*max22- joined #nim
07:29:24*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
07:50:22Amun-Rahow can I check backend type (c/cpp/objc) compile time?
07:51:46*jjido joined #nim
07:53:31FromDiscord<xflywind> !eval import std/compilesettings; static: echo querySetting(backend)
07:53:33NimBot<no output>
07:53:49FromDiscord<Rika> it doesnt post compile time output
07:54:07FromDiscord<xflywind> !eval import std/compilesettings; const s = querySetting(backend); echo s
07:54:09NimBotc
07:54:38FromDiscord<xflywind> In reply to @Amun-Ra "how can I check": ^
07:54:50FromDiscord<xflywind> In reply to @Rika "it doesnt post compile": I forgot
07:57:13Amun-Raxflywind: that's it, thank you
07:57:33FromDiscord<xflywind> no problem
08:20:13NimEventerNew thread by Jorjun_arch: Is the Browser the Platform?, see https://forum.nim-lang.org/t/8477
08:32:35*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:08:15*jjido joined #nim
09:27:42*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
10:41:24*pro joined #nim
10:42:36*pro quit (Client Quit)
10:56:04*Vladar joined #nim
11:25:18*jjido joined #nim
11:25:19*jjido quit (Client Quit)
11:42:36*crem quit (Ping timeout: 245 seconds)
11:42:55*crem joined #nim
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:32*supakeen joined #nim
12:16:18*rockcavera joined #nim
12:16:18*rockcavera quit (Changing host)
12:16:18*rockcavera joined #nim
12:19:24*pro joined #nim
12:37:36PMunchHmm, maybe I should do a little bit of streaming for Hacktober
12:39:01promaybe :)
12:54:56*pro quit (Quit: WeeChat 3.3)
13:02:01*kayabaNerve_ joined #nim
13:03:37*TechAspirer joined #nim
13:04:28*kayabaNerve quit (Ping timeout: 252 seconds)
13:04:35*arkurious joined #nim
13:06:26*kayabaNerve_ quit (Ping timeout: 260 seconds)
13:23:44*PMunch quit (Quit: Leaving)
13:25:20FromDiscord<Marvel> hi, i am trying to use nimyaml and output my yaml file but i am just getting no output. how do i fix this?↵↵nim file: https://play.nim-lang.org/#ix=3AOm (the example from the nimyaml documentation)
13:29:49*PMunch joined #nim
13:32:49*max22- quit (Ping timeout: 268 seconds)
13:32:56*KainAlive joined #nim
13:34:53FromDiscord<Gumber> You're not sending anything to stdout...
13:35:07*KainAlive quit (Client Quit)
13:35:11FromDiscord<Marvel> what should i send?
13:35:14FromDiscord<Marvel> `s`?
13:40:13FromDiscord<Gumber> You're code doesn't make sense
13:40:44FromDiscord<Rika> ill take a look as well
13:40:59FromDiscord<Rika> gumber i think they mean "output" as in file output
13:41:56FromDiscord<Rika> ah
13:42:10FromDiscord<Rika> marvel, isnt an empty array in yaml just an empty file
13:42:15FromDiscord<Rika> thats why
13:42:20FromDiscord<Rika> your seq is empty
13:42:35FromDiscord<tandy> can nimdoc generate docs for javascript backend?
13:42:49FromDiscord<haxscramper> nim doc can generate docs for any backend
13:43:03FromDiscord<haxscramper> or do you have some specific thing that is hidden under `when defined(js)`?
13:43:22FromDiscord<tandy> hmm no, but i have an `import dom` which causes nim doc to fail i think
13:43:25FromDiscord<haxscramper> In this case you can probably use `-d:js` or `--backend:js` when `nim doc`
13:43:35FromDiscord<haxscramper> What is the error message?
13:43:36FromDiscord<tandy> oh cool
13:43:51FromDiscord<haxscramper> And you can hide some code from nim doc using `when no defined(nimdoc)`
13:44:10FromDiscord<Rika> is there anyone other than status employees that use `nim-serialization`? are there any issues with it? about to write some code, just want to know if youve encountered issues
13:44:30FromDiscord<Gumber> Sorry I'm at the doctor
13:45:12FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3AOq
13:45:25FromDiscord<tandy> i tried doing that, but then of course the code fails without the import
13:46:40FromDiscord<Marvel> In reply to @Rika "marvel, isnt an empty": no the yaml file isn't empty
13:46:50FromDiscord<haxscramper> https://github.com/nim-lang/Nim/blob/version-1-4/lib/js/dom.nim#L13
13:46:52FromDiscord<Rika> oh you're loading&
13:46:54FromDiscord<haxscramper> it has a typo in check
13:46:58FromDiscord<haxscramper> `Nimdoc`
13:47:01FromDiscord<haxscramper> should be `nimdoc`
13:47:13FromDiscord<haxscramper> Run with `-d:Nimdoc`
13:47:18FromDiscord<Marvel> sent a code paste, see https://play.nim-lang.org/#ix=3AOr
13:47:31*def- quit (Quit: -)
13:47:38FromDiscord<tandy> oof, but im running devel?
13:47:45FromDiscord<tandy> i dont see the typo there
13:47:52*PMunch quit (Quit: Leaving)
13:48:18FromDiscord<haxscramper> image.png https://media.discordapp.net/attachments/371759389889003532/894581701123117106/image.png
13:48:20FromDiscord<haxscramper> SHould be `nimdoc`
13:48:20*def- joined #nim
13:48:30FromDiscord<haxscramper> qah
13:48:30FromDiscord<tandy> yea, i switched branch to devel on that file
13:48:31FromDiscord<haxscramper> devel
13:48:48FromDiscord<haxscramper> aff
13:48:55FromDiscord<haxscramper> there is no nimdoc check even
13:49:08FromDiscord<tandy> this is if i add `-d:js`
13:49:10FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3AOv
13:49:17FromDiscord<haxscramper> well, then I don't know, probably @xflywind is typing some magic fix
13:49:26FromDiscord<xflywind> `defined` is style-insensitive
13:49:29FromDiscord<haxscramper> but I have no idea
13:49:48FromDiscord<haxscramper> `nimdoc` != `Nimdoc` even with style insensetivity
13:50:27FromDiscord<xflywind> well, I was wrong. the first char is case insensitive.
13:50:34FromDiscord<xflywind> try `nim doc -b:js`?
13:51:04FromDiscord<tandy> woo
13:51:07FromDiscord<tandy> that works
13:51:24FromDiscord<tandy> didnt know -b was a thing
13:51:25FromDiscord<haxscramper> does `--backend:js` not work?
13:51:44FromDiscord<tandy> i didnt try --backend oops
13:51:45FromDiscord<haxscramper> oh well
13:51:46FromDiscord<haxscramper> `-b` is the same as `--backend`
13:51:53FromDiscord<tandy> that works tho
13:53:02FromDiscord<tandy> where is nim doc docs?
13:53:15*max22- joined #nim
13:53:23FromDiscord<haxscramper> `htmldocs` or `--outdir:<your directory>`
13:53:28FromDiscord<tandy> https://nim-lang.org/docs/docgen.html
13:53:41FromDiscord<tandy> ty ahha
13:56:18FromDiscord<Gumber> But uh the problem is you're just loading your file into a stream and then deserializing it into a seq
13:56:33FromDiscord<Gumber> You never print the stream or the sequence
13:57:03FromDiscord<Gumber> @Marvel
13:57:15FromDiscord<Gumber> This is why I said your code makes no sense
13:57:18FromDiscord<Marvel> so what should i print?
13:57:25*neurocyte013288 joined #nim
13:57:25*neurocyte013288 quit (Changing host)
13:57:25*neurocyte013288 joined #nim
13:57:27FromDiscord<Marvel> sorry i am new to nim
13:57:42FromDiscord<Gumber> You need to understand what you're doing first....
13:57:48FromDiscord<Marvel> ooooh wiat
13:57:52FromDiscord<Marvel> (edit) "wiat" => "wait"
13:57:54FromDiscord<Marvel> i got it
13:57:57FromDiscord<Marvel> ok ok
13:58:29FromDiscord<Marvel> so the `load` function takes the yaml contents from file `s` and puts it into seq `personList` so if i echo `personList` i get the contents of the fiel
13:58:31FromDiscord<Marvel> (edit) "fiel" => "file"
13:58:38FromDiscord<Gumber> You're not doing what you think you're trying to do....
13:58:52FromDiscord<Gumber> You're just trying to load a YAML file into memory and print it, correct?
13:59:07FromDiscord<Marvel> at first
13:59:10FromDiscord<Gumber> No
13:59:22FromDiscord<Marvel> eventually i need to save it into a variable and use it as an api token
13:59:24FromDiscord<Gumber> You get a sequence of people objects
13:59:36FromDiscord<Gumber> Deserialization
13:59:52FromDiscord<Gumber> You take the yaml representation of the people list
14:00:21FromDiscord<Gumber> And you deserialize it into a sequence of people objects
14:00:32FromDiscord<Gumber> If you want to print them out you can use echo
14:00:35*neurocyte013288 quit (Client Quit)
14:00:48FromDiscord<Gumber> Or echo repr if they are ref objects
14:01:04FromDiscord<Gumber> Use echo ref if you want to print the entire sequence
14:01:38FromDiscord<Gumber> Sorry I'm on the doctor's table waiting for them to come back in
14:01:44FromDiscord<Marvel> lol its alr
14:01:57FromDiscord<Marvel> In reply to @Gumber "Use echo ref if": wdym 'ref'?
14:02:03FromDiscord<Gumber> Reference
14:02:12FromDiscord<Gumber> You should read the Nim manual
14:02:20FromDiscord<Gumber> It explains these things
14:02:35FromDiscord<Gumber> Well not nimyaml
14:02:41FromDiscord<Gumber> But ref objects
14:03:06FromDiscord<Marvel> no i understand ref
14:03:15FromDiscord<Marvel> i have a large programming background
14:03:19FromDiscord<Marvel> im just new to nim
14:03:26FromDiscord<Gumber> Okay
14:03:56FromDiscord<Marvel> thanks so much for you're help
14:04:03FromDiscord<Marvel> im sorry im so stupid lol
14:04:04FromDiscord<Gumber> Np
14:04:21FromDiscord<Gumber> You're probably not stupid and no need to apologize
14:04:36FromDiscord<Gumber> I can't say for certain haha, I don't know you personally
14:04:42FromDiscord<Marvel> lmao thanks
14:04:49FromDiscord<Gumber> 👍
14:06:19*neurocyte013288 joined #nim
14:06:19*neurocyte013288 quit (Changing host)
14:06:19*neurocyte013288 joined #nim
14:14:22*Zevv quit (Ping timeout: 250 seconds)
14:37:26*User11 quit (Ping timeout: 260 seconds)
14:44:29*jjido joined #nim
15:51:03FromDiscord<Goel> sent a code paste, see https://paste.rs/9OT
15:52:05FromDiscord<Rika> inc doesnt mean "add one"
15:52:10FromDiscord<Rika> well
15:52:17FromDiscord<Rika> afaik?
15:52:54FromDiscord<Rika> okay
15:52:59FromDiscord<Rika> it does mean add one but it's not well defined on floats
15:53:08FromDiscord<Goel> I can understand that inc() needs ordinal type and n is float. I can accept it. But why i can do n += 1? 1 is not cosidered int in this case? I though i had to do n += 1.0
15:53:17FromDiscord<Rika> rather not all floats would return a different value when you add one
15:53:49FromDiscord<Rika> `1` is a literal and can be coerced into a float
15:54:50krux02Goel, if you remove `inc` from your knowledge and your codebase, you won't miss anything.
15:55:31nrds<Prestige99> Yeah I just avoid `inc`
15:55:38nrds<Prestige99> seems odd to me
15:56:09krux02I think it was introduced for enums, but iterators work much better here.
15:56:20FromDiscord<Goel> Really? Actually i've been using += for long time, then reading some code i read a lot of inc() and i though was a good idea as of style to change into it...
15:56:48krux02I've been on both sides
15:56:56krux02you can safely ignore inc
15:57:03FromDiscord<Rika> In reply to @Goel "Really? Actually i've been": prolly just used because people recommended it
15:57:15FromDiscord<Rika> yes it can be ignored, it's just another +=
15:57:31krux02but it is also not bad to have just inc instead of `+=`, you should just pick one and ignore the other
15:57:38krux02and I prefer `+=`
15:58:01*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:59:40FromDiscord<Rika> well personally i use one or the other depending on context but yeah
16:10:28*neurocyte013288 quit (Quit: The Lounge - https://thelounge.chat)
16:12:17*neurocyte013288 joined #nim
16:12:17*neurocyte013288 quit (Changing host)
16:12:17*neurocyte013288 joined #nim
16:24:35*Zevv joined #nim
17:26:59*neurocyte013288 quit (Ping timeout: 245 seconds)
17:37:46*rockcavera quit (Ping timeout: 252 seconds)
17:44:36*jjido joined #nim
17:51:49*nixfreak_nim[m]1 quit (Ping timeout: 268 seconds)
17:52:08*nixfreak_nim[m]1 joined #nim
18:04:16*Gustavo6046 quit (Ping timeout: 245 seconds)
18:04:52*Gustavo6046 joined #nim
18:08:29FromDiscord<Hamid Bluri> hey - is there any async wrapper for `osproc` module?
18:10:43FromDiscord<Hamid Bluri> or any suggestion how to implement it?
18:10:47FromDiscord<Hamid Bluri> (edit) "or any suggestion ... how" added "on"
18:14:51*max22- quit (Ping timeout: 268 seconds)
18:31:25*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:35:00FromDiscord<haxscramper> https://github.com/cheatfate/asynctools
18:35:03nrds<R2D299> itHub: 7"Various asynchronous tools for Nim language"
18:37:54FromDiscord<iffy (Matt Haggard)> How can I pass a string by reference instead of copying?
18:38:38FromDiscord<iffy (Matt Haggard)> In other words, I have a `string` and I've made a proc that wants a `ref string`. Am I doing it wrong?
18:38:59FromDiscord<Yardanico> In reply to @iffy (Matt Haggard) "In other words, I": why do you want a ref of it?
18:39:05FromDiscord<Yardanico> to modify? then use `var string` in argument
18:39:18FromDiscord<iffy (Matt Haggard)> I want the speed of avoiding a copy. Oh, duh...
18:39:24FromDiscord<iffy (Matt Haggard)> Thinking too hard
18:41:02*rockcavera joined #nim
18:41:02*rockcavera quit (Changing host)
18:41:02*rockcavera joined #nim
18:41:59*vicfred joined #nim
18:42:44FromDiscord<haxscramper> you don't need to be concerned with that when passing arguments to functions
18:42:49FromDiscord<haxscramper> nim optimizes that
18:52:08*nixfreak_nim[m]1 quit (Ping timeout: 250 seconds)
18:54:37*nixfreak_nim[m]1 joined #nim
18:56:09*max22- joined #nim
18:56:42*max22- quit (Remote host closed the connection)
18:57:27*max22- joined #nim
19:06:25*Vladar quit (Quit: Leaving)
19:07:15*jjido joined #nim
19:20:10FromDiscord<treeform> In reply to @iffy (Matt Haggard) "In other words, I": I don't think that would speed things, but do profile it, you never know.
19:20:17*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:20:50FromDiscord<treeform> I had speed success in passing using `var string` even when I am not modifying it.
19:21:31FromDiscord<treeform> I used `hottie` to see that there was a ton of string copying
19:21:44FromDiscord<treeform> nim could figure out that I don't mutate the string
19:21:54FromDiscord<treeform> so it just made everything var string which made mutation ok
19:22:03FromDiscord<treeform> and it just passed stuff without string copies
19:22:11FromDiscord<treeform> even though no mutation where there
19:22:47FromDiscord<treeform> this var string made a difference: https://github.com/treeform/globby/blob/master/src/globby.nim#L34
19:23:01FromDiscord<treeform> I `hottie` and `bency` it and it was good.
19:26:51FromDiscord<Hamid Bluri> In reply to @treeform "I `hottie` and `bency`": ben[ch]y you mean?
19:27:03FromDiscord<treeform> sorry yes
19:57:37*nixfreak_nim[m]1 quit (Ping timeout: 268 seconds)
19:57:59*nixfreak_nim[m]1 joined #nim
19:59:16*neurocyte013288 joined #nim
19:59:16*neurocyte013288 quit (Changing host)
19:59:16*neurocyte013288 joined #nim
19:59:23*neurocyte013288 quit (Client Quit)
20:03:06*jjido joined #nim
20:06:55*neurocyte013288 joined #nim
20:06:55*neurocyte013288 quit (Changing host)
20:06:55*neurocyte013288 joined #nim
20:11:43FromDiscord<iffy (Matt Haggard)> hmmm, why does `nimble install hottie` not work?
20:19:45FromDiscord<Elegantbeef> What does it error with?
20:21:24FromDiscord<iffy (Matt Haggard)> " Error\: Package not found."
20:21:43FromDiscord<iffy (Matt Haggard)> Is it because I'm on macOS and hottie isn't supported for macOS?
20:21:49FromDiscord<Elegantbeef> Seems like your nimble package list isnt upgrading
20:21:55FromDiscord<Elegantbeef> You can always install it using the git url
20:22:31FromDiscord<Yardanico> In reply to @iffy (Matt Haggard) "hmmm, why does `nimble": It's because it's not in Nimble :D
20:22:49FromDiscord<Yardanico> ah nvm it is
20:22:53FromDiscord<Yardanico> scratch my previous message
20:23:35FromDiscord<treeform> In reply to @iffy (Matt Haggard) "Is it because I'm": hottie is not supported on macOS
20:25:39FromDiscord<Elegantbeef> It is
20:27:14*neurocyte013288 quit (Quit: The Lounge - https://thelounge.chat)
21:07:19FromDiscord<Elegantbeef> @geekrelief\: i have to ask, have you taken a look at nimscripter v2 yet?
21:23:29FromDiscord<geekrelief> In reply to @Elegantbeef "<@109484839480107008>\: i have to": Yeah I just tried it out a bit last night.
21:24:22FromDiscord<geekrelief> It's been a while since I last looked at it. It was only a cursory glance just to see if things were working.
21:25:28FromDiscord<geekrelief> It feels nicer compared to last time I checked. I'm looking forward to see how this works out with TM.
21:29:13FromDiscord<Elegantbeef> Yea, i'm much happier with the API as it is, odd what a year of making macros/writting code can do 😀
21:29:30FromDiscord<Elegantbeef> Honestly thinks the fancy to/fromVm macros were purely from fixing the compiler
21:29:56FromDiscord<geekrelief> In reply to @Elegantbeef "Yea, i'm much happier": Definitely, the first time I tried nimscripter, I couldn't figure how to make it work with nim devel. :p
21:29:58FromDiscord<geekrelief> (edit) ":p" => "😄"
21:31:51FromDiscord<geekrelief> Hopefully, I want to dive into the nimscripter source more once I get my TM bindings further along. There's gotta be a way to make the bindings from to nim to nims smoother.
21:32:16FromDiscord<geekrelief> (edit) removed "Hopefully,"
21:33:22FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3AQQ
21:33:50FromDiscord<geekrelief> Creating that wrapping seems tedious.
21:33:59FromDiscord<Elegantbeef> Yep having the compiler as a dependancy with nimble does nothing but cause issues
21:36:12FromDiscord<Elegantbeef> Well the issue is typeclasses/generics, but it's doable
21:37:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3AQR
21:38:24FromDiscord<Elegantbeef> Typeclasses are a bitch though, so i have to think on it a bit
21:38:38FromDiscord<Elegantbeef> The one idea is a bunch of try excepts on parsing, but that's shit for obvious reasons
21:38:43FromDiscord<geekrelief> In reply to @Elegantbeef "Well the issue is": Can you elaborate on why typeclasses/generics are tedious to deal with? I haven't used much of either, but then again I'm going to be dealing with a C binding.
21:38:58FromDiscord<Elegantbeef> Generics will not be supported as it's just unfeasible
21:39:07FromDiscord<Elegantbeef> typeclasses can be, so i will offer it
21:41:31FromDiscord<Elegantbeef> Ideally we can export an entire module to a script, but we'll see 😀
21:41:57FromDiscord<geekrelief> That would be sweet!
21:42:19FromDiscord<Elegantbeef> Well you cannot overload on nimscript for VM procs
21:42:22FromDiscord<Elegantbeef> So you have to figure out the proc to call from parsing
21:42:43FromDiscord<Elegantbeef> Or export a bunch of aliases that call mangled names
21:43:26FromDiscord<geekrelief> In reply to @Elegantbeef "Or export a bunch": For my purposes, that's ok. What happens if you try overloading?
21:43:42FromDiscord<Elegantbeef> square for instance has `int or float` for every parameter, so that means you need every combination of type classes
21:43:42FromDiscord<Elegantbeef> so `int, int, int, int` `int, int, int, float` `int, int, float, int` ....
21:44:08FromDiscord<Elegantbeef> So one side will make the nimscript bloated, the otherside will make interop more costly with try excepts for flow control
21:44:39FromDiscord<Elegantbeef> Generics are just impossible to support due to needing to have a nim generic instantiated
21:45:04FromDiscord<Elegantbeef> Since generics instantiate procs when called, and you dont know what type the nimscript is sending you, you just cannot use generics
21:45:27FromDiscord<Elegantbeef> Typeclasses will work purely due to the fact you know the limited allowed types so can generate code to support them
21:45:39FromDiscord<Elegantbeef> composite type classes like `seq` will not work either for the same reason as generics
21:46:18FromDiscord<Elegantbeef> Well you cannot overload VM procs, there is a single `someProcName` for the nimscript side solution it involves emitting all permutations of the proc then calling a mangled version internally
21:46:53FromDiscord<Elegantbeef> so you might have `squareintintintint` or something similar emitted by nimscripter so when you do `square(10, 10, 10, 10)` it calls that one
21:47:26FromDiscord<Elegantbeef> But if you did `square(10d, 10d, 10fint, 10int)` it'd call `squarefloatfloatintint`
21:47:55FromDiscord<Elegantbeef> Probably better to just use `gensym` for the naming
21:47:57FromDiscord<Elegantbeef> But you get the point
21:48:07FromDiscord<Elegantbeef> Each permutation needs it's own generated nimscript side proc
21:49:22FromDiscord<geekrelief> I wonder if that's going to be a real issue in practice.
21:49:43FromDiscord<Elegantbeef> Well i'm going to walk dogs now, so will be back to talk more in a bit if you have any more ideas/concerns
21:49:52FromDiscord<geekrelief> alright thx!
21:50:55FromDiscord<Elegantbeef> It'll be 100% hidden either way
21:51:14FromDiscord<Elegantbeef> So it's a non issue for users, just implementation issues
22:01:02*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:02:08FromDiscord<geekrelief> In reply to @Elegantbeef "Well you cannot overload": So I just answered my own question. I was wondering what would happen if you attempt to overload: Overloading on parameter types we get output to the console about mismatched types, but overloading on argument count I got unexpected behavior. Why is the circle growing?! https://media.discordapp.net/attachments/371759389889003532/894705973724348466/dYCBallUFf.mp4
22:14:06FromDiscord<geekrelief> I guess we can deal with different argument counts with default parameters.
22:26:22nrds<Prestige99> In a c lib I'm wrapping there are checks like `#if CP_USE_DOUBLES` How should I go about wrapping that?
22:26:50nrds<Prestige99> atm it appears to be falsey so I had to declare a type with cfloat instead of cdouble
22:26:51FromDiscord<impbox [ftsf]> Sounds like it's an option
22:26:59FromDiscord<impbox [ftsf]> Probably with a define
22:27:15FromDiscord<impbox [ftsf]> The user of the library can use whether they want doubles or floats
22:27:33FromDiscord<impbox [ftsf]> Assuming CP is the library
22:27:37nrds<Prestige99> hm yeah I found #if defined(__LP64__) && __LP64__
22:27:44*stkrdknmibalz joined #nim
22:27:53nrds<Prestige99> that determines CP_USE_DOUBLES
22:28:03FromDiscord<impbox [ftsf]> `when defined(useDoubles)`
22:28:15FromDiscord<impbox [ftsf]> Yeah i dunno then
22:29:08FromDiscord<impbox [ftsf]> Instead of using cfloat or cdouble you probably want to use a type that is defined to one of those depending on that
22:30:11nrds<Prestige99> hmm yeah maybe
22:30:21FromDiscord<impbox [ftsf]> when defined (useDoubles): type creal = cfloat↵else: type creal = cfloat32
22:34:49FromDiscord<Elegantbeef> @geekrelief\: yea parameter count overloading works fine it's type overloading that's an issue
22:35:21FromDiscord<Elegantbeef> Going to work on the module wide exporting now
22:36:13FromDiscord<geekrelief> In reply to @Elegantbeef "Going to work on": I was just looking at the source. Is there a reason `nimscripter` doesn't export `expose`?
22:36:58FromDiscord<Elegantbeef> Other than me being a dullard, nope
22:44:44FromDiscord<Elegantbeef> So seems there isnt presently a way to get the module body from a macro
22:51:37FromDiscord<geekrelief> In reply to @Elegantbeef "So seems there isnt": Just throwing this out there, can we read the module file and use the compiler to parse it?
23:03:45*max22- quit (Remote host closed the connection)
23:05:41FromDiscord<Elegantbeef> This is a shame really, cause i dont even see a way in the compiler to do that
23:06:09FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3AR8
23:06:10FromDiscord<geekrelief> but I get an importc error
23:06:24FromDiscord<geekrelief> C:\Nim\compiler\options.nim(547, 22) Error: cannot 'importc' variable at compile time; stderr
23:06:42FromDiscord<Elegantbeef> Yea that's not the right way around this problem
23:07:12FromDiscord<Elegantbeef> On top of it you're going to get symbols that dont match the ones in the cache
23:08:12FromDiscord<Elegantbeef> The proper solution is to patch the compiler so `skModule`s return their sem'd AST but they dont seem to store that so it's a pipedream
23:08:22FromDiscord<geekrelief> yeah don't listen to me, I barely have an inkling of what I'm talking about. I was inspired by looking at nimterop's code 😄
23:08:25FromDiscord<Elegantbeef> It might be possible to get the symbols they expose though, which might make it possible
23:08:52FromDiscord<Elegantbeef> It's fine, just looking at the compiler to see if we can gracefully add this
23:15:33FromDiscord<Elegantbeef> Well i do not see how so i guess we'll have to settle for the tedious impl until
23:34:27FromDiscord<impbox [ftsf]> _is sad push can't be used for this, seems perfect_
23:36:51FromDiscord<Elegantbeef> It may be possible i guess, idk i'd prefer just `exportToNimscript(module, nimscriptModuleName)`
23:37:32NimEventerNew post on r/nim by hayden_suse: Nim Windows Containers, see https://reddit.com/r/nim/comments/q1ibtl/nim_windows_containers/
23:38:33FromDiscord<impbox [ftsf]> yeah i guess that'd be rad too
23:38:48FromDiscord<impbox [ftsf]> time to hack the compiler
23:39:36FromDiscord<Elegantbeef> Well i did see if there is a way for us to get exported symbols from a module easily, if so we can make a new VM op
23:44:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ARe
23:54:41*Lord_Nightmare quit (Quit: ZNC - http://znc.in)