<< 02-01-2021 >>

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:23FromDiscord<fwsgonzo> can you pass a nim function to C? and then back?
01:01:34disrupteksure.
02:37:49*cyraxjoe joined #nim
02:55:56FromDiscord<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:26disruptekwhat do you want me to do about it?
02:57:49FromDiscord<exelotl> hang on I might have solved it xD
02:58:24FromDiscord<exelotl> basically the toolchain makefiles will happily compile these .s files, but Nim won't
02:58:52disruptekwhat's the difference?
03:05:07leorizejust use --verbosity:3 and it should tell you how Nim is trying to compile those
03:05:23disruptekor --listCmd i suppose.
03:05:29leorize`make V=1` usually will print the commands the makefile run too
03:06:55FromDiscord<exelotl> oh thanks that'll be handy
03:07:40FromDiscord<exelotl> from what I can see so far, I need to pass "-x assembler-with-cpp"
03:08:12FromDiscord<exelotl> or rename my file to `foo.S` instead of `.foo.s` because of course I do.
03:08:19FromDiscord<exelotl> (edit) "`.foo.s`" => "`foo.s`"
03:16:34FromDiscord<exelotl> ah so the catch is you shouldn't pass it to a C file
03:21:53FromDiscord<Ben Boughton> sent a long message, see http://ix.io/2Kzn
03:32:23FromGitter<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:29FromGitter<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:25FromDiscord<Ben Boughton> If you see this later and want to email [email protected]
04:05:16FromDiscord<Cohjellah> had Thread[T] been deprecated or something?
04:05:40disruptek--threads:on
04:05:41FromDiscord<ElegantBeef> What makes you ask?
04:05:54FromDiscord<Cohjellah> mmmmmmmmmmmmmm VS code errors
04:05:58FromDiscord<Cohjellah> that's what makes me question
04:05:59FromDiscord<Rika> normal
04:06:02FromDiscord<Cohjellah> so it works, just intellisense
04:06:08FromDiscord<Rika> nimsuggest doesnt check with --threads:in
04:06:09FromDiscord<Rika> on
04:06:15FromDiscord<Cohjellah> boo
04:06:58FromDiscord<ElegantBeef> You need to add it to the cfg
04:07:04FromDiscord<Rika> i think you can make it but i forgot how
04:07:04FromDiscord<ElegantBeef> It cannot intuit you want threads on
04:07:14FromDiscord<ElegantBeef> You just add it to one of the cfg methods
04:07:16FromDiscord<Rika> ah yes internet sending late to make me look like an idiot
04:08:25FromDiscord<Cohjellah> so if I have a .nims file
04:08:31FromDiscord<Cohjellah> intellisense will pick up on it
04:09:27FromDiscord<Cohjellah> also, array/list[T].len is supposed to return an integer right?
04:09:42FromDiscord<Cohjellah> sorry, nvm ignore that
04:09:45FromDiscord<Cohjellah> I meant string.len
04:10:07FromGitter<offbeat-stuff> How to autoconvert OPERATOR_CLEAR to OperatorClear
04:10:08FromDiscord<Rika> yes why
04:10:10FromGitter<offbeat-stuff> strutils
04:10:18disruptekno point.
04:10:37FromDiscord<Rika> why do you need that offbeat?
04:11:05FromDiscord<Rika> theres no proc for that
04:11:26disruptekthere is, but it's 1.4+ iirc.
04:11:29FromDiscord<Avatarfighter> offbeat-stuff: making that proc would be a great way to practice nim though
04:11:39FromDiscord<Cohjellah> Idk I'm trying to do 0 .. <param.len
04:11:46FromDiscord<Cohjellah> and it's just throwing me errors about type mismatches
04:11:58FromDiscord<Rika> avatar i have a small question, whats your opinion on the nimble package `nim-random`?
04:12:09disrupteki have an impl in ups, also.
04:12:10disruptek!repo ups
04:12:11disbothttps://github.com/dmknght/UPS -- 9UPS: 11Super stupid secret 15 1⭐ 1🍴 7& 1 more...
04:12:13FromDiscord<Rika> use ..< instead of .. <
04:12:16disruptek!repo disruptek/ups
04:12:16disbothttps://github.com/disruptek/ups -- 9ups: 11a package handler 15 1⭐ 0🍴
04:12:30FromGitter<offbeat-stuff> Converting c++ enums to well nim code
04:12:43FromDiscord<Cohjellah> omg
04:12:43disruptekthose are already equivalent in nim.
04:12:47FromDiscord<Rika> you dont need to convert them
04:12:47FromDiscord<Cohjellah> Thanks Rika, fk
04:14:03FromGitter<offbeat-stuff> Nah I'm just renaming them
04:14:03FromGitter<offbeat-stuff> Is there a reduce in nim
04:14:09FromDiscord<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:13disruptekfoldl
04:14:24FromDiscord<Rika> ^ in sequtils
04:14:30FromDiscord<Avatarfighter> looking at it
04:14:52*D_ joined #nim
04:15:41FromDiscord<Avatarfighter> Rika: it looks good
04:15:46FromDiscord<Avatarfighter> why you ask
04:16:00FromDiscord<Rika> because i need more opinions than my own
04:16:20FromDiscord<Rika> would you prefer nim-random's api over nim's std/random?
04:16:27FromDiscord<ElegantBeef> doesnt ask me, wow
04:16:35FromDiscord<Rika> well you werent here
04:17:02FromDiscord<Avatarfighter> Rika: yeah I would
04:17:12FromDiscord<flywind> it's a bit broken in windows I think
04:17:12FromDiscord<Rika> im kinda iffy on nim-random really, it feels e
04:17:13FromDiscord<Rika> eh
04:17:14FromDiscord<Avatarfighter> its straightforward to read and use
04:18:03FromDiscord<Rika> holy fuck this is an old package
04:18:08FromDiscord<Rika> docs generated 2015
04:19:40FromDiscord<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:02FromDiscord<ElegantBeef> I personally dislike making an RNG then passing it around
04:20:08FromDiscord<Rika> i see
04:20:19FromDiscord<Cohjellah> have they changed how threading works in the past 2 years
04:20:32FromDiscord<Cohjellah> as in, made it safer, somewhat
04:20:37FromDiscord<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:42leorizethat's in-progress
04:20:43FromDiscord<Cohjellah> nvm I'm dumb ignore 🙂
04:22:30FromDiscord<ElegantBeef> Ah so keep up with the usualy coh 😛
04:23:06FromDiscord<Rika> huh why does nim-random not have a randomUint16?
04:23:14FromDiscord<Rika> just found that a bit odd
04:27:35FromDiscord<Cohjellah> RNG?
04:27:42FromDiscord<Avatarfighter> random number gene
04:27:44FromDiscord<Avatarfighter> (edit) "gene" => "generator"
04:27:51FromDiscord<Cohjellah> (edit)
04:27:54FromDiscord<ElegantBeef> Random number geezus
04:28:00FromDiscord<Cohjellah> yeah I deleted all my words before RNG
04:28:03FromDiscord<Cohjellah> idk how
04:28:03FromDiscord<ElegantBeef> Nope we have random in the stdlib
04:28:11FromDiscord<Cohjellah> ok so why does random-nim exist
04:28:19FromDiscord<ElegantBeef> Cause there are so many different impls 😄
04:28:29FromDiscord<Cohjellah> entropy, entropy everywhere
04:29:05FromDiscord<ElegantBeef> Well look at json, we have json, packedjson, jason, treeform's json lib, planetis' json library
04:29:43FromDiscord<Cohjellah> oh my god, do we?
04:29:46FromDiscord<ElegantBeef> Yes
04:29:54FromDiscord<Cohjellah> surely regular old json is good nuff
04:30:10FromDiscord<ElegantBeef> Well the regular json library is slower due to how it works
04:30:16FromDiscord<ElegantBeef> But it also enables manually going through nodes
04:30:30FromDiscord<ElegantBeef> Where as treeforms and jason i believe are straight to objects or from
04:30:49FromDiscord<ElegantBeef> So they're faster
04:30:51FromDiscord<Cohjellah> yeah nodes are groovy
04:31:06*D_ quit (Ping timeout: 265 seconds)
04:33:00FromDiscord<Rika> whos the next person to make a json library
04:33:27FromDiscord<Cohjellah> I think it's cool we have so many variants on one library
04:33:30FromDiscord<Rika> fucking name it derulo or something xdddddddd
04:33:34FromDiscord<Cohjellah> Means people are actively making stuff for the community
04:33:35disrupteki'm waiting for a decent deserializer.
04:33:47FromDiscord<Cohjellah> deserializer for what in particular
04:33:54disruptekjson.
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:07FromDiscord<Cohjellah> standard ones not good enough?
04:38:47FromDiscord<ElegantBeef> Rika i could make one, and name it my last name
04:38:53FromDiscord<Cohjellah> beef
04:38:59FromDiscord<Cohjellah> that's a good lib name
04:39:02FromDiscord<ElegantBeef> Just perfect naming since jason is my first name
04:39:03disrupteki want a zero-copy stream deserializer and i'm not willing to use the status code.
04:39:23FromDiscord<Rika> okay Jason Beef
04:39:34FromDiscord<ElegantBeef> Thats... not my lastname
04:39:41FromDiscord<Rika> thats the joke
04:39:43FromDiscord<Rika> :facepalm1:
04:39:44disruptekthat's his maiden name.
04:39:48FromDiscord<ElegantBeef> ^
04:39:51FromDiscord<Cohjellah> haha
04:39:53FromDiscord<ElegantBeef> I'm a maiden at heart
04:39:58FromDiscord<Cohjellah> Maiden Beef
04:40:11FromDiscord<Cohjellah> What's your favourite beef, k go
04:40:22FromDiscord<ElegantBeef> Salmon
04:40:26FromDiscord<Cohjellah> nice
04:42:47FromGitter<offbeat-stuff> what is a good way to port enums into nim that come from c++ and c
04:43:05disruptek!repo gittyup
04:43:06disbothttps://github.com/disruptek/gittyup -- 9gittyup: 11higher-level libgit2 bindings that build upon nimgit2 15 6⭐ 1🍴
04:43:09disrupteklotsa examples in there.
04:45:49FromDiscord<ElegantBeef> Much better version than those const ints
04:47:15FromDiscord<Rika> man i wish more people used procs with typedesc instead of putting the type name in the proc name
04:47:28FromDiscord<Rika> makes it easier by use generics instead of using a macro
04:47:32FromDiscord<Rika> by using
04:47:35disrupteki know.
04:47:54disruptekit makes me sad when i see new code written this way.
04:47:57*disruptek coughs.
04:47:59disruptek!repo flatty
04:48:00disbothttps://github.com/treeform/flatty -- 9flatty: 11Flatty - tools and serializer for plain flat binary files. 15 11⭐ 1🍴
04:48:02*disruptek coughs.
04:49:02disruptekcompare to frosty's api. 🙄
04:54:03FromGitter<offbeat-stuff> Let's I am import an enum from c++
04:54:15FromDiscord<ElegantBeef> Reminds me that i should clean up the nimscripter marshalling logic
04:54:32FromGitter<offbeat-stuff> It doesn't matter right If name them anything in nim
04:54:42FromGitter<offbeat-stuff> as long as they are in equal amount
04:55:26FromGitter<offbeat-stuff> Sorry for bad english I am eating words in b/w because of slow typing
04:56:51disrupteksounds tasty.
04:57:42FromGitter<offbeat-stuff> So disruptek shouldn;t matter right
04:59:56disruptekmost 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:40disruptekrika: what are you working on?
05:15:41FromDiscord<Rika> More PRNGs in pure nim for no reason other than I got interested in doing it again
05:16:01disruptekrepo link?
05:49:58FromDiscord<Rika> None yet
05:50:10disruptekball hairs?
05:50:16FromDiscord<Rika> I’ll upload it today xd
05:52:00*D_ joined #nim
05:57:44FromGitter<offbeat-stuff> Code
05:57:45FromGitter<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:01FromGitter<offbeat-stuff> Error
05:58:03FromGitter<offbeat-stuff> `/home/kai/coding/caironim/src/inc/cairomm/surface.nim(154, 6) Error: overloaded 'create' leads to ambiguous calls`
05:59:47FromGitter<offbeat-stuff> Error is same on both devel and stable version
06:02:01FromDiscord<Rika> Do you have another create procedure
06:02:38FromGitter<offbeat-stuff> Yeah
06:02:49FromGitter<offbeat-stuff> I will try and rename em
06:05:52*NimBot joined #nim
06:06:34disruptekzevv: the current problem is that the .cpsLift. stuff is getting duplicated, but only the exit/done proc. it's really weird.
06:08:27disrupteki think there's a rendering issue there, too; you have to treeRepr it because repr() cannot see it.
06:10:09disrupteksomething inside saften.
06:39:06saemRika by chance are the PRNGs to drive generators for property based testing? ;)
06:42:09FromDiscord<Rika> No I just ported them for no damn reason really
06:42:17FromDiscord<Rika> You can use them for that maybe sure
06:42:29FromDiscord<Rika> I haven’t tested whether they accurately depict the original yet though
06:45:45saemI have enough Nim related projects to keep me busy for a while.
06:46:09FromDiscord<dk> How do nimlets do mixed backend projects?
06:46:12saemBut 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:41FromDiscord<dk> Should I just split to a project per backend?
06:47:51FromDiscord<ElegantBeef> Why would you split the project
06:48:02FromDiscord<ElegantBeef> we use `when defined` so we dont severe the codebase
06:49:21FromDiscord<dk> because editor extension is too dumb to properly check the files if I set the backend in .nims instead of .nimble
06:49:40FromDiscord<dk> I don't think I can do `when` like that in .nimble
06:51:18FromDiscord<ElegantBeef> What are you doing in nimble
06:51:22saemThe editor getting fixated on the backend is definitely my bad.
06:52:19FromDiscord<dk> I have `frontend.nim` that's JS backend and `backend.nim` that's C backend
06:52:22FromDiscord<dk> that's all
06:52:38FromDiscord<ElegantBeef> I mean in your nimble
06:53:09FromDiscord<dk> I just set the backend to C or JS
06:53:37FromDiscord<dk> because I don't know of a way to set the backend depending on filename or whatever
06:53:43FromDiscord<dk> other than .nims
06:54:09FromDiscord<dk> If I set it to C than the JS file doesn't get checked
06:54:21FromDiscord<dk> If I set it to JS than it's the other way around
06:54:24FromDiscord<ElegantBeef> Well in this case your probably do want to separate the code since they arent the same application
06:54:41FromDiscord<dk> Ok but muh shared code
06:54:45FromDiscord<dk> There's going to be some
06:55:18*waleee-cl quit (Quit: Connection closed for inactivity)
06:57:23FromDiscord<dk> I guess shared code is a third project
06:57:28saemdk give me a few minutes, let me see if I can just back out the hard coded backend.
06:58:06FromDiscord<dk> 🤠
06:59:03*D_ quit (Quit: No Ping reply in 180 seconds.)
07:00:00*D_ joined #nim
07:12:37FromDiscord<Cohjellah> who was that dude that had a fork of the QML library
07:12:37FromDiscord<Cohjellah> also
07:12:43FromDiscord<Cohjellah> What's the difference between QML and QT?
07:12:44FromDiscord<ElegantBeef> mratsim?
07:12:46FromDiscord<Cohjellah> That one
07:12:56FromDiscord<ElegantBeef> QML is a markup language qt is the underlying library afaik
07:12:58FromDiscord<Cohjellah> QML is QT I get that, is it just some variant
07:12:58FromDiscord<Cohjellah> yeah
07:13:08FromDiscord<Cohjellah> Is QML just nicer to write gui's with?
07:14:03FromDiscord<ElegantBeef> It's non programmatic, it's all markup
07:15:53FromDiscord<Cohjellah> QT is pretty standard. Can use in so many languages now, probs decent to stay with such a filled GUI library
07:16:03FromDiscord<Cohjellah> HMM
07:18:05FromDiscord<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:28FromDiscord<Cohjellah> or can you install forks through Nimble
07:18:30FromDiscord<Cohjellah> that would be pretty nifty
07:18:41FromDiscord<dk> you can just use the github url
07:18:53FromDiscord<ElegantBeef> You can also use `nimble develop` for the main branch
07:19:38FromDiscord<Cohjellah> oh true
07:19:40FromDiscord<Cohjellah> DK big brain
07:19:49FromDiscord<Cohjellah> what does nimble develop do
07:25:43*leorize quit (Ping timeout: 240 seconds)
07:28:23FromDiscord<Cohjellah> Fk that I'll just go do websites
07:28:57FromDiscord<ElegantBeef> https://github.com/nim-lang/nimble#nimble-develop
07:29:49FromDiscord<Cohjellah> legit I keep looking at gui frameworks like 👀
07:29:59FromDiscord<Cohjellah> But, websites man, they're the present, the past and the future
07:37:10*leorize joined #nim
07:40:32FromDiscord<dk> Nobody will download qt just to launch your toy program tbh
07:41:35FromGitter<offbeat-stuff> How to convert RefPtr[Context] to var Context when RefPtr is a manager ptr in c++
07:41:45FromGitter<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:44saemOK, prepping the release
08:03:48*narimiran joined #nim
08:04:14*pigmej quit (Ping timeout: 245 seconds)
08:12:28saemdk are you using vscode or vscodium?
08:18:41saemdk 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:35FromGitter<offbeat-stuff> ...........................fatal.nim(49) sysFatal ⏎ Error: unhandled exception: types.nim(161, 9) `result != nil` [AssertionDefect]
08:26:40FromGitter<offbeat-stuff> Why
08:27:25FromGitter<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:43FromGitter<offbeat-stuff> https://play.nim-lang.org/#ix=2KAc
08:31:07FromDiscord<dk> @saem Not sure, I just use my package manager
08:31:19FromDiscord<dk> I'll try the new extension version now
08:32:09saemdk VS Code uses the MS Marketplace for extensions, the other ones use Open VSX.
08:33:58FromDiscord<dk> It seems to work fine, not hardcoded anymore
08:35:25saemdk 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:57FromDiscord<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:05FromDiscord<dk> that was a problem with the previous extension too
08:36:27saemDo you have build on save enabled?
08:36:41FromDiscord<dk> but since it's in src it doesn't replace anything
08:36:59FromDiscord<dk> nope
08:37:52FromDiscord<dk> it's `setCommand "js"` to be exact
08:38:14saemyeah... that's probably what's doing it.
08:38:17FromDiscord<dk> what I use to switch backends
08:38:29saem`--backend:js`
08:38:55saemThis is what the extension uses: https://github.com/saem/vscode-nim/blob/master/nim.cfg
08:39:24FromDiscord<dk> fixed it 🥴
08:39:37FromDiscord<dk> I didn't expect it to do anything different than setCommand
08:39:55saemYeah, setCommand you're changing the action it'll take. ;)
08:40:56saemI 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:22FromDiscord<dk> I think I did actually have linting working most of the time
08:44:57FromDiscord<dk> but that may explain why it used to have more problems working in my js-backend files than in normal ones...
08:45:16FromDiscord<dk> anyway, thanks
08:46:31saemNP, 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:08saemMaybe 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:51FromDiscord<dk> I have no idea what you're talking about with the projects
08:51:08FromDiscord<dk> I'll stick to a single .nimble since I can switch backends per file
08:58:27ForumUpdaterBotNew 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:55saemLoL. 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:05FromDiscord<dk> That would prevent nimsuggest from running on files not listed there?
09:06:42FromDiscord<dk> I tend to have few files anyway
09:07:24FromDiscord<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:21FromDiscord<flywind> https://news.ycombinator.com/item?id=25610996
09:39:13FromDiscord<flywind> front page of hacker news again
09:41:51FromDiscord<ElegantBeef> @j-james odd that you shared that but yay i guess for being fp D:
09:41:52FromDiscord<ElegantBeef> (edit) "D:" => "😄"
09:48:47FromDiscord<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:14FromDiscord<fwsgonzo> how do you convert a cstring with a known length to string?
11:30:31*not_lum quit (Quit: Lum: Bye!)
11:34:53mipri$thecstring
11:35:05FromDiscord<fwsgonzo> that probably involves a strlen, right?
11:35:10mipriyep.
11:35:24mipriif you want to avoid that, create a new string and copyMem into it.
11:38:15FromDiscord<fwsgonzo> how can I get the ptr of a function?
11:38:29FromDiscord<fwsgonzo> `unsafeAddr(remote_trampoline)` -> "expression has no address"
11:38:55FromDiscord<fwsgonzo> function is cdecl so I assume there's no problems
11:39:58*synthmeat quit (Quit: WeeChat 3.0)
11:41:57planetis[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:21FromDiscord<lqdev> @fwsgonzo procs are already pointers so you can just cast[pointer](yourProc)
12:14:13*tane joined #nim
12:15:25FromDiscord<fwsgonzo> seems to work now 🙂 I'm having an issue freezing a Json structure
12:15:53FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KBi
12:16:00FromDiscord<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:47planetis[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:38planetis[m]however this wont be enough since you are using a binary serializer'
12:55:25FromDiscord<enthus1ast> is the hot code reloading broken?
12:57:11FromDiscord<flywind> It has many bugs and doesn't works well
12:57:24FromDiscord<enthus1ast> hi @flywind btw
12:57:34FromDiscord<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:00FromDiscord<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:38FromDiscord<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:49FromDiscord<enthus1ast> what do you want to serialize @fwsgonzo ?
13:04:58FromDiscord<fwsgonzo> just objects in general, I'm passing them between machines
13:05:25planetis[m]yeah, he doesn't support that try https://github.com/planetis-m/eminim and https://github.com/treeform/jsony
13:06:24FromDiscord<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:46FromDiscord<enthus1ast> what i normally do is i create special "network objects"
13:06:59FromDiscord<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:01FromDiscord<enthus1ast> that are "plain old data objects"
13:07:12*tarsiec joined #nim
13:07:48*tarsiec quit (Client Quit)
13:07:59FromDiscord<enthus1ast> can you share code?
13:09:06FromDiscord<enthus1ast> (edit) "code?" => "code/error message?"
13:11:35FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KBu
13:12:00FromDiscord<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:04FromDiscord<enthus1ast> j.pretty()
13:12:06FromDiscord<enthus1ast> breaks it
13:12:11FromDiscord<fwsgonzo> no, this works just fine
13:12:17FromDiscord<fwsgonzo> im using strings for the API
13:12:53FromDiscord<fwsgonzo> but I would have liked a general solution to serializing objects 🙂
13:12:59FromDiscord<fwsgonzo> seems very 2021 for a programming language
13:13:34FromDiscord<fwsgonzo> this is very easy to understand though, so I
13:13:39FromDiscord<fwsgonzo> (edit) "I" => "I'll leave it as is for now"
13:15:00FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2KBv
13:15:11FromDiscord<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:42FromDiscord<lqdev> disruptek: are you sure that araq-ic6 actually… you know, contains the IC logic?
13:16:52FromDiscord<lqdev> 'cause for me if i change a single module it recompiles everything
13:16:55FromDiscord<lqdev> with --incremental:on ofc
13:17:25FromDiscord<enthus1ast> @fwsgonzo yes you are right, i can parse pretty json as well
13:17:49FromDiscord<fwsgonzo> looks nice, I'll have a look!
13:18:59FromDiscord<enthus1ast> what error message do you get? Because parsing the json works (for me 🙂 )
13:19:08FromDiscord<fwsgonzo> none, JSON works beautifully
13:19:15FromDiscord<enthus1ast> ah ok?
13:19:20FromDiscord<fwsgonzo> its just when i was trying to use frosty I couldnt get it to work
13:19:35FromDiscord<fwsgonzo> btw. is there a way to get Nim to assume ownership of a cstring?
13:20:28FromDiscord<enthus1ast> cannot comment on frosty never heared of it
13:24:38disruptekfwsgonzo: what was the problem?
13:24:39FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KBy
13:24:44disrupteklqdev: you need to use --incremental:on
13:24:56FromDiscord<lqdev> yeah, i am using it…
13:25:15disruptekcheck your nimcache for .rod files.
13:25:25FromDiscord<lqdev> they're here
13:26:00FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2KBz
13:27:32FromDiscord<juliuskiesian> how do you pass varargs to another proc that takes varargs?
13:27:55FromDiscord<juliuskiesian> and how do you pass a seq[T] to a proc that takes varargs?
13:28:22disrupteklqdev: 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:29FromDiscord<enthus1ast> @fwsgonzo "remote_trampoline" sounds like api hooking, what are you hacking?
13:28:37disruptekas i said, it's pretty lousy at the moment.
13:29:04disruptekenthus1ast: you have you read his blog to understand it; it's pretty neat.
13:29:12FromDiscord<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:36disrupteki warned you not to blame me, didn't i?
13:29:46FromDiscord<lqdev> yeah, i'm not blaming you.
13:29:54disrupteki know. 😉
13:29:57FromDiscord<lqdev> just sharing my thoughts.
13:30:18disrupteki'm trying not to shit on it too much, but i'm frustrated, too.
13:30:46disruptekpoint is, i /was/ able to get it to compile nim faster.
13:30:59disruptekbut it's a very convoluted process to even evoke a performance boost.
13:31:31FromDiscord<enthus1ast> @disruptek have a link?
13:31:40disruptekfwsgonzo: what was the problem with frosty, i mean?
13:32:04disruptekhttps://fwsgonzo.medium.com/
13:32:13FromDiscord<enthus1ast> ty
13:32:23disrupteklook 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:01FromDiscord<lqdev> disruptek: does frosty output endian-independent binary data?
13:37:14disruptekno.
13:38:09disruptekif you want your data in a specific form, put it in that form before you serialize it.
13:38:23disruptekit's just a serializer/deserializer.
13:39:39FromDiscord<enthus1ast> i read it but i guess i do not understand it 😄
13:39:56FromDiscord<enthus1ast> but have also never touched varnish before so yeah
13:40:47FromDiscord<enthus1ast> the basic idea is to have a virtual machine that runs code inside a cache?
13:41:11disruptekyep.
13:46:00FromDiscord<enthus1ast> sounds like jit to me
13:49:18disruptekthe 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:03disruptekit's pretty hacky but technically awesome.
13:50:31FromDiscord<enthus1ast> i'm not sure what the problem is he's trying to solve
13:50:55disruptekhe wants to run arbitrary logic on each request received by the cache.
13:51:10FromDiscord<enthus1ast> where does the logic come from?
13:51:42disruptekif 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:53planetis[m]varchars turned out to be slower from strings in a number of benchmarks
13:52:00planetis[m]string it is then
13:52:19disruptekstrings have custom code in the compiler that make them the best choice for strings.
13:52:22disruptekweird, i know.
13:53:09planetis[m]what custom code? I optimized comparisons and copies as much as strings
13:53:54disrupteklook at how alloc works.
13:54:24disruptekwhere are your benchmarks?
13:55:26Oddmongeris there a function for buffering a file without opening/closing it explicitely ? (like readFile does)
13:55:49planetis[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:53disruptekhow would that work?
13:57:47disruptekplanetis[m]: why didn't you just make a `varchar[N: static int] = distinct string`?
13:58:31planetis[m]as requested https://github.com/planetis-m/varchars/blob/master/tests/str_vs_varchar.nim
13:59:09disruptek!repo criterion
13:59:10disbothttps://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 38⭐ 3🍴 7& 1 more...
13:59:18disruptek!repo disruptek/criterion
13:59:18disbothttps://github.com/disruptek/criterion -- 9criterion: 11statistics-driven micro-benchmarking framework 15 14⭐ 0🍴
14:02:04planetis[m]because i would have to rewrite varints
14:02:09*lritter joined #nim
14:02:33disruptekare varints anything like varmints?
14:03:33planetis[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:28disruptekyou've provoked two updates to my style document.
14:04:31disruptekcongrats!
14:05:32planetis[m]ok what are those?
14:06:50disruptekinclude requirements for your tests, always.
14:07:45disruptekdon'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:48disruptekgah.
14:08:25planetis[m]i didnt it was in description
14:08:30disruptekand, yes, i know you aren't guilty of this.
14:08:53planetis[m]what do you mean include requirements?
14:10:14FromDiscord<Clyybber> heh, look at those CIs https://github.com/apple/swift :p
14:10:16planetis[m]snif what will happen to me?
14:10:28disruptekyou will die.
14:10:46disruptekwhy export cmpVarChars and not simply cmp?
14:10:55disruptekwhy export eqVarChars at all?
14:11:01*waleee-cl joined #nim
14:11:30disruptekwhy export toString and not merely $?
14:12:56*lritter quit (Quit: Leaving)
14:16:43disruptekand there's no point to impl <=, right?
14:18:54*lritter joined #nim
14:20:47FromDiscord<flywind> Is `inline iterator ` proc type?
14:21:07FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2KBQ
14:21:10FromDiscord<flywind> Should this compile?
14:22:10disruptekplanetis[m]: what does using varints buy you?
14:22:44disruptekflywind: no.
14:23:18FromDiscord<flywind> I see
14:23:47FromDiscord<flywind> !eval iterator hello(): int = yield 12; echo hello is proc; echo hello is "iterator"
14:23:49NimBot<no output>
14:23:49planetis[m]nothing apparently
14:24:25disruptekplanetis[m]: but what did you think it would buy you?
14:24:58disruptekthis is closer to making sense than i expected. 😉
14:25:09FromDiscord<Clyybber> @flywind Its a bug that it compiles afaik
14:25:24FromDiscord<flywind> which one?
14:25:40FromDiscord<flywind> That's not a bug, it is a useful feature.
14:25:49disruptekone man's trash.
14:26:03FromDiscord<flywind> I need that feature.
14:26:15disruptekwhy?
14:26:20FromDiscord<flywind> see https://github.com/nim-lang/Nim/pull/16552
14:26:21disbotfix a bug since 2012 hash(closure iterator) doesn't work
14:26:23FromDiscord<Clyybber> @flywind I mean an iterator being a proc
14:27:09FromDiscord<Clyybber> I don't see why you would need it
14:28:04FromDiscord<flywind> My first example doesn't compile.
14:28:25FromDiscord<Clyybber> Yeah, it shuoldn't
14:29:26FromDiscord<Clyybber> It shouldn't instantiate successfully even
14:29:32FromDiscord<flywind> I need it not to compile too.
14:29:49disruptekam i high right now?
14:29:50FromDiscord<Clyybber> but it does because of https://github.com/nim-lang/Nim/issues/16548
14:29:56disbot`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:04FromDiscord<Clyybber> @flywind haha, I thought you wanted it to compile
14:30:36FromDiscord<flywind> yeah
14:30:41FromDiscord<Clyybber> wait..
14:30:47FromDiscord<Clyybber> I'm with disruptek now lol
14:30:51disruptekhe wants hash to work and his solution is to change the sigmatch.
14:32:04planetis[m]i dunno, i read about how database varchars work and tried to replicate it (but its still not compatible)\
14:32:29FromDiscord<flywind> that's where it needs to be changed.
14:32:59disruptekplanetis[m]: database varchars use varints?
14:33:00FromDiscord<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:04FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2KBT
14:33:06FromDiscord<Clyybber> inline iterators are not procs
14:33:49FromDiscord<flywind> that's two question
14:34:07FromDiscord<flywind> (edit) "that's" => "they are" | "question" => "issues, not very related"
14:34:29Zevv
14:34:31FromDiscord<Clyybber> So you want closure iterators to keep counting as proc ?
14:35:04FromDiscord<flywind> Isn't it?
14:35:17FromDiscord<Clyybber> Right now it is, but it might change in the future
14:35:20FromDiscord<flywind> No, I just fix the bug
14:35:24FromDiscord<Clyybber> But if it does we can just change the hash module
14:35:52FromDiscord<Clyybber> @flywind Which bug do you fix? That `when T is "closure"` doesn't work for closure iterators?
14:36:09FromDiscord<flywind> yes
14:36:15FromDiscord<Clyybber> ok, seems fine
14:36:33FromDiscord<Clyybber> but we should wait for araq to review it
14:36:55FromDiscord<flywind> After this PR, It could be used to fix two issues.
14:37:09disruptekeh i don't want iterator to sigmatch proc.
14:37:21FromDiscord<Clyybber> disruptek: Yeah, but flywind didn't change that
14:37:27FromDiscord<Clyybber> disruptek: Its a thing since 2012
14:37:36FromDiscord<Clyybber> https://github.com/nim-lang/Nim/blob/662c5080755eb5a42df2c3acb84c044876571a46/tests/iter/titer8.nim#L80
14:37:56disruptekgah.
14:38:11FromDiscord<Clyybber> @flywind You should edit your PR's description to make it more clear that you are fixing `is "closure"`
14:38:32FromDiscord<flywind> ok
14:38:42federico3https://hotwire.dev/#screencast I wonder if this stuff could make sense in Nim
14:42:11Oddmongerwith 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:43Oddmongeri should say, how allocate pointed buffer ?
14:42:53FromDiscord<Clyybber> @flywind Why did you change hash to hashWangYi1 ?
14:42:55disruptekany way you want.
14:43:17Oddmongeris there a malloc i have missed ?
14:43:23disruptekalloc()
14:43:37FromDiscord<flywind> reduce necessary call
14:43:50FromDiscord<flywind> The types are always Hash
14:44:02*filcuc joined #nim
14:44:06FromDiscord<Clyybber> but it ignores nimIntHash1
14:44:38FromDiscord<Clyybber> ah, its fine
14:44:40Oddmongeryes i had missed it, thank you disruptek
14:45:33FromDiscord<Clyybber> (edit) "fine" => "fine, nevermind"
14:47:10FromDiscord<jken> disuptek, you should livestream, I'd watch./
14:47:12FromDiscord<jken> (edit) "watch./" => "watch."
14:48:10FromDiscord<Clyybber> @flywind In your second PR please make the tests check that compiletime == runtime
14:48:37FromDiscord<flywind> Ok, will do it later
14:48:43FromDiscord<Rika> disruptek used to livestream i believe
14:50:08FromDiscord<flywind> ah, I link the wrong issue...
14:51:33FromDiscord<Clyybber> yep
14:51:53FromDiscord<flywind> I think I already make the tests check compiletime == runtime
14:52:13FromDiscord<Clyybber> There is a small part that checks hashWangY1 and hashIdentity
14:52:37FromDiscord<Clyybber> But not for the other hashes afaict
14:52:47FromDiscord<flywind> ?
14:53:03*sk_ joined #nim
14:53:10FromDiscord<Clyybber> murmurHash
14:54:25FromDiscord<flywind> `main` is already put both in `static` and global scope.
14:54:31FromDiscord<flywind> (edit) "`main`" => "`main()`"
14:55:01FromDiscord<Clyybber> yes, but it does not check wether its results are consistent between compile and runtime
14:55:17FromDiscord<flywind> doAssert hash(cstring"abracadabra") == 97309975↵ doAssert hash(cstring"abracadabra") == hash("abracadabra")
14:55:45Zevvwhats with the mallocs
14:56:47FromDiscord<Clyybber> @flywind Ah, right.
14:57:35FromDiscord<Clyybber> although I think cstring is the one type where we shouldn't do that :p
14:57:56FromDiscord<Clyybber> all this "make cstring behave the same in VM as in backend" stuff is not a good idea IMO
14:58:13FromDiscord<Clyybber> cstring means backend-defined-string
14:58:20FromDiscord<Clyybber> so its by definition not backend agnostic
14:58:59FromDiscord<flywind> though I still hope the default value of `cstring` is `nil` not `""`.
14:59:10*abm joined #nim
14:59:25FromDiscord<flywind> in VM
14:59:32FromDiscord<Clyybber> why?
14:59:55FromDiscord<flywind> Then I can reduce some bytes in `options.nim`.
15:00:18sk_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:24FromDiscord<Clyybber> @flywind I see. I don't think its a good idea though. cstring might not be a pointer on some backends
15:02:44FromDiscord<Clyybber> But maybe if we clarify the spec around cstring its fine
15:03:14FromDiscord<flywind> JS has null as default value, it works, C/C++ works too.
15:03:31ForumUpdaterBotNew question by Alex Craft: Why the template can&#39;t see imported functions in Nim?, see https://stackoverflow.com/questions/65540529/why-the-template-cant-see-imported-functions-in-nim
15:04:18FromDiscord<Rika> oh man my type names are getting pretty damn long
15:04:21narimirandid he just write `to_loVer` and complains that the template doesn't see `to_loWer`?
15:04:29FromDiscord<Rika> yes he did
15:05:02FromDiscord<lqdev> yes
15:05:24FromDiscord<Clyybber> @flywind Yeah, we should put it in the spec then that cstring is backend specific but guarantees having a `nil` state
15:05:50FromDiscord<flywind> I agree
15:05:58disrupteki'm hoping to resume streaming in february if i don't have a job by then.
15:06:31Zevvso whats magic about februari
15:06:36Zevvthen you give up finding a job?
15:06:51FromDiscord<jken> Jobs are so 2019.
15:07:07FromDiscord<lqdev> oh shuddup, 2019 was a good year
15:07:18ZevvDisruptekt is employed for one hour/month now
15:07:29FromDiscord<shadow.> jobs are so laughs in high schooler
15:07:36disruptekstarlink projected to expand beta to my area later this month, so figure another month waiting for the hardware.
15:08:25FromDiscord<fwsgonzo> you can probably live in a sailboat with starlink
15:08:29Zevvwhat does that look like, hardware-like
15:08:43disruptekjust a frisbee antenna.
15:08:58disruptekgonzo: what's wrong with frosty?
15:09:27FromDiscord<fwsgonzo> ill resume trying it later, but hopefully nothing - might have been ABI stuff
15:10:14disrupteki 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:55FromDiscord<Rika> @shadow. have fun in a few years
15:11:32disruptekyou too can fund disruptek.
15:12:04FromDiscord<shadow.> i have done decently with programming lol
15:12:14Zevvyes, you *too* can fund disruptek!
15:12:15FromDiscord<shadow.> hoping i can find a startup or somethin to hop on for passive income
15:12:18FromDiscord<shadow.> thats the dream
15:12:19disruptekif you're not with me, you're against me.
15:12:24FromDiscord<fwsgonzo> im getting a null-pointer when im returning a cstring from a string? what gives
15:12:40Zevvhttps://github.com/sponsors/disruptek
15:12:56disruptek~disruptek
15:12:57disbotdisruptek: 11unsafe at any speed. -- disruptek
15:12:57disbotdisruptek: 11:disruptek:
15:12:57disbotdisruptek: 11an unsafe nil deref
15:13:11disruptek~disruptek is broke: https://github.com/sponsors/disruptek
15:13:11disbotdisruptek: 11broke: https://github.com/sponsors/disruptek
15:13:11disbotdisruptek: 11:disruptek:
15:13:11disbotdisruptek: 11an unsafe nil deref
15:13:14FromDiscord<Rika> i'm having fun here in a country where basically no one understands english 😄
15:13:26FromDiscord<Rika> not the smartest decision ive made
15:13:48disruptekyou're in the phillipines?
15:14:13*sk_ quit (Quit: Leaving)
15:14:13Zevvfwsgonzo: show the code
15:14:15FromDiscord<Clyybber> japan I think?
15:14:52disruptekzevv: did you read his blog?
15:14:59Zevvwhose
15:15:02disruptekgonzo
15:15:07Zevvno
15:15:11Zevvshould I or should I not
15:15:13disrupteklol worth it.
15:15:21FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KCk
15:15:27disruptekhttps://fwsgonzo.medium.com/
15:15:28disruptekaugust
15:17:26Zevvi don't see it
15:27:28Oddmongeris it possible to use echo on a allocated buffer ?
15:27:47Oddmongerlike echo (mybuffer[1]) for displaying first char
15:27:59Oddmonger(well, second char)
15:29:03Zevvyou probably want some casting so num knows how to dump that for you
15:29:39Oddmongerso maybe it would be faster for me to use an array…
15:31:19Zevvhttps://fwsgonzo.medium.com/
15:31:21Zevvno
15:31:24Zevvecho cast[ptr UncheckedArray[uint8]](buffer)[][1]
15:31:25Zevvwhat one
15:32:16Oddmongerouch
15:32:18Zevvwhy?
15:32:52Oddmongeri wanted to use a buffer for avoiding an array
15:33:24Zevvwell move to C if you like these kind of things
15:33:26FromDiscord<fwsgonzo> its arrays all the way down
15:33:35ZevvNim allows it, but makes it easy to do the /right/ thing
15:33:44Zevvand casting stuff about is usually not
15:34:01Zevvbecause `cast[]` basically means `I'm lying to you`
15:34:16Zevvand "trust me, I know what I'm doing"
15:34:36Oddmongeryes i know when cast appears, problems arise
15:35:03Oddmongerexcept is some low level cases where you have no choice
15:35:08Oddmongeror stream reading
15:37:57Oddmongeris there a difference between readChars and readBytes ? On systems where char can be != 8 bits maybe ?
15:38:37*Arrrrrrrr joined #nim
15:38:56Oddmongersadly, there is not readInt
15:39:15Oddmongeror maybe the exercise is left to the reader with a nim trick
15:39:48FromDiscord<shadow.> there is definitely some form of readInt
15:39:51FromDiscord<shadow.> might be in the streams module tho
15:41:02Oddmongeryes indeed, it's in the index
15:41:07FromDiscord<shadow.> disruptek: your internet is 128 a month? haven't you talked about how it can't even load github?
15:47:21disruptekyep.
15:47:51Zevvfun, right
15:47:54disruptekthere's a local monopoly that thinks 10-20% packet-loss isn't as important as price-gouging customers.
15:48:02planetis[m]you just do readdata with sizeof(int64) and cast the result to int64
15:48:51disruptekwhat's crazy is that i used to be a network engineer for an ISP in this state.
15:49:09disruptekyou'd think i'd know what to do.
15:49:16FromDiscord<Rika> ayy my lib works kinda time to upload it now
15:49:28disruptekship it.
15:49:53planetis[m]anyone wants to have the honor to port https://github.com/roig/destral_ecs to Nim
15:50:13disruptek~fwsgonzo is https://fwsgonzo.medium.com/virtual-machines-for-multi-tenancy-in-varnish-1c619ea3276
15:50:14disbotfwsgonzo: 11https://fwsgonzo.medium.com/virtual-machines-for-multi-tenancy-in-varnish-1c619ea3276
15:51:11disruptekhonestly, the internet has improved here somewhat. i think they are worried about starlink competition, as they should be.
15:52:06disruptekbut 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:49disruptekplanetis[m]: do you want help on varchars?
15:53:16FromDiscord<enthus1ast> what is the benefit of usesing destral_etc over Entt?
15:53:34FromDiscord<enthus1ast> (edit) "usesing" => "using"
15:54:01FromDiscord<enthus1ast> entt is pretty good
15:54:11FromDiscord<Clyybber> disruptek: Why can't you simply use getType on i?
15:54:16FromDiscord<Clyybber> I tried it and it works
15:54:37disrupteki told you i probably could.
15:54:44disruptekalso, the compiler should give me valid nim.
15:54:56FromDiscord<Clyybber> no it shouldn't have to
15:55:02FromDiscord<Clyybber> its after transformation after all
15:55:07FromDiscord<Clyybber> this code is intended for the backend
15:55:14disruptekit was typed when i gave it to the compiler.
15:55:24FromDiscord<Clyybber> so? RTFM
15:55:25FromDiscord<Clyybber> :p
15:55:32disruptekyou RTFM. this is macro code.
15:55:45FromDiscord<Clyybber> https://nim-lang.github.io/Nim/macros#getImplTransformed%2CNimNode
15:55:54disruptekyes, i know.
15:56:34disruptekit's not correct ast. c'mon, man.
15:56:55Zevvyeaaah but its for deubugging and inspection, not for disruptek
15:57:00FromDiscord<Clyybber> It is correct for what its supposed to be
15:57:08FromDiscord<Clyybber> I understand wanting it to be nicer
15:57:21disruptekdo the pass in the compiler, please. what the hell.
15:57:24Zevvright. *but* if we can make it more correct, that would be cool & helpful
15:57:27FromDiscord<Clyybber> but I'm thinking now that we got rodfiles including the type node in the AST might bloat it
15:57:36disrupteklol
15:57:48disruptekthe rodfiles are bloated because they aren't compressed.
15:58:13FromDiscord<Clyybber> disruptek: ? getImplTransformed isn't implemented in macros.nim
15:58:19FromDiscord<Clyybber> it is the pass
15:58:30disruptekit's a macros api that returns faulty ast.
15:58:34disruptekare you serious right now?
15:58:38FromDiscord<Clyybber> lol its not
15:58:43FromDiscord<Clyybber> yes I am
15:58:47disruptekam i wrong?
15:58:52FromDiscord<Clyybber> I'm not sure if I should fix it because it makes the AST bigger
15:59:07FromDiscord<Clyybber> disruptek: Yeah, because it doesn't specifiy that it returns correct AST
15:59:22FromDiscord<Clyybber> AST is different once its been through the transf stage
15:59:31Zevvdoes strutils.reverse specify it returns a correct reversed string?
15:59:36disruptekdo we need to specify that ast is correct?
15:59:55FromDiscord<Clyybber> Zevv: No, but it doesn't specify: " note that code transformations are implementation dependent and subject to change"
16:00:04disruptekso what?
16:00:07*sk_ joined #nim
16:00:10disrupteki don't care if you /change/ the ast.
16:00:13disruptekjust make it correct.
16:00:15Zevvhehe
16:00:25disruptekseriously. idgaf.
16:00:48disruptekname another proc exported in macros that returns bogus data.
16:00:55disruptekthis is literally bad data that we're talking about.
16:01:17disruptekit's bananas. it fits right, but it's not correct.
16:02:09*Vladar joined #nim
16:02:22FromDiscord<Clyybber> there is no correct. It says on the tin that its implementation defined and used for debugging/peeping
16:02:39disruptekthen just give me a string.
16:02:53disruptekif the data is meaningless, don't let people try to use it.
16:02:59FromDiscord<Clyybber> its not meaningless
16:03:02FromDiscord<Clyybber> its special
16:03:10disruptekthis is ridiculous.
16:03:45FromDiscord<Clyybber> I'm not opposed to making it valid typed AST
16:04:04disruptekyou decide. i am done arguing about it.
16:04:04FromDiscord<Clyybber> but theres probably more to it than just fixing this one part
16:04:30planetis[m]disruptek: what's left to do?
16:04:34sk_https://i.ibb.co/mvc4svV/Screenshot-from-2021-01-02-22-00-31.png what this error means. copyFile proc
16:04:41disrupteki'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:51disruptekthat's irresponsible of me to attempt on someone else's code.
16:05:08disruptekplanetis[m]: on varchars?
16:05:56planetis[m]ya
16:06:01*opal joined #nim
16:06:55disruptekis the point to have a bounded string that's useful on the stack?
16:07:02disruptekor.. something?
16:07:09FromDiscord<Clyybber> disruptek: transformed doesn't only mean iterators inlined, it also does closure transforms, unpacking tuple assignments and so on
16:07:16FromDiscord<Clyybber> and it sometimes also introduces temporaries
16:07:21FromDiscord<Clyybber> which don't have a declaration at all
16:07:37disruptekreturn a string.
16:08:07disrupteki will transform the for/defer myself.
16:08:17FromDiscord<Clyybber> and what do you want a string for?
16:08:49disrupteki don't want it. i want people to not try to depend upon an api that produces misleading data.
16:09:16planetis[m]could be, but it was supposed to be used in seqs primarily
16:09:20FromDiscord<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:24disruptekdame difference.
16:09:33disruptekclyybber: noted. return a string.
16:09:48FromDiscord<Clyybber> you want rendered AST?
16:09:54disruptekplanetis[m]: can we remove varints and add a converter to string?
16:10:05disruptekclyybber: i think that makes sense. that, or treeRepr.
16:10:11planetis[m]anyway if you want that try to start from spills/varchar i linked you the other day
16:10:44FromDiscord<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:45disruptekspills/varchar?
16:10:56disruptekclyybber: it never did.
16:11:07disruptekit's wrong to ascribe any value to it, as you pointed out.
16:11:07FromDiscord<Clyybber> getType
16:11:32disruptekagain, to rely upon this api would be irresponsible.
16:11:56*sk_ quit (Quit: Leaving)
16:12:04FromDiscord<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:42disruptekanything you expose will be misused.
16:12:48FromGitter<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:18FromDiscord<Clyybber> deech: No it will copy. It will prevent you from doing so if you declare `=` as `{.error.}`
16:13:52Oddmongeris it possible to convert to string a range of a seq ? (s.join converts all)
16:14:08FromDiscord<Clyybber> disruptek: Can't you just do getType FOR NOW
16:14:23disruptekwhy?
16:14:29FromGitter<deech> Clyybber, how do I do that?
16:14:44Oddmongerof course, i could use a loop on my seq with start,end index
16:14:55FromDiscord<Clyybber> deech: proc `=`(x: var MyType, y: MyType) {.error.}
16:15:06Oddmongerbut maybe it's already done in the standard lib
16:15:11disruptekoddmonger: use join(s[40..50], ".")
16:15:12FromDiscord<Clyybber> disruptek: Because we don't have consensus on how this should look yet
16:15:18disrupteki will wait.
16:15:30Oddmongeroh so easy! thank you
16:15:37FromGitter<deech> Oh wait, `cstring`s specifically copy on assignment?
16:15:38FromDiscord<Clyybber> why'd you want to wait? don't we want cps to get going?
16:15:56Oddmonger(i do have check manual, and it wasn't in it ;) )
16:16:18disrupteki don't want to have to support `for` loops with code i can't trust, let alone justify.
16:16:48disruptekpeople should simply accept that they can't use a for loop yet. big fucking deal.
16:16:49FromDiscord<treeform> @disruptek , it makes me said when code is slow... https://gist.github.com/treeform/0ec5d9026167c73a1791bb8ffa94682f
16:16:50FromDiscord<Clyybber> deech: I don't remember if they copy or if they have ref semantics, but they don't have a `=`{.error.}
16:17:13disruptektreeform: where is the benchmark?
16:17:30disrupteki told you that i'd compete with you once you reach feature parity; not before.
16:17:40FromDiscord<treeform> https://github.com/treeform/flatty/blob/master/tests/benchmark_tree.nim
16:17:57FromDiscord<treeform> What features do you need?
16:18:07disruptekall the ones you lack.
16:18:08FromDiscord<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:25disruptekclyybber: whatever it does should be fine for cps.
16:18:32FromDiscord<treeform> I have a feature you lack 🙂
16:18:41disruptektreeform: serialize pointers, intsets, etc.
16:19:14FromDiscord<treeform> why would you want to serialize a pointer?
16:19:23disrupteks/pointers/refs/
16:19:32FromDiscord<treeform> oh I support refs...
16:19:56FromDiscord<treeform> the benchmark uses a ref object
16:19:57disruptekmy flatty benchmark shows the bits i had to cut out.
16:20:11FromDiscord<treeform> link
16:20:18disruptek!repo frosty
16:20:18disbothttps://github.com/disruptek/frosty -- 9frosty: 11serialize native Nim types to strings, streams, or sockets ⛄ 15 23⭐ 1🍴
16:20:27FromDiscord<treeform> to the bench makr?
16:20:44FromDiscord<Rika> one shitty library fresh outta the oven https://github.com/de-odex/shama/
16:20:49FromDiscord<treeform> this https://github.com/disruptek/frosty/blob/master/tests/bench.nim ?
16:20:58disruptekyes.
16:21:04FromGitter<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:28disruptekmaybe it's case objs you don't do, yet?
16:21:42FromDiscord<treeform> I am waiting for nim to add case objects in generics
16:21:49FromDiscord<treeform> you can only use case objects in macros
16:21:58*nyaa8 quit (Quit: byeee~)
16:22:02*disruptek shrugs.
16:22:04FromDiscord<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:27FromDiscord<treeform> before 1.0 they had ability to set the case object key field...
16:22:33FromDiscord<treeform> they removed that ability I don't know why
16:22:44disruptekwhat do you mean?
16:22:45FromDiscord<treeform> they should have kept it under some sort of usafe flag
16:22:59disruptekyou mean discriminator transitions?
16:23:04FromDiscord<treeform> yes
16:23:08FromDiscord<Clyybber> deech: https://play.nim-lang.org/#ix=2KCI
16:23:14disruptekin theory you still can; in practice... it's complicated.
16:23:36Zevvyeah, much better: https://github.com/zevv/testes/commit/316139df9dd2545cc1b91d5b193ffcca4cea5858
16:23:48disrupteklol
16:23:53FromDiscord<Filipe Duarte> How to understand the usage of {.word.} curly brackets after procedures args? For example: {.inline.}
16:23:59disruptekzevv: pr it
16:24:25FromDiscord<Filipe Duarte> What is the document to study?
16:24:28disrupteki find it nice to scroll through my CI and see color.
16:24:33FromDiscord<Filipe Duarte> (edit) "study?" => "study this?"
16:24:46disruptekfilipe: "pragma"
16:24:46Zevvcolor is ok
16:24:52Zevvbut then use normal ascii + ansi colors
16:24:58Zevvnot colored unicode blurps
16:25:06disruptekzevv: make it a flag and we'll both be happy.
16:25:11Zevvtadaa
16:25:16FromDiscord<treeform> @disruptek `frosty\tests\bench.nim(14, 10) Error: define danger for benchmarks` why?
16:25:26FromGitter<deech> Clyybber: thanks!
16:25:55disruptekbecause otherwise you're measuring runtime cost of assertions.
16:26:00Zevvdisruptek: also, consider making it eat `suite "foo":`, that'll make it drop in from the unittests
16:26:11FromDiscord<Clyybber> Araq: ping
16:26:19disruptekZevv: scramper was adding that but, i dunno, he gave up or something.
16:26:26Zevvit was probably hard
16:26:33disruptekyou think?
16:26:42ZevvI stopped that years ago
16:26:56disruptektemplate suite(x: string; body: untyped) = testes: body
16:27:14disruptekit's harder than it looks, i guess?
16:27:23ZevvI was just typing exactly that
16:29:32FromDiscord<Filipe Duarte> thanks!
16:29:44disruptekzevv: export it.
16:29:49Zevvpfff
16:30:07Zevvso lazy.
16:30:15FromDiscord<Rika> lmao nimble failed publishing
16:30:16FromDiscord<Clyybber> disruptek: you can use effecttraits.nim to query {.tags.} btw
16:30:31disruptekclyybber: yeah, i couldn't remember how to do it.
16:31:02FromDiscord<Clyybber> getTagsList
16:31:16disruptekwdyt about automagically determining blocking calls using effects?
16:32:26disruptekwe can determine which types and calls are tainted and generate cps primitives for them.
16:32:36disruptekthis would probably be a separate library.
16:32:41FromDiscord<Clyybber> hmm
16:32:56FromDiscord<Clyybber> interesting idea, but the blocking stuff is already declared, so we can't attach tags to it
16:33:02Zevvdisruptek: hmm you need a lot of info in these effects
16:33:07ZevvI think it doesn't pay off
16:33:11Zevvyou need only a handful of things
16:33:13disruptekwe don't need to add effects to existing stuff.
16:33:25disruptekthe pay-off is that there's no color.
16:33:27FromDiscord<Clyybber> and a proc can also be "kind of blocking"
16:33:42FromDiscord<Clyybber> disruptek: Please clarify
16:33:43Zevvdisruptek: I'm not not liking it
16:33:55disruptekZevv: don't import it. 😁
16:34:29FromDiscord<Clyybber> all communcation channels are dead :/
16:34:45disruptekwhat does "kind of blocking" mean?
16:34:50FromDiscord<Clyybber> except for github I guess
16:34:51disrupteki'm talking about sniffing types and calls.
16:35:15FromDiscord<Clyybber> disruptek: It could block for the first half, but then decide to do the rest non-blocking
16:35:41Zevvdisruptek: as usual: one thing at a time
16:35:55FromDiscord<Clyybber> proc openTwoWindows() : opens the first window blocking, returns and opens the second window without blocking
16:36:18disruptekyes, but the first call will tag the proc as blocking.
16:36:34FromDiscord<Clyybber> yes, but its not an all or nothing thing
16:36:43disruptekit doesn't matter, does it?
16:37:05FromDiscord<treeform> I ported your test to my system:
16:37:06FromDiscord<treeform> https://gist.github.com/treeform/b21db06a96646c84b0d5d85bc65ac06e
16:37:07disruptekif any clause of an if statement has a cps call in it, i need to split the entire statement.
16:37:22FromDiscord<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:37disruptekwhat are you saying? you're hiding the fact that it blocks?
16:38:48FromDiscord<treeform> here its with danger: https://gist.github.com/treeform/81e966bf70b50e68b0f2dacf88ca9f92
16:39:14disruptektreeform: how do you explain the difference?
16:39:45FromDiscord<treeform> you use StringStream?
16:40:02FromDiscord<treeform> I support tIntset
16:40:05disruptekrun the test against a stream, then.
16:40:24FromDiscord<treeform> but frosty crashing reading it
16:40:35FromDiscord<Clyybber> disruptek: I don't understand
16:40:49FromDiscord<treeform> sorry the bug was on my end
16:41:09FromDiscord<treeform> I seem to support Intset
16:41:13FromDiscord<treeform> but I have never used it
16:41:20FromDiscord<treeform> you said I don't
16:41:26disruptekneat, let me check again.
16:41:39FromDiscord<treeform> I don't support case objects
16:41:46FromDiscord<treeform> and json is one
16:41:54disruptek0.1.4 is the version i should use?
16:42:02FromDiscord<Clyybber> disruptek, Zevv: Supporting inline iterators would probably be easier when inline iterators would be implemented as templates
16:43:01FromDiscord<Clyybber> or macros
16:44:11FromDiscord<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:15disruptektreeform: flatty 0.1.4 works on intsets 🎉
16:44:24FromDiscord<treeform> great!
16:44:34FromDiscord<treeform> @disruptek `thaw[type(what)](what.freeze())` works
16:44:47FromDiscord<treeform> but `what.freeze().thaw[type(what)]()` does not
16:44:56FromDiscord<treeform> `frosty.nim(419, 12) Error: cannot instantiate: 'T'`
16:45:28disruptekfor, what, any type?
16:45:33FromDiscord<treeform> string
16:45:34FromDiscord<Rika> isnt it `.thaw[:type(what)]()`?
16:46:13disruptekthat's surprising.
16:46:44FromDiscord<Rika> @rinfz make it `proc (draft: T {.inject.}) =` instead (i think, might have gotten the order wrong)
16:48:41FromDiscord<rinfz> holy hell, i didnt expect it to be that easy
16:50:10FromDiscord<Rika> its easy because you're still at the simple issues
16:50:27FromDiscord<rinfz> lets hope i stay there 🙂
16:51:24*Cadey quit (Quit: WeeChat 2.9)
16:51:26disruptektreeform: can confirm. that's nuts.
16:52:02*Xe joined #nim
16:52:04disruptekmust be a recent change.
16:52:19FromDiscord<treeform> I think I run into an issue like that before
16:52:30FromDiscord<treeform> that is why I started to use foo(X) vs foo[X]()
16:52:32FromDiscord<Clyybber> @timotheecour Did you see https://github.com/nim-lang/Nim/issues/16526 ?
16:52:33*filcuc quit (Ping timeout: 256 seconds)
16:52:39disbotconfig 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:59FromDiscord<fwsgonzo> im having trouble testing a cstring for NULL
17:35:33FromDiscord<fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KD5
17:45:33FromDiscord<exelotl> Zevv: hey I got nimcoro running on the gba! :D
17:46:54FromDiscord<Clyybber> @exelotl Btw, whats your issue with arc again?
17:47:27FromDiscord<Avatarfighter> @exelotl oh wow that's crazy
17:47:45FromDiscord<exelotl> (well a trimmed down version of it that doesn't use ref types)
17:49:19FromDiscord<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:44FromDiscord<exelotl> I guess it's assuming a 64 bit system?
17:50:18FromDiscord<Clyybber> hmm, seems like it, can you static: echo sizeof(int) ?
17:51:33FromDiscord<exelotl> hmm it does echo 4
17:51:59FromDiscord<exelotl> same for sizeof(pointer)
17:52:55FromDiscord<exelotl> so I guess that's not exactly it...
17:54:08FromDiscord<exelotl> OH
17:54:11qwrC int is 4 on most 64-bit platforms, but pointers are 64 bit
17:54:38Zevvexolotl: what my funny nimcoro?
17:54:54FromDiscord<exelotl> it's an issue with my config.nims - I'm still doing `put "arm.standalone.gcc.exe", "arm-none-eabi-gcc"`
17:55:29FromDiscord<exelotl> so it's using the wrong GCC as soon as I switch to --os:any
17:57:01FromDiscord<exelotl> sweet! https://media.discordapp.net/attachments/371759389889003532/794987626570186752/Screenshot_from_2021-01-02_17-56-37.png
17:57:25FromDiscord<Avatarfighter> oh wow!
17:57:29FromDiscord<Avatarfighter> that's really cool!!
17:59:30*xet7 joined #nim
17:59:30FromDiscord<Clyybber> @exelotl yay \o/
18:00:10FromDiscord<rinfz> sent a code paste, see https://play.nim-lang.org/#ix=2KDa
18:00:17FromDiscord<Clyybber> yes
18:00:21FromDiscord<exelotl> yup
18:00:34FromDiscord<Rika> it is?
18:01:20FromDiscord<rinfz> is there a workaround for ref types?
18:02:07FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2KDc
18:02:57FromDiscord<exelotl> basically need to allocate a T object before you can do anything with it
18:03:50FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2KDf
18:04:21FromDiscord<rinfz> ah, im dumb 😄
18:04:29FromDiscord<rinfz> thanks
18:04:33FromDiscord<exelotl> np :)
18:05:20FromDiscord<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:32FromDiscord<exelotl> but was starting to run into bugs and limitations
18:05:42FromDiscord<exelotl> then I discovered someone implemented ucontext for GBA
18:06:09FromDiscord<exelotl> so I was able to adapt your nimcoro instead
18:06:15FromDiscord<exelotl> it works extremely well!
18:06:24FromDiscord<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:38FromDiscord<treeform> I don't like case objects...
18:06:54disruptekwhy not?
18:07:12FromDiscord<treeform> They are harder to deal with
18:07:36FromDiscord<treeform> they never fit the way I want them to fit
18:07:41FromDiscord<treeform> but I do suppor them
18:08:04*Zevv quit (Quit: Lost terminal)
18:08:31*Zevv joined #nim
18:08:34Zevvexelotl: thats cool, so it has at least one user now
18:08:54Zevvso you have ucontext on your platform
18:09:11FromDiscord<treeform> @disruptek also: `frosty.nim(218, 13) Warning: Potential object case transition, instantiate new object instead [CaseTransition]`
18:09:18disruptekcase objects compose pretty well in nim; i don't think inheritance is superior.
18:09:32disruptekyeah, transitions are safe in some cases.
18:09:34FromDiscord<treeform> I agree inheritance is terrible
18:10:08FromDiscord<treeform> @disruptek, if you think that transition is safe there, can you silence the warning?
18:10:50disruptekprobably. i will cut a 1.0 release that changes frosty Real Soon Now.
18:11:04disruptekgot a lot of snow to move today...
18:11:22ZevvReal Soon Now
18:11:50disruptekyep.
18:15:47planetis[m]i see you really like to compare your libs with benchmarks
18:16:05disruptekit's easy.
18:17:58planetis[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:22FromDiscord<treeform> planetis, already done, thank you for that tip
18:18:24disruptekyeah, i have a ticket to put it into 1.0.
18:18:28planetis[m]he wins bc he knows this secret :P
18:18:41disruptekit's actually already written, i just want to break frosty a bit more.
18:19:03*zedeus quit (Ping timeout: 265 seconds)
18:19:17FromDiscord<treeform> I just want to outsource my speed ideas to you guys.
18:20:02disruptekthe speed is good enough for my uses at the moment. jason is a bigger speed problem.
18:20:32disruptekto put that another way, there is more room to optimize jason and win real benefit.
18:20:37FromDiscord<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:36FromDiscord<Clyybber> why is it faster?
18:21:54FromDiscord<treeform> disruptek, I reached feature parity, uphold your and of the bargain. Make frosty faster!
18:22:19disrupteki will. 😈
18:22:37*vsantana quit (Ping timeout: 246 seconds)
18:22:57FromDiscord<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:05FromDiscord<Clyybber> I see
18:23:18disruptek64 bit or 64 byte?
18:23:43FromDiscord<treeform> Its probably faster to copy large chunks of memory by not copying memory at all but resigning the virtual pages.
18:23:58FromDiscord<treeform> But if you copy small things you don't need a check for that?
18:24:13FromDiscord<treeform> 64 bit
18:24:33disrupteki would rather have less code that is slower and more reliable.
18:24:34FromDiscord<treeform> Without using SIMD that's all you can load.
18:25:02disruptekonce i have one copy, i'm satisfied.
18:25:28FromDiscord<treeform> I want the fastest code possible (provided it works ofc)
18:25:46disrupteki 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:25planetis[m]sounds like a variation of busy work really, I must focus finishing my project instead
18:31:33*vsantana joined #nim
18:35:39leorize[m]is it possible to forward declare a type?
18:36:59FromDiscord<fwsgonzo> im in string copying hell
18:37:01*Zevv quit (Quit: Lost terminal)
18:37:22*Zevv joined #nim
18:39:19saemMorning
18:39:40*D_ quit (Ping timeout: 256 seconds)
18:46:26FromDiscord<fwsgonzo> can I accept a ref cstring from C?
18:46:38FromDiscord<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:45FromDiscord<lqdev> you have to put them under a single type section
18:49:28*lritter quit (Quit: Leaving)
18:50:02Oddmongeri have a myseq (seq[uint8]) , filled with values. When i try a myseq.join , compiler says « undeclerad field join »
18:50:28Oddmongerbut i can echo the whole sequence (without the «join»)
18:50:52Zevvdid you import strutils then
18:51:02Oddmonger*shame on me*
18:51:13Zevvoh wait uint8, that'll not work
18:51:17Zevvno shame
18:51:50saemEcho is using $, I think, so that's why that works
18:51:51Oddmongerindeed it works: https://play.nim-lang.org/#ix=2KDB
18:52:28Oddmongerbut i'd rather like to have «ab» string instead of values
18:52:45Oddmongermaybe toString before
18:53:30Zevvhttps://play.nim-lang.org/#ix=2KDD
18:53:36Zevvconvert your uint8s to chars
18:53:46Zevvthis makes a copy. If you're brave you can cast
18:53:56FromDiscord<fwsgonzo> is there a move-like keyword?
18:54:06Zevvno. there is only `move`
18:54:27Oddmongeri see, thank you (well in fact it's kind of magic)
18:54:38*D_ joined #nim
18:54:51ZevvOddmonger: https://play.nim-lang.org/#ix=2KDF
18:55:39*hnOsmium0001 joined #nim
18:55:41Oddmongerah ok, like the good old &mystring[0]
18:55:47Zevvbut this one is probably best: https://play.nim-lang.org/#ix=2KDG
18:56:02Zevvbut it's kind of nasty, since it assums seq and str are the same thing under the hood
18:56:06Zevvthey happen to be at this time
18:56:11Zevvbut they might not in the future
18:56:36Zevvbut it's cheapest as there is no copying involved
18:57:49Oddmongerso for «future proof», the best would be the cast à-la-C (cast[cstring](myseq[0].addr) ) ?
18:58:37miprino, for the opposite of future-proofing do that
18:59:48mipriI'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:48Oddmongerhmmm
19:00:55Zevvyea, trust mipri, not me
19:01:41*abm quit (Quit: Leaving)
19:07:10*Jesin quit (Quit: Leaving)
19:12:13ZevvHow can I genericize an int range type?
19:13:00ZevvI 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:47FromDiscord<treeform> planetis, I benched your json serializer it appears to be slower then std lib? https://gist.github.com/treeform/572e6d200fe17a409a7cb510dea62001
19:15:22FromDiscord<Avatarfighter> @treeform just curious, why are you benchmarking so many libraries?
19:17:01*xet7 quit (Quit: Leaving)
19:19:35FromDiscord<treeform> I want to mine them for nuggets of speed goodness
19:20:04FromDiscord<Daniel> got to go fast
19:20:08FromDiscord<Avatarfighter> fr
19:20:11FromDiscord<treeform> also https://handmade.network/manifesto
19:21:54FromDiscord<Daniel> Manifesto is great, but ppl are lazy, and they will always clutter.....
19:22:09FromDiscord<treeform> @disruptek You don't do json parsing yet right? https://github.com/disruptek/jason
19:22:31FromDiscord<treeform> @Daniel true, I am just not being lazy.
19:22:41FromGitter<timotheecour> > *<FromDiscord>* <Clyybber> @timotheecour Did you see https://github.com/nim-lang/Nim/issues/16526 ?
19:22:43disbotconfig file resolution might be broken or reported incorrectly ; snippet at 12https://play.nim-lang.org/#ix=2KCU
19:22:45FromGitter<timotheecour> @Clyybber ya
19:23:00Zevvtreeform: nope, only serializing
19:23:13FromDiscord<Clyybber> @timotheecour Is it a bug, or is it intended?
19:23:20FromGitter<timotheecour> bug
19:23:30*abm joined #nim
19:23:39FromGitter<timotheecour> (Pre-existing); while investigating it i found a regression: https://github.com/nim-lang/Nim/issues/16556
19:23:40disbotregression(1.4.2=>devel): `nim c main` creates `pkgs` dir in current directory
19:30:32*xet7 joined #nim
19:32:09FromGitter<timotheecour> @claudiunv ok i have a fix coming
19:33:24*lritter joined #nim
19:33:31FromDiscord<Clyybber> cool! (I suppose you meant to ping me :)
19:35:42Zevv-EWRONGTABEXP
19:36:13*D_ quit (Ping timeout: 264 seconds)
19:38:10*Jesin joined #nim
19:44:03*disruptek throbs.
19:45:13FromDiscord<Clyybber> @timotheecour Can you add a test?
19:47:07FromDiscord<Clyybber> It should be possible using testaments "output" directive
19:47:07*fanta1 quit (Quit: fanta1)
19:47:17FromDiscord<Clyybber> eh, "nimout" I mean
19:47:29*Arrrrrrrr quit (Quit: Arrrrrrrr)
19:48:38*Prestige quit (Quit: Prestige)
19:48:49FromDiscord<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:37ForumUpdaterBotNew 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:29planetis[m]treeform: give us the benchmarks, im sure you did something naive like coping the stream to string and such
20:10:59FromGitter<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:00disbotfix #16526 run config.nims before foo.nim.cfg
20:11:04planetis[m]but you should know i have work to do now
20:16:33FromDiscord<treeform> planetis, sorry I will not bother you with bench mark stuff 😦
20:16:44FromDiscord<treeform> you should have told me earlier you don't want my input
20:16:45FromDiscord<Daniel> i like benchmarks
20:19:46FromDiscord<treeform> Could GPU serialize json faster then CPU? hmmm
20:20:23FromDiscord<Clyybber> @timotheecour Commented on the PR
20:32:35planetis[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:17planetis[m]i just dont get this aggressive marketing "we do everything for speed" and if it pays off.
20:33:57planetis[m]what about usability, bug fixes, features, do they go down the drain?
20:34:06*lritter quit (Quit: Leaving)
20:34:07FromDiscord<treeform> Its ok, we all trying to ship some thing.
20:34:13FromDiscord<treeform> We all have limited time.
20:34:20FromDiscord<treeform> I totally get it.
20:35:44planetis[m]*error checking as well
20:36:05FromDiscord<treeform> I am not saying forget about usability, bug fixes, features...
20:36:22planetis[m]👍
20:36:29FromDiscord<treeform> It just everyone always forgets about speed. That is what made me want to use nim.
20:36:42FromDiscord<treeform> We have these super fast computers but most software just kind of runs slow.
20:37:04FromDiscord<treeform> Its easy to see when you have a bug, but its hard to see when some thing is slow.
20:37:33FromDiscord<treeform> I just want to write better code, faster code.
20:37:33FromDiscord<haxscramper> > yeasy to see when you have a bug
20:37:39FromDiscord<haxscramper> (edit) "yeasy" => "easy"
20:37:56FromDiscord<treeform> I don't want to pollute the world with my shitty slow code, I just want to rise above that.
20:38:54Zevvtreeform: I admire your courage
20:39:28disrupteki would rather have slow code that is at the correct abstraction. then if it can be made faster, someone will do it.
20:41:40ZevvImagine 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:09ZevvI just do #include <stdio.h> and int main(). And every day, my stuff is more efficient then the day before
20:42:42ZevvI should put that on my CV, that my code gets twice as fast every two years.
20:43:26FromDiscord<Daniel> its interesting how your code has become 4096 times faster
20:43:47FromDiscord<treeform> I want my code to quadruple in speed every 2 years
20:43:47Zevvmoores law. twice as fast every 2 years. 2^12-and-a-bit
20:43:48Zevvthere you go
20:44:02qwrin this case you're ignoring best software practices to compensate for that unplanned speed increase ;)
20:44:04FromDiscord<treeform> By getting better at speed
20:44:29Zevvnever change a winning algorithm
20:44:39Zevvif it was good enough for dijkstra, it's good enough for me
20:49:25FromDiscord<lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2KEn
20:49:26FromDiscord<lqdev> excuse the hell outta me?
20:52:57disrupteki do love the animated graphs of cpu speed growth.
20:53:15*_randyr joined #nim
20:53:16disrupteklike the one in /the social dilemma/
20:53:47disruptekwe lived with those early pre-x86 machines, man.
20:54:16_randyrMinor 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:42disrupteklqdev: that's awesome, haha
20:58:13FromDiscord<lqdev> disruptek: you know what the problem was?
20:58:20disruptekwhat?
20:58:30FromDiscord<lqdev> i was passing a static int32 to a generic param that wanted a static int
20:58:33FromDiscord<Clyybber> _randyr: Thanks, already fixed here: https://nim-lang.github.io/Nim/system#succ%2CT%2Cint
20:58:40FromDiscord<lqdev> and it didn't cause any problems at the first instantiation
20:58:49FromDiscord<lqdev> only at this call for some reason
20:59:00disruptekgenerics+statics are super fun.
20:59:04FromDiscord<lqdev> yes.
20:59:31disruptektook 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:23FromDiscord<jken> I've imported sequtils, any know why I can't toSeq a HashSet<system.String>?
21:24:34FromDiscord<haxscramper> Have you imported `std/sets` too? And can you show the error if not
21:24:48FromDiscord<haxscramper> if you did import
21:24:54FromDiscord<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:51ForumUpdaterBotNew thread by Chris3606: Creating Custom DLLMain using MSVC, see https://forum.nim-lang.org/t/7326
21:56:02FromDiscord<Randall> Doc typo in `clamp`: https://nim-lang.github.io/Nim/system#clamp%2CT%2CT%2CT↵↵"fatser" -> "faster"
21:58:45ForumUpdaterBotNew 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:53ForumUpdaterBotNew 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:49FromDiscord<exelotl> heyy, I have a question about closure iterators
22:45:22disruptekyes, they will be replaced by cps.
22:45:35disruptekall your iteration are belong to us.
22:45:35FromDiscord<exelotl> hehehe
22:45:57FromDiscord<exelotl> my question is, are they like, naturally prone to leaking memory under ARC? Or just certain usages of them?
22:46:16disrupteknot as far as i know.
22:46:32disruptekdo you have a repro?
22:47:01FromDiscord<dk> does stdlib have sugar for this """pattern"""? https://media.discordapp.net/attachments/371759389889003532/795060609606746112/unknown.png
22:47:16FromDiscord<lqdev> just… use object constructor syntax?
22:47:37FromDiscord<dk> to be more explicit - I want to copy all the fields from row to p
22:47:44FromDiscord<lqdev> oh
22:47:48FromDiscord<lqdev> well, not that i know of
22:47:52disruptekshort answer: no. long answer: write a macro.
22:47:55ForumUpdaterBotNew thread by Chris3606: Cross-Compiling for Windows 32-bit with ChooseNim Install, see https://forum.nim-lang.org/t/7328
22:48:03FromDiscord<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:18FromDiscord<exelotl> so I was wondering what the cause behind that was
22:48:29disruptekyou could maybe do it with an assignment macro that takes a concept argument... would be kinda nifty.
22:49:09FromDiscord<dk> I thought concepts are died
22:49:12disruptekexelotl: 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:41disruptekconcepts are being reimpl'd and there's no support for old syntax yet.
22:49:47disruptekalso, the new impl is not merged.
22:50:31FromDiscord<exelotl> ah, so it was an "async introduces cycles" problem rather than a "closure iterators introduce cycles" problem
22:50:43disruptekfor 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:31disruptekexelotl: 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:23disruptekthe 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:36disruptekdisbot: are you leaking memory right now?
22:52:36disbotmy sources say no.
22:52:44disruptek!memory
22:52:45disbot total: 93 Megabytes; free: 22 Megabytes; owned: 67 Megabytes; max: 93 Megabytes
22:52:53disruptekmy sources say yes.
23:02:44*xet7 quit (Quit: Leaving)
23:09:46*natrys quit (Quit: natrys)
23:10:41saemIs 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:04FromDiscord<lqdev> possibly to not have a single hard to manage 10000 line file
23:22:06saemI agree that would be unwieldy, but include vs import
23:23:15FromDiscord<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:49FromDiscord<ElegantBeef> Import gets a little funky with circular logic as of now
23:24:59FromDiscord<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:26disruptekit's a pita in the compiler like nowhere else.