<< 30-09-2020 >>

00:00:23FromDiscord<Avatarfighter> I'm so jealous of terminal editors I can barely learn the keybinds for them lol
00:00:35*kinkinkijkin joined #nim
00:00:46disruptekthat word is `envious`.
00:00:49FromDiscord<JSGRANT> @disruptek I think that's fair; The whole Eight-megabytes-and-constantly-swapping was a meme for a reason. Heck Lisp-Machines were a thing for a reason ... that level of dynamicism surely has a cost; ESPECIALLY in a historical context. It's crazy to think modern-day Common-Lisp implmentations are in the same league as Java.
00:01:08*abm quit (Read error: Connection reset by peer)
00:01:13FromDiscord<XeroOl> there's a terminal editor called "micro" that uses easy-to-learn keybinds
00:01:17FromDiscord<XeroOl> ie ctrl+c is copy
00:01:30FromDiscord<Avatarfighter> disruptek how do I use your bot to set a description for a word again?
00:01:50disruptekjust ~someword is some description.
00:01:55FromDiscord<Avatarfighter> ~disruptek A human dictionary and thesaurus.
00:01:55disbotno matching footnotes for `disruptek` with regexps `A, human, dictionary, and, thesaurus.`. ๐Ÿ™
00:02:03FromDiscord<Avatarfighter> i cry
00:02:03FromDiscord<JSGRANT> I was considering trying to learn (Neo)Vim again -- but I'm 'too hipster' to use a normal keymap (Colemak) & I can't seem to get :langmap / :keymap to work ever. So visual-mode uses qwerty ... so I don't have to modifying every freaking binding lol
00:02:37disruptekyou omitted `is`.
00:03:17disrupteki still don't really know how to use my editor very well.
00:03:30FromDiscord<Avatarfighter> oh I didn't realize you meant `~word is` + `description`
00:04:07disrupteki don't think i ever taught the bot what to do when a discord person says `~help`.
00:06:12FromDiscord<Avatarfighter> I'm curious to see the code behind the bot
00:06:36disruptekpretty messy, but i show it on stream frequently.
00:06:46FromDiscord<Avatarfighter> stream!?
00:07:11disruptekit's been a little while, but i used to stream like 10hrs/day.
00:07:17FromDiscord<Avatarfighter> you've been withholding critical information from me disruptek
00:07:24disruptekas per usual.
00:07:31FromDiscord<Avatarfighter> What site do you stream on?
00:07:32FromDiscord<Avatarfighter> ahah
00:07:37disruptektwitch.
00:07:42disruptek~stream
00:07:43disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
00:08:09FromDiscord<Avatarfighter> Thank you ๐Ÿ™‚
00:08:45FromDiscord<JSGRANT> I think I might of saw him stream before I ever talked to him on Discord; lol
00:09:01FromDiscord<JSGRANT> Like only result I ever got from "nim lang" on Twitch
00:09:09disruptekyeah.
00:09:25voidpiwhat does the * mean in: type client* = object
00:09:28voidpi?
00:09:33disruptekit means that symbol is exported.
00:10:05disruptekequivalent syntax to `export client`.
00:10:39voidpithanks disruptek
00:11:16disrupteksure thing.
00:19:42*kinkinkijkin quit (Remote host closed the connection)
00:20:05*kinkinkijkin joined #nim
00:21:27disruptekall the hookers in vermont smell like patchouli.
00:21:31disruptekwhat's that about?
00:33:15*sagax joined #nim
01:05:26*enthus1ast quit (Ping timeout: 246 seconds)
01:09:46*lritter joined #nim
01:15:13*voltist joined #nim
01:22:52*brainbomb[m] quit (Ping timeout: 244 seconds)
01:22:53*lnxw37d4 quit (Ping timeout: 244 seconds)
01:22:55*Northstrider[m] quit (Ping timeout: 240 seconds)
01:22:57*stisa[m] quit (Ping timeout: 240 seconds)
01:22:59*Helios quit (Ping timeout: 244 seconds)
01:22:59*agentofuser[m] quit (Ping timeout: 244 seconds)
01:23:15*Northstrider[m] joined #nim
01:23:27*silvernode[m] quit (Ping timeout: 244 seconds)
01:23:27*orazovae[m] quit (Ping timeout: 244 seconds)
01:23:27*unclechu quit (Ping timeout: 244 seconds)
01:23:33*planetis[m] quit (Ping timeout: 260 seconds)
01:23:33*einichi quit (Ping timeout: 260 seconds)
01:23:58*reversem3 quit (Ping timeout: 244 seconds)
01:24:07*leorize[m]1 quit (Ping timeout: 260 seconds)
01:26:46*silvernode[m] joined #nim
01:27:47*reversem3 joined #nim
01:28:39*planetis[m] joined #nim
01:31:25*voltist quit (Quit: The Lounge - https://thelounge.chat)
01:33:28*agentofuser[m] joined #nim
01:34:12*lnxw37d4 joined #nim
01:34:52*voltist joined #nim
01:38:08*brainbomb[m] joined #nim
01:39:04*stisa[m] joined #nim
01:41:16*unclechu joined #nim
01:41:38*orazovae[m] joined #nim
01:42:06*einichi joined #nim
01:43:04*lritter quit (Quit: Leaving)
01:46:06FromDiscord<dayl1ght> why can I take the addr of a variable declare with `var`, but not with `let`?
01:46:29FromDiscord<dayl1ght> with `let` I get the error `Error: expression has no address; maybe use 'unsafeAddr'`
01:49:12*apahl quit (Ping timeout: 260 seconds)
01:50:57*apahl joined #nim
01:55:37*Tanger joined #nim
02:01:52*lritter joined #nim
02:12:11*enthus1ast joined #nim
02:14:56*unclechu quit (*.net *.split)
02:14:57*Northstrider[m] quit (*.net *.split)
02:14:57*kinkinkijkin quit (*.net *.split)
02:14:57*ormiret quit (*.net *.split)
02:14:57*waleee-cl quit (*.net *.split)
02:14:57*ee7[m] quit (*.net *.split)
02:14:57*muffindrake quit (*.net *.split)
02:14:57*hpyc9 quit (*.net *.split)
02:14:57*junland quit (*.net *.split)
02:15:06*kinkinkijkin joined #nim
02:15:15*hpyc9 joined #nim
02:15:19*ormiret joined #nim
02:15:31*waleee-cl joined #nim
02:15:41*muffindrake joined #nim
02:16:19*unclechu joined #nim
02:16:43*Northstrider[m] joined #nim
02:17:16*junland joined #nim
02:18:15*ee7[m] joined #nim
02:56:34*leorize[m]1 joined #nim
02:56:35leorize[m]1@dayl1ght as the error said, you gotta use unsafeAddr to get the address of let variables
02:56:55FromDiscord<dayl1ght> Yes but _why_
02:57:15FromDiscord<dayl1ght> What is the semantic difference between var and let other than mutability?
02:57:24leorize[m]1mutability
02:57:43FromDiscord<dayl1ght> And why does mutability imply being able to call addr
02:57:59leorize[m]1if you got the memory address, you may write into it
02:58:05*jeff3 joined #nim
02:58:19leorize[m]1that's just how computers work
02:58:24PrestigeIf anyone can take a look, I'm a bit confused about some OOP related stuff: ttps://github.com/avahe-kellenberger/nimlike/blob/master/src/ground.nim#L17
02:58:33leorize[m]1so Nim helps you by forcing you to declare that you really wanted the address
02:58:37*muffindrake quit (Ping timeout: 260 seconds)
02:58:37FromDiscord<dayl1ght> ok but I'm not necessarily going to write to something just because I took addr
02:58:40FromDiscord<dayl1ght> but I could
02:58:45FromDiscord<dayl1ght> So I guess that makes sense
02:58:56PrestigeMy base class/object has a method x that isn't getting called from the subclass
02:59:08Prestigeunless I redeclare it and use procCall
02:59:09FromDiscord<dayl1ght> Since nim can't predict if I'm going to write or not
02:59:38FromDiscord<dayl1ght> Thanks for the explanation :) I think the manual could highlight this, or maybe the error message could be a little clearer
03:00:43*opal quit (Ping timeout: 240 seconds)
03:00:52*muffindrake joined #nim
03:01:58PrestigeMaybe it's just a limitation of Nim right now, but I want to make sure I'm not missing something
03:02:25leorize[m]1Prestige: so what's the error when you omit `x()`
03:02:36FromDiscord<dayl1ght> @leorize Wait but at runtime there's no difference right? E.g. having addr called on a let variable and passed onto a c function would still work
03:02:49FromDiscord<dayl1ght> but it would break nim's type system promise that let variables are immutable
03:03:06FromDiscord<dayl1ght> (Assuming the c function tries to write to the address)
03:03:19leorize[m]1@dayl1ght yep there aren't any difference other than the explicit "I know what I am doing" promise
03:04:10leorize[m]1you can look at the C function prototype to know if the proc writes into the passed pointer (at least for well formed programs/libraries)
03:04:36Prestigeleorize[m]1: It was thinking that I was calling the vector2d `x` proc
03:04:45FromDiscord<dayl1ght> I see. I think I'll open a PR later to update the docs and maybe the message, "expression has no address" seems confusing
03:05:05Prestigebut after adding the methods, running, then deleting the methods, it's working all of a sudden...
03:05:22leorize[m]1if it's `const type* variable`, then it usually means that nothing will be written
03:06:03FromDiscord<dayl1ght> right, but if it's just type* variable then I have no guarantees
03:06:16leorize[m]1yep
03:06:42FromDiscord<dayl1ght> Thanks for explaining :)
03:06:57leorize[m]1Prestige: uhmmm isn't that what's AABB.x() do?
03:07:22leorize[m]1or do you mean you got an overloading error?
03:07:36*opal joined #nim
03:08:22PrestigeI got an error saying it expected x(this: Vector) but got x(this: Ground)
03:08:58PrestigeBut now after doing those steps and reverting back to the original code, it's working without error. I've no idea why
03:09:01*vegai quit (Ping timeout: 265 seconds)
03:09:24leorize[m]1did you work with code that imports only ground but not aabb?
03:09:37leorize[m]1then just export aabb from ground
03:09:50PrestigeAh yes, the import must have fixed it
03:09:58PrestigeThanks, makes sense now
03:10:41PrestigeI keep feeling like I don't have to import files that I'm extending
03:30:17*vegai joined #nim
03:34:57*sealmove quit (Quit: WeeChat 2.9)
03:43:45Prestigeleorize[m]1: Is there any way to automatically export all of your imports in a file? Maybe it's not a great idea, but seems to be what I need at the moment...
03:50:21FromDiscord<Elegant Beef> you'd have to import the macro but you could write a macro to do importing and exporting for you
03:50:56leorize[m]1Prestige: write a template that import and export whatever you passed
03:51:21Prestigegood idea
03:51:23FromDiscord<Elegant Beef> Can it be done in a template since you may not always import just a single file
03:51:39FromDiscord<Elegant Beef> Since you may import `dir/subfile`
03:51:56Prestigethen you only need to export subfile
03:52:18FromDiscord<Elegant Beef> that's my point
03:53:19Prestigewouldn't I need to import the module that has my import template? lol
03:53:27FromDiscord<Elegant Beef> You would
03:53:32*jeff3 quit (Quit: WeeChat 2.8)
03:53:40FromDiscord<Elegant Beef> You could use the `--importModule` flag
03:57:16FromDiscord<Elegant Beef> So your nimble task would pass that module which it'd import in every file, and boom no importing it manually ๐Ÿ˜„
04:00:11PrestigeHm good idea, trying to get it to work
04:00:34Prestigeusing exec "nim c -r -d:release --import:src/util/imports.nim -o:nimlike src/main.nim"
04:00:50Prestigenimlike/src/main.nim(1, 2) Error: cannot open file: src/util/imports.nim
04:01:14PrestigeIf I remove the src in the import line, it says cannot open file: ""
04:02:25leorize[m]1Prestige: you can copy karax
04:02:48leorize[m]1put every imports into a file, then use `include` on it whenever you want them all
04:04:12Prestigewell I really like the solution @Elegant Beef proposed, if I can get it working
04:05:29FromDiscord<Elegant Beef> Yea import is broken for sub dirs
04:05:43FromDiscord<Elegant Beef> include isnt
04:05:52Prestigeoh, damn
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:40*supakeen joined #nim
04:07:11FromDiscord<Elegant Beef> I've opened an issue but probably didnt document it well enough ๐Ÿ˜„
04:07:54PrestigeI feel like importing a file should also import it's deps, but I guess there's probably a reason not to
04:08:02Prestigeits*
04:08:06FromDiscord<Elegant Beef> That ruins exporting
04:08:32Prestigewhat do you mean by ruins?
04:08:43FromDiscord<Elegant Beef> You cant selectively export things
04:08:46FromDiscord<Elegant Beef> so you expose many things
04:09:24Prestigemaybe at least for methods that are extended from
04:11:30leorize[m]1there were talks about selective exports of everything related to a type
04:11:34leorize[m]1but it never flew
04:12:57leorize[m]1I guess that has to do with how most Nim users don't do complicated inheritance (or at all)
04:13:02PrestigeIt really feels clunky - maybe I'll try bringing up the topic again
04:13:04PrestigeYeah
04:13:12PrestigeI feel like every1 here but me hates OOP
04:14:21FromDiscord<Elegant Beef> I dont hate it, i feel there is a time and a place ๐Ÿ˜„
04:15:07PrestigeI couldn't find a good way to implement ECS so I'm going with OOP for a game I'm making. It's simple enough for nim's minimal OOP support to work, if I'm careful
04:15:25Prestigemultiple inheritence would make things much easier
04:15:40FromDiscord<Elegant Beef> Multiple inheritance ewww
04:16:10PrestigeMI is such a great language feature, really hope it's added eventually
04:17:19FromDiscord<Elegant Beef> Why is it great?
04:17:29FromDiscord<Elegant Beef> Just use interfaces like a good OOPer
04:17:45PrestigeIt gives the user a lot of flexibility. We also don't have interfaces
04:17:58Prestigeinterfaces are just very partial MI anyway
04:18:16FromDiscord<Elegant Beef> Well they're the only way to do MI without headaches
04:18:55PrestigeI mean, other languages have done it - only real issue is the diamond problem, and you could just simply not allow the diamond to compile
04:19:18FromDiscord<Elegant Beef> I dont think it matters what other languages have done ๐Ÿ˜„
04:19:28PrestigeI'm saying it's possible is all
04:19:40FromDiscord<Elegant Beef> I didnt disagree with it being possible
04:21:29FromDiscord<Elegant Beef> I do think nim needs an standard method for interfaces, be it expanding concepts for runtime support or just a easy to use macro ๐Ÿ˜„
04:21:42Prestigeah okay. Anyway, interfaces are ok, just not as powerful as MI
04:21:49PrestigeYeah I agree
04:22:16FromDiscord<Elegant Beef> I mean interfaces are better as it's composition
04:22:23FromDiscord<Elegant Beef> Composition is vastly better to inheritance
04:22:30FromDiscord<Elegant Beef> It's the entire reason EC, and ECS exist
04:23:02Prestigeinterfaces are just abstract classes though, it's essentially still inheritence
04:23:23bungdart has complete OOP supported
04:24:58FromDiscord<Elegant Beef> I'd be pretty happy with runtime concepts ๐Ÿ˜„
04:25:08bungit has interface ,abstract class, mixin, extension
04:26:05Prestigeif I could type Foo = ref object of A, B, C I'd be very happy
04:33:52*NimBot joined #nim
04:43:30leorize[m]1it'll take awhile before runtime concepts become a thing
04:45:20leorize[m]1currently it seems that we are prioritizing borrow checking and nil checking
04:45:34leorize[m]1maybe after that concepts will be finalized (hopefully)
04:48:26FromDiscord<flywind> How could I test nimdoc? I have found a bug in nimdoc
04:50:09FromGitter<xflywind> never mind, now I know
04:54:29*mmohammadi9812 joined #nim
04:55:18FromDiscord<flywind> I want to escape HTML code in JS backend, any solution?
04:58:20leorize[m]wdym escape html code? are you building a DOM?
04:58:34FromDiscord<flywind> No I want to fix a Nim doc bug
04:58:53FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/760727342695317566/unknown.png
04:59:07FromDiscord<flywind> (edit) removed 'No'
04:59:30FromDiscord<flywind> I need to escape strings
05:00:52FromDiscord<flywind> `matches[i][0].innerHTML = matches[i][0].getAttribute("data-doc-search-tag")`
05:01:46FromDiscord<flywind> Anyway I could write escape function by myself
05:02:26*narimiran joined #nim
05:02:53leorize[m]maybe create a text node explicitly with the DOM api?
05:03:10leorize[m]then the html shouldn't be an issue
05:03:52FromDiscord<flywind> I will check it, thanks!
05:04:36*thomasross quit (Ping timeout: 260 seconds)
05:35:37*waleee-cl quit (Quit: Connection closed for inactivity)
05:36:55*sagax quit (Quit: Konversation terminated!)
06:11:12FromDiscord<shad0w> i've read it a few times now and i think i still don't get the `proc` vs `method` difference ?
06:11:40FromDiscord<shad0w> i read a few articles about static vs dynamic dispatch since i was unfamiliar, didn't really help : ?
06:12:17FromDiscord<Rika> proc is static dispatch, meaning compile time choice depending on the types of the arguments; method is dynamic dispatch meaning run time choice depending on the runtime types of the arguments
06:13:05FromDiscord<shad0w> but the only thing that i wouldn't know compile time are things that come from outside at runtime ?
06:13:49FromDiscord<Rika> inheritance/oop is runtime, if you arent using those then you dont need methods
06:14:05FromDiscord<Elegant Beef> Methods mainly so you can override procs and have the called at runtime for inheriting objects
06:14:08FromDiscord<shad0w> @Rika screw OOP
06:14:12FromDiscord<Rika> lol
06:14:19FromDiscord<Rika> that's the spirit
06:14:31FromDiscord<shad0w> i've had enough of that shit already
06:14:43FromDiscord<Rika> (nim programmers seem to not like oop at all)
06:15:05FromDiscord<Rika> well yeah im done with oop too
06:15:16FromDiscord<Rika> object variants do enough for me already
06:15:25FromDiscord<shad0w> > (nim programmers seem to not like oop at all)โ†ต@Rika oop programmers should not like oop
06:15:32FromDiscord<Rika> lol
06:15:53FromDiscord<shad0w> i picked up haskell, just to rebel
06:16:28FromDiscord<Rika> nice
06:16:41FromDiscord<Rika> well yeah thats basically it
06:16:45FromDiscord<Rika> if you dont use oop dont use methods
06:16:47FromDiscord<Rika> no reason to
06:17:08FromDiscord<Rika> you lose out on some optimisations by doing so too afaik?
06:17:11FromDiscord<shad0w> but not using something vs not understanding something erks me
06:17:26FromDiscord<Rika> well i just tried explaining above, maybe you missed it?
06:17:42FromDiscord<Rika> > proc is static dispatch, meaning compile time choice depending on the types of the arguments; method is dynamic dispatch meaning run time choice depending on the runtime types of the argumentsโ†ตi'll rephrase it; one moment
06:19:08FromDiscord<Rika> proc is static dispatch, meaning which proc to use is chosen at compile time depending on the types (regular types, "type xxxx = object") of the arguments; method is dynamic dispatch meaning which method to use is chosen at run time depending on the runtime types (oop types, "type xxxx = ref object of Something") of the arguments
06:19:18FromDiscord<Elegant Beef> Dynamic dispatch allows the runtime situation choose the most fitting method to be used based off the type, so if you use inheritance and have a proc for the parent, and the children it can choose the child proc at times, but also the parent one if needed
06:19:25*euantorano quit (Ping timeout: 240 seconds)
06:19:42*matlock quit (Ping timeout: 256 seconds)
06:20:14FromDiscord<shad0w> i see. it's kindda hitting now
06:20:24FromDiscord<Elegant Beef> you can override the behaviour of inherited functions, and have it called without having to manually cast to the type you wan
06:20:26*matlock joined #nim
06:20:27*euantorano joined #nim
06:21:14FromDiscord<Rika> ~~except you kinda still have to but thats another discussion for another day~~
06:21:32FromDiscord<Elegant Beef> In what way rika?
06:21:45FromDiscord<Rika> idk, i still had to do that when i called a method in a proc
06:21:46FromDiscord<shad0w> > proc is static dispatch, meaning which proc to use is chosen at compile time depending on the types (regular types, "type xxxx = object") of the arguments; method is dynamic dispatch meaning which method to use is chosen at run time depending on the runtime types (oop types, "type xxxx = ref object of Something") of the argumentsโ†ต@Rika wouldn't procs have different signatures for different types anyway ?
06:22:18FromDiscord<shad0w> like `proc(x: Parent): something` vs` proc(x:Child): something`
06:22:33FromDiscord<Rika> > @Rika wouldn't procs have different signatures for different types anyway ?โ†ต@shad0w what if you had two procs, same signatures except for the first arg, proc 1 has "BaseType" and the 2nd has "InheritingFromBaseType"
06:22:52*solitudesf joined #nim
06:22:52Prestige@Rika I haven't seen a good replacement for OOP (aside from ECS) for my use cases
06:23:09FromDiscord<Rika> how do you know which proc a call with first type "InheritingFromBaseType" wants? does it want base or 2nd?
06:23:51FromDiscord<Rika> and even sometimes the explicit type is just BaseType since lets say you got a seq of these
06:23:54FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2zeo
06:24:00FromDiscord<Elegant Beef> There is why they're nice if using OOP
06:24:04FromDiscord<shad0w> > @shad0w what if you had two procs, same signatures except for the first arg, proc 1 has "BaseType" and the 2nd has "InheritingFromBaseType"โ†ต@Rika i think im missing something, they have the same first argument :?
06:24:12FromDiscord<Rika> no
06:24:20FromDiscord<Elegant Beef> Just look at my example and run it ๐Ÿ˜›
06:24:22FromDiscord<Rika> look at beed's
06:24:24FromDiscord<Rika> beef
06:24:34FromDiscord<Rika> i dont use inheritance at all
06:24:44FromDiscord<Rika> beef prolly does
06:24:50FromDiscord<Elegant Beef> I've played with it
06:25:06FromDiscord<Elegant Beef> I learned you have to explictly import the base object or the entire seemless casting falls apart
06:25:40FromDiscord<Elegant Beef> If the base object isnt imported by the module attempting to call methods, it doesnt automagically cast ๐Ÿ˜„
06:26:41Prestige^ bugs me
06:26:50FromDiscord<shad0w> > https://play.nim-lang.org/#ix=2zeoโ†ต@Elegant Beef exactly mypoint, doThing should already be called the right call based on the fact that we overload it for different types anyway ?
06:26:58FromDiscord<Elegant Beef> Look how they're stored
06:27:04FromDiscord<Elegant Beef> They're all stored as if they're `A`
06:27:16FromDiscord<Elegant Beef> So in your world it'd call only the parent proc
06:27:43PrestigeWe need dynamic dispatching
06:28:04FromDiscord<shad0w> > They're all stored as if they're `A`โ†ต@Elegant Beef lol, how :? pardon the noobness
06:28:17FromDiscord<Elegant Beef> Inherited reference objects implictly cast to `A`
06:28:21FromDiscord<Elegant Beef> Well their parents
06:28:30FromDiscord<Rika> because type info is stored in the type itself, so on run time we know what it actually is
06:29:52FromDiscord<shad0w> wait. i just typed `echo typeof x` in the loop in your example @Elegant Beef
06:29:57FromDiscord<shad0w> it says they're all A
06:30:14FromDiscord<shad0w> that's not right ?
06:30:32FromDiscord<Elegant Beef> That is
06:30:56FromDiscord<shad0w> that's what i've been having problems with, then
06:30:57FromDiscord<Rika> the way inheritance in nim works a bit weirdly
06:31:12FromDiscord<shad0w> > the way inheritance in nim works a bit weirdlyโ†ต@Rika it should just mention it there lol.
06:31:36FromDiscord<Rika> there is a *compile time type* and a *run time type* (im pretty sure?)
06:31:52FromDiscord<shad0w> most newbies like me expect if i do `var b = B()` then `typeof b` == `B`
06:32:04PrestigeThe col array is of type A
06:32:15FromDiscord<shad0w> no matter if it inherits from A
06:32:34FromDiscord<Elegant Beef> It's not cause it inherits from A
06:32:36FromDiscord<JSGRANT> I wish method's keyword was just 'meth' so it stuck with the proc, & func 4 letter word stylistic choice
06:32:46FromDiscord<Elegant Beef> It's cause we stored it in a `seq[A]`
06:33:01PrestigeNah that would be gross jsgrant
06:33:03FromDiscord<Elegant Beef> Here is my example expanded to work with static dispatch https://play.nim-lang.org/#ix=2zer
06:33:31FromDiscord<shad0w> > It's cause we stored it in a `seq[A]`โ†ต@Elegant Beef what was i gonna ask next. it's that way because we store it that way or we store it that way, BECAUSE its that way
06:33:33FromDiscord<JSGRANT> Prestige: But it'd also be c o n s i s t e n t ; lol
06:33:45FromDiscord<Rika> i dont actually know how typeof works, but im pretty sure about the distinction of a compiletime type and runtime type
06:33:52FromDiscord<lqdev> @JSGRANT iter
06:33:53PrestigeSay no to meth! Lol
06:34:07FromDiscord<Elegant Beef> It's the same as `seq[10u32, 100, 200]`, we know the data type by the first value
06:34:15Prestige^
06:34:22FromDiscord<Rika> btw echo typeof B() still says B
06:34:24FromDiscord<JSGRANT> @lqdev Wouldn't mind it that much; But don't view it on the same level
06:34:43FromDiscord<Rika> just not `let a: A = B(); echo typeof a`
06:34:49FromDiscord<lqdev> eh you drug addicts
06:34:55FromDiscord<shad0w> so it's typecasted to A's since all elements in dequence must be of asme type :?
06:35:01FromDiscord<Rika> yes
06:35:02FromDiscord<Elegant Beef> Yes
06:35:02Prestigelqdev likes meth?
06:35:09FromDiscord<shad0w> (edit) 'dequence' => 'sequence'
06:35:19FromDiscord<JSGRANT> method man
06:35:28FromDiscord<Elegant Beef> Nim is statically type so containers have to be all the same type, which nim inferers from the first element
06:35:34FromDiscord<shad0w> wouldn't that result is loss of information ?
06:35:48FromDiscord<Elegant Beef> Yes, which is where `of` and method dispatch comes into play
06:35:55FromDiscord<shad0w> > because type info is stored in the type itself, so on run time we know what it actually isโ†ต@Rika but this, i guess ?
06:36:14FromDiscord<Rika> thats why theres no loss of info
06:36:25FromDiscord<Elegant Beef> As you can see the method dispatch is vastly more compact, and the inside the method we have the actual type
06:36:42FromDiscord<Elegant Beef> So you dont *have* to cast yourself to have type safety as long as you design the OOP right
06:37:29FromDiscord<shad0w> OOP should come with a mental health warning :?
06:37:38FromDiscord<Rika> yes
06:37:44FromDiscord<Elegant Beef> Nim's certainly should
06:38:13FromDiscord<lqdev> every should
06:38:28FromDiscord<lqdev> java's oop is certainly no better
06:38:40FromDiscord<JSGRANT> OOP within certain-contexts is absolutely fine; The amount of internet-hate I've seen for it over the past few years has been crazy to me lol It has costs, like everything else.
06:38:48FromDiscord<Elegant Beef> I mean C#'s OOP is more complex but the story is told differently, and it is more graspable i think
06:39:03FromDiscord<Rika> python's oop is pretty bad imo
06:39:10FromDiscord<shad0w> i think the mental model is flawed
06:39:14FromDiscord<Rika> shudders in multiple inheritance
06:39:15FromDiscord<Elegant Beef> It's a tool, it needs to be used in the proper context
06:39:18FromDiscord<shad0w> scale just excacerbates it
06:39:26FromDiscord<lqdev> Nim's OOP is bad because Nim shouldn't be written with an object-oriented style
06:39:33FromDiscord<JSGRANT> Python feels like it has OO tacked-on; More-so than OCaml which ... blatantly did lol
06:39:40FromDiscord<lqdev> Nim is not Java nor C#
06:39:47FromDiscord<Elegant Beef> You can scream DoD from rooftops but that isnt always the solution
06:39:52FromDiscord<Rika> no, its bad because no one is writing much oop in nim, so it's basically ignored/low priority to nim devs
06:40:09FromDiscord<shad0w> > Nim is not Java nor C#โ†ต@lqdev thanks @Araq : )
06:40:12FromDiscord<lqdev> because the language embraces a more procedural style, rika
06:40:21*giaco quit (Remote host closed the connection)
06:40:46*giaco joined #nim
06:40:52FromDiscord<Elegant Beef> Lq is right, nim allows you to have an "object definition" to span multiple files, whereas C# you're limited to the scope of the class def
06:41:22FromDiscord<Elegant Beef> Aside from extension methods you cannot add to a class without being inside a classes body
06:42:10FromDiscord<shad0w> so tl;dr, if i don't care about OOPS, i can just ignore i ever read `method` exists /
06:42:17FromDiscord<Rika> yes
06:42:22FromDiscord<shad0w> thenks
06:42:51FromDiscord<Elegant Beef> Well i wouldnt personally act like OOP doesnt exist in nim, as it's a tool, but yea
06:43:41*fredrikhr quit (Quit: Ping timeout (120 seconds))
06:43:41FromDiscord<Elegant Beef> Try all you will your shitty phillips screw will never turn the superior robertson head ๐Ÿ˜›
06:43:44Prestige@Rika I'm wanting to write more oop in Nim - I wish we could get more support
06:43:50PrestigeMaybe a donation..
06:43:51*PMunch joined #nim
06:43:54*fredrikhr joined #nim
06:43:56FromGitter<ynfle> @shad0w, one time where it made a difference is the `unittest` module is written with `method`s so `test` can't be run in a `static` context
06:43:57FromDiscord<Elegant Beef> Start making macros ๐Ÿ˜›
06:44:03FromDiscord<Rika> no, a big project
06:44:18FromDiscord<Rika> donation has no intent so it wont go towards what you want
06:44:22FromDiscord<JSGRANT> I can't remember where I saw it; But I remember someone implemented the more-traditional "class whatever extends whatever" styled object-model in Nim via Macros not too-too long ago
06:45:09FromGitter<ynfle> https://github.com/bluenote10/oop_utils
06:45:11Prestige@Elegant Beef well I'm thinking more along the lines of MI, so compiler changes
06:45:36PrestigeMaybe I should look into the compiler
06:45:36FromDiscord<JSGRANT> Nah, was just searching and it wasn't this -- but close
06:45:37FromDiscord<Elegant Beef> You'd be suprised what's capable using nim's current type system ๐Ÿ˜›
06:46:17FromDiscord<lqdev> i honestly don't think nim's OOP support is that terrible
06:46:32FromDiscord<lqdev> it's rudimentary, yes, but also enough for pretty much everything
06:46:39FromDiscord<lqdev> in my experience.
06:46:40*sagax joined #nim
06:46:42FromDiscord<lqdev> but ymmv
06:46:49PrestigeLack of interfaces and multiple inheritance makes it difficult
06:46:54FromDiscord<Elegant Beef> I mean they exist
06:46:55FromDiscord<lqdev> true
06:47:06FromDiscord<lqdev> runtime interfaces could be a nice addition
06:47:09PrestigeI'd settle for interfaces, but would like multiple inheritance
06:47:10FromDiscord<JSGRANT> Also the "tool" is the right context/mindset to frame this; There's a reason MOST languages aren't pure-OO or pure-FP; Ultimately everything breaks down when you push a paradigm to it's limits and requires kludges to dig yourself out
06:47:22FromDiscord<lqdev> multiple inheritance? never needed it
06:47:22FromDiscord<Elegant Beef> Yea included in the language would be nice, but there are macros to get interfaces
06:47:25FromDiscord<Rika> a LOT of languages have no multiple inheritance
06:47:48PrestigeI always miss multiple inheritance in those cases
06:47:50FromDiscord<lqdev> like, the only language i used that had multiple inheritance was c++
06:48:01FromDiscord<Elegant Beef> For instance https://github.com/slangmgh/interfaced/blob/master/example.nim
06:48:02FromDiscord<lqdev> and i never even inherited from more than one object
06:48:23PrestigeI don't think it's needed in most applications, but it's very useful in some cases
06:48:29FromDiscord<Rika> python has MI but i dont see it used often
06:48:55FromDiscord<shad0w> > multiple inheritance? never needed itโ†ต@lqdev how do you make a robot dog then ? inhereit from Robot and Animal lol. you also get all the methods you're not gonna use for fee : )
06:49:19FromDiscord<lqdev> yea i guess
06:49:29FromDiscord<Elegant Beef> I always just feel MI is interfaces but done annoyingly
06:49:34FromDiscord<lqdev> but i generally don't like deep inheritance chains
06:49:41PrestigeUseful for game engines
06:49:42FromDiscord<lqdev> one level is cool
06:49:44FromDiscord<lqdev> two are fine
06:49:48FromDiscord<lqdev> three or more are hell
06:49:59FromDiscord<Elegant Beef> prestige im uncertain how it's useful
06:50:26FromDiscord<shad0w> (edit) 'fee' => 'free'
06:50:40PrestigeImagine you'd want most objects to have a location
06:51:13PrestigeThey could extend an object that handles anything to do with location and translations
06:51:17FromDiscord<Rika> i'd use composition for that but okay
06:51:22FromDiscord<lqdev> lemme guess, but not all of them? https://gameprogrammingpatterns.com/component.html
06:51:23PrestigeHow?
06:51:23FromDiscord<Elegant Beef> So i make a position component for this hypothetical EC
06:51:33FromDiscord<Elegant Beef> A transform component
06:51:40FromDiscord<Elegant Beef> *Like how unity does it without MI*
06:51:42FromDiscord<Rika> a location type as a field?
06:51:49Prestige@Rika I always hear that but I've never seen a clean example
06:52:00FromDiscord<Elegant Beef> Unity's EC is perfectly fine
06:52:08FromDiscord<Rika> what the hell is a *clean* example ***objectively***?
06:52:38FromDiscord<Elegant Beef> In Unity's case all GameObjects are forced to have a transform component which is unremoveable
06:52:39PrestigeSomething that isn't annoying or cumbersome to use and implement
06:52:54FromDiscord<Elegant Beef> an Entity Component system(small s)
06:52:55FromDiscord<Rika> ...which is subjective, is it not
06:53:14FromDiscord<Gary M> hi beef
06:53:19FromDiscord<Elegant Beef> an EC doesnt require MI, is composition based, and isnt annoying to use
06:53:21FromDiscord<Elegant Beef> Hey jerry
06:53:43PrestigeI haven't seen a good ECS in Nim at least - I was going to implement one but couldn't figure it out
06:53:48FromDiscord<Elegant Beef> Not ECS
06:53:49FromDiscord<Elegant Beef> EC
06:53:54FromDiscord<Gary M> I'm trying to use g++ and {.importcpp.} but it's not liking it.
06:54:07FromDiscord<Gary M> it works fine if it's gcc and importc
06:54:09PrestigeWould be stupid easy with MI
06:54:20FromDiscord<JSGRANT> Okay, bed-time. o/
06:54:21FromDiscord<Elegant Beef> It's stupid easy with an entity component implementation
06:54:32FromDiscord<Elegant Beef> You make a new Transform and put it on the entity
06:54:35PrestigeCan you give me an example?
06:54:40FromDiscord<Elegant Beef> Unity's
06:54:43PrestigeA code example
06:54:48FromDiscord<Elegant Beef> Ok
06:55:18FromDiscord<Gary M> what happens when I try to compile and importcpp:โ†ตerror: request for member 'addTwoIntegers' in '3', which is of non-class type 'int'โ†ต ... int T2_ = ((int) 3).addTwoIntegers(((int) 7));
06:55:46PrestigeBecause I can't for the life of me figure out how it can be done without being worse than MI
06:56:21FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2zes
06:56:26FromDiscord<lqdev> https://github.com/liquid600pgm/rapid/blob/master/tests/tworld.nim#L22
06:56:56FromDiscord<Elegant Beef> No MI, is composition based, and isnt ass to work with
06:57:40PrestigeBeef: but how do you use this? Like how do I invoke some proc that utilizes the component
06:58:01FromDiscord<Elegant Beef> You call update on each component every frame
06:59:03PrestigeIs there any way to have behavior happen when the object has two specific components?
06:59:13FromDiscord<Elegant Beef> @Gary M how are you compiling?
06:59:22FromDiscord<Gary M> nimble build via cpp backend
06:59:36FromDiscord<Elegant Beef> Yes you check if the object has to specific components in update
06:59:39FromDiscord<Elegant Beef> (edit) 'to' => 'two'
06:59:45FromDiscord<lqdev> Prestige: look no further than ECS
06:59:51*PMunch quit (Quit: leaving)
07:00:02FromDiscord<Elegant Beef> You'd implement a GetComponent which returns the requested type from the entity list
07:00:03PrestigeI haven't seen a good ECS impl in Nim
07:00:20FromDiscord<Elegant Beef> Well this isnt an ECS it's EC lq, unless you're suggesting to use an ECS
07:00:44FromDiscord<Elegant Beef> As i know nothing about C++ you're on unix right?
07:01:07AraqI haven't seen a good ECS, ever. Just write domain objects for you game and stop pretending you're in AAA land
07:01:13PrestigeI like the concept of ECS, but I've yet to see how it can work in Nim
07:01:25PrestigeWhich is why I want MI
07:01:26FromDiscord<lqdev> Araq: domain objects?
07:01:41AraqMonster = object
07:01:44FromDiscord<Elegant Beef> What do you mean how it can work in nim? It's inheritly the same everywhere
07:01:56Araq rotation: Matrix
07:02:02Araq velocity: float
07:02:07Araqetc. etc.
07:02:32PrestigeAraq: How much money do I need to give you to add multiple inheritance to Nim
07:02:49Araq100K
07:03:00FromDiscord<lqdev> too low imo
07:03:05PrestigeYou drive a hard bargain
07:03:06AraqI'm cheap :P
07:03:42AraqI'm not against MI btw, I prefer if over classes+interfaces splits
07:03:55PrestigeMe too
07:04:14AraqI've seen discussions about "oh, should we use an interface here or a class, blah blah blub"
07:04:29PrestigeI may open an issue soon about it, I want it. But I need to sleep
07:04:41Araqof course they went with "interface" because it's a sexier name
07:05:09Araqthankfully I never had to look at the resulting code
07:06:53FromDiscord<shad0w> i think im gonna try it as an exercise. write basic ML classifiers from python sklearn, perceptron adaline etc which are OOP style in a composition style and see if i can figure it out
07:07:25FromDiscord<shad0w> would probably give me a chance to hammer in the basics i've learned till now
07:10:42Araqping alehander92
07:12:54FromDiscord<shad0w> @alexander92 @alehander42 im sorry it's ambiguous, but _PING_ ?
07:16:13*mmohammadi9812 quit (Ping timeout: 258 seconds)
07:16:46*bozaloshtsh quit (Quit: ZNC 1.7.5 - https://znc.in)
07:16:58*bozaloshtsh joined #nim
07:16:58*bozaloshtsh quit (Changing host)
07:16:58*bozaloshtsh joined #nim
07:19:40FromDiscord<Gary M> I just can't run any nim project compiled with cpp instead of c on windows. I don't know what gives.
07:22:52*oculux quit (Ping timeout: 272 seconds)
07:22:54FromDiscord<haxscramper> !requires patty
07:22:55disbotpatty: 11akavel[ixit,3dali], 11QuinnFreedman/3smoke-dungeon, 11loloicci/3nimly, 11vegansk/3nimboost, 11NickSeagull/3nim-twtypes, 11zedeus/3kinoplex, 11juancarlospaco/3fision, 11nonvirtualthunk/3nledgine, 11andreaferretti/3backupper 710 total
07:22:59*oculuxe joined #nim
07:23:04FromDiscord<haxscramper> !requires gara
07:23:05disbotgara: 11akavel/ixit, 11citycide/3fugitive, 11berquist/3rangemath, 11juancarlospaco/3fision, 11Adeohluwa/3gen, 11matkarlg/3rps-nim 76 total
07:24:49FromDiscord<haxscramper> !requires ast_pattern_matching
07:24:50disbotast_pattern_matching: 11kristianmandrup[im_esmodules,3nim_es2015_classes,3nim_custom_elements], 11zacharycarter/3nes, 11PMunch/3jsonschema, 11chocobo333/3mcmurry 76 total
07:25:17FromDiscord<Rika> wonder if anyone uses one of my libraries lol
07:26:14*letto quit (Quit: Konversation terminated!)
07:28:08FromDiscord<shad0w> what's the existing convention for naming types with multiple words?
07:28:18FromDiscord<Elegant Beef> Pascal casing
07:28:36FromDiscord<Elegant Beef> but remember casing only matters on first character and `_` dont matter ๐Ÿ˜›
07:28:52FromDiscord<shad0w> 1.) THIS_IS_A_TYPEโ†ต2.) This_is_a_typeโ†ต3) This_Is_A_Type
07:28:57FromDiscord<Elegant Beef> `FancyType` is the same as `fan_cy_t_y_p_e`
07:29:01FromDiscord<Elegant Beef> shit
07:29:10FromDiscord<Elegant Beef> Captialize the "f"
07:29:22FromDiscord<Rika> @shad0w ThisIsAType
07:29:30FromDiscord<Rika> that's the "convention"
07:29:34FromDiscord<Rika> but as most of us will say
07:29:37FromDiscord<Rika> it doesnt matter
07:29:41FromDiscord<shad0w> > that's the "convention"โ†ต@Rika lmao, i see.
07:29:48FromDiscord<Rika> because of partial style insensitivity
07:30:22FromDiscord<Elegant Beef> I'm always suprised when people say that's a bad thing ๐Ÿ˜„
07:30:48FromDiscord<Rika> well its rarely a problem
07:31:02FromDiscord<Rika> whats the chance of you having a type with the same name but different meanings
07:32:06*letto joined #nim
07:43:43*kinkinkijkin quit (Ping timeout: 244 seconds)
07:54:42FromDiscord<lqdev> also the first letter is style sensitive which eliminates most if not all problems
07:58:01*Vladar joined #nim
08:01:14ForumUpdaterBotNew thread by ElAfalw: Assignment in if condition, see https://forum.nim-lang.org/t/6874
08:06:34*kinkinkijkin joined #nim
08:06:45FromDiscord<alehander42> sorry Araq
08:06:54FromDiscord<alehander42> / narimiran
08:07:15ForumUpdaterBotNew thread by Jasonfi: How to pass an array to fastRows?, see https://forum.nim-lang.org/t/6875
08:07:18FromDiscord<alehander42> i forgot to charge my phone battery (so stopped my hotspot)
08:19:12FromDiscord<Giamby> sent a long message, see http://ix.io/2zeM
08:21:43FromDiscord<Elegant Beef> So you're making JS but not garbage ๐Ÿ˜„
08:23:12FromDiscord<Giamby> basically
08:23:20Araqcreating toy languages is fine but I'm not interested :-)
08:23:33FromDiscord<Giamby> it's a toy now
08:23:48FromDiscord<Giamby> it should become production ready asap
08:23:52FromDiscord<Giamby> that's the goal
08:23:56Araqsure sure
08:24:19FromDiscord<Elegant Beef> So you're using nim to make a new intepreted language when nim has an intepreter ๐Ÿ˜„
08:24:27Araqand then we have one more language that is like all the others but incompatible with them, it'll be great
08:24:47FromDiscord<Giamby> why should it be incompatible
08:24:52FromDiscord<Giamby> with FFI you can do anything
08:25:13FromDiscord<Giamby> I mean anyone could reason that about nim as well
08:25:28FromDiscord<Giamby> or about any language really
08:25:42Araqnot really, no. only if you don't think it through.
08:25:52FromDiscord<Giamby> > So you're using nim to make a new intepreted language when nim has an intepreter ๐Ÿ˜„โ†ต@Elegant Beef It's both a fun project and a learning experience
08:26:28Araqa VM FFI is not a magic wand
08:27:15Araqand writing the FFI code to bridge your VM and e.g Python's VM will be somebody's debugging hell
08:29:20FromDiscord<Giamby> I understand your reasoning, but I'm here to both improve my skills and knowledge about programming languages. I'm not a language hacker, but languages always charmed me and I'm hoping there's other people like me here who would like to help me out, that's it :)
08:30:00FromDiscord<Giamby> I'm not trying to compete with any other existing solution, but It would be nice being able to in the future
08:30:00Araqto improve your skills it's an excellent project
08:30:36Araqfor "production" it's a nightmare. :-)
08:30:48FromDiscord<Elegant Beef> I do feel like nim is one of the harder languages to find developers for an interpreted language considering we've got nimscript ๐Ÿ˜›
08:31:47FromDiscord<Giamby> I like challenges๐Ÿ‘ป, I've developed mission critical backend software (and designed a custom protocol standard for one of those), it can't be much harder๐Ÿ˜†
08:32:17FromDiscord<Giamby> @Elegant Beef I understand there's nimscript, but that's not my point
08:33:51FromDiscord<Giamby> if there's anyone interested, I'll be here ๐Ÿ˜
08:36:44*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:36:49*PMunch joined #nim
08:37:29FromDiscord<Giamby> Also @Araq[IRC]#0000, this is mainly a learning project so yeah
08:39:02FromDiscord<Rika> theyre just trying to learn is what i'm getting from their messages
08:39:09*arecacea1 quit (Remote host closed the connection)
08:39:13FromDiscord<Rika> yeah didnt see that last one there ๐Ÿ‘€
08:39:33*arecacea1 joined #nim
08:39:58AraqGiamby: you can copy and modify compiler/vm.nim and get a good one
08:40:24FromDiscord<Rika> theyre trying to learn how to make one tho
08:40:56Araqthat's easy, a while loop plus a case statement inside
08:41:17FromDiscord<flywind> !repo nim-lox
08:41:17disbothttps://github.com/cabhishek/nimlox -- 9nimlox: 11Interpreter for the 'Lox' language written in Nim 15 31โญ 1๐Ÿด 7& 3 more...
08:41:41FromDiscord<flywind> https://github.com/Yardanico/nim-lox
08:45:05*vicfred_ joined #nim
08:45:48Araqthe reason why there are so many programming languages is because they are so easy to build.
08:47:06*vicfred quit (Ping timeout: 272 seconds)
08:47:22FromDiscord<ache of head> Oh, thanks for posting these!
08:47:50FromDiscord<ache of head> Seem like good resources
08:49:36*arecacea1 quit (Remote host closed the connection)
08:50:32*arecacea1 joined #nim
08:58:40FromDiscord<flywind> When I use `testament all` to test all tests, it causes an unexpected in one file. But when I test that file, everything is ok. Any idea?
08:58:45FromDiscord<flywind> https://media.discordapp.net/attachments/371759389889003532/760787704731664404/unknown.png
08:58:52FromDiscord<flywind> (edit) 'When I use `testament all` to test all tests, it causes an unexpected ... in' => 'When I use `testament all` to test all tests, it causes an unexpectederror'
08:58:55Araqtest 'metatest'
08:59:01Araqtest 'megatest'
09:01:03*agentofuser[m] quit (Quit: Idle for 30+ days)
09:02:29FromDiscord<flywind> D:\QQPCmgr\Desktop\prologue\tests\megatest.nim(1, 8) Error: cannot open file: nimcache\tests\megatest_0d61f8370cad1d412f80b84d143e1257\megatest_0.nim
09:03:01FromDiscord<flywind> ```nim c -r tests/megatest.nim```
09:07:49PMunchzielmicha__, hi are you around?
09:08:29FromDiscord<Giamby> > Giamby: you can copy and modify compiler/vm.nim and get a good oneโ†ต@Araq[IRC]#0000 that feels like cheating
09:09:03FromDiscord<Giamby> > that's easy, a while loop plus a case statement insideโ†ต@Araq[IRC]#0000 that's the beginning tho
09:09:43FromDiscord<Giamby> > the reason why there are so many programming languages is because they are so easy to build.โ†ต@Araq[IRC]#0000 I could argue that the basics are easy, but not so trivial
09:10:32FromDiscord<Giamby> there's possible bugs, then things like bytecode optimization such as constant folding or stack caching, string interning etc
09:11:22FromDiscord<Giamby> the main purpose for this project is for me to understand fully all of the concepts and algorithms that come into play when writing compilers and VMs and I learn by doing from scratch
09:11:44FromDiscord<Giamby> When I wanted to understand async deeply I created a simple yet working async event loop implementation for I/O and stuff
09:11:58FromDiscord<Giamby> but I'd like to push this further and make it more structured
09:12:11FromDiscord<flywind> I use lots of `block`, but when using `testament all`, the test is still polluted, I don't know why.
09:12:45*newUser joined #nim
09:13:43newUserhi, I have no idea for ptr ptr float initialisation, please can someone help: https://play.nim-lang.org/#ix=2zfx
09:13:50FromDiscord<flywind> I guess `testament all` collect many tests into one, and some released memory block is reuse again without collected.
09:20:24FromDiscord<Rika> newUser: is there a reason you're doing this in this way
09:21:02newUsertranslating from a cpp file
09:21:15FromDiscord<Rika> translating or ffi?
09:21:29FromDiscord<Rika> like, really translating or translating for ffi?
09:21:33newUserwhat is ffi?
09:21:42FromDiscord<Rika> interfacing nim with cpp
09:22:01newUserno, translating (for fun and exercise)
09:22:05FromDiscord<Rika> if you're just purely translating i suggest you to use actual nim types
09:22:17newUserarray or seq?
09:22:30FromDiscord<Rika> seq
09:22:49newUserhow to init 2 dim seq with newSeq?
09:23:06newUsernewSeq[newSeq[float](17)](6)?
09:23:10FromDiscord<Rika> you can just leave it normally, it's initialized automatically
09:23:24FromDiscord<Rika> seqs are not nilable anymore
09:23:29FromDiscord<Rika> so they'll start out as empty
09:23:46FromDiscord<Rika> empty, but existing
09:23:51newUserk
09:27:26bungsend a code paste https://play.nim-lang.org/#ix=2zfz
09:33:43FromDiscord<Vindaar> newUser, if you do want to init a 2D seq of some form use `newSeqWith` https://nim-lang.github.io/Nim/sequtils.html#newSeqWith.t%2Cint%2Cuntyped
09:34:33newUser<Vindaar> nice, thx
09:35:33*oz quit (Quit: EOF)
09:35:48*oz joined #nim
09:38:51FromDiscord<Gary M> is it possible to call a C macro from nim
09:39:22FromDiscord<Gary M> or do I have to expand the macro myself in nim
09:40:15FromDiscord<haxscramper> No, you cannot call c macro. The closes thing should be either wrapping it with c2nim or using .emit. depending on what your are after
09:40:41FromDiscord<Gary M> well the issue is the library I'm trying to interface abuses macros everywhere
09:41:06FromDiscord<Gary M> macros that expand into other macros etc lol
09:41:28FromDiscord<haxscramper> So it has horrible C API and they just wrapped everything in macros to make calling it not so painful, correct?
09:41:40FromDiscord<haxscramper> Then you should probably look into c2nim
09:41:47FromDiscord<Gary M> well, the api for working with it in C is fine
09:42:02FromDiscord<Gary M> I've already tried every interop solution under the sun
09:42:13FromDiscord<Gary M> I've never got any to work, ever
09:42:21FromDiscord<haxscramper> Can you link the library in question
09:42:29FromDiscord<Vindaar> unfortunately that's just the way it is sometimes @Gary M. The header files of R were so bad for me last weekend that I ended up wrapping the stuff I needed manually, because c2nim was choking all over the place
09:42:35FromDiscord<Gary M> https://github.com/SanderMertens/flecs
09:43:16FromDiscord<Gary M> so the C api for working with this is like ECS_COMPONENT(world, Position);
09:43:31FromDiscord<Gary M> sent a long message, see http://ix.io/2zfA
09:43:53FromDiscord<Gary M> so the macro expands it to basically have generics for other structs
09:44:26FromDiscord<haxscramper> So you are talking about things like `Copy convenience macro */โ†ต#define ECS_COPY_IMPL(type, dst_var, src_var, ...)\` which expands to something else
09:44:27FromDiscord<Gary M> which looks rather ugly like: ECS_ENTITY_VAR(component) = ecs_new_component(world, 0, "component", sizeof(component), ECS_ALIGNOF(component)); ECS_VECTOR_STACK(FLECS__Tcomponent, ecs_entity_t, &FLECS__Ecomponent, 1); (void)ecs_entity(component); (void)ecs_type(component)
09:44:47FromDiscord<Gary M> which... has more macros
09:44:48FromDiscord<Gary M> lol
09:45:15FromDiscord<Gary M> again, using it in C, works fine.... interop outside of C, ehhhhhhh
09:45:24FromDiscord<mratsim> @Gary M @haxscramper you can call C macros
09:45:30FromDiscord<Gary M> how
09:45:38FromDiscord<Vindaar> you can try to run `gcc -E` on the file to let `gcc` expand the macro. Then take the expansion and make it a Nim template
09:46:02FromDiscord<Vindaar> @mratsim huh? using `emit`?
09:46:06FromDiscord<mratsim> no
09:46:16FromDiscord<mratsim> using importc
09:46:23FromDiscord<haxscramper> Oh
09:46:27FromDiscord<mratsim> I had an example in Weave, looking for an old commit
09:46:34FromDiscord<Vindaar> interesting
09:46:38FromDiscord<haxscramper> Yes, inportc it is just dumb codegen actually
09:46:40FromDiscord<Gary M> I'd like to see that
09:47:31FromDiscord<mratsim> https://github.com/mratsim/weave/blob/5ce845517948ef7011412fa41055c9472d57e045/experiments/e04_channel_based_work_stealing/primitives/coz.nim#L21-L23
09:47:45FromDiscord<mratsim> wrapping this: https://github.com/mratsim/weave/blob/5ce845517948ef7011412fa41055c9472d57e045/experiments/e04_channel_based_work_stealing/primitives/coz.h#L79
09:48:02FromDiscord<Vindaar> mind blown
09:48:14FromDiscord<Gary M> thanks, I'll take a look
09:49:30FromDiscord<mratsim> When we say Nim has the best C / C++ interop, it really means the best ๐Ÿ˜‰
09:53:04bunghow to wraps a proc like `wrapApi( rawQuery )` ?
09:53:34bungit can't take the rawQuery as nnkProcDef
09:54:46*synthmeat quit (Quit: WeeChat 2.9)
09:56:06*synthmeat joined #nim
09:59:20Araqjust forget about C ECS frameworks, it's trolling via code
10:00:50FromDiscord<Gary M> I like ECS, so I'll withstand the trolling ๐Ÿ˜„
10:00:58Araqjust use an object of arrays instead of an array of objects. yes it's super annoying in practice, you can sugar over it with Nim's templates
10:01:17Araqno need to wrap anything for that...
10:01:17FromDiscord<Gary M> besides, I simply cannot get C++ to compile either
10:02:09Araqif you cannot get things to compile you have very different problems from "omg, I lose 8ns because the cache line is not saturated"
10:04:50FromDiscord<Gary M> I mean yes I definitely don't have those problems lol
10:05:20FromDiscord<Gary M> everything works with the default gcc compiler on windows, but as soon as I try to compile the simplest application with g++ it just doesn't work.
10:07:18*Tlangir joined #nim
10:08:18FromDiscord<lqdev> Araq but ECS doesn't just imply better performance, it also has a nicer code structure esp. for a language like Nim where you cannot have recursive module dependencies
10:09:25*Tanger quit (Ping timeout: 244 seconds)
10:10:10AraqI don't agree but let's say you're completely right. why do need to wrap anything to get it? it's not really much code to write an ECS
10:10:10FromDiscord<alehander42> @Giamby cool !
10:10:40FromDiscord<alehander42> ok back to work today from now: hm, i allocate a sequence >= 900k times
10:11:02FromDiscord<alehander42> my favorite stat from yesterday
10:15:52newUserplease can someone help: https://play.nim-lang.org/#ix=2zfM
10:15:55*kinkinkijkin quit (Ping timeout: 240 seconds)
10:16:16FromDiscord<mratsim> use a proc not a template
10:16:17FromDiscord<lqdev> why template?
10:16:32FromDiscord<mratsim> C templates map to Nim generic procs
10:16:38FromDiscord<lqdev> also, generic params go after the export marker
10:16:48FromDiscord<lqdev> https://play.nim-lang.org/#ix=2zfN
10:17:16newUseryup, thx
10:28:17*dv-^_^6 quit (Quit: The Lounge - https://thelounge.chat)
10:44:05PMunchHmm, trying to figure out how to use dbus to create a notification daemon, this stuff is tricky..
10:45:54newUserbye
10:45:58*newUser quit (Remote host closed the connection)
10:49:31*Tlangir quit (Remote host closed the connection)
10:53:59*noname joined #nim
10:54:32nonamewas any decision taken / rfc written regarding https://github.com/nim-lang/Nim/pull/15282#pullrequestreview-484151422 ?
10:54:33disbotโžฅ borrow checking
10:58:05*noname quit (Remote host closed the connection)
11:08:39planetis[m]a few days back i finished a port of an breakout clone written using ecs https://github.com/planetis-m/breakout-ecs
11:09:10planetis[m]the original was created in typescript and already had c and rust ports
11:09:54planetis[m]plus I added some improvements of my own
11:16:00FromDiscord<whisperdev> Does Nim have interfaces?
11:17:19planetis[m]yes
11:17:19FromDiscord<Rika> !repo interfaced
11:17:20disbothttps://github.com/andreaferretti/interfaced -- 9interfaced: 11 15 27โญ 4๐Ÿด & 29 more...
11:17:50planetis[m]or just https://www.openmymind.net/Interfaces-In-Nim/
11:21:35bungundeclared identifier: 'await' , how to fix this , when I call `ident("await")` in macro
11:25:19*synthmeat quit (Remote host closed the connection)
11:26:19*lritter quit (Ping timeout: 244 seconds)
11:26:25*synthmeat joined #nim
11:26:49FromDiscord<Vindaar> are you sure the generated code is inside of an async procedure?
11:27:09FromDiscord<Gary M> well I got one of the macros to work so that's fun
11:27:21*synthmeat quit (Client Quit)
11:27:26FromDiscord<Gary M> but the next one is giving me more trouble because of the varargs
11:28:57bungVindaar , it's in template
11:30:44FromDiscord<Vindaar> not quite following. `await` is only valid inside procs annotated with the `async` pragma iirc. So if your macro generates code that ends up outside of such a proc it throws that error
11:32:26bungawait in template works well since 1.3.1 AFAIK
11:32:58bunghttps://play.nim-lang.org/#ix=2zg8 I also can't make this work
11:34:47*narimiran quit (Ping timeout: 240 seconds)
11:34:55bungwell, it works when the hello proc is sync, maybe I should create a issue for this
11:35:13*natrys joined #nim
11:37:55FromDiscord<Vindaar> hm, maybe. I'm no help here :/
11:40:43*orazovae[m] left #nim ("User left")
11:42:18bungthe only way I know is write this macro as a pragma attach to original proc
11:43:00bungbut I dont want touch original procs
11:43:44FromDiscord<Vindaar> the issue to me is due to the complexity of the async macro, there's a lot of ways to run into weird problems trying to modify those
11:44:39FromDiscord<Vindaar> as in elements of the body already being turned into symbols, which causes problems when reinserting the modified code with the same symbols cte
11:44:42FromDiscord<Vindaar> *etc
11:46:10*dv-^_^6 joined #nim
11:49:37bungyeah, the await template appears when compile async proc
11:50:44bungit will be a problem when I wrap it as a new template
11:55:15*altarrel joined #nim
11:56:23*opal quit (Ping timeout: 240 seconds)
11:59:26*opal joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:34*supakeen joined #nim
12:15:07*sagax quit (Remote host closed the connection)
12:24:54*krux02 joined #nim
12:25:24*luis_ joined #nim
12:31:33*synthmeat joined #nim
12:40:56*waleee-cl joined #nim
12:41:20*sagax joined #nim
12:44:55Araqso ... what can we do about https://github.com/nim-lang/RFCs/issues/178 ?
12:44:55disbotโžฅ lent/var/openArray inside objects/containers
12:45:23Araqthe more time I spent on it, the more I realize I have no clue how this feature should really work
12:45:28*luis_ quit (Quit: luis_)
12:46:00Araqit's fairytale stuff, I don't even know what a borrow operation **is**
12:46:29Araqit's some assignment to a view type, but not all of them
12:47:08Araqand you want to allow assignments between view types so that Table[int, ViewType] can compile
12:48:12*luis_ joined #nim
12:51:21*arecacea1 quit (Remote host closed the connection)
12:51:40*arecacea1 joined #nim
13:04:07*altarrel quit (Quit: WeeChat 2.8)
13:05:18*altarrel joined #nim
13:13:56ForumUpdaterBotNew thread by Bung: How to wraps async proc, see https://forum.nim-lang.org/t/6876
13:18:37FromDiscord<shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2zgA
13:19:16FromDiscord<shad0w> Is there any way that the function that i pass to mul can access whatever function i pass to add ?
13:19:28FromDiscord<shad0w> (edit) 'mul' => '`mul`' | 'add' => '`add`'
13:20:11FromDiscord<shad0w> if i want to define a function in terms of another, or is it a no go ?
13:23:42AraqI don't understand the question
13:24:16FromDiscord<shad0w> hi Araq. something analogous to javascripts `this` ?
13:24:44FromDiscord<Rika> no
13:24:47FromDiscord<Rika> not that i know of
13:24:55AraqI never understood JS's 'this'
13:25:05FromDiscord<Rika> unless you pass the type into the function
13:25:19FromDiscord<Rika> like mul: proc(this: MyType, x:...
13:26:31FromDiscord<shad0w> sent a code paste, see https://play.nim-lang.org/#ix=2zgF
13:26:41FromDiscord<shad0w> (edit) 'https://play.nim-lang.org/#ix=2zgF' => 'https://play.nim-lang.org/#ix=2zgG'
13:27:25Araqok, now I understand 'this'
13:27:29Araqyeah, Nim doesn't have it
13:27:53FromDiscord<shad0w> > I never understood JS's 'this'โ†ต@Araq[IRC]#0000 that just means. in whichever context this function runs (the stack context) find the value that i am asking for in THAT context
13:28:51Araqthe question always was what 'context' means, but it's the thing you write before the dot
13:28:59Araq(roughly)
13:29:07FromDiscord<shad0w> it's runtime
13:34:06FromDiscord<exelotl> @shad0w If I understand correctly, you can do what you want if you add a `self: MyType` as the first param to each procedure
13:35:05FromDiscord<shad0w> cant really say what scope it will run in exactly, until it does run in it. (event handlers? async stuff ? stuff that completes later, after the function that called it is long returned ? ) and whatever the scope is at that time (the context?), fetch me the value of the thing i asked after the dot.โ†ตโ†ต `this` is really untrival to explain clearly, you kindda sorta get a intuition for this over repeated use(abuse?).
13:36:13FromDiscord<shad0w> > @shad0w If I understand correctly, you can do what you want if you add a `self: MyType` as the first param to each procedureโ†ต@exelotl i could. i was just wondering if there is an inbuilt way for this in nim, since i am a newbie ?
13:37:38FromGitter<alehander92> wow `this` is not simpl
13:37:41FromGitter<alehander92> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
13:38:43FromDiscord<shad0w> > @exelotl i could. i was just wondering if there is an inbuilt way for this in nim, since i am a newbie ?โ†ต@shad0w wait no, this wont work ? i'd need the reference of the object that i am initialzing in the first place ?
13:39:50FromDiscord<shad0w> var m: MyType = MyType(x=1,y=1, add=fn Ref, mul=fn_ref)
13:39:53FromDiscord<exelotl> @shad0w I'm using a similar design in my game because I needed VTable kind of behaviour https://media.discordapp.net/attachments/371759389889003532/760858452833730571/unknown.png
13:41:36FromDiscord<exelotl> but this is because I'm working without the GC and needed more control than Nim's `method`s
13:41:55FromDiscord<Rika> @shad0w that is fine, because you will be calling the function like `m.mul(m, someint, someint2)`
13:42:24FromDiscord<exelotl> yep, that ^
13:42:24FromDiscord<shad0w> > @shad0w that is fine, because you will be calling the function like `m.mul(m, someint, someint2)`โ†ต@Rika i see.
13:42:34FromDiscord<Rika> note that m is written twice
13:42:40FromDiscord<shad0w> i got that.
13:42:45FromDiscord<Rika> okay
13:42:56FromDiscord<shad0w> at which point, i just might rip it out of m
13:43:09FromDiscord<shad0w> mul m, someint, someint2
13:43:41FromDiscord<exelotl> to avoid the self parameter you might want to try using RootObj + methods instead
13:44:03FromDiscord<exelotl> that's the more idiomatic way to do dynamic dispatch in Nim
13:44:07FromDiscord<shad0w> i'd avoid inheritance if i could
13:44:32Zevvyeah I made kids. would not recommend.
13:45:03FromDiscord<shad0w> wait, wut
13:47:54*luis_ quit (Quit: luis_)
13:48:20*luis_ joined #nim
13:51:02*luis_ quit (Client Quit)
13:53:47disrupteklol
13:53:58disruptek!last zevv
13:53:59disbotZevv spoke in 12#nim 9 minutes ago 12https://irclogs.nim-lang.org/30-09-2020.html#13:44:32
13:54:04Zevvwut
13:54:05disrupteknow it's immortalized.
13:54:40disruptekhow are you, zevv?
13:55:00Zevvoverwhelmed but enjoying myself thoroughly
13:55:38disruptekwhat are you working on?
13:56:17*Trustable joined #nim
13:57:03Zevvthe usual stuff at $customer. But there's all kind of interesting organizational things going on, it's Interesting Times
13:57:18Zevvgiven that this channel is logged, I'll not go into details :)
13:57:29disruptekhehe
13:57:31Zevveverything you #nim can and might be used against you
13:57:40disrupteki'm counting on it.
13:57:53FromDiscord<Recruit_main707> Default values for object fields was something planned?
13:58:26Zevvand you? got your villa at the lake yet?
13:59:15disruptekrecruit: yep.
13:59:37disruptekno, i just got back from moving my parents. and retrieving a car from storage.
14:00:05disruptekman, it's been so long since i had a proper drive.
14:00:10Zevvyou didn't have to move in with your parents, at least
14:00:17Zevvnot yet
14:00:24disrupteki did that earlier.
14:00:30Zevvdidn't we all
14:01:02disruptekit's a plague across this country. i hate it.
14:01:47ZevvI was expected to have a good laugh this morning. but I really had to switch that off after a minute or two
14:02:03Zevvbut let's not go into the details
14:02:47*altarrel quit (Quit: WeeChat 2.8)
14:03:01disruptekwell, my 911 still raises my spirits. i forgot how much we need something like that.
14:03:42disruptekand i killed a mouse in the trailer last night, so there's that.
14:03:53disruptekwhat have you killed lately?
14:04:54ZevvI caught one in a mouse-friendly trap that didn't turn out too mouse-friendly because the tail was stuck
14:05:04Zevvput it out 1 km away in the forst. Took it about 15 minutes to get back
14:05:18Zevvcaught it a second time, put it away 2 KM. Not made it back yet.
14:05:32Zevvit's wife was still here, however, so caught that as well and put it out 2 KM
14:05:41disrupteksame direction?
14:05:43Zevvtook about half an hour to get back and climb in throuhg the window again
14:05:45Zevvyeah
14:06:09disrupteki used the friendly traps for awhile. used to get 4-5 mice in one trap every night.
14:06:31disruptekthen i took a trip and forgot to pick up one of the "friendly" traps.
14:06:31Zevvwell, it's common voles, so I'm not keen on termintaing hem
14:06:35disrupteki won't do that again.
14:06:38Zevvthey just come in, steal some food and go out again
14:06:39Zevvkind of like that
14:06:49Zevvooh the smell?
14:06:54disruptekjust cruel.
14:06:59Zevvor just the act of killing them like that
14:06:59Zevvright
14:07:05Zevvyeah I felt sorry for the one with the tail
14:07:10Zevvthe good thing is that I recongnize it now
14:07:16Zevvit's the one with the dent
14:07:22disruptekvoles already have short tails, no?
14:07:33Zevvkind of. but long enough to get stuck
14:07:41Zevvbut I like them, they don't piss in the house or make nests
14:07:55disruptekno problem, then.
14:08:05Zevvlate evening the come speeding throuhg the house. I leave them a snack and wave. and they go again
14:08:17Zevvoh you don't have these in the states?
14:08:17Zevvwow
14:08:23ZevvI thought they would be pretty common
14:08:43disrupteki don't mind mice running across my legs while i'm working. i just don't like the scent of their urine dripping down the walls.
14:08:55Zevvyeah, that's the difference :)
14:09:02Zevvmy kids had rats for some time. never ever again
14:09:05disrupteki don't love the idea of their eating through my pantry and leaving dead family members in my walls.
14:09:12Zevvright so
14:09:19Zevvvoles just like to sleep out side I guess
14:09:32disrupteki had rats for awhile. i bred different coloration patterns.
14:09:54ZevvI liked their characters, but hated the piss
14:10:09disrupteki have a video of bentley inspecting a vole in the yard.
14:10:46disruptekimgur does video, right?
14:10:56Zevvsnippets
14:13:04disruptekwhat the hell is a snippet?
14:13:14ZevvI mean just a short fragment
14:13:16Zevva few secs
14:15:12*disruptek tries to find a 10 year old to help him post something.
14:17:20Zevvdude you should tiktok that shit
14:17:29disruptekjust what i need.
14:17:53Zevvoh wait that's illegal, right?
14:18:10disruptekthe way i use tiktok is illegal, yeah.
14:18:16Zevvhooo
14:18:40disruptekvermont is gorgeous this time of year. it's a shame all the colorful leaves will be blown off the trees today.
14:18:59Zevvthat's what makes it so beautiful
14:19:35ZevvThis time of year I alwas pick up one nice big conker on my daily hikes and put it on the table, all in a row over the days
14:19:44Zevvso the latest is big and shiny and has a great smell
14:19:52Zevvthe oldest is shrinking, getting dull and wrinkly
14:20:03Zevvand they just lie around all year. Until half of september
14:20:36Zevvlooking like rasins by that time
14:20:38disruptekremind me about conkers.
14:20:45Zevvhey disruptek
14:22:16disrupteki mean the game, chucklehead.
14:22:23Zevvooow
14:22:57Zevvmy kids always play it wrong
14:23:08Zevvthey hit eachother and scream loud until I break
14:24:20disruptekyeah, but how is the game supposed to be played?
14:24:31ZevvI don't know. It's nothing dutch
14:24:38disruptekhmm.
14:24:48ZevvI believe you take one each, smack them into eachother and see which once survices
14:24:53disrupteki didn't know that was a prerequisite for you.
14:24:54Zevvthey do that with raw eggs here
14:25:41disruptekoh, i have a talent for smacking nuts.
14:26:20disruptekimgur doesn't support my vole video. such a shame.
14:26:26Zevvbah
14:26:54disruptekwhere are we on cps?
14:27:06disruptekit's supposed to work with arc now, right?
14:27:10ZevvI have no clue. I forgot what that was
14:27:44disrupteki am pulling the first-proc-param-is-included-in-proc-name out of mangling.
14:28:10disrupteki just cannot make it work right now, and i'd rather move on to ic.
14:28:24Zevvman you're still chewing on that
14:28:43disruptekit's too boring for me, honestly.
14:29:24Zevvhmm got a meeting and a call and stuff. that's also getting kind of boring...
14:29:26Zevvbbl!
14:45:17*dv-^_^6 quit (Quit: The Lounge - https://thelounge.chat)
14:47:44*luis_ joined #nim
15:05:51FromDiscord<lqdev> is there a "symbol" (interned string) library for nim?
15:06:11FromDiscord<lqdev> didn't find anything on nimble
15:19:26*a_chou joined #nim
15:22:46*hnOsmium0001 joined #nim
15:24:39leorize[m]1then probably there aren't any
15:24:59leorize[m]1what is this "interned string" thingy btw? :P I read up on wikipedia but still not sure what exactly is it
15:25:12*leorize[m]1 quit (Quit: issued !quit command)
15:25:12FromDiscord<lqdev> an immutable string with a precomputed hash basically
15:25:32FromDiscord<lqdev> it's represented by an ID
15:25:37FromDiscord<lqdev> so table lookups are fast
15:26:41Araqit's a poor man's enum :P
15:27:23disruptekyep.
15:27:37FromDiscord<lqdev> yeah, kind of
15:28:11FromDiscord<lqdev> i need them because you can't expand an enum easily
15:28:24FromDiscord<lqdev> also things like language string lookups are much faster
15:28:35disruptekdon't be rude. of course you can.
15:28:46disruptekE n u m
15:29:01Araqlqdev: you can compute string hashes at compile-time
15:29:04FromDiscord<lqdev> wow that's a t h i c c enum you got there disruptek
15:29:10disruptekright?
15:29:22Araqand thus Nim offers everything to build one
15:29:32FromDiscord<lqdev> Araq: yeah, i know
15:29:38FromDiscord<lqdev> that's what i'm doing right now
15:29:43Araqenums are still much better as they are typo safe
15:29:51disruptekhe's trying to make his code harder to understand.
15:30:00FromDiscord<lqdev> yeah, i agree that enums are better
15:30:10FromDiscord<lqdev> but sometimes symbols are more flexible
15:30:12*leorize joined #nim
15:30:36disruptekcan you give me an example?
15:31:21FromDiscord<lqdev> i am developing a "tracer" system for debugging physics - basically, physics objects can request drawing stuff during the update process
15:31:25FromGitter<alehander92> e.g. cases where you might have dynamic source of values?
15:31:35FromDiscord<lqdev> i want to be able to filter what gets draw
15:31:38FromDiscord<lqdev> drawn*
15:31:38FromGitter<alehander92> i guess if you want to ensure stuff is only one of n "init"-ed values
15:31:49FromGitter<alehander92> but you init them on runtime, that's a bit tough to represent with enums
15:31:57FromDiscord<lqdev> and using strings as tags is gonna be slow
15:32:08FromDiscord<lqdev> and enums are too inflexible for that
15:32:14disrupteksounds like sets of enums.
15:32:23FromDiscord<lqdev> no disruptek
15:32:31Araqyou can also do
15:32:32FromDiscord<lqdev> my engine would need to define a fixed set of categories
15:32:39FromDiscord<lqdev> which i don't want
15:32:46Araqtype Thing = distinct uint8
15:32:52Araqtype Filter = set[Thing]
15:33:03Araqconst systemA = Thing(1)
15:33:06disruptekthat seems even less useful.
15:33:13FromDiscord<lqdev> hm true
15:33:21Araqconst systemB = Thing(2) # look, can put this in a different file
15:33:31FromDiscord<lqdev> but autoincrementing the Thing number would be a nice thing to have
15:33:41disrupteki do a lot of set/enum/const gymnastics in gully.
15:33:45disruptek!repo gully
15:33:46disbothttps://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 1โญ 0๐Ÿด
15:33:47Araqyou can do that with a .compileTime variable
15:34:01FromDiscord<lqdev> true
15:34:02disrupteki think you're making this hard than it needs to be.
15:34:08disruptek^ harder, too.
15:34:19AraqI'm not sure it's a good idea, stable values are better when you ever debug your code
15:34:36FromGitter<alehander92> you can just have a wrapper ? `systemA = initThing()`
15:34:47FromGitter<alehander92> which uses the compile time var inside
15:35:21*a_chou quit (Remote host closed the connection)
15:36:09FromDiscord<lqdev> yea, but what if i have tons of language strings? i'd have to do that for every one of them
15:36:29FromDiscord<lqdev> a bit annoying imo
15:37:00Araq'what if' you don't? you cannot program against what-ifs. what if the coworker also wants to understand your complex solution?
15:37:35Araqwhat if you need to port your code over to Java which lacks compile-time variables? I hate what-if.
15:37:48Araqyou can whatif everything
15:37:59disruptekif only there was a way to make a device that could do one verbose operation over and over without human intervention.
15:38:03Araqdo you have tons of language strings?
15:38:17FromDiscord<lqdev> well, not yet. but i expect to
15:38:25disruptekstore them in code, not csv or json.
15:38:37disruptekmake sure whatever you do, you don't structure them at all.
15:38:53disruptekit's important that a computer cannot do the job of your coworker.
15:38:56*luis_ quit (Quit: luis_)
15:39:19Araqlqdev: is it related to i18n ?
15:39:20*luis_ joined #nim
15:39:25FromDiscord<lqdev> yes.
15:40:23Araqah, now we're getting somewhere
15:40:50AraqI designed a library for that use case, not sure if I kept the code
15:42:13Araqkarax/i18.nim
15:42:45Araqwas written for the JS target
15:45:25AraqI used Table[string, string] but you can indeed do better than that. Easiest way it to compute a hash at compile-time and don't bother with incrementing a global counter (which breaks modularity)
15:45:57Araqsimply add some runtime check that you never got a hash collision
15:46:47Araq(and you won't for any hash function that is at least mediocre)
15:48:08FromDiscord<lqdev> hm
15:48:21leorizewe have several i18n libraries iirc
15:48:50FromDiscord<lqdev> yeah but it's not just about i18n
15:49:26FromDiscord<lqdev> there are many more usecases for a symbol library, at least in my opinion
15:49:43FromDiscord<lqdev> there probably exist faster solutions, but i do not want to overoptimize my code.
15:50:06FromDiscord<lqdev> so one of those use cases is a modding API for my game
15:50:35FromDiscord<lqdev> modders will be able to arbitrarily add blocks and stuff, and of course storing a tile's name for each tile on the map is very inefficient
15:50:36Araqi18n is also about a format like DSL that allows for pluralizations etc
15:50:51FromDiscord<lqdev> so a simple solution would be storing a symbol
15:50:57FromDiscord<lqdev> and i do not want to overengineer this
15:51:17FromDiscord<lqdev> i want the API to be simple to use and understand. i don't want to require the modder to first fetch a special block ID thing
15:51:23FromDiscord<lqdev> just provide the name
15:52:56bungcircular dependecies is headache, move code around every time
15:52:57Araqif you don't want to overengineer it, use an enum
15:53:18FromDiscord<lqdev> so we're back to square one.
15:53:20Araqyou can map the ordinal value to a line number in a text file
15:53:37Araqand then for i18n you simply use a different text file
15:53:52Araqtranslators have it easy, one file they have to translate
15:54:29Araqextra points if the format strings are position independent (use $1 and not %s)
15:55:03FromGitter<alehander92> but lqdev what happens if people access a symbol that doesnt exist
15:55:13FromGitter<alehander92> does it just gets auto-initialized
15:55:30FromGitter<alehander92> or is there not a concept of "acceptable set of values"
15:56:20*NimBot joined #nim
15:56:34FromDiscord<lqdev> it's just created
15:56:45FromDiscord<lqdev> i do agree it's less type safe
15:57:05FromDiscord<lqdev> it has its drawbacks just like the enum approach
15:57:15FromDiscord<lqdev> you go either safe or easily expandable
16:01:26FromGitter<alehander92> well, if you force the user to handle the case when it's not a valid symbol
16:01:32FromGitter<alehander92> it's maybe similarly safe
16:01:49FromGitter<alehander92> but it might be more verbose
16:02:28Araqthe enum is a better fit because for translations you need to know *all* the strings to be translated
16:02:44Araqso you might as well enumerate them in a single place
16:03:01*uhoh joined #nim
16:03:10uhohWhy Nim over Rust?
16:03:39supakeenWhy not :)
16:03:47leorizewe have nicer syntax with pretty much the same safety :P
16:03:49FromDiscord<lqdev> yes Araq, but not when you have a plugin/modding API
16:03:56leorizenot as big ecosystem though
16:03:58Araqcause it has fewer different pointer types and is more convenient
16:04:20uhohAraq What about the fact that Rust doesn't have a garbage collector?
16:04:25FromDiscord<lqdev> uhoh: primarily because it's less verbose.
16:04:37FromDiscord<lqdev> nim also has deterministic memory management, --gc:arc
16:05:13uhohFromDiscord What does "deterministic memory management" mean?
16:05:20Araq"no GC"
16:05:34FromDiscord<mratsim> it means you know at compile-time when memory/resource is released
16:05:41krux02uhoh: FromDiscord is not a user name
16:06:20Araq(even though reference counting is a GC and thus Rust and C++ are GC'ed too)
16:06:39FromDiscord<mratsim> it's a memory management technique, not a GC ๐Ÿ˜‰
16:07:04leorizeI guess popular belief is that GC = stack scanning monster that locks your program up
16:07:11FromDiscord<mratsim> there is not garbage with refcounting because it's collected immediately as it's not useful, so you don't put it in a "bin"
16:07:22krux02"deterministic memory management" means no garbage collection interrupiton of the program
16:07:41FromDiscord<mratsim> well you have ref deletion amplification
16:08:06FromDiscord<mratsim> when you remove the last ref of a long leaf node and then you need to collect the whole tree/graph
16:08:25FromDiscord<lqdev> is reading elements from a single table thread-safe?
16:08:27FromDiscord<lqdev> i'd expect it to be
16:08:31FromDiscord<lqdev> but not writing
16:08:37leorize@lqdev locks
16:08:43leorizealways use locks
16:08:47FromDiscord<lqdev> leorize: even for writing?
16:08:50FromDiscord<lqdev> gah
16:08:51FromDiscord<lqdev> reading*
16:08:51leorizeeven for reading
16:08:53Araqmratsim, true but not related to refcounting, a tree of unique pointers has the same downside
16:09:00FromDiscord<lqdev> leorize: why?
16:09:00uhohHow does Nim handle errors?
16:09:06FromDiscord<lqdev> uhoh: exceptions
16:09:14FromDiscord<mratsim> or Result, or bool or options
16:09:28leorize@lqdev because cpu caches :P ask mratsim
16:09:31FromDiscord<mratsim> and you can enforce exceptions handling or not raising exceptions
16:09:52krux02lqdev: Don't expect things to be "thread safe", thread safe means that it locks internally, which is an expensive overhead on single threaded applications.
16:09:52FromDiscord<lqdev> @mratsim i'm asking you then, why do i need a lock when reading or writing to a table?
16:09:57FromDiscord<mratsim> "Multithreading pitfalls for the unsuspecting dev"
16:10:22*natrys quit (Quit: natrys)
16:10:45FromDiscord<mratsim> A Nim table assume a single threaded portion of the program so in that case you don't need a lock. If multithreaded, don't use Nim tables so you wouldn't need a lock either ๐Ÿ˜‰
16:10:47krux02lqdev: you don't want Tables to have locking overhead on single thread applications, or do you?
16:10:55uhohlqdev: Why exceptions over functors?
16:11:01FromDiscord<lqdev> krux02: of course not
16:11:03uhohDoes Nim have null?
16:11:11krux02yes
16:11:11leorizeuhoh: Araq can answer that for you
16:11:20leorizeand yes we have null, it's called `nil` here
16:11:24FromDiscord<mratsim> functors are not a way to handle errors
16:11:41uhohmratsim: What do you mean?
16:11:46Araquhoh, please read one of our tutorials.
16:11:58uhohAraq sure
16:12:00leorizeanyone have a good write up on why we don't use result types?
16:12:10disruptekwhat?
16:12:22leorizeI'll just add that to disbot so we can refer people to it whenever someone asks :P
16:12:24disruptekwhat are result types?
16:12:28krux02uhoh: you are asking basic question here, they are not hard to answer, but they are also pretty well covered by the tutorials.
16:12:29leorizeResult[T]
16:12:35FromDiscord<mratsim> A functor is a map between categories, unless you meant handling errors with Monad like Result or Either types
16:13:05FromDiscord<mratsim> @leorize, because it needs a maintainer in the stdlib
16:13:25FromDiscord<mratsim> This has been reviewed in security audits btw: https://github.com/status-im/nim-stew/blob/master/stew/results.nim
16:13:39leorizeeverything needs a maintainer, and there will be if there's interest for it in the core language
16:13:42disruptekwell, i use result types and i like them.
16:13:46disruptek!repo badresults
16:13:46disbothttps://github.com/disruptek/badresults -- 9badresults: 11like results but worse 15 1โญ 0๐Ÿด
16:14:10leorizeAraq is very insistent on exceptions as default instead of result types
16:14:16FromDiscord<mratsim> https://github.com/disruptek/badresults/blob/master/badresults.nim#L1
16:14:27Prestigedisruptek: why are the builds always failing
16:14:37disruptekwhat builds?
16:14:51disruptekmratsim: it's MIT-licensed.
16:14:59Araqmonads don't compose. ;-)
16:15:17Prestigehttps://travis-ci.org/github/disruptek/badresults
16:15:26disruptekwho cares?
16:15:40AraqI do.
16:15:44PrestigeIt's just funny, like 99% of repos I see have failing builds
16:15:56disruptekAraq: i'm talking to prestige.
16:16:03Araqah :D
16:16:07FromGitter<alehander92> that's a nolan's movie man
16:16:15disruptekPrestige: it's arne's tests and i don't care about travis anymore; it's too annoying to use.
16:16:23disrupteki only use github actions now.
16:16:33Prestigefair, I also dislike travis
16:16:34FromDiscord<Rika> why is travis annoying for you?
16:16:44leorizeit's slow, and the ui doesn't work
16:16:49FromGitter<alehander92> circle ci?
16:16:51Prestigetbh I can't figure out github actions, I just use circleci
16:16:54disruptekbadresults is used extensively in gittyup, so i know that it works fine.
16:17:03disruptekprestige: just copy it from one of my repos.
16:17:05FromGitter<alehander92> but edge cases
16:17:12leorizecircle ci is cool but can't do OSX
16:17:17leorize(without paying)
16:17:25disruptektravis doesn't track the nims i care about.
16:17:30disruptekand, not in a way i trust.
16:17:44disruptekie. i don't want choosenim to be a part of my ci.
16:18:54disruptekmy opinion is that exceptions should be exceptional.
16:19:10*luis_ quit (Read error: Connection reset by peer)
16:19:12disruptekif you have a known error condition and you're going to write code against it, then what the fuck. write the damn code.
16:19:17disruptekwrite it in the right place.
16:19:21disruptekhave it do the right thing.
16:19:28disruptekand have it abstract the error condition properly.
16:19:35leorizeexceptional is subjective
16:19:37*luis_ joined #nim
16:19:42disruptekof course.
16:19:58disruptekbut a plan for failure isn't exceptional.
16:20:05disruptekit's no less exceptional than a plan for success.
16:20:15FromDiscord<mratsim> agreed
16:20:22FromDiscord<mratsim> file not found should not be an exception
16:20:27Prestigedisruptek is exceptional
16:20:57FromDiscord<Rika> of course he is
16:21:24disruptekexceptionally difficult.
16:22:13leorizefile not found can be an exception depends on the type of application/library you're working on :P
16:22:17FromDiscord<Rika> i guess everyone has their self deprecating moments
16:22:43disruptekrika: how would you like a throat punch?
16:22:58disrupteki am on a killing spree.
16:23:05disruptek0 days since my last kill.
16:23:39FromDiscord<Rika> i dont have a throat
16:23:43FromDiscord<Rika> in fact, i dont exist
16:23:45FromDiscord<Rika> wake up
16:23:48PrestigeWeapon of choice? Compiled languages.
16:24:17leorizeI have yet to see a good writeup on exceptions vs result in Nim
16:24:24FromGitter<alehander92> the problem is
16:24:27disruptekwhy do you keep saying this?
16:24:40FromGitter<alehander92> if you just define it like "use whatever you want"
16:24:54FromGitter<alehander92> i guess i like strong conventions
16:25:04FromGitter<alehander92> except when i disagree with them :(
16:25:12FromDiscord<Rika> lol
16:25:14disrupteki've explained my position on exceptions vs. results multiple times in this channel. you don't think it's a good write-up? or you have a good rebuttal?
16:25:16FromDiscord<Rika> doesnt everyone
16:25:34disruptekpeople vote with their feet.
16:25:38leorizedisruptek: I mean a written one on paper/rfcs
16:25:59leorizelike result types are the hot thing rn and I do like them
16:26:06FromDiscord<Rika> why does it have to be on paper or an rfc
16:26:09leorizeI just feel like I'm not seeing enough of issues with exceptions
16:26:13PrestigeI'd like to see an RFC
16:27:28FromGitter<alehander92> oh man
16:27:48disruptekmy issues with exceptions mostly surround interop, macros, scope.
16:27:56leorize@Rika because chat is small and there aren't room for debate without you having the information on hand already
16:28:13FromDiscord<Vindaar> and also, _because it gets lost_
16:28:14FromDiscord<Rika> i guess it is time to write
16:28:30PrestigeMaybe I should write an RFC about multiple inheritance, but I think this community would burn me at the stake
16:28:42leorizePrestige: someone did already iirc
16:29:07disruptekleorize: what would the rfc request comments on?
16:29:46FromDiscord<Rika> prestige: it cant hurt to try i assume
16:29:57leorizethe possibility of result as the default error handling scheme? if you don't want that then a forum post is fine
16:30:14disrupteki'm fairly certain that there will be big pushback on that.
16:30:28leorizelike I would really want opinions of people who are much more qualified than me :P
16:30:46disruptekbut, putting a results type into stdlib makes sense to me.
16:30:56disrupteka more basic one than badresults.
16:31:22leorizeyou can just push one to fusion
16:31:29disruptekno, i don't /do/ fusion.
16:31:29leorizelower barrier of entry and still usable ootb
16:31:37*uhoh quit (Quit: Leaving)
16:32:59disruptekmaybe i'll just strip down badresults. maybe that'll be more attractive to other folks.
16:33:01Prestige@Rika yeah I think I will, after work
16:33:02*altarrel joined #nim
16:33:07leorizePrestige: as long as you present your case convincingly no one will burn you down :P
16:33:19PrestigeI'll do my best haha
16:34:43FromDiscord<Rika> good luck
16:37:57*altarrel quit (Quit: WeeChat 2.8)
16:44:27FromGitter<alehander92> i am testing
16:44:33FromGitter<alehander92> different impls of data structures
16:44:37FromGitter<alehander92> in the same module
16:44:40FromGitter<alehander92> with when implX
16:44:51FromGitter<alehander92> is that a common approach: i feel like
16:44:59FromGitter<alehander92> its cleaner than commenting out stuff
16:45:09FromGitter<alehander92> but maybe more fragmented
16:45:44bungproc in template still need exported ?
16:45:48disruptekdude, newline is not a substitute for punctuation.
16:48:18FromGitter<alehander92> :)
16:48:23FromGitter<alehander92> ! ok
16:50:45FromGitter<alehander92> ok
16:51:02FromGitter<alehander92> testing my next impl : tables vs seq
16:53:18Zevvdisruptek: you are the only one here using punctuation anyway.
16:53:29Zevvoh look at me, i just punctuated.
16:53:40*bung quit (Ping timeout: 246 seconds)
16:53:47disruptekyeah, but i hate having to hang on sasha's every word. i never know when the sentence ends.
16:53:52Zevv"punkt"
16:53:57disrupteki mean, what the fuck, man.
16:54:10disrupteksome of us are trying to watch porn.
16:54:40FromGitter<alehander92> porn is evil, man
16:54:49disruptekdon't be silly.
16:54:52FromGitter<alehander92> and this fact is so important, i use punctuation
16:54:54FromDiscord<Rika> some people read it too
16:55:22FromGitter<alehander92> So, read my analysis and focus.
16:55:27disruptekthere are many shades of evil.
16:55:48Zevvlike, 50
16:55:52disruptekshhh
16:55:57disruptekthat book was horrible.
16:56:18FromGitter<alehander92> Yes, and porn is horrible .
16:56:34disruptekwhat did i tell you about being silly?
16:57:03FromDiscord<lqdev> why don't tables preserve their contents between run time and compile time? https://play.nim-lang.org/#ix=2zi0
16:57:16FromDiscord<lqdev> and is there a way i could work around that?
16:58:35disruptekhttps://play.nim-lang.org/#ix=2zi4
16:58:58FromGitter<alehander92> So
16:59:03FromDiscord<Vindaar> https://play.nim-lang.org/#ix=2zi5
16:59:15FromGitter<alehander92> I'll try to hide set logic behind `implSets`
16:59:26FromGitter<alehander92> and see how long does it take without it.
16:59:29FromDiscord<lqdev> thanks vindaar
16:59:33FromDiscord<lqdev> and disruptek
16:59:34disrupteklqdev: i use a proc instead of static:
16:59:45FromDiscord<lqdev> yeah but it doesn't work with a proc either
17:00:01disruptekhmm, works for me. lemme hack your example.
17:00:09FromGitter<alehander92> With `nkSym` only and `implSets = false`, I hope I see more clearly bottlenecks.
17:00:40FromDiscord<lqdev> hm but this won't work here
17:00:47FromDiscord<lqdev> because it'll make the table immutable
17:00:54FromDiscord<lqdev> unless maybe i use a TableRef?
17:01:12disruptekhttps://play.nim-lang.org/#ix=2zi9
17:01:16disruptekworks fine.
17:01:40FromDiscord<lqdev> yeah but the table is mutated after its declaration
17:02:04FromDiscord<lqdev> TableRef doesn't seem to be valid for const
17:02:13disruptekwell, sure.
17:03:34FromGitter<alehander92> yess
17:03:35disruptekthis seems like a bug to me.
17:03:50FromGitter<alehander92> With sets false , we get to <4s
17:04:04disrupteklqdev: ie, i would file this as an issue: https://play.nim-lang.org/#ix=2zic
17:04:05FromGitter<alehander92> much closer to the original compiler time.
17:04:30FromDiscord<lqdev> disruptek: this applies to seqs too, btw
17:04:40FromDiscord<lqdev> i'm filing a bug then
17:08:08*vicfred_ quit (Quit: Leaving)
17:08:32disruptekalso https://play.nim-lang.org/#ix=2zih
17:08:53disrupteki mean, how the hell are we supposed to do this?
17:11:37*thomasross joined #nim
17:21:29*D_ quit (Ping timeout: 260 seconds)
17:23:05*luis_ quit (Ping timeout: 240 seconds)
17:23:58FromDiscord<lqdev> https://github.com/nim-lang/Nim/issues/15441
17:24:00disbotโžฅ {.compileTime.} variables' values do not get transitioned over to runtime ; snippet at 12https://play.nim-lang.org/#ix=2zim
17:24:32ForumUpdaterBotNew thread by Niminem: First Nimble Package - process, see https://forum.nim-lang.org/t/6877
17:24:42disruptekto me, the problem is that you cannot mutate a ct var at ct.
17:24:54disrupteki've never been a fan of transitioning ct vars to rt.
17:25:03*D_ joined #nim
17:25:11disruptekespecially because they silently swallow mutations there.
17:25:18disruptekwhich is fucked up.
17:29:44disrupteki guess the problem is that this condition extends to ct, right?
17:30:06FromDiscord<lqdev> wdym?
17:30:18disruptekyou cannot mutate the ct var at ct or at rt.
17:30:30disruptekmutations are just silently ignored.
17:32:26FromDiscord<lqdev> but the compile time value is clearly changed
17:32:35FromDiscord<lqdev> in the static block
17:32:42*Vladar quit (Quit: Leaving)
17:33:07disruptek#15441
17:33:08disbothttps://github.com/nim-lang/Nim/issues/15441 -- 3{.compileTime.} variables' values do not get transitioned over to runtime ; snippet at 12https://play.nim-lang.org/#ix=2zim
17:33:57disruptekhmm, maybe i'm misremembering my own repro.
17:47:29*Trustable quit (Remote host closed the connection)
17:57:34*narimiran joined #nim
18:03:35*bung joined #nim
18:05:14*natrys joined #nim
18:11:43*bung quit (Ping timeout: 246 seconds)
18:22:16FromGitter<alehander92> praise God
18:22:25FromGitter<alehander92> such a calm evening
18:23:58FromGitter<alehander92> ok, good timings for implTables=false, implSets=false
18:24:05FromGitter<alehander92> but i need to implHistory=false now
18:24:09FromGitter<alehander92> still >4s
18:24:11FromGitter<alehander92> most of the time
18:24:48FromGitter<alehander92> The compiler is built with `-d:release` ?
18:24:51FromGitter<alehander92> Usually, right?
18:24:55disruptekyep.
18:25:35FromGitter<alehander92> dude now i get slower times
18:25:38FromGitter<alehander92> without my code
18:25:46FromGitter<alehander92> i really need to find a way to get more stable timings
18:26:23FromGitter<alehander92> how do people benchmark? i get 5s then I get 3.4s
18:26:40FromGitter<alehander92> I know about medians, but there must be a strategy,
18:26:40*vicfred joined #nim
18:26:55FromGitter<alehander92> for just getting more stable results: probably have to turn off my other apps.
18:27:01disrupteki just make up numbers.
18:32:44FromGitter<alehander92> :)
18:32:52FromGitter<alehander92> it feels like that, right..
18:36:21FromGitter<alehander92> huh man
18:36:28FromGitter<alehander92> this is unexpectedly hard
18:36:38FromGitter<alehander92> can't i just isolate one of my cpu-s and be like
18:36:43FromGitter<alehander92> just use this.
18:38:45FromGitter<alehander92> You know, the weird thing is
18:38:57FromGitter<alehander92> 6s look slower to me, but not twice as slow as 3s.
18:40:28FromGitter<alehander92> I should try with the medians of 10 runs, I guess :)
18:41:05FromGitter<alehander92> !repo golden
18:41:06disbothttps://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim ๐Ÿ† 15 22โญ 0๐Ÿด
18:41:19Araqsimply write your Nim compiler code as I do
18:41:37FromDiscord<Avatarfighter> What is up everyone
18:41:42*gmaggior joined #nim
18:42:01FromGitter<alehander92> Benchmarking is fun.
18:42:06FromGitter<alehander92> Let me play a bit
18:42:20FromDiscord<Avatarfighter> What are you benchmarking alehander?
18:43:02FromGitter<alehander92> Something that made Araq laugh.
18:43:08FromGitter<alehander92> :D
18:43:34Araqhis not-nil implementation, featuring an exponential number of memory allocations
18:43:58Araqbecause we can never let reality win over functional programming
18:44:04Araq:P
18:44:41FromGitter<alehander92> That's not really the problem, tho.
18:44:53FromGitter<alehander92> I mean, I had some needless stuff
18:44:56Araqyeah I'm not serious
18:45:07Araqbut the code looked slow
18:45:13Araqand surprise, it is.
18:45:16FromGitter<alehander92> But I am trying to find out what of the things I disable wins most time
18:45:40FromGitter<alehander92> That's true.
18:45:47FromGitter<alehander92> Man, golden install a lot of stuff
18:46:07*dv-^_^6 joined #nim
18:48:08*ldlework quit (Ping timeout: 272 seconds)
18:49:59disruptekit'll be even "worse" with the next version.
18:50:11disruptekit's a thing i like to call, "code reuse."
18:50:33FromGitter<alehander92> Sorry, this is cool.
18:50:44FromGitter<alehander92> I just expected one feature.
18:50:54disruptekwhich one?
18:51:25FromGitter<alehander92> Thanks, man.
18:51:27FromGitter<alehander92> I found it.
18:51:38FromGitter<alehander92> The passing of args to the binary thing.
18:52:04FromGitter<alehander92> Is ~0.85 a big standard deviation?
18:53:24disrupteksure.
18:53:35Zevvis 3cm small? is an hour long?
18:53:41disruptekshhh
18:53:45FromGitter<alehander92> Yeah, I realized it later.
18:54:06FromDiscord<Rika> zevv i regret to inform you that 3cm is indeed small
18:54:07Zevvthat was a pretty stupid question, right? :)
18:54:12disrupteklol
18:54:19FromGitter<alehander92> Super stupid.
18:54:45disrupteki'm pretty sure it's a lot but i'm also sure you don't need to look at stddev in your case.
18:55:02disruptekthe longer golden runs, the more accurate the output.
18:55:34FromGitter<alehander92> :) http://ix.io/2ziQ
18:55:39FromDiscord<Vindaar> @Rika I beg to differ. 3 cm is 3ยท10ยณยณ planck lengths
18:55:56Zevvright so
18:56:08disruptekalehander92: why does it vary?
18:56:41FromGitter<alehander92> Awesome.
18:56:42ZevvVindaar: although you're not _quite_ right
18:56:56FromGitter<alehander92> Thank God, I feel close to figuring out what to do.
18:56:58Zevvit's 1.8561e33 lp
18:57:05FromDiscord<Vindaar> did I misremember a Planck length? damn
18:57:13FromGitter<alehander92> @disruptek , because .. I have a lot turned on currently
18:57:29FromGitter<alehander92> So probably my resource usage varies significantly.
18:57:31Zevvit would be kind of happy little accident if the plank length had any relation with the circumference of the earth, right?
18:57:50FromDiscord<Vindaar> oh, haha. I totally ignored those 1.65 ish
18:57:52Zevvat least you had the number of zeroes right
18:57:52FromGitter<alehander92> ok, so this is for `nkSym, implHistory = false, implTables = false, implSets = false`
18:58:17*rockcavera joined #nim
18:58:34FromDiscord<Vindaar> I'd argue the zeros are the important bit here ๐Ÿ˜‰
18:59:05Zevvpff zeros are nothing
18:59:20FromDiscord<Vindaar> false
18:59:42FromDiscord<Vindaar> the set of zeros has 1 element. thus it's different from the empty set, the real nothing
19:00:51FromGitter<alehander92> ix.io/2ziW !
19:01:05FromGitter<alehander92> http://ix.io/2ziW *
19:01:27disruptekjson bench: (arc) 2.79, (refc) 3.29. arc is faster.
19:01:32FromDiscord<Avatarfighter> I want to make something really inefficient
19:01:40FromGitter<alehander92> So, Araq
19:01:44FromDiscord<Avatarfighter> anyone have any ideas ๐Ÿ˜›
19:02:18FromGitter<alehander92> the good news is if I cut out a lot of stuff, the main functionality seems close to the compiler now
19:03:15disruptekbase64 bench: (arc) 1.88, (refc) 1.38. refc is faster.
19:05:03*leorize[m]1 joined #nim
19:06:00disruptekalehander92: what's the point of removing functionality?
19:06:36FromGitter<alehander92> BEING FAST
19:07:22disruptekwrong answers, delivered quickly?
19:07:38FromGitter<alehander92> you're right :)
19:07:55FromGitter<alehander92> I am saying it not very seriously .
19:08:16FromGitter<alehander92> However what this means is that I can focus on the slowest sub-feature and optimize that.
19:08:23FromGitter<alehander92> Knowing the other ones aren't a bottleneck.
19:08:55FromGitter<alehander92> Maybe http://ix.io/2zj1
19:09:07FromGitter<alehander92> this is with the alias set stuff on
19:09:25FromGitter<alehander92> It seems this is where I need to optimize ^
19:18:12*leorize[m]1 quit (Quit: authenticating)
19:18:18*leorize[m]1 joined #nim
19:29:30disrupteksounds fun.
19:30:09disruptekmy current problem is that i get type and proc symbols entered into the typecache out of order, and into separate caches. so of course they end up with the same names.
19:30:22disruptekbut the caches are nominally for the same module.
19:30:46FromGitter<alehander92> can't you merge em
19:32:43*tane joined #nim
19:34:26FromGitter<alehander92> it really seems my sets stuff is the bottleneck
19:34:54ForumUpdaterBotNew thread by Niminem: Library for making lightweight Electron-like HTML/JS GUI applications, see https://forum.nim-lang.org/t/6878
19:36:48disrupteki didn't expect to have multiple toplevel typecaches for a single module.
19:38:47FromGitter<Knaque> I'm not seeing anything in Nimble's official package list, so does anyone know if someone has made a wrapper for the Firebase SDK already?
19:38:58disruptekno one has.
19:39:40disrupteki assume you mean the rest api.
19:40:08*rockcavera quit (Remote host closed the connection)
19:40:26disrupteki guess i should release my version.
19:40:29FromGitter<alehander92> ok dude
19:41:10FromGitter<Knaque> So you've been working on one, or are you referring to an earlier conversation?
19:41:32FromGitter<alehander92> i can rebuild the compiler now in 7s
19:41:36FromGitter<alehander92> it's a bit strange
19:41:52disrupteki wrote something over a year ago. i dunno what kinda state it's in now, though.
19:41:52FromGitter<Knaque> I'm referring to https://github.com/firebase/firebase-cpp-sdk (firebase/firebase-cpp-sdk) specifically.
19:42:06disruptekoh, i don't know anything about that.
19:42:06FromGitter<alehander92> i almost wonder if i am just not visiting some stuff
19:42:29FromGitter<Knaque> But I'm not picky, I only would *really* need to query a Firestore database.
19:42:32disruptek7s is about what it takes me to build the compiler.
19:42:43*gmaggior quit (Ping timeout: 246 seconds)
19:42:46FromGitter<Knaque> Problem is, I'd love to do it myself, but I'm *so* unqualified to do so.
19:42:57disrupteknonsense.
19:43:13FromGitter<alehander92> yes disruptek :)
19:43:28*haxscramper joined #nim
19:43:49FromGitter<alehander92> huh, so it's all the set/history stuff
19:44:03FromGitter<alehander92> i just see it visually stopping
19:44:05FromGitter<alehander92> when i enable it
19:44:25haxscramperKnaque: if you don't have a lot of functions you can just wrap them using importcpp manually
19:44:40haxscramperOr try nimterop/c2nim to wrap things
19:44:58disruptekor just see if the cpp actually adds value. if not, just start from scratch in nim.
19:46:18disruptekif you want a simple example of a rest api impl in nim, i can offer a few.
19:46:28haxscramper!repo openapi
19:46:28disbothttps://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 33โญ 3๐Ÿด 7& 5 more...
19:46:32disruptekif you can get a swagger/openapi definition, then you can use openapi.
19:46:49disruptek!repo datamuse
19:46:49disbothttps://github.com/disruptek/datamuse -- 9datamuse: 11 15 2โญ 0๐Ÿด
19:46:56disruptekone we made on-stream.
19:49:05FromGitter<Knaque> I'm not committed to Firebase, so while it would be preferred, it depends on if the effort required to make it usable would be meaningfully better than just using some other service with some other flavor of SQL and being able to use the stdlib.
19:49:33disruptekwell, firebase isn't sql.
19:49:49FromGitter<Knaque> I know, just poor phrasing.
19:50:22disrupteki use firebase in production. i don't recommend firebase. i recommend aws services, but i'm heavily biased because i don't care to use the other clouds.
19:50:45disruptekwhat are you trying to store?
19:51:20FromGitter<Knaque> Basically just a single table with A:B relationships.
19:51:28disruptek!repo atoz
19:51:29disbothttps://github.com/disruptek/atoz -- 9atoz: 11Amazon Web Services (AWS) APIs in Nim 15 20โญ 0๐Ÿด
19:51:34disruptekrecommend dynamodb.
19:52:15disruptekSadly, only the 220 most popular AWS APIs are supported at this time. ๏ฟผ๐Ÿ˜ข
19:52:59FromGitter<Knaque> I genuinely can't tell if that's sarcasm or not, I've never touched anything like this before.
19:53:33disruptekit's sarcasm. all the api versions are supported.
19:54:49*gmaggior joined #nim
19:54:54FromGitter<alehander92> Araq
19:55:20FromGitter<alehander92> so ..
19:55:23*narimiran quit (Ping timeout: 240 seconds)
19:55:35FromGitter<alehander92> final for today (I might not be online 10 tomorrow): good news and bad news
19:55:50disruptekgimme the bad news first.
19:55:58FromGitter<alehander92> good news is it seems just by disabling the alias set part of all (some bugfixes needed)
19:56:02disruptekdamnit.
19:56:06FromGitter<alehander92> the speed gets close to the compiler one
19:56:15FromGitter<alehander92> so most of this N times slowdown seems to come from there
19:56:25disruptekmaybe it's slow because you're generating so many warnings.
19:56:41FromGitter<alehander92> so now even with this nilmap data structure it seems fast
19:56:46FromGitter<alehander92> ~relatively
19:56:46disbotno footnotes for `relatively`. ๐Ÿ™
19:57:10FromGitter<alehander92> bad news is that yeah the set alias thing needs some good optimization then, but i'll try to do that tomorrow
19:57:18FromGitter<alehander92> disruptek well no
19:57:33FromGitter<alehander92> i am using the `--warning ..off` stuff
19:58:06FromGitter<alehander92> and even with warning generation it can be very fast
19:58:07FromGitter<alehander92> ~10s
19:58:07disbotno footnotes for `10s`. ๐Ÿ™
19:58:12FromGitter<alehander92> with the output included
19:58:42FromGitter<alehander92> (but probably not very correct warnings right now :D)
19:59:11disruptekhonestly, i wouldn't worry about the speed unless it's like 50% slower.
19:59:44disruptekjust put a warning in like, "notnil enabled: maybe grab a coffee..."
20:00:23FromGitter<alehander92> well it was 6x slower
20:00:24FromGitter<alehander92> now it's like
20:01:27FromGitter<alehander92> 12%
20:01:28FromGitter<alehander92> slower
20:01:31FromGitter<alehander92> for nkSym, nkDotExpr and static nkBracketExpr, implHistory = false, implTables = false, implSets = false
20:01:45disrupteki dunno what that means.
20:02:15disruptekit sounds like you disabled functionality to make the speed comparable, which sounds pointless.
20:02:15FromGitter<alehander92> super unscientific, different benchmark etc
20:02:42FromGitter<alehander92> without set aliases it's ~12% slower with it's i dunno 2-4x slower probably
20:03:05disruptek.msg ryan74 i'm looking for kids, not full-grown.
20:03:10disruptekoops
20:04:27FromGitter<alehander92> ?
20:04:28Zevv!- There is no such nick: ryan74
20:04:34Zevvdon't feed the trolls
20:04:47FromGitter<alehander92> an irc professional!
20:05:03Zevv20+ years of experience, at your service
20:05:11disruptekgah you make one typo and then...
20:05:23FromGitter<alehander92> ok, so the point is that we need to keep the aliasing stuff but I just need to read a bit more
20:05:27FromGitter<alehander92> cool
20:05:29FromGitter<alehander92> thanks guys
20:08:34*bung joined #nim
20:09:23*evanj quit (Quit: WeeChat 2.9)
20:10:44haxscramperDoes anyone use nimdow window manager as main one?
20:13:12*bung quit (Ping timeout: 265 seconds)
20:15:34*natrys quit (Quit: natrys)
20:20:00disruptekprestige does.
20:21:37*nature joined #nim
20:21:42PrestigeYep
20:22:09Prestigehaxscramper: it's still in beta but is usable - if you have questions lmk
20:24:05haxscramperPrestige: do you recommend using it if I want to write some extensive additions on top of it? For example I use two languages and I coded up extension to awesome-wm that keeps track on layouts on per-window basis.
20:24:22haxscramperI'm fine with writing nim code & recompiling it
20:24:42disrupteki think that's kinda the idea behind impl a wm in nim.
20:24:56PrestigeYou could do that, sure
20:25:01haxscramperIt might also use nimscript. nimdow does not though
20:25:25PrestigeYeah I've not tried using nimscript much, yet
20:25:36PrestigeI'm receptive of suggestions
20:27:31haxscramperPrestige: Is there API for customization or it is more dwm-style approach where you just write everything directly in project's code? And nimscript is just one possibility for extensions (and not really the best one in this scenario).
20:29:25PrestigeAtm it's more patch style like dwm - I haven't made plans for extensions
20:30:33PrestigeIf you have questions about the code just ping me
20:30:51disruptekprestige: why did you write it?
20:31:26PrestigeI mostly liked my dwm version but it would crash sometimes when I'd move windows between monitors
20:31:45PrestigeSo I wrote my own wm, and it's working better for me
20:32:16Zevvit's just like forth. Everybody just needs to write a forth at least once, just like a wm
20:32:19PrestigeI also liked awesome but it had a memleak
20:32:24haxscramperIs it a good idea to try and integrate it with hcr or `plugins` module?
20:32:29haxscramperOr just waste of time
20:32:53disruptekhcr is a waste. plugins would be worthwhile, especially if you could help get it working on arc.
20:33:38haxscramperisn't hcr just glorified DLL i.e. similar to plugins?
20:33:48disrupteki only say this because i want fewer arc bugs and hcr is ripe for disruption during ic.
20:34:39PrestigeI just cba to write a plugin system currently, there's a lot more core functionality I want to add before that
20:34:40FromDiscord<Avatarfighter> whats hcr for the uneducated like myself?
20:34:45FromDiscord<Avatarfighter> Hot code reload
20:34:47FromDiscord<Avatarfighter> nvm
20:34:51FromDiscord<Avatarfighter> I am educated
20:35:27leorize[m]1lol
20:36:01leorize[m]1haxscramper: nah, HCR lets you edit the source code and has that change seamlessly loaded into the current program
20:36:17haxscramperPrestige: I think that providing WM-as-a-library is a better starting point compared to plugin system as it only requires separating code into "internal" and "more-public" parts. Well, that's how I would start something like this
20:36:40leorize[m]1for starters just a configuration system like xmonad sounds fun
20:36:54haxscramperAnd end user just builds own WM or reuses existing solution (default one that is shipped with the library and only works with simple configurations)
20:36:54leorize[m]1I don't know how exactly xmonad works, but it's configuration is written in haskell
20:37:19PrestigeI'm planning on writing a cli client that will invoke WM actions, like bspwm
20:38:03haxscramperBecause in the end I think there are two types of users (roughly): ones that want to customize everything and ones that just want different shortcuts/styles.
20:41:53Prestigehaxscramper: well if you have questions or have ideas, hit me up. It's still in a working state, a lot to add and a lot can be changed
20:44:09haxscramperMost likely I will try it in the next several days. Since I'm interested rewriting & relatively heavy customizations I might do a PR with some documentation updates or new helper functions but that's probably it. Otherwise I don't think I will have some major ideas.
20:45:43PrestigeOne thing I'm planning on doing is having a 81 tags per monitor (9x9 grid) - that's kind of the next thing I'm adding
20:48:20haxscramperCan I have multiple workspaces per monitor & multiple windows per workspace? Similar to awesome-wm
20:48:58PrestigeYou mean have the same window on multiple workspaces?
20:49:45PrestigeYeah that's called 'tags', I'm working on adding that currently. Atm it's just regular workspaces, 9 per monitor
20:49:53*nature quit (Ping timeout: 260 seconds)
20:51:26haxscramperAnd each tag can have any number of clients & I can move clients between tags? And no, I didn't mean to have same window on multiple tags
20:52:07PrestigeAh I think that's just regular workspace behavior - yeah, you can do that
20:52:13haxscramperI'm just not that great when it comes to WM terminology because after I configured mine I just forgot everything
20:52:57haxscramperGreat, seems like everything I need is already there. Thanks for answering they questions
20:53:08haxscramperthe*
20:53:12PrestigeAny time
20:55:13PrestigeLook over https://github.com/avahe-kellenberger/nimdow/wiki/User-Configuration-File#controls-table- to see the available controls. There's also a default config file in the repo
21:06:30*Jesin quit (Quit: Leaving)
21:09:56*Jesin joined #nim
21:24:57disruptekprestige: you looked at the i3ipc, right?
21:25:35PrestigeI'm aware it exists, that's about it
21:26:14disruptekthere are a couple clients for it (i wrote one) and wm'ers in wayland and x that use it, so...
21:26:35disruptekmaybe it will be good inspiration if you decide to go a different way.
21:26:44disruptekanything dbus would make me happy.
21:26:57PrestigeI'll check it out, thanks
21:42:56*def- quit (Quit: -)
21:43:07*def- joined #nim
21:51:39*ldlework joined #nim
21:52:53FromDiscord<Avatarfighter> What is the tool that all the cool Nim developers use to convert C code to Nim but then you tweak it by hand
21:53:16leorizec2nim
21:54:06FromDiscord<Avatarfighter> oh yeah that's what I am looking for
21:54:16FromDiscord<Avatarfighter> Thank you leorize, the name was slipping from me
21:55:56FromDiscord<Avatarfighter> Has anyone used https://github.com/nimterop/nimterop before and to rate their experience on a scale of 0-9
21:56:12disruptek09
21:56:13leorizeI'll give it a 6
21:56:34leorizereally cool, just that nimterop have a lot of dependency (not that it can be avoided)
21:56:54disruptekwhat does that have to do with anything?
21:57:17FromDiscord<Avatarfighter> Ok that's neat, I want to make a wrapper for a lib but I'm too lazy to figure out what to put in my importc pragmas
21:57:36leorize[m]1I guess nimble stop doing that now but I used to have a ton of installation errors when I try nimterop to write nim-kmod
21:57:57leorize[m]1if nimble is better now then this should stop being an issue
21:58:01*haxscramper quit (Remote host closed the connection)
22:00:35*solitudesf quit (Ping timeout: 240 seconds)
22:04:16FromDiscord<Avatarfighter> nimterop is the coolest thing I've ever seen
22:09:24*bung joined #nim
22:10:22*abm joined #nim
22:13:47*bung quit (Ping timeout: 240 seconds)
22:14:40*tane quit (Quit: Leaving)
22:24:24disruptekyou need to get out more.
22:32:35*oprypin quit (Quit: Bye)
22:32:43*oprypin joined #nim
22:33:46*def- quit (Quit: -)
22:34:26*def- joined #nim
22:37:59FromDiscord<Avatarfighter> lmao
22:38:17FromDiscord<Avatarfighter> What is this outside you speak of?
22:49:46FromDiscord<Avatarfighter> Oh my goodness I just spent the past hour making this in figma so I can mess with it with fidget https://media.discordapp.net/attachments/371759389889003532/760996830619631646/unknown.png
22:50:24disruptekthat's crazy; `Main` is my mom's name.
22:50:33disruptekare we related?
22:53:39disruptekhello?
22:54:07disruptekare you `Main` on your mother's side, or is it dad's family?
22:55:40FromDiscord<Avatarfighter> main is on my fathers side of course
22:55:42FromDiscord<Avatarfighter> hbu
22:55:49disruptekmom.
22:56:04disruptekgrammy main just died like 5 years ago.
22:56:09FromDiscord<Avatarfighter> are our parents related? siblings maybe
22:56:27disruptekno; my mom only has sisters.
22:56:33FromDiscord<Avatarfighter> oh
22:57:04FromDiscord<Avatarfighter> well my main is better ๐Ÿ˜‰
22:58:14disruptekhttps://www.youtube.com/watch?v=AYo2vpzfvj8
23:01:12FromDiscord<Avatarfighter> oh god
23:01:14FromDiscord<Avatarfighter> the intro
23:01:21FromDiscord<Avatarfighter> i wasn't expecting this
23:02:11disruptekno one expects the spanish inquisition.
23:11:40FromDiscord<Avatarfighter> how would one iterate through a `ptr cstring`?
23:11:57*enthus1ast quit (Ping timeout: 260 seconds)
23:13:03disruptekwhat does that even mean?
23:13:25FromDiscord<Avatarfighter> I'm not sure how to phrase my question to be honest
23:13:56disruptekitems cst
23:15:02FromDiscord<Avatarfighter> this library that i'm wrapping has `char**` as a parameter and I believe the Nim equivalent is `ptr cstring` right?
23:15:21FromDiscord<Avatarfighter> Can I iterate a ptr?
23:15:34disruptekyou can deref a ptr.
23:16:43FromDiscord<Avatarfighter> What type would I get?
23:16:55FromDiscord<Avatarfighter> if I deref'd a ptr like the one I put above?
23:17:00disruptekwho knows. nim is funky that way.
23:17:07FromDiscord<Avatarfighter> lovely
23:17:11disruptekit's a total crapshoot.
23:17:33FromDiscord<Avatarfighter> im assuming I cant cast my `ptr cstring` to an openarray or something lol
23:18:20disruptekuse [] to deref it, chuckles.
23:18:39FromDiscord<Avatarfighter> I'm going to be so sad if i can't iterate this
23:18:56disruptekme too, you're embarrassing me.
23:19:23disruptekso i guess the icons for my bookmarks are stored in a sqlite db.
23:19:24FromDiscord<Avatarfighter> lol
23:20:18disrupteki wonder if there's an easy way to set a bookmark icon manually.
23:21:29disruptekah, you do this with extensions. i guess that makes sense.
23:25:26*abm quit (Read error: Connection reset by peer)
23:25:28*enthus1ast joined #nim
23:31:17FromDiscord<liming-coder> xmlparser doesn't support namespace?
23:34:02*gmaggior quit (Quit: Leaving)
23:42:11*fredrikhr5 joined #nim
23:42:11*^Q-Master^ joined #nim
23:45:24*Q-Master quit (Read error: Connection reset by peer)
23:45:36*fredrikhr quit (Ping timeout: 258 seconds)
23:45:36*fredrikhr5 is now known as fredrikhr
23:45:56disrupteki think i'm ready to become a grandpa.
23:45:59*Prestige quit (Ping timeout: 258 seconds)
23:46:29disruptekrecreational child-rearing, you know what i mean?
23:46:47*Prestige joined #nim
23:47:08disrupteki'll stay on your couch and smoke your dope when i'm not watching yer nasty ass kids.
23:47:26disrupteki think we could make this work out great for everyone.
23:47:56*arecacea1 quit (Remote host closed the connection)
23:48:35*arecacea1 joined #nim
23:51:09disruptekdude, can you stream an appletv to airpods?
23:51:38disruptekholy shit, that's killer.
23:55:47FromDiscord<Vindaar> @Avatarfighter if you know your `char **` really is an array of `char *`, you can cast to `ptr UncheckedArray[cstring]`. Need to know the length of course:โ†ตhttps://play.nim-lang.org/#ix=2zkeโ†ตโ†ตgotta go to bed, good night ๐Ÿ™‚