00:33:49 | * | Gustavo6046 joined #nim |
00:38:01 | * | PMunch quit (Quit: leaving) |
00:43:27 | * | lritter quit (Quit: Leaving) |
00:50:38 | * | Gustavo6046 quit (Ping timeout: 268 seconds) |
00:52:31 | * | Gustavo6046 joined #nim |
00:57:57 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
00:58:42 | * | Gustavo6046 joined #nim |
01:01:23 | FromDiscord | <fwsgonzo> can you pass a nim function to C? and then back? |
01:01:34 | disruptek | sure. |
02:37:49 | * | cyraxjoe joined #nim |
02:55:56 | FromDiscord | <exelotl> Hey, I'm trying to {.compile:"foo.s".} but foo.s is an assembly file which appears to be using the C preprocessor (it has #define in a couple of places) |
02:56:26 | disruptek | what do you want me to do about it? |
02:57:49 | FromDiscord | <exelotl> hang on I might have solved it xD |
02:58:24 | FromDiscord | <exelotl> basically the toolchain makefiles will happily compile these .s files, but Nim won't |
02:58:52 | disruptek | what's the difference? |
03:05:07 | leorize | just use --verbosity:3 and it should tell you how Nim is trying to compile those |
03:05:23 | disruptek | or --listCmd i suppose. |
03:05:29 | leorize | `make V=1` usually will print the commands the makefile run too |
03:06:55 | FromDiscord | <exelotl> oh thanks that'll be handy |
03:07:40 | FromDiscord | <exelotl> from what I can see so far, I need to pass "-x assembler-with-cpp" |
03:08:12 | FromDiscord | <exelotl> or rename my file to `foo.S` instead of `.foo.s` because of course I do. |
03:08:19 | FromDiscord | <exelotl> (edit) "`.foo.s`" => "`foo.s`" |
03:16:34 | FromDiscord | <exelotl> ah so the catch is you shouldn't pass it to a C file |
03:21:53 | FromDiscord | <Ben Boughton> sent a long message, see http://ix.io/2Kzn |
03:32:23 | FromGitter | <offbeat-stuff> Yo , I have a c++ type typedef slot7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7> parent_type; |
03:32:29 | FromGitter | <offbeat-stuff> How do import it into nim |
03:51:01 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:53:00 | * | muffindrake joined #nim |
03:53:48 | * | D_ quit (Ping timeout: 256 seconds) |
03:59:25 | FromDiscord | <Ben Boughton> If you see this later and want to email [email protected] |
04:05:16 | FromDiscord | <Cohjellah> had Thread[T] been deprecated or something? |
04:05:40 | disruptek | --threads:on |
04:05:41 | FromDiscord | <ElegantBeef> What makes you ask? |
04:05:54 | FromDiscord | <Cohjellah> mmmmmmmmmmmmmm VS code errors |
04:05:58 | FromDiscord | <Cohjellah> that's what makes me question |
04:05:59 | FromDiscord | <Rika> normal |
04:06:02 | FromDiscord | <Cohjellah> so it works, just intellisense |
04:06:08 | FromDiscord | <Rika> nimsuggest doesnt check with --threads:in |
04:06:09 | FromDiscord | <Rika> on |
04:06:15 | FromDiscord | <Cohjellah> boo |
04:06:58 | FromDiscord | <ElegantBeef> You need to add it to the cfg |
04:07:04 | FromDiscord | <Rika> i think you can make it but i forgot how |
04:07:04 | FromDiscord | <ElegantBeef> It cannot intuit you want threads on |
04:07:14 | FromDiscord | <ElegantBeef> You just add it to one of the cfg methods |
04:07:16 | FromDiscord | <Rika> ah yes internet sending late to make me look like an idiot |
04:08:25 | FromDiscord | <Cohjellah> so if I have a .nims file |
04:08:31 | FromDiscord | <Cohjellah> intellisense will pick up on it |
04:09:27 | FromDiscord | <Cohjellah> also, array/list[T].len is supposed to return an integer right? |
04:09:42 | FromDiscord | <Cohjellah> sorry, nvm ignore that |
04:09:45 | FromDiscord | <Cohjellah> I meant string.len |
04:10:07 | FromGitter | <offbeat-stuff> How to autoconvert OPERATOR_CLEAR to OperatorClear |
04:10:08 | FromDiscord | <Rika> yes why |
04:10:10 | FromGitter | <offbeat-stuff> strutils |
04:10:18 | disruptek | no point. |
04:10:37 | FromDiscord | <Rika> why do you need that offbeat? |
04:11:05 | FromDiscord | <Rika> theres no proc for that |
04:11:26 | disruptek | there is, but it's 1.4+ iirc. |
04:11:29 | FromDiscord | <Avatarfighter> offbeat-stuff: making that proc would be a great way to practice nim though |
04:11:39 | FromDiscord | <Cohjellah> Idk I'm trying to do 0 .. <param.len |
04:11:46 | FromDiscord | <Cohjellah> and it's just throwing me errors about type mismatches |
04:11:58 | FromDiscord | <Rika> avatar i have a small question, whats your opinion on the nimble package `nim-random`? |
04:12:09 | disruptek | i have an impl in ups, also. |
04:12:10 | disruptek | !repo ups |
04:12:11 | disbot | https://github.com/dmknght/UPS -- 9UPS: 11Super stupid secret 15 1⭐ 1🍴 7& 1 more... |
04:12:13 | FromDiscord | <Rika> use ..< instead of .. < |
04:12:16 | disruptek | !repo disruptek/ups |
04:12:16 | disbot | https://github.com/disruptek/ups -- 9ups: 11a package handler 15 1⭐ 0🍴 |
04:12:30 | FromGitter | <offbeat-stuff> Converting c++ enums to well nim code |
04:12:43 | FromDiscord | <Cohjellah> omg |
04:12:43 | disruptek | those are already equivalent in nim. |
04:12:47 | FromDiscord | <Rika> you dont need to convert them |
04:12:47 | FromDiscord | <Cohjellah> Thanks Rika, fk |
04:14:03 | FromGitter | <offbeat-stuff> Nah I'm just renaming them |
04:14:03 | FromGitter | <offbeat-stuff> Is there a reduce in nim |
04:14:09 | FromDiscord | <Rika> @Avatarfighter resending because it seems you didnt see, "i have a small question, whats your opinion on the nimble package nim-random?" |
04:14:13 | disruptek | foldl |
04:14:24 | FromDiscord | <Rika> ^ in sequtils |
04:14:30 | FromDiscord | <Avatarfighter> looking at it |
04:14:52 | * | D_ joined #nim |
04:15:41 | FromDiscord | <Avatarfighter> Rika: it looks good |
04:15:46 | FromDiscord | <Avatarfighter> why you ask |
04:16:00 | FromDiscord | <Rika> because i need more opinions than my own |
04:16:20 | FromDiscord | <Rika> would you prefer nim-random's api over nim's std/random? |
04:16:27 | FromDiscord | <ElegantBeef> doesnt ask me, wow |
04:16:35 | FromDiscord | <Rika> well you werent here |
04:17:02 | FromDiscord | <Avatarfighter> Rika: yeah I would |
04:17:12 | FromDiscord | <flywind> it's a bit broken in windows I think |
04:17:12 | FromDiscord | <Rika> im kinda iffy on nim-random really, it feels e |
04:17:13 | FromDiscord | <Rika> eh |
04:17:14 | FromDiscord | <Avatarfighter> its straightforward to read and use |
04:18:03 | FromDiscord | <Rika> holy fuck this is an old package |
04:18:08 | FromDiscord | <Rika> docs generated 2015 |
04:19:40 | FromDiscord | <flywind> `pkg/random` got a broken system random generator in windows, someone made a workaround https://github.com/theAkito/nim-neoid/blob/39e6a67900f990925a2d279cbae1675e822ebe4f/neoid.nim#L8 |
04:20:02 | FromDiscord | <ElegantBeef> I personally dislike making an RNG then passing it around |
04:20:08 | FromDiscord | <Rika> i see |
04:20:19 | FromDiscord | <Cohjellah> have they changed how threading works in the past 2 years |
04:20:32 | FromDiscord | <Cohjellah> as in, made it safer, somewhat |
04:20:37 | FromDiscord | <Rika> because i just converted a bunch of rngs into nim and i was thinking if i should make them nim-random compatible |
04:20:42 | leorize | that's in-progress |
04:20:43 | FromDiscord | <Cohjellah> nvm I'm dumb ignore 🙂 |
04:22:30 | FromDiscord | <ElegantBeef> Ah so keep up with the usualy coh 😛 |
04:23:06 | FromDiscord | <Rika> huh why does nim-random not have a randomUint16? |
04:23:14 | FromDiscord | <Rika> just found that a bit odd |
04:27:35 | FromDiscord | <Cohjellah> RNG? |
04:27:42 | FromDiscord | <Avatarfighter> random number gene |
04:27:44 | FromDiscord | <Avatarfighter> (edit) "gene" => "generator" |
04:27:51 | FromDiscord | <Cohjellah> (edit) |
04:27:54 | FromDiscord | <ElegantBeef> Random number geezus |
04:28:00 | FromDiscord | <Cohjellah> yeah I deleted all my words before RNG |
04:28:03 | FromDiscord | <Cohjellah> idk how |
04:28:03 | FromDiscord | <ElegantBeef> Nope we have random in the stdlib |
04:28:11 | FromDiscord | <Cohjellah> ok so why does random-nim exist |
04:28:19 | FromDiscord | <ElegantBeef> Cause there are so many different impls 😄 |
04:28:29 | FromDiscord | <Cohjellah> entropy, entropy everywhere |
04:29:05 | FromDiscord | <ElegantBeef> Well look at json, we have json, packedjson, jason, treeform's json lib, planetis' json library |
04:29:43 | FromDiscord | <Cohjellah> oh my god, do we? |
04:29:46 | FromDiscord | <ElegantBeef> Yes |
04:29:54 | FromDiscord | <Cohjellah> surely regular old json is good nuff |
04:30:10 | FromDiscord | <ElegantBeef> Well the regular json library is slower due to how it works |
04:30:16 | FromDiscord | <ElegantBeef> But it also enables manually going through nodes |
04:30:30 | FromDiscord | <ElegantBeef> Where as treeforms and jason i believe are straight to objects or from |
04:30:49 | FromDiscord | <ElegantBeef> So they're faster |
04:30:51 | FromDiscord | <Cohjellah> yeah nodes are groovy |
04:31:06 | * | D_ quit (Ping timeout: 265 seconds) |
04:33:00 | FromDiscord | <Rika> whos the next person to make a json library |
04:33:27 | FromDiscord | <Cohjellah> I think it's cool we have so many variants on one library |
04:33:30 | FromDiscord | <Rika> fucking name it derulo or something xdddddddd |
04:33:34 | FromDiscord | <Cohjellah> Means people are actively making stuff for the community |
04:33:35 | disruptek | i'm waiting for a decent deserializer. |
04:33:47 | FromDiscord | <Cohjellah> deserializer for what in particular |
04:33:54 | disruptek | json. |
04:34:22 | * | spiderstew_ joined #nim |
04:35:37 | * | spiderstew quit (Ping timeout: 260 seconds) |
04:36:44 | * | rockcavera quit (Remote host closed the connection) |
04:37:29 | * | opal quit (Remote host closed the connection) |
04:37:57 | * | opal joined #nim |
04:38:07 | FromDiscord | <Cohjellah> standard ones not good enough? |
04:38:47 | FromDiscord | <ElegantBeef> Rika i could make one, and name it my last name |
04:38:53 | FromDiscord | <Cohjellah> beef |
04:38:59 | FromDiscord | <Cohjellah> that's a good lib name |
04:39:02 | FromDiscord | <ElegantBeef> Just perfect naming since jason is my first name |
04:39:03 | disruptek | i want a zero-copy stream deserializer and i'm not willing to use the status code. |
04:39:23 | FromDiscord | <Rika> okay Jason Beef |
04:39:34 | FromDiscord | <ElegantBeef> Thats... not my lastname |
04:39:41 | FromDiscord | <Rika> thats the joke |
04:39:43 | FromDiscord | <Rika> :facepalm1: |
04:39:44 | disruptek | that's his maiden name. |
04:39:48 | FromDiscord | <ElegantBeef> ^ |
04:39:51 | FromDiscord | <Cohjellah> haha |
04:39:53 | FromDiscord | <ElegantBeef> I'm a maiden at heart |
04:39:58 | FromDiscord | <Cohjellah> Maiden Beef |
04:40:11 | FromDiscord | <Cohjellah> What's your favourite beef, k go |
04:40:22 | FromDiscord | <ElegantBeef> Salmon |
04:40:26 | FromDiscord | <Cohjellah> nice |
04:42:47 | FromGitter | <offbeat-stuff> what is a good way to port enums into nim that come from c++ and c |
04:43:05 | disruptek | !repo gittyup |
04:43:06 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level libgit2 bindings that build upon nimgit2 15 6⭐ 1🍴 |
04:43:09 | disruptek | lotsa examples in there. |
04:45:49 | FromDiscord | <ElegantBeef> Much better version than those const ints |
04:47:15 | FromDiscord | <Rika> man i wish more people used procs with typedesc instead of putting the type name in the proc name |
04:47:28 | FromDiscord | <Rika> makes it easier by use generics instead of using a macro |
04:47:32 | FromDiscord | <Rika> by using |
04:47:35 | disruptek | i know. |
04:47:54 | disruptek | it makes me sad when i see new code written this way. |
04:47:57 | * | disruptek coughs. |
04:47:59 | disruptek | !repo flatty |
04:48:00 | disbot | https://github.com/treeform/flatty -- 9flatty: 11Flatty - tools and serializer for plain flat binary files. 15 11⭐ 1🍴 |
04:48:02 | * | disruptek coughs. |
04:49:02 | disruptek | compare to frosty's api. 🙄 |
04:54:03 | FromGitter | <offbeat-stuff> Let's I am import an enum from c++ |
04:54:15 | FromDiscord | <ElegantBeef> Reminds me that i should clean up the nimscripter marshalling logic |
04:54:32 | FromGitter | <offbeat-stuff> It doesn't matter right If name them anything in nim |
04:54:42 | FromGitter | <offbeat-stuff> as long as they are in equal amount |
04:55:26 | FromGitter | <offbeat-stuff> Sorry for bad english I am eating words in b/w because of slow typing |
04:56:51 | disruptek | sounds tasty. |
04:57:42 | FromGitter | <offbeat-stuff> So disruptek shouldn;t matter right |
04:59:56 | disruptek | most agree: disruptek doesn't matter. |
05:05:06 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:05:24 | * | njoseph joined #nim |
05:14:40 | disruptek | rika: what are you working on? |
05:15:41 | FromDiscord | <Rika> More PRNGs in pure nim for no reason other than I got interested in doing it again |
05:16:01 | disruptek | repo link? |
05:49:58 | FromDiscord | <Rika> None yet |
05:50:10 | disruptek | ball hairs? |
05:50:16 | FromDiscord | <Rika> I’ll upload it today xd |
05:52:00 | * | D_ joined #nim |
05:57:44 | FromGitter | <offbeat-stuff> Code |
05:57:45 | FromGitter | <offbeat-stuff> proc create*(filename: string; widthInPoints: cdouble; heightInPoints: cdouble): RefPtr[ ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ff00b59c746c6431cedcbe2] |
05:58:01 | FromGitter | <offbeat-stuff> Error |
05:58:03 | FromGitter | <offbeat-stuff> `/home/kai/coding/caironim/src/inc/cairomm/surface.nim(154, 6) Error: overloaded 'create' leads to ambiguous calls` |
05:59:47 | FromGitter | <offbeat-stuff> Error is same on both devel and stable version |
06:02:01 | FromDiscord | <Rika> Do you have another create procedure |
06:02:38 | FromGitter | <offbeat-stuff> Yeah |
06:02:49 | FromGitter | <offbeat-stuff> I will try and rename em |
06:05:52 | * | NimBot joined #nim |
06:06:34 | disruptek | zevv: the current problem is that the .cpsLift. stuff is getting duplicated, but only the exit/done proc. it's really weird. |
06:08:27 | disruptek | i think there's a rendering issue there, too; you have to treeRepr it because repr() cannot see it. |
06:10:09 | disruptek | something inside saften. |
06:39:06 | saem | Rika by chance are the PRNGs to drive generators for property based testing? ;) |
06:42:09 | FromDiscord | <Rika> No I just ported them for no damn reason really |
06:42:17 | FromDiscord | <Rika> You can use them for that maybe sure |
06:42:29 | FromDiscord | <Rika> I haven’t tested whether they accurately depict the original yet though |
06:45:45 | saem | I have enough Nim related projects to keep me busy for a while. |
06:46:09 | FromDiscord | <dk> How do nimlets do mixed backend projects? |
06:46:12 | saem | But it's on the list to get to if someone doesn't already. But I have a feeling it'll encounter some friction with the testing style I've sen thus far. |
06:46:41 | FromDiscord | <dk> Should I just split to a project per backend? |
06:47:51 | FromDiscord | <ElegantBeef> Why would you split the project |
06:48:02 | FromDiscord | <ElegantBeef> we use `when defined` so we dont severe the codebase |
06:49:21 | FromDiscord | <dk> because editor extension is too dumb to properly check the files if I set the backend in .nims instead of .nimble |
06:49:40 | FromDiscord | <dk> I don't think I can do `when` like that in .nimble |
06:51:18 | FromDiscord | <ElegantBeef> What are you doing in nimble |
06:51:22 | saem | The editor getting fixated on the backend is definitely my bad. |
06:52:19 | FromDiscord | <dk> I have `frontend.nim` that's JS backend and `backend.nim` that's C backend |
06:52:22 | FromDiscord | <dk> that's all |
06:52:38 | FromDiscord | <ElegantBeef> I mean in your nimble |
06:53:09 | FromDiscord | <dk> I just set the backend to C or JS |
06:53:37 | FromDiscord | <dk> because I don't know of a way to set the backend depending on filename or whatever |
06:53:43 | FromDiscord | <dk> other than .nims |
06:54:09 | FromDiscord | <dk> If I set it to C than the JS file doesn't get checked |
06:54:21 | FromDiscord | <dk> If I set it to JS than it's the other way around |
06:54:24 | FromDiscord | <ElegantBeef> Well in this case your probably do want to separate the code since they arent the same application |
06:54:41 | FromDiscord | <dk> Ok but muh shared code |
06:54:45 | FromDiscord | <dk> There's going to be some |
06:55:18 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:57:23 | FromDiscord | <dk> I guess shared code is a third project |
06:57:28 | saem | dk give me a few minutes, let me see if I can just back out the hard coded backend. |
06:58:06 | FromDiscord | <dk> 🤠 |
06:59:03 | * | D_ quit (Quit: No Ping reply in 180 seconds.) |
07:00:00 | * | D_ joined #nim |
07:12:37 | FromDiscord | <Cohjellah> who was that dude that had a fork of the QML library |
07:12:37 | FromDiscord | <Cohjellah> also |
07:12:43 | FromDiscord | <Cohjellah> What's the difference between QML and QT? |
07:12:44 | FromDiscord | <ElegantBeef> mratsim? |
07:12:46 | FromDiscord | <Cohjellah> That one |
07:12:56 | FromDiscord | <ElegantBeef> QML is a markup language qt is the underlying library afaik |
07:12:58 | FromDiscord | <Cohjellah> QML is QT I get that, is it just some variant |
07:12:58 | FromDiscord | <Cohjellah> yeah |
07:13:08 | FromDiscord | <Cohjellah> Is QML just nicer to write gui's with? |
07:14:03 | FromDiscord | <ElegantBeef> It's non programmatic, it's all markup |
07:15:53 | FromDiscord | <Cohjellah> QT is pretty standard. Can use in so many languages now, probs decent to stay with such a filled GUI library |
07:16:03 | FromDiscord | <Cohjellah> HMM |
07:18:05 | FromDiscord | <Cohjellah> would the best way to install unofficial forks of Nimble packages be to clone the repository then use Nimble Install on the .nimble file? |
07:18:28 | FromDiscord | <Cohjellah> or can you install forks through Nimble |
07:18:30 | FromDiscord | <Cohjellah> that would be pretty nifty |
07:18:41 | FromDiscord | <dk> you can just use the github url |
07:18:53 | FromDiscord | <ElegantBeef> You can also use `nimble develop` for the main branch |
07:19:38 | FromDiscord | <Cohjellah> oh true |
07:19:40 | FromDiscord | <Cohjellah> DK big brain |
07:19:49 | FromDiscord | <Cohjellah> what does nimble develop do |
07:25:43 | * | leorize quit (Ping timeout: 240 seconds) |
07:28:23 | FromDiscord | <Cohjellah> Fk that I'll just go do websites |
07:28:57 | FromDiscord | <ElegantBeef> https://github.com/nim-lang/nimble#nimble-develop |
07:29:49 | FromDiscord | <Cohjellah> legit I keep looking at gui frameworks like 👀 |
07:29:59 | FromDiscord | <Cohjellah> But, websites man, they're the present, the past and the future |
07:37:10 | * | leorize joined #nim |
07:40:32 | FromDiscord | <dk> Nobody will download qt just to launch your toy program tbh |
07:41:35 | FromGitter | <offbeat-stuff> How to convert RefPtr[Context] to var Context when RefPtr is a manager ptr in c++ |
07:41:45 | FromGitter | <offbeat-stuff> managed ptr |
07:47:45 | * | leorize quit (Remote host closed the connection) |
07:48:27 | * | leorize joined #nim |
07:48:59 | * | D_ quit (Quit: No Ping reply in 180 seconds.) |
07:49:56 | * | D_ joined #nim |
07:50:44 | saem | OK, prepping the release |
08:03:48 | * | narimiran joined #nim |
08:04:14 | * | pigmej quit (Ping timeout: 245 seconds) |
08:12:28 | saem | dk are you using vscode or vscodium? |
08:18:41 | saem | dk latest version should be up, I was a tad fast and loose so hopefully it's all good. If you do encounter any issues let me know or try a PR and you can always drop a version if it's a real bother. :D |
08:26:35 | FromGitter | <offbeat-stuff> ...........................fatal.nim(49) sysFatal ⏎ Error: unhandled exception: types.nim(161, 9) `result != nil` [AssertionDefect] |
08:26:40 | FromGitter | <offbeat-stuff> Why |
08:27:25 | FromGitter | <offbeat-stuff> #{.passc: gorge("pkg-config --cflags cairomm-1.0").} ⏎ ⏎ #{.passL: gorge("pkg-config --libs cairomm-1.0").} ⏎ ⏎ import cairomm/[surface,context,enums] ... [https://gitter.im/nim-lang/Nim?at=5ff02e6de7f693041f46a895] |
08:28:43 | FromGitter | <offbeat-stuff> https://play.nim-lang.org/#ix=2KAc |
08:31:07 | FromDiscord | <dk> @saem Not sure, I just use my package manager |
08:31:19 | FromDiscord | <dk> I'll try the new extension version now |
08:32:09 | saem | dk VS Code uses the MS Marketplace for extensions, the other ones use Open VSX. |
08:33:58 | FromDiscord | <dk> It seems to work fine, not hardcoded anymore |
08:35:25 | saem | dk that was the easy change. :D I also changed a bunch of things around the outline, symbol search, indexing of symbols, and a bunch of other stuff. Finally seeing a way out of the previous structure into something slightly more workable. |
08:35:57 | FromDiscord | <dk> It doesn't really matter, but editing a .nim file that has the js backend set in the .nims file creates a .js file in the src dir despite me not explicitly compiling it? |
08:36:05 | FromDiscord | <dk> that was a problem with the previous extension too |
08:36:27 | saem | Do you have build on save enabled? |
08:36:41 | FromDiscord | <dk> but since it's in src it doesn't replace anything |
08:36:59 | FromDiscord | <dk> nope |
08:37:52 | FromDiscord | <dk> it's `setCommand "js"` to be exact |
08:38:14 | saem | yeah... that's probably what's doing it. |
08:38:17 | FromDiscord | <dk> what I use to switch backends |
08:38:29 | saem | `--backend:js` |
08:38:55 | saem | This is what the extension uses: https://github.com/saem/vscode-nim/blob/master/nim.cfg |
08:39:24 | FromDiscord | <dk> fixed it 🥴 |
08:39:37 | FromDiscord | <dk> I didn't expect it to do anything different than setCommand |
08:39:55 | saem | Yeah, setCommand you're changing the action it'll take. ;) |
08:40:56 | saem | I believe what was happening was the extension was linting on save, which uses `nim check` by default, but then your switch changed that to -> `nim js` |
08:44:22 | FromDiscord | <dk> I think I did actually have linting working most of the time |
08:44:57 | FromDiscord | <dk> but that may explain why it used to have more problems working in my js-backend files than in normal ones... |
08:45:16 | FromDiscord | <dk> anyway, thanks |
08:46:31 | saem | NP, I would setup projects in the settings. Basically every "root" project file should go in there. Your backend and frontend ones from what I know of your project thus far. That way it won't spawn a million nim suggest processes. |
08:49:08 | saem | Maybe tomorrow I'll be able to go an hour before getting side-tracked on various other clean-ups and actually fix the way projects are handled. |
08:50:51 | FromDiscord | <dk> I have no idea what you're talking about with the projects |
08:51:08 | FromDiscord | <dk> I'll stick to a single .nimble since I can switch backends per file |
08:58:27 | ForumUpdaterBot | New question by Alex Craft: How to return `void` as a generic return type in Nim?, see https://stackoverflow.com/questions/65537411/how-to-return-void-as-a-generic-return-type-in-nim |
08:59:55 | saem | LoL. Check out the readme for the extension. Do a quick search for project. You can make an array of relative paths to nim files. As you start adding more files you'll want those set. |
09:06:05 | FromDiscord | <dk> That would prevent nimsuggest from running on files not listed there? |
09:06:42 | FromDiscord | <dk> I tend to have few files anyway |
09:07:24 | FromDiscord | <dk> Also I'm offended at having to create vscode-specific files in my projects |
09:27:50 | * | natrys joined #nim |
09:33:33 | * | aenesidemus_ joined #nim |
09:36:49 | * | aenesidemus quit (Ping timeout: 264 seconds) |
09:38:21 | FromDiscord | <flywind> https://news.ycombinator.com/item?id=25610996 |
09:39:13 | FromDiscord | <flywind> front page of hacker news again |
09:41:51 | FromDiscord | <ElegantBeef> @j-james odd that you shared that but yay i guess for being fp D: |
09:41:52 | FromDiscord | <ElegantBeef> (edit) "D:" => "😄" |
09:48:47 | FromDiscord | <flywind> I also post something old too https://news.ycombinator.com/item?id=25611550 |
09:49:11 | * | JustASlacker joined #nim |
09:57:50 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:26:05 | * | JustASlacker quit (Ping timeout: 256 seconds) |
10:42:37 | * | Vladar joined #nim |
10:50:23 | * | vicfred quit (Quit: Leaving) |
11:16:00 | * | JustASlacker joined #nim |
11:27:08 | * | Vladar quit (Ping timeout: 260 seconds) |
11:30:14 | FromDiscord | <fwsgonzo> how do you convert a cstring with a known length to string? |
11:30:31 | * | not_lum quit (Quit: Lum: Bye!) |
11:34:53 | mipri | $thecstring |
11:35:05 | FromDiscord | <fwsgonzo> that probably involves a strlen, right? |
11:35:10 | mipri | yep. |
11:35:24 | mipri | if you want to avoid that, create a new string and copyMem into it. |
11:38:15 | FromDiscord | <fwsgonzo> how can I get the ptr of a function? |
11:38:29 | FromDiscord | <fwsgonzo> `unsafeAddr(remote_trampoline)` -> "expression has no address" |
11:38:55 | FromDiscord | <fwsgonzo> function is cdecl so I assume there's no problems |
11:39:58 | * | synthmeat quit (Quit: WeeChat 3.0) |
11:41:57 | planetis[m] | disruptek: what features are you expecting from a json deserialiser |
11:49:04 | * | Vladar joined #nim |
11:49:42 | * | synthmeat joined #nim |
11:50:37 | * | mbomba joined #nim |
11:52:03 | * | mbomba quit (Client Quit) |
11:53:16 | * | JustASlacker quit (Ping timeout: 240 seconds) |
12:04:21 | FromDiscord | <lqdev> @fwsgonzo procs are already pointers so you can just cast[pointer](yourProc) |
12:14:13 | * | tane joined #nim |
12:15:25 | FromDiscord | <fwsgonzo> seems to work now 🙂 I'm having an issue freezing a Json structure |
12:15:53 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KBi |
12:16:00 | FromDiscord | <fwsgonzo> is this supported? |
12:36:12 | * | fanta1 joined #nim |
12:45:04 | * | Vladar quit (Quit: Leaving) |
12:45:20 | * | rockcavera joined #nim |
12:48:47 | planetis[m] | i don't know what you intent to do, but this one writes JsonNodes to disc, not readable json, you can try to do j.toPretty |
12:49:38 | planetis[m] | however this wont be enough since you are using a binary serializer' |
12:55:25 | FromDiscord | <enthus1ast> is the hot code reloading broken? |
12:57:11 | FromDiscord | <flywind> It has many bugs and doesn't works well |
12:57:24 | FromDiscord | <enthus1ast> hi @flywind btw |
12:57:34 | FromDiscord | <enthus1ast> for me it does not work at all 😄 |
13:00:46 | * | tiorock joined #nim |
13:00:46 | * | tiorock quit (Changing host) |
13:00:46 | * | tiorock joined #nim |
13:00:46 | * | rockcavera quit (Killed (kornbluth.freenode.net (Nickname regained by services))) |
13:00:46 | * | tiorock is now known as rockcavera |
13:01:00 | FromDiscord | <flywind> hello, yeah that's a pity |
13:01:18 | * | tiorock joined #nim |
13:01:18 | * | tiorock quit (Changing host) |
13:01:18 | * | tiorock joined #nim |
13:01:18 | * | rockcavera is now known as Guest73052 |
13:01:18 | * | Guest73052 quit (Killed (moon.freenode.net (Nickname regained by services))) |
13:01:18 | * | tiorock is now known as rockcavera |
13:01:38 | FromDiscord | <fwsgonzo> yes, I want to serialize the JSON, but I can't deserialize it after |
13:01:48 | * | tiorock joined #nim |
13:01:48 | * | tiorock quit (Changing host) |
13:01:48 | * | tiorock joined #nim |
13:01:48 | * | rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
13:01:48 | * | tiorock is now known as rockcavera |
13:02:19 | * | rockcavera is now known as Guest80579 |
13:02:19 | * | tiorock joined #nim |
13:02:19 | * | Guest80579 quit (Killed (tepper.freenode.net (Nickname regained by services))) |
13:02:19 | * | tiorock is now known as rockcavera |
13:02:40 | * | tiorock joined #nim |
13:04:49 | FromDiscord | <enthus1ast> what do you want to serialize @fwsgonzo ? |
13:04:58 | FromDiscord | <fwsgonzo> just objects in general, I'm passing them between machines |
13:05:25 | planetis[m] | yeah, he doesn't support that try https://github.com/planetis-m/eminim and https://github.com/treeform/jsony |
13:06:24 | FromDiscord | <enthus1ast> i think it depends if you have ptr or refs in the objects, afaik tables do also not work (maybe works now) |
13:06:46 | FromDiscord | <enthus1ast> what i normally do is i create special "network objects" |
13:06:59 | FromDiscord | <fwsgonzo> I see - passing JSON itself works perfectly fine, but it's not a general solution↵also, the machines are running the same binary |
13:07:01 | FromDiscord | <enthus1ast> that are "plain old data objects" |
13:07:12 | * | tarsiec joined #nim |
13:07:48 | * | tarsiec quit (Client Quit) |
13:07:59 | FromDiscord | <enthus1ast> can you share code? |
13:09:06 | FromDiscord | <enthus1ast> (edit) "code?" => "code/error message?" |
13:11:35 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KBu |
13:12:00 | FromDiscord | <fwsgonzo> im taking var j and sending it to a remote machine, it gets parsed into json, serialized back, returned, and then used in a HTTP response |
13:12:04 | FromDiscord | <enthus1ast> j.pretty() |
13:12:06 | FromDiscord | <enthus1ast> breaks it |
13:12:11 | FromDiscord | <fwsgonzo> no, this works just fine |
13:12:17 | FromDiscord | <fwsgonzo> im using strings for the API |
13:12:53 | FromDiscord | <fwsgonzo> but I would have liked a general solution to serializing objects 🙂 |
13:12:59 | FromDiscord | <fwsgonzo> seems very 2021 for a programming language |
13:13:34 | FromDiscord | <fwsgonzo> this is very easy to understand though, so I |
13:13:39 | FromDiscord | <fwsgonzo> (edit) "I" => "I'll leave it as is for now" |
13:15:00 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2KBv |
13:15:11 | FromDiscord | <flywind> rpc? https://github.com/status-im/nim-json-rpc |
13:16:22 | * | liblq-dev joined #nim |
13:16:25 | * | liblq-dev quit (Client Quit) |
13:16:42 | FromDiscord | <lqdev> disruptek: are you sure that araq-ic6 actually… you know, contains the IC logic? |
13:16:52 | FromDiscord | <lqdev> 'cause for me if i change a single module it recompiles everything |
13:16:55 | FromDiscord | <lqdev> with --incremental:on ofc |
13:17:25 | FromDiscord | <enthus1ast> @fwsgonzo yes you are right, i can parse pretty json as well |
13:17:49 | FromDiscord | <fwsgonzo> looks nice, I'll have a look! |
13:18:59 | FromDiscord | <enthus1ast> what error message do you get? Because parsing the json works (for me 🙂 ) |
13:19:08 | FromDiscord | <fwsgonzo> none, JSON works beautifully |
13:19:15 | FromDiscord | <enthus1ast> ah ok? |
13:19:20 | FromDiscord | <fwsgonzo> its just when i was trying to use frosty I couldnt get it to work |
13:19:35 | FromDiscord | <fwsgonzo> btw. is there a way to get Nim to assume ownership of a cstring? |
13:20:28 | FromDiscord | <enthus1ast> cannot comment on frosty never heared of it |
13:24:38 | disruptek | fwsgonzo: what was the problem? |
13:24:39 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KBy |
13:24:44 | disruptek | lqdev: you need to use --incremental:on |
13:24:56 | FromDiscord | <lqdev> yeah, i am using it… |
13:25:15 | disruptek | check your nimcache for .rod files. |
13:25:25 | FromDiscord | <lqdev> they're here |
13:26:00 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2KBz |
13:27:32 | FromDiscord | <juliuskiesian> how do you pass varargs to another proc that takes varargs? |
13:27:55 | FromDiscord | <juliuskiesian> and how do you pass a seq[T] to a proc that takes varargs? |
13:28:22 | disruptek | lqdev: the only way i was able to notice a difference was to build with ic enabled, then recompile the project with an old compiler, then build it again to get the new compiler to both use the ic artifacts and rebuild everything. |
13:28:29 | FromDiscord | <enthus1ast> @fwsgonzo "remote_trampoline" sounds like api hooking, what are you hacking? |
13:28:37 | disruptek | as i said, it's pretty lousy at the moment. |
13:29:04 | disruptek | enthus1ast: you have you read his blog to understand it; it's pretty neat. |
13:29:12 | FromDiscord | <lqdev> disruptek: i'd expect that with IC it would load the rodfiles or something, and it would be quicker than recompiling the whole project but for some reason it takes about the same amount of time |
13:29:36 | disruptek | i warned you not to blame me, didn't i? |
13:29:46 | FromDiscord | <lqdev> yeah, i'm not blaming you. |
13:29:54 | disruptek | i know. 😉 |
13:29:57 | FromDiscord | <lqdev> just sharing my thoughts. |
13:30:18 | disruptek | i'm trying not to shit on it too much, but i'm frustrated, too. |
13:30:46 | disruptek | point is, i /was/ able to get it to compile nim faster. |
13:30:59 | disruptek | but it's a very convoluted process to even evoke a performance boost. |
13:31:31 | FromDiscord | <enthus1ast> @disruptek have a link? |
13:31:40 | disruptek | fwsgonzo: what was the problem with frosty, i mean? |
13:32:04 | disruptek | https://fwsgonzo.medium.com/ |
13:32:13 | FromDiscord | <enthus1ast> ty |
13:32:23 | disruptek | look at the august post. |
13:36:43 | * | rockcavera quit (Remote host closed the connection) |
13:36:49 | * | tiorock quit (Remote host closed the connection) |
13:37:01 | FromDiscord | <lqdev> disruptek: does frosty output endian-independent binary data? |
13:37:14 | disruptek | no. |
13:38:09 | disruptek | if you want your data in a specific form, put it in that form before you serialize it. |
13:38:23 | disruptek | it's just a serializer/deserializer. |
13:39:39 | FromDiscord | <enthus1ast> i read it but i guess i do not understand it 😄 |
13:39:56 | FromDiscord | <enthus1ast> but have also never touched varnish before so yeah |
13:40:47 | FromDiscord | <enthus1ast> the basic idea is to have a virtual machine that runs code inside a cache? |
13:41:11 | disruptek | yep. |
13:46:00 | FromDiscord | <enthus1ast> sounds like jit to me |
13:49:18 | disruptek | the memory sharing is a little confusing; i think he's sharing metadata instead of data because even sharing the data is too expensive. |
13:50:03 | disruptek | it's pretty hacky but technically awesome. |
13:50:31 | FromDiscord | <enthus1ast> i'm not sure what the problem is he's trying to solve |
13:50:55 | disruptek | he wants to run arbitrary logic on each request received by the cache. |
13:51:10 | FromDiscord | <enthus1ast> where does the logic come from? |
13:51:42 | disruptek | if it takes 1ms to update data in cache of arbitrary size, you can now run a db query for each request in native code and operate on constants. |
13:51:53 | planetis[m] | varchars turned out to be slower from strings in a number of benchmarks |
13:52:00 | planetis[m] | string it is then |
13:52:19 | disruptek | strings have custom code in the compiler that make them the best choice for strings. |
13:52:22 | disruptek | weird, i know. |
13:53:09 | planetis[m] | what custom code? I optimized comparisons and copies as much as strings |
13:53:54 | disruptek | look at how alloc works. |
13:54:24 | disruptek | where are your benchmarks? |
13:55:26 | Oddmonger | is there a function for buffering a file without opening/closing it explicitely ? (like readFile does) |
13:55:49 | planetis[m] | i blame the varint encoding for some of the slowdown and the rest (x2) on data not fitting on cache, (but that could be avoided with hot-cold split) |
13:55:53 | disruptek | how would that work? |
13:57:47 | disruptek | planetis[m]: why didn't you just make a `varchar[N: static int] = distinct string`? |
13:58:31 | planetis[m] | as requested https://github.com/planetis-m/varchars/blob/master/tests/str_vs_varchar.nim |
13:59:09 | disruptek | !repo criterion |
13:59:10 | disbot | https://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 38⭐ 3🍴 7& 1 more... |
13:59:18 | disruptek | !repo disruptek/criterion |
13:59:18 | disbot | https://github.com/disruptek/criterion -- 9criterion: 11statistics-driven micro-benchmarking framework 15 14⭐ 0🍴 |
14:02:04 | planetis[m] | because i would have to rewrite varints |
14:02:09 | * | lritter joined #nim |
14:02:33 | disruptek | are varints anything like varmints? |
14:03:33 | planetis[m] | and also the main idea was to use an array so that there is no indirection |
14:04:07 | * | disruptek sighs again. |
14:04:28 | disruptek | you've provoked two updates to my style document. |
14:04:31 | disruptek | congrats! |
14:05:32 | planetis[m] | ok what are those? |
14:06:50 | disruptek | include requirements for your tests, always. |
14:07:45 | disruptek | don't use nim- or .nim or even `nim` in your package name; we all know it's fucking nim, that's why we showed up. |
14:07:48 | disruptek | gah. |
14:08:25 | planetis[m] | i didnt it was in description |
14:08:30 | disruptek | and, yes, i know you aren't guilty of this. |
14:08:53 | planetis[m] | what do you mean include requirements? |
14:10:14 | FromDiscord | <Clyybber> heh, look at those CIs https://github.com/apple/swift :p |
14:10:16 | planetis[m] | snif what will happen to me? |
14:10:28 | disruptek | you will die. |
14:10:46 | disruptek | why export cmpVarChars and not simply cmp? |
14:10:55 | disruptek | why export eqVarChars at all? |
14:11:01 | * | waleee-cl joined #nim |
14:11:30 | disruptek | why export toString and not merely $? |
14:12:56 | * | lritter quit (Quit: Leaving) |
14:16:43 | disruptek | and there's no point to impl <=, right? |
14:18:54 | * | lritter joined #nim |
14:20:47 | FromDiscord | <flywind> Is `inline iterator ` proc type? |
14:21:07 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2KBQ |
14:21:10 | FromDiscord | <flywind> Should this compile? |
14:22:10 | disruptek | planetis[m]: what does using varints buy you? |
14:22:44 | disruptek | flywind: no. |
14:23:18 | FromDiscord | <flywind> I see |
14:23:47 | FromDiscord | <flywind> !eval iterator hello(): int = yield 12; echo hello is proc; echo hello is "iterator" |
14:23:49 | NimBot | <no output> |
14:23:49 | planetis[m] | nothing apparently |
14:24:25 | disruptek | planetis[m]: but what did you think it would buy you? |
14:24:58 | disruptek | this is closer to making sense than i expected. 😉 |
14:25:09 | FromDiscord | <Clyybber> @flywind Its a bug that it compiles afaik |
14:25:24 | FromDiscord | <flywind> which one? |
14:25:40 | FromDiscord | <flywind> That's not a bug, it is a useful feature. |
14:25:49 | disruptek | one man's trash. |
14:26:03 | FromDiscord | <flywind> I need that feature. |
14:26:15 | disruptek | why? |
14:26:20 | FromDiscord | <flywind> see https://github.com/nim-lang/Nim/pull/16552 |
14:26:21 | disbot | ➥ fix a bug since 2012 hash(closure iterator) doesn't work |
14:26:23 | FromDiscord | <Clyybber> @flywind I mean an iterator being a proc |
14:27:09 | FromDiscord | <Clyybber> I don't see why you would need it |
14:28:04 | FromDiscord | <flywind> My first example doesn't compile. |
14:28:25 | FromDiscord | <Clyybber> Yeah, it shuoldn't |
14:29:26 | FromDiscord | <Clyybber> It shouldn't instantiate successfully even |
14:29:32 | FromDiscord | <flywind> I need it not to compile too. |
14:29:49 | disruptek | am i high right now? |
14:29:50 | FromDiscord | <Clyybber> but it does because of https://github.com/nim-lang/Nim/issues/16548 |
14:29:56 | disbot | ➥ `x is iterator` is true for procs, `x is proc` is true for iterators ; snippet at 12https://play.nim-lang.org/#ix=2KBS |
14:30:04 | FromDiscord | <Clyybber> @flywind haha, I thought you wanted it to compile |
14:30:36 | FromDiscord | <flywind> yeah |
14:30:41 | FromDiscord | <Clyybber> wait.. |
14:30:47 | FromDiscord | <Clyybber> I'm with disruptek now lol |
14:30:51 | disruptek | he wants hash to work and his solution is to change the sigmatch. |
14:32:04 | planetis[m] | i dunno, i read about how database varchars work and tried to replicate it (but its still not compatible)\ |
14:32:29 | FromDiscord | <flywind> that's where it needs to be changed. |
14:32:59 | disruptek | planetis[m]: database varchars use varints? |
14:33:00 | FromDiscord | <Clyybber> @flywind I don't understand. Your test in your pr is about closure iterators, the one you posted here is about inline iterators |
14:33:04 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2KBT |
14:33:06 | FromDiscord | <Clyybber> inline iterators are not procs |
14:33:49 | FromDiscord | <flywind> that's two question |
14:34:07 | FromDiscord | <flywind> (edit) "that's" => "they are" | "question" => "issues, not very related" |
14:34:29 | Zevv | |
14:34:31 | FromDiscord | <Clyybber> So you want closure iterators to keep counting as proc ? |
14:35:04 | FromDiscord | <flywind> Isn't it? |
14:35:17 | FromDiscord | <Clyybber> Right now it is, but it might change in the future |
14:35:20 | FromDiscord | <flywind> No, I just fix the bug |
14:35:24 | FromDiscord | <Clyybber> But if it does we can just change the hash module |
14:35:52 | FromDiscord | <Clyybber> @flywind Which bug do you fix? That `when T is "closure"` doesn't work for closure iterators? |
14:36:09 | FromDiscord | <flywind> yes |
14:36:15 | FromDiscord | <Clyybber> ok, seems fine |
14:36:33 | FromDiscord | <Clyybber> but we should wait for araq to review it |
14:36:55 | FromDiscord | <flywind> After this PR, It could be used to fix two issues. |
14:37:09 | disruptek | eh i don't want iterator to sigmatch proc. |
14:37:21 | FromDiscord | <Clyybber> disruptek: Yeah, but flywind didn't change that |
14:37:27 | FromDiscord | <Clyybber> disruptek: Its a thing since 2012 |
14:37:36 | FromDiscord | <Clyybber> https://github.com/nim-lang/Nim/blob/662c5080755eb5a42df2c3acb84c044876571a46/tests/iter/titer8.nim#L80 |
14:37:56 | disruptek | gah. |
14:38:11 | FromDiscord | <Clyybber> @flywind You should edit your PR's description to make it more clear that you are fixing `is "closure"` |
14:38:32 | FromDiscord | <flywind> ok |
14:38:42 | federico3 | https://hotwire.dev/#screencast I wonder if this stuff could make sense in Nim |
14:42:11 | Oddmonger | with proc readBuffer(f: File; buffer: pointer; len: Natural): int {...} , what is a buffer ? As there functions for openArrays too, and strings, that's not one of them |
14:42:43 | Oddmonger | i should say, how allocate pointed buffer ? |
14:42:53 | FromDiscord | <Clyybber> @flywind Why did you change hash to hashWangYi1 ? |
14:42:55 | disruptek | any way you want. |
14:43:17 | Oddmonger | is there a malloc i have missed ? |
14:43:23 | disruptek | alloc() |
14:43:37 | FromDiscord | <flywind> reduce necessary call |
14:43:50 | FromDiscord | <flywind> The types are always Hash |
14:44:02 | * | filcuc joined #nim |
14:44:06 | FromDiscord | <Clyybber> but it ignores nimIntHash1 |
14:44:38 | FromDiscord | <Clyybber> ah, its fine |
14:44:40 | Oddmonger | yes i had missed it, thank you disruptek |
14:45:33 | FromDiscord | <Clyybber> (edit) "fine" => "fine, nevermind" |
14:47:10 | FromDiscord | <jken> disuptek, you should livestream, I'd watch./ |
14:47:12 | FromDiscord | <jken> (edit) "watch./" => "watch." |
14:48:10 | FromDiscord | <Clyybber> @flywind In your second PR please make the tests check that compiletime == runtime |
14:48:37 | FromDiscord | <flywind> Ok, will do it later |
14:48:43 | FromDiscord | <Rika> disruptek used to livestream i believe |
14:50:08 | FromDiscord | <flywind> ah, I link the wrong issue... |
14:51:33 | FromDiscord | <Clyybber> yep |
14:51:53 | FromDiscord | <flywind> I think I already make the tests check compiletime == runtime |
14:52:13 | FromDiscord | <Clyybber> There is a small part that checks hashWangY1 and hashIdentity |
14:52:37 | FromDiscord | <Clyybber> But not for the other hashes afaict |
14:52:47 | FromDiscord | <flywind> ? |
14:53:03 | * | sk_ joined #nim |
14:53:10 | FromDiscord | <Clyybber> murmurHash |
14:54:25 | FromDiscord | <flywind> `main` is already put both in `static` and global scope. |
14:54:31 | FromDiscord | <flywind> (edit) "`main`" => "`main()`" |
14:55:01 | FromDiscord | <Clyybber> yes, but it does not check wether its results are consistent between compile and runtime |
14:55:17 | FromDiscord | <flywind> doAssert hash(cstring"abracadabra") == 97309975↵ doAssert hash(cstring"abracadabra") == hash("abracadabra") |
14:55:45 | Zevv | whats with the mallocs |
14:56:47 | FromDiscord | <Clyybber> @flywind Ah, right. |
14:57:35 | FromDiscord | <Clyybber> although I think cstring is the one type where we shouldn't do that :p |
14:57:56 | FromDiscord | <Clyybber> all this "make cstring behave the same in VM as in backend" stuff is not a good idea IMO |
14:58:13 | FromDiscord | <Clyybber> cstring means backend-defined-string |
14:58:20 | FromDiscord | <Clyybber> so its by definition not backend agnostic |
14:58:59 | FromDiscord | <flywind> though I still hope the default value of `cstring` is `nil` not `""`. |
14:59:10 | * | abm joined #nim |
14:59:25 | FromDiscord | <flywind> in VM |
14:59:32 | FromDiscord | <Clyybber> why? |
14:59:55 | FromDiscord | <flywind> Then I can reduce some bytes in `options.nim`. |
15:00:18 | sk_ | Hi, i wrote a tool where user can write certain configuration in a cfg file which will be loaded by parsecfg.nim library. But i can not find any way to check whether a value exists or not. or how to loop through property of a section. thanks |
15:02:24 | FromDiscord | <Clyybber> @flywind I see. I don't think its a good idea though. cstring might not be a pointer on some backends |
15:02:44 | FromDiscord | <Clyybber> But maybe if we clarify the spec around cstring its fine |
15:03:14 | FromDiscord | <flywind> JS has null as default value, it works, C/C++ works too. |
15:03:31 | ForumUpdaterBot | New question by Alex Craft: Why the template can't see imported functions in Nim?, see https://stackoverflow.com/questions/65540529/why-the-template-cant-see-imported-functions-in-nim |
15:04:18 | FromDiscord | <Rika> oh man my type names are getting pretty damn long |
15:04:21 | narimiran | did he just write `to_loVer` and complains that the template doesn't see `to_loWer`? |
15:04:29 | FromDiscord | <Rika> yes he did |
15:05:02 | FromDiscord | <lqdev> yes |
15:05:24 | FromDiscord | <Clyybber> @flywind Yeah, we should put it in the spec then that cstring is backend specific but guarantees having a `nil` state |
15:05:50 | FromDiscord | <flywind> I agree |
15:05:58 | disruptek | i'm hoping to resume streaming in february if i don't have a job by then. |
15:06:31 | Zevv | so whats magic about februari |
15:06:36 | Zevv | then you give up finding a job? |
15:06:51 | FromDiscord | <jken> Jobs are so 2019. |
15:07:07 | FromDiscord | <lqdev> oh shuddup, 2019 was a good year |
15:07:18 | Zevv | Disruptekt is employed for one hour/month now |
15:07:29 | FromDiscord | <shadow.> jobs are so laughs in high schooler |
15:07:36 | disruptek | starlink projected to expand beta to my area later this month, so figure another month waiting for the hardware. |
15:08:25 | FromDiscord | <fwsgonzo> you can probably live in a sailboat with starlink |
15:08:29 | Zevv | what does that look like, hardware-like |
15:08:43 | disruptek | just a frisbee antenna. |
15:08:58 | disruptek | gonzo: what's wrong with frosty? |
15:09:27 | FromDiscord | <fwsgonzo> ill resume trying it later, but hopefully nothing - might have been ABI stuff |
15:10:14 | disruptek | i don't have to worry about it in ic anymore, so will probably break it and cut a 1.0 release in the next couple days. |
15:10:55 | FromDiscord | <Rika> @shadow. have fun in a few years |
15:11:32 | disruptek | you too can fund disruptek. |
15:12:04 | FromDiscord | <shadow.> i have done decently with programming lol |
15:12:14 | Zevv | yes, you *too* can fund disruptek! |
15:12:15 | FromDiscord | <shadow.> hoping i can find a startup or somethin to hop on for passive income |
15:12:18 | FromDiscord | <shadow.> thats the dream |
15:12:19 | disruptek | if you're not with me, you're against me. |
15:12:24 | FromDiscord | <fwsgonzo> im getting a null-pointer when im returning a cstring from a string? what gives |
15:12:40 | Zevv | https://github.com/sponsors/disruptek |
15:12:56 | disruptek | ~disruptek |
15:12:57 | disbot | disruptek: 11unsafe at any speed. -- disruptek |
15:12:57 | disbot | disruptek: 11:disruptek: |
15:12:57 | disbot | disruptek: 11an unsafe nil deref |
15:13:11 | disruptek | ~disruptek is broke: https://github.com/sponsors/disruptek |
15:13:11 | disbot | disruptek: 11broke: https://github.com/sponsors/disruptek |
15:13:11 | disbot | disruptek: 11:disruptek: |
15:13:11 | disbot | disruptek: 11an unsafe nil deref |
15:13:14 | FromDiscord | <Rika> i'm having fun here in a country where basically no one understands english 😄 |
15:13:26 | FromDiscord | <Rika> not the smartest decision ive made |
15:13:48 | disruptek | you're in the phillipines? |
15:14:13 | * | sk_ quit (Quit: Leaving) |
15:14:13 | Zevv | fwsgonzo: show the code |
15:14:15 | FromDiscord | <Clyybber> japan I think? |
15:14:52 | disruptek | zevv: did you read his blog? |
15:14:59 | Zevv | whose |
15:15:02 | disruptek | gonzo |
15:15:07 | Zevv | no |
15:15:11 | Zevv | should I or should I not |
15:15:13 | disruptek | lol worth it. |
15:15:21 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KCk |
15:15:27 | disruptek | https://fwsgonzo.medium.com/ |
15:15:28 | disruptek | august |
15:17:26 | Zevv | i don't see it |
15:27:28 | Oddmonger | is it possible to use echo on a allocated buffer ? |
15:27:47 | Oddmonger | like echo (mybuffer[1]) for displaying first char |
15:27:59 | Oddmonger | (well, second char) |
15:29:03 | Zevv | you probably want some casting so num knows how to dump that for you |
15:29:39 | Oddmonger | so maybe it would be faster for me to use an array… |
15:31:19 | Zevv | https://fwsgonzo.medium.com/ |
15:31:21 | Zevv | no |
15:31:24 | Zevv | echo cast[ptr UncheckedArray[uint8]](buffer)[][1] |
15:31:25 | Zevv | what one |
15:32:16 | Oddmonger | ouch |
15:32:18 | Zevv | why? |
15:32:52 | Oddmonger | i wanted to use a buffer for avoiding an array |
15:33:24 | Zevv | well move to C if you like these kind of things |
15:33:26 | FromDiscord | <fwsgonzo> its arrays all the way down |
15:33:35 | Zevv | Nim allows it, but makes it easy to do the /right/ thing |
15:33:44 | Zevv | and casting stuff about is usually not |
15:34:01 | Zevv | because `cast[]` basically means `I'm lying to you` |
15:34:16 | Zevv | and "trust me, I know what I'm doing" |
15:34:36 | Oddmonger | yes i know when cast appears, problems arise |
15:35:03 | Oddmonger | except is some low level cases where you have no choice |
15:35:08 | Oddmonger | or stream reading |
15:37:57 | Oddmonger | is there a difference between readChars and readBytes ? On systems where char can be != 8 bits maybe ? |
15:38:37 | * | Arrrrrrrr joined #nim |
15:38:56 | Oddmonger | sadly, there is not readInt |
15:39:15 | Oddmonger | or maybe the exercise is left to the reader with a nim trick |
15:39:48 | FromDiscord | <shadow.> there is definitely some form of readInt |
15:39:51 | FromDiscord | <shadow.> might be in the streams module tho |
15:41:02 | Oddmonger | yes indeed, it's in the index |
15:41:07 | FromDiscord | <shadow.> disruptek: your internet is 128 a month? haven't you talked about how it can't even load github? |
15:47:21 | disruptek | yep. |
15:47:51 | Zevv | fun, right |
15:47:54 | disruptek | there's a local monopoly that thinks 10-20% packet-loss isn't as important as price-gouging customers. |
15:48:02 | planetis[m] | you just do readdata with sizeof(int64) and cast the result to int64 |
15:48:51 | disruptek | what's crazy is that i used to be a network engineer for an ISP in this state. |
15:49:09 | disruptek | you'd think i'd know what to do. |
15:49:16 | FromDiscord | <Rika> ayy my lib works kinda time to upload it now |
15:49:28 | disruptek | ship it. |
15:49:53 | planetis[m] | anyone wants to have the honor to port https://github.com/roig/destral_ecs to Nim |
15:50:13 | disruptek | ~fwsgonzo is https://fwsgonzo.medium.com/virtual-machines-for-multi-tenancy-in-varnish-1c619ea3276 |
15:50:14 | disbot | fwsgonzo: 11https://fwsgonzo.medium.com/virtual-machines-for-multi-tenancy-in-varnish-1c619ea3276 |
15:51:11 | disruptek | honestly, the internet has improved here somewhat. i think they are worried about starlink competition, as they should be. |
15:52:06 | disruptek | but it's still 6mbit/1mbit adsl, so even if the latency is 40ms and they pass all my packets, who gives a shit? |
15:52:49 | disruptek | planetis[m]: do you want help on varchars? |
15:53:16 | FromDiscord | <enthus1ast> what is the benefit of usesing destral_etc over Entt? |
15:53:34 | FromDiscord | <enthus1ast> (edit) "usesing" => "using" |
15:54:01 | FromDiscord | <enthus1ast> entt is pretty good |
15:54:11 | FromDiscord | <Clyybber> disruptek: Why can't you simply use getType on i? |
15:54:16 | FromDiscord | <Clyybber> I tried it and it works |
15:54:37 | disruptek | i told you i probably could. |
15:54:44 | disruptek | also, the compiler should give me valid nim. |
15:54:56 | FromDiscord | <Clyybber> no it shouldn't have to |
15:55:02 | FromDiscord | <Clyybber> its after transformation after all |
15:55:07 | FromDiscord | <Clyybber> this code is intended for the backend |
15:55:14 | disruptek | it was typed when i gave it to the compiler. |
15:55:24 | FromDiscord | <Clyybber> so? RTFM |
15:55:25 | FromDiscord | <Clyybber> :p |
15:55:32 | disruptek | you RTFM. this is macro code. |
15:55:45 | FromDiscord | <Clyybber> https://nim-lang.github.io/Nim/macros#getImplTransformed%2CNimNode |
15:55:54 | disruptek | yes, i know. |
15:56:34 | disruptek | it's not correct ast. c'mon, man. |
15:56:55 | Zevv | yeaaah but its for deubugging and inspection, not for disruptek |
15:57:00 | FromDiscord | <Clyybber> It is correct for what its supposed to be |
15:57:08 | FromDiscord | <Clyybber> I understand wanting it to be nicer |
15:57:21 | disruptek | do the pass in the compiler, please. what the hell. |
15:57:24 | Zevv | right. *but* if we can make it more correct, that would be cool & helpful |
15:57:27 | FromDiscord | <Clyybber> but I'm thinking now that we got rodfiles including the type node in the AST might bloat it |
15:57:36 | disruptek | lol |
15:57:48 | disruptek | the rodfiles are bloated because they aren't compressed. |
15:58:13 | FromDiscord | <Clyybber> disruptek: ? getImplTransformed isn't implemented in macros.nim |
15:58:19 | FromDiscord | <Clyybber> it is the pass |
15:58:30 | disruptek | it's a macros api that returns faulty ast. |
15:58:34 | disruptek | are you serious right now? |
15:58:38 | FromDiscord | <Clyybber> lol its not |
15:58:43 | FromDiscord | <Clyybber> yes I am |
15:58:47 | disruptek | am i wrong? |
15:58:52 | FromDiscord | <Clyybber> I'm not sure if I should fix it because it makes the AST bigger |
15:59:07 | FromDiscord | <Clyybber> disruptek: Yeah, because it doesn't specifiy that it returns correct AST |
15:59:22 | FromDiscord | <Clyybber> AST is different once its been through the transf stage |
15:59:31 | Zevv | does strutils.reverse specify it returns a correct reversed string? |
15:59:36 | disruptek | do we need to specify that ast is correct? |
15:59:55 | FromDiscord | <Clyybber> Zevv: No, but it doesn't specify: " note that code transformations are implementation dependent and subject to change" |
16:00:04 | disruptek | so what? |
16:00:07 | * | sk_ joined #nim |
16:00:10 | disruptek | i don't care if you /change/ the ast. |
16:00:13 | disruptek | just make it correct. |
16:00:15 | Zevv | hehe |
16:00:25 | disruptek | seriously. idgaf. |
16:00:48 | disruptek | name another proc exported in macros that returns bogus data. |
16:00:55 | disruptek | this is literally bad data that we're talking about. |
16:01:17 | disruptek | it's bananas. it fits right, but it's not correct. |
16:02:09 | * | Vladar joined #nim |
16:02:22 | FromDiscord | <Clyybber> there is no correct. It says on the tin that its implementation defined and used for debugging/peeping |
16:02:39 | disruptek | then just give me a string. |
16:02:53 | disruptek | if the data is meaningless, don't let people try to use it. |
16:02:59 | FromDiscord | <Clyybber> its not meaningless |
16:03:02 | FromDiscord | <Clyybber> its special |
16:03:10 | disruptek | this is ridiculous. |
16:03:45 | FromDiscord | <Clyybber> I'm not opposed to making it valid typed AST |
16:04:04 | disruptek | you decide. i am done arguing about it. |
16:04:04 | FromDiscord | <Clyybber> but theres probably more to it than just fixing this one part |
16:04:30 | planetis[m] | disruptek: what's left to do? |
16:04:34 | sk_ | https://i.ibb.co/mvc4svV/Screenshot-from-2021-01-02-22-00-31.png what this error means. copyFile proc |
16:04:41 | disruptek | i'm also not going to try to massage "debugging" output that "is intended only for peeping" into code that we run. |
16:04:43 | * | opal quit (Ping timeout: 240 seconds) |
16:04:51 | disruptek | that's irresponsible of me to attempt on someone else's code. |
16:05:08 | disruptek | planetis[m]: on varchars? |
16:05:56 | planetis[m] | ya |
16:06:01 | * | opal joined #nim |
16:06:55 | disruptek | is the point to have a bounded string that's useful on the stack? |
16:07:02 | disruptek | or.. something? |
16:07:09 | FromDiscord | <Clyybber> disruptek: transformed doesn't only mean iterators inlined, it also does closure transforms, unpacking tuple assignments and so on |
16:07:16 | FromDiscord | <Clyybber> and it sometimes also introduces temporaries |
16:07:21 | FromDiscord | <Clyybber> which don't have a declaration at all |
16:07:37 | disruptek | return a string. |
16:08:07 | disruptek | i will transform the for/defer myself. |
16:08:17 | FromDiscord | <Clyybber> and what do you want a string for? |
16:08:49 | disruptek | i don't want it. i want people to not try to depend upon an api that produces misleading data. |
16:09:16 | planetis[m] | could be, but it was supposed to be used in seqs primarily |
16:09:20 | FromDiscord | <Clyybber> disruptek: The only thing I'm trying to tell you is that its a bigger thing to guarantee that transformed AST is valid typed AST |
16:09:24 | disruptek | dame difference. |
16:09:33 | disruptek | clyybber: noted. return a string. |
16:09:48 | FromDiscord | <Clyybber> you want rendered AST? |
16:09:54 | disruptek | planetis[m]: can we remove varints and add a converter to string? |
16:10:05 | disruptek | clyybber: i think that makes sense. that, or treeRepr. |
16:10:11 | planetis[m] | anyway if you want that try to start from spills/varchar i linked you the other day |
16:10:44 | FromDiscord | <Clyybber> disruptek: It makes no sense at all. Now you don't even have any possibility anymore of extracting the type of i because `var i` doesn't say what type it has |
16:10:45 | disruptek | spills/varchar? |
16:10:56 | disruptek | clyybber: it never did. |
16:11:07 | disruptek | it's wrong to ascribe any value to it, as you pointed out. |
16:11:07 | FromDiscord | <Clyybber> getType |
16:11:32 | disruptek | again, to rely upon this api would be irresponsible. |
16:11:56 | * | sk_ quit (Quit: Leaving) |
16:12:04 | FromDiscord | <Clyybber> thats my point. Its ok if we use this for CPS right now, but we may want to clarify this in the future |
16:12:42 | disruptek | anything you expose will be misused. |
16:12:48 | FromGitter | <deech> Trying to understand how arc/orc works, I have a function that takes a `sink cstring` argument but I'm still able to access it after a call to that function. Isn't `arc` supposed to prevent me from doing that at compile time? https://play.nim-lang.org/#ix=2KCz |
16:13:18 | FromDiscord | <Clyybber> deech: No it will copy. It will prevent you from doing so if you declare `=` as `{.error.}` |
16:13:52 | Oddmonger | is it possible to convert to string a range of a seq ? (s.join converts all) |
16:14:08 | FromDiscord | <Clyybber> disruptek: Can't you just do getType FOR NOW |
16:14:23 | disruptek | why? |
16:14:29 | FromGitter | <deech> Clyybber, how do I do that? |
16:14:44 | Oddmonger | of course, i could use a loop on my seq with start,end index |
16:14:55 | FromDiscord | <Clyybber> deech: proc `=`(x: var MyType, y: MyType) {.error.} |
16:15:06 | Oddmonger | but maybe it's already done in the standard lib |
16:15:11 | disruptek | oddmonger: use join(s[40..50], ".") |
16:15:12 | FromDiscord | <Clyybber> disruptek: Because we don't have consensus on how this should look yet |
16:15:18 | disruptek | i will wait. |
16:15:30 | Oddmonger | oh so easy! thank you |
16:15:37 | FromGitter | <deech> Oh wait, `cstring`s specifically copy on assignment? |
16:15:38 | FromDiscord | <Clyybber> why'd you want to wait? don't we want cps to get going? |
16:15:56 | Oddmonger | (i do have check manual, and it wasn't in it ;) ) |
16:16:18 | disruptek | i don't want to have to support `for` loops with code i can't trust, let alone justify. |
16:16:48 | disruptek | people should simply accept that they can't use a for loop yet. big fucking deal. |
16:16:49 | FromDiscord | <treeform> @disruptek , it makes me said when code is slow... https://gist.github.com/treeform/0ec5d9026167c73a1791bb8ffa94682f |
16:16:50 | FromDiscord | <Clyybber> deech: I don't remember if they copy or if they have ref semantics, but they don't have a `=`{.error.} |
16:17:13 | disruptek | treeform: where is the benchmark? |
16:17:30 | disruptek | i told you that i'd compete with you once you reach feature parity; not before. |
16:17:40 | FromDiscord | <treeform> https://github.com/treeform/flatty/blob/master/tests/benchmark_tree.nim |
16:17:57 | FromDiscord | <treeform> What features do you need? |
16:18:07 | disruptek | all the ones you lack. |
16:18:08 | FromDiscord | <Clyybber> disruptek: Ok. You can't trust the code from getImplTransformed thats true and was my point. It does more than loop transforms so it would probably only work for the simple cases |
16:18:25 | disruptek | clyybber: whatever it does should be fine for cps. |
16:18:32 | FromDiscord | <treeform> I have a feature you lack 🙂 |
16:18:41 | disruptek | treeform: serialize pointers, intsets, etc. |
16:19:14 | FromDiscord | <treeform> why would you want to serialize a pointer? |
16:19:23 | disruptek | s/pointers/refs/ |
16:19:32 | FromDiscord | <treeform> oh I support refs... |
16:19:56 | FromDiscord | <treeform> the benchmark uses a ref object |
16:19:57 | disruptek | my flatty benchmark shows the bits i had to cut out. |
16:20:11 | FromDiscord | <treeform> link |
16:20:18 | disruptek | !repo frosty |
16:20:18 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11serialize native Nim types to strings, streams, or sockets ⛄ 15 23⭐ 1🍴 |
16:20:27 | FromDiscord | <treeform> to the bench makr? |
16:20:44 | FromDiscord | <Rika> one shitty library fresh outta the oven https://github.com/de-odex/shama/ |
16:20:49 | FromDiscord | <treeform> this https://github.com/disruptek/frosty/blob/master/tests/bench.nim ? |
16:20:58 | disruptek | yes. |
16:21:04 | FromGitter | <deech> Clyybber: I changed the example to use a `ref object` and it still doesn't prevent access. https://play.nim-lang.org/#ix=2KCF |
16:21:28 | disruptek | maybe it's case objs you don't do, yet? |
16:21:42 | FromDiscord | <treeform> I am waiting for nim to add case objects in generics |
16:21:49 | FromDiscord | <treeform> you can only use case objects in macros |
16:21:58 | * | nyaa8 quit (Quit: byeee~) |
16:22:02 | * | disruptek shrugs. |
16:22:04 | FromDiscord | <Clyybber> deech: refs have ref semantics, they don't prevent copies, since their copies are just ref copies |
16:22:11 | * | nyaa8 joined #nim |
16:22:27 | FromDiscord | <treeform> before 1.0 they had ability to set the case object key field... |
16:22:33 | FromDiscord | <treeform> they removed that ability I don't know why |
16:22:44 | disruptek | what do you mean? |
16:22:45 | FromDiscord | <treeform> they should have kept it under some sort of usafe flag |
16:22:59 | disruptek | you mean discriminator transitions? |
16:23:04 | FromDiscord | <treeform> yes |
16:23:08 | FromDiscord | <Clyybber> deech: https://play.nim-lang.org/#ix=2KCI |
16:23:14 | disruptek | in theory you still can; in practice... it's complicated. |
16:23:36 | Zevv | yeah, much better: https://github.com/zevv/testes/commit/316139df9dd2545cc1b91d5b193ffcca4cea5858 |
16:23:48 | disruptek | lol |
16:23:53 | FromDiscord | <Filipe Duarte> How to understand the usage of {.word.} curly brackets after procedures args? For example: {.inline.} |
16:23:59 | disruptek | zevv: pr it |
16:24:25 | FromDiscord | <Filipe Duarte> What is the document to study? |
16:24:28 | disruptek | i find it nice to scroll through my CI and see color. |
16:24:33 | FromDiscord | <Filipe Duarte> (edit) "study?" => "study this?" |
16:24:46 | disruptek | filipe: "pragma" |
16:24:46 | Zevv | color is ok |
16:24:52 | Zevv | but then use normal ascii + ansi colors |
16:24:58 | Zevv | not colored unicode blurps |
16:25:06 | disruptek | zevv: make it a flag and we'll both be happy. |
16:25:11 | Zevv | tadaa |
16:25:16 | FromDiscord | <treeform> @disruptek `frosty\tests\bench.nim(14, 10) Error: define danger for benchmarks` why? |
16:25:26 | FromGitter | <deech> Clyybber: thanks! |
16:25:55 | disruptek | because otherwise you're measuring runtime cost of assertions. |
16:26:00 | Zevv | disruptek: also, consider making it eat `suite "foo":`, that'll make it drop in from the unittests |
16:26:11 | FromDiscord | <Clyybber> Araq: ping |
16:26:19 | disruptek | Zevv: scramper was adding that but, i dunno, he gave up or something. |
16:26:26 | Zevv | it was probably hard |
16:26:33 | disruptek | you think? |
16:26:42 | Zevv | I stopped that years ago |
16:26:56 | disruptek | template suite(x: string; body: untyped) = testes: body |
16:27:14 | disruptek | it's harder than it looks, i guess? |
16:27:23 | Zevv | I was just typing exactly that |
16:29:32 | FromDiscord | <Filipe Duarte> thanks! |
16:29:44 | disruptek | zevv: export it. |
16:29:49 | Zevv | pfff |
16:30:07 | Zevv | so lazy. |
16:30:15 | FromDiscord | <Rika> lmao nimble failed publishing |
16:30:16 | FromDiscord | <Clyybber> disruptek: you can use effecttraits.nim to query {.tags.} btw |
16:30:31 | disruptek | clyybber: yeah, i couldn't remember how to do it. |
16:31:02 | FromDiscord | <Clyybber> getTagsList |
16:31:16 | disruptek | wdyt about automagically determining blocking calls using effects? |
16:32:26 | disruptek | we can determine which types and calls are tainted and generate cps primitives for them. |
16:32:36 | disruptek | this would probably be a separate library. |
16:32:41 | FromDiscord | <Clyybber> hmm |
16:32:56 | FromDiscord | <Clyybber> interesting idea, but the blocking stuff is already declared, so we can't attach tags to it |
16:33:02 | Zevv | disruptek: hmm you need a lot of info in these effects |
16:33:07 | Zevv | I think it doesn't pay off |
16:33:11 | Zevv | you need only a handful of things |
16:33:13 | disruptek | we don't need to add effects to existing stuff. |
16:33:25 | disruptek | the pay-off is that there's no color. |
16:33:27 | FromDiscord | <Clyybber> and a proc can also be "kind of blocking" |
16:33:42 | FromDiscord | <Clyybber> disruptek: Please clarify |
16:33:43 | Zevv | disruptek: I'm not not liking it |
16:33:55 | disruptek | Zevv: don't import it. 😁 |
16:34:29 | FromDiscord | <Clyybber> all communcation channels are dead :/ |
16:34:45 | disruptek | what does "kind of blocking" mean? |
16:34:50 | FromDiscord | <Clyybber> except for github I guess |
16:34:51 | disruptek | i'm talking about sniffing types and calls. |
16:35:15 | FromDiscord | <Clyybber> disruptek: It could block for the first half, but then decide to do the rest non-blocking |
16:35:41 | Zevv | disruptek: as usual: one thing at a time |
16:35:55 | FromDiscord | <Clyybber> proc openTwoWindows() : opens the first window blocking, returns and opens the second window without blocking |
16:36:18 | disruptek | yes, but the first call will tag the proc as blocking. |
16:36:34 | FromDiscord | <Clyybber> yes, but its not an all or nothing thing |
16:36:43 | disruptek | it doesn't matter, does it? |
16:37:05 | FromDiscord | <treeform> I ported your test to my system: |
16:37:06 | FromDiscord | <treeform> https://gist.github.com/treeform/b21db06a96646c84b0d5d85bc65ac06e |
16:37:07 | disruptek | if any clause of an if statement has a cps call in it, i need to split the entire statement. |
16:37:22 | FromDiscord | <Clyybber> disruptek: But how will the first call tag it as blocking? The proc it calls isn't tagged |
16:37:25 | * | Xe joined #nim |
16:37:32 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
16:38:29 | * | Cadey is now known as Guest57365 |
16:38:29 | * | Guest57365 quit (Killed (egan.freenode.net (Nickname regained by services))) |
16:38:29 | * | Xe is now known as Cadey |
16:38:37 | disruptek | what are you saying? you're hiding the fact that it blocks? |
16:38:48 | FromDiscord | <treeform> here its with danger: https://gist.github.com/treeform/81e966bf70b50e68b0f2dacf88ca9f92 |
16:39:14 | disruptek | treeform: how do you explain the difference? |
16:39:45 | FromDiscord | <treeform> you use StringStream? |
16:40:02 | FromDiscord | <treeform> I support tIntset |
16:40:05 | disruptek | run the test against a stream, then. |
16:40:24 | FromDiscord | <treeform> but frosty crashing reading it |
16:40:35 | FromDiscord | <Clyybber> disruptek: I don't understand |
16:40:49 | FromDiscord | <treeform> sorry the bug was on my end |
16:41:09 | FromDiscord | <treeform> I seem to support Intset |
16:41:13 | FromDiscord | <treeform> but I have never used it |
16:41:20 | FromDiscord | <treeform> you said I don't |
16:41:26 | disruptek | neat, let me check again. |
16:41:39 | FromDiscord | <treeform> I don't support case objects |
16:41:46 | FromDiscord | <treeform> and json is one |
16:41:54 | disruptek | 0.1.4 is the version i should use? |
16:42:02 | FromDiscord | <Clyybber> disruptek, Zevv: Supporting inline iterators would probably be easier when inline iterators would be implemented as templates |
16:43:01 | FromDiscord | <Clyybber> or macros |
16:44:11 | FromDiscord | <rinfz> given some code like this, is there any way i can prevent `Error: undeclared identifier: 'draft'`, i.e. introduce a variable at the call that maps to the inner lambdas `draft` arg? https://media.discordapp.net/attachments/371759389889003532/794969293775306783/unknown.png |
16:44:15 | disruptek | treeform: flatty 0.1.4 works on intsets 🎉 |
16:44:24 | FromDiscord | <treeform> great! |
16:44:34 | FromDiscord | <treeform> @disruptek `thaw[type(what)](what.freeze())` works |
16:44:47 | FromDiscord | <treeform> but `what.freeze().thaw[type(what)]()` does not |
16:44:56 | FromDiscord | <treeform> `frosty.nim(419, 12) Error: cannot instantiate: 'T'` |
16:45:28 | disruptek | for, what, any type? |
16:45:33 | FromDiscord | <treeform> string |
16:45:34 | FromDiscord | <Rika> isnt it `.thaw[:type(what)]()`? |
16:46:13 | disruptek | that's surprising. |
16:46:44 | FromDiscord | <Rika> @rinfz make it `proc (draft: T {.inject.}) =` instead (i think, might have gotten the order wrong) |
16:48:41 | FromDiscord | <rinfz> holy hell, i didnt expect it to be that easy |
16:50:10 | FromDiscord | <Rika> its easy because you're still at the simple issues |
16:50:27 | FromDiscord | <rinfz> lets hope i stay there 🙂 |
16:51:24 | * | Cadey quit (Quit: WeeChat 2.9) |
16:51:26 | disruptek | treeform: can confirm. that's nuts. |
16:52:02 | * | Xe joined #nim |
16:52:04 | disruptek | must be a recent change. |
16:52:19 | FromDiscord | <treeform> I think I run into an issue like that before |
16:52:30 | FromDiscord | <treeform> that is why I started to use foo(X) vs foo[X]() |
16:52:32 | FromDiscord | <Clyybber> @timotheecour Did you see https://github.com/nim-lang/Nim/issues/16526 ? |
16:52:33 | * | filcuc quit (Ping timeout: 256 seconds) |
16:52:39 | disbot | ➥ config file resolution might be broken or reported incorrectly ; snippet at 12https://play.nim-lang.org/#ix=2KCU |
16:54:23 | * | Xe is now known as Cadey |
17:10:40 | * | filcuc joined #nim |
17:21:36 | * | Arrrrrrrr joined #nim |
17:24:16 | * | filcuc quit (Ping timeout: 240 seconds) |
17:31:06 | * | NimBot joined #nim |
17:31:59 | * | a_chou joined #nim |
17:34:59 | FromDiscord | <fwsgonzo> im having trouble testing a cstring for NULL |
17:35:33 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KD5 |
17:45:33 | FromDiscord | <exelotl> Zevv: hey I got nimcoro running on the gba! :D |
17:46:54 | FromDiscord | <Clyybber> @exelotl Btw, whats your issue with arc again? |
17:47:27 | FromDiscord | <Avatarfighter> @exelotl oh wow that's crazy |
17:47:45 | FromDiscord | <exelotl> (well a trimmed down version of it that doesn't use ref types) |
17:49:19 | FromDiscord | <exelotl> @Clyybber --gc:arc --os:any --d:useMalloc gives this assertion failure: `NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void) && NIM_INTBITS == sizeof(NI)8, "");` |
17:49:44 | FromDiscord | <exelotl> I guess it's assuming a 64 bit system? |
17:50:18 | FromDiscord | <Clyybber> hmm, seems like it, can you static: echo sizeof(int) ? |
17:51:33 | FromDiscord | <exelotl> hmm it does echo 4 |
17:51:59 | FromDiscord | <exelotl> same for sizeof(pointer) |
17:52:55 | FromDiscord | <exelotl> so I guess that's not exactly it... |
17:54:08 | FromDiscord | <exelotl> OH |
17:54:11 | qwr | C int is 4 on most 64-bit platforms, but pointers are 64 bit |
17:54:38 | Zevv | exolotl: what my funny nimcoro? |
17:54:54 | FromDiscord | <exelotl> it's an issue with my config.nims - I'm still doing `put "arm.standalone.gcc.exe", "arm-none-eabi-gcc"` |
17:55:29 | FromDiscord | <exelotl> so it's using the wrong GCC as soon as I switch to --os:any |
17:57:01 | FromDiscord | <exelotl> sweet! https://media.discordapp.net/attachments/371759389889003532/794987626570186752/Screenshot_from_2021-01-02_17-56-37.png |
17:57:25 | FromDiscord | <Avatarfighter> oh wow! |
17:57:29 | FromDiscord | <Avatarfighter> that's really cool!! |
17:59:30 | * | xet7 joined #nim |
17:59:30 | FromDiscord | <Clyybber> @exelotl yay \o/ |
18:00:10 | FromDiscord | <rinfz> sent a code paste, see https://play.nim-lang.org/#ix=2KDa |
18:00:17 | FromDiscord | <Clyybber> yes |
18:00:21 | FromDiscord | <exelotl> yup |
18:00:34 | FromDiscord | <Rika> it is? |
18:01:20 | FromDiscord | <rinfz> is there a workaround for ref types? |
18:02:07 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2KDc |
18:02:57 | FromDiscord | <exelotl> basically need to allocate a T object before you can do anything with it |
18:03:50 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2KDf |
18:04:21 | FromDiscord | <rinfz> ah, im dumb 😄 |
18:04:29 | FromDiscord | <rinfz> thanks |
18:04:33 | FromDiscord | <exelotl> np :) |
18:05:20 | FromDiscord | <exelotl> Zevv: yeah! I was using my `ecolo` library which is like uber shitty cps, for all cutscene/dialogue scripting in my game |
18:05:32 | FromDiscord | <exelotl> but was starting to run into bugs and limitations |
18:05:42 | FromDiscord | <exelotl> then I discovered someone implemented ucontext for GBA |
18:06:09 | FromDiscord | <exelotl> so I was able to adapt your nimcoro instead |
18:06:15 | FromDiscord | <exelotl> it works extremely well! |
18:06:24 | FromDiscord | <treeform> @disruptek I have added support for object variants, and now I can do your json benchmark. https://gist.github.com/treeform/93b56ce81a15fb3c6ce284face5424b7 |
18:06:38 | FromDiscord | <treeform> I don't like case objects... |
18:06:54 | disruptek | why not? |
18:07:12 | FromDiscord | <treeform> They are harder to deal with |
18:07:36 | FromDiscord | <treeform> they never fit the way I want them to fit |
18:07:41 | FromDiscord | <treeform> but I do suppor them |
18:08:04 | * | Zevv quit (Quit: Lost terminal) |
18:08:31 | * | Zevv joined #nim |
18:08:34 | Zevv | exelotl: thats cool, so it has at least one user now |
18:08:54 | Zevv | so you have ucontext on your platform |
18:09:11 | FromDiscord | <treeform> @disruptek also: `frosty.nim(218, 13) Warning: Potential object case transition, instantiate new object instead [CaseTransition]` |
18:09:18 | disruptek | case objects compose pretty well in nim; i don't think inheritance is superior. |
18:09:32 | disruptek | yeah, transitions are safe in some cases. |
18:09:34 | FromDiscord | <treeform> I agree inheritance is terrible |
18:10:08 | FromDiscord | <treeform> @disruptek, if you think that transition is safe there, can you silence the warning? |
18:10:50 | disruptek | probably. i will cut a 1.0 release that changes frosty Real Soon Now. |
18:11:04 | disruptek | got a lot of snow to move today... |
18:11:22 | Zevv | Real Soon Now |
18:11:50 | disruptek | yep. |
18:15:47 | planetis[m] | i see you really like to compare your libs with benchmarks |
18:16:05 | disruptek | it's easy. |
18:17:58 | planetis[m] | disruptek: as i said treeform to get better speed you need to use when supportsCopyMem(T) and do copyMem with arays/seqs/objects/tuples |
18:18:22 | FromDiscord | <treeform> planetis, already done, thank you for that tip |
18:18:24 | disruptek | yeah, i have a ticket to put it into 1.0. |
18:18:28 | planetis[m] | he wins bc he knows this secret :P |
18:18:41 | disruptek | it's actually already written, i just want to break frosty a bit more. |
18:19:03 | * | zedeus quit (Ping timeout: 265 seconds) |
18:19:17 | FromDiscord | <treeform> I just want to outsource my speed ideas to you guys. |
18:20:02 | disruptek | the speed is good enough for my uses at the moment. jason is a bigger speed problem. |
18:20:32 | disruptek | to put that another way, there is more room to optimize jason and win real benefit. |
18:20:37 | FromDiscord | <treeform> Guzba has a nim copymem that's faster then system copymem, I should try to see if that's a speedup. |
18:20:37 | * | zedeus joined #nim |
18:21:36 | FromDiscord | <Clyybber> why is it faster? |
18:21:54 | FromDiscord | <treeform> disruptek, I reached feature parity, uphold your and of the bargain. Make frosty faster! |
18:22:19 | disruptek | i will. 😈 |
18:22:37 | * | vsantana quit (Ping timeout: 246 seconds) |
18:22:57 | FromDiscord | <treeform> @Clyybber I think because its less safer, copies in 64 bit chunks. System copy mem must support huge copies as well as tiny copies. |
18:23:05 | FromDiscord | <Clyybber> I see |
18:23:18 | disruptek | 64 bit or 64 byte? |
18:23:43 | FromDiscord | <treeform> Its probably faster to copy large chunks of memory by not copying memory at all but resigning the virtual pages. |
18:23:58 | FromDiscord | <treeform> But if you copy small things you don't need a check for that? |
18:24:13 | FromDiscord | <treeform> 64 bit |
18:24:33 | disruptek | i would rather have less code that is slower and more reliable. |
18:24:34 | FromDiscord | <treeform> Without using SIMD that's all you can load. |
18:25:02 | disruptek | once i have one copy, i'm satisfied. |
18:25:28 | FromDiscord | <treeform> I want the fastest code possible (provided it works ofc) |
18:25:46 | disruptek | i mean, as long as i don't have an extra copy, i'd rather optimize loc. |
18:26:54 | * | Zevv quit (Quit: Lost terminal) |
18:27:13 | * | Zevv joined #nim |
18:30:25 | planetis[m] | sounds like a variation of busy work really, I must focus finishing my project instead |
18:31:33 | * | vsantana joined #nim |
18:35:39 | leorize[m] | is it possible to forward declare a type? |
18:36:59 | FromDiscord | <fwsgonzo> im in string copying hell |
18:37:01 | * | Zevv quit (Quit: Lost terminal) |
18:37:22 | * | Zevv joined #nim |
18:39:19 | saem | Morning |
18:39:40 | * | D_ quit (Ping timeout: 256 seconds) |
18:46:26 | FromDiscord | <fwsgonzo> can I accept a ref cstring from C? |
18:46:38 | FromDiscord | <lqdev> @leorize knowing for how long you've used nim i would've expected you to know the answer to that question, but the answer is: no. |
18:46:45 | FromDiscord | <lqdev> you have to put them under a single type section |
18:49:28 | * | lritter quit (Quit: Leaving) |
18:50:02 | Oddmonger | i have a myseq (seq[uint8]) , filled with values. When i try a myseq.join , compiler says « undeclerad field join » |
18:50:28 | Oddmonger | but i can echo the whole sequence (without the «join») |
18:50:52 | Zevv | did you import strutils then |
18:51:02 | Oddmonger | *shame on me* |
18:51:13 | Zevv | oh wait uint8, that'll not work |
18:51:17 | Zevv | no shame |
18:51:50 | saem | Echo is using $, I think, so that's why that works |
18:51:51 | Oddmonger | indeed it works: https://play.nim-lang.org/#ix=2KDB |
18:52:28 | Oddmonger | but i'd rather like to have «ab» string instead of values |
18:52:45 | Oddmonger | maybe toString before |
18:53:30 | Zevv | https://play.nim-lang.org/#ix=2KDD |
18:53:36 | Zevv | convert your uint8s to chars |
18:53:46 | Zevv | this makes a copy. If you're brave you can cast |
18:53:56 | FromDiscord | <fwsgonzo> is there a move-like keyword? |
18:54:06 | Zevv | no. there is only `move` |
18:54:27 | Oddmonger | i see, thank you (well in fact it's kind of magic) |
18:54:38 | * | D_ joined #nim |
18:54:51 | Zevv | Oddmonger: https://play.nim-lang.org/#ix=2KDF |
18:55:39 | * | hnOsmium0001 joined #nim |
18:55:41 | Oddmonger | ah ok, like the good old &mystring[0] |
18:55:47 | Zevv | but this one is probably best: https://play.nim-lang.org/#ix=2KDG |
18:56:02 | Zevv | but it's kind of nasty, since it assums seq and str are the same thing under the hood |
18:56:06 | Zevv | they happen to be at this time |
18:56:11 | Zevv | but they might not in the future |
18:56:36 | Zevv | but it's cheapest as there is no copying involved |
18:57:49 | Oddmonger | so for «future proof», the best would be the cast à-la-C (cast[cstring](myseq[0].addr) ) ? |
18:58:37 | mipri | no, for the opposite of future-proofing do that |
18:59:48 | mipri | I've been told the problem with casting seq[char] to string is precisely that a trailing NUL isn't guaranteed for seq[char] but is assumed by some string->cstring conversions. |
19:00:48 | Oddmonger | hmmm |
19:00:55 | Zevv | yea, trust mipri, not me |
19:01:41 | * | abm quit (Quit: Leaving) |
19:07:10 | * | Jesin quit (Quit: Leaving) |
19:12:13 | Zevv | How can I genericize an int range type? |
19:13:00 | Zevv | I want a proc that works on `set[char|int]`, but putting in `{1,2,3}` doesn't match because that's `set[range 0..65535(int)]` instead |
19:13:47 | FromDiscord | <treeform> planetis, I benched your json serializer it appears to be slower then std lib? https://gist.github.com/treeform/572e6d200fe17a409a7cb510dea62001 |
19:15:22 | FromDiscord | <Avatarfighter> @treeform just curious, why are you benchmarking so many libraries? |
19:17:01 | * | xet7 quit (Quit: Leaving) |
19:19:35 | FromDiscord | <treeform> I want to mine them for nuggets of speed goodness |
19:20:04 | FromDiscord | <Daniel> got to go fast |
19:20:08 | FromDiscord | <Avatarfighter> fr |
19:20:11 | FromDiscord | <treeform> also https://handmade.network/manifesto |
19:21:54 | FromDiscord | <Daniel> Manifesto is great, but ppl are lazy, and they will always clutter..... |
19:22:09 | FromDiscord | <treeform> @disruptek You don't do json parsing yet right? https://github.com/disruptek/jason |
19:22:31 | FromDiscord | <treeform> @Daniel true, I am just not being lazy. |
19:22:41 | FromGitter | <timotheecour> > *<FromDiscord>* <Clyybber> @timotheecour Did you see https://github.com/nim-lang/Nim/issues/16526 ? |
19:22:43 | disbot | ➥ config file resolution might be broken or reported incorrectly ; snippet at 12https://play.nim-lang.org/#ix=2KCU |
19:22:45 | FromGitter | <timotheecour> @Clyybber ya |
19:23:00 | Zevv | treeform: nope, only serializing |
19:23:13 | FromDiscord | <Clyybber> @timotheecour Is it a bug, or is it intended? |
19:23:20 | FromGitter | <timotheecour> bug |
19:23:30 | * | abm joined #nim |
19:23:39 | FromGitter | <timotheecour> (Pre-existing); while investigating it i found a regression: https://github.com/nim-lang/Nim/issues/16556 |
19:23:40 | disbot | ➥ regression(1.4.2=>devel): `nim c main` creates `pkgs` dir in current directory |
19:30:32 | * | xet7 joined #nim |
19:32:09 | FromGitter | <timotheecour> @claudiunv ok i have a fix coming |
19:33:24 | * | lritter joined #nim |
19:33:31 | FromDiscord | <Clyybber> cool! (I suppose you meant to ping me :) |
19:35:42 | Zevv | -EWRONGTABEXP |
19:36:13 | * | D_ quit (Ping timeout: 264 seconds) |
19:38:10 | * | Jesin joined #nim |
19:44:03 | * | disruptek throbs. |
19:45:13 | FromDiscord | <Clyybber> @timotheecour Can you add a test? |
19:47:07 | FromDiscord | <Clyybber> It should be possible using testaments "output" directive |
19:47:07 | * | fanta1 quit (Quit: fanta1) |
19:47:17 | FromDiscord | <Clyybber> eh, "nimout" I mean |
19:47:29 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
19:48:38 | * | Prestige quit (Quit: Prestige) |
19:48:49 | FromDiscord | <Clyybber> since it checks for ordered subset (AFAIK?) it can be tested independently of where the repo or the install directory resides |
19:52:24 | * | Prestige joined #nim |
19:55:37 | ForumUpdaterBot | New thread by Mantielero: C++ bindings - doubt with an argument's default value, see https://forum.nim-lang.org/t/7324 |
20:01:18 | * | a_b_m joined #nim |
20:02:01 | * | a_b_m quit (Client Quit) |
20:02:07 | * | D_ joined #nim |
20:08:40 | * | JustASlacker joined #nim |
20:10:13 | * | Vladar quit (Quit: Leaving) |
20:10:29 | planetis[m] | treeform: give us the benchmarks, im sure you did something naive like coping the stream to string and such |
20:10:59 | FromGitter | <timotheecour> > *<FromDiscord>* <Clyybber> @timotheecour Can you add a test? ⏎ ⏎ I already did, let’s discuss in that PR https://github.com/nim-lang/Nim/pull/16557 |
20:11:00 | disbot | ➥ fix #16526 run config.nims before foo.nim.cfg |
20:11:04 | planetis[m] | but you should know i have work to do now |
20:16:33 | FromDiscord | <treeform> planetis, sorry I will not bother you with bench mark stuff 😦 |
20:16:44 | FromDiscord | <treeform> you should have told me earlier you don't want my input |
20:16:45 | FromDiscord | <Daniel> i like benchmarks |
20:19:46 | FromDiscord | <treeform> Could GPU serialize json faster then CPU? hmmm |
20:20:23 | FromDiscord | <Clyybber> @timotheecour Commented on the PR |
20:32:35 | planetis[m] | @treeeform oh no, that's not what I meant, but if you dont feel like giving input, I can't extract it from you |
20:33:17 | planetis[m] | i just dont get this aggressive marketing "we do everything for speed" and if it pays off. |
20:33:57 | planetis[m] | what about usability, bug fixes, features, do they go down the drain? |
20:34:06 | * | lritter quit (Quit: Leaving) |
20:34:07 | FromDiscord | <treeform> Its ok, we all trying to ship some thing. |
20:34:13 | FromDiscord | <treeform> We all have limited time. |
20:34:20 | FromDiscord | <treeform> I totally get it. |
20:35:44 | planetis[m] | *error checking as well |
20:36:05 | FromDiscord | <treeform> I am not saying forget about usability, bug fixes, features... |
20:36:22 | planetis[m] | 👍 |
20:36:29 | FromDiscord | <treeform> It just everyone always forgets about speed. That is what made me want to use nim. |
20:36:42 | FromDiscord | <treeform> We have these super fast computers but most software just kind of runs slow. |
20:37:04 | FromDiscord | <treeform> Its easy to see when you have a bug, but its hard to see when some thing is slow. |
20:37:33 | FromDiscord | <treeform> I just want to write better code, faster code. |
20:37:33 | FromDiscord | <haxscramper> > yeasy to see when you have a bug |
20:37:39 | FromDiscord | <haxscramper> (edit) "yeasy" => "easy" |
20:37:56 | FromDiscord | <treeform> I don't want to pollute the world with my shitty slow code, I just want to rise above that. |
20:38:54 | Zevv | treeform: I admire your courage |
20:39:28 | disruptek | i would rather have slow code that is at the correct abstraction. then if it can be made faster, someone will do it. |
20:41:40 | Zevv | Imagine what it's like to be me. I haven't learned anything new in, like, 25 years. I type the same kind of code for 25 years. So my code has become 4096 times faster, just by doing *nothing new* |
20:42:09 | Zevv | I just do #include <stdio.h> and int main(). And every day, my stuff is more efficient then the day before |
20:42:42 | Zevv | I should put that on my CV, that my code gets twice as fast every two years. |
20:43:26 | FromDiscord | <Daniel> its interesting how your code has become 4096 times faster |
20:43:47 | FromDiscord | <treeform> I want my code to quadruple in speed every 2 years |
20:43:47 | Zevv | moores law. twice as fast every 2 years. 2^12-and-a-bit |
20:43:48 | Zevv | there you go |
20:44:02 | qwr | in this case you're ignoring best software practices to compensate for that unplanned speed increase ;) |
20:44:04 | FromDiscord | <treeform> By getting better at speed |
20:44:29 | Zevv | never change a winning algorithm |
20:44:39 | Zevv | if it was good enough for dijkstra, it's good enough for me |
20:49:25 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2KEn |
20:49:26 | FromDiscord | <lqdev> excuse the hell outta me? |
20:52:57 | disruptek | i do love the animated graphs of cpu speed growth. |
20:53:15 | * | _randyr joined #nim |
20:53:16 | disruptek | like the one in /the social dilemma/ |
20:53:47 | disruptek | we lived with those early pre-x86 machines, man. |
20:54:16 | _randyr | Minor doc thing: the `succ` and `pred` functions declare a variable in the docs, but then don't use them: https://nim-lang.org/docs/system.html#succ%2CT%2Cint |
20:57:42 | disruptek | lqdev: that's awesome, haha |
20:58:13 | FromDiscord | <lqdev> disruptek: you know what the problem was? |
20:58:20 | disruptek | what? |
20:58:30 | FromDiscord | <lqdev> i was passing a static int32 to a generic param that wanted a static int |
20:58:33 | FromDiscord | <Clyybber> _randyr: Thanks, already fixed here: https://nim-lang.github.io/Nim/system#succ%2CT%2Cint |
20:58:40 | FromDiscord | <lqdev> and it didn't cause any problems at the first instantiation |
20:58:49 | FromDiscord | <lqdev> only at this call for some reason |
20:59:00 | disruptek | generics+statics are super fun. |
20:59:04 | FromDiscord | <lqdev> yes. |
20:59:31 | disruptek | took me forever to get gram working with them, and i don't know if i can ever modify it now. 🤣 |
21:00:46 | * | _randyr quit (Remote host closed the connection) |
21:23:23 | FromDiscord | <jken> I've imported sequtils, any know why I can't toSeq a HashSet<system.String>? |
21:24:34 | FromDiscord | <haxscramper> Have you imported `std/sets` too? And can you show the error if not |
21:24:48 | FromDiscord | <haxscramper> if you did import |
21:24:54 | FromDiscord | <jken> aha, yep, that was it! |
21:30:47 | * | a_chou quit (Quit: a_chou) |
21:31:56 | * | JustASlacker quit (Ping timeout: 240 seconds) |
21:55:51 | ForumUpdaterBot | New thread by Chris3606: Creating Custom DLLMain using MSVC, see https://forum.nim-lang.org/t/7326 |
21:56:02 | FromDiscord | <Randall> Doc typo in `clamp`: https://nim-lang.github.io/Nim/system#clamp%2CT%2CT%2CT↵↵"fatser" -> "faster" |
21:58:45 | ForumUpdaterBot | New question by Alex Craft: Why referring to immutable variable is NOT side effect free in Nim?, see https://stackoverflow.com/questions/65544504/why-referring-to-immutable-variable-is-not-side-effect-free-in-nim |
22:09:53 | ForumUpdaterBot | New thread by Lecale: What am I doing wrong with streams, see https://forum.nim-lang.org/t/7327 |
22:17:06 | * | narimiran quit (Ping timeout: 256 seconds) |
22:30:03 | * | vsantana quit (Quit: vsantana) |
22:44:49 | FromDiscord | <exelotl> heyy, I have a question about closure iterators |
22:45:22 | disruptek | yes, they will be replaced by cps. |
22:45:35 | disruptek | all your iteration are belong to us. |
22:45:35 | FromDiscord | <exelotl> hehehe |
22:45:57 | FromDiscord | <exelotl> my question is, are they like, naturally prone to leaking memory under ARC? Or just certain usages of them? |
22:46:16 | disruptek | not as far as i know. |
22:46:32 | disruptek | do you have a repro? |
22:47:01 | FromDiscord | <dk> does stdlib have sugar for this """pattern"""? https://media.discordapp.net/attachments/371759389889003532/795060609606746112/unknown.png |
22:47:16 | FromDiscord | <lqdev> just… use object constructor syntax? |
22:47:37 | FromDiscord | <dk> to be more explicit - I want to copy all the fields from row to p |
22:47:44 | FromDiscord | <lqdev> oh |
22:47:48 | FromDiscord | <lqdev> well, not that i know of |
22:47:52 | disruptek | short answer: no. long answer: write a macro. |
22:47:55 | ForumUpdaterBot | New thread by Chris3606: Cross-Compiling for Windows 32-bit with ChooseNim Install, see https://forum.nim-lang.org/t/7328 |
22:48:03 | FromDiscord | <exelotl> disruptek: nope, it's just I'm aware that the async implementation suffered from lots of leaks or something before ORC came along to save the day |
22:48:18 | FromDiscord | <exelotl> so I was wondering what the cause behind that was |
22:48:29 | disruptek | you could maybe do it with an assignment macro that takes a concept argument... would be kinda nifty. |
22:49:09 | FromDiscord | <dk> I thought concepts are died |
22:49:12 | disruptek | exelotl: it's /mostly/ fixed, afaik, due to fixes to async to reduce cycles and fixes to orc to collect cycles. but, who knows. |
22:49:41 | disruptek | concepts are being reimpl'd and there's no support for old syntax yet. |
22:49:47 | disruptek | also, the new impl is not merged. |
22:50:31 | FromDiscord | <exelotl> ah, so it was an "async introduces cycles" problem rather than a "closure iterators introduce cycles" problem |
22:50:43 | disruptek | for two years i was told there was no reason not to use concepts. i started using concepts. almost immediately, concepts were reimpl and few of my advanced uses work. so, go figure. |
22:51:31 | disruptek | exelotl: ymmv. i don't use async if i can help it, so i can't offer personal experience. i don't have any async code that doesn't crash or leak memory, fwiw. |
22:52:23 | disruptek | the only modern async code i have is in the bot. it crashes as often as you see it commit to the disruptek/disbot repo. |
22:52:36 | disruptek | disbot: are you leaking memory right now? |
22:52:36 | disbot | my sources say no. |
22:52:44 | disruptek | !memory |
22:52:45 | disbot | total: 93 Megabytes; free: 22 Megabytes; owned: 67 Megabytes; max: 93 Megabytes |
22:52:53 | disruptek | my sources say yes. |
23:02:44 | * | xet7 quit (Quit: Leaving) |
23:09:46 | * | natrys quit (Quit: natrys) |
23:10:41 | saem | Is there a relatively simple explanation as to why sem* modules are broken up and then composed via includes as opposed to importing? |
23:11:10 | * | tane quit (Quit: Leaving) |
23:17:22 | * | radgeRayden_ quit (Ping timeout: 260 seconds) |
23:17:53 | * | radgeRayden joined #nim |
23:19:04 | FromDiscord | <lqdev> possibly to not have a single hard to manage 10000 line file |
23:22:06 | saem | I agree that would be unwieldy, but include vs import |
23:23:15 | FromDiscord | <ElegantBeef> Cause including copies it together so it works as a single file so you can easily have circular logic as long as you forward declare |
23:23:49 | FromDiscord | <ElegantBeef> Import gets a little funky with circular logic as of now |
23:24:59 | FromDiscord | <ElegantBeef> Atleast that'd be my approximation of why using include over import, plus they compose a single file which is what include is made for |
23:27:26 | disruptek | it's a pita in the compiler like nowhere else. |