<< 18-03-2021 >>

00:32:05ForumUpdaterBotNew thread by Buster_blue: Macros and Syntax, see https://forum.nim-lang.org/t/7654
00:32:38FromDiscord<Ayy Lmao> I am trying to do some stuff with ENet and I am having some trouble. I am running into errors that seem to point to needing to link "Ws2_32.lib". Does anyone know how to link that? All info I can find seems to be using Visual Studio.
00:37:01FromDiscord<Ayy Lmao> I'm not exactly sure I even need to use ENet but I can't seem to get anything to work. For context, I am trying to communicate with https://github.com/project-slippi/slippi-wiki/blob/master/SPECTATOR_PROTOCOL.md
00:45:52*xet7 joined #nim
00:55:55FromDiscord<TurtleP> Hey, so I'm trying to loop through a list of strings and depending on what they are, I want to call a method on the created object. There's two objects which both have the same constructor and share the method name, but are derived from another type. Here's the code I have atm: <https://pastebin.com/LW2ENjzQ>
01:08:01FromDiscord<ElegantBeef> What's' the entire code?
01:08:38FromDiscord<exelotl> oooh you homebrewin'
01:10:28FromDiscord<TurtleP> In reply to @exelotl "oooh you homebrewin'": always have been :tuxdab:
01:10:47FromDiscord<TurtleP> In reply to @ElegantBeef "What's' the entire code?": I'm not sure what else I can show, but it's reading from a toml file for the config values
01:11:01FromDiscord<ElegantBeef> Sure but what are you objects
01:11:13FromDiscord<ElegantBeef> Also use nim playground πŸ˜„
01:11:52FromDiscord<TurtleP> <https://pastebin.com/qd36PDvp>
01:12:09FromDiscord<TurtleP> there's not much done with the objects since I haven't gotten that far
01:12:11FromDiscord<ElegantBeef> https://play.nim-lang.org/ πŸ˜›
01:12:13FromDiscord<ElegantBeef> Ok
01:12:23FromDiscord<InventorMatt> @Ayy Lmao if you post it on the forum you may have a better chance at someone being able to answer your question
01:13:20FromDiscord<ElegantBeef> I dont see the issue if you make a `CTR` or `HAC` object then invoke `consoleName` it'll call the proper one
01:14:17FromDiscord<ElegantBeef> The entire point of methods is that they're dynamically dispatched and dont require explict conversions
01:14:28FromDiscord<TurtleP> I mean the constructor values are the same, so I would like to know if I can simplify making one or the other
01:14:39FromDiscord<TurtleP> like in python I could store the object type
01:14:40FromDiscord<ElegantBeef> You could make a template
01:14:43FromDiscord<TurtleP> and then invoke it based on that
01:14:54FromDiscord<TurtleP> In reply to @ElegantBeef "You could make a": template hm?
01:15:07FromDiscord<Ayy Lmao> In reply to @InventorMatt "<@!277645179115143178> if you post": Yeah I will probably end up doing that if I can't figure this out.
01:16:37FromDiscord<ElegantBeef> @TurtleP https://play.nim-lang.org/#ix=2TfY
01:17:08FromDiscord<TurtleP> oh interesting
01:17:17FromDiscord<ElegantBeef> That also allows you to add more later on and store them in the same field
01:17:43FromDiscord<ElegantBeef> Of course you can do the more normal `var console: Console` then set it manually
01:17:55FromDiscord<ElegantBeef> Atleast i think that compiles
01:23:04FromDiscord<ElegantBeef> Also worth noting if this is the extent of your inheritance you may want to consider just using an enum to control the logic
01:28:11FromDiscord<ElegantBeef> @TurtleP something like this(If you dont need actual polymorphism and just need to return different values, which atleast it seems is all you need)
01:28:13FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Tg1
01:30:20FromDiscord<TurtleP> I'll need polymorphism once I delve deeper
01:30:23FromDiscord<TurtleP> but thank you
01:30:24FromDiscord<TurtleP> πŸ™‚
01:30:51FromDiscord<ElegantBeef> Dont say that too loudly some dont accept anyone needing it πŸ˜›
01:35:16*Tanger joined #nim
01:45:48*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:46:08*njoseph joined #nim
01:49:28FromDiscord<Zachary Carter> @Ayy Lmao well .lib files are windows files
01:50:02FromDiscord<Zachary Carter> static library files I believe
01:50:23FromDiscord<Zachary Carter> on linux they're `.a` files
01:50:58FromDiscord<Zachary Carter> not sure what you're trying to do with ENet or what OS you're using but sharing some code would help
01:53:22FromDiscord<Papel> Is there a way to get the name of a variable? Something like this:↡`var thisvar = 12↡echo "SELECT FROM TABLE1 WHERE", thisvar.name? , " = ", thisvar`
01:55:05FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Tg8
01:55:43FromDiscord<ElegantBeef> Not overly safe, but works for this
01:57:08FromDiscord<Ayy Lmao> In reply to @Zachary Carter "not sure what you're": I'm using Windows, but ideally it would be platform agnostic. At the moment I am trying to essentially trying to port this to Nim https://github.com/altf4/libmelee/blob/master/melee/slippstream.py
01:57:19FromDiscord<Papel> what's unsafe about it @ElegantBeef ?
01:57:34FromDiscord<ElegantBeef> if you do `a.b` it doesnt return `b` it returns `a.b`
01:57:45FromDiscord<Zachary Carter> In reply to @Ayy Lmao "I'm using Windows, but": I meant your ENet binding code that's producing that error
01:58:14FromDiscord<Zachary Carter> you need to link to the ENet library in order to use it - either you need to bind dynamically to the DLL or link statically to the .lib file
01:58:23FromDiscord<Ayy Lmao> @Zachary Carter I barely have any code so far, but this is what does it https://play.nim-lang.org/#ix=2Tg9
01:59:19FromDiscord<Papel> In reply to @ElegantBeef "if you do `a.b`": so, if it's a variable from an object, it might end up passed as "player.health" instead of only "health", did I get it right?
01:59:25FromDiscord<ElegantBeef> Yep
01:59:38FromDiscord<Ayy Lmao> If I don't pass in Ws2_32.lib it throws tons of linker errors that when googled lead me to linking Ws2_32.lib, but I don't know exactly how to link or find that lib
02:00:22FromDiscord<Papel> i see, shouldn't be much trouble dividing the string at the . though, thanks a ton!
02:01:57FromDiscord<Zachary Carter> @Ayy Lmao maybe try `{.passL: "-l enet64.lib".}` I'm not sure - I usually use `cl.exe` with Nim on windows and I doubt you're using that
02:02:03FromDiscord<Zachary Carter> youre probably using mingw or something
02:03:20FromDiscord<Ayy Lmao> Yeah I'm using mingw64. When I try that it says it can't find -lenet64.lib
02:05:23FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=2Tge
02:20:13FromDiscord<ElegantBeef> Saem your PR was accepted, so cheers πŸ˜„
02:21:11FromDiscord<Zachary Carter> okay well you're still missing more libraries then
02:21:42FromDiscord<Zachary Carter> actually @Ayy Lmao try `-lws2_32` instead
02:21:47FromDiscord<Zachary Carter> omit the `.lib` and see if that works
02:21:59FromDiscord<sealmove> do we have a lzw compression library?
02:25:51FromDiscord<ElegantBeef> I know we have zippy but i dont remember if it does lzw
02:27:00FromDiscord<sealmove> zippy has: dfZlib, dfGzip, dfDeflate
02:38:24FromDiscord<Ayy Lmao> @Zachary Carter That seems to work! I am apparently missing another lib that I need to figure out what it is however.
02:40:11FromDiscord<Ayy Lmao> Ok so the other lib is winmm. I linked that and it compiles now. ENet fails to initialize, but at least I am a step closer
02:40:24FromDiscord<Ayy Lmao> Thank you for the help
02:41:21FromDiscord<Ayy Lmao> Oh wait it didn't fail, it just returns 0 on success, which is strange
03:00:53FromDiscord<Zachary Carter> NP
03:19:34saemI'm super excited
03:19:42saemThanks, Beef!
03:25:45*NimBot joined #nim
03:29:11PrestigeHell yeah
03:31:14*wasted_youth2 quit (Quit: Leaving)
03:42:28FromDiscord<ElegantBeef> Sorry i didnt do the homework πŸ˜›
03:42:35saem:P
03:42:47saemIt's totally cool
03:43:28FromDiscord<ElegantBeef> But hey people like my defaults macro so 10/10 day
03:43:39saemoh yeah?
03:44:22saemI gotta get profiling working, I wonder if I can replicate what treeform was doing.
03:46:27FromDiscord<ElegantBeef> If you hadn't seen it (I didnt just add headers so i could do this) https://github.com/beef331/constructor#defaults
03:46:57FromDiscord<ElegantBeef> Do you mean with Vtune, or proffy?
03:47:10saemvtune of callgrind or something
03:47:15saemor even
03:58:36FromDiscord<Yardanico> trying out ormin, I guess I actually prefer it over norm
03:59:12FromDiscord<Yardanico> it's a bit "lower-level" (you make queries yourself), but they're checked at compile time and are fully safe, also norm uses runtime object inheritance instead (to do joins and stuff)
03:59:20FromDiscord<Yardanico> just look at this
03:59:26FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Tgx
04:02:23PrestigeAre the nim tutorial pages just made my hand?
04:02:30FromDiscord<Yardanico> ?
04:02:37FromDiscord<Yardanico> no, they use docgen
04:02:41FromDiscord<Yardanico> as the module docs
04:02:47FromDiscord<ElegantBeef> Well they're made by hand in RST πŸ˜„
04:02:54FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/doc/tut1.rst
04:02:58FromDiscord<Yardanico> https://raw.githubusercontent.com/nim-lang/Nim/devel/doc/tut1.rst
04:03:14PrestigeYeah that's what I meant, what beef said
04:03:48PrestigeWas thinking we could break out each section into single pages with the playground to make something like https://tour.golang.org/welcome/1
04:04:00PrestigeOr even as a start, without the playground
04:04:16FromDiscord<Yardanico> someone already made something like that for playground in the past
04:04:21FromDiscord<ElegantBeef> Well the playground supports it so have at 'er
04:04:46FromDiscord<Yardanico> yeah exactly
04:04:55PrestigeWould be a lot easier to get through for beginners if the pages weren't massive
04:05:07PrestigeMaybe I will work on that
04:05:34FromDiscord<ElegantBeef> Yay i finally have confirmation that resus works!
04:05:52FromDiscord<ElegantBeef> Who'd have thought that a green led brought any happiness πŸ˜„
04:07:02FromDiscord<ElegantBeef> Seems the resuscitation callback cannot sleep the processor else it just locks there
04:10:15*spiderstew_ quit (Ping timeout: 244 seconds)
04:10:16*spiderstew joined #nim
04:23:38*lritter joined #nim
04:47:01FromDiscord<Yardanico> am I even doing this right 0_0
04:47:04FromDiscord<Yardanico> but looks cool :D
04:47:07FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgF
04:49:40FromDiscord<jfmonty2> hello, is this where to put noob questions?
04:49:47FromDiscord<Yardanico> yeah, sure
04:49:59FromDiscord<Yardanico> we don't have a separate place for "noob" questions, ask all questions in there
04:50:08FromDiscord<jfmonty2> ok, great. So I'm just trying out Nim, seems very cool so far, coming from a mostly Python background
04:50:15FromDiscord<Gary M> The answer is "nil"
04:50:48FromDiscord<ElegantBeef> Nah it's strictly typed is how you dont have silly errors!
04:50:52FromDiscord<Gary M> Hello Beef
04:50:56FromDiscord<ElegantBeef> Yellow
04:51:02FromDiscord<jfmonty2> sent a code paste, see https://play.nim-lang.org/#ix=2TgG
04:51:07FromDiscord<jfmonty2> basically just splitting up what would otherwise be a mondo line
04:51:18FromDiscord<Gary M> Function pointer
04:51:18FromDiscord<jfmonty2> but in Nim, I understand that assigning to a new variable will actually copy
04:51:24FromDiscord<Yardanico> if it's a value type, yes
04:51:29FromDiscord<Yardanico> but for them that's usually fine
04:51:38FromDiscord<ElegantBeef> We do have `{.byaddr.}` though
04:51:39FromDiscord<Yardanico> ref types have ref semantics obviously
04:51:49FromDiscord<jfmonty2> so basically it's just not enough of a performance hit to worry about?
04:52:01FromDiscord<Gary M> For a function pointer? Typically not no
04:52:20FromDiscord<Yardanico> @jfmonty2 for copies - generally no
04:52:28FromDiscord<jfmonty2> Not sure I quite understand function pointer, in this context
04:52:31FromDiscord<Gary M> Or wait that's not a fp is it
04:52:35FromDiscord<Gary M> Thats just a value of a field
04:52:40FromDiscord<jfmonty2> Right, pretty much
04:52:51FromDiscord<Yardanico> also, when testing performance, don't forget to compare with -d:release or -d:danger for release builds (those have to be provided on the CLI, not in config files)
04:52:55FromDiscord<Gary M> Okay. You can technically make it a ref object
04:53:05FromDiscord<jfmonty2> I often just break up long chains of property/method/function-calls at somewhat-arbitrary points, just for readability
04:53:06FromDiscord<Rika> its not usually an issue
04:53:11FromDiscord<ElegantBeef> That's fine
04:53:16FromDiscord<Rika> worry when it gets noticeable πŸ˜‰
04:53:18FromDiscord<ElegantBeef> If you're worried use `byaddr`
04:53:31FromDiscord<jfmonty2> byaddr is a function pragma, right? So you specify it when you define the function?
04:53:33FromDiscord<jfmonty2> er, proc. sorry
04:53:44FromDiscord<Rika> no its just a pragma
04:53:52FromDiscord<Gary M> I think on assignment so you're making it assign by addr
04:53:54FromDiscord<Rika> var a {.byaddr.} = ..
04:53:58FromDiscord<Yardanico> @jfmonty2 https://nim-lang.org/docs/decls.html but really you don't have to worry about copies in most cases
04:54:07FromDiscord<Yardanico> just write your code first :)
04:54:11FromDiscord<jfmonty2> oh, so you can use it for any function call? like `a = seq.pop(); callFunc(a)`?
04:54:17FromDiscord<ElegantBeef> Never worry about performance until it's a problem
04:54:21FromDiscord<Rika> pragmas arent just decorators on crack, theyre much more
04:54:26FromDiscord<jfmonty2> fair enough
04:54:37FromDiscord<jfmonty2> I do have a tendency to go depth-first when learning new things πŸ˜›
04:55:33FromDiscord<Gary M> Unless you're doing some soft-realtime stuff where you have a lot of copies going on every cycle that are hindering performance it's not something to really worry about ever and it's safer than having refs everywhere.
04:55:51FromDiscord<Yardanico> well, it's also faster than having refs everywhere
04:56:02FromDiscord<Gary M> Is it actually faster πŸ˜„
04:56:06FromDiscord<Yardanico> yes of course
04:56:15FromDiscord<Yardanico> nim doesn't do dumb copies of all objects
04:56:16FromDiscord<Rika> adds strain for the gc i believe
04:56:19FromDiscord<Yardanico> if an object is too big the compiler will pass it by reference anyway
04:56:27FromDiscord<Yardanico> automatically
04:56:30FromDiscord<jfmonty2> That's good to know, thanks!
04:56:32FromDiscord<Yardanico> I mean to functions/etc
04:56:38FromDiscord<Gary M> I thought mutating a reference was usually faster than copying
04:56:47FromDiscord<Rika> not in all cases
04:56:49FromDiscord<jfmonty2> I'm not super familiar with memory management stuff (even at the most basic level) coming from dynamic/interpreted languages
04:57:11FromDiscord<Rika> and you dont need to
04:57:17FromDiscord<Yardanico> @Gary M it includes a pointer dereference
04:57:19FromDiscord<Rika> i mean, dynamic languages tend to hide it from you
04:57:21FromDiscord<Yardanico> don't forget that
04:57:25FromDiscord<Gary M> No worries I'm dumb and I get by with Nim lol
04:57:31FromDiscord<Gary M> If I can then so can you
04:57:52FromDiscord<Gary M> Basically just do it the easiest and cleanest way by default and you'll have fun
04:58:06FromDiscord<jfmonty2> sounds good! πŸ‘
04:58:09FromDiscord<ElegantBeef> Idiomatic Nim tends to be very performant
04:58:18FromDiscord<Gary M> Occam's razor or something like that
04:58:18FromDiscord<jfmonty2> That is very reminiscent of python πŸ˜„
04:58:37FromDiscord<Gary M> Yep! With actual performance! Lol
04:58:40FromDiscord<ElegantBeef> ^
04:58:46FromDiscord<Gary M> It's like having cython but for everything you do
04:58:50FromDiscord<ElegantBeef> Idiomatic python is still slow, and will cut you
04:58:56FromDiscord<jfmonty2> Looking forward to that πŸ™‚
04:58:57FromDiscord<Yardanico> yeah ormin seems to be faster than norm
04:58:58FromDiscord<Rika> cython but without the weird ass quirks of cython
04:59:04FromDiscord<Gary M> What is ormin
04:59:10FromDiscord<ElegantBeef> Cython but if it was a good wirth-like language
04:59:11FromDiscord<Rika> orm for nim
04:59:12FromDiscord<Yardanico> shame on your for not knowing!
04:59:13FromDiscord<Yardanico> https://github.com/Araq/ormin
04:59:16FromDiscord<Yardanico> xD
04:59:25FromDiscord<Rika> ha! i got the description almost exact
04:59:29FromDiscord<Gary M> For db's?
04:59:32FromDiscord<Yardanico> yes
04:59:34FromDiscord<Yardanico> i'm starting to really like ormin
04:59:37FromDiscord<Gary M> Neat.
04:59:37FromDiscord<Rika> yeah, what else would an orm do
04:59:43FromDiscord<Gary M> Idk that's why I asked
04:59:44FromDiscord<Yardanico> its simple yet statically checked and stuff
04:59:45FromDiscord<Rika> oh
04:59:46FromDiscord<Rika> ok
04:59:48FromDiscord<Gary M> Geez rika chill sometimes
04:59:54FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgI
04:59:59FromDiscord<Yardanico> the query is checked at compile time
05:00:07FromDiscord<Yardanico> since ormin remembers your DB model and checks against it
05:00:11FromDiscord<Gary M> Oh sql query builder? Nice.
05:00:20FromDiscord<Yardanico> it also does natural joins
05:00:28FromDiscord<Gary M> I've worked with a weird db that is both sql and nosql
05:00:37FromDiscord<Gary M> But does EVERYTHING through http post request
05:00:39FromDiscord<Yardanico> but yeah, I'm not sure if I'm abusing ormin a bit too much
05:00:44FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgF
05:00:56FromDiscord<Rika> i mean it looks fine to me
05:00:57FromDiscord<Gary M> Does that query builder return a string?
05:01:00FromDiscord<Yardanico> nononononono
05:01:03FromDiscord<Yardanico> it doesn't give you strings, never
05:01:07FromDiscord<Yardanico> it does queries by itself
05:01:07FromDiscord<Gary M> Oh :(
05:01:17FromDiscord<Yardanico> it's not just a query builder
05:01:24FromDiscord<Gary M> That's the thing is to use it with http I would need it stringified
05:01:26FromDiscord<Rika> i mean strings are scary when it comes to dbs innit?
05:01:32FromDiscord<Yardanico> very
05:01:46FromDiscord<Rika> shit can easily give you an injection problem
05:02:23FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgL
05:03:29FromDiscord<Yardanico> not much but its honest work https://media.discordapp.net/attachments/371759389889003532/821972052986691664/unknown.png
05:03:46FromDiscord<Rika> if you posted some macro heavy nim code and asked a random programmer what programming language they think it is i wonder what the answers would be
05:04:11FromDiscord<Yardanico> @Rika show them https://github.com/Yardanico/nimpylib/blob/master/tests/tclass.nim
05:04:58FromDiscord<Yardanico> or https://github.com/Yardanico/nimpylib/blob/master/tests/ttonim.nim
05:05:47FromDiscord<Rika> what the FUCK
05:05:52FromDiscord<Gary M> Lol
05:05:55FromDiscord<Yardanico> it's actually really simple to do
05:06:07FromDiscord<Yardanico> since its valid nim syntax :)
05:06:08FromDiscord<Rika> can we ban yardanico
05:06:13FromDiscord<Yardanico> no
05:06:25FromDiscord<DefinitelyNotYardanico> besides, who is yardanico anyway
05:06:29FromDiscord<Rika> this is illegal
05:06:33FromDiscord<Rika> this is banned
05:06:38FromDiscord<Rika> you are a sinner
05:06:57FromDiscord<DefinitelyNotYardanico> just check https://github.com/Yardanico/nimpylib/blob/master/examples/readme.nim to let your soul rest
05:07:14FromDiscord<Rika> im gonna cry
05:07:16FromDiscord<Rika> this is heretic
05:07:22FromDiscord<Gary M> Cool stuff i like
05:07:42FromDiscord<Gary M> Now make one for C
05:07:48FromDiscord<Rika> though the with and context manager style stuff is actually nice
05:07:48FromDiscord<DefinitelyNotYardanico> I even use concepts for the with macro
05:07:50FromDiscord<DefinitelyNotYardanico> https://github.com/Yardanico/nimpylib/blob/master/src/pylib/pywith.nim
05:07:56FromDiscord<Gary M> I want to write valid C in Nim instead of Nim oh wait I'll just use emit
05:08:00FromDiscord<DefinitelyNotYardanico> and its actually really simple too
05:08:02FromDiscord<DefinitelyNotYardanico> the macro I mean
05:08:06FromDiscord<DefinitelyNotYardanico> but it took me a few tries to get there
05:08:21FromDiscord<DefinitelyNotYardanico> ah wait I think it has a bug in it which I didn't fix yet
05:08:31FromDiscord<Rika> In reply to @Gary M "I want to write": inb4 "why tf use nim if u just writing c anyway?!?!??!?!?!?!????"
05:08:41FromDiscord<Rika> lol
05:08:41FromDiscord<Gary M> : P
05:09:15FromDiscord<Gary M> I'm going to attempt to write a buffer allocator from scratch, I hope it doesn't all blow up.
05:09:16FromDiscord<Rika> though legit, nim can do c-style stuff anyway so you shouldnt really need to write C
05:09:23FromDiscord<Rika> oh MAN that sounds intense
05:09:44FromDiscord<Gary M> Maybe, but maybe not? I guess if I'm not handling fragmentation and stuff idk...
05:10:20FromDiscord<Gary M> It's for Vulkan though so I already have some predefined stuff to base it around
05:10:28FromDiscord<Rika> if youre just doing it naiively then sure prolly easy but if you want a good one...
05:10:40FromDiscord<Gary M> Yeah idk yet
05:10:59FromDiscord<Gary M> The naive way should be easy to get things working anyways
05:12:08FromDiscord<Gary M> I think the real "fun" is going to come when I try to generate texture atlases and stuff I have zero information on how those are implemented
05:12:39FromDiscord<Gary M> Especially when they start packing long textures sideways how it sends the correct uv's to the shader fuck
05:13:12FromDiscord<Rika> man's doing the complex shit
05:13:33FromDiscord<Gary M> No no I'm dumb
05:13:40FromDiscord<Gary M> I'm just engineering
05:13:51FromDiscord<Gary M> Implementing ideas not making them
05:14:16FromDiscord<DefinitelyNotYardanico> so with norm i profiled the code and 25% of time was spent in karax with string concatenation (to build the resulting html), with ormin it's 44%
05:14:23FromDiscord<DefinitelyNotYardanico> maybe I should just use SCFs for fun :P
05:14:30FromDiscord<Yardanico> and I mean server-side karax
05:14:44FromDiscord<Gary M> Thread that shit boy idk
05:15:06FromDiscord<Yardanico> hm
05:15:21FromDiscord<Gary M> If you have multiple concats to do split them up via threads
05:15:31FromDiscord<Yardanico> lol wat
05:15:35FromDiscord<Gary M> Idk fuck me
05:15:39FromDiscord<Gary M> Thread it anyways
05:15:41FromDiscord<Yardanico> and the problem is that i have one global DB variable anyway
05:16:01FromDiscord<Yardanico> i mean it's not a "problem"
05:16:07FromDiscord<Gary M> You said the string concats were taking a large amount of time
05:16:13FromDiscord<Yardanico> compared to other runtime, yes
05:16:16FromDiscord<Rika> threads can be slower than sync if your tasks arent intensive enough
05:16:29FromDiscord<Yardanico> and anyway, 13k reqs/sec for a forum is already good
05:16:36FromDiscord<Yardanico> with DB access and all that
05:16:36FromDiscord<Gary M> I'm only saying parallelize it and join the results on the main thread idk?
05:16:38FromDiscord<Rika> good enough for tiny forums
05:16:46FromDiscord<Gary M> I have zero idea what it actually looks like
05:16:47FromDiscord<Rika> which are basically all forums nowadays...
05:17:14FromDiscord<Yardanico> @Gary M first of all, it's in karax, I'll have to change karax quite a lot
05:17:16FromDiscord<Gary M> 13k reqs/second psh I would beat that within a day of launching with how famous I am
05:17:26FromDiscord<Gary M> /s
05:17:29FromDiscord<Yardanico> and then parallelizing string concatenation wouldn't really help
05:17:34FromDiscord<Rika> s↡ss
05:17:40FromDiscord<Rika> snake
05:17:41FromDiscord<Gary M> Big s
05:17:42FromDiscord<Rika> python
05:17:44FromDiscord<Rika> heretic!
05:17:45FromDiscord<Yardanico> @Rika I was replying to a previous message
05:17:47FromDiscord<Gary M> Ohhhh you got me
05:18:23FromDiscord<ElegantBeef> How do i get this to work? https://play.nim-lang.org/#ix=2TgO
05:18:59FromDiscord<Rika> u dont
05:19:00FromDiscord<Gary M> Thread it
05:19:04FromDiscord<Rika> ill take a look
05:19:22FromDiscord<ElegantBeef> Lol i really hope "you dont" isnt the actual response
05:19:44FromDiscord<Gary M> Wouldn't you just make an actual dirty C file at this point lol
05:19:58FromDiscord<Gary M> Stinky stinky C
05:20:07FromDiscord<ElegantBeef> The emited C is provided by the pico sdk
05:20:22FromDiscord<ElegantBeef> I could emit C code that just forwards the Nim call i suppose
05:20:26FromDiscord<Rika> eww beef stinky
05:20:32FromDiscord<Gary M> Lol
05:20:41FromDiscord<ElegantBeef> How dare you Gary
05:20:53FromDiscord<ElegantBeef> Also gary did you see that we've convinced miki to try Nim? πŸ˜„
05:21:24FromDiscord<Rika> do you two know each other' or somehting
05:21:27FromDiscord<ElegantBeef> Yea
05:21:32FromDiscord<ElegantBeef> I got gary into Nim
05:21:33FromDiscord<Rika> best buds aww
05:21:37FromDiscord<Rika> how cute
05:21:48FromDiscord<ElegantBeef> We'll know eachother from another discord
05:21:56FromDiscord<ElegantBeef> Not real life friends or anything
05:22:12FromDiscord<Rika> i was joking lol
05:22:14FromDiscord<Gary M> yeah thankfully
05:22:18FromDiscord<Rika> LMAO
05:22:21FromDiscord<Gary M> stinky Canadians
05:22:39FromDiscord<ElegantBeef> Ah i was going to make a covid joke but you'd probably catch it
05:22:50FromDiscord<Gary M> already did jackass lol
05:22:56FromDiscord<Rika> beef why are you such a pro at being self deprecating
05:22:58FromDiscord<ElegantBeef> ~~That's the joke~~
05:23:14FromDiscord<Gary M> well, hm. I don't know if it landed very well then
05:23:19FromDiscord<Gary M> hard to catch it twice
05:23:20FromDiscord<ElegantBeef> Well cause when you write code as bad as me it's the only way to live
05:23:36FromDiscord<Gary M> haha it's funny because he's making fun of himself
05:23:49FromDiscord<ElegantBeef> Glad you were here cause i wouldve missed the joke
05:24:12FromDiscord<Gary M> you'd probably catch it
05:24:16FromDiscord<Gary M> get it? get it?
05:24:25FromDiscord<Rika> imagine relying on such popular packages and the package creator says that...
05:24:46FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2TgS
05:24:46FromDiscord<ElegantBeef> Rika the main reason is that i just laugh at everything regardless of who it implies
05:25:00FromDiscord<ElegantBeef> What popular packages do i have?
05:25:07FromDiscord<Rika> constructor
05:25:08FromDiscord<Gary M> I thought everyone on github wrote really good clean well-behaving code except me
05:25:25FromDiscord<ElegantBeef> People actually use my code?
05:25:32FromDiscord<Gary M> then I actually looked at some of the libraries I use regularly and geez there's some really stinky things
05:25:34FromDiscord<ElegantBeef> I just assumed by the issues no one used it
05:25:36FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2TgT
05:25:43FromDiscord<ShadowElf37> of what specifically
05:25:44FromDiscord<Rika> In reply to @Gary M "I thought everyone on": everyone believes that
05:25:50FromDiscord<Rika> In reply to @ShadowElf37 "of what specifically": result
05:25:56FromDiscord<ShadowElf37> also sorry for interrupting 😁
05:25:59FromDiscord<Rika> no its fine
05:26:04FromDiscord<Rika> we're just fucking around at this point
05:26:05FromDiscord<ElegantBeef> It's fine we werent talking about anything important
05:26:21FromDiscord<Gary M> yeah only talking about beef
05:26:27FromDiscord<Rika> lmao
05:26:55FromDiscord<ElegantBeef> Damn if i could read i'm sure i'd be offended
05:27:25FromDiscord<Gary M> good thing you read'nt
05:27:29FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2TgU
05:27:31FromDiscord<ShadowElf37> hmmmm πŸ€”
05:27:47FromDiscord<ShadowElf37> i love how it does that
05:27:47FromDiscord<Gary M> readn't
05:28:08FromDiscord<ElegantBeef> Looks like you should just throw the macro + example on nim-playground
05:28:15*haxscramper joined #nim
05:28:25FromDiscord<ShadowElf37> ok give me a sec
05:31:29FromDiscord<ShadowElf37> https://play.nim-lang.org/#ix=2TgW
05:31:33FromDiscord<ShadowElf37> should be everything
05:37:32FromDiscord<ElegantBeef> The issue seems to be that it's doing `prefix` instead of `call`
05:37:51FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2TgX
05:37:53FromDiscord<ElegantBeef> Compiles
05:39:22FromDiscord<ShadowElf37> well
05:39:25FromDiscord<ShadowElf37> cool
05:39:42FromDiscord<ShadowElf37> lol
05:40:04*gangstacat quit (Quit: Ĝis!)
05:47:15*gangstacat joined #nim
05:49:35FromDiscord<ShadowElf37> actually that wasnt the issue
05:49:45FromDiscord<ShadowElf37> it was when you removed expandMacros
05:50:00FromDiscord<ElegantBeef> Yea just do `echo result.repr`
05:50:27FromDiscord<ShadowElf37> interesting ill keep that in mind
06:05:49*acidx quit (Ping timeout: 260 seconds)
06:06:04*acidx joined #nim
06:06:18FromDiscord<Yardanico> apparently my stupidish "forum" is 50% faster with orc than with refc (single threaded)
06:06:26FromDiscord<Yardanico> that's karax + sqlite queries + jester
06:06:37FromDiscord<ElegantBeef> Damn i can spam my packages even faster?
06:06:49FromDiscord<Yardanico> sorry 42%
06:07:07FromDiscord<ElegantBeef> Damn that's only ~80% of the promised increase
06:07:09FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Th5
06:07:10FromDiscord<Yardanico> and no leaks
06:07:12FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Th6
06:07:19FromDiscord<Yardanico> you can see that the latency is ~3ms lower
06:07:45FromDiscord<Gary M> nice
06:16:28*tiorock joined #nim
06:16:28*tiorock quit (Changing host)
06:16:28*tiorock joined #nim
06:16:28*rockcavera quit (Killed (beckett.freenode.net (Nickname regained by services)))
06:16:28*tiorock is now known as rockcavera
06:20:48*narimiran joined #nim
06:20:55*a_chou joined #nim
06:22:34*waleee-cl quit (Quit: Connection closed for inactivity)
06:27:31FromDiscord<ElegantBeef> So the arm compiler disagrees with my code
06:27:41saemrude
06:28:21FromDiscord<ElegantBeef> You're telling me, it's telling me conflicting types for a bunch of procedures, even though they match the C procs 1:1 as far as i can tell
06:29:45FromDiscord<ElegantBeef> Why does `attribute ((weak))` exist!
06:32:29FromDiscord<ElegantBeef> Thought i could be smart with emit, but nope so i guess i take a 4th shot at attempting to get these silly C callbacks to register
06:33:37*a_chou quit (Quit: a_chou)
06:37:00FromDiscord<ElegantBeef> Oh `codegendecl` exists
06:44:07FromDiscord<ElegantBeef> Is there a way to temporarily disable the dead code elimination?
06:44:41FromDiscord<Gary M> push pop something?
06:44:55FromDiscord<Gary M> : P
06:44:59FromDiscord<ElegantBeef> the issue being i cannot find the flag
06:47:45FromDiscord<Yardanico> @ElegantBeef no, dead code elimination is always enabled regardless of compiler options
06:47:53FromDiscord<Yardanico> for consistency so debug vs release builds don't give different results
06:47:58FromDiscord<Yardanico> why would you ever want to disable it?
06:48:07FromDiscord<Yardanico> also I guess you can try the {.used.} pragma but idk if it will work
06:48:13FromDiscord<ElegantBeef> Cause i need it to emit these weakly bound C procedures
06:48:14FromDiscord<Gary M> so this `--deadCodeElim=off` would do nothing?
06:48:19FromDiscord<Yardanico> yes
06:48:27FromDiscord<Gary M> yikes
06:48:34FromDiscord<Yardanico> it's a good thing though
06:48:47FromDiscord<Yardanico> and it has been that way since 0.19.0
06:49:00FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_0_19_0.md#compiler-changes The deadCodeElim option is now always turned on and the switch has no effect anymore, but is recognized for backwards compatibility.
06:49:17FromDiscord<Yardanico> i don't really get why people still include it in their configs
06:49:22FromDiscord<Yardanico> it's been a nop for a long time
06:49:54FromDiscord<Gary M> no deprecation warnings in configs
06:50:20FromDiscord<Yardanico> there is though
06:50:31FromDiscord<Yardanico> command line(1, 2) Warning: 'deadCodeElim' is deprecated, now a noop [Deprecated]
06:50:35FromDiscord<Gary M> then people are ignorant?
06:50:41FromDiscord<Yardanico> yes
06:50:51FromDiscord<Yardanico> ah actually no, that change was introduced recently
06:50:56FromDiscord<Yardanico> the one to show the warning
06:51:01FromDiscord<Gary M> 😠
06:51:07FromDiscord<Yardanico> why are you mad
06:51:19FromDiscord<Gary M> uh I'm not mad
06:51:28FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/821999224882200586/unknown.png
06:51:43FromDiscord<Gary M> don't take that at face value πŸ˜„
06:51:58FromDiscord<Gary M> I might not be smiling in real life either!!
06:52:36*mwbrown quit (Ping timeout: 240 seconds)
06:52:52saemfun sysprof works pretty nicely
06:59:43FromDiscord<ElegantBeef> Nice
06:59:51FromDiscord<ElegantBeef> I'm one procedure away from having it possibly compile
07:02:29FromDiscord<Rika> Congrats
07:02:38FromDiscord<Rika> Also isn’t there a used pragma
07:02:56FromDiscord<ElegantBeef> Eh i needed to exportC anyway apparently so it's fine
07:51:02*mwbrown joined #nim
07:52:46*fredrikhr joined #nim
07:59:16*superbia joined #nim
08:11:38*sixtyten joined #nim
08:26:26*PMunch joined #nim
08:26:52*Tanger quit (Quit: Leaving)
08:41:13*sixtyten quit (Quit: Leaving)
08:49:01*Jesin quit (Ping timeout: 276 seconds)
09:30:37*vicfred quit (Quit: Leaving)
09:47:52*superbia quit (Quit: WeeChat 3.1)
10:23:53PMunchIs there a way to ensure that a type doesn't leak to runtime?
10:25:01PMunchFor example in my keyboard firmware code I have Pin definitions that contains port and number, and I use macros to build the statements to switch them. So these definitions should never be pushed to runtime by accident.
10:35:40liblq-devPMunch: put it in a static block?
10:46:08*Jesin joined #nim
10:50:11PMunchThe type definition?
10:50:16PMunchOr the const part?
11:01:28*jholland__ quit (Quit: Connection closed for inactivity)
11:05:57PMunchStatic block around the const doesn't work: https://play.nim-lang.org/#ix=2ThY
11:15:48ForumUpdaterBotNew thread by Mrhdias: How do I share a hash table among multiple processes to store temporary http sessions?, see https://forum.nim-lang.org/t/7655
11:23:58*Vladar joined #nim
11:39:35*antranigv quit (Ping timeout: 240 seconds)
12:04:37*rockcavera quit (Read error: Connection reset by peer)
12:05:10*rockcavera joined #nim
12:12:38*antranigv joined #nim
12:35:11*haxscramper quit (Remote host closed the connection)
12:36:32FromDiscord<Livingstone> sent a code paste, see https://paste.rs/gvC
12:36:50FromDiscord<Livingstone> can someone help me understand this error
12:36:51FromDiscord<Livingstone> https://play.nim-lang.org/#ix=2Tio
12:38:19FromDiscord<Zachary Carter> you're trying to use the subscript operator on a collection with fewer than 100 elements
12:38:50FromDiscord<Zachary Carter> so you're trying to access the element at index 100 in some collection that doesn't have 101 or more elements in it
12:39:05FromDiscord<Zachary Carter> also referred to as an out of bounds exception
12:39:33FromDiscord<Zachary Carter> the subscript operator is `[]`
12:40:42FromDiscord<Zachary Carter> https://play.nim-lang.org/#ix=2Tiq will result in the same error
12:42:42FromDiscord<Zachary Carter> so in your example code `predicted` or `actual` don't hold the same number of elements - predicted probably has less elements than actual
12:43:11FromDiscord<Zachary Carter> (edit) "or" => "and"
12:43:29FromDiscord<Zachary Carter> but you're iterating over both collections using the same range on line 45
12:43:55FromDiscord<Zachary Carter> @Livingstone I hope this explanation helps you
12:44:30FromDiscord<Livingstone> ah ok
12:51:22FromDiscord<Livingstone> In reply to @Zachary Carter "you're trying to use": yeah I got it thanks
12:57:24FromDiscord<Livingstone> In reply to @Zachary Carter "you're trying to use": How did you identify which one was the problem?
13:02:32FromDiscord<Zachary Carter> By looking at the for loop
13:02:59FromDiscord<Zachary Carter> the high end of your range is the length of actual
13:03:08FromDiscord<Zachary Carter> so it must be predicted then right?
13:06:36FromDiscord<Livingstone> I fixed the problem by changing line 69 to actual.add(row[^1]) though
13:07:41FromDiscord<Zachary Carter> okay so now actual has less elements in it right?
13:08:05FromDiscord<Livingstone> does it I thought that just added the last element
13:08:08FromDiscord<Livingstone> of row
13:08:27FromDiscord<Zachary Carter> I don't know - I don't have your source input files and I really haven't dug through your code too much
13:08:38FromDiscord<Zachary Carter> I just looked at the error and I know what causes that error and I was positing what the problem might be caused by
13:08:45FromDiscord<Zachary Carter> I can't step through your program
13:09:58FromDiscord<Livingstone> the file is just 100 pairs of random numbers
13:19:02*Vladar quit (Quit: Leaving)
13:20:07ForumUpdaterBotNew thread by Kcvinu: Some suggestions about Nim play gorund and Nim forum., see https://forum.nim-lang.org/t/7656
13:20:45FromDiscord<Zachary Carter> Yeah, sorry I just don't have time to debug and step through your program. The error's cause though is what I identified earlier. I can't reason about your application state without spending more time on the problem and I'm at work atm.
13:22:33*lritter quit (Ping timeout: 256 seconds)
13:27:13FromDiscord<Livingstone> In reply to @Zachary Carter "Yeah, sorry I just": you don't have to I was just adding that in case it was relevant
13:27:50FromDiscord<Livingstone> do you know of a way to select a random number from a range in nim?
13:29:50FromDiscord<Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2TiB
13:29:59FromDiscord<Zachary Carter> sample will also work on an array
13:33:23*rockcavera quit (Remote host closed the connection)
13:39:59FromGitter<ynfle> @Livingstone https://play.nim-lang.org/#ix=2TiF the rand (https://nim-lang.org/docs/random.html#rand%2CHSlice%5BT%3A+Ordinal+or+float+or+float32+or+float64%2CT%3A+Ordinal+or+float+or+float32+or+float64%5D) takes a range
13:47:43*xet7 quit (Quit: Leaving)
13:48:51Clonkk[m]I didn't know Britney Spears wrote documentation for Nim https://nim-lang.org/docs/idetools.html
13:49:20PMunchHuh?
13:49:27PMunchOh, the Author..
13:50:30PMunchApparently it has said that since it was created
13:51:06FromDiscord<Rika> LMAO
13:52:18PMunchNot sure if it was migrated from somewhere else though
13:53:55Clonkk[m]Some language are backed by Google or Mozilla; Nim is backed by early 2000's pop stars.
13:56:22FromDiscord<Rika> lmao
13:57:20PMunchWould be great if some reporter managed to contact her and ask her about it :P
13:57:34PMunchWasn't there a movie that just came out about her?
13:58:21PMunchImagine an interview around that and someone asked, "back in 2013 you wrote a document named IDE tools integration for the Nim project, how do you feel this influenced your career?"
14:01:00FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2TiO
14:02:50FromDiscord<Livingstone> why doesnt dataset.delete(dataset[1]) work?
14:03:02FromDiscord<Livingstone> (edit) "why doesnt dataset.delete(dataset[1]) ... work?" added ")"
14:04:36FromDiscord<Rika> you dont pass the element, you pass the index
14:09:16FromDiscord<Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2TiP
14:10:16*joast joined #nim
14:11:28FromDiscord<Livingstone> does this make sense?
14:14:23FromDiscord<Rika> pretty sure yea
14:14:52*lritter joined #nim
14:19:06Clonkk[m]Is there a way to concatenate the documentation of difference Nim files in one html result file (instead of having links to it import section) ?
14:19:11Clonkk[m]Using nim doc
14:22:02*Prestige quit (Quit: Prestige)
14:23:34*Prestige joined #nim
14:34:58*lritter quit (Ping timeout: 260 seconds)
14:50:29*haxscramper joined #nim
14:51:43FromDiscord<Goel> sent a long message, see http://ix.io/2Tj7
14:53:58FromDiscord<Rika> https://nim-lang.org/docs/colors.html
14:54:33FromDiscord<Rika> will need to convert but i believe theres a proc for that too
14:58:27FromDiscord<Goel> Initially i was thinking to just replace entirely the OpenGL glClearColor with a Nim procedure that does the same, since the RGBA procedure shows there, only accepts float between 0.0 and 1. Doing that in Nim would be a lot better, but i don't think i can replace entirely that procedure into GLFW? Since GLFW is based on OpenGL... well i'll try anyway, thanks
15:00:12*shmorgle quit (Quit: [TalkSoup] via NEXTSPACE)
15:03:14*shmorgle joined #nim
15:06:19*PMunch quit (Quit: leaving)
15:13:00FromDiscord<whisperdev> What is the regex engine for Nim? I want this: https://regex101.com/r/szMSw6/1 but it does not work: https://play.nim-lang.org/#ix=2Tju
15:16:26narimiran@whisperdev can you be more specific about "does not work"?
15:18:11FromDiscord<whisperdev> @nariminar: to me it looks like match groups dont match.
15:18:19FromDiscord<whisperdev> if you click on the links I pasted
15:18:29narimirani did click
15:18:41narimirannim version doesn't print a group, but a match
15:19:01FromDiscord<whisperdev> I just want the test_website--production
15:22:43FromDiscord<whisperdev> I am not really proficient with regexes I use cheat sheet for that πŸ˜„
15:23:21narimiranthen i would suggest `strscans.scanf` - easier to understand and easier to use
15:25:47FromDiscord<whisperdev> But you can see that the regexes dont match right?
15:25:49FromDiscord<whisperdev> Or..?
15:26:02narimiranit is not that they don't match
15:26:29narimiranyou want a group (stuff inside of `(...)`), and you're given the full match
15:27:33narimiranhere's the scanf version with the stuff you want: https://play.nim-lang.org/#ix=2Tjz
15:30:52*tane joined #nim
15:33:20*xet7 joined #nim
15:33:48*wasted_youth2 joined #nim
15:34:15FromDiscord<whisperdev> Thanks I guess?
15:34:26FromDiscord<whisperdev> So what do I need to look for in these regex implementations?
15:34:38FromDiscord<whisperdev> I was looking to use the pure nim implementation from nitely
15:34:47FromDiscord<whisperdev> But decided to try with the stdlib one first
15:34:54FromDiscord<Rika> re is based on pcre
15:34:57FromDiscord<whisperdev> just to play around with the regexes
15:37:42FromDiscord<clyybber> In reply to @Clonkk "I didn't know Britney": lmao what
15:40:20Prestige@whisperdev https://play.nim-lang.org/#ix=2TjE
15:40:35Prestigesee https://nim-lang.org/docs/re.html#%3D~.t%2Cstring%2CRegex
15:42:58FromDiscord<exelotl> In reply to @Clyybber "lmao what": tox ic intensifies https://aurensnyder.bandcamp.com/track/tox-ic
15:43:49narimiran@whisperdev, Prestige is there a reason why the pattern isn't just a simple `"(.+)"`?
15:44:06FromDiscord<Rika> greedy
15:44:12FromDiscord<Rika> prolly wants lazy
15:44:14PrestigeI just copied his, could just .+?
15:44:15FromDiscord<Rika> so .+?
15:57:05*superbia joined #nim
16:04:12FromDiscord<jfmonty2> In what circumstances can parentheses be left off a proc call? From testing it seems like the following are true:↡- when using method-call syntax, at the end of an expression and with one or fewer additional arguments↡- otherwise, only at the end of an expression and with _exactly_ one argument
16:04:54FromDiscord<jfmonty2> so a single identifier like `someproc` can never be treated as invoking `someproc`, only a reference to it, but `someproc 3` or `3.someproc` will
16:05:32FromDiscord<jfmonty2> Are there other situations I'm missing? I looked in the manual but there doesn't seem to be a section that lays this out, it only mentions briefly that parens may be left off with method syntax
16:07:51FromDiscord<zetashift> Those are all the ones I know of too
16:09:06FromDiscord<zetashift> https://github.com/disruptek/disruptek/blob/master/style.md#method-call-syntax-command-syntax-function-call-syntax here are some more
16:09:23FromDiscord<zetashift> I feel like this question comes up every now and then, enough to warrant some FAQ about it maybe?
16:09:44*fredrikhr quit (Quit: Client Disconnecting)
16:09:45FromDiscord<zetashift> Probably not THE Nim faq but just a more general one?
16:16:35FromDiscord<KnorrFG> i write a library, that uses sdl2. sdl2 has a type point. My library has one too. If a file imports my library, but not sdl2, and uses the Point class, the compiler wants me to specify whether i mean my point or the sdl one, even though i dont export the symbol from sdl2. is there a way to prevent this?
16:18:05FromGitter<gogolxdong> Is it possible to borrow this `https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_object_value` to solve cycle reference when using --gc:arc?
16:23:00Clonkk[m]<FromDiscord "<KnorrFG> i write a library, tha"> If you have a type point in both module1 and module2 you can specify which to use with ``module1.Point``
16:23:28FromDiscord<Rika> In reply to @KnorrFG "i write a library,": i believe that shouldnt happen...
16:26:44FromDiscord<Yardanico> @gogolxdong this is not related at all really
16:27:06FromDiscord<Yardanico> Nim already does cycle detection at compile time, but that only works for simple cafes
16:27:11FromDiscord<Yardanico> (edit) "cafes" => "cases"
16:27:18FromDiscord<Yardanico> Otherwise we wouldn't have needed ORC
16:31:21FromDiscord<Yardanico> one thing which was already proposed is to add some kind of logging to ORC to tell you which types are cyclic at runtime
16:35:03FromDiscord<Zachary Carter> The forum should prevent you from posting if you're not logged in
16:35:39FromDiscord<Zachary Carter> like get rid of the entire reply area and have some kind of warning saying log in to post or something
16:35:47FromDiscord<Zachary Carter> tired of typing out replies and then realizing I'm not logged in lol
16:36:00FromDiscord<Zachary Carter> and then the page posting back and me losing my reply
16:38:12FromDiscord<Rika> copy it first then log in
16:38:16FromDiscord<Rika> then paste
16:39:47FromDiscord<Zachary Carter> I mean yes but it's annoying
16:39:59FromDiscord<Zachary Carter> why even give the option to post if you're just going to make me log in?
16:52:45*hed0n1st joined #nim
16:55:24*hed0n1st quit (Client Quit)
17:00:58FromDiscord<Yardanico> In reply to @Zachary Carter "The forum should prevent": You don't lose the reply though
17:01:15FromDiscord<Yardanico> Since Nim forum is SPA you can login with your reply in the field and it'll still be there
17:01:22FromDiscord<Yardanico> I just tried
17:01:59*waleee-cl joined #nim
17:06:43*vicfred joined #nim
17:27:57FromDiscord<jfmonty2> sent a code paste, see https://play.nim-lang.org/#ix=2Tki
17:29:15FromDiscord<jfmonty2> (edit)
17:29:36FromDiscord<jfmonty2> (edit)
17:33:55*Vladar joined #nim
17:35:51FromDiscord<konsumlamm> not sure, but as a workaround, you can explicitly cast the first element: `var a: array[0..2, 0..99] = [range[0..99](23), 47, 58]`
17:41:53FromDiscord<jfmonty2> that seems fairly reasonable, thanks
18:16:11*hyiltiz quit (Quit: No Ping reply in 210 seconds.)
18:35:54*Wezl joined #nim
18:36:45WezlI have a friend who keeps recommending nim to me, what are some good counter-arguments?
18:39:49PrestigeOnce you use Nim you won't enjoy programming in other languages. Does that count?
18:40:01Wezlno
18:40:07PrestigeWell I'm all out
18:40:22Wezlis there a better place to ask?
18:40:47PrestigeOn why you shouldn't use Nim? Idk, #rust?
18:45:21*krux02 joined #nim
18:48:45*hyiltiz joined #nim
18:48:45*hyiltiz quit (Changing host)
18:48:45*hyiltiz joined #nim
18:50:45*liblq-devel joined #nim
18:52:52FromDiscord<konsumlamm> most people there probably don't know Nim though
18:53:25Wezlperhaps they'll support my argument more then ::)
18:54:23Wezldoes nim have any keywords (alphanumeric words built-in to the lexer)?
18:57:02Prestigehttps://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords ?
18:58:54WezlI don't know whether I should be happy or sad now that I have that as an argument, but thanks
18:59:20FromDiscord<dom96> Wezl: what's your language of choice?
18:59:49Wezldom96: lisp, scheme, my own version of lisp
19:02:53Wezl(at least there's stropping, an improvement over most languages)
19:06:20FromDiscord<exelotl> Wezl: The ecosystem is immature in lots of areas (e.g. I can't recommend Nim at work because there is only 1 decent ORM which is pretty new and doesn't support MySQL). There are problems with tooling (nimsuggest is notorious for getting stuck and using 100% CPU) - improving that is one of the main goals for this year I think.
19:07:29WezlI can't say lisp is better there :(
19:11:01FromDiscord<Yardanico> apparently now `` works in github issue titles https://media.discordapp.net/attachments/371759389889003532/822185336720326706/unknown.png
19:11:15PrestigeNice
19:11:53FromDiscord<exelotl> woahhh
19:12:06FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/822185608821997568/unknown.png
19:12:09FromDiscord<Yardanico> took them long enough
19:13:03Wezloh, one of my other arguments against nim is that it's on github
19:13:23FromDiscord<Yardanico> where would you prefer it to be?
19:13:43FromDiscord<Yardanico> having it on github allows for wider audience and it's easier for contributors since github is the most popular
19:13:45Wezlgitea or sr.ht
19:13:56FromDiscord<Yardanico> that'll raise up the bar for contributions sadly
19:14:18Wezl"took them long enough" is not a problem elsewhere (on a floss hoster)
19:15:40FromDiscord<Yardanico> I didn't say that it's such a big issue
19:15:42FromDiscord<Yardanico> it's just nice to have
19:16:35Wezlright, but what if github thinks you infringed on some copyright, or something?
19:16:46FromDiscord<Yardanico> we don't infringe on copyright
19:17:04FromDiscord<Yardanico> and yes I know the debates of self-hosted vs centralized, and really in most cases it's not worth the hassle
19:17:14Wezlthat's not my point, it just matters if MS thinks you do
19:17:17FromDiscord<Hi02Hi> In reply to @Wezl "(at least there's stropping,": do you mean something like https://nim-lang.org/docs/manual.html#lexical-analysis-stropping ?
19:17:17FromDiscord<Yardanico> so in addition to maintaining the software itself you have to maintain your instance
19:17:23FromDiscord<Yardanico> @Wezl it's not related to MS
19:17:29FromDiscord<Yardanico> it's about US' DMCA laws
19:17:50Wezlyou can use a gitea hosted outside of the US
19:18:03WezlHi02Hi: yes
19:18:12FromDiscord<zidsal> surley we should cross that bridge if it becoems an issue? git is decentralised after all
19:18:22FromDiscord<zidsal> until then why wouldn't you use github?
19:18:26FromDiscord<haxscramper> If I have `ShellVar` type and I want to create `=` operator to assign form other type (like ``proc `=`(b: int, c: float) = discard``) I'm out of luck and there is a completely no way around that right?
19:18:30FromDiscord<Yardanico> @zidsal exactly
19:18:41FromDiscord<Yardanico> @Wezl anyway, I don't think it's worth the effort
19:18:50FromDiscord<Yardanico> it'll make nim harder to contribute to, and harder to discover for other people
19:18:53FromDiscord<haxscramper> I want to have something like `$$VARNAME = "true"` syntax for assigning environment variables,
19:19:07Wezlbut it doesn't really help because you could put an underscore at the beginning instead of stropping
19:19:36Wezlhaxscramper: and you can do that with lisp :) search 'setf defmethod lisp' or smt like that
19:19:41FromDiscord<dom96> the problem is that the issue tracker isn't decentralised
19:19:48FromDiscord<Yardanico> surely there are tools to mirror it to somewhere
19:19:50FromDiscord<Yardanico> or just to backup
19:20:06FromDiscord<dom96> lol
19:20:09Wezlalso there are problems with discord, but that's not necessarily relevant to nim
19:20:11FromDiscord<dom96> there are tools to mirror svn too
19:20:26FromDiscord<Yardanico> @Wezl for that exact reason we maintain a bridge
19:20:29haxscramperWezl: sadly lisp can't do types for the most part (at least when comes to not some ultra-obscure dialect that literally sinle person knows about), so I'd stick with nim
19:20:39FromDiscord<Yardanico> but most people have started to prefer discord over the last few years
19:21:44Wezlhaxscramper: evidence? sbcl has many optimization options and most lisps have at least basic (declare)s
19:22:27FromDiscord<Yardanico> but still it's not _mandatory_
19:22:57Wezl(though lisp doesn't place efficiency above expressiveness)
19:23:08WezlYardanico: I don't think it should be
19:23:26Wezl(oh, I thought you meant type annotations)
19:24:18Wezl(sbsl is not an obscure dialect at all btw)
19:24:22Wezl*sbcl
19:24:31FromDiscord<Yardanico> yeah I know that sbcl is one of the most commonly used CL impls
19:28:51haxscramperYes, my point is - in SBCL is is opt-in feature that I can learn by reading one of the couple articles like https://medium.com/@MartinCracauer/static-type-checking-in-the-programmable-programming-language-lisp-79bb79eb068a So it is not a part of a core language, and so it has worse ergonomisc etc. Of course you can use macros to solve ergonomics problem, but for example I couldn't find (quickly) a way to do function overloading ('sbcl
19:28:51haxscramperfunction overloading' returns results that are not particularly relevant (I think if there is 8.7k results it is safe to say feature is basically used by nobody))
19:29:02haxscramperAnd other nice parts of built-in static type system
19:29:21ForumUpdaterBotNew thread by Kiloneie: Nim SDL2 Game Development for Beginners #3 Adding AABB Rectangular Collision Detection, see https://forum.nim-lang.org/t/7657
19:29:35Wezlsearch for 'CLOS defgeneric'
19:30:12FromDiscord<Kiloneie> https://youtu.be/xjIjyMiJIF8
19:30:24Wezla truly flexible language does things like miniknren effortlessly
19:30:27FromDiscord<Kiloneie> (i can't post on reddit... it's all greyed out D:...)
19:30:44Wezl(and maybe a "truly flexible language" could include nim)
19:31:09haxscramperYou mean http://minikanren.org/?
19:31:14Wezlyes
19:31:45*liblq-devel quit (Quit: WeeChat 3.1)
19:32:38jfondren[m]eh there are Go, OCaml and Rust implementations there, so Nim's just a matter of interest
19:32:58PrestigeI find Wezl's use of parens entertaining
19:33:28WezlI'll take that as a compliment, but why?
19:34:03PrestigeJust because you're into lisp and use a lot of parens
19:34:40WezlI use parentheses for side notes, lisp uses parentheses to show functionality
19:35:23Wezl(as a side note: why does nim place efficiency over expressiveness and elegance?)
19:35:48narimiran(can one reply to a side note in a regular comment?)
19:35:49Wezl* side question
19:36:16FromDiscord<Kiloneie> Why can't i post in r/nim ?
19:36:27haxscramperWell, after using emacs for 4+? years, (== seveal years of lisp experience) I would say that nim wins when it comes to expresiveness
19:36:42haxscramperemacs lisp is quite bad dialect overall though
19:36:52Wezl(narimiran: yes, though I'm not sure if it's good style (:)) too)
19:36:53*jess quit (Quit: update innit)
19:37:30narimirani.might(start) answering.like(this)
19:37:40Wezlew
19:38:09Wezlno offense, but that's the wrong way to do OOP
19:38:25*j joined #nim
19:38:30haxscramperIt is just UFCS for function calls, no OOP was involved here
19:38:44FromDiscord<Yardanico> shh, don't tell them
19:39:05WezlI still prefer smalltalk's syntax
19:40:34FromDiscord<Kiloneie> Please retweet Nim overlords mah video D:
19:40:35FromDiscord<Yardanico> btw #nim-offtopic exists, just saying :P
19:41:00FromDiscord<Goel> @DefinitelyNotYardanico For how long does it stay the https://play.nim-lang.org/ link once generated? Or that code is saved somewhere?
19:41:02narimirannot only it exists, it uses lisp-like hypen in its name!
19:41:13FromDiscord<Yardanico> @Goel nim playground uses ix.io
19:41:16*j is now known as jess
19:41:18FromDiscord<Yardanico> and it saves for a very long time
19:41:37Wezlnarimiran: what does?
19:41:38FromDiscord<Yardanico> http://ix.io/
19:41:46FromDiscord<Yardanico> @Wezl #nim-offtopic
19:42:30Wezlwell that's because IRC is nice, I can't possibly admit that nim would be inspired by lisp :P
19:50:57*Gustavo6046 quit (Ping timeout: 265 seconds)
19:52:59*Gustavo6046 joined #nim
19:54:57FromGitter<bung87> how to get unix-like os release name ?
19:56:53FromGitter<bung87> equals to `os.release()` in nodejs
19:57:40FromDiscord<jfmonty2> `uname -r`?
19:57:55FromDiscord<jfmonty2> on linux at least
19:58:03FromDiscord<jfmonty2> gives you the kernel version
20:02:06FromGitter<bung87> any other way that dont need call cmd?
20:03:25FromDiscord<Yardanico> For Linux you can use https://man7.org/linux/man-pages/man2/uname.2.html
20:03:31FromDiscord<Yardanico> Not sure if other nix's support this syscall
20:05:32FromGitter<bung87> Thanks that's what I need
20:15:40*sz0 joined #nim
20:25:53FromDiscord<brainproxy> Nim's sharedtables warns Use plain old non GC'ed keys and values or you'll be in trouble, makes sense.↡↡is `tuple[pointer, pointer]` a safe value type in that respect?
20:26:35FromDiscord<Yardanico> well, it's safe as in you can have them in a shared table
20:26:44FromDiscord<Yardanico> but it's up to you to not do bad things with those pointers
20:26:46FromDiscord<brainproxy> I mean is the tuple subject to GC?
20:26:49FromDiscord<brainproxy> In reply to @Yardanico "but it's up to": sure
20:30:15ForumUpdaterBotNew post on r/nim by Ericarthurc: How to be better... at coding in general?, see https://reddit.com/r/nim/comments/m7zwg3/how_to_be_better_at_coding_in_general/
20:30:34FromDiscord<Kiloneie> reddit works !.
20:30:46*Wezl left #nim ("ping me on #concurr")
20:32:15ForumUpdaterBotNew post on r/nim by Kiloneie: Nim SDL2 Game Development for Beginners #3 Adding AABB Rectangular Collision Detection, see https://reddit.com/r/nim/comments/m7zy3d/nim_sdl2_game_development_for_beginners_3_adding/
20:37:28PrestigeNice Kiloneie
20:37:40FromDiscord<Kiloneie> Thanks πŸ™‚
20:38:58*narimiran quit (Ping timeout: 260 seconds)
20:40:18ForumUpdaterBotNew thread by Lhupfeldt: Regex not hashable?, see https://forum.nim-lang.org/t/7658
20:52:39FromDiscord<Kiloneie> @narimiran can't @ you here, but could you pretty please retweet my video, i have tagged nim_lang, if you are still awake πŸ˜›
20:55:41FromDiscord<Yardanico> wdym "can't @", he was pinged anyway (if he's online)
20:55:58FromDiscord<Yardanico> but seems like he's not
20:56:05FromDiscord<Yardanico> he's not around
20:56:08FromDiscord<Kiloneie> well discord doesn't find him
20:56:11FromDiscord<Yardanico> (I just checked in IRC)
20:56:14FromDiscord<Yardanico> well of course because he's in IRC
20:56:28FromDiscord<Yardanico> There's no way to add ability to auto-complete IRC users from Discord sadly
20:56:37FromDiscord<Kiloneie> oh well, tomorrow then
20:57:03FromDiscord<Kiloneie> can't wait for 1000 subs YT program one day already D:
20:59:28FromDiscord<zidsal> @haxscramper a while ago you asked if it there was a way to make a staticTry so you can assert that a macro throws an exception in a test. Did you ever figure out a way to do that?
21:01:34FromDiscord<haxscramper> No, though if I'm not mistaken I've seen a note in changelog that exceptions are supported for nimscript target (don't remember if it was 1.4.4 or 1.4.0. Or it is just my bad memory and there was no such thing)
21:02:15FromDiscord<zidsal> ok. I guess I could use testament and check the stdout but that feels evil πŸ˜›
21:02:34FromDiscord<haxscramper> But in the end I tested it by adding `when` and just checking for errors visually, so testament might be a fine solution
21:02:42*Prestige is now known as prestigebot
21:03:23FromDiscord<zidsal> fair enough my only qualm with testament is that it means I'll need to hack at the nim test task but that's not the end of the world
21:04:30*prestigebot is now known as Prestige
21:14:26*xet7 quit (Remote host closed the connection)
21:20:20FromDiscord<King Crimson> Is reading lines from stdin broken, because it keeps waiting for input if i pipe data from another application.
21:21:05FromDiscord<Yardanico> can you show the code?
21:21:19FromDiscord<sealmove> I am trying to setup github workflows for autogenerating documentation on push with `nim doc2 myfile.nim`
21:22:03FromDiscord<sealmove> I use the ubuntu image, but when I download nim with apt-get it downloads an old version which doesn't work with my project
21:22:04*haxscramper quit (Remote host closed the connection)
21:22:35FromDiscord<sealmove> what are my options? :s
21:23:10FromDiscord<zidsal> so you'll ever need to tell apt-get about another repository that has a later version of nim, or use choosenim, or curl and build nim yourself
21:23:37FromDiscord<sealmove> but won't this take a lot of time?
21:23:54FromDiscord<Yardanico> @sealmove wait, did you actually use apt-get's nim before?
21:23:54FromDiscord<Yardanico> wtf
21:23:58FromDiscord<zidsal> building it would, I don't think choosenim is going take any longer then an apt-get
21:24:02FromDiscord<Yardanico> testing with latest nim takes like 7s on github actions CI
21:24:15FromDiscord<zidsal> is it really an issue if the action takes 2-3 seconds more?
21:24:24FromDiscord<Yardanico> https://github.com/nim-lang/Nim/wiki/BuildServices#github-actions
21:24:42FromDiscord<sealmove> no, 2-3 seconds is not a problem of course :P
21:25:06FromDiscord<sealmove> ohhh this is a nice page, thanks!
21:25:28FromDiscord<Yardanico> its really fast since I suspect github does github-wide caching
21:26:15FromDiscord<zidsal> they would be mad not to
21:29:56FromDiscord<King Crimson> sent a code paste, see https://play.nim-lang.org/#ix=2TlR
21:30:08FromDiscord<Yardanico> huh, why selectors?
21:30:17FromDiscord<Yardanico> reading from piped input doesn't need selectors really
21:30:29FromDiscord<King Crimson> Dunno, new to nim
21:30:57FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TlS
21:31:39PrestigeAnyone familiar with the irc module? I'm trying to get my bot to identify with nickserv before auto-joining channels, but it always happens the other way around
21:31:53FromDiscord<Yardanico> I'm somewhat familiar with it
21:32:05FromDiscord<King Crimson> Same issue
21:32:29FromDiscord<Yardanico> @Prestige are you sure you pass username and password to newAsyncIrcClient ?
21:32:37FromDiscord<Yardanico> @King Crimson weird, it works for me here when piping something into it
21:32:42FromDiscord<Yardanico> @Prestige for example https://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L555
21:32:50PrestigeI'm just using "newIrc"
21:33:28PrestigeIs "serverPass" supposed to be the password of the user?
21:33:34FromDiscord<Yardanico> yes
21:33:40FromDiscord<Yardanico> https://github.com/nim-lang/irc/blob/master/src/irc.nim#L310
21:33:55FromDiscord<Yardanico> otherwise you can just manually send a msg to NickServ after `connect`ing
21:33:59Prestigeaha, thanks. That wasn't clear to me
21:34:07PrestigeYeah that's what I was doing but the timing was off
21:34:15FromDiscord<Yardanico> you can always sleep :D
21:34:24FromDiscord<King Crimson> In reply to @Yardanico "<@!224940690516344834> weird, it works": I don't know man, it even fails when i test with stdin.endOfFile
21:34:49FromDiscord<Yardanico> how are you piping data into it?
21:34:49PrestigeUnreliable but this worked, ty
21:36:10FromDiscord<King Crimson> through openconnect --script parameter, I get the data I want, but then it reads another line and i guess it fails there
21:38:04*Jesin quit (Quit: Leaving)
21:40:16FromDiscord<King Crimson> i mean openconnect will write to stdin the values it wants to pass to the script or binary the file
21:40:31FromDiscord<King Crimson> (edit) "i mean openconnect will write to stdin the values it wants to pass to the script or ... binary" added "the" | removed "the"
21:40:51FromDiscord<Yardanico> does it only write 1 line?>
21:41:36FromDiscord<King Crimson> In my scenario i get 4 lines
21:42:57FromDiscord<zidsal> sent a code paste, see https://paste.rs/Yhv
21:43:08FromDiscord<King Crimson> sure
21:43:28FromDiscord<sealmove> ok I managed to setup the github workflow. Now the next problem... I uplodead the html and css doc files, but they are not displayed/rendered :p
21:43:44FromDiscord<Yardanico> you need to use github pages for that
21:43:52FromDiscord<Yardanico> or htmlpreview
21:43:57FromDiscord<Yardanico> https://htmlpreview.github.io/
21:44:10FromDiscord<Yardanico> (don't forget to upload the nimdoc.css too)
21:44:33FromDiscord<zidsal> pfft css is overrated, everyone uses screen readers
21:45:25FromDiscord<Yardanico> heresy! nimdoc css is a holy artifact and thus must be preserved for all of the eternity
21:45:43FromDiscord<sealmove> github pages are free?
21:45:54FromDiscord<zidsal> I believe 1 is per account
21:46:14FromDiscord<Yardanico> @sealmove you get a free subdomain for serving static pages
21:46:23FromDiscord<Yardanico> yourgithubnickname.github.io
21:46:23FromDiscord<sealmove> niiiice
21:46:27FromDiscord<King Crimson> https://media.discordapp.net/attachments/371759389889003532/822224452766924800/unknown.png
21:47:03FromDiscord<Yardanico> @King Crimson are you sure it actually passes data as stdin and not as program arguments?
21:48:23FromDiscord<King Crimson> https://media.discordapp.net/attachments/371759389889003532/822224942376550421/unknown.png
21:48:32FromDiscord<Yardanico> hm
21:48:35FromDiscord<King Crimson> this is what i get before stdin.readline stops working
21:49:10FromDiscord<King Crimson> But yeah it does both actually, but the data i need comes from stdin
21:49:31FromDiscord<zidsal> but I'm not convinced you have a stdin πŸ˜›
21:50:53FromDiscord<zidsal> if you just run the program normally via zsh can it read input?
21:50:53*deepend_ joined #nim
21:50:53*deepend quit (Ping timeout: 264 seconds)
21:51:22*nekits07 quit (Read error: Connection reset by peer)
21:51:28*deepend_ is now known as deepend
21:51:38*nekits07 joined #nim
21:52:24FromDiscord<King Crimson> Do you mean my nim application?
21:52:48FromDiscord<King Crimson> yeah
21:52:48FromDiscord<King Crimson> (edit) "application?" => "binary?"
21:53:43FromDiscord<zidsal> just to check are you running -script or -S,--script-tun ?
21:55:46FromDiscord<King Crimson> sent a code paste, see https://play.nim-lang.org/#ix=
21:56:32FromDiscord<zidsal> right so just so we're all on the same page because I suck at this kind of stuff --script-tun passes data via a UNIX socket. is stdin.readlines() going to pick this up?
21:57:40FromDiscord<sealmove> so apparently github page is just a repo with a specific name. how do I push from my repo to another repo?
21:57:42FromDiscord<King Crimson> Well im no better πŸ˜›
21:57:54FromDiscord<King Crimson> Yeah that is where i'm reading the data from
21:57:58FromDiscord<Yardanico> @sealmove you don't have to do that
21:58:01FromDiscord<Yardanico> you can have a github-pages branch
21:58:09FromDiscord<Yardanico> https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
21:58:24FromDiscord<King Crimson> But it seams that readline maybe doesn't detect eof
21:58:29FromDiscord<Yardanico> you can also just choose the /docs folder
21:58:32*so quit (Ping timeout: 246 seconds)
21:58:39FromDiscord<Yardanico> as a source for github pages for the repo
21:58:39FromDiscord<Yardanico> https://docs.github.com/en/github/working-with-github-pages/creating-a-github-pages-site
21:58:46FromDiscord<Yardanico> "If your site is associated with an existing project, you can add the source code to that project's repository, in a /docs folder on the default branch or on a different branch. "
21:59:36*so joined #nim
21:59:44FromDiscord<Yardanico> @sealmove just go into repo settings and choose something like this https://media.discordapp.net/attachments/371759389889003532/822227800156012554/unknown.png
22:00:19FromDiscord<sealmove> wow, that's nice
22:04:45FromDiscord<zidsal> @King Crimson I've had a bit of a google but this is a bit out of my league, I suspect this is to do with the data coming from unix sockets
22:05:18*FromGitter quit (Remote host closed the connection)
22:05:19*oprypin_ quit (Quit: Bye)
22:05:37*oprypin joined #nim
22:05:48*FromGitter joined #nim
22:09:55FromDiscord<King Crimson> Yeah maybe, but shouldn't it be possible to read data from a socket?
22:10:41FromDiscord<zidsal> definitely, but what kind of socket is this πŸ˜›
22:11:15FromDiscord<King Crimson> it's the fd 0 https://en.wikipedia.org/wiki/File_descriptor
22:14:49FromDiscord<King Crimson> Maybe i should connect to the socket and read from the socket rather than stdin
22:15:24FromDiscord<zidsal> ok I found this post which proves this is almost certainly the issue https://medium.com/@benoit.sevens/reading-from-a-file-pipe-or-socket-is-not-the-same-4675e364c536↡↡I'm trying to find a snippet of code of how to read from a fd docket so I can help you translate it to nim
22:17:24FromDiscord<sealmove> @DefinitelyNotYardanico I enabled the option you showed and uploaded a `docs/` folder in my repo. What should I expect? Will they be uploaded to my `sealmove.github.io` repo automatically after some time?
22:17:47FromDiscord<Yardanico> they should be available almost instantly in sealmove.github.io/reponame/file.html
22:17:51FromDiscord<Yardanico> for index.html you don't need to provide file.html of course
22:18:10FromDiscord<Yardanico> @sealmove https://sealmove.github.io/binarylang/binarylang.html
22:18:30FromDiscord<sealmove> oh nice
22:18:31FromDiscord<Yardanico> you can rename binarylang.html to index.html so that https://sealmove.github.io/binarylang/ works
22:19:15FromDiscord<sealmove> oh thanks :)
22:19:27FromDiscord<Yardanico> `nim doc2 binarylang.nim`
22:19:31FromDiscord<sealmove> it's confusing because https://github.com/sealmove/sealmove.github.io is blank
22:19:34FromDiscord<King Crimson> In reply to @zidsal "ok I found this": I was thinking of just using the net library
22:19:44FromDiscord<Yardanico> you can just do `nim doc2 -o:index.html binarylang.nim`
22:19:52FromDiscord<Yardanico> (edit) "-o:index.html" => "-o:htmldocs/index.html"
22:19:58FromDiscord<zidsal> @King Crimson thats what I am looking at, trying to work out what options you need to pass to newSocket πŸ˜„
22:21:33FromDiscord<zidsal> you could prob use ` proc connectUnix(socket: Socket, path: string) =` if you knew where in \proc the fd is
22:29:05FromDiscord<King Crimson> sent a code paste, see https://play.nim-lang.org/#ix=2Tmc
22:29:25FromDiscord<King Crimson> Maybe not raw
22:32:08FromDiscord<zidsal> anyway I'm going to bed now n guys
22:32:30FromDiscord<King Crimson> Thanks for help, NN
22:38:40*krux02 quit (Remote host closed the connection)
22:42:29*xet7 joined #nim
22:46:23*NimBot joined #nim
22:57:12*tane quit (Quit: Leaving)
22:58:39FromGitter<gogolxdong> @Yardanico why not inject some code like this to break cycle since compile time detection?
23:00:01FromDiscord<Yardanico> @gogolxdong you might want to ask Araq, I don't know much about this
23:00:18FromDiscord<Yardanico> but IIRC before ORC he tried breaking cycles but he ended up using the algo used in ORC now
23:19:05FromDiscord<clyybber> it's based on the same principles
23:19:21FromDiscord<clyybber> but manual cycle breaking isn't really equivalent to cycle collection
23:20:24FromDiscord<clyybber> since with manual cycle breaking you break the structure of whatever you are breaking, you must be sure that nothing else wants to use it later on, otherwise it will read access the broken up structure
23:31:36FromDiscord<Seedofarson> hmmm
23:31:58FromDiscord<Seedofarson> there are a few modules from base libary that dont work with nim ---> JS compiling
23:32:05FromDiscord<Yardanico> yes, that's to be expected
23:32:14FromDiscord<Seedofarson> Is there a list anywhere though
23:32:34FromDiscord<Seedofarson> It's totally expected and im not complaining. I just havent been able to find a definitive list haha
23:32:37FromDiscord<ElegantBeef> The easy rule is that if it's related to the system or is impure it's not going to work
23:32:49FromDiscord<Yardanico> some list is https://github.com/nim-lang/Nim/wiki/Standard-library-and-the-JavaScript-backend
23:32:52FromDiscord<Yardanico> but really it's easy to try
23:33:00FromDiscord<Yardanico> (that list is not complete)
23:33:14FromDiscord<Yardanico> it's been extended after some more JS fixes relatively recently
23:33:26FromDiscord<Seedofarson> awesome
23:33:28FromDiscord<Seedofarson> thank you!
23:33:43FromDiscord<Seedofarson> http client \:( rip
23:34:03FromDiscord<ElegantBeef> There are js http clients
23:34:04FromDiscord<sealmove> Can I directly render a `.rst` with nim without it being in a nim module and commented?
23:34:05FromDiscord<Yardanico> it uses sockets so it's not easy to port it to the JS backend with the same api
23:34:09FromDiscord<Yardanico> @sealmove of course
23:34:10FromDiscord<Yardanico> nim rst2html
23:34:15FromDiscord<sealmove> nice
23:34:30FromDiscord<Yardanico> you can also use the rst module programmaticaly
23:34:31FromDiscord<Yardanico> (edit) "programmaticaly" => "programmatically"
23:34:43FromDiscord<ElegantBeef> yea got 3 rst modules in the stdlib
23:34:49FromDiscord<Yardanico> no
23:35:03FromDiscord<ElegantBeef> What do you mean "no"
23:35:13FromDiscord<Yardanico> your message sounded like they're redundant :)
23:35:31FromDiscord<ElegantBeef> Ah
23:35:35FromDiscord<Yardanico> but they're just well separated - parser, html/latex generator
23:35:38FromDiscord<Yardanico> and what's the third one?
23:35:42FromDiscord<ElegantBeef> ast
23:35:47FromDiscord<Yardanico> ????????
23:35:58FromDiscord<ElegantBeef> https://nim-lang.org/docs/rstast.html
23:36:10FromDiscord<Yardanico> well, even more logical :P
23:36:16FromDiscord<Yardanico> ast, parser, html/latex generator
23:36:43FromDiscord<Yardanico> for json we have a parser and json -> nim (and nim -> json) module too
23:36:46FromDiscord<Yardanico> https://nim-lang.org/docs/parsejson.html
23:40:57FromDiscord<gogolxdong> @clyybber are you saying there is only possible to know whether cyclic structure are the last read in runtime ?
23:41:37FromDiscord<clyybber> generally it's only possible to know whether a structure will be used later on at runtime
23:41:40FromDiscord<clyybber> for refs that is
23:42:02FromDiscord<clyybber> unless they don't escape or don't come from somewhere external
23:42:12FromDiscord<clyybber> so the same applies to cyclic structures
23:42:38FromDiscord<clyybber> so manual cycle breaking is like manual memory management
23:42:54FromDiscord<sealmove> Maybe it would be useful to manipulate the rst docs programmatically, because right now I have 400 commented lines in my module. And I want them to get rendered along with comments in procs and such stuff.
23:43:18FromDiscord<sealmove> So I can't just move them in a seperate rst file
23:44:47FromDiscord<Seedofarson> I just realized I went on a 3 hour tangent trying to build a UI that updates btc price from like a web API
23:44:53FromDiscord<Seedofarson> when I was trying to learn ReactJS
23:44:54FromDiscord<Seedofarson> lmao
23:45:18FromDiscord<Seedofarson> (edit) "trying" => "supposed" | "learn" => "be learning"
23:58:33*superbia quit (Ping timeout: 260 seconds)