<< 10-12-2020 >>

00:04:58FromGitter<ynfle> @Elegant Beef nice solution for the parsing
00:05:04FromGitter<ynfle> My guess is it includes part 2
00:05:42FromGitter<ynfle> For lines 8 through 10, I don't think you need to check if it hasn't been put in yet
00:05:48FromGitter<ynfle> I don't think there are duplicates
00:06:26FromGitter<ynfle> Also, there's this https://nim-lang.org/docs/tables.html#hasKeyOrPut%2CTable%5BA%2CB%5D%2CA%2CB
00:07:11FromGitter<fish-face> There can be duplicate colours on the same line of input
00:11:23FromGitter<ynfle> What do you mean?
00:12:11FromDiscord<treeform> @UNIcodeX that does look really strange. I am working an a full rewrite of the renderer. It does not have the artifacts.
00:17:53FromGitter<fish-face> @ynfle You can have a line like "<blah> contains 4 shiny red bags, 3 shiny red bags."
00:18:06FromGitter<fish-face> I am now caught up
00:18:06FromGitter<ynfle> Really?
00:18:23FromGitter<ynfle> Do you have that in your input or know of someone who does?
00:18:33FromGitter<fish-face> I know of someone who did
00:18:47FromGitter<fish-face> There is another edge case which I had and which apparently not everyone does
00:18:57FromGitter<fish-face> but will not spoil the surprise unless you want to know
00:19:05FromGitter<fish-face> (though I was warned about it and still fell into the trap)
00:19:42FromGitter<ynfle> I'm pretty sure Beef's check was only for the beginning of the line not for the end
00:19:53FromGitter<ynfle> I'm not gonna do part 2 tonight
00:19:57FromGitter<fish-face> I may have misunderstood what you meant
00:20:07FromDiscord<ElegantBeef> My check is for the end of the line
00:20:09FromGitter<ynfle> Take a look a the link that was posted
00:20:17FromDiscord<ElegantBeef> I do it for both
00:20:34FromDiscord<ElegantBeef> Sure it's possibly redundant, but i was uncertain if there were any duplicate left hand cases
00:20:39FromGitter<ynfle> Why for the beggining?
00:20:47FromGitter<ynfle> Is that an actual edge case?
00:21:10FromDiscord<ElegantBeef> Cause i dont look at the data, and just write code that is reasonable
00:21:24FromGitter<fish-face> haha
00:21:27FromDiscord<ElegantBeef> It's reasonable to assume that there can be duplicates
00:21:29FromGitter<fish-face> usually they give you very friendly input
00:22:55FromDiscord<ElegantBeef> Sure but the only way to know that it's not a case is to check 😄
00:23:42FromGitter<fish-face> well. You can also just try it and see if it breaks ;)
00:24:09FromGitter<fish-face> as an example I never write error handling for AoC to see if there is malformed input or bounds breaks and so on
00:24:18FromGitter<fish-face> I think it's not so much the point
00:24:34FromDiscord<ElegantBeef> Well to each their own
00:28:22FromDiscord<ElegantBeef> I personally attempt to minimize any error before they appear 😄
00:28:36FromDiscord<shadow.> i know none of you use windows, but if you do, install windows terminal lol
00:28:39FromDiscord<shadow.> so much cleaner than cmd
00:28:49FromDiscord<ElegantBeef> Next you'll suggest winget
00:28:53FromDiscord<shadow.> scoop
00:28:54FromDiscord<shadow.> LOL
00:32:37FromDiscord<shadow.> aw man, disruptek's testes have never looked so beautiful https://media.discordapp.net/attachments/371759389889003532/786389810943885322/unknown.png
00:32:48FromDiscord<shadow.> really, it brings a tear to my eye
00:33:13*hmmm quit ()
00:35:03*Cthalupa quit (Ping timeout: 260 seconds)
00:36:04*Cthalupa joined #nim
00:36:39FromDiscord<ElegantBeef> It's something to behold
00:36:46disruptekit brings a song to my heart.
00:44:03disruptekthose underlines are bananas.
00:44:34disruptekand why is it that the check is an assertion error on windows and a compilation failure on linux? 🤔
00:44:55disruptekand the indentation is fucked up.
00:45:03disruptekmy testes have never been so messy.
00:45:14disruptekwell, there was one time in new mexico, but other than that...
00:46:15*azed quit (Ping timeout: 258 seconds)
00:51:49FromDiscord<shadow.> lmfao that's weird
00:51:55FromDiscord<shadow.> (that it's still different)
00:52:13disrupteki fixed that bug.
00:52:20disrupteknow i'm looking at the indent.
00:52:23FromDiscord<shadow.> much better https://media.discordapp.net/attachments/371759389889003532/786394847392301057/unknown.png
00:52:57disruptekbut those underlines...
00:53:40FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786395174191628298/unknown.png
00:53:42FromDiscord<shadow.> much better.
00:53:52FromDiscord<shadow.> dont ask why my ubuntu python is on 2.7.17
00:54:04FromDiscord<shadow.> yeah the underlines are quite sped
00:54:12disruptekweird, i named my workstation DESKTOP-PN664HR also.
00:55:29*Tanger joined #nim
00:55:30*abm quit (Read error: Connection reset by peer)
00:56:37FromDiscord<shadow.> damn that's crazy
00:56:46disruptekyeah, new mexico is lit.
00:56:46FromDiscord<shadow.> we must just be interconnected
00:56:48FromDiscord<shadow.> you got the brain
00:56:49FromDiscord<shadow.> i got the
00:56:53FromDiscord<shadow.> air pockets in the brain
00:57:07FromDiscord<shadow.> 👍
00:57:15disruptekmaybe it's just that yours is the first workstation i pwned.
00:57:26FromDiscord<shadow.> true
00:57:28FromDiscord<shadow.> oh no
00:57:33FromDiscord<shadow.> you might access by unidiomatic nim code
00:57:34FromDiscord<shadow.> :o
01:01:34disruptekthe indentation seems to be a nim repr() bug.
01:01:44disruptekrepr(NimNode), specifically.
01:03:07disrupteka regression from nim-1.0.
01:03:24disrupteki'll let shadow. fixed the damned underscores. too stupid.
01:11:04FromDiscord<shadow.> hmm
01:11:08FromDiscord<shadow.> which part?
01:11:13FromDiscord<shadow.> ohhh
01:11:14FromDiscord<shadow.> i see
01:11:18FromDiscord<shadow.> LMAO
01:11:24FromDiscord<shadow.> time to git clone git add git commit git push
01:11:26FromDiscord<shadow.> 🙄,,
01:11:48FromDiscord<shadow.> lmk the lines in question ill take a look with my sexy new terminal 🥵
01:14:58FromDiscord<Cypheriel> `python3`, `python` (2.7) is used internally by certain things
01:15:43FromDiscord<shadow.> fair enough
01:15:49FromDiscord<Cypheriel> Can't remember what specifically, but I remember someone telling me to never delete the already installed version of python2
01:16:03FromDiscord<shadow.> ill take your word for it
01:16:14FromDiscord<Cypheriel> but that's why Linux has you use `python` and `python3` rather than Windows having like just `py`
01:16:54FromDiscord<shadow.> fair
01:16:57FromDiscord<shadow.> or
01:16:58FromDiscord<shadow.> even better
01:16:59FromDiscord<shadow.> python3.9
01:17:01FromDiscord<shadow.> and so on
01:17:05FromDiscord<Cypheriel> 3.9 D:
01:17:09FromDiscord<shadow.> hn?
01:17:13FromDiscord<shadow.> hm?
01:17:21FromDiscord<Cypheriel> Not all modules currently are updated to work on 3.9
01:17:24FromDiscord<shadow.> yeah i know
01:17:28FromDiscord<Cypheriel> and most Linux distros will not come with 3.9
01:17:29FromDiscord<shadow.> i reverted for dpy lol
01:17:38disruptekpython is pointless.
01:17:42FromDiscord<Cypheriel> D:
01:17:43FromDiscord<shadow.> ^^
01:17:49FromDiscord<Cypheriel> Why is it pointless? :<
01:17:56FromDiscord<shadow.> i use to like but after discovering higher level languages like nim or c# it just becomes obsolete
01:18:05FromDiscord<shadow.> idk if i should count c# bc it's its own shitshow
01:18:06FromDiscord<shadow.> but still
01:18:10FromDiscord<Cypheriel> C#...
01:18:23FromDiscord<shadow.> yeah thats right im flexing my windows .net on you what are you gonna do abt it
01:18:25FromDiscord<shadow.> mOnO
01:18:26FromDiscord<shadow.> smh
01:18:29FromDiscord<Cypheriel> I didn't use to have anything against it, but now I can't even use it
01:18:34FromDiscord<shadow.> hah
01:18:37FromDiscord<shadow.> pfft
01:18:48FromDiscord<shadow.> ill stick with my 25 popup gui just to open a console 🙄
01:19:39FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HmJ
01:19:43FromDiscord<shadow.> isn't that invalid syntax
01:19:46FromDiscord<Cypheriel> nope
01:19:50FromDiscord<shadow.> oh lord
01:19:52FromDiscord<shadow.> what is a variable
01:19:54FromDiscord<shadow.> love is a variable
01:19:58FromDiscord<shadow.> the is overload
01:20:03FromDiscord<shadow.> prints "baby don't hurt me?"
01:20:03FromDiscord<Cypheriel> :)
01:20:10FromDiscord<shadow.> am i right?
01:20:13FromDiscord<shadow.> or did you do it somehow else
01:20:14FromDiscord<Cypheriel> Yep
01:20:19FromDiscord<shadow.> fair enough
01:20:23FromDiscord<shadow.> now add a custom ope-
01:20:24FromDiscord<Cypheriel> No no
01:20:24FromDiscord<shadow.> oh wait
01:20:25FromDiscord<Cypheriel> you're right
01:20:32FromDiscord<shadow.> i know
01:20:35FromDiscord<shadow.> now add a custom ope-
01:20:37FromDiscord<shadow.> oh right
01:20:39FromDiscord<shadow.> python
01:20:40FromDiscord<Cypheriel> ope?
01:20:42FromDiscord<shadow.> operator
01:20:46FromDiscord<shadow.> i cut myself off bc you can't
01:20:56FromDiscord<shadow.> pfft
01:20:59FromDiscord<shadow.> i'll stick with nim
01:21:04FromDiscord<Cypheriel> lol
01:21:52FromDiscord<bark> im still planning to dev an android app with nim using the js backend 🔫
01:22:06FromDiscord<shadow.> that's what we like to see
01:22:08FromDiscord<bark> i might try karax and apach cordova
01:22:15FromDiscord<bark> (edit) "apach" => "apache"
01:22:26FromDiscord<shadow.> yeah idk java is quite unsexy
01:22:32FromDiscord<shadow.> that's why i've stayed away from android development thus far
01:22:36FromDiscord<shadow.> and kotlin is uh...
01:22:37FromDiscord<shadow.> a thing
01:22:41FromDiscord<shadow.> 💀
01:22:45FromDiscord<bark> i don't mind java
01:22:52FromDiscord<shadow.> kotlin uh....
01:22:53FromDiscord<shadow.> certainly exists
01:22:54FromDiscord<bark> i just don't feel like learning the ui lib, i want muh css
01:22:56FromDiscord<shadow.> it's certainly a thing
01:23:01FromDiscord<shadow.> definitely a programming language
01:23:08FromDiscord<shadow.> can't say much else about it without lying but uh
01:23:11FromDiscord<shadow.> yeah :)
01:23:32FromDiscord<shadow.> idk i feel like java just fucks the shit out of oop
01:23:35FromDiscord<shadow.> overblows it
01:23:54FromDiscord<shadow.> composition-based solutions work better than inheritance usually imo
01:24:57FromDiscord<bark> I find it workable, if you're used to it
01:25:12FromDiscord<bark> but as someone who's not paid to code, I'm just gonna stick to nim
01:25:38FromDiscord<shadow.> yup
01:25:42FromDiscord<shadow.> i mean i've used java before
01:25:52FromDiscord<shadow.> i just wanted to smash my head in afterwards, that's all
01:26:00FromDiscord<shadow.> it's certainly usable though
01:26:14FromDiscord<shadow.> also, is that a suga pfp lmao
01:31:08FromDiscord<shadow.> does `writeFile` overwrite or append
01:31:13disruptekyes.
01:33:44FromDiscord<shadow.> good answer
01:33:58FromDiscord<shadow.> i'm not fixing your underlines until i get an answer of former or latter 🙄
01:34:15disruptekformer or latter.
01:35:30FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HmM
01:40:08FromDiscord<exelotl> Kotlin adds the sugar needed to make Java bearable
01:40:21FromDiscord<exelotl> I respect it for that x)
01:40:54FromDiscord<shadow.> yes, but it adds tons of other sugar that makes kotlin unbearable
01:41:12FromDiscord<Cohjellah> does purchasing the nim merch off teespring help the devs?
01:41:52disruptekoffer us jobs writing rust instead.
01:42:16FromDiscord<shadow.> ew
01:42:22FromDiscord<shadow.> you didn't even censor it
01:43:18FromDiscord<Rebel> Would't it depend on how you opened the file?
01:43:25FromDiscord<shadow.> wdym?
01:43:32FromDiscord<Rebel> https://nim-lang.org/docs/io.html#FileMode
01:43:39FromDiscord<Cohjellah> now why would you want to write Rust
01:43:39FromDiscord<Rebel> it would only append if you tell it to append
01:43:46FromDiscord<Rebel> also I saw you complaining about C#
01:43:51FromDiscord<Rebel> you didn't bring up any valid point
01:43:55FromDiscord<Rika> dont say the r word wt
01:43:56FromDiscord<Rika> f
01:44:00FromDiscord<Rika> at least censor it
01:44:07FromDiscord<Cohjellah> HAHAHA it is the forbidden word is it
01:44:48FromDiscord<Rika> wdym by valid point tho
01:45:01FromDiscord<Cohjellah> What's wrong with Microsoft Java?
01:45:03FromDiscord<Cohjellah> I quite like it
01:45:19FromDiscord<Rika> me saying i dont like rst because of it being super verbose can be both valid or invalid, depending on the person
01:45:36FromDiscord<ElegantBeef> Doesnt enforce immutabillity, relies on OOP, lacks any metaprogramming inside the language, and has no compile time evaluation
01:45:47disrupteki'll code clojure for food, too.
01:45:58FromDiscord<ElegantBeef> You'd probably code anything for food
01:46:05FromDiscord<Cohjellah> I'd code anything for food
01:46:09FromDiscord<Rika> i dont think hed code in c++ for food
01:46:16FromDiscord<Cohjellah> Who's got tips for finding a grad software role
01:46:17FromDiscord<Cohjellah> lmao
01:46:37FromDiscord<Rika> gain (your age)+5 years of job experience first
01:46:48FromDiscord<Cohjellah> Thank god I'm in Australia lol
01:46:56FromDiscord<Cohjellah> In America it seems ridiculous to get a grad role
01:47:06FromDiscord<Cohjellah> Meanwhile it's like "Yeah know basic programming concepts, have a semi-relevant degree, thanks"
01:47:09FromDiscord<Rika> it seems even more ridiculous in japan
01:47:33FromDiscord<Cohjellah> I think Aus has a shortage of good engineers
01:47:39FromDiscord<Cohjellah> but idk how many actual software grads we have
01:47:44FromDiscord<Rebel> I still disagree completely with that metaprogramming statement there is a whole book about metaprogramming, you also have dnlib and mono.cecil for IL manipulation and editing of assemblies
01:48:15FromDiscord<Rika> man il manip tho sounds like hell doesnt it
01:48:21FromDiscord<Rebel> eh
01:48:25FromDiscord<Rebel> depends what you're trying to do
01:48:35FromDiscord<shadow.> c# literally only works on windows and requires special interference to work on other platforms
01:48:40FromDiscord<shadow.> lmao
01:48:40FromDiscord<Rika> if youre trying to do whatever youve made in nim
01:48:42FromDiscord<Rebel> that's 100% a lie
01:48:48FromDiscord<Rika> not anymore i believe
01:48:48FromDiscord<Rebel> that's just incorrect
01:48:51FromDiscord<shadow.> i would consider mono interference
01:48:53FromDiscord<shadow.> no?
01:48:58FromDiscord<Rika> net core?
01:48:58FromDiscord<Rebel> interference?
01:49:01FromDiscord<Rebel> ok
01:49:03FromDiscord<Rebel> oh boy
01:49:07FromDiscord<ElegantBeef> dotnetcore runs on most platforms
01:49:16FromDiscord<shadow.> ah right core
01:49:16FromDiscord<Rika> lol
01:49:21FromDiscord<shadow.> alr time to bring up the other 100
01:49:22FromDiscord<shadow.> issues
01:49:23FromDiscord<shadow.> with c#
01:49:24FromDiscord<ElegantBeef> Aside from having to have a runtime it's a non issue
01:49:36FromDiscord<Rebel> we can either talk about it here or offtopic
01:49:41FromDiscord<Rebel> because that is just 100% incorrect
01:49:45FromDiscord<ElegantBeef> Which part?
01:49:49FromDiscord<Rebel> I am talking about shadow
01:49:57FromDiscord<shadow.> lol
01:50:11FromDiscord<ElegantBeef> How do you do metaprogramming with C# without leaving the runtime?
01:50:21FromDiscord<shadow.> that's true
01:50:23FromDiscord<Rebel> .NET Framework = installed and enabled by default on most windows OS versions, .NET Core, .NET 5 (future of .NET, .net core version next, and is open source and cross-platform)
01:50:37FromDiscord<Rebel> (edit) "versions," => "versions and nly targets Window,"
01:50:39FromDiscord<Rebel> (edit) "nly" => "only"
01:50:41FromGitter<fish-face> what is the most concise way to pass a newly initialised object to a proc? Having to repeat all its fields in `proc(TypeName(field: value, fieldb: valueb...))` seems verbose
01:50:58FromDiscord<ElegantBeef> make a constructor?
01:51:05FromDiscord<Cohjellah> Want to move to offtopic for the .NET talk?
01:51:06FromDiscord<shadow.> yeah
01:51:09FromDiscord<shadow.> eh
01:51:09FromDiscord<Rebel> sure
01:51:11FromDiscord<shadow.> idc enough to argue
01:51:17FromDiscord<shadow.> but personally i just don't enjoy c# i'll leave it at that
01:51:20FromDiscord<Cohjellah> Also, yeah .NET 5 is taking over both core/framework
01:51:20FromDiscord<ElegantBeef> !repo constructor
01:51:21disbothttps://github.com/beef331/constructor -- 9constructor: 11Nim macros to aid in object construction including event programming, and constructors. 15 3⭐ 0🍴 7& 2 more...
01:51:21FromDiscord<ElegantBeef> 😄
01:51:31FromDiscord<shadow.> litty
01:51:58FromGitter<fish-face> haha I see
01:52:19FromGitter<fish-face> I am trying to do AoC with stdlib for now
01:52:30FromGitter<fish-face> but thanks
01:56:55*wowaname joined #nim
01:57:33FromDiscord<exelotl> @Cohjellah I don't think it does, might be wrong though
01:58:00FromDiscord<Cohjellah> Interesting, I thought they were the OGs that put it on teespring
01:58:03*opal quit (Ping timeout: 240 seconds)
01:58:04*wowaname is now known as opal
01:58:06FromDiscord<Cohjellah> Hope it does support them ahah bought a mug
01:59:09FromDiscord<exelotl> I would totally buy some Nim merch if I knew it was legit x)
02:00:14FromDiscord<Rebel> where is disruptek when you need him 😦 finally going to solve my woeful problems
02:00:34disruptekabout fucking time.
02:00:50FromDiscord<Rika> Lol
02:01:28FromDiscord<shadow.> lmfao
02:01:37FromDiscord<shadow.> disruptek what were the lines were underlining is handled
02:01:40FromDiscord<shadow.> and what did you say was the issue
02:01:48FromDiscord<Rika> I assume it's too long
02:01:53FromDiscord<shadow.> ill work on it after i finish writing about index fossils
02:01:55FromDiscord<shadow.> lmfao
02:02:14FromGitter<fish-face> final question for tonight: is there a way to pass something as a mutable value?
02:02:26FromDiscord<Rebel> oh shit lol
02:02:30FromGitter<fish-face> sorry, I mean: pass something *by* value, but mutable
02:02:32FromDiscord<Rebel> wasn't expecting you to respond right away 😛
02:02:43disruptekprefix the proc param with `var`.
02:02:54disruptekthe /type/, rather.
02:03:06mipriso you want a var param but don't want to mutate the caller's value? gotta make a new var in the proc.
02:03:16FromDiscord<shadow.> shadow it
02:03:25disruptekdisruptek it
02:03:55FromDiscord<shadow.> don't you just hate when you disruptek your parameters in for loops
02:04:00FromGitter<fish-face> this doesn't work as I expect: the compiler complains that the value is immutable - which is what I want, because the *calling* proc should not mutate it. So I want to pass a copy to the inner proc (by value semantics) which would not violate immutability
02:04:25disruptekshadow it and then disruptek it.
02:04:28disruptekshadow it and then pass it.
02:04:42mipriit's a lone point where Nim can be more verbose than usual, but just exploit `result` a little more to bring the verbosity back down.
02:04:43FromGitter<fish-face> oh wait, I misunderstood my own code
02:05:07disruptekhold your laptop a little closer to the router; i can't quite make out what's going on here.
02:05:09FromDiscord<ElegantBeef> By default it's immutable, `var` makes it a reference to the original, so yea you have to make a copy
02:05:17FromDiscord<shadow.> shadowruptek it
02:05:21FromDiscord<ElegantBeef> Close your windows the wifi is escaping
02:05:30FromDiscord<shadow.> what? why would i shut down my os
02:05:32FromDiscord<shadow.> that's a dumb idea
02:05:35FromDiscord<shadow.> actually no it's a great idea
02:05:39disruptekturn the lights down low; the contrast is all washed out.
02:05:39FromDiscord<shadow.> i'm just too much of a kiddy to do it
02:05:40FromGitter<fish-face> I think I understood anything correctly, except that actually the calling proc *does* need to mutate it - hence the error :)
02:05:54FromDiscord<shadow.> so then prefix parameter with `var` right?
02:06:19mipriright. what you want is mutable vars within the proc, but you don't want to mutate the caller's proc. The way to do this is to accept immmutable parameters normally, and then assign them to vars.
02:06:57FromDiscord<shadow.> yeah
02:07:23FromDiscord<shadow.> id say a `mut` keyword could be added but nah
02:07:27FromDiscord<shadow.> not tryn ago rst mode
02:07:33FromDiscord<shadow.> that'd also be confusing
02:07:34miprihttps://play.nim-lang.org/#ix=2HmX - like so.
02:07:41FromGitter<fish-face> the calling proc needed `var` in the type spec, and to explicitly copy the var somewhere else. I got mixed up between the proc that receives it by value, and a different proc which needs it by reference, and which is doing the mutation
02:07:55FromDiscord<shadow.> fair enough
02:09:01FromDiscord<shadow.> also disruptek i learned how to use git finally
02:09:01FromDiscord<shadow.> lmao
02:09:11FromDiscord<shadow.> so i dont have to use 500mb of ram to make a pr
02:16:35disruptekno shit.
02:20:05FromDiscord<shadow.> yeah
02:20:13FromDiscord<shadow.> are you proud https://media.discordapp.net/attachments/371759389889003532/786416948811661342/unknown.png
02:24:00disrupteki don't see any underlines.
02:24:25FromDiscord<shadow.> hmm
02:25:25FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786418262694035486/unknown.png
02:25:29FromDiscord<shadow.> this one works fine lol
02:25:36FromDiscord<shadow.> its the test on the front page with the underlines, right?
02:25:54disruptekyeah, that looks fine.
02:27:57FromDiscord<shadow.> yeah hmm
02:28:05FromDiscord<shadow.> lemme try the test one
02:28:11FromDiscord<shadow.> !repo testes
02:28:12FromDiscord<shadow.> im so lazy
02:28:13disbothttps://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 17⭐ 1🍴 7& 29 more...
02:28:43disruptek29 more testes... that must feature ol' three-ball saul.
02:29:44FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/786419348973682708/unknown.png
02:29:46FromDiscord<shadow.> this looks...fine?
02:29:55FromDiscord<shadow.> ahhh
02:29:58FromDiscord<shadow.> it does the sped lines only in minimized
02:30:11FromDiscord<shadow.> or rather when you like stretch console
02:30:14FromDiscord<shadow.> it's a windows thing iirc
02:30:16disruptekwtf is a sped line?
02:30:19disrupteksuper fun.
02:30:21FromDiscord<shadow.> it happened with my maze solver too
02:30:22FromDiscord<shadow.> a line that is sped
02:30:28disrupteksped?
02:30:47disruptek2 definitions found
02:30:47disruptek
02:30:47disruptekFrom The Collaborative International Dictionary of English v.0.48 [gcide]:
02:30:47disruptek
02:30:49disruptek Sped \Sped\,
02:30:52disruptek imp. & p. p. of {Speed}.
02:30:54disruptek [1913 Webster]
02:30:57disruptek
02:30:59disruptekFrom The Collaborative International Dictionary of English v.0.48 [gcide]:
02:31:02disruptek
02:31:04disruptek Speed \Speed\ (sp[=e]d), v. i. [imp. & p. p. {Sped} (sp[e^]d),
02:31:07disruptek {Speeded}; p. pr. & vb. n. {Speeding}.] [AS. sp[=e]dan, fr.
02:31:09disruptek sp[=e]d, n.; akin to D. spoeden, G. sich sputen. See {Speed},
02:31:12disruptek n.]
02:31:14disruptek 1. To go; to fare. [Obs.]
02:31:17disruptek [1913 Webster]
02:31:19disruptek
02:31:22disruptek To warn him now he is too farre sped. --Remedy of
02:31:24disruptek Love.
02:31:27disruptek [1913 Webster]
02:31:29disruptek
02:31:32disruptek 2. To experience in going; to have any condition, good or
02:31:35disruptek ill; to fare. --Shak.
02:31:37disruptek [1913 Webster]
02:31:39disruptek
02:31:42disruptek Ships heretofore in seas like fishes sped;
02:31:44disruptek The mightiest still upon the smallest fed. --Waller.
02:31:47disruptek [1913 Webster]
02:31:49disruptek
02:31:52disruptek 3. To fare well; to have success; to prosper.
02:31:54disruptek [1913 Webster]
02:31:55mipricombo breaker
02:31:57disruptek
02:31:59disruptek Save London, and send true lawyers their meed!
02:32:03disruptek For whoso wants money with them shall not speed!
02:32:04disruptek --Lydgate.
02:32:07disruptek [1913 Webster]
02:32:09disruptek
02:32:12disruptek I told ye then he should prevail, and speed
02:32:15disruptek On his bad errand. --Milton.
02:32:17disruptek [1913 Webster]
02:32:19disruptek
02:32:22disruptek 4. To make haste; to move with celerity.
02:32:24disruptek [1913 Webster]
02:32:27disruptek
02:32:29disruptek I have speeded hither with the very extremest inch
02:32:32disruptek of possibility. --Shak.
02:32:34disruptek [1913 Webster]
02:32:37disruptek
02:32:40disruptek 5. To be expedient. [Obs.] --Wyclif (2 Cor. xii. 1.)
02:32:42disruptek [1913 Webster]
02:32:45disruptekoops.
02:32:47FromDiscord<shadow.> urban dictionary is a more credible source
02:32:57FromDiscord<shadow.> > an insult used when someone does something stupid.
02:33:09FromDiscord<shadow.> there are other definitions but i dont condone using it that way
02:33:15FromDiscord<shadow.> lmao
02:33:21disruptekokay, chucklehead.
02:33:22blackbeard420sped = One who attends special education classes.
02:33:46FromDiscord<shadow.> yeah did not mean that lol
02:34:17FromDiscord<Rika> did you mean sped up or what
02:35:29FromDiscord<shadow.> just stupid
02:35:30FromDiscord<shadow.> nvm
02:35:34FromDiscord<shadow.> this is what i get for being in high school
02:36:02disrupteki could probably teach you a thing or two about being high.
02:36:06FromDiscord<Quibono> lol
02:36:59FromDiscord<shadow.> yes
02:37:06FromDiscord<shadow.> be the good influence i need
02:37:16FromDiscord<Rebel> oh yeah disruptek I am pushing what I have to dev branch now just need to figure out when to call my async proc to ship reults
02:37:32disruptekyeah, great.
02:37:41FromDiscord<shadow.> so then the line thing isnt a code issue
02:37:44FromDiscord<shadow.> it's just windows being stupid
02:37:49FromDiscord<shadow.> windows being windows
02:37:49FromDiscord<Rika> lol
02:37:49disruptekyeah, great.
02:37:51FromDiscord<Rebel> yes great indeed this problem has been a pain on my side
02:37:51FromDiscord<Rika> as expected
02:37:54FromDiscord<Rebel> for weeks...
02:38:00FromDiscord<Rebel> it's slowly chipping away at my sanity
02:38:08FromDiscord<shadow.> so then we just need to fix the expect thing?
02:38:12FromDiscord<shadow.> still don't know why that fails 1.0-1.2
02:38:21FromDiscord<Rebel> ya boi has IL manipulation they need to do
02:38:54FromDiscord<Rika> man using they as a 1st person singular is weird lmao
02:39:03FromDiscord<shadow.> yeah lmao
02:39:15FromDiscord<shadow.> doesn't roll well
02:39:26FromDiscord<Rebel> this is what happens when your sanity has taken a dip
02:39:26FromDiscord<shadow.> obvi use whatever pronouns you'd like but in third person sounds kinda bumpy lol
02:39:39FromDiscord<Quibono> So I passed a private url to httpclient, the code proc in httpclient errors out with Error: unhandled exception: value out of range: 999 notin 0 .. 599 [RangeDefect]
02:39:41FromDiscord<Rika> almost as weird as using name to refer to yourself
02:39:42FromDiscord<Rebel> I thought you said you could import export symbols 🤔
02:39:59FromDiscord<Rebel> not recursive module dependency errors 😦
02:40:01FromDiscord<Quibono> Should there be a code for it?
02:40:12FromDiscord<Rika> i dont get it lol
02:40:17FromDiscord<shadow.> `RangeDefect` i suppose, but that's a bit scuffed
02:40:22FromDiscord<shadow.> wdym by private url
02:40:22disruptekyou got an http status code of 999.
02:40:35FromDiscord<shadow.> that makes sense
02:40:35FromDiscord<shadow.> lol
02:40:39FromDiscord<Rika> that would be odd
02:40:42FromDiscord<shadow.> i mean
02:40:46FromDiscord<Quibono> Why does that give a rangedefect tho?
02:40:49disruptekask dom96 to right some unit tests so his shit might work some day.
02:40:50FromDiscord<Rika> what kinda noncompliant webserver returns 999 as a status code
02:40:52FromDiscord<shadow.> because its not in the range of accepted codes
02:40:55FromDiscord<shadow.> 0..599
02:41:01disruptekwrite, too.
02:41:02FromDiscord<shadow.> lol
02:41:13FromDiscord<Quibono> Lol coursera
02:41:19FromDiscord<shadow.> urls behind passwords raise http status 999?
02:41:21FromDiscord<shadow.> thats news to me
02:41:36FromDiscord<Quibono> I tried to use a coursera url behind a password
02:41:42FromDiscord<shadow.> oh lord
02:42:01FromDiscord<shadow.> rly going all out on error testing huh lol
02:42:11FromDiscord<shadow.> like i said, if the user abuses that;
02:42:18FromDiscord<shadow.> (edit) "abuses that;" => "tries to mess it up on purpose"
02:42:21FromDiscord<shadow.> that should be their issue lol
02:42:28FromDiscord<shadow.> you don't needa completelyy idiot proof it
02:42:43FromDiscord<Quibono> Yes you do
02:42:47FromDiscord<Quibono> lol
02:42:54FromDiscord<Rebel> it has been pushed disruptek
02:42:59FromDiscord<Quibono> You used the word user shadow.
02:43:02FromDiscord<Quibono> That means idiot
02:43:03FromDiscord<Rebel> just need to figure out my error of why it's not compiling lol
02:43:04FromDiscord<Rika> why 999 and not 403?
02:43:17FromDiscord<Quibono> @Rika because coursera loves me?
02:43:18FromDiscord<shadow.> because 999 rolls off the tongue smoother, no?
02:43:23FromDiscord<Rika> lmao
02:43:38FromDiscord<Rebel> ` Error: undeclared identifier: 'tLock', This might be caused by a recursive module dependency:`
02:43:42FromDiscord<shadow.> oh lord
02:43:50FromDiscord<shadow.> recursive imports
02:43:51FromDiscord<Rika> what are you importing
02:43:56FromDiscord<Rebel> well
02:44:01FromDiscord<Rebel> tLock is defined in a different file
02:44:03FromDiscord<Rebel> I am exporting it
02:44:05FromDiscord<Rebel> and trying to import
02:44:06FromDiscord<Rebel> (edit) "and trying to import ... " added "it"
02:44:19FromDiscord<Rebel> `var tLock: Lock`
02:44:39FromDiscord<Rebel> I guess I could link the exact line if you want
02:44:41FromDiscord<Rika> do you import anything in the different file from the exporting file?
02:44:42FromDiscord<Rebel> might be easier to explain
02:44:45*cgfuh joined #nim
02:44:52FromDiscord<Rebel> no?
02:44:59FromDiscord<Rebel> I only import that symbol from the file
02:45:04FromDiscord<Rika> i mean in reverse sorry
02:45:09FromDiscord<Rebel> oh
02:45:10FromDiscord<Rebel> yes
02:45:16FromDiscord<Rika> different file importing the exporting file
02:45:20FromDiscord<Rebel> yes yes
02:45:40FromDiscord<Rebel> the file where tLock is declared imports procs from the file that imports the exported var tLock
02:45:41FromDiscord<Rika> thats messy haha gonna be a ride to fix
02:46:17FromDiscord<Rebel> https://tenor.com/view/oso-bear-care-bear-family-guy-suicide-gif-5667806
02:46:19*cgfuh quit (Client Quit)
02:46:43FromDiscord<Quibono> Guys I've got a brilliant idea: We make a python implementation compiled in Nim.
02:46:52FromDiscord<Quibono> And then slowly change the syntax
02:46:55FromDiscord<Rebel> where is disruptek 😡
02:46:57FromDiscord<Quibono> Until it's Nim
02:46:59FromDiscord<Quibono> Compiled in Nim
02:47:19FromDiscord<Rebel> you should check out vlang quibono you can see vlang compile vlang
02:47:37FromDiscord<Rika> https://nim-lang.org/docs/manual.html#modules maybe read this section because i cant explain this well
02:47:51FromDiscord<Rika> i mean the nim compiler is in nim
02:48:04FromDiscord<Quibono> Rika exactly
02:48:11FromDiscord<Quibono> They'll all be secretly using Nim
02:48:25FromDiscord<shadow.> smart
02:48:29FromDiscord<Rebel> Yeah this is not going to be fun to solve
02:48:34FromDiscord<Rebel> maybe I should just move the lock in it's own file
02:48:39FromDiscord<shadow.> just comment out the line
02:48:49FromDiscord<Rika> yeah in nim the location of the import line is important 😛
02:48:52FromDiscord<Rika> it gets messy
02:49:35disruptekpay me money and i'll teach you whatever you want to know about girls.
02:49:49disruptekmaybe some info on threading will be thrown in, too.
02:49:54disruptekno promises.
02:50:15FromDiscord<Quibono> Women are a little bit like parallelism...
02:50:19FromDiscord<shadow.> oh lord
02:50:25FromDiscord<Rebel> I want to know how to solve my recursive module dependency
02:50:25FromDiscord<shadow.> where is this going
02:50:28FromDiscord<shadow.> it's fun to do more at once
02:50:30FromDiscord<shadow.> (edit) "once" => "once?"
02:50:40FromDiscord<shadow.> that's my guess
02:50:43disruptekone at a time is good, two at a time is better.
02:50:50FromDiscord<Quibono> I meant confusing and liable to cause race conditions, but sure.
02:50:50FromDiscord<shadow.> ah there we go
02:50:59FromDiscord<shadow.> i like our version better
02:51:33FromDiscord<Rika> i wonder when will the software people start changing "race conditions" to "more inclusive language"
02:51:41FromDiscord<Rebel> um
02:51:48FromDiscord<Rebel> should check out twitter
02:51:54FromDiscord<Rika> no thank you
02:52:30FromDiscord<Rebel> https://twitter.com/TwitterEng/status/1278733305190342656
02:52:33FromDiscord<Rebel> too late 😛
02:54:22FromDiscord<Rebel> wait is this not how you import vars declared in a separate file? `from ../utils/job import tLock`
02:55:15FromDiscord<Rika> i mean it is
02:55:37FromDiscord<Rika> its just that if it hits another import itll go to that file
02:55:59FromDiscord<Rebel> oh fiddlesticks
02:56:06FromDiscord<Rebel> this is quite the conundrum
02:56:35FromDiscord<Rebel> I want to move onto the funner things like CLR Hosting and a wrapper for memorymodule not this jank threading solution
03:03:38FromDiscord<shadow.> who's sticks are we fiddling
03:03:42FromDiscord<shadow.> (edit) "who's" => "whose"
03:04:10FromDiscord<Rebel> whelp in the meantime guess it's time to learn mono.cecil
03:04:27FromDiscord<Rebel> Would prefer dnlib but it just archived so F
03:05:47FromDiscord<Rebel> fun IL manipulation to do fun things to assemblies 😈
03:06:39disruptekit's hard to run when you can't even walk.
03:08:14FromDiscord<Rebel> ....
03:08:22FromDiscord<Rebel> thanks Descartes
03:12:33FromDiscord<Rebel> I guess there is always plan D
03:12:51*mbomba quit (Quit: WeeChat 3.0)
03:13:06disruptekcorrespondence classes and try to get your GED?
03:13:43FromDiscord<Rebel> no just archive it and remove the feature lol
03:13:46FromDiscord<Rebel> work on other things
03:13:50FromDiscord<Rebel> and maybe come back to it
03:13:56FromDiscord<Rebel> I don't get paid enough to deal with this
03:14:20disrupteki'm with you.
03:14:23disruptekthreads are for nerds.
03:14:36*muffindrake quit (Ping timeout: 258 seconds)
03:16:39*muffindrake joined #nim
03:17:15FromDiscord<Rebel> true 😦
03:17:33FromDiscord<Rebel> I guess I could just not import the lock
03:17:37FromDiscord<Rebel> and hope it works
03:18:20FromDiscord<Rebel> what's the worse that could happen
03:19:19FromDiscord<Rebel> in theory only one thread would be accessing that table at all times so there should be no race condition 🤔
03:19:37FromDiscord<Rebel> unless I'm being smoothbrained right now
03:21:21FromDiscord<Rebel> right disruptek? isn't that the motto just yolo commit and push to prod 😄
03:21:32disrupteki just delete anything i don't understand.
03:22:20FromDiscord<Rebel> well riddle me this if only one thread is accessing the table there would be no race condition right?
03:22:36disruptekit'd be a very long race.
03:22:44FromDiscord<Rebel> Do I really need that lock?
03:23:06disruptekif only one thread accesses it, why would i have told you to build it that way?
03:23:25voltistIf I have a seq of `ref T`, how can I add a traced reference to an object of type T to it?
03:23:33FromDiscord<Rebel> wait what?
03:23:36FromDiscord<Rebel> I don't understand
03:23:46FromDiscord<Rebel> because it's the easiest solution?
03:23:46disrupteks.add new (ref T)(some: field, values: here)
03:23:52disrupteker, omit `new`.
03:24:03disruptekrebel: because you should have two threads accessing it.
03:24:17disruptekone where you do async bullshit and another where you do your keylogging.
03:24:38FromDiscord<Rebel> well how do you import the lock then?
03:24:39disrupteki can't spend the whole evening explaining this again, though.
03:24:42disrupteki have porn to watch.
03:24:48FromDiscord<Rebel> hentai?
03:24:57disrupteknah, interracial.
03:24:59voltistdisruptek: What if it's an existing object? I'm using `s.add(ref obj)` where obj is of type T, but I get a syntax error
03:25:10disruptekthat's not a thing.
03:25:14FromDiscord<Rebel> it's fine lol I don't need you to explain it again I'm not touching it tonight anymore
03:25:19disruptekcool.
03:25:31FromDiscord<Rebel> I don't know if I would call it cool
03:25:32Prestigedisruptek: interracial, was that the race condition?
03:25:42disrupteklet x = (ref T)(); x[] = obj; s.add x
03:25:45FromDiscord<Rebel> well I guess IL manipulation is cool
03:25:55disruptekPrestige: smart cookie.
03:26:38voltistOh cool thanks
03:26:50disruptekvoltist: meet nim halfway -- give it a ref to manage. 😉
03:29:33voltistdisruptek: Yeah, makes a bit more sense
03:30:23ForumUpdaterBotNew thread by Ggibson: Fusion/SharedPtr why []= sig undefined?, see https://forum.nim-lang.org/t/7234
03:30:32disruptekif you had to choose packages to add to a nim distribution, what would you include?
03:31:17voltistLike existing but non-standard-library packages?
03:31:39disruptekyeah.
03:31:58voltistggplotnim and jester would be my choices
03:32:08voltistOh and arraymancer
03:32:42disruptekimagine that when you run `git nim devel` you get this set of packages, all guaranteed to work with the devel compiler, and when you `git nim stable` you get the same (or slightly different) set, but also versioned to work with the given compiler.
03:34:55disruptekthat's a pretty weak list.
03:52:54voltistIt just happens to be what I use
03:53:21voltistProbably not the typical nim user's needs
04:04:49FromDiscord<shadow.> disruptek is there any way to view the log of the failed tests for the expect template? it'd be easy to find out what the issue was after that
04:05:38disruptekof course.
04:06:01*supakeen quit (Quit: WeeChat 2.9)
04:06:34*supakeen joined #nim
04:07:00FromDiscord<shadow.> alr ill take a look
04:09:16FromDiscord<shadow.> unhandled os error
04:09:24FromDiscord<shadow.> the template isnt catching it?
04:10:46*spiderstew quit (Ping timeout: 256 seconds)
04:11:41*spiderstew joined #nim
04:13:16FromDiscord<shadow.> i dont see how that'd change between versions 1.2 and 1.4
04:14:04disrupteki wish there was some way to test it locally.
04:14:42FromDiscord<shadow.> im too lazy to get a nim version control handler
04:14:54FromDiscord<shadow.> im also not around my pc rn, ill massage your testes tmr
04:15:03disruptekaight.
04:15:24FromDiscord<shadow.> i mean if you have nim 1.0 you could always test it
04:15:29FromDiscord<shadow.> wink emoji
04:16:02disrupteki'll wait.
04:17:00FromDiscord<shadow.> you don't like touching your own testes?
04:17:17FromDiscord<shadow.> what do you do when you watch your interracial, eat popcorn?
04:17:37disruptekjunior mints and milk duds.
04:17:42FromDiscord<Esbeesy> You know waking up at 4am, I thought “I wonder if the nim Discord is active”
04:17:50FromDiscord<shadow.> always.
04:17:55FromDiscord<Esbeesy> Walked straight into disrupteks testes
04:18:02disruptekand not for the last time.
04:18:24FromDiscord<Esbeesy> They do have a welcome warmth, I must admit
04:18:56disrupteki have the best package.
04:19:52FromDiscord<shadow.> esbeesy what was your solution for aoc today?
04:23:31FromDiscord<Esbeesy> Day 9?
04:23:36FromDiscord<shadow.> ye
04:23:55FromDiscord<shadow.> we can compare, im interested to see how others did it
04:24:20FromDiscord<Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day9/day9.nim
04:24:31FromDiscord<shadow.> ohh ok
04:24:39FromDiscord<shadow.> !repo shadowninja55/aoc-2020
04:24:40disbothttps://github.com/shadowninja55/aoc-2020 -- 9aoc-2020: 11my attempt at advent of code 2020 in nim. 15 1⭐ 0🍴
04:24:42FromDiscord<Daniel> Areas in brain of a woman is not interconnected the same way as a brain of a man.
04:24:54FromDiscord<Daniel> (edit) "is" => "are"
04:24:56FromDiscord<Esbeesy> Need to get into that repo bot
04:25:25disruptekfun fact: the bot doesn't compile right now due to nimterop.
04:25:59FromDiscord<shadow.> wow, your solution's pretty clean
04:27:31disruptekblock found: for number in preamble: if nextNumber - number in preamble: break found
04:27:58disruptekomit continue. just fucking strike it from your vocabulary.
04:28:17disruptekuse named break versus temporary booleans.
04:28:17FromDiscord<ElegantBeef> ^
04:30:01*mbomba joined #nim
04:30:33FromDiscord<Esbeesy> Ha what’s wrong with continue? Does it fuck with nims optimiser?
04:30:42FromDiscord<ElegantBeef> It's just silly
04:30:45disruptekit fucks with the reader.
04:30:54disruptekjust use dominating conditionals.
04:30:57FromDiscord<ElegantBeef> Especially since you can do better
04:31:20FromDiscord<ElegantBeef> you can do `for n in numbers.toOpenArray(25,numbers.high)`
04:31:47FromDiscord<ElegantBeef> Or even my method 😄 https://play.nim-lang.org/#ix=2HnA
04:32:49disruptekuse more newlines after :
04:33:44disruptekuse named break. 😉
04:35:13FromDiscord<ElegantBeef> If that's to me i have 0 clue where i'd
04:35:33disruptekanyFound.
04:35:39FromDiscord<Esbeesy> Yeah so I didn’t know about named break until just now, definitely@could have saved 7 lines there
04:36:19disruptekaraq would say, "continue is lazy control-flow."
04:37:48disruptekfor findErrorRangeSum() i would like to see an explicit `result = 0` at the end of the proc.
04:40:26disruptekif ...: ... is tolerated in the compiler but i think it's obnoxious. too hard to intuit at a glance.
04:40:45disrupteki want newlines. i want to see the structure.
04:40:55disruptekjust my opinions.
04:41:00FromDiscord<ElegantBeef> It's one of the few things i retain from C# 😄
04:41:13disrupteki mean, araq does it. i don't like it.
04:41:27FromDiscord<Esbeesy> “C# PTSD triggered”
04:41:57FromDiscord<Esbeesy> 4 level nested Ternary operators
04:42:28FromDiscord<Esbeesy> ? Smashed on the end of every word cause fuck knows where the next null value is going to pop up and ruin your day
04:42:31disruptekit's like... just because you /can/, doesn't mean you /should/.
04:44:19FromDiscord<ElegantBeef> well nim's wrapnils allows you to do the same but you just use `?` once
04:44:33FromDiscord<ElegantBeef> `?.long.ass.proc.call.chain`
04:44:35disruptekwhat a dumb addition. i've never, ever seen it used. ever.
04:44:42FromDiscord<Esbeesy> Same
04:44:46FromDiscord<ElegantBeef> Triple same
04:45:19disruptekwaste of a perfectly useful operator.
04:45:32FromDiscord<Esbeesy> Go also has “nil” but the language stops it from jumping out at you in dark alleys
04:45:45FromDiscord<ElegantBeef> It also doesnt have gnerics
04:45:46FromDiscord<ElegantBeef> (edit) "gnerics" => "generics"
04:46:02disruptekthey are getting generics and we are getting notnil, so it's a wash.
04:46:06FromDiscord<Esbeesy> Doesn’t need them, but it will have them in 1.18 anyway
04:49:46FromDiscord<Esbeesy> Oh boy, I have this random benchmark exercise I do to see how fast a language can parse a huge CSV file, I wrote the nim one like a year ago...
04:49:56FromDiscord<Esbeesy> I clearly had no experience with nim lmao
04:50:13disruptekyou should test the old code with and without arc.
04:50:39FromDiscord<shadow.> and -d:danger -d:lto
04:51:11FromDiscord<Esbeesy> Okay so interested pique’d, you guys might be interested in this
04:51:34FromDiscord<Esbeesy> I wrote the nim code to be actually, legible, perf was the same
04:51:59FromDiscord<Esbeesy> Rust: 600ms↵Go: 980 ms↵Nim: 1500ms
04:52:14FromDiscord<Esbeesy> Then I started doing the danger, gc:none
04:52:32FromDiscord<Esbeesy> (Side note, Didn’t use lto yet, what is that?)
04:52:40FromDiscord<Esbeesy> Got Nim down to 920ms
04:53:19FromDiscord<ElegantBeef> Now just imagine if you wrote it well 😛
04:53:26*waleee-cl quit (Quit: Connection closed for inactivity)
04:54:14*narimiran joined #nim
04:54:14FromDiscord<Esbeesy> I mean, it is well written now, and I wrote it 4 different ways, and the perf didn’t change once
04:54:23FromDiscord<Esbeesy> Nims optimiser is fantastic
04:54:44FromDiscord<ElegantBeef> Can we see the nim code?
04:54:50disrupteksounds like your code isn't very good.
04:55:26FromDiscord<Esbeesy> Hear me out:
04:55:43mipridon't worry too much about what disruptek says
04:55:50FromDiscord<Esbeesy> Nimprof shows 62% of the time is spent in the parseCsv’s parseField method
04:56:03disruptekignore nimprof.
04:56:14disruptekonly perf counts.
04:56:48FromDiscord<Esbeesy> Wat
04:56:58FromDiscord<Esbeesy> How do you profile performance in nim?
04:57:39FromDiscord<ElegantBeef> `cpuTime` 😛
04:59:09*mbomba quit (Quit: WeeChat 3.0)
04:59:45FromDiscord<j-james> alright day ten time
05:00:54disruptek!repo perf
05:00:55disbothttps://github.com/dfdeshom/nim_log_perf -- 9nim_log_perf: 11 15 0⭐ 0🍴
05:01:00disruptekuh, no.
05:01:06FromDiscord<Esbeesy> Lmao
05:01:43disruptekhttps://perf.wiki.kernel.org/index.php/Main_Page
05:02:46FromDiscord<Esbeesy> cries in Windows
05:03:17disruptekas the kids say, `rip.`
05:03:17FromDiscord<Esbeesy> Really should set up WSL but tres effort
05:03:46disruptekso where is the code?
05:03:58disruptekignore mipri; it sucks.
05:10:26FromDiscord<Rika> Lol
05:10:46FromDiscord<Esbeesy> It’s 5AM and I’m currently in bed bollock naked, only awake cause my puppy decided to start howling at.. a ghost or something
05:11:00FromDiscord<Esbeesy> I’ll send the code when I’m up shortly though 😂
05:12:33*NimBot joined #nim
05:18:17FromDiscord<Rika> Sorry was just peeking in your house didn't mean to disturb your dog
05:19:20*vicfred quit (Quit: Leaving)
05:20:07disruptekit's okay; i was awake.
05:24:04FromDiscord<Cypheriel> So what exactly is the deal with the VSCode extension? How come the last update was 9 months ago?
05:24:56FromDiscord<Cypheriel> I mean... I don't know if maybe I don't know what I'm talking about, but 9 months seems like a really long time
05:25:26disruptekthat's what my mom says, too.
05:25:35FromDiscord<Cypheriel> ._.
05:25:56FromDiscord<Esbeesy> I think it’s okay? Tried the IntelliJ one and the code one was better
05:26:19FromDiscord<Esbeesy> Its not using LSP though I don’t think?
05:26:39FromDiscord<Cypheriel> I don't really know the difference, I don't have access to the LSP one
05:26:50FromDiscord<Cypheriel> but I mean it feels like it's still unfinished
05:34:41FromDiscord<Cypheriel> I mean, I also noticed that the Jetbrains Nim plugin updated pretty recently
05:35:00FromDiscord<Cypheriel> so I was just a little confused as to why not much was happening on the VSCode side
05:35:16FromDiscord<Esbeesy> What features do you mean exactly?
05:35:41FromDiscord<Cypheriel> Not necessarily features, but I have noticed some weird fake errors and things like that
05:36:39FromDiscord<Rebel> can the guy who made nimsuggest extension learn to optimize better that shit eats up my CPU 😦
05:36:49FromDiscord<Esbeesy> Can you give an example? I’ve noticed the errors are cascading, I.e if you have an error at line 6 it’ll throw off everything after
05:37:16FromDiscord<Rebel> why do you have Karl Marx as your pfp? 🤔
05:37:20disrupteknimsuggest is basically the compiler.
05:37:23FromDiscord<Rebel> were you part of the recent FireEye hack....
05:37:53FromDiscord<Cypheriel> The only thing I can think of off the top of my head is the wrapSocket() and newContext() will always show up as undefined
05:38:09FromDiscord<Cypheriel> but even with 100% fine code, sometimes there will be weird errors
05:38:26FromDiscord<Cypheriel> not to mention, you only get to see new errors whenever you save your code
05:39:08FromDiscord<Cypheriel> when I say wrapSocket() and newContext(), I mean from the `net` library
05:40:29*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:40:36*njoseph joined #nim
05:42:07FromDiscord<j-james> Refactoring is also shakey
05:43:21FromDiscord<Cypheriel> It's kind of gotten to the point where the only real reliable thing from the extension is the syntax highlighting
05:44:12FromDiscord<Cypheriel> you're pretty much better off using any old text editor and running your code to using the.. <CLI command I forgot the name of> to check your code
05:53:03FromDiscord<Esbeesy> I’m a bearded commie bastard is why 😂
05:54:01FromDiscord<Esbeesy> I’ve noticed it goes booloo if you start using channels
05:54:27FromDiscord<Zeus> I noticed some weird issues with the vscode earlier today as well. But my issue was that the extension wasn't recognizing an exported proc as valid
05:55:11FromDiscord<Esbeesy> The beauty of nim is it’s easy to parse (visually) and quick to debug with a couple of echo statements, ‘nim c -r filename’
05:55:32FromDiscord<Esbeesy> But still, there’s always room for improvement with anything
05:55:39FromDiscord<Rebel> I don't know if it's always quick to debug lol
05:56:02FromDiscord<Rebel> Nothing compared to having tools like pycharm's debugger
05:56:09FromDiscord<Esbeesy> !repo nimlsp
05:56:09disbothttps://github.com/PMunch/nimlsp -- 9nimlsp: 11Language Server Protocol implementation for Nim 15 169⭐ 18🍴
05:56:29FromDiscord<Cypheriel> So what exactly is this LSP?
05:56:43FromDiscord<Esbeesy> PMunch frequents here, they can probably add more to the conversation than just our whining 😂
05:56:51FromDiscord<Esbeesy> Language Server Protocol
05:57:39FromDiscord<Esbeesy> https://microsoft.github.io/language-server-protocol/
05:57:41FromDiscord<Cypheriel> Do I just install it and reload VSCodium?
05:58:03FromDiscord<Esbeesy> One of the rare times M$ has given more than it’s taken
05:58:50FromDiscord<Esbeesy> Not sure Cypher, I think the Code extension needs code to actually point at it
05:59:01FromDiscord<Cypheriel> Oh there's a whole setup section
05:59:29FromDiscord<Cypheriel> but of course there's no section for VSCode lol
06:00:05FromDiscord<Esbeesy> Lmao yeah
06:01:28FromDiscord<Esbeesy> For me the biggest feature would be auto-imports
06:02:05FromDiscord<Esbeesy> Like you type in scanf and it auto slaps in import strscans
06:02:33FromDiscord<Cypheriel> ohh, how cool
06:02:41disrupteki hate you.
06:02:53FromDiscord<Cypheriel> oh my
06:03:49FromDiscord<Esbeesy> lmao love you too
06:06:27FromDiscord<Rebel> I think you were taking care of interracial business disruptek? 🤔
06:06:37disruptekthere's still time for that.
06:11:05*jholland__ quit (Read error: Connection reset by peer)
06:11:21*jholland__ joined #nim
06:11:22*Evolver quit (Ping timeout: 268 seconds)
06:11:39*notchris quit (Read error: Connection reset by peer)
06:11:49*Evolver joined #nim
06:11:56*notchris joined #nim
06:13:38FromDiscord<Cypheriel> so maybe I shouldn't use PyCharm + LSP
06:13:47disrupteklsp is for chumps.
06:13:57disruptekreal nimions use nvim.
06:14:12FromDiscord<Cypheriel> I hovered over the `strscans` in `import strscans` and my entire screen was filled with the documentation
06:15:00FromDiscord<Esbeesy> I do use neovim actually for quick text editing tasks, just not comfortable enough with it to be `zen`
06:15:13FromDiscord<nikki> my text editor inserts the documentation of functions and modules i use, into my code
06:15:24FromDiscord<nikki> so i don't need to hover again
06:15:48FromDiscord<Cypheriel> I might try neovim, Nim might give me an excuse to learn it
06:16:04disruptektry simply remembering what things are instead.
06:16:07disruptekmight be easier.
06:16:10FromDiscord<Cypheriel> I had to install a nightly build, though... the formatting in `:Tutor` was broken and it was bugging the heck out of me
06:16:34FromDiscord<Cypheriel> also I hovered over it because it was underlined in red
06:16:52FromDiscord<nikki> vim8 just works
06:17:00FromDiscord<Esbeesy> Vim M8
06:17:05FromDiscord<Cypheriel> I'm trying to take a screenshot but it won't upload :(
06:17:07FromDiscord<nikki> but broken things are more fun
06:17:16FromDiscord<Rika> vi m8
06:18:34FromDiscord<Esbeesy> Holy - What is that --d:lto option?
06:18:49disrupteklink-time optimization.
06:19:15FromDiscord<nikki> build-time pessimization
06:19:49disruptekit smells like vomit in here, but my shirt is dry. curious.
06:20:09disruptekah, it's on my pants.
06:20:54FromDiscord<Cypheriel> oh my
06:21:01FromDiscord<Esbeesy> Well it just took the CSV parser down to 790-800 ms which is shweet
06:21:17disrupteklet's see this shitty code.
06:21:24FromDiscord<Esbeesy> Just making a gist now
06:21:28FromDiscord<Esbeesy> Broke my Rust compiler haha
06:21:34disruptekoh, i think i get the gist.
06:21:47FromDiscord<Cypheriel> was that supposed to be a pun
06:22:19disruptekdo you think i cannot find you?
06:24:12*clemens3_ joined #nim
06:24:51FromDiscord<Cypheriel> Do you think you can find me?
06:25:10FromDiscord<Rebel> did you like my hot code disruptek? or was it shitty 😦
06:25:12disruptekdon't you think it's odd that yardanico hasn't been seen in ages?
06:25:43disruptekrebel: i gave up on you awhile ago. i'm just waiting for you to give up, now.
06:25:56*clemens3 quit (Ping timeout: 240 seconds)
06:26:00FromDiscord<Rebel> ouch
06:26:10FromDiscord<Rebel> what happened to never giving up
06:26:17disruptekthat's for kids.
06:26:33disruptekyou don't get participation trophies in #nim.
06:26:48FromDiscord<Rebel> What do I get? 🤔
06:27:03FromDiscord<Rebel> 🏅
06:28:26disrupteki'll have to ask zevv if we can afford to give you a green square.
06:29:24FromDiscord<Rebel> what does that mean?
06:29:32FromDiscord<Rebel> Like how you can name a star after yourself?
06:29:47disrupteki dunno, but people do it all the time.
06:29:48FromDiscord<Rebel> tell me what do the numbers mean
06:30:07disrupteki had a star named after me, but that was many aliases ago.
06:34:14FromDiscord<Esbeesy> Wow okay so - latest rust 1.48, build time optimisations, it's actually ~800, identical to Nim
06:34:41FromDiscord<Esbeesy> Friendship ended with Rust too now I guess, all in on Nim 😂
06:34:58FromDiscord<Cypheriel> So does that mean Rust bad or Nim good
06:34:59disruptekrust has never been friendly.
06:35:15FromDiscord<Esbeesy> I do think there's an optimisation flag I'm missing on the Rust compiler but I just can't think what it is and the docs are all over the place
06:35:26FromDiscord<Esbeesy> saying that, I never found Nim's LTO flag until you guys told me
06:35:52disruptek--panics:on
06:36:03FromDiscord<nikki> disruptek, how do you feel about rust
06:36:06FromDiscord<Esbeesy> https://gist.github.com/sambeckingham/130928307835ce5e8bafa29806e124b2
06:36:16disrupteki'm in favor of anything that pays my bills.
06:36:26FromDiscord<Esbeesy> Strong agree ^
06:36:43*thomasross quit (Ping timeout: 260 seconds)
06:36:44FromDiscord<nikki> do you like nim more than that
06:36:55FromDiscord<nikki> i would guess so
06:36:58FromDiscord<Esbeesy> Although I've had it with .NET, underpaid for the amount of work you need to work with it
06:37:17disruptekthere's a lot to like about rust, but i'm most impressed by the tooling.
06:37:25FromDiscord<Cypheriel> C# and etc don't sound fun at all, honestly
06:37:31disrupteksam, i need the data.
06:37:40FromDiscord<nikki> i did asp.net mvc for a bit and it was aite
06:37:42FromDiscord<Esbeesy> Yes you do
06:37:44FromDiscord<Esbeesy> One sec
06:37:59disruptekc# is pretty good, imo.
06:38:01FromDiscord<nikki> what do you like about rust tooling disruptek
06:38:03FromDiscord<nikki> any examples
06:38:16disrupteklolbench has been most inspirational.
06:38:20FromDiscord<Esbeesy> "rustup" and away you go
06:38:27disruptekcargo is the best of the worst package managers i've used.
06:38:40disruptekservo.
06:38:59FromDiscord<Esbeesy> Serde is also obscenely fast
06:39:04disruptekthis is stuff that we need and i just haven't made it a priority to build it.
06:39:07FromDiscord<nikki> nice i know the lolbench author personally / have worked with
06:39:19disruptekwell, i did build nimph, but no one uses it.
06:39:37disrupteki have a thing that will blow lolbench away.
06:39:46FromDiscord<nikki> oho
06:40:10*habamax joined #nim
06:40:23disruptekas usual, my reach exceeds my grasp.
06:40:24FromDiscord<Rebel> if you think that level of optimization is crazy should how this person shrank a C# binary to under 8 kilobytes
06:40:30FromDiscord<Rebel> (edit) "if you think that level of optimization is crazy should ... how" added "read"
06:40:52FromDiscord<Esbeesy> Oh fuck I read that 😂 Way too much time
06:41:02FromDiscord<Rebel> 65 megabytes to 8 kilobytes 😄 fun stuff
06:41:50FromDiscord<Esbeesy> Worst part is the dotBoomer squad at work used it to justify how C# is "the best"
06:42:06FromDiscord<Rebel> I mean C# is pretty hot
06:42:07FromDiscord<Esbeesy> Like any of their smooth brains had the capacity to do the same
06:42:10FromDiscord<Rebel> especially with release of .net core
06:42:13FromDiscord<nikki> on disk
06:42:19FromDiscord<nikki> but what about in memory 😮
06:42:22FromDiscord<Rebel> Really depends on what you are trying to do
06:42:34FromDiscord<Rebel> you can execute C# .NET assemblies in memory??
06:42:39FromDiscord<Rebel> just host the CLR in C#
06:42:44FromDiscord<Esbeesy> As someone who's worked with it professionally for 6+ years: It's not that good
06:42:50FromDiscord<nikki> c# has a pretty fast interpreter for ios
06:42:53FromDiscord<Esbeesy> @disruptek: https://easyupload.io/ruj7bb
06:42:56FromDiscord<Rebel> reflective DLL in C++ that hosts the CLR to load your .NET assembly in memory
06:43:15FromDiscord<Rebel> you can't just say it's not that good and not expand...
06:43:17FromDiscord<nikki> ios can't jit, and it's pretty fast + you can use mixed aot and interpreted code
06:43:29FromDiscord<Rebel> check out coreRT runtime for hot AOT action
06:45:34FromDiscord<Esbeesy> The issue with C# and the .NET framework is that it does too much. "Just code it right" isn't an acceptable answer to this when you have to work in teams of 100+ developers who all have their own ideas.
06:45:50FromDiscord<Esbeesy> async/await poisons your code base
06:45:55FromDiscord<Esbeesy> Fuck nulls, just fuck em
06:46:18*a_chou joined #nim
06:46:36FromDiscord<Esbeesy> It's pass-by-ref behaviour is quite opaque unless you know, and in fact that goes for pretty much everything in C#, "unless you know"
06:47:18FromDiscord<nikki> an issue for me is also--- mark and sweep and ref types evrrywhere
06:47:26FromDiscord<nikki> but; they do have more valuey things for sure
06:48:09FromDiscord<Esbeesy> Then there's articles like that one where they reduce the program to 3 bits or make it so fast it breaks physics, but they ignore the main reason C# exists: Enterprise value
06:48:31*a_chou quit (Client Quit)
06:48:36FromDiscord<Rebel> I mean C# is pretty dank to write red team tools in
06:48:53FromDiscord<Rebel> What do you mean by enterprise value
06:49:25FromDiscord<Esbeesy> .NET's origins are squarely in providing plentiful resources to enterprise
06:49:33FromDiscord<Rebel> So you're mad they also have standard factory models for standards like async/await, and tasks?
06:50:15FromDiscord<Rebel> Well not mad but have gripes
06:50:23FromDiscord<Esbeesy> I'm not mad they have them - In fact I'm not mad, these are just observations from exposure over years
06:50:30FromDiscord<nikki> yeah it was a response to java / sun i think?
06:50:35FromDiscord<Esbeesy> Yes
06:51:10FromDiscord<nikki> vm / gc was a vibe
06:51:15FromDiscord<Esbeesy> And it's still there, they sell that MS ❤️ Open Source bullshit, but literally everything they release now has a one-click Azure integration or something to that effect
06:51:23FromDiscord<Esbeesy> Because cloud computing is now where the money is
06:52:04FromDiscord<nikki> they get used a bit for gamedev
06:52:04FromDiscord<Rebel> Can you blame them? Azure ad is becoming much more common so it's def working lol
06:52:12FromDiscord<nikki> and by a bit, i mean quite a bit. haha
06:52:13FromDiscord<Rebel> They probably also make bank on msatp
06:52:28disruptekit will take me more than 30mins to download this csv file.
06:52:43FromDiscord<nikki> i mean. yes? because one is responsible for their own decisions even when made in accordance with the market
06:52:52disrupteki mean, if my network would stay connected.
06:53:04FromDiscord<Esbeesy> No doubt, but the problem comes down to what this does to enterprise businesses. Have you worked in a large ".NET houses?"
06:53:09FromDiscord<Esbeesy> (edit) "houses?"" => "house"?"
06:53:24FromDiscord<nikki> that sounds like the kinda party we all wanna be at in the 90s
06:53:29FromDiscord<Esbeesy> disRIPtek
06:53:47FromDiscord<Cypheriel> C# D:
06:53:47FromDiscord<Esbeesy> Panic is over anyway disrup, Nim is as fast if not slightly faster 😂
06:53:58FromDiscord<Cypheriel> C# is why I can't have ShareX on Linux >:(
06:54:06FromDiscord<Esbeesy> Ah fuck ShareX is so good innit
06:54:24FromDiscord<Cypheriel> I love it.. when I can use it :c
06:54:50FromDiscord<Rebel> Have you played around with V?
06:54:53FromDiscord<Esbeesy> yes!
06:55:00FromDiscord<Rebel> 👀
06:55:00FromDiscord<Esbeesy> I've actually contributed to the CSV library lmao
06:55:09FromDiscord<Esbeesy> Because doing those benchmarks I discovered a bug
06:55:22FromDiscord<Rebel> Dam that's cool
06:55:24disruptekplease zip it up. i can't even download it.
06:55:32FromDiscord<Esbeesy> lmao, one sec
06:55:48FromDiscord<Rebel> His bandwidth is too constrained by other vices
06:57:17FromDiscord<Esbeesy> 7z okay disrup?
06:57:21disruptekyeah.
06:57:45FromDiscord<Esbeesy> ls
06:57:47FromDiscord<Esbeesy> fuck
06:58:04disruptekitym `fsck`
06:58:19disruptekoh it's going now, baby.
06:58:36disrupteki just sent all my tcp acks ahead of time.
06:58:39disruptekthis is way faster.
06:58:51FromDiscord<Esbeesy> https://easyupload.io/zjsdks
06:59:15disruptekthanks.
06:59:44disruptekthere had better be porn in here.
06:59:46FromDiscord<Esbeesy> 17% of the size haha
06:59:59disrupteka least a naked pic of your feet or something.
07:00:02FromDiscord<Esbeesy> Unless you get off to comma delimited market reports, there is not
07:00:09FromDiscord<Rebel> Well at least now MSFT has a unified vision for the purpose and goal of .NET :)
07:00:32FromDiscord<Rebel> My final thought on that lol
07:00:45FromDiscord<Esbeesy> All I'll say is, you've not experienced hell until you spend your 8 working hours wiping the arse of .NET man babies
07:01:09disruptekwhat kinda cpu do you have?
07:01:19FromDiscord<Esbeesy> uh... i7-8700 iirc
07:01:26disruptekhmm.
07:01:49disruptekLinux olive.disruptek.com 5.9.11-gentoo-2012010117-auto #1 SMP Tue Dec 1 01:17:37 EST 2020 x86_64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz GenuineIntel GNU/Linux
07:01:57FromDiscord<Esbeesy> lmao I really need to up that RAM a bit https://media.discordapp.net/attachments/371759389889003532/786487851130814534/unknown.png
07:02:07disruptek┌────────┬──────────┬──────────┬──────────┬──────────┐
07:02:09disruptek│ Runs │ Min │ Max │ Mean │ StdDev │
07:02:12disruptek├────────┼──────────┼──────────┼──────────┼──────────┤
07:02:15disruptek│ 89 │ 0.604797 │ 1.170178 │ 0.645162 │ 0.072612 │
07:02:18disruptek└────────┴──────────┴──────────┴──────────┴──────────┘
07:02:25FromDiscord<Esbeesy> Is that Nim? Nice
07:02:44FromDiscord<Cypheriel> jeez that looks so bad without monospace
07:02:54FromDiscord<Esbeesy> Innit 😂 Bet it looks boss in IRC though
07:03:10FromDiscord<Esbeesy> sent a code paste, see https://play.nim-lang.org/#ix=2Ho8
07:03:15FromDiscord<Cypheriel> I was literally just doing that lol
07:03:24disruptekwell, i discover the header position and then parse parser.row[i] directly.
07:03:42FromDiscord<Esbeesy> Wait let me show you the other 3 solutions
07:04:31FromDiscord<Esbeesy> 2 solutions, think I deleted one
07:04:32FromDiscord<Esbeesy> http://ix.io/2Hob
07:04:45disruptekgc:none is slower than arc.
07:05:06FromDiscord<Esbeesy> I found Orc to be near none, and Arc to be slower, maybe a windows thing?
07:05:24disrupteki'd be surprised.
07:05:37disruptekwho knows how optimal the parser is, though.
07:05:48FromDiscord<Rebel> why did you choose Nim over V?
07:05:51disrupteki thought you might be doing something interesting, but... there's not much room to work.
07:06:09disruptekv brings nothing to the table.
07:06:30FromDiscord<Esbeesy> Yeah that's kind of the point, to really keep it bare bones, core library
07:06:53FromDiscord<Cypheriel> What's `V`, again?
07:06:56FromDiscord<Esbeesy> Next one on the list after Nim is .NET Core 3.1 at 4 seconds, not even worth mentioning at that point lmao
07:07:02FromDiscord<Esbeesy> https://vlang.io/
07:07:14FromDiscord<Esbeesy> V is like.. "Go done right"
07:07:27disrupteki mean, there's nothing to optimize. if you let me hack the library, maybe we can make it faster. pooling would help, for example.
07:07:30FromDiscord<Esbeesy> Well, that's what they claim anyway haha
07:07:32FromDiscord<Cypheriel> Ohh, how interesting
07:07:45FromDiscord<Esbeesy> It's actually pretty cool
07:07:55disruptekzig is interesting. v is a joke. a bad joke.
07:08:28FromDiscord<Esbeesy> V definitely had the icarus problem, creator came out the gate on day dot like "It's gonna be the best language for EVERYTHING"
07:08:41FromDiscord<Esbeesy> Like, obtaining world peace levels of grandiosity
07:10:16FromDiscord<Esbeesy> Also I stopped using V after I updated and he'd refactored the language to use var instead of mut
07:10:18FromDiscord<Esbeesy> or the other way around
07:10:30FromDiscord<Esbeesy> either way it fucked up all my code and I was like "Cba" with this!
07:10:55FromDiscord<Esbeesy> @Rebel I'm only using Nim now for AoC, but it's quickly becoming my favourite language 😂
07:11:23FromDiscord<Cypheriel> So many programming languages have names so unoriginal that you literally have to append `lang` to everything
07:11:55FromDiscord<Rebel> hehe ever heard of Red? They have funny stuff in the wiki about avs flagging Red code.
07:12:10FromDiscord<Rebel> Guess V is not the next language I will be using for a project 😦
07:12:14FromDiscord<Rebel> was between V, Zig, and Red
07:12:49FromDiscord<Cypheriel> Lord. why would you name a programming language "Red" or "V" or flippin "Julia"
07:13:10FromDiscord<Cypheriel> Surely they have meaning behind them
07:13:41FromDiscord<ElegantBeef> `nim-lang`
07:13:51disruptekso lame
07:13:54FromDiscord<ElegantBeef> V is for vaporware
07:14:14FromDiscord<Cypheriel> I can see hat a bit
07:14:28FromDiscord<Cypheriel> but still. Jeez, lol
07:15:04FromDiscord<ElegantBeef> Cmon rebel use nim for your next project 😛
07:17:46FromDiscord<Rebel> But I can't
07:17:51FromDiscord<Rebel> it needs to be a different language
07:17:57FromDiscord<Esbeesy> ?
07:18:03*lbart joined #nim
07:18:03*lbart quit (Changing host)
07:18:03*lbart joined #nim
07:18:03FromDiscord<Rebel> I am tempted to port a massive codebase to Nim
07:18:03FromDiscord<Esbeesy> Anything but nim?
07:18:07FromDiscord<Rebel> No
07:18:24FromDiscord<Rebel> Anything but C, C++, x86, x64, C#, Go, Rust, Python, Nim
07:18:26FromDiscord<Esbeesy> Was gonna say that's an odd requirement haha
07:18:38FromDiscord<Esbeesy> Have you tried D?
07:18:51FromDiscord<Esbeesy> Not /the/ D, which is something TOTALLY different
07:19:12FromDiscord<Rebel> No so maybe but maybe will use beef
07:20:15FromDiscord<Esbeesy> What is the project you're working on?
07:20:19FromDiscord<Rebel> omg what another ridiculous name for a language
07:20:23disruptekwasting my time.
07:20:27FromDiscord<Rebel> hehe
07:20:35FromDiscord<Rebel> threading is for nerds
07:20:36FromDiscord<Rebel> and not fun
07:20:55FromDiscord<Cypheriel> Scratch :^
07:21:03disruptekrebel fancies himself a whitehat.
07:21:28FromDiscord<Rebel> The project isn't really a project it's an adventure where I'll be exploring different languages and seeing what they bring to the table for implant & offensive tool development
07:21:52disruptekyeah, beef would be /perfect/ for that.
07:22:22FromDiscord<Rebel> holy shit
07:22:26FromDiscord<Rebel> you're not wrong
07:22:27FromDiscord<Rebel> like legit
07:22:30FromDiscord<Rebel> I'm reading docs now
07:22:32FromDiscord<Rebel> ah yeah
07:22:35FromDiscord<Rebel> I found it
07:22:47FromDiscord<Rebel> Chief called he said this is it
07:23:04FromDiscord<Cypheriel> Is beef supposed to be the name for another language
07:23:17FromDiscord<Cypheriel> Are you kidding me...
07:23:21disruptekbeef lang.
07:23:24FromDiscord<Rebel> hell to o
07:23:25FromDiscord<Rebel> (edit) "o" => "no"
07:23:26FromDiscord<Rebel> https://www.beeflang.org/
07:23:35FromDiscord<Cypheriel> ...
07:23:37FromDiscord<Rebel> (edit) "hell to ... noain't" added "the" | "theno ... " added "ain't joking"
07:23:44FromDiscord<Rebel> dude read how LLVM is compiled
07:23:46FromDiscord<Rebel> that's fucking hot
07:23:57FromDiscord<Rebel> (edit) "LLVM" => "beef"
07:24:00FromDiscord<Rebel> using LLVM as a backend 🤤
07:24:12disruptekwhat a novel concept.
07:24:14FromDiscord<Rebel> ripe for LLVM obfuscation 😈
07:24:53FromDiscord<Cypheriel> Man, I bet you can find any programming language just by adding `-lang` to any word
07:24:58*mbomba joined #nim
07:25:14disruptek!repo disruptek/dim
07:25:16disbothttps://github.com/disruptek/dim -- 9dim: 11an experimental language 15 2⭐ 0🍴
07:25:33FromDiscord<Esbeesy> >Dim↵>No content↵↵checks out
07:26:08FromDiscord<Cypheriel> 2 stars, too
07:26:16FromDiscord<Esbeesy> 3 now
07:26:27FromDiscord<Cypheriel> Make that 4
07:27:03FromDiscord<Rebel> Hold up should I use dim for my adventure? Hmmm
07:27:14disruptekit's perfect for you.
07:27:25FromDiscord<Rebel> Y
07:27:27FromDiscord<Cypheriel> ah yes. code with a README.md
07:27:44FromDiscord<Cypheriel> oh, and a license
07:27:44disruptekeasy syntax, fully concurrent without nerdy threads.
07:28:25FromDiscord<Rebel> Why cant you fork Nim and do a PR with that juice????
07:28:34FromDiscord<Rebel> Are you smoking crack?
07:28:42disrupteki had to make a new language because the syntax changed.
07:29:02disruptekit's so much faster than nim that i didn't want to associate with such a sluggish lang.
07:29:19FromDiscord<Esbeesy> Haha forking a language always reminds of Elm - You get excommunicado'd from the community if you do it
07:29:56FromDiscord<Rebel> Is Elm better than Red and V if so I will add that to the list
07:29:58FromDiscord<Rebel> No gas
07:30:20FromDiscord<Esbeesy> Nah I wouldn't bother
07:30:42FromDiscord<Esbeesy> cool language but it's stunted by poor leadership
07:31:51disruptekyou're talking about nim?
07:32:06FromDiscord<Esbeesy> Lmao I know literally nothing about Nims leadership
07:32:18FromDiscord<Esbeesy> It's not benevolent dictator model though is it?
07:32:28disruptekwhat else?
07:32:31disruptek~araq
07:32:31disbotAraq: 11👑Andreas "What Else?" Rumpf👑 -- disruptek
07:32:53FromDiscord<ElegantBeef> For a small language like this it's not like it can be committee led
07:33:12FromDiscord<Esbeesy> I should clarify - Araq takes other peoples input on board, right?
07:33:24FromDiscord<Rebel> Wait wut 10k stars is a small language?
07:33:35FromDiscord<Idefau> its an absolutist monarchy
07:33:59FromDiscord<j-james> Stars probably aren't the best metric
07:34:09FromDiscord<j-james> No way Go is only eight times more popular
07:34:35FromDiscord<Esbeesy> !repo disruptek/dim has 4 stars and it's the best language this side of 2020
07:34:36disbotno results 😢
07:34:40disruptekpeople star nim because they're sure they'll misplace it otherwise.
07:34:46FromDiscord<Esbeesy> Shit
07:34:50FromDiscord<Esbeesy> !repo disruptek/dim
07:34:51disbothttps://github.com/disruptek/dim -- 9dim: 11an experimental language 15 5⭐ 0🍴
07:35:36FromDiscord<Rebel> Hot
07:35:47FromDiscord<Rebel> Now I want dim sum
07:35:50*mbomba quit (Quit: WeeChat 3.0)
07:36:37FromDiscord<ElegantBeef> There are probably more useful metrics to figuring out the size of the user base, like checking github/lab and seeing the amount of unique users with nim in a repo
07:37:07FromDiscord<Esbeesy> Also checking out job market stats
07:37:31disrupteki can provide those on demand.
07:37:31FromDiscord<Esbeesy> ItJobsWatch doesn't even have a metric for nim 😦
07:37:45FromDiscord<Rebel> A better metric == see how many projects are in Go and how many in Nim in Github + Gitlab?
07:47:54FromDiscord<Esbeesy> Day 10 mannnn, this description
07:48:04FromDiscord<Esbeesy> Honestly sometimes I read these AoC tasks and I feel like I'm having a stroke
07:48:08FromDiscord<ElegantBeef> pt 2 is the real issue
07:48:11FromDiscord<ElegantBeef> pt1 is easy as hell
07:48:19FromDiscord<ElegantBeef> pt2 is a pain in the ass 😄
07:51:18FromDiscord<Cypheriel> I haven't even done day 8 yet, I got too confused
08:00:56FromDiscord<Esbeesy> wtf is part 2
08:02:27FromDiscord<ElegantBeef> Something i havent done
08:02:48disruptekahh, like combing your hair?
08:04:20FromDiscord<ElegantBeef> Yea
08:09:44FromDiscord<hugogranstrom> I'm brute-forcing my part2 and it has been running for several minutes now. Feels like there's a smarter way to do it xD
08:10:31disruptekif there was, the lord wouldn't have provided all those sweet, sweet, cycles.
08:10:49FromDiscord<hugogranstrom> haha true true
08:13:02*mbomba joined #nim
08:13:28FromDiscord<Esbeesy> Hmm I'm calculating too many
08:14:38FromDiscord<hugogranstrom> Your're getting a result at least 😉
08:14:47*mbomba quit (Client Quit)
08:17:24FromDiscord<Esbeesy> Far too early for mathboi antics
08:20:38FromDiscord<hugogranstrom> agreed
08:22:19FromDiscord<Rebel> If you want to make it check out threads pepelaugh
08:22:31FromDiscord<Rebel> Make it faster
08:23:01FromDiscord<Cypheriel> Well, I got done with day 8
08:23:09FromDiscord<Cypheriel> Do I even want to try day 9
08:24:50FromDiscord<ElegantBeef> 9 is easy
08:25:06FromDiscord<ElegantBeef> Although i also found 8 easy
08:25:07FromDiscord<ElegantBeef> so.... 😄
08:26:32FromDiscord<Cypheriel> D:
08:26:51FromDiscord<Cypheriel> I had to do some really... unclean things to get day 8 to work
08:27:18FromDiscord<ElegantBeef> Let's see your code 😄
08:27:41FromDiscord<Cypheriel> It's Python, though
08:27:45FromDiscord<ElegantBeef> oh
08:27:48FromDiscord<ElegantBeef> Get out of this server
08:27:52FromDiscord<ElegantBeef> 😛
08:27:53FromDiscord<Cypheriel> :c
08:28:29FromDiscord<Cypheriel> I swear I'll switch to Nim soon-ish, but I'm too new to do these solutions in Nim
08:30:02miprigetting comfortable with a language is the best use of Advent of Code. I've done it repeatedly with languages I only had a few weeks of light use of. Fumbling with the language goes well with the light time pressure.
08:30:55FromDiscord<Cypheriel> I suppose, yeah. perhaps I'll try day 9 in Nim
08:31:05FromDiscord<Cypheriel> although, that might be too big of a jump
08:31:41FromDiscord<Esbeesy> Ah fuck I'll have to think about it later, have to do shitting paid C# work like the corporate monkey that I am
08:32:09mipriyeah, day 10 is an inappropriate Project Euler problem. You either get it or you have no chance whatsoever of solving it.
08:35:33FromDiscord<Vindaar> wow, the AoC description today is confusing
08:35:48FromDiscord<Esbeesy> Innit!?
08:35:49FromDiscord<ElegantBeef> Yea it makes it seem more confusing than it actually it
08:35:58FromDiscord<ElegantBeef> pt1 is super simply solved though
08:40:01FromDiscord<Vindaar> ok, I got it now, especially the usage of the word "distribution" threw me off completely
08:49:49*Tanger quit (Remote host closed the connection)
08:52:48disruptekthat's what i told the cops about the word "miner."
08:53:25disruptekturns out it means something completely different.
08:55:18FromDiscord<j-james> part two today is terrible
08:55:23FromDiscord<Esbeesy> Ah I think it's just come to me, I was multiplying every combo by every subsequent combo, you actually just need to keep a cumulative tally of all the possibilities
08:55:52FromDiscord<kenran> I have a `Thread` that runs indefinitely and uses a blocking POSIX repeatedly. Now if my main thread is done, I want to stop the background thread. How do I do that "gracefully"? Is there any way if it's just blocking?
08:56:10FromDiscord<kenran> (edit) "I have a `Thread` that runs indefinitely and uses a blocking POSIX ... repeatedly." added "call"
08:56:30miprihave it block on a selector that includes a pipe that your main program writes to
08:56:41FromDiscord<Cypheriel> Isn't that what daemonized threads are for?
08:56:52disruptekmipri nailed it.
08:58:31FromDiscord<kenran> mipri I don't quite understand it yet. Should I open another pipe then instead of `select()`ing on only one FD I should include that one in the fdset; then write to that pipe from my main thread when it's done so the thread will know when to finish?
08:58:45disruptekyes.
08:59:02disruptekare you on windows with all these pipes?
08:59:19FromDiscord<kenran> Linux right now
08:59:41disruptekdon't we have a semaphore you can use?
08:59:55disruptekor am i thinking of my stuff...
09:00:04*guelosk[m] quit (Quit: Idle for 30+ days)
09:00:32disruptekanyway, it doesn't matter what it is.
09:00:38FromDiscord<kenran> There's only a PTY right now that I'm checking if it's readable. There's multiple things making it hard for me: next to no knowledge of Nim yet, no idea about POSIX and pipes yet 😄
09:00:50FromDiscord<kenran> but I'll get there, very sloooowly
09:01:13disruptekc'mon, i know you from way back.
09:01:40FromDiscord<kenran> this was when I last used Nim, and even then only a little bit
09:01:49disruptekhmmph.
09:02:00*Vladar joined #nim
09:02:01disruptekserves you right, then.
09:02:16FromDiscord<kenran> with all this stuff going on and a 2nd kid I had no time whatsoever to program anything... now it's "itching" me very much
09:02:57FromDiscord<kenran> plus, there was the time when nim binaries were not working as well on NixOS. thankfully some patched the compiler there I think
09:03:01FromDiscord<kenran> someone
09:03:34FromDiscord<kenran> are you still streaming disruptek? haven't seen your stream lately, but I'm not online much
09:03:59FromDiscord<Esbeesy> Fucking done it, get in
09:04:04disruptekif you hold a pillow over its face, it'll stop itching.
09:04:07FromDiscord<Esbeesy> That was way too much mathboi shite
09:04:49disrupteki haven't been streaming because i'm homeless, jobless, health-insurance-less, and penniless.
09:04:55disrupteknot to mention merciless.
09:05:02disruptekGET DOWN BITCHES
09:05:27disrupteksorry, that came out wrong.
09:05:53FromDiscord<Cypheriel> this is America
09:05:56disrupteki meant mirthless.
09:06:51FromDiscord<j-james> so uh out of curiosity
09:07:07FromDiscord<ElegantBeef> no
09:07:34FromDiscord<j-james> about how long would it take for a procedure to look at a position in an array, then call itself again
09:07:38FromDiscord<j-james> over a trillion times
09:08:25disrupteki think you're the first person ever to ask such a question.
09:08:33FromDiscord<Cypheriel> I don't think it'd take long to run into the recursion limit
09:08:54FromDiscord<ElegantBeef> Well if you got a few years you might get it
09:09:05FromDiscord<ElegantBeef> Someone's attempting to solve the aoc 10 p2 recursively 😛
09:09:07FromDiscord<j-james> surprisingly i haven't hit it yet
09:09:13disruptekthe recursion limit is only 2000.
09:09:20disruptekyou'd hit it instantly.
09:09:21FromDiscord<ElegantBeef> in debug build
09:09:30FromDiscord<j-james> i know, it's strange
09:09:31FromDiscord<Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day10/day10.nim↵↵Check it out
09:09:37disruptekit's limited to a 16bit integer.
09:09:44disruptekit doesn't matter what it is in danger.
09:09:50FromDiscord<Esbeesy> Disruptek-triggering driven development
09:10:05FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=2Hoz
09:10:06FromDiscord<ElegantBeef> esbeesy using unicode characters to be cool
09:10:10FromDiscord<j-james> This is the relevant code ^
09:10:32*livcd quit (Ping timeout: 256 seconds)
09:10:46disruptekwhat you need is cps.
09:10:52FromDiscord<Cypheriel> Recursion always continues to break my mind
09:10:57*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:11:03FromDiscord<ElegantBeef> Is that part 1 or part 2 james?
09:11:21FromDiscord<j-james> that's part 2
09:11:49FromDiscord<j-james> it's taken me about a hundred time longer than part 1 so far
09:11:55FromDiscord<j-james> (edit) "time" => "times"
09:12:25FromDiscord<Esbeesy> Did an s/jolt/⚡ before commit to see if it worked, and it did! much to my pleasure
09:14:19disruptekhttps://auctionhero.io/
09:14:29disrupteksplish splash, i was takin' a bath
09:14:52FromDiscord<Cypheriel> I'm so confused. How've I spent the last 14 minutes trying to make seqs
09:15:05FromDiscord<Cypheriel> haha wait seqs funny word
09:15:08disruptekthe best seqs takes time.
09:15:15FromDiscord<hugogranstrom> I gave up the recursion (which still is running :P) and solved it in a "smart" way instead. Boring but efficient
09:15:18FromDiscord<ElegantBeef> `var a: seq[T]` is about 14 minutes of work
09:15:27FromDiscord<Cypheriel> uh
09:15:34FromDiscord<Cypheriel> oh. I'm so dumb
09:15:52FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoA
09:15:56FromDiscord<Cypheriel> This is what I was doing
09:15:58Araq14 minutes?
09:16:01FromDiscord<ElegantBeef> I didnt say it
09:16:14FromDiscord<ElegantBeef> Araq you seen my PR's you know i'm not the quickest
09:16:23FromDiscord<Cypheriel> wait. I'm confused even then
09:16:33FromDiscord<Cypheriel> What is T
09:16:41FromDiscord<ElegantBeef> Your type you want the seq
09:16:46disrupteka poor substitute for coffee.
09:16:59FromDiscord<Esbeesy> T is whatever you want to be
09:17:08FromDiscord<Esbeesy> https://www.youtube.com/watch?v=SVi3-PrQ0pY
09:17:11FromDiscord<Cypheriel> ohh. I see
09:17:13FromDiscord<ElegantBeef> T who you wanna T barbie girl
09:17:28FromDiscord<Esbeesy> (edit) "T is whatever you want ... to" added "it"
09:17:36FromDiscord<Cypheriel> See, this is why I was using Python
09:17:46FromDiscord<ElegantBeef> Cause static type systems are confusing? 😛
09:18:36FromDiscord<Cypheriel> yes
09:18:47FromDiscord<Cypheriel> I was doing all kinds of weird things, honestly
09:19:02disruptekdo you have video?
09:19:03FromDiscord<Cypheriel> newSeq(), newSeq()[int], newSeq[int]()
09:19:18disruptekthat's too much seqs for so early in the morning.
09:20:52FromDiscord<Cypheriel> I am... so confused
09:21:45FromDiscord<Cypheriel> Wait... I did it!
09:21:50FromDiscord<Cypheriel> Only took 21 minutes
09:22:08FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoC
09:22:44FromDiscord<Esbeesy> Whats the difference between a seq and a slice in Nim?
09:26:14FromDiscord<ElegantBeef> https://nim-lang.org/docs/system.html#HSlice
09:26:27disruptekshort for `HomeSlice`.
09:27:40disruptekthere's a guy passed out in the bathroom with no pants. should i work on ic or try to take advantage?
09:28:04FromDiscord<Cypheriel> What kind of advantage?
09:28:14AraqHeterogenousSlice iirc
09:28:25Araqhttps://github.com/nim-lang/RFCs/issues/287 yes/no?
09:28:26disbotDeprecate TaintedString
09:28:31FromDiscord<ElegantBeef> Yea it's in the description of Hslice
09:28:46mipri!eval echo (@[1,2].type, [1,2][0..1].type)
09:28:48NimBot(seq[int], seq[int])
09:28:48AraqJuan demands a decision
09:29:36mipri[] returns a seq. it's the same thing as a seq. If you're looking for some kind of non-owning view into a seq, experimental viewtypes are coming with that
09:30:01FromDiscord<ElegantBeef> Well we already have `toOpenArray` which lets you do that afaik
09:30:40FromDiscord<ElegantBeef> I could be wrong about that though
09:30:50miprino, that's what I'm talking about
09:31:09FromDiscord<ElegantBeef> Ah it's not apart of experimental though
09:31:38mipriit gets experimental real fast, like if you want to store that in a variable
09:32:43*opal quit (Ping timeout: 240 seconds)
09:33:07FromDiscord<ElegantBeef> Speaking of this i still want an opinion those slice lent iterators like this https://play.nim-lang.org/#ix=2Hh8
09:34:03FromDiscord<ElegantBeef> Slicing a seq duplicates it so the only solution is to use `toOpenArray` which i find is very obscure for what's wanted 😄
09:34:28FromDiscord<Cypheriel> Wait a minute... how am I meant to make a set of ints if ints are too big for sets but intsets don't let you use bigger ints?
09:34:31*opal joined #nim
09:34:47disruptekAraq: i don't recognize any of the people who thumbed that rfc.
09:34:47mipriHashSet[int], from the sets module
09:35:13disruptekintsets doesn't let you use bigger ints?
09:35:24Araqdisruptek, very good point
09:36:17mipriintset isn't generic, is I guess the problem.
09:36:31mipribut
09:36:44mipri!eval echo (int.sizeof, int32.sizeof, int64.sizeof)
09:36:46NimBot(8, 4, 8)
09:36:48disruptekpackedsets works for any ordinal.
09:37:14disruptekpretty sure all ints are ordinals.
09:37:16mipriit's already 'bigger ints'. if you want bignums you can use HashSets with them, after defining a hash func
09:37:28disruptekand a bignum, of course.
09:39:10*mika_ joined #nim
09:40:36*Cthalupa quit (Ping timeout: 240 seconds)
09:40:57FromDiscord<mratsim> bignum in a HashSet? 😄
09:41:24FromDiscord<Cypheriel> Ah, okay. I thought my issue was that my numbers from AoC were too big to be parsed, but it turns out I was accidentally parsing `''` because of a newline at the end of my file
09:41:50*Cthalupa joined #nim
09:41:53miprireadFile("...").strip.splitLines is useful for a lot of these.
09:42:19*waleee-cl joined #nim
09:42:21disrupteki prefer to split my lines by hand.
09:42:35FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoO
09:42:36disruptekhand-split artisinal lines.
09:42:36FromDiscord<Cypheriel> I ended up doing this
09:43:05disruptekyou really don't want a do a line you haven't split yourself.
09:43:19FromDiscord<ElegantBeef> Well `split` will split at all whitespace chars, which depending on which challenge is perfectly valid 😄
09:43:54FromDiscord<Cypheriel> I mean... `parseInt('')` doesn't work out too well
09:44:08FromDiscord<ElegantBeef> it'd have been removed by `split` 😄
09:44:10FromDiscord<j-james> that's where strip comes in handy
09:44:32FromDiscord<Cypheriel> wait
09:44:35Araqdisruptek, please cut the noise a little. you definitely can have too many jokes
09:44:53FromDiscord<Cypheriel> I don't think that's right
09:45:03disrupteksorry, i'm punchy. it's nearly 5a and ic is broken again.
09:45:10FromDiscord<Cypheriel> because I just tried it by removing the `strip()` and I get the
09:45:15*spiderstew quit (Quit: Konversation terminated!)
09:45:27FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2HoP
09:45:28FromDiscord<Cypheriel> sent a code paste, see https://paste.rs/Gk5
09:45:37FromDiscord<j-james> beef flip-flopped `strip` and `split`
09:46:02FromDiscord<ElegantBeef> I really didnt https://nim-lang.org/docs/strutils.html#split.i,string,set[char],int
09:46:05FromDiscord<mratsim> @PizzaFox yes, I do suggest using stew/endians2 though
09:46:10*spiderstew joined #nim
09:46:12FromDiscord<ElegantBeef> `split`'s default set to split at is whitespace
09:46:13FromDiscord<PizzaFox> thanks. also, why
09:46:20FromDiscord<mratsim> better API
09:46:32FromDiscord<ElegantBeef> Which is defined as https://nim-lang.org/docs/strutils.html#Whitespace
09:46:41FromDiscord<mratsim> changing endianness should return a bytearray not an integer
09:46:57FromDiscord<mratsim> because you can't use it as an integer anymore technically
09:47:13FromDiscord<j-james> right, but files usually end with newlines
09:47:29FromDiscord<j-james> so you'll end up with a garbage `''`
09:47:35FromDiscord<ElegantBeef> How?
09:48:04mipriassert "a\nb\n".split == @["a", "b", ""]
09:48:06FromDiscord<Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoQ
09:48:31FromDiscord<Cypheriel> It's actually when you split `\n\n` pretty sure
09:48:41*Tanger joined #nim
09:48:42FromDiscord<Cypheriel> which would be a blank line as the last line in your file
09:48:46*Tlangir joined #nim
09:48:55FromDiscord<ElegantBeef> well when you split by `\n\n` you arent splitting at all whitespace chars
09:49:26FromDiscord<ElegantBeef> mirpri has proven me wrong
09:49:30FromDiscord<ElegantBeef> So i'll shush and clap my hands
09:49:43*mika_ quit (Ping timeout: 246 seconds)
09:51:27FromDiscord<Cypheriel> Oh, splitting in Nim is somehow different from Python
09:52:46FromDiscord<ElegantBeef> So Araq should i just put `whenscanf` off, or is there an implementation possible today that makes you happy? 😄
09:53:19*mika_ joined #nim
09:53:20*Tlanger joined #nim
09:54:04mipriPython has a magic nullary .split() so it's quite weird
09:54:28mipri"a\nb\n".split() != "a\nb\n".split("\n") # Python
09:55:14FromDiscord<Cypheriel> That is fairly weird
09:55:14Araq<ElegantBeef> make it return a tuple?
09:55:30Araqseems the best option
09:55:40*Tlangir quit (Ping timeout: 246 seconds)
09:55:52Araqand name it 'scant' (t for tuple) or better
09:55:58*Tanger quit (Ping timeout: 265 seconds)
09:56:07Araqor maybe scanTuple
09:56:21*Tanger joined #nim
09:56:22*Torro joined #nim
09:56:41voltistIn my most ambitious porting project ever, I have ported the human Basal ganglia to Nim :) As described here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6143798/
09:57:25Araqwait what?
09:57:32*PMunch joined #nim
09:58:17FromDiscord<ElegantBeef> Will do, though the tuple has an issue with user defined matchers, since the type cannot be solved from the string alone afaik
09:58:58Araqvoltist, is the code public? sounds awesome
09:59:11AraqElegantBeef: hmm
09:59:54voltistThat paper is about taking the anatomy of the Basal ganglia and simulating it's function, and I'm just trying to implement it in Nim
10:00:11voltistI'll put my code up as soon as I have something vaguely resembling their results
10:00:27voltistShouldn't be too long now
10:00:42Araqdon't worry if you cannot replicate it, most things are unreproducible :P
10:00:48disruptekgood, i need some more brainpower.
10:01:10Araqonly trust the stats that you faked yourself or whatever it's in English
10:01:50voltistThis is algorithms and equations, so it *should* be exactly reproducible
10:02:01FromDiscord<ElegantBeef> Now that i think about it, i can pretty much just copy scanf and just change the output code, instead of relying on it as i am currently
10:02:21voltistAlthough I'll have to devise my own training/testing because they don't describe theirs very well
10:02:41FromDiscord<mratsim> @voltist, believe me, ML results are a pain to reproduce
10:02:56FromDiscord<mratsim> Especially if they don't describe how they initialize the neurons
10:03:15FromDiscord<mratsim> like I had wildly different results when using a gaussian with stddev 0.1 vs 0.01
10:03:25FromDiscord<mratsim> and obviously the paper doesn't tell me what they used
10:04:24disruptekjust cut open a baby see what they are set to from the factory.
10:04:31FromDiscord<ElegantBeef> Grab your favourite dart and dartboard and just start going 😄
10:04:33disrupteki'm surprised random values wouldn't be fine.
10:04:55Araqmratsim: what channel/queue to use?
10:05:09Araqlooking for a simple, fast one for fusion
10:05:11voltistHopefully this will be different because, as far as I'm aware, the initialization of a spiking neuron has no impact on it just a few time-steps down because the equations balance out like the real chemicals would
10:05:30voltistGee that was a big sentence
10:06:16voltistAnd SNN's are meant to be more resilient to variation and noise, but yeah it still might all go wrong
10:06:21FromDiscord<mratsim> Like: this was the change - https://github.com/mratsim/Arraymancer/commit/5705d4e21dff87731f56b921b646f2be7ad38b92#diff-970644ce40446d13ad64339bbed0a185e0bf479e4b657c6d6829414cad538e37L29↵And afterwards I could have a simple Shakespeare RNN: https://github.com/mratsim/Arraymancer/commit/4cf0ea9d419b011fa923d71d10c64ceb001b24b0
10:06:43FromDiscord<mratsim> @Araq: something multithreaded?
10:06:58Araqyeah, it's time for Isolated[T]
10:07:13FromDiscord<mratsim> I don't have anything that supports non-copymem object though it might work with arc
10:07:22voltistOh nice I didn't know that deep learning was done much in Nim
10:07:40Araqmratsim: I can adapt the code if it's simple enough
10:08:07FromDiscord<mratsim> I assume you need multi-producer multi consumer?
10:08:47Araqhmm good question
10:09:20Araqcan't hurt I guess
10:09:28FromDiscord<mratsim> This one should be a good start: https://github.com/mratsim/weave/blob/5696d94e6358711e840f8c0b7c684fcc5cbd4472/unused/channels/channels_legacy.nim
10:10:08FromDiscord<mratsim> It has a cache system which brought it like within 80% of pure atomics based channel.
10:10:34FromDiscord<mratsim> It uses 2 locks, one for producers one for consumers to reduce lock contention (see Michael & Scott paper)
10:10:55*Tlanger quit (Quit: Leaving)
10:12:05FromDiscord<mratsim> https://www.cs.rochester.edu/u/scott/papers/1996_PODC_queues.pdf
10:14:01FromDiscord<mratsim> also it's linearizable (but that's a costly property usually).
10:14:23Araqwhat does 'linearizable' mean in this context?
10:17:04*abm joined #nim
10:17:43FromDiscord<mratsim> this is probably the clearest and shortest explanation on serializability vs linearizability: https://cs.stackexchange.com/a/41741
10:19:05FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2Hp7
10:19:28FromDiscord<PizzaFox> (edit) "https://play.nim-lang.org/#ix=2Hp7" => "https://play.nim-lang.org/#ix=2Hp8"
10:19:35FromDiscord<mratsim> outp[0..<8] = inp
10:19:45FromDiscord<PizzaFox> (edit) "https://play.nim-lang.org/#ix=2Hp8" => "https://play.nim-lang.org/#ix=2Hp9"
10:19:48FromDiscord<PizzaFox> thanks
10:20:24FromDiscord<mratsim> to be honest, I always have to reread those guarantees, they made my head hurt every single time
10:21:27FromDiscord<mratsim> the important thing about both is that if a process A sends A1 then A2 and then requests from the objects will always send A1 before A2
10:21:52FromDiscord<mratsim> if there are no guarantees you might get A2 before A1
10:23:25FromDiscord<mratsim> those are the kind of reasons why I think concurrent data structures should be under a dedicated umbrella (like the often asked about shared hashtable)
10:23:43FromDiscord<mratsim> because solving documenting and building that stuff is complex
10:24:52*hmmmmm joined #nim
10:25:15hmmmmmg'day
10:25:36FromDiscord<mratsim> The snmalloc paper (another allocator from microsoft) uses and describe the Pony-lang queue, and shows how a non-linearizable queue work: https://media.discordapp.net/attachments/371759389889003532/786539102220451870/unknown.png
10:25:56FromDiscord<mratsim> https://media.discordapp.net/attachments/371759389889003532/786539185464016896/unknown.png
10:26:02FromDiscord<mratsim> https://github.com/microsoft/snmalloc/blob/7faefbbb0ed69554d0e19bfe901ec5b28e046a82/snmalloc.pdf
10:26:45FromDiscord<mratsim> in that case, a dequeue can return empty even though there is an item in the queue
10:28:56*mbomba joined #nim
10:32:58*mika_ quit (Ping timeout: 260 seconds)
10:33:37Araqit's why I had high hopes on "hardware lock elision"
10:34:04Araqthis stuff is hard and the hardware folks are very good at it
10:34:53FromDiscord<mratsim> It was buggy for a long while, on Haswell, Boradwell and Skylake, was only fixed in Skylake-X iirc
10:35:19FromDiscord<mratsim> This is also where formal verification helps and a borrow checker stops being useful.
10:35:21Araqyes but the idea behind it is a good one, IMO
10:35:30FromDiscord<mratsim> ah sure.
10:35:52FromDiscord<mratsim> Haskell did implement Software Transactional Memory for their multithreading and GC, it is very impressive.
10:36:26Araqthe M1 apparently improved atomic refcounting
10:36:38Araq(they had to because of Swift I guess)
10:37:25FromDiscord<mratsim> Swift devs still have to handle cycles on their own
10:37:54Araqsure, but my point is, if the uncontested atomic RC case would be close to the non-atomic RC
10:38:02FromDiscord<mratsim> btw is there a reason we use -std=gnu++14 instead of -std=c++14?
10:38:28*mbomba quit (Quit: WeeChat 3.0)
10:38:31Araqthis would really simplify language design :-)
10:38:32FromDiscord<mratsim> It can't be. Even uncontested, an atomic requires L1, L2 and cache line synchronization.
10:39:01Araqyou could use a side-channel for the sync snooping
10:39:07FromDiscord<mratsim> having fast/efficient hardware channels would also simplify design 😉
10:39:55FromDiscord<mratsim> especially hardware, because chipmakers are hitting boundaries on how to synchronize shared memory across all the L1, L2, L3 and registers available
10:40:06Araqbut probably such a "side-channel" is impossible
10:41:59FromDiscord<mratsim> Note that cache synchronization is an area where Intel does use formal verification https://lamport.azurewebsites.net/tla/intel-excerpt.html?back-link=industrial-use.html?unhideBut@EQhide-intel@AMPunhideDiv@EQintel http://dl.acm.org/citation.cfm?id=1391675
10:53:37FromDiscord<Cypheriel> Who the heck came up with AoC day 10
10:53:57FromDiscord<Cypheriel> There are so many numbers and I have no clue what the heck I'm reading
10:54:57FromDiscord<j-james> Yeah, I'm in the same boat as you Cypheriel
10:56:29FromDiscord<Cypheriel> I understand it but.. I don't understand it
10:56:47FromDiscord<Cypheriel> Like I can understand the concept but I have no clue how I'm supposed to figure that out
10:57:09FromDiscord<j-james> I feel like there's some computer science principle that would be useful
10:57:45FromDiscord<j-james> it really can't be a pure math problem
10:58:05FromDiscord<Cypheriel> nvm maybe I don't understand the prompt at all
10:59:28FromDiscord<Cypheriel> Oh lord. I was thinking of something totally different.
10:59:44FromDiscord<Cypheriel> I love how this barely mentioned outlets and that's all I was really thinking of
11:01:40Araqmratsim: I don't understand why snmalloc isn't compared to 'memalloc'
11:01:56FromDiscord<mratsim> mimzlloc you mean?
11:02:01FromDiscord<mratsim> mimalloc?
11:02:08Araqmimalloc
11:02:29FromDiscord<mratsim> It is, in the mimalloc paper, snmalloc is about 6 months or 1 yearolder and from another Microsoft team
11:02:50FromDiscord<mratsim> so they weren't aware of mimalloc when they released that paper
11:03:29FromDiscord<mratsim> Since then they also integrated a lot of mimalloc advances but still kept the message-passing based thread synchronization
11:03:46FromDiscord<mratsim> (while mimalloc uses compare-and-swap)
11:04:40FromDiscord<mratsim> snmalloc is especially strong when memory is allocated in one thread and released in another (producer-consumer workload) while all other mem allocator had their worst case performance.
11:12:10AraqI found https://github.com/SchrodingerZhu/bench_suite/blob/master/output/index.md
11:12:16Araqwhich has interesting numbers
11:29:56FromDiscord<mratsim> the pool allocator I have in Weave is a mix of snmalloc + mimalloc for fixed size allocation.
11:31:27FromDiscord<mratsim> in particular mimalloc "heartbeat hook" is very interesting to amortizing caching operations from caching layers that build on top of the allocator
11:31:30FromDiscord<mratsim> https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L153-L162
11:32:14FromDiscord<mratsim> which I use to trigger regular expensive maintenance in Weave: https://github.com/mratsim/weave/blob/master/weave/memory/lookaside_lists.nim#L111-L150
11:40:22*Tlangir joined #nim
11:40:23*Tanger quit (Read error: Connection reset by peer)
11:43:26*Q-Master quit (Ping timeout: 272 seconds)
11:43:43*Vladar quit (Remote host closed the connection)
11:46:25hmmmmmduh apparently mirc wants my monnies, what do discerning nimions use for irc on windows
11:47:59FromDiscord<Zachary Carter> probably windows subsystem for linux and iirc
11:48:14FromDiscord<Zachary Carter> err wait
11:48:21PMunchHaha
11:48:22hmmmmmyou heaten
11:48:42FromDiscord<Zachary Carter> irssi lol
11:48:48hmmmmmwindows is very nice and comfy, a platform for the cozy gentleman
11:48:54PMunchI use HexChat on Linux, I think it's available for Windows as well (but with the normal caveat that Gtk might look sub-par on Windows without some configuration
11:49:18PMunchhmmmmm, nice and comfy, like a straight-jacket
11:49:21FromDiscord<Zeus> I use hexchat on Windows and it's fine
11:49:32PMunchIt's like a never-ending hug
11:50:06FromDiscord<Zachary Carter> I need to figure out if there's a way to make windows terminal better, now that I'm back on windows
11:50:21hmmmmmw10 terminal is pretty confy they remade it
11:50:41FromDiscord<Zachary Carter> yeah I have it installed - I like how you can fire up power shell sessions and wsl sessions in the same window
11:50:43*Q-Master joined #nim
11:50:50FromDiscord<Zachary Carter> but I miss stuff from fish shell
11:51:13FromDiscord<Zachary Carter> I mean at a bare minimum I want command history and auto completion
11:51:21hmmmmmI really don't want to use discord
11:51:27FromDiscord<Zachary Carter> well don't
11:51:28hmmmmmstallman said it's bad for my freedom
11:53:23hmmmmm"the top 21 irc clients for windwos"
11:53:29hmmmmmwoah they made 21? wtf
11:54:11FromDiscord<Zachary Carter> Oh duh, I can just change my shell I'm not stuck with the default ubuntu shell
11:54:23FromDiscord<mratsim> I remember using mIRC 18 years ago
11:54:33FromDiscord<mratsim> trying to solve why I couldn't do DCC requests
11:55:17hmmmmmyou ever solved it?
11:55:19hmmmmm:D
11:55:34hmmmmmhonestly irc is great for books
11:55:48*Q-Master quit (Ping timeout: 260 seconds)
11:56:28FromDiscord<mratsim> no, I just leeched with XDCC, I think it was a port mapping problem
11:56:39FromDiscord<mratsim> anyway offtopic
11:56:41PMunchhmmmmm, IRC clients are pretty easy to make
11:58:04FromDiscord<mratsim> At that time people were shifting from AIM to MSN Mesenger
11:58:56FromDiscord<mratsim> The holy grail was setting your MSN status message to Winamp music
11:59:28*Q-Master joined #nim
12:00:08FromDiscord<mratsim> ah not AIM, ICQ
12:01:13FromDiscord<flywind> How could I load the value without atomic for performance purpose(because I use a lock and no need to atomically load a value in this situation)?
12:01:23FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2HpS
12:01:57FromDiscord<mratsim> location.load(moRelaxed)
12:02:38FromDiscord<mratsim> no perf hit on x86 because x86 has a strong memory model
12:02:56FromDiscord<mratsim> though on Power 9 and ARM you might have some extra cache sync.
12:04:13FromDiscord<flywind> I see, thanks.
12:04:38FromDiscord<flywind> Could we export the raw data of `Atomics` instead?
12:05:14FromDiscord<mratsim> you can cast of course though I think it won't compile with the C++ backend.
12:05:51FromDiscord<mratsim> but relaxed ordering should be enough, the only guarantee it provides is that a read is done in a single atomic instruction
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:04FromDiscord<Zachary Carter> Apparently ICQ is still around somehow
12:06:11*hmmmmm quit (Remote host closed the connection)
12:06:18FromDiscord<mratsim> which is always true if you use 64 bit types on 64 bit and 32 bit types on 32 bit
12:06:33*supakeen joined #nim
12:08:56PMunch@mratsim, oh those were the day
12:09:00PMunchdays*
12:16:20FromDiscord<flywind> https://github.com/nim-lang/Nim/issues/16312
12:16:22disbotWrong code generation for sequences with "let". ; snippet at 12https://play.nim-lang.org/#ix=2HpY
12:17:02*jjido joined #nim
12:17:09FromDiscord<mratsim> it's a duplicate of an issue in the 6000 something
12:17:59FromDiscord<flywind> It looks really terrible.
12:18:29FromDiscord<mratsim> https://github.com/nim-lang/Nim/issues/2314
12:18:31disbotLet behaves differently in proc? ; snippet at 12https://play.nim-lang.org/#ix=2Hq0
12:19:11FromDiscord<mratsim> and I think there is another one
12:20:54FromDiscord<flywind> I think it is even worse?
12:21:15PMunchOh wow, that's not what I would expect at all
12:22:34FromDiscord<flywind> After a number is added to `s1`, `s2` is cleared.
12:26:16FromDiscord<mratsim> if you use arc, i think the sequence are OK
12:26:31FromDiscord<mratsim> the implementation are different and use sink for no copy let when it's possible
12:28:03FromDiscord<flywind> Yeah, with `arc` it works.
12:28:16FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Hq2
12:28:58FromDiscord<flywind> with `refc`
12:29:05FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Hq3
12:29:17*mika_ joined #nim
12:31:50FromDiscord<Vindaar> yes, I was also really surprised to see that issue
12:33:22FromDiscord<mratsim> I was suprised to never met it in my own library
12:33:42FromDiscord<mratsim> Arraymancer used to use sequences for example
12:34:02*mika_ quit (Ping timeout: 256 seconds)
12:34:20FromDiscord<Vindaar> yeah, I feel like I could have met that bug at any time
12:49:25*Vladar joined #nim
12:50:02FromDiscord<sealmove> guys how to construct identifiers in quote do? pls remind me
12:53:54FromDiscord<mratsim> `myIdent`
12:53:58FromDiscord<mratsim> use quote
12:54:23FromDiscord<mratsim> but use ident("foo") or bindSym("foo") before to declare it
12:58:58FromDiscord<sealmove> i mean with concatenation
13:05:44FromDiscord<mratsim> ident("foo" & "foo")
13:05:50FromDiscord<sealmove> ah ok ok
13:06:01FromDiscord<sealmove> so I do this outside the quote do
13:06:18FromDiscord<mratsim> you can't do anything in quote do you will trigger strange warnings
13:06:34FromDiscord<shadow.> yeahh
13:06:42FromDiscord<shadow.> just preevaluate any expressions you'd put in quotes
13:06:53FromDiscord<shadow.> or at least get them under an identifier lol
13:07:00FromDiscord<sealmove> i see. btw never understood bindsym. I want to construct a proc identifier. so the template will call either one proc or the other.
13:07:21FromDiscord<sealmove> i don't need bindsym for this right?
13:09:38FromDiscord<mratsim> bindSym is for binding a symbol in the macro scope
13:09:43FromDiscord<shadow.> how do you get a reference by indexing an openarray?
13:09:49FromDiscord<mratsim> otherwise ident can only look in the caller scope
13:09:57FromDiscord<shadow.> or do i have to use `.addr`
13:10:14FromDiscord<mratsim> @shadow. you use let foo {.byaddr.} = a[i]
13:10:19FromDiscord<shadow.> thanks
13:10:20FromDiscord<mratsim> or maybe it's byref
13:10:33FromDiscord<shadow.> ill try byref then byaddr lol
13:10:42FromDiscord<mratsim> you can use addr or unsafeAddr but then there is no check that you don't escape the scope with that reference
13:11:10FromDiscord<mratsim> or you use template ai: untyped = a[i]
13:11:39FromDiscord<shadow.> fair enough thanks
13:20:14ForumUpdaterBotNew thread by HJarausch: Collect for seq[set[int8]] , see https://forum.nim-lang.org/t/7235
13:21:12*Torro left #nim ("bye")
13:26:14ForumUpdaterBotNew thread by B3liever: Ideal design for a general purpose SparseSet?, see https://forum.nim-lang.org/t/7236
13:31:00FromDiscord<sealmove> just uploaded this https://github.com/sealmove/bitstreams
13:36:14FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HqH
13:36:16FromDiscord<shadow.> how could this get above index 97?
13:36:26FromDiscord<shadow.> i have a check for len and it only ever increments by one
13:37:01*spiderstew quit (Quit: Konversation terminated!)
13:37:21FromDiscord<shadow.> (edit) "97?" => "96?"
13:38:13FromDiscord<shadow.> even with >= it still fails
13:38:39disruptek!repo sparseset
13:38:40disbothttps://github.com/planetis-m/sparseset -- 9sparseset: 11Sparsesets for Nim 15 0⭐ 0🍴
13:42:04FromDiscord<shadow.> ah wait i see it's because the return is condition
13:42:43FromDiscord<squid> How do you use cstring?
13:42:53FromDiscord<shadow.> sprinkle liberally.
13:43:12FromDiscord<squid> I havent figured out how to create a cstring.
13:43:21FromDiscord<mratsim> cstring"Tread carefully"
13:43:30FromDiscord<shadow.> haha yeah
13:43:41FromDiscord<squid> And if I need to use it as pointer/buffer
13:44:40FromDiscord<squid> Like how do I allocate 20 characters?
13:44:54FromDiscord<mratsim> I use it in 2 situations:↵- Error message with non-dynamic content to save on GC↵- For interop with C library
13:45:17FromDiscord<squid> I need it for interop with C library
13:45:19FromDiscord<mratsim> everything else is likely begging for buffer overflow
13:45:22FromDiscord<squid> I wanna do stuff with imgui
13:45:45FromDiscord<mratsim> proc foo(myStr: cstring){.importc.}
13:45:52FromDiscord<mratsim> and just pass a Nim string to it
13:45:57FromDiscord<mratsim> Nim will do the right thing
13:46:12FromDiscord<squid> How do you do pointers?
13:46:28FromDiscord<squid> Like for imgui you need to provide a buffer for input from a textbox
13:46:33Zevvlet p = addr thing
13:46:34*PMunch quit (Ping timeout: 256 seconds)
13:46:56Zevvif you want a string, take the addr of s[0]
13:47:11FromDiscord<squid> And how do I allocate a 20 character long cstring?
13:47:52FromDiscord<mratsim> var foo = newString(20)
13:48:00FromDiscord<mratsim> you can pass that to C.
13:49:04FromDiscord<squid> Oh
13:49:07FromDiscord<squid> Thank you
13:49:45FromDiscord<squid> sent a code paste, see https://play.nim-lang.org/#ix=2HqM
13:51:22FromDiscord<mratsim> you don't need the address if newTextbox accepts a cstring
13:51:49FromDiscord<mratsim> if it demands a void pointer or pointer char you need to do addr(foo[0])
13:52:11FromDiscord<mratsim> (edit) "or" => "instead of a"
13:58:37*PMunch joined #nim
13:59:15PMunchNew after work stream of AoC today at 15:15 UTC
14:01:23*rockcavera quit (Remote host closed the connection)
14:08:40FromDiscord<shadow.> `nim r file.nim` is an official command right?
14:08:46FromDiscord<shadow.> it works fine for me but my friends says it says invalid command
14:09:20PrestigeYeah, are they doing -r by chance?
14:09:25FromDiscord<shadow.> nope
14:09:26FromDiscord<WalrusNoj> nope
14:09:31FromDiscord<shadow.> friend
14:09:34FromDiscord<shadow.> lol
14:09:46FromDiscord<WalrusNoj> sent a code paste, see https://play.nim-lang.org/#ix=2HqU
14:11:39narimiran@shadow. are you two on the same nim version?
14:11:39Prestigewhat is the output of nim --version?
14:12:29FromDiscord<shadow.> i'm on latest 1.4.2
14:12:38FromDiscord<shadow.> windows amd64
14:12:41FromDiscord<j-james> fyi shadow don't recurse
14:12:45FromDiscord<shadow.> fr?
14:12:49FromDiscord<shadow.> is todays not that hard lmao
14:12:49FromDiscord<j-james> my code has been running for four hours
14:12:51FromDiscord<shadow.> LOL
14:12:57FromDiscord<shadow.> i think i might have misunderstood the problem
14:13:00FromDiscord<shadow.> its so weird
14:13:04FromDiscord<j-james> a trillion is large
14:13:21FromDiscord<WalrusNoj> oh i am on 1.0.6
14:15:54FromDiscord<shadow.> lmao
14:16:11FromDiscord<shadow.> serves you right for sudo apt-get installing pfft
14:16:18FromDiscord<shadow.> !repo disruptek/gitnim
14:16:20disbothttps://github.com/disruptek/gitnim -- 9gitnim: 11choosenim for choosey nimions 15 6⭐ 0🍴
14:16:34EvolverHow can I use https://arrow.apache.org/docs/ with Nim? It has C/C++ bindings. Are direct Nim bindings possible? Or can/would I use the C/C++ bindings via Nim?
14:18:17PMunchWhat do you mean by "direct Nim bindings" vs "use the C/C++ bindings via Nim"?
14:19:03PMunchSince Nim compiles to C/C++ you simply need to tell Nim how to call the various things you need and possibly how some of the data structures are laid out and you should be golden
14:19:38EvolverPMunch: I see. Is there a good example of this that I can see on GitHub?
14:20:14Evolverfor a C/C++ package being used from Nim
14:22:21FromDiscord<shadow.> shit
14:22:24FromDiscord<shadow.> i think i misunderstood the problem
14:22:26FromDiscord<shadow.> this looks easy asf-
14:22:27FromDiscord<shadow.> lmfao
14:22:58Evolverwe should IMO try to keep the language professional here
14:23:33PMunchEvolver, we're normally pretty relaxed about language usage here
14:23:47FromDiscord<shadow.> i mean
14:24:04FromDiscord<shadow.> i can certainly do that but
14:24:13FromDiscord<shadow.> it's been pretty chill since i've been here as long as it's not like
14:24:14FromDiscord<shadow.> rude
14:24:15FromDiscord<shadow.> lmao
14:24:35FromDiscord<j-james> i still haven't gotten part ii yet
14:24:41PMunch@Evolver, there are some examples here: https://nim-lang.org/docs/backends.html
14:24:44FromDiscord<shadow.> im on part 1 LOL
14:24:48FromDiscord<j-james> (but last tried to four hours ago)
14:24:56FromDiscord<j-james> oh
14:25:01FromDiscord<shadow.> LMAO
14:25:15FromDiscord<shadow.> i dont think i needed recursion for part one
14:25:16PMunch@Evolver, you can also use c2nim to generate a wrapper
14:25:18FromDiscord<shadow.> im overthinking it
14:25:21PMunchOr nimterop
14:25:42FromDiscord<j-james> nono def not
14:25:55EvolverPMunch: thanks
14:26:15PMunch@Evolver, if you just want to see other projects wrapping a C/C++ library you can search for "wrapper" in the packages: https://nimble.directory/search?query=wrapper
14:26:48FromDiscord<Recruit_main707> Evolver, I guess that you meant a pure implementation by direct Nim bindings
14:27:05FromDiscord<lqdev> Evolver: imo keeping the language chill makes people can make people a bit more comfortable about speaking their mind out, not having to think about every single word they type and making it sound "professional"
14:27:06EvolverFromDiscord: yes
14:27:12FromDiscord<Recruit_main707> I think it would be possible, don’t know if it would be worth it
14:27:18FromDiscord<lqdev> (edit) removed "people can make"
14:27:28EvolverRecruit_main707: ok, thx
14:28:01PMunchBesides, not everyone here are native English speakers and might have a hard time making their language sound "professional"
14:28:07Evolverlqdev: lmao, lmfao, shit, asf -- these are not chill. These are just offensive.
14:28:23PMunchThat being said over-use of curses and such are generally not tolerated
14:28:32FromDiscord<lqdev> ^
14:28:58FromDiscord<shadow.> i don't think most people would consider "wow this challenge is hard asf" to be offensive
14:29:03FromDiscord<shadow.> it might be informal
14:29:04FromDiscord<lqdev> it's really not that offensive unless it's directed at someone
14:29:09FromDiscord<lqdev> @shadow. exactly
14:29:10FromDiscord<shadow.> but it's not targeted at someone
14:29:11FromDiscord<shadow.> so yeah
14:29:19*cgfuh joined #nim
14:30:47PMunchFurthermore there's a huge difference in timezones as well. Someone might be sipping gin from their couch while discussing here while others are at work
14:31:01FromDiscord<j-james> ~~it's targeted at santa~~
14:31:09FromDiscord<shadow.> lol
14:31:30PMunchHmm, so this one is harder than previous days?
14:31:31PMunchInteresting
14:31:35FromDiscord<shadow.> nah definitely not
14:31:40FromDiscord<shadow.> i misunderstood the problem
14:31:43FromDiscord<shadow.> made some huge recursion and intset thing
14:31:44FromDiscord<lqdev> and the definition of "offensive" is relative depending on who you ask so yeah
14:31:45PMunchAh okay :P
14:31:46FromDiscord<shadow.> as i always do 😉
14:31:51FromDiscord<lqdev> let's just keep it chill and not scold each other
14:31:57FromDiscord<shadow.> unless you're disruptek
14:31:59FromDiscord<shadow.> then you can roast anyone
14:32:01FromDiscord<shadow.> lol
14:32:11PMunchHe doesn't have an exception
14:32:11FromDiscord<lqdev> yes. disruptek is an exception
14:32:29FromDiscord<shadow.> hmm https://media.discordapp.net/attachments/371759389889003532/786601235230097468/unknown.png
14:32:49FromDiscord<lqdev> lol
14:32:53FromDiscord<j-james> PMunch: part ii is the hardest problem yet imo
14:32:54PMunchI mean where I live cursing is a normal part of everyday language (northern Norway)
14:33:00FromDiscord<j-james> by a wide margin
14:33:12FromDiscord<shadow.> well im on part one so i wouldn't know lmao
14:33:18FromDiscord<ache of head> why is "lmao" offensive?
14:33:20PMunchTo the point where the courts have ruled that cursing at a cop doesn't count as verbal abuse here and is not a fineable offense
14:33:23FromDiscord<Recruit_main707> Same here, both joking and seriously:p
14:33:31FromDiscord<ache of head> it's vulgar, sure
14:33:46FromDiscord<ache of head> but only offensive if you use it in an offensive context.
14:34:07PMunchSome people just find curses in general offensive
14:34:15FromDiscord<ache of head> ¯\_(ツ)_/¯
14:34:22PMunchBut then again, there's always someone who finds anything offensive
14:34:22FromDiscord<shadow.> depends on the person i suppose
14:34:33FromDiscord<shadow.> here i can offend everyone here with no vulgar
14:34:34FromDiscord<lqdev> yeah we in poland just spew swear words out like there's no tommorow sometimes
14:34:39FromDiscord<ache of head> lmao
14:34:41FromDiscord<ache of head> oops sorry
14:34:42FromDiscord<shadow.> "i prefer rust to nim"
14:34:48FromDiscord<shadow.> there we go
14:34:53FromDiscord<ache of head> i literally did that by accident
14:34:55FromDiscord<ache of head> i'm sorry
14:34:57PMunch /kick shadow.
14:35:00FromDiscord<shadow.> LMAO
14:35:02FromDiscord<lqdev> @shadow. YOU OFFENDED ME. I SHALL NOW EXECUTE YOU ON TWITTER.
14:35:02FromDiscord<shadow.> accurate.
14:35:07EvolverLet's just agree that it's vulgar, and that's reason enough for users to self-police it.
14:35:17FromDiscord<ache of head> but see, this is just how i express amusement
14:35:26FromDiscord<ache of head> unless i'm in an argument and i'm mocking someone
14:35:31FromDiscord<ache of head> "lmao" means that i enjoyed someone's joke
14:35:37FromDiscord<lqdev> Evolver: one thing i try to do is keep the swear words down on #nim, only use them on #nim-offtopic
14:35:44PMunchI guess it's similar to how lol was originally an abbreviation but has now sort of morphed into it's own expression
14:35:49FromDiscord<shadow.> yeah
14:36:01FromDiscord<shadow.> i don't use "lmao" because it's a swear, just because it's a generic reaction
14:36:11PMunchI tend to use "Haha" instead
14:36:28ForumUpdaterBotNew thread by JPLRouge: thread vscode error juste is normal , see https://forum.nim-lang.org/t/7237
14:36:32FromDiscord<ache of head> other than that
14:36:37FromDiscord<ache of head> i feel like all of them have a different ring to them
14:37:06FromDiscord<sealmove> oh wow, `_` is valid in nim but `_something` isn't
14:37:10FromDiscord<sealmove> ?
14:37:41FromDiscord<lqdev> yeah
14:37:47FromDiscord<lqdev> sometimes _ is used as a placeholder
14:37:52FromDiscord<lqdev> like `for _ in 1..5`
14:37:55FromDiscord<shadow.> for saying
14:37:56FromDiscord<shadow.> hey!
14:37:56FromDiscord<Recruit_main707> Basically, Nim ignores different ways of writing function names, except the firs character
14:37:58FromDiscord<sealmove> yes i see i see
14:37:58FromDiscord<shadow.> i don't need this!
14:37:59FromDiscord<lqdev> or `let (_, _, ext) = x.splitFile`
14:38:04FromDiscord<shadow.> ye
14:38:07FromDiscord<Recruit_main707> And that
14:38:33FromDiscord<sealmove> is there some other kind of ident that is not valid for names but can be used by macros?
14:38:41FromDiscord<lqdev> PMunch: ah yes, your classic "Haha :P"
14:39:09FromDiscord<lqdev> anyways
14:39:14FromDiscord<sealmove> for example i can provide end user with `_` which can't conflict with his variables
14:39:29FromDiscord<sealmove> so i was hoping for `_specialVar` but it doesn't work
14:39:39FromDiscord<lqdev> i generalized my Nim linter for lite, now it's possible to make it lint languages other than Nim
14:39:45FromDiscord<lqdev> think i'm gonna publish it soom
14:39:47FromDiscord<lqdev> (edit) "soom" => "soon"
14:39:50PMunch@sealmove genSym is probably what you want
14:40:03FromDiscord<Recruit_main707> Id use a symbol like ! for that
14:40:21FromDiscord<sealmove> but such symbols are operators, they are not parsed as identifiers
14:40:58PMunchWhat are you actually trying to do?
14:41:27PMunchIf you just want an identifier in your code but make sure that the user doesn't accidentally collide with it or use it in the block then genSym is what you want
14:41:59FromDiscord<sealmove> https://github.com/sealmove/binaryparse#repetition
14:42:53FromDiscord<sealmove> need to provide user with implicit variables for stream, loop index, and current element.
14:43:25narimiranPMunch: you asked about today's task. it is harder only in a sense that you cannot brute force it.
14:43:25PMunchAh
14:43:51narimiranand in my case that meant i need to remember how to do [REDACTED], which i haven't used in a long long time
14:44:02PMunch@sealmove, it should be fine to just use those identifiers, or just some longer names
14:44:03*Q-Master quit (Ping timeout: 260 seconds)
14:44:13PMunchnarimiran, hmm interesting!
14:44:33FromDiscord<sealmove> when you say "those"?
14:44:43PMunchWithout the _
14:45:06PMunchnarimiran, so no quadruple for loop today :P
14:45:07FromDiscord<shadow.> yeah im kinda tripped up on part one rn bc the wording is kinda awkward
14:45:11FromDiscord<shadow.> lol
14:45:13FromDiscord<shadow.> probably not
14:45:15narimiranPMunch: :P
14:45:31narimirannow it will be too easy for you :P
14:45:31PMunchStreaming in half an hour
14:45:38PMunchHaha, okay :P
14:45:58PMunchI'll take your word for it for now
14:46:03narimiranmwahahaha
14:46:05PMunchAnd blame you if I can't figure it out!
14:46:10FromDiscord<sealmove> btw, I want to use a dependency
14:46:18PMunchWhich one?
14:46:27narimiranPMunch: yeah, i also blamed myself this morning
14:46:58FromDiscord<sealmove> https://github.com/sealmove/bitstreams↵of course we can just throw the module in your repo if you prefer it, but I thought it deserves its own.
14:47:59FromDiscord<shadow.> wait
14:48:01FromDiscord<shadow.> how do i do this without
14:48:03FromDiscord<shadow.> recursion
14:48:11FromDiscord<shadow.> i need some way to handle branch possibilities, no?
14:49:30disruptekplanetis[m]: did you look at bitabs before making spareset?
14:49:47disrupteksparseset, too. i can't fucking spell it. ever.
14:50:50FromDiscord<shadow.> !repo bitabs
14:50:51disbotno results 😢
14:50:57FromDiscord<shadow.> is that a pkg or something
14:51:10PMunchOh nice, as long as it isn't a massive performance penalty and you're committed to keeping it up to date I'm all for it
14:51:59disrupteknevermind, it's in ic but it's not published anywhere else.
14:53:15FromDiscord<shadow.> ah i see
14:53:30FromDiscord<sealmove> no no it's even a performance boost since I am reading bytes 8-8 and caching them
14:53:40*vicfred joined #nim
14:53:52FromDiscord<sealmove> and it's already quite stable because I pretty much copy-pasted well-tested code from kaitai
15:02:39*Q-Master joined #nim
15:06:33FromDiscord<sealmove> what's the correct practice for proc aliases?
15:06:41FromDiscord<sealmove> (2 different names for the same proc)
15:06:49FromDiscord<sealmove> not proc variables
15:08:02FromDiscord<trippleA> I got a question. If I should use const over let if given the choice between the two, when should I ever need to use let when I can just use const for everything?
15:09:03Zevvyou can't const something that's calculated at run time
15:09:13Zevvyou can do "let a = readLine()"
15:09:17Zevvnot "const a = readLine()"
15:09:23Zevvbecause it needs to be available at compile time
15:09:32Zevvconst = compile time
15:09:52FromDiscord<trippleA> Is it wise to prefer const over let if I have a choice between the two?
15:10:31FromDiscord<sealmove> yes, because you ensure your program will have the value hardcoded
15:10:39FromDiscord<sealmove> instead of calculating it
15:10:52FromDiscord<trippleA> But I thought let was hardcoded also?
15:10:58FromDiscord<sealmove> not it's not
15:11:04FromDiscord<lqdev> not always
15:11:09FromDiscord<sealmove> it just ensures that your own code will not change it
15:11:16FromDiscord<sealmove> it's just type safety
15:11:41FromDiscord<trippleA> So the code can't change let, but I can manually change let myself?
15:12:10FromDiscord<sealmove> trippleA can you rephrase your last question? 😛
15:12:24FromDiscord<kenran> I found an issue with `defer` becoming deprecated in the next Nim major version. Should I try and avoid `defer` now already? What would be the alternative on how to manage resources that have to be freed, like in graphics programming or low-level stuff?
15:12:47FromDiscord<lqdev> @kenran destructors
15:13:01FromDiscord<trippleA> I'm not sure how to rephrase it, but I'll try. Lets say I have let x = 10 and that means the code can't change it, but I can later do let x = 50 and there will be no problems?
15:13:21FromDiscord<shadow.> uhm
15:13:27FromDiscord<lqdev> no
15:13:40FromDiscord<shadow.> const is an immutable evaluated at compile let
15:13:42FromDiscord<lqdev> you can't redeclare variables
15:13:44FromDiscord<shadow.> (edit) "let" => "time"
15:13:46FromDiscord<kenran> I've seen a tiny bit of how people do it in C++ with destructors, and I've done it in functional languages with `bracket` before. I don't know where and how to use destructors in Nim yet or if they even exist. Bracketing should be possible with first-class functions in Nim too
15:13:52FromDiscord<shadow.> let is an immutable evaluated at runtime
15:14:11FromDiscord<trippleA> But how is const hardcoded and let isn't?
15:14:15FromDiscord<lqdev> what's bracketing?
15:14:43FromDiscord<lqdev> @trippleA he meant that whatever value you give to a `const` always ends up as a single constant in your final executable
15:14:50FromDiscord<lqdev> while `let` can do calculations during runtime
15:15:08FromDiscord<trippleA> So it's generally faster to do const over let?
15:15:12FromDiscord<lqdev> yeah
15:15:17FromDiscord<shadow.> i mean
15:15:19FromDiscord<lqdev> but you can't always use it
15:15:23FromDiscord<shadow.> you only have to evaluate it once when you compile
15:15:26FromDiscord<lqdev> smart C compilers will constant-fond `let` variables at compile time so you shouldn't worry that much
15:15:27FromDiscord<shadow.> instead of everytime you run
15:15:43disruptekconstant-fondle?
15:15:56FromDiscord<lqdev> i had a stroke.
15:16:00FromDiscord<lqdev> constant-fold.
15:16:01disrupteknoted.
15:16:33FromDiscord<kenran> @lqdev It's more or less calling a function `bracket` that takes 3 functions: one to acquire a resource, one to free the resource, one to use the resource. and `bracket` itself calls these 3 in order with some sort of `finally` variant to make sure the resource is freed.
15:16:48FromDiscord<trippleA> Okay. I think I understand the difference between let and const. Const is at compile time and is generally faster because it's only done once at compile, but you can't use const for everything because sometimes you have to use let.
15:16:54FromDiscord<trippleA> Thanks guys for the help
15:17:12FromDiscord<kenran> Might be the wrong terminology, but it feels like working with continuations I guess.
15:17:18FromDiscord<lqdev> @trippleA let me extend that a bit: you have to use let iff you do runtime computations, such as taking input from the user
15:17:32FromDiscord<trippleA> got it
15:17:40disrupteki sometimes wonder if there's any reason our & operator doesn't concatenate at compile-time. i have a rewrite macro for it but... i wonder if there's a good reason not to do it in everyone's code.
15:17:55FromDiscord<lqdev> @kenran feels a bit inefficient
15:18:00FromDiscord<lqdev> nim has destructors https://nim-lang.org/docs/destructors.html
15:18:13FromDiscord<lqdev> and also you can pass a finalizer to `new(x)`
15:18:36PMunchStream is live: https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=UPpmXGVFO6w
15:18:39PMunchDay 10, here we go!
15:18:40FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Hre
15:18:41FromDiscord<kenran> it probably is in a language like nim. In Haskell you cannot do much else, and everything is a big composition of functions anyway
15:18:57FromDiscord<shadow.> im watching this bc i cannot figure out part one lmfao
15:19:01FromDiscord<shadow.> the wording is so awkward
15:19:25disruptekthat word is awkward.
15:19:26FromDiscord<kenran> Cool thanks. I didn't know they already existed. I only stumbled over some older blog post that mentioned they were coming
15:20:01*Cthalupa quit (Ping timeout: 264 seconds)
15:20:09PMunchnarimiran, stream is live if you're tuning it today :)
15:20:19narimiranPMunch: youtube link please
15:20:28PMunchhttps://www.youtube.com/watch?v=UPpmXGVFO6w
15:22:27FromDiscord<kenran> Sorry, I don't quite get it yet. This also mentions the "upcoming Nim runtime". but they're in already?
15:22:37FromDiscord<lqdev> yeah
15:22:40FromDiscord<kenran> I'm on 1.4.0 I just saw, so I gotta get a newer one probably
15:22:41FromDiscord<lqdev> you can use them with the default GC
15:22:44*Cthalupa joined #nim
15:23:58FromDiscord<kenran> That's what I'd like to try. I have no idea on how to really efficiently manage memory myself, but when the libraries I have to use are on a level where I have to free stuff manually, then destructors are probably what I'd go to first, while still using GC for everything else.
15:24:15FromDiscord<kenran> If the performance suffers later on, I can still try and optimize by doing more stuff manually.
15:26:35ForumUpdaterBotNew thread by Serge: Is there a way to monitor the total memory usage of a Nim app?, see https://forum.nim-lang.org/t/7238
15:31:18FromDiscord<kenran> woah, this is all a hell of a lot to learn... but I love that it's very easy to just try out stuff with nim
15:31:32*lritter joined #nim
15:31:46FromDiscord<kenran> no need to set up a "project" or something to play around; just create some `.nim` file and use `nim` to get up and running
15:32:55narimiranPMunch: diff - 1, not diff + 1
15:45:44FromDiscord<lqdev> hm, nim --fullHelp says that --errorMax defaults to 0 but in reality it seems to default to 1
15:46:05disruptekICE ICE baby
15:46:08FromDiscord<kenran> sent a code paste, see https://play.nim-lang.org/#ix=2Hrq
15:47:06*a_chou joined #nim
15:48:56disruptekkenran: you are unlikely to be able to out-optimize arc mm; it's not impossible, but it's unlikely. but what you /can/ do is hint to the compiler to help it optimize even further. basically, anything you are likely to want to do by hand, you can hint at and the compiler can do it even better.
15:51:27*mika_ joined #nim
15:53:13FromDiscord<kenran> I'm surely unable to do that. I'm not even using `arc` yet but just the default MM. I think I want to use destructors to free some resources like maybe textures or the low-level POSIX stuff I'm using.
15:57:07*hnOsmium0001 joined #nim
15:57:18*mika_ quit (Ping timeout: 260 seconds)
15:59:53FromDiscord<shadow.> for anyone that's doing aoc, could i get a hint as to why this isn't working for day 10 part one? https://hatebin.com/pvqvzqezuk
16:02:10FromDiscord<pietroppeter> @shadow: giving a quick look, it might be the num[3] + 3 at the end. I guess if you want to account for last plug (max + 3) you should only increase count by 1.
16:02:16*Q-Master quit (Ping timeout: 240 seconds)
16:02:35FromDiscord<pietroppeter> but also I am not sure your nums[1] is correct depends if adapters contain also the 0 plug at the beginning.
16:02:42FromDiscord<shadow.> well im increasing the 3 diff count, no?
16:03:00FromDiscord<shadow.> bc its before multiplication
16:03:03FromDiscord<shadow.> and yeah idk if it counts 0
16:03:03Araqhmm I think I can often "beat" arc, but it's a waste of time. easier to rewrite the code to use fewer 'ref' instead of coming up with "faster refs"
16:03:30FromDiscord<pietroppeter> yes you are increasing it but it should b increased by 1
16:03:38FromDiscord<shadow.> OHHH
16:03:39FromDiscord<shadow.> i see
16:04:02FromDiscord<pietroppeter> it is easy to mix up stuff like this, I do it all the time 🙂
16:04:06FromDiscord<shadow.> do i count the 0?
16:04:07FromDiscord<shadow.> im not sure
16:04:19FromDiscord<Esbeesy> Part one is just the differences isn't it?
16:04:22FromDiscord<shadow.> yeah
16:04:26FromDiscord<shadow.> do i count the zero plug?
16:04:30FromDiscord<shadow.> https://hatebin.com/pvqvzqezuk
16:04:36disruptekAraq: yes, but you don't count. sorry, bud.
16:04:39FromDiscord<Esbeesy> so you want to count the 0 (broken port) to your first adapter
16:04:43FromDiscord<shadow.> kk thanks
16:04:49Araqdisruptek, ah ok.
16:04:58FromDiscord<pietroppeter> mmh, looking better, you probably do already with the initialization of last = 0
16:04:58FromDiscord<shadow.> yup got it
16:05:00FromDiscord<shadow.> thanks guys
16:05:11FromDiscord<shadow.> question is do i use nums[3] or succ nums
16:05:13FromDiscord<shadow.> (edit) "nums" => "nums[3]"
16:05:17FromDiscord<shadow.> (edit) "or" => "+ 1or"
16:05:29FromDiscord<shadow.> bc i kinda wanna use succ
16:05:32FromDiscord<Esbeesy> succ?
16:05:43FromDiscord<shadow.> successor
16:05:47FromDiscord<Esbeesy> Like the meme? https://media.discordapp.net/attachments/371759389889003532/786624713244934194/iu.png
16:05:48FromDiscord<shadow.> basically peek of inc
16:05:49FromDiscord<shadow.> lol
16:05:54FromDiscord<shadow.> succ 1 == 2
16:06:05disrupteki wonder how much money aoc costs the industry every year in wasted effort.
16:06:13FromDiscord<Esbeesy> Tonnes
16:06:38FromDiscord<pietroppeter> yeah, they are the same. succ I think it is mostly useful when you are not dealing with Ordinal that do not have a + operator (like char)
16:07:14FromDiscord<pietroppeter> when you ARE dealing (scratch not)
16:07:17FromDiscord<shadow.> yeah true
16:07:22FromDiscord<shadow.> + 1 is more readable here
16:07:23FromDiscord<shadow.> but
16:07:24FromDiscord<shadow.> succ is just so
16:07:26FromDiscord<shadow.> succ
16:07:31FromDiscord<shadow.> my humor is broken
16:07:35FromDiscord<shadow.> or maybe im just 14
16:07:39FromDiscord<shadow.> it's one of those
16:08:11narimiranto all AoC-ers, PMunc4 is currently streaming (and struggling with part 2 :)), take a look!
16:09:07Araqmratsim: why do you use 'pad: array[CacheLineSize, byte]'
16:09:16FromDiscord<shadow.> lol hes still on it wow
16:09:20FromDiscord<shadow.> im going to fail then
16:09:22Araqand not 'pad: array[CacheLineSize - sizeof(int32), byte]' ?
16:10:03FromDiscord<kenran> currently trying to use https://github.com/nim-lang/sdl2. where do I find the keycodes that I can compare my `event.key.keysym.sym` to on `sdl2.KeyDown` event?
16:11:38disruptekmaybe xev will give you what you want. i'm not familiar with sdl.
16:12:01FromDiscord<kenran> nevermind, found it! the first comment in https://github.com/nim-lang/sdl2/blob/master/src/sdl2/private/keycodes.nim
16:12:44disruptekthat's... not terribly legible.
16:13:14FromDiscord<pietroppeter> narimiran: you got me at struggling... 🍿 (to be fair this is not really something that I would expect anyone to solve smoothly during a stream)
16:13:39narimiranyeah, it makes me feel better knowing i'm not the only one who struggled
16:14:08FromDiscord<pietroppeter> well, this might be the time that someone takes advantage of these: https://pietroppeter.github.io/adventofnim/2020/day10hints.html
16:14:27narimiranafter a brute-force attempt, i had a correct idea, but i was very rusty on implementation details so it took me too much time to do it
16:14:34FromDiscord<pietroppeter> (although they are biased toward my approach)
16:15:32FromDiscord<shadow.> you said you struggle on parsing days, hm?
16:15:35*Tlangir quit (Quit: Leaving)
16:15:41FromDiscord<shadow.> what do you usually use to parse
16:17:15narimiran@pietroppeter do you know your page titles are your local path to file?
16:17:44FromDiscord<pietroppeter> Yes I do, an issue of nimib I have to fix
16:18:09FromDiscord<bark> https://media.discordapp.net/attachments/371759389889003532/786627825993777152/Screenshot_20201210-171732_Alarm.png
16:18:19FromDiscord<bark> karax todo example running as an android app
16:18:25FromDiscord<pietroppeter> Shadow: strscans and parseutils. Trying to learn npeg and trying to skip learning regexes
16:18:50FromDiscord<pietroppeter> I had to drop from pmunch stream though
16:19:37FromDiscord<shadow.> yes i would
16:19:41FromDiscord<shadow.> highly recommend npeg
16:19:46FromDiscord<shadow.> makes everything so much easier
16:20:12FromDiscord<sealmove> huh, I think I found a bug
16:20:49Zevvin npeg
16:20:58FromDiscord<sealmove> I have a char variable and when I pass it as argument to a proc with quote do, it turns into an int.
16:21:10Zevvyou forget newLit
16:21:22Zevvalways newLit your quote do's
16:21:30FromDiscord<sealmove> oh hm
16:22:02FromDiscord<sealmove> no it's not like that
16:23:06FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2HrF
16:23:47FromDiscord<sealmove> and I get type missmatch: int literal but expected char
16:23:48FromDiscord<mratsim> @Araq, today you should use {.align: 64.}
16:24:12FromDiscord<mratsim> but yes your padding is better on memory used and has the same performance
16:25:44*a_chou quit (Remote host closed the connection)
16:26:26Zevvsealmove: need context.
16:26:41Zevvwhat is myCharVar
16:27:12FromDiscord<sealmove> just a variable. `let myCharVar = 'a'`
16:27:23ZevvnewLit that, really
16:27:30Zevvlet foo = newLit(myCharVar)
16:27:34Zevvand use `foo` in your macro
16:27:41FromDiscord<sealmove> i see thx
16:28:15*Q-Master joined #nim
16:28:27FromDiscord<sealmove> oh ok i have a more interesting question
16:28:37FromDiscord<sealmove> i am using a template that generates a call to a proc
16:28:53FromDiscord<sealmove> depending on the proc that gets generated, the return type might differ
16:29:25FromDiscord<sealmove> so I haven't specified a return type for the template, and it seems it returns a NimNode, which is undesirable
16:29:52Zevvthe template does not have a return type, as such
16:30:07*PMunch quit (Quit: leaving)
16:30:09FromDiscord<sealmove> right, so it should work
16:30:22Zevvits "result" is just put at the location of the invocation
16:31:41FromDiscord<sealmove> oh ok btw this template is generated by a macro... this might be important 😛
16:31:54Zevvyou know you're on your own now, right
16:32:19Zevvwhen in doubt, expand your macro
16:32:32Zevvuse -d:expandMacro=.. (or whatever its called) or `repr` that stuff
16:32:45Zevvbut don't assume anything.
16:32:49FromDiscord<sealmove> yes I can see the template call is correctly generated
16:32:58Zevvthen it's your fault :)
16:34:50ForumUpdaterBotNew thread by Lqdev: Lint+ - an improved linter for the lite text editor, incl. Nim support, see https://forum.nim-lang.org/t/7239
16:34:50*rockcavera joined #nim
16:39:54FromDiscord<shadow.> fuck
16:39:57FromDiscord<shadow.> this aoc is tough
16:40:02FromDiscord<Esbeesy> Haha
16:40:09FromDiscord<Esbeesy> 2 is hard innit
16:40:12FromDiscord<shadow.> looks like i gotta use math and statistics instead of bruteforcing
16:40:15FromDiscord<shadow.> have you tried it yet?
16:40:19FromDiscord<Esbeesy> Done
16:40:22FromDiscord<shadow.> damn alr
16:40:39FromDiscord<shadow.> i mean ive figured out ||that there are numbers which can't be removed|| but that's about it
16:40:40Zevvdon't recurse kids. it's bad for you, hmmkaay
16:41:28FromDiscord<shadow.> im guessing it's going to be something like multiplying the possible states of each subarray where subarray is split on mandatory number?
16:41:29FromDiscord<shadow.> something like that
16:41:30FromDiscord<Esbeesy> When you see the answer it’s really easy as well
16:42:11FromDiscord<Esbeesy> I couldn’t think of the answer until I looked at my Work slack going mad cause all the dev envs were down
16:42:23FromDiscord<shadow.> lmfao
16:42:31FromDiscord<m0nsta> simon peyton jones has requested your location.
16:42:41FromDiscord<Esbeesy> “Beck help us!” And then my ADHD addled brain was like “wait I know the answer to AoC now”
16:42:50FromDiscord<m0nsta> ^in reply to zevv recursion.
16:43:04FromDiscord<m0nsta> keep forgetting irc replies thing.
16:43:16narimiranZevv: you can recurse, but.... remember where you've been ;)
16:44:53Zevvman I always forget about that
16:45:03Zevvmy memory is not what it was
16:45:14narimiranyou forgot to remember to (not) forget
16:45:26narimiranthe beatles said something about that
16:48:41FromDiscord<m0nsta> iterators ?
16:52:58*theo_ joined #nim
16:56:52*vicfred_ joined #nim
17:00:22*vicfred quit (Ping timeout: 256 seconds)
17:03:04FromDiscord<Esbeesy> Iterate?
17:03:08*theo_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
17:05:36*vicfred_ quit (Quit: Leaving)
17:14:47*Jesin quit (Quit: Leaving)
17:18:21*hmmmmm joined #nim
17:19:25FromDiscord<shadow.> whew
17:19:27FromDiscord<shadow.> solved part two
17:19:29FromDiscord<shadow.> jesus, that was difficult
17:21:30FromGitter<bung87> what's these means in roc `%x21 / %x23-5B `
17:21:34FromGitter<bung87> rfc
17:21:54FromDiscord<shadow.> is there a type of `Table[T]` where if you attempt to access an uninitialized key it sets the `Table[T]` at that key to `default T`?
17:22:45*Jesin joined #nim
17:23:23FromDiscord<lqdev> @shadow. `yourTable.getOrDefault(key, defaultValue)`
17:25:47Zevv~your initial hunch seems insightful
17:25:47Zevvbut calling yourself is frightful
17:25:47Zevvit's ok, don't be afraid
17:25:48disbotno footnotes for `your`. 🙁
17:25:49Zevviterate, iterate, iterate!
17:26:04FromDiscord<shadow.> that doesn't set it internally, does it?
17:26:10FromDiscord<lqdev> no
17:26:16FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HrZ
17:26:17FromDiscord<shadow.> if poss[adapter] doesn't exist
17:26:22FromDiscord<shadow.> is there a way for it to set to `default int`
17:26:25FromDiscord<shadow.> and then do the operation?
17:26:29FromDiscord<lqdev> then mgerOrPut is what you're looking for
17:26:36FromDiscord<shadow.> ty
17:26:38Zevvdudes really are you ignoring my christmas carol
17:26:40FromDiscord<lqdev> `poss.mgetOrPut(adapter) += poss[diff]`
17:27:17FromDiscord<shadow.> ty
17:27:42FromDiscord<zetashift> @Zevv I like it!
17:33:02disruptekcps recursion is harmless. 😁
17:33:34FromDiscord<shadow.> lol
17:35:06disrupteki got rejected for a job at github in record time.
17:35:18disruptekless than 24hrs. performance is improving.
17:35:47FromDiscord<ache of head> they don't deserve you, disruptek
17:36:07disruptekno one deserves me, but someone is gonna get fuckin' stuck with me.
17:37:25disruptekhopefully, it's not my parents.
17:37:59FromDiscord<shadow.> perhaps they declined you because they saw my pr spam in testes
17:38:00FromDiscord<Idefau> you can live with me
17:38:11FromDiscord<shadow.> that would be interesting
17:38:15FromDiscord<Idefau> indeed
17:38:16FromDiscord<shadow.> have you done aoc today
17:38:18FromDiscord<shadow.> good luck
17:38:23FromDiscord<Idefau> i havent done aoc in a week
17:38:25FromDiscord<shadow.> wow
17:38:28FromDiscord<shadow.> lacking
17:38:32disrupteki don't think i could live with you.
17:38:40disrupteklack of motivation is a real downer.
17:38:48disruptekit's the last influence i need right now.
17:38:51FromDiscord<shadow.> if you lived with me you could just come slap me when i didn't do local tests
17:38:52FromDiscord<Idefau> 😦
17:39:14FromDiscord<shadow.> granted, it'd be child abuse but i'm sure that's the least of your worries
17:39:18disruptekmy parents are looking for a place to stay, though.
17:40:32FromDiscord<shadow.> hm
17:40:40FromDiscord<shadow.> we could get two generations of abuse in that case
17:40:48FromDiscord<shadow.> tis the season?
17:40:59FromDiscord<shadow.> what's the saying
17:41:03FromDiscord<shadow.> the more the merrier?
17:42:51FromDiscord<shadow.> @Esbeesy holy
17:42:56FromDiscord<shadow.> our solutions are nearly identical for part two
18:04:20disruptekdomestic abuse begins at home.
18:05:06*vsantana joined #nim
18:08:54FromDiscord<shadow.> wrong
18:09:03FromDiscord<shadow.> it begins when you tell your parents you'd rather program then go outside
18:10:16FromDiscord<Idefau> mine got used to it
18:10:16FromDiscord<shadow.> disruptek how many years has it been since you exited the womb
18:10:39FromDiscord<Idefau> thats an interesting way to ask
18:11:18FromDiscord<shadow.> otherwise he'll swindle the question
18:11:19FromDiscord<shadow.> and be like
18:11:25FromDiscord<shadow.> "well are we considering when i was a little pod racer"
18:13:16*vsantana quit (Quit: Leaving)
18:20:15*opal quit (Remote host closed the connection)
18:20:43*opal joined #nim
18:20:59disruptekdepends on whose womb you're referring to.
18:24:20FromDiscord<shadow.> the womb of your biological mother
18:24:33FromDiscord<shadow.> what would the answer be in that case
18:24:46FromDiscord<$not> <a:aPES_EvilPlan:765876509557915668>
18:24:52disrupteki'm a very immature 44.
18:24:59FromDiscord<shadow.> sounds about right
18:25:04disruptekbut i fuck like a 20yo.
18:25:27FromDiscord<shadow.> hmm, i'll send a hooker your way and ask for a rating in float form
18:25:59disruptekmake sure he's a redhead.
18:26:28FromDiscord<shadow.> who else would i even consider?
18:27:50FromDiscord<Recruit_main707> offtopic... :/
18:27:57disruptekhow is it that i'm getting an nkIntLit export pattern?
18:28:10disruptekexport 1
18:28:17disruptekthat's not a thing, right? 🤣
18:29:04FromDiscord<shadow.> if only there were some way to test it locally
18:29:25FromDiscord<shadow.> let me take a guess
18:29:30FromDiscord<shadow.> cannot export 1
18:32:25FromDiscord<squid> How do you do python fstrings in nim?
18:32:32FromDiscord<squid> or like javascript `` strings
18:32:53FromDiscord<mratsim> import strformat and &"your{magic]{interpolation}"
18:33:06FromDiscord<mratsim> your{magic}{interpolation}
18:33:11FromDiscord<squid> ok
18:33:12FromDiscord<squid> thank you
18:34:26*habamax quit (Ping timeout: 256 seconds)
18:36:14FromDiscord<squid> I am not getting it to work 😐
18:36:50FromDiscord<squid> Is there any way to format like C printf
18:37:13disrupteksure, you can use C printf.
18:37:23disruptekit's literally C printf.
18:37:29FromDiscord<squid> I mean like
18:37:35FromDiscord<squid> Just formatting so it returns a string
18:37:45miprithat's not what printf does.
18:37:45FromDiscord<squid> "%s", foo
18:37:56FromDiscord<squid> I know.
18:37:59disruptekyou mean C sprintf?
18:38:05FromDiscord<squid> yeah maybe
18:38:09disruptektry importing sprintf.
18:38:13FromDiscord<squid> I just meant the formatting part of printf
18:38:15FromDiscord<ache of head> i think squid meant the way that printf formats strings
18:38:18FromDiscord<ache of head> yeah
18:38:18FromDiscord<squid> Yes
18:38:37disrupteksprintf formats it exactly as it does in C... because it /is/ C.
18:38:37FromDiscord<shadow.> code and error?
18:38:41*disruptek 🤯
18:38:42miprithe two big string interpolation options in Nim are strformat's & and strutils' %
18:38:54disruptek~paste
18:38:55disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek
18:39:15hmmmmmwat I can & instead of fmt
18:39:21hmmmmmwhat sorcery is dat
18:39:24disruptek~&
18:39:24disbot&: 11unreachable
18:39:30miprirather than refer constantly to other languages if you can say what you don't like about some specific code, you'll get better help. "this works but I don't like it because ___"
18:40:13FromDiscord<shadow.> hmmmmm: the sorcery of custom prefix operators
18:40:28disruptekfmt and & aren't exactly the same.
18:40:32FromDiscord<shadow.> true
18:40:42FromDiscord<shadow.> i just always use &
18:40:51disruptekfmt is spelled with a `t`.
18:42:09FromDiscord<shadow.> that it is
18:42:43FromDiscord<shadow.> wait are the tools on xs made by you?
18:42:58hmmmmmthe only thing I regret from python is their beautiful floats with no 00000001
18:43:05FromDiscord<shadow.> that's the only thing you regret?
18:43:09hmmmmmyes!
18:43:11FromDiscord<shadow.> oh wait
18:43:12FromDiscord<shadow.> you meant
18:43:13FromDiscord<squid> `&"Username: {username} Password: {password}"` Is this correct?
18:43:13FromDiscord<shadow.> nvm
18:43:15hmmmmmI'm very comfy on nime :>
18:43:25FromDiscord<shadow.> should be
18:43:33FromDiscord<shadow.> are username and password defined
18:43:34FromDiscord<shadow.> send the code
18:43:41FromDiscord<squid> Yes they are defined
18:43:58FromDiscord<squid> "Username: %s Password: %s", username, password <-- This work supplied to an imgui text
18:44:13mipri!eval import strformat; let (u, p) = ("user", "pass"); echo &"Username: {u} Password: {p}"
18:44:16NimBotUsername: user Password: pass
18:44:20FromDiscord<squid> I think I know
18:44:22FromDiscord<shadow.> again, what's your code squid
18:44:33FromDiscord<squid> It is from a C library so the string ends after the first variable
18:44:45FromDiscord<squid> as it ends with \0
18:44:52FromDiscord<shadow.> then convert it to a string
18:45:03FromDiscord<mratsim> echoing a password is wrong
18:45:09FromDiscord<shadow.> true
18:45:10FromDiscord<mratsim> wroooooooooonnnnnnggggg
18:45:11FromDiscord<squid> =
18:45:14FromDiscord<squid> (edit) "=" => "?"
18:45:17FromDiscord<mratsim> my eyes, they bleeeed
18:45:23FromDiscord<squid> It is just a debug thingy
18:45:32FromDiscord<shadow.> alright but can we see the code at least to help you
18:45:33FromDiscord<mratsim> you killed me
18:45:53FromDiscord<shadow.> because otherwise we're blindly stabbing when the issue is probably higher up
18:45:53FromDiscord<mratsim> I'll have nightmares of password being printed on console tonight
18:46:31FromDiscord<squid> sent a code paste, see https://play.nim-lang.org/#ix=2Hsp
18:46:36hmmmmmyou can't see the code! you would steal it and profit from it :|
18:47:09FromDiscord<shadow.> i'm going to make millions from printing passwords
18:47:14hmmmmmlol
18:47:19FromDiscord<shadow.> what does `igInputText` do
18:47:20miprias stated already, and as shown above, there's nothing wrong with your usage of & there
18:47:21FromDiscord<mratsim> let text =
18:47:21FromDiscord<shadow.> nvm, lib function
18:47:33hmmmmmdisruptek are you around
18:47:36FromDiscord<shadow.> ah yes you need a word before assigning text unless it's declared higher up
18:47:36disruptekno.
18:47:39FromDiscord<squid> mipri, I know they just asked for the source
18:47:51FromDiscord<squid> Oh sorry. Yeah it is defined under the other variables
18:48:01FromDiscord<shadow.> and what's the error?
18:48:03FromDiscord<squid> it isnt giving an error.
18:48:04hmmmmmhey disruptek can you make one of your fancy presentations like CPS to make floats in nim as beautiful as in python
18:48:09FromDiscord<shadow.> then what's the issue
18:48:14disruptekhmmmmm: i tried.
18:48:18hmmmmmreally?
18:48:19hmmmmm:O
18:48:22hmmmmmu r my hero
18:48:24FromDiscord<squid> The problem was \0 on the strings the library returned i think
18:48:28FromDiscord<mratsim> if your password has a \0 inside, the C library might early exit
18:48:31narimiranhmmmmm: we had "beautiful floats" before, but it was changed to what it is today
18:48:39FromDiscord<mratsim> welcome to C strings
18:48:39hmmmmmjesus
18:48:45hmmmmmand disruptek allowed that?
18:48:47disruptekyeah, two other people started similar efforts to port ryu to nim so i abandoned my work. then they abandoned theirs. 🤷
18:48:47hmmmmm:|
18:49:08narimiranhmmmmm: that was before disruptek reign
18:49:13hmmmmmI see
18:49:14FromDiscord<squid> I figured that out before, mratsim. I have done C programming before just didnt think of it
18:49:40FromDiscord<squid> Whats the easiest way to remove \0 in those strings?
18:49:50disrupteki don't care what they look like, much, but i'm annoyed that they aren't as fast as they could be.
18:50:07FromDiscord<mratsim> a library that is keen on manipulating string in a safe way requires ptr char + len in C
18:50:28FromDiscord<shadow.> convert them to normal strings?
18:50:32FromDiscord<shadow.> are they cstrings or strings
18:50:32FromDiscord<squid> How?
18:50:39FromDiscord<mratsim> removing \0 from a password or username will likely trigger bugs.
18:50:43FromDiscord<squid> I use newString as you can see in the code i posted
18:50:43hmmmmmthey should be beautiful too. 70.9300000000001 is a thing from the movie IT
18:50:54FromDiscord<mratsim> Nim strings are basically cstring + len
18:50:58FromDiscord<shadow.> yeah
18:51:07FromDiscord<squid> mratsim, then what do I do?
18:51:12FromDiscord<mratsim> the issue is if your password or username contains \0
18:51:15FromDiscord<shadow.> is it a string
18:51:17FromDiscord<shadow.> or a cstring
18:51:18narimiranhmmmmm: i think you still don't understand the problem
18:51:20FromDiscord<shadow.> print its typeof
18:51:28narimiranhmmmmm: ...and that's why they need to stay ugly
18:51:39FromDiscord<mratsim> it doesn't matter, when passed to imgui Nim will extract the cstring part without the len
18:51:47FromDiscord<shadow.> ah i see
18:51:48FromDiscord<squid> string
18:51:50FromDiscord<shadow.> ohh right
18:51:51FromDiscord<shadow.> implicit
18:51:54FromDiscord<shadow.> hmm
18:52:03FromDiscord<shadow.> i mean you could do str[0..^2] but don't
18:52:17FromDiscord<squid> My problem is that &"Username: {username} Password: {password}" stops early
18:52:20FromDiscord<mratsim> you should prevalidate the input so that there is no \0 character
18:52:21hmmmmmhey I stand on the giant shoulders, python devs thought about it and made them as beautiful as a flower, they should know their stuff :>
18:52:29narimiran~ninp
18:52:29disbotninp: 11nim is not python!! -- narimiran
18:52:30FromDiscord<squid> ??
18:52:39FromDiscord<shadow.> how do you make a quote
18:52:44FromDiscord<shadow.> lol
18:52:50miprisquid, mratsim is trying to help you with the question you asked, which isn't the question you wanted to ask, yet again.
18:53:17narimiran~xy is https://en.wikipedia.org/wiki/XY_problem
18:53:18disbotxy: 11https://en.wikipedia.org/wiki/XY_problem
18:53:44FromDiscord<squid> Understood.
18:54:22FromDiscord<squid> My problem is that &"Username: {username} Password: {password}" stops early. (I think because imgui returns strings with extra \0)
18:54:49miprisquid: probably, you have something typed as a string that inappropriately contains a trailing \0. That's not part of the data, that's just a mistake from earlier in your code. That's what you want to remove. The way to remove that is to fix the earlier mistake. Nim has very good C support and part of it is not having to deal with such things.
18:55:09FromDiscord<nikki> oho i see some imgui code here
18:55:12miprisquid: what mratsim is trying to help you do is remove internal \0 chars that have been intentionally put in passwords and are part of the data, not a mistake
18:55:49FromDiscord<mratsim> can you echo the string returned by imgui
18:56:04FromDiscord<squid> Just as it is?
18:56:06FromDiscord<mratsim> I don't understand if your string ends with \0\0 (one from imgui one from Nim)
18:56:15FromDiscord<mratsim> or if it's something els
18:56:18FromDiscord<nikki> imgui's string thing returns the length too, so you can use that
18:56:25mipri!eval echo @"ab\0"
18:56:27FromDiscord<mratsim> also maybe imgui as a string API with ptr + len?
18:56:28NimBot@['a', 'b', '\x00']
18:56:30FromDiscord<nikki> could also do $result before
18:56:45FromDiscord<mratsim> unfortunately i got to go
18:56:45FromDiscord<nikki> this is specifically cimgui
18:56:46mipriecho it as a set of chars like that to highlight bytes like \0 that would otherwise not print in your terminal
18:57:50FromDiscord<squid> @['a', 'd', 'f', 'v', 'a', 'd', 'f', 'v', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00']
18:57:51FromDiscord<squid> So
18:57:55FromDiscord<squid> Yeahhh
18:58:24FromDiscord<squid> Soo. that is my problem confirmed.
18:58:28mipriare you reading into an array of bytes?
18:58:37FromDiscord<squid> I use newString(64)
18:58:45FromDiscord<squid> (edit) "newString(64)" => "`newString(64)`"
18:58:55FromDiscord<squid> (edit) "`newString(64)`" => "`newString(32)`"
18:59:12FromDiscord<squid> As I am trying to communicate with c
18:59:14FromDiscord<squid> (edit) "c" => "C"
18:59:22mipri!eval echo @(newString(2))
18:59:25NimBot@['\x00', '\x00']
18:59:34*hmmmmm quit (Quit: brb)
18:59:36miprisimilar issue.
19:00:11FromDiscord<squid> And no idea how to fix it..
19:01:15mipri!eval var s = "ab\0\0\0"; echo @($cast[cstring](s[0].addr))
19:01:18NimBot@['a', 'b']
19:01:46FromDiscord<nikki> igInputText writes to a buffer you give it, so yeah you need to allocate a larger one this way. but the resulting stringification will have the right length
19:01:48miprialthough you've got a string there, logically it's not a string, it's just a buffer that you're reading into. I'd use array[64, char] to make that a little more clear.
19:01:51*thomasross joined #nim
19:01:51FromDiscord<squid> Lmao. I was just trying it
19:02:09FromDiscord<nikki> yeah you don't need a seq / dynamically allocated buffer
19:02:17FromDiscord<nikki> unless you're trying to handle potentially long / expanding text
19:02:36mipriand then after the read you need a little more work to pull out the string
19:02:55mipriwhat I showed above is casting the address of the first byte to a cstring, and then $'ing that to get a string
19:03:22mipribut probably igInputText tells you how many bytes it reads? In that case you can avoid the unnecessary strlen() that happens with a cstring->string conversion
19:03:34FromDiscord<nikki> it actually doesn't lol
19:03:44mipriyou can also avoid the additional copy by keeping newString() as you've got, but changing its length to match the number of bytes read
19:03:46FromDiscord<nikki> https://github.com/cimgui/cimgui/blob/98bfe4375548d296dd491dddd81d06bbef9206fd/cimgui.h#L2043
19:03:48miprioh, lame.
19:03:49FromDiscord<nikki> this is what it does do
19:04:18FromDiscord<squid> I am still as lost
19:04:29FromDiscord<squid> How do I do you cast thingy?
19:04:32FromDiscord<nikki> we've added a lot of info here. do you have specific questions?
19:04:46mipri$cast[cstring](buffer[0].addr)
19:04:48FromDiscord<nikki> cast is just `cast[targetType](sourceExpr)`
19:04:48FromDiscord<squid> he didnt mention the string variable at all
19:04:52Araqmratsim: 'trySend' returns false when the channel is full
19:05:12FromDiscord<shadow.> can anyone recommend me a good lib for cli development?
19:05:15Araqwhat is the poor programmer supposed to do?
19:05:40miprishadow.: cligen
19:05:43FromDiscord<shadow.> thanks
19:06:07FromDiscord<squid> `var s = "ab\0\0\0"; echo @($castcstring)` Can anyone explain what this code does?
19:06:31disruptekAraq: if you do not succeed at first, try and try again.
19:06:36mipribuffer[0].addr # take a pointer to the first byte of the buffer
19:06:55mipricast[cstring](that) # treat it as a C string. trailing NUL byte, all that.
19:07:02mipri$that # turn it into a Nim string
19:07:12FromDiscord<squid> Where is buffer[0].addr
19:07:27mipriyou're creating them with newString(64), you said.
19:07:31FromDiscord<nikki> yeah just do `var buffer = array[64, char]` and then pass `buffer[0].addr` to igText
19:08:58FromDiscord<squid> Okay. And then to convert that i do $castcstring(buffer)
19:09:25mipriok, it sounds like the IRC<->Discord channel is dropping a lot COMPLETELY NORMAL ASCII CHARACTERS again
19:09:32FromDiscord<squid> Why is this so damn hard.
19:10:01FromDiscord<squid> Eh. Probably mipri
19:10:03FromDiscord<nikki> it's not hard, i think it just depends on understanding the underlying model that nim and c are sharing
19:10:19FromDiscord<nikki> they are talking through addresses over the same underlying memory
19:10:25FromDiscord<nikki> but they don't have a shared concept of nim strings
19:10:31miprihttps://play.nim-lang.org/#ix=2Hst <-
19:11:00FromDiscord<nikki> as i said before @squid -- `cast[targetType](sourceExpr)`
19:11:26FromDiscord<nikki> so `cast[cstring](buffer[0].addr)` give you the `cstring`
19:11:28mipriwhen a C API gives you a cstring, all you have to do is $ it to get a Nim string. that's pretty easy. what's harder here is that you have a buffer that you need to extract a string from, and don't even have length information so you have to go through cstring to get it
19:11:30FromDiscord<squid> oh wow. mipri. it dropped a lot of stuff
19:11:32FromDiscord<nikki> if you `$that` you get the nim string
19:12:24FromDiscord<nikki> sent a code paste, see https://play.nim-lang.org/#ix=2Hsu
19:12:27FromDiscord<squid> var username = array[32, char] -- Now this isnt valid for me
19:12:43mipriyou're assigning a type there
19:12:44FromDiscord<nikki> i'm silly, it's `:`
19:13:07FromDiscord<nikki> `var b: array[64, char]`
19:13:22FromDiscord<nikki> mainly it's good to make sure it's clear why this works
19:13:52FromDiscord<squid> I need to re watch a beginner nim video again
19:14:04FromDiscord<nikki> that won't help unless it covers this code specifically
19:14:12FromDiscord<nikki> also `igInputText` may have a buflen arg; it's good to pass the same 64 to that
19:14:49FromDiscord<nikki> as described before -- the main thing is that c and nim have a view of the same underlying memory with the same addresses. and you're giving C the start address of your buffer, telling it to write characters there
19:14:59FromDiscord<squid> I couldn't remember how to assign a variable
19:15:42FromDiscord<nikki> i wouldn't overindex on that, i think understanding the underlying concept might be the most important thing here
19:16:46FromDiscord<squid> Now it works.
19:17:00FromDiscord<squid> But really ugly 😄
19:17:05FromDiscord<squid> text = &"Username: {$cast[cstring](username[0].addr)} Password: {$cast[cstring](password[0].addr)}"
19:17:16FromDiscord<nikki> the main thing here is the C api you're using doesn't lead to idiomatic usage from the nim side
19:17:21FromDiscord<nikki> you can wrap igInputText in something nicer
19:17:58FromDiscord<nikki> something that has the array[64, char] inside, and then returns the casted string
19:18:10FromDiscord<nikki> bonus points for making the 64 a static param
19:18:13FromDiscord<squid> I might try nimgui
19:18:34FromDiscord<nikki> text inputs are the only case where you have this buffer thing happen, everything else usually works fine
19:18:44FromDiscord<nikki> and it's beneficial to have access to the whole api and up to date with upstream
19:18:47FromDiscord<nikki> if you go the direct C route
19:19:40FromDiscord<nikki> just checked nimgui -- it also uses a cstring so -- you'll have the same thing
19:19:48FromDiscord<nikki> it doesn't do any higher level wrapping
19:19:55FromDiscord<squid> oof
19:20:04FromDiscord<nikki> you can write a higher level wrapper for your use case, it's worth it
19:20:25FromDiscord<nikki> a benefit is that you know what's going on and how many allocations are being made etc.
19:21:18FromDiscord<squid> And that wrapper, would that just be a function that returns other stuff and runs other code before/after that igInputText
19:21:31FromDiscord<squid> (edit) "And that wrapper, would that just be a function that returns other stuff and runs other code before/after that igInputText ... " added "function"
19:22:31FromDiscord<nikki> yeah -- and returns the string (i.e., the result of `$blah`)
19:23:20FromDiscord<squid> A mutable normal string could also work
19:23:35*GitterIntegratio joined #nim
19:23:43FromDiscord<nikki> if it's preallocated with enough size. the main thing is the code at the callsite is not that much simpler
19:23:57FromDiscord<nikki> like, `var result = myInputText("password", 64)` seems nice right?
19:24:10FromDiscord<squid> I mean yeah
19:24:15FromDiscord<squid> I just dont know how imgui works
19:24:25FromDiscord<squid> It might write every frame
19:24:45FromDiscord<nikki> i know how imgui works, and i can tell you that it does 🙂
19:25:07FromDiscord<nikki> you will get a new allocated string per frame, but that should be clear because this code runs every frame and there's a `$`
19:25:20FromDiscord<squid> Is that bad for performance?
19:25:25FromDiscord<nikki> nah it's fine
19:25:43FromDiscord<squid> Would I allocate the array (every frame) in the wrapper?
19:25:58FromDiscord<nikki> the array is on the stack and the allocation is pretty cheap
19:26:15FromDiscord<nikki> the `$` conversion is what does the heap alloc, but there's not much refcount / copy going on because the result is moved out
19:26:43FromDiscord<nikki> the main concern is if you have like over 3000 of these in a huge scrollview
19:26:44miprihttps://play.nim-lang.org/#ix=2Hsy <- getInput's what I'd write here
19:26:49FromDiscord<nikki> but, even then just tryit and see
19:26:51FromDiscord<squid> is there any free() in Nim or does the gc do that normally?
19:27:32FromDiscord<squid> Oh. From reading your code mipri. I dont need to free or anything
19:27:36FromDiscord<nikki> is this a general question? or related to the example
19:27:36FromDiscord<Zachary Carter> yes there is a free
19:27:52FromDiscord<squid> It was more related to the example.
19:27:56FromDiscord<nikki> you don't need to free because you didn't allocate any memory or receive ownership
19:28:05FromDiscord<nikki> but, thereis also a free for when that does happen
19:28:19FromDiscord<squid> Isnt array[32, char] an allocation?
19:28:23FromDiscord<nikki> the array is on the stack. and the result of `$` is a tracked ref
19:28:38FromDiscord<nikki> yeah you didn't do somethign like `alloc0` is what i meant
19:30:45miprimanual deallocation: https://play.nim-lang.org/#ix=2Hsz . there are many ways to avoid this in Nim. the newString() you started with for example, you could use that as a buffer which would be freed automatically
19:32:21mipriah that last link has a bad use of sizeof
19:32:42miprihttps://play.nim-lang.org/#ix=2HsB <- newString example where you shrink the buffer and keep it as a string, instead of copying out of it
19:32:57FromDiscord<nikki> @squid i think https://play.nim-lang.org/#ix=2HsC is a good way to go
19:33:05FromDiscord<nikki> i left out extra params to igInputText as '...'
19:33:39FromDiscord<squid> What is the static keyword?
19:33:48FromDiscord<squid> Is it just non-mutable then?
19:33:54FromDiscord<nikki> it just means you have to specify that at compile time
19:33:58FromDiscord<nikki> that makes it so the array can be stack allocated
19:34:29FromDiscord<nikki> that way you only have one heap allocation for the string. not a big deal tbh, but, it even makes the code simpler? (subjective)
19:34:34*shuji joined #nim
19:35:13FromDiscord<nikki> i'm realizing though, for imgui i think you want to own the string state and then pass that back in right
19:35:20FromDiscord<nikki> like `username = myInputText("username", username)`
19:35:28*sagax joined #nim
19:36:10FromDiscord<nikki> anyways i would suggest getting it working, then adjusting as you need
19:37:22FromDiscord<squid> 0.ImguiInputTextFlags
19:37:24FromDiscord<squid> What is this?
19:37:33FromDiscord<squid> Flags is an enum
19:37:51FromDiscord<nikki> it's a conversion. `0.SomeType` converts to that type
19:37:56FromDiscord<squid> Oh
19:38:04FromDiscord<squid> So it is just 0 but that enum
19:38:06FromDiscord<nikki> `SomeType(0)` is equivalent
19:38:17FromDiscord<nikki> i believe so yeah
19:38:30FromDiscord<nikki> for the flags case it's mainly because zero flags means default
19:38:34FromDiscord<nikki> in the ig api
19:38:45mipri!eval echo (0.FileMode, 0.char, 0.int)
19:38:48NimBot(fmRead, '\x00', 0)
19:41:26FromDiscord<squid> hmm. That doesnt work as imgui uses the buffer as the text
19:41:33FromDiscord<squid> So after one frame its back to none
19:41:36FromDiscord<squid> (edit) "none" => "nothing"
19:42:33FromDiscord<squid> I could have the normal string variable as input and set the array to that
19:42:42FromDiscord<squid> It seems bad
19:43:37FromDiscord<squid> Oh. This is what you were talking about before
19:46:30FromDiscord<squid> How do I overwrite the first characters in the array with my string?
19:48:40miprihttps://play.nim-lang.org/#ix=2HsK
19:48:53FromDiscord<mratsim> @Araq that's the whole point
19:49:13FromDiscord<mratsim> if you have infinite buffer channels that's a DOS attack waiting to happen
19:49:33FromDiscord<mratsim> otherwise you need to expand the buffer
19:49:54FromDiscord<squid> mipri, And to avoid buffer overflow?
19:50:02FromDiscord<squid> (edit) "buffer overflow?" => "writing past the array limit?"
19:50:43FromDiscord<mratsim> Also this gives backpressure to the system, which is important as well
19:51:15miprithese are operations on pointers. you've left the realm of automatic safety and get to avoid buffer overflows the same way you do in C.
19:51:46mipriI would look at not having to do this. What you're asking for is pretty weird.
19:51:50FromDiscord<mratsim> for the record, during audit auditors asked us to max size all of our buffers that could be filled by RPCs or incoming network
19:52:36FromDiscord<squid> mipri, Imgui uses the buffer array on every single draw. It basically stores the text box value in it. I need the wrapper to have the same buffer each time
19:52:42mipriwith that said, no-addr version: https://play.nim-lang.org/#ix=2HsN
19:52:57mipriwhy do you need to write to that buffer though?
19:53:08mipricopying out of it, we've already shown
19:53:43FromDiscord<squid> I need it to have the same content every time I run the function
19:54:04FromDiscord<squid> But I only want a normal string variable outside to pass inside as var string
19:54:51FromDiscord<squid> Writing this wrapper is hard...
19:55:23avassIf I want to override the test task in my nimble config to use testament instead. How do I make sure nimble also installs any dependencies?
19:55:25*Gustavo6046 quit (Ping timeout: 272 seconds)
19:56:46FromDiscord<squid> mipri, https://play.nim-lang.org/#ix=2HsQ
19:57:35FromDiscord<squid> That doesnt work either
19:57:38FromDiscord<squid> Which I dont know why
19:57:52mipriwhy do you need to write to that buffer again?
19:58:01mipriit's stack allocated
19:58:21miprivar copy = string_buf; copy.setLen(len)
19:58:25FromDiscord<squid> imgui uses the buffer as what to draw to the input box and stores it there too.
19:58:34miprithat doesn't imply what you're doing.
19:59:24mipririp_igInputText returns an empty string, and writes to its string_buf parameter instead
19:59:26*Gustavo6046 joined #nim
19:59:31FromDiscord<squid> Oh yeaj
19:59:33FromDiscord<squid> (edit) "yeaj" => "yeah"
19:59:53*hmmm joined #nim
19:59:53FromDiscord<squid> It was supposed to return
19:59:55FromDiscord<squid> Then I changed that
19:59:59miprisince you have username = rip_igInputText(..., username, ...), you're writing to username and then blowing it away in the same call
20:00:14FromDiscord<squid> bruh.
20:00:16FromDiscord<squid> I am dumb..
20:00:18mipriwhat are you using it for to begin with, as a parameter?
20:00:33hmmmsquid don't worry we are nation
20:00:52FromDiscord<squid> mipri, imgui needs the string content to draw to the screen.
20:00:54*shuji quit (Ping timeout: 245 seconds)
20:01:14*Q-Master quit (Ping timeout: 272 seconds)
20:01:15FromDiscord<squid> That wrapper is supposed to change the buffer type from the weird array to basically a string
20:01:16hmmmis there a nice lib that understands "1.000.000,00" as 1000000.00
20:03:06miprisquid: ok, what I would suggest here is the strlen solution
20:06:36miprihttps://play.nim-lang.org/#ix=2HsT
20:06:54miprithere, you're always passing the same buffer when you ask for the same field, and it has whatever was last written to it
20:07:40mipribut after the first call to getInput() it's always a normal string with an appropriate size and without trailing NUL bytes
20:08:42miprithe .setLen() in getInput's just to save you give you pass a short string to it.
20:08:57*kenran joined #nim
20:09:34mipriapart from that possibly happening there won't be any allocation after the newString()s
20:11:15FromDiscord<lytedev> !eval import strutils, macros; template nn(s: string): float64 = s.replace(".").replace(",",".").parseFloat↵echo(nn"1.000.000,00")
20:11:17NimBot<no output>
20:12:21FromDiscord<lytedev> mipri: https://play.nim-lang.org/#ix=2HsW
20:12:22FromDiscord<squid> mipri, Thank you. That seems like a better solution in my case
20:12:23FromDiscord<squid> if it works
20:19:32FromDiscord<kenran> Can you point me to examples of how to test some impure low-level code in Nim, or what methods there are to test this, or even how to write low-level code that's testable? I know I'll just try to factor out as much of the code into pure funcs to use unit testing, but what else is there? I remember when doing a bit of C# that using interfaces there in combination with mocking was one way. Does that work in nim as well?
20:27:41*narimiran quit (Ping timeout: 258 seconds)
20:28:20*Q-Master joined #nim
20:30:09*shuji joined #nim
20:30:17shujihow do you assign to an Unchecked array?
20:30:37shujilet arr1:UncheckedArray[int]=[7,8]
20:33:05*Q-Master quit (Ping timeout: 240 seconds)
20:33:12FromDiscord<shadow.> anyone know of a cross-platform solution to reading clipboard?
20:33:14shujia better question would be how to pass a bidimensional array into a C function?
20:33:20FromDiscord<shadow.> i could use winim but i wanna make this work on unix too eventually
20:33:48miprihttps://play.nim-lang.org/#ix=2Ht5 <- unchecked arrays
20:35:17shujii see thanks maybe that is not what I am looking for
20:35:38FromDiscord<Quibono> Semi seriously, could you make an os in Nim since it compiles to C?
20:35:47FromDiscord<zetashift> yes checkout nimkernel
20:37:19*vicfred joined #nim
20:38:58FromDiscord<Quibono> Cool thanks
20:42:32planetis[m]disruptek: no I had followed a blog on desinging an ecs, https://skypjack.github.io/2019-02-14-ecs-baf-part-1/ but at the end it's not the desing I want to follow (im trying something a lot simpler)
20:43:10planetis[m]*designing
20:49:22*xet7 quit (Remote host closed the connection)
20:53:27FromDiscord<shadow.> how do you set clipboard text in winim?
20:53:42FromDiscord<shadow.> i know you have to open first, but the second parameter, hMem, im unsure about that
20:53:52FromDiscord<shadow.> how do i get from a string to the handle it wants
20:53:58FromDiscord<shadow.> (edit) "wants" => "wants?"
20:57:13FromDiscord<shadow.> nvm figured it out i think
20:59:21*shuji quit (Remote host closed the connection)
21:01:20FromDiscord<shadow.> nvm i did not figure it out support would be appreciated
21:03:27*Cthalupa quit (Ping timeout: 260 seconds)
21:04:09FromDiscord<lqdev> i guess, refer to the microsoft docs?
21:04:16*Cthalupa joined #nim
21:04:28FromDiscord<shadow.> microsoft docs are shit
21:04:29FromDiscord<shadow.> but i can try
21:04:59FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Htp
21:05:11FromDiscord<shadow.> but GlobalLock returns LPVOID which can't be passed to setclipboard data
21:05:15FromDiscord<shadow.> so i tried a cast which ik was dumb
21:05:15FromDiscord<shadow.> lol
21:06:25FromDiscord<lqdev> um, i think GlobalLock probably locks a mutex somewhere thus it's not what you want
21:06:34FromDiscord<shadow.> seems to be what they do so im confused lol
21:06:42FromDiscord<shadow.> https://docs.microsoft.com/en-us/windows/win32/dataxchg/using-the-clipboard#copying-information-to-the-clipboard
21:08:05FromDiscord<lqdev> i think hMem just expects a pointer
21:08:27FromDiscord<lqdev> have you tried just passing it `url[0].addr`?
21:08:37FromDiscord<lqdev> oh hold on
21:08:41FromDiscord<lqdev> nope take that back
21:08:54FromDiscord<lqdev> > If SetClipboardData succeeds, the system owns the object identified by the hMem parameter. The application may not write to or free the data once ownership has been transferred to the system, but it can lock and read from the data until the CloseClipboard function is called.
21:08:54FromDiscord<shadow.> rip
21:09:03FromDiscord<shadow.> yeah
21:09:12FromDiscord<shadow.> sorry, am i missing something lol?
21:09:16FromDiscord<lqdev> gosh windows is confusing
21:09:18FromDiscord<shadow.> yeah
21:09:22FromDiscord<shadow.> the api is pretty wack
21:09:35FromDiscord<shadow.> and the names aren't great either
21:09:37FromDiscord<lqdev> i'm not on window right now so i can't really help ya
21:09:40FromDiscord<shadow.> everything is PascalCase lol
21:09:41FromDiscord<shadow.> ah fair fair
21:10:11FromDiscord<Rebel> oh boy what are you doing with the clipboard 😛
21:10:21FromDiscord<Rebel> next thing I know you'll be doing some low level keyboard hooking
21:10:34FromDiscord<Rebel> join the thread nightmare train
21:10:37FromDiscord<lqdev> hm hold on
21:10:38FromDiscord<lqdev> actually
21:10:41FromDiscord<shadow.> oh?
21:10:44FromDiscord<shadow.> has the savior arrived?
21:10:59FromDiscord<lqdev> i think you can pass a cstring there but you'll have to keep it alive until CloseClipboard is called
21:11:17FromDiscord<shadow.> yeah i just switched to using cstring
21:11:22FromDiscord<shadow.> the issue is `discard SetClipboardData(CF_TEXT, buffer)`
21:11:27FromDiscord<shadow.> buffer is of type LPVOID not HANDLE
21:11:38FromDiscord<shadow.> LPVOID is just a pointer, HANDLE is like an int or something?
21:11:43FromDiscord<shadow.> and idk what it's a pointer to
21:11:48FromDiscord<shadow.> how do i check again? dref?
21:12:02*Q-Master joined #nim
21:12:23FromDiscord<lqdev> uhhh
21:12:24FromDiscord<lqdev> lemme check
21:14:19FromDiscord<shadow.> OHH NVM
21:14:21FromDiscord<shadow.> ik what im doing wrong
21:14:50FromDiscord<shadow.> À‹
21:14:53FromDiscord<lqdev> HANDLE is an int
21:14:54FromDiscord<shadow.> ok that's wrong, but it's something
21:14:57FromDiscord<shadow.> the text
21:14:58FromDiscord<shadow.> À‹
21:14:58FromDiscord<shadow.> LOL
21:15:07FromDiscord<shadow.> yeah handle is an int i knew that
21:15:10FromDiscord<lqdev> Á←
21:15:11FromDiscord<shadow.> sry i fixed it i think at least partially
21:15:22FromDiscord<shadow.> i was passing the buffer instead of the lock
21:15:23FromDiscord<shadow.> or something
21:15:40FromDiscord<shadow.> so confusing-
21:23:14FromDiscord<shadow.> im getting closer
21:25:14FromDiscord<shadow.> °ö‚
21:25:15FromDiscord<shadow.> maybe not...
21:26:50FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HtD
21:26:50FromDiscord<shadow.> this is at least valid
21:26:53FromDiscord<shadow.> but the bytes just aren't correct
21:26:58FromDiscord<shadow.> even with a c string
21:29:03FromDiscord<squid> Does the httpclient have any ways to receive cookies from request?
21:29:29FromDiscord<juliuskiesian> https://github.com/linebender/piet-gpu/blob/master/doc/vision.md
21:29:40FromDiscord<juliuskiesian> for those who are interested.
21:30:50FromDiscord<shadow.> check the response object or whatever get() returns
21:32:13FromDiscord<shadow.> OML
21:32:14FromDiscord<shadow.> GOT IT
21:32:53FromDiscord<shadow.> @lqdev figured it out
21:32:53FromDiscord<squid> You got clipboard thingy working?
21:33:00FromDiscord<shadow.> yes
21:33:05FromDiscord<shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HtF
21:33:07FromDiscord<shadow.> cstrings are already pointers
21:33:15FromDiscord<shadow.> so i shouldnt pass `cstring.addr`
21:33:22FromDiscord<shadow.> also `len` returns len so + 1 for nullbyte
21:33:37*vicfred quit (Ping timeout: 258 seconds)
21:34:46FromDiscord<Quibono> So what are we doing with the clipboard?
21:38:30FromDiscord<squid> "Research"
21:44:17*PMunch joined #nim
21:44:57*vicfred joined #nim
21:47:05*Jjp137_ quit (Ping timeout: 240 seconds)
21:48:52FromDiscord<shadow.> oh well
21:48:56FromDiscord<shadow.> its an upload thingy
21:49:01FromDiscord<shadow.> so that you can upload to playground through cmd
21:49:07FromDiscord<shadow.> and it puts the upload link in clipboard
21:49:21FromDiscord<shadow.> and windows only pft
21:49:26FromDiscord<shadow.> bc its just me using it lol
22:01:48FromDiscord<brainproxy> sent a long message, see http://ix.io/2HtK
22:02:25FromDiscord<brainproxy> (edit) "http://ix.io/2HtK" => "https://paste.rs/hd4"
22:02:44*kenran quit (Quit: leaving)
22:07:27*FromDiscord quit (Remote host closed the connection)
22:07:30PMunch@shadow. I have something similar set up on Linux
22:07:42*FromDiscord joined #nim
22:08:11PMunchxclip -o -selection primary | ix | tr -d '\n' | xclip -i -selection clipboard
22:08:26PMunchWhere ix is a program in AUR that uploads stuff to ix.io
22:12:54PrestigePMunch: did you already stream today?
22:13:00PMunchYeah..
22:13:02FromDiscord<shadow.> yes, he did
22:13:04FromDiscord<shadow.> rip
22:13:07Prestigedang
22:13:08PMunchBut I wasn't able to do p2..
22:13:14PMunchTrying to figure it out now
22:13:52FromDiscord<shadow.> wait rly?
22:13:54FromDiscord<shadow.> rip
22:13:58FromDiscord<shadow.> i finished it but yeah it was really hard
22:14:00FromDiscord<shadow.> took me like 2 hours lmao
22:14:05disruptek!repo disruptek/xs
22:14:06disbothttps://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 3⭐ 0🍴
22:14:14PMunchI mean I just got back to it
22:14:17disruptekthere's an ix in there that does the xclip and everything for you. in nim.
22:14:18FromDiscord<shadow.> fair
22:14:24PMunchHave been doing other stuff since I stopped streaming
22:14:32FromDiscord<shadow.> disruptek: who was that aimed at lol
22:14:39PMunchAnd combinatorics where never my strong suit..
22:14:44FromDiscord<shadow.> fair
22:15:32PMunch@shadow, I'm guessing for whoever was talking about ix pasting before I got here
22:19:47*lritter quit (Quit: Leaving)
22:26:06FromDiscord<shadow.> ohh
22:26:09FromDiscord<shadow.> that was probably me
22:26:16FromDiscord<shadow.> i made a program to upload to playground
22:26:20FromDiscord<shadow.> and put url in clipboard lol
22:26:46PMunchYeah, and I shared a oneliner script for how to do that in Linux
22:26:56FromDiscord<shadow.> hey hey hey
22:26:59PMunchWhich requires a "ix" program
22:27:00FromDiscord<shadow.> no competition smh
22:27:05FromDiscord<shadow.> ohhhh
22:27:09FromDiscord<shadow.> that would make sense
22:27:12PMunchAnd disruptek shared one such program :P
22:27:27FromDiscord<shadow.> https://play.nim-lang.org/#ix=2HtP
22:27:29FromDiscord<shadow.> this was mine
22:27:31FromDiscord<shadow.> i didnt know it had been made
22:27:37FromDiscord<shadow.> i just made it bc i hate copy pasting and opening a browser
22:27:42PMunchWhich is kinda handy, as you can pipe the output of a running program to ix
22:28:00FromDiscord<shadow.> smart
22:32:08*Vladar quit (Quit: Leaving)
22:55:32reversem3how do you append writing to a file ?
22:55:44reversem3I only see an enum for fmAppend
23:00:03FromDiscord<Esbeesy> I set an alias for ixio upload also
23:00:10FromDiscord<Esbeesy> Shadow how was your part 2?
23:00:26PMunchreversem3, you open it in append mode
23:00:47PMunchSo var myFile = open("output.log", fmAppend); myFile.write("Hello world")
23:00:57FromDiscord<Esbeesy> PMunch: I keep missing your streams cause I'm at work 😦
23:01:01reversem3ok thanks
23:01:16FromDiscord<Esbeesy> I was trying to implement a VS Code extension to speak to your nimlsp earlier - I didn't get far.
23:01:17PMunch@Esbeesy, todays stream was a bit of a dud TBH
23:01:33FromDiscord<Esbeesy> Yeah part 2 is very mathboi, caught me off guard
23:01:34reversem3let f = await client.execCommand("uptime")
23:01:34reversem3 #echo f
23:01:34reversem3 write("file.txt", $f)
23:01:59PMunchDid the first part really quickly, then spent almost an hour bumbling around with the second while getting no-where
23:02:08reversem3I'm not opening anything though just writing , so I supposed after I write I can re-open it and append
23:02:35PMunchYeah or just open it once to begin with
23:02:56FromDiscord<nikki> you can keep the file handle around after opening it once, and keep appending with that original handle
23:03:34PMunchOh well, time to get to bed
23:03:44*PMunch quit (Quit: leaving)
23:04:15FromDiscord<Esbeesy> Noight - What time are you usually on? Wanted to talk to you on the LSP
23:06:37FromDiscord<j-james> i'm still banging my head against the wall that is part ii
23:12:12mipriif you don't get it, stop banging your head and just read an explanation on how to solve it
23:13:26mipriEric's done this a few times since 2019. The problem is absolutely impossible if you're missing some key ideas.
23:15:26FromDiscord<Esbeesy> If you read mine, I used an emoji for a variable name to make it extra cryptic↵↵https://github.com/sambeckingham/advent-of-code-2020/blob/main/day10/day10.nim
23:16:08ForumUpdaterBotNew thread by Mantielero: Question about dup syntax, see https://forum.nim-lang.org/t/7240
23:16:29*Jjp137_ joined #nim
23:27:19FromDiscord<scott> How can I find out which procs/fields are accessible on a NimNode? I dug around until I decided to check the source code for the definition of `NimNode` and found this... https://github.com/nim-lang/Nim/blob/3fb5157ab1b666a5a5c34efde0f357a82d433d04/lib/system.nim#L2735↵↵If it's magic then why isn't it thoroughly documented for all variants of NimNode??
23:31:41*oculux joined #nim
23:32:34*oculuxe quit (Ping timeout: 246 seconds)
23:36:00FromDiscord<shadow.> lol i like it
23:36:07FromDiscord<shadow.> your part two is very close to mine
23:36:11FromDiscord<shadow.> yours is just easier to read
23:36:31FromDiscord<shadow.> https://github.com/shadowninja55/aoc-2020/blob/main/10/day10.nim
23:36:37FromDiscord<Esbeesy> Check again, I just added a chunky comment underneath to explain the algo
23:36:46FromDiscord<shadow.> ohh lol
23:36:50FromDiscord<shadow.> you seen mine?
23:36:55FromDiscord<Esbeesy> But yeah, exact same
23:37:00FromDiscord<shadow.> lol ye
23:37:04FromDiscord<shadow.> i just used a table inference
23:37:06FromDiscord<shadow.> and mgetOrPut
23:37:31FromDiscord<shadow.> SHEESH
23:37:31FromDiscord<shadow.> that comment is thicc
23:37:33FromDiscord<Esbeesy> Innit
23:37:48FromDiscord<Esbeesy> One of my friends is struggling with it as well and is about to give up
23:37:52FromDiscord<shadow.> damn
23:37:59FromDiscord<shadow.> i just realized like halfway through that it's just math
23:38:00FromDiscord<shadow.> lol
23:39:15FromDiscord<Esbeesy> Yeah I think Nari said earlier it was just a Project Euler puzzle hidden in an AoC
23:39:48FromDiscord<Esbeesy> Which is fair, but theres a fine line between fun programming hacks and actual work
23:40:22FromDiscord<shadow.> yeahhh true
23:40:27FromDiscord<shadow.> idk i didn't find it that enjoyable
23:40:34FromDiscord<shadow.> for instance yesterday's was very cool
23:40:40FromDiscord<shadow.> much more algorithm / programming orientic
23:40:41FromDiscord<shadow.> (edit) "orientic" => "oriented"
23:40:52FromDiscord<shadow.> today's just felt like a preview to the ap stat class i have to take lmfao
23:46:46*abm quit (Quit: Leaving)
23:52:55FromDiscord<shadow.> !repo clipboard
23:52:56disbothttps://github.com/Guevara-chan/Cliptomania -- 9Cliptomania: 11•.NET Clipboard for Nim• 15 6⭐ 0🍴
23:54:58FromDiscord<rinfz> how can I pass a compiled .o file to the compiler?
23:55:45FromDiscord<nikki> maybe `--passL:file.o`?
23:55:49FromDiscord<nikki> haven't tried just guessing
23:57:03FromDiscord<rinfz> yeah that worked, thanks! I was stupidly trying passC instead 😄
23:57:23FromDiscord<shadow.> https://play.nim-lang.org/#ix=2Hue
23:57:24FromDiscord<shadow.> boom
23:57:28FromDiscord<shadow.> added clipboard support
23:57:33FromDiscord<shadow.> if filename not provided
23:57:35FromDiscord<shadow.> litty
23:59:23FromDiscord<nikki> haven't coded nim in a sec bc. working on work project but seems like i still mostly remember the things
23:59:29*abm joined #nim
23:59:42FromDiscord<nikki> it's just kind of a sensible language and has low random noise compared to other ones