00:00:10 | FromDiscord | <sealmove> Just more well defined spec through excessive testing, which might lead to slight language changes to make it more _correct_. At least that's my take. |
00:01:08 | FromDiscord | <evoalg> ok ... I guess I was trying to get a feel of the extent of where it says "Ultimately this will mean a different community, language, standard library, and much more." |
00:02:35 | FromDiscord | <sealmove> different community, though it doesn't have to be this way. Different language, no. Different standard library, kind of, yes. |
00:02:36 | FromDiscord | <Elegantbeef> Well features will be added/changed but the overall language will be "the same but different" |
00:03:50 | FromDiscord | <evoalg> just don't take "collect" away! 😉 |
00:04:05 | FromDiscord | <Elegantbeef> I mean collect is a macro 😛 |
00:04:16 | FromDiscord | <Elegantbeef> Saem personally doesnt like macros but has no plan of removing them |
00:04:22 | * | brain-soup left #nim (Leave.) |
00:05:34 | * | brain-soup joined #nim |
00:06:11 | FromDiscord | <evoalg> ohhhh ... ahh ok I know so little ... but then again, from a noob's perspective learning nim, "collect" is absolutely part of the language. Oh interesting that Saem doesn't like macro's when from what i can gather they are all the fashion ... I've been trying to avoid them thus far |
00:08:57 | FromDiscord | <evoalg> I'm someone trying to learn & use nim without having to know C or the having to know difference between the stack & the heap, and not having to know what functional programming is ... you can tell I've mainly used python 😉 ... but I've read that I don't have to know that stuff unless I'm doing something tricky like interfacing with some hardware using a c lib or something |
00:09:13 | FromDiscord | <Elegantbeef> To be fair though leorize we're not compatible with Nim already 😛 We no longer have marshal in the VM and no longer have importutils |
00:10:14 | arkanoid | every time I tried using collect, I ended up in a corner where it was better not using it. As an extensive user of python comprehensions and c# linq expressions, I would say that collect macro is not up to the task |
00:10:30 | FromDiscord | <Elegantbeef> Well saem doesnt like them since they're obfuscation engines practically, it's hard to audit what's going on internally with them |
00:10:37 | FromDiscord | <Elegantbeef> Eh i use collect a lot it does it's job well imo |
00:10:54 | FromDiscord | <leorize> but luckily saem isn't the only dev \:p |
00:11:22 | FromDiscord | <Elegantbeef> I mean he's the odd one out with that view |
00:12:13 | FromDiscord | <evoalg> I used to like python LC's, but now I'm so in love with collect |
00:12:38 | FromDiscord | <leorize> macros as the compiler implement it might change though |
00:13:03 | FromDiscord | <Elegantbeef> My view will always be list comprehensions are backwards |
00:13:16 | FromDiscord | <Elegantbeef> it's just an unintuitive to read mess |
00:13:57 | FromDiscord | <evoalg> exactly |
00:13:59 | FromDiscord | <leorize> nim's collect is pretty easy to read |
00:14:06 | FromDiscord | <leorize> the impl is just horrendous though |
00:14:17 | FromDiscord | <Elegantbeef> Yea collect is much more imperative which fits better |
00:14:43 | FromDiscord | <Elegantbeef> What's the issue with collect? |
00:16:15 | FromDiscord | <leorize> try to read the impl |
00:16:22 | FromDiscord | <Elegantbeef> Oh ok i see |
00:22:07 | FromDiscord | <Elegantbeef> Uh oh saem read all the messages, scatter! |
00:24:13 | FromDiscord | <KimJongUnstoppable> Anyone have issues using writeFile on Windows? Every file I try to write to, I get an IO error, regardless of directory I'm in. Even if I'm using an admin elevated command prompt, I still get failures. The only directory I can write to is the temp directory. |
00:24:24 | FromDiscord | <KimJongUnstoppable> Wondering if it's a me issue or an OS thing. |
00:24:51 | FromDiscord | <Elegantbeef> Have you read the IoError message? |
00:26:03 | FromDiscord | <KimJongUnstoppable> Unhandled Exception, cannot open, [IO error] are the basics of it, aside from the file name and location |
00:27:19 | FromDiscord | <Elegantbeef> I can only imagine you're trying to write in a location you dont have user permissions for |
00:27:59 | FromDiscord | <KimJongUnstoppable> Which is the confusing part, since I've tried the documents folder, the desktop, a drive I use only for storage, and I tried all that from an admin-elevated command prompt, and elevating the binary as admin. None of it worked. |
00:28:35 | FromDiscord | <KimJongUnstoppable> Typing this out is making me think it's an issue with my machine or copy of windows rather than a package issue with std/io |
00:29:03 | FromDiscord | <leorize> if every other applications work, then it might be an issue with nim |
00:29:26 | FromDiscord | <KimJongUnstoppable> I've never experienced any issues writing to any of those directories before, in python or in general |
00:29:58 | FromDiscord | <leorize> can you try running a nim compile outputting to that directory? |
00:30:12 | FromDiscord | <leorize> if that works then it might just be your code bugging somehow |
00:30:17 | FromDiscord | <KimJongUnstoppable> it compiles fine into the directory I was testing from and then when I run the executable I made it won't write to any files in that directory |
00:30:41 | FromDiscord | <leorize> do you mind sharing the part that was erroring? |
00:30:49 | FromDiscord | <KimJongUnstoppable> I'll spend some more time testing and try to see if I can find a more specific issue than just "IO error" and come back |
00:31:11 | FromDiscord | <leorize> and please keep in mind about win32 special names |
00:34:57 | * | vicfred quit (Quit: Leaving) |
00:50:32 | * | kayabaNerve quit (Remote host closed the connection) |
00:56:07 | * | kayabaNerve joined #nim |
02:03:55 | * | krux02 quit (Remote host closed the connection) |
02:20:01 | FromDiscord | <evoalg> I'm just checking ... for a variable I use "var", but if it doesn't change I can use "let" (which has to be resolved at compile time), but even if it doesn't change, instead of using "let" I can use "var" if I want to, and the code will probably run just as fast either way, but using "let" will catch if I inadvertently try to change it later in the code, so it's more thing of good programming practice to use let when it doesn't change - ha |
02:20:37 | FromDiscord | <Elegantbeef> Nope let does not have to be resolved at compile time |
02:20:50 | FromDiscord | <Elegantbeef> `let` is a runtime immutable, `const` is a compile time constant |
02:21:08 | FromDiscord | <evoalg> ahhh ok! ... have I got the rest of it right? |
02:21:23 | FromDiscord | <Elegantbeef> My rule is `const -> let -> var` |
02:21:27 | FromDiscord | <Elegantbeef> If it can be constant make it as such, if it needs runtime info, use let, otherwise use var |
02:21:51 | FromDiscord | <Elegantbeef> But yes let/var is just a typesystem thing and has 0 effect on runtime speed |
02:22:21 | FromDiscord | <Rika> Why does skull not have import utils ? |
02:26:43 | FromDiscord | <Elegantbeef> Oh it actually still does, guess i just tried compiling wrong |
02:37:46 | FromDiscord | <evoalg> for something declared as with var, I can call a variable, but do name should I use for something declared as a let? ... it's not a variable, right? or is it a variable, just an immutable variable? |
02:38:12 | FromDiscord | <Elegantbeef> it's an immutable variable |
02:38:38 | FromDiscord | <Rika> If you want to really make it sound sensible you can prolly use names value |
02:38:40 | FromDiscord | <Rika> Named |
02:41:23 | FromDiscord | <evoalg> I don't know what you mean Rika? |
02:42:46 | FromDiscord | <Rika> Instead of “variable”, “named value” |
02:43:05 | FromDiscord | <evoalg> ahhh ok 😉 |
02:45:37 | FromDiscord | <evoalg> so I don't have to pass const's to proc's / func's which is nice, but for other variable I do, and sometimes I have to pass lots of them! ... is this a case where I should bundle them up into something like an object or a tuple, to save on typing really long proc parameter lines? |
02:47:40 | FromDiscord | <Rika> usually yeah pretty much |
02:48:02 | FromDiscord | <evoalg> Thank you! |
03:01:18 | * | neurocyte0132889 quit (Ping timeout: 268 seconds) |
03:08:33 | * | arkurious quit (Quit: Leaving) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
04:22:00 | FromDiscord | <evoalg> instead of a func, I could call it proc instead and it wouldn't change anything (if that's the only change I made) right? The reason we would use func is to catch any side effects that we might introduce inadvertently later, so it's more of a good programming practice thing to do? ... but I could run a proc as a func and it wouldn't change the speed of the program? |
05:27:53 | FromDiscord | <Rika> Yes |
05:43:49 | * | Guest62 joined #nim |
05:44:04 | * | Guest62 quit (Client Quit) |
05:44:16 | * | Guest62 joined #nim |
05:44:29 | * | Guest62 quit (Client Quit) |
06:03:20 | FromDiscord | <dangbinghoo> hi, we should have a "Packages" link on nim-lang.org for https://nimble.directory/ |
06:20:36 | FromDiscord | <demotomohiro> There is a link to nimble directory in: https://nim-lang.org/documentation.html |
06:34:53 | FromDiscord | <dangbinghoo> home page is more convenient |
06:35:26 | FromDiscord | <Elegantbeef> something about PRs welcome here |
06:35:52 | FromDiscord | <narimiran> something about bookmark the documentation page, and then it is as convenient as home page |
06:36:29 | FromDiscord | <Elegantbeef> Shit you got me |
06:37:22 | FromDiscord | <narimiran> (but don't bookmark nimble.directory, that's too convenient!) |
06:37:44 | FromDiscord | <Elegantbeef> Yea two clicks are better than one |
06:37:55 | FromDiscord | <Elegantbeef> Twice as satisfying to hear |
06:38:29 | FromDiscord | <Elegantbeef> And certainly dont make a rofi frontend to search the registry |
07:12:48 | * | anjovi quit (Remote host closed the connection) |
07:13:11 | * | anjovi joined #nim |
07:46:16 | FromDiscord | <dangbinghoo> https://tenor.com/view/bunnies-what-confused-meh-gif-13712192 |
07:46:42 | FromDiscord | <dangbinghoo> 🙃 |
08:02:44 | * | neurocyte0132889 joined #nim |
08:02:44 | * | neurocyte0132889 quit (Changing host) |
08:02:44 | * | neurocyte0132889 joined #nim |
08:08:56 | * | anjovi quit (Remote host closed the connection) |
08:09:18 | * | anjovi joined #nim |
08:13:10 | * | mahlon quit (Ping timeout: 260 seconds) |
08:13:13 | * | PMunch joined #nim |
08:50:47 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
08:51:44 | * | neurocyte0132889 joined #nim |
08:51:44 | * | neurocyte0132889 quit (Changing host) |
08:51:44 | * | neurocyte0132889 joined #nim |
09:18:30 | * | mahlon joined #nim |
10:44:26 | NimEventer | New thread by FernandoTorres: Overloaded array operator allows changing the indexing sequence for objects, but not for tuples., see https://forum.nim-lang.org/t/8581 |
11:58:24 | FromDiscord | <hmmm> hey what is the nim equivalent of python list.index("element") |
11:59:42 | FromDiscord | <haxscramper> `list.find("element")` |
11:59:42 | FromDiscord | <ynfle (ynfle)> find |
11:59:47 | FromDiscord | <Yardanico> https://nim-lang.org/docs/system.html#find%2CT%2CS |
11:59:50 | FromDiscord | <Yardanico> xd |
12:00:17 | FromDiscord | <hmmm> good boys |
12:00:34 | FromDiscord | <enthus1ast> but when you have to find in a seq that often, better use another data type, eg table |
12:00:57 | FromDiscord | <enthus1ast> or when the seq ist huge |
12:01:18 | FromDiscord | <enthus1ast> or HashSet |
12:01:34 | FromDiscord | <hmmm> hmm let's see where index takes me, if it becomes painful I'll change data structure |
12:02:17 | FromDiscord | <enthus1ast> for small datasets i might even be faster than hash lookup |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:54 | * | supakeen joined #nim |
12:07:28 | FromDiscord | <Rika> you? |
12:14:21 | FromDiscord | <dom96> we should all be using O(enthus1ast) lookups |
12:14:50 | FromDiscord | <enthus1ast> \:) |
12:15:08 | FromDiscord | <enthus1ast> somehow my keyboard is dirty i guess |
12:15:28 | FromDiscord | <dom96> huh, we went to 12.1k stars pretty fast on the Nim repo |
12:15:52 | * | Vladar joined #nim |
12:28:56 | FromDiscord | <Goel> It was me making thousands of fake accounts to star Nim :nimble: _lies_ |
12:36:20 | FromDiscord | <Rika> "lies" |
12:55:59 | FromDiscord | <krsh> There is a library for parsing and analyzing ELF files? Like pyelftools and Lief |
12:56:03 | madprops | https://nim-lang.org/docs/nre.html |
12:56:18 | madprops | does find in nre return an Option[RegexMatch] or Option[string] ? |
12:56:31 | PMunch | @dom96, not really a crazy increase in stargazers: https://star-history.t9t.io/#nim-lang/nim |
12:56:56 | madprops | nvm |
13:01:49 | PMunch | @krsh, not sure if we have a library, but this might be helpful: https://formats.kaitai.io/elf/nim.html |
13:02:48 | madprops | so system.quit is not recommended, what's the best way to quietly quit a program? |
13:08:03 | FromDiscord | <haxscramper> I don't know what is wrong with `quit()` |
13:08:17 | FromDiscord | <haxscramper> Well, I would raise an exception and let the program terminate as usual |
13:08:26 | FromDiscord | <haxscramper> `setExitCode()` from exitprocs IIRC |
13:08:40 | FromDiscord | <haxscramper> https://nim-lang.org/docs/exitprocs.html#setProgramResult%2Cint |
13:20:40 | FromDiscord | <dom96> PMunch: that chart is so tiny lol |
13:20:55 | PMunch | So tiny? |
13:21:11 | FromDiscord | <dom96> I mean: doesn’t have a lot of data points. |
13:21:19 | FromDiscord | <dom96> So hard to drill into the recent increase |
13:22:28 | FromDiscord | <dom96> In reply to @haxscramper "I don't know what": Problem with quit is when it’s used in some library code. I don’t want my libraries to terminate my app. |
13:23:22 | FromDiscord | <dom96> So I would say it’s an anti-pattern in apps too. Eventually you’ll refactor into some libraries and run into issues. |
13:23:39 | FromDiscord | <dom96> Exceptions are indeed the way to go |
13:25:15 | PMunch | True. Do you have another which is more high-res? |
13:45:21 | NimEventer | New thread by Miran: This Month with Nim - October 2021, see https://forum.nim-lang.org/t/8582 |
13:50:52 | PMunch | Ah damn it, forgot to submit Futhark.. |
13:51:05 | PMunch | Yardanico, did you ever try it out with Sciter? |
13:51:31 | FromDiscord | <Yardanico> Sorry, not yet :( thanks for reminding me, I'll try tomorrow |
13:58:28 | PMunch | Sweet, so far it's running smoothly for everything I've used it for :) |
14:13:08 | FromDiscord | <dom96> We should fix this heh https://media.discordapp.net/attachments/371759389889003532/905097194594504714/IMG_7926.png |
14:13:46 | FromDiscord | <IsaacPaul> The squished photo? |
14:14:03 | FromDiscord | <dom96> yep |
14:17:24 | NimEventer | New thread by IvanS: Error: type mismatch: got <type string> / expected <string> but got <type string> (fidget), see https://forum.nim-lang.org/t/8583 |
14:19:44 | FromDiscord | <IsaacPaul> Some pretty cool projects this month |
14:21:09 | FromDiscord | <IsaacPaul> kinda wish changer followed this format: https://keepachangelog.com/en/1.0.0/ |
14:23:09 | FromDiscord | <dom96> ooh changer is indeed cool |
14:50:04 | FromDiscord | <tandy> no mention of nimskull \:\>)↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>) |
14:54:56 | FromDiscord | <Yardanico> @tandy ? |
14:55:06 | FromDiscord | <Yardanico> TMWN is user-made content |
15:05:32 | NimEventer | New thread by Aclough: Nim snap status?, see https://forum.nim-lang.org/t/8584 |
15:11:51 | PMunch | Hmm, even with `nimble build -y -d:debug --lineDir:on --debuginfo --debugger:native` I don't get debug symbols in my generated so file.. |
15:12:23 | PMunch | I have --app:lib --threads:on --gc:orc in my nim.cfg file |
15:12:24 | FromDiscord | <Yardanico> huh |
15:12:35 | FromDiscord | <Yardanico> also generally you don't need anything other that --debugger:native for nim source lines to appear, do you |
15:13:01 | PMunch | Dunno, gdb just keeps saying the library doesn't have debug symbols |
15:13:25 | PMunch | And objdump --syms <file> | grep debug shows nada |
15:17:29 | FromDiscord | <Yardanico> are you trying to debug the library on the same machine where you compiled it? |
15:17:51 | FromDiscord | <Yardanico> but yeah, here it works, gdb just says "Reading symbols from libtest.so..." |
15:18:22 | FromDiscord | <Yardanico> try ` objdump -h libtest.so | grep .debug` |
15:19:23 | FromDiscord | <tandy> technicaly nimskul is user-made↵(@Yardanico) |
15:19:30 | FromDiscord | <Yardanico> you didn't get my point |
15:19:43 | FromDiscord | <Yardanico> TMWN is made from people submitting their projects |
15:19:51 | FromDiscord | <Yardanico> if nimskull is "not there" it means that no one submitted it to TMWN |
15:20:11 | FromDiscord | <tandy> yee i know it was a joke |
15:20:15 | FromDiscord | <dom96> PMunch: make sure Nimble is passing those options by using `--debug` |
15:20:35 | FromDiscord | <dom96> passing those options to Nim |
15:23:00 | PMunch | By the way, when building a dynamically linked library with nimble it doesn't name it libX.so |
15:23:48 | PMunch | Wait, I might've been an idiot and copied the wrong file |
15:24:23 | FromDiscord | <haxscramper> We certainly have a good number of projects to spam tmwn for months, don't worry |
15:24:41 | * | PMunch quit (Quit: Leaving) |
15:25:09 | FromDiscord | <haxscramper> idk, I can automatically churn out library wrappers and auto-submit them |
15:27:02 | FromDiscord | <tandy> nice \:) |
15:27:35 | FromDiscord | <tandy> is there any plan to add union to the nimskull stdlib? i know u guys wanna keep it lean so id imagine no |
15:28:19 | FromDiscord | <haxscramper> it depends ..., but I personally would be glad to see `Result[]`, `union` and more fp-stuff in stdlinb |
15:28:33 | FromDiscord | <tandy> sweet |
15:28:43 | FromDiscord | <haxscramper> since we don't have any opposition on form of "Option is dumb" etc. |
15:29:27 | FromDiscord | <kevin> Stuck on an error in my code: `Warning: 'write' is not GC-safe as it calls 'len'` where write is (https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/streams.nim#L346) |
15:29:44 | FromDiscord | <haxscramper> > ↵> Warning↵> |
15:29:57 | FromDiscord | <kevin> I get an error for my function |
15:30:03 | FromDiscord | <kevin> That's the warning right before it errors |
15:30:13 | FromDiscord | <haxscramper> Then what is the error? |
15:30:17 | FromDiscord | <kevin> `Error: 'serialize' is not GC-safe as it calls 'write'` |
15:30:28 | FromDiscord | <kevin> where serialize is my own function |
15:30:52 | FromDiscord | <kevin> I don't believe something like `len` would actually not be gc-safe by default |
15:38:15 | FromDiscord | <hmmm> hey what was the magic incantation to stuff two seqs in a std/tables |
15:39:46 | FromDiscord | <haxscramper> `for k, v in zip(seq1, seq2): table[k] = v` |
15:40:12 | FromDiscord | <hmmm> this looks like a winner, I'll try it |
15:48:02 | FromDiscord | <IsaacPaul> In reply to @kevin "`Error: 'serialize' is not": You can ignore it by annotating your proc with a pragma: `{.gcsafe.}` but I'd find a gc safe way to use write |
15:49:44 | FromDiscord | <IsaacPaul> Perhaps your stream is a global variable? |
15:49:54 | FromDiscord | <kevin> In reply to @IsaacPaul "You can ignore it": It's a proc local variable |
15:50:33 | FromDiscord | <kevin> Guess I'm confused on how Nim thinks `write` or `len` are not gcsafe |
15:52:45 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3DJ4 |
15:52:55 | FromDiscord | <IsaacPaul> may or may not help you.. I'm no expect 😅 |
15:53:01 | FromDiscord | <IsaacPaul> (edit) "expect" => "expert" |
15:54:35 | FromDiscord | <kevin> Thanks! 😄 |
16:11:36 | FromDiscord | <hmmm> hexxy is strange if I use your magic formula I get a ginormous type error but if I use the standard formula in the docs it works just fine: for pairs in zip(x,y):↵ let (first,second) = pairs↵ q[first] = second |
16:13:14 | * | sagax quit (Remote host closed the connection) |
16:15:43 | FromDiscord | <haxscramper> well, read the error idk |
16:15:54 | FromDiscord | <hmmm> yea I'm on it |
16:15:57 | FromDiscord | <haxscramper> or `for (k, v) in zip(x, y)` |
16:16:03 | FromDiscord | <hmmm> I want to use yours because it's comfier |
16:16:19 | FromDiscord | <haxscramper> `for (k, v) in zip(x, y): table[k] = v` |
16:17:51 | FromDiscord | <hmmm> yay it werks |
16:18:01 | FromDiscord | <hmmm> ty 👑 |
16:18:38 | FromDiscord | <haxscramper> ah, `zip` is not an iterator |
16:18:42 | FromDiscord | <haxscramper> why it is not an iterator ... |
16:20:59 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/Ibe |
16:21:19 | FromDiscord | <haxscramper> basically `sequtils.zip` creates a new sequence, so `for k, v in sequtils.zip()` is the same as `for k, v in pairs(sequtils.zip())`, that's why you get `k` as int and `v` as `(S1, S2)` that you can't put in the table |
16:21:33 | FromDiscord | <haxscramper> I completely fail to understand why zip is not an iterator |
16:29:18 | * | sagax joined #nim |
17:00:00 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3DJB |
17:00:46 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3DJE |
17:00:49 | FromDiscord | <haxscramper> index + zipped tuples |
17:01:24 | FromDiscord | <IsaacPaul> ah that's your custom zip function |
17:04:44 | * | nrds quit (Remote host closed the connection) |
17:05:56 | FromDiscord | <IsaacPaul> yea the current zip returns a seq of tuples with no index... using `for k, v in` just automatically adds the index as k instead of destructing the tuple |
17:06:21 | * | nrds joined #nim |
17:07:33 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3DJL |
17:08:03 | FromDiscord | <IsaacPaul> the sdk zip procedure |
17:10:07 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3DJM |
17:14:51 | FromDiscord | <IsaacPaul> Yea I agree it should be an iterator |
17:15:44 | FromDiscord | <Elegantbeef> There should atleast be an iterator variant of all(most) of the procs in sequtils |
17:16:39 | FromDiscord | <IsaacPaul> What's interesting is that being an iterator allows you to bypass destructing the tuple... there seems to be a not so obvious difference in behaviors. |
17:17:05 | FromDiscord | <IsaacPaul> but I'm not new, I'm not sure whats _expected_ |
17:17:13 | FromDiscord | <IsaacPaul> (edit) removed "not" |
17:18:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3DJS |
17:20:37 | FromDiscord | <IsaacPaul> ah I'm dumb one is actually returning a tuple and the other is returning a seq of tuples which results in the difference of behavior |
17:20:44 | FromDiscord | <IsaacPaul> 1 is |
17:20:47 | FromDiscord | <Elegantbeef> Which also applies to your for loop over a tuple of elements just `k, v` calls `pairs` and `(k, v)` destructors the given value |
17:21:21 | FromDiscord | <Elegantbeef> Uhh |
17:21:37 | FromDiscord | <Elegantbeef> I dont think that's the case |
17:36:53 | nrds | <Prestige99> Elegantbeef: You have any experience wrapping c++ libraries? I need a box2d wrapper |
17:37:07 | nrds | <Prestige99> not sure how decent the interop will be |
17:37:33 | FromDiscord | <IsaacPaul> I think there are different implementations of pairs. It seems like most that apply to sequences or strings automatically assign an index to k. The ones that apply to tables just map the left value to k. I'm not sure if a tuple is a table or not tho.. 😂 either way I gotta get back to work T.T |
17:39:05 | FromDiscord | <Elegantbeef> What's C++ is that something you eat? |
17:39:22 | nrds | <Prestige99> I tried once but threw up |
17:39:58 | FromDiscord | <haxscramper> damn box2d is huge |
17:40:25 | nrds | <Prestige99> If I can't find someone to write a wrapper I honestly might just port it to Nim |
17:40:38 | * | kayabaNerve_ joined #nim |
17:40:41 | * | kayabaNerve quit (Remote host closed the connection) |
17:40:42 | * | kinkinkijkin quit (Remote host closed the connection) |
17:41:10 | FromDiscord | <Elegantbeef> Arent you just making a platformer? |
17:41:17 | nrds | <Prestige99> no I'm making a game engine |
17:41:25 | FromDiscord | <haxscramper> You can wrap only needed parts |
17:41:40 | FromDiscord | <haxscramper> But in general I don't think there is any tool that would be able to properly process all of this |
17:41:50 | FromDiscord | <haxscramper> you can try c2nim maybe |
17:42:07 | FromDiscord | <haxscramper> it "has successfully wrapped thousands of lines of C++ code", so you might have a chance |
17:42:09 | * | pch joined #nim |
17:42:20 | nrds | <Prestige99> I did, it ate 16GB ram and almost all my swap before I killed it lol |
17:45:06 | FromDiscord | <haxscramper> holy |
17:45:06 | FromDiscord | <haxscramper> I thought it is a simple code transform, what is it doing even |
17:46:39 | nrds | <Prestige99> 🤷 |
17:46:55 | nrds | <Prestige99> infinite loop maybe |
17:47:05 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
17:53:09 | FromDiscord | <IsaacPaul> comment half the file until you find the culprit :3 |
17:53:11 | * | arkurious joined #nim |
17:54:04 | FromDiscord | <Elegantbeef> Manual binary search |
17:55:50 | nrds | <Prestige99> Would be damn nice if it were just in pure Nim tbh |
17:56:13 | nrds | <Prestige99> maybe I'm crazy enough |
17:56:27 | FromDiscord | <Elegantbeef> Well physics is complex so i'll see you in a few years |
17:56:28 | FromDiscord | <IsaacPaul> Yea, but then someone's gotta maintain it.. |
17:56:48 | nrds | <Prestige99> I mean just porting it 1 to 1 |
17:58:00 | * | neurocyte0132889 joined #nim |
17:58:00 | * | neurocyte0132889 quit (Changing host) |
17:58:00 | * | neurocyte0132889 joined #nim |
18:00:25 | FromDiscord | <haxscramper> it is impossible |
18:00:33 | FromDiscord | <haxscramper> 1\:1 from C++ to nim is a dead end |
18:00:51 | FromDiscord | <haxscramper> for example you get 10x+ drop in method performance, so you have use custom vtable imp |
18:00:59 | FromDiscord | <haxscramper> with arc you get like 400x drop |
18:01:01 | FromDiscord | <haxscramper> for methods |
18:01:07 | FromDiscord | <haxscramper> Unless that was fixed |
18:01:20 | nrds | <Prestige99> wow really that bad? |
18:01:21 | FromDiscord | <haxscramper> and this library seems to be oop-heavy |
18:02:37 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/issues/18612 |
18:02:38 | FromDiscord | <Elegantbeef> Well there is an idea to make it not that bad but it's pretty bad with --newRuntime |
18:02:51 | FromDiscord | <haxscramper> 18x slower than before↵nearly 100x slower than regular procs |
18:02:53 | * | vicfred joined #nim |
18:03:06 | FromDiscord | <haxscramper> I was testing hot dispatch loop for the interpreter |
18:03:16 | FromDiscord | <haxscramper> just to see which methods are best |
18:03:31 | FromDiscord | <haxscramper> and I had slowdown for 100s for times |
18:04:01 | FromDiscord | <Elegantbeef> Plus 1\:1 C++ -\> Nim isnt going to be idiomatic Nim 😀 |
18:04:35 | FromDiscord | <haxscramper> anyway, methods are almost useless |
18:04:52 | nrds | <Prestige99> Could get away with concepts if they're usable, I think.. |
18:04:54 | FromDiscord | <haxscramper> I use them only when I know I won't be calling into them with any reasonable frequency |
18:05:25 | nrds | <Prestige99> that's embarrassingly slow though |
18:05:32 | FromDiscord | <Elegantbeef> Or function pointers since it's a onetime cost |
18:06:01 | nrds | <Prestige99> are "new concepts" out? |
18:06:25 | FromDiscord | <haxscramper> not yet |
18:06:39 | Amun-Ra | speaking of new concepts, what's the equivalent of T.foo is int? |
18:07:14 | FromDiscord | <Elegantbeef> It's more limited in some regards so i dont think there is an equivlent, since that could be a proc or a field |
18:07:24 | FromDiscord | <haxscramper> Well, if `T.foo is int` does not work you can also try `default(T).foo is int` |
18:08:08 | FromDiscord | <Elegantbeef> For new concepts though hax that still wont work? |
18:08:46 | FromDiscord | <haxscramper> ah |
18:08:51 | FromDiscord | <hmmm> boyz what should I know about importing my own modules apart from marking with star all the stuff I want to use? |
18:08:52 | FromDiscord | <haxscramper> I missed concept |
18:08:56 | nrds | <Prestige99> man that speed slowdown for methods is depressing |
18:08:57 | FromDiscord | <haxscramper> context\ |
18:09:18 | FromDiscord | <haxscramper> Nothing really. Depends on what you want to do↵(@hmmm) |
18:09:18 | FromDiscord | <hmmm> can I leave all the redundant std imports for testing or should I clean it up? |
18:09:36 | FromDiscord | <haxscramper> For new concepts field checks are not implemented IIRC↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
18:10:43 | FromDiscord | <haxscramper> I don't understand the question. If you have some imports you use then leave them, if they are warned with UnusedImport then remove them↵(@hmmm) |
18:10:51 | FromDiscord | <hmmm> star import works only on procs or it works on data structures too? |
18:11:08 | FromDiscord | <haxscramper> types, fields, procs iterators, toplevel variables |
18:11:16 | Amun-Ra | I mean: https://play.nim-lang.org/#ix=3DK9 |
18:11:16 | FromDiscord | <hmmm> perfect |
18:11:18 | FromDiscord | <hmmm> ty hexxy |
18:11:19 | FromDiscord | <haxscramper> any named entity |
18:11:56 | FromDiscord | <Elegantbeef> Yea like we said there isnt an equivalent that we know of |
18:12:39 | Amun-Ra | ah, I see |
18:30:37 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
18:36:06 | * | neurocyte0132889 joined #nim |
18:36:06 | * | neurocyte0132889 quit (Changing host) |
18:36:07 | * | neurocyte0132889 joined #nim |
18:46:03 | * | nrds quit (Remote host closed the connection) |
18:47:46 | * | nrds joined #nim |
18:53:11 | * | krux02 joined #nim |
18:59:48 | * | Vladar quit (Quit: Leaving) |
19:13:45 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
19:14:27 | * | neurocyte0132889 joined #nim |
19:14:27 | * | neurocyte0132889 quit (Changing host) |
19:14:27 | * | neurocyte0132889 joined #nim |
19:39:04 | * | neurocyte0132889 quit (Ping timeout: 268 seconds) |
19:59:20 | * | neurocyte0132889 joined #nim |
19:59:20 | * | neurocyte0132889 quit (Changing host) |
19:59:20 | * | neurocyte0132889 joined #nim |
21:12:09 | * | brain-soup quit (Remote host closed the connection) |
22:52:10 | * | Pyautogui joined #nim |
22:56:37 | FromDiscord | <el__maco> noob question #126: how do I stop a case statement from complaining that all cases are not covered |
23:00:13 | FromDiscord | <Elegantbeef> `else: assert false` is the easiest but depending on the type you can do some other things |
23:00:16 | FromDiscord | <Elegantbeef> What's the type, and what's the of branches |
23:02:22 | FromDiscord | <el__maco> the type is GLenum. The type can probably contain a million different things, but in my case there's only 3 values it can have |
23:03:03 | FromDiscord | <Elegantbeef> Ah well if they arent contiguous values the assert method is the best |
23:03:15 | FromDiscord | <el__maco> hmm |
23:03:24 | FromDiscord | <Elegantbeef> if they're contiguous you can do `case range[low..high](yourValue)` |
23:03:48 | FromDiscord | <Elegantbeef> low and high being the lowest value and highest value it could be |
23:04:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3DM0 |
23:05:13 | FromDiscord | <Elegantbeef> uh oh i did case "idiomatically wrong" |
23:05:18 | FromDiscord | <Elegantbeef> No `:` on the case line! |
23:06:31 | FromDiscord | <Rika> uh oh |
23:06:35 | FromDiscord | <Rika> banned |
23:06:42 | FromDiscord | <Elegantbeef> later chumps! |
23:07:34 | * | Pyautogui quit (Ping timeout: 260 seconds) |
23:13:27 | * | Pyautogui joined #nim |
23:18:37 | * | vicfred quit (Quit: Leaving) |
23:47:36 | * | Pyautogui quit (Ping timeout: 268 seconds) |
23:55:34 | FromDiscord | <codic> I have a question about arc: if it has deterministic destruction, copying, etc (RAII like C++) where exactly is stuff ref counted? <https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html> doesn't explain it |
23:59:41 | FromDiscord | <treeform> I think ref is a pointer to to memory of which first 8 bytes is a memory count |
23:59:58 | * | FromDiscord quit (Remote host closed the connection) |