00:04:57 | * | lritter quit (Quit: Leaving) |
00:13:04 | FromGitter | <sealmove> https://play.nim-lang.org/#ix=2rzp |
00:19:01 | FromGitter | <sealmove> static context, hmm ok I get it now, it works :) |
00:22:35 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2rzr |
00:22:39 | FromGitter | <ynfle> Oh ok |
00:32:06 | * | Shucks quit (Quit: Leaving) |
00:32:37 | * | xet7 joined #nim |
00:42:14 | * | Cthalupa quit (Ping timeout: 240 seconds) |
00:48:23 | * | Cthalupa joined #nim |
00:51:36 | * | vicfred_ quit (Quit: Leaving) |
00:51:56 | * | vicfred joined #nim |
00:58:54 | * | rockcavera quit (Read error: Connection reset by peer) |
00:59:21 | * | rockcavera joined #nim |
00:59:39 | FromDiscord | <Yardanico> If someone's curious how my Nim looked like when I first started learning it - https://github.com/Yardanico/nickel/tree/76414b216f3ad7e290e478654f9bae17ea093b3b |
00:59:46 | FromDiscord | <Yardanico> apparently I used explicit "return"s too 😄 |
01:01:16 | * | oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
01:05:56 | * | audiophile joined #nim |
01:18:25 | * | RaycatWhoDat left #nim ("ERC (IRC client for Emacs 26.3)") |
01:22:33 | FromDiscord | <KingDarBoja> Yesssss |
01:29:35 | * | chemist69_ joined #nim |
01:32:54 | * | chemist69 quit (Ping timeout: 256 seconds) |
01:33:50 | * | endragor joined #nim |
01:35:39 | FromDiscord | <Yardanico> btw our parsetoml lib passes most toml tests (found a repo with a lot of them), but not all |
01:36:37 | FromDiscord | <Yardanico> well I didn't verify that it _correctly_ parsed, just that it *parsed* |
01:36:39 | FromDiscord | <Yardanico> or errored for invalid files |
01:41:00 | FromDiscord | <Yardanico> no toml why |
01:41:04 | FromDiscord | <Yardanico> "Allow heterogenous values in arrays." 1.0.0-rc1 |
01:42:36 | FromDiscord | <Varriount> Hm, Nim doesn't appear to have append-or-create as a filemode |
01:42:40 | FromDiscord | <Yardanico> well actually with parsetoml it should be easy to add support to that |
01:42:43 | FromDiscord | <Yardanico> @Varriount it does? |
01:42:46 | FromDiscord | <Yardanico> fmAppend does that |
01:42:57 | FromDiscord | <Rika> time to make another box type (TomlNode perhaps lol) |
01:43:07 | FromDiscord | <Yardanico> just try it yourself if you don't believe me 😛 |
01:43:12 | FromDiscord | <Yardanico> @Rika nah I was too fast |
01:43:19 | FromDiscord | <Yardanico> parsetoml already boxes all types including arrays |
01:43:23 | FromDiscord | <Rika> i see |
01:43:28 | FromDiscord | <Yardanico> so it should just be a matter of relaxing rules |
01:43:29 | FromDiscord | <Rika> well then theres no issue |
01:47:02 | * | fredrikhr quit (Ping timeout: 272 seconds) |
01:47:03 | FromDiscord | <Yardanico> I literally commented 3 lines in the parser and now parsetoml can handle mixed-type arrays lol |
01:52:55 | FromDiscord | <Zachary Carter> Hit another blocker with my project - ↵```/Users/zacharycarter/.cache/nim/junkers_d/@mjunkers.nim.cpp:1761:22: error: cannot initialize a variable of type 'struct rizz_shader *' with an rvalue of type↵ 'const rizz_shader *'``` |
01:53:00 | * | Tlanger joined #nim |
01:53:06 | FromDiscord | <Zachary Carter> https://github.com/septag/rizz/blob/886295aef6b5cfa8b2b2a55ae25cfc5a9f063a1a/src/rizz/graphics.c#L1738 |
01:54:12 | shashlick | That might be a nimterop issue |
01:54:25 | leorize | nim code please? |
01:54:41 | FromDiscord | <Zachary Carter> the code that's generated by nimterop? |
01:55:08 | FromDiscord | <Zachary Carter> `shader_get*: proc (shader_asset: rizz_asset): ptr rizz_shader {.cdecl.}` |
01:55:21 | leorize | how you used it to be exact |
01:55:25 | * | Tongir quit (Ping timeout: 264 seconds) |
01:55:45 | shashlick | Well maybe not |
01:55:46 | FromDiscord | <Zachary Carter> ` let shade = (theGfx.shader_get(gState.boneShader).shd` |
01:56:04 | FromDiscord | <Zachary Carter> oops sorry |
01:56:08 | shashlick | I was thinking https://github.com/nimterop/nimterop/issues/226 but that's different |
01:56:10 | disbot | ➥ Using `ast2` generates `importc` calls for any constants defined in headers which fails when using `dylib="dynlibFile"` ; snippet at 12https://play.nim-lang.org/#ix=2rzL |
01:56:11 | FromDiscord | <Zachary Carter> let shade = theGfx.shader_get(gState.boneShader).shd |
01:56:44 | leorize | nim don't understand C/C++ const pointers |
01:57:06 | FromDiscord | <Zachary Carter> Yeah - I had to fix something similar in my ozz bindings to C++ |
01:57:29 | FromDiscord | <Zachary Carter> but I'm not sure how to fix this one - maybe I'll just skip the symbol and define the object myself |
01:57:29 | leorize | `reinterpret_cast` I guess |
01:58:18 | leorize | can you see what's the C++ code generated by Nim? |
01:58:25 | FromDiscord | <Zachary Carter> yeah |
01:58:32 | leorize | can I see? |
01:58:33 | FromDiscord | <Zachary Carter> well I can at least see the invocation |
01:58:41 | leorize | yep that should be enough |
01:59:07 | FromDiscord | <Zachary Carter> `struct rizz_shader* T59_ = (*theGfx__NsFRuc7gJ63QiZwCUEJyXg).shader_get(gState__R6OSvMNU9cpgjx0L9aUPnGBA.boneShader);` |
01:59:42 | leorize | yea that's your problem |
02:01:27 | leorize | Nim don't have the concept of immutable pointers... |
02:02:17 | leorize | this is C code wrapped by nimterop then you use Nim's C++ codegen? |
02:02:21 | FromDiscord | <Zachary Carter> yeah |
02:02:22 | FromDiscord | <Zachary Carter> :/ |
02:02:25 | FromDiscord | <Zachary Carter> going to be fun to try to fix |
02:02:36 | leorize | not that hard actually |
02:03:06 | FromDiscord | <Zachary Carter> alias the type and cOverride the proc? |
02:04:18 | leorize | nah, you'll have to override the const qualifier via casting |
02:04:31 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2rzN |
02:04:31 | leorize | generating (struct rizz_shader*)(expr) |
02:05:21 | leorize | that works too I guess |
02:05:33 | FromDiscord | <Zachary Carter> let me try casting first - that's much simpler |
02:05:38 | shashlick | is it a nimterop wrapping bug? |
02:05:48 | leorize | yes and no :P |
02:06:36 | leorize | you ignored the const qualifier but even if you don't ignore it you can't represent it in Nim |
02:06:51 | leorize | because we don't have the concept of an immutable pointer |
02:07:56 | shashlick | ya const is not really respected yet |
02:08:01 | disruptek | rude. |
02:08:14 | shashlick | but at least we could skip wrapping it or something |
02:08:20 | FromDiscord | <Yardanico> ok fixed the "Leading zeroes in exponent parts of floats are permitted." part of 1.0.0-rc1 |
02:08:27 | FromDiscord | <Yardanico> the fix isn't the cleanest one, but the most minimal at least |
02:08:40 | FromDiscord | <Yardanico> so "-0e02" is correctly parsed as -0.0 |
02:08:52 | FromDiscord | <Yardanico> (and yes that's a valid float, even in Nim itself) |
02:09:16 | shashlick | @leorize - did you have any feedback on the candidates branch of lazylib? |
02:09:30 | leorize | I haven't looked at it unfortunately |
02:09:40 | leorize | knees deep in an ancient C++ codebase rn |
02:10:34 | FromDiscord | <Yardanico> ok now the scariest contender |
02:10:35 | FromDiscord | <Yardanico> str = ''''That,' she said, 'is still pointless.'''' |
02:10:45 | FromDiscord | <Yardanico> parsetoml doesn't parse it correctly for some reason |
02:10:58 | FromDiscord | <Yardanico> ah I know why probably |
02:11:28 | FromDiscord | <Yardanico> it fails at the end, probably because it parses first 3 delimiters and then is surprised about last ' |
02:12:31 | shashlick | leorize - okay will bother you again later |
02:13:12 | FromDiscord | <Yardanico> wait do I need backtracking for this? |
02:13:25 | FromDiscord | <Yardanico> or I just can't think straight rn |
02:13:34 | FromDiscord | <Yardanico> to correctly implement parsing of stuff like data = ''''a'''' |
02:13:47 | FromDiscord | <Yardanico> where ''' (triple single quote) is the opening/closing of a string |
02:13:50 | FromDiscord | <Yardanico> and string itself is 'a' |
02:14:03 | leorize | you don't need backtracking |
02:14:11 | leorize | you just need to copy Nim's parsing behavior |
02:14:17 | FromDiscord | <Yardanico> sounds simple 😄 |
02:14:28 | FromDiscord | <Yardanico> but parsetoml is ~1.4k cloc of Nim |
02:14:30 | FromDiscord | <Yardanico> fully custom |
02:14:37 | FromDiscord | <Yardanico> doesn't even use lexbase 😛 |
02:14:47 | leorize | well the lexer code should still give you an idea for how to do it :P |
02:15:02 | FromDiscord | <Yardanico> and right now it handles delimiters by simply checking if 3 characters in a row are the delimiter ones |
02:15:24 | shashlick | time to make nimterop wrappers even more standalone, people love islands |
02:17:47 | leorize | Yardanico you can just count the continous delimiters until you reach the end :p |
02:17:59 | leorize | then if count >= 3 that's the end |
02:18:22 | leorize | not sure how Nim itself does this, but I would assume it's something similar |
02:18:27 | FromDiscord | <Yardanico> yeah I had a similar idea |
02:18:30 | * | oprypin quit (Ping timeout: 256 seconds) |
02:18:42 | * | FromGitter quit (Ping timeout: 272 seconds) |
02:18:56 | leorize | !eval echo """"That," she said, "is still pointless."""" |
02:18:59 | NimBot | "That," she said, "is still pointless." |
02:19:07 | leorize | yep it works as expected |
02:19:21 | FromDiscord | <Yardanico> well I expect it to be 😛 |
02:19:28 | FromDiscord | <Yardanico> nim's lexer is pretty stable I think |
02:19:48 | leorize | I think I do support that case in my toml lexer |
02:19:51 | leorize | actually maybe not :P |
02:20:04 | FromDiscord | <Yardanico> "Multi-line literal strings are surrounded by three single quotes on each side and allow newlines. " "You can write 1 or 2 single quotes anywhere within a multi-line literal string, but sequences of three or more single quotes are not permitted." |
02:22:27 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:24:07 | * | muffindrake joined #nim |
02:25:45 | * | FromGitter joined #nim |
02:25:55 | * | oprypin joined #nim |
02:26:42 | FromDiscord | <impbox> hmm maybe closing quotes should have to match number of opening quotes... so """"" has to match """"", that lets you quote """ |
02:26:55 | FromDiscord | <Yardanico> well not really |
02:27:05 | FromDiscord | <Yardanico> TOML only allows for single-character opening/closing quotes |
02:27:07 | FromDiscord | <Yardanico> or triple-character |
02:27:15 | FromDiscord | <Yardanico> either ', ", ''' or """ |
02:27:17 | FromDiscord | <Yardanico> no '' or "" |
02:27:37 | FromDiscord | <impbox> sorry I was referring to nim not toml |
02:29:43 | FromDiscord | <Yardanico> I think I got it |
02:29:48 | FromDiscord | <Yardanico> ah, almost |
02:30:19 | leorize | @impbox that'd limit their usage |
02:30:34 | leorize | all triple-quoted literals are raw strings |
02:31:38 | * | NimBot joined #nim |
02:37:48 | * | nikita_ joined #nim |
02:39:56 | FromGitter | <ynfle> Is there any way to use `strutils.escape` and have it mimic having the string in triple double-quotes if it's coming from a variable? I don't want it to escape, for example, newlines etc. |
02:40:52 | * | nikita` quit (Ping timeout: 272 seconds) |
02:41:12 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2rzR |
02:44:56 | leorize | @ynfle so basically you want it to be printed in Nim's raw format? |
02:44:58 | leorize | but why? |
02:45:29 | FromGitter | <ynfle> I want to write json but I don't want to have to import json |
02:45:40 | FromGitter | <ynfle> Wait to nim remove all the unused functions? |
02:45:48 | FromGitter | <ynfle> *procs |
02:45:54 | leorize | yes nim do dead code elimination |
02:46:19 | leorize | if you are super wary of size then there's also packedjson |
02:46:48 | * | justsomeguy left #nim (#nim) |
02:48:36 | FromGitter | <ynfle> Thx |
02:48:51 | FromGitter | <ynfle> But is there a way to convert to raw string? |
02:49:16 | FromDiscord | <Yardanico> @ynfle generally nim follows a rule that all optimizations in Nim itself are always enabled |
02:49:23 | FromDiscord | <Yardanico> so you don't get different results with -d:debug or -d:danger |
02:49:37 | FromDiscord | <Yardanico> that's true for most nim (implemented in the nim compiler itself) optimizations I think |
02:49:51 | leorize | true for all actually |
02:50:03 | FromDiscord | <Yardanico> @leorize well I think I did it, didn't verify that the files are correctly parsed, but they are parsed without errors |
02:50:07 | FromDiscord | <Yardanico> although my code looks like a hack |
02:50:23 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rzT |
02:50:23 | leorize | !repo alaviss/toml |
02:50:24 | disbot | https://github.com/alaviss/toml -- 9toml: 11Nim TOML parser 15 0⭐ 0🍴 |
02:50:29 | FromDiscord | <Yardanico> woah |
02:50:34 | leorize | ^ feel free to take that lexer |
02:50:40 | leorize | I wrote it when I first learned Nim |
02:50:55 | FromDiscord | <Yardanico> isn't it easier to have lexer/parser together for a thing like TOML? |
02:51:23 | leorize | or you can have a lexer + state machine |
02:51:32 | leorize | then you have the ultimate flexibility |
02:52:29 | leorize | idk to be honest, I wrote it that way because I saw how parsejson and parsecfg works |
02:53:12 | FromDiscord | <Yardanico> well yeah but for now seems like this multiline thing is (maybe) solved |
02:53:32 | FromDiscord | <Yardanico> I just feel it's a bit dirty to push last character back into the parser 😛 |
02:54:28 | FromDiscord | <Yardanico> I certainly will look into lexbase and your lexer 😛 |
02:54:36 | leorize | have you tried to build a toml parser out of npeg? lol |
02:54:44 | FromDiscord | <Varriount> Yardanico: Why not use NPeg? |
02:54:59 | FromDiscord | <Varriount> Oh, leorize beat me too it. |
02:55:02 | FromDiscord | <Yardanico> @Varriount well I can |
02:55:05 | FromDiscord | <Yardanico> I have some experience with npeg |
02:55:09 | FromDiscord | <Yardanico> but isn't it kinda slower? 😛 |
02:55:35 | leorize | my lexer can't handle the string problem, but it shouldn't be too hard to fix |
02:55:57 | FromDiscord | <Varriount> The only downside to NPeg right now is that it doesn't support streaming input automatically (you can still design your grammar for streaming through), |
02:56:00 | leorize | Yardanico: I'm not sure if npeg is slower than the abomination that's parsetoml :P |
02:56:13 | FromDiscord | <Yardanico> why so rude 😦 |
02:56:28 | FromDiscord | <Varriount> It's probably slower than hand-optimized parsers, but then, so is C to hand-optimized assembly. |
02:56:28 | FromDiscord | <Yardanico> but yeah toml has a abnf grammar in spec |
02:56:36 | FromDiscord | <Yardanico> if shouldn't be too hard to translate to NPeg |
02:56:49 | leorize | in fact I wrote that lexer because I hated parsetoml when I first looked at it |
02:56:54 | leorize | maybe it's better now, not sure |
02:57:10 | FromDiscord | <Rika> why use toml if you can use a different format /s |
02:57:17 | FromDiscord | <Yardanico> @Rika because toml is pretty nice |
02:57:32 | leorize | toml is basically standardized ini |
02:57:34 | FromDiscord | <Yardanico> Looks more similar to INI |
02:57:34 | FromDiscord | <Yardanico> yeah |
02:57:40 | FromDiscord | <Rika> is /s no longer what i think means |
02:57:41 | FromDiscord | <Rika> it* means |
02:57:46 | leorize | but then they have to make it work like json, which imo was a terrible move |
02:57:48 | FromDiscord | <Yardanico> it is, but why would you ask anyway 😛 |
02:57:54 | FromDiscord | <Varriount> I'd gladly pay @Zevv money to work on better streaming support for NPeg, (although the problem is more philosophical than technical) |
02:57:57 | FromDiscord | <Rika> as a joke |
02:58:23 | FromDiscord | <Varriount> leorize: I just want another data language that supports tags like YAML |
02:58:36 | FromDiscord | <Rika> cbor |
02:58:40 | FromDiscord | <Varriount> And references, for deduplication. |
02:58:43 | FromDiscord | <Rika> (lol i'm not super serious |
02:58:53 | FromDiscord | <Rika> but i am working on cbor |
02:59:05 | FromDiscord | <Rika> if you want references, maybe smile |
02:59:24 | FromDiscord | <Rika> but i dont get why you'd want that tbh, since you can just compress the data with zlib or something |
02:59:27 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:59:53 | leorize | I think they wanted a configuration format for human |
02:59:54 | FromDiscord | <Rika> the "binary representation" part is only so that it's easier to process, imo, not so that it's smaller to store |
02:59:56 | FromDiscord | <Rika> ah |
02:59:58 | FromDiscord | <Varriount> @Rika it's not for size, but readability. |
02:59:58 | FromDiscord | <Rika> i see |
03:00:14 | FromDiscord | <Rika> i see |
03:00:25 | FromDiscord | <Varriount> For example, when you have a configuration file with multiple sections that share almost the same data. |
03:00:38 | FromDiscord | <Rika> i'm too focused on my particular usecase (only machine-processed data) |
03:01:00 | FromDiscord | <Rika> we're creeping towards scripting language as a configuration language territory here i feel 😛 |
03:01:07 | FromDiscord | <Varriount> Probably. |
03:02:11 | leorize | someone did make a scripting but not really configuration language |
03:02:14 | leorize | it didn't fly iirc |
03:03:18 | * | leorize quit (Quit: WeeChat 2.8) |
03:04:08 | FromDiscord | <Yardanico> dhall |
03:04:20 | FromDiscord | <Yardanico> oh, maybe you mean something different |
03:05:38 | * | leorize joined #nim |
03:07:35 | leorize[m] | yea, dhall |
03:07:55 | leorize[m] | why didn't everyone just improve ini instead... |
03:08:35 | FromDiscord | <Rika> cuz windows and windows bad /s |
03:10:07 | FromDiscord | <Yardanico> too much /ss |
03:10:45 | FromDiscord | <Rika> haha okay will stop |
03:11:16 | FromDiscord | <Yardanico> jk |
03:11:18 | FromDiscord | <Yardanico> you can jok |
03:11:21 | FromDiscord | <Yardanico> almost everyone is sleeping anyway |
03:12:40 | FromDiscord | <impbox> lua? |
03:13:21 | FromDiscord | <Yardanico> js! |
03:13:37 | FromDiscord | <impbox> hmm is js easy to use as a config language? |
03:13:37 | FromDiscord | <Yardanico> @<@&371760042338287618>s are asleep, post JS questions@@ |
03:13:39 | FromDiscord | <Yardanico> oh wait |
03:13:47 | FromDiscord | <Yardanico> @impbox nah I was joking |
03:13:55 | FromDiscord | <Yardanico> but JSON can be easy to use if you don't mind not having comments 😛 |
03:14:11 | FromDiscord | <Yardanico> for simple configurations json is quite easy to use |
03:14:14 | FromDiscord | <Rika> did you just ping admins lmao |
03:14:15 | leorize | I'm pretty sure that's not how the message is supposed to look like Yardanico ^ |
03:14:22 | FromDiscord | <impbox> json is not really programming though, just declaration |
03:14:35 | * | audiophile quit (Ping timeout: 240 seconds) |
03:14:36 | FromDiscord | <Yardanico> @leorize how does it look on IRC? I don't think any good |
03:14:37 | FromDiscord | <impbox> you can't do conditionals or loops etc or read files |
03:14:43 | Yardanico | oh I see |
03:14:47 | Yardanico | I don't parse role pings |
03:15:02 | Yardanico | dumb discord doesn't send proper text |
03:15:11 | leorize | if you want ini with reference, Nim's parsecfg is a contender |
03:15:12 | Yardanico | it sends an ID of the role instead, and you must get a text representation of it yourself |
03:16:46 | FromDiscord | <impbox> is ini standardised now? |
03:16:54 | leorize | e |
03:16:58 | leorize | nope |
03:22:56 | * | krux02_ quit (Remote host closed the connection) |
03:22:57 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2rzZ |
03:23:49 | FromDiscord | <Zachary Carter> the cpp for that line looks like - `(*theGfx__NsFRuc7gJ63QiZwCUEJyXg).shader_get = reinterpret_cast<tyProc__rzrAFk9aKPYnlD8SFThcbFA>((*theGfx__NsFRuc7gJ63QiZwCUEJyXg).shader_get);` |
03:24:16 | FromDiscord | <Zachary Carter> `typedef N_CDECL_PTR(struct rizz_shader*, tyProc__rzrAFk9aKPYnlD8SFThcbFA) (rizz_asset shader_asset);` |
03:24:20 | leorize | have you tried... `cast[ptr rizz_shader](call-goes here)` |
03:24:40 | FromDiscord | <Zachary Carter> I think so - but let me try again |
03:25:09 | leorize | if that doesn't work then rope reinterpret_cast over it |
03:27:22 | FromDiscord | <Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=2rA1 |
03:27:28 | FromDiscord | <Zachary Carter> I'll try the second suggestion now |
03:28:58 | leorize | there's also this stupid lifehack: `(ptr rizz_shader)(pointer(theGfx.shader_get(gState.boneShader))).shd` |
03:29:53 | FromDiscord | <Zachary Carter> thanks - if nothing else works I'll resort to that |
03:30:44 | leorize | well if reinterpret_cast doesn't work I don't think anything will lol |
03:32:09 | leorize | I'm actually having a feeling that reinterpret_cast wouldn't work because Nim will try to use a temp var to store the result of that function call before passing it into reinterpret_cast |
03:32:28 | leorize | if that's the case then the lifehack might actually work lol |
03:32:45 | FromDiscord | <KingDarBoja> Windows doesnt suck 🙈 |
03:35:53 | * | debased quit (Quit: WeeChat 2.8) |
03:40:48 | FromDiscord | <Yardanico> you forgot the /s /s |
03:41:46 | FromDiscord | <Elegant Beef> I mean the fact i went to play a game today, and had it open a "Welcom to Edge" window means it does |
03:41:53 | FromDiscord | <Elegant Beef> (edit) '"Welcom' => '"Welcome' |
03:43:42 | FromDiscord | <KingDarBoja> ¯\_(ツ)_/¯ |
03:44:03 | FromDiscord | <Zachary Carter> leorize: yeah that's exactly what's happening |
03:44:09 | FromDiscord | <Zachary Carter> the temp var is screwing everything up |
03:45:05 | leorize | if the lifehack doesn't work, your only way out would be to use nimterop's no headers mode |
03:45:17 | FromDiscord | <Zachary Carter> bleh |
03:45:21 | FromDiscord | <Zachary Carter> that will break everything else 😛 |
03:45:32 | leorize | it can be done per-wrapper iirc |
03:45:57 | FromDiscord | <Zachary Carter> I'll have to see - I know shashlick made a bunch of fixes for me a couple weeks ago that only worked in header mode |
03:47:15 | leorize | the hack didn't work either? :P |
03:47:20 | FromDiscord | <Zachary Carter> yeah the temp var still screws up the life hack |
03:47:34 | FromDiscord | <Zachary Carter> ```↵struct rizz_shader* T60_ = (*theGfx__NsFRuc7gJ63QiZwCUEJyXg).shader_get(gState__R6OSvMNU9cpgjx0L9aUPnGBA.boneShader);↵pipDesc.shader = (*((struct rizz_shader*) (((void*) (T60_))))).shd;↵``` |
03:49:11 | leorize | `cast[proc(shd: rizz_asset): ptr rizz_shader {.cdecl.}](theGfx.shader_get)(gState.boneShader).shd` |
03:49:26 | leorize | the ultimate hack :P |
03:49:54 | leorize | I hate this but it got a chance of actually working |
03:50:44 | FromDiscord | <Zachary Carter> lol yup compiled |
03:50:52 | leorize | if that works then `cast[typeof theGfx.shader_get](theGfx.shader_get)` might work as well :P |
03:51:09 | leorize | lol |
03:52:06 | FromDiscord | <Zachary Carter> thanks again - it's ugly af but at least it works 🙂 |
03:52:41 | FromDiscord | <Zachary Carter> (edit) removed 'again' |
03:52:52 | FromDiscord | <Zachary Carter> one step closer to skeletal animation 😄 |
03:53:37 | * | vicfred_ joined #nim |
03:53:45 | leorize | yw :) |
03:54:47 | * | vicfred quit (Remote host closed the connection) |
03:54:48 | * | screens__ quit (Quit: No Ping reply in 90 seconds.) |
03:54:48 | * | vqrs quit (Ping timeout: 256 seconds) |
03:57:07 | * | screens_ joined #nim |
03:57:16 | * | vqrs joined #nim |
03:59:59 | * | vicfred_ quit (Quit: Leaving) |
04:05:30 | * | rockcavera quit (Remote host closed the connection) |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:39 | * | supakeen joined #nim |
04:29:05 | FromDiscord | <malfong> ```↵type Flags = set[ImGuiWindowFlags] # Error: set is too large↵``` |
04:31:24 | FromDiscord | <malfong> sent a code paste, see https://play.nim-lang.org/#ix=2rA7 |
04:35:26 | FromDiscord | <Rika> `ImGuiWindowFlags` should be "which bit is set", not "the mask of the flag"↵so not `1,2,4,8,16` but `1,2,3,4,5` |
04:36:02 | FromDiscord | <Rika> so in this case you cant do this w/o making another enum i assume... |
04:40:01 | * | arecaceae quit (Remote host closed the connection) |
04:40:25 | FromDiscord | <malfong> oh, I thought so - - thanks😫 |
04:41:19 | * | arecaceae joined #nim |
04:53:54 | FromDiscord | <Rika> i feel dumb; how do i get how many entries are in a tuple? |
04:54:05 | FromDiscord | <impbox> `.len`? |
04:54:19 | FromDiscord | <Rika> nope |
04:54:36 | ForumUpdaterBot | New thread by Jasonfi: Sort a table by value, see https://forum.nim-lang.org/t/6542 |
04:55:34 | FromDiscord | <impbox> @Rika wow, i was sure that was a thing. interesting |
04:55:57 | FromGitter | <ynfle> @Rika, https://nim-lang.org/docs/typetraits.html#tupleLen.t |
04:56:23 | FromDiscord | <Rika> thanks |
04:56:31 | FromDiscord | <Rika> why's it delegated to typetraits though? |
04:56:49 | FromDiscord | <impbox> probably because you shouldn't generally care about the length of a tuple |
04:56:54 | FromDiscord | <impbox> you care about specific fields |
04:57:30 | FromDiscord | <impbox> why do you need the number of entries in a tuple? |
04:57:46 | FromDiscord | <Rika> because i'm converting it to a table w/ boxed values |
04:57:58 | FromDiscord | <Rika> and i dont want to "overallocate" |
04:58:12 | FromDiscord | <impbox> mmmkay |
04:58:13 | FromGitter | <ynfle> Just allocate 2 then |
04:58:34 | FromDiscord | <Rika> eh if the info's there then why not use it |
04:58:49 | FromGitter | <ynfle> I think it's in typetraits because tuple[int, int] is a different type to tuple[int, int, int] |
04:59:42 | FromDiscord | <Rika> eh, the "optimization" did barely anything anyway so i'm still hunting for what's taking up 20kb of memory (it says its a Table but i dont know which) |
05:00:10 | FromDiscord | <Rika> i mean which amongst the tables i am using |
05:00:13 | FromDiscord | <Yardanico> refc is a deferred refcounting GC though |
05:00:17 | FromDiscord | <Rika> yes i am already using the heap dump |
05:00:22 | FromDiscord | <Yardanico> it might not free some GC'd type instantly |
05:00:28 | * | Guest14468 quit (Ping timeout: 246 seconds) |
05:00:38 | FromDiscord | <Yardanico> try with arc 😛 |
05:01:11 | * | Vladar joined #nim |
05:01:12 | FromDiscord | <Rika> i already did but i cant use heapdump w/ it i think? |
05:01:25 | FromDiscord | <Yardanico> yeah you can't I think, but you can measure RSS right? |
05:01:30 | FromDiscord | <Yardanico> with refc and with arc |
05:01:33 | FromDiscord | <Yardanico> or maximum peak memory |
05:01:35 | * | dadada joined #nim |
05:01:38 | FromDiscord | <Rika> ah yes |
05:01:53 | FromDiscord | <Yardanico> arc/orc in most cases should use less memory than refc |
05:01:59 | * | dadada is now known as Guest29868 |
05:02:10 | FromDiscord | <Rika> same total mem it seems |
05:02:10 | FromDiscord | <Yardanico> even for simple kostay benchmarks (e.g. base64 benchmark) arc uses 2.6mb compared to 8mb with refc |
05:02:12 | FromDiscord | <Yardanico> (peak memory) |
05:02:17 | FromDiscord | <Yardanico> that's a 3.5x difference |
05:02:27 | FromDiscord | <Yardanico> (edit) 'kostay benchmarks' => 'kostya/benchmarks' |
05:02:58 | FromDiscord | <Yardanico> well if you're not on latest devel the savings might be not so big |
05:02:58 | FromDiscord | <Rika> the table thing i did helped, removed 10kb from usage |
05:03:10 | FromDiscord | <Rika> i cant use devel because nimyaml doesnt like it |
05:03:12 | FromDiscord | <Rika> eh |
05:03:12 | FromDiscord | <Yardanico> because on devel there is scoped destructor thing |
05:03:16 | FromDiscord | <Rika> well i can always comment that |
05:03:22 | FromDiscord | <Rika> im not using nimyaml anyway |
05:03:25 | FromDiscord | <Rika> okay ill test devel then |
05:03:36 | FromDiscord | <Yardanico> well although there's currently a regression because of scoped destructors 😛 |
05:04:11 | FromDiscord | <Yardanico> see e.g https://github.com/nim-lang/Nim/pull/14964 (my testcase https://gist.github.com/Yardanico/d654e8be96ade03ce2fcc18c56ea0108) and https://github.com/nim-lang/Nim/issues/14968 |
05:04:13 | disbot | ➥ [ARC] segmentation fault with `now().utc` ; snippet at 12https://play.nim-lang.org/#ix=2rAa |
05:04:33 | FromDiscord | <Yardanico> it's because of using an implicit return 😄 |
05:05:04 | FromDiscord | <Yardanico> but really the point with scoped destructors is that everything which makes a new scope destroys all variables in that scope after it |
05:05:08 | FromDiscord | <Yardanico> not at procedure-level |
05:05:33 | FromDiscord | <Yardanico> e.g. if you put some string stuff in a "block: ", when execution of code in that block ends, all destructors for variables inside of it will be called |
05:06:17 | FromDiscord | <Rika> nice |
05:06:21 | FromDiscord | <Rika> thats real nice |
05:07:22 | FromDiscord | <Yardanico> just waiting for https://github.com/nim-lang/Nim/pull/14964 and https://github.com/nim-lang/Nim/pull/14962 to be done and merged 😛 |
05:07:24 | disbot | ➥ WIP: An optimizer for ARC |
05:13:16 | * | narimiran joined #nim |
05:20:41 | * | maier joined #nim |
05:31:35 | FromGitter | <Knaque> This is a bit of an unusual question, but I'm a bit curious... Is there any Nim package that allows for control over the mouse? i.e. clicks, movement, etc. |
06:12:16 | FromDiscord | <Varriount> Knaque: are you still there? |
06:20:58 | FromDiscord | <Varriount> @Knaque |
06:30:54 | FromGitter | <Knaque> Yep. |
06:33:30 | FromGitter | <Knaque> I mean, I'm here if you still are. Was about to sign off for the night, but I'll wait a few minutes. |
06:38:51 | * | solitudesf joined #nim |
06:42:02 | * | charmander quit (Quit: WeeChat 2.8) |
06:46:54 | FromDiscord | <reilly> Tell you what, @Varriount, just send it to me via Discord when you see this 😉 |
06:55:21 | * | solitudesf- joined #nim |
06:57:47 | * | solitudesf quit (Ping timeout: 240 seconds) |
07:09:49 | * | russellb joined #nim |
07:10:24 | * | russellb is now known as ruste |
07:11:52 | * | ruste quit (Client Quit) |
07:50:35 | * | Guest29868 quit (Ping timeout: 240 seconds) |
07:57:55 | * | dadada joined #nim |
07:58:18 | * | dadada is now known as Guest55294 |
08:00:02 | * | oddp joined #nim |
08:40:16 | * | fredrikhr joined #nim |
08:50:48 | FromDiscord | <Clyybber> Araq: Hi, in case you missed my answer yesterday: The template can't be turned into a proc because of parameter captures |
08:56:46 | * | Shucks joined #nim |
09:11:49 | Araq | parameter captures? |
09:16:38 | FromDiscord | <Clyybber> yeah, like s and c |
09:16:52 | FromDiscord | <Clyybber> I can't pass them to the proc because they are var params |
09:30:29 | Araq | that means the code is too complex |
09:31:00 | Araq | can't you find a simpler solution? the one other template that remains proved to be difficult to refactor |
09:31:04 | Araq | in fact I gave up on it |
09:36:57 | * | krux02 joined #nim |
09:39:42 | FromGitter | <gogolxdong> Anyone got a xlsx reader? |
09:49:36 | Araq | there was a Nimble package for it based on COM iirc |
09:49:57 | Araq | Clyybber: so. it turns out I don't understand cursors all that well |
09:50:09 | Araq | can you move data out of a cursor? |
09:50:22 | FromDiscord | <Clyybber> I dont think so |
09:50:46 | FromDiscord | <Clyybber> Since they are just views it would modifiy their origin |
09:51:06 | Araq | proc p(root: Node): Node = |
09:51:06 | Araq | var x {.cursor.} = root |
09:51:06 | Araq | result = x |
09:51:18 | Araq | ^ I claim this is valid |
09:51:37 | FromDiscord | <Clyybber> The template is the simplest solution until escape analysis improves |
09:51:51 | FromDiscord | <Clyybber> Araq: I think its valid |
09:52:05 | FromDiscord | <Clyybber> but only if root is deeply immutable |
09:52:46 | Araq | immutability is irrelevant, I wonder about the RC ops |
09:53:04 | FromDiscord | <Clyybber> it can be moved here |
09:53:16 | FromDiscord | <Clyybber> I think |
09:53:28 | Araq | https://github.com/nim-lang/Nim/pull/14962/files#diff-fb6fdacdba17344fa52ce6ed542efcf6R20 |
09:53:29 | disbot | ➥ WIP: An optimizer for ARC |
09:53:39 | Araq | is how to write your tests in a more robust fashion |
09:54:11 | * | arecaceae quit (Ping timeout: 240 seconds) |
09:56:10 | Araq | so 'x' doesn't own a refcount yet we can move from it? how does that work? does it work? |
09:57:05 | FromDiscord | <Clyybber> outliving. If it doesn't outlive it its fine |
09:57:58 | FromDiscord | <Clyybber> right? |
10:01:35 | Araq | I think I'm wrong and it's invalid |
10:01:57 | * | matti quit (Ping timeout: 244 seconds) |
10:02:05 | * | tyler569 quit (Ping timeout: 246 seconds) |
10:02:12 | Araq | when you later on do let y = p() we move it into y, p() owns the ref |
10:02:23 | * | lain quit (Ping timeout: 244 seconds) |
10:03:00 | Araq | a move doesn't incRef so we miss an RC op |
10:03:16 | * | tyler569 joined #nim |
10:03:20 | * | lain joined #nim |
10:03:34 | * | matti joined #nim |
10:03:37 | * | Zoom[m] quit (Ping timeout: 260 seconds) |
10:03:37 | * | Northstrider[m] quit (Ping timeout: 260 seconds) |
10:03:48 | * | Northstrider[m] joined #nim |
10:03:53 | Araq | maybe I should enable .cursor only for non-refs for now, subtle stuff |
10:04:03 | Araq | pointers suck :-) |
10:04:24 | * | Zoom[m] joined #nim |
10:04:49 | FromDiscord | <Clyybber> hmm, but p doesn't store its arg anywhere |
10:05:12 | FromDiscord | <Clyybber> the ref should be passing through without any rc ops |
10:06:43 | * | Cthalupa quit (Ping timeout: 246 seconds) |
10:12:12 | * | Cthalupa joined #nim |
10:12:40 | FromDiscord | <Clyybber> so in let x = Node(); let y = p(x) there should be no rc ops |
10:13:23 | FromDiscord | <Clyybber> because either p's param was inferred to be a sink param, so x gets moved into it |
10:13:53 | FromDiscord | <Clyybber> or p's param is a lent/cursor param and returns a lent/cursor |
10:14:13 | FromDiscord | <Clyybber> in the first case =destroy(y) will cause the cleanup |
10:14:24 | FromDiscord | <Clyybber> in the second case =destroy(x) will do it |
10:16:12 | Araq | hmm my next programming language will lack 'break', 'return' and 'continue' |
10:16:18 | FromDiscord | <Clyybber> lol |
10:16:37 | Araq | https://github.com/nim-lang/fusion/pull/12/files#diff-04a39be152f2be9f427f98252025de5aR69 and on and on it goes |
10:16:37 | FromDiscord | <Clyybber> what about try: finally :p |
10:16:38 | disbot | ➥ Add webscraper |
10:16:50 | Araq | but hey, at least it's not nested this way. |
10:17:01 | Araq | so silly. asm isn't nested either |
10:17:17 | FromDiscord | <impbox> in nimble is there a way to use variables? eg. `releaseOptions = "-d:release -d:danger -d:fooBar"` and then pass that to a task `exec nim c {releaseOptions} ...` or something along those lines like i'd do in a makefile |
10:18:54 | FromDiscord | <mratsim> yes: https://github.com/mratsim/constantine/blob/master/constantine.nimble#L15-L72 |
10:19:00 | FromDiscord | <Clyybber> Araq: Does your cursorifier do escape analysis currently? |
10:19:32 | FromDiscord | <impbox> @mratsim thanks! |
10:20:48 | FromDiscord | <impbox> nice I can import strformat in my nimble file =) |
10:22:20 | Araq | Clyybber: no, it doesn't. it ignores control flow, pessimizing the results |
10:23:29 | FromDiscord | <Clyybber> Ok. Can cursors be passed to regular parameters? |
10:23:34 | * | l1x quit (Ping timeout: 244 seconds) |
10:23:37 | FromDiscord | <Clyybber> I think they may only be passed to lent params |
10:24:02 | FromDiscord | <Clyybber> Since otherwise they may outlive their source |
10:24:45 | * | l1x joined #nim |
10:25:21 | FromDiscord | <impbox> does nim have an option to clean a nimcache directory before building in it so it doesn't keep unused files there? |
10:28:37 | FromDiscord | <impbox> I would just removeDir() but seems that's not available in nimble nimscript |
10:28:48 | * | fredrikhr quit (Read error: Connection reset by peer) |
10:29:08 | FromDiscord | <exelotl> there's -f / --forceBuild:on but I'm not sure it removes unused files |
10:29:14 | * | fredrikhr joined #nim |
10:31:04 | FromDiscord | <exelotl> Is nim compiler nimscript not an option? I'm sure you can rmDir in there |
10:39:04 | * | abm joined #nim |
10:47:47 | * | oddp_ joined #nim |
10:47:59 | * | oddp quit (Quit: quit) |
10:48:11 | FromDiscord | <Clyybber> Araq: The tests I added don't really serve to test wether something got moved, rather that it doesn't crash and gets destroyed properly |
10:48:17 | * | chemist69_ quit (Quit: WeeChat 2.7) |
10:48:36 | * | chemist69 joined #nim |
10:49:03 | FromDiscord | <Clyybber> And your cursifier will still rely on that behaviour to be correct I think |
11:00:19 | FromDiscord | <lqdev> damn my project isn't even that big and it takes 4 seconds to compile :/ |
11:01:16 | FromGitter | <bung87> hi , I'd like create PR for js backend, a browser api proc accept options, should I using exported custom type or using jsffi's JsObject? |
11:05:40 | Araq | preferably a custom type |
11:05:56 | FromGitter | <bung87> ok, Thanks! |
11:09:16 | * | endragor quit (Remote host closed the connection) |
11:11:41 | * | nikita_ is now known as nikita` |
11:27:10 | * | nikita` quit (Ping timeout: 272 seconds) |
11:35:47 | * | waleee-cl joined #nim |
11:46:31 | FromDiscord | <Clyybber> Araq: My PR is ready for review/finished btw (I only cleaned up a tiny bit in the last commit) :p |
11:49:40 | Araq | ok, fine |
11:49:48 | Araq | but in an upcoming PR, remove the templates |
11:49:57 | Araq | and if it takes callbacks instead, so be it |
11:55:10 | FromGitter | <bung87> RootNodeOptions,SlotOptions,ShadowRootInit how's these look ? as a proc parameter type? |
11:59:43 | Araq | set of enum? |
12:01:24 | * | skelett quit (Quit: WeeChat 2.7.1) |
12:03:01 | * | Shucks_ joined #nim |
12:05:00 | FromGitter | <bung87> all is js object |
12:05:14 | * | Shucks quit (Ping timeout: 256 seconds) |
12:05:24 | * | Shucks_ is now known as Shucks |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:33 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f0d9fc9bd3edf666fcdb60a] |
12:06:45 | * | supakeen joined #nim |
12:07:09 | FromGitter | <bung87> ```proc getRootNode*(n: Node,options: RootNodeOptions): Node``` |
12:07:29 | * | skelett joined #nim |
12:25:13 | * | lritter joined #nim |
12:29:20 | Araq | bikeshedding time |
12:30:23 | Araq | how to name the new --expandIr switch? |
12:35:09 | FromDiscord | <Clyybber> expandlr? |
12:36:44 | FromGitter | <tim-st> is there no difference in type parameters `T: bool` and `T: uint8|char|byte`? it says, both procs are matching |
12:37:14 | Araq | hmm doesn't sound right, bool is different from byte and char |
12:37:27 | FromGitter | <tim-st> yes, thought so too |
12:37:30 | Araq | I went with "expandarc" |
12:39:13 | FromDiscord | <Clyybber> tim-st: Does it work with `uint8 or char or byte` ? |
12:39:40 | FromDiscord | <Clyybber> Araq: What does the switch do? |
12:39:55 | Araq | dump the AST after our ARC related transformations |
12:40:10 | Araq | I'm writing tests now that make use of it |
12:40:32 | Araq | it's better to test the IR rather than what the end binary |
12:40:39 | Araq | produces |
12:40:48 | FromDiscord | <Clyybber> yeah |
12:41:03 | FromGitter | <tim-st> Clyybber: it seems to work at upper level to call the proc, not when the generic proc is called in an other generic proc |
12:43:44 | FromGitter | <tim-st> https://play.nim-lang.org/#ix=2rBg |
12:45:48 | Araq | oh stop the "deepcopy" already |
12:46:05 | FromGitter | <tim-st> yes, it was only to get a quick oneliner |
12:46:09 | FromGitter | <tim-st> I dont use it normally |
12:46:28 | Araq | it doesn't work on openArray anyway |
12:46:39 | Araq | at least it shouldn't |
12:47:06 | FromDiscord | <Clyybber> Isn't it actually fairly easy to implement a non-magic deepcopy? |
12:47:07 | FromGitter | <tim-st> https://play.nim-lang.org/#ix=2rBh |
12:47:13 | FromGitter | <tim-st> here without deepCopy |
12:47:39 | FromGitter | <tim-st> I wanted `copy(openArray[T])` but it doesnt seem to be implemented |
12:48:43 | Araq | this works fine https://play.nim-lang.org/#ix=2rBi |
12:49:13 | FromGitter | <sealmove> what's the equivalent of echo in macros, for debugging |
12:49:16 | Araq | there is a showstopper bug with explicit generic instantiations within generic code that seems to be your bug |
12:49:42 | Araq | sealmove: you can use 'echo repr result' to debug a macro's AST |
12:49:54 | * | bung joined #nim |
12:50:58 | FromGitter | <sealmove> nice |
12:51:07 | FromDiscord | <Clyybber> Araq: Is it reported? |
12:51:17 | FromDiscord | <Clyybber> I can't find it |
12:51:25 | Araq | i marked it with "showstopper" |
12:51:40 | FromDiscord | <Clyybber> You mean this one? https://github.com/nim-lang/Nim/issues/14942 ? |
12:51:42 | disbot | ➥ Incorrect overloaded generic function called ; snippet at 12https://play.nim-lang.org/#ix=2rBl |
12:53:18 | FromGitter | <tim-st> Araq: thanks, but I cant fit it to my original code... https://play.nim-lang.org/#ix=2rBm |
12:53:34 | Araq | clyybber: yes |
12:53:51 | FromDiscord | <Clyybber> Hmm, is it really the same bug? |
12:54:05 | FromGitter | <tim-st> Oh, I see, it was just the type parameter |
12:54:19 | FromDiscord | <Yardanico> oh nice, I would love to see something like --expandArc |
12:54:22 | FromGitter | <tim-st> `sort[T]()` crashes, but `sort()` works, thanks! |
12:54:33 | Araq | https://play.nim-lang.org/#ix=2rBn |
12:55:00 | FromDiscord | <Clyybber> because that bug is just that the function gets semmed even though it doesn't actually get called |
12:58:08 | FromDiscord | <Clyybber> https://play.nim-lang.org/#ix=2rBq here it the one tim-st encountered minimized |
12:58:20 | FromDiscord | <Clyybber> I remember disruptek fought with that bug too |
12:58:56 | FromDiscord | <Clyybber> Araq: Should I make a new issue or append it to the other showstopper? |
13:01:26 | * | solitudesf- quit (Read error: Connection reset by peer) |
13:01:51 | * | solitudesf joined #nim |
13:04:19 | * | solitudesf quit (Client Quit) |
13:04:45 | * | solitudesf joined #nim |
13:05:10 | * | solitudesf quit (Remote host closed the connection) |
13:06:08 | Araq | don't care |
13:06:55 | * | solitudesf joined #nim |
13:15:48 | FromDiscord | <Clyybber> Araq: Its already reported https://github.com/nim-lang/Nim/issues/6407 , should we assign showstopper? |
13:15:50 | disbot | ➥ Real and integer types fails to differentiate in a generic call from other generic ; snippet at 12https://play.nim-lang.org/#ix=2rBu |
13:18:42 | * | rockcavera joined #nim |
13:21:29 | Araq | ok |
13:45:40 | * | letto quit (Quit: Konversation terminated!) |
13:48:13 | * | letto joined #nim |
13:52:17 | * | chemist69 quit (Ping timeout: 260 seconds) |
13:52:49 | * | chemist69 joined #nim |
13:54:17 | * | mbuchel quit (Ping timeout: 260 seconds) |
13:55:05 | * | mbuchel joined #nim |
14:00:33 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:00:59 | * | fredrikhr joined #nim |
14:17:23 | * | narimiran quit (Ping timeout: 240 seconds) |
14:24:37 | FromGitter | <iffy> A user of mine is seeing this error `ERROR index 1024 not in 0 .. 1023 ⏎ fatal.nim(39) sysFatal ⏎ asyncfutures.nim(431) asyncCheckCallback` and I'm having trouble diagnosing the cause. Does anything jump out to anyone about this? 1024 seems like a suspicious number. A max size of some data structure? |
14:29:02 | Araq | there is some logic based on MAX_FD |
14:29:15 | Araq | we preallocate based on this |
14:33:24 | FromGitter | <iffy> I'll see what the user's ulimit is set to. That seems like a likely guess. `grep -r "MAX_FD" *` is failing to find anything in Nim source. Which file should I be looking at? |
14:38:36 | FromGitter | <iffy> okay, maybe ioselectors_kqueue.nim |
14:42:59 | * | rockcavera quit (Ping timeout: 240 seconds) |
14:45:56 | FromGitter | <iffy> Is this code is leaking file descriptors? http://ix.io/2rBS |
14:46:12 | FromGitter | <iffy> (and is there a better way to read asynchronously from stdin?) |
14:48:04 | Araq | well better close the file stream |
14:48:23 | Araq | also I don't know why you need to do |
14:48:25 | Araq | var |
14:48:25 | Araq | s = newFileStream(stdin) |
14:48:25 | Araq | var data = s.readStr(4096) |
14:48:27 | Araq | result = $data |
14:48:39 | Araq | what's wrong with stdin.readLine |
14:52:20 | * | audiophile joined #nim |
14:54:31 | * | endragor joined #nim |
15:16:11 | * | vicfred joined #nim |
15:17:24 | leorize[m] | @iffy you know that you can poll on stdin, right? :P |
15:17:28 | leorize[m] | well except on windows |
15:19:03 | FromGitter | <iffy> @Araq I'm reading netstrings (not newline-delimited) -- I had a version that read char by char, but that seemed like a bad idea |
15:19:32 | leorize[m] | you should use a buffering system tbh |
15:19:39 | leorize[m] | lexbase got one :p |
15:19:44 | * | natrys joined #nim |
15:20:18 | FromGitter | <iffy> and this is code for Linux/macOS/Windows so it has to work on all |
15:20:38 | Araq | use a UI library :-) |
15:21:40 | Araq | and add a UI to your app, yeah yeah I know know yada yada your Linux server has no monitor attached (I keep wondering about this one btw, so .. does it have a keyboard attached?) |
15:22:21 | FromGitter | <iffy> well..... this is an Electron app. I'm slowly gouging out the old NodeJS code and porting it to Nim (while keeping the Electron shell until I can replace it) |
15:22:37 | FromGitter | <iffy> Here's my actual reading code: http://ix.io/2rC8 |
15:22:46 | Araq | what's stdin for an Electron app? |
15:23:06 | FromGitter | <iffy> The Electron app spawns a Nim executable and communicates with it on stdin/stdout/stderr |
15:23:11 | leorize[m] | asyncevent do take up fd iirc |
15:23:53 | leorize[m] | until rayman got his virtual events thingy merged |
15:24:17 | FromGitter | <iffy> Is `close()` the opposite of `addEvent()`? |
15:24:17 | FromGitter | <alehander92> i did use an electron app |
15:24:30 | FromGitter | <alehander92> it communicated using a socket: this might be easier? |
15:24:33 | FromGitter | <iffy> or `unregister()`? |
15:24:49 | leorize[m] | unregister iirc |
15:24:56 | FromGitter | <alehander92> again with a nim process (which was actually .. probably a sibling process) |
15:25:17 | Araq | how do I redirect stderr again? 2>file ? |
15:25:29 | FromGitter | <alehander92> &> |
15:25:30 | FromGitter | <iffy> yes |
15:25:32 | FromGitter | <alehander92> i just had to do it today |
15:25:33 | leorize[m] | yea |
15:25:37 | disruptek | it's a fd leak afaik. |
15:25:53 | leorize[m] | @iffy you should avoid threadpool for this stuff though |
15:26:01 | FromGitter | <iffy> solved with `unregister()` right, disruptek? |
15:26:08 | disruptek | yes. |
15:26:28 | FromGitter | <iffy> leorize: I'd love to avoid a threadpool, but that's the best way I've seen to cross-platform read from stdin asynchronously |
15:26:28 | FromGitter | <alehander92> disruptek i plan on writing a mini container runtime |
15:26:39 | disruptek | i pitty the fool. |
15:26:42 | FromGitter | <alehander92> do you have any insight in that, as you have like 20 projects |
15:26:47 | leorize[m] | @iffy threadpool is designed for threaded computation workload, if you do blocking I/O it will take up a slot in the pool |
15:26:51 | FromGitter | <alehander92> so probably you did that by accident |
15:26:53 | FromGitter | <alehander92> sometime |
15:27:00 | leorize[m] | use normal createThread() and friends instead |
15:27:31 | FromGitter | <iffy> As I only have one thread ever being used, is it a problem? |
15:28:01 | disruptek | i dunno what "mini container runtime" means but it sounds like a reinvention of the wheel. |
15:28:24 | leorize | Araq: btw use `2>file` instead of `&>` |
15:28:29 | leorize | `&>` is bash-only |
15:29:07 | disruptek | 2>&1 |
15:29:13 | leorize | @iffy you can never be too careful |
15:30:49 | leorize | @iffy unregister and close AsyncEvent after use |
15:31:07 | FromGitter | <bung87> alehander92 send a list https://pastebin.com/VQW3Kxfv |
15:31:12 | FromGitter | <iffy> Can I do it immediately after `trigger()`? |
15:31:30 | Araq | thanks |
15:31:47 | FromGitter | <iffy> Or should I do it in the callback? |
15:32:06 | disruptek | i don't think it matters, but i wouldn't do it in the cb. |
15:32:50 | Araq | well threadpool is complex code on top of createThread so if you don't need it, better avoid it |
15:33:12 | FromGitter | <iffy> k, I'll attempt a change |
15:33:29 | FromGitter | <iffy> Hopefully this fixes my fd leak; thank you all! |
15:33:33 | Araq | so ... my cursor inference breaks disruptek's "bump" tool |
15:34:09 | disruptek | funny. |
15:34:17 | Araq | software development were so much easier without tests |
15:34:26 | leorize | @iffy you should do the clean up after Future completion |
15:34:29 | disruptek | i knew it should have been a shell script. |
15:34:37 | leorize | that'd be the safest way |
15:34:57 | Araq | disruptek: well I also have "easier" code in the suite that also fails |
15:35:22 | Araq | do we want to conflate cursor inference with "sink inference"? |
15:35:25 | FromGitter | <iffy> @leorize how do I do that? I see my only options as "right after trigger" or "in the callback." I don't know how else to know that the Future has completed. |
15:35:35 | leorize | fut.addCallback |
15:35:41 | Araq | and maybe name the switch "--unsafeOptimizations" |
15:35:44 | Araq | ? |
15:36:20 | disruptek | "aggressive" is more friendly than "unsafe". |
15:36:26 | Araq | --winBenchmarkAndFailForComplexCasesButComplexCasesAreIOboundAnyway |
15:36:49 | leorize | shouldn't all optimizations be enabled by default instead? |
15:37:01 | leorize | if it can't be they maybe it's not really worth it? |
15:37:13 | Araq | yeah yeah, I'm fixing the bugs |
15:37:56 | disruptek | i can't believe anyone wrote code that is simpler than bump, but i guess i know a compiler author who has just such a superpower. |
15:41:58 | FromGitter | <alehander92> disruptek yeah |
15:42:12 | FromGitter | <alehander92> my plan is to just implement small examples of stuff that exists |
15:42:12 | disruptek | dude. |
15:42:20 | FromGitter | <alehander92> like mini-package manager |
15:42:22 | FromGitter | <iffy> @leorize oh right; I thought the existing callback was that Future's callback. I missed that |
15:42:30 | FromGitter | <alehander92> mini-x |
15:42:31 | disruptek | well, i need something that's like a cloudbased runtime. |
15:42:38 | FromGitter | <alehander92> NOT MINI |
15:42:48 | disruptek | no, it has to be mini. |
15:42:53 | disruptek | like, really mini. |
15:43:00 | FromGitter | <alehander92> so what does it do |
15:43:20 | disruptek | it's a lib that provides a context you can use to operate the cloud. |
15:43:41 | disruptek | it knows how to downgrade its perms and it has a concept of identity. |
15:44:47 | FromGitter | <alehander92> ok, learning new terms |
15:45:01 | FromGitter | <alehander92> what is identity in cloud context |
15:45:22 | * | nikita` joined #nim |
15:45:22 | disruptek | the notion that you can differentiate between yourself and any other. |
15:45:34 | leorize | downgrade its perms? like dropping privilages and setup its own sandbox? |
15:45:43 | disruptek | dropping privs is enough. |
15:45:52 | FromGitter | <alehander92> ok, easy here |
15:45:58 | FromGitter | <alehander92> still trying to understand chroot |
15:46:05 | leorize | I know how to do both if anyone is willing to write a lib :P |
15:46:15 | FromGitter | <alehander92> please do it :D |
15:46:22 | disruptek | i mean, it's in development. |
15:46:27 | * | maier quit (Ping timeout: 256 seconds) |
15:46:28 | disruptek | i just don't have time to work on it. |
15:46:49 | disruptek | this is nigel i'm talking about. |
15:48:00 | FromGitter | <alehander92> is this the song |
15:48:11 | disruptek | yeah |
15:48:26 | FromGitter | <alehander92> @bung87 awesomke! |
15:48:31 | FromGitter | <alehander92> i knew about bocker |
15:48:42 | FromGitter | <alehander92> i am interested in building tho |
15:49:22 | livcd | what's bocker? or is that actually not a typo? |
15:49:39 | FromGitter | <bung87> yeah, someday I was wondering the docker internal, so I collected the list. |
15:50:08 | FromGitter | <bung87> it's docker in 100 lines of bash. |
15:50:41 | disruptek | i didn't see rain for over a year, once. |
15:50:53 | disruptek | now i cannot escape it. |
15:51:19 | livcd | i love rain |
15:51:21 | FromGitter | <alehander92> @bung87 yeah exactly |
15:51:25 | leorize | disruptek: for starters just wrap something over bubblewrap (the programmable sandbox software) |
15:51:35 | FromGitter | <alehander92> is firejail good |
15:51:49 | leorize | firejail is fine for desktop |
15:52:05 | disruptek | you can add that later. i'm just trying to bootstrap the damned thing. |
15:52:06 | FromGitter | <alehander92> maaan chroot runs fine |
15:52:15 | leorize | chroot is not a security feature fwiw |
15:52:16 | disruptek | maybe i will work on it today, since everyone is all into this shit suddenly. |
15:52:32 | FromGitter | <alehander92> yeah i am just finding out about basic linux stuff |
15:52:34 | FromGitter | <alehander92> it seems |
15:53:16 | disruptek | nothing's basic. |
15:53:37 | FromGitter | <alehander92> but yeah chroot not security |
15:53:50 | disruptek | everything's basically something. |
15:53:52 | FromGitter | <alehander92> hm, only perl manages to start fine inside my basic folder |
15:53:57 | disruptek | but nothing at all is basic. |
15:54:04 | leorize | even docker is not a good way to secure things :P |
15:54:05 | FromGitter | <alehander92> visual basic |
15:54:11 | FromGitter | <alehander92> leorize oh i assume |
15:54:24 | FromGitter | <alehander92> i just want to learn a bit better the linux stuff that containers are based on |
15:54:33 | FromGitter | <alehander92> and to make a cool minimal project in c++ |
15:54:46 | disruptek | !repo criu |
15:54:49 | disbot | https://github.com/checkpoint-restore/criu -- 9criu: 11Checkpoint/Restore tool 15 1159⭐ 273🍴 7& 29 more... |
15:55:02 | leorize[m] | in C++? do it in nim and save yourself the hassle |
15:55:03 | FromGitter | <alehander92> and yeah many ppl are into this and some of my possible jobs |
15:55:13 | FromGitter | <alehander92> leorize i need some projects which are not in nim |
15:55:17 | Araq | I'd look into pico kernels or whatever its now called |
15:55:21 | FromGitter | <alehander92> its hard to find a job with nim |
15:56:01 | Araq | true. and sad |
15:56:02 | disruptek | i'm more about a runtime kernel than i am about processes, if that helps. |
15:56:04 | FromGitter | <alehander92> yeah i remember the idea of running just specialized stuff on bare metal / hypervised (?) metal |
15:56:18 | Araq | there is a new OS developed by google |
15:56:18 | FromGitter | <alehander92> but this is somewhere in my long mental todo |
15:56:25 | leorize[m] | I'll warn you beforehand that security (on linux) is an endless rabbit hole :P |
15:56:25 | Araq | forgot its name |
15:56:25 | FromGitter | <alehander92> fuschia |
15:56:31 | Araq | yeah, maybe that one |
15:56:34 | FromGitter | <alehander92> fuchsia |
15:56:47 | disruptek | it beats magenta by a mile. |
15:56:54 | FromGitter | <alehander92> leorize i am really not very interested in security |
15:56:57 | disruptek | i don't like what i read about it, though. |
15:57:02 | FromGitter | <alehander92> like, i am to an extent, but not as an expert |
15:57:34 | disruptek | i consider security orthagonal to my work, honestly. |
15:57:38 | leorize | same here, it's fun to look at, and a horror to work on :P |
15:57:52 | FromGitter | <alehander92> Araq sorry this wasn't a dig at nim, i actually want to work some time with other languages, currently my nim knowledge suffers as i am not well versed with c++/rust etc |
15:58:21 | Araq | no offense taken, it sucks not be Rust |
15:58:25 | Araq | *not to be |
15:58:38 | leorize | one day I'll have to learn rust just to get a leg up at jobs :P |
15:58:57 | FromDiscord | <Recruit_main707> just create a nim-rust bacjed :wesmart: |
15:59:02 | disruptek | it's okay. we will be at the finish line first. |
15:59:03 | FromGitter | <alehander92> yeah: i do plan to keep working on the parallel compiler experiment and on some RFC-s |
15:59:22 | FromGitter | <alehander92> i have a very annoying rfc planned which people will dislike! |
15:59:29 | Araq | this is so weird |
15:59:57 | Araq | my analysis says "if n is inferred as .cursor it would explain the crash you're seeing" |
16:00:09 | * | maier joined #nim |
16:00:16 | Araq | problem is: n isn't inferred as .cursor |
16:00:34 | disruptek | arc knows what n is better than you. |
16:00:57 | leorize | @alehander92 I'll hate it if you RFC something to get rid of `result` :P |
16:01:16 | leorize | oh wait someone already did that |
16:01:23 | FromGitter | <oskca> hi @Araq , how to subclassing an imported C++ class and export it back to C++ world? |
16:01:50 | disruptek | agree, i use result in most procedures i write. and i exploit it in most cases. clearly, objectively, i cannot support its removal. |
16:02:12 | Araq | oskca: I only got it to work with .emit |
16:02:21 | Araq | but I did get it to work :-) |
16:02:59 | FromGitter | <alehander92> leorize sorry, it's only half-prepared in an old chat somewhere |
16:03:00 | FromGitter | <oskca> ok, thanks |
16:03:09 | FromGitter | <alehander92> but it's not about result :) |
16:03:25 | leorize | then I'm cool :P |
16:05:06 | * | maier quit (Ping timeout: 258 seconds) |
16:05:54 | Araq | alehander92: tell us about your RFC please :-) |
16:18:49 | * | marnix joined #nim |
16:19:12 | livcd | oskca: are you the guy that did sciter bindings? |
16:21:26 | * | NimBot joined #nim |
16:24:12 | FromGitter | <alehander92> Araq i'll try to write it down tomorrow |
16:37:31 | FromGitter | <iffy> As I convert my stdin-reader to use createThread, should I return results via FlowVars or Channels? |
16:44:15 | FromDiscord | <Clyybber> sent a long message, see http://ix.io/2rCm |
16:44:21 | FromDiscord | <Clyybber> Currently it throws an illegal recursion error |
16:48:35 | * | Trustable joined #nim |
16:49:46 | * | marnix quit (Ping timeout: 256 seconds) |
16:50:41 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
16:55:33 | * | marnix joined #nim |
17:05:48 | * | audiophile quit (Read error: Connection reset by peer) |
17:08:42 | * | fredrikhr quit (Read error: Connection reset by peer) |
17:10:41 | * | fredrikhr joined #nim |
17:12:17 | * | the_pumpkin_man joined #nim |
17:12:54 | the_pumpkin_man | Hello, I was looking at this language, does it has a working TUI library ? |
17:13:11 | the_pumpkin_man | I've looked at nimbox and nim-ncurses, both don't work |
17:13:14 | solitudesf | !repo illwill |
17:13:14 | disbot | https://github.com/johnnovak/illwill -- 9illwill: 11 15 110⭐ 11🍴 & 1 more... |
17:13:41 | disruptek | !help |
17:13:53 | FromDiscord | <dom96> the_pumpkin_man: nimbox doesn't work? I've used it a few years back, might be simple to fix |
17:13:59 | disruptek | it was worth a shot. |
17:14:25 | the_pumpkin_man | dom96: There's an error about missing termbox.h |
17:14:35 | the_pumpkin_man | solitudesf: Thanks I will try this |
17:14:53 | * | waleee-cl joined #nim |
17:15:01 | disruptek | you'll like it. |
17:15:23 | the_pumpkin_man | You should probably add the TUI tag, couldn't find it with `nimble search` |
17:16:02 | FromDiscord | <dom96> `sudo apt install termbox-dev`? |
17:16:40 | the_pumpkin_man | dom96: no doesn't exist |
17:16:50 | the_pumpkin_man | And the dev would have mentionned such dependency anyway |
17:17:07 | FromDiscord | <dom96> Doubt it |
17:17:10 | the_pumpkin_man | (because else that would mean he doesn't care about it) |
17:18:11 | the_pumpkin_man | But illwill perfectly works, so thank you ! |
17:18:19 | * | bung quit (Ping timeout: 258 seconds) |
17:18:35 | * | the_pumpkin_man quit (Quit: WeeChat 2.8) |
17:22:03 | Oddmonger | i'm searching for informations about cdecl, but it's not in the index |
17:22:27 | Oddmonger | it seems to be used for defining a proc as a C function pointer, but i want to be sure |
17:22:44 | solitudesf | ~manual |
17:22:44 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html |
17:23:19 | disruptek | #14976 holy shit |
17:23:22 | disbot | https://github.com/nim-lang/Nim/pull/14976 -- 3escape analysis: enables memory safe views (cf 1st class openarray) and optimizations ; snippet at 12https://play.nim-lang.org/#ix=2rCC |
17:23:49 | Araq | disruptek: yeah it's nice but I cannot merge it because it uses 'continue' everywhere :P |
17:23:53 | Araq | XD |
17:26:16 | Oddmonger | solitudesf: i've already looked at the manuel, and the index (no entry in the index) |
17:26:29 | Oddmonger | the manuel definition is not clear for me : «The cdecl convention means that a procedure shall use the same convention as the C compiler. » |
17:27:08 | Oddmonger | convention ? Means register/stack parameters passing for example ? |
17:27:25 | Araq | yes, that one |
17:27:30 | FromGitter | <iffy> How do I pass my `string` to a proc expecting a `var openArray[char]` (I'm looking at `File.readChars`) |
17:29:19 | Oddmonger | Araq: i'm not sure you were answering to me, but in that case, is it important to specify it for a callback ? |
17:29:22 | FromDiscord | <Rika> have you tried just passing it? (i dont know) |
17:29:28 | Araq | Oddmonger: yes and yes |
17:29:41 | Oddmonger | ok , thank you |
17:30:42 | FromGitter | <iffy> oh, derp... save your file before you run it |
17:35:37 | FromGitter | <ynfle> Anyone want to help me debug `SIGSEGV` that aren't consistent across platform? |
17:41:04 | disruptek | rika: rude. |
17:41:43 | disruptek | what's wrong with gram? |
17:42:12 | * | junland quit (Quit: %ZNC Disconnected%) |
17:42:56 | * | junland joined #nim |
17:44:36 | FromGitter | <iffy> @leorize how's this version? http://ix.io/2rCI It assumes AsyncEvent is safe to pass through a channel (and tuples, for that matter). No longer uses streams, and I think it might be more efficient by writing into a string rather than appending to one. |
17:45:19 | FromGitter | <iffy> Also, it seems like `event.unregister()` just breaks things, but `event.close()` works |
17:46:09 | FromGitter | <iffy> I get `Event is not registered in the queue!` when I call unregister |
17:49:13 | FromDiscord | <Rika> disruptek: ??????????????????????? |
17:49:50 | FromDiscord | <Rika> grim? it takes a fucktonne of ram when the node, edge, and label counts are high |
17:52:08 | FromDiscord | <Varriount> iffy: Is the event being unregistered in a different thread from where it was registered |
17:54:41 | FromDiscord | <Varriount> ynfle: What's the problem? |
17:59:05 | * | rockcavera joined #nim |
18:01:26 | disruptek | rika: grim or gram? |
18:03:21 | disruptek | !repo gram |
18:03:21 | disbot | https://github.com/disruptek/gram -- 9gram: 11Generic graphs in Nim 15 4⭐ 0🍴 7& 4 more... |
18:03:41 | disruptek | gram is pretty heavy, but i've barely done any work on it. |
18:03:45 | FromDiscord | <Rika> disruptek: grim, ill take a look at gram |
18:04:04 | disruptek | it's more about solving the api problem i had with grim. |
18:04:38 | FromDiscord | <Rika> which is? |
18:07:55 | FromDiscord | <Clyybber> Araq: https://github.com/nim-lang/Nim/blob/Clyybber-movemoodestroy/doc/destructors.rst#cursor-inference-copy-elision shouldn't it output "destroy" ? |
18:10:29 | disruptek | rika: i hated it. |
18:12:13 | FromDiscord | <Rika> i see |
18:12:19 | FromDiscord | <Rika> ill watch this repo though |
18:19:24 | disruptek | sure. i haven't gotten a comment on my bug report from months ago, afaik. |
18:22:12 | FromDiscord | <Clyybber> which one |
18:22:55 | FromDiscord | <Clyybber> oh, nevermind, thought you were talking about nim |
18:26:31 | disruptek | nah; if i hated nim, you'd have heard about it sooner. |
18:48:01 | * | Jesin quit (Quit: Leaving) |
18:49:02 | FromGitter | <kdheepak> I have a silly nim question. I have a package that is a binary, and I now want to use it as a library in another program. When I nimble install it, nimble doesn't pull in any source files, so I'm not able to import it as a library in the other package. Is there a way to do this? |
18:50:57 | FromGitter | <kdheepak> I just have one file in the package as a binary that I want to convert to a library. So I don't need to use a packagepkg folder. |
18:51:11 | shashlick | you can make it a hybrid - you can install just that file or a bunch of files by extension |
18:51:41 | shashlick | `installDirs`, `installFiles` or `installExt` |
18:51:51 | shashlick | see nimterop for an example |
18:52:19 | disruptek | if you didn't create the package, use `nimble develop` or whatever. |
18:53:54 | shashlick | disruptek: is nimgit2 in a good place now? i see gittyup still asks for git2Git but nimph is updated |
18:54:16 | FromDiscord | <Varriount> @Clyybber Is any of the current work on destructors going to place destructors calls in the middle of a function? For example, at the end of a 'for' or 'block' scope? |
18:54:52 | disruptek | shashlick: gittyup.nim.cfg has no bearing on nimph. |
18:55:13 | FromDiscord | <Clyybber> @Varriount Yeah! Thats actually what was being worked on the last weeks |
18:55:23 | FromDiscord | <Clyybber> We place them at the end of scopes |
18:55:27 | shashlick | agreed but if anyone else wants to use gittyup directly |
18:55:49 | shashlick | well, even then it won't have any bearing |
18:55:52 | shashlick | okay cool |
18:55:52 | disruptek | it's only used during development afaict. |
18:55:59 | FromGitter | <kdheepak> Thanks shashlick. `installFiles` is what I wanted. |
18:56:07 | shashlick | kdheepak - did you see lazylib |
18:59:48 | FromDiscord | <Varriount> @Clyybber Oh good, that's what I thought. What are your thought on this then? https://github.com/nim-lang/Nim/pull/14976 |
18:59:49 | disbot | ➥ escape analysis: enables memory safe views (cf 1st class openarray) and optimizations ; snippet at 12https://play.nim-lang.org/#ix=2rCC |
19:00:10 | * | debased joined #nim |
19:00:44 | FromDiscord | <Clyybber> not sure yet. I think we need escape analysis at some point for views/lent/cursor which are basically the same concept |
19:01:02 | FromDiscord | <Clyybber> but I feel like it should be using the dfa |
19:01:42 | skrylar[m] | so. i was looking at replacing the derpy bmessage serializer with a tlsf one |
19:01:53 | skrylar[m] | although messages are probably so small this wasnt worth it |
19:02:04 | * | tane joined #nim |
19:02:15 | FromDiscord | <Clyybber> oh, I only now see your comment |
19:02:33 | FromGitter | <iffy> Varriount: It's calling `unregister()` in the same thread: http://ix.io/2rCQ |
19:03:07 | FromDiscord | <Clyybber> @Varriount yeah, I think its a real issue. It should use the symbolic/destructor scope |
19:03:49 | * | marnix quit (Ping timeout: 264 seconds) |
19:04:37 | FromDiscord | <Clyybber> (edit) 'symbolic/destructor' => 'lexical/destructor' |
19:05:23 | FromDiscord | <Clyybber> at least for types that have a destructor |
19:05:23 | FromDiscord | <Varriount> @Clyybber I mean, I know that we shouldn't necessarily be aiming for "perfect" in a proposal like this, but it's important to discuss where such features should eventually reach. |
19:06:01 | FromDiscord | <Clyybber> yeah, definitely |
19:06:14 | FromDiscord | <Clyybber> I think we should always aim for "perfect" :p |
19:07:44 | * | Jesin joined #nim |
19:08:09 | * | marnix joined #nim |
19:08:54 | FromDiscord | <Varriount> The unfortunate truth is that, with the rise of GC'd languages such as Go, Perl, Python, etc., knowledge of stack vs heap allocation has become less important. Symbolic scope, on the other hand, is still a common concept. |
19:09:08 | FromGitter | <tim-st> wouldn't this be good for stdlib: https://play.nim-lang.org/#ix=2rCT (counting sort overload for some int types; O(n) runtime) |
19:10:39 | FromDiscord | <Varriount> @tim-st doesn't the stdlib already have a sort function? |
19:11:05 | FromGitter | <tim-st> yes, sure, but I think it uses the same for all types |
19:11:54 | FromGitter | <tim-st> I tested a huge array which sorted in 6seconds, nims sorting didnt return after 60 seconds |
19:12:48 | FromDiscord | <Clyybber> @Varriount Yeah, true. Although regarding destructors it shouldn't really matter. Accessing a destroyed object thats on the stack is definitely a bad idea |
19:13:12 | supakeen | Been toying with Nico, it's so neat! |
19:13:17 | FromDiscord | <Clyybber> especially since that object might actually be a custom ref type or similar |
19:15:14 | FromDiscord | <Clyybber> interestingly enough the lexical scope isn't exactly the same as the destructor scope |
19:16:12 | FromDiscord | <Clyybber> since in `if cond: ...` or `while cond: ...` the cond is considered part of the outside scope as far as destructors are concerned, while its considered part of the inner scope as far as lexical scope is concerned |
19:19:43 | FromDiscord | <Varriount> @Clyybber Huh, why is that? Why not make the scopes the same? |
19:19:57 | FromDiscord | <Clyybber> its not possible |
19:20:13 | FromDiscord | <Clyybber> since cond needs to be destroyed even in the case it evaluates to false |
19:21:28 | FromDiscord | <Varriount> Oh, see. Why not place the destructor right after the statement block then? |
19:22:16 | FromDiscord | <Clyybber> funny, I just had the same thought :D |
19:22:58 | FromDiscord | <Clyybber> I'm thinking if that could also be accomplished by moving the destructors as far up as possible |
19:23:21 | FromDiscord | <Clyybber> hmm, I don't think so. |
19:24:03 | FromDiscord | <Clyybber> hmm, I think I found the "right" way to think about this in terms of scopes |
19:24:25 | FromDiscord | <Clyybber> `if cond:` is its own scope with `: ...` being a subscope of that |
19:24:39 | FromDiscord | <Varriount> Yeah |
19:25:31 | FromGitter | <iffy> Is there an alternative to `AsyncEvent` that can be triggered multiple times? Or is there a way to have a worker thread cause a proc call in the main thread if the main thread is doing `runForever()`? I'm opening too many file descriptors with the number of AsyncEvents I'm making. |
19:26:16 | FromDiscord | <Varriount> iffy: were you able to figure out your other problem? |
19:26:35 | FromGitter | <iffy> This is part of the same problem |
19:27:45 | FromDiscord | <Varriount> Hm, a workaround could be raising the descriptor limit |
19:28:29 | FromDiscord | <Varriount> iffy: Channel + a rescheduling future procedure? |
19:28:41 | FromGitter | <iffy> :) yes, in the short term I'll tell my user that |
19:29:11 | FromDiscord | <Varriount> Do we have async thread channels? |
19:29:38 | FromGitter | <tim-st> should `s.add(s)` work, where `s` is `var seq[int]`? |
19:30:23 | FromGitter | <tim-st> `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
19:30:34 | FromDiscord | <Varriount> tim-st: No, because s isn't an integer |
19:30:59 | FromDiscord | <Varriount> That should cause a compile-time error |
19:31:05 | FromGitter | <tim-st> Varriount: there is an overload proc |
19:31:43 | FromGitter | <tim-st> I would assume this to work, maybe the memory is freed too early |
19:32:10 | FromDiscord | <Clyybber> @Varriount Theres an overload that adds a seq to another seq |
19:32:43 | FromDiscord | <Clyybber> But the issue is that its illegal aliasing |
19:32:51 | FromDiscord | <Clyybber> which ideally the compiler would detect |
19:32:55 | FromDiscord | <Clyybber> but doesn't currently |
19:34:01 | FromGitter | <tim-st> Clybber: what does this mean? is it only allowed to use other seqs as parameter? |
19:34:51 | FromGitter | <tim-st> a simple example works: https://play.nim-lang.org/#ix=2rD1 |
19:34:59 | FromGitter | <tim-st> maybe the problem is with arc only |
19:35:47 | FromDiscord | <Clyybber> Yeah, it might be exclusive to arc |
19:36:07 | FromDiscord | <Clyybber> Since add is evaluated left to right |
19:36:21 | FromDiscord | <Clyybber> but the RHS parameter of add is sink |
19:36:39 | FromDiscord | <Clyybber> Which will invalidate the LHS s |
19:36:41 | FromGitter | <tim-st> yes, I checked, my code works without arc |
19:36:45 | FromDiscord | <Clyybber> I *think* |
19:37:12 | FromDiscord | <Clyybber> Workaround is to use a temporary |
19:38:48 | FromGitter | <tim-st> Clybber: thanks! it works with a temp seq |
19:46:29 | FromDiscord | <Clyybber> @Varriount Hmm, actually that isn't the "right" way to think about it either, since theres no way we could destroy `cond` in `if cond: ... elif othercond: ...` before the elif part, even though in the elif part cond isn't accessable anymore |
19:46:43 | FromDiscord | <Clyybber> Without introducing a lot of unneccessary temporaries that is |
19:46:51 | FromDiscord | <Clyybber> (edit) 'unneccessary' => '' |
19:47:23 | FromGitter | <iffy> Varriount, leorize: okay this version only uses max 1 file descriptor at a time and doesn't require any polling: http://ix.io/2rD6 |
19:48:44 | FromDiscord | <Clyybber> hmm, actually we could if we expand the elifs into if: ... else: nestings |
19:49:39 | disruptek | that's the only realistic approach, imo. |
19:50:23 | FromDiscord | <Clyybber> yeah |
19:50:58 | FromDiscord | <Varriount> iffy: To be honest, I haven't dealt with the async part of the stdlib much. |
19:51:01 | disruptek | i have to do the same thing in cps. |
19:51:03 | FromDiscord | <Clyybber> Araq: Wdyt? (expanding elifs into else: if: before or during injectdestructors)? |
19:52:10 | FromDiscord | <--HA--> I'm probably missing something but is there no sort for sequences? |
19:52:29 | disruptek | see algorithm module. |
19:54:15 | leorize | @iffy I'll try to pull off a cross-platform single threaded version for you |
19:54:48 | FromDiscord | <--HA--> Thanks disruptek |
19:54:51 | FromGitter | <iffy> I will be impressed -- and then make a PR to put it in stdlib :) |
20:01:36 | * | narimiran joined #nim |
20:01:53 | * | Trustable quit (Remote host closed the connection) |
20:02:25 | FromDiscord | <gingerBill> I have been experimenting with Nim's `Channel` type and I found that they the buffered ones dynamically grow. Why do they grow rather than have a fix size and then block? Or not allow for that? |
20:06:51 | FromDiscord | <Varriount> @gingerBill Channels can be unlimited or have a max size: https://nim-lang.org/docs/channels.html#open%2CChannel%5BTMsg%5D%2Cint |
20:09:11 | FromDiscord | <gingerBill> I'll rephrase my question 😛 |
20:12:13 | FromDiscord | <Galdor Sereg> Is nim edit ready to use yet? |
20:12:49 | FromDiscord | <Rika> nim edit? |
20:13:09 | FromDiscord | <Galdor Sereg> https://github.com/Araq/nimedit↵https://nim-lang.org/nimedit/ |
20:14:09 | * | fredrikhr quit (Read error: Connection reset by peer) |
20:14:20 | FromDiscord | <gingerBill> sent a long message, see http://ix.io/2rDk |
20:14:25 | FromDiscord | <gingerBill> (edit) 'http://ix.io/2rDk' => 'http://ix.io/2rDl' |
20:14:46 | * | Vladar quit (Quit: Leaving) |
20:16:10 | FromDiscord | <gingerBill> I was wondering, why allow for the buffered unlimited capacity non-blocking channel case? |
20:17:05 | * | lbart joined #nim |
20:17:05 | * | lbart quit (Changing host) |
20:17:05 | * | lbart joined #nim |
20:20:14 | * | marnix quit (Ping timeout: 240 seconds) |
20:29:52 | FromGitter | <deech> How do I pretty print an ast generated by a macro? |
20:30:21 | FromGitter | <deech> So I guess the macroexpand equivalent for Nim. |
20:31:17 | FromDiscord | <lqdev> macros.expandMacros |
20:33:24 | FromGitter | <ynfle> `echo result.repr` in the macro |
20:36:19 | FromDiscord | <lqdev> or `result.treeRepr` if you want to see what the actual AST is |
20:36:56 | FromGitter | <deech> expandMacros worked, thanks! |
20:38:52 | FromDiscord | <Yardanico> @Galdor Sereg it's abandoned I think |
20:39:54 | FromDiscord | <Galdor Sereg> Well, foop. I was hoping it would become a thing, I'm trying to get NeoVim working with Nim and not having success. But I'll keep at it 🙂 |
20:40:24 | FromDiscord | <Yardanico> Are you using https://github.com/alaviss/nim.nvim ? |
20:40:34 | FromDiscord | <Yardanico> Also @leorize is here :P |
20:40:47 | FromDiscord | <Galdor Sereg> Yes, that's the one I'm trying to get up and going 🙂 |
20:41:08 | FromDiscord | <Galdor Sereg> I'm just not very knowledgeable with Vim, so its a beginner on multiple fronts :p |
20:41:12 | * | debased quit (Quit: WeeChat 2.8) |
20:41:35 | leorize | what is the problem? |
20:41:38 | FromGitter | <ynfle> https://github.com/fox0430/moe |
20:41:40 | FromDiscord | <dom96> Why are you going with Vim? Why not VS Code? |
20:41:57 | disruptek | i think he wants it to work. |
20:42:29 | FromDiscord | <Elegant Beef> Well if that was the case, why not use nano |
20:42:42 | FromDiscord | <lqdev> because vim is way superior |
20:42:50 | FromDiscord | <Elegant Beef> But clearly it doesnt work |
20:42:59 | FromDiscord | <lqdev> it does? |
20:43:11 | FromDiscord | <lqdev> it's probably an issue with his setup. |
20:43:24 | FromDiscord | <Rika> man can we focus on the issue here |
20:43:27 | FromDiscord | <lqdev> so let's help him debug. |
20:43:31 | FromDiscord | <Rika> we're not here to debate which editor is better |
20:43:38 | FromDiscord | <Galdor Sereg> @dom96 I want to use my samsung dex with it. And VS code does not work well on Dex |
20:43:49 | FromDiscord | <dom96> ahh |
20:43:54 | FromDiscord | <Elegant Beef> I thought it was clear i was countering disruptek's joke with a joke 😦 |
20:44:04 | FromDiscord | <Rika> it was not |
20:44:07 | leorize | so.. what's the issue? |
20:44:09 | FromDiscord | <lqdev> alright @Galdor Sereg, what are you stuck on? |
20:45:49 | FromDiscord | <Shucks> I don't like to use editors which are smarter than me... vim ;p |
20:46:20 | FromDiscord | <Galdor Sereg> It's probably just user error, but I can't get Nim to start up, like when I start typing it doesn't register as Nim code, just text. |
20:46:30 | FromDiscord | <lqdev> hm |
20:46:34 | FromDiscord | <Galdor Sereg> I'm thinking its just setup error, cause I've never done it before and I just need to keep at it |
20:46:42 | leorize | screenshots please? :) |
20:46:47 | FromDiscord | <Rika> did you save the file |
20:47:08 | FromDiscord | <lqdev> you don't need to save the file, keywords like `proc` should be highlighted anyways |
20:47:11 | FromDiscord | <lqdev> check that |
20:47:26 | FromDiscord | <lqdev> but symbols won't be highlighted until you save |
20:47:47 | FromDiscord | <lqdev> for starters, try `:set ft=nim` |
20:48:38 | FromDiscord | <Shucks> Damn, nim had its own ide? I would kill to use it. |
20:48:53 | disruptek | good; i have a list of people i need to remove. |
20:49:17 | FromDiscord | <Shucks> If you bring up NimEdit I gonna do it. |
20:50:58 | FromDiscord | <Yardanico> aporia was there |
20:51:01 | FromDiscord | <Yardanico> https://github.com/nim-lang/Aporia |
20:51:37 | * | Guest55294 quit (Remote host closed the connection) |
20:51:45 | FromDiscord | <Yardanico> but it's gtk2 |
20:52:20 | FromDiscord | <Galdor Sereg> That's what I get when trying to :set ft=nim https://media.discordapp.net/attachments/371759389889003532/732701031451852831/Neovim_2.JPG |
20:52:32 | FromDiscord | <Rika> uh |
20:52:35 | FromDiscord | <lqdev> that's odd. |
20:52:39 | FromDiscord | <Rika> press escape and try again? |
20:53:32 | FromDiscord | <lqdev> look at the bottom right corner of your screen, there's a `c` and it shows you your current movement (or whatever it's called) |
20:53:41 | FromDiscord | <lqdev> if you want to bring up the command line it needs to be empty |
20:53:48 | FromDiscord | <Rika> so press escape |
20:53:52 | FromDiscord | <lqdev> exactly |
20:54:00 | FromDiscord | <lqdev> it cancels the current movement |
20:54:02 | FromDiscord | <Rika> to cancel the |
20:54:02 | FromDiscord | <Rika> yeah |
20:54:05 | disruptek | alt-f4 turns on aiming assist. |
20:54:12 | FromDiscord | <Galdor Sereg> That time it put it on the screen |
20:54:17 | FromDiscord | <Rika> ? |
20:54:18 | FromDiscord | <Rika> wdym? |
20:54:21 | FromDiscord | <Galdor Sereg> I think I need to go study Vim for a little bit |
20:54:29 | FromDiscord | <Galdor Sereg> It typed it into the text area |
20:54:29 | FromDiscord | <lqdev> yeah, use :Tutor to get started |
20:54:35 | FromDiscord | <Rika> that should be correct yes |
20:54:37 | FromDiscord | <Rika> then press enter |
20:55:05 | FromDiscord | <Rika> looks like this right? https://media.discordapp.net/attachments/371759389889003532/732701726167138307/unknown.png |
20:55:13 | FromDiscord | <Rika> at least the lowest row |
20:55:29 | FromDiscord | <Rika> if so, just press enter to run the command |
20:55:49 | FromDiscord | <Rika> ~~i learned vim without using the Tutor~~ |
20:56:16 | FromDiscord | <Galdor Sereg> I'm pretty sure I need the tutor, cause its not doing anything in either place https://media.discordapp.net/attachments/371759389889003532/732702025871261728/Neovim.JPG |
20:56:31 | FromDiscord | <lqdev> press i to enter insert mode |
20:56:37 | FromDiscord | <lqdev> and type `proc` |
20:56:40 | FromDiscord | <lqdev> or some other keyword |
20:57:22 | FromDiscord | <Galdor Sereg> Shows up like regular text |
20:57:50 | FromDiscord | <lqdev> try the tutor, please. |
20:58:05 | FromDiscord | <lqdev> to learn basic movement and stuff |
20:58:12 | FromDiscord | <Galdor Sereg> I will 🙂 I tihnk I might need to just reinstall from scratch and try again |
20:58:18 | FromDiscord | <Rika> i have a feeling... that you dont actually have the plugin installed |
20:58:18 | FromDiscord | <lqdev> no need to |
20:58:19 | FromDiscord | <Galdor Sereg> (edit) 'tihnk' => 'think' |
20:58:27 | FromDiscord | <lqdev> we can carry on with syntax and stuff after you learn the basics :) |
20:58:37 | FromDiscord | <Galdor Sereg> @Rika it's completely possible :p |
21:01:00 | * | casaca quit (Excess Flood) |
21:01:12 | * | casaca joined #nim |
21:02:01 | FromDiscord | <dom96> > https://github.com/nim-lang/Aporia↵@Yardanico Aporia was the shit |
21:02:09 | FromDiscord | <Yardanico> ? |
21:02:14 | FromDiscord | <Yardanico> you pigned the wrong person I think 😛 |
21:02:31 | FromDiscord | <dom96> I quoted you 🙂 |
21:02:43 | FromDiscord | <Yardanico> there's also my fork with some fixes so it at least launches on latest nim, but it still has crashes and stuff https://github.com/Yardanico/Aporia |
21:02:56 | FromDiscord | <Yardanico> and I don't know if I translated socket code to async correctly |
21:03:00 | FromDiscord | <lqdev> I may have a shot at writing a Nim editor at some point, but not now. I have more important projects on my head, and neovim servers me very well |
21:03:15 | FromDiscord | <dom96> Yeah, don't do it. It's a massive time sink. |
21:03:33 | FromDiscord | <dom96> If I had the time I would simply create a great plugin for VS Code |
21:03:55 | FromDiscord | <Clyybber> Argh, theres an issue when we expand all the elif into else: if: |
21:04:25 | FromDiscord | <Clyybber> when the expanded thing is an if expression |
21:04:33 | FromDiscord | <Clyybber> because then we'll get a lot of temporaries |
21:04:59 | * | narimiran quit (Ping timeout: 240 seconds) |
21:05:18 | FromDiscord | <Clyybber> ah, nevermind. I think that could be done without temporarie |
21:05:19 | FromDiscord | <Clyybber> s |
21:06:12 | * | casaca quit (Max SendQ exceeded) |
21:06:13 | FromDiscord | <dom96> holy shit, Guido is turning Python into Nim https://lwn.net/ml/python-ideas/CAP7+vJKsrT-n4rHjaR4PYPRq09JOZcoR54ZjkboOkZcYhB+7oA@mail.gmail.com/ |
21:06:27 | * | casaca joined #nim |
21:06:33 | FromDiscord | <Yardanico> ahhaha |
21:07:14 | FromDiscord | <Yardanico> "I believe there are some other languages that support a similar grammar↵(Ruby? R? Raku?) but I haven't investigated." didn't mention Nim smh 😦 |
21:07:50 | FromDiscord | <dom96> Hopefully he sees my comment https://news.ycombinator.com/item?id=23837893 |
21:08:34 | FromDiscord | <Clyybber> Araq: Hmm, maybe we really *should* do the statementizing in injectdestructors |
21:09:05 | FromDiscord | <Yardanico> @dom96 is he on HN though? |
21:09:18 | FromDiscord | <Yardanico> you can post in the mail list since it's public 😛 |
21:09:42 | FromDiscord | <dom96> Probably not. Also this message is from June |
21:10:46 | FromDiscord | <Shucks> huh. This isn't python? Was just wondering why pycharm doesnt works! |
21:11:26 | FromDiscord | <Yardanico> ? |
21:12:02 | FromDiscord | <Shucks> nvm. Doing bad jokes is something of my best skills. |
21:12:43 | FromDiscord | <Yardanico> @tim-st what corruption were you talking about with ARC? |
21:12:56 | FromDiscord | <Yardanico> with your example in https://github.com/nim-lang/Nim/issues/14983 I get the exact same results with refc/arc/arc + useMalloc |
21:12:58 | disbot | ➥ memory corruption for seq.add(seq) with gc:arc and d:useMalloc ; snippet at 12https://play.nim-lang.org/#ix=2rDE |
21:13:10 | FromDiscord | <Yardanico> on latest devel |
21:13:15 | FromDiscord | <Rika> @dom96 many people dont like it it seems |
21:13:46 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/732706426752991242/unknown.png |
21:13:50 | FromDiscord | <Yardanico> I think that clyybber's PR might've fixed it, not sure |
21:14:35 | FromGitter | <tim-st> Yardanico: I try to find a newer nightly build for windows and test it again |
21:14:52 | * | tane quit (Quit: Leaving) |
21:15:04 | * | nikita` quit (Quit: leaving) |
21:15:21 | FromDiscord | <Yardanico> try this ones: |
21:15:37 | FromDiscord | <Yardanico> https://github.com/alaviss/nightlies/releases/tag/2020-07-13-devel-6cc0061a72826022991262eb8e31b97f6fdf37e9 |
21:15:43 | FromDiscord | <Yardanico> windows x32 or x64 depending on what you want |
21:15:44 | FromDiscord | <Clyybber> oh, did I? |
21:15:50 | FromDiscord | <Clyybber> that would be cool if I did fix it |
21:16:01 | FromDiscord | <Yardanico> @Clyybber well it works for me correctly as far as I can see |
21:16:08 | FromDiscord | <Clyybber> oooooooh, seems like my analysis before was wrong |
21:16:18 | FromDiscord | <Clyybber> yeah, this is a case that *should* be working |
21:16:34 | FromDiscord | <Yardanico> valgrind doesn't show any errors either |
21:16:35 | FromDiscord | <Yardanico> "==17486== total heap usage: 14 allocs, 14 frees, 6,324 bytes allocated" |
21:16:35 | FromDiscord | <Clyybber> *probably* |
21:16:41 | FromGitter | <tim-st> Yardanico: thanks for the link, I searched a complete page before :\ |
21:16:58 | FromDiscord | <Yardanico> ah it shows some errors though |
21:17:02 | FromDiscord | <Yardanico> "Invalid read of size 8" |
21:17:05 | FromDiscord | <Yardanico> hrm |
21:17:09 | FromDiscord | <Clyybber> ah |
21:17:16 | FromDiscord | <Clyybber> well then I know the cause |
21:17:27 | FromDiscord | <Clyybber> its because the seq is getting sinked on the RHS |
21:17:39 | FromDiscord | <Clyybber> but is getting evaluated before that on the LHS |
21:17:46 | FromDiscord | <Clyybber> now thats not an issue |
21:17:49 | FromDiscord | <Yardanico> also, anyone knows how to update locally checked out github PR with git? |
21:17:54 | FromGitter | <tim-st> originally I wanted to create the issue from two hours ago, but then I saw this one... |
21:17:56 | FromDiscord | <Clyybber> unless add determines it should grow the seq |
21:17:59 | FromDiscord | <Yardanico> I mean I checked it out a few days ago, how to pull in latest changes now? |
21:18:00 | FromDiscord | <Clyybber> and thus realloc |
21:19:00 | Yardanico | !status |
21:19:02 | FromDiscord | Uptime - 6 days, 12 hours, and 24 minutes |
21:19:21 | FromGitter | <tim-st> No, it's not fixed |
21:19:25 | * | natrys quit (Ping timeout: 264 seconds) |
21:19:33 | FromGitter | <tim-st> same issues on devel from 13th of july |
21:19:58 | FromDiscord | <Clyybber> my fixes came in today, but yeah they don't fix it |
21:20:35 | FromGitter | <tim-st> ok, I didnt check the commits later than this date |
21:21:10 | FromGitter | <tim-st> now I have to reproduce this other issue which created segfault |
21:30:36 | * | audiophile joined #nim |
21:33:45 | FromDiscord | <Yardanico> @Clyybber just a quick question - orc-specific code (e.g. checking objects for cycles, etc) is inserted in the backend? |
21:34:03 | FromDiscord | <Yardanico> or in the compiler frontend before the codegen? |
21:41:35 | FromDiscord | <Yardanico> on an unrelated note ircord has been running for 6.5 days without restarts 😛 |
21:42:09 | disruptek | orc is in the frontend. |
21:42:53 | FromDiscord | <Yardanico> wait really? |
21:43:51 | leorize | yea, there's even a new --expandArc which will show you the AST transformation done by destructors in 4raq pending PR |
21:44:44 | FromGitter | <tim-st> when I'm using arc and I don't know, if I have a cycle in my code, will the compile see it? |
21:44:57 | FromDiscord | <Yardanico> use orc when not sure |
21:45:03 | FromDiscord | <Avatarfighter> What is up everyone |
21:45:07 | FromDiscord | <Yardanico> well @leorize I'm in the process of toying around with expandArc |
21:45:07 | leorize | unless it's super obvious, the compiler wouldn't know |
21:45:10 | FromDiscord | <Yardanico> so I asked |
21:45:19 | FromDiscord | <Yardanico> because I don't see orc-specific code in expandArc 😛 |
21:45:20 | FromGitter | <tim-st> ok, thanks |
21:45:23 | FromDiscord | <Yardanico> well it might make sense |
21:45:37 | leorize | use orc for programs, but design with arc in mind for libraries |
21:46:14 | FromGitter | <tim-st> orc has the "stop the world gc" thing, right? |
21:46:19 | FromDiscord | <Yardanico> yeah, basically it's better to design data structures without cycles (if it's possible), and use {.acyclic.} when you're sure that your object type isn't cyclic |
21:46:25 | leorize | @tim-st nope |
21:46:36 | FromGitter | <tim-st> ok, cool :D |
21:46:57 | FromDiscord | <Avatarfighter> Stupid question, mostly bc I haven't learned this in school yet but what is a cycle( a GC cycle?)? |
21:47:02 | leorize | orc is kind of a hybrid between a fully thread-safe gc and a thread-local gc |
21:47:46 | FromDiscord | <Yardanico> @Avatarfighter it's actually simple |
21:48:00 | FromDiscord | <Yardanico> object a points to object b, object b points to object c, object c points to object a |
21:48:05 | FromDiscord | <Avatarfighter> oh |
21:48:11 | FromDiscord | <Yardanico> that's the simplest example 😛 |
21:48:14 | FromDiscord | <Avatarfighter> ok yeah |
21:48:14 | leorize | IIRC arc/orc have limited data sharing between threads in the form of graph moving, meaning references must be moved between threads and no two threads can (safely) access the same ref at the same time. |
21:48:28 | FromDiscord | <Avatarfighter> I had a rough idea of what you guys meant but I don't want to confuse myself lmfao |
21:48:30 | FromDiscord | <Yardanico> @leorize I thought it wasn't implemented yet? |
21:48:45 | FromDiscord | <Yardanico> @Avatarfighter and cycle here is because even after no other code uses these objects, their refcounts will be 1 |
21:48:51 | FromDiscord | <Yardanico> because each of them is references 1 time by the other object |
21:48:57 | FromDiscord | <Yardanico> (edit) 'references' => 'referenced' |
21:49:11 | FromDiscord | <Avatarfighter> Yeah that makes a lot of sense, just don't make circular code basically lol |
21:49:14 | leorize | Yardanico: it should be implemented by now, but query Araq just to be sure |
21:49:17 | FromDiscord | <Yardanico> you should watch https://www.youtube.com/watch?v=aUJcYTnPWCg 😛 |
21:49:28 | FromDiscord | <Yardanico> it explains cycles too, and how orc deals with them |
21:49:34 | FromDiscord | <Avatarfighter> I shall 😛 Thank you very much 🙂 |
21:49:37 | FromDiscord | <Yardanico> 27:00 |
21:49:40 | FromDiscord | <Yardanico> (edit) 'at27:00 ... ' => 'at27:00about orc' |
21:49:46 | FromDiscord | <Avatarfighter> Its been a minute since I've written some Nim tbh |
21:49:52 | FromGitter | <tim-st> can I have cycles without ref objects? |
21:49:59 | FromDiscord | <Yardanico> well yes |
21:50:12 | leorize | cycles can be introduced by closures |
21:50:16 | leorize | those are harder to spot |
21:50:33 | FromDiscord | <Yardanico> I mean it's still ref objects in the end, but other way - |
21:50:38 | FromDiscord | <Avatarfighter> Nim async has cycles right? |
21:50:48 | leorize | loads of cycles, yes :P |
21:50:53 | FromDiscord | <Avatarfighter> noice |
21:50:59 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2rDW |
21:51:02 | FromDiscord | <Avatarfighter> I feel like I've already asked this like 4 times lmao |
21:51:03 | FromDiscord | <Yardanico> no explicitly written "ref object" 😛 |
21:51:11 | FromDiscord | <Avatarfighter> Nice to see you Leorize btw 🙂 |
21:51:22 | leorize | o/ |
21:51:42 | FromDiscord | <Avatarfighter> ok guys this is really easy actually |
21:51:50 | FromGitter | <tim-st> but the compiler would know when it creates a closure and at the same time is in compile mode "arc"? |
21:52:35 | leorize | I don't think the compiler is aware of that atm |
21:52:41 | leorize | cycles analysis is really premature |
21:52:50 | leorize | if it's good we wouldn't need orc :P |
21:53:05 | FromDiscord | <Yardanico> well it's not possible to cover all cases at compile-time 😛 |
21:53:08 | FromDiscord | <Yardanico> as far as I know |
21:53:11 | FromDiscord | <Yardanico> about detecting cycles |
21:53:19 | FromGitter | <tim-st> ok, thanks, that's good to know |
21:53:30 | FromDiscord | <Avatarfighter> gotta cover them all pre compile-time :GWjiangoPepeGenius: |
21:53:33 | FromDiscord | <Avatarfighter> 😛 |
21:53:43 | FromGitter | <ynfle> @Varriount, if wanna look at the `SIGSEGV` issue https://github.com/ynfle/nim-test-runner/commit/6cbe2994011bc991a5d6609323f20d99b8e0b603 & https://github.com/ynfle/nim-test-runner/runs/871136877 |
21:53:47 | leorize | owned ref will help with that once its finalized |
21:54:08 | FromGitter | <ynfle> But it seems to be solved (at least locally) with `--gc:arc` |
21:54:42 | FromDiscord | <Yardanico> envToCStringArray hm |
21:54:51 | FromDiscord | <Avatarfighter> is arc/orc available in the current stable release of nim or do you still need devel to use it? |
21:54:54 | FromDiscord | <Yardanico> maybe it's some weird native OS API interaction issue? |
21:54:55 | FromGitter | <ynfle> It's using osproc |
21:54:58 | FromDiscord | <Yardanico> @Avatarfighter it's much better to use devel |
21:55:00 | FromDiscord | <Yardanico> especially for orc |
21:55:14 | FromDiscord | <Yardanico> arc has a lot of new stuff in devel too |
21:55:24 | FromDiscord | <Avatarfighter> alright I'll set that up then 🙂 |
21:55:31 | FromDiscord | <Avatarfighter> gosh it feels good to be back to nim |
22:04:34 | * | laqq3 joined #nim |
22:06:22 | * | laqq3 quit (Remote host closed the connection) |
22:06:34 | * | laqq3 joined #nim |
22:07:34 | FromDiscord | <Yardanico> oof |
22:08:12 | FromDiscord | <Yardanico> so from kostya/benchmarks (I added packedjson there a month ago) json benchmark for nim. last devel refc - ~0.95s, 381mb peak |
22:08:26 | FromDiscord | <Yardanico> ah sorry that's with arc |
22:08:26 | FromDiscord | <Yardanico> but! |
22:08:34 | * | laqq3_ joined #nim |
22:09:07 | FromDiscord | <Yardanico> if I replace when isMainModule with proc main = ... main() the memory usage is much less |
22:09:09 | FromDiscord | <Yardanico> 262mb peak |
22:09:20 | FromDiscord | <Yardanico> because with when isMainModule apparently the compiler couldn't sink a variable |
22:09:31 | FromDiscord | <Avatarfighter> lmao what |
22:09:39 | FromDiscord | <Yardanico> well it's generally recommended to use proc main |
22:09:41 | FromDiscord | <Yardanico> and not global-level code |
22:09:54 | FromDiscord | <Yardanico> but I wonder if it's a limitation of global scope |
22:09:57 | FromDiscord | <Yardanico> that variables can't be sinked |
22:10:59 | * | laqq3 quit (Ping timeout: 240 seconds) |
22:12:01 | FromDiscord | <Avatarfighter> got a link to packedjson btw? |
22:12:06 | FromDiscord | <Avatarfighter> sounds really interesting |
22:12:21 | FromDiscord | <Yardanico> Ihttps://github.com/Araq/packedjson |
22:12:26 | FromDiscord | <Avatarfighter> thanks |
22:13:30 | FromDiscord | <Yardanico> although the benchmark in kostya/benchmarks is a bit flawed anyway |
22:13:39 | FromDiscord | <Yardanico> all implementations there first fully read the file in memory, and then parse |
22:13:55 | FromDiscord | <Yardanico> if I change code to make packedjson to parse the file directly (so it can use streams), peak RAM usage is 156mb with latest arc |
22:14:11 | FromDiscord | <Yardanico> compare that with 1281mb with stdlib's json 😛 |
22:14:29 | FromDiscord | <Yardanico> well actually need to change the stdlib test too for fairness |
22:15:40 | FromDiscord | <Avatarfighter> wow thats cool |
22:16:25 | FromDiscord | <Yardanico> well yeah, changing stdlib json test to parse from file directly strips of ~100mb too (because that's the size of the file) |
22:17:10 | FromDiscord | <Yardanico> although apparently packedjson with refc doesn't suffer from high memory usage even in that case |
22:17:18 | FromDiscord | <Yardanico> although it's slower than packedjson with arc (1.25s vs 0.9s) |
22:17:26 | FromDiscord | <Yardanico> for parsing a 107mb json file |
22:17:42 | FromGitter | <ynfle> > But it seems to be solved (at least locally) with `--gc:arc` ⏎ ⏎ Nvm, wrong branch |
22:21:01 | FromDiscord | <Shucks> Holy cow. Did anyone managed to get plug.vim runnign with windows neovim? |
22:24:23 | FromDiscord | <Clyybber> @Yardanico Its done in liftdestructors |
22:25:15 | FromGitter | <awr1> @Shucks I use Plugged, works fine |
22:25:36 | FromGitter | <awr1> You may need to make sure your python providers are working |
22:28:09 | FromGitter | <awr1> has anyone ever floated the idea of making a hoogle-like docs system for Nim? |
22:28:50 | disruptek | no one of sound mind and body. |
22:28:52 | FromDiscord | <Shucks> I guess im actually missing some autoload directory |
22:29:13 | * | krux02 quit (Remote host closed the connection) |
22:29:55 | FromGitter | <awr1> Meh it's just kinda annoying searching for library documentation on google |
22:30:10 | disruptek | !repo ndoc |
22:30:12 | disbot | https://github.com/nodeca/ndoc -- 9ndoc: 11js port of pdoc, with extentions 15 93⭐ 8🍴 7& 29 more... |
22:30:16 | disruptek | not that one. |
22:30:19 | disruptek | !repo disruptek/ndoc |
22:30:20 | disbot | https://github.com/disruptek/ndoc -- 9ndoc: 11like pydoc but for nim 15 0⭐ 0🍴 |
22:30:50 | FromGitter | <awr1> hmmm |
22:31:22 | * | audiophile_ joined #nim |
22:33:46 | FromGitter | <awr1> good ideas here. TBH it wouldn't need to be completely like Hoogle, as in a centralized web-only service, it should work offline too |
22:34:11 | * | audiophile quit (Ping timeout: 240 seconds) |
22:34:18 | * | audiophile_ is now known as audiophile |
22:34:59 | FromGitter | <awr1> nim already kinda has the infrastructure to generate docs in a useful format, i.e. JSON generation |
22:43:45 | leorize[m] | @iffy: here's something for you to play with: https://play.nim-lang.org/#ix=2rEc |
22:43:50 | leorize[m] | untested on windows |
22:45:20 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Is there something like https://github.com/kkawakam/rustyline for Nim? |
22:45:46 | FromDiscord | <Rika> why? |
22:45:49 | FromDiscord | <Rika> we have linenoise |
22:45:50 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> It implements history, arrow keys, ctrl c and escape codes |
22:45:56 | FromDiscord | <Yardanico> yes, exactly |
22:45:59 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> What's linenoise? |
22:46:06 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> !repo linenoise |
22:46:07 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> ? |
22:46:07 | disbot | https://github.com/jangko/nim-noise -- 9nim-noise: 11Nim implementation of linenoise command line editor 15 22⭐ 3🍴 7& 1 more... |
22:46:17 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> This? |
22:46:40 | FromDiscord | <Rika> yeah basically |
22:46:48 | FromDiscord | <Rika> or uh the nim binding |
22:47:00 | FromDiscord | <Rika> no package, since it's in stdlib |
22:47:05 | leorize[m] | !repo nimprompt |
22:47:06 | disbot | no results 😢 |
22:47:11 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Oh okay |
22:47:16 | leorize[m] | !repo prompt |
22:47:17 | disbot | https://github.com/icyphox/nicy -- 9nicy: 11:snowflake: a nice and icy ZSH prompt in Nim 15 135⭐ 6🍴 7& 6 more... |
22:47:39 | FromDiscord | <Rika> https://nim-lang.org/docs/linenoise.html |
22:48:01 | leorize[m] | !repo nim-prompt |
22:48:02 | FromDiscord | <Recruit_main707> Regarding Nim rfcs... there are very little milestones, is it because basically 99% of the ideas have been rejected already? |
22:48:02 | disbot | https://github.com/icyphox/nicy -- 9nicy: 11:snowflake: a nice and icy ZSH prompt in Nim 15 135⭐ 6🍴 7& 3 more... |
22:48:58 | leorize[m] | !repo status-im/nim-prompt |
22:48:59 | disbot | no results 😢 |
22:49:02 | FromDiscord | <Yardanico> @Recruit_main707 because no one adds these 😛 |
22:49:10 | FromDiscord | <Yardanico> I mean not 99% |
22:49:31 | FromDiscord | <Yardanico> a lot of RFCs are accepted |
22:49:36 | FromDiscord | <Yardanico> despite not having an "Accepted RFCs" label |
22:49:40 | FromDiscord | <Yardanico> not the majority of course |
22:50:01 | * | lritter quit (Quit: Leaving) |
22:50:27 | FromDiscord | <InventorMatt> are there any updated libraries nim for converting/importing images to arrays? |
22:50:46 | FromDiscord | <Yardanico> what do you mean by that? |
22:50:49 | leorize[m] | !repo flippy |
22:50:50 | disbot | https://github.com/treeform/flippy -- 9flippy: 11Flippy is a simple 2d image and drawing library. 15 38⭐ 6🍴 |
22:50:58 | FromDiscord | <Yardanico> to pixels you mean? |
22:51:16 | FromDiscord | <Yardanico> but yeah flippy |
22:51:34 | FromDiscord | <Yardanico> it only supports png though |
22:51:54 | FromDiscord | <Yardanico> there's https://github.com/define-private-public/stb_image-Nim as a wrapper for stb_image |
22:52:03 | FromDiscord | <InventorMatt> well I want to be able to do math operations on the arrays. like how in python numpy can be used for images |
22:52:10 | FromDiscord | <InventorMatt> in python |
22:52:33 | Prestige | Does Nim have any sort of multiple inheritence? |
22:52:58 | FromDiscord | <Recruit_main707> Yes |
22:53:17 | FromDiscord | <Yardanico> not really |
22:53:21 | FromDiscord | <Yardanico> It's single inheritace |
22:53:28 | FromDiscord | <Yardanico> but we have multimethods and object variants 😛 |
22:53:46 | FromDiscord | <Yardanico> @Recruit_main707 "multiple inheritance" usually means something like |
22:53:53 | FromDiscord | <Yardanico> "type MyType = object of A, B" |
22:54:08 | FromDiscord | <Yardanico> so a type inherits from two types |
22:55:44 | * | abm quit (Read error: Connection reset by peer) |
22:55:45 | FromDiscord | <Recruit_main707> Ah, sorry, i missunderstood |
22:57:15 | FromDiscord | <Recruit_main707> @InventorMatt you can probably use flippy for that, just write a little function or template to do getRgbA of all pixels of an “Image” object |
22:57:21 | Prestige | Been trying to figure out how ECS is actually implemented but I haven't found any clean examples, but I'll have to keep investigating since we don't have mulitple inheritence |
22:59:01 | leorize | you can look at some ecs frameworks |
23:07:10 | * | xet7 quit (Quit: Leaving) |
23:11:20 | * | xet7 joined #nim |
23:25:38 | FromGitter | <awr1> ECS is really based more around composition than inheritance |
23:27:56 | Prestige | Yeah, I understand ECS conceptually but haven't figured out how I'd implement it in a nice way |
23:29:49 | leorize | we need proper composition in nim :P |
23:29:50 | * | laqq3_ quit (Ping timeout: 256 seconds) |
23:30:19 | leorize | too bad vtref didn't fly |
23:32:02 | * | solitudesf quit (Ping timeout: 256 seconds) |
23:34:13 | * | ForumUpdaterBot quit (Remote host closed the connection) |
23:34:20 | * | ForumUpdaterBot joined #nim |
23:37:36 | * | solitudesf joined #nim |
23:43:26 | FromDiscord | <reilly> Hey @Varriount, just @ me whenever you want to fill me in on the question from last night. |
23:45:11 | Prestige | Hmm okay I think I see (partially) how entt could be implemented in Nim |
23:45:44 | Prestige | Would be a fun project if I can figure it out |
23:46:59 | * | solitudesf quit (Ping timeout: 240 seconds) |
23:51:09 | * | xet7 quit (Quit: Leaving) |
23:51:47 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> How do i make a cstring from a string? |
23:51:56 | FromDiscord | <Yardanico> cstring(string) |
23:52:00 | * | xet7 joined #nim |
23:52:08 | FromDiscord | <Yardanico> cstring("abc") |
23:54:22 | FromDiscord | <Technisha Circuit (LGBTQIAP+)> Thanks |