00:04:58 | FromGitter | <ynfle> @Elegant Beef nice solution for the parsing |
00:05:04 | FromGitter | <ynfle> My guess is it includes part 2 |
00:05:42 | FromGitter | <ynfle> For lines 8 through 10, I don't think you need to check if it hasn't been put in yet |
00:05:48 | FromGitter | <ynfle> I don't think there are duplicates |
00:06:26 | FromGitter | <ynfle> Also, there's this https://nim-lang.org/docs/tables.html#hasKeyOrPut%2CTable%5BA%2CB%5D%2CA%2CB |
00:07:11 | FromGitter | <fish-face> There can be duplicate colours on the same line of input |
00:11:23 | FromGitter | <ynfle> What do you mean? |
00:12:11 | FromDiscord | <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:53 | FromGitter | <fish-face> @ynfle You can have a line like "<blah> contains 4 shiny red bags, 3 shiny red bags." |
00:18:06 | FromGitter | <fish-face> I am now caught up |
00:18:06 | FromGitter | <ynfle> Really? |
00:18:23 | FromGitter | <ynfle> Do you have that in your input or know of someone who does? |
00:18:33 | FromGitter | <fish-face> I know of someone who did |
00:18:47 | FromGitter | <fish-face> There is another edge case which I had and which apparently not everyone does |
00:18:57 | FromGitter | <fish-face> but will not spoil the surprise unless you want to know |
00:19:05 | FromGitter | <fish-face> (though I was warned about it and still fell into the trap) |
00:19:42 | FromGitter | <ynfle> I'm pretty sure Beef's check was only for the beginning of the line not for the end |
00:19:53 | FromGitter | <ynfle> I'm not gonna do part 2 tonight |
00:19:57 | FromGitter | <fish-face> I may have misunderstood what you meant |
00:20:07 | FromDiscord | <ElegantBeef> My check is for the end of the line |
00:20:09 | FromGitter | <ynfle> Take a look a the link that was posted |
00:20:17 | FromDiscord | <ElegantBeef> I do it for both |
00:20:34 | FromDiscord | <ElegantBeef> Sure it's possibly redundant, but i was uncertain if there were any duplicate left hand cases |
00:20:39 | FromGitter | <ynfle> Why for the beggining? |
00:20:47 | FromGitter | <ynfle> Is that an actual edge case? |
00:21:10 | FromDiscord | <ElegantBeef> Cause i dont look at the data, and just write code that is reasonable |
00:21:24 | FromGitter | <fish-face> haha |
00:21:27 | FromDiscord | <ElegantBeef> It's reasonable to assume that there can be duplicates |
00:21:29 | FromGitter | <fish-face> usually they give you very friendly input |
00:22:55 | FromDiscord | <ElegantBeef> Sure but the only way to know that it's not a case is to check 😄 |
00:23:42 | FromGitter | <fish-face> well. You can also just try it and see if it breaks ;) |
00:24:09 | FromGitter | <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:18 | FromGitter | <fish-face> I think it's not so much the point |
00:24:34 | FromDiscord | <ElegantBeef> Well to each their own |
00:28:22 | FromDiscord | <ElegantBeef> I personally attempt to minimize any error before they appear 😄 |
00:28:36 | FromDiscord | <shadow.> i know none of you use windows, but if you do, install windows terminal lol |
00:28:39 | FromDiscord | <shadow.> so much cleaner than cmd |
00:28:49 | FromDiscord | <ElegantBeef> Next you'll suggest winget |
00:28:53 | FromDiscord | <shadow.> scoop |
00:28:54 | FromDiscord | <shadow.> LOL |
00:32:37 | FromDiscord | <shadow.> aw man, disruptek's testes have never looked so beautiful https://media.discordapp.net/attachments/371759389889003532/786389810943885322/unknown.png |
00:32:48 | FromDiscord | <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:39 | FromDiscord | <ElegantBeef> It's something to behold |
00:36:46 | disruptek | it brings a song to my heart. |
00:44:03 | disruptek | those underlines are bananas. |
00:44:34 | disruptek | and why is it that the check is an assertion error on windows and a compilation failure on linux? 🤔 |
00:44:55 | disruptek | and the indentation is fucked up. |
00:45:03 | disruptek | my testes have never been so messy. |
00:45:14 | disruptek | well, there was one time in new mexico, but other than that... |
00:46:15 | * | azed quit (Ping timeout: 258 seconds) |
00:51:49 | FromDiscord | <shadow.> lmfao that's weird |
00:51:55 | FromDiscord | <shadow.> (that it's still different) |
00:52:13 | disruptek | i fixed that bug. |
00:52:20 | disruptek | now i'm looking at the indent. |
00:52:23 | FromDiscord | <shadow.> much better https://media.discordapp.net/attachments/371759389889003532/786394847392301057/unknown.png |
00:52:57 | disruptek | but those underlines... |
00:53:40 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/786395174191628298/unknown.png |
00:53:42 | FromDiscord | <shadow.> much better. |
00:53:52 | FromDiscord | <shadow.> dont ask why my ubuntu python is on 2.7.17 |
00:54:04 | FromDiscord | <shadow.> yeah the underlines are quite sped |
00:54:12 | disruptek | weird, 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:37 | FromDiscord | <shadow.> damn that's crazy |
00:56:46 | disruptek | yeah, new mexico is lit. |
00:56:46 | FromDiscord | <shadow.> we must just be interconnected |
00:56:48 | FromDiscord | <shadow.> you got the brain |
00:56:49 | FromDiscord | <shadow.> i got the |
00:56:53 | FromDiscord | <shadow.> air pockets in the brain |
00:57:07 | FromDiscord | <shadow.> 👍 |
00:57:15 | disruptek | maybe it's just that yours is the first workstation i pwned. |
00:57:26 | FromDiscord | <shadow.> true |
00:57:28 | FromDiscord | <shadow.> oh no |
00:57:33 | FromDiscord | <shadow.> you might access by unidiomatic nim code |
00:57:34 | FromDiscord | <shadow.> :o |
01:01:34 | disruptek | the indentation seems to be a nim repr() bug. |
01:01:44 | disruptek | repr(NimNode), specifically. |
01:03:07 | disruptek | a regression from nim-1.0. |
01:03:24 | disruptek | i'll let shadow. fixed the damned underscores. too stupid. |
01:11:04 | FromDiscord | <shadow.> hmm |
01:11:08 | FromDiscord | <shadow.> which part? |
01:11:13 | FromDiscord | <shadow.> ohhh |
01:11:14 | FromDiscord | <shadow.> i see |
01:11:18 | FromDiscord | <shadow.> LMAO |
01:11:24 | FromDiscord | <shadow.> time to git clone git add git commit git push |
01:11:26 | FromDiscord | <shadow.> 🙄,, |
01:11:48 | FromDiscord | <shadow.> lmk the lines in question ill take a look with my sexy new terminal 🥵 |
01:14:58 | FromDiscord | <Cypheriel> `python3`, `python` (2.7) is used internally by certain things |
01:15:43 | FromDiscord | <shadow.> fair enough |
01:15:49 | FromDiscord | <Cypheriel> Can't remember what specifically, but I remember someone telling me to never delete the already installed version of python2 |
01:16:03 | FromDiscord | <shadow.> ill take your word for it |
01:16:14 | FromDiscord | <Cypheriel> but that's why Linux has you use `python` and `python3` rather than Windows having like just `py` |
01:16:54 | FromDiscord | <shadow.> fair |
01:16:57 | FromDiscord | <shadow.> or |
01:16:58 | FromDiscord | <shadow.> even better |
01:16:59 | FromDiscord | <shadow.> python3.9 |
01:17:01 | FromDiscord | <shadow.> and so on |
01:17:05 | FromDiscord | <Cypheriel> 3.9 D: |
01:17:09 | FromDiscord | <shadow.> hn? |
01:17:13 | FromDiscord | <shadow.> hm? |
01:17:21 | FromDiscord | <Cypheriel> Not all modules currently are updated to work on 3.9 |
01:17:24 | FromDiscord | <shadow.> yeah i know |
01:17:28 | FromDiscord | <Cypheriel> and most Linux distros will not come with 3.9 |
01:17:29 | FromDiscord | <shadow.> i reverted for dpy lol |
01:17:38 | disruptek | python is pointless. |
01:17:42 | FromDiscord | <Cypheriel> D: |
01:17:43 | FromDiscord | <shadow.> ^^ |
01:17:49 | FromDiscord | <Cypheriel> Why is it pointless? :< |
01:17:56 | FromDiscord | <shadow.> i use to like but after discovering higher level languages like nim or c# it just becomes obsolete |
01:18:05 | FromDiscord | <shadow.> idk if i should count c# bc it's its own shitshow |
01:18:06 | FromDiscord | <shadow.> but still |
01:18:10 | FromDiscord | <Cypheriel> C#... |
01:18:23 | FromDiscord | <shadow.> yeah thats right im flexing my windows .net on you what are you gonna do abt it |
01:18:25 | FromDiscord | <shadow.> mOnO |
01:18:26 | FromDiscord | <shadow.> smh |
01:18:29 | FromDiscord | <Cypheriel> I didn't use to have anything against it, but now I can't even use it |
01:18:34 | FromDiscord | <shadow.> hah |
01:18:37 | FromDiscord | <shadow.> pfft |
01:18:48 | FromDiscord | <shadow.> ill stick with my 25 popup gui just to open a console 🙄 |
01:19:39 | FromDiscord | <Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HmJ |
01:19:43 | FromDiscord | <shadow.> isn't that invalid syntax |
01:19:46 | FromDiscord | <Cypheriel> nope |
01:19:50 | FromDiscord | <shadow.> oh lord |
01:19:52 | FromDiscord | <shadow.> what is a variable |
01:19:54 | FromDiscord | <shadow.> love is a variable |
01:19:58 | FromDiscord | <shadow.> the is overload |
01:20:03 | FromDiscord | <shadow.> prints "baby don't hurt me?" |
01:20:03 | FromDiscord | <Cypheriel> :) |
01:20:10 | FromDiscord | <shadow.> am i right? |
01:20:13 | FromDiscord | <shadow.> or did you do it somehow else |
01:20:14 | FromDiscord | <Cypheriel> Yep |
01:20:19 | FromDiscord | <shadow.> fair enough |
01:20:23 | FromDiscord | <shadow.> now add a custom ope- |
01:20:24 | FromDiscord | <Cypheriel> No no |
01:20:24 | FromDiscord | <shadow.> oh wait |
01:20:25 | FromDiscord | <Cypheriel> you're right |
01:20:32 | FromDiscord | <shadow.> i know |
01:20:35 | FromDiscord | <shadow.> now add a custom ope- |
01:20:37 | FromDiscord | <shadow.> oh right |
01:20:39 | FromDiscord | <shadow.> python |
01:20:40 | FromDiscord | <Cypheriel> ope? |
01:20:42 | FromDiscord | <shadow.> operator |
01:20:46 | FromDiscord | <shadow.> i cut myself off bc you can't |
01:20:56 | FromDiscord | <shadow.> pfft |
01:20:59 | FromDiscord | <shadow.> i'll stick with nim |
01:21:04 | FromDiscord | <Cypheriel> lol |
01:21:52 | FromDiscord | <bark> im still planning to dev an android app with nim using the js backend 🔫 |
01:22:06 | FromDiscord | <shadow.> that's what we like to see |
01:22:08 | FromDiscord | <bark> i might try karax and apach cordova |
01:22:15 | FromDiscord | <bark> (edit) "apach" => "apache" |
01:22:26 | FromDiscord | <shadow.> yeah idk java is quite unsexy |
01:22:32 | FromDiscord | <shadow.> that's why i've stayed away from android development thus far |
01:22:36 | FromDiscord | <shadow.> and kotlin is uh... |
01:22:37 | FromDiscord | <shadow.> a thing |
01:22:41 | FromDiscord | <shadow.> 💀 |
01:22:45 | FromDiscord | <bark> i don't mind java |
01:22:52 | FromDiscord | <shadow.> kotlin uh.... |
01:22:53 | FromDiscord | <shadow.> certainly exists |
01:22:54 | FromDiscord | <bark> i just don't feel like learning the ui lib, i want muh css |
01:22:56 | FromDiscord | <shadow.> it's certainly a thing |
01:23:01 | FromDiscord | <shadow.> definitely a programming language |
01:23:08 | FromDiscord | <shadow.> can't say much else about it without lying but uh |
01:23:11 | FromDiscord | <shadow.> yeah :) |
01:23:32 | FromDiscord | <shadow.> idk i feel like java just fucks the shit out of oop |
01:23:35 | FromDiscord | <shadow.> overblows it |
01:23:54 | FromDiscord | <shadow.> composition-based solutions work better than inheritance usually imo |
01:24:57 | FromDiscord | <bark> I find it workable, if you're used to it |
01:25:12 | FromDiscord | <bark> but as someone who's not paid to code, I'm just gonna stick to nim |
01:25:38 | FromDiscord | <shadow.> yup |
01:25:42 | FromDiscord | <shadow.> i mean i've used java before |
01:25:52 | FromDiscord | <shadow.> i just wanted to smash my head in afterwards, that's all |
01:26:00 | FromDiscord | <shadow.> it's certainly usable though |
01:26:14 | FromDiscord | <shadow.> also, is that a suga pfp lmao |
01:31:08 | FromDiscord | <shadow.> does `writeFile` overwrite or append |
01:31:13 | disruptek | yes. |
01:33:44 | FromDiscord | <shadow.> good answer |
01:33:58 | FromDiscord | <shadow.> i'm not fixing your underlines until i get an answer of former or latter 🙄 |
01:34:15 | disruptek | former or latter. |
01:35:30 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HmM |
01:40:08 | FromDiscord | <exelotl> Kotlin adds the sugar needed to make Java bearable |
01:40:21 | FromDiscord | <exelotl> I respect it for that x) |
01:40:54 | FromDiscord | <shadow.> yes, but it adds tons of other sugar that makes kotlin unbearable |
01:41:12 | FromDiscord | <Cohjellah> does purchasing the nim merch off teespring help the devs? |
01:41:52 | disruptek | offer us jobs writing rust instead. |
01:42:16 | FromDiscord | <shadow.> ew |
01:42:22 | FromDiscord | <shadow.> you didn't even censor it |
01:43:18 | FromDiscord | <Rebel> Would't it depend on how you opened the file? |
01:43:25 | FromDiscord | <shadow.> wdym? |
01:43:32 | FromDiscord | <Rebel> https://nim-lang.org/docs/io.html#FileMode |
01:43:39 | FromDiscord | <Cohjellah> now why would you want to write Rust |
01:43:39 | FromDiscord | <Rebel> it would only append if you tell it to append |
01:43:46 | FromDiscord | <Rebel> also I saw you complaining about C# |
01:43:51 | FromDiscord | <Rebel> you didn't bring up any valid point |
01:43:55 | FromDiscord | <Rika> dont say the r word wt |
01:43:56 | FromDiscord | <Rika> f |
01:44:00 | FromDiscord | <Rika> at least censor it |
01:44:07 | FromDiscord | <Cohjellah> HAHAHA it is the forbidden word is it |
01:44:48 | FromDiscord | <Rika> wdym by valid point tho |
01:45:01 | FromDiscord | <Cohjellah> What's wrong with Microsoft Java? |
01:45:03 | FromDiscord | <Cohjellah> I quite like it |
01:45:19 | FromDiscord | <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:36 | FromDiscord | <ElegantBeef> Doesnt enforce immutabillity, relies on OOP, lacks any metaprogramming inside the language, and has no compile time evaluation |
01:45:47 | disruptek | i'll code clojure for food, too. |
01:45:58 | FromDiscord | <ElegantBeef> You'd probably code anything for food |
01:46:05 | FromDiscord | <Cohjellah> I'd code anything for food |
01:46:09 | FromDiscord | <Rika> i dont think hed code in c++ for food |
01:46:16 | FromDiscord | <Cohjellah> Who's got tips for finding a grad software role |
01:46:17 | FromDiscord | <Cohjellah> lmao |
01:46:37 | FromDiscord | <Rika> gain (your age)+5 years of job experience first |
01:46:48 | FromDiscord | <Cohjellah> Thank god I'm in Australia lol |
01:46:56 | FromDiscord | <Cohjellah> In America it seems ridiculous to get a grad role |
01:47:06 | FromDiscord | <Cohjellah> Meanwhile it's like "Yeah know basic programming concepts, have a semi-relevant degree, thanks" |
01:47:09 | FromDiscord | <Rika> it seems even more ridiculous in japan |
01:47:33 | FromDiscord | <Cohjellah> I think Aus has a shortage of good engineers |
01:47:39 | FromDiscord | <Cohjellah> but idk how many actual software grads we have |
01:47:44 | FromDiscord | <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:15 | FromDiscord | <Rika> man il manip tho sounds like hell doesnt it |
01:48:21 | FromDiscord | <Rebel> eh |
01:48:25 | FromDiscord | <Rebel> depends what you're trying to do |
01:48:35 | FromDiscord | <shadow.> c# literally only works on windows and requires special interference to work on other platforms |
01:48:40 | FromDiscord | <shadow.> lmao |
01:48:40 | FromDiscord | <Rika> if youre trying to do whatever youve made in nim |
01:48:42 | FromDiscord | <Rebel> that's 100% a lie |
01:48:48 | FromDiscord | <Rika> not anymore i believe |
01:48:48 | FromDiscord | <Rebel> that's just incorrect |
01:48:51 | FromDiscord | <shadow.> i would consider mono interference |
01:48:53 | FromDiscord | <shadow.> no? |
01:48:58 | FromDiscord | <Rika> net core? |
01:48:58 | FromDiscord | <Rebel> interference? |
01:49:01 | FromDiscord | <Rebel> ok |
01:49:03 | FromDiscord | <Rebel> oh boy |
01:49:07 | FromDiscord | <ElegantBeef> dotnetcore runs on most platforms |
01:49:16 | FromDiscord | <shadow.> ah right core |
01:49:16 | FromDiscord | <Rika> lol |
01:49:21 | FromDiscord | <shadow.> alr time to bring up the other 100 |
01:49:22 | FromDiscord | <shadow.> issues |
01:49:23 | FromDiscord | <shadow.> with c# |
01:49:24 | FromDiscord | <ElegantBeef> Aside from having to have a runtime it's a non issue |
01:49:36 | FromDiscord | <Rebel> we can either talk about it here or offtopic |
01:49:41 | FromDiscord | <Rebel> because that is just 100% incorrect |
01:49:45 | FromDiscord | <ElegantBeef> Which part? |
01:49:49 | FromDiscord | <Rebel> I am talking about shadow |
01:49:57 | FromDiscord | <shadow.> lol |
01:50:11 | FromDiscord | <ElegantBeef> How do you do metaprogramming with C# without leaving the runtime? |
01:50:21 | FromDiscord | <shadow.> that's true |
01:50:23 | FromDiscord | <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:37 | FromDiscord | <Rebel> (edit) "versions," => "versions and nly targets Window," |
01:50:39 | FromDiscord | <Rebel> (edit) "nly" => "only" |
01:50:41 | FromGitter | <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:58 | FromDiscord | <ElegantBeef> make a constructor? |
01:51:05 | FromDiscord | <Cohjellah> Want to move to offtopic for the .NET talk? |
01:51:06 | FromDiscord | <shadow.> yeah |
01:51:09 | FromDiscord | <shadow.> eh |
01:51:09 | FromDiscord | <Rebel> sure |
01:51:11 | FromDiscord | <shadow.> idc enough to argue |
01:51:17 | FromDiscord | <shadow.> but personally i just don't enjoy c# i'll leave it at that |
01:51:20 | FromDiscord | <Cohjellah> Also, yeah .NET 5 is taking over both core/framework |
01:51:20 | FromDiscord | <ElegantBeef> !repo constructor |
01:51:21 | disbot | https://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:21 | FromDiscord | <ElegantBeef> 😄 |
01:51:31 | FromDiscord | <shadow.> litty |
01:51:58 | FromGitter | <fish-face> haha I see |
01:52:19 | FromGitter | <fish-face> I am trying to do AoC with stdlib for now |
01:52:30 | FromGitter | <fish-face> but thanks |
01:56:55 | * | wowaname joined #nim |
01:57:33 | FromDiscord | <exelotl> @Cohjellah I don't think it does, might be wrong though |
01:58:00 | FromDiscord | <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:06 | FromDiscord | <Cohjellah> Hope it does support them ahah bought a mug |
01:59:09 | FromDiscord | <exelotl> I would totally buy some Nim merch if I knew it was legit x) |
02:00:14 | FromDiscord | <Rebel> where is disruptek when you need him 😦 finally going to solve my woeful problems |
02:00:34 | disruptek | about fucking time. |
02:00:50 | FromDiscord | <Rika> Lol |
02:01:28 | FromDiscord | <shadow.> lmfao |
02:01:37 | FromDiscord | <shadow.> disruptek what were the lines were underlining is handled |
02:01:40 | FromDiscord | <shadow.> and what did you say was the issue |
02:01:48 | FromDiscord | <Rika> I assume it's too long |
02:01:53 | FromDiscord | <shadow.> ill work on it after i finish writing about index fossils |
02:01:55 | FromDiscord | <shadow.> lmfao |
02:02:14 | FromGitter | <fish-face> final question for tonight: is there a way to pass something as a mutable value? |
02:02:26 | FromDiscord | <Rebel> oh shit lol |
02:02:30 | FromGitter | <fish-face> sorry, I mean: pass something *by* value, but mutable |
02:02:32 | FromDiscord | <Rebel> wasn't expecting you to respond right away 😛 |
02:02:43 | disruptek | prefix the proc param with `var`. |
02:02:54 | disruptek | the /type/, rather. |
02:03:06 | mipri | so 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:16 | FromDiscord | <shadow.> shadow it |
02:03:25 | disruptek | disruptek it |
02:03:55 | FromDiscord | <shadow.> don't you just hate when you disruptek your parameters in for loops |
02:04:00 | FromGitter | <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:25 | disruptek | shadow it and then disruptek it. |
02:04:28 | disruptek | shadow it and then pass it. |
02:04:42 | mipri | it'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:43 | FromGitter | <fish-face> oh wait, I misunderstood my own code |
02:05:07 | disruptek | hold your laptop a little closer to the router; i can't quite make out what's going on here. |
02:05:09 | FromDiscord | <ElegantBeef> By default it's immutable, `var` makes it a reference to the original, so yea you have to make a copy |
02:05:17 | FromDiscord | <shadow.> shadowruptek it |
02:05:21 | FromDiscord | <ElegantBeef> Close your windows the wifi is escaping |
02:05:30 | FromDiscord | <shadow.> what? why would i shut down my os |
02:05:32 | FromDiscord | <shadow.> that's a dumb idea |
02:05:35 | FromDiscord | <shadow.> actually no it's a great idea |
02:05:39 | disruptek | turn the lights down low; the contrast is all washed out. |
02:05:39 | FromDiscord | <shadow.> i'm just too much of a kiddy to do it |
02:05:40 | FromGitter | <fish-face> I think I understood anything correctly, except that actually the calling proc *does* need to mutate it - hence the error :) |
02:05:54 | FromDiscord | <shadow.> so then prefix parameter with `var` right? |
02:06:19 | mipri | right. 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:57 | FromDiscord | <shadow.> yeah |
02:07:23 | FromDiscord | <shadow.> id say a `mut` keyword could be added but nah |
02:07:27 | FromDiscord | <shadow.> not tryn ago rst mode |
02:07:33 | FromDiscord | <shadow.> that'd also be confusing |
02:07:34 | mipri | https://play.nim-lang.org/#ix=2HmX - like so. |
02:07:41 | FromGitter | <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:55 | FromDiscord | <shadow.> fair enough |
02:09:01 | FromDiscord | <shadow.> also disruptek i learned how to use git finally |
02:09:01 | FromDiscord | <shadow.> lmao |
02:09:11 | FromDiscord | <shadow.> so i dont have to use 500mb of ram to make a pr |
02:16:35 | disruptek | no shit. |
02:20:05 | FromDiscord | <shadow.> yeah |
02:20:13 | FromDiscord | <shadow.> are you proud https://media.discordapp.net/attachments/371759389889003532/786416948811661342/unknown.png |
02:24:00 | disruptek | i don't see any underlines. |
02:24:25 | FromDiscord | <shadow.> hmm |
02:25:25 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/786418262694035486/unknown.png |
02:25:29 | FromDiscord | <shadow.> this one works fine lol |
02:25:36 | FromDiscord | <shadow.> its the test on the front page with the underlines, right? |
02:25:54 | disruptek | yeah, that looks fine. |
02:27:57 | FromDiscord | <shadow.> yeah hmm |
02:28:05 | FromDiscord | <shadow.> lemme try the test one |
02:28:11 | FromDiscord | <shadow.> !repo testes |
02:28:12 | FromDiscord | <shadow.> im so lazy |
02:28:13 | disbot | https://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 17⭐ 1🍴 7& 29 more... |
02:28:43 | disruptek | 29 more testes... that must feature ol' three-ball saul. |
02:29:44 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/786419348973682708/unknown.png |
02:29:46 | FromDiscord | <shadow.> this looks...fine? |
02:29:55 | FromDiscord | <shadow.> ahhh |
02:29:58 | FromDiscord | <shadow.> it does the sped lines only in minimized |
02:30:11 | FromDiscord | <shadow.> or rather when you like stretch console |
02:30:14 | FromDiscord | <shadow.> it's a windows thing iirc |
02:30:16 | disruptek | wtf is a sped line? |
02:30:19 | disruptek | super fun. |
02:30:21 | FromDiscord | <shadow.> it happened with my maze solver too |
02:30:22 | FromDiscord | <shadow.> a line that is sped |
02:30:28 | disruptek | sped? |
02:30:47 | disruptek | 2 definitions found |
02:30:47 | disruptek | |
02:30:47 | disruptek | From The Collaborative International Dictionary of English v.0.48 [gcide]: |
02:30:47 | disruptek | |
02:30:49 | disruptek | Sped \Sped\, |
02:30:52 | disruptek | imp. & p. p. of {Speed}. |
02:30:54 | disruptek | [1913 Webster] |
02:30:57 | disruptek | |
02:30:59 | disruptek | From The Collaborative International Dictionary of English v.0.48 [gcide]: |
02:31:02 | disruptek | |
02:31:04 | disruptek | Speed \Speed\ (sp[=e]d), v. i. [imp. & p. p. {Sped} (sp[e^]d), |
02:31:07 | disruptek | {Speeded}; p. pr. & vb. n. {Speeding}.] [AS. sp[=e]dan, fr. |
02:31:09 | disruptek | sp[=e]d, n.; akin to D. spoeden, G. sich sputen. See {Speed}, |
02:31:12 | disruptek | n.] |
02:31:14 | disruptek | 1. To go; to fare. [Obs.] |
02:31:17 | disruptek | [1913 Webster] |
02:31:19 | disruptek | |
02:31:22 | disruptek | To warn him now he is too farre sped. --Remedy of |
02:31:24 | disruptek | Love. |
02:31:27 | disruptek | [1913 Webster] |
02:31:29 | disruptek | |
02:31:32 | disruptek | 2. To experience in going; to have any condition, good or |
02:31:35 | disruptek | ill; to fare. --Shak. |
02:31:37 | disruptek | [1913 Webster] |
02:31:39 | disruptek | |
02:31:42 | disruptek | Ships heretofore in seas like fishes sped; |
02:31:44 | disruptek | The mightiest still upon the smallest fed. --Waller. |
02:31:47 | disruptek | [1913 Webster] |
02:31:49 | disruptek | |
02:31:52 | disruptek | 3. To fare well; to have success; to prosper. |
02:31:54 | disruptek | [1913 Webster] |
02:31:55 | mipri | combo breaker |
02:31:57 | disruptek | |
02:31:59 | disruptek | Save London, and send true lawyers their meed! |
02:32:03 | disruptek | For whoso wants money with them shall not speed! |
02:32:04 | disruptek | --Lydgate. |
02:32:07 | disruptek | [1913 Webster] |
02:32:09 | disruptek | |
02:32:12 | disruptek | I told ye then he should prevail, and speed |
02:32:15 | disruptek | On his bad errand. --Milton. |
02:32:17 | disruptek | [1913 Webster] |
02:32:19 | disruptek | |
02:32:22 | disruptek | 4. To make haste; to move with celerity. |
02:32:24 | disruptek | [1913 Webster] |
02:32:27 | disruptek | |
02:32:29 | disruptek | I have speeded hither with the very extremest inch |
02:32:32 | disruptek | of possibility. --Shak. |
02:32:34 | disruptek | [1913 Webster] |
02:32:37 | disruptek | |
02:32:40 | disruptek | 5. To be expedient. [Obs.] --Wyclif (2 Cor. xii. 1.) |
02:32:42 | disruptek | [1913 Webster] |
02:32:45 | disruptek | oops. |
02:32:47 | FromDiscord | <shadow.> urban dictionary is a more credible source |
02:32:57 | FromDiscord | <shadow.> > an insult used when someone does something stupid. |
02:33:09 | FromDiscord | <shadow.> there are other definitions but i dont condone using it that way |
02:33:15 | FromDiscord | <shadow.> lmao |
02:33:21 | disruptek | okay, chucklehead. |
02:33:22 | blackbeard420 | sped = One who attends special education classes. |
02:33:46 | FromDiscord | <shadow.> yeah did not mean that lol |
02:34:17 | FromDiscord | <Rika> did you mean sped up or what |
02:35:29 | FromDiscord | <shadow.> just stupid |
02:35:30 | FromDiscord | <shadow.> nvm |
02:35:34 | FromDiscord | <shadow.> this is what i get for being in high school |
02:36:02 | disruptek | i could probably teach you a thing or two about being high. |
02:36:06 | FromDiscord | <Quibono> lol |
02:36:59 | FromDiscord | <shadow.> yes |
02:37:06 | FromDiscord | <shadow.> be the good influence i need |
02:37:16 | FromDiscord | <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:32 | disruptek | yeah, great. |
02:37:41 | FromDiscord | <shadow.> so then the line thing isnt a code issue |
02:37:44 | FromDiscord | <shadow.> it's just windows being stupid |
02:37:49 | FromDiscord | <shadow.> windows being windows |
02:37:49 | FromDiscord | <Rika> lol |
02:37:49 | disruptek | yeah, great. |
02:37:51 | FromDiscord | <Rebel> yes great indeed this problem has been a pain on my side |
02:37:51 | FromDiscord | <Rika> as expected |
02:37:54 | FromDiscord | <Rebel> for weeks... |
02:38:00 | FromDiscord | <Rebel> it's slowly chipping away at my sanity |
02:38:08 | FromDiscord | <shadow.> so then we just need to fix the expect thing? |
02:38:12 | FromDiscord | <shadow.> still don't know why that fails 1.0-1.2 |
02:38:21 | FromDiscord | <Rebel> ya boi has IL manipulation they need to do |
02:38:54 | FromDiscord | <Rika> man using they as a 1st person singular is weird lmao |
02:39:03 | FromDiscord | <shadow.> yeah lmao |
02:39:15 | FromDiscord | <shadow.> doesn't roll well |
02:39:26 | FromDiscord | <Rebel> this is what happens when your sanity has taken a dip |
02:39:26 | FromDiscord | <shadow.> obvi use whatever pronouns you'd like but in third person sounds kinda bumpy lol |
02:39:39 | FromDiscord | <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:41 | FromDiscord | <Rika> almost as weird as using name to refer to yourself |
02:39:42 | FromDiscord | <Rebel> I thought you said you could import export symbols 🤔 |
02:39:59 | FromDiscord | <Rebel> not recursive module dependency errors 😦 |
02:40:01 | FromDiscord | <Quibono> Should there be a code for it? |
02:40:12 | FromDiscord | <Rika> i dont get it lol |
02:40:17 | FromDiscord | <shadow.> `RangeDefect` i suppose, but that's a bit scuffed |
02:40:22 | FromDiscord | <shadow.> wdym by private url |
02:40:22 | disruptek | you got an http status code of 999. |
02:40:35 | FromDiscord | <shadow.> that makes sense |
02:40:35 | FromDiscord | <shadow.> lol |
02:40:39 | FromDiscord | <Rika> that would be odd |
02:40:42 | FromDiscord | <shadow.> i mean |
02:40:46 | FromDiscord | <Quibono> Why does that give a rangedefect tho? |
02:40:49 | disruptek | ask dom96 to right some unit tests so his shit might work some day. |
02:40:50 | FromDiscord | <Rika> what kinda noncompliant webserver returns 999 as a status code |
02:40:52 | FromDiscord | <shadow.> because its not in the range of accepted codes |
02:40:55 | FromDiscord | <shadow.> 0..599 |
02:41:01 | disruptek | write, too. |
02:41:02 | FromDiscord | <shadow.> lol |
02:41:13 | FromDiscord | <Quibono> Lol coursera |
02:41:19 | FromDiscord | <shadow.> urls behind passwords raise http status 999? |
02:41:21 | FromDiscord | <shadow.> thats news to me |
02:41:36 | FromDiscord | <Quibono> I tried to use a coursera url behind a password |
02:41:42 | FromDiscord | <shadow.> oh lord |
02:42:01 | FromDiscord | <shadow.> rly going all out on error testing huh lol |
02:42:11 | FromDiscord | <shadow.> like i said, if the user abuses that; |
02:42:18 | FromDiscord | <shadow.> (edit) "abuses that;" => "tries to mess it up on purpose" |
02:42:21 | FromDiscord | <shadow.> that should be their issue lol |
02:42:28 | FromDiscord | <shadow.> you don't needa completelyy idiot proof it |
02:42:43 | FromDiscord | <Quibono> Yes you do |
02:42:47 | FromDiscord | <Quibono> lol |
02:42:54 | FromDiscord | <Rebel> it has been pushed disruptek |
02:42:59 | FromDiscord | <Quibono> You used the word user shadow. |
02:43:02 | FromDiscord | <Quibono> That means idiot |
02:43:03 | FromDiscord | <Rebel> just need to figure out my error of why it's not compiling lol |
02:43:04 | FromDiscord | <Rika> why 999 and not 403? |
02:43:17 | FromDiscord | <Quibono> @Rika because coursera loves me? |
02:43:18 | FromDiscord | <shadow.> because 999 rolls off the tongue smoother, no? |
02:43:23 | FromDiscord | <Rika> lmao |
02:43:38 | FromDiscord | <Rebel> ` Error: undeclared identifier: 'tLock', This might be caused by a recursive module dependency:` |
02:43:42 | FromDiscord | <shadow.> oh lord |
02:43:50 | FromDiscord | <shadow.> recursive imports |
02:43:51 | FromDiscord | <Rika> what are you importing |
02:43:56 | FromDiscord | <Rebel> well |
02:44:01 | FromDiscord | <Rebel> tLock is defined in a different file |
02:44:03 | FromDiscord | <Rebel> I am exporting it |
02:44:05 | FromDiscord | <Rebel> and trying to import |
02:44:06 | FromDiscord | <Rebel> (edit) "and trying to import ... " added "it" |
02:44:19 | FromDiscord | <Rebel> `var tLock: Lock` |
02:44:39 | FromDiscord | <Rebel> I guess I could link the exact line if you want |
02:44:41 | FromDiscord | <Rika> do you import anything in the different file from the exporting file? |
02:44:42 | FromDiscord | <Rebel> might be easier to explain |
02:44:45 | * | cgfuh joined #nim |
02:44:52 | FromDiscord | <Rebel> no? |
02:44:59 | FromDiscord | <Rebel> I only import that symbol from the file |
02:45:04 | FromDiscord | <Rika> i mean in reverse sorry |
02:45:09 | FromDiscord | <Rebel> oh |
02:45:10 | FromDiscord | <Rebel> yes |
02:45:16 | FromDiscord | <Rika> different file importing the exporting file |
02:45:20 | FromDiscord | <Rebel> yes yes |
02:45:40 | FromDiscord | <Rebel> the file where tLock is declared imports procs from the file that imports the exported var tLock |
02:45:41 | FromDiscord | <Rika> thats messy haha gonna be a ride to fix |
02:46:17 | FromDiscord | <Rebel> https://tenor.com/view/oso-bear-care-bear-family-guy-suicide-gif-5667806 |
02:46:19 | * | cgfuh quit (Client Quit) |
02:46:43 | FromDiscord | <Quibono> Guys I've got a brilliant idea: We make a python implementation compiled in Nim. |
02:46:52 | FromDiscord | <Quibono> And then slowly change the syntax |
02:46:55 | FromDiscord | <Rebel> where is disruptek 😡 |
02:46:57 | FromDiscord | <Quibono> Until it's Nim |
02:46:59 | FromDiscord | <Quibono> Compiled in Nim |
02:47:19 | FromDiscord | <Rebel> you should check out vlang quibono you can see vlang compile vlang |
02:47:37 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#modules maybe read this section because i cant explain this well |
02:47:51 | FromDiscord | <Rika> i mean the nim compiler is in nim |
02:48:04 | FromDiscord | <Quibono> Rika exactly |
02:48:11 | FromDiscord | <Quibono> They'll all be secretly using Nim |
02:48:25 | FromDiscord | <shadow.> smart |
02:48:29 | FromDiscord | <Rebel> Yeah this is not going to be fun to solve |
02:48:34 | FromDiscord | <Rebel> maybe I should just move the lock in it's own file |
02:48:39 | FromDiscord | <shadow.> just comment out the line |
02:48:49 | FromDiscord | <Rika> yeah in nim the location of the import line is important 😛 |
02:48:52 | FromDiscord | <Rika> it gets messy |
02:49:35 | disruptek | pay me money and i'll teach you whatever you want to know about girls. |
02:49:49 | disruptek | maybe some info on threading will be thrown in, too. |
02:49:54 | disruptek | no promises. |
02:50:15 | FromDiscord | <Quibono> Women are a little bit like parallelism... |
02:50:19 | FromDiscord | <shadow.> oh lord |
02:50:25 | FromDiscord | <Rebel> I want to know how to solve my recursive module dependency |
02:50:25 | FromDiscord | <shadow.> where is this going |
02:50:28 | FromDiscord | <shadow.> it's fun to do more at once |
02:50:30 | FromDiscord | <shadow.> (edit) "once" => "once?" |
02:50:40 | FromDiscord | <shadow.> that's my guess |
02:50:43 | disruptek | one at a time is good, two at a time is better. |
02:50:50 | FromDiscord | <Quibono> I meant confusing and liable to cause race conditions, but sure. |
02:50:50 | FromDiscord | <shadow.> ah there we go |
02:50:59 | FromDiscord | <shadow.> i like our version better |
02:51:33 | FromDiscord | <Rika> i wonder when will the software people start changing "race conditions" to "more inclusive language" |
02:51:41 | FromDiscord | <Rebel> um |
02:51:48 | FromDiscord | <Rebel> should check out twitter |
02:51:54 | FromDiscord | <Rika> no thank you |
02:52:30 | FromDiscord | <Rebel> https://twitter.com/TwitterEng/status/1278733305190342656 |
02:52:33 | FromDiscord | <Rebel> too late 😛 |
02:54:22 | FromDiscord | <Rebel> wait is this not how you import vars declared in a separate file? `from ../utils/job import tLock` |
02:55:15 | FromDiscord | <Rika> i mean it is |
02:55:37 | FromDiscord | <Rika> its just that if it hits another import itll go to that file |
02:55:59 | FromDiscord | <Rebel> oh fiddlesticks |
02:56:06 | FromDiscord | <Rebel> this is quite the conundrum |
02:56:35 | FromDiscord | <Rebel> I want to move onto the funner things like CLR Hosting and a wrapper for memorymodule not this jank threading solution |
03:03:38 | FromDiscord | <shadow.> who's sticks are we fiddling |
03:03:42 | FromDiscord | <shadow.> (edit) "who's" => "whose" |
03:04:10 | FromDiscord | <Rebel> whelp in the meantime guess it's time to learn mono.cecil |
03:04:27 | FromDiscord | <Rebel> Would prefer dnlib but it just archived so F |
03:05:47 | FromDiscord | <Rebel> fun IL manipulation to do fun things to assemblies 😈 |
03:06:39 | disruptek | it's hard to run when you can't even walk. |
03:08:14 | FromDiscord | <Rebel> .... |
03:08:22 | FromDiscord | <Rebel> thanks Descartes |
03:12:33 | FromDiscord | <Rebel> I guess there is always plan D |
03:12:51 | * | mbomba quit (Quit: WeeChat 3.0) |
03:13:06 | disruptek | correspondence classes and try to get your GED? |
03:13:43 | FromDiscord | <Rebel> no just archive it and remove the feature lol |
03:13:46 | FromDiscord | <Rebel> work on other things |
03:13:50 | FromDiscord | <Rebel> and maybe come back to it |
03:13:56 | FromDiscord | <Rebel> I don't get paid enough to deal with this |
03:14:20 | disruptek | i'm with you. |
03:14:23 | disruptek | threads are for nerds. |
03:14:36 | * | muffindrake quit (Ping timeout: 258 seconds) |
03:16:39 | * | muffindrake joined #nim |
03:17:15 | FromDiscord | <Rebel> true 😦 |
03:17:33 | FromDiscord | <Rebel> I guess I could just not import the lock |
03:17:37 | FromDiscord | <Rebel> and hope it works |
03:18:20 | FromDiscord | <Rebel> what's the worse that could happen |
03:19:19 | FromDiscord | <Rebel> in theory only one thread would be accessing that table at all times so there should be no race condition 🤔 |
03:19:37 | FromDiscord | <Rebel> unless I'm being smoothbrained right now |
03:21:21 | FromDiscord | <Rebel> right disruptek? isn't that the motto just yolo commit and push to prod 😄 |
03:21:32 | disruptek | i just delete anything i don't understand. |
03:22:20 | FromDiscord | <Rebel> well riddle me this if only one thread is accessing the table there would be no race condition right? |
03:22:36 | disruptek | it'd be a very long race. |
03:22:44 | FromDiscord | <Rebel> Do I really need that lock? |
03:23:06 | disruptek | if only one thread accesses it, why would i have told you to build it that way? |
03:23:25 | voltist | If I have a seq of `ref T`, how can I add a traced reference to an object of type T to it? |
03:23:33 | FromDiscord | <Rebel> wait what? |
03:23:36 | FromDiscord | <Rebel> I don't understand |
03:23:46 | FromDiscord | <Rebel> because it's the easiest solution? |
03:23:46 | disruptek | s.add new (ref T)(some: field, values: here) |
03:23:52 | disruptek | er, omit `new`. |
03:24:03 | disruptek | rebel: because you should have two threads accessing it. |
03:24:17 | disruptek | one where you do async bullshit and another where you do your keylogging. |
03:24:38 | FromDiscord | <Rebel> well how do you import the lock then? |
03:24:39 | disruptek | i can't spend the whole evening explaining this again, though. |
03:24:42 | disruptek | i have porn to watch. |
03:24:48 | FromDiscord | <Rebel> hentai? |
03:24:57 | disruptek | nah, interracial. |
03:24:59 | voltist | disruptek: 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:10 | disruptek | that's not a thing. |
03:25:14 | FromDiscord | <Rebel> it's fine lol I don't need you to explain it again I'm not touching it tonight anymore |
03:25:19 | disruptek | cool. |
03:25:31 | FromDiscord | <Rebel> I don't know if I would call it cool |
03:25:32 | Prestige | disruptek: interracial, was that the race condition? |
03:25:42 | disruptek | let x = (ref T)(); x[] = obj; s.add x |
03:25:45 | FromDiscord | <Rebel> well I guess IL manipulation is cool |
03:25:55 | disruptek | Prestige: smart cookie. |
03:26:38 | voltist | Oh cool thanks |
03:26:50 | disruptek | voltist: meet nim halfway -- give it a ref to manage. 😉 |
03:29:33 | voltist | disruptek: Yeah, makes a bit more sense |
03:30:23 | ForumUpdaterBot | New thread by Ggibson: Fusion/SharedPtr why []= sig undefined?, see https://forum.nim-lang.org/t/7234 |
03:30:32 | disruptek | if you had to choose packages to add to a nim distribution, what would you include? |
03:31:17 | voltist | Like existing but non-standard-library packages? |
03:31:39 | disruptek | yeah. |
03:31:58 | voltist | ggplotnim and jester would be my choices |
03:32:08 | voltist | Oh and arraymancer |
03:32:42 | disruptek | imagine 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:55 | disruptek | that's a pretty weak list. |
03:52:54 | voltist | It just happens to be what I use |
03:53:21 | voltist | Probably not the typical nim user's needs |
04:04:49 | FromDiscord | <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:38 | disruptek | of course. |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:34 | * | supakeen joined #nim |
04:07:00 | FromDiscord | <shadow.> alr ill take a look |
04:09:16 | FromDiscord | <shadow.> unhandled os error |
04:09:24 | FromDiscord | <shadow.> the template isnt catching it? |
04:10:46 | * | spiderstew quit (Ping timeout: 256 seconds) |
04:11:41 | * | spiderstew joined #nim |
04:13:16 | FromDiscord | <shadow.> i dont see how that'd change between versions 1.2 and 1.4 |
04:14:04 | disruptek | i wish there was some way to test it locally. |
04:14:42 | FromDiscord | <shadow.> im too lazy to get a nim version control handler |
04:14:54 | FromDiscord | <shadow.> im also not around my pc rn, ill massage your testes tmr |
04:15:03 | disruptek | aight. |
04:15:24 | FromDiscord | <shadow.> i mean if you have nim 1.0 you could always test it |
04:15:29 | FromDiscord | <shadow.> wink emoji |
04:16:02 | disruptek | i'll wait. |
04:17:00 | FromDiscord | <shadow.> you don't like touching your own testes? |
04:17:17 | FromDiscord | <shadow.> what do you do when you watch your interracial, eat popcorn? |
04:17:37 | disruptek | junior mints and milk duds. |
04:17:42 | FromDiscord | <Esbeesy> You know waking up at 4am, I thought “I wonder if the nim Discord is active” |
04:17:50 | FromDiscord | <shadow.> always. |
04:17:55 | FromDiscord | <Esbeesy> Walked straight into disrupteks testes |
04:18:02 | disruptek | and not for the last time. |
04:18:24 | FromDiscord | <Esbeesy> They do have a welcome warmth, I must admit |
04:18:56 | disruptek | i have the best package. |
04:19:52 | FromDiscord | <shadow.> esbeesy what was your solution for aoc today? |
04:23:31 | FromDiscord | <Esbeesy> Day 9? |
04:23:36 | FromDiscord | <shadow.> ye |
04:23:55 | FromDiscord | <shadow.> we can compare, im interested to see how others did it |
04:24:20 | FromDiscord | <Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day9/day9.nim |
04:24:31 | FromDiscord | <shadow.> ohh ok |
04:24:39 | FromDiscord | <shadow.> !repo shadowninja55/aoc-2020 |
04:24:40 | disbot | https://github.com/shadowninja55/aoc-2020 -- 9aoc-2020: 11my attempt at advent of code 2020 in nim. 15 1⭐ 0🍴 |
04:24:42 | FromDiscord | <Daniel> Areas in brain of a woman is not interconnected the same way as a brain of a man. |
04:24:54 | FromDiscord | <Daniel> (edit) "is" => "are" |
04:24:56 | FromDiscord | <Esbeesy> Need to get into that repo bot |
04:25:25 | disruptek | fun fact: the bot doesn't compile right now due to nimterop. |
04:25:59 | FromDiscord | <shadow.> wow, your solution's pretty clean |
04:27:31 | disruptek | block found: for number in preamble: if nextNumber - number in preamble: break found |
04:27:58 | disruptek | omit continue. just fucking strike it from your vocabulary. |
04:28:17 | disruptek | use named break versus temporary booleans. |
04:28:17 | FromDiscord | <ElegantBeef> ^ |
04:30:01 | * | mbomba joined #nim |
04:30:33 | FromDiscord | <Esbeesy> Ha what’s wrong with continue? Does it fuck with nims optimiser? |
04:30:42 | FromDiscord | <ElegantBeef> It's just silly |
04:30:45 | disruptek | it fucks with the reader. |
04:30:54 | disruptek | just use dominating conditionals. |
04:30:57 | FromDiscord | <ElegantBeef> Especially since you can do better |
04:31:20 | FromDiscord | <ElegantBeef> you can do `for n in numbers.toOpenArray(25,numbers.high)` |
04:31:47 | FromDiscord | <ElegantBeef> Or even my method 😄 https://play.nim-lang.org/#ix=2HnA |
04:32:49 | disruptek | use more newlines after : |
04:33:44 | disruptek | use named break. 😉 |
04:35:13 | FromDiscord | <ElegantBeef> If that's to me i have 0 clue where i'd |
04:35:33 | disruptek | anyFound. |
04:35:39 | FromDiscord | <Esbeesy> Yeah so I didn’t know about named break until just now, definitely@could have saved 7 lines there |
04:36:19 | disruptek | araq would say, "continue is lazy control-flow." |
04:37:48 | disruptek | for findErrorRangeSum() i would like to see an explicit `result = 0` at the end of the proc. |
04:40:26 | disruptek | if ...: ... is tolerated in the compiler but i think it's obnoxious. too hard to intuit at a glance. |
04:40:45 | disruptek | i want newlines. i want to see the structure. |
04:40:55 | disruptek | just my opinions. |
04:41:00 | FromDiscord | <ElegantBeef> It's one of the few things i retain from C# 😄 |
04:41:13 | disruptek | i mean, araq does it. i don't like it. |
04:41:27 | FromDiscord | <Esbeesy> “C# PTSD triggered” |
04:41:57 | FromDiscord | <Esbeesy> 4 level nested Ternary operators |
04:42:28 | FromDiscord | <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:31 | disruptek | it's like... just because you /can/, doesn't mean you /should/. |
04:44:19 | FromDiscord | <ElegantBeef> well nim's wrapnils allows you to do the same but you just use `?` once |
04:44:33 | FromDiscord | <ElegantBeef> `?.long.ass.proc.call.chain` |
04:44:35 | disruptek | what a dumb addition. i've never, ever seen it used. ever. |
04:44:42 | FromDiscord | <Esbeesy> Same |
04:44:46 | FromDiscord | <ElegantBeef> Triple same |
04:45:19 | disruptek | waste of a perfectly useful operator. |
04:45:32 | FromDiscord | <Esbeesy> Go also has “nil” but the language stops it from jumping out at you in dark alleys |
04:45:45 | FromDiscord | <ElegantBeef> It also doesnt have gnerics |
04:45:46 | FromDiscord | <ElegantBeef> (edit) "gnerics" => "generics" |
04:46:02 | disruptek | they are getting generics and we are getting notnil, so it's a wash. |
04:46:06 | FromDiscord | <Esbeesy> Doesn’t need them, but it will have them in 1.18 anyway |
04:49:46 | FromDiscord | <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:56 | FromDiscord | <Esbeesy> I clearly had no experience with nim lmao |
04:50:13 | disruptek | you should test the old code with and without arc. |
04:50:39 | FromDiscord | <shadow.> and -d:danger -d:lto |
04:51:11 | FromDiscord | <Esbeesy> Okay so interested pique’d, you guys might be interested in this |
04:51:34 | FromDiscord | <Esbeesy> I wrote the nim code to be actually, legible, perf was the same |
04:51:59 | FromDiscord | <Esbeesy> Rust: 600ms↵Go: 980 ms↵Nim: 1500ms |
04:52:14 | FromDiscord | <Esbeesy> Then I started doing the danger, gc:none |
04:52:32 | FromDiscord | <Esbeesy> (Side note, Didn’t use lto yet, what is that?) |
04:52:40 | FromDiscord | <Esbeesy> Got Nim down to 920ms |
04:53:19 | FromDiscord | <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:14 | FromDiscord | <Esbeesy> I mean, it is well written now, and I wrote it 4 different ways, and the perf didn’t change once |
04:54:23 | FromDiscord | <Esbeesy> Nims optimiser is fantastic |
04:54:44 | FromDiscord | <ElegantBeef> Can we see the nim code? |
04:54:50 | disruptek | sounds like your code isn't very good. |
04:55:26 | FromDiscord | <Esbeesy> Hear me out: |
04:55:43 | mipri | don't worry too much about what disruptek says |
04:55:50 | FromDiscord | <Esbeesy> Nimprof shows 62% of the time is spent in the parseCsv’s parseField method |
04:56:03 | disruptek | ignore nimprof. |
04:56:14 | disruptek | only perf counts. |
04:56:48 | FromDiscord | <Esbeesy> Wat |
04:56:58 | FromDiscord | <Esbeesy> How do you profile performance in nim? |
04:57:39 | FromDiscord | <ElegantBeef> `cpuTime` 😛 |
04:59:09 | * | mbomba quit (Quit: WeeChat 3.0) |
04:59:45 | FromDiscord | <j-james> alright day ten time |
05:00:54 | disruptek | !repo perf |
05:00:55 | disbot | https://github.com/dfdeshom/nim_log_perf -- 9nim_log_perf: 11 15 0⭐ 0🍴 |
05:01:00 | disruptek | uh, no. |
05:01:06 | FromDiscord | <Esbeesy> Lmao |
05:01:43 | disruptek | https://perf.wiki.kernel.org/index.php/Main_Page |
05:02:46 | FromDiscord | <Esbeesy> cries in Windows |
05:03:17 | disruptek | as the kids say, `rip.` |
05:03:17 | FromDiscord | <Esbeesy> Really should set up WSL but tres effort |
05:03:46 | disruptek | so where is the code? |
05:03:58 | disruptek | ignore mipri; it sucks. |
05:10:26 | FromDiscord | <Rika> Lol |
05:10:46 | FromDiscord | <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:00 | FromDiscord | <Esbeesy> I’ll send the code when I’m up shortly though 😂 |
05:12:33 | * | NimBot joined #nim |
05:18:17 | FromDiscord | <Rika> Sorry was just peeking in your house didn't mean to disturb your dog |
05:19:20 | * | vicfred quit (Quit: Leaving) |
05:20:07 | disruptek | it's okay; i was awake. |
05:24:04 | FromDiscord | <Cypheriel> So what exactly is the deal with the VSCode extension? How come the last update was 9 months ago? |
05:24:56 | FromDiscord | <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:26 | disruptek | that's what my mom says, too. |
05:25:35 | FromDiscord | <Cypheriel> ._. |
05:25:56 | FromDiscord | <Esbeesy> I think it’s okay? Tried the IntelliJ one and the code one was better |
05:26:19 | FromDiscord | <Esbeesy> Its not using LSP though I don’t think? |
05:26:39 | FromDiscord | <Cypheriel> I don't really know the difference, I don't have access to the LSP one |
05:26:50 | FromDiscord | <Cypheriel> but I mean it feels like it's still unfinished |
05:34:41 | FromDiscord | <Cypheriel> I mean, I also noticed that the Jetbrains Nim plugin updated pretty recently |
05:35:00 | FromDiscord | <Cypheriel> so I was just a little confused as to why not much was happening on the VSCode side |
05:35:16 | FromDiscord | <Esbeesy> What features do you mean exactly? |
05:35:41 | FromDiscord | <Cypheriel> Not necessarily features, but I have noticed some weird fake errors and things like that |
05:36:39 | FromDiscord | <Rebel> can the guy who made nimsuggest extension learn to optimize better that shit eats up my CPU 😦 |
05:36:49 | FromDiscord | <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:16 | FromDiscord | <Rebel> why do you have Karl Marx as your pfp? 🤔 |
05:37:20 | disruptek | nimsuggest is basically the compiler. |
05:37:23 | FromDiscord | <Rebel> were you part of the recent FireEye hack.... |
05:37:53 | FromDiscord | <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:09 | FromDiscord | <Cypheriel> but even with 100% fine code, sometimes there will be weird errors |
05:38:26 | FromDiscord | <Cypheriel> not to mention, you only get to see new errors whenever you save your code |
05:39:08 | FromDiscord | <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:07 | FromDiscord | <j-james> Refactoring is also shakey |
05:43:21 | FromDiscord | <Cypheriel> It's kind of gotten to the point where the only real reliable thing from the extension is the syntax highlighting |
05:44:12 | FromDiscord | <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:03 | FromDiscord | <Esbeesy> I’m a bearded commie bastard is why 😂 |
05:54:01 | FromDiscord | <Esbeesy> I’ve noticed it goes booloo if you start using channels |
05:54:27 | FromDiscord | <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:11 | FromDiscord | <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:32 | FromDiscord | <Esbeesy> But still, there’s always room for improvement with anything |
05:55:39 | FromDiscord | <Rebel> I don't know if it's always quick to debug lol |
05:56:02 | FromDiscord | <Rebel> Nothing compared to having tools like pycharm's debugger |
05:56:09 | FromDiscord | <Esbeesy> !repo nimlsp |
05:56:09 | disbot | https://github.com/PMunch/nimlsp -- 9nimlsp: 11Language Server Protocol implementation for Nim 15 169⭐ 18🍴 |
05:56:29 | FromDiscord | <Cypheriel> So what exactly is this LSP? |
05:56:43 | FromDiscord | <Esbeesy> PMunch frequents here, they can probably add more to the conversation than just our whining 😂 |
05:56:51 | FromDiscord | <Esbeesy> Language Server Protocol |
05:57:39 | FromDiscord | <Esbeesy> https://microsoft.github.io/language-server-protocol/ |
05:57:41 | FromDiscord | <Cypheriel> Do I just install it and reload VSCodium? |
05:58:03 | FromDiscord | <Esbeesy> One of the rare times M$ has given more than it’s taken |
05:58:50 | FromDiscord | <Esbeesy> Not sure Cypher, I think the Code extension needs code to actually point at it |
05:59:01 | FromDiscord | <Cypheriel> Oh there's a whole setup section |
05:59:29 | FromDiscord | <Cypheriel> but of course there's no section for VSCode lol |
06:00:05 | FromDiscord | <Esbeesy> Lmao yeah |
06:01:28 | FromDiscord | <Esbeesy> For me the biggest feature would be auto-imports |
06:02:05 | FromDiscord | <Esbeesy> Like you type in scanf and it auto slaps in import strscans |
06:02:33 | FromDiscord | <Cypheriel> ohh, how cool |
06:02:41 | disruptek | i hate you. |
06:02:53 | FromDiscord | <Cypheriel> oh my |
06:03:49 | FromDiscord | <Esbeesy> lmao love you too |
06:06:27 | FromDiscord | <Rebel> I think you were taking care of interracial business disruptek? 🤔 |
06:06:37 | disruptek | there'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:38 | FromDiscord | <Cypheriel> so maybe I shouldn't use PyCharm + LSP |
06:13:47 | disruptek | lsp is for chumps. |
06:13:57 | disruptek | real nimions use nvim. |
06:14:12 | FromDiscord | <Cypheriel> I hovered over the `strscans` in `import strscans` and my entire screen was filled with the documentation |
06:15:00 | FromDiscord | <Esbeesy> I do use neovim actually for quick text editing tasks, just not comfortable enough with it to be `zen` |
06:15:13 | FromDiscord | <nikki> my text editor inserts the documentation of functions and modules i use, into my code |
06:15:24 | FromDiscord | <nikki> so i don't need to hover again |
06:15:48 | FromDiscord | <Cypheriel> I might try neovim, Nim might give me an excuse to learn it |
06:16:04 | disruptek | try simply remembering what things are instead. |
06:16:07 | disruptek | might be easier. |
06:16:10 | FromDiscord | <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:34 | FromDiscord | <Cypheriel> also I hovered over it because it was underlined in red |
06:16:52 | FromDiscord | <nikki> vim8 just works |
06:17:00 | FromDiscord | <Esbeesy> Vim M8 |
06:17:05 | FromDiscord | <Cypheriel> I'm trying to take a screenshot but it won't upload :( |
06:17:07 | FromDiscord | <nikki> but broken things are more fun |
06:17:16 | FromDiscord | <Rika> vi m8 |
06:18:34 | FromDiscord | <Esbeesy> Holy - What is that --d:lto option? |
06:18:49 | disruptek | link-time optimization. |
06:19:15 | FromDiscord | <nikki> build-time pessimization |
06:19:49 | disruptek | it smells like vomit in here, but my shirt is dry. curious. |
06:20:09 | disruptek | ah, it's on my pants. |
06:20:54 | FromDiscord | <Cypheriel> oh my |
06:21:01 | FromDiscord | <Esbeesy> Well it just took the CSV parser down to 790-800 ms which is shweet |
06:21:17 | disruptek | let's see this shitty code. |
06:21:24 | FromDiscord | <Esbeesy> Just making a gist now |
06:21:28 | FromDiscord | <Esbeesy> Broke my Rust compiler haha |
06:21:34 | disruptek | oh, i think i get the gist. |
06:21:47 | FromDiscord | <Cypheriel> was that supposed to be a pun |
06:22:19 | disruptek | do you think i cannot find you? |
06:24:12 | * | clemens3_ joined #nim |
06:24:51 | FromDiscord | <Cypheriel> Do you think you can find me? |
06:25:10 | FromDiscord | <Rebel> did you like my hot code disruptek? or was it shitty 😦 |
06:25:12 | disruptek | don't you think it's odd that yardanico hasn't been seen in ages? |
06:25:43 | disruptek | rebel: 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:00 | FromDiscord | <Rebel> ouch |
06:26:10 | FromDiscord | <Rebel> what happened to never giving up |
06:26:17 | disruptek | that's for kids. |
06:26:33 | disruptek | you don't get participation trophies in #nim. |
06:26:48 | FromDiscord | <Rebel> What do I get? 🤔 |
06:27:03 | FromDiscord | <Rebel> 🏅 |
06:28:26 | disruptek | i'll have to ask zevv if we can afford to give you a green square. |
06:29:24 | FromDiscord | <Rebel> what does that mean? |
06:29:32 | FromDiscord | <Rebel> Like how you can name a star after yourself? |
06:29:47 | disruptek | i dunno, but people do it all the time. |
06:29:48 | FromDiscord | <Rebel> tell me what do the numbers mean |
06:30:07 | disruptek | i had a star named after me, but that was many aliases ago. |
06:34:14 | FromDiscord | <Esbeesy> Wow okay so - latest rust 1.48, build time optimisations, it's actually ~800, identical to Nim |
06:34:41 | FromDiscord | <Esbeesy> Friendship ended with Rust too now I guess, all in on Nim 😂 |
06:34:58 | FromDiscord | <Cypheriel> So does that mean Rust bad or Nim good |
06:34:59 | disruptek | rust has never been friendly. |
06:35:15 | FromDiscord | <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:26 | FromDiscord | <Esbeesy> saying that, I never found Nim's LTO flag until you guys told me |
06:35:52 | disruptek | --panics:on |
06:36:03 | FromDiscord | <nikki> disruptek, how do you feel about rust |
06:36:06 | FromDiscord | <Esbeesy> https://gist.github.com/sambeckingham/130928307835ce5e8bafa29806e124b2 |
06:36:16 | disruptek | i'm in favor of anything that pays my bills. |
06:36:26 | FromDiscord | <Esbeesy> Strong agree ^ |
06:36:43 | * | thomasross quit (Ping timeout: 260 seconds) |
06:36:44 | FromDiscord | <nikki> do you like nim more than that |
06:36:55 | FromDiscord | <nikki> i would guess so |
06:36:58 | FromDiscord | <Esbeesy> Although I've had it with .NET, underpaid for the amount of work you need to work with it |
06:37:17 | disruptek | there's a lot to like about rust, but i'm most impressed by the tooling. |
06:37:25 | FromDiscord | <Cypheriel> C# and etc don't sound fun at all, honestly |
06:37:31 | disruptek | sam, i need the data. |
06:37:40 | FromDiscord | <nikki> i did asp.net mvc for a bit and it was aite |
06:37:42 | FromDiscord | <Esbeesy> Yes you do |
06:37:44 | FromDiscord | <Esbeesy> One sec |
06:37:59 | disruptek | c# is pretty good, imo. |
06:38:01 | FromDiscord | <nikki> what do you like about rust tooling disruptek |
06:38:03 | FromDiscord | <nikki> any examples |
06:38:16 | disruptek | lolbench has been most inspirational. |
06:38:20 | FromDiscord | <Esbeesy> "rustup" and away you go |
06:38:27 | disruptek | cargo is the best of the worst package managers i've used. |
06:38:40 | disruptek | servo. |
06:38:59 | FromDiscord | <Esbeesy> Serde is also obscenely fast |
06:39:04 | disruptek | this is stuff that we need and i just haven't made it a priority to build it. |
06:39:07 | FromDiscord | <nikki> nice i know the lolbench author personally / have worked with |
06:39:19 | disruptek | well, i did build nimph, but no one uses it. |
06:39:37 | disruptek | i have a thing that will blow lolbench away. |
06:39:46 | FromDiscord | <nikki> oho |
06:40:10 | * | habamax joined #nim |
06:40:23 | disruptek | as usual, my reach exceeds my grasp. |
06:40:24 | FromDiscord | <Rebel> if you think that level of optimization is crazy should how this person shrank a C# binary to under 8 kilobytes |
06:40:30 | FromDiscord | <Rebel> (edit) "if you think that level of optimization is crazy should ... how" added "read" |
06:40:52 | FromDiscord | <Esbeesy> Oh fuck I read that 😂 Way too much time |
06:41:02 | FromDiscord | <Rebel> 65 megabytes to 8 kilobytes 😄 fun stuff |
06:41:50 | FromDiscord | <Esbeesy> Worst part is the dotBoomer squad at work used it to justify how C# is "the best" |
06:42:06 | FromDiscord | <Rebel> I mean C# is pretty hot |
06:42:07 | FromDiscord | <Esbeesy> Like any of their smooth brains had the capacity to do the same |
06:42:10 | FromDiscord | <Rebel> especially with release of .net core |
06:42:13 | FromDiscord | <nikki> on disk |
06:42:19 | FromDiscord | <nikki> but what about in memory 😮 |
06:42:22 | FromDiscord | <Rebel> Really depends on what you are trying to do |
06:42:34 | FromDiscord | <Rebel> you can execute C# .NET assemblies in memory?? |
06:42:39 | FromDiscord | <Rebel> just host the CLR in C# |
06:42:44 | FromDiscord | <Esbeesy> As someone who's worked with it professionally for 6+ years: It's not that good |
06:42:50 | FromDiscord | <nikki> c# has a pretty fast interpreter for ios |
06:42:53 | FromDiscord | <Esbeesy> @disruptek: https://easyupload.io/ruj7bb |
06:42:56 | FromDiscord | <Rebel> reflective DLL in C++ that hosts the CLR to load your .NET assembly in memory |
06:43:15 | FromDiscord | <Rebel> you can't just say it's not that good and not expand... |
06:43:17 | FromDiscord | <nikki> ios can't jit, and it's pretty fast + you can use mixed aot and interpreted code |
06:43:29 | FromDiscord | <Rebel> check out coreRT runtime for hot AOT action |
06:45:34 | FromDiscord | <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:50 | FromDiscord | <Esbeesy> async/await poisons your code base |
06:45:55 | FromDiscord | <Esbeesy> Fuck nulls, just fuck em |
06:46:18 | * | a_chou joined #nim |
06:46:36 | FromDiscord | <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:18 | FromDiscord | <nikki> an issue for me is also--- mark and sweep and ref types evrrywhere |
06:47:26 | FromDiscord | <nikki> but; they do have more valuey things for sure |
06:48:09 | FromDiscord | <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:36 | FromDiscord | <Rebel> I mean C# is pretty dank to write red team tools in |
06:48:53 | FromDiscord | <Rebel> What do you mean by enterprise value |
06:49:25 | FromDiscord | <Esbeesy> .NET's origins are squarely in providing plentiful resources to enterprise |
06:49:33 | FromDiscord | <Rebel> So you're mad they also have standard factory models for standards like async/await, and tasks? |
06:50:15 | FromDiscord | <Rebel> Well not mad but have gripes |
06:50:23 | FromDiscord | <Esbeesy> I'm not mad they have them - In fact I'm not mad, these are just observations from exposure over years |
06:50:30 | FromDiscord | <nikki> yeah it was a response to java / sun i think? |
06:50:35 | FromDiscord | <Esbeesy> Yes |
06:51:10 | FromDiscord | <nikki> vm / gc was a vibe |
06:51:15 | FromDiscord | <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:23 | FromDiscord | <Esbeesy> Because cloud computing is now where the money is |
06:52:04 | FromDiscord | <nikki> they get used a bit for gamedev |
06:52:04 | FromDiscord | <Rebel> Can you blame them? Azure ad is becoming much more common so it's def working lol |
06:52:12 | FromDiscord | <nikki> and by a bit, i mean quite a bit. haha |
06:52:13 | FromDiscord | <Rebel> They probably also make bank on msatp |
06:52:28 | disruptek | it will take me more than 30mins to download this csv file. |
06:52:43 | FromDiscord | <nikki> i mean. yes? because one is responsible for their own decisions even when made in accordance with the market |
06:52:52 | disruptek | i mean, if my network would stay connected. |
06:53:04 | FromDiscord | <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:09 | FromDiscord | <Esbeesy> (edit) "houses?"" => "house"?" |
06:53:24 | FromDiscord | <nikki> that sounds like the kinda party we all wanna be at in the 90s |
06:53:29 | FromDiscord | <Esbeesy> disRIPtek |
06:53:47 | FromDiscord | <Cypheriel> C# D: |
06:53:47 | FromDiscord | <Esbeesy> Panic is over anyway disrup, Nim is as fast if not slightly faster 😂 |
06:53:58 | FromDiscord | <Cypheriel> C# is why I can't have ShareX on Linux >:( |
06:54:06 | FromDiscord | <Esbeesy> Ah fuck ShareX is so good innit |
06:54:24 | FromDiscord | <Cypheriel> I love it.. when I can use it :c |
06:54:50 | FromDiscord | <Rebel> Have you played around with V? |
06:54:53 | FromDiscord | <Esbeesy> yes! |
06:55:00 | FromDiscord | <Rebel> 👀 |
06:55:00 | FromDiscord | <Esbeesy> I've actually contributed to the CSV library lmao |
06:55:09 | FromDiscord | <Esbeesy> Because doing those benchmarks I discovered a bug |
06:55:22 | FromDiscord | <Rebel> Dam that's cool |
06:55:24 | disruptek | please zip it up. i can't even download it. |
06:55:32 | FromDiscord | <Esbeesy> lmao, one sec |
06:55:48 | FromDiscord | <Rebel> His bandwidth is too constrained by other vices |
06:57:17 | FromDiscord | <Esbeesy> 7z okay disrup? |
06:57:21 | disruptek | yeah. |
06:57:45 | FromDiscord | <Esbeesy> ls |
06:57:47 | FromDiscord | <Esbeesy> fuck |
06:58:04 | disruptek | itym `fsck` |
06:58:19 | disruptek | oh it's going now, baby. |
06:58:36 | disruptek | i just sent all my tcp acks ahead of time. |
06:58:39 | disruptek | this is way faster. |
06:58:51 | FromDiscord | <Esbeesy> https://easyupload.io/zjsdks |
06:59:15 | disruptek | thanks. |
06:59:44 | disruptek | there had better be porn in here. |
06:59:46 | FromDiscord | <Esbeesy> 17% of the size haha |
06:59:59 | disruptek | a least a naked pic of your feet or something. |
07:00:02 | FromDiscord | <Esbeesy> Unless you get off to comma delimited market reports, there is not |
07:00:09 | FromDiscord | <Rebel> Well at least now MSFT has a unified vision for the purpose and goal of .NET :) |
07:00:32 | FromDiscord | <Rebel> My final thought on that lol |
07:00:45 | FromDiscord | <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:09 | disruptek | what kinda cpu do you have? |
07:01:19 | FromDiscord | <Esbeesy> uh... i7-8700 iirc |
07:01:26 | disruptek | hmm. |
07:01:49 | disruptek | Linux 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:57 | FromDiscord | <Esbeesy> lmao I really need to up that RAM a bit https://media.discordapp.net/attachments/371759389889003532/786487851130814534/unknown.png |
07:02:07 | disruptek | ┌────────┬──────────┬──────────┬──────────┬──────────┐ |
07:02:09 | disruptek | │ Runs │ Min │ Max │ Mean │ StdDev │ |
07:02:12 | disruptek | ├────────┼──────────┼──────────┼──────────┼──────────┤ |
07:02:15 | disruptek | │ 89 │ 0.604797 │ 1.170178 │ 0.645162 │ 0.072612 │ |
07:02:18 | disruptek | └────────┴──────────┴──────────┴──────────┴──────────┘ |
07:02:25 | FromDiscord | <Esbeesy> Is that Nim? Nice |
07:02:44 | FromDiscord | <Cypheriel> jeez that looks so bad without monospace |
07:02:54 | FromDiscord | <Esbeesy> Innit 😂 Bet it looks boss in IRC though |
07:03:10 | FromDiscord | <Esbeesy> sent a code paste, see https://play.nim-lang.org/#ix=2Ho8 |
07:03:15 | FromDiscord | <Cypheriel> I was literally just doing that lol |
07:03:24 | disruptek | well, i discover the header position and then parse parser.row[i] directly. |
07:03:42 | FromDiscord | <Esbeesy> Wait let me show you the other 3 solutions |
07:04:31 | FromDiscord | <Esbeesy> 2 solutions, think I deleted one |
07:04:32 | FromDiscord | <Esbeesy> http://ix.io/2Hob |
07:04:45 | disruptek | gc:none is slower than arc. |
07:05:06 | FromDiscord | <Esbeesy> I found Orc to be near none, and Arc to be slower, maybe a windows thing? |
07:05:24 | disruptek | i'd be surprised. |
07:05:37 | disruptek | who knows how optimal the parser is, though. |
07:05:48 | FromDiscord | <Rebel> why did you choose Nim over V? |
07:05:51 | disruptek | i thought you might be doing something interesting, but... there's not much room to work. |
07:06:09 | disruptek | v brings nothing to the table. |
07:06:30 | FromDiscord | <Esbeesy> Yeah that's kind of the point, to really keep it bare bones, core library |
07:06:53 | FromDiscord | <Cypheriel> What's `V`, again? |
07:06:56 | FromDiscord | <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:02 | FromDiscord | <Esbeesy> https://vlang.io/ |
07:07:14 | FromDiscord | <Esbeesy> V is like.. "Go done right" |
07:07:27 | disruptek | i 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:30 | FromDiscord | <Esbeesy> Well, that's what they claim anyway haha |
07:07:32 | FromDiscord | <Cypheriel> Ohh, how interesting |
07:07:45 | FromDiscord | <Esbeesy> It's actually pretty cool |
07:07:55 | disruptek | zig is interesting. v is a joke. a bad joke. |
07:08:28 | FromDiscord | <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:41 | FromDiscord | <Esbeesy> Like, obtaining world peace levels of grandiosity |
07:10:16 | FromDiscord | <Esbeesy> Also I stopped using V after I updated and he'd refactored the language to use var instead of mut |
07:10:18 | FromDiscord | <Esbeesy> or the other way around |
07:10:30 | FromDiscord | <Esbeesy> either way it fucked up all my code and I was like "Cba" with this! |
07:10:55 | FromDiscord | <Esbeesy> @Rebel I'm only using Nim now for AoC, but it's quickly becoming my favourite language 😂 |
07:11:23 | FromDiscord | <Cypheriel> So many programming languages have names so unoriginal that you literally have to append `lang` to everything |
07:11:55 | FromDiscord | <Rebel> hehe ever heard of Red? They have funny stuff in the wiki about avs flagging Red code. |
07:12:10 | FromDiscord | <Rebel> Guess V is not the next language I will be using for a project 😦 |
07:12:14 | FromDiscord | <Rebel> was between V, Zig, and Red |
07:12:49 | FromDiscord | <Cypheriel> Lord. why would you name a programming language "Red" or "V" or flippin "Julia" |
07:13:10 | FromDiscord | <Cypheriel> Surely they have meaning behind them |
07:13:41 | FromDiscord | <ElegantBeef> `nim-lang` |
07:13:51 | disruptek | so lame |
07:13:54 | FromDiscord | <ElegantBeef> V is for vaporware |
07:14:14 | FromDiscord | <Cypheriel> I can see hat a bit |
07:14:28 | FromDiscord | <Cypheriel> but still. Jeez, lol |
07:15:04 | FromDiscord | <ElegantBeef> Cmon rebel use nim for your next project 😛 |
07:17:46 | FromDiscord | <Rebel> But I can't |
07:17:51 | FromDiscord | <Rebel> it needs to be a different language |
07:17:57 | FromDiscord | <Esbeesy> ? |
07:18:03 | * | lbart joined #nim |
07:18:03 | * | lbart quit (Changing host) |
07:18:03 | * | lbart joined #nim |
07:18:03 | FromDiscord | <Rebel> I am tempted to port a massive codebase to Nim |
07:18:03 | FromDiscord | <Esbeesy> Anything but nim? |
07:18:07 | FromDiscord | <Rebel> No |
07:18:24 | FromDiscord | <Rebel> Anything but C, C++, x86, x64, C#, Go, Rust, Python, Nim |
07:18:26 | FromDiscord | <Esbeesy> Was gonna say that's an odd requirement haha |
07:18:38 | FromDiscord | <Esbeesy> Have you tried D? |
07:18:51 | FromDiscord | <Esbeesy> Not /the/ D, which is something TOTALLY different |
07:19:12 | FromDiscord | <Rebel> No so maybe but maybe will use beef |
07:20:15 | FromDiscord | <Esbeesy> What is the project you're working on? |
07:20:19 | FromDiscord | <Rebel> omg what another ridiculous name for a language |
07:20:23 | disruptek | wasting my time. |
07:20:27 | FromDiscord | <Rebel> hehe |
07:20:35 | FromDiscord | <Rebel> threading is for nerds |
07:20:36 | FromDiscord | <Rebel> and not fun |
07:20:55 | FromDiscord | <Cypheriel> Scratch :^ |
07:21:03 | disruptek | rebel fancies himself a whitehat. |
07:21:28 | FromDiscord | <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:52 | disruptek | yeah, beef would be /perfect/ for that. |
07:22:22 | FromDiscord | <Rebel> holy shit |
07:22:26 | FromDiscord | <Rebel> you're not wrong |
07:22:27 | FromDiscord | <Rebel> like legit |
07:22:30 | FromDiscord | <Rebel> I'm reading docs now |
07:22:32 | FromDiscord | <Rebel> ah yeah |
07:22:35 | FromDiscord | <Rebel> I found it |
07:22:47 | FromDiscord | <Rebel> Chief called he said this is it |
07:23:04 | FromDiscord | <Cypheriel> Is beef supposed to be the name for another language |
07:23:17 | FromDiscord | <Cypheriel> Are you kidding me... |
07:23:21 | disruptek | beef lang. |
07:23:24 | FromDiscord | <Rebel> hell to o |
07:23:25 | FromDiscord | <Rebel> (edit) "o" => "no" |
07:23:26 | FromDiscord | <Rebel> https://www.beeflang.org/ |
07:23:35 | FromDiscord | <Cypheriel> ... |
07:23:37 | FromDiscord | <Rebel> (edit) "hell to ... noain't" added "the" | "theno ... " added "ain't joking" |
07:23:44 | FromDiscord | <Rebel> dude read how LLVM is compiled |
07:23:46 | FromDiscord | <Rebel> that's fucking hot |
07:23:57 | FromDiscord | <Rebel> (edit) "LLVM" => "beef" |
07:24:00 | FromDiscord | <Rebel> using LLVM as a backend 🤤 |
07:24:12 | disruptek | what a novel concept. |
07:24:14 | FromDiscord | <Rebel> ripe for LLVM obfuscation 😈 |
07:24:53 | FromDiscord | <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:14 | disruptek | !repo disruptek/dim |
07:25:16 | disbot | https://github.com/disruptek/dim -- 9dim: 11an experimental language 15 2⭐ 0🍴 |
07:25:33 | FromDiscord | <Esbeesy> >Dim↵>No content↵↵checks out |
07:26:08 | FromDiscord | <Cypheriel> 2 stars, too |
07:26:16 | FromDiscord | <Esbeesy> 3 now |
07:26:27 | FromDiscord | <Cypheriel> Make that 4 |
07:27:03 | FromDiscord | <Rebel> Hold up should I use dim for my adventure? Hmmm |
07:27:14 | disruptek | it's perfect for you. |
07:27:25 | FromDiscord | <Rebel> Y |
07:27:27 | FromDiscord | <Cypheriel> ah yes. code with a README.md |
07:27:44 | FromDiscord | <Cypheriel> oh, and a license |
07:27:44 | disruptek | easy syntax, fully concurrent without nerdy threads. |
07:28:25 | FromDiscord | <Rebel> Why cant you fork Nim and do a PR with that juice???? |
07:28:34 | FromDiscord | <Rebel> Are you smoking crack? |
07:28:42 | disruptek | i had to make a new language because the syntax changed. |
07:29:02 | disruptek | it's so much faster than nim that i didn't want to associate with such a sluggish lang. |
07:29:19 | FromDiscord | <Esbeesy> Haha forking a language always reminds of Elm - You get excommunicado'd from the community if you do it |
07:29:56 | FromDiscord | <Rebel> Is Elm better than Red and V if so I will add that to the list |
07:29:58 | FromDiscord | <Rebel> No gas |
07:30:20 | FromDiscord | <Esbeesy> Nah I wouldn't bother |
07:30:42 | FromDiscord | <Esbeesy> cool language but it's stunted by poor leadership |
07:31:51 | disruptek | you're talking about nim? |
07:32:06 | FromDiscord | <Esbeesy> Lmao I know literally nothing about Nims leadership |
07:32:18 | FromDiscord | <Esbeesy> It's not benevolent dictator model though is it? |
07:32:28 | disruptek | what else? |
07:32:31 | disruptek | ~araq |
07:32:31 | disbot | Araq: 11👑Andreas "What Else?" Rumpf👑 -- disruptek |
07:32:53 | FromDiscord | <ElegantBeef> For a small language like this it's not like it can be committee led |
07:33:12 | FromDiscord | <Esbeesy> I should clarify - Araq takes other peoples input on board, right? |
07:33:24 | FromDiscord | <Rebel> Wait wut 10k stars is a small language? |
07:33:35 | FromDiscord | <Idefau> its an absolutist monarchy |
07:33:59 | FromDiscord | <j-james> Stars probably aren't the best metric |
07:34:09 | FromDiscord | <j-james> No way Go is only eight times more popular |
07:34:35 | FromDiscord | <Esbeesy> !repo disruptek/dim has 4 stars and it's the best language this side of 2020 |
07:34:36 | disbot | no results 😢 |
07:34:40 | disruptek | people star nim because they're sure they'll misplace it otherwise. |
07:34:46 | FromDiscord | <Esbeesy> Shit |
07:34:50 | FromDiscord | <Esbeesy> !repo disruptek/dim |
07:34:51 | disbot | https://github.com/disruptek/dim -- 9dim: 11an experimental language 15 5⭐ 0🍴 |
07:35:36 | FromDiscord | <Rebel> Hot |
07:35:47 | FromDiscord | <Rebel> Now I want dim sum |
07:35:50 | * | mbomba quit (Quit: WeeChat 3.0) |
07:36:37 | FromDiscord | <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:07 | FromDiscord | <Esbeesy> Also checking out job market stats |
07:37:31 | disruptek | i can provide those on demand. |
07:37:31 | FromDiscord | <Esbeesy> ItJobsWatch doesn't even have a metric for nim 😦 |
07:37:45 | FromDiscord | <Rebel> A better metric == see how many projects are in Go and how many in Nim in Github + Gitlab? |
07:47:54 | FromDiscord | <Esbeesy> Day 10 mannnn, this description |
07:48:04 | FromDiscord | <Esbeesy> Honestly sometimes I read these AoC tasks and I feel like I'm having a stroke |
07:48:08 | FromDiscord | <ElegantBeef> pt 2 is the real issue |
07:48:11 | FromDiscord | <ElegantBeef> pt1 is easy as hell |
07:48:19 | FromDiscord | <ElegantBeef> pt2 is a pain in the ass 😄 |
07:51:18 | FromDiscord | <Cypheriel> I haven't even done day 8 yet, I got too confused |
08:00:56 | FromDiscord | <Esbeesy> wtf is part 2 |
08:02:27 | FromDiscord | <ElegantBeef> Something i havent done |
08:02:48 | disruptek | ahh, like combing your hair? |
08:04:20 | FromDiscord | <ElegantBeef> Yea |
08:09:44 | FromDiscord | <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:31 | disruptek | if there was, the lord wouldn't have provided all those sweet, sweet, cycles. |
08:10:49 | FromDiscord | <hugogranstrom> haha true true |
08:13:02 | * | mbomba joined #nim |
08:13:28 | FromDiscord | <Esbeesy> Hmm I'm calculating too many |
08:14:38 | FromDiscord | <hugogranstrom> Your're getting a result at least 😉 |
08:14:47 | * | mbomba quit (Client Quit) |
08:17:24 | FromDiscord | <Esbeesy> Far too early for mathboi antics |
08:20:38 | FromDiscord | <hugogranstrom> agreed |
08:22:19 | FromDiscord | <Rebel> If you want to make it check out threads pepelaugh |
08:22:31 | FromDiscord | <Rebel> Make it faster |
08:23:01 | FromDiscord | <Cypheriel> Well, I got done with day 8 |
08:23:09 | FromDiscord | <Cypheriel> Do I even want to try day 9 |
08:24:50 | FromDiscord | <ElegantBeef> 9 is easy |
08:25:06 | FromDiscord | <ElegantBeef> Although i also found 8 easy |
08:25:07 | FromDiscord | <ElegantBeef> so.... 😄 |
08:26:32 | FromDiscord | <Cypheriel> D: |
08:26:51 | FromDiscord | <Cypheriel> I had to do some really... unclean things to get day 8 to work |
08:27:18 | FromDiscord | <ElegantBeef> Let's see your code 😄 |
08:27:41 | FromDiscord | <Cypheriel> It's Python, though |
08:27:45 | FromDiscord | <ElegantBeef> oh |
08:27:48 | FromDiscord | <ElegantBeef> Get out of this server |
08:27:52 | FromDiscord | <ElegantBeef> 😛 |
08:27:53 | FromDiscord | <Cypheriel> :c |
08:28:29 | FromDiscord | <Cypheriel> I swear I'll switch to Nim soon-ish, but I'm too new to do these solutions in Nim |
08:30:02 | mipri | getting 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:55 | FromDiscord | <Cypheriel> I suppose, yeah. perhaps I'll try day 9 in Nim |
08:31:05 | FromDiscord | <Cypheriel> although, that might be too big of a jump |
08:31:41 | FromDiscord | <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:09 | mipri | yeah, day 10 is an inappropriate Project Euler problem. You either get it or you have no chance whatsoever of solving it. |
08:35:33 | FromDiscord | <Vindaar> wow, the AoC description today is confusing |
08:35:48 | FromDiscord | <Esbeesy> Innit!? |
08:35:49 | FromDiscord | <ElegantBeef> Yea it makes it seem more confusing than it actually it |
08:35:58 | FromDiscord | <ElegantBeef> pt1 is super simply solved though |
08:40:01 | FromDiscord | <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:48 | disruptek | that's what i told the cops about the word "miner." |
08:53:25 | disruptek | turns out it means something completely different. |
08:55:18 | FromDiscord | <j-james> part two today is terrible |
08:55:23 | FromDiscord | <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:52 | FromDiscord | <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:10 | FromDiscord | <kenran> (edit) "I have a `Thread` that runs indefinitely and uses a blocking POSIX ... repeatedly." added "call" |
08:56:30 | mipri | have it block on a selector that includes a pipe that your main program writes to |
08:56:41 | FromDiscord | <Cypheriel> Isn't that what daemonized threads are for? |
08:56:52 | disruptek | mipri nailed it. |
08:58:31 | FromDiscord | <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:45 | disruptek | yes. |
08:59:02 | disruptek | are you on windows with all these pipes? |
08:59:19 | FromDiscord | <kenran> Linux right now |
08:59:41 | disruptek | don't we have a semaphore you can use? |
08:59:55 | disruptek | or am i thinking of my stuff... |
09:00:04 | * | guelosk[m] quit (Quit: Idle for 30+ days) |
09:00:32 | disruptek | anyway, it doesn't matter what it is. |
09:00:38 | FromDiscord | <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:50 | FromDiscord | <kenran> but I'll get there, very sloooowly |
09:01:13 | disruptek | c'mon, i know you from way back. |
09:01:40 | FromDiscord | <kenran> this was when I last used Nim, and even then only a little bit |
09:01:49 | disruptek | hmmph. |
09:02:00 | * | Vladar joined #nim |
09:02:01 | disruptek | serves you right, then. |
09:02:16 | FromDiscord | <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:57 | FromDiscord | <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:01 | FromDiscord | <kenran> someone |
09:03:34 | FromDiscord | <kenran> are you still streaming disruptek? haven't seen your stream lately, but I'm not online much |
09:03:59 | FromDiscord | <Esbeesy> Fucking done it, get in |
09:04:04 | disruptek | if you hold a pillow over its face, it'll stop itching. |
09:04:07 | FromDiscord | <Esbeesy> That was way too much mathboi shite |
09:04:49 | disruptek | i haven't been streaming because i'm homeless, jobless, health-insurance-less, and penniless. |
09:04:55 | disruptek | not to mention merciless. |
09:05:02 | disruptek | GET DOWN BITCHES |
09:05:27 | disruptek | sorry, that came out wrong. |
09:05:53 | FromDiscord | <Cypheriel> this is America |
09:05:56 | disruptek | i meant mirthless. |
09:06:51 | FromDiscord | <j-james> so uh out of curiosity |
09:07:07 | FromDiscord | <ElegantBeef> no |
09:07:34 | FromDiscord | <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:38 | FromDiscord | <j-james> over a trillion times |
09:08:25 | disruptek | i think you're the first person ever to ask such a question. |
09:08:33 | FromDiscord | <Cypheriel> I don't think it'd take long to run into the recursion limit |
09:08:54 | FromDiscord | <ElegantBeef> Well if you got a few years you might get it |
09:09:05 | FromDiscord | <ElegantBeef> Someone's attempting to solve the aoc 10 p2 recursively 😛 |
09:09:07 | FromDiscord | <j-james> surprisingly i haven't hit it yet |
09:09:13 | disruptek | the recursion limit is only 2000. |
09:09:20 | disruptek | you'd hit it instantly. |
09:09:21 | FromDiscord | <ElegantBeef> in debug build |
09:09:30 | FromDiscord | <j-james> i know, it's strange |
09:09:31 | FromDiscord | <Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day10/day10.nim↵↵Check it out |
09:09:37 | disruptek | it's limited to a 16bit integer. |
09:09:44 | disruptek | it doesn't matter what it is in danger. |
09:09:50 | FromDiscord | <Esbeesy> Disruptek-triggering driven development |
09:10:05 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2Hoz |
09:10:06 | FromDiscord | <ElegantBeef> esbeesy using unicode characters to be cool |
09:10:10 | FromDiscord | <j-james> This is the relevant code ^ |
09:10:32 | * | livcd quit (Ping timeout: 256 seconds) |
09:10:46 | disruptek | what you need is cps. |
09:10:52 | FromDiscord | <Cypheriel> Recursion always continues to break my mind |
09:10:57 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:11:03 | FromDiscord | <ElegantBeef> Is that part 1 or part 2 james? |
09:11:21 | FromDiscord | <j-james> that's part 2 |
09:11:49 | FromDiscord | <j-james> it's taken me about a hundred time longer than part 1 so far |
09:11:55 | FromDiscord | <j-james> (edit) "time" => "times" |
09:12:25 | FromDiscord | <Esbeesy> Did an s/jolt/⚡ before commit to see if it worked, and it did! much to my pleasure |
09:14:19 | disruptek | https://auctionhero.io/ |
09:14:29 | disruptek | splish splash, i was takin' a bath |
09:14:52 | FromDiscord | <Cypheriel> I'm so confused. How've I spent the last 14 minutes trying to make seqs |
09:15:05 | FromDiscord | <Cypheriel> haha wait seqs funny word |
09:15:08 | disruptek | the best seqs takes time. |
09:15:15 | FromDiscord | <hugogranstrom> I gave up the recursion (which still is running :P) and solved it in a "smart" way instead. Boring but efficient |
09:15:18 | FromDiscord | <ElegantBeef> `var a: seq[T]` is about 14 minutes of work |
09:15:27 | FromDiscord | <Cypheriel> uh |
09:15:34 | FromDiscord | <Cypheriel> oh. I'm so dumb |
09:15:52 | FromDiscord | <Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoA |
09:15:56 | FromDiscord | <Cypheriel> This is what I was doing |
09:15:58 | Araq | 14 minutes? |
09:16:01 | FromDiscord | <ElegantBeef> I didnt say it |
09:16:14 | FromDiscord | <ElegantBeef> Araq you seen my PR's you know i'm not the quickest |
09:16:23 | FromDiscord | <Cypheriel> wait. I'm confused even then |
09:16:33 | FromDiscord | <Cypheriel> What is T |
09:16:41 | FromDiscord | <ElegantBeef> Your type you want the seq |
09:16:46 | disruptek | a poor substitute for coffee. |
09:16:59 | FromDiscord | <Esbeesy> T is whatever you want to be |
09:17:08 | FromDiscord | <Esbeesy> https://www.youtube.com/watch?v=SVi3-PrQ0pY |
09:17:11 | FromDiscord | <Cypheriel> ohh. I see |
09:17:13 | FromDiscord | <ElegantBeef> T who you wanna T barbie girl |
09:17:28 | FromDiscord | <Esbeesy> (edit) "T is whatever you want ... to" added "it" |
09:17:36 | FromDiscord | <Cypheriel> See, this is why I was using Python |
09:17:46 | FromDiscord | <ElegantBeef> Cause static type systems are confusing? 😛 |
09:18:36 | FromDiscord | <Cypheriel> yes |
09:18:47 | FromDiscord | <Cypheriel> I was doing all kinds of weird things, honestly |
09:19:02 | disruptek | do you have video? |
09:19:03 | FromDiscord | <Cypheriel> newSeq(), newSeq()[int], newSeq[int]() |
09:19:18 | disruptek | that's too much seqs for so early in the morning. |
09:20:52 | FromDiscord | <Cypheriel> I am... so confused |
09:21:45 | FromDiscord | <Cypheriel> Wait... I did it! |
09:21:50 | FromDiscord | <Cypheriel> Only took 21 minutes |
09:22:08 | FromDiscord | <Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoC |
09:22:44 | FromDiscord | <Esbeesy> Whats the difference between a seq and a slice in Nim? |
09:26:14 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/system.html#HSlice |
09:26:27 | disruptek | short for `HomeSlice`. |
09:27:40 | disruptek | there's a guy passed out in the bathroom with no pants. should i work on ic or try to take advantage? |
09:28:04 | FromDiscord | <Cypheriel> What kind of advantage? |
09:28:14 | Araq | HeterogenousSlice iirc |
09:28:25 | Araq | https://github.com/nim-lang/RFCs/issues/287 yes/no? |
09:28:26 | disbot | ➥ Deprecate TaintedString |
09:28:31 | FromDiscord | <ElegantBeef> Yea it's in the description of Hslice |
09:28:46 | mipri | !eval echo (@[1,2].type, [1,2][0..1].type) |
09:28:48 | NimBot | (seq[int], seq[int]) |
09:28:48 | Araq | Juan demands a decision |
09:29:36 | mipri | [] 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:01 | FromDiscord | <ElegantBeef> Well we already have `toOpenArray` which lets you do that afaik |
09:30:40 | FromDiscord | <ElegantBeef> I could be wrong about that though |
09:30:50 | mipri | no, that's what I'm talking about |
09:31:09 | FromDiscord | <ElegantBeef> Ah it's not apart of experimental though |
09:31:38 | mipri | it 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:07 | FromDiscord | <ElegantBeef> Speaking of this i still want an opinion those slice lent iterators like this https://play.nim-lang.org/#ix=2Hh8 |
09:34:03 | FromDiscord | <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:28 | FromDiscord | <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:47 | disruptek | Araq: i don't recognize any of the people who thumbed that rfc. |
09:34:47 | mipri | HashSet[int], from the sets module |
09:35:13 | disruptek | intsets doesn't let you use bigger ints? |
09:35:24 | Araq | disruptek, very good point |
09:36:17 | mipri | intset isn't generic, is I guess the problem. |
09:36:31 | mipri | but |
09:36:44 | mipri | !eval echo (int.sizeof, int32.sizeof, int64.sizeof) |
09:36:46 | NimBot | (8, 4, 8) |
09:36:48 | disruptek | packedsets works for any ordinal. |
09:37:14 | disruptek | pretty sure all ints are ordinals. |
09:37:16 | mipri | it's already 'bigger ints'. if you want bignums you can use HashSets with them, after defining a hash func |
09:37:28 | disruptek | and a bignum, of course. |
09:39:10 | * | mika_ joined #nim |
09:40:36 | * | Cthalupa quit (Ping timeout: 240 seconds) |
09:40:57 | FromDiscord | <mratsim> bignum in a HashSet? 😄 |
09:41:24 | FromDiscord | <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:53 | mipri | readFile("...").strip.splitLines is useful for a lot of these. |
09:42:19 | * | waleee-cl joined #nim |
09:42:21 | disruptek | i prefer to split my lines by hand. |
09:42:35 | FromDiscord | <Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoO |
09:42:36 | disruptek | hand-split artisinal lines. |
09:42:36 | FromDiscord | <Cypheriel> I ended up doing this |
09:43:05 | disruptek | you really don't want a do a line you haven't split yourself. |
09:43:19 | FromDiscord | <ElegantBeef> Well `split` will split at all whitespace chars, which depending on which challenge is perfectly valid 😄 |
09:43:54 | FromDiscord | <Cypheriel> I mean... `parseInt('')` doesn't work out too well |
09:44:08 | FromDiscord | <ElegantBeef> it'd have been removed by `split` 😄 |
09:44:10 | FromDiscord | <j-james> that's where strip comes in handy |
09:44:32 | FromDiscord | <Cypheriel> wait |
09:44:35 | Araq | disruptek, please cut the noise a little. you definitely can have too many jokes |
09:44:53 | FromDiscord | <Cypheriel> I don't think that's right |
09:45:03 | disruptek | sorry, i'm punchy. it's nearly 5a and ic is broken again. |
09:45:10 | FromDiscord | <Cypheriel> because I just tried it by removing the `strip()` and I get the |
09:45:15 | * | spiderstew quit (Quit: Konversation terminated!) |
09:45:27 | FromDiscord | <PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2HoP |
09:45:28 | FromDiscord | <Cypheriel> sent a code paste, see https://paste.rs/Gk5 |
09:45:37 | FromDiscord | <j-james> beef flip-flopped `strip` and `split` |
09:46:02 | FromDiscord | <ElegantBeef> I really didnt https://nim-lang.org/docs/strutils.html#split.i,string,set[char],int |
09:46:05 | FromDiscord | <mratsim> @PizzaFox yes, I do suggest using stew/endians2 though |
09:46:10 | * | spiderstew joined #nim |
09:46:12 | FromDiscord | <ElegantBeef> `split`'s default set to split at is whitespace |
09:46:13 | FromDiscord | <PizzaFox> thanks. also, why |
09:46:20 | FromDiscord | <mratsim> better API |
09:46:32 | FromDiscord | <ElegantBeef> Which is defined as https://nim-lang.org/docs/strutils.html#Whitespace |
09:46:41 | FromDiscord | <mratsim> changing endianness should return a bytearray not an integer |
09:46:57 | FromDiscord | <mratsim> because you can't use it as an integer anymore technically |
09:47:13 | FromDiscord | <j-james> right, but files usually end with newlines |
09:47:29 | FromDiscord | <j-james> so you'll end up with a garbage `''` |
09:47:35 | FromDiscord | <ElegantBeef> How? |
09:48:04 | mipri | assert "a\nb\n".split == @["a", "b", ""] |
09:48:06 | FromDiscord | <Cypheriel> sent a code paste, see https://play.nim-lang.org/#ix=2HoQ |
09:48:31 | FromDiscord | <Cypheriel> It's actually when you split `\n\n` pretty sure |
09:48:41 | * | Tanger joined #nim |
09:48:42 | FromDiscord | <Cypheriel> which would be a blank line as the last line in your file |
09:48:46 | * | Tlangir joined #nim |
09:48:55 | FromDiscord | <ElegantBeef> well when you split by `\n\n` you arent splitting at all whitespace chars |
09:49:26 | FromDiscord | <ElegantBeef> mirpri has proven me wrong |
09:49:30 | FromDiscord | <ElegantBeef> So i'll shush and clap my hands |
09:49:43 | * | mika_ quit (Ping timeout: 246 seconds) |
09:51:27 | FromDiscord | <Cypheriel> Oh, splitting in Nim is somehow different from Python |
09:52:46 | FromDiscord | <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:04 | mipri | Python has a magic nullary .split() so it's quite weird |
09:54:28 | mipri | "a\nb\n".split() != "a\nb\n".split("\n") # Python |
09:55:14 | FromDiscord | <Cypheriel> That is fairly weird |
09:55:14 | Araq | <ElegantBeef> make it return a tuple? |
09:55:30 | Araq | seems the best option |
09:55:40 | * | Tlangir quit (Ping timeout: 246 seconds) |
09:55:52 | Araq | and name it 'scant' (t for tuple) or better |
09:55:58 | * | Tanger quit (Ping timeout: 265 seconds) |
09:56:07 | Araq | or maybe scanTuple |
09:56:21 | * | Tanger joined #nim |
09:56:22 | * | Torro joined #nim |
09:56:41 | voltist | In 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:25 | Araq | wait what? |
09:57:32 | * | PMunch joined #nim |
09:58:17 | FromDiscord | <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:58 | Araq | voltist, is the code public? sounds awesome |
09:59:11 | Araq | ElegantBeef: hmm |
09:59:54 | voltist | That 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:11 | voltist | I'll put my code up as soon as I have something vaguely resembling their results |
10:00:27 | voltist | Shouldn't be too long now |
10:00:42 | Araq | don't worry if you cannot replicate it, most things are unreproducible :P |
10:00:48 | disruptek | good, i need some more brainpower. |
10:01:10 | Araq | only trust the stats that you faked yourself or whatever it's in English |
10:01:50 | voltist | This is algorithms and equations, so it *should* be exactly reproducible |
10:02:01 | FromDiscord | <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:21 | voltist | Although I'll have to devise my own training/testing because they don't describe theirs very well |
10:02:41 | FromDiscord | <mratsim> @voltist, believe me, ML results are a pain to reproduce |
10:02:56 | FromDiscord | <mratsim> Especially if they don't describe how they initialize the neurons |
10:03:15 | FromDiscord | <mratsim> like I had wildly different results when using a gaussian with stddev 0.1 vs 0.01 |
10:03:25 | FromDiscord | <mratsim> and obviously the paper doesn't tell me what they used |
10:04:24 | disruptek | just cut open a baby see what they are set to from the factory. |
10:04:31 | FromDiscord | <ElegantBeef> Grab your favourite dart and dartboard and just start going 😄 |
10:04:33 | disruptek | i'm surprised random values wouldn't be fine. |
10:04:55 | Araq | mratsim: what channel/queue to use? |
10:05:09 | Araq | looking for a simple, fast one for fusion |
10:05:11 | voltist | Hopefully 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:30 | voltist | Gee that was a big sentence |
10:06:16 | voltist | And SNN's are meant to be more resilient to variation and noise, but yeah it still might all go wrong |
10:06:21 | FromDiscord | <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:43 | FromDiscord | <mratsim> @Araq: something multithreaded? |
10:06:58 | Araq | yeah, it's time for Isolated[T] |
10:07:13 | FromDiscord | <mratsim> I don't have anything that supports non-copymem object though it might work with arc |
10:07:22 | voltist | Oh nice I didn't know that deep learning was done much in Nim |
10:07:40 | Araq | mratsim: I can adapt the code if it's simple enough |
10:08:07 | FromDiscord | <mratsim> I assume you need multi-producer multi consumer? |
10:08:47 | Araq | hmm good question |
10:09:20 | Araq | can't hurt I guess |
10:09:28 | FromDiscord | <mratsim> This one should be a good start: https://github.com/mratsim/weave/blob/5696d94e6358711e840f8c0b7c684fcc5cbd4472/unused/channels/channels_legacy.nim |
10:10:08 | FromDiscord | <mratsim> It has a cache system which brought it like within 80% of pure atomics based channel. |
10:10:34 | FromDiscord | <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:05 | FromDiscord | <mratsim> https://www.cs.rochester.edu/u/scott/papers/1996_PODC_queues.pdf |
10:14:01 | FromDiscord | <mratsim> also it's linearizable (but that's a costly property usually). |
10:14:23 | Araq | what does 'linearizable' mean in this context? |
10:17:04 | * | abm joined #nim |
10:17:43 | FromDiscord | <mratsim> this is probably the clearest and shortest explanation on serializability vs linearizability: https://cs.stackexchange.com/a/41741 |
10:19:05 | FromDiscord | <PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2Hp7 |
10:19:28 | FromDiscord | <PizzaFox> (edit) "https://play.nim-lang.org/#ix=2Hp7" => "https://play.nim-lang.org/#ix=2Hp8" |
10:19:35 | FromDiscord | <mratsim> outp[0..<8] = inp |
10:19:45 | FromDiscord | <PizzaFox> (edit) "https://play.nim-lang.org/#ix=2Hp8" => "https://play.nim-lang.org/#ix=2Hp9" |
10:19:48 | FromDiscord | <PizzaFox> thanks |
10:20:24 | FromDiscord | <mratsim> to be honest, I always have to reread those guarantees, they made my head hurt every single time |
10:21:27 | FromDiscord | <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:52 | FromDiscord | <mratsim> if there are no guarantees you might get A2 before A1 |
10:23:25 | FromDiscord | <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:43 | FromDiscord | <mratsim> because solving documenting and building that stuff is complex |
10:24:52 | * | hmmmmm joined #nim |
10:25:15 | hmmmmm | g'day |
10:25:36 | FromDiscord | <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:56 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/786539185464016896/unknown.png |
10:26:02 | FromDiscord | <mratsim> https://github.com/microsoft/snmalloc/blob/7faefbbb0ed69554d0e19bfe901ec5b28e046a82/snmalloc.pdf |
10:26:45 | FromDiscord | <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:37 | Araq | it's why I had high hopes on "hardware lock elision" |
10:34:04 | Araq | this stuff is hard and the hardware folks are very good at it |
10:34:53 | FromDiscord | <mratsim> It was buggy for a long while, on Haswell, Boradwell and Skylake, was only fixed in Skylake-X iirc |
10:35:19 | FromDiscord | <mratsim> This is also where formal verification helps and a borrow checker stops being useful. |
10:35:21 | Araq | yes but the idea behind it is a good one, IMO |
10:35:30 | FromDiscord | <mratsim> ah sure. |
10:35:52 | FromDiscord | <mratsim> Haskell did implement Software Transactional Memory for their multithreading and GC, it is very impressive. |
10:36:26 | Araq | the M1 apparently improved atomic refcounting |
10:36:38 | Araq | (they had to because of Swift I guess) |
10:37:25 | FromDiscord | <mratsim> Swift devs still have to handle cycles on their own |
10:37:54 | Araq | sure, but my point is, if the uncontested atomic RC case would be close to the non-atomic RC |
10:38:02 | FromDiscord | <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:31 | Araq | this would really simplify language design :-) |
10:38:32 | FromDiscord | <mratsim> It can't be. Even uncontested, an atomic requires L1, L2 and cache line synchronization. |
10:39:01 | Araq | you could use a side-channel for the sync snooping |
10:39:07 | FromDiscord | <mratsim> having fast/efficient hardware channels would also simplify design 😉 |
10:39:55 | FromDiscord | <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:06 | Araq | but probably such a "side-channel" is impossible |
10:41:59 | FromDiscord | <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:37 | FromDiscord | <Cypheriel> Who the heck came up with AoC day 10 |
10:53:57 | FromDiscord | <Cypheriel> There are so many numbers and I have no clue what the heck I'm reading |
10:54:57 | FromDiscord | <j-james> Yeah, I'm in the same boat as you Cypheriel |
10:56:29 | FromDiscord | <Cypheriel> I understand it but.. I don't understand it |
10:56:47 | FromDiscord | <Cypheriel> Like I can understand the concept but I have no clue how I'm supposed to figure that out |
10:57:09 | FromDiscord | <j-james> I feel like there's some computer science principle that would be useful |
10:57:45 | FromDiscord | <j-james> it really can't be a pure math problem |
10:58:05 | FromDiscord | <Cypheriel> nvm maybe I don't understand the prompt at all |
10:59:28 | FromDiscord | <Cypheriel> Oh lord. I was thinking of something totally different. |
10:59:44 | FromDiscord | <Cypheriel> I love how this barely mentioned outlets and that's all I was really thinking of |
11:01:40 | Araq | mratsim: I don't understand why snmalloc isn't compared to 'memalloc' |
11:01:56 | FromDiscord | <mratsim> mimzlloc you mean? |
11:02:01 | FromDiscord | <mratsim> mimalloc? |
11:02:08 | Araq | mimalloc |
11:02:29 | FromDiscord | <mratsim> It is, in the mimalloc paper, snmalloc is about 6 months or 1 yearolder and from another Microsoft team |
11:02:50 | FromDiscord | <mratsim> so they weren't aware of mimalloc when they released that paper |
11:03:29 | FromDiscord | <mratsim> Since then they also integrated a lot of mimalloc advances but still kept the message-passing based thread synchronization |
11:03:46 | FromDiscord | <mratsim> (while mimalloc uses compare-and-swap) |
11:04:40 | FromDiscord | <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:10 | Araq | I found https://github.com/SchrodingerZhu/bench_suite/blob/master/output/index.md |
11:12:16 | Araq | which has interesting numbers |
11:29:56 | FromDiscord | <mratsim> the pool allocator I have in Weave is a mix of snmalloc + mimalloc for fixed size allocation. |
11:31:27 | FromDiscord | <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:30 | FromDiscord | <mratsim> https://github.com/mratsim/weave/blob/master/weave/memory/memory_pools.nim#L153-L162 |
11:32:14 | FromDiscord | <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:25 | hmmmmm | duh apparently mirc wants my monnies, what do discerning nimions use for irc on windows |
11:47:59 | FromDiscord | <Zachary Carter> probably windows subsystem for linux and iirc |
11:48:14 | FromDiscord | <Zachary Carter> err wait |
11:48:21 | PMunch | Haha |
11:48:22 | hmmmmm | you heaten |
11:48:42 | FromDiscord | <Zachary Carter> irssi lol |
11:48:48 | hmmmmm | windows is very nice and comfy, a platform for the cozy gentleman |
11:48:54 | PMunch | I 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:18 | PMunch | hmmmmm, nice and comfy, like a straight-jacket |
11:49:21 | FromDiscord | <Zeus> I use hexchat on Windows and it's fine |
11:49:32 | PMunch | It's like a never-ending hug |
11:50:06 | FromDiscord | <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:21 | hmmmmm | w10 terminal is pretty confy they remade it |
11:50:41 | FromDiscord | <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:50 | FromDiscord | <Zachary Carter> but I miss stuff from fish shell |
11:51:13 | FromDiscord | <Zachary Carter> I mean at a bare minimum I want command history and auto completion |
11:51:21 | hmmmmm | I really don't want to use discord |
11:51:27 | FromDiscord | <Zachary Carter> well don't |
11:51:28 | hmmmmm | stallman said it's bad for my freedom |
11:53:23 | hmmmmm | "the top 21 irc clients for windwos" |
11:53:29 | hmmmmm | woah they made 21? wtf |
11:54:11 | FromDiscord | <Zachary Carter> Oh duh, I can just change my shell I'm not stuck with the default ubuntu shell |
11:54:23 | FromDiscord | <mratsim> I remember using mIRC 18 years ago |
11:54:33 | FromDiscord | <mratsim> trying to solve why I couldn't do DCC requests |
11:55:17 | hmmmmm | you ever solved it? |
11:55:19 | hmmmmm | :D |
11:55:34 | hmmmmm | honestly irc is great for books |
11:55:48 | * | Q-Master quit (Ping timeout: 260 seconds) |
11:56:28 | FromDiscord | <mratsim> no, I just leeched with XDCC, I think it was a port mapping problem |
11:56:39 | FromDiscord | <mratsim> anyway offtopic |
11:56:41 | PMunch | hmmmmm, IRC clients are pretty easy to make |
11:58:04 | FromDiscord | <mratsim> At that time people were shifting from AIM to MSN Mesenger |
11:58:56 | FromDiscord | <mratsim> The holy grail was setting your MSN status message to Winamp music |
11:59:28 | * | Q-Master joined #nim |
12:00:08 | FromDiscord | <mratsim> ah not AIM, ICQ |
12:01:13 | FromDiscord | <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:23 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2HpS |
12:01:57 | FromDiscord | <mratsim> location.load(moRelaxed) |
12:02:38 | FromDiscord | <mratsim> no perf hit on x86 because x86 has a strong memory model |
12:02:56 | FromDiscord | <mratsim> though on Power 9 and ARM you might have some extra cache sync. |
12:04:13 | FromDiscord | <flywind> I see, thanks. |
12:04:38 | FromDiscord | <flywind> Could we export the raw data of `Atomics` instead? |
12:05:14 | FromDiscord | <mratsim> you can cast of course though I think it won't compile with the C++ backend. |
12:05:51 | FromDiscord | <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:04 | FromDiscord | <Zachary Carter> Apparently ICQ is still around somehow |
12:06:11 | * | hmmmmm quit (Remote host closed the connection) |
12:06:18 | FromDiscord | <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:56 | PMunch | @mratsim, oh those were the day |
12:09:00 | PMunch | days* |
12:16:20 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/issues/16312 |
12:16:22 | disbot | ➥ Wrong code generation for sequences with "let". ; snippet at 12https://play.nim-lang.org/#ix=2HpY |
12:17:02 | * | jjido joined #nim |
12:17:09 | FromDiscord | <mratsim> it's a duplicate of an issue in the 6000 something |
12:17:59 | FromDiscord | <flywind> It looks really terrible. |
12:18:29 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/issues/2314 |
12:18:31 | disbot | ➥ Let behaves differently in proc? ; snippet at 12https://play.nim-lang.org/#ix=2Hq0 |
12:19:11 | FromDiscord | <mratsim> and I think there is another one |
12:20:54 | FromDiscord | <flywind> I think it is even worse? |
12:21:15 | PMunch | Oh wow, that's not what I would expect at all |
12:22:34 | FromDiscord | <flywind> After a number is added to `s1`, `s2` is cleared. |
12:26:16 | FromDiscord | <mratsim> if you use arc, i think the sequence are OK |
12:26:31 | FromDiscord | <mratsim> the implementation are different and use sink for no copy let when it's possible |
12:28:03 | FromDiscord | <flywind> Yeah, with `arc` it works. |
12:28:16 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Hq2 |
12:28:58 | FromDiscord | <flywind> with `refc` |
12:29:05 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Hq3 |
12:29:17 | * | mika_ joined #nim |
12:31:50 | FromDiscord | <Vindaar> yes, I was also really surprised to see that issue |
12:33:22 | FromDiscord | <mratsim> I was suprised to never met it in my own library |
12:33:42 | FromDiscord | <mratsim> Arraymancer used to use sequences for example |
12:34:02 | * | mika_ quit (Ping timeout: 256 seconds) |
12:34:20 | FromDiscord | <Vindaar> yeah, I feel like I could have met that bug at any time |
12:49:25 | * | Vladar joined #nim |
12:50:02 | FromDiscord | <sealmove> guys how to construct identifiers in quote do? pls remind me |
12:53:54 | FromDiscord | <mratsim> `myIdent` |
12:53:58 | FromDiscord | <mratsim> use quote |
12:54:23 | FromDiscord | <mratsim> but use ident("foo") or bindSym("foo") before to declare it |
12:58:58 | FromDiscord | <sealmove> i mean with concatenation |
13:05:44 | FromDiscord | <mratsim> ident("foo" & "foo") |
13:05:50 | FromDiscord | <sealmove> ah ok ok |
13:06:01 | FromDiscord | <sealmove> so I do this outside the quote do |
13:06:18 | FromDiscord | <mratsim> you can't do anything in quote do you will trigger strange warnings |
13:06:34 | FromDiscord | <shadow.> yeahh |
13:06:42 | FromDiscord | <shadow.> just preevaluate any expressions you'd put in quotes |
13:06:53 | FromDiscord | <shadow.> or at least get them under an identifier lol |
13:07:00 | FromDiscord | <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:21 | FromDiscord | <sealmove> i don't need bindsym for this right? |
13:09:38 | FromDiscord | <mratsim> bindSym is for binding a symbol in the macro scope |
13:09:43 | FromDiscord | <shadow.> how do you get a reference by indexing an openarray? |
13:09:49 | FromDiscord | <mratsim> otherwise ident can only look in the caller scope |
13:09:57 | FromDiscord | <shadow.> or do i have to use `.addr` |
13:10:14 | FromDiscord | <mratsim> @shadow. you use let foo {.byaddr.} = a[i] |
13:10:19 | FromDiscord | <shadow.> thanks |
13:10:20 | FromDiscord | <mratsim> or maybe it's byref |
13:10:33 | FromDiscord | <shadow.> ill try byref then byaddr lol |
13:10:42 | FromDiscord | <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:10 | FromDiscord | <mratsim> or you use template ai: untyped = a[i] |
13:11:39 | FromDiscord | <shadow.> fair enough thanks |
13:20:14 | ForumUpdaterBot | New 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:14 | ForumUpdaterBot | New thread by B3liever: Ideal design for a general purpose SparseSet?, see https://forum.nim-lang.org/t/7236 |
13:31:00 | FromDiscord | <sealmove> just uploaded this https://github.com/sealmove/bitstreams |
13:36:14 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HqH |
13:36:16 | FromDiscord | <shadow.> how could this get above index 97? |
13:36:26 | FromDiscord | <shadow.> i have a check for len and it only ever increments by one |
13:37:01 | * | spiderstew quit (Quit: Konversation terminated!) |
13:37:21 | FromDiscord | <shadow.> (edit) "97?" => "96?" |
13:38:13 | FromDiscord | <shadow.> even with >= it still fails |
13:38:39 | disruptek | !repo sparseset |
13:38:40 | disbot | https://github.com/planetis-m/sparseset -- 9sparseset: 11Sparsesets for Nim 15 0⭐ 0🍴 |
13:42:04 | FromDiscord | <shadow.> ah wait i see it's because the return is condition |
13:42:43 | FromDiscord | <squid> How do you use cstring? |
13:42:53 | FromDiscord | <shadow.> sprinkle liberally. |
13:43:12 | FromDiscord | <squid> I havent figured out how to create a cstring. |
13:43:21 | FromDiscord | <mratsim> cstring"Tread carefully" |
13:43:30 | FromDiscord | <shadow.> haha yeah |
13:43:41 | FromDiscord | <squid> And if I need to use it as pointer/buffer |
13:44:40 | FromDiscord | <squid> Like how do I allocate 20 characters? |
13:44:54 | FromDiscord | <mratsim> I use it in 2 situations:↵- Error message with non-dynamic content to save on GC↵- For interop with C library |
13:45:17 | FromDiscord | <squid> I need it for interop with C library |
13:45:19 | FromDiscord | <mratsim> everything else is likely begging for buffer overflow |
13:45:22 | FromDiscord | <squid> I wanna do stuff with imgui |
13:45:45 | FromDiscord | <mratsim> proc foo(myStr: cstring){.importc.} |
13:45:52 | FromDiscord | <mratsim> and just pass a Nim string to it |
13:45:57 | FromDiscord | <mratsim> Nim will do the right thing |
13:46:12 | FromDiscord | <squid> How do you do pointers? |
13:46:28 | FromDiscord | <squid> Like for imgui you need to provide a buffer for input from a textbox |
13:46:33 | Zevv | let p = addr thing |
13:46:34 | * | PMunch quit (Ping timeout: 256 seconds) |
13:46:56 | Zevv | if you want a string, take the addr of s[0] |
13:47:11 | FromDiscord | <squid> And how do I allocate a 20 character long cstring? |
13:47:52 | FromDiscord | <mratsim> var foo = newString(20) |
13:48:00 | FromDiscord | <mratsim> you can pass that to C. |
13:49:04 | FromDiscord | <squid> Oh |
13:49:07 | FromDiscord | <squid> Thank you |
13:49:45 | FromDiscord | <squid> sent a code paste, see https://play.nim-lang.org/#ix=2HqM |
13:51:22 | FromDiscord | <mratsim> you don't need the address if newTextbox accepts a cstring |
13:51:49 | FromDiscord | <mratsim> if it demands a void pointer or pointer char you need to do addr(foo[0]) |
13:52:11 | FromDiscord | <mratsim> (edit) "or" => "instead of a" |
13:58:37 | * | PMunch joined #nim |
13:59:15 | PMunch | New after work stream of AoC today at 15:15 UTC |
14:01:23 | * | rockcavera quit (Remote host closed the connection) |
14:08:40 | FromDiscord | <shadow.> `nim r file.nim` is an official command right? |
14:08:46 | FromDiscord | <shadow.> it works fine for me but my friends says it says invalid command |
14:09:20 | Prestige | Yeah, are they doing -r by chance? |
14:09:25 | FromDiscord | <shadow.> nope |
14:09:26 | FromDiscord | <WalrusNoj> nope |
14:09:31 | FromDiscord | <shadow.> friend |
14:09:34 | FromDiscord | <shadow.> lol |
14:09:46 | FromDiscord | <WalrusNoj> sent a code paste, see https://play.nim-lang.org/#ix=2HqU |
14:11:39 | narimiran | @shadow. are you two on the same nim version? |
14:11:39 | Prestige | what is the output of nim --version? |
14:12:29 | FromDiscord | <shadow.> i'm on latest 1.4.2 |
14:12:38 | FromDiscord | <shadow.> windows amd64 |
14:12:41 | FromDiscord | <j-james> fyi shadow don't recurse |
14:12:45 | FromDiscord | <shadow.> fr? |
14:12:49 | FromDiscord | <shadow.> is todays not that hard lmao |
14:12:49 | FromDiscord | <j-james> my code has been running for four hours |
14:12:51 | FromDiscord | <shadow.> LOL |
14:12:57 | FromDiscord | <shadow.> i think i might have misunderstood the problem |
14:13:00 | FromDiscord | <shadow.> its so weird |
14:13:04 | FromDiscord | <j-james> a trillion is large |
14:13:21 | FromDiscord | <WalrusNoj> oh i am on 1.0.6 |
14:15:54 | FromDiscord | <shadow.> lmao |
14:16:11 | FromDiscord | <shadow.> serves you right for sudo apt-get installing pfft |
14:16:18 | FromDiscord | <shadow.> !repo disruptek/gitnim |
14:16:20 | disbot | https://github.com/disruptek/gitnim -- 9gitnim: 11choosenim for choosey nimions 15 6⭐ 0🍴 |
14:16:34 | Evolver | How 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:17 | PMunch | What do you mean by "direct Nim bindings" vs "use the C/C++ bindings via Nim"? |
14:19:03 | PMunch | Since 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:38 | Evolver | PMunch: I see. Is there a good example of this that I can see on GitHub? |
14:20:14 | Evolver | for a C/C++ package being used from Nim |
14:22:21 | FromDiscord | <shadow.> shit |
14:22:24 | FromDiscord | <shadow.> i think i misunderstood the problem |
14:22:26 | FromDiscord | <shadow.> this looks easy asf- |
14:22:27 | FromDiscord | <shadow.> lmfao |
14:22:58 | Evolver | we should IMO try to keep the language professional here |
14:23:33 | PMunch | Evolver, we're normally pretty relaxed about language usage here |
14:23:47 | FromDiscord | <shadow.> i mean |
14:24:04 | FromDiscord | <shadow.> i can certainly do that but |
14:24:13 | FromDiscord | <shadow.> it's been pretty chill since i've been here as long as it's not like |
14:24:14 | FromDiscord | <shadow.> rude |
14:24:15 | FromDiscord | <shadow.> lmao |
14:24:35 | FromDiscord | <j-james> i still haven't gotten part ii yet |
14:24:41 | PMunch | @Evolver, there are some examples here: https://nim-lang.org/docs/backends.html |
14:24:44 | FromDiscord | <shadow.> im on part 1 LOL |
14:24:48 | FromDiscord | <j-james> (but last tried to four hours ago) |
14:24:56 | FromDiscord | <j-james> oh |
14:25:01 | FromDiscord | <shadow.> LMAO |
14:25:15 | FromDiscord | <shadow.> i dont think i needed recursion for part one |
14:25:16 | PMunch | @Evolver, you can also use c2nim to generate a wrapper |
14:25:18 | FromDiscord | <shadow.> im overthinking it |
14:25:21 | PMunch | Or nimterop |
14:25:42 | FromDiscord | <j-james> nono def not |
14:25:55 | Evolver | PMunch: thanks |
14:26:15 | PMunch | @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:48 | FromDiscord | <Recruit_main707> Evolver, I guess that you meant a pure implementation by direct Nim bindings |
14:27:05 | FromDiscord | <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:06 | Evolver | FromDiscord: yes |
14:27:12 | FromDiscord | <Recruit_main707> I think it would be possible, don’t know if it would be worth it |
14:27:18 | FromDiscord | <lqdev> (edit) removed "people can make" |
14:27:28 | Evolver | Recruit_main707: ok, thx |
14:28:01 | PMunch | Besides, not everyone here are native English speakers and might have a hard time making their language sound "professional" |
14:28:07 | Evolver | lqdev: lmao, lmfao, shit, asf -- these are not chill. These are just offensive. |
14:28:23 | PMunch | That being said over-use of curses and such are generally not tolerated |
14:28:32 | FromDiscord | <lqdev> ^ |
14:28:58 | FromDiscord | <shadow.> i don't think most people would consider "wow this challenge is hard asf" to be offensive |
14:29:03 | FromDiscord | <shadow.> it might be informal |
14:29:04 | FromDiscord | <lqdev> it's really not that offensive unless it's directed at someone |
14:29:09 | FromDiscord | <lqdev> @shadow. exactly |
14:29:10 | FromDiscord | <shadow.> but it's not targeted at someone |
14:29:11 | FromDiscord | <shadow.> so yeah |
14:29:19 | * | cgfuh joined #nim |
14:30:47 | PMunch | Furthermore 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:01 | FromDiscord | <j-james> ~~it's targeted at santa~~ |
14:31:09 | FromDiscord | <shadow.> lol |
14:31:30 | PMunch | Hmm, so this one is harder than previous days? |
14:31:31 | PMunch | Interesting |
14:31:35 | FromDiscord | <shadow.> nah definitely not |
14:31:40 | FromDiscord | <shadow.> i misunderstood the problem |
14:31:43 | FromDiscord | <shadow.> made some huge recursion and intset thing |
14:31:44 | FromDiscord | <lqdev> and the definition of "offensive" is relative depending on who you ask so yeah |
14:31:45 | PMunch | Ah okay :P |
14:31:46 | FromDiscord | <shadow.> as i always do 😉 |
14:31:51 | FromDiscord | <lqdev> let's just keep it chill and not scold each other |
14:31:57 | FromDiscord | <shadow.> unless you're disruptek |
14:31:59 | FromDiscord | <shadow.> then you can roast anyone |
14:32:01 | FromDiscord | <shadow.> lol |
14:32:11 | PMunch | He doesn't have an exception |
14:32:11 | FromDiscord | <lqdev> yes. disruptek is an exception |
14:32:29 | FromDiscord | <shadow.> hmm https://media.discordapp.net/attachments/371759389889003532/786601235230097468/unknown.png |
14:32:49 | FromDiscord | <lqdev> lol |
14:32:53 | FromDiscord | <j-james> PMunch: part ii is the hardest problem yet imo |
14:32:54 | PMunch | I mean where I live cursing is a normal part of everyday language (northern Norway) |
14:33:00 | FromDiscord | <j-james> by a wide margin |
14:33:12 | FromDiscord | <shadow.> well im on part one so i wouldn't know lmao |
14:33:18 | FromDiscord | <ache of head> why is "lmao" offensive? |
14:33:20 | PMunch | To 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:23 | FromDiscord | <Recruit_main707> Same here, both joking and seriously:p |
14:33:31 | FromDiscord | <ache of head> it's vulgar, sure |
14:33:46 | FromDiscord | <ache of head> but only offensive if you use it in an offensive context. |
14:34:07 | PMunch | Some people just find curses in general offensive |
14:34:15 | FromDiscord | <ache of head> ¯\_(ツ)_/¯ |
14:34:22 | PMunch | But then again, there's always someone who finds anything offensive |
14:34:22 | FromDiscord | <shadow.> depends on the person i suppose |
14:34:33 | FromDiscord | <shadow.> here i can offend everyone here with no vulgar |
14:34:34 | FromDiscord | <lqdev> yeah we in poland just spew swear words out like there's no tommorow sometimes |
14:34:39 | FromDiscord | <ache of head> lmao |
14:34:41 | FromDiscord | <ache of head> oops sorry |
14:34:42 | FromDiscord | <shadow.> "i prefer rust to nim" |
14:34:48 | FromDiscord | <shadow.> there we go |
14:34:53 | FromDiscord | <ache of head> i literally did that by accident |
14:34:55 | FromDiscord | <ache of head> i'm sorry |
14:34:57 | PMunch | /kick shadow. |
14:35:00 | FromDiscord | <shadow.> LMAO |
14:35:02 | FromDiscord | <lqdev> @shadow. YOU OFFENDED ME. I SHALL NOW EXECUTE YOU ON TWITTER. |
14:35:02 | FromDiscord | <shadow.> accurate. |
14:35:07 | Evolver | Let's just agree that it's vulgar, and that's reason enough for users to self-police it. |
14:35:17 | FromDiscord | <ache of head> but see, this is just how i express amusement |
14:35:26 | FromDiscord | <ache of head> unless i'm in an argument and i'm mocking someone |
14:35:31 | FromDiscord | <ache of head> "lmao" means that i enjoyed someone's joke |
14:35:37 | FromDiscord | <lqdev> Evolver: one thing i try to do is keep the swear words down on #nim, only use them on #nim-offtopic |
14:35:44 | PMunch | I guess it's similar to how lol was originally an abbreviation but has now sort of morphed into it's own expression |
14:35:49 | FromDiscord | <shadow.> yeah |
14:36:01 | FromDiscord | <shadow.> i don't use "lmao" because it's a swear, just because it's a generic reaction |
14:36:11 | PMunch | I tend to use "Haha" instead |
14:36:28 | ForumUpdaterBot | New thread by JPLRouge: thread vscode error juste is normal , see https://forum.nim-lang.org/t/7237 |
14:36:32 | FromDiscord | <ache of head> other than that |
14:36:37 | FromDiscord | <ache of head> i feel like all of them have a different ring to them |
14:37:06 | FromDiscord | <sealmove> oh wow, `_` is valid in nim but `_something` isn't |
14:37:10 | FromDiscord | <sealmove> ? |
14:37:41 | FromDiscord | <lqdev> yeah |
14:37:47 | FromDiscord | <lqdev> sometimes _ is used as a placeholder |
14:37:52 | FromDiscord | <lqdev> like `for _ in 1..5` |
14:37:55 | FromDiscord | <shadow.> for saying |
14:37:56 | FromDiscord | <shadow.> hey! |
14:37:56 | FromDiscord | <Recruit_main707> Basically, Nim ignores different ways of writing function names, except the firs character |
14:37:58 | FromDiscord | <sealmove> yes i see i see |
14:37:58 | FromDiscord | <shadow.> i don't need this! |
14:37:59 | FromDiscord | <lqdev> or `let (_, _, ext) = x.splitFile` |
14:38:04 | FromDiscord | <shadow.> ye |
14:38:07 | FromDiscord | <Recruit_main707> And that |
14:38:33 | FromDiscord | <sealmove> is there some other kind of ident that is not valid for names but can be used by macros? |
14:38:41 | FromDiscord | <lqdev> PMunch: ah yes, your classic "Haha :P" |
14:39:09 | FromDiscord | <lqdev> anyways |
14:39:14 | FromDiscord | <sealmove> for example i can provide end user with `_` which can't conflict with his variables |
14:39:29 | FromDiscord | <sealmove> so i was hoping for `_specialVar` but it doesn't work |
14:39:39 | FromDiscord | <lqdev> i generalized my Nim linter for lite, now it's possible to make it lint languages other than Nim |
14:39:45 | FromDiscord | <lqdev> think i'm gonna publish it soom |
14:39:47 | FromDiscord | <lqdev> (edit) "soom" => "soon" |
14:39:50 | PMunch | @sealmove genSym is probably what you want |
14:40:03 | FromDiscord | <Recruit_main707> Id use a symbol like ! for that |
14:40:21 | FromDiscord | <sealmove> but such symbols are operators, they are not parsed as identifiers |
14:40:58 | PMunch | What are you actually trying to do? |
14:41:27 | PMunch | If 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:59 | FromDiscord | <sealmove> https://github.com/sealmove/binaryparse#repetition |
14:42:53 | FromDiscord | <sealmove> need to provide user with implicit variables for stream, loop index, and current element. |
14:43:25 | narimiran | PMunch: you asked about today's task. it is harder only in a sense that you cannot brute force it. |
14:43:25 | PMunch | Ah |
14:43:51 | narimiran | and 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:02 | PMunch | @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:13 | PMunch | narimiran, hmm interesting! |
14:44:33 | FromDiscord | <sealmove> when you say "those"? |
14:44:43 | PMunch | Without the _ |
14:45:06 | PMunch | narimiran, so no quadruple for loop today :P |
14:45:07 | FromDiscord | <shadow.> yeah im kinda tripped up on part one rn bc the wording is kinda awkward |
14:45:11 | FromDiscord | <shadow.> lol |
14:45:13 | FromDiscord | <shadow.> probably not |
14:45:15 | narimiran | PMunch: :P |
14:45:31 | narimiran | now it will be too easy for you :P |
14:45:31 | PMunch | Streaming in half an hour |
14:45:38 | PMunch | Haha, okay :P |
14:45:58 | PMunch | I'll take your word for it for now |
14:46:03 | narimiran | mwahahaha |
14:46:05 | PMunch | And blame you if I can't figure it out! |
14:46:10 | FromDiscord | <sealmove> btw, I want to use a dependency |
14:46:18 | PMunch | Which one? |
14:46:27 | narimiran | PMunch: yeah, i also blamed myself this morning |
14:46:58 | FromDiscord | <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:59 | FromDiscord | <shadow.> wait |
14:48:01 | FromDiscord | <shadow.> how do i do this without |
14:48:03 | FromDiscord | <shadow.> recursion |
14:48:11 | FromDiscord | <shadow.> i need some way to handle branch possibilities, no? |
14:49:30 | disruptek | planetis[m]: did you look at bitabs before making spareset? |
14:49:47 | disruptek | sparseset, too. i can't fucking spell it. ever. |
14:50:50 | FromDiscord | <shadow.> !repo bitabs |
14:50:51 | disbot | no results 😢 |
14:50:57 | FromDiscord | <shadow.> is that a pkg or something |
14:51:10 | PMunch | Oh 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:59 | disruptek | nevermind, it's in ic but it's not published anywhere else. |
14:53:15 | FromDiscord | <shadow.> ah i see |
14:53:30 | FromDiscord | <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:52 | FromDiscord | <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:33 | FromDiscord | <sealmove> what's the correct practice for proc aliases? |
15:06:41 | FromDiscord | <sealmove> (2 different names for the same proc) |
15:06:49 | FromDiscord | <sealmove> not proc variables |
15:08:02 | FromDiscord | <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:03 | Zevv | you can't const something that's calculated at run time |
15:09:13 | Zevv | you can do "let a = readLine()" |
15:09:17 | Zevv | not "const a = readLine()" |
15:09:23 | Zevv | because it needs to be available at compile time |
15:09:32 | Zevv | const = compile time |
15:09:52 | FromDiscord | <trippleA> Is it wise to prefer const over let if I have a choice between the two? |
15:10:31 | FromDiscord | <sealmove> yes, because you ensure your program will have the value hardcoded |
15:10:39 | FromDiscord | <sealmove> instead of calculating it |
15:10:52 | FromDiscord | <trippleA> But I thought let was hardcoded also? |
15:10:58 | FromDiscord | <sealmove> not it's not |
15:11:04 | FromDiscord | <lqdev> not always |
15:11:09 | FromDiscord | <sealmove> it just ensures that your own code will not change it |
15:11:16 | FromDiscord | <sealmove> it's just type safety |
15:11:41 | FromDiscord | <trippleA> So the code can't change let, but I can manually change let myself? |
15:12:10 | FromDiscord | <sealmove> trippleA can you rephrase your last question? 😛 |
15:12:24 | FromDiscord | <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:47 | FromDiscord | <lqdev> @kenran destructors |
15:13:01 | FromDiscord | <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:21 | FromDiscord | <shadow.> uhm |
15:13:27 | FromDiscord | <lqdev> no |
15:13:40 | FromDiscord | <shadow.> const is an immutable evaluated at compile let |
15:13:42 | FromDiscord | <lqdev> you can't redeclare variables |
15:13:44 | FromDiscord | <shadow.> (edit) "let" => "time" |
15:13:46 | FromDiscord | <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:52 | FromDiscord | <shadow.> let is an immutable evaluated at runtime |
15:14:11 | FromDiscord | <trippleA> But how is const hardcoded and let isn't? |
15:14:15 | FromDiscord | <lqdev> what's bracketing? |
15:14:43 | FromDiscord | <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:50 | FromDiscord | <lqdev> while `let` can do calculations during runtime |
15:15:08 | FromDiscord | <trippleA> So it's generally faster to do const over let? |
15:15:12 | FromDiscord | <lqdev> yeah |
15:15:17 | FromDiscord | <shadow.> i mean |
15:15:19 | FromDiscord | <lqdev> but you can't always use it |
15:15:23 | FromDiscord | <shadow.> you only have to evaluate it once when you compile |
15:15:26 | FromDiscord | <lqdev> smart C compilers will constant-fond `let` variables at compile time so you shouldn't worry that much |
15:15:27 | FromDiscord | <shadow.> instead of everytime you run |
15:15:43 | disruptek | constant-fondle? |
15:15:56 | FromDiscord | <lqdev> i had a stroke. |
15:16:00 | FromDiscord | <lqdev> constant-fold. |
15:16:01 | disruptek | noted. |
15:16:33 | FromDiscord | <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:48 | FromDiscord | <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:54 | FromDiscord | <trippleA> Thanks guys for the help |
15:17:12 | FromDiscord | <kenran> Might be the wrong terminology, but it feels like working with continuations I guess. |
15:17:18 | FromDiscord | <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:32 | FromDiscord | <trippleA> got it |
15:17:40 | disruptek | i 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:55 | FromDiscord | <lqdev> @kenran feels a bit inefficient |
15:18:00 | FromDiscord | <lqdev> nim has destructors https://nim-lang.org/docs/destructors.html |
15:18:13 | FromDiscord | <lqdev> and also you can pass a finalizer to `new(x)` |
15:18:36 | PMunch | Stream is live: https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=UPpmXGVFO6w |
15:18:39 | PMunch | Day 10, here we go! |
15:18:40 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2Hre |
15:18:41 | FromDiscord | <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:57 | FromDiscord | <shadow.> im watching this bc i cannot figure out part one lmfao |
15:19:01 | FromDiscord | <shadow.> the wording is so awkward |
15:19:25 | disruptek | that word is awkward. |
15:19:26 | FromDiscord | <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:09 | PMunch | narimiran, stream is live if you're tuning it today :) |
15:20:19 | narimiran | PMunch: youtube link please |
15:20:28 | PMunch | https://www.youtube.com/watch?v=UPpmXGVFO6w |
15:22:27 | FromDiscord | <kenran> Sorry, I don't quite get it yet. This also mentions the "upcoming Nim runtime". but they're in already? |
15:22:37 | FromDiscord | <lqdev> yeah |
15:22:40 | FromDiscord | <kenran> I'm on 1.4.0 I just saw, so I gotta get a newer one probably |
15:22:41 | FromDiscord | <lqdev> you can use them with the default GC |
15:22:44 | * | Cthalupa joined #nim |
15:23:58 | FromDiscord | <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:15 | FromDiscord | <kenran> If the performance suffers later on, I can still try and optimize by doing more stuff manually. |
15:26:35 | ForumUpdaterBot | New 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:18 | FromDiscord | <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:46 | FromDiscord | <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:55 | narimiran | PMunch: diff - 1, not diff + 1 |
15:45:44 | FromDiscord | <lqdev> hm, nim --fullHelp says that --errorMax defaults to 0 but in reality it seems to default to 1 |
15:46:05 | disruptek | ICE ICE baby |
15:46:08 | FromDiscord | <kenran> sent a code paste, see https://play.nim-lang.org/#ix=2Hrq |
15:47:06 | * | a_chou joined #nim |
15:48:56 | disruptek | kenran: 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:13 | FromDiscord | <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:53 | FromDiscord | <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:10 | FromDiscord | <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:35 | FromDiscord | <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:42 | FromDiscord | <shadow.> well im increasing the 3 diff count, no? |
16:03:00 | FromDiscord | <shadow.> bc its before multiplication |
16:03:03 | FromDiscord | <shadow.> and yeah idk if it counts 0 |
16:03:03 | Araq | hmm 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:30 | FromDiscord | <pietroppeter> yes you are increasing it but it should b increased by 1 |
16:03:38 | FromDiscord | <shadow.> OHHH |
16:03:39 | FromDiscord | <shadow.> i see |
16:04:02 | FromDiscord | <pietroppeter> it is easy to mix up stuff like this, I do it all the time 🙂 |
16:04:06 | FromDiscord | <shadow.> do i count the 0? |
16:04:07 | FromDiscord | <shadow.> im not sure |
16:04:19 | FromDiscord | <Esbeesy> Part one is just the differences isn't it? |
16:04:22 | FromDiscord | <shadow.> yeah |
16:04:26 | FromDiscord | <shadow.> do i count the zero plug? |
16:04:30 | FromDiscord | <shadow.> https://hatebin.com/pvqvzqezuk |
16:04:36 | disruptek | Araq: yes, but you don't count. sorry, bud. |
16:04:39 | FromDiscord | <Esbeesy> so you want to count the 0 (broken port) to your first adapter |
16:04:43 | FromDiscord | <shadow.> kk thanks |
16:04:49 | Araq | disruptek, ah ok. |
16:04:58 | FromDiscord | <pietroppeter> mmh, looking better, you probably do already with the initialization of last = 0 |
16:04:58 | FromDiscord | <shadow.> yup got it |
16:05:00 | FromDiscord | <shadow.> thanks guys |
16:05:11 | FromDiscord | <shadow.> question is do i use nums[3] or succ nums |
16:05:13 | FromDiscord | <shadow.> (edit) "nums" => "nums[3]" |
16:05:17 | FromDiscord | <shadow.> (edit) "or" => "+ 1or" |
16:05:29 | FromDiscord | <shadow.> bc i kinda wanna use succ |
16:05:32 | FromDiscord | <Esbeesy> succ? |
16:05:43 | FromDiscord | <shadow.> successor |
16:05:47 | FromDiscord | <Esbeesy> Like the meme? https://media.discordapp.net/attachments/371759389889003532/786624713244934194/iu.png |
16:05:48 | FromDiscord | <shadow.> basically peek of inc |
16:05:49 | FromDiscord | <shadow.> lol |
16:05:54 | FromDiscord | <shadow.> succ 1 == 2 |
16:06:05 | disruptek | i wonder how much money aoc costs the industry every year in wasted effort. |
16:06:13 | FromDiscord | <Esbeesy> Tonnes |
16:06:38 | FromDiscord | <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:14 | FromDiscord | <pietroppeter> when you ARE dealing (scratch not) |
16:07:17 | FromDiscord | <shadow.> yeah true |
16:07:22 | FromDiscord | <shadow.> + 1 is more readable here |
16:07:23 | FromDiscord | <shadow.> but |
16:07:24 | FromDiscord | <shadow.> succ is just so |
16:07:26 | FromDiscord | <shadow.> succ |
16:07:31 | FromDiscord | <shadow.> my humor is broken |
16:07:35 | FromDiscord | <shadow.> or maybe im just 14 |
16:07:39 | FromDiscord | <shadow.> it's one of those |
16:08:11 | narimiran | to all AoC-ers, PMunc4 is currently streaming (and struggling with part 2 :)), take a look! |
16:09:07 | Araq | mratsim: why do you use 'pad: array[CacheLineSize, byte]' |
16:09:16 | FromDiscord | <shadow.> lol hes still on it wow |
16:09:20 | FromDiscord | <shadow.> im going to fail then |
16:09:22 | Araq | and not 'pad: array[CacheLineSize - sizeof(int32), byte]' ? |
16:10:03 | FromDiscord | <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:38 | disruptek | maybe xev will give you what you want. i'm not familiar with sdl. |
16:12:01 | FromDiscord | <kenran> nevermind, found it! the first comment in https://github.com/nim-lang/sdl2/blob/master/src/sdl2/private/keycodes.nim |
16:12:44 | disruptek | that's... not terribly legible. |
16:13:14 | FromDiscord | <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:39 | narimiran | yeah, it makes me feel better knowing i'm not the only one who struggled |
16:14:08 | FromDiscord | <pietroppeter> well, this might be the time that someone takes advantage of these: https://pietroppeter.github.io/adventofnim/2020/day10hints.html |
16:14:27 | narimiran | after 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:34 | FromDiscord | <pietroppeter> (although they are biased toward my approach) |
16:15:32 | FromDiscord | <shadow.> you said you struggle on parsing days, hm? |
16:15:35 | * | Tlangir quit (Quit: Leaving) |
16:15:41 | FromDiscord | <shadow.> what do you usually use to parse |
16:17:15 | narimiran | @pietroppeter do you know your page titles are your local path to file? |
16:17:44 | FromDiscord | <pietroppeter> Yes I do, an issue of nimib I have to fix |
16:18:09 | FromDiscord | <bark> https://media.discordapp.net/attachments/371759389889003532/786627825993777152/Screenshot_20201210-171732_Alarm.png |
16:18:19 | FromDiscord | <bark> karax todo example running as an android app |
16:18:25 | FromDiscord | <pietroppeter> Shadow: strscans and parseutils. Trying to learn npeg and trying to skip learning regexes |
16:18:50 | FromDiscord | <pietroppeter> I had to drop from pmunch stream though |
16:19:37 | FromDiscord | <shadow.> yes i would |
16:19:41 | FromDiscord | <shadow.> highly recommend npeg |
16:19:46 | FromDiscord | <shadow.> makes everything so much easier |
16:20:12 | FromDiscord | <sealmove> huh, I think I found a bug |
16:20:49 | Zevv | in npeg |
16:20:58 | FromDiscord | <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:10 | Zevv | you forget newLit |
16:21:22 | Zevv | always newLit your quote do's |
16:21:30 | FromDiscord | <sealmove> oh hm |
16:22:02 | FromDiscord | <sealmove> no it's not like that |
16:23:06 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2HrF |
16:23:47 | FromDiscord | <sealmove> and I get type missmatch: int literal but expected char |
16:23:48 | FromDiscord | <mratsim> @Araq, today you should use {.align: 64.} |
16:24:12 | FromDiscord | <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:26 | Zevv | sealmove: need context. |
16:26:41 | Zevv | what is myCharVar |
16:27:12 | FromDiscord | <sealmove> just a variable. `let myCharVar = 'a'` |
16:27:23 | Zevv | newLit that, really |
16:27:30 | Zevv | let foo = newLit(myCharVar) |
16:27:34 | Zevv | and use `foo` in your macro |
16:27:41 | FromDiscord | <sealmove> i see thx |
16:28:15 | * | Q-Master joined #nim |
16:28:27 | FromDiscord | <sealmove> oh ok i have a more interesting question |
16:28:37 | FromDiscord | <sealmove> i am using a template that generates a call to a proc |
16:28:53 | FromDiscord | <sealmove> depending on the proc that gets generated, the return type might differ |
16:29:25 | FromDiscord | <sealmove> so I haven't specified a return type for the template, and it seems it returns a NimNode, which is undesirable |
16:29:52 | Zevv | the template does not have a return type, as such |
16:30:07 | * | PMunch quit (Quit: leaving) |
16:30:09 | FromDiscord | <sealmove> right, so it should work |
16:30:22 | Zevv | its "result" is just put at the location of the invocation |
16:31:41 | FromDiscord | <sealmove> oh ok btw this template is generated by a macro... this might be important 😛 |
16:31:54 | Zevv | you know you're on your own now, right |
16:32:19 | Zevv | when in doubt, expand your macro |
16:32:32 | Zevv | use -d:expandMacro=.. (or whatever its called) or `repr` that stuff |
16:32:45 | Zevv | but don't assume anything. |
16:32:49 | FromDiscord | <sealmove> yes I can see the template call is correctly generated |
16:32:58 | Zevv | then it's your fault :) |
16:34:50 | ForumUpdaterBot | New 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:54 | FromDiscord | <shadow.> fuck |
16:39:57 | FromDiscord | <shadow.> this aoc is tough |
16:40:02 | FromDiscord | <Esbeesy> Haha |
16:40:09 | FromDiscord | <Esbeesy> 2 is hard innit |
16:40:12 | FromDiscord | <shadow.> looks like i gotta use math and statistics instead of bruteforcing |
16:40:15 | FromDiscord | <shadow.> have you tried it yet? |
16:40:19 | FromDiscord | <Esbeesy> Done |
16:40:22 | FromDiscord | <shadow.> damn alr |
16:40:39 | FromDiscord | <shadow.> i mean ive figured out ||that there are numbers which can't be removed|| but that's about it |
16:40:40 | Zevv | don't recurse kids. it's bad for you, hmmkaay |
16:41:28 | FromDiscord | <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:29 | FromDiscord | <shadow.> something like that |
16:41:30 | FromDiscord | <Esbeesy> When you see the answer it’s really easy as well |
16:42:11 | FromDiscord | <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:23 | FromDiscord | <shadow.> lmfao |
16:42:31 | FromDiscord | <m0nsta> simon peyton jones has requested your location. |
16:42:41 | FromDiscord | <Esbeesy> “Beck help us!” And then my ADHD addled brain was like “wait I know the answer to AoC now” |
16:42:50 | FromDiscord | <m0nsta> ^in reply to zevv recursion. |
16:43:04 | FromDiscord | <m0nsta> keep forgetting irc replies thing. |
16:43:16 | narimiran | Zevv: you can recurse, but.... remember where you've been ;) |
16:44:53 | Zevv | man I always forget about that |
16:45:03 | Zevv | my memory is not what it was |
16:45:14 | narimiran | you forgot to remember to (not) forget |
16:45:26 | narimiran | the beatles said something about that |
16:48:41 | FromDiscord | <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:04 | FromDiscord | <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:25 | FromDiscord | <shadow.> whew |
17:19:27 | FromDiscord | <shadow.> solved part two |
17:19:29 | FromDiscord | <shadow.> jesus, that was difficult |
17:21:30 | FromGitter | <bung87> what's these means in roc `%x21 / %x23-5B ` |
17:21:34 | FromGitter | <bung87> rfc |
17:21:54 | FromDiscord | <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:23 | FromDiscord | <lqdev> @shadow. `yourTable.getOrDefault(key, defaultValue)` |
17:25:47 | Zevv | ~your initial hunch seems insightful |
17:25:47 | Zevv | but calling yourself is frightful |
17:25:47 | Zevv | it's ok, don't be afraid |
17:25:48 | disbot | no footnotes for `your`. 🙁 |
17:25:49 | Zevv | iterate, iterate, iterate! |
17:26:04 | FromDiscord | <shadow.> that doesn't set it internally, does it? |
17:26:10 | FromDiscord | <lqdev> no |
17:26:16 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HrZ |
17:26:17 | FromDiscord | <shadow.> if poss[adapter] doesn't exist |
17:26:22 | FromDiscord | <shadow.> is there a way for it to set to `default int` |
17:26:25 | FromDiscord | <shadow.> and then do the operation? |
17:26:29 | FromDiscord | <lqdev> then mgerOrPut is what you're looking for |
17:26:36 | FromDiscord | <shadow.> ty |
17:26:38 | Zevv | dudes really are you ignoring my christmas carol |
17:26:40 | FromDiscord | <lqdev> `poss.mgetOrPut(adapter) += poss[diff]` |
17:27:17 | FromDiscord | <shadow.> ty |
17:27:42 | FromDiscord | <zetashift> @Zevv I like it! |
17:33:02 | disruptek | cps recursion is harmless. 😁 |
17:33:34 | FromDiscord | <shadow.> lol |
17:35:06 | disruptek | i got rejected for a job at github in record time. |
17:35:18 | disruptek | less than 24hrs. performance is improving. |
17:35:47 | FromDiscord | <ache of head> they don't deserve you, disruptek |
17:36:07 | disruptek | no one deserves me, but someone is gonna get fuckin' stuck with me. |
17:37:25 | disruptek | hopefully, it's not my parents. |
17:37:59 | FromDiscord | <shadow.> perhaps they declined you because they saw my pr spam in testes |
17:38:00 | FromDiscord | <Idefau> you can live with me |
17:38:11 | FromDiscord | <shadow.> that would be interesting |
17:38:15 | FromDiscord | <Idefau> indeed |
17:38:16 | FromDiscord | <shadow.> have you done aoc today |
17:38:18 | FromDiscord | <shadow.> good luck |
17:38:23 | FromDiscord | <Idefau> i havent done aoc in a week |
17:38:25 | FromDiscord | <shadow.> wow |
17:38:28 | FromDiscord | <shadow.> lacking |
17:38:32 | disruptek | i don't think i could live with you. |
17:38:40 | disruptek | lack of motivation is a real downer. |
17:38:48 | disruptek | it's the last influence i need right now. |
17:38:51 | FromDiscord | <shadow.> if you lived with me you could just come slap me when i didn't do local tests |
17:38:52 | FromDiscord | <Idefau> 😦 |
17:39:14 | FromDiscord | <shadow.> granted, it'd be child abuse but i'm sure that's the least of your worries |
17:39:18 | disruptek | my parents are looking for a place to stay, though. |
17:40:32 | FromDiscord | <shadow.> hm |
17:40:40 | FromDiscord | <shadow.> we could get two generations of abuse in that case |
17:40:48 | FromDiscord | <shadow.> tis the season? |
17:40:59 | FromDiscord | <shadow.> what's the saying |
17:41:03 | FromDiscord | <shadow.> the more the merrier? |
17:42:51 | FromDiscord | <shadow.> @Esbeesy holy |
17:42:56 | FromDiscord | <shadow.> our solutions are nearly identical for part two |
18:04:20 | disruptek | domestic abuse begins at home. |
18:05:06 | * | vsantana joined #nim |
18:08:54 | FromDiscord | <shadow.> wrong |
18:09:03 | FromDiscord | <shadow.> it begins when you tell your parents you'd rather program then go outside |
18:10:16 | FromDiscord | <Idefau> mine got used to it |
18:10:16 | FromDiscord | <shadow.> disruptek how many years has it been since you exited the womb |
18:10:39 | FromDiscord | <Idefau> thats an interesting way to ask |
18:11:18 | FromDiscord | <shadow.> otherwise he'll swindle the question |
18:11:19 | FromDiscord | <shadow.> and be like |
18:11:25 | FromDiscord | <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:59 | disruptek | depends on whose womb you're referring to. |
18:24:20 | FromDiscord | <shadow.> the womb of your biological mother |
18:24:33 | FromDiscord | <shadow.> what would the answer be in that case |
18:24:46 | FromDiscord | <$not> <a:aPES_EvilPlan:765876509557915668> |
18:24:52 | disruptek | i'm a very immature 44. |
18:24:59 | FromDiscord | <shadow.> sounds about right |
18:25:04 | disruptek | but i fuck like a 20yo. |
18:25:27 | FromDiscord | <shadow.> hmm, i'll send a hooker your way and ask for a rating in float form |
18:25:59 | disruptek | make sure he's a redhead. |
18:26:28 | FromDiscord | <shadow.> who else would i even consider? |
18:27:50 | FromDiscord | <Recruit_main707> offtopic... :/ |
18:27:57 | disruptek | how is it that i'm getting an nkIntLit export pattern? |
18:28:10 | disruptek | export 1 |
18:28:17 | disruptek | that's not a thing, right? 🤣 |
18:29:04 | FromDiscord | <shadow.> if only there were some way to test it locally |
18:29:25 | FromDiscord | <shadow.> let me take a guess |
18:29:30 | FromDiscord | <shadow.> cannot export 1 |
18:32:25 | FromDiscord | <squid> How do you do python fstrings in nim? |
18:32:32 | FromDiscord | <squid> or like javascript `` strings |
18:32:53 | FromDiscord | <mratsim> import strformat and &"your{magic]{interpolation}" |
18:33:06 | FromDiscord | <mratsim> your{magic}{interpolation} |
18:33:11 | FromDiscord | <squid> ok |
18:33:12 | FromDiscord | <squid> thank you |
18:34:26 | * | habamax quit (Ping timeout: 256 seconds) |
18:36:14 | FromDiscord | <squid> I am not getting it to work 😐 |
18:36:50 | FromDiscord | <squid> Is there any way to format like C printf |
18:37:13 | disruptek | sure, you can use C printf. |
18:37:23 | disruptek | it's literally C printf. |
18:37:29 | FromDiscord | <squid> I mean like |
18:37:35 | FromDiscord | <squid> Just formatting so it returns a string |
18:37:45 | mipri | that's not what printf does. |
18:37:45 | FromDiscord | <squid> "%s", foo |
18:37:56 | FromDiscord | <squid> I know. |
18:37:59 | disruptek | you mean C sprintf? |
18:38:05 | FromDiscord | <squid> yeah maybe |
18:38:09 | disruptek | try importing sprintf. |
18:38:13 | FromDiscord | <squid> I just meant the formatting part of printf |
18:38:15 | FromDiscord | <ache of head> i think squid meant the way that printf formats strings |
18:38:18 | FromDiscord | <ache of head> yeah |
18:38:18 | FromDiscord | <squid> Yes |
18:38:37 | disruptek | sprintf formats it exactly as it does in C... because it /is/ C. |
18:38:37 | FromDiscord | <shadow.> code and error? |
18:38:41 | * | disruptek 🤯 |
18:38:42 | mipri | the two big string interpolation options in Nim are strformat's & and strutils' % |
18:38:54 | disruptek | ~paste |
18:38:55 | disbot | paste: 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:15 | hmmmmm | wat I can & instead of fmt |
18:39:21 | hmmmmm | what sorcery is dat |
18:39:24 | disruptek | ~& |
18:39:24 | disbot | &: 11unreachable |
18:39:30 | mipri | rather 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:13 | FromDiscord | <shadow.> hmmmmm: the sorcery of custom prefix operators |
18:40:28 | disruptek | fmt and & aren't exactly the same. |
18:40:32 | FromDiscord | <shadow.> true |
18:40:42 | FromDiscord | <shadow.> i just always use & |
18:40:51 | disruptek | fmt is spelled with a `t`. |
18:42:09 | FromDiscord | <shadow.> that it is |
18:42:43 | FromDiscord | <shadow.> wait are the tools on xs made by you? |
18:42:58 | hmmmmm | the only thing I regret from python is their beautiful floats with no 00000001 |
18:43:05 | FromDiscord | <shadow.> that's the only thing you regret? |
18:43:09 | hmmmmm | yes! |
18:43:11 | FromDiscord | <shadow.> oh wait |
18:43:12 | FromDiscord | <shadow.> you meant |
18:43:13 | FromDiscord | <squid> `&"Username: {username} Password: {password}"` Is this correct? |
18:43:13 | FromDiscord | <shadow.> nvm |
18:43:15 | hmmmmm | I'm very comfy on nime :> |
18:43:25 | FromDiscord | <shadow.> should be |
18:43:33 | FromDiscord | <shadow.> are username and password defined |
18:43:34 | FromDiscord | <shadow.> send the code |
18:43:41 | FromDiscord | <squid> Yes they are defined |
18:43:58 | FromDiscord | <squid> "Username: %s Password: %s", username, password <-- This work supplied to an imgui text |
18:44:13 | mipri | !eval import strformat; let (u, p) = ("user", "pass"); echo &"Username: {u} Password: {p}" |
18:44:16 | NimBot | Username: user Password: pass |
18:44:20 | FromDiscord | <squid> I think I know |
18:44:22 | FromDiscord | <shadow.> again, what's your code squid |
18:44:33 | FromDiscord | <squid> It is from a C library so the string ends after the first variable |
18:44:45 | FromDiscord | <squid> as it ends with \0 |
18:44:52 | FromDiscord | <shadow.> then convert it to a string |
18:45:03 | FromDiscord | <mratsim> echoing a password is wrong |
18:45:09 | FromDiscord | <shadow.> true |
18:45:10 | FromDiscord | <mratsim> wroooooooooonnnnnnggggg |
18:45:11 | FromDiscord | <squid> = |
18:45:14 | FromDiscord | <squid> (edit) "=" => "?" |
18:45:17 | FromDiscord | <mratsim> my eyes, they bleeeed |
18:45:23 | FromDiscord | <squid> It is just a debug thingy |
18:45:32 | FromDiscord | <shadow.> alright but can we see the code at least to help you |
18:45:33 | FromDiscord | <mratsim> you killed me |
18:45:53 | FromDiscord | <shadow.> because otherwise we're blindly stabbing when the issue is probably higher up |
18:45:53 | FromDiscord | <mratsim> I'll have nightmares of password being printed on console tonight |
18:46:31 | FromDiscord | <squid> sent a code paste, see https://play.nim-lang.org/#ix=2Hsp |
18:46:36 | hmmmmm | you can't see the code! you would steal it and profit from it :| |
18:47:09 | FromDiscord | <shadow.> i'm going to make millions from printing passwords |
18:47:14 | hmmmmm | lol |
18:47:19 | FromDiscord | <shadow.> what does `igInputText` do |
18:47:20 | mipri | as stated already, and as shown above, there's nothing wrong with your usage of & there |
18:47:21 | FromDiscord | <mratsim> let text = |
18:47:21 | FromDiscord | <shadow.> nvm, lib function |
18:47:33 | hmmmmm | disruptek are you around |
18:47:36 | FromDiscord | <shadow.> ah yes you need a word before assigning text unless it's declared higher up |
18:47:36 | disruptek | no. |
18:47:39 | FromDiscord | <squid> mipri, I know they just asked for the source |
18:47:51 | FromDiscord | <squid> Oh sorry. Yeah it is defined under the other variables |
18:48:01 | FromDiscord | <shadow.> and what's the error? |
18:48:03 | FromDiscord | <squid> it isnt giving an error. |
18:48:04 | hmmmmm | hey disruptek can you make one of your fancy presentations like CPS to make floats in nim as beautiful as in python |
18:48:09 | FromDiscord | <shadow.> then what's the issue |
18:48:14 | disruptek | hmmmmm: i tried. |
18:48:18 | hmmmmm | really? |
18:48:19 | hmmmmm | :O |
18:48:22 | hmmmmm | u r my hero |
18:48:24 | FromDiscord | <squid> The problem was \0 on the strings the library returned i think |
18:48:28 | FromDiscord | <mratsim> if your password has a \0 inside, the C library might early exit |
18:48:31 | narimiran | hmmmmm: we had "beautiful floats" before, but it was changed to what it is today |
18:48:39 | FromDiscord | <mratsim> welcome to C strings |
18:48:39 | hmmmmm | jesus |
18:48:45 | hmmmmm | and disruptek allowed that? |
18:48:47 | disruptek | yeah, two other people started similar efforts to port ryu to nim so i abandoned my work. then they abandoned theirs. 🤷 |
18:48:47 | hmmmmm | :| |
18:49:08 | narimiran | hmmmmm: that was before disruptek reign |
18:49:13 | hmmmmm | I see |
18:49:14 | FromDiscord | <squid> I figured that out before, mratsim. I have done C programming before just didnt think of it |
18:49:40 | FromDiscord | <squid> Whats the easiest way to remove \0 in those strings? |
18:49:50 | disruptek | i don't care what they look like, much, but i'm annoyed that they aren't as fast as they could be. |
18:50:07 | FromDiscord | <mratsim> a library that is keen on manipulating string in a safe way requires ptr char + len in C |
18:50:28 | FromDiscord | <shadow.> convert them to normal strings? |
18:50:32 | FromDiscord | <shadow.> are they cstrings or strings |
18:50:32 | FromDiscord | <squid> How? |
18:50:39 | FromDiscord | <mratsim> removing \0 from a password or username will likely trigger bugs. |
18:50:43 | FromDiscord | <squid> I use newString as you can see in the code i posted |
18:50:43 | hmmmmm | they should be beautiful too. 70.9300000000001 is a thing from the movie IT |
18:50:54 | FromDiscord | <mratsim> Nim strings are basically cstring + len |
18:50:58 | FromDiscord | <shadow.> yeah |
18:51:07 | FromDiscord | <squid> mratsim, then what do I do? |
18:51:12 | FromDiscord | <mratsim> the issue is if your password or username contains \0 |
18:51:15 | FromDiscord | <shadow.> is it a string |
18:51:17 | FromDiscord | <shadow.> or a cstring |
18:51:18 | narimiran | hmmmmm: i think you still don't understand the problem |
18:51:20 | FromDiscord | <shadow.> print its typeof |
18:51:28 | narimiran | hmmmmm: ...and that's why they need to stay ugly |
18:51:39 | FromDiscord | <mratsim> it doesn't matter, when passed to imgui Nim will extract the cstring part without the len |
18:51:47 | FromDiscord | <shadow.> ah i see |
18:51:48 | FromDiscord | <squid> string |
18:51:50 | FromDiscord | <shadow.> ohh right |
18:51:51 | FromDiscord | <shadow.> implicit |
18:51:54 | FromDiscord | <shadow.> hmm |
18:52:03 | FromDiscord | <shadow.> i mean you could do str[0..^2] but don't |
18:52:17 | FromDiscord | <squid> My problem is that &"Username: {username} Password: {password}" stops early |
18:52:20 | FromDiscord | <mratsim> you should prevalidate the input so that there is no \0 character |
18:52:21 | hmmmmm | hey 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:29 | narimiran | ~ninp |
18:52:29 | disbot | ninp: 11nim is not python!! -- narimiran |
18:52:30 | FromDiscord | <squid> ?? |
18:52:39 | FromDiscord | <shadow.> how do you make a quote |
18:52:44 | FromDiscord | <shadow.> lol |
18:52:50 | mipri | squid, mratsim is trying to help you with the question you asked, which isn't the question you wanted to ask, yet again. |
18:53:17 | narimiran | ~xy is https://en.wikipedia.org/wiki/XY_problem |
18:53:18 | disbot | xy: 11https://en.wikipedia.org/wiki/XY_problem |
18:53:44 | FromDiscord | <squid> Understood. |
18:54:22 | FromDiscord | <squid> My problem is that &"Username: {username} Password: {password}" stops early. (I think because imgui returns strings with extra \0) |
18:54:49 | mipri | squid: 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:09 | FromDiscord | <nikki> oho i see some imgui code here |
18:55:12 | mipri | squid: 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:49 | FromDiscord | <mratsim> can you echo the string returned by imgui |
18:56:04 | FromDiscord | <squid> Just as it is? |
18:56:06 | FromDiscord | <mratsim> I don't understand if your string ends with \0\0 (one from imgui one from Nim) |
18:56:15 | FromDiscord | <mratsim> or if it's something els |
18:56:18 | FromDiscord | <nikki> imgui's string thing returns the length too, so you can use that |
18:56:25 | mipri | !eval echo @"ab\0" |
18:56:27 | FromDiscord | <mratsim> also maybe imgui as a string API with ptr + len? |
18:56:28 | NimBot | @['a', 'b', '\x00'] |
18:56:30 | FromDiscord | <nikki> could also do $result before |
18:56:45 | FromDiscord | <mratsim> unfortunately i got to go |
18:56:45 | FromDiscord | <nikki> this is specifically cimgui |
18:56:46 | mipri | echo it as a set of chars like that to highlight bytes like \0 that would otherwise not print in your terminal |
18:57:50 | FromDiscord | <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:51 | FromDiscord | <squid> So |
18:57:55 | FromDiscord | <squid> Yeahhh |
18:58:24 | FromDiscord | <squid> Soo. that is my problem confirmed. |
18:58:28 | mipri | are you reading into an array of bytes? |
18:58:37 | FromDiscord | <squid> I use newString(64) |
18:58:45 | FromDiscord | <squid> (edit) "newString(64)" => "`newString(64)`" |
18:58:55 | FromDiscord | <squid> (edit) "`newString(64)`" => "`newString(32)`" |
18:59:12 | FromDiscord | <squid> As I am trying to communicate with c |
18:59:14 | FromDiscord | <squid> (edit) "c" => "C" |
18:59:22 | mipri | !eval echo @(newString(2)) |
18:59:25 | NimBot | @['\x00', '\x00'] |
18:59:34 | * | hmmmmm quit (Quit: brb) |
18:59:36 | mipri | similar issue. |
19:00:11 | FromDiscord | <squid> And no idea how to fix it.. |
19:01:15 | mipri | !eval var s = "ab\0\0\0"; echo @($cast[cstring](s[0].addr)) |
19:01:18 | NimBot | @['a', 'b'] |
19:01:46 | FromDiscord | <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:48 | mipri | although 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:51 | FromDiscord | <squid> Lmao. I was just trying it |
19:02:09 | FromDiscord | <nikki> yeah you don't need a seq / dynamically allocated buffer |
19:02:17 | FromDiscord | <nikki> unless you're trying to handle potentially long / expanding text |
19:02:36 | mipri | and then after the read you need a little more work to pull out the string |
19:02:55 | mipri | what I showed above is casting the address of the first byte to a cstring, and then $'ing that to get a string |
19:03:22 | mipri | but 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:34 | FromDiscord | <nikki> it actually doesn't lol |
19:03:44 | mipri | you 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:46 | FromDiscord | <nikki> https://github.com/cimgui/cimgui/blob/98bfe4375548d296dd491dddd81d06bbef9206fd/cimgui.h#L2043 |
19:03:48 | mipri | oh, lame. |
19:03:49 | FromDiscord | <nikki> this is what it does do |
19:04:18 | FromDiscord | <squid> I am still as lost |
19:04:29 | FromDiscord | <squid> How do I do you cast thingy? |
19:04:32 | FromDiscord | <nikki> we've added a lot of info here. do you have specific questions? |
19:04:46 | mipri | $cast[cstring](buffer[0].addr) |
19:04:48 | FromDiscord | <nikki> cast is just `cast[targetType](sourceExpr)` |
19:04:48 | FromDiscord | <squid> he didnt mention the string variable at all |
19:04:52 | Araq | mratsim: 'trySend' returns false when the channel is full |
19:05:12 | FromDiscord | <shadow.> can anyone recommend me a good lib for cli development? |
19:05:15 | Araq | what is the poor programmer supposed to do? |
19:05:40 | mipri | shadow.: cligen |
19:05:43 | FromDiscord | <shadow.> thanks |
19:06:07 | FromDiscord | <squid> `var s = "ab\0\0\0"; echo @($castcstring)` Can anyone explain what this code does? |
19:06:31 | disruptek | Araq: if you do not succeed at first, try and try again. |
19:06:36 | mipri | buffer[0].addr # take a pointer to the first byte of the buffer |
19:06:55 | mipri | cast[cstring](that) # treat it as a C string. trailing NUL byte, all that. |
19:07:02 | mipri | $that # turn it into a Nim string |
19:07:12 | FromDiscord | <squid> Where is buffer[0].addr |
19:07:27 | mipri | you're creating them with newString(64), you said. |
19:07:31 | FromDiscord | <nikki> yeah just do `var buffer = array[64, char]` and then pass `buffer[0].addr` to igText |
19:08:58 | FromDiscord | <squid> Okay. And then to convert that i do $castcstring(buffer) |
19:09:25 | mipri | ok, it sounds like the IRC<->Discord channel is dropping a lot COMPLETELY NORMAL ASCII CHARACTERS again |
19:09:32 | FromDiscord | <squid> Why is this so damn hard. |
19:10:01 | FromDiscord | <squid> Eh. Probably mipri |
19:10:03 | FromDiscord | <nikki> it's not hard, i think it just depends on understanding the underlying model that nim and c are sharing |
19:10:19 | FromDiscord | <nikki> they are talking through addresses over the same underlying memory |
19:10:25 | FromDiscord | <nikki> but they don't have a shared concept of nim strings |
19:10:31 | mipri | https://play.nim-lang.org/#ix=2Hst <- |
19:11:00 | FromDiscord | <nikki> as i said before @squid -- `cast[targetType](sourceExpr)` |
19:11:26 | FromDiscord | <nikki> so `cast[cstring](buffer[0].addr)` give you the `cstring` |
19:11:28 | mipri | when 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:30 | FromDiscord | <squid> oh wow. mipri. it dropped a lot of stuff |
19:11:32 | FromDiscord | <nikki> if you `$that` you get the nim string |
19:12:24 | FromDiscord | <nikki> sent a code paste, see https://play.nim-lang.org/#ix=2Hsu |
19:12:27 | FromDiscord | <squid> var username = array[32, char] -- Now this isnt valid for me |
19:12:43 | mipri | you're assigning a type there |
19:12:44 | FromDiscord | <nikki> i'm silly, it's `:` |
19:13:07 | FromDiscord | <nikki> `var b: array[64, char]` |
19:13:22 | FromDiscord | <nikki> mainly it's good to make sure it's clear why this works |
19:13:52 | FromDiscord | <squid> I need to re watch a beginner nim video again |
19:14:04 | FromDiscord | <nikki> that won't help unless it covers this code specifically |
19:14:12 | FromDiscord | <nikki> also `igInputText` may have a buflen arg; it's good to pass the same 64 to that |
19:14:49 | FromDiscord | <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:59 | FromDiscord | <squid> I couldn't remember how to assign a variable |
19:15:42 | FromDiscord | <nikki> i wouldn't overindex on that, i think understanding the underlying concept might be the most important thing here |
19:16:46 | FromDiscord | <squid> Now it works. |
19:17:00 | FromDiscord | <squid> But really ugly 😄 |
19:17:05 | FromDiscord | <squid> text = &"Username: {$cast[cstring](username[0].addr)} Password: {$cast[cstring](password[0].addr)}" |
19:17:16 | FromDiscord | <nikki> the main thing here is the C api you're using doesn't lead to idiomatic usage from the nim side |
19:17:21 | FromDiscord | <nikki> you can wrap igInputText in something nicer |
19:17:58 | FromDiscord | <nikki> something that has the array[64, char] inside, and then returns the casted string |
19:18:10 | FromDiscord | <nikki> bonus points for making the 64 a static param |
19:18:13 | FromDiscord | <squid> I might try nimgui |
19:18:34 | FromDiscord | <nikki> text inputs are the only case where you have this buffer thing happen, everything else usually works fine |
19:18:44 | FromDiscord | <nikki> and it's beneficial to have access to the whole api and up to date with upstream |
19:18:47 | FromDiscord | <nikki> if you go the direct C route |
19:19:40 | FromDiscord | <nikki> just checked nimgui -- it also uses a cstring so -- you'll have the same thing |
19:19:48 | FromDiscord | <nikki> it doesn't do any higher level wrapping |
19:19:55 | FromDiscord | <squid> oof |
19:20:04 | FromDiscord | <nikki> you can write a higher level wrapper for your use case, it's worth it |
19:20:25 | FromDiscord | <nikki> a benefit is that you know what's going on and how many allocations are being made etc. |
19:21:18 | FromDiscord | <squid> And that wrapper, would that just be a function that returns other stuff and runs other code before/after that igInputText |
19:21:31 | FromDiscord | <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:31 | FromDiscord | <nikki> yeah -- and returns the string (i.e., the result of `$blah`) |
19:23:20 | FromDiscord | <squid> A mutable normal string could also work |
19:23:35 | * | GitterIntegratio joined #nim |
19:23:43 | FromDiscord | <nikki> if it's preallocated with enough size. the main thing is the code at the callsite is not that much simpler |
19:23:57 | FromDiscord | <nikki> like, `var result = myInputText("password", 64)` seems nice right? |
19:24:10 | FromDiscord | <squid> I mean yeah |
19:24:15 | FromDiscord | <squid> I just dont know how imgui works |
19:24:25 | FromDiscord | <squid> It might write every frame |
19:24:45 | FromDiscord | <nikki> i know how imgui works, and i can tell you that it does 🙂 |
19:25:07 | FromDiscord | <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:20 | FromDiscord | <squid> Is that bad for performance? |
19:25:25 | FromDiscord | <nikki> nah it's fine |
19:25:43 | FromDiscord | <squid> Would I allocate the array (every frame) in the wrapper? |
19:25:58 | FromDiscord | <nikki> the array is on the stack and the allocation is pretty cheap |
19:26:15 | FromDiscord | <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:43 | FromDiscord | <nikki> the main concern is if you have like over 3000 of these in a huge scrollview |
19:26:44 | mipri | https://play.nim-lang.org/#ix=2Hsy <- getInput's what I'd write here |
19:26:49 | FromDiscord | <nikki> but, even then just tryit and see |
19:26:51 | FromDiscord | <squid> is there any free() in Nim or does the gc do that normally? |
19:27:32 | FromDiscord | <squid> Oh. From reading your code mipri. I dont need to free or anything |
19:27:36 | FromDiscord | <nikki> is this a general question? or related to the example |
19:27:36 | FromDiscord | <Zachary Carter> yes there is a free |
19:27:52 | FromDiscord | <squid> It was more related to the example. |
19:27:56 | FromDiscord | <nikki> you don't need to free because you didn't allocate any memory or receive ownership |
19:28:05 | FromDiscord | <nikki> but, thereis also a free for when that does happen |
19:28:19 | FromDiscord | <squid> Isnt array[32, char] an allocation? |
19:28:23 | FromDiscord | <nikki> the array is on the stack. and the result of `$` is a tracked ref |
19:28:38 | FromDiscord | <nikki> yeah you didn't do somethign like `alloc0` is what i meant |
19:30:45 | mipri | manual 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:21 | mipri | ah that last link has a bad use of sizeof |
19:32:42 | mipri | https://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:57 | FromDiscord | <nikki> @squid i think https://play.nim-lang.org/#ix=2HsC is a good way to go |
19:33:05 | FromDiscord | <nikki> i left out extra params to igInputText as '...' |
19:33:39 | FromDiscord | <squid> What is the static keyword? |
19:33:48 | FromDiscord | <squid> Is it just non-mutable then? |
19:33:54 | FromDiscord | <nikki> it just means you have to specify that at compile time |
19:33:58 | FromDiscord | <nikki> that makes it so the array can be stack allocated |
19:34:29 | FromDiscord | <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:13 | FromDiscord | <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:20 | FromDiscord | <nikki> like `username = myInputText("username", username)` |
19:35:28 | * | sagax joined #nim |
19:36:10 | FromDiscord | <nikki> anyways i would suggest getting it working, then adjusting as you need |
19:37:22 | FromDiscord | <squid> 0.ImguiInputTextFlags |
19:37:24 | FromDiscord | <squid> What is this? |
19:37:33 | FromDiscord | <squid> Flags is an enum |
19:37:51 | FromDiscord | <nikki> it's a conversion. `0.SomeType` converts to that type |
19:37:56 | FromDiscord | <squid> Oh |
19:38:04 | FromDiscord | <squid> So it is just 0 but that enum |
19:38:06 | FromDiscord | <nikki> `SomeType(0)` is equivalent |
19:38:17 | FromDiscord | <nikki> i believe so yeah |
19:38:30 | FromDiscord | <nikki> for the flags case it's mainly because zero flags means default |
19:38:34 | FromDiscord | <nikki> in the ig api |
19:38:45 | mipri | !eval echo (0.FileMode, 0.char, 0.int) |
19:38:48 | NimBot | (fmRead, '\x00', 0) |
19:41:26 | FromDiscord | <squid> hmm. That doesnt work as imgui uses the buffer as the text |
19:41:33 | FromDiscord | <squid> So after one frame its back to none |
19:41:36 | FromDiscord | <squid> (edit) "none" => "nothing" |
19:42:33 | FromDiscord | <squid> I could have the normal string variable as input and set the array to that |
19:42:42 | FromDiscord | <squid> It seems bad |
19:43:37 | FromDiscord | <squid> Oh. This is what you were talking about before |
19:46:30 | FromDiscord | <squid> How do I overwrite the first characters in the array with my string? |
19:48:40 | mipri | https://play.nim-lang.org/#ix=2HsK |
19:48:53 | FromDiscord | <mratsim> @Araq that's the whole point |
19:49:13 | FromDiscord | <mratsim> if you have infinite buffer channels that's a DOS attack waiting to happen |
19:49:33 | FromDiscord | <mratsim> otherwise you need to expand the buffer |
19:49:54 | FromDiscord | <squid> mipri, And to avoid buffer overflow? |
19:50:02 | FromDiscord | <squid> (edit) "buffer overflow?" => "writing past the array limit?" |
19:50:43 | FromDiscord | <mratsim> Also this gives backpressure to the system, which is important as well |
19:51:15 | mipri | these 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:46 | mipri | I would look at not having to do this. What you're asking for is pretty weird. |
19:51:50 | FromDiscord | <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:36 | FromDiscord | <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:42 | mipri | with that said, no-addr version: https://play.nim-lang.org/#ix=2HsN |
19:52:57 | mipri | why do you need to write to that buffer though? |
19:53:08 | mipri | copying out of it, we've already shown |
19:53:43 | FromDiscord | <squid> I need it to have the same content every time I run the function |
19:54:04 | FromDiscord | <squid> But I only want a normal string variable outside to pass inside as var string |
19:54:51 | FromDiscord | <squid> Writing this wrapper is hard... |
19:55:23 | avass | If 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:46 | FromDiscord | <squid> mipri, https://play.nim-lang.org/#ix=2HsQ |
19:57:35 | FromDiscord | <squid> That doesnt work either |
19:57:38 | FromDiscord | <squid> Which I dont know why |
19:57:52 | mipri | why do you need to write to that buffer again? |
19:58:01 | mipri | it's stack allocated |
19:58:21 | mipri | var copy = string_buf; copy.setLen(len) |
19:58:25 | FromDiscord | <squid> imgui uses the buffer as what to draw to the input box and stores it there too. |
19:58:34 | mipri | that doesn't imply what you're doing. |
19:59:24 | mipri | rip_igInputText returns an empty string, and writes to its string_buf parameter instead |
19:59:26 | * | Gustavo6046 joined #nim |
19:59:31 | FromDiscord | <squid> Oh yeaj |
19:59:33 | FromDiscord | <squid> (edit) "yeaj" => "yeah" |
19:59:53 | * | hmmm joined #nim |
19:59:53 | FromDiscord | <squid> It was supposed to return |
19:59:55 | FromDiscord | <squid> Then I changed that |
19:59:59 | mipri | since you have username = rip_igInputText(..., username, ...), you're writing to username and then blowing it away in the same call |
20:00:14 | FromDiscord | <squid> bruh. |
20:00:16 | FromDiscord | <squid> I am dumb.. |
20:00:18 | mipri | what are you using it for to begin with, as a parameter? |
20:00:33 | hmmm | squid don't worry we are nation |
20:00:52 | FromDiscord | <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:15 | FromDiscord | <squid> That wrapper is supposed to change the buffer type from the weird array to basically a string |
20:01:16 | hmmm | is there a nice lib that understands "1.000.000,00" as 1000000.00 |
20:03:06 | mipri | squid: ok, what I would suggest here is the strlen solution |
20:06:36 | mipri | https://play.nim-lang.org/#ix=2HsT |
20:06:54 | mipri | there, 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:40 | mipri | but after the first call to getInput() it's always a normal string with an appropriate size and without trailing NUL bytes |
20:08:42 | mipri | the .setLen() in getInput's just to save you give you pass a short string to it. |
20:08:57 | * | kenran joined #nim |
20:09:34 | mipri | apart from that possibly happening there won't be any allocation after the newString()s |
20:11:15 | FromDiscord | <lytedev> !eval import strutils, macros; template nn(s: string): float64 = s.replace(".").replace(",",".").parseFloat↵echo(nn"1.000.000,00") |
20:11:17 | NimBot | <no output> |
20:12:21 | FromDiscord | <lytedev> mipri: https://play.nim-lang.org/#ix=2HsW |
20:12:22 | FromDiscord | <squid> mipri, Thank you. That seems like a better solution in my case |
20:12:23 | FromDiscord | <squid> if it works |
20:19:32 | FromDiscord | <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:17 | shuji | how do you assign to an Unchecked array? |
20:30:37 | shuji | let arr1:UncheckedArray[int]=[7,8] |
20:33:05 | * | Q-Master quit (Ping timeout: 240 seconds) |
20:33:12 | FromDiscord | <shadow.> anyone know of a cross-platform solution to reading clipboard? |
20:33:14 | shuji | a better question would be how to pass a bidimensional array into a C function? |
20:33:20 | FromDiscord | <shadow.> i could use winim but i wanna make this work on unix too eventually |
20:33:48 | mipri | https://play.nim-lang.org/#ix=2Ht5 <- unchecked arrays |
20:35:17 | shuji | i see thanks maybe that is not what I am looking for |
20:35:38 | FromDiscord | <Quibono> Semi seriously, could you make an os in Nim since it compiles to C? |
20:35:47 | FromDiscord | <zetashift> yes checkout nimkernel |
20:37:19 | * | vicfred joined #nim |
20:38:58 | FromDiscord | <Quibono> Cool thanks |
20:42:32 | planetis[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:10 | planetis[m] | *designing |
20:49:22 | * | xet7 quit (Remote host closed the connection) |
20:53:27 | FromDiscord | <shadow.> how do you set clipboard text in winim? |
20:53:42 | FromDiscord | <shadow.> i know you have to open first, but the second parameter, hMem, im unsure about that |
20:53:52 | FromDiscord | <shadow.> how do i get from a string to the handle it wants |
20:53:58 | FromDiscord | <shadow.> (edit) "wants" => "wants?" |
20:57:13 | FromDiscord | <shadow.> nvm figured it out i think |
20:59:21 | * | shuji quit (Remote host closed the connection) |
21:01:20 | FromDiscord | <shadow.> nvm i did not figure it out support would be appreciated |
21:03:27 | * | Cthalupa quit (Ping timeout: 260 seconds) |
21:04:09 | FromDiscord | <lqdev> i guess, refer to the microsoft docs? |
21:04:16 | * | Cthalupa joined #nim |
21:04:28 | FromDiscord | <shadow.> microsoft docs are shit |
21:04:29 | FromDiscord | <shadow.> but i can try |
21:04:59 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Htp |
21:05:11 | FromDiscord | <shadow.> but GlobalLock returns LPVOID which can't be passed to setclipboard data |
21:05:15 | FromDiscord | <shadow.> so i tried a cast which ik was dumb |
21:05:15 | FromDiscord | <shadow.> lol |
21:06:25 | FromDiscord | <lqdev> um, i think GlobalLock probably locks a mutex somewhere thus it's not what you want |
21:06:34 | FromDiscord | <shadow.> seems to be what they do so im confused lol |
21:06:42 | FromDiscord | <shadow.> https://docs.microsoft.com/en-us/windows/win32/dataxchg/using-the-clipboard#copying-information-to-the-clipboard |
21:08:05 | FromDiscord | <lqdev> i think hMem just expects a pointer |
21:08:27 | FromDiscord | <lqdev> have you tried just passing it `url[0].addr`? |
21:08:37 | FromDiscord | <lqdev> oh hold on |
21:08:41 | FromDiscord | <lqdev> nope take that back |
21:08:54 | FromDiscord | <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:54 | FromDiscord | <shadow.> rip |
21:09:03 | FromDiscord | <shadow.> yeah |
21:09:12 | FromDiscord | <shadow.> sorry, am i missing something lol? |
21:09:16 | FromDiscord | <lqdev> gosh windows is confusing |
21:09:18 | FromDiscord | <shadow.> yeah |
21:09:22 | FromDiscord | <shadow.> the api is pretty wack |
21:09:35 | FromDiscord | <shadow.> and the names aren't great either |
21:09:37 | FromDiscord | <lqdev> i'm not on window right now so i can't really help ya |
21:09:40 | FromDiscord | <shadow.> everything is PascalCase lol |
21:09:41 | FromDiscord | <shadow.> ah fair fair |
21:10:11 | FromDiscord | <Rebel> oh boy what are you doing with the clipboard 😛 |
21:10:21 | FromDiscord | <Rebel> next thing I know you'll be doing some low level keyboard hooking |
21:10:34 | FromDiscord | <Rebel> join the thread nightmare train |
21:10:37 | FromDiscord | <lqdev> hm hold on |
21:10:38 | FromDiscord | <lqdev> actually |
21:10:41 | FromDiscord | <shadow.> oh? |
21:10:44 | FromDiscord | <shadow.> has the savior arrived? |
21:10:59 | FromDiscord | <lqdev> i think you can pass a cstring there but you'll have to keep it alive until CloseClipboard is called |
21:11:17 | FromDiscord | <shadow.> yeah i just switched to using cstring |
21:11:22 | FromDiscord | <shadow.> the issue is `discard SetClipboardData(CF_TEXT, buffer)` |
21:11:27 | FromDiscord | <shadow.> buffer is of type LPVOID not HANDLE |
21:11:38 | FromDiscord | <shadow.> LPVOID is just a pointer, HANDLE is like an int or something? |
21:11:43 | FromDiscord | <shadow.> and idk what it's a pointer to |
21:11:48 | FromDiscord | <shadow.> how do i check again? dref? |
21:12:02 | * | Q-Master joined #nim |
21:12:23 | FromDiscord | <lqdev> uhhh |
21:12:24 | FromDiscord | <lqdev> lemme check |
21:14:19 | FromDiscord | <shadow.> OHH NVM |
21:14:21 | FromDiscord | <shadow.> ik what im doing wrong |
21:14:50 | FromDiscord | <shadow.> À‹ |
21:14:53 | FromDiscord | <lqdev> HANDLE is an int |
21:14:54 | FromDiscord | <shadow.> ok that's wrong, but it's something |
21:14:57 | FromDiscord | <shadow.> the text |
21:14:58 | FromDiscord | <shadow.> À‹ |
21:14:58 | FromDiscord | <shadow.> LOL |
21:15:07 | FromDiscord | <shadow.> yeah handle is an int i knew that |
21:15:10 | FromDiscord | <lqdev> Á← |
21:15:11 | FromDiscord | <shadow.> sry i fixed it i think at least partially |
21:15:22 | FromDiscord | <shadow.> i was passing the buffer instead of the lock |
21:15:23 | FromDiscord | <shadow.> or something |
21:15:40 | FromDiscord | <shadow.> so confusing- |
21:23:14 | FromDiscord | <shadow.> im getting closer |
21:25:14 | FromDiscord | <shadow.> °ö‚ |
21:25:15 | FromDiscord | <shadow.> maybe not... |
21:26:50 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HtD |
21:26:50 | FromDiscord | <shadow.> this is at least valid |
21:26:53 | FromDiscord | <shadow.> but the bytes just aren't correct |
21:26:58 | FromDiscord | <shadow.> even with a c string |
21:29:03 | FromDiscord | <squid> Does the httpclient have any ways to receive cookies from request? |
21:29:29 | FromDiscord | <juliuskiesian> https://github.com/linebender/piet-gpu/blob/master/doc/vision.md |
21:29:40 | FromDiscord | <juliuskiesian> for those who are interested. |
21:30:50 | FromDiscord | <shadow.> check the response object or whatever get() returns |
21:32:13 | FromDiscord | <shadow.> OML |
21:32:14 | FromDiscord | <shadow.> GOT IT |
21:32:53 | FromDiscord | <shadow.> @lqdev figured it out |
21:32:53 | FromDiscord | <squid> You got clipboard thingy working? |
21:33:00 | FromDiscord | <shadow.> yes |
21:33:05 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HtF |
21:33:07 | FromDiscord | <shadow.> cstrings are already pointers |
21:33:15 | FromDiscord | <shadow.> so i shouldnt pass `cstring.addr` |
21:33:22 | FromDiscord | <shadow.> also `len` returns len so + 1 for nullbyte |
21:33:37 | * | vicfred quit (Ping timeout: 258 seconds) |
21:34:46 | FromDiscord | <Quibono> So what are we doing with the clipboard? |
21:38:30 | FromDiscord | <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:52 | FromDiscord | <shadow.> oh well |
21:48:56 | FromDiscord | <shadow.> its an upload thingy |
21:49:01 | FromDiscord | <shadow.> so that you can upload to playground through cmd |
21:49:07 | FromDiscord | <shadow.> and it puts the upload link in clipboard |
21:49:21 | FromDiscord | <shadow.> and windows only pft |
21:49:26 | FromDiscord | <shadow.> bc its just me using it lol |
22:01:48 | FromDiscord | <brainproxy> sent a long message, see http://ix.io/2HtK |
22:02:25 | FromDiscord | <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:30 | PMunch | @shadow. I have something similar set up on Linux |
22:07:42 | * | FromDiscord joined #nim |
22:08:11 | PMunch | xclip -o -selection primary | ix | tr -d '\n' | xclip -i -selection clipboard |
22:08:26 | PMunch | Where ix is a program in AUR that uploads stuff to ix.io |
22:12:54 | Prestige | PMunch: did you already stream today? |
22:13:00 | PMunch | Yeah.. |
22:13:02 | FromDiscord | <shadow.> yes, he did |
22:13:04 | FromDiscord | <shadow.> rip |
22:13:07 | Prestige | dang |
22:13:08 | PMunch | But I wasn't able to do p2.. |
22:13:14 | PMunch | Trying to figure it out now |
22:13:52 | FromDiscord | <shadow.> wait rly? |
22:13:54 | FromDiscord | <shadow.> rip |
22:13:58 | FromDiscord | <shadow.> i finished it but yeah it was really hard |
22:14:00 | FromDiscord | <shadow.> took me like 2 hours lmao |
22:14:05 | disruptek | !repo disruptek/xs |
22:14:06 | disbot | https://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 3⭐ 0🍴 |
22:14:14 | PMunch | I mean I just got back to it |
22:14:17 | disruptek | there's an ix in there that does the xclip and everything for you. in nim. |
22:14:18 | FromDiscord | <shadow.> fair |
22:14:24 | PMunch | Have been doing other stuff since I stopped streaming |
22:14:32 | FromDiscord | <shadow.> disruptek: who was that aimed at lol |
22:14:39 | PMunch | And combinatorics where never my strong suit.. |
22:14:44 | FromDiscord | <shadow.> fair |
22:15:32 | PMunch | @shadow, I'm guessing for whoever was talking about ix pasting before I got here |
22:19:47 | * | lritter quit (Quit: Leaving) |
22:26:06 | FromDiscord | <shadow.> ohh |
22:26:09 | FromDiscord | <shadow.> that was probably me |
22:26:16 | FromDiscord | <shadow.> i made a program to upload to playground |
22:26:20 | FromDiscord | <shadow.> and put url in clipboard lol |
22:26:46 | PMunch | Yeah, and I shared a oneliner script for how to do that in Linux |
22:26:56 | FromDiscord | <shadow.> hey hey hey |
22:26:59 | PMunch | Which requires a "ix" program |
22:27:00 | FromDiscord | <shadow.> no competition smh |
22:27:05 | FromDiscord | <shadow.> ohhhh |
22:27:09 | FromDiscord | <shadow.> that would make sense |
22:27:12 | PMunch | And disruptek shared one such program :P |
22:27:27 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2HtP |
22:27:29 | FromDiscord | <shadow.> this was mine |
22:27:31 | FromDiscord | <shadow.> i didnt know it had been made |
22:27:37 | FromDiscord | <shadow.> i just made it bc i hate copy pasting and opening a browser |
22:27:42 | PMunch | Which is kinda handy, as you can pipe the output of a running program to ix |
22:28:00 | FromDiscord | <shadow.> smart |
22:32:08 | * | Vladar quit (Quit: Leaving) |
22:55:32 | reversem3 | how do you append writing to a file ? |
22:55:44 | reversem3 | I only see an enum for fmAppend |
23:00:03 | FromDiscord | <Esbeesy> I set an alias for ixio upload also |
23:00:10 | FromDiscord | <Esbeesy> Shadow how was your part 2? |
23:00:26 | PMunch | reversem3, you open it in append mode |
23:00:47 | PMunch | So var myFile = open("output.log", fmAppend); myFile.write("Hello world") |
23:00:57 | FromDiscord | <Esbeesy> PMunch: I keep missing your streams cause I'm at work 😦 |
23:01:01 | reversem3 | ok thanks |
23:01:16 | FromDiscord | <Esbeesy> I was trying to implement a VS Code extension to speak to your nimlsp earlier - I didn't get far. |
23:01:17 | PMunch | @Esbeesy, todays stream was a bit of a dud TBH |
23:01:33 | FromDiscord | <Esbeesy> Yeah part 2 is very mathboi, caught me off guard |
23:01:34 | reversem3 | let f = await client.execCommand("uptime") |
23:01:34 | reversem3 | #echo f |
23:01:34 | reversem3 | write("file.txt", $f) |
23:01:59 | PMunch | Did the first part really quickly, then spent almost an hour bumbling around with the second while getting no-where |
23:02:08 | reversem3 | I'm not opening anything though just writing , so I supposed after I write I can re-open it and append |
23:02:35 | PMunch | Yeah or just open it once to begin with |
23:02:56 | FromDiscord | <nikki> you can keep the file handle around after opening it once, and keep appending with that original handle |
23:03:34 | PMunch | Oh well, time to get to bed |
23:03:44 | * | PMunch quit (Quit: leaving) |
23:04:15 | FromDiscord | <Esbeesy> Noight - What time are you usually on? Wanted to talk to you on the LSP |
23:06:37 | FromDiscord | <j-james> i'm still banging my head against the wall that is part ii |
23:12:12 | mipri | if you don't get it, stop banging your head and just read an explanation on how to solve it |
23:13:26 | mipri | Eric's done this a few times since 2019. The problem is absolutely impossible if you're missing some key ideas. |
23:15:26 | FromDiscord | <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:08 | ForumUpdaterBot | New thread by Mantielero: Question about dup syntax, see https://forum.nim-lang.org/t/7240 |
23:16:29 | * | Jjp137_ joined #nim |
23:27:19 | FromDiscord | <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:00 | FromDiscord | <shadow.> lol i like it |
23:36:07 | FromDiscord | <shadow.> your part two is very close to mine |
23:36:11 | FromDiscord | <shadow.> yours is just easier to read |
23:36:31 | FromDiscord | <shadow.> https://github.com/shadowninja55/aoc-2020/blob/main/10/day10.nim |
23:36:37 | FromDiscord | <Esbeesy> Check again, I just added a chunky comment underneath to explain the algo |
23:36:46 | FromDiscord | <shadow.> ohh lol |
23:36:50 | FromDiscord | <shadow.> you seen mine? |
23:36:55 | FromDiscord | <Esbeesy> But yeah, exact same |
23:37:00 | FromDiscord | <shadow.> lol ye |
23:37:04 | FromDiscord | <shadow.> i just used a table inference |
23:37:06 | FromDiscord | <shadow.> and mgetOrPut |
23:37:31 | FromDiscord | <shadow.> SHEESH |
23:37:31 | FromDiscord | <shadow.> that comment is thicc |
23:37:33 | FromDiscord | <Esbeesy> Innit |
23:37:48 | FromDiscord | <Esbeesy> One of my friends is struggling with it as well and is about to give up |
23:37:52 | FromDiscord | <shadow.> damn |
23:37:59 | FromDiscord | <shadow.> i just realized like halfway through that it's just math |
23:38:00 | FromDiscord | <shadow.> lol |
23:39:15 | FromDiscord | <Esbeesy> Yeah I think Nari said earlier it was just a Project Euler puzzle hidden in an AoC |
23:39:48 | FromDiscord | <Esbeesy> Which is fair, but theres a fine line between fun programming hacks and actual work |
23:40:22 | FromDiscord | <shadow.> yeahhh true |
23:40:27 | FromDiscord | <shadow.> idk i didn't find it that enjoyable |
23:40:34 | FromDiscord | <shadow.> for instance yesterday's was very cool |
23:40:40 | FromDiscord | <shadow.> much more algorithm / programming orientic |
23:40:41 | FromDiscord | <shadow.> (edit) "orientic" => "oriented" |
23:40:52 | FromDiscord | <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:55 | FromDiscord | <shadow.> !repo clipboard |
23:52:56 | disbot | https://github.com/Guevara-chan/Cliptomania -- 9Cliptomania: 11•.NET Clipboard for Nim• 15 6⭐ 0🍴 |
23:54:58 | FromDiscord | <rinfz> how can I pass a compiled .o file to the compiler? |
23:55:45 | FromDiscord | <nikki> maybe `--passL:file.o`? |
23:55:49 | FromDiscord | <nikki> haven't tried just guessing |
23:57:03 | FromDiscord | <rinfz> yeah that worked, thanks! I was stupidly trying passC instead 😄 |
23:57:23 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2Hue |
23:57:24 | FromDiscord | <shadow.> boom |
23:57:28 | FromDiscord | <shadow.> added clipboard support |
23:57:33 | FromDiscord | <shadow.> if filename not provided |
23:57:35 | FromDiscord | <shadow.> litty |
23:59:23 | FromDiscord | <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:42 | FromDiscord | <nikki> it's just kind of a sensible language and has low random noise compared to other ones |