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:53 | federico3 | https://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:03 | FromDiscord | <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:29 | FromDiscord | <exelotl> @Anonymous Poet use an unsigned int if the wrapping behaviour is desired |
04:58:41 | FromDiscord | <ElegantBeef> There is also `--overflowChecks:on|off` |
04:58:58 | FromDiscord | <Anonymous Poet> In reply to @exelotl "<@747239904181747854> use an unsigned": i need it to be treated as a negative though |
04:59:12 | FromDiscord | <Anonymous Poet> i think overflow checks is what i wanted, will try in a sec |
04:59:22 | FromDiscord | <ElegantBeef> You can disable most runtime checks |
04:59:53 | FromDiscord | <ElegantBeef> Though i dont know the behaviour |
05:00:23 | FromDiscord | <Anonymous Poet> yes, that worked, ty |
05:00:33 | FromDiscord | <Anonymous Poet> I dont suppose I can disable it for only a certain section of code? |
05:00:42 | FromDiscord | <Anonymous Poet> like push a pragma |
05:00:52 | FromDiscord | <Rika> There is actually a push pragma |
05:00:58 | FromDiscord | <exelotl> I was just about to ask that xP |
05:01:23 | FromDiscord | <Anonymous Poet> so like `{.push overflowChecks:off .}`? |
05:01:33 | FromDiscord | <Rika> Prolly yeah |
05:03:00 | FromDiscord | <Anonymous Poet> hmm, that spelling didnt work; where should i look for the right word? |
05:04:57 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2R1F |
05:07:02 | FromDiscord | <Anonymous Poet> https://nim-lang.org/docs/manual.html#pragmas docs suggest that its correct too but its still erroring |
05:07:16 | FromDiscord | <Anonymous Poet> im trying to push this at the top level call site btw |
05:07:24 | FromDiscord | <ElegantBeef> Show code |
05:07:40 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2R1H |
05:07:56 | FromDiscord | <Anonymous Poet> runHaskellTl is basically just eval |
05:08:38 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2R1I |
05:08:51 | FromDiscord | <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:23 | FromDiscord | <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:52 | FromDiscord | <Anonymous Poet> Ah :/ |
05:10:56 | FromDiscord | <Anonymous Poet> makes sense, i guess |
05:11:24 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2R1K |
05:11:43 | FromDiscord | <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:11 | FromDiscord | <ElegantBeef> well you could have a `when defined(overFlowSilliness):` with the overflow logic turned on insiide that |
05:12:20 | FromDiscord | <ElegantBeef> But yea idk what you need exactly ๐ |
05:12:32 | FromDiscord | <Anonymous Poet> can I set a `define X:` in code somehow? |
05:12:39 | FromDiscord | <Anonymous Poet> or is that only set-able from the cli? |
05:13:10 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2R1L |
05:13:20 | FromDiscord | <Anonymous Poet> i know i can do `if defined(FOO):` for the second bit, but what about the first? |
05:13:38 | FromDiscord | <ElegantBeef> Not a clue |
05:13:56 | FromDiscord | <Anonymous Poet> haha, fair enough, ty for the help! |
05:14:36 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2R1M |
05:15:26 | FromDiscord | <Anonymous Poet> how bad is the macro behind it? |
05:15:39 | FromDiscord | <ElegantBeef> ~120 loc ๐ |
05:15:39 | * | rockcavera quit (Remote host closed the connection) |
05:15:58 | FromDiscord | <ElegantBeef> You can look at it here https://github.com/beef331/constructor/blob/master/src/constructor/variants.nim#L13 |
05:16:38 | FromDiscord | <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:14 | FromDiscord | <ElegantBeef> Though it'll only work on 1.5.1 + due to my use of strictNotNil |
05:17:43 | FromDiscord | <Anonymous Poet> i swear i saw 1.4.4 dropped just this week |
05:18:08 | FromDiscord | <ElegantBeef> odd numbers indicate development |
05:18:23 | FromDiscord | <ElegantBeef> "1.5.X" is development for 1.6 |
05:18:30 | FromDiscord | <Anonymous Poet> ๐ฎ |
05:18:47 | FromDiscord | <Anonymous Poet> does your macro generate the `initVar` and friends functions? |
05:18:52 | FromDiscord | <ElegantBeef> Yep |
05:19:01 | FromDiscord | <Anonymous Poet> and if so, does it also disallow construction with the raw `Lambda(kind: ...)` form? |
05:19:16 | FromDiscord | <ElegantBeef> No you cannot disallow that unless you dont expose the type |
05:19:39 | FromDiscord | <hamidb80> good morning |
05:19:46 | FromDiscord | <ElegantBeef> To disallow that you just have to not export the object, but export the fields then import that module |
05:19:47 | FromDiscord | <Anonymous Poet> aww ๐ฆ |
05:20:08 | FromDiscord | <ElegantBeef> I mean it's pretty hard to accidently call the default constructor considering how tedious it is to usue |
05:20:10 | FromDiscord | <ElegantBeef> (edit) "usue" => "use" |
05:20:12 | FromDiscord | <Anonymous Poet> i want my programs to be statically provably correct |
05:20:53 | FromDiscord | <ElegantBeef> Yea i mean i still only do runtime checks for ensuring that you dont pass the wrong kind of variant |
05:20:54 | FromDiscord | <Anonymous Poet> i think i've had enough respect for idiots instilled in me - "theres always a smarter idiot" |
05:21:13 | FromDiscord | <Anonymous Poet> best to just not allow an incorrect construction to begin with imo |
05:21:35 | FromDiscord | <Anonymous Poet> but ty for this work, definitely a step in the right direction! |
05:21:38 | FromDiscord | <ElegantBeef> I agree, but we cannot disable the constructor from within the model |
05:22:13 | FromDiscord | <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:51 | FromDiscord | <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:52 | FromDiscord | <ElegantBeef> This is the output btw if curious https://play.nim-lang.org/#ix=2R1O |
05:23:42 | FromDiscord | <Anonymous Poet> `Error: expression expected, but found 'keyword const'` ? cant set it to 1.5.1 |
05:23:50 | FromDiscord | <Anonymous Poet> (and this was after adding not nil pragma) |
05:23:53 | FromDiscord | <Rika> Set what? |
05:24:09 | FromDiscord | <ElegantBeef> The code i shared isnt meant to be runnalbe |
05:24:13 | FromDiscord | <ElegantBeef> (edit) "runnalbe" => "runnable" |
05:24:19 | FromDiscord | <ElegantBeef> It's just a showcase of what it generates |
05:25:06 | FromDiscord | <Anonymous Poet> ah derp :p |
05:25:36 | FromDiscord | <ElegantBeef> Suppose i should throw an error instead of the assert, but meh mostly just toy code |
05:26:10 | FromDiscord | <Anonymous Poet> it looks much less intimidating than i'd have expected |
05:27:20 | FromDiscord | <ElegantBeef> Well it's just a DSL for making variants it's not any of the funky macro stuff ๐ |
05:28:23 | FromDiscord | <hyu1996> https://media.discordapp.net/attachments/371759389889003532/815092946374361088/unknown.png |
05:28:40 | FromDiscord | <ElegantBeef> [1,2,3,4].\`@\` |
05:29:37 | FromDiscord | <hyu1996> ok let me try |
05:32:17 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#lexical-analysis-stropping |
05:34:06 | FromDiscord | <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:34 | FromDiscord | <ElegantBeef> Assuming you can get that information easily of course |
05:34:45 | FromDiscord | <ElegantBeef> I'm not a compiler developer, i'm a numpty |
05:36:35 | FromDiscord | <hyu1996> thanks ๐ i like nim lang |
05:36:53 | FromDiscord | <ElegantBeef> Ah then you're in the right place |
05:37:09 | FromDiscord | <ElegantBeef> If you do want to break the ufcs just do `[1,2,3,4].items.toSeq` |
05:37:34 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax |
05:57:50 | FromDiscord | <Araq> these limitations will mostly disappear btw |
05:58:20 | FromDiscord | <ElegantBeef> With tim's aliasing or another thing ๐ |
06:04:50 | FromDiscord | <ElegantBeef> Ah i see timothee's latest wip PR, first class iterators it seems |
06:11:10 | FromDiscord | <hamidb80> ufcs ? |
06:12:01 | FromDiscord | <ElegantBeef> Uniform function call syntax, where we get both `b(a)` and `a.b()` from a single implementation |
06:12:11 | FromDiscord | <ElegantBeef> The manual refers to it as Method Call Syntax |
06:13:08 | FromDiscord | <flywind> it is called MCS in Nim.๐ |
06:13:29 | FromDiscord | <ElegantBeef> Sure, same thing different name |
06:14:54 | FromDiscord | <Araq> well my name makes sense as the "uniform" syntax is `f(a, b, c)` without special casing the first argument... |
06:18:08 | FromDiscord | <ElegantBeef> Yea Universal is probably a better U, or I just call it like MCS like a proper Nim user ๐ |
06:19:31 | FromDiscord | <flywind> https://en.m.wikipedia.org/wiki/Uniform_Function_Call_Syntax |
06:19:52 | FromDiscord | <ElegantBeef> Who's that for? ๐ |
06:21:48 | FromDiscord | <Araq> https://i.redd.it/jd25yqv8xsf31.jpg |
06:24:27 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=2R1Y |
06:25:21 | FromDiscord | <Rika> ive got a good feeling im doing something wrong but idk |
06:25:36 | FromDiscord | <Araq> concepts are not interfaces |
06:25:43 | FromDiscord | <Rika> i'm not using it as such |
06:25:58 | FromDiscord | <Rika> i'm using a ref because i need ref semantics |
06:27:03 | FromDiscord | <Rika> i dont want this to "resolve at runtime" |
06:32:20 | FromDiscord | <Rika> i dont understand why this fails |
06:36:02 | FromDiscord | <Araq> too complex to type check, I guess |
06:37:09 | FromDiscord | <Rika> oh oh nevermind it seems like "echo AInfo is Info" is false for some reason |
06:38:40 | FromDiscord | <Rika> oh okay thats an odd error |
06:39:06 | FromDiscord | <Rika> so the gist is that an error in another module i import causes the concept to not match the type |
06:39:49 | FromDiscord | <Araq> ah |
06:40:07 | FromDiscord | <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:23 | FromDiscord | <hyu1996> `a.info[] < b.info[]`where is `info` field defined |
08:11:30 | FromDiscord | <hyu1996> sorry, I see it |
08:20:51 | * | quadrassel4321 joined #nim |
08:27:10 | FromDiscord | <Solitude> In reply to @Rika "```nim type ": works on devel |
08:27:33 | FromDiscord | <Rika> Yeah |
08:27:49 | FromDiscord | <Rika> Now I just need to figure out the internal error which I assume is from async |
08:29:38 | ForumUpdaterBot | New thread by Drkameleon: Easiest way to check for shift-left overflow?, see https://forum.nim-lang.org/t/7564 |
09:06:28 | FromDiscord | <hyu1996> sent a code paste, see https://play.nim-lang.org/#ix=2R2A |
09:08:08 | FromDiscord | <ElegantBeef> Well make a forum account and reply ๐ |
09:09:33 | FromDiscord | <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:24 | fredsted | Hi, 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:24 | fredsted | Exception type: [HttpRequestError]" |
09:27:22 | * | krux02 quit (Remote host closed the connection) |
09:27:41 | * | krux02 joined #nim |
09:32:33 | FromDiscord | <carpal> In reply to @hyu1996 "": do you use vscode? |
09:32:57 | FromDiscord | <hyu1996> yes |
09:33:04 | * | vicfred quit (Read error: Connection reset by peer) |
09:33:35 | FromDiscord | <hyu1996> https://media.discordapp.net/attachments/371759389889003532/815154653431857162/unknown.png |
09:33:43 | FromDiscord | <Solitude> fredsted, compile your program with -d:ssl |
09:34:39 | fredsted | Solitude: Thanks :-) |
09:35:01 | * | vicfred joined #nim |
09:35:19 | * | krux02_ joined #nim |
09:35:30 | FromDiscord | <hyu1996> isn't fredsted a robot? |
09:38:15 | FromDiscord | <ElegantBeef> Nope, it's a bridge to irc |
09:43:12 | * | haxscramper joined #nim |
09:46:39 | fredsted | After 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:39 | fredsted | Interestingly 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:03 | FromDiscord | <ElegantBeef> fredsted what's the result with `nim -v`? |
10:01:41 | fredsted | ElegantBeef, https://sf.gl/f/b79d584.txt |
10:07:19 | FromDiscord | <ElegantBeef> Whelp fairly clear issue with openssl but no clue how to actually help, sorry ๐ |
10:21:32 | Oddmonger | https://nymtech.net/ : the name was cool but it's go+rust |
10:23:29 | * | letto joined #nim |
10:25:18 | FromDiscord | <carpal> how does the nim compiler make it works?โตhttps://play.nim-lang.org/#ix=2R37 |
10:25:51 | FromDiscord | <carpal> if nim generates c code, in c a similar code would throw "incomplete type" |
10:30:39 | FromDiscord | <mratsim> just look at the C codegen |
10:30:50 | FromDiscord | <carpal> yes I'm looking for it |
10:31:11 | FromDiscord | <carpal> (edit) "for" => "at" |
10:31:19 | FromDiscord | <mratsim> you can do recursive types in C, otherwise you wouldn't be able to do intrusive linked lists |
10:33:34 | FromDiscord | <carpal> I'm talking about the prototypes |
10:33:42 | FromDiscord | <carpal> not recursive structs |
10:34:28 | FromDiscord | <carpal> but in nim yes |
10:34:28 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=2R39 |
10:37:23 | * | vicfred quit (Quit: Leaving) |
11:08:25 | FromGitter | <offbeat-stuff> Yo |
11:09:03 | FromGitter | <offbeat-stuff> I am alive after that macro journey , did this to get The typeImpl through macro for a typedesc |
11:09:03 | FromGitter | <offbeat-stuff> template genCon(T: typedesc) = โ โ ```const o = getTypeImpl(T).repr() โ mkCon(T,o)``` [https://gitter.im/nim-lang/Nim?at=603a284f457d6b4a948f6c8f] |
11:10:03 | FromGitter | <offbeat-stuff> Well Onto the next one, How do I disable output buffering for execCmd |
11:10:56 | FromGitter | <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:12 | FromGitter | <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:02 | FromGitter | <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:55 | FromGitter | <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:10 | FromDiscord | <hamidb80> `#? stdtmpl(subsChar = '$', metaChar = '#', toString = "xmltree.escape")` |
12:21:13 | FromDiscord | <hamidb80> what's that |
12:21:52 | FromDiscord | <hamidb80> https://github.com/dom96/nim-in-action-code/tree/master/Chapter7/Tweeter/src/views |
12:22:14 | FromDiscord | <hamidb80> (edit) "that" => "that?" |
12:27:37 | FromDiscord | <haxscramper> Source code filters |
12:31:37 | FromGitter | <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:05 | beeswax | is 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:05 | FromDiscord | <haxscramper> !eval import std/times; echo parse("2000-01-01", "yyyy-MM-dd").format("'ะะจะจะ'yyyy") |
13:36:09 | NimBot | ะะจะจะ2000 |
13:36:17 | FromDiscord | <haxscramper> > Other strings can be inserted by putting them in ''. For example hh'->'mm will give 01->56. |
13:39:58 | beeswax | oh I didn't make the connection between that arrow and any possible string :facepalm:, thank you! |
13:50:30 | FromGitter | <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:07 | FromDiscord | <haxscramper> Create an object and take its address separately |
13:53:26 | * | fredrikhr joined #nim |
13:53:29 | FromDiscord | <Yardanico> @HJarausch_gitlab by this you're creating an object on the stack |
13:53:47 | FromDiscord | <Yardanico> you want an unmanaged (raw) heap-allocated object? then use `alloc` and friends |
13:54:05 | FromDiscord | <Yardanico> or maybe you're ok with managed (by GC) heap-allocated object/ |
13:55:31 | FromGitter | <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:13 | FromDiscord | <Yardanico> yes |
13:56:27 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R4i |
13:58:45 | FromDiscord | <Yardanico> then myObj will have a ptr to a heap-allocated object |
13:59:33 | FromDiscord | <Yardanico> https://nim-lang.org/docs/system.html#create%2Ctypedesc |
13:59:45 | FromDiscord | <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:02 | FromGitter | <HJarausch_gitlab> @Yardanico Thanks! But then I have to create the object first and initialize its fields afterwards? |
14:04:25 | FromDiscord | <Yardanico> well all nim objects are zero-initialized by default, but yes |
14:04:42 | FromDiscord | <Yardanico> you can assign all fields at once with myObj[] = Obj(id: 5) |
14:06:17 | FromGitter | <HJarausch_gitlab> Thanks for this (although it implies some copying). โ Nim should have something like C++ โ ``new myObj(....)`` |
14:07:15 | FromDiscord | <konsumlamm> are you sure that you don't just want to use a ref object? |
14:08:41 | FromDiscord | <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:59 | FromDiscord | <Solitude> In reply to @exelotl "We have the convention": we do. dont. |
14:09:16 | FromDiscord | <exelotl> xD |
14:09:24 | FromDiscord | <exelotl> That's fair lol |
14:12:39 | FromDiscord | <exelotl> @HJarausch what's your use case here? Can you use ref instead of ptr? |
14:12:44 | FromDiscord | <Solitude> In reply to @exelotl "We have the convention": i like status'es convention of init/new(typedesc). thats the future. |
14:13:55 | FromDiscord | <Yardanico> > typedesc |
14:14:48 | * | krux02` joined #nim |
14:15:35 | * | krux02` quit (Remote host closed the connection) |
14:16:21 | FromDiscord | <exelotl> On the GBA I find myself using init(var T) a lot |
14:17:19 | FromDiscord | <Solitude> In reply to @exelotl "On the GBA I": thats cool too |
14:17:20 | FromDiscord | <exelotl> Because I don't do any heap allocation, I usually need to initialise something that's already allocated |
14:18:46 | FromGitter | <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:59 | FromDiscord | <Yardanico> why not use ref objects then? :P |
14:22:42 | FromDiscord | <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:23 | FromDiscord | <exelotl> Which may not have the desired performance characteristics, since they'll no longer be contiguous in memory |
14:28:57 | FromGitter | <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:21 | FromGitter | <HJarausch> @Solitude Where is this ``init`` proc/template/macro defined? |
14:33:28 | FromDiscord | <Solitude> nowhere |
14:33:50 | FromDiscord | <Solitude> you define it yourself for your types |
14:34:25 | FromDiscord | <konsumlamm> In reply to @HJarausch "Then, in the single": when you use `.`, it automatically dereferences |
14:35:03 | * | krux02`` joined #nim |
14:35:51 | krux02` | what ~init~ are you specifically talking about? |
14:39:17 | FromDiscord | <Solitude> https://status-im.github.io/nim-style-guide/03_language.html#object-initialization |
14:39:35 | FromGitter | <HJarausch> exelotl wrote โ *On the GBA I find myself using ``init(var T) `` a lot* |
14:43:38 | krux02` | Nim does not have a constructor language feature. |
14:44:09 | krux02` | There are default values for members in discussion. But not yet accepted in the language (AFAIK) |
14:44:55 | krux02` | This one reason for this is exception safety. Only functions can raise exceptions, not variable declarations (as in c++). |
14:45:27 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/252 was partially accepted with `constexpr` for field values |
14:46:17 | krux02` | 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:00 | krux02` | not having default constructors or generally arbitrary object initialization code circumvents this problem. |
14:47:50 | krux02` | using the ~init~ pattern allows to have kind of constructors. |
14:48:01 | krux02` | I think that is very useful pattern to use |
14:48:16 | krux02` | Ok, anyway I didn't get the full discussion and need to go now |
14:48:17 | krux02` | 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:46 | FromDiscord | <exelotl> sent a code paste, see https://paste.rs/82t |
15:28:41 | * | al1ranger quit (Quit: Leaving) |
15:29:11 | FromDiscord | <exelotl> then I can use it like `objAffMem[id].init(myMatrix)` (where objAffMem is an array of ObjAffine) |
15:29:11 | FromDiscord | <Yardanico> he won't get pinged by this btw :P |
15:29:15 | FromDiscord | <Yardanico> ah nvm he will |
15:29:15 | FromDiscord | <exelotl> aw |
15:29:23 | FromDiscord | <Yardanico> thought that he was still through gitlab |
15:29:31 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/815244223213207552/unknown.png |
15:29:34 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/815244239997894656/unknown.png |
15:29:35 | FromDiscord | <Yardanico> yeah sorryu |
15:32:40 | FromDiscord | <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:09 | FromDiscord | <haxscramper> When I was starting writing parsers I tied to read this and also base my parser around lexbase |
15:34:21 | FromDiscord | <haxscramper> In the end I decided it is easier to do everything from scratch |
15:35:39 | FromDiscord | <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:59 | FromDiscord | <dom96> !eval echo(300 in 250 .. 500) |
15:38:01 | NimBot | true |
15:38:36 | FromDiscord | <carpal> In reply to @haxscramper "In the end I": yes I always write all from scratch |
15:39:02 | FromDiscord | <carpal> because I learn so |
15:39:08 | FromDiscord | <mratsim> assembly for ever |
15:39:08 | FromDiscord | <carpal> (edit) "because I learn ... so" added "more" |
15:39:11 | FromDiscord | <carpal> ahah |
15:39:28 | FromDiscord | <carpal> I tried doing something with assembly, but floats are terrible to manage |
15:40:33 | FromDiscord | <mratsim> There is no point in using assembly for floats. |
15:40:57 | FromDiscord | <mratsim> Compilers produce decent code even with just intrinsics. |
15:41:21 | FromDiscord | <mratsim> When i say decent, I mean i can beat pure Assembly high performance library with intrinsics. |
15:41:57 | FromDiscord | <mratsim> There are more usable float registers on x86_64 than integer/general registers ๐คท |
15:43:20 | FromDiscord | <carpal> mhhh |
15:43:25 | FromDiscord | <carpal> and so? |
15:44:50 | FromDiscord | <mratsim> the compiler has more leeway for optimizations and doesn't try to do fancy things that actually are pessimizations. |
16:00:42 | FromDiscord | <carpal> but I tried to do that to learn lol |
16:13:15 | saem | Morning |
16:20:58 | FromDiscord | <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:58 | FromDiscord | <Kiloneie> Please @ me here your twitter. |
16:24:26 | FromDiscord | <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:37 | FromDiscord | <dom96> <https://twitter.com/d0m96> ๐ |
16:25:42 | FromDiscord | <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:56 | FromDiscord | <Kiloneie> Whoever is running the nim_lang twitter, probably Araq or Miran, should add me. |
16:27:16 | FromDiscord | <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:54 | FromDiscord | <dom96> Just tweet and CC the nim_lang twitter |
16:36:59 | FromDiscord | <dom96> we will RT it |
16:37:04 | FromDiscord | <dom96> or at least like it |
16:39:15 | FromDiscord | <Kiloneie> as in @Nim_lang ? |
16:39:36 | FromDiscord | <Kiloneie> im a boomer D:... haven't used twiter is so long |
16:40:33 | FromDiscord | <dom96> yeah |
16:40:51 | FromDiscord | <Kiloneie> Okay will do that with the next one |
16:43:20 | FromDiscord | <dom96> I'll tweet it out from the nim_lang twitter ๐ |
16:43:22 | federico3 | if I can put together some kludge to access the tweets from mastodon I'm going to follow you guys |
16:43:32 | FromDiscord | <Rika> some poor lad is called @ nim here? lmao |
16:43:36 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2R5C |
16:43:53 | FromDiscord | <Kiloneie> yeh that was weird xD |
16:44:41 | FromDiscord | <dom96> https://twitter.com/nim_lang/status/1365704376652886024 |
16:45:18 | FromDiscord | <Kiloneie> Nice |
16:45:31 | asdflkj | Iโm a zoomer, I donโt use twitter except for nitter |
16:46:00 | FromDiscord | <Kiloneie> Yeh i never really used it other to watch when the podcast TotaLbiscuit went online |
16:46:05 | FromDiscord | <Kiloneie> he is dead now... |
16:46:45 | FromDiscord | <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:26 | FromDiscord | <dom96> ahh, I've watched TotalBiscuit back in the day too |
16:48:09 | FromDiscord | <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:23 | FromDiscord | <dom96> same :/ |
16:50:28 | FromDiscord | <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:25 | FromDiscord | <QueenFuckingAdrielle> game dev convo? |
17:16:03 | FromDiscord | <QueenFuckingAdrielle> im trying to learn vulkan rn and it makes me want to hurt kittens |
17:16:54 | FromDiscord | <Unaimend> So I think I found sth. where no usefull error message is given |
17:16:55 | FromDiscord | <Unaimend> https://play.nim-lang.org/#ix=2Qz5 |
17:17:56 | * | krux02` quit (Remote host closed the connection) |
17:18:24 | FromDiscord | <Yardanico> wdym? |
17:18:45 | FromDiscord | <Yardanico> this works as expected because you're modifying the string |
17:18:55 | FromDiscord | <Yardanico> v1 is a view into a string, so if a string changes - the view will change to |
17:18:59 | FromDiscord | <Yardanico> too |
17:19:21 | FromDiscord | <QueenFuckingAdrielle> anyone have any opinions on a good cross platform window library that runs on nix/windows/android/ios/mac? |
17:19:23 | FromDiscord | <Unaimend> NVM the link is wrong |
17:19:38 | FromDiscord | <QueenFuckingAdrielle> so like, not glfw |
17:19:39 | FromDiscord | <Unaimend> In reply to @Yardanico "wdym?": https://play.nim-lang.org/#ix=2R5P |
17:20:00 | FromDiscord | <Yardanico> hm yeah, c compiler errors are bugs, please make an issue :) |
17:20:14 | FromDiscord | <Unaimend> Will do |
17:20:34 | FromDiscord | <Unaimend> Any Idea what I did wrong there? |
17:21:17 | FromDiscord | <Rika> no |
17:21:22 | FromDiscord | <Rika> nothing here looks wrong |
17:21:35 | FromDiscord | <Rika> strange? yes, strange to store len but its not incorrect |
17:21:46 | FromDiscord | <Rika> seqs already internally store their len |
17:21:58 | FromDiscord | <Rika> but again its not wrong to do so |
17:25:22 | FromDiscord | <Unaimend> just a habit, dont think that it makes a difference after optimization |
17:25:28 | FromDiscord | <Unaimend> https://github.com/nim-lang/Nim/issues/17197 |
17:25:33 | FromDiscord | <Unaimend> So is this issue ok |
17:25:49 | saem | hmm, 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:40 | saem | Specifically, trying to figure out how to move this change here: https://github.com/nim-lang/Nim/commit/d933fde40d1232004c9eaa260dc6bd3dc376c272 |
17:27:06 | FromDiscord | <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:18 | FromDiscord | <Unaimend> ok will edit |
17:27:20 | FromDiscord | <Yardanico> i edited your issue to enable highlighting |
17:27:34 | FromDiscord | <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:38 | FromDiscord | <Yardanico> so they can search by the message in the issues |
17:29:22 | FromDiscord | <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:28 | FromDiscord | <Unaimend> thank for your help |
17:29:55 | FromDiscord | <Yardanico> yeah you should format it with three backticks, I did that for you |
17:30:06 | FromDiscord | <Unaimend> So now I am stuck at implementing bioinformatic algorithms for nim, that was quick๐ |
17:30:10 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/815274591185272872/unknown.png |
17:30:15 | FromDiscord | <Unaimend> In reply to @Yardanico "yeah you should format": Thanks ๐ |
17:30:24 | FromDiscord | <Unaimend> In reply to @Yardanico "": looks much nice |
17:31:01 | FromDiscord | <Yardanico> @Unaimend there's a way to workaround it without losing performance I think |
17:31:21 | FromDiscord | <Unaimend> In reply to @Yardanico "": I take any workaround for now ๐ |
17:32:26 | FromDiscord | <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:34 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R5W |
17:32:35 | FromDiscord | <Yardanico> maybe this is what you want |
17:33:07 | FromDiscord | <Yardanico> this preallocates grid and then preallocates all subseqs inside of it |
17:33:22 | FromDiscord | <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:48 | FromDiscord | <Unaimend> In reply to @Yardanico "```nim const DEBUG =": much nicer |
17:33:53 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R5X |
17:34:08 | FromDiscord | <Rika> can i disable the sigint message `SIGINT: Interrupted by Ctrl-C.`? |
17:34:32 | FromDiscord | <Unaimend> In reply to @Yardanico "the difference between newSeq": Why? |
17:34:37 | FromDiscord | <Yardanico> @Unaimend wdym "why"? |
17:34:57 | FromDiscord | <Rika> capacity just means the memory is there, but they contain nothing |
17:35:06 | FromDiscord | <Unaimend> yeah yeah i know |
17:35:17 | FromDiscord | <Rika> you still have to add the seqs with cap |
17:35:26 | FromDiscord | <Rika> (edit) "with" => "when using" |
17:35:38 | FromDiscord | <Unaimend> In reply to @Rika "you still have to": or maybe i dont |
17:35:39 | FromDiscord | <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:53 | FromDiscord | <Yardanico> also @Unaimend yes your original code is wrong |
17:35:54 | FromDiscord | <haxscramper> Single and multiple sequence alignments |
17:36:06 | FromDiscord | <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:20 | FromDiscord | <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:33 | FromDiscord | <Rika> In reply to @Yardanico "your grid is seq[seq[int]]": ah so thats what i misread ๐ |
17:36:36 | FromDiscord | <Unaimend> In reply to @Yardanico "your grid is seq[seq[int]]": True |
17:36:50 | FromDiscord | <Yardanico> so just change seq[int] to int in that line and your original code will work too |
17:37:02 | FromDiscord | <Yardanico> but its better to preallocate the grid itself since you have the length |
17:37:20 | FromDiscord | <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:39 | FromDiscord | <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:35 | FromDiscord | <Unaimend> (edit) "atm" => "atm. So a collection of usefull algos and tools for bioinformatics in Nim" |
17:39:09 | FromDiscord | <Yardanico> wait maybe I'm missing something |
17:39:15 | FromDiscord | <Rika> In reply to @Rika "can i disable the": me question got swallowed so imma bump it ๐ |
17:39:34 | FromDiscord | <Yardanico> you can set your own controlc hook |
17:39:59 | FromDiscord | <Rika> i did |
17:40:04 | FromDiscord | <Rika> it doesnt remove the message |
17:40:20 | FromDiscord | <Unaimend> In reply to @haxscramper "Single and multiple sequence": So what is your connetion to bioinformatics, if I may ask? |
17:40:46 | FromDiscord | <Yardanico> @Rika it should work |
17:40:52 | FromDiscord | <Yardanico> works just fine |
17:40:55 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R64 |
17:41:16 | FromDiscord | <Rika> `setControlCHook(proc() {.noconv.} = discard)` is what i use |
17:41:32 | FromDiscord | <Rika> but the message is still there, which is very odd |
17:41:39 | FromDiscord | <Yardanico> that works for me |
17:41:48 | FromDiscord | <Rika> what the heck |
17:42:21 | FromDiscord | <Yardanico> you can always do -d:noSignalHandler and make your own signal handlers |
17:42:24 | FromDiscord | <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:27 | FromDiscord | <Yardanico> but i'd recommend against it :P |
17:42:33 | FromDiscord | <Rika> i already make my own signal handler |
17:42:39 | FromDiscord | <Yardanico> then pass -d:noSignalHandler |
17:42:46 | FromDiscord | <Rika> i have to, i dont want sigint to kill the program immediately |
17:42:47 | FromDiscord | <Yardanico> then nim won't make any signal handlers on its own |
17:42:58 | FromDiscord | <Yardanico> @Rika well setControlCHook doesn't kill the program for me |
17:43:02 | FromDiscord | <Unaimend> In reply to @haxscramper "No connection. I needed": Ahh ok, got a little bit excited to find another bioinformatician ๐ |
17:43:03 | FromDiscord | <Yardanico> not sure why it doesn't work for you |
17:43:11 | FromDiscord | <Rika> it doesnt either for me, but the message still echoes |
17:43:30 | FromDiscord | <Rika> wtf? even with -d:noSignalHandler the message still echoes |
17:43:49 | FromDiscord | <Yardanico> are you sure the code actually recompiles? |
17:43:52 | FromDiscord | <Yardanico> try compiling with `-f` |
17:43:53 | FromDiscord | <Rika> it is |
17:44:05 | FromDiscord | <Yardanico> without code I won't be able to help :P |
17:44:26 | FromDiscord | <Rika> its a lot of code, not easy to minimize |
17:57:12 | FromDiscord | <Rika> does it have anything to do with the fact im using async as well i wonder |
18:13:07 | FromDiscord | <Rika> oh |
18:13:21 | FromDiscord | <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:25 | FromDiscord | <Rika> thats really odd |
18:13:31 | FromDiscord | <Rika> oh i get it |
18:13:40 | FromDiscord | <Rika> the text is from the compiler |
18:13:51 | FromDiscord | <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:10 | Oddmonger | is there a difference between array[3,int] and array[0..3,int] ? |
18:40:26 | FromDiscord | <Yardanico> 3 vs 4 elements |
18:40:43 | FromDiscord | <Yardanico> nim ranges are inclusive |
18:40:47 | FromDiscord | <hamidb80> what does `FD` mean in `AsyncFD`? |
18:40:53 | FromDiscord | <Yardanico> FileDescriptor |
18:41:04 | Oddmonger | ah the trap. Thank you |
18:42:57 | * | tane joined #nim |
18:44:10 | FromDiscord | <hamidb80> In reply to @Yardanico "FileDescriptor": how did you know that |
18:44:26 | FromDiscord | <Yardanico> well, because I just knew :P |
18:44:46 | FromDiscord | <Yardanico> can't explain how, I just learned it from the internet or the source code |
18:45:35 | FromDiscord | <hamidb80> ๐ ๐ |
18:45:48 | FromDiscord | <Yardanico> https://en.wikipedia.org/wiki/File_descriptor |
18:46:04 | FromDiscord | <ใใญใถใผใ> ill be in voicechat attempting to make a game |
18:46:35 | FromDiscord | <Rika> does nim have async file io? |
18:46:39 | FromDiscord | <Yardanico> not really |
18:46:46 | FromDiscord | <Rika> rip |
18:47:05 | FromDiscord | <Yardanico> there's asyncfile but it's not really async AFAIK |
18:47:12 | FromDiscord | <Rika> why so? |
18:47:20 | FromDiscord | <Yardanico> because it doesn't actually read asynchronously |
18:47:30 | FromDiscord | <Yardanico> it integrates FDs with async dispatcher though |
18:47:53 | FromDiscord | <Rika> is it really async if it doesnt read async... |
18:58:42 | FromDiscord | <hamidb80> In reply to @Yardanico "FileDescriptor": what does `cb` mean? |
18:59:31 | FromDiscord | <Yardanico> usually callback |
18:59:34 | FromDiscord | <Yardanico> but depends on the context |
19:01:55 | FromDiscord | <hamidb80> what does qoute do |
19:01:59 | FromDiscord | <hamidb80> (edit) "qoute" => "`qoute`" |
19:02:03 | FromDiscord | <Yardanico> quasi-quoting for macros |
19:02:09 | FromDiscord | <Yardanico> https://nim-lang.org/docs/macros.html#quote%2Ctyped%2Cstring |
19:02:20 | FromDiscord | <Yardanico> https://nim-lang.org/docs/tut3.html#introduction-generating-code |
19:02:39 | eternaldelta | why does sequtils suggest using collect instead of map/filter/mapit/filterit? |
19:02:55 | FromDiscord | <Yardanico> because it's more efficient and more nim-style :P |
19:03:25 | eternaldelta | does it actually optimize better? |
19:03:34 | * | wasted_youth2 joined #nim |
19:03:49 | FromDiscord | <Yardanico> for example if you use x.map(something).filter(something) it'll create a lot of temprary seqs |
19:03:56 | FromDiscord | <Yardanico> but collect won't |
19:04:15 | eternaldelta | ah interesting, thanks! |
19:06:03 | krux02 | you can also just write the loop directly, then it is more obvious what the computer actually does. |
19:06:15 | krux02 | with functional programming patterns it is often not that obvious. |
19:06:24 | FromDiscord | <Yardanico> well collect is closer to "normal" nim code than using sequtils procs anyway |
19:06:52 | FromDiscord | <Yardanico> the macro is quite simple |
19:08:22 | * | PMunch joined #nim |
19:10:00 | krux02 | there is collect, map filter, and flatMap |
19:10:06 | krux02 | all doing very similar things. |
19:10:57 | ForumUpdaterBot | New thread by Mrhdias: Asynchttpserver issue?, see https://forum.nim-lang.org/t/7565 |
19:11:27 | FromDiscord | <IndianGoldSmith> Hi all, is there any problem in using thisโต{.experimental: "codeReordering".} |
19:11:38 | * | carkh joined #nim |
19:11:53 | FromDiscord | <Yardanico> it might not work, that's all :P |
19:12:07 | FromDiscord | <Yardanico> that's why it's experimental, and it won't work for recursively dependent procs anyway |
19:12:14 | FromDiscord | <lepot311> sent a code paste, see https://play.nim-lang.org/#ix=2R6t |
19:13:08 | FromDiscord | <Rika> youre not instantiating it, youre assigning the type |
19:13:16 | FromDiscord | <Rika> ClownFish -> ClownFish() |
19:13:24 | FromDiscord | <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:27 | FromDiscord | <Yardanico> also `result.name = name` won't work because Entity doesn't have a field like that |
19:13:46 | FromDiscord | <Rika> has to be result.species.name |
19:13:52 | FromDiscord | <Yardanico> yeah probably |
19:14:03 | FromDiscord | <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:11 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6u |
19:14:25 | FromDiscord | <Yardanico> oh then |
19:14:31 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6v |
19:14:41 | FromDiscord | <Yardanico> you can also use the object construction syntax |
19:15:06 | FromDiscord | <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:12 | FromDiscord | <lepot311> sent a code paste, see https://play.nim-lang.org/#ix=2R6w |
19:16:20 | FromDiscord | <Yardanico> can you show the code for that? |
19:16:44 | FromDiscord | <Yardanico> what type should have the max_speed field? |
19:16:59 | FromDiscord | <lepot311> Species |
19:17:30 | FromDiscord | <Yardanico> but this works just fine |
19:17:35 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/Owq |
19:17:37 | FromDiscord | <Yardanico> or maybe i'm misunderstanding you? |
19:18:28 | FromDiscord | <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:55 | FromDiscord | <lepot311> I want ClownFish to be a subclass I can just assign class vars and methods to |
19:19:37 | FromDiscord | <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:27 | FromDiscord | <lepot311> sent a code paste, see https://play.nim-lang.org/#ix=2R6z |
19:20:27 | FromDiscord | <ใใญใถใผใ> sent a code paste, see https://paste.rs/mxC |
19:20:49 | FromDiscord | <Yardanico> @lepot311 nim doesn't have user-settable default values - you can kind of get them by making your own constructors though |
19:21:05 | FromDiscord | <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:22 | FromDiscord | <Yardanico> @ใใญใถใผใ it should just work provided playerVelocity is mutable |
19:21:31 | FromDiscord | <ใใญใถใผใ> hm |
19:21:43 | FromDiscord | <Yardanico> but why do you want to heap-allocate a vector? :P |
19:22:08 | FromDiscord | <Yardanico> this works just fine |
19:22:10 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6B |
19:22:33 | FromDiscord | <Rika> In reply to @lepot311 "yes but wasn't sure": oop relies on dynamic dispatch |
19:22:42 | FromDiscord | <ใใญใถใผใ> oh what the fuck |
19:23:00 | FromDiscord | <Yardanico> this works as well |
19:23:02 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R6C |
19:23:16 | FromDiscord | <Yardanico> and it's generally better to only use `ref` when you need it |
19:23:37 | FromDiscord | <Yardanico> since nim will pass stack-allocated objects by reference if they're big enough anyway |
19:24:09 | FromDiscord | <ใใญใถใผใ> so is it more nim-y to do it first or second way? |
19:24:20 | FromDiscord | <lepot311> I think I get it now, thanks @Yardanico and @Rika |
19:24:21 | FromDiscord | <Yardanico> second way is generally better, since I don't think you would want to heap-allocate a vector |
19:24:26 | FromDiscord | <ใใญใถใผใ> yeah lool |
19:24:45 | FromDiscord | <ใใญใถใผใ> i was treating this just like GDScript when it isnt |
19:24:49 | FromDiscord | <ใใญใถใผใ> forgot about the low level stuff |
19:24:55 | * | Jesin joined #nim |
19:25:06 | FromDiscord | <Yardanico> well this isn't that much low-level, but okay :) |
19:25:16 | FromDiscord | <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:48 | FromDiscord | <ใใญใถใผใ> can objects in nim inherent multiple things |
20:41:18 | FromDiscord | <Yardanico> no, there's no multiple inheritance |
20:42:01 | FromDiscord | <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:33 | FromDiscord | <ใใญใถใผใ> do objects in nim have methods attacted to them? |
21:08:37 | FromDiscord | <ใใญใถใผใ> if so how do i do that |
21:10:10 | FromDiscord | <Yardanico> nim has methods for dynamic dispatch and procs for static dispatch |
21:10:11 | FromDiscord | <Yardanico> https://nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch |
22:07:08 | FromDiscord | <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:24 | FromDiscord | <carpal> a way to import all files in one and then import that one? |
22:36:42 | FromDiscord | <carpal> include gives me problems with declarations |
22:36:59 | FromDiscord | <carpal> import does not show members when import the file |
22:37:09 | FromDiscord | <Yardanico> import and then export |
22:37:47 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2R7q |
22:38:22 | FromDiscord | <ใใญใถใผใ> does anyone know how to get the normal vector from rectangles overlapping in bumpy |
22:38:57 | FromDiscord | <carpal> thanksss |
22:46:24 | FromDiscord | <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:31 | FromDiscord | <Yardanico> 4raq "I still think we should rename Babel to Babe..." |
22:47:13 | FromDiscord | <Yardanico> (for those who don't know - babel is the old name of nimble) |
22:50:23 | FromDiscord | <Rika> oml babe lmao |
22:51:07 | FromDiscord | <Yardanico> The earliest I found right now is https://irclogs.nim-lang.org/18-08-2014.html#13:11:30 |
23:11:21 | FromDiscord | <Yardanico> Found it I think https://irclogs.nim-lang.org/29-01-2014.html#22:15:10 |
23:11:26 | FromDiscord | <Yardanico> 29th of January |
23:11:29 | FromDiscord | <Yardanico> "I'm playing with the idea to rename it to 'Nim' for version 1 fwiw, lol" |
23:18:00 | FromDiscord | <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:09 | FromDiscord | <Yardanico> BitPuffin Rod 1.0: Rock Solid |
23:26:19 | FromDiscord | <Yardanico> hm, to more productive matters - seems like nitter compilations results in nim compiler crashing with arc/orc, time to dive in |
23:26:57 | FromDiscord | <Yardanico> will be in discord voice channel streaming I guess |
23:31:38 | * | tane quit (Quit: Leaving) |
23:46:34 | saem | @Yardanico you mentioned something about chat for you stream and I missed it. :D |