00:32:05 | ForumUpdaterBot | New thread by Buster_blue: Macros and Syntax, see https://forum.nim-lang.org/t/7654 |
00:32:38 | FromDiscord | <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:01 | FromDiscord | <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:55 | FromDiscord | <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:01 | FromDiscord | <ElegantBeef> What's' the entire code? |
01:08:38 | FromDiscord | <exelotl> oooh you homebrewin' |
01:10:28 | FromDiscord | <TurtleP> In reply to @exelotl "oooh you homebrewin'": always have been :tuxdab: |
01:10:47 | FromDiscord | <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:01 | FromDiscord | <ElegantBeef> Sure but what are you objects |
01:11:13 | FromDiscord | <ElegantBeef> Also use nim playground π |
01:11:52 | FromDiscord | <TurtleP> <https://pastebin.com/qd36PDvp> |
01:12:09 | FromDiscord | <TurtleP> there's not much done with the objects since I haven't gotten that far |
01:12:11 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/ π |
01:12:13 | FromDiscord | <ElegantBeef> Ok |
01:12:23 | FromDiscord | <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:20 | FromDiscord | <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:17 | FromDiscord | <ElegantBeef> The entire point of methods is that they're dynamically dispatched and dont require explict conversions |
01:14:28 | FromDiscord | <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:39 | FromDiscord | <TurtleP> like in python I could store the object type |
01:14:40 | FromDiscord | <ElegantBeef> You could make a template |
01:14:43 | FromDiscord | <TurtleP> and then invoke it based on that |
01:14:54 | FromDiscord | <TurtleP> In reply to @ElegantBeef "You could make a": template hm? |
01:15:07 | FromDiscord | <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:37 | FromDiscord | <ElegantBeef> @TurtleP https://play.nim-lang.org/#ix=2TfY |
01:17:08 | FromDiscord | <TurtleP> oh interesting |
01:17:17 | FromDiscord | <ElegantBeef> That also allows you to add more later on and store them in the same field |
01:17:43 | FromDiscord | <ElegantBeef> Of course you can do the more normal `var console: Console` then set it manually |
01:17:55 | FromDiscord | <ElegantBeef> Atleast i think that compiles |
01:23:04 | FromDiscord | <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:11 | FromDiscord | <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:13 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Tg1 |
01:30:20 | FromDiscord | <TurtleP> I'll need polymorphism once I delve deeper |
01:30:23 | FromDiscord | <TurtleP> but thank you |
01:30:24 | FromDiscord | <TurtleP> π |
01:30:51 | FromDiscord | <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:28 | FromDiscord | <Zachary Carter> @Ayy Lmao well .lib files are windows files |
01:50:02 | FromDiscord | <Zachary Carter> static library files I believe |
01:50:23 | FromDiscord | <Zachary Carter> on linux they're `.a` files |
01:50:58 | FromDiscord | <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:22 | FromDiscord | <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:05 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Tg8 |
01:55:43 | FromDiscord | <ElegantBeef> Not overly safe, but works for this |
01:57:08 | FromDiscord | <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:19 | FromDiscord | <Papel> what's unsafe about it @ElegantBeef ? |
01:57:34 | FromDiscord | <ElegantBeef> if you do `a.b` it doesnt return `b` it returns `a.b` |
01:57:45 | FromDiscord | <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:14 | FromDiscord | <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:23 | FromDiscord | <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:19 | FromDiscord | <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:25 | FromDiscord | <ElegantBeef> Yep |
01:59:38 | FromDiscord | <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:22 | FromDiscord | <Papel> i see, shouldn't be much trouble dividing the string at the . though, thanks a ton! |
02:01:57 | FromDiscord | <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:03 | FromDiscord | <Zachary Carter> youre probably using mingw or something |
02:03:20 | FromDiscord | <Ayy Lmao> Yeah I'm using mingw64. When I try that it says it can't find -lenet64.lib |
02:05:23 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=2Tge |
02:20:13 | FromDiscord | <ElegantBeef> Saem your PR was accepted, so cheers π |
02:21:11 | FromDiscord | <Zachary Carter> okay well you're still missing more libraries then |
02:21:42 | FromDiscord | <Zachary Carter> actually @Ayy Lmao try `-lws2_32` instead |
02:21:47 | FromDiscord | <Zachary Carter> omit the `.lib` and see if that works |
02:21:59 | FromDiscord | <sealmove> do we have a lzw compression library? |
02:25:51 | FromDiscord | <ElegantBeef> I know we have zippy but i dont remember if it does lzw |
02:27:00 | FromDiscord | <sealmove> zippy has: dfZlib, dfGzip, dfDeflate |
02:38:24 | FromDiscord | <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:11 | FromDiscord | <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:24 | FromDiscord | <Ayy Lmao> Thank you for the help |
02:41:21 | FromDiscord | <Ayy Lmao> Oh wait it didn't fail, it just returns 0 on success, which is strange |
03:00:53 | FromDiscord | <Zachary Carter> NP |
03:19:34 | saem | I'm super excited |
03:19:42 | saem | Thanks, Beef! |
03:25:45 | * | NimBot joined #nim |
03:29:11 | Prestige | Hell yeah |
03:31:14 | * | wasted_youth2 quit (Quit: Leaving) |
03:42:28 | FromDiscord | <ElegantBeef> Sorry i didnt do the homework π |
03:42:35 | saem | :P |
03:42:47 | saem | It's totally cool |
03:43:28 | FromDiscord | <ElegantBeef> But hey people like my defaults macro so 10/10 day |
03:43:39 | saem | oh yeah? |
03:44:22 | saem | I gotta get profiling working, I wonder if I can replicate what treeform was doing. |
03:46:27 | FromDiscord | <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:57 | FromDiscord | <ElegantBeef> Do you mean with Vtune, or proffy? |
03:47:10 | saem | vtune of callgrind or something |
03:47:15 | saem | or even |
03:58:36 | FromDiscord | <Yardanico> trying out ormin, I guess I actually prefer it over norm |
03:59:12 | FromDiscord | <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:20 | FromDiscord | <Yardanico> just look at this |
03:59:26 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Tgx |
04:02:23 | Prestige | Are the nim tutorial pages just made my hand? |
04:02:30 | FromDiscord | <Yardanico> ? |
04:02:37 | FromDiscord | <Yardanico> no, they use docgen |
04:02:41 | FromDiscord | <Yardanico> as the module docs |
04:02:47 | FromDiscord | <ElegantBeef> Well they're made by hand in RST π |
04:02:54 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/doc/tut1.rst |
04:02:58 | FromDiscord | <Yardanico> https://raw.githubusercontent.com/nim-lang/Nim/devel/doc/tut1.rst |
04:03:14 | Prestige | Yeah that's what I meant, what beef said |
04:03:48 | Prestige | Was 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:00 | Prestige | Or even as a start, without the playground |
04:04:16 | FromDiscord | <Yardanico> someone already made something like that for playground in the past |
04:04:21 | FromDiscord | <ElegantBeef> Well the playground supports it so have at 'er |
04:04:46 | FromDiscord | <Yardanico> yeah exactly |
04:04:55 | Prestige | Would be a lot easier to get through for beginners if the pages weren't massive |
04:05:07 | Prestige | Maybe I will work on that |
04:05:34 | FromDiscord | <ElegantBeef> Yay i finally have confirmation that resus works! |
04:05:52 | FromDiscord | <ElegantBeef> Who'd have thought that a green led brought any happiness π |
04:07:02 | FromDiscord | <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:01 | FromDiscord | <Yardanico> am I even doing this right 0_0 |
04:47:04 | FromDiscord | <Yardanico> but looks cool :D |
04:47:07 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgF |
04:49:40 | FromDiscord | <jfmonty2> hello, is this where to put noob questions? |
04:49:47 | FromDiscord | <Yardanico> yeah, sure |
04:49:59 | FromDiscord | <Yardanico> we don't have a separate place for "noob" questions, ask all questions in there |
04:50:08 | FromDiscord | <jfmonty2> ok, great. So I'm just trying out Nim, seems very cool so far, coming from a mostly Python background |
04:50:15 | FromDiscord | <Gary M> The answer is "nil" |
04:50:48 | FromDiscord | <ElegantBeef> Nah it's strictly typed is how you dont have silly errors! |
04:50:52 | FromDiscord | <Gary M> Hello Beef |
04:50:56 | FromDiscord | <ElegantBeef> Yellow |
04:51:02 | FromDiscord | <jfmonty2> sent a code paste, see https://play.nim-lang.org/#ix=2TgG |
04:51:07 | FromDiscord | <jfmonty2> basically just splitting up what would otherwise be a mondo line |
04:51:18 | FromDiscord | <Gary M> Function pointer |
04:51:18 | FromDiscord | <jfmonty2> but in Nim, I understand that assigning to a new variable will actually copy |
04:51:24 | FromDiscord | <Yardanico> if it's a value type, yes |
04:51:29 | FromDiscord | <Yardanico> but for them that's usually fine |
04:51:38 | FromDiscord | <ElegantBeef> We do have `{.byaddr.}` though |
04:51:39 | FromDiscord | <Yardanico> ref types have ref semantics obviously |
04:51:49 | FromDiscord | <jfmonty2> so basically it's just not enough of a performance hit to worry about? |
04:52:01 | FromDiscord | <Gary M> For a function pointer? Typically not no |
04:52:20 | FromDiscord | <Yardanico> @jfmonty2 for copies - generally no |
04:52:28 | FromDiscord | <jfmonty2> Not sure I quite understand function pointer, in this context |
04:52:31 | FromDiscord | <Gary M> Or wait that's not a fp is it |
04:52:35 | FromDiscord | <Gary M> Thats just a value of a field |
04:52:40 | FromDiscord | <jfmonty2> Right, pretty much |
04:52:51 | FromDiscord | <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:55 | FromDiscord | <Gary M> Okay. You can technically make it a ref object |
04:53:05 | FromDiscord | <jfmonty2> I often just break up long chains of property/method/function-calls at somewhat-arbitrary points, just for readability |
04:53:06 | FromDiscord | <Rika> its not usually an issue |
04:53:11 | FromDiscord | <ElegantBeef> That's fine |
04:53:16 | FromDiscord | <Rika> worry when it gets noticeable π |
04:53:18 | FromDiscord | <ElegantBeef> If you're worried use `byaddr` |
04:53:31 | FromDiscord | <jfmonty2> byaddr is a function pragma, right? So you specify it when you define the function? |
04:53:33 | FromDiscord | <jfmonty2> er, proc. sorry |
04:53:44 | FromDiscord | <Rika> no its just a pragma |
04:53:52 | FromDiscord | <Gary M> I think on assignment so you're making it assign by addr |
04:53:54 | FromDiscord | <Rika> var a {.byaddr.} = .. |
04:53:58 | FromDiscord | <Yardanico> @jfmonty2 https://nim-lang.org/docs/decls.html but really you don't have to worry about copies in most cases |
04:54:07 | FromDiscord | <Yardanico> just write your code first :) |
04:54:11 | FromDiscord | <jfmonty2> oh, so you can use it for any function call? like `a = seq.pop(); callFunc(a)`? |
04:54:17 | FromDiscord | <ElegantBeef> Never worry about performance until it's a problem |
04:54:21 | FromDiscord | <Rika> pragmas arent just decorators on crack, theyre much more |
04:54:26 | FromDiscord | <jfmonty2> fair enough |
04:54:37 | FromDiscord | <jfmonty2> I do have a tendency to go depth-first when learning new things π |
04:55:33 | FromDiscord | <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:51 | FromDiscord | <Yardanico> well, it's also faster than having refs everywhere |
04:56:02 | FromDiscord | <Gary M> Is it actually faster π |
04:56:06 | FromDiscord | <Yardanico> yes of course |
04:56:15 | FromDiscord | <Yardanico> nim doesn't do dumb copies of all objects |
04:56:16 | FromDiscord | <Rika> adds strain for the gc i believe |
04:56:19 | FromDiscord | <Yardanico> if an object is too big the compiler will pass it by reference anyway |
04:56:27 | FromDiscord | <Yardanico> automatically |
04:56:30 | FromDiscord | <jfmonty2> That's good to know, thanks! |
04:56:32 | FromDiscord | <Yardanico> I mean to functions/etc |
04:56:38 | FromDiscord | <Gary M> I thought mutating a reference was usually faster than copying |
04:56:47 | FromDiscord | <Rika> not in all cases |
04:56:49 | FromDiscord | <jfmonty2> I'm not super familiar with memory management stuff (even at the most basic level) coming from dynamic/interpreted languages |
04:57:11 | FromDiscord | <Rika> and you dont need to |
04:57:17 | FromDiscord | <Yardanico> @Gary M it includes a pointer dereference |
04:57:19 | FromDiscord | <Rika> i mean, dynamic languages tend to hide it from you |
04:57:21 | FromDiscord | <Yardanico> don't forget that |
04:57:25 | FromDiscord | <Gary M> No worries I'm dumb and I get by with Nim lol |
04:57:31 | FromDiscord | <Gary M> If I can then so can you |
04:57:52 | FromDiscord | <Gary M> Basically just do it the easiest and cleanest way by default and you'll have fun |
04:58:06 | FromDiscord | <jfmonty2> sounds good! π |
04:58:09 | FromDiscord | <ElegantBeef> Idiomatic Nim tends to be very performant |
04:58:18 | FromDiscord | <Gary M> Occam's razor or something like that |
04:58:18 | FromDiscord | <jfmonty2> That is very reminiscent of python π |
04:58:37 | FromDiscord | <Gary M> Yep! With actual performance! Lol |
04:58:40 | FromDiscord | <ElegantBeef> ^ |
04:58:46 | FromDiscord | <Gary M> It's like having cython but for everything you do |
04:58:50 | FromDiscord | <ElegantBeef> Idiomatic python is still slow, and will cut you |
04:58:56 | FromDiscord | <jfmonty2> Looking forward to that π |
04:58:57 | FromDiscord | <Yardanico> yeah ormin seems to be faster than norm |
04:58:58 | FromDiscord | <Rika> cython but without the weird ass quirks of cython |
04:59:04 | FromDiscord | <Gary M> What is ormin |
04:59:10 | FromDiscord | <ElegantBeef> Cython but if it was a good wirth-like language |
04:59:11 | FromDiscord | <Rika> orm for nim |
04:59:12 | FromDiscord | <Yardanico> shame on your for not knowing! |
04:59:13 | FromDiscord | <Yardanico> https://github.com/Araq/ormin |
04:59:16 | FromDiscord | <Yardanico> xD |
04:59:25 | FromDiscord | <Rika> ha! i got the description almost exact |
04:59:29 | FromDiscord | <Gary M> For db's? |
04:59:32 | FromDiscord | <Yardanico> yes |
04:59:34 | FromDiscord | <Yardanico> i'm starting to really like ormin |
04:59:37 | FromDiscord | <Gary M> Neat. |
04:59:37 | FromDiscord | <Rika> yeah, what else would an orm do |
04:59:43 | FromDiscord | <Gary M> Idk that's why I asked |
04:59:44 | FromDiscord | <Yardanico> its simple yet statically checked and stuff |
04:59:45 | FromDiscord | <Rika> oh |
04:59:46 | FromDiscord | <Rika> ok |
04:59:48 | FromDiscord | <Gary M> Geez rika chill sometimes |
04:59:54 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgI |
04:59:59 | FromDiscord | <Yardanico> the query is checked at compile time |
05:00:07 | FromDiscord | <Yardanico> since ormin remembers your DB model and checks against it |
05:00:11 | FromDiscord | <Gary M> Oh sql query builder? Nice. |
05:00:20 | FromDiscord | <Yardanico> it also does natural joins |
05:00:28 | FromDiscord | <Gary M> I've worked with a weird db that is both sql and nosql |
05:00:37 | FromDiscord | <Gary M> But does EVERYTHING through http post request |
05:00:39 | FromDiscord | <Yardanico> but yeah, I'm not sure if I'm abusing ormin a bit too much |
05:00:44 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgF |
05:00:56 | FromDiscord | <Rika> i mean it looks fine to me |
05:00:57 | FromDiscord | <Gary M> Does that query builder return a string? |
05:01:00 | FromDiscord | <Yardanico> nononononono |
05:01:03 | FromDiscord | <Yardanico> it doesn't give you strings, never |
05:01:07 | FromDiscord | <Yardanico> it does queries by itself |
05:01:07 | FromDiscord | <Gary M> Oh :( |
05:01:17 | FromDiscord | <Yardanico> it's not just a query builder |
05:01:24 | FromDiscord | <Gary M> That's the thing is to use it with http I would need it stringified |
05:01:26 | FromDiscord | <Rika> i mean strings are scary when it comes to dbs innit? |
05:01:32 | FromDiscord | <Yardanico> very |
05:01:46 | FromDiscord | <Rika> shit can easily give you an injection problem |
05:02:23 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TgL |
05:03:29 | FromDiscord | <Yardanico> not much but its honest work https://media.discordapp.net/attachments/371759389889003532/821972052986691664/unknown.png |
05:03:46 | FromDiscord | <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:11 | FromDiscord | <Yardanico> @Rika show them https://github.com/Yardanico/nimpylib/blob/master/tests/tclass.nim |
05:04:58 | FromDiscord | <Yardanico> or https://github.com/Yardanico/nimpylib/blob/master/tests/ttonim.nim |
05:05:47 | FromDiscord | <Rika> what the FUCK |
05:05:52 | FromDiscord | <Gary M> Lol |
05:05:55 | FromDiscord | <Yardanico> it's actually really simple to do |
05:06:07 | FromDiscord | <Yardanico> since its valid nim syntax :) |
05:06:08 | FromDiscord | <Rika> can we ban yardanico |
05:06:13 | FromDiscord | <Yardanico> no |
05:06:25 | FromDiscord | <DefinitelyNotYardanico> besides, who is yardanico anyway |
05:06:29 | FromDiscord | <Rika> this is illegal |
05:06:33 | FromDiscord | <Rika> this is banned |
05:06:38 | FromDiscord | <Rika> you are a sinner |
05:06:57 | FromDiscord | <DefinitelyNotYardanico> just check https://github.com/Yardanico/nimpylib/blob/master/examples/readme.nim to let your soul rest |
05:07:14 | FromDiscord | <Rika> im gonna cry |
05:07:16 | FromDiscord | <Rika> this is heretic |
05:07:22 | FromDiscord | <Gary M> Cool stuff i like |
05:07:42 | FromDiscord | <Gary M> Now make one for C |
05:07:48 | FromDiscord | <Rika> though the with and context manager style stuff is actually nice |
05:07:48 | FromDiscord | <DefinitelyNotYardanico> I even use concepts for the with macro |
05:07:50 | FromDiscord | <DefinitelyNotYardanico> https://github.com/Yardanico/nimpylib/blob/master/src/pylib/pywith.nim |
05:07:56 | FromDiscord | <Gary M> I want to write valid C in Nim instead of Nim oh wait I'll just use emit |
05:08:00 | FromDiscord | <DefinitelyNotYardanico> and its actually really simple too |
05:08:02 | FromDiscord | <DefinitelyNotYardanico> the macro I mean |
05:08:06 | FromDiscord | <DefinitelyNotYardanico> but it took me a few tries to get there |
05:08:21 | FromDiscord | <DefinitelyNotYardanico> ah wait I think it has a bug in it which I didn't fix yet |
05:08:31 | FromDiscord | <Rika> In reply to @Gary M "I want to write": inb4 "why tf use nim if u just writing c anyway?!?!??!?!?!?!????" |
05:08:41 | FromDiscord | <Rika> lol |
05:08:41 | FromDiscord | <Gary M> : P |
05:09:15 | FromDiscord | <Gary M> I'm going to attempt to write a buffer allocator from scratch, I hope it doesn't all blow up. |
05:09:16 | FromDiscord | <Rika> though legit, nim can do c-style stuff anyway so you shouldnt really need to write C |
05:09:23 | FromDiscord | <Rika> oh MAN that sounds intense |
05:09:44 | FromDiscord | <Gary M> Maybe, but maybe not? I guess if I'm not handling fragmentation and stuff idk... |
05:10:20 | FromDiscord | <Gary M> It's for Vulkan though so I already have some predefined stuff to base it around |
05:10:28 | FromDiscord | <Rika> if youre just doing it naiively then sure prolly easy but if you want a good one... |
05:10:40 | FromDiscord | <Gary M> Yeah idk yet |
05:10:59 | FromDiscord | <Gary M> The naive way should be easy to get things working anyways |
05:12:08 | FromDiscord | <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:39 | FromDiscord | <Gary M> Especially when they start packing long textures sideways how it sends the correct uv's to the shader fuck |
05:13:12 | FromDiscord | <Rika> man's doing the complex shit |
05:13:33 | FromDiscord | <Gary M> No no I'm dumb |
05:13:40 | FromDiscord | <Gary M> I'm just engineering |
05:13:51 | FromDiscord | <Gary M> Implementing ideas not making them |
05:14:16 | FromDiscord | <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:23 | FromDiscord | <DefinitelyNotYardanico> maybe I should just use SCFs for fun :P |
05:14:30 | FromDiscord | <Yardanico> and I mean server-side karax |
05:14:44 | FromDiscord | <Gary M> Thread that shit boy idk |
05:15:06 | FromDiscord | <Yardanico> hm |
05:15:21 | FromDiscord | <Gary M> If you have multiple concats to do split them up via threads |
05:15:31 | FromDiscord | <Yardanico> lol wat |
05:15:35 | FromDiscord | <Gary M> Idk fuck me |
05:15:39 | FromDiscord | <Gary M> Thread it anyways |
05:15:41 | FromDiscord | <Yardanico> and the problem is that i have one global DB variable anyway |
05:16:01 | FromDiscord | <Yardanico> i mean it's not a "problem" |
05:16:07 | FromDiscord | <Gary M> You said the string concats were taking a large amount of time |
05:16:13 | FromDiscord | <Yardanico> compared to other runtime, yes |
05:16:16 | FromDiscord | <Rika> threads can be slower than sync if your tasks arent intensive enough |
05:16:29 | FromDiscord | <Yardanico> and anyway, 13k reqs/sec for a forum is already good |
05:16:36 | FromDiscord | <Yardanico> with DB access and all that |
05:16:36 | FromDiscord | <Gary M> I'm only saying parallelize it and join the results on the main thread idk? |
05:16:38 | FromDiscord | <Rika> good enough for tiny forums |
05:16:46 | FromDiscord | <Gary M> I have zero idea what it actually looks like |
05:16:47 | FromDiscord | <Rika> which are basically all forums nowadays... |
05:17:14 | FromDiscord | <Yardanico> @Gary M first of all, it's in karax, I'll have to change karax quite a lot |
05:17:16 | FromDiscord | <Gary M> 13k reqs/second psh I would beat that within a day of launching with how famous I am |
05:17:26 | FromDiscord | <Gary M> /s |
05:17:29 | FromDiscord | <Yardanico> and then parallelizing string concatenation wouldn't really help |
05:17:34 | FromDiscord | <Rika> sβ΅ss |
05:17:40 | FromDiscord | <Rika> snake |
05:17:41 | FromDiscord | <Gary M> Big s |
05:17:42 | FromDiscord | <Rika> python |
05:17:44 | FromDiscord | <Rika> heretic! |
05:17:45 | FromDiscord | <Yardanico> @Rika I was replying to a previous message |
05:17:47 | FromDiscord | <Gary M> Ohhhh you got me |
05:18:23 | FromDiscord | <ElegantBeef> How do i get this to work? https://play.nim-lang.org/#ix=2TgO |
05:18:59 | FromDiscord | <Rika> u dont |
05:19:00 | FromDiscord | <Gary M> Thread it |
05:19:04 | FromDiscord | <Rika> ill take a look |
05:19:22 | FromDiscord | <ElegantBeef> Lol i really hope "you dont" isnt the actual response |
05:19:44 | FromDiscord | <Gary M> Wouldn't you just make an actual dirty C file at this point lol |
05:19:58 | FromDiscord | <Gary M> Stinky stinky C |
05:20:07 | FromDiscord | <ElegantBeef> The emited C is provided by the pico sdk |
05:20:22 | FromDiscord | <ElegantBeef> I could emit C code that just forwards the Nim call i suppose |
05:20:26 | FromDiscord | <Rika> eww beef stinky |
05:20:32 | FromDiscord | <Gary M> Lol |
05:20:41 | FromDiscord | <ElegantBeef> How dare you Gary |
05:20:53 | FromDiscord | <ElegantBeef> Also gary did you see that we've convinced miki to try Nim? π |
05:21:24 | FromDiscord | <Rika> do you two know each other' or somehting |
05:21:27 | FromDiscord | <ElegantBeef> Yea |
05:21:32 | FromDiscord | <ElegantBeef> I got gary into Nim |
05:21:33 | FromDiscord | <Rika> best buds aww |
05:21:37 | FromDiscord | <Rika> how cute |
05:21:48 | FromDiscord | <ElegantBeef> We'll know eachother from another discord |
05:21:56 | FromDiscord | <ElegantBeef> Not real life friends or anything |
05:22:12 | FromDiscord | <Rika> i was joking lol |
05:22:14 | FromDiscord | <Gary M> yeah thankfully |
05:22:18 | FromDiscord | <Rika> LMAO |
05:22:21 | FromDiscord | <Gary M> stinky Canadians |
05:22:39 | FromDiscord | <ElegantBeef> Ah i was going to make a covid joke but you'd probably catch it |
05:22:50 | FromDiscord | <Gary M> already did jackass lol |
05:22:56 | FromDiscord | <Rika> beef why are you such a pro at being self deprecating |
05:22:58 | FromDiscord | <ElegantBeef> ~~That's the joke~~ |
05:23:14 | FromDiscord | <Gary M> well, hm. I don't know if it landed very well then |
05:23:19 | FromDiscord | <Gary M> hard to catch it twice |
05:23:20 | FromDiscord | <ElegantBeef> Well cause when you write code as bad as me it's the only way to live |
05:23:36 | FromDiscord | <Gary M> haha it's funny because he's making fun of himself |
05:23:49 | FromDiscord | <ElegantBeef> Glad you were here cause i wouldve missed the joke |
05:24:12 | FromDiscord | <Gary M> you'd probably catch it |
05:24:16 | FromDiscord | <Gary M> get it? get it? |
05:24:25 | FromDiscord | <Rika> imagine relying on such popular packages and the package creator says that... |
05:24:46 | FromDiscord | <ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2TgS |
05:24:46 | FromDiscord | <ElegantBeef> Rika the main reason is that i just laugh at everything regardless of who it implies |
05:25:00 | FromDiscord | <ElegantBeef> What popular packages do i have? |
05:25:07 | FromDiscord | <Rika> constructor |
05:25:08 | FromDiscord | <Gary M> I thought everyone on github wrote really good clean well-behaving code except me |
05:25:25 | FromDiscord | <ElegantBeef> People actually use my code? |
05:25:32 | FromDiscord | <Gary M> then I actually looked at some of the libraries I use regularly and geez there's some really stinky things |
05:25:34 | FromDiscord | <ElegantBeef> I just assumed by the issues no one used it |
05:25:36 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=2TgT |
05:25:43 | FromDiscord | <ShadowElf37> of what specifically |
05:25:44 | FromDiscord | <Rika> In reply to @Gary M "I thought everyone on": everyone believes that |
05:25:50 | FromDiscord | <Rika> In reply to @ShadowElf37 "of what specifically": result |
05:25:56 | FromDiscord | <ShadowElf37> also sorry for interrupting π |
05:25:59 | FromDiscord | <Rika> no its fine |
05:26:04 | FromDiscord | <Rika> we're just fucking around at this point |
05:26:05 | FromDiscord | <ElegantBeef> It's fine we werent talking about anything important |
05:26:21 | FromDiscord | <Gary M> yeah only talking about beef |
05:26:27 | FromDiscord | <Rika> lmao |
05:26:55 | FromDiscord | <ElegantBeef> Damn if i could read i'm sure i'd be offended |
05:27:25 | FromDiscord | <Gary M> good thing you read'nt |
05:27:29 | FromDiscord | <ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2TgU |
05:27:31 | FromDiscord | <ShadowElf37> hmmmm π€ |
05:27:47 | FromDiscord | <ShadowElf37> i love how it does that |
05:27:47 | FromDiscord | <Gary M> readn't |
05:28:08 | FromDiscord | <ElegantBeef> Looks like you should just throw the macro + example on nim-playground |
05:28:15 | * | haxscramper joined #nim |
05:28:25 | FromDiscord | <ShadowElf37> ok give me a sec |
05:31:29 | FromDiscord | <ShadowElf37> https://play.nim-lang.org/#ix=2TgW |
05:31:33 | FromDiscord | <ShadowElf37> should be everything |
05:37:32 | FromDiscord | <ElegantBeef> The issue seems to be that it's doing `prefix` instead of `call` |
05:37:51 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2TgX |
05:37:53 | FromDiscord | <ElegantBeef> Compiles |
05:39:22 | FromDiscord | <ShadowElf37> well |
05:39:25 | FromDiscord | <ShadowElf37> cool |
05:39:42 | FromDiscord | <ShadowElf37> lol |
05:40:04 | * | gangstacat quit (Quit: Δis!) |
05:47:15 | * | gangstacat joined #nim |
05:49:35 | FromDiscord | <ShadowElf37> actually that wasnt the issue |
05:49:45 | FromDiscord | <ShadowElf37> it was when you removed expandMacros |
05:50:00 | FromDiscord | <ElegantBeef> Yea just do `echo result.repr` |
05:50:27 | FromDiscord | <ShadowElf37> interesting ill keep that in mind |
06:05:49 | * | acidx quit (Ping timeout: 260 seconds) |
06:06:04 | * | acidx joined #nim |
06:06:18 | FromDiscord | <Yardanico> apparently my stupidish "forum" is 50% faster with orc than with refc (single threaded) |
06:06:26 | FromDiscord | <Yardanico> that's karax + sqlite queries + jester |
06:06:37 | FromDiscord | <ElegantBeef> Damn i can spam my packages even faster? |
06:06:49 | FromDiscord | <Yardanico> sorry 42% |
06:07:07 | FromDiscord | <ElegantBeef> Damn that's only ~80% of the promised increase |
06:07:09 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Th5 |
06:07:10 | FromDiscord | <Yardanico> and no leaks |
06:07:12 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Th6 |
06:07:19 | FromDiscord | <Yardanico> you can see that the latency is ~3ms lower |
06:07:45 | FromDiscord | <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:31 | FromDiscord | <ElegantBeef> So the arm compiler disagrees with my code |
06:27:41 | saem | rude |
06:28:21 | FromDiscord | <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:45 | FromDiscord | <ElegantBeef> Why does `attribute ((weak))` exist! |
06:32:29 | FromDiscord | <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:00 | FromDiscord | <ElegantBeef> Oh `codegendecl` exists |
06:44:07 | FromDiscord | <ElegantBeef> Is there a way to temporarily disable the dead code elimination? |
06:44:41 | FromDiscord | <Gary M> push pop something? |
06:44:55 | FromDiscord | <Gary M> : P |
06:44:59 | FromDiscord | <ElegantBeef> the issue being i cannot find the flag |
06:47:45 | FromDiscord | <Yardanico> @ElegantBeef no, dead code elimination is always enabled regardless of compiler options |
06:47:53 | FromDiscord | <Yardanico> for consistency so debug vs release builds don't give different results |
06:47:58 | FromDiscord | <Yardanico> why would you ever want to disable it? |
06:48:07 | FromDiscord | <Yardanico> also I guess you can try the {.used.} pragma but idk if it will work |
06:48:13 | FromDiscord | <ElegantBeef> Cause i need it to emit these weakly bound C procedures |
06:48:14 | FromDiscord | <Gary M> so this `--deadCodeElim=off` would do nothing? |
06:48:19 | FromDiscord | <Yardanico> yes |
06:48:27 | FromDiscord | <Gary M> yikes |
06:48:34 | FromDiscord | <Yardanico> it's a good thing though |
06:48:47 | FromDiscord | <Yardanico> and it has been that way since 0.19.0 |
06:49:00 | FromDiscord | <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:17 | FromDiscord | <Yardanico> i don't really get why people still include it in their configs |
06:49:22 | FromDiscord | <Yardanico> it's been a nop for a long time |
06:49:54 | FromDiscord | <Gary M> no deprecation warnings in configs |
06:50:20 | FromDiscord | <Yardanico> there is though |
06:50:31 | FromDiscord | <Yardanico> command line(1, 2) Warning: 'deadCodeElim' is deprecated, now a noop [Deprecated] |
06:50:35 | FromDiscord | <Gary M> then people are ignorant? |
06:50:41 | FromDiscord | <Yardanico> yes |
06:50:51 | FromDiscord | <Yardanico> ah actually no, that change was introduced recently |
06:50:56 | FromDiscord | <Yardanico> the one to show the warning |
06:51:01 | FromDiscord | <Gary M> π |
06:51:07 | FromDiscord | <Yardanico> why are you mad |
06:51:19 | FromDiscord | <Gary M> uh I'm not mad |
06:51:28 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/821999224882200586/unknown.png |
06:51:43 | FromDiscord | <Gary M> don't take that at face value π |
06:51:58 | FromDiscord | <Gary M> I might not be smiling in real life either!! |
06:52:36 | * | mwbrown quit (Ping timeout: 240 seconds) |
06:52:52 | saem | fun sysprof works pretty nicely |
06:59:43 | FromDiscord | <ElegantBeef> Nice |
06:59:51 | FromDiscord | <ElegantBeef> I'm one procedure away from having it possibly compile |
07:02:29 | FromDiscord | <Rika> Congrats |
07:02:38 | FromDiscord | <Rika> Also isnβt there a used pragma |
07:02:56 | FromDiscord | <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:53 | PMunch | Is there a way to ensure that a type doesn't leak to runtime? |
10:25:01 | PMunch | For 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:40 | liblq-dev | PMunch: put it in a static block? |
10:46:08 | * | Jesin joined #nim |
10:50:11 | PMunch | The type definition? |
10:50:16 | PMunch | Or the const part? |
11:01:28 | * | jholland__ quit (Quit: Connection closed for inactivity) |
11:05:57 | PMunch | Static block around the const doesn't work: https://play.nim-lang.org/#ix=2ThY |
11:15:48 | ForumUpdaterBot | New 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:32 | FromDiscord | <Livingstone> sent a code paste, see https://paste.rs/gvC |
12:36:50 | FromDiscord | <Livingstone> can someone help me understand this error |
12:36:51 | FromDiscord | <Livingstone> https://play.nim-lang.org/#ix=2Tio |
12:38:19 | FromDiscord | <Zachary Carter> you're trying to use the subscript operator on a collection with fewer than 100 elements |
12:38:50 | FromDiscord | <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:05 | FromDiscord | <Zachary Carter> also referred to as an out of bounds exception |
12:39:33 | FromDiscord | <Zachary Carter> the subscript operator is `[]` |
12:40:42 | FromDiscord | <Zachary Carter> https://play.nim-lang.org/#ix=2Tiq will result in the same error |
12:42:42 | FromDiscord | <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:11 | FromDiscord | <Zachary Carter> (edit) "or" => "and" |
12:43:29 | FromDiscord | <Zachary Carter> but you're iterating over both collections using the same range on line 45 |
12:43:55 | FromDiscord | <Zachary Carter> @Livingstone I hope this explanation helps you |
12:44:30 | FromDiscord | <Livingstone> ah ok |
12:51:22 | FromDiscord | <Livingstone> In reply to @Zachary Carter "you're trying to use": yeah I got it thanks |
12:57:24 | FromDiscord | <Livingstone> In reply to @Zachary Carter "you're trying to use": How did you identify which one was the problem? |
13:02:32 | FromDiscord | <Zachary Carter> By looking at the for loop |
13:02:59 | FromDiscord | <Zachary Carter> the high end of your range is the length of actual |
13:03:08 | FromDiscord | <Zachary Carter> so it must be predicted then right? |
13:06:36 | FromDiscord | <Livingstone> I fixed the problem by changing line 69 to actual.add(row[^1]) though |
13:07:41 | FromDiscord | <Zachary Carter> okay so now actual has less elements in it right? |
13:08:05 | FromDiscord | <Livingstone> does it I thought that just added the last element |
13:08:08 | FromDiscord | <Livingstone> of row |
13:08:27 | FromDiscord | <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:38 | FromDiscord | <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:45 | FromDiscord | <Zachary Carter> I can't step through your program |
13:09:58 | FromDiscord | <Livingstone> the file is just 100 pairs of random numbers |
13:19:02 | * | Vladar quit (Quit: Leaving) |
13:20:07 | ForumUpdaterBot | New thread by Kcvinu: Some suggestions about Nim play gorund and Nim forum., see https://forum.nim-lang.org/t/7656 |
13:20:45 | FromDiscord | <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:13 | FromDiscord | <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:50 | FromDiscord | <Livingstone> do you know of a way to select a random number from a range in nim? |
13:29:50 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2TiB |
13:29:59 | FromDiscord | <Zachary Carter> sample will also work on an array |
13:33:23 | * | rockcavera quit (Remote host closed the connection) |
13:39:59 | FromGitter | <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:51 | Clonkk[m] | I didn't know Britney Spears wrote documentation for Nim https://nim-lang.org/docs/idetools.html |
13:49:20 | PMunch | Huh? |
13:49:27 | PMunch | Oh, the Author.. |
13:50:30 | PMunch | Apparently it has said that since it was created |
13:51:06 | FromDiscord | <Rika> LMAO |
13:52:18 | PMunch | Not sure if it was migrated from somewhere else though |
13:53:55 | Clonkk[m] | Some language are backed by Google or Mozilla; Nim is backed by early 2000's pop stars. |
13:56:22 | FromDiscord | <Rika> lmao |
13:57:20 | PMunch | Would be great if some reporter managed to contact her and ask her about it :P |
13:57:34 | PMunch | Wasn't there a movie that just came out about her? |
13:58:21 | PMunch | Imagine 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:00 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2TiO |
14:02:50 | FromDiscord | <Livingstone> why doesnt dataset.delete(dataset[1]) work? |
14:03:02 | FromDiscord | <Livingstone> (edit) "why doesnt dataset.delete(dataset[1]) ... work?" added ")" |
14:04:36 | FromDiscord | <Rika> you dont pass the element, you pass the index |
14:09:16 | FromDiscord | <Livingstone> sent a code paste, see https://play.nim-lang.org/#ix=2TiP |
14:10:16 | * | joast joined #nim |
14:11:28 | FromDiscord | <Livingstone> does this make sense? |
14:14:23 | FromDiscord | <Rika> pretty sure yea |
14:14:52 | * | lritter joined #nim |
14:19:06 | Clonkk[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:11 | Clonkk[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:43 | FromDiscord | <Goel> sent a long message, see http://ix.io/2Tj7 |
14:53:58 | FromDiscord | <Rika> https://nim-lang.org/docs/colors.html |
14:54:33 | FromDiscord | <Rika> will need to convert but i believe theres a proc for that too |
14:58:27 | FromDiscord | <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:00 | FromDiscord | <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:26 | narimiran | @whisperdev can you be more specific about "does not work"? |
15:18:11 | FromDiscord | <whisperdev> @nariminar: to me it looks like match groups dont match. |
15:18:19 | FromDiscord | <whisperdev> if you click on the links I pasted |
15:18:29 | narimiran | i did click |
15:18:41 | narimiran | nim version doesn't print a group, but a match |
15:19:01 | FromDiscord | <whisperdev> I just want the test_website--production |
15:22:43 | FromDiscord | <whisperdev> I am not really proficient with regexes I use cheat sheet for that π |
15:23:21 | narimiran | then i would suggest `strscans.scanf` - easier to understand and easier to use |
15:25:47 | FromDiscord | <whisperdev> But you can see that the regexes dont match right? |
15:25:49 | FromDiscord | <whisperdev> Or..? |
15:26:02 | narimiran | it is not that they don't match |
15:26:29 | narimiran | you want a group (stuff inside of `(...)`), and you're given the full match |
15:27:33 | narimiran | here'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:15 | FromDiscord | <whisperdev> Thanks I guess? |
15:34:26 | FromDiscord | <whisperdev> So what do I need to look for in these regex implementations? |
15:34:38 | FromDiscord | <whisperdev> I was looking to use the pure nim implementation from nitely |
15:34:47 | FromDiscord | <whisperdev> But decided to try with the stdlib one first |
15:34:54 | FromDiscord | <Rika> re is based on pcre |
15:34:57 | FromDiscord | <whisperdev> just to play around with the regexes |
15:37:42 | FromDiscord | <clyybber> In reply to @Clonkk "I didn't know Britney": lmao what |
15:40:20 | Prestige | @whisperdev https://play.nim-lang.org/#ix=2TjE |
15:40:35 | Prestige | see https://nim-lang.org/docs/re.html#%3D~.t%2Cstring%2CRegex |
15:42:58 | FromDiscord | <exelotl> In reply to @Clyybber "lmao what": tox ic intensifies https://aurensnyder.bandcamp.com/track/tox-ic |
15:43:49 | narimiran | @whisperdev, Prestige is there a reason why the pattern isn't just a simple `"(.+)"`? |
15:44:06 | FromDiscord | <Rika> greedy |
15:44:12 | FromDiscord | <Rika> prolly wants lazy |
15:44:14 | Prestige | I just copied his, could just .+? |
15:44:15 | FromDiscord | <Rika> so .+? |
15:57:05 | * | superbia joined #nim |
16:04:12 | FromDiscord | <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:54 | FromDiscord | <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:32 | FromDiscord | <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:51 | FromDiscord | <zetashift> Those are all the ones I know of too |
16:09:06 | FromDiscord | <zetashift> https://github.com/disruptek/disruptek/blob/master/style.md#method-call-syntax-command-syntax-function-call-syntax here are some more |
16:09:23 | FromDiscord | <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:45 | FromDiscord | <zetashift> Probably not THE Nim faq but just a more general one? |
16:16:35 | FromDiscord | <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:05 | FromGitter | <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:00 | Clonkk[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:28 | FromDiscord | <Rika> In reply to @KnorrFG "i write a library,": i believe that shouldnt happen... |
16:26:44 | FromDiscord | <Yardanico> @gogolxdong this is not related at all really |
16:27:06 | FromDiscord | <Yardanico> Nim already does cycle detection at compile time, but that only works for simple cafes |
16:27:11 | FromDiscord | <Yardanico> (edit) "cafes" => "cases" |
16:27:18 | FromDiscord | <Yardanico> Otherwise we wouldn't have needed ORC |
16:31:21 | FromDiscord | <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:03 | FromDiscord | <Zachary Carter> The forum should prevent you from posting if you're not logged in |
16:35:39 | FromDiscord | <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:47 | FromDiscord | <Zachary Carter> tired of typing out replies and then realizing I'm not logged in lol |
16:36:00 | FromDiscord | <Zachary Carter> and then the page posting back and me losing my reply |
16:38:12 | FromDiscord | <Rika> copy it first then log in |
16:38:16 | FromDiscord | <Rika> then paste |
16:39:47 | FromDiscord | <Zachary Carter> I mean yes but it's annoying |
16:39:59 | FromDiscord | <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:58 | FromDiscord | <Yardanico> In reply to @Zachary Carter "The forum should prevent": You don't lose the reply though |
17:01:15 | FromDiscord | <Yardanico> Since Nim forum is SPA you can login with your reply in the field and it'll still be there |
17:01:22 | FromDiscord | <Yardanico> I just tried |
17:01:59 | * | waleee-cl joined #nim |
17:06:43 | * | vicfred joined #nim |
17:27:57 | FromDiscord | <jfmonty2> sent a code paste, see https://play.nim-lang.org/#ix=2Tki |
17:29:15 | FromDiscord | <jfmonty2> (edit) |
17:29:36 | FromDiscord | <jfmonty2> (edit) |
17:33:55 | * | Vladar joined #nim |
17:35:51 | FromDiscord | <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:53 | FromDiscord | <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:45 | Wezl | I have a friend who keeps recommending nim to me, what are some good counter-arguments? |
18:39:49 | Prestige | Once you use Nim you won't enjoy programming in other languages. Does that count? |
18:40:01 | Wezl | no |
18:40:07 | Prestige | Well I'm all out |
18:40:22 | Wezl | is there a better place to ask? |
18:40:47 | Prestige | On 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:52 | FromDiscord | <konsumlamm> most people there probably don't know Nim though |
18:53:25 | Wezl | perhaps they'll support my argument more then ::) |
18:54:23 | Wezl | does nim have any keywords (alphanumeric words built-in to the lexer)? |
18:57:02 | Prestige | https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords ? |
18:58:54 | Wezl | I don't know whether I should be happy or sad now that I have that as an argument, but thanks |
18:59:20 | FromDiscord | <dom96> Wezl: what's your language of choice? |
18:59:49 | Wezl | dom96: lisp, scheme, my own version of lisp |
19:02:53 | Wezl | (at least there's stropping, an improvement over most languages) |
19:06:20 | FromDiscord | <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:29 | Wezl | I can't say lisp is better there :( |
19:11:01 | FromDiscord | <Yardanico> apparently now `` works in github issue titles https://media.discordapp.net/attachments/371759389889003532/822185336720326706/unknown.png |
19:11:15 | Prestige | Nice |
19:11:53 | FromDiscord | <exelotl> woahhh |
19:12:06 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/822185608821997568/unknown.png |
19:12:09 | FromDiscord | <Yardanico> took them long enough |
19:13:03 | Wezl | oh, one of my other arguments against nim is that it's on github |
19:13:23 | FromDiscord | <Yardanico> where would you prefer it to be? |
19:13:43 | FromDiscord | <Yardanico> having it on github allows for wider audience and it's easier for contributors since github is the most popular |
19:13:45 | Wezl | gitea or sr.ht |
19:13:56 | FromDiscord | <Yardanico> that'll raise up the bar for contributions sadly |
19:14:18 | Wezl | "took them long enough" is not a problem elsewhere (on a floss hoster) |
19:15:40 | FromDiscord | <Yardanico> I didn't say that it's such a big issue |
19:15:42 | FromDiscord | <Yardanico> it's just nice to have |
19:16:35 | Wezl | right, but what if github thinks you infringed on some copyright, or something? |
19:16:46 | FromDiscord | <Yardanico> we don't infringe on copyright |
19:17:04 | FromDiscord | <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:14 | Wezl | that's not my point, it just matters if MS thinks you do |
19:17:17 | FromDiscord | <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:17 | FromDiscord | <Yardanico> so in addition to maintaining the software itself you have to maintain your instance |
19:17:23 | FromDiscord | <Yardanico> @Wezl it's not related to MS |
19:17:29 | FromDiscord | <Yardanico> it's about US' DMCA laws |
19:17:50 | Wezl | you can use a gitea hosted outside of the US |
19:18:03 | Wezl | Hi02Hi: yes |
19:18:12 | FromDiscord | <zidsal> surley we should cross that bridge if it becoems an issue? git is decentralised after all |
19:18:22 | FromDiscord | <zidsal> until then why wouldn't you use github? |
19:18:26 | FromDiscord | <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:30 | FromDiscord | <Yardanico> @zidsal exactly |
19:18:41 | FromDiscord | <Yardanico> @Wezl anyway, I don't think it's worth the effort |
19:18:50 | FromDiscord | <Yardanico> it'll make nim harder to contribute to, and harder to discover for other people |
19:18:53 | FromDiscord | <haxscramper> I want to have something like `$$VARNAME = "true"` syntax for assigning environment variables, |
19:19:07 | Wezl | but it doesn't really help because you could put an underscore at the beginning instead of stropping |
19:19:36 | Wezl | haxscramper: and you can do that with lisp :) search 'setf defmethod lisp' or smt like that |
19:19:41 | FromDiscord | <dom96> the problem is that the issue tracker isn't decentralised |
19:19:48 | FromDiscord | <Yardanico> surely there are tools to mirror it to somewhere |
19:19:50 | FromDiscord | <Yardanico> or just to backup |
19:20:06 | FromDiscord | <dom96> lol |
19:20:09 | Wezl | also there are problems with discord, but that's not necessarily relevant to nim |
19:20:11 | FromDiscord | <dom96> there are tools to mirror svn too |
19:20:26 | FromDiscord | <Yardanico> @Wezl for that exact reason we maintain a bridge |
19:20:29 | haxscramper | Wezl: 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:39 | FromDiscord | <Yardanico> but most people have started to prefer discord over the last few years |
19:21:44 | Wezl | haxscramper: evidence? sbcl has many optimization options and most lisps have at least basic (declare)s |
19:22:27 | FromDiscord | <Yardanico> but still it's not _mandatory_ |
19:22:57 | Wezl | (though lisp doesn't place efficiency above expressiveness) |
19:23:08 | Wezl | Yardanico: I don't think it should be |
19:23:26 | Wezl | (oh, I thought you meant type annotations) |
19:24:18 | Wezl | (sbsl is not an obscure dialect at all btw) |
19:24:22 | Wezl | *sbcl |
19:24:31 | FromDiscord | <Yardanico> yeah I know that sbcl is one of the most commonly used CL impls |
19:28:51 | haxscramper | Yes, 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:51 | haxscramper | function 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:02 | haxscramper | And other nice parts of built-in static type system |
19:29:21 | ForumUpdaterBot | New 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:35 | Wezl | search for 'CLOS defgeneric' |
19:30:12 | FromDiscord | <Kiloneie> https://youtu.be/xjIjyMiJIF8 |
19:30:24 | Wezl | a truly flexible language does things like miniknren effortlessly |
19:30:27 | FromDiscord | <Kiloneie> (i can't post on reddit... it's all greyed out D:...) |
19:30:44 | Wezl | (and maybe a "truly flexible language" could include nim) |
19:31:09 | haxscramper | You mean http://minikanren.org/? |
19:31:14 | Wezl | yes |
19:31:45 | * | liblq-devel quit (Quit: WeeChat 3.1) |
19:32:38 | jfondren[m] | eh there are Go, OCaml and Rust implementations there, so Nim's just a matter of interest |
19:32:58 | Prestige | I find Wezl's use of parens entertaining |
19:33:28 | Wezl | I'll take that as a compliment, but why? |
19:34:03 | Prestige | Just because you're into lisp and use a lot of parens |
19:34:40 | Wezl | I use parentheses for side notes, lisp uses parentheses to show functionality |
19:35:23 | Wezl | (as a side note: why does nim place efficiency over expressiveness and elegance?) |
19:35:48 | narimiran | (can one reply to a side note in a regular comment?) |
19:35:49 | Wezl | * side question |
19:36:16 | FromDiscord | <Kiloneie> Why can't i post in r/nim ? |
19:36:27 | haxscramper | Well, after using emacs for 4+? years, (== seveal years of lisp experience) I would say that nim wins when it comes to expresiveness |
19:36:42 | haxscramper | emacs lisp is quite bad dialect overall though |
19:36:52 | Wezl | (narimiran: yes, though I'm not sure if it's good style (:)) too) |
19:36:53 | * | jess quit (Quit: update innit) |
19:37:30 | narimiran | i.might(start) answering.like(this) |
19:37:40 | Wezl | ew |
19:38:09 | Wezl | no offense, but that's the wrong way to do OOP |
19:38:25 | * | j joined #nim |
19:38:30 | haxscramper | It is just UFCS for function calls, no OOP was involved here |
19:38:44 | FromDiscord | <Yardanico> shh, don't tell them |
19:39:05 | Wezl | I still prefer smalltalk's syntax |
19:40:34 | FromDiscord | <Kiloneie> Please retweet Nim overlords mah video D: |
19:40:35 | FromDiscord | <Yardanico> btw #nim-offtopic exists, just saying :P |
19:41:00 | FromDiscord | <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:02 | narimiran | not only it exists, it uses lisp-like hypen in its name! |
19:41:13 | FromDiscord | <Yardanico> @Goel nim playground uses ix.io |
19:41:16 | * | j is now known as jess |
19:41:18 | FromDiscord | <Yardanico> and it saves for a very long time |
19:41:37 | Wezl | narimiran: what does? |
19:41:38 | FromDiscord | <Yardanico> http://ix.io/ |
19:41:46 | FromDiscord | <Yardanico> @Wezl #nim-offtopic |
19:42:30 | Wezl | well 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:57 | FromGitter | <bung87> how to get unix-like os release name ? |
19:56:53 | FromGitter | <bung87> equals to `os.release()` in nodejs |
19:57:40 | FromDiscord | <jfmonty2> `uname -r`? |
19:57:55 | FromDiscord | <jfmonty2> on linux at least |
19:58:03 | FromDiscord | <jfmonty2> gives you the kernel version |
20:02:06 | FromGitter | <bung87> any other way that dont need call cmd? |
20:03:25 | FromDiscord | <Yardanico> For Linux you can use https://man7.org/linux/man-pages/man2/uname.2.html |
20:03:31 | FromDiscord | <Yardanico> Not sure if other nix's support this syscall |
20:05:32 | FromGitter | <bung87> Thanks that's what I need |
20:15:40 | * | sz0 joined #nim |
20:25:53 | FromDiscord | <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:35 | FromDiscord | <Yardanico> well, it's safe as in you can have them in a shared table |
20:26:44 | FromDiscord | <Yardanico> but it's up to you to not do bad things with those pointers |
20:26:46 | FromDiscord | <brainproxy> I mean is the tuple subject to GC? |
20:26:49 | FromDiscord | <brainproxy> In reply to @Yardanico "but it's up to": sure |
20:30:15 | ForumUpdaterBot | New 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:34 | FromDiscord | <Kiloneie> reddit works !. |
20:30:46 | * | Wezl left #nim ("ping me on #concurr") |
20:32:15 | ForumUpdaterBot | New 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:28 | Prestige | Nice Kiloneie |
20:37:40 | FromDiscord | <Kiloneie> Thanks π |
20:38:58 | * | narimiran quit (Ping timeout: 260 seconds) |
20:40:18 | ForumUpdaterBot | New thread by Lhupfeldt: Regex not hashable?, see https://forum.nim-lang.org/t/7658 |
20:52:39 | FromDiscord | <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:41 | FromDiscord | <Yardanico> wdym "can't @", he was pinged anyway (if he's online) |
20:55:58 | FromDiscord | <Yardanico> but seems like he's not |
20:56:05 | FromDiscord | <Yardanico> he's not around |
20:56:08 | FromDiscord | <Kiloneie> well discord doesn't find him |
20:56:11 | FromDiscord | <Yardanico> (I just checked in IRC) |
20:56:14 | FromDiscord | <Yardanico> well of course because he's in IRC |
20:56:28 | FromDiscord | <Yardanico> There's no way to add ability to auto-complete IRC users from Discord sadly |
20:56:37 | FromDiscord | <Kiloneie> oh well, tomorrow then |
20:57:03 | FromDiscord | <Kiloneie> can't wait for 1000 subs YT program one day already D: |
20:59:28 | FromDiscord | <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:34 | FromDiscord | <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:15 | FromDiscord | <zidsal> ok. I guess I could use testament and check the stdout but that feels evil π |
21:02:34 | FromDiscord | <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:23 | FromDiscord | <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:20 | FromDiscord | <King Crimson> Is reading lines from stdin broken, because it keeps waiting for input if i pipe data from another application. |
21:21:05 | FromDiscord | <Yardanico> can you show the code? |
21:21:19 | FromDiscord | <sealmove> I am trying to setup github workflows for autogenerating documentation on push with `nim doc2 myfile.nim` |
21:22:03 | FromDiscord | <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:35 | FromDiscord | <sealmove> what are my options? :s |
21:23:10 | FromDiscord | <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:37 | FromDiscord | <sealmove> but won't this take a lot of time? |
21:23:54 | FromDiscord | <Yardanico> @sealmove wait, did you actually use apt-get's nim before? |
21:23:54 | FromDiscord | <Yardanico> wtf |
21:23:58 | FromDiscord | <zidsal> building it would, I don't think choosenim is going take any longer then an apt-get |
21:24:02 | FromDiscord | <Yardanico> testing with latest nim takes like 7s on github actions CI |
21:24:15 | FromDiscord | <zidsal> is it really an issue if the action takes 2-3 seconds more? |
21:24:24 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/wiki/BuildServices#github-actions |
21:24:42 | FromDiscord | <sealmove> no, 2-3 seconds is not a problem of course :P |
21:25:06 | FromDiscord | <sealmove> ohhh this is a nice page, thanks! |
21:25:28 | FromDiscord | <Yardanico> its really fast since I suspect github does github-wide caching |
21:26:15 | FromDiscord | <zidsal> they would be mad not to |
21:29:56 | FromDiscord | <King Crimson> sent a code paste, see https://play.nim-lang.org/#ix=2TlR |
21:30:08 | FromDiscord | <Yardanico> huh, why selectors? |
21:30:17 | FromDiscord | <Yardanico> reading from piped input doesn't need selectors really |
21:30:29 | FromDiscord | <King Crimson> Dunno, new to nim |
21:30:57 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TlS |
21:31:39 | Prestige | Anyone 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:53 | FromDiscord | <Yardanico> I'm somewhat familiar with it |
21:32:05 | FromDiscord | <King Crimson> Same issue |
21:32:29 | FromDiscord | <Yardanico> @Prestige are you sure you pass username and password to newAsyncIrcClient ? |
21:32:37 | FromDiscord | <Yardanico> @King Crimson weird, it works for me here when piping something into it |
21:32:42 | FromDiscord | <Yardanico> @Prestige for example https://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L555 |
21:32:50 | Prestige | I'm just using "newIrc" |
21:33:28 | Prestige | Is "serverPass" supposed to be the password of the user? |
21:33:34 | FromDiscord | <Yardanico> yes |
21:33:40 | FromDiscord | <Yardanico> https://github.com/nim-lang/irc/blob/master/src/irc.nim#L310 |
21:33:55 | FromDiscord | <Yardanico> otherwise you can just manually send a msg to NickServ after `connect`ing |
21:33:59 | Prestige | aha, thanks. That wasn't clear to me |
21:34:07 | Prestige | Yeah that's what I was doing but the timing was off |
21:34:15 | FromDiscord | <Yardanico> you can always sleep :D |
21:34:24 | FromDiscord | <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:49 | FromDiscord | <Yardanico> how are you piping data into it? |
21:34:49 | Prestige | Unreliable but this worked, ty |
21:36:10 | FromDiscord | <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:16 | FromDiscord | <King Crimson> i mean openconnect will write to stdin the values it wants to pass to the script or binary the file |
21:40:31 | FromDiscord | <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:51 | FromDiscord | <Yardanico> does it only write 1 line?> |
21:41:36 | FromDiscord | <King Crimson> In my scenario i get 4 lines |
21:42:57 | FromDiscord | <zidsal> sent a code paste, see https://paste.rs/Yhv |
21:43:08 | FromDiscord | <King Crimson> sure |
21:43:28 | FromDiscord | <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:44 | FromDiscord | <Yardanico> you need to use github pages for that |
21:43:52 | FromDiscord | <Yardanico> or htmlpreview |
21:43:57 | FromDiscord | <Yardanico> https://htmlpreview.github.io/ |
21:44:10 | FromDiscord | <Yardanico> (don't forget to upload the nimdoc.css too) |
21:44:33 | FromDiscord | <zidsal> pfft css is overrated, everyone uses screen readers |
21:45:25 | FromDiscord | <Yardanico> heresy! nimdoc css is a holy artifact and thus must be preserved for all of the eternity |
21:45:43 | FromDiscord | <sealmove> github pages are free? |
21:45:54 | FromDiscord | <zidsal> I believe 1 is per account |
21:46:14 | FromDiscord | <Yardanico> @sealmove you get a free subdomain for serving static pages |
21:46:23 | FromDiscord | <Yardanico> yourgithubnickname.github.io |
21:46:23 | FromDiscord | <sealmove> niiiice |
21:46:27 | FromDiscord | <King Crimson> https://media.discordapp.net/attachments/371759389889003532/822224452766924800/unknown.png |
21:47:03 | FromDiscord | <Yardanico> @King Crimson are you sure it actually passes data as stdin and not as program arguments? |
21:48:23 | FromDiscord | <King Crimson> https://media.discordapp.net/attachments/371759389889003532/822224942376550421/unknown.png |
21:48:32 | FromDiscord | <Yardanico> hm |
21:48:35 | FromDiscord | <King Crimson> this is what i get before stdin.readline stops working |
21:49:10 | FromDiscord | <King Crimson> But yeah it does both actually, but the data i need comes from stdin |
21:49:31 | FromDiscord | <zidsal> but I'm not convinced you have a stdin π |
21:50:53 | FromDiscord | <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:24 | FromDiscord | <King Crimson> Do you mean my nim application? |
21:52:48 | FromDiscord | <King Crimson> yeah |
21:52:48 | FromDiscord | <King Crimson> (edit) "application?" => "binary?" |
21:53:43 | FromDiscord | <zidsal> just to check are you running -script or -S,--script-tun ? |
21:55:46 | FromDiscord | <King Crimson> sent a code paste, see https://play.nim-lang.org/#ix= |
21:56:32 | FromDiscord | <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:40 | FromDiscord | <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:42 | FromDiscord | <King Crimson> Well im no better π |
21:57:54 | FromDiscord | <King Crimson> Yeah that is where i'm reading the data from |
21:57:58 | FromDiscord | <Yardanico> @sealmove you don't have to do that |
21:58:01 | FromDiscord | <Yardanico> you can have a github-pages branch |
21:58:09 | FromDiscord | <Yardanico> https://docs.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site |
21:58:24 | FromDiscord | <King Crimson> But it seams that readline maybe doesn't detect eof |
21:58:29 | FromDiscord | <Yardanico> you can also just choose the /docs folder |
21:58:32 | * | so quit (Ping timeout: 246 seconds) |
21:58:39 | FromDiscord | <Yardanico> as a source for github pages for the repo |
21:58:39 | FromDiscord | <Yardanico> https://docs.github.com/en/github/working-with-github-pages/creating-a-github-pages-site |
21:58:46 | FromDiscord | <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:44 | FromDiscord | <Yardanico> @sealmove just go into repo settings and choose something like this https://media.discordapp.net/attachments/371759389889003532/822227800156012554/unknown.png |
22:00:19 | FromDiscord | <sealmove> wow, that's nice |
22:04:45 | FromDiscord | <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:55 | FromDiscord | <King Crimson> Yeah maybe, but shouldn't it be possible to read data from a socket? |
22:10:41 | FromDiscord | <zidsal> definitely, but what kind of socket is this π |
22:11:15 | FromDiscord | <King Crimson> it's the fd 0 https://en.wikipedia.org/wiki/File_descriptor |
22:14:49 | FromDiscord | <King Crimson> Maybe i should connect to the socket and read from the socket rather than stdin |
22:15:24 | FromDiscord | <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:24 | FromDiscord | <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:47 | FromDiscord | <Yardanico> they should be available almost instantly in sealmove.github.io/reponame/file.html |
22:17:51 | FromDiscord | <Yardanico> for index.html you don't need to provide file.html of course |
22:18:10 | FromDiscord | <Yardanico> @sealmove https://sealmove.github.io/binarylang/binarylang.html |
22:18:30 | FromDiscord | <sealmove> oh nice |
22:18:31 | FromDiscord | <Yardanico> you can rename binarylang.html to index.html so that https://sealmove.github.io/binarylang/ works |
22:19:15 | FromDiscord | <sealmove> oh thanks :) |
22:19:27 | FromDiscord | <Yardanico> `nim doc2 binarylang.nim` |
22:19:31 | FromDiscord | <sealmove> it's confusing because https://github.com/sealmove/sealmove.github.io is blank |
22:19:34 | FromDiscord | <King Crimson> In reply to @zidsal "ok I found this": I was thinking of just using the net library |
22:19:44 | FromDiscord | <Yardanico> you can just do `nim doc2 -o:index.html binarylang.nim` |
22:19:52 | FromDiscord | <Yardanico> (edit) "-o:index.html" => "-o:htmldocs/index.html" |
22:19:58 | FromDiscord | <zidsal> @King Crimson thats what I am looking at, trying to work out what options you need to pass to newSocket π |
22:21:33 | FromDiscord | <zidsal> you could prob use ` proc connectUnix(socket: Socket, path: string) =` if you knew where in \proc the fd is |
22:29:05 | FromDiscord | <King Crimson> sent a code paste, see https://play.nim-lang.org/#ix=2Tmc |
22:29:25 | FromDiscord | <King Crimson> Maybe not raw |
22:32:08 | FromDiscord | <zidsal> anyway I'm going to bed now n guys |
22:32:30 | FromDiscord | <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:39 | FromGitter | <gogolxdong> @Yardanico why not inject some code like this to break cycle since compile time detection? |
23:00:01 | FromDiscord | <Yardanico> @gogolxdong you might want to ask Araq, I don't know much about this |
23:00:18 | FromDiscord | <Yardanico> but IIRC before ORC he tried breaking cycles but he ended up using the algo used in ORC now |
23:19:05 | FromDiscord | <clyybber> it's based on the same principles |
23:19:21 | FromDiscord | <clyybber> but manual cycle breaking isn't really equivalent to cycle collection |
23:20:24 | FromDiscord | <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:36 | FromDiscord | <Seedofarson> hmmm |
23:31:58 | FromDiscord | <Seedofarson> there are a few modules from base libary that dont work with nim ---> JS compiling |
23:32:05 | FromDiscord | <Yardanico> yes, that's to be expected |
23:32:14 | FromDiscord | <Seedofarson> Is there a list anywhere though |
23:32:34 | FromDiscord | <Seedofarson> It's totally expected and im not complaining. I just havent been able to find a definitive list haha |
23:32:37 | FromDiscord | <ElegantBeef> The easy rule is that if it's related to the system or is impure it's not going to work |
23:32:49 | FromDiscord | <Yardanico> some list is https://github.com/nim-lang/Nim/wiki/Standard-library-and-the-JavaScript-backend |
23:32:52 | FromDiscord | <Yardanico> but really it's easy to try |
23:33:00 | FromDiscord | <Yardanico> (that list is not complete) |
23:33:14 | FromDiscord | <Yardanico> it's been extended after some more JS fixes relatively recently |
23:33:26 | FromDiscord | <Seedofarson> awesome |
23:33:28 | FromDiscord | <Seedofarson> thank you! |
23:33:43 | FromDiscord | <Seedofarson> http client \:( rip |
23:34:03 | FromDiscord | <ElegantBeef> There are js http clients |
23:34:04 | FromDiscord | <sealmove> Can I directly render a `.rst` with nim without it being in a nim module and commented? |
23:34:05 | FromDiscord | <Yardanico> it uses sockets so it's not easy to port it to the JS backend with the same api |
23:34:09 | FromDiscord | <Yardanico> @sealmove of course |
23:34:10 | FromDiscord | <Yardanico> nim rst2html |
23:34:15 | FromDiscord | <sealmove> nice |
23:34:30 | FromDiscord | <Yardanico> you can also use the rst module programmaticaly |
23:34:31 | FromDiscord | <Yardanico> (edit) "programmaticaly" => "programmatically" |
23:34:43 | FromDiscord | <ElegantBeef> yea got 3 rst modules in the stdlib |
23:34:49 | FromDiscord | <Yardanico> no |
23:35:03 | FromDiscord | <ElegantBeef> What do you mean "no" |
23:35:13 | FromDiscord | <Yardanico> your message sounded like they're redundant :) |
23:35:31 | FromDiscord | <ElegantBeef> Ah |
23:35:35 | FromDiscord | <Yardanico> but they're just well separated - parser, html/latex generator |
23:35:38 | FromDiscord | <Yardanico> and what's the third one? |
23:35:42 | FromDiscord | <ElegantBeef> ast |
23:35:47 | FromDiscord | <Yardanico> ???????? |
23:35:58 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/rstast.html |
23:36:10 | FromDiscord | <Yardanico> well, even more logical :P |
23:36:16 | FromDiscord | <Yardanico> ast, parser, html/latex generator |
23:36:43 | FromDiscord | <Yardanico> for json we have a parser and json -> nim (and nim -> json) module too |
23:36:46 | FromDiscord | <Yardanico> https://nim-lang.org/docs/parsejson.html |
23:40:57 | FromDiscord | <gogolxdong> @clyybber are you saying there is only possible to know whether cyclic structure are the last read in runtime ? |
23:41:37 | FromDiscord | <clyybber> generally it's only possible to know whether a structure will be used later on at runtime |
23:41:40 | FromDiscord | <clyybber> for refs that is |
23:42:02 | FromDiscord | <clyybber> unless they don't escape or don't come from somewhere external |
23:42:12 | FromDiscord | <clyybber> so the same applies to cyclic structures |
23:42:38 | FromDiscord | <clyybber> so manual cycle breaking is like manual memory management |
23:42:54 | FromDiscord | <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:18 | FromDiscord | <sealmove> So I can't just move them in a seperate rst file |
23:44:47 | FromDiscord | <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:53 | FromDiscord | <Seedofarson> when I was trying to learn ReactJS |
23:44:54 | FromDiscord | <Seedofarson> lmao |
23:45:18 | FromDiscord | <Seedofarson> (edit) "trying" => "supposed" | "learn" => "be learning" |
23:58:33 | * | superbia quit (Ping timeout: 260 seconds) |