<< 02-11-2020 >>

00:53:07*mbomba joined #nim
01:17:31*Tanger joined #nim
01:44:04*abm quit (Read error: Connection reset by peer)
01:53:40*mbomba quit (Quit: WeeChat 2.9)
02:06:23*unihernandez22 joined #nim
02:12:38*apahl quit (Ping timeout: 264 seconds)
02:14:30*apahl joined #nim
02:23:47FromDiscord<courtier> i know ive been bugging you people but can anyone help me with pkcs5 padding?
02:44:15*jrhawley[m] joined #nim
03:01:35*mbomba joined #nim
03:14:26*muffindrake quit (Ping timeout: 264 seconds)
03:16:33*muffindrake joined #nim
03:19:25*a_chou joined #nim
03:23:05*a_chou quit (Remote host closed the connection)
03:27:48FromGitter<sealmove> What is NimCEF?
03:28:54FromGitter<sealmove> Chromium?
03:29:06PrestigeWhere did you see that?
03:31:27FromDiscord<Yardanico> !repo nimcef
03:31:28disbothttps://github.com/jangko/nimCEF -- 9nimCEF: 11Nim wrapper for the Chromium Embedded Framework 15 22⭐ 1🍴
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:38*supakeen joined #nim
04:46:35FromDiscord<flywind> Is it possible to implement closure iterator for JS backend?
04:47:42FromDiscord<flywind> JS backend could error for closure iterator anyway.
04:47:49FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2CKz
04:54:58*vicfred quit (Quit: Leaving)
05:04:44*unihernandez22 quit (Quit: leaving)
05:11:04FromDiscord<PizzaFox> surely the `algorithm` lib should use cool timsort instead of cringe iterative merge sort
05:12:48FromDiscord<PizzaFox> i so no real reason to use a mergesort
05:13:10FromDiscord<PizzaFox> timsort is the same but has a best case of O(n) instead of O(n log n)
05:13:53FromDiscord<PizzaFox> (edit) "so" => "see"
05:14:43FromDiscord<ElegantBeef> Just use stalinsort and get O(1)
05:14:57FromDiscord<ElegantBeef> Sorry O(n) constantly
05:30:32*keisterfish is now known as disruptek
05:35:00*letto quit (Quit: Konversation terminated!)
05:36:54*letto joined #nim
05:38:40*mbomba quit (Quit: WeeChat 2.9)
05:47:43*astronavt quit (Quit: Leaving)
05:52:26*narimiran joined #nim
05:54:24*apahl quit (Ping timeout: 240 seconds)
05:55:44*apahl joined #nim
06:24:57FromDiscord<Idefau> an empty list is a sorted list!
06:25:37FromDiscord<Revenant> i want to log all Defects before exit, how do i do that? use case is i want to write the stacktraces to a log file so users can submit it with the bug reports if the app crashes
06:32:04FromDiscord<Revenant> ignore... figured out i can catch Exceptions too, not just CatchableErrors...
06:41:03FromDiscord<nikki> is there a quick way to do bitwise or 🤔 i have some constants to pass to SDL and i wanted to 'or' them
06:41:05FromDiscord<Rika> Defects can be caught by default, but there is a mode where you cannot
06:41:08FromDiscord<nikki> or do i have to go through a bitset
06:41:15FromDiscord<Rika> `or` is bitwise when done with numbers
06:41:30FromDiscord<Rika> there is also a module called `bitops` that defines a proc `bitor`
06:42:00FromDiscord<Rika> !eval echo 2 or 5
06:42:04NimBot7
06:42:07FromDiscord<nikki> awesome thanks 😄
07:04:11*Tlangir joined #nim
07:06:47*Tanger quit (Ping timeout: 260 seconds)
07:08:01*solitudesf joined #nim
07:14:53FromDiscord<shashlick> @leorize - this rpath nonsense is a nightmare - got it working on linux, but osx has its own way of doing things, and windows is also completely different
07:33:53FromDiscord<Yardanico> Yesss there is technical possibility
07:33:59FromDiscord<Yardanico> Fiber to my flat
07:34:04FromDiscord<Yardanico> 500mbp
07:34:06FromDiscord<Yardanico> s
07:47:03Zevvdude stop boasting about your russion internets
07:47:09Zevvwe know, right :)
07:47:28FromDiscord<Yardanico> No you don't get it
07:47:37FromDiscord<Yardanico> I've max had 100mbps in my life
07:47:42FromDiscord<Yardanico> and now 500
07:47:49FromDiscord<Yardanico> it's cheap yes
07:48:01FromDiscord<Yardanico> But need a media converter and a router (which I already bought)
07:49:00FromDiscord<lqdev> yardardanico shut up, i have to put up with a shitty 10Mbps connection on a daily basis where usually it reaches less than 5Mbps
07:49:14FromDiscord<lqdev> 100Mbps would be a miracle living in such a shithole
07:49:21Zevvdon't let disruptek hear you guys
07:49:30Zevvhe's on 64Kbit with a 200Mb daily cap
07:49:40FromDiscord<lqdev> zevv you fool
07:49:44FromDiscord<lqdev> you just called him!!
07:49:50Zevvhe's asleep
07:51:30FromDiscord<lqdev> oh
07:55:23FromDiscord<Rika> ~~your media converter can be your router if its strong enough~~
07:56:17*vicfred joined #nim
07:58:07*Vladar joined #nim
07:59:11*PMunch joined #nim
08:01:01Zevvfiber to ethernet is common gear these days, right?
08:01:35Zevvfrom there on it's typically PPPoE, so you just route it through some linux thing and do your routing and NAT there
08:08:18PMunchHmm, started getting this error on 1.4.0: Error: cannot use symbol of kind 'param' as a 'var'
08:09:23PMunchProbably because I'm lifting type information from a getImpl
08:18:49PMunchIs there a way to de-sym a tree?
08:19:06PMunchBasically I have this: http://ix.io/2CLc
08:19:21PMunchBut I'd want those syms to be idents
08:21:29FromDiscord<lqdev> get an untyped AST in the first place?
08:21:54FromDiscord<lqdev> walk the AST and replace every node.kind == nnkSym with an ident(node.strVal)?
08:21:57PMunchWell I get it from getImpl..
08:22:10PMunchYeah that's what I'm implementing now..
08:22:29PMunchBut it's a bit annoying that this worked in 1.2.6
08:22:46PMunchAnd now I need to implement my own tree walker to undo something
08:26:58*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
08:29:47*Lord_Nightmare joined #nim
08:30:40PMunchThis did the trick: http://ix.io/2CLe
08:30:45PMunchBut still, quite annoying..
08:35:32FromDiscord<Yardanico> @Rika good joek
08:35:38FromDiscord<Yardanico> but I think they'll provide their own one
08:35:57FromDiscord<Yardanico> the problem with buying media converters myself is that then I need to know the exact wavelengths
08:36:00FromDiscord<Yardanico> of the fiber connection
08:42:02*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:05:19*Tlangir quit (Quit: Leaving)
09:16:39*krux02 joined #nim
10:26:22*lum_but_somethin joined #nim
10:29:35*Vladar quit (Quit: Leaving)
10:29:37*lum quit (Ping timeout: 260 seconds)
10:36:09*Tanger joined #nim
10:42:43*apahl quit (Quit: WeeChat 2.7)
10:44:08*apahl joined #nim
10:59:28*abm joined #nim
11:07:22ForumUpdaterBotNew thread by Clonk: Generating code coverage with Nim 1.4.0, see https://forum.nim-lang.org/t/7024
11:09:23FromDiscord<Yardanico> turns out I've been bamboozled and they just give me a 4-pair ethernet cable (gigabit)
11:09:28FromDiscord<Yardanico> Which is very good
11:09:36FromDiscord<Yardanico> I wouldn't need to care about all the optic stuff
11:09:39FromDiscord<Rika> thonk
11:09:49FromDiscord<Yardanico> Just plug into router and good to go
11:11:33ZevvPMunch: I have no clue what you're doing, I guess your macros are typed?
11:15:02PMunchZevv, nope. I was getting the signature of a procedure that I only had the symbol for by doing `getImpl`. Then I extracted the arguments `id: int, test: string` for example and added that to a var block. This used to work fine when the `getImpl` returned IdentDefs had Idents in it, but somewhere between 1.2.6 and 1.4.0 this changed to be symbols instead. So now `id` and `test` are symbols with the `param` symbol kind, and thus I can't copy them
11:15:02PMunchdirectly into the variable block.
11:16:02PMunchI "fixed" this by "de-symming" the `getImpl` return: https://github.com/docopt/docopt.nim/pull/51/commits/2fdff42518c891422609edcbb14b800d6c41cfe1
11:16:03disbotAdd procedure dispatch module
11:25:51FromDiscord<Vindaar> PMunch: As far as I'm aware that's the only way to do it. I do it that way where required and I know mratsim does the same
11:26:51FromDiscord<Vindaar> imo there should be a helper for this in the macros module "unsymTree" or something
11:31:09PMunchAgreed!
11:31:54PMunchFeel free to take my `deSym` procedure there and PR it to the macros module
11:36:24Zevvmaybe we also can make a `reSym` so disruptek can finish cps
11:52:07PMunch`reSym`?
12:05:45ZevvWe need syms where we only have idents :)
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:42*supakeen joined #nim
12:09:42PMunchAha, that is a bit trickier :P
12:16:45*narimiran quit (Ping timeout: 240 seconds)
12:18:05*narimiran joined #nim
12:34:05*lritter joined #nim
12:38:49*TomDotTom joined #nim
12:44:24*Kaivo quit (Quit: WeeChat 2.9)
12:47:14AraqI wrote unsem() myself too...
12:48:57*Tanger quit (Remote host closed the connection)
12:49:54FromDiscord<g5becks> Who do I reach out to about my forum account?
12:50:06FromDiscord<g5becks> I signed up a week ago.
12:50:25*Kaivo joined #nim
12:50:26FromDiscord<g5becks> But didn’t verify my email for about 2 days
12:50:31PMunch@dom96 ^
12:50:57FromDiscord<g5becks> @dom96
12:51:28FromDiscord<g5becks> When you get a chance. I need to be able to get a new activation link.
12:52:22FromDiscord<g5becks> On a side note. It’s probably a good idea to be able to resend an activation link from within the forum.
12:55:48PMunchYeah, the sign up process to the forum is a bit of a mess sometimes
12:57:52*sealmove joined #nim
12:58:10sealmoveguys, is it possible to detect an Option type with the `is` operator?
13:01:32mipriyes, just the way you'd do it.
13:01:43mipriare you asking if there's a way to detect if it's any kind of Option[T] type, without knowing the T?
13:01:55sealmoveyeah
13:02:11mipriyeah, no idea. How would you even receive the thing to ask the question?
13:02:38FromDiscord<Rika> I'll try something
13:03:16FromDiscord<Rika> !eval import options; echo some(0) is Option
13:03:19NimBottrue
13:03:24sealmoveoh `let x = some(2); when x is Option:` works
13:03:31sealmoveyeah nice
13:03:35FromDiscord<Rika> !eval import options; echo 0 is Option
13:03:38NimBotfalse
13:03:45FromDiscord<Rika> there
13:04:28sealmoveman this is so convinient
13:05:47mipriah I only tried stuff like Option[_], Option[T] (with no T defined)
13:07:15mipriI was thinking that it'd be nice if the discriminant could be "whether the pointer is null", but what options.nim does with `when is SomePointer` works well enough, too
13:08:07sealmovewhen I implement TLV, nimitai will be pretty much ready-to-use :D
13:08:37mipriTLV?
13:09:05sealmove"type-length-value", will be mapped to object variants in nim
13:11:06sealmovebasically it means that the object's type is determined at runtime
13:11:30sealmovefor example you parse field x, and x tells you what type y is
13:12:52sealmoveKaitai Struct semantics map really nicely to Nim's object variants.
13:16:05sealmovehttps://gist.github.com/sealmove/080f54337a92d24e5ab6c8d61ffe8ecf
14:10:09FromDiscord<Grzegorz Brzęczyszczykiewicz> Why is exception handling disabled on os:standalone?
14:49:16FromDiscord<lqdev> i created a nim syntax plugin for rxi/lite: https://gist.github.com/liquid600pgm/3021d27a038fe701539523042a5f65e5#file-language_nim-lua
14:49:27FromDiscord<lqdev> gonna be trying out that editor for the next few days
14:54:34*madpata joined #nim
15:11:20*oprypin quit (Remote host closed the connection)
15:15:26*oprypin joined #nim
15:27:35disruptekZevv: there's a desym() and a resym() in cps already.
15:27:54disruptekwhat we really need is bug fixes, not new lines.
15:29:00FromDiscord<Grzegorz Brzęczyszczykiewicz> So I've been tweaking the standard library to try to get exceptions to work in os:standalone for wasm, and I managed to make it work, more or less. The exception tests pass (I haven't tested cpp exceptions tho), except for tfinally4. It seems that when you return from a finally block, the exception is supposed to be muted (and that is the behavior for normal builds), but in this case the caller caught the exception.
15:29:33Zevvdisruptek: did you tell clyybber yet?
15:29:56FromDiscord<Clyybber> still busy with the untyped method call fix
15:30:10FromDiscord<Clyybber> Araq: What are you worried about?
15:30:21FromDiscord<Clyybber> Araq: And what is your semityped idea?
15:31:16FromDiscord<Clyybber> Ah, i think I remember. But I don't see how its related
15:34:01FromDiscord<Clyybber> also, can we get the mangling back up?
15:38:55disrupteknah, i've wasted too much of my life on it.
15:39:17FromDiscord<Clyybber> it should not go to waste
15:39:18disrupteki'm not expected to live all that much longer and i have more i want to do.
15:43:11PMunch@Clyybber, did you see that I fixed the notificatcher thing?
15:43:24PMunchBy writing a `deSym` procedure
15:43:33FromDiscord<Clyybber> ah, yeah.
15:44:29FromDiscord<Clyybber> macros.nim should probably have such a thing
15:44:36PMunchYup
15:44:51PMunchWe've all agreed, but none of us could be arsed to actually PR it it seems :P
15:45:46*hnOsmium0001 joined #nim
15:49:08PMunchFor all the "Oooh Python is so easy" comments there are surprisingly many pitfalls in it
15:49:19Zevvuse Lua instead
15:49:32PMunchNo automatic stringification, case sensitivity, etc
15:50:09Zevvtry to do some async I/O
15:50:10PMunchI'm helping my sister with some programming assignment
15:50:13mipriPython being easy is like your uncle still believing that you weigh 8 pounds because the last time he saw you was when you were a baby
15:50:24PMunchAnd she keeps messing up the casing <_<
15:50:36ZevvcaSe maTters!
15:50:48Zevvlet's make fun of all of the languages that don't do Nim casing
15:50:50Oddmongeryäh Lua with löve2D
15:50:52Zevvha ha joke's on you guys!
15:54:07*Vladar joined #nim
15:56:38disrupteklaughing all the way to the tiobe 100.
15:57:43mipriNim's there, it's in "the next 50 programming languages" after 1..50
15:58:04*leorize quit (Remote host closed the connection)
15:58:59*leorize joined #nim
15:59:46PMunchAnd what is the deal with `",".join(map(str, xValues))`?
16:00:06PMunch`xValues.map($).join(",") is so much more readable..
16:01:30mipridoes that actually work, though?
16:01:43PMunchOf course it does
16:01:56mipriwith what imports?
16:02:22PMunch!eval import sequtils, strutils; echo [1, 2, 3].map(`$`).join(",")
16:02:24NimBotCompile failed: /usercode/in.nim(1, 48) Error: '$' cannot be passed to a procvar
16:02:31PMunch!eval import sequtils, strutils; echo [1, 2, 3].mapIt($it).join(",")
16:02:35NimBot1,2,3
16:02:41PMunchI swear that used to work with only map
16:03:18FromDiscord<Clyybber> !eval import sequtils, strutils; echo [1, 2, 3].map(`$`[int]).join(",")
16:03:20NimBotCompile failed: /usercode/in.nim(1, 42) Error: type mismatch: got <array[0..2, int], proc (x: openArray[int]): string{.noSideEffect, gcsafe, locks: 0.} | proc (x: seq[int]): string{.noSideEffect, gcsafe, locks: 0.} | proc (x: set[int]): string{.noSideEffect, gcsafe, locks: 0.}>
16:04:57FromDiscord<kodkuce> is status good
16:13:56*Jesin quit (Ping timeout: 268 seconds)
16:15:21disruptekfair question.
16:18:35Zevvwell, is it
16:24:18disrupteki think one of my socks is smellier than the other.
16:24:22disruptekthat's a thing, right?
16:29:54Zevvit sure is
16:30:02Zevvbut usually it goes away after puberty
16:30:27narimiran:D :D
16:42:58FromGitter<iffy> @ftsf thanks for making NICO! I just made a game/simulation with it: https://www.iffycan.com/stealtheelection/index.html
16:44:25supakeenYea, Nico is *great*.
16:47:28FromDiscord<Avatarfighter> disruptek: just make the socks smell the same smhhh
17:01:25*sealmove quit (Ping timeout: 264 seconds)
17:03:45*narimiran quit (Ping timeout: 240 seconds)
17:37:05FromDiscord<MiniApple> is there some easy game library
17:42:38PMunchWell, Nico should be pretty easy
17:45:20nikki93PMunch: do you happen to test nimlsp on windows much? like test with interactive use in an editor (vs. just headless testing of the server)
17:45:34PMunchNope
17:45:43PMunchI test it on Linux by using it daily
17:46:11PMunchBut I know some people run it on Windows, and I think they use it pretty often
17:46:28nikki93yeah it's been p good for me on linux and mac. on windows i had to do some fiddling of the path <-> uri handling to get "goto def" working-- https://github.com/nikki93/nimlsp/commit/06550873b790d2eac208e6dd343d0c255817f746
17:47:02nikki93but even after that; in a file it shows me errors on `import sibling_file`
17:47:25PMunchHmm, that's not good
17:47:57nikki93why would sibling file import fail / how could i dig into that?
17:48:00FromDiscord<shashlick> is it possible to run code before nimLoadLibrary() runs
17:48:18nikki93the fix above was just my attempts when pushing through it and i'm a nim noob so the code isn't as good as it could be
17:49:26PMunchWell it could be issues with the project file detection
17:50:42nikki93yeah -- i wasn't using nimble or anything in this project; just `nim cpp` on a main file and it finds siblings
17:50:54nikki93there's a 'nim.cfg' adjactent to it tho
17:51:17nikki93oh: building the project works totally fine on windows. just nimlsp issues
17:51:24PMunch@MiniAppl, there is also Enu
17:51:48FromDiscord<MiniApple> Enu?
17:51:58PMunchYou asked for simple game libraries?
17:52:02PMunchI suggested Nico
17:52:03FromDiscord<MiniApple> yes
17:52:21FromDiscord<MiniApple> but i didn't have pico-8
17:52:22PMunchAlso nimgame2, but that is a bit more advanced
17:52:26PMunchHave?
17:52:50PMunchThis was posted about an hour before you asked: https://www.iffycan.com/stealtheelection/index.html
17:52:54PMunchIt is written in Nico
17:53:08FromDiscord<MiniApple> ok thank
17:55:38nikki93if i just go to an empty directory with no nim stuff on the path to it, then make a .nim file there, what should the project file for that be, PMunch ? just that file itself?
17:55:52PMunchYe
17:55:58FromDiscord<courtier> @ftsf thanks for making NICO! I just made a game/simulation with it: https://www.iffycan.com/stealtheelection/index.html↵@iffy verry fun game actually
17:57:19FromDiscord<MiniApple> do i need pico-8 to use nico?
17:57:43PMunchNope
17:58:03FromDiscord<MiniApple> wow
17:59:11PMunchhttps://github.com/ftsf/nico#installation
18:05:58FromGitter<sealmove> PMunch: once i tried to help someone with programming and he was putting spaces between a single identifier, for example he was writing `my X` instead of `myX`
18:06:37Zevvso why is that funny
18:07:40FromGitter<sealmove> didn't say it's funny, but it did surprise me. I mean he was studying computer science and was even beyond first semester
18:08:00FromGitter<sealmove> then you have to take a big step back and explain basics
18:08:10ZevvCS != engineering
18:08:20ZevvI bet he can sort a linked list like no one else
18:08:31FromGitter<sealmove> maybe
18:08:58FromDiscord<dom96> I mean... first semester I wouldn't even be surprised if students can't even create a hello world app
18:09:14*tane joined #nim
18:09:18Zevvtoday I spent my day debugging someone's own C++ STL implementation that's part of our project. Fancy ownership passing on realloc going belly up. That was a fun day.
18:09:29FromDiscord<dom96> there are many people who take Computer Science with absolutely no prior knowledge of programming at all
18:09:38ZevvI whisper "... nim ..." in their ears every now and then, but they do not hear me
18:09:49FromGitter<sealmove> the assignment was to make an image parser in C++ :D (of some simple format like tga)
18:10:05FromDiscord<patasuss> First semester students should be required to have implemented their own OS and Compiler from scratch! /s
18:10:19*narimiran joined #nim
18:12:13FromDiscord<Avatarfighter> Just used a template in my code and its actually useful 😎
18:12:52FromDiscord<Recruit_main707> Cool guy moment
18:13:50FromGitter<sealmove> guys do you like options? or prefer to use a secord bool for tracking, or some other way?
18:14:13FromGitter<sealmove> second*
18:14:48*Jesin joined #nim
18:15:28Zevvwell, given the options...
18:15:41FromGitter<sealmove> xD
18:15:48ZevvI do like the idea of options, but I hate the 'some' and 'none' stuff that comes with it
18:15:58FromDiscord<patasuss> I like using Option. Allows for some terser code.
18:17:31FromDiscord<patasuss> I opened a PR in the packages repo (#1670) 19 days ago and there's no more updates on it. Would it be bad practice to ask about it in the PR's comments.
18:17:31disbothttps://github.com/nim-lang/Nim/issues/1670 -- 5Better error message when attempting to define 'object' consts
18:17:51PMunchsealmove, that is crazy. Our first semester was programming some simple stuff in C..
18:18:09PMunchZevv, you can always use converter ;)
18:18:22FromGitter<sealmove> "beyond first semester", he wasn't first semester
18:18:23FromDiscord<patasuss> don't wanna seem to pushy
18:18:25ZevvPMunch: for what?
18:18:34PMunchFor Options
18:18:44Zevvhmmm
18:18:52PMunchSealmove, yeah I know you said that, that's the crazy part :P
18:18:57PMunchIf it was the first semester I would understand it
18:19:41FromGitter<sealmove> Let me explain: Nimitai has feature of "conditional fields", which means when you are parsing, some field might exist or no exist depending on some info that you parsed earlier. But since the whole thing is represented with a type, the field must be declared anyway. So should it be an Option? Or should I declare 2 field, for example `myField` and `isMyField`?
18:21:37PMunchHmm, depends on how much you need to check on it
18:21:38Zevvhmm I guess options come pretty natural for something like that
18:21:40FromDiscord<dom96> options are brilliant
18:21:59FromGitter<sealmove> PMunch how would you do it for your binaryparser generator? :P
18:22:18FromGitter<sealmove> I don't know how often it will be checked, I am only exposing the API
18:23:51PMunchWell if it is always present when the first flag is present then an Option would be best
18:24:17PMunchbrb
18:25:22FromGitter<sealmove> ok poll completed, you all vote Option, thanks this really helps! :)
18:32:13FromDiscord<g5becks> @dom96
18:32:42FromDiscord<g5becks> Anyway I can get another link to activate me email on the forum?
18:34:11FromDiscord<dom96> I activated it for you
18:34:59FromDiscord<g5becks> Thanks
18:38:25Zevvsealmove: we will all whine about it by the time you are done and we start actually using it
18:41:25PMunchThey aren't the most ergonomic thing..
18:43:43FromGitter<sealmove> As long as you use it I don't care!
18:44:06FromGitter<sealmove> Can change it if most people dislike it
18:45:04FromGitter<sealmove> One of these days it will be ready :> Only 1 crucial feature is missing atm.
18:45:45FromGitter<sealmove> And oh well, we still don't have a yaml parser so you will have to use it with json.
18:46:08FromGitter<sealmove> Although flyx's comments are encouraging: https://github.com/flyx/NimYAML/issues/70
18:46:10disbothow much work needed to make it work at compile time? ; snippet at 12https://play.nim-lang.org/#ix=2COc
19:04:33*leorize quit (Quit: WeeChat 2.9)
19:08:56*mmohammadi9812 quit (Quit: Quit)
19:16:53FromDiscord<haxscramper> @dom96 I was told I should ask you about this
19:21:47FromDiscord<alehander42> oii
19:22:30FromDiscord<g5becks> Does anyoune know if there is a way to represent an anonymous object type in nim?
19:22:39FromDiscord<g5becks> Similar to go
19:23:01FromDiscord<haxscramper> `var v: tuple[field1: type, field2: type2]`
19:23:06FromDiscord<g5becks> or typescript
19:23:19FromDiscord<g5becks> makes sense
19:23:32FromDiscord<g5becks> I need to check how this translates to js
19:23:37FromDiscord<g5becks> @haxscramper
19:23:40FromDiscord<g5becks> thanks
19:27:04FromDiscord<haxscramper> > I was told I should ask you about this↵About survey dates to be precise
19:32:42*Vladar quit (Quit: Leaving)
19:42:28FromDiscord<alehander42> hey
19:42:38FromDiscord<alehander42> do you use the javascript backend @g5becks
19:42:53FromDiscord<alehander42> if so, then you can just use `JsObject`
19:43:02FromDiscord<alehander42> if you need interop
19:43:05FromDiscord<alehander42> if not, tuples are better
19:45:55FromDiscord<g5becks> @alehander42 I am writing a cli to convert typescript definition files to nim wrappers
19:46:11FromDiscord<g5becks> In typescript, you might find code that looks like this
19:46:47*mbomba joined #nim
19:46:51FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COA
19:47:26FromDiscord<g5becks> My intuition tells me that the equivalent nim code would be this
19:47:35FromDiscord<alehander42> awesome
19:47:44FromDiscord<alehander42> have you seen the dts2nim thing
19:47:50FromDiscord<alehander42> we do need a newer one
19:47:56FromDiscord<alehander42> i wanted to write one, but totally no time
19:47:58FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COB
19:48:02FromDiscord<alehander42> no
19:48:07FromDiscord<alehander42> this is rarely used
19:48:12FromDiscord<alehander42> because it generates a generic
19:48:15FromDiscord<g5becks> yea
19:48:17FromDiscord<g5becks> I see
19:48:19FromDiscord<alehander42> which is not always easy to work with
19:48:33FromDiscord<alehander42> i am not very good with typescript advanced
19:48:34FromDiscord<alehander42> types
19:48:42FromDiscord<alehander42> is this like an adt
19:48:44FromDiscord<g5becks> I need a way to reperesent typescript unions
19:48:47FromDiscord<alehander42> or like just an union
19:49:01FromDiscord<alehander42> e.g. can a concrete value be assigned this type
19:49:03FromDiscord<g5becks> Or else It just wont work
19:49:18FromDiscord<alehander42> well, maybe this is the correct mapping
19:49:41FromDiscord<alehander42> but .. i need to look at examples
19:49:52FromDiscord<alehander42> of functions like that
19:50:06FromDiscord<g5becks> It doesnt work
19:50:40FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COC
19:51:06FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COD
19:51:25FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COE
19:51:52FromDiscord<g5becks> In typescript
19:52:22FromDiscord<alehander42> hmm
19:52:25FromDiscord<g5becks> I could assign a string or number or an object containing a name field anywhere the Anonymous type is used
19:52:59FromDiscord<g5becks> Without a way to represent Unions and anonymous objects. Theres a no way to map d.ts files to nim wrappers
19:53:31disrupteknamed tuples are essentially anonymous objects.
19:53:34FromDiscord<g5becks> Those two constructs are use literally everywhere in typescript
19:53:41disrupteknot my problem.
19:54:26FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2COF
19:54:54disrupteki'm surprised you can't make a typescript union work as a nim variant object, honestly. a little creativity would seem to go a long way here.
19:55:03FromDiscord<g5becks> @lqdev
19:55:50disruptekman, fuck decent internet. i'd settle for stable electricity.
19:56:00FromDiscord<g5becks> @disruptek
19:56:13FromDiscord<g5becks> It's literally like my 3rd day using nim
19:56:19disrupteki'm okay with that.
19:56:21disruptek~manual
19:56:22disbotmanual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek
19:56:22disbotmanual: 11just good to Ctrl+F in cases like this
19:56:28disruptekwe have a seat for every ass.
19:56:40FromDiscord<g5becks> and a variant still doesnt map
19:56:59FromDiscord<g5becks> Because it has to have a name and a way to create it
19:57:00disruptekyou have no idea how sad that makes me.
19:57:10disrupteka name?
19:57:24FromDiscord<g5becks> It's not anonymous
19:57:57FromDiscord<g5becks> It has to be defined beforehand
19:58:04FromDiscord<g5becks> this is valid typescript
19:58:08disrupteksounds super groovy, dude.
19:58:19disruptekdoes that manual link work for you?
19:58:49FromGitter<ynfle> @g5becks, why not tuples?
19:59:05FromDiscord<g5becks> @ynfle
19:59:13FromDiscord<g5becks> Tuples seemed like the answer
19:59:30FromDiscord<g5becks> Problem is that they don't compile to javascript objects
20:00:00disruptekyou realize this is #nim, right?
20:00:21FromDiscord<g5becks> @disruptek
20:00:28FromDiscord<g5becks> Ok, and?
20:00:28FromGitter<ynfle> What do you mean "they don't compile"?
20:01:09disruptekand very few people here care about typescript and javascript. you are welcome to change the compiler and submit a PR.
20:01:10FromDiscord<ElegantBeef> I assume the issue is that tuples dont seemlessly interop with the JS objects
20:01:31FromDiscord<ElegantBeef> Dont get overly offended by disruptek, he's our 60 grit sandpaper
20:01:48FromDiscord<Rebel> he keeps it 💯
20:01:52FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COG
20:02:15FromDiscord<g5becks> @Rebel hes talking shit with nothing of value to offer
20:02:26disruptekdon't use void as a return type.
20:02:27FromDiscord<g5becks> ``
20:02:32disruptekthere's some fuckin' value for ya.
20:02:36FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COH
20:03:02FromDiscord<ElegantBeef> Disruptek sometimes offers good advice 😄
20:03:24FromDiscord<g5becks> Look
20:03:33FromDiscord<ElegantBeef> Cant you use a JsObject there and just check if it has a `name`?
20:03:40FromDiscord<g5becks> I am trying to create something I need and others may want to use
20:03:50FromDiscord<g5becks> @disruptek
20:03:53FromGitter<ynfle> You did named tuples. do something like tuple[cstring]
20:04:03disruptekyou are welcome to ask. or, i will:
20:04:12disruptekwho here is interested in typescript conversion to nim?
20:04:21FromDiscord<ElegantBeef> We already have dst2nim
20:04:24FromDiscord<ElegantBeef> or w/e it's called
20:04:29FromDiscord<Rebel> oh shit lol, you know discord has support for nim snippets you can do " three backticks nim \n code \n your ticks"
20:04:39FromDiscord<g5becks> @ElegantBeef
20:04:50FromDiscord<g5becks> it doest cover any real use cases
20:04:58FromDiscord<g5becks> typescript code is pretty complex
20:05:04miprig5becks: ok, you do that and you get {Field0: 'gary'}. what output were you hoping for?
20:05:07FromDiscord<ElegantBeef> Yea i know i was talking to disruptek
20:05:32FromDiscord<g5becks> @ElegantBeef oh, ok
20:06:20FromDiscord<g5becks> No
20:06:26FromDiscord<alehander42> disruptek i am and i literally wanted to do that like many times
20:06:46FromDiscord<alehander42> and many people tired and overally convertion from dts to nim would be a very obvious good thing to have
20:06:55disrupteknah. it's a typical "i don't know anything about nim but i want you to sit here and teach me how to code my app." that's not the way this works.
20:07:04FromDiscord<alehander42> the edgy stuff doesn't work when you're wrong mate
20:07:11disruptekyou start with some small amount of capital.
20:07:19FromDiscord<g5becks> @disruptek I asked a simple question
20:07:23disruptekyou increase it by showing some investment.
20:07:31FromDiscord<alehander42> anyway 😄
20:07:34disruptekwe don't magically give a shit about your project because it exists.
20:07:39miprino, what's going on is that g5becks is trying to do something precise, but hasn't explained it because he's responding to your dumb provocations
20:07:46FromDiscord<alehander42> disruptek just shut up for a second
20:07:54disrupteki already told him to fix the compiler.
20:07:57FromDiscord<g5becks> @disruptek
20:08:07FromDiscord<ElegantBeef> Will you shut up man? 😄
20:08:08FromDiscord<alehander42> i love you and i want to buy you icecream
20:08:16FromDiscord<alehander42> but this address of yours keeps getting lost
20:08:18FromDiscord<alehander42> in the gc
20:08:21FromDiscord<alehander42> or something
20:08:48disruptekgo ahead and tell me it doesn't need a compiler patch.
20:08:50disrupteki'll wait.
20:08:51FromDiscord<g5becks> I don't see how nim community can ever grow with people like this lingering in the community
20:09:05FromDiscord<ElegantBeef> Luckily disruptek isnt the entire community
20:09:12FromDiscord<alehander42> @g5becks so the problem is the union thing?
20:09:14disruptekwe usually wash out the folks that aren't willing to invest any time in the language pretty quickly.
20:09:15FromDiscord<alehander42> or the cstring thing
20:09:21FromDiscord<ElegantBeef> you
20:09:36FromDiscord<alehander42> disruptek his original question was relevant, and it wasn't obvious even to me
20:09:45disruptekand my original answer still stands.
20:10:08FromDiscord<ElegantBeef> "rtfm div operator"
20:10:11disrupteki'm not the asshole because i don't take responsibility for nim not converting named tuples into javascript objects. jesus.
20:10:15FromDiscord<g5becks> @disruptek How am I not willing to invest time?
20:10:19disruptekno one cares. rtfm and fix the compiler.
20:10:25disruptekthis is open source, buddy.
20:10:34FromDiscord<alehander42> dude it doesn't have anything to do with the compiler
20:10:35FromDiscord<g5becks> the fact that I answerd a question that you can even answer?
20:10:46FromDiscord<alehander42> like, it might but there are many solutions
20:10:50miprig5becks, you're obviously willing to invest time into responding to disruptek, and commenting on his presence, when you're clearly getting no help from him. Just ignore him.
20:10:51disruptekit does have to do with the compiler.
20:10:56FromDiscord<alehander42> i used a `jsobject` macro for a long time
20:11:04FromDiscord<alehander42> with was enough for many cases
20:11:07FromDiscord<ElegantBeef> g5becks can you just say what you want to have to happen, what's happening?
20:11:13FromDiscord<alehander42> and i had an issue from years ago about the question
20:11:14FromDiscord<g5becks> Ok
20:11:27*mmohammadi9812 joined #nim
20:11:43FromDiscord<alehander42> @g5becks so basically one option is to use this macro
20:12:00FromDiscord<alehander42> which just generates an actual type of object each time with the correct fields
20:12:15FromDiscord<alehander42> but the js code should include the actual fields, not `Field1` etc
20:12:25FromDiscord<alehander42> for this a macro is enough
20:12:44FromDiscord<alehander42> if you really need local variables to somehow preserve this, then you need something more
20:12:59FromDiscord<alehander42> but for type defs only this doesn't seem to be
20:13:01FromDiscord<alehander42> relevant
20:13:36FromDiscord<alehander42> as one can easily refactor to a non-anonimoys type if needed to pass that and not directly deref ..
20:14:47FromDiscord<g5becks> exactly
20:15:03FromDiscord<alehander42> now, having an in-compiler support would be cool-er as disruptek rightly says
20:15:08FromDiscord<g5becks> I can actually get around the anonymous object problem
20:15:08FromDiscord<alehander42> but i had pushback for that
20:15:10FromDiscord<alehander42> in the past
20:15:19FromDiscord<alehander42> so that's why i am not so optimistic
20:15:25FromDiscord<g5becks> when traversing the typescript syntax tree
20:15:56FromDiscord<g5becks> I can create a nim type for the anonymous object that's needed
20:16:16FromDiscord<g5becks> but variant objects wont work as a replacement for union types
20:16:34FromDiscord<alehander42> https://github.com/nim-lang/Nim/issues/6623
20:16:34disbotFeature request: a version of tuples that generates `.fieldname`
20:16:40FromDiscord<alehander42> this is the original issue IIR
20:16:42FromDiscord<alehander42> (edit) "IIR" => "IIRC"
20:16:51FromDiscord<alehander42> that's also possible
20:17:03FromDiscord<alehander42> and yeah variant types are adt replacement often
20:17:23FromDiscord<alehander42> you probably can try concepts or
20:17:28FromDiscord<alehander42> indeed nim's unions
20:18:09disruptekdon't even bother with concepts.
20:18:24*narimiran quit (Ping timeout: 265 seconds)
20:18:26FromDiscord<alehander42> yeah, they're .. not stable
20:18:36FromDiscord<alehander42> but for an experimental project one might see what's up
20:19:53FromDiscord<g5becks> Ok
20:19:59FromDiscord<g5becks> I think I figured it out
20:20:54FromDiscord<alehander42> i want concepts man
20:21:01FromDiscord<alehander42> i hope they are done in 2021
20:23:00FromDiscord<g5becks> @alehander42
20:23:08FromDiscord<g5becks> So basically
20:23:54FromDiscord<g5becks> the union type needs to be used in the generic constraint position
20:24:06FromDiscord<g5becks> and not parameter position
20:26:20FromDiscord<alehander42> i really almost never use those
20:26:24FromGitter<ynfle> Exactly
20:26:29FromDiscord<alehander42> so even with several years of xp i am not sure about that
20:26:34FromGitter<ynfle> 👍 @ArRolin
20:26:41FromDiscord<alehander42> can you give an example of such a .dts file
20:26:45FromDiscord<alehander42> that you want to translare
20:26:47FromDiscord<alehander42> (edit) "translare" => "translate"
20:27:18FromDiscord<j$> can someone explain proc types
20:27:19FromDiscord<j$> https://play.nim-lang.org/#ix=2COP
20:28:45FromDiscord<g5becks> @alehander42 not at the moment
20:29:09FromDiscord<g5becks> actully
20:29:31FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2COS
20:32:33miprij$, you're not setting the type of some_func there; you're providing the type of its return value
20:32:42FromDiscord<j$> ah
20:32:43FromDiscord<j$> yess
20:32:49FromDiscord<j$> silly me
20:33:26FromDiscord<g5becks> @alehander42 Thanks for the help.
20:33:44FromDiscord<j$> is there any way to do the thing I was trying?
20:34:04miprijust remove that return type from some_func and it works
20:36:07FromDiscord<j$> what about if the proc had params I'd have to specify those for the proc. I wanted to just specify the proc type
20:36:49mipriprocs already have types, you don't need to specify them.
20:37:02mipriproc some_func = ... <-- it's a proc(). takes no arguments, returns none.
20:37:46FromDiscord<j$> okay so what about the situation with callbacks, I have to specify the params and return type instead of the proc type?
20:37:56miprithat is the proc type
20:38:10mipriproc() <- you've specified the params and the return type. there aren't any and there isn't one
20:39:07miprihttps://play.nim-lang.org/#ix=2COX here's one with a slightly more interesting type
20:39:48FromDiscord<j$> yes, but I didn't want to re-specify the details of the proc for some_func
20:40:06FromDiscord<j$> so the type alias has some use
20:41:32miprithe use is in you not having to repeat those details for the 'p' argument to test_proc, or in other uses of the proc as a value
20:41:53FromDiscord<alehander42> @g5becks thanks. hm, so don't those
20:42:01FromDiscord<alehander42> implment an interface or somthing like that
20:42:19FromDiscord<alehander42> yeah for some of those
20:42:27FromDiscord<alehander42> just using jsobjects and casting
20:42:30FromDiscord<alehander42> might be easiest
20:42:42FromDiscord<alehander42> i mean, the jsffi ones which
20:42:50FromDiscord<alehander42> provide more dynamic escape hatch
20:42:52miprimaybe there's some weird JS-style thing you could do with const bindings and sugar lambdas, but if the problem is that you're having to define a bunch of similar procs, I'm sure a template could help with the specific task
20:43:29FromDiscord<j$> yeah, but in my case I'm using callbacks so it's just not very helpful to me, I have to look up the details and write them myself
20:43:32FromDiscord<j$> as for the js thing
20:43:50FromDiscord<j$> idk
20:43:51mipriin order to do anything in the proc you still need to know that stuff
20:44:02Zevvj$, what exactly are you trying to do?
20:44:57miprij$ wants to define functions with a predefined proc type, rather than by having to name and give types for the proc's parameters and return value
20:45:00FromDiscord<j$> using glfw, I thought I could just use a type to specify the details of a proc for a callback
20:45:35FromDiscord<g5becks> @alehander42 The interfaces in typescript are all structurally typed
20:45:56FromDiscord<g5becks> So anything with the same shape can be used
20:46:03ZevvSo it's basically about typing less?
20:46:16FromDiscord<g5becks> I would just used JsObject
20:46:28FromDiscord<g5becks> but then you loose typesafety
20:46:55FromDiscord<g5becks> an object can have 100s of keys
20:46:56FromDiscord<j$> that's seems like the same reason the proc types exist in the first place no?
20:47:13Zevvwell, no, proc types are just 1st class types like any types.
20:47:16miprithey do not exist for the purpose of typing less when you're defining procs
20:47:17ZevvIs this helping maybe? https://nim-lang.github.io/Nim/manual.html#statements-and-expressions-using-statement
20:49:43FromDiscord<j$> well yeah they're types as well, but what else is specifying a proc type used for other than convenience?
20:50:40mipriyou experience that convenience already in test_proc, where you just say ProcType for the parameter type.
20:50:56miprithe language doesn't need a shortcut for defining functions. It's not ATS.
20:51:25mipriif you've got a bunch of regular functions that all use the same types and parameter names, I bet a template could help you define those more conveniently.
20:52:18Zevvand if you want to go all the way, you can whip up a macro to do exacly what you need here, although that will take a bit more effort to setup
20:54:12FromDiscord<j$> really it wasn't that big a deal tbh, I just assumed I could use the defined proc type to specify the type of a proc I created. ↵with the example I provided, the only part I actually define with glfw is some_func, so in that case I haven't used any of the convenience.
20:55:07FromDiscord<j$> idk it just seems like I should be able to do that but I don't know enough about the lang soooo
20:56:46miprihow it works in ATS, a language with 300-character function signatures from all the extra guarantees you can shove in there, is that you define a type, and then you say `val f1: ftype`, `val f2: ftype`, you define a bunch of functions with that type, without providing implementations. and then later you say, 'implement f1(a, b) = ...` and go to town, only having to name the parameters because they're already typed, and not needing to provide the return type
20:57:55miprithe definition/implementation distinction also helps with header files.
20:58:45mipribut in Nim the closest thing to this is just declaring a function early for the sake of mutual recursion
21:01:10mipribut speaking of providing parameter names without their types, Nim has that
21:01:43mipriZevv mentioned it above and I didn't even notice. https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement <- again
21:02:33mipriif you've got a bunch of repetitive functions, that plus a terse type for the return value might be all that you need
21:05:06Zevvno one ever notices :(
21:09:02*Kaivo quit (Ping timeout: 264 seconds)
21:11:20*Kaivo joined #nim
21:15:57FromDiscord<Avatarfighter> Zevv: i notice 🙂
21:16:57FromDiscord<Avatarfighter> Random question but what is the advantage of using "method" over "proc" when doing OOP stuff with nim?
21:18:14disruptekit can slow down your program when it otherwise runs too fast.
21:18:20mipridynamic vs. static dispatch
21:19:17FromDiscord<Avatarfighter> i guess a better question that I should be asking is wtf is static/dynamic dispatch?
21:19:20*Prestige quit (Quit: Prestige)
21:19:39disruptekvarying proc invocation at runtime.
21:20:02mipriyou have... let me think of a compelling OO example ... you have a list of fruit. if you map over it with a proc you'll just throw the fruit. But if you map over it with a method you can peel banasas, scare doctors with apples, and spit out watermelon seeds, without any nonsense about casts or checking what kind of fruit you have
21:20:19FromDiscord<Avatarfighter> Neveel
21:20:33FromDiscord<Avatarfighter> Had to google that lmao
21:20:36FromDiscord<Avatarfighter> yeah that makes sense
21:20:43FromDiscord<Avatarfighter> very cool that nim has it
21:20:49*Prestige joined #nim
21:21:29*NimBot joined #nim
21:21:30FromDiscord<Avatarfighter> Thank you mipri and disruptek
21:21:53disruptekis your bot done?
21:22:29FromDiscord<Avatarfighter> It is actually
21:22:41disruptekwhen's the release party?
21:22:51FromDiscord<Avatarfighter> im partying rn 🙂
21:23:14disruptekw00t what's your winning percentage?
21:23:33FromDiscord<Avatarfighter> winning as it % of the sales i keep or the success rate?
21:23:39disrupteksuccess.
21:24:11FromDiscord<Timmy> Is nim embeddable into a C++ program? Like Lua for example?
21:24:13FromDiscord<Avatarfighter> Last test i did i managed 20 success 5 fails but i think i can bring the fail chance down
21:24:30FromDiscord<Avatarfighter> @Timmy there is the nimvm which is embeddable
21:25:04FromDiscord<Avatarfighter> Raw nim can be used to ffi with c/cpp/objc/js though
21:25:55FromDiscord<nikki> @Timmy i use nim-generated c/c++ as part of the build in a cmake project
21:26:04FromDiscord<Timmy> I'm looking for something with code hotreloading.
21:26:12FromDiscord<Avatarfighter> Nimvm
21:26:22FromDiscord<ElegantBeef> Nim has hotcode reloading
21:26:24FromDiscord<Avatarfighter> @ElegantBeef is the resident vm nerd
21:26:26FromDiscord<ElegantBeef> compiled nim that is
21:26:34disruptekhahaha no.
21:26:39FromDiscord<Timmy> Could you link me that? @Avatarfighter
21:27:20FromDiscord<Avatarfighter> Disruptek: the main issue i have right now is with a company called datadome, they flag real users as bots and block access to the site so im trying to see if i can bypass that service entirely
21:27:29FromDiscord<Timmy> Nim itself can hot reload code? Where can I read more about that?
21:27:38disruptekgoogle?
21:28:16FromDiscord<Timmy> When I google nimvm I get nim "version manager"
21:28:22FromDiscord<ElegantBeef> I've got <https://github.com/beef331/nimscripter> for easy interop
21:28:25FromDiscord<ElegantBeef> It's nimscript
21:28:36FromDiscord<ElegantBeef> easy interop with nimscript
21:28:45FromDiscord<nikki> searching "nim hot code reloading" gave me https://nim-lang.org/docs/hcr.html
21:29:12FromDiscord<Avatarfighter> https://nim-lang.org/docs/nims.html for docs on nimscript
21:29:29FromDiscord<Timmy> Thanks! reading now
21:30:11miprisupposedly https://github.com/inim-repl/INim uses hot code reloading. it loads https://nim-lang.org/docs/hotcodereloading.html after all
21:31:19FromDiscord<nikki> for my game engine scenario i'm thinking about doing this by actually just serializing game state and then reloading the app. it's tricky when types change etc.; and leveraging the existing eg. serialization migration logic for it makes sense
21:31:38FromDiscord<nikki> (edit) "for my game engine scenario i'm thinking about doing this by actually just serializing game state ... and" added "/ ui state (eg. what stuff you have selected in the editor)"
21:32:42FromDiscord<nikki> i dug pretty far into a code-reloading base UX for dev and -- it's nice for scoped changes of eg. constants for the jump distance of an object and so on, but then with larger changes you can often get into states of your program that are only possible due when reloading multiple times and you'd never actually get to on a fresh run xD
21:33:42PMunchBack :)
21:35:30Prestigeo/
21:35:37Prestigemore streaming today PMunch ?
21:35:48PMunchUnfortunately not, it's getting late here
21:36:39*lritter quit (Ping timeout: 260 seconds)
21:40:25reversem3Any playing with prologue for web development ?
21:40:48reversem3 * Anyone playing with prologue for web development ?
21:41:50FromDiscord<Theodore> Ayo would Nim be good for parsing bencode?
21:42:13FromDiscord<Theodore> why r these irc yutes here
21:42:36Prestigesure @Theodore
21:45:06PMunch@Theodore, got anything against IRC?
21:58:28*eburk joined #nim
22:02:46*mmohammadi9812 quit (Quit: Quit)
22:03:11*mmohammadi9812 joined #nim
22:03:34Yardanico@Theodore there is already at least two nim bencode libs
22:03:39Yardanico!repo bencode
22:03:40disbothttps://github.com/xmonader/nim-bencode -- 9nim-bencode: 11bencode encoder/decoder in nim 15 3⭐ 1🍴 7& 3 more...
22:03:45Yardanico!rip bencode 3
22:03:49Yardanico!repo bencode 3
22:03:51disbothttps://github.com/fuzeman/bencode.py -- 9bencode.py: 11Simple bencode parser (for Python 2, Python 3 and PyPy) 15 19⭐ 10🍴 7& 20 more...
22:03:53Yardanicoit doesn't work like that?
22:03:59Yardanico!repos bencode
22:04:00disbothttps://github.com/xmonader/nim-bencode -- 9nim-bencode: 11bencode encoder/decoder in nim 15 3⭐ 1🍴
22:04:00disbothttps://github.com/FedericoCeratto/nim-bencode -- 9nim-bencode: 11Bencode library for Nim 15 2⭐ 0🍴
22:04:00disbothttps://github.com/rokups/nim-bencode -- 9nim-bencode: 11BEncoding encoding/decoding lib for Nim language 15 1⭐ 0🍴 7& 1 more...
22:04:01Yardanicoohhh
22:04:03Yardanicoyes this
22:05:07FromDiscord<dom96> @haxscramper you should ask narimiran, or better yet make an issue somewhere about it. Maybe the Nim website repo or even RFCs 🙂
22:34:58reversem3Ok , I still haven't figure this one out yet , why do I get an error from nimsuggest using nvim "nimsuggest is only available to file on disk". I am trying to just create a new file
22:37:36PMunchWhat on earth..
22:37:54PMunchTrying to debug a problem with dbus
22:38:48FromDiscord<nikki> reversem3 -- i also would kinda run into this through nimlsp. worked around it by always using `touch path/to/the_new_file.nim` and then just opening that created file in vim instead of having vim create a new file
22:38:52PMunchAnd I added a `echo "Checking ", $cast[int](watch)` to a loop over self.watches
22:39:08PMunchAnd it shows me that one of the pointers in "16"
22:39:12FromDiscord<nikki> i think it's bc. the new file isn't written yet when you first open it; and nimsuggest gets confused trying to find it
22:39:35PMunchBut if I add `echo self.watches.mapIt(cast[int](it))` before the loop it doesn't show it, and the error is gone..
22:39:44reversem3Ahh that makes sense , I like to vim as a filemanager and IDE so thats a bummer
22:39:49reversem3thanks
22:40:56reversem3Thats so weird , I did a touch app.nim even though I already created it and nimsuggest works great now
22:41:00reversem3Thanks again
22:42:09PMunchThe thick plottens
22:42:31PMunchI echo self.watches.len and it gives be 121, even though there are only two values in the sequence..
22:43:45FromDiscord<Clyybber> PMunch: Sounds like memory corruption
22:43:52*solitudesf quit (Ping timeout: 260 seconds)
22:44:17PMunchWell, the values are always those
22:44:30PMunch121 for the length, and one of the pointers is 16
22:44:57FromDiscord<Clyybber> hmm
22:45:49FromDiscord<Clyybber> does a tiny sleep instead of an echo also fix the issue?
22:46:02FromDiscord<Clyybber> before the loop I mean
22:46:48PMunchNope
22:55:41PMunchThis is a strange error indeed..
22:56:22PMunchOh well, I should've gone to bed ages ago
22:56:25PMunchGood night
22:56:43*PMunch quit (Quit: leaving)
22:58:00*tane quit (Quit: Leaving)
22:58:07FromDiscord<Clyybber> good night
23:02:22reversem3choosenim/toolchains/nim-1.4.0/lib/core/rlocks.nim(14, 10) Error: Rlocks requires --threads:on option.
23:06:32Yardanico--threads:on
23:06:36Yardanico:P
23:15:10FromDiscord<UNIcodeX> looking at documentation for `strscans`, `scanf` doesn't seem to have a selector to return a single character. Is that right?
23:39:09*mbomba quit (Ping timeout: 260 seconds)
23:51:11FromDiscord<Yardanico> it does though
23:51:29FromDiscord<Yardanico> ah you want only 1 char in the middle of the string?
23:51:42FromDiscord<Yardanico> if you have something to match after that char, you can match it easily
23:52:01FromDiscord<Yardanico> but I don't think there's a default matcher for matching a single char at the end of the string or something like that
23:52:03FromDiscord<Yardanico> you can make your own