<< 27-02-2021 >>

00:06:17*theelous3 quit (Read error: Connection reset by peer)
00:07:25*theelous3 joined #nim
00:15:29*casaca joined #nim
00:35:46*jess quit (Quit: - think)
00:37:35*jess joined #nim
01:02:34*JustASlacker joined #nim
01:06:36*JustASlacker quit (Ping timeout: 240 seconds)
01:07:10*antranigv quit (Remote host closed the connection)
01:13:15*JustASlacker joined #nim
01:19:10*JustASlacker quit (Ping timeout: 256 seconds)
01:22:37*antranigv joined #nim
01:23:52*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:24:13*njoseph joined #nim
01:24:53federico3https://labs.bishopfox.com/tech-blog/an-exploration-of-json-interoperability-vulnerabilities
01:25:54*NimBot joined #nim
01:55:34*smlckz[m] left #nim ("User left")
03:05:45*wasted_youth2 quit (Quit: Leaving)
03:29:44*muffindrake quit (Ping timeout: 240 seconds)
03:31:59*muffindrake joined #nim
03:39:28*abm quit (Read error: Connection reset by peer)
03:50:13*theelous3 quit (Read error: Connection reset by peer)
04:17:35*xet7 joined #nim
04:29:36*spiderstew joined #nim
04:31:14*spiderstew_ quit (Ping timeout: 264 seconds)
04:44:19*ddl_smurf joined #nim
04:55:03FromDiscord<Anonymous Poet> im in the awkward situation where im trying to rewrite some code in nim, and in the old code, addition overflowing is a "feature". Fortunately, nim errors if an int overflows, but I'd like this behaviour to check compatibility with the old system. what should i do?
04:58:29FromDiscord<exelotl> @Anonymous Poet use an unsigned int if the wrapping behaviour is desired
04:58:41FromDiscord<ElegantBeef> There is also `--overflowChecks:on|off`
04:58:58FromDiscord<Anonymous Poet> In reply to @exelotl "<@747239904181747854> use an unsigned": i need it to be treated as a negative though
04:59:12FromDiscord<Anonymous Poet> i think overflow checks is what i wanted, will try in a sec
04:59:22FromDiscord<ElegantBeef> You can disable most runtime checks
04:59:53FromDiscord<ElegantBeef> Though i dont know the behaviour
05:00:23FromDiscord<Anonymous Poet> yes, that worked, ty
05:00:33FromDiscord<Anonymous Poet> I dont suppose I can disable it for only a certain section of code?
05:00:42FromDiscord<Anonymous Poet> like push a pragma
05:00:52FromDiscord<Rika> There is actually a push pragma
05:00:58FromDiscord<exelotl> I was just about to ask that xP
05:01:23FromDiscord<Anonymous Poet> so like `{.push overflowChecks:off .}`?
05:01:33FromDiscord<Rika> Prolly yeah
05:03:00FromDiscord<Anonymous Poet> hmm, that spelling didnt work; where should i look for the right word?
05:04:57FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2R1F
05:07:02FromDiscord<Anonymous Poet> https://nim-lang.org/docs/manual.html#pragmas docs suggest that its correct too but its still erroring
05:07:16FromDiscord<Anonymous Poet> im trying to push this at the top level call site btw
05:07:24FromDiscord<ElegantBeef> Show code
05:07:40FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2R1H
05:07:56FromDiscord<Anonymous Poet> runHaskellTl is basically just eval
05:08:38FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2R1I
05:08:51FromDiscord<Anonymous Poet> but i dont want to disable the check for all my test cases (even though thats what the reference implementation does)
05:10:23FromDiscord<ElegantBeef> Think you'd need to push the pragma inside the code block that uses it
05:10:45*ddl_smurf quit (Quit: _)
05:10:52FromDiscord<Anonymous Poet> Ah :/
05:10:56FromDiscord<Anonymous Poet> makes sense, i guess
05:11:24FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2R1K
05:11:43FromDiscord<Anonymous Poet> in that case ill probably just ignore this test case - i saw that my implementation passes it, and there's a handful of other tests that should be inclusive enough
05:12:11FromDiscord<ElegantBeef> well you could have a `when defined(overFlowSilliness):` with the overflow logic turned on insiide that
05:12:20FromDiscord<ElegantBeef> But yea idk what you need exactly ๐Ÿ˜„
05:12:32FromDiscord<Anonymous Poet> can I set a `define X:` in code somehow?
05:12:39FromDiscord<Anonymous Poet> or is that only set-able from the cli?
05:13:10FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2R1L
05:13:20FromDiscord<Anonymous Poet> i know i can do `if defined(FOO):` for the second bit, but what about the first?
05:13:38FromDiscord<ElegantBeef> Not a clue
05:13:56FromDiscord<Anonymous Poet> haha, fair enough, ty for the help!
05:14:36FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2R1M
05:15:26FromDiscord<Anonymous Poet> how bad is the macro behind it?
05:15:39FromDiscord<ElegantBeef> ~120 loc ๐Ÿ˜„
05:15:39*rockcavera quit (Remote host closed the connection)
05:15:58FromDiscord<ElegantBeef> You can look at it here https://github.com/beef331/constructor/blob/master/src/constructor/variants.nim#L13
05:16:38FromDiscord<ElegantBeef> Currently have an issue with the shared fields it just has an internal error, have to make a minimal example or resolve my weird AST
05:17:14FromDiscord<ElegantBeef> Though it'll only work on 1.5.1 + due to my use of strictNotNil
05:17:43FromDiscord<Anonymous Poet> i swear i saw 1.4.4 dropped just this week
05:18:08FromDiscord<ElegantBeef> odd numbers indicate development
05:18:23FromDiscord<ElegantBeef> "1.5.X" is development for 1.6
05:18:30FromDiscord<Anonymous Poet> ๐Ÿ˜ฎ
05:18:47FromDiscord<Anonymous Poet> does your macro generate the `initVar` and friends functions?
05:18:52FromDiscord<ElegantBeef> Yep
05:19:01FromDiscord<Anonymous Poet> and if so, does it also disallow construction with the raw `Lambda(kind: ...)` form?
05:19:16FromDiscord<ElegantBeef> No you cannot disallow that unless you dont expose the type
05:19:39FromDiscord<hamidb80> good morning
05:19:46FromDiscord<ElegantBeef> To disallow that you just have to not export the object, but export the fields then import that module
05:19:47FromDiscord<Anonymous Poet> aww ๐Ÿ˜ฆ
05:20:08FromDiscord<ElegantBeef> I mean it's pretty hard to accidently call the default constructor considering how tedious it is to usue
05:20:10FromDiscord<ElegantBeef> (edit) "usue" => "use"
05:20:12FromDiscord<Anonymous Poet> i want my programs to be statically provably correct
05:20:53FromDiscord<ElegantBeef> Yea i mean i still only do runtime checks for ensuring that you dont pass the wrong kind of variant
05:20:54FromDiscord<Anonymous Poet> i think i've had enough respect for idiots instilled in me - "theres always a smarter idiot"
05:21:13FromDiscord<Anonymous Poet> best to just not allow an incorrect construction to begin with imo
05:21:35FromDiscord<Anonymous Poet> but ty for this work, definitely a step in the right direction!
05:21:38FromDiscord<ElegantBeef> I agree, but we cannot disable the constructor from within the model
05:22:13FromDiscord<Anonymous Poet> hmm, think it would be possible to make a `{.hiddenConstructor.}` pragma? you could probably just do some fairly simple file checks
05:22:51FromDiscord<Anonymous Poet> it wouldnt have to be bullet proof (ex. `foo/foo.nim` and `bar/foo.nim` could trick it), but might still be worth it?
05:22:52FromDiscord<ElegantBeef> This is the output btw if curious https://play.nim-lang.org/#ix=2R1O
05:23:42FromDiscord<Anonymous Poet> `Error: expression expected, but found 'keyword const'` ? cant set it to 1.5.1
05:23:50FromDiscord<Anonymous Poet> (and this was after adding not nil pragma)
05:23:53FromDiscord<Rika> Set what?
05:24:09FromDiscord<ElegantBeef> The code i shared isnt meant to be runnalbe
05:24:13FromDiscord<ElegantBeef> (edit) "runnalbe" => "runnable"
05:24:19FromDiscord<ElegantBeef> It's just a showcase of what it generates
05:25:06FromDiscord<Anonymous Poet> ah derp :p
05:25:36FromDiscord<ElegantBeef> Suppose i should throw an error instead of the assert, but meh mostly just toy code
05:26:10FromDiscord<Anonymous Poet> it looks much less intimidating than i'd have expected
05:27:20FromDiscord<ElegantBeef> Well it's just a DSL for making variants it's not any of the funky macro stuff ๐Ÿ˜„
05:28:23FromDiscord<hyu1996> https://media.discordapp.net/attachments/371759389889003532/815092946374361088/unknown.png
05:28:40FromDiscord<ElegantBeef> [1,2,3,4].\`@\`
05:29:37FromDiscord<hyu1996> ok let me try
05:32:17FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#lexical-analysis-stropping
05:34:06FromDiscord<ElegantBeef> Also anonymous the "Safe constructor" wouldnt be overly complex since the logic is merely "When calling an constructor check if the callsite's name is 'newT' or 'initT'"
05:34:34FromDiscord<ElegantBeef> Assuming you can get that information easily of course
05:34:45FromDiscord<ElegantBeef> I'm not a compiler developer, i'm a numpty
05:36:35FromDiscord<hyu1996> thanks ๐Ÿ˜‹ i like nim lang
05:36:53FromDiscord<ElegantBeef> Ah then you're in the right place
05:37:09FromDiscord<ElegantBeef> If you do want to break the ufcs just do `[1,2,3,4].items.toSeq`
05:37:34FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax
05:57:50FromDiscord<Araq> these limitations will mostly disappear btw
05:58:20FromDiscord<ElegantBeef> With tim's aliasing or another thing ๐Ÿ˜„
06:04:50FromDiscord<ElegantBeef> Ah i see timothee's latest wip PR, first class iterators it seems
06:11:10FromDiscord<hamidb80> ufcs ?
06:12:01FromDiscord<ElegantBeef> Uniform function call syntax, where we get both `b(a)` and `a.b()` from a single implementation
06:12:11FromDiscord<ElegantBeef> The manual refers to it as Method Call Syntax
06:13:08FromDiscord<flywind> it is called MCS in Nim.๐Ÿ˜œ
06:13:29FromDiscord<ElegantBeef> Sure, same thing different name
06:14:54FromDiscord<Araq> well my name makes sense as the "uniform" syntax is `f(a, b, c)` without special casing the first argument...
06:18:08FromDiscord<ElegantBeef> Yea Universal is probably a better U, or I just call it like MCS like a proper Nim user ๐Ÿ˜„
06:19:31FromDiscord<flywind> https://en.m.wikipedia.org/wiki/Uniform_Function_Call_Syntax
06:19:52FromDiscord<ElegantBeef> Who's that for? ๐Ÿ˜„
06:21:48FromDiscord<Araq> https://i.redd.it/jd25yqv8xsf31.jpg
06:24:27FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2R1Y
06:25:21FromDiscord<Rika> ive got a good feeling im doing something wrong but idk
06:25:36FromDiscord<Araq> concepts are not interfaces
06:25:43FromDiscord<Rika> i'm not using it as such
06:25:58FromDiscord<Rika> i'm using a ref because i need ref semantics
06:27:03FromDiscord<Rika> i dont want this to "resolve at runtime"
06:32:20FromDiscord<Rika> i dont understand why this fails
06:36:02FromDiscord<Araq> too complex to type check, I guess
06:37:09FromDiscord<Rika> oh oh nevermind it seems like "echo AInfo is Info" is false for some reason
06:38:40FromDiscord<Rika> oh okay thats an odd error
06:39:06FromDiscord<Rika> so the gist is that an error in another module i import causes the concept to not match the type
06:39:49FromDiscord<Araq> ah
06:40:07FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=2R26
06:42:33*waleee-cl quit (Quit: Connection closed for inactivity)
07:00:01*letto quit (Ping timeout: 276 seconds)
07:16:23*letto joined #nim
08:08:23FromDiscord<hyu1996> `a.info[] < b.info[]`where is `info` field defined
08:11:30FromDiscord<hyu1996> sorry, I see it
08:20:51*quadrassel4321 joined #nim
08:27:10FromDiscord<Solitude> In reply to @Rika "```nim type ": works on devel
08:27:33FromDiscord<Rika> Yeah
08:27:49FromDiscord<Rika> Now I just need to figure out the internal error which I assume is from async
08:29:38ForumUpdaterBotNew thread by Drkameleon: Easiest way to check for shift-left overflow?, see https://forum.nim-lang.org/t/7564
09:06:28FromDiscord<hyu1996> sent a code paste, see https://play.nim-lang.org/#ix=2R2A
09:08:08FromDiscord<ElegantBeef> Well make a forum account and reply ๐Ÿ˜„
09:09:33FromDiscord<hyu1996> ok
09:18:43*krux02 joined #nim
09:19:47*krux02 quit (Client Quit)
09:20:10*krux02 joined #nim
09:22:04*fredsted joined #nim
09:23:24fredstedHi, I'm trying out nim for the first time. Installed with homebrew on mac and getting this error when trying a script that connects to an ssl http server. Do I need to ditch homebrew and compile nim manually to enable ssl support? "Exception message: SSL support is not available. Cannot connect over SSL. Compile with -d:ssl to enable.
09:23:24fredstedException type: [HttpRequestError]"
09:27:22*krux02 quit (Remote host closed the connection)
09:27:41*krux02 joined #nim
09:32:33FromDiscord<carpal> In reply to @hyu1996 "": do you use vscode?
09:32:57FromDiscord<hyu1996> yes
09:33:04*vicfred quit (Read error: Connection reset by peer)
09:33:35FromDiscord<hyu1996> https://media.discordapp.net/attachments/371759389889003532/815154653431857162/unknown.png
09:33:43FromDiscord<Solitude> fredsted, compile your program with -d:ssl
09:34:39fredstedSolitude: Thanks :-)
09:35:01*vicfred joined #nim
09:35:19*krux02_ joined #nim
09:35:30FromDiscord<hyu1996> isn't fredsted a robot?
09:38:15FromDiscord<ElegantBeef> Nope, it's a bridge to irc
09:43:12*haxscramper joined #nim
09:46:39fredstedAfter adding the -d:ssl flag when compiling my Nim program, I now get this: "Exception message: error:140020B5:SSL routines:CONNECT_CW_CLNT_HELLO:no ciphers available" (Am using macOS 11.0.1, have installed openssl 1.1.1j via brew)
09:47:39fredstedInterestingly there seems to be only like 5 results for that error on google.
09:50:35*krux02_ quit (Quit: Leaving)
09:50:54*krux02 quit (Remote host closed the connection)
09:53:57*letto quit (Ping timeout: 264 seconds)
09:57:06*krux02 joined #nim
10:01:03FromDiscord<ElegantBeef> fredsted what's the result with `nim -v`?
10:01:41fredstedElegantBeef, https://sf.gl/f/b79d584.txt
10:07:19FromDiscord<ElegantBeef> Whelp fairly clear issue with openssl but no clue how to actually help, sorry ๐Ÿ˜„
10:21:32Oddmongerhttps://nymtech.net/ : the name was cool but it's go+rust
10:23:29*letto joined #nim
10:25:18FromDiscord<carpal> how does the nim compiler make it works?โ†ตhttps://play.nim-lang.org/#ix=2R37
10:25:51FromDiscord<carpal> if nim generates c code, in c a similar code would throw "incomplete type"
10:30:39FromDiscord<mratsim> just look at the C codegen
10:30:50FromDiscord<carpal> yes I'm looking for it
10:31:11FromDiscord<carpal> (edit) "for" => "at"
10:31:19FromDiscord<mratsim> you can do recursive types in C, otherwise you wouldn't be able to do intrusive linked lists
10:33:34FromDiscord<carpal> I'm talking about the prototypes
10:33:42FromDiscord<carpal> not recursive structs
10:34:28FromDiscord<carpal> but in nim yes
10:34:28FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=2R39
10:37:23*vicfred quit (Quit: Leaving)
11:08:25FromGitter<offbeat-stuff> Yo
11:09:03FromGitter<offbeat-stuff> I am alive after that macro journey , did this to get The typeImpl through macro for a typedesc
11:09:03FromGitter<offbeat-stuff> template genCon(T: typedesc) = โŽ โŽ ```const o = getTypeImpl(T).repr() โŽ mkCon(T,o)``` [https://gitter.im/nim-lang/Nim?at=603a284f457d6b4a948f6c8f]
11:10:03FromGitter<offbeat-stuff> Well Onto the next one, How do I disable output buffering for execCmd
11:10:56FromGitter<offbeat-stuff> I want to get hold on the ansii codes for a program called bat that is like cat but with syntax highlighting
11:12:27*superbia joined #nim
11:13:12FromGitter<offbeat-stuff> I could have used unbuffer command but it stops the bat when the stdin stops which is before the bat outputs
11:39:56*haxscram` joined #nim
11:40:11*haxscram` left #nim (#nim)
11:44:12*haxscramper quit (Ping timeout: 256 seconds)
12:12:02FromGitter<AlexisCAL> Hello, I have this code in Ruby: โŽ โŽ ```code paste, see link``` โŽ โŽ I tried to do the same in nim [https://gitter.im/nim-lang/Nim?at=603a3712d2619a4f2e0ed01a]
12:18:55FromGitter<AlexisCAL> (sorry for split, big fingers lol) โŽ And I have this: โŽ โŽ ```code paste, see link``` โŽ ... [https://gitter.im/nim-lang/Nim?at=603a38afd74bbe49e0c0acba]
12:21:10FromDiscord<hamidb80> `#? stdtmpl(subsChar = '$', metaChar = '#', toString = "xmltree.escape")`
12:21:13FromDiscord<hamidb80> what's that
12:21:52FromDiscord<hamidb80> https://github.com/dom96/nim-in-action-code/tree/master/Chapter7/Tweeter/src/views
12:22:14FromDiscord<hamidb80> (edit) "that" => "that?"
12:27:37FromDiscord<haxscramper> Source code filters
12:31:37FromGitter<AlexisCAL> @hamidb80 It looks to be defining the helpers for the views with `$` being used for substitution and `#` for nim code blocks in the view, lastly `toString` is set to escape XML special chars so to sanitize the value to some extent. This is the format for Jester templates. Maybe reading this will help you understand more: https://ttj.dk/blog/2019/01/20/setup-a-website-with-nim
13:24:27*beeswax joined #nim
13:25:05beeswaxis there a way to use unicode characters in a format string for times.format()?
13:29:28*xet7 quit (Remote host closed the connection)
13:30:40*theelous3 joined #nim
13:30:54*xet7 joined #nim
13:36:05FromDiscord<haxscramper> !eval import std/times; echo parse("2000-01-01", "yyyy-MM-dd").format("'ะ–ะจะจะ–'yyyy")
13:36:09NimBotะ–ะจะจะ–2000
13:36:17FromDiscord<haxscramper> > Other strings can be inserted by putting them in ''. For example hh'->'mm will give 01->56.
13:39:58beeswaxoh I didn't make the connection between that arrow and any possible string :facepalm:, thank you!
13:50:30FromGitter<HJarausch_gitlab> How to get the address of an object? โŽ I need to create an object (on the heap) and save โŽ its address. The following does not work โŽ โŽ `type Obj = object ... [https://gitter.im/nim-lang/Nim?at=603a4e26457d6b4a948fcfbf]
13:53:07FromDiscord<haxscramper> Create an object and take its address separately
13:53:26*fredrikhr joined #nim
13:53:29FromDiscord<Yardanico> @HJarausch_gitlab by this you're creating an object on the stack
13:53:47FromDiscord<Yardanico> you want an unmanaged (raw) heap-allocated object? then use `alloc` and friends
13:54:05FromDiscord<Yardanico> or maybe you're ok with managed (by GC) heap-allocated object/
13:55:31FromGitter<HJarausch_gitlab> @haxscramper If I create the object within some proc, isn't it allocated on the local stack, If yes, an address to that is invalid as soon I leave the proc?
13:56:13FromDiscord<Yardanico> yes
13:56:27FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R4i
13:58:45FromDiscord<Yardanico> then myObj will have a ptr to a heap-allocated object
13:59:33FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#create%2Ctypedesc
13:59:45FromDiscord<Yardanico> but maybe you want a managed heap-allocated object?
14:01:20*asdflkj joined #nim
14:02:45*xet7 quit (Remote host closed the connection)
14:04:02FromGitter<HJarausch_gitlab> @Yardanico Thanks! But then I have to create the object first and initialize its fields afterwards?
14:04:25FromDiscord<Yardanico> well all nim objects are zero-initialized by default, but yes
14:04:42FromDiscord<Yardanico> you can assign all fields at once with myObj[] = Obj(id: 5)
14:06:17FromGitter<HJarausch_gitlab> Thanks for this (although it implies some copying). โŽ Nim should have something like C++ โŽ ``new myObj(....)``
14:07:15FromDiscord<konsumlamm> are you sure that you don't just want to use a ref object?
14:08:41FromDiscord<exelotl> We have the convention of defining a proc newFoo(args) to create a managed pointer, initFoo(args) to create an object by-value...โ†ตBut do we have a convention for creating an unmanaged pointer?
14:08:59FromDiscord<Solitude> In reply to @exelotl "We have the convention": we do. dont.
14:09:16FromDiscord<exelotl> xD
14:09:24FromDiscord<exelotl> That's fair lol
14:12:39FromDiscord<exelotl> @HJarausch what's your use case here? Can you use ref instead of ptr?
14:12:44FromDiscord<Solitude> In reply to @exelotl "We have the convention": i like status'es convention of init/new(typedesc). thats the future.
14:13:55FromDiscord<Yardanico> > typedesc
14:14:48*krux02` joined #nim
14:15:35*krux02` quit (Remote host closed the connection)
14:16:21FromDiscord<exelotl> On the GBA I find myself using init(var T) a lot
14:17:19FromDiscord<Solitude> In reply to @exelotl "On the GBA I": thats cool too
14:17:20FromDiscord<exelotl> Because I don't do any heap allocation, I usually need to initialise something that's already allocated
14:18:46FromGitter<HJarausch> @exelotl I have several object types, one of which has a seq of objects and all other just have a seq of pointers to these objects
14:20:59FromDiscord<Yardanico> why not use ref objects then? :P
14:22:42FromDiscord<exelotl> I suppose in order to use ref objects you have to replace the master sequence of objects with a sequence of ref objects too
14:23:23FromDiscord<exelotl> Which may not have the desired performance characteristics, since they'll no longer be contiguous in memory
14:28:57FromGitter<HJarausch> Then, in the single object which contains the seq of objects I have to use deferencing ([]) all over the time. That's doable of course, but less readable
14:29:27*krux02` joined #nim
14:29:44*Gustavo6046 quit (Read error: Connection reset by peer)
14:30:40*Gustavo6046 joined #nim
14:31:21FromGitter<HJarausch> @Solitude Where is this ``init`` proc/template/macro defined?
14:33:28FromDiscord<Solitude> nowhere
14:33:50FromDiscord<Solitude> you define it yourself for your types
14:34:25FromDiscord<konsumlamm> In reply to @HJarausch "Then, in the single": when you use `.`, it automatically dereferences
14:35:03*krux02`` joined #nim
14:35:51krux02`what ~init~ are you specifically talking about?
14:39:17FromDiscord<Solitude> https://status-im.github.io/nim-style-guide/03_language.html#object-initialization
14:39:35FromGitter<HJarausch> exelotl wrote โŽ *On the GBA I find myself using ``init(var T) `` a lot*
14:43:38krux02`Nim does not have a constructor language feature.
14:44:09krux02`There are default values for members in discussion. But not yet accepted in the language (AFAIK)
14:44:55krux02`This one reason for this is exception safety. Only functions can raise exceptions, not variable declarations (as in c++).
14:45:27FromDiscord<haxscramper> https://github.com/nim-lang/RFCs/issues/252 was partially accepted with `constexpr` for field values
14:46:17krux02`I don't know the details anymore, but getting c++ code exception safe is surprisingly very hard and has many unexpected corner cases that I don't remember right now.
14:47:00krux02`not having default constructors or generally arbitrary object initialization code circumvents this problem.
14:47:50krux02`using the ~init~ pattern allows to have kind of constructors.
14:48:01krux02`I think that is very useful pattern to use
14:48:16krux02`Ok, anyway I didn't get the full discussion and need to go now
14:48:17krux02`bye
14:54:55*al1ranger joined #nim
15:19:50*beeswax quit (Quit: leaving)
15:20:24*xet7 joined #nim
15:21:15*rockcavera joined #nim
15:26:46FromDiscord<exelotl> sent a code paste, see https://paste.rs/82t
15:28:41*al1ranger quit (Quit: Leaving)
15:29:11FromDiscord<exelotl> then I can use it like `objAffMem[id].init(myMatrix)` (where objAffMem is an array of ObjAffine)
15:29:11FromDiscord<Yardanico> he won't get pinged by this btw :P
15:29:15FromDiscord<Yardanico> ah nvm he will
15:29:15FromDiscord<exelotl> aw
15:29:23FromDiscord<Yardanico> thought that he was still through gitlab
15:29:31FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/815244223213207552/unknown.png
15:29:34FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/815244239997894656/unknown.png
15:29:35FromDiscord<Yardanico> yeah sorryu
15:32:40FromDiscord<carpal> do you advise to read the nim lexer(<https://github.com/nim-lang/Nim/blob/devel/compiler/lexer.nim>) or not? because in the readme of the compiler there is this https://media.discordapp.net/attachments/371759389889003532/815245019027472384/unknown.png
15:34:09FromDiscord<haxscramper> When I was starting writing parsers I tied to read this and also base my parser around lexbase
15:34:21FromDiscord<haxscramper> In the end I decided it is easier to do everything from scratch
15:35:39FromDiscord<haxscramper> But I usually just read the whole file into string at once (because why not, I would do this anyway) and parse it by indexing into it directly
15:37:59FromDiscord<dom96> !eval echo(300 in 250 .. 500)
15:38:01NimBottrue
15:38:36FromDiscord<carpal> In reply to @haxscramper "In the end I": yes I always write all from scratch
15:39:02FromDiscord<carpal> because I learn so
15:39:08FromDiscord<mratsim> assembly for ever
15:39:08FromDiscord<carpal> (edit) "because I learn ... so" added "more"
15:39:11FromDiscord<carpal> ahah
15:39:28FromDiscord<carpal> I tried doing something with assembly, but floats are terrible to manage
15:40:33FromDiscord<mratsim> There is no point in using assembly for floats.
15:40:57FromDiscord<mratsim> Compilers produce decent code even with just intrinsics.
15:41:21FromDiscord<mratsim> When i say decent, I mean i can beat pure Assembly high performance library with intrinsics.
15:41:57FromDiscord<mratsim> There are more usable float registers on x86_64 than integer/general registers ๐Ÿคท
15:43:20FromDiscord<carpal> mhhh
15:43:25FromDiscord<carpal> and so?
15:44:50FromDiscord<mratsim> the compiler has more leeway for optimizations and doesn't try to do fancy things that actually are pessimizations.
16:00:42FromDiscord<carpal> but I tried to do that to learn lol
16:13:15saemMorning
16:20:58FromDiscord<Kiloneie> Hey nimions, i wanna add you all on twitter so for when i post a video i can share it more via twitter.
16:22:58FromDiscord<Kiloneie> Please @ me here your twitter.
16:24:26FromDiscord<Kiloneie> This social media thing really works because yesterday i shared my last video on twitter and facebook and the views and watch time went up to almost the amount that i got from the day i actually released the video.
16:25:37FromDiscord<dom96> <https://twitter.com/d0m96> ๐Ÿ™‚
16:25:42FromDiscord<Kiloneie> I cannot 100% confirm it was all due to sharing on social media(fridays/saturdays do get more), should know more once analytics gathers the data, which is like 1-2 days.
16:26:56FromDiscord<Kiloneie> Whoever is running the nim_lang twitter, probably Araq or Miran, should add me.
16:27:16FromDiscord<Kiloneie> Don't wanna bother them on a weekend though ๐Ÿ˜›
16:35:26*krux02`` quit (Ping timeout: 264 seconds)
16:36:02*krux02` quit (Ping timeout: 264 seconds)
16:36:02*krux02 quit (Ping timeout: 264 seconds)
16:36:54FromDiscord<dom96> Just tweet and CC the nim_lang twitter
16:36:59FromDiscord<dom96> we will RT it
16:37:04FromDiscord<dom96> or at least like it
16:39:15FromDiscord<Kiloneie> as in @Nim_lang ?
16:39:36FromDiscord<Kiloneie> im a boomer D:... haven't used twiter is so long
16:40:33FromDiscord<dom96> yeah
16:40:51FromDiscord<Kiloneie> Okay will do that with the next one
16:43:20FromDiscord<dom96> I'll tweet it out from the nim_lang twitter ๐Ÿ™‚
16:43:22federico3if I can put together some kludge to access the tweets from mastodon I'm going to follow you guys
16:43:32FromDiscord<Rika> some poor lad is called @ nim here? lmao
16:43:36FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2R5C
16:43:53FromDiscord<Kiloneie> yeh that was weird xD
16:44:41FromDiscord<dom96> https://twitter.com/nim_lang/status/1365704376652886024
16:45:18FromDiscord<Kiloneie> Nice
16:45:31asdflkjIโ€™m a zoomer, I donโ€™t use twitter except for nitter
16:46:00FromDiscord<Kiloneie> Yeh i never really used it other to watch when the podcast TotaLbiscuit went online
16:46:05FromDiscord<Kiloneie> he is dead now...
16:46:45FromDiscord<Kiloneie> so ... i never used twitter since, actually stopped before that. i couldn't watch some of the podcasts because they were quite late in the day
16:47:26FromDiscord<dom96> ahh, I've watched TotalBiscuit back in the day too
16:48:09FromDiscord<Kiloneie> man i miss him, and his style of content to follow new games, his podcasts shown a lot of games so i could see if i wanted to play them... now i get news of cool games randomly...
16:49:23FromDiscord<dom96> same :/
16:50:28FromDiscord<Kiloneie> Kind of idolized him, and took notes what not to do when making games and what to do.
16:54:14*waleee-cl joined #nim
16:57:51*natrys joined #nim
17:05:03*rockcavera quit (Remote host closed the connection)
17:14:46*krux02 joined #nim
17:14:58*krux02` joined #nim
17:15:25FromDiscord<QueenFuckingAdrielle> game dev convo?
17:16:03FromDiscord<QueenFuckingAdrielle> im trying to learn vulkan rn and it makes me want to hurt kittens
17:16:54FromDiscord<Unaimend> So I think I found sth. where no usefull error message is given
17:16:55FromDiscord<Unaimend> https://play.nim-lang.org/#ix=2Qz5
17:17:56*krux02` quit (Remote host closed the connection)
17:18:24FromDiscord<Yardanico> wdym?
17:18:45FromDiscord<Yardanico> this works as expected because you're modifying the string
17:18:55FromDiscord<Yardanico> v1 is a view into a string, so if a string changes - the view will change to
17:18:59FromDiscord<Yardanico> too
17:19:21FromDiscord<QueenFuckingAdrielle> anyone have any opinions on a good cross platform window library that runs on nix/windows/android/ios/mac?
17:19:23FromDiscord<Unaimend> NVM the link is wrong
17:19:38FromDiscord<QueenFuckingAdrielle> so like, not glfw
17:19:39FromDiscord<Unaimend> In reply to @Yardanico "wdym?": https://play.nim-lang.org/#ix=2R5P
17:20:00FromDiscord<Yardanico> hm yeah, c compiler errors are bugs, please make an issue :)
17:20:14FromDiscord<Unaimend> Will do
17:20:34FromDiscord<Unaimend> Any Idea what I did wrong there?
17:21:17FromDiscord<Rika> no
17:21:22FromDiscord<Rika> nothing here looks wrong
17:21:35FromDiscord<Rika> strange? yes, strange to store len but its not incorrect
17:21:46FromDiscord<Rika> seqs already internally store their len
17:21:58FromDiscord<Rika> but again its not wrong to do so
17:25:22FromDiscord<Unaimend> just a habit, dont think that it makes a difference after optimization
17:25:28FromDiscord<Unaimend> https://github.com/nim-lang/Nim/issues/17197
17:25:33FromDiscord<Unaimend> So is this issue ok
17:25:49saemhmm, trying to reason about how to move a cppBackend specific nkHiddenAdder wrapping and move it from the sem layer into the code gen and not quite sure where it should go. ๐Ÿค”
17:26:40saemSpecifically, trying to figure out how to move this change here: https://github.com/nim-lang/Nim/commit/d933fde40d1232004c9eaa260dc6bd3dc376c272
17:27:06FromDiscord<Yardanico> @Unaimend mostly yes, you can use \`\`\`nim to specify syntax highlighting, and also version is better to be copied from "nim -v". And you should paste your C compiler error into "current output"
17:27:18FromDiscord<Unaimend> ok will edit
17:27:20FromDiscord<Yardanico> i edited your issue to enable highlighting
17:27:34FromDiscord<Yardanico> but yeah, if you provide "current output" it might help other people in the future if they will get the same C compiler error
17:27:38FromDiscord<Yardanico> so they can search by the message in the issues
17:29:22FromDiscord<Unaimend> So not sure if the c compiler output helps of if i should format is somehow, but i added $nim -v and the output
17:29:28FromDiscord<Unaimend> thank for your help
17:29:55FromDiscord<Yardanico> yeah you should format it with three backticks, I did that for you
17:30:06FromDiscord<Unaimend> So now I am stuck at implementing bioinformatic algorithms for nim, that was quick๐Ÿ˜‚
17:30:10FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/815274591185272872/unknown.png
17:30:15FromDiscord<Unaimend> In reply to @Yardanico "yeah you should format": Thanks ๐Ÿ™‚
17:30:24FromDiscord<Unaimend> In reply to @Yardanico "": looks much nice
17:31:01FromDiscord<Yardanico> @Unaimend there's a way to workaround it without losing performance I think
17:31:21FromDiscord<Unaimend> In reply to @Yardanico "": I take any workaround for now ๐Ÿ™‚
17:32:26FromDiscord<Unaimend> Do you know stuff about the nim internals, if possible I would like to try to indentify the src of the bug
17:32:34FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R5W
17:32:35FromDiscord<Yardanico> maybe this is what you want
17:33:07FromDiscord<Yardanico> this preallocates grid and then preallocates all subseqs inside of it
17:33:22FromDiscord<Yardanico> the difference between newSeq and newSeqOfCap is that in the first case you have to assign by index, in the latter case you can use add
17:33:48FromDiscord<Unaimend> In reply to @Yardanico "```nim const DEBUG =": much nicer
17:33:53FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R5X
17:34:08FromDiscord<Rika> can i disable the sigint message `SIGINT: Interrupted by Ctrl-C.`?
17:34:32FromDiscord<Unaimend> In reply to @Yardanico "the difference between newSeq": Why?
17:34:37FromDiscord<Yardanico> @Unaimend wdym "why"?
17:34:57FromDiscord<Rika> capacity just means the memory is there, but they contain nothing
17:35:06FromDiscord<Unaimend> yeah yeah i know
17:35:17FromDiscord<Rika> you still have to add the seqs with cap
17:35:26FromDiscord<Rika> (edit) "with" => "when using"
17:35:38FromDiscord<Unaimend> In reply to @Rika "you still have to": or maybe i dont
17:35:39FromDiscord<haxscramper> In reply to @Unaimend "https://play.nim-lang.org/#ix=2R5P": https://github.com/haxscramper/hmisc/blob/master/src/hmisc/algo/hseq_distance.nim#L524 if you are interested I have generic implementation for some sequence alignment algorithms (I needed them for some other tasks, so implementation API might be a little different from what you need)
17:35:53FromDiscord<Yardanico> also @Unaimend yes your original code is wrong
17:35:54FromDiscord<haxscramper> Single and multiple sequence alignments
17:36:06FromDiscord<Rika> In reply to @Unaimend "or maybe i dont": cap: has memory, no values. seqs are a value, so you have to add them
17:36:20FromDiscord<Yardanico> your grid is seq[seq[int]] and `grid.add(newSeqOfCap[seq[int]](seq2_len))` means that you want to add a `seq[seq[int]]` to a grid which is wrong
17:36:33FromDiscord<Rika> In reply to @Yardanico "your grid is seq[seq[int]]": ah so thats what i misread ๐Ÿ˜›
17:36:36FromDiscord<Unaimend> In reply to @Yardanico "your grid is seq[seq[int]]": True
17:36:50FromDiscord<Yardanico> so just change seq[int] to int in that line and your original code will work too
17:37:02FromDiscord<Yardanico> but its better to preallocate the grid itself since you have the length
17:37:20FromDiscord<Unaimend> In reply to @Yardanico "so just change seq[int]": I like your first vesion more, thats what I had original in mind, but did not know how to do it
17:37:39FromDiscord<Unaimend> In reply to @haxscramper "https://github.com/haxscramper/hmisc/blob/master/sr": Really cool, I am working on some sort of bionim atm
17:38:35FromDiscord<Unaimend> (edit) "atm" => "atm. So a collection of usefull algos and tools for bioinformatics in Nim"
17:39:09FromDiscord<Yardanico> wait maybe I'm missing something
17:39:15FromDiscord<Rika> In reply to @Rika "can i disable the": me question got swallowed so imma bump it ๐Ÿ˜›
17:39:34FromDiscord<Yardanico> you can set your own controlc hook
17:39:59FromDiscord<Rika> i did
17:40:04FromDiscord<Rika> it doesnt remove the message
17:40:20FromDiscord<Unaimend> In reply to @haxscramper "Single and multiple sequence": So what is your connetion to bioinformatics, if I may ask?
17:40:46FromDiscord<Yardanico> @Rika it should work
17:40:52FromDiscord<Yardanico> works just fine
17:40:55FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R64
17:41:16FromDiscord<Rika> `setControlCHook(proc() {.noconv.} = discard)` is what i use
17:41:32FromDiscord<Rika> but the message is still there, which is very odd
17:41:39FromDiscord<Yardanico> that works for me
17:41:48FromDiscord<Rika> what the heck
17:42:21FromDiscord<Yardanico> you can always do -d:noSignalHandler and make your own signal handlers
17:42:24FromDiscord<haxscramper> In reply to @Unaimend "So what is your": No connection. I needed this for my idea of cost-based token alignment for pretty-printer. Basically I needed an algorithm that minimizes the cost of particular alignment for delimiter tokens (like `"("`), over multiple sequences, and this looked like a good fit.
17:42:27FromDiscord<Yardanico> but i'd recommend against it :P
17:42:33FromDiscord<Rika> i already make my own signal handler
17:42:39FromDiscord<Yardanico> then pass -d:noSignalHandler
17:42:46FromDiscord<Rika> i have to, i dont want sigint to kill the program immediately
17:42:47FromDiscord<Yardanico> then nim won't make any signal handlers on its own
17:42:58FromDiscord<Yardanico> @Rika well setControlCHook doesn't kill the program for me
17:43:02FromDiscord<Unaimend> In reply to @haxscramper "No connection. I needed": Ahh ok, got a little bit excited to find another bioinformatician ๐Ÿ™‚
17:43:03FromDiscord<Yardanico> not sure why it doesn't work for you
17:43:11FromDiscord<Rika> it doesnt either for me, but the message still echoes
17:43:30FromDiscord<Rika> wtf? even with -d:noSignalHandler the message still echoes
17:43:49FromDiscord<Yardanico> are you sure the code actually recompiles?
17:43:52FromDiscord<Yardanico> try compiling with `-f`
17:43:53FromDiscord<Rika> it is
17:44:05FromDiscord<Yardanico> without code I won't be able to help :P
17:44:26FromDiscord<Rika> its a lot of code, not easy to minimize
17:57:12FromDiscord<Rika> does it have anything to do with the fact im using async as well i wonder
18:13:07FromDiscord<Rika> oh
18:13:21FromDiscord<Rika> if you run it with nim c -r then it has the text, running the binary itself will not have the text
18:13:25FromDiscord<Rika> thats really odd
18:13:31FromDiscord<Rika> oh i get it
18:13:40FromDiscord<Rika> the text is from the compiler
18:13:51FromDiscord<Rika> then the process is orphaned after
18:14:47*superbia quit (Quit: WeeChat 3.0)
18:25:20*sixtyten joined #nim
18:39:16*eternaldelta joined #nim
18:40:10Oddmongeris there a difference between array[3,int] and array[0..3,int] ?
18:40:26FromDiscord<Yardanico> 3 vs 4 elements
18:40:43FromDiscord<Yardanico> nim ranges are inclusive
18:40:47FromDiscord<hamidb80> what does `FD` mean in `AsyncFD`?
18:40:53FromDiscord<Yardanico> FileDescriptor
18:41:04Oddmongerah the trap. Thank you
18:42:57*tane joined #nim
18:44:10FromDiscord<hamidb80> In reply to @Yardanico "FileDescriptor": how did you know that
18:44:26FromDiscord<Yardanico> well, because I just knew :P
18:44:46FromDiscord<Yardanico> can't explain how, I just learned it from the internet or the source code
18:45:35FromDiscord<hamidb80> ๐Ÿ˜‘ ๐Ÿ˜‘
18:45:48FromDiscord<Yardanico> https://en.wikipedia.org/wiki/File_descriptor
18:46:04FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> ill be in voicechat attempting to make a game
18:46:35FromDiscord<Rika> does nim have async file io?
18:46:39FromDiscord<Yardanico> not really
18:46:46FromDiscord<Rika> rip
18:47:05FromDiscord<Yardanico> there's asyncfile but it's not really async AFAIK
18:47:12FromDiscord<Rika> why so?
18:47:20FromDiscord<Yardanico> because it doesn't actually read asynchronously
18:47:30FromDiscord<Yardanico> it integrates FDs with async dispatcher though
18:47:53FromDiscord<Rika> is it really async if it doesnt read async...
18:58:42FromDiscord<hamidb80> In reply to @Yardanico "FileDescriptor": what does `cb` mean?
18:59:31FromDiscord<Yardanico> usually callback
18:59:34FromDiscord<Yardanico> but depends on the context
19:01:55FromDiscord<hamidb80> what does qoute do
19:01:59FromDiscord<hamidb80> (edit) "qoute" => "`qoute`"
19:02:03FromDiscord<Yardanico> quasi-quoting for macros
19:02:09FromDiscord<Yardanico> https://nim-lang.org/docs/macros.html#quote%2Ctyped%2Cstring
19:02:20FromDiscord<Yardanico> https://nim-lang.org/docs/tut3.html#introduction-generating-code
19:02:39eternaldeltawhy does sequtils suggest using collect instead of map/filter/mapit/filterit?
19:02:55FromDiscord<Yardanico> because it's more efficient and more nim-style :P
19:03:25eternaldeltadoes it actually optimize better?
19:03:34*wasted_youth2 joined #nim
19:03:49FromDiscord<Yardanico> for example if you use x.map(something).filter(something) it'll create a lot of temprary seqs
19:03:56FromDiscord<Yardanico> but collect won't
19:04:15eternaldeltaah interesting, thanks!
19:06:03krux02you can also just write the loop directly, then it is more obvious what the computer actually does.
19:06:15krux02with functional programming patterns it is often not that obvious.
19:06:24FromDiscord<Yardanico> well collect is closer to "normal" nim code than using sequtils procs anyway
19:06:52FromDiscord<Yardanico> the macro is quite simple
19:08:22*PMunch joined #nim
19:10:00krux02there is collect, map filter, and flatMap
19:10:06krux02all doing very similar things.
19:10:57ForumUpdaterBotNew thread by Mrhdias: Asynchttpserver issue?, see https://forum.nim-lang.org/t/7565
19:11:27FromDiscord<IndianGoldSmith> Hi all, is there any problem in using thisโ†ต{.experimental: "codeReordering".}
19:11:38*carkh joined #nim
19:11:53FromDiscord<Yardanico> it might not work, that's all :P
19:12:07FromDiscord<Yardanico> that's why it's experimental, and it won't work for recursively dependent procs anyway
19:12:14FromDiscord<lepot311> sent a code paste, see https://play.nim-lang.org/#ix=2R6t
19:13:08FromDiscord<Rika> youre not instantiating it, youre assigning the type
19:13:16FromDiscord<Rika> ClownFish -> ClownFish()
19:13:24FromDiscord<IndianGoldSmith> @Yardanico ,โ†ตI am currently using it in my files and it's working. Well, i dont have any recursively dependent functions. All i am afraid of future changes in langauge.
19:13:27FromDiscord<Yardanico> also `result.name = name` won't work because Entity doesn't have a field like that
19:13:46FromDiscord<Rika> has to be result.species.name
19:13:52FromDiscord<Yardanico> yeah probably
19:14:03FromDiscord<lepot311> In reply to @Yardanico "also `result.name = name`": sorry in my code Entity does in fact have a name I forgot to paste it here
19:14:11FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6u
19:14:25FromDiscord<Yardanico> oh then
19:14:31FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6v
19:14:41FromDiscord<Yardanico> you can also use the object construction syntax
19:15:06FromDiscord<lepot311> but I don't really want to instantiate a ClownFish, I want to instantiate an Entity with the ClownFish species attached to it so I can reference ClownFish class vars
19:16:12FromDiscord<lepot311> sent a code paste, see https://play.nim-lang.org/#ix=2R6w
19:16:20FromDiscord<Yardanico> can you show the code for that?
19:16:44FromDiscord<Yardanico> what type should have the max_speed field?
19:16:59FromDiscord<lepot311> Species
19:17:30FromDiscord<Yardanico> but this works just fine
19:17:35FromDiscord<Yardanico> sent a code paste, see https://paste.rs/Owq
19:17:37FromDiscord<Yardanico> or maybe i'm misunderstanding you?
19:18:28FromDiscord<lepot311> well if I make a bunch of ClownFish, and I use ` result = new_entity(ClownFish())`, aren't I instantiating a new ClownFish instance for every new Entity?
19:18:55FromDiscord<lepot311> I want ClownFish to be a subclass I can just assign class vars and methods to
19:19:37FromDiscord<Yardanico> sorry, I don't understand you a bit, have you looked into https://nim-lang.org/docs/tut2.html#object-oriented-programming-inheritance and https://nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch ?
19:20:27*Jesin quit (Quit: Leaving)
19:20:27FromDiscord<lepot311> sent a code paste, see https://play.nim-lang.org/#ix=2R6z
19:20:27FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> sent a code paste, see https://paste.rs/mxC
19:20:49FromDiscord<Yardanico> @lepot311 nim doesn't have user-settable default values - you can kind of get them by making your own constructors though
19:21:05FromDiscord<lepot311> In reply to @Yardanico "sorry, I don't understand": yes but wasn't sure if dynamic dispatch was what I was looking for
19:21:22FromDiscord<Yardanico> @ใƒใƒญใ‚ถใƒผใƒ‰ it should just work provided playerVelocity is mutable
19:21:31FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> hm
19:21:43FromDiscord<Yardanico> but why do you want to heap-allocate a vector? :P
19:22:08FromDiscord<Yardanico> this works just fine
19:22:10FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6B
19:22:33FromDiscord<Rika> In reply to @lepot311 "yes but wasn't sure": oop relies on dynamic dispatch
19:22:42FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> oh what the fuck
19:23:00FromDiscord<Yardanico> this works as well
19:23:02FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6C
19:23:16FromDiscord<Yardanico> and it's generally better to only use `ref` when you need it
19:23:37FromDiscord<Yardanico> since nim will pass stack-allocated objects by reference if they're big enough anyway
19:24:09FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> so is it more nim-y to do it first or second way?
19:24:20FromDiscord<lepot311> I think I get it now, thanks @Yardanico and @Rika
19:24:21FromDiscord<Yardanico> second way is generally better, since I don't think you would want to heap-allocate a vector
19:24:26FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> yeah lool
19:24:45FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> i was treating this just like GDScript when it isnt
19:24:49FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> forgot about the low level stuff
19:24:55*Jesin joined #nim
19:25:06FromDiscord<Yardanico> well this isn't that much low-level, but okay :)
19:25:16FromDiscord<Rika> its more low level than gdscript tho
19:35:54*sixtyten quit (Quit: Leaving)
20:24:50*a_chou joined #nim
20:27:43*quadrassel4321 quit (Quit: Leaving)
20:40:48FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> can objects in nim inherent multiple things
20:41:18FromDiscord<Yardanico> no, there's no multiple inheritance
20:42:01FromDiscord<mattrb> What's the best way to convert between int types when they're out of range? Does that need an explicit cast? eg `cast[int8](0xFF'u8)` vs `int8(0xFF'u8)`
20:42:57*vicfred joined #nim
20:50:50*a_chou quit (Remote host closed the connection)
21:00:01*natrys quit (Quit: natrys)
21:08:33FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> do objects in nim have methods attacted to them?
21:08:37FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> if so how do i do that
21:10:10FromDiscord<Yardanico> nim has methods for dynamic dispatch and procs for static dispatch
21:10:11FromDiscord<Yardanico> https://nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch
22:07:08FromDiscord<exelotl> In reply to @mattrb "What's the best way": yeah cast is probably the preferred way to do that
22:13:05*Sembei joined #nim
22:36:24FromDiscord<carpal> a way to import all files in one and then import that one?
22:36:42FromDiscord<carpal> include gives me problems with declarations
22:36:59FromDiscord<carpal> import does not show members when import the file
22:37:09FromDiscord<Yardanico> import and then export
22:37:47FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R7q
22:38:22FromDiscord<ใƒใƒญใ‚ถใƒผใƒ‰> does anyone know how to get the normal vector from rectangles overlapping in bumpy
22:38:57FromDiscord<carpal> thanksss
22:46:24FromDiscord<Yardanico> trying to find the start of discussion about nimrod -> nim rename in irc messages and stumbled upon https://irclogs.nim-lang.org/21-08-2014.html#21:36:12
22:46:31FromDiscord<Yardanico> 4raq "I still think we should rename Babel to Babe..."
22:47:13FromDiscord<Yardanico> (for those who don't know - babel is the old name of nimble)
22:50:23FromDiscord<Rika> oml babe lmao
22:51:07FromDiscord<Yardanico> The earliest I found right now is https://irclogs.nim-lang.org/18-08-2014.html#13:11:30
23:11:21FromDiscord<Yardanico> Found it I think https://irclogs.nim-lang.org/29-01-2014.html#22:15:10
23:11:26FromDiscord<Yardanico> 29th of January
23:11:29FromDiscord<Yardanico> "I'm playing with the idea to rename it to 'Nim' for version 1 fwiw, lol"
23:18:00FromDiscord<Yardanico> filwit instead of 'Nim', you could switch to 'Rod' and try and get popularity by writing a bunch of sexual innuendos o~O
23:18:09FromDiscord<Yardanico> BitPuffin Rod 1.0: Rock Solid
23:26:19FromDiscord<Yardanico> hm, to more productive matters - seems like nitter compilations results in nim compiler crashing with arc/orc, time to dive in
23:26:57FromDiscord<Yardanico> will be in discord voice channel streaming I guess
23:31:38*tane quit (Quit: Leaving)
23:46:34saem@Yardanico you mentioned something about chat for you stream and I missed it. :D