00:53:08 | * | rockcavera quit (Remote host closed the connection) |
01:02:12 | * | Guest49 joined #nim |
01:03:33 | Guest49 | Is the https://github.com/nim-lang/Nim/blob/devel/lib/pure/mersenne.nim module going to be improved in 2.0? |
01:05:13 | * | Guest49 quit (Client Quit) |
01:05:31 | * | Guest69 joined #nim |
01:05:46 | * | Guest69 quit (Client Quit) |
01:06:26 | FromDiscord | <ElegantBeef> Well what does it need, and are you capable of adding to it? ๐ |
01:07:33 | FromDiscord | <pyautogui> Maybe. I was wondering if there was a plan in place. |
01:07:40 | * | rockcavera joined #nim |
01:07:40 | * | rockcavera quit (Changing host) |
01:07:40 | * | rockcavera joined #nim |
01:07:48 | FromDiscord | <timotheecour> "just make a PR" is the usual answer |
01:07:53 | FromDiscord | <pyautogui> Got it. |
01:08:54 | FromDiscord | <ElegantBeef> Nim is very community driven so many PR's to improve the stdlib are accepted, though Nim 2.0 seems like it'll make it a better process for doing such |
01:09:57 | FromDiscord | <timotheecour> what would nim 2.0 have that makes it easier to write PRs? |
01:10:32 | FromDiscord | <ElegantBeef> Well the suggestion araq has is to make the stdlib a distribution so destructive but beneficial changes would be more acceptable afaik |
01:12:49 | FromDiscord | <Rika> Are there any issues preventing that or is it a total go for 2.0? |
01:13:13 | FromDiscord | <ElegantBeef> Well 2.0 is still just and idea and not a thing yet ๐ |
01:13:18 | FromDiscord | <ElegantBeef> (edit) "and" => "an" |
01:13:31 | FromDiscord | <Rika> I donโt see how that is relevant to what I asked |
01:13:47 | FromDiscord | <ElegantBeef> Well not having a bundler is a big issue ๐ |
01:13:52 | FromDiscord | <timotheecour> ... but nothing prevents one from contributing PRs until this grand vision comes to life (honestly, that's still vague from my point of view) |
01:14:38 | FromDiscord | <ElegantBeef> So probable nimble is also a blocking issue for the bundler |
01:15:08 | FromDiscord | <ElegantBeef> Yea ofc people should still make PRs, as they mentioned 2.0 i just explained what the implications of that forum post say |
01:16:45 | FromDiscord | <timotheecour> I think https://github.com/nim-lang/RFCs/issues/291 is a key ingredient for nimble |
01:28:11 | FromDiscord | <ElegantBeef> i barely can find the keyway so i have no idea what's key ๐ |
01:33:00 | FromDiscord | <exelotl> We can improve the mersenne module by deleting it |
01:33:10 | FromDiscord | <exelotl> Mersenne Twister is trash :P |
01:36:24 | FromDiscord | <Rika> Lol |
01:43:49 | FromDiscord | <ElegantBeef> Exelotl tell us how you really feal ๐ |
01:44:52 | FromDiscord | <Rika> Exquisite spelling ability as usual beef |
01:47:37 | FromDiscord | <exelotl> I probably said this before but I feel like people only remember it because it has a catchy name |
01:48:19 | FromDiscord | <ElegantBeef> Lol i wanted to get water more than type properly ๐ |
01:48:40 | FromDiscord | <ElegantBeef> +36c here right now, so i'll place all blame on that |
01:50:10 | FromDiscord | <exelotl> It's so slow and has such hefty memory requirements compared to every other PRNG, yet it's not even cryptographically secure! What's even the point lol |
01:50:31 | FromDiscord | <exelotl> Ok mersenne rant over |
01:50:40 | FromDiscord | <ElegantBeef> How goes goodboy galaxy? |
01:51:10 | FromDiscord | <exelotl> Pretty good, boy :) |
01:52:08 | FromDiscord | <exelotl> Well we're still inching towards the kickstarter but we're so very close now |
01:52:46 | FromDiscord | <exelotl> We made a company which is pretty exciting too! |
01:53:05 | FromDiscord | <exelotl> (Well we had to as a prerequisite for the kickstarter) |
01:55:07 | FromDiscord | <exelotl> Our publisher had some test carts made and confirmed that saving works on real GBA carts using SRAM or FRAM |
01:55:59 | FromDiscord | <ElegantBeef> Will physical carts also get a digital key? |
01:56:16 | FromDiscord | <exelotl> Yeah, for sure |
01:59:13 | FromDiscord | <Rika> In reply to @exelotl "It's so slow and": Well itโs old |
02:01:19 | FromDiscord | <exelotl> Yeah I guess it was good compared to the other algorithms around 2001 or whenever it was released |
02:02:08 | FromDiscord | <exelotl> Oh 1997 |
02:02:10 | FromDiscord | <Rika> 19k7 |
02:02:13 | FromDiscord | <Rika> Dammit |
02:02:19 | FromDiscord | <Rika> Pressed k instead of 9 |
02:02:38 | FromDiscord | <exelotl> I'm only 2 years older than it :P |
02:02:59 | FromDiscord | <ElegantBeef> Jeez what a dinosaur |
02:05:12 | * | Epsilon left #nim (ERR: OUT_OF_MEM) |
02:05:59 | FromDiscord | <exelotl> I wish I could've done something for NimConf but too much happening at the moment and I couldn't get a new version of my library out in time, let alone write a talk about it |
02:06:07 | FromDiscord | <exelotl> Maybe next year |
02:14:52 | arkanoid | I'm confused my the difference of func/{.noSideEffect.} and {.raises[].} |
02:15:00 | arkanoid | s/my/by |
02:15:36 | FromDiscord | <ElegantBeef> What confuses you? |
02:16:16 | arkanoid | that seems overlapping |
02:16:22 | FromDiscord | <ElegantBeef> Func is a "pure"(Like functional programming function) procedure, `raises[]` tells you the procedure cannot have any errors so if anything inside of it has an error it'll report it |
02:17:18 | FromDiscord | <ElegantBeef> They do vastly different things, noSideEffect does not let you mutate any state not passed in as mutable, raises does not let the procedure have any uncaught exceptions |
02:19:31 | arkanoid | the "raises" and "tags" pragma are the main componens of the effect system (https://nim-lang.org/docs/manual.html#effect-system). They are meant to declare the effects of the preocedure and enforce the presence or absence of them. "noSideEffect" does the same, in a black/white fashion |
02:22:17 | FromDiscord | <ElegantBeef> !eval func a = raise newException(ValueError, "This is an error") |
02:22:19 | NimBot | <no output> |
02:22:53 | FromDiscord | <ElegantBeef> I dont quite follow where the overlap is |
02:24:05 | * | rockcavera quit (Remote host closed the connection) |
02:25:25 | arkanoid | So what you're saying is that the "noSideEffect" thing is unrelated to the "effect system" |
02:25:50 | arkanoid | is this unlucky naming of things? |
02:25:52 | FromDiscord | <ElegantBeef> Afaik yes, it's a pragma to annotate whether the function is pure |
02:26:20 | FromDiscord | <ElegantBeef> `noSideEffect` is talking about pure functions, like those in functional languages, where they do not mutate global state |
02:26:57 | FromDiscord | <Hi02Hi> In reply to @arkanoid "is this unlucky naming": you mean noSideEffect is the unlucky naming |
02:27:00 | FromDiscord | <Hi02Hi> (edit) "naming" => "naming?" |
02:28:16 | arkanoid | I know "effect tracking" and "no side effects" concepts in theory, and in other languages. They surely overlap there, as changing global state is an "effect" too |
02:29:00 | FromDiscord | <ElegantBeef> Exception handling may be considered in strictfuncs as impure, but i dont know |
02:29:05 | arkanoid | I'm just confused how nim has those in different chapters of the manual, with overlapping names but apparently no overlapping features |
02:30:52 | FromDiscord | <Rika> Effects and exceptions are separate |
02:32:03 | FromDiscord | <Rika> Ah I misread |
02:33:31 | FromDiscord | <@bracketmaster-5a708063d73408ce4> sent a long message, see http://ix.io/3rqE |
02:33:38 | FromDiscord | <@bracketmaster-5a708063d73408ce4> emulator currently does 21,000 instructions per second |
02:33:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> not great |
02:34:16 | FromDiscord | <ElegantBeef> I thought it was nimdiotic ๐ |
02:34:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> If it seems readable, I think I'll add some more instructions, enough to get lInux running |
02:34:34 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oh |
02:34:36 | FromDiscord | <ElegantBeef> You did bench it on release right? |
02:34:41 | FromDiscord | <@bracketmaster-5a708063d73408ce4> almost sounds like "idiotic" |
02:34:44 | FromDiscord | <@bracketmaster-5a708063d73408ce4> no? |
02:34:46 | FromDiscord | <ElegantBeef> That was the joke |
02:34:47 | FromDiscord | <@bracketmaster-5a708063d73408ce4> How do I do that? |
02:34:52 | FromDiscord | <@bracketmaster-5a708063d73408ce4> haha |
02:34:57 | FromDiscord | <@bracketmaster-5a708063d73408ce4> good one |
02:34:59 | FromDiscord | <ElegantBeef> `nim c -d:release ...` |
02:35:24 | FromDiscord | <ElegantBeef> Probably also want `-d:lto` if on linux/windows or `--passC:-flto` and `--passL:-flto` on mac |
02:35:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> does release not catch exceptions? |
02:35:53 | FromDiscord | <ElegantBeef> It still does |
02:35:54 | FromDiscord | <Rika> It does |
02:36:11 | FromDiscord | <Rika> Just lacks stack traces I believe |
02:36:28 | FromDiscord | <@bracketmaster-5a708063d73408ce4> https://github.com/BracketMaster/nimulatorPPC/blob/main/src/nimulatorPPC.nim#L41 |
02:36:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I catch instructions emulated as an exception |
02:36:45 | FromDiscord | <Rika> That will work |
02:36:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> as -\> after |
02:37:00 | FromDiscord | <@bracketmaster-5a708063d73408ce4> doesn't seem to print with release |
02:37:17 | FromDiscord | <ElegantBeef> If exception handling didnt work with release that'd be a nightmare |
02:37:20 | FromDiscord | <Rika> You probably didnโt flush the standard output |
02:37:36 | FromDiscord | <ElegantBeef> Yea `stdout.flush` should ensure it works properly |
02:37:45 | FromDiscord | <Rika> Flush file |
02:37:51 | FromDiscord | <Rika> Flush is for streams |
02:38:03 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I know what happened - lol |
02:38:04 | FromDiscord | <@bracketmaster-5a708063d73408ce4> one sec |
02:38:05 | FromDiscord | <ElegantBeef> Ah, cause why not have a different name for no reason |
02:38:21 | FromDiscord | <Rika> Because itโs a file duh |
02:38:33 | FromDiscord | <Rika> Funny beef saying nonsense |
02:38:43 | FromDiscord | <@bracketmaster-5a708063d73408ce4> what's the way to set a ctrl-c hook? |
02:39:11 | FromDiscord | <Rika> https://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29 |
02:39:46 | FromDiscord | <ElegantBeef> Well rika you know very well `flushFile(f: File)` is redundant |
02:40:04 | FromDiscord | <Rika> Iโm joking just so you know |
02:40:13 | FromDiscord | <Rika> I canโt tell if you know |
02:40:21 | FromDiscord | <ElegantBeef> Nah you're a meanie and insult me daily! |
02:40:35 | FromDiscord | <Rika> I mean youโre so easy to bully |
02:40:46 | FromDiscord | <Rika> Itโs difficult to resist |
02:42:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> roughly the same speed |
02:42:38 | FromDiscord | <ElegantBeef> True, i'm a big self deprecating target of indifference |
02:42:48 | arkanoid | lol |
02:43:12 | FromDiscord | <ElegantBeef> Well how can i benchmark this? |
02:43:27 | FromDiscord | <ElegantBeef> Time to whip out treeform's hottie and put it to work |
02:44:00 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @\_discord\_145405730571288577\:t2bot.io , are you asking how to benchmark nimulator? |
02:44:17 | FromDiscord | <ElegantBeef> I believe so |
02:44:37 | FromDiscord | <@bracketmaster-5a708063d73408ce4> `nim c -d:release r src/nimulatorPPC` then type something for maybe a couple seconds, and finally press ctrl+c |
02:44:43 | FromDiscord | <@bracketmaster-5a708063d73408ce4> it should tell you cycles/second |
02:44:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> as an output |
02:44:48 | FromDiscord | <ElegantBeef> ok |
02:44:57 | FromDiscord | <@bracketmaster-5a708063d73408ce4> or more accurately, instructions/second |
02:45:38 | FromDiscord | <@bracketmaster-5a708063d73408ce4> modern CPUs execute on the order of 100M+ instructions per second |
02:46:00 | FromDiscord | <@bracketmaster-5a708063d73408ce4> around 22k/second is alright for a purely software emulator |
02:46:22 | FromDiscord | <@bracketmaster-5a708063d73408ce4> with ASM jitting, you can hit up to 10M+ instructions per second |
02:46:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> and with a verilator optimized hardware model, you hit around 250k instructions per second, for some context |
02:47:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @\_discord\_145405730571288577\:t2bot.io , you might need the PPC gnu assembler to build a binary |
02:49:32 | FromDiscord | <ElegantBeef> Excuse me i've just learned my package manger is borked |
02:49:41 | FromDiscord | <ElegantBeef> I need to go kick my pc a for a few minutes |
02:49:48 | FromDiscord | <@bracketmaster-5a708063d73408ce4> lol |
02:49:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> apt? |
02:50:52 | FromDiscord | <ElegantBeef> Ah nvm i'm just a dummy |
02:51:21 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I can drop a firmware.bin.tar.gz link if needbe |
02:51:37 | FromDiscord | <@bracketmaster-5a708063d73408ce4> installing cross compilers can be a pain |
02:52:57 | FromDiscord | <ElegantBeef> I've got it |
02:53:12 | arkanoid | I've simplified my cross-compiling dev experience using nix |
02:53:46 | FromDiscord | <ElegantBeef> Ah LTO is really what's needed |
02:54:50 | FromDiscord | <ElegantBeef> from 130k/s to 450k/s |
02:55:07 | FromDiscord | <@bracketmaster-5a708063d73408ce4> LOT? |
02:55:18 | FromDiscord | <@bracketmaster-5a708063d73408ce4> \\LTO |
02:55:49 | FromDiscord | <ElegantBeef> Link time optimization, on linux you should be able to do `-d:lto` if using gcc, with clang you'll need to do `--passC:-flto` and `--passL:-flto` |
02:56:12 | FromDiscord | <ElegantBeef> Due to how nim C code is generated it gives proper performance |
02:57:00 | FromDiscord | <ElegantBeef> Then `-d:danger` gets us to 470k/s on my machine |
02:57:51 | FromDiscord | <@bracketmaster-5a708063d73408ce4> oooh... 400k cycles per second!! |
02:57:57 | FromDiscord | <@bracketmaster-5a708063d73408ce4> that is really fast! |
02:58:09 | FromDiscord | <@bracketmaster-5a708063d73408ce4> lemme try danger |
02:58:10 | FromDiscord | <ElegantBeef> Let's do it better and faster ๐ |
02:58:30 | arkanoid | what do you think of https://koka-lang.github.io ? |
02:58:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> danger breaks things - lol |
02:58:48 | FromDiscord | <@bracketmaster-5a708063d73408ce4> but I got 725k |
02:59:21 | FromDiscord | <@bracketmaster-5a708063d73408ce4> first glance? |
02:59:25 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I sorta like it |
03:00:17 | FromDiscord | <ElegantBeef> Havent looked at the code yet, main thing was to get you to learn how to actually run Nim code ๐ |
03:01:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> anyways, 400k cycles per second is defnitely enough to run linux |
03:03:09 | FromDiscord | <@bracketmaster-5a708063d73408ce4> in emulation |
03:05:22 | FromDiscord | <ElegantBeef> Ok so bitpat pairings is a table for literally 0 reason afaic |
03:05:28 | FromDiscord | <ElegantBeef> make it an array |
03:05:32 | FromDiscord | <ElegantBeef> free speed |
03:05:55 | FromDiscord | <@bracketmaster-5a708063d73408ce4> hmm - alright |
03:06:17 | FromDiscord | <ElegantBeef> Well it's remove `{}.toTable` and replace with `[]` and the api is 100% identical |
03:06:31 | FromDiscord | <ElegantBeef> So you get the exact same logic/connection without any hashing |
03:07:05 | FromDiscord | <ElegantBeef> Atleast assuming all the values from `mnemonic_enums` are used |
03:07:08 | FromDiscord | <Rika> In reply to @ElegantBeef "Ok so bitpat pairings": Bit what? |
03:07:32 | FromDiscord | <ElegantBeef> That's the filename `bitpat_pairings` |
03:07:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @\_discord\_259277943275126785\:t2bot.io - that's how I do my decoder |
03:08:02 | FromDiscord | <@bracketmaster-5a708063d73408ce4> https://github.com/BracketMaster/nimulatorPPC/blob/main/src/isa/bitpat_pairings.nim |
03:08:16 | FromDiscord | <@bracketmaster-5a708063d73408ce4> also, shoudln't `nim c --profiler:on --stacktrace:on -r src/nimulatorPPC.nim` give me a stack trace? |
03:08:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> and profiler results? |
03:08:49 | FromDiscord | <Rika> What do you get? |
03:08:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> nothing... |
03:09:06 | FromDiscord | <Rika> Oh you need to import the profiler as well |
03:09:19 | FromDiscord | <Rika> Odd quirk but eh |
03:09:21 | FromDiscord | <ElegantBeef> Yea just use a C profiler or checkout `treeform/hottie` |
03:10:40 | FromDiscord | <ElegantBeef> Though hottie did not work for me |
03:10:43 | FromDiscord | <Rika> Why not call it spottie though |
03:10:48 | FromDiscord | <Rika> Would be cooler IMO |
03:10:51 | FromDiscord | <ElegantBeef> It's for hot path finding |
03:11:06 | FromDiscord | <Rika> Big brain call it hot spot finding |
03:11:12 | FromDiscord | <Rika> Ez |
03:11:30 | FromDiscord | <ElegantBeef> Though for whatever reason it doesnt work on this project, so either something is wrong with the linux impl or something is wrong with how this program is ran ๐ |
03:12:15 | FromDiscord | <reilly> Does anyone have any resources I can read for using Nim on the GPU? |
03:12:18 | FromDiscord | <@bracketmaster-5a708063d73408ce4> yeah, importing nimprof seems to break stdout |
03:12:26 | FromDiscord | <ElegantBeef> nimsl |
03:12:32 | FromDiscord | <ElegantBeef> That'll be it all for nim on gpu |
03:12:39 | FromDiscord | <ElegantBeef> Think there are some other transpilers |
03:16:22 | FromDiscord | <ElegantBeef> Ah i was being dumb |
03:16:24 | FromDiscord | <ElegantBeef> Works fine |
03:16:43 | FromDiscord | <ElegantBeef> I'm more often dumb than smart, why does anyone listen to a word i have to say |
03:16:52 | FromDiscord | <@bracketmaster-5a708063d73408ce4> You're right, nimprof shows the hash is probably taking up 29% of the simulation |
03:17:03 | FromDiscord | <ElegantBeef> Well it's needless |
03:17:19 | FromDiscord | <ElegantBeef> You have an enum -> value, that's a free index lookup in nim |
03:19:07 | FromDiscord | <ElegantBeef> Yea without lto or danger went from 130k to 190k with just changing the `{ }.toTable` to an `[]` |
03:19:41 | FromDiscord | <ElegantBeef> nice 2.3million now |
03:19:50 | FromDiscord | <ElegantBeef> (edit) "2.3million" => "2.23million" |
03:20:03 | FromDiscord | <Rika> Damn |
03:20:25 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Is it Nim, or is it bracket master? |
03:20:36 | FromDiscord | <@bracketmaster-5a708063d73408ce4> lol - jk |
03:20:58 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @\_discord\_145405730571288577\:t2bot.io , diff me your changes? |
03:21:27 | FromDiscord | <ElegantBeef> It's literally open `bitpat_pairings` and replace `{}.toTable` with `[]` |
03:21:49 | FromDiscord | <ElegantBeef> Like there is no elaborate code changes, Nim's arrays can be enum indexed |
03:22:04 | FromDiscord | <ElegantBeef> so since you dont pass this around and just access it, it's free |
03:22:31 | FromDiscord | <Rika> Thinking about it a bit |
03:22:47 | FromDiscord | <Rika> Why would the hash function of an enumeration be different from its integer value |
03:22:58 | FromDiscord | <Rika> The result of the hash function I mean |
03:22:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I also got 2.5M |
03:23:02 | FromDiscord | <@bracketmaster-5a708063d73408ce4> without danger |
03:23:19 | FromDiscord | <@bracketmaster-5a708063d73408ce4> 3M with |
03:23:23 | FromDiscord | <Rika> Now slap LTO on it and get billions (I kid) |
03:23:28 | FromDiscord | <ElegantBeef> Think that's with lto |
03:24:24 | FromDiscord | <ElegantBeef> Time to run a profiler to see where the slowdown is now |
03:26:41 | FromDiscord | <ElegantBeef> Ah yes 43% is spent in blank https://media.discordapp.net/attachments/371759389889003532/859273642088726528/unknown.png |
03:27:37 | FromDiscord | <Rika> This code doesnโt exist |
03:27:56 | FromDiscord | <Rika> The program spends its time on contemplating whether it dies after running or not |
03:28:23 | FromDiscord | <@bracketmaster-5a708063d73408ce4> blank? |
03:28:43 | FromDiscord | <ElegantBeef> Hottie didnt find a stacktrace in the objdump for what that is |
03:28:46 | FromDiscord | <Rika> Can you see the image |
03:28:47 | FromDiscord | <@bracketmaster-5a708063d73408ce4> how do I fix that? |
03:28:54 | FromDiscord | <ElegantBeef> That's an issue for hottie |
03:29:04 | FromDiscord | <Rika> โRemove all the white space only lines in your codeโ |
03:29:08 | FromDiscord | <Rika> Iโm kidding |
03:29:47 | FromDiscord | <@bracketmaster-5a708063d73408ce4> ah |
03:30:26 | FromDiscord | <ElegantBeef> I'd argue though the `from X import Y` isnt very idiomatic Nim, but that's probably just cause i'm a lazy tosser |
03:30:43 | FromDiscord | <@bracketmaster-5a708063d73408ce4> ha, you're probably right |
03:30:55 | FromDiscord | <ElegantBeef> also all the snake case ๐ |
03:31:12 | FromDiscord | <@bracketmaster-5a708063d73408ce4> When this is done, nimulator codebase will have roughly 4000 functions |
03:31:24 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I wanted to keep my sanity when importing functions |
03:31:38 | FromDiscord | <@bracketmaster-5a708063d73408ce4> POWER has 900 instructions, so roughly 5 functions per instruction |
03:31:49 | FromDiscord | <ElegantBeef> Well yea i cannot force you to write code the way i want, if i wanted to do that i'd have written this library |
03:32:53 | FromDiscord | <ElegantBeef> https://github.com/BracketMaster/nimulatorPPC/blob/main/src/utils/rawTerm.nim#L7โตProbably should just do `stdin.getFileHandle.cint` instead of the cast |
03:33:30 | FromDiscord | <@bracketmaster-5a708063d73408ce4> that would make sense |
03:34:56 | FromDiscord | <ElegantBeef> https://github.com/BracketMaster/nimulatorPPC/blob/main/src/cpu/decoder.nim#L20-L24โตAlso what's this?โตshouldnt this just be `Pairings[instruction] == insnInfo` |
03:35:18 | FromDiscord | <ElegantBeef> Also why are you putting an assertion in a try block |
03:36:51 | FromDiscord | <ElegantBeef> Defects are not meant to be caught they're meant to be avoided properly, they're sanity checks not to be used as exceptions |
03:36:51 | FromDiscord | <Rika> Assertions are defects, you might not be able to catch them |
03:37:36 | FromDiscord | <ElegantBeef> Yea some flag disables them which might be why your danger build is borked |
03:38:36 | FromDiscord | <Rika> Maybe there should be a warning when something that only raises a defect is the sole raiser in a try block |
03:38:39 | FromDiscord | <ElegantBeef> Probably, but i just dont get the point here |
03:38:50 | FromDiscord | <ElegantBeef> Raise the assertion to catch the assertion |
03:39:32 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3rqT |
03:40:02 | FromDiscord | <Rika> Pretty much |
03:41:00 | FromDiscord | <ElegantBeef> The iterating over all the instructions seems like another place for a slowdown |
03:41:23 | FromDiscord | <ElegantBeef> And hottie said iterators was 3% of your programs runtime so wouldnt doubt it |
03:43:33 | FromDiscord | <ElegantBeef> Wonder if you can just do an `array[0..instructions, OpCode]` then just check if instruction is in that range |
03:51:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> `if not opCodeFound: raise newException(NimulatorError, "Op code not found")` does seem like a better patter |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:36 | * | supakeen joined #nim |
05:03:59 | fn | <ForumUpdaterBot99> New Nimble package! websock - Websocket server and client implementation, see https://github.com/status-im/nim-websock |
05:04:00 | fn | <R2D299> itHub: 7"Websocket for Nim" |
05:23:38 | FromDiscord | <Bung> hmm we got 3 or 4 websocket lib |
06:00:14 | * | SebastianM joined #nim |
06:06:16 | * | SebastianM quit (Quit: Bye) |
06:07:40 | FromDiscord | <Richard> Hey, does anyone know if Nim has a machine learning for beginners type of tutorial? |
06:17:22 | FromDiscord | <Bung> I think they just beginning https://github.com/SciNim/getting-started/issues/19 |
06:19:52 | * | PMunch joined #nim |
06:21:39 | FromDiscord | <treeform> In reply to @ElegantBeef "Ah yes 43% is": blank usually means OS code, like waiting for file read or some thing. |
06:21:51 | FromDiscord | <treeform> or a sleep() call |
06:32:07 | FromDiscord | <ElegantBeef> @treeform do i have a bug for you ๐ single line puppy stack smashing |
07:02:04 | FromDiscord | <Avatarfighter> In reply to @Bung "hmm we got 3": This one is using chronos |
07:03:00 | FromDiscord | <Avatarfighter> kind of dope |
07:05:39 | FromDiscord | <Bung> use chronos then it's fine , as chronos use its own async pragma |
07:06:06 | FromDiscord | <Bung> requires "nimcrypto"โตrequires "bearssl"โตrequires "https://github.com/status-im/nim-zlib" I dont know why these in dependencies |
07:07:19 | FromDiscord | <Avatarfighter> I assume that maybe status is using/going to use this in nimbus and they are probably just using the same dependencies everywhere |
07:10:41 | FromDiscord | <Bung> oh, I checked these are really in used. |
07:47:30 | * | max22- joined #nim |
08:09:16 | * | nixfreak_nim[m] quit (Quit: Bridge terminating on SIGTERM) |
08:09:16 | * | Clonkk[m] quit (Quit: Bridge terminating on SIGTERM) |
08:09:17 | * | Zoom[m] quit (Quit: Bridge terminating on SIGTERM) |
08:09:30 | * | Helios quit (Quit: Bridge terminating on SIGTERM) |
08:19:44 | * | Vladar joined #nim |
08:26:52 | FromDiscord | <KnorrFG> do we have a min function, were we can explicitely pass the comparison operator instead of implicitely using `<` ? |
08:29:43 | FromDiscord | <KnorrFG> nvm. found algorithm.sort |
08:57:26 | PMunch | Finally have time to watch all the Nim talks from NimConf :) |
09:00:39 | FromDiscord | <Rika> good for you ๐ฆ |
09:08:15 | FromDiscord | <gogolxdong (liuxiaodong)> Anyone familiar with blake3? |
09:13:36 | PMunch | @Rika, haven't had time to watch them yet? |
09:21:15 | FromDiscord | <stu002> Can someone give me more insight into the error message `Error: no tuple type for constructor`? I'm preparing a Gist that shows the error in context, i.e. passing 2-tuples of floats to a function. |
10:00:14 | FromDiscord | <haxscramper> @stu002 what is the function signature? |
10:00:29 | FromDiscord | <haxscramper> `func a(a, b: float)` and you are passing `(float, float)` to it? |
10:31:10 | * | deshordash joined #nim |
10:32:00 | * | deshordash quit (Remote host closed the connection) |
10:32:30 | fn | <ForumUpdaterBot99> New Nimble package! sync - Useful synchronization primitives, see https://github.com/planetis-m/sync |
10:32:31 | fn | <R2D299> itHub: 7"Useful synchronization primitives." |
10:34:11 | FromDiscord | <planetis> How do I check this\: https://gist.github.com/planetis-m/42b675403212e018b5b9c9cc2378dffc does or doesn't make an huge copy |
10:35:33 | FromDiscord | <richard stallmen(crazy GNU guy)> sent a code paste, see https://play.nim-lang.org/#ix=3rsL |
10:38:14 | PMunch | @planetis, I guess you could use getOccupiedMem in strategic places |
10:39:54 | FromDiscord | <planetis> i mean how to make sure it doesn't create a X in the stack and then copyMem to the allocated space |
10:39:59 | FromDiscord | <richard stallmen(crazy GNU guy)> i did define it |
10:40:43 | FromDiscord | <richard stallmen(crazy GNU guy)> varโต Farenheit: float32 |
10:43:05 | FromDiscord | <planetis> wait my stack size is 8MB. so if it did, it should crash |
10:48:12 | FromDiscord | <planetis> yep slightly changing it to use a temp causes segmentation fault |
10:48:22 | FromDiscord | <planetis> so nim has inplace |
10:50:36 | FromDiscord | <planetis> myth busted |
10:51:21 | * | max22- quit (Ping timeout: 268 seconds) |
11:07:35 | * | jkl quit (Quit: ZNC 1.8.2 - https://znc.in) |
11:07:37 | FromDiscord | <stu002> In reply to @haxscramper "`func a(a, b: float)`": The context of the error is at https://gitlab.com/-/snippets/2142177 |
11:08:06 | FromDiscord | <stu002> (edit) "In reply to @haxscramper "`func a(a, b: float)`": The context of the error is at https://gitlab.com/-/snippets/2142177 ... " added "Please excuse probably non-idiomatic Nim" |
11:09:26 | * | jkl joined #nim |
11:19:52 | * | jkl quit (Quit: ZNC 1.8.2 - https://znc.in) |
11:20:43 | * | jkl joined #nim |
11:21:19 | FromDiscord | <planetis> old style concepts are afaik going to be removed |
11:26:34 | FromDiscord | <haxscramper> In reply to @stu002 "The context of the": Which line at least gives the error? |
11:26:50 | FromDiscord | <haxscramper> Reproducible example would be better |
11:28:13 | FromDiscord | <haxscramper> This gives the same error https://play.nim-lang.org/#ix=3rsV |
11:29:33 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rsW |
11:35:52 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
11:37:54 | * | MightyJoe quit (Ping timeout: 268 seconds) |
11:39:30 | * | Vladar quit (Quit: Leaving) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:37 | * | supakeen joined #nim |
12:42:07 | PMunch | Ah bummer, NiGui doesn't have mouse move events? |
12:42:43 | * | SebastianM joined #nim |
12:44:29 | PMunch | What do the cool kids use in Nim nowadays for UIs? |
12:47:21 | * | max22- joined #nim |
12:55:25 | PMunch | Hmm, the integer/float remainder system that @impox is using in his talk is interesting indeed |
12:55:33 | PMunch | Definitely should have its own writeup |
12:55:54 | ozzz_ | I try to use NiGui. I'm old to be young lol, maybe that's why I not found that limitation :) |
12:56:24 | PMunch | Well I'm trying to do something a bit out of the ordinary |
12:56:35 | PMunch | Definitely seems a lot more useable than last time I looked at it |
12:56:54 | ozzz_ | It works definitely |
12:57:13 | PMunch | But I want to create a small graph with moveable nodes as part of my program, and I need some mouse move event to move the nodes around in the graph |
12:57:31 | ozzz_ | Sounds interesting |
12:57:54 | ozzz_ | I'm doing image generation too |
12:58:10 | ozzz_ | XY graph, non inetractive |
12:59:43 | * | max22- quit (Ping timeout: 246 seconds) |
13:00:15 | PMunch | Oh cool, what're you using it for? |
13:01:25 | ozzz_ | I not finished it yet, but in plans to integrate libjpeg or libpng |
13:02:00 | ozzz_ | It should be small triode calculator, with frequency response graphs |
13:02:08 | PMunch | There is an example in NiGui on how to save PNG images from an internal image |
13:02:28 | PMunch | Oh cool |
13:02:52 | ozzz_ | yeah, I tested that. Not very fan of tmp folders |
13:03:27 | ozzz_ | Unfortunately nigui don't has methods to work with ram |
13:05:10 | * | rockcavera joined #nim |
13:05:10 | * | rockcavera quit (Changing host) |
13:05:10 | * | rockcavera joined #nim |
13:11:22 | * | SebastianM quit (Quit: Bye) |
13:20:04 | FromDiscord | <juan_carlos> I dont know who created it, but thanks for creating `importutils.privateAccess` is very useful. :) |
13:26:48 | FromDiscord | <konsumlamm> it was timothee |
13:27:49 | * | Vladar joined #nim |
13:55:32 | FromDiscord | <dom96> In reply to @juan_carlos "I dont know who": what is it? ๐ฎ |
13:56:05 | FromDiscord | <pietroppeter> how do you use the strdefine in nimscript? an option like --d:myVar=myval how does it translate with the switch syntax? |
13:57:11 | FromDiscord | <pietroppeter> (for the record switch("d:myVar", "myVal") does not work |
13:57:30 | FromDiscord | <pietroppeter> and I cannot find clues in docs: https://nim-lang.org/docs/nims.html |
13:59:52 | FromDiscord | <dom96> https://github.com/nim-lang/Nim/blob/devel/lib/std/importutils.nim#L23 |
13:59:53 | FromDiscord | <dom96> cool |
14:00:48 | FromDiscord | <dom96> @timotheecour your contributions are appreciated ๐ |
14:00:59 | FromDiscord | <haxscramper> In reply to @pietroppeter "and I cannot find": Have you tried `switch("d", "myVar=myVal")` |
14:01:02 | FromDiscord | <haxscramper> (edit) ""myVar=myVal")`" => ""myVar=myVal")`?" |
14:03:06 | * | max22- joined #nim |
14:05:44 | FromDiscord | <pietroppeter> tried now, it does not throw error but it does not work |
14:06:44 | * | PMunch quit (Quit: Leaving) |
14:06:55 | FromDiscord | <pietroppeter> wait on a smaller test it works |
14:07:03 | FromDiscord | <pietroppeter> I will try again |
14:07:56 | FromDiscord | <pietroppeter> yeah, it works, thanks! |
14:26:52 | FromDiscord | <aleclarson> is there a built-in proc for type assertion? ideally one that narrows the type of the variable it receives to avoid compiler warnings after the assertion |
14:28:06 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3rtD |
14:29:03 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3rtE |
14:29:36 | FromDiscord | <aleclarson> i'm doing dynamic dispatch, so overloads are not an option |
14:32:30 | * | xet7 quit (Remote host closed the connection) |
14:33:39 | * | xet7 joined #nim |
14:35:48 | * | xet7 quit (Remote host closed the connection) |
14:37:13 | * | xet7 joined #nim |
14:46:44 | fn | <bung99> why not use generic type? |
14:47:03 | fn | <bung99> proc foo[T](arg:T) |
14:47:45 | FromDiscord | <aleclarson> the idea is to raise an error if an invalid type is passed |
14:48:37 | FromDiscord | <aleclarson> even if i used a generic type, wouldn't any procs i pass the generic variable to still need to have overloads for each possible type? |
14:51:18 | fn | <bung99> maybe try template with typed arg I think |
14:52:00 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rtH |
14:52:16 | FromDiscord | <haxscramper> `import std/[macros]` is required for `{.error` IIRC |
14:54:46 | FromDiscord | <aleclarson> i'm looking for a runtime typecheck that also changes the type of the variable in lines following the typecheck. i think the `is` operator is what i want, but not sure |
14:55:04 | FromDiscord | <aleclarson> (edit) "i'm looking for a runtime typecheck that also changes the type of the variable in lines following the typecheck. i think the `is` operator ... is" added "combined with `if` statement" |
15:00:47 | FromDiscord | <haxscramper> nim is statically typed language, you would need to box all types |
15:01:14 | FromDiscord | <aleclarson> i am \:) |
15:01:16 | FromDiscord | <haxscramper> `is` runs at compile-time regardless of whether you use `when` or `if` |
15:01:29 | FromDiscord | <aleclarson> oh interesting |
15:01:33 | FromDiscord | <haxscramper> `argOfBoxedType is int` wont' work |
15:01:50 | FromDiscord | <aleclarson> but using ref objects, it will? |
15:01:51 | FromDiscord | <haxscramper> And you can't overload `is` - https://nim-lang.org/docs/manual.html#procedures-nonoverloadable-builtins |
15:02:02 | FromDiscord | <haxscramper> In reply to @aleclarson "but using ref objects,": no, is runs at compile-time |
15:02:08 | FromDiscord | <haxscramper> for ref objects you can use `of` |
15:02:20 | FromDiscord | <aleclarson> ah ok, thanks a lot |
15:02:27 | FromDiscord | <haxscramper> for boxed variants (recommended solution) you can use `.kind in {expectedKinds}` |
15:03:31 | FromDiscord | <aleclarson> hmm it says `"of" takes object types` when i try using a `ref object` type with it |
15:03:59 | FromDiscord | <haxscramper> can you show error&code? |
15:04:12 | FromDiscord | <haxscramper> `value of Type` |
15:04:39 | FromDiscord | <haxscramper> What is your use case btw? |
15:05:08 | FromDiscord | <aleclarson> https://play.nim-lang.org/#ix=3rtV |
15:06:41 | FromDiscord | <aleclarson> In reply to @haxscramper "What is your use": i have a `Table[string, proc (arg: Box): Box]` where each proc may require different arguments, so they need to do runtime type-checking |
15:07:00 | FromDiscord | <haxscramper> `proc Foo = ref object of RootObj`? |
15:07:51 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3rtY |
15:08:11 | FromDiscord | <aleclarson> oops, my bad. lemme see if i can repro it correctly |
15:08:16 | FromDiscord | <haxscramper> In reply to @aleclarson "i have a `Table[string,": I would suggest you use variant for boxing |
15:08:39 | FromDiscord | <haxscramper> like this https://nim-lang.org/docs/macros.html#the-ast-in-nim |
15:08:45 | FromDiscord | <aleclarson> i don't like object variants for this use case, because variants can't share the same property name |
15:09:04 | FromDiscord | <aleclarson> how's it better? |
15:09:17 | FromDiscord | <haxscramper> aside from property names? |
15:09:43 | FromDiscord | <haxscramper> I hope we get #368 implemented this year |
15:11:40 | * | vicfred joined #nim |
15:12:11 | FromDiscord | <aleclarson> i mean, why do u suggest object variants instead of inheritance |
15:12:59 | FromDiscord | <haxscramper> it is faster, easier to reason about (no need to have dozens of separate types for couple shared fields) |
15:13:33 | FromDiscord | <haxscramper> The argument of shared fields only useful when you have inheritance graph of depth 3 or more, otherwise putting shared fields on top would give you the same object size |
15:14:01 | FromDiscord | <haxscramper> You can check for sets of object variants, while for inheritance you require `of ... or of ...` checks |
15:14:17 | FromDiscord | <haxscramper> While inheritance does work with pattern matching it is an ugly solution |
15:14:58 | FromDiscord | <haxscramper> inheritance almost always requires `ref`, while variant types can be by-value (store on stack, no need for heap alocations etc). |
15:15:25 | FromDiscord | <haxscramper> `case` statically checks that all variants are handled, where with `of` check you are left on your own |
15:16:54 | FromDiscord | <haxscramper> I'm sure there is more, but that's main points that are usually important for me for choosing variants vs inheritance |
15:17:14 | FromDiscord | <haxscramper> I've rarely seen inheritance used, and I don't think I've ever seen it used for boxing |
15:17:46 | FromDiscord | <haxscramper> RTTI works only on refc gc, but not on arc/orc. Though I'm not really sure about that part, maybe I'm wrong here |
15:19:01 | FromDiscord | <haxscramper> In reply to @haxscramper "You can check for": Also using variants allows you to have an `array[BoxKind, T]` that is extremly conventient for any sort of mappings, while with inheritance you would need to rely on |
15:19:25 | FromDiscord | <haxscramper> idk what, but I doubt it is as concise and cheap as `array` mappings |
15:19:38 | FromDiscord | <haxscramper> which are as cheap as you can possibly get to begin with |
15:19:58 | FromDiscord | <konsumlamm> note that Nim doesn't support variance annotations (eventhough the experimental docs mention it afaik) |
15:20:03 | FromDiscord | <konsumlamm> (edit) |
15:24:53 | FromDiscord | <aleclarson> interesting points, thx |
15:27:24 | FromDiscord | <aleclarson> any idea why this template fails? https://play.nim-lang.org/#ix=3ru0 |
15:28:32 | FromDiscord | <haxscramper> `proc (arg {.inject.}: string): void =` https://nim-lang.org/docs/manual.html#templates-hygiene-in-templates |
15:28:53 | FromDiscord | <aleclarson> ahh very nice ^^ |
15:31:53 | FromDiscord | <aleclarson> `of` doesn't seem to actually change the variable type within the `if` statement. how come?โตhttps://play.nim-lang.org/#ix=3ru2 |
15:32:51 | FromDiscord | <aleclarson> oh i forgot to export the property, but it's still not working |
15:36:07 | * | xet7 quit (Remote host closed the connection) |
15:36:45 | FromDiscord | <haxscramper> In reply to @aleclarson "`of` doesn't seem to": Why should it? |
15:37:07 | FromDiscord | <haxscramper> `if` checks for object runtime type, that's all |
15:37:10 | FromDiscord | <haxscramper> (edit) "`if`" => "`of`" |
15:37:47 | * | xet7 joined #nim |
15:38:04 | FromDiscord | <aleclarson> i don't see the point of `of` if it doesn't let me access a subtype's property \:S |
15:38:59 | FromDiscord | <aleclarson> so the only workaround is casting inside the if block? |
15:39:30 | FromDiscord | <haxscramper> it is not "workaround". The point of `of` is to check object runtime type |
15:39:53 | FromDiscord | <haxscramper> No additional flow analysis is performed to implicitly convert types |
15:40:41 | FromDiscord | <haxscramper> If you need to tread supertype as a subtype, you can do `Subtype(ident).myField` to access subtype fields |
15:51:46 | FromDiscord | <Zoom> To clarify, currently I use `spawn`, but I'd like the thread to get reaped for me without passing any messages. Will it work? |
15:52:03 | * | arkurious joined #nim |
16:04:27 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3rug |
16:05:10 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3ruh |
16:05:13 | FromDiscord | <aleclarson> (edit) |
16:06:23 | FromDiscord | <haxscramper> I don't really understand how it is supposed to work, but looks like this would not be possible |
16:10:09 | FromDiscord | <aleclarson> is it possible to have a forward declaration for an `object` type? |
16:11:33 | FromDiscord | <timotheecour> https://nim-lang.github.io/Nim/manual_experimental.html#package-level-objects but it's probably gonna be replaced by something better |
16:13:30 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3ruk |
16:14:38 | FromDiscord | <aleclarson> In reply to @timotheecour "https://nim-lang.github.io/Nim/manual_experimental.": what if they're in the same package |
16:14:58 | FromDiscord | <aleclarson> (edit) "package" => "file" |
16:15:47 | FromDiscord | <timotheecour> In reply to @aleclarson "can i "spread" the": no, use a macro for that (which is a more flexible design than hard-coding some spread syntax) |
16:16:23 | FromDiscord | <timotheecour> In reply to @aleclarson "what if they're in": try it and let us know ; i'd (lightly) expect it to wok |
16:16:25 | FromDiscord | <timotheecour> (edit) "wok" => "work" |
16:20:17 | FromDiscord | <aleclarson> the docs aren't clear on whether an {.experimental.} pragma is required for package-level objects |
16:21:38 | FromDiscord | <timotheecour> PR's welcome to improve docs; IIRC it's not needed, but IMO should be |
16:21:51 | FromDiscord | <Zoom> K, thanks, seems I need to add message consuming to a thread just to kill it \:/ |
16:24:12 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3ruo |
16:24:15 | * | leehbi joined #nim |
16:27:20 | FromDiscord | <timotheecour> you're using it wrong though |
16:28:07 | FromDiscord | <aleclarson> tried with `type Pack.A = object` but got "unknown package name" |
16:28:21 | FromDiscord | <aleclarson> where Pack.nim is the filename |
16:30:07 | FromDiscord | <aleclarson> i'm not using devel branch, so that may be the problem |
16:30:40 | FromDiscord | <timotheecour> see tests/package_level_objects/ |
16:31:09 | FromDiscord | <timotheecour> it doesn't need devel, it's been there for a while. |
16:32:26 | FromDiscord | <aleclarson> does the `.nimble` file need to be in the same directory, or will it be found in parent directory? |
16:32:48 | FromDiscord | <timotheecour> parent should be ok; again, PR's very welcome to improve docs |
16:43:19 | FromDiscord | <timotheecour> sent a code paste, see https://play.nim-lang.org/#ix=3rus |
16:43:28 | FromDiscord | <timotheecour> (edit) "https://play.nim-lang.org/#ix=3rus" => "https://play.nim-lang.org/#ix=3rut" |
16:43:52 | FromDiscord | <timotheecour> (edit) "https://play.nim-lang.org/#ix=3rut" => "https://play.nim-lang.org/#ix=3ruu" |
16:45:41 | FromDiscord | <haxscramper> https://botwars.io/Language/Details/nim was linked in the tg chat, maybe someone would find it interesting |
16:45:47 | FromDiscord | <haxscramper> It has nim support |
16:48:29 | fn | <Prestige99> huh interesting |
16:58:56 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3ruA |
16:59:07 | FromDiscord | <aleclarson> (edit) "https://play.nim-lang.org/#ix=3ruA" => "https://play.nim-lang.org/#ix=3ruB" |
16:59:13 | FromDiscord | <haxscramper> common approach is to put multiple objects in single type section |
16:59:38 | FromDiscord | <aleclarson> ya i'm not a fan \:) |
16:59:44 | FromDiscord | <haxscramper> Why? |
16:59:58 | FromDiscord | <aleclarson> no logical reason, lol |
17:00:54 | FromDiscord | <haxscramper> Well, whatever, but you are trying to use experimental and probably-going-to-be-deprecated feature over recommended approach |
17:01:45 | FromDiscord | <aleclarson> you're referring to package-level objects? are you saying types within the same "type section" can reference each no problem? |
17:01:54 | FromDiscord | <aleclarson> (edit) "you're referring to package-level objects? are you saying types within the same "type section" can reference each ... no" added "other," |
17:02:05 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#type-sections |
17:02:15 | FromDiscord | <haxscramper> > Type definitions can be recursive or even mutually recursive. Mutually recursive types are only possible within a single type section. |
17:03:06 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ruD |
17:03:08 | FromDiscord | <aleclarson> kinda strange it doesn't work between type sections, but thanks for blowing my mind |
17:03:58 | FromDiscord | <haxscramper> For it to work between type sections, we would have to either implement C-like forward declarations (that's that `{.package.}` does mostly) |
17:04:21 | FromDiscord | <haxscramper> But in overwhelming majority of use cases you can save yourself trouble and just put things in `type` section |
17:04:39 | FromDiscord | <aleclarson> I'm a fan of the typescript approach, where order of types does not matter \:P |
17:04:49 | FromDiscord | <haxscramper> MAJOR pain to wrap forward-declared C types though, but that's another story |
17:05:21 | FromDiscord | <aleclarson> (edit) "does not matter" => "never matters" |
17:07:40 | fn | <ForumUpdaterBot99> New post on r/nim by RattleyCooper: Why does nim hate underscores?, see https://reddit.com/r/nim/comments/oacjbs/why_does_nim_hate_underscores/ |
17:16:37 | FromDiscord | <timotheecour> sent a long message, see http://ix.io/3ruJ |
17:17:13 | FromDiscord | <timotheecour> (edit) "http://ix.io/3ruJ" => "http://ix.io/3ruK" |
17:19:17 | * | leehbi quit (Remote host closed the connection) |
17:19:46 | * | leehbi joined #nim |
17:21:37 | FromDiscord | <aleclarson> yeah that was before i knew that type sections allowed that \:) |
17:24:47 | * | leehbi quit (Ping timeout: 268 seconds) |
19:18:06 | fn | <ForumUpdaterBot99> New thread by Niminem: How to get Name and Value from Variable for macro/template, see https://forum.nim-lang.org/t/8172 |
20:02:55 | * | PMunch joined #nim |
20:03:40 | * | SebastianM joined #nim |
20:03:50 | * | SebastianM quit (Client Quit) |
20:07:56 | * | Schnouki quit (Ping timeout: 268 seconds) |
20:18:11 | FromDiscord | <aust9n> Hi there |
20:18:30 | FromDiscord | <aust9n> I am trying to write a wrapper for the bittorrent utp library and im not sure how to do it |
20:18:38 | FromDiscord | <aust9n> If anyone can point me in the right direction, that would be great! |
20:20:32 | FromDiscord | <timotheecour> nimterop or c2nim |
20:21:50 | * | PMunch quit (Quit: leaving) |
20:39:34 | * | supakeen quit (Remote host closed the connection) |
20:39:59 | * | supakeen joined #nim |
21:02:44 | * | Schnouki joined #nim |
21:20:13 | * | Schnouki quit (Ping timeout: 246 seconds) |
21:34:54 | * | Vladar quit (Quit: Leaving) |
22:03:42 | * | Clonkk[m] joined #nim |
22:12:31 | * | Clonkk[m] quit (Quit: node-irc says goodbye) |
22:21:57 | * | Zoom[m] joined #nim |
22:21:57 | * | nixfreak_nim[m] joined #nim |
22:21:57 | * | Helios joined #nim |
22:22:27 | * | Zoom[m] quit (Write error: Connection reset by peer) |
22:22:36 | * | Helios quit (Remote host closed the connection) |
22:22:36 | * | nixfreak_nim[m] quit (Remote host closed the connection) |
22:28:44 | * | Clonkk[m] joined #nim |
22:29:22 | FromDiscord | <exelotl> old style concepts feel like a game of Baba is You https://media.discordapp.net/attachments/371759389889003532/859561201855889418/Screenshot_from_2021-06-29_23-28-35.png |
22:29:34 | * | Zoom[m] joined #nim |
22:29:34 | * | nixfreak_nim[m] joined #nim |
22:29:34 | * | Helios joined #nim |
22:36:28 | FromDiscord | <reilly> Treeform's Pixie is cool and all, but it would be nice if it was GPU-accelerated. Is there any way I could "port" it to the GPU without having to reinvent the wheel? |
22:46:31 | * | Schnouki joined #nim |
22:54:06 | * | max22- quit (Remote host closed the connection) |
23:23:38 | FromDiscord | <guzba> no, that is a huge undertaking. someday we'll have a gpu-accelerated version but for now you can cpu-render then upload as texture and gpu away to your hearts content |
23:24:53 | fn | <ForumUpdaterBot99> New question by DuckPuncher: Can I unpack `varargs` to use as individual procedure call arguments with nim?, see https://stackoverflow.com/questions/68186716/can-i-unpack-varargs-to-use-as-individual-procedure-call-arguments-with-nim |
23:25:16 | federico3 | guzba: that would make it ineffective |
23:27:07 | FromDiscord | <guzba> do you mean pixie ineffective and how so? unless you need to re-render the image every single frame which is not common, it'd be great to just rasterize once then use over and over |
23:27:20 | FromDiscord | <guzba> (edit) "common," => "for sure," |
23:27:31 | FromDiscord | <guzba> (edit) "for sure," => "often required," |
23:27:49 | FromDiscord | <guzba> for example, render some text in pixie, upload to gpu, then use that text as texture to display in game for the rest of the time |
23:33:04 | FromDiscord | <stefantalpalaru> I'm on devel and `./koch runCI` fails with `Nim/tests/test_nimscript.nims(6, 13) Error: cannot open file: stdtest/specialpaths`. Am I missing a step? |
23:33:25 | FromDiscord | <ElegantBeef> Sounds like it's missing the booted version |
23:33:51 | FromDiscord | <ElegantBeef> `./koch boot -d:release` or similar to poop out a version in `bin/` |
23:34:08 | FromDiscord | <stefantalpalaru> I even tried `. ci/funs.sh && nimInternalBuildKochAndRunCI` like in GitHub Actions. |
23:35:05 | FromDiscord | <stefantalpalaru> No, it builds the compiler just fine. The failure is when it tries to do `nim e tests/test_nimscript.nims` |
23:36:23 | FromDiscord | <stefantalpalaru> Wait, I didn't set the PATH. |
23:36:25 | * | stkrdknmibalz joined #nim |
23:36:42 | FromDiscord | <reilly> federico3: what guzba is describing is exactly what Fidget does, and unless Treeform is lying to me, Fidget is fast enough for games. It's not as fast as doing everything on the GPU, though; it's more of a halfway-house. |
23:38:36 | FromDiscord | <reilly> What I'm looking after is to use Pixie for games. The reason I don't want to use Fidget is because Fidget doesn't let me use a lot of Pixie's functionality, and for making games, I want those features. (Stuff like masking, gradients, tiling, blurs, glows, etc.) |
23:38:42 | FromDiscord | <reilly> (edit) "after" => "for" |
23:40:38 | FromDiscord | <timotheecour> In reply to @stefantalpalaru "I'm on devel and": `./koch --nim:bin/nim runCI` |
23:41:01 | FromDiscord | <stefantalpalaru> Yeah, it was the PATH. |
23:41:22 | FromDiscord | <timotheecour> you don't need to set PATH though with `--nim` |
23:41:28 | FromDiscord | <stefantalpalaru> Cool. |
23:45:00 | FromDiscord | <timotheecour> (which allows passing custom binary names, eg: `--nim:bin/nim_tmp`) |