00:01:37 | * | endragor joined #nim |
00:01:59 | shashlick | Ya |
00:05:52 | * | endragor quit (Ping timeout: 246 seconds) |
00:09:50 | * | hyiltiz_ quit (Quit: No Ping reply in 180 seconds.) |
00:10:56 | * | hyiltiz joined #nim |
00:14:27 | FromDiscord | <slymilano> sent a long message, see http://ix.io/2rvg |
00:19:22 | FromDiscord | <Rika> uh, how many CPU cores does your CPU have |
00:19:34 | FromDiscord | <Yardanico> lemme guess - 4 |
00:19:38 | FromDiscord | <Rika> yeah |
00:19:46 | FromDiscord | <Rika> if it's 4 then theres the culprit |
00:19:54 | FromDiscord | <slymilano> it's this one: https://support.apple.com/kb/sp714?locale=en_US |
00:19:57 | FromDiscord | <Rika> nim doesnt use green threading (or whatever) |
00:20:04 | FromDiscord | <slymilano> 1.5Ghz dual-core intel core i5 |
00:20:17 | FromDiscord | <Yardanico> hyper threading? |
00:20:19 | FromDiscord | <Rika> dual core? huh thats interesting |
00:20:22 | FromDiscord | <Rika> might be that yes |
00:20:27 | FromDiscord | <Rika> 2 cores 4 threads |
00:20:34 | FromDiscord | <Rika> if it's the i7 |
00:20:52 | FromDiscord | <Rika> but yeah its because you only have 4 logical processors |
00:20:54 | FromDiscord | <Yardanico> well @Rika threadpool should still run them |
00:20:58 | FromDiscord | <Yardanico> even if more than 4 spawned |
00:20:58 | FromDiscord | <Rika> huh really? |
00:21:07 | FromDiscord | <slymilano> simple dumb example of what I'm trying to do: https://play.nim-lang.org/#ix=2rvj |
00:21:12 | FromDiscord | <Varriount> Unless the workers run forever |
00:21:27 | FromDiscord | <Yardanico> @slymilano threadpool wouldn't be good for that |
00:21:35 | FromDiscord | <Yardanico> why not just use createThread/joinThread? |
00:21:43 | FromDiscord | <slymilano> it's more manual and i'm a lazy bastard lmao |
00:21:55 | FromDiscord | <Rika> lol |
00:21:57 | FromDiscord | <Yardanico> well in your case there would be almost no difference |
00:22:13 | FromDiscord | <Yardanico> in the code I mean |
00:22:14 | FromDiscord | <Varriount> Are channels in a working state? |
00:22:17 | FromDiscord | <Yardanico> yes? |
00:22:30 | FromDiscord | <Yardanico> they're writing to a DB from each separate thread though |
00:22:35 | FromDiscord | <Yardanico> i mean slymilano's code |
00:22:43 | FromDiscord | <Yardanico> so channels are not needed there really |
00:24:05 | FromDiscord | <slymilano> hm... you're recommending I use createThread and joinThread. eventually my app will have crawlers for 20 or 30 different sites, is your approach still valid? not familiar deeply with those createthread/jointhread |
00:24:11 | FromDiscord | <Yardanico> yes of course |
00:24:15 | FromDiscord | <Yardanico> since you want to all them run in parallel |
00:24:17 | FromDiscord | <Yardanico> forever |
00:24:41 | FromDiscord | <slymilano> i see, in what case would you use `spawn` then? I thought spawn was a shoe-in for my crawlers feature |
00:25:04 | FromDiscord | <Yardanico> for CPU-intensive computation tasks |
00:25:08 | FromDiscord | <Yardanico> when you need to parallelize the computations |
00:25:30 | FromDiscord | <Yardanico> also for your case you should really look into using async |
00:26:09 | FromDiscord | <Yardanico> ah, and right, as I said before (when I was talking with you about threads, not sure how long ago) - don't call procs in themselves |
00:26:16 | FromDiscord | <Yardanico> otherwise you'll be in deep recursion |
00:26:31 | FromDiscord | <Yardanico> just do while true: fetchLatest(); sleep(30000) |
00:26:39 | FromDiscord | <Yardanico> so you wouldn't have recursion |
00:27:03 | FromDiscord | <slymilano> totally! i have to shake the recursion off a bit 😛 i'm an elixir dev for my day job |
00:27:07 | FromDiscord | <Rika> ah, webcrawler |
00:27:13 | FromDiscord | <Rika> you really should use async there |
00:27:26 | FromDiscord | <Yardanico> when I made some suggestions to you I talked about recursion too |
00:27:28 | FromDiscord | <Rika> you're not cpu bound here, you're io bound |
00:27:53 | FromDiscord | <Yardanico> exactly what I was talking about too |
00:27:54 | FromDiscord | <Rika> it'll save a lot of headaches, i'm almost sure of it |
00:28:17 | * | oriba quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
00:28:37 | mbuchel | does anyone know if there is a websocket library like treeform/ws which also implements permessage-deflate? |
00:29:19 | FromDiscord | <Yardanico> @slymilano non-recursive example with createThread |
00:29:24 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rvk |
00:29:34 | FromDiscord | <Yardanico> you can also easily make a "convenience" wrapper so it would look like with your "spawn" |
00:29:43 | FromDiscord | <Yardanico> forgot thrs[4] though |
00:30:12 | FromDiscord | <Rika> y u no for loop |
00:30:18 | FromDiscord | <Yardanico> ? |
00:30:24 | FromDiscord | <slymilano> looks great and async await looks like it's a good fit https://gist.github.com/rsirres/9949a4b98b7d5b9dd441483f14f06fbf |
00:30:36 | FromDiscord | <Rika> (why'd you not use a for loop) |
00:30:54 | FromDiscord | <Yardanico> because in slymilano's case they won't be able to use a for loop |
00:31:06 | FromDiscord | <Yardanico> @slymilano just be aware that "await" actually blocks until that future completes |
00:31:16 | FromDiscord | <Yardanico> also you don't need to be so verbose |
00:31:31 | FromDiscord | <Yardanico> and you should use sleepAsync 🙂 |
00:31:44 | FromDiscord | <Rika> mbuchel: why not ask treeform if they can implement it 😛 |
00:32:21 | FromDiscord | <slymilano> "just be aware that "await" actually blocks until that future completes" does this mean I can't `async` my five crawlers, and then continue on to run my jester routes and serve web requests? |
00:32:37 | FromDiscord | <Yardanico> you can |
00:32:41 | FromDiscord | <Yardanico> just need to structure it properly 🙂 |
00:32:43 | FromDiscord | <Yardanico> asyncCheck and such |
00:33:22 | mbuchel | i do not know how long it will take him to implement it, if one does not exist i likely will have to implement my own |
00:34:18 | FromDiscord | <Yardanico> @slymilano your example, in "nim async" style 😛 (although I changed 0.7 < 0.5 to 0.7 > 0.5) |
00:34:25 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rvl |
00:34:45 | FromDiscord | <Yardanico> you can use return instead of "result = " too, it's just preferred to use "result" in Nim world if you don't need "return" for the control flow 🙂 |
00:35:18 | FromDiscord | <slymilano> that looks good to me, and the nim in action book has some examples of futures i can use + your code 😄 |
00:35:22 | FromDiscord | <Yardanico> if you actually put await to value and value2 declarations, output will be different |
00:35:30 | FromDiscord | <Yardanico> because then you'll wait until callback1 fully complets |
00:35:45 | FromDiscord | <Yardanico> but in my example you start both async functions |
00:35:55 | FromDiscord | <Yardanico> and then wait for the first one to return, and then for the second one |
00:36:23 | FromDiscord | <slymilano> I would like the crawlers to run at their own individual pace, don't care about sequential-ness. So something like this would work? https://play.nim-lang.org/#ix=2rvm |
00:36:34 | FromDiscord | <Yardanico> no no |
00:36:39 | FromDiscord | <Yardanico> in this case you probably want to use asyncCheck |
00:36:50 | FromDiscord | <Yardanico> also are they supposed to return anything? |
00:37:02 | FromDiscord | <slymilano> nope, they just do their thing and write to sqlite |
00:37:02 | FromDiscord | <Yardanico> since it's async it'll be single threaded so you can access the same DB instance from different crawlers |
00:37:10 | FromDiscord | <Yardanico> @slymilano yeah, then you can just use asyncCheck |
00:37:20 | FromDiscord | <Yardanico> httpclient supports async |
00:37:23 | FromDiscord | <Yardanico> sleep -> sleepAsync |
00:37:52 | FromDiscord | <slymilano> gotcha, i'll start by modifying one crawler to use asyncheck, and see what's up |
00:38:13 | FromDiscord | <slymilano> i hope this works! i want people to be able to run this tiny binary and serve their own personal torrent search engine |
00:39:28 | FromDiscord | <Varriount> slymilano: Huh, interesting. Will this application being doing the torrenting? |
00:39:47 | FromDiscord | <Yardanico> @slymilano well, for nyaa - |
00:40:01 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2rvn I didn't test it, but it should be pretty close |
00:40:08 | FromDiscord | <Yardanico> and in your main file you would call asyncCheck startCrawl() |
00:40:18 | FromDiscord | <slymilano> @Varriount not really, just indexing and serving a search UI, but api support as well for torznab for sonarr and radarr support |
00:40:23 | FromDiscord | <Yardanico> asyncCheck basically starts the future and sets a callback for it to handle exceptions |
00:40:29 | FromDiscord | <slymilano> the smaller, tighter, cleaner Jackett (C#) built in Nim 😛 |
00:40:53 | FromDiscord | <Yardanico> ah sorry, fetchLatest() -> doWork() in my example |
00:41:25 | FromDiscord | <slymilano> someone call the zoo, cause Yardanico is a BEAST |
00:41:30 | FromDiscord | <slymilano> thanks dude this looks much clearer to me now |
00:41:55 | FromDiscord | <Yardanico> np 🙂 |
00:44:25 | * | krux02_ quit (Remote host closed the connection) |
00:46:07 | FromDiscord | <Yardanico> btw, pushed first working example with nimterop's sciter and nim - https://github.com/Yardanico/nsciter |
00:46:11 | FromDiscord | <Yardanico> it's all pretty low-level right now |
00:48:14 | * | Guest44090 quit (Ping timeout: 256 seconds) |
00:50:52 | FromDiscord | <j$> types can't be stored right? |
00:51:14 | FromDiscord | <Yardanico> well they can't be stored at runtime |
00:51:17 | FromDiscord | <Yardanico> but there's "typedesc" |
00:51:21 | FromDiscord | <j$> right |
00:51:25 | FromDiscord | <j$> darn |
00:51:33 | FromDiscord | <Yardanico> why do you need to store them at runtime? |
00:51:56 | FromDiscord | <j$> trying to cast a pointer to a ptr at runtime |
00:52:05 | FromDiscord | <j$> but I have to have the type |
00:52:11 | FromDiscord | <Yardanico> what's the point? |
00:52:15 | FromDiscord | <Yardanico> you don't change the representation |
00:52:23 | FromDiscord | <Yardanico> "pointer" and "ptr Type" are exactly the same in memory |
00:52:25 | FromDiscord | <j$> opengl uniforms |
00:52:36 | FromDiscord | <j$> trying to group them into one func call |
00:52:41 | FromDiscord | <Yardanico> it's just that with "ptr Type" you give the compiler more information |
00:52:56 | FromDiscord | <Yardanico> at runtime they all will be like "pointer" 😛 |
00:53:26 | FromDiscord | <j$> yeah I know that but trying to call specific procs based on pointer type |
00:53:42 | FromDiscord | <impbox> use `method` ? |
00:53:48 | FromDiscord | <j$> hmmm |
00:53:55 | FromDiscord | <j$> gotta read up on those |
00:54:12 | FromDiscord | <j$> something something dynamic dispatch? |
00:54:38 | FromDiscord | <Yardanico> well yes, because it sounds like what you want |
00:56:10 | FromDiscord | <j$> can objects have generic types, no right? |
00:56:17 | FromDiscord | <Yardanico> wdym? |
00:56:20 | FromDiscord | <Yardanico> objects can be generic |
00:56:26 | FromDiscord | <Yardanico> or you can have object variants |
00:56:50 | FromDiscord | <j$> like generic procs with the proc name[T](...) |
00:57:23 | FromDiscord | <Yardanico> yes |
00:57:34 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#generics |
00:57:42 | * | dadada joined #nim |
00:58:06 | * | dadada is now known as Guest13125 |
00:58:25 | FromDiscord | <j$> *gasp* |
00:58:28 | FromDiscord | <j$> I needed this |
00:59:14 | FromDiscord | <impbox> nim generics are great <3 |
00:59:35 | FromDiscord | <Rika> impbox's name is a generic |
00:59:39 | FromDiscord | <Rika> (lol) |
01:00:11 | FromDiscord | <impbox> you can also do generics without the [T] thing, proc foo(v: TypeA | TypeB | TypeC) etc |
01:00:17 | FromDiscord | <impbox> (edit) 'proc' => '`proc' | 'TypeC)' => 'TypeC)`' |
01:00:36 | FromDiscord | <Rika> theyre called implicit (?) generics or something |
01:00:37 | FromDiscord | <impbox> (see below under "implicit generics") |
01:00:43 | FromDiscord | <Rika> huahuahuahua |
01:00:45 | FromDiscord | <j$> cool |
01:00:45 | FromDiscord | <Rika> i am right |
01:00:47 | FromDiscord | <impbox> yep, didn't realise they had a name |
01:03:22 | FromDiscord | <Yardanico> there's also this feature |
01:03:27 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rvr |
01:03:56 | FromDiscord | <Varriount> @j$ There are also other situations where a procedure becomes generic (or "generic-like") |
01:04:05 | FromDiscord | <Yardanico> you can access the "subtype" of the generic even if it's implicit |
01:04:33 | FromDiscord | <Varriount> For example, when a procedure has a parameter of type `typed` |
01:04:40 | FromDiscord | <Yardanico> or auto/any |
01:05:54 | FromDiscord | <Varriount> Although, I don't know if the compiler internally handles those like generics |
01:06:33 | FromDiscord | <Yardanico> well |
01:06:38 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rvs |
01:06:56 | FromDiscord | <Yardanico> ah I don't need typeof here either |
01:06:58 | FromDiscord | <impbox> oh never used that |
01:07:02 | FromDiscord | <Yardanico> neither did I |
01:07:03 | FromDiscord | <impbox> in procs |
01:11:29 | * | Tlanger joined #nim |
01:14:32 | * | Tongir quit (Ping timeout: 272 seconds) |
01:18:59 | * | fredrikhr quit (Ping timeout: 256 seconds) |
01:27:41 | * | audiophile joined #nim |
01:28:36 | * | Shucks quit (Quit: Leaving) |
01:33:22 | FromDiscord | <exelotl> "Implicit generics" ohhhh that's what they are |
01:33:50 | * | chemist69 quit (Ping timeout: 256 seconds) |
01:35:49 | * | chemist69 joined #nim |
01:36:46 | FromDiscord | <impbox> it was implicit =) |
01:37:53 | FromDiscord | <Rika> *was*? |
01:38:20 | FromDiscord | <impbox> it's not now we've made it explicit by talking about it |
01:38:34 | FromDiscord | <Rika> lmao |
01:38:35 | FromDiscord | <Rika> i see |
01:38:44 | FromDiscord | <Rika> my brain: :loading: |
01:45:30 | * | endragor joined #nim |
02:23:51 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:25:22 | FromGitter | <ynfle> Any reason I'm getting `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` for `getAppDir().parentDir()` |
02:25:39 | * | muffindrake joined #nim |
02:26:08 | FromGitter | <ynfle> On Macos |
02:28:12 | * | endragor quit (Remote host closed the connection) |
02:28:24 | * | endragor joined #nim |
02:32:46 | FromDiscord | <impbox> what does getAppDir() return? |
02:34:34 | * | Cthalupa quit (Ping timeout: 240 seconds) |
02:36:51 | * | Cthalupa joined #nim |
02:38:23 | shashlick | Directory where current binary is |
02:47:17 | FromDiscord | <impbox> the actual value i mean |
02:47:23 | FromDiscord | <impbox> when it's crashing |
02:47:56 | FromDiscord | <impbox> is it getAppDir() that's segfaulting or parentDir()? |
02:48:26 | FromDiscord | <impbox> `getAppDir: Returns the directory of the application's executable. Note: This does not work reliably on BSD` macos is BSD right? |
02:48:49 | FromDiscord | <impbox> would be nice if it explained what "not working reliably" meant |
02:49:47 | FromGitter | <ynfle> :facepalm: |
02:50:03 | FromGitter | <ynfle> Classic amiguous nim docs |
02:51:45 | FromDiscord | <impbox> but ynfle, what is the return value of getAppDir? |
02:52:35 | FromGitter | <ynfle> Now it's not failing on that anymore |
02:53:04 | FromDiscord | <impbox> uhh ok... sounds like you're getting memory corruption or something |
02:53:36 | FromGitter | <ynfle> It's SISSEGVing on `/` for joining paths |
02:53:58 | FromDiscord | <impbox> got a test case? |
02:54:11 | FromGitter | <ynfle> Are you on Mac? |
02:54:12 | FromDiscord | <impbox> or is it only happening in part of a larger app |
02:54:20 | FromDiscord | <impbox> nope |
02:55:10 | FromDiscord | <impbox> but if it happens in isolation then it's probably a problem with nim, if not then it's likely you're messing up the memory somewhere else and it's throwing an error there |
02:55:15 | FromDiscord | <impbox> can you valgrind it on mac? |
03:01:52 | * | chemist69 quit (Ping timeout: 260 seconds) |
03:02:17 | * | chemist69 joined #nim |
03:03:02 | * | endragor_ joined #nim |
03:03:10 | * | endragor quit (Read error: Connection reset by peer) |
03:10:46 | * | audiophile quit (Remote host closed the connection) |
03:38:56 | shashlick | @Yardanico - I updated the gist to fix the HWINDOW issue - check it out when you get a chance |
03:43:40 | FromDiscord | <Varriount> @impbox No valgrind on Mac, but there is address sanitizer |
03:45:55 | FromGitter | <ynfle> @impbox, what does that mean? |
03:46:47 | FromDiscord | <impbox> Valgrind is a program that runs your app in a sandbox and monitors invalid memory usage and tells you where/when it happens, since often those errors don't show up until you get a segfault in a weird unrelated place |
03:47:29 | FromGitter | <ynfle> @Varriount, any suggestions? |
03:54:14 | * | Cthalupa quit (Ping timeout: 240 seconds) |
03:56:18 | FromDiscord | <slymilano> Progress! asyncCheck, and asyncSleep, await, {.async} and Future's gave me the solution I needed. However it doesn't seem to play well with Jester. If I uncomment my jester routes macro, the crawlers don't run, and if I leave the runForever the jester macros don't run so I get no website api. https://play.nim-lang.org/#ix=2rvF |
03:56:28 | FromDiscord | <slymilano> (edit) 'asyncSleep,' => 'sleepAsync,' |
03:56:35 | * | Cthalupa joined #nim |
03:58:30 | FromDiscord | <slymilano> The changes I made if anyone's curious https://github.com/sergiotapia/torrentinim/commit/db1cc8d429d08afea1c806a20b145d499da141cf?diff=split |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:33 | FromDiscord | <Rika> use a router |
04:06:38 | * | supakeen joined #nim |
04:06:54 | FromDiscord | <Rika> let me edit your playground demo one moment |
04:07:40 | FromDiscord | <Varriount> @ynfle: still here? |
04:07:46 | FromGitter | <ynfle> Yup |
04:08:58 | FromDiscord | <Varriount> ynfle: Are you using the Arc GC (or is there a reason you can't use Arc)? |
04:09:06 | FromDiscord | <Rika> @slymilano https://play.nim-lang.org/#ix=2rvH |
04:09:30 | FromDiscord | <Rika> dunno if you have to do this specifically, but there |
04:09:32 | FromGitter | <ynfle> Wasn't specifying ay |
04:09:36 | FromGitter | <ynfle> *any |
04:09:38 | FromDiscord | <slymilano> let me try thank you |
04:09:42 | FromDiscord | <Varriount> @ynfle Try adding `--gc:arc --passc:-fsanitize=address` |
04:09:45 | FromGitter | <ynfle> Would that help? |
04:10:03 | FromDiscord | <Varriount> It might make the address sanitizer complain less/be more accurate |
04:11:53 | FromDiscord | <Varriount> @ynfle Anything? |
04:12:17 | FromGitter | <ynfle> It seems to have solved it |
04:12:24 | FromGitter | <ynfle> Why was `arc` needed? |
04:12:42 | FromDiscord | <Varriount> Hm, that wasn't meant to solve it, just help find the cause. |
04:12:55 | FromDiscord | <Varriount> What happens if you remove `--gc:arc`? |
04:13:18 | FromGitter | <ynfle> I got this `clang: error: unsupported argument 'address--skipUserCfg:on' to option 'fsanitize='` |
04:13:24 | FromDiscord | <slymilano> @Rika https://play.nim-lang.org/#ix=2rvI - with no runForever the crawlers don't actually run, and with it, the jester server doesn't start because of runForevers' while true |
04:13:33 | FromDiscord | <Varriount> I added arc because diagnostic tools like valgrind and address sanitizer can mistake the GC for bad programming |
04:13:57 | FromGitter | <ynfle> Makes sense |
04:13:58 | FromDiscord | <Varriount> @ynfle Add a space after 'address' |
04:14:20 | FromGitter | <ynfle> Oh haha |
04:20:09 | FromDiscord | <slymilano> it's weird because Jester's .serve() function actually called runForever() at the end of it's proc - so why would it not work exactly like my runForever in my main nim file |
04:24:21 | FromDiscord | <Varriount> @slymilano That's really odd |
04:26:21 | * | endragor joined #nim |
04:26:21 | * | endragor_ quit (Read error: Connection reset by peer) |
04:27:54 | FromDiscord | <Varriount> @slymilano If you remove runForever and let Jester run, what happens when it serves a request? |
04:28:08 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:30:57 | FromDiscord | <slymilano> @Varriount nothing happens as far crawlers being fired - the requests to jester are served, but crawlers ramain dead/silent |
04:33:09 | FromDiscord | <slymilano> the project has zero deps if you're curious enough to git clone - a simple `nimble run torrentinim` runs it |
04:33:43 | FromDiscord | <Varriount> slymilano: I can in about an hour. |
04:34:59 | FromDiscord | <Varriount> slymilano: Do you have a C/C++ debugger on hand? Nim is compatible with GDB/LLDB/etc |
04:37:10 | FromDiscord | <Varriount> @slymilano ^ |
04:37:26 | FromDiscord | <slymilano> that's a bit out of my wheelhouse 😦 |
04:37:34 | FromDiscord | <slymilano> i don't have that nor know how to use it |
04:39:31 | * | B4s1l3 joined #nim |
04:39:55 | * | B4s1l3 is now known as opDispatch |
04:41:47 | FromDiscord | <slymilano> thanks @Varriount appreciate your help whenever you can |
04:42:37 | FromDiscord | <Varriount> slymilano: Try raising an exception in your web crawlers on the very first line of their implementation |
04:53:11 | * | Guest13125 quit (Ping timeout: 256 seconds) |
04:53:33 | FromDiscord | <Varriount> slymilano: If you can wait another 30-40 minutes, I'll be able to compile your program then. |
04:53:44 | FromDiscord | <slymilano> sure i'll be around |
04:53:51 | FromDiscord | <Varriount> Although, it will be on Windows, so it might just explode. ;D |
04:53:55 | FromDiscord | <slymilano> hahaha nice |
04:54:01 | FromDiscord | <slymilano> like i said no rush and i appreciate any help |
04:59:52 | * | dadada joined #nim |
05:00:16 | * | dadada is now known as Guest14468 |
05:13:17 | FromDiscord | <Varriount> @slymilano Cloning and compiling now. |
05:17:54 | FromDiscord | <Varriount> @slymilano Theoretically, what would I be seeing if the workers were running? |
05:18:50 | FromDiscord | <Varriount> Because I get `INFO Jester is making jokes at http://127.0.0.1:5000 (all interfaces)`, then the terminal starts outputting a bunch of information that looks like the output of a web crawler. |
05:19:36 | FromDiscord | <slymilano> woah, i don't see that, i'm on latest master. maybe it's because i'm running it on vs code's terminal that doesn't make sense though |
05:20:00 | FromDiscord | <Varriount> I'd post the output, but there is quite a lot of it. |
05:20:37 | FromDiscord | <slymilano> yeah that means it's writing to your local sqlite database in the repo. hm.... i don't see any output in my standalone terminal either. wut |
05:20:44 | FromDiscord | <slymilano> strange and i'm out of ideas then lol |
05:20:55 | FromDiscord | <slymilano> is there a build cache I can nuke for the project haha |
05:21:09 | FromDiscord | <Varriount> `~/nimcache`, I think. |
05:21:48 | FromDiscord | <Varriount> Maybe it's because I'm on Windows? |
05:22:01 | FromDiscord | <slymilano> that may be it |
05:22:08 | FromDiscord | <slymilano> so this may be a bug? my code aint that clever lol |
05:22:16 | FromDiscord | <slymilano> (edit) 'bug?' => 'bug with Nim?' |
05:22:27 | FromDiscord | <Varriount> Hm |
05:23:19 | FromDiscord | <Varriount> How familiar are you with Docker? |
05:23:32 | FromDiscord | <slymilano> not very - what do you have mind? |
05:24:20 | FromDiscord | <Varriount> Well, you or I could run the program on Linux (via Docker) to see if that has an effect |
05:25:07 | FromDiscord | <Varriount> I'll admit that OSX is a bit of a blind-spot in Nim's testing protocols. |
05:25:37 | FromDiscord | <Varriount> It's not that we don't try programming for OSX, however it's hard to run it in a CI/CD pipeline. |
05:26:01 | FromDiscord | <slymilano> i'll try to create a docker for the project next weekend or after wednesday |
05:26:08 | FromDiscord | <slymilano> appreciate your help and actually running the app though! |
05:26:14 | FromDiscord | <slymilano> now i have a thread to follow |
05:26:17 | FromDiscord | <Varriount> Do you have a parallels or Windows environment? |
05:27:04 | * | Vladar joined #nim |
05:27:20 | FromDiscord | <Varriount> slymilano: Anyway, I hope this didn't scare you off Nim. |
05:27:54 | FromDiscord | <slymilano> nah, i see nim as a scalpel atm. hard to weild but precise and sharp a **** i'll get better at it |
05:28:00 | FromDiscord | <Varriount> I'll admit, the async framework isn't as polished as it could be. There hasn't really been anyone willing to invest much time into improving. |
05:28:02 | FromDiscord | <slymilano> bright future ahead of this language |
05:30:16 | FromDiscord | <Varriount> I'm on the EST timezone (-4), feel free to ping me if you need help (though if I'm working, I can't guarantee I'll be able to dedicate too much time) |
05:33:09 | * | hoijui joined #nim |
05:36:44 | * | bung joined #nim |
05:38:34 | FromDiscord | <Elegant Beef> If i generate a proc through a macro, how can i subscribe add that proc to a table from said macro? |
05:38:50 | FromDiscord | <Elegant Beef> like i have the `ident` node |
05:38:52 | FromDiscord | <Varriount> subscribe? |
05:38:55 | FromDiscord | <Elegant Beef> Well add it |
05:39:01 | FromDiscord | <Elegant Beef> It's a lut of id, proc |
05:40:20 | * | maier joined #nim |
05:40:27 | FromDiscord | <Varriount> So, you have a macro that generates procedures, and after generating a procedure, you want to store the name and procedure in a table? |
05:40:42 | FromDiscord | <Elegant Beef> well i just want to store the procedure in the table |
05:40:46 | FromDiscord | <Elegant Beef> I have it's name in an ident node |
05:41:38 | FromDiscord | <Varriount> https://nim-lang.org/docs/manual.html#constants-and-constant-expressions |
05:42:08 | FromDiscord | <Varriount> That should work? Or is that not what you're aiming for. |
05:43:05 | FromDiscord | <Elegant Beef> Well i know how to make the lut at compile time outside of this macro, i just dont know how i can do the `table.add(id, macroGeneratedProcedure)` |
05:43:11 | ForumUpdaterBot | New thread by Domogled: tests in the same files as the code, see https://forum.nim-lang.org/t/6540 |
05:43:37 | FromDiscord | <Varriount> Doesn't `table.add(id, macroGeneratedProcedure)` work? |
05:44:05 | FromDiscord | <Elegant Beef> You mean give it the ast? |
05:44:36 | FromDiscord | <Elegant Beef> Cause i cant use the name as the name of the generated procedure depends on what procedure generated it |
05:45:30 | FromDiscord | <Varriount> I'm confused. The macro generating a procedure should be able to access the procedure's name. |
05:45:38 | FromDiscord | <Elegant Beef> Yea i have the name of it |
05:46:17 | FromDiscord | <Elegant Beef> How can i put the table that is `Table[uint32,proc]` |
05:46:40 | FromDiscord | <Varriount> Why is the key a uint32? |
05:46:55 | FromDiscord | <Elegant Beef> does it matter? |
05:47:23 | FromDiscord | <Varriount> Well, if you want to store a name as a key, you need the table to have a string type as the key. |
05:47:27 | FromDiscord | <Elegant Beef> This is for a RPC and 2^32 sounded like enough possible events for a single system, uif you're curous |
05:47:30 | FromDiscord | <Elegant Beef> Well not |
05:47:32 | FromDiscord | <Elegant Beef> I want an id |
05:47:44 | FromDiscord | <Elegant Beef> I want to store the generated proc as the value |
05:47:45 | FromDiscord | <Elegant Beef> Not the key |
05:47:56 | FromDiscord | <Elegant Beef> But i have no idea how to get the signature to do as such |
05:48:21 | FromDiscord | <Varriount> Hm, Along with the procedure body, output a call to register that procedure with the table. |
05:48:51 | FromDiscord | <Elegant Beef> seems hacky, but ok 😄 |
05:52:23 | FromDiscord | <Varriount> I mean, I don't see what the problem is. Yes, you could theoretically have the macro modify the compile-time variable to store the procedure, but it's going to amount to mostly the same work as the solution I proposed. |
05:52:45 | FromDiscord | <Varriount> The compile-time variable would still need to be initialized at run-time. |
05:52:52 | FromDiscord | <Elegant Beef> Yea i know |
06:02:35 | * | endragor quit (Ping timeout: 240 seconds) |
06:05:40 | * | vicfred quit (Quit: Leaving) |
06:06:59 | * | endragor joined #nim |
06:20:25 | * | narimiran joined #nim |
06:35:29 | FromDiscord | <Varriount> Hm, what are some common questions people have when working with Nim? |
06:38:24 | * | debased quit (Quit: WeeChat 2.8) |
06:45:20 | vegai | how to repl? :P |
06:45:32 | * | hoijui quit (Quit: Leaving) |
06:45:34 | vegai | dunno if that's common, but I keep wonering |
06:45:39 | * | hoijui joined #nim |
06:47:10 | FromDiscord | <flywind> I can think of some questions such as: |
06:47:22 | FromDiscord | <flywind> sent a long message, see http://ix.io/2rvU |
06:47:27 | Oddmonger | hello, nimmers |
06:48:06 | vegai | aww, github is broken again |
06:48:25 | FromDiscord | <flywind> Hello |
06:54:13 | livcd | nimeans. nimrods. nimuans. nimasters. |
06:57:23 | Oddmonger | nimrod, it's like a character from Lyonnesse |
07:06:48 | narimiran | common questions? |
07:07:05 | narimiran | "why sTyLE_inSeNSitiVIty???" |
07:07:25 | narimiran | "why imports are not just like in python?" |
07:07:50 | livcd | narimiran: that's because Nim has been advertised as "faster python" |
07:08:14 | Araq | narimiran, shttt, don't mention it |
07:08:31 | narimiran | :) |
07:08:35 | Araq | you should phrase it as "Why is Nim so much better than X" |
07:17:06 | Oddmonger | well i have publish the link of the wiki entry «nim for the Pythoners», and all i get was «what, space identation ? That language sucks» |
07:18:13 | FromDiscord | <lqdev> tell them about source code filters |
07:18:30 | Oddmonger | what is it ? |
07:18:44 | FromDiscord | <lqdev> #? replace("\t", " ") |
07:18:55 | FromDiscord | <lqdev> put that at the first line of your file |
07:19:06 | FromDiscord | <lqdev> and all tabs will get replaced with 4 spaces |
07:19:10 | Oddmonger | ah |
07:19:15 | Oddmonger | thank you |
07:19:36 | FromDiscord | <lqdev> source code filters allow you to modify source code before it's compiled |
07:20:11 | FromDiscord | <lqdev> https://nim-lang.org/docs/filters.html |
07:21:42 | Oddmonger | nice |
07:26:48 | Oddmonger | btw i use two spaces (another holy war ?) |
07:29:00 | FromDiscord | <lqdev> yeah another holy war |
07:29:12 | FromDiscord | <lqdev> most people also use 2 spaces i think |
07:30:05 | FromDiscord | <lqdev> at least according to my observations on github |
07:33:19 | bung | Oddmonger that also says from js programers |
07:55:25 | FromDiscord | <XxDiCaprioxX> I mean VS Code does the space indentation with tabs, too |
07:57:53 | FromDiscord | <Zed> githubs down again :( |
07:57:58 | * | Tongir joined #nim |
07:58:20 | Araq | github down, a free day, no work |
07:58:43 | Araq | I'm addicted though, must write my .cursor analysis |
08:00:10 | bung | I modified vnode's class called redraw(), it doest sync to native dom? |
08:00:11 | * | Tlanger quit (Ping timeout: 240 seconds) |
08:01:26 | Araq | bung, well define "sync" |
08:01:42 | Araq | Karax assumes the VDOM is the single source of truth |
08:02:21 | bung | I can check the vnode's class changed , but dom not changed |
08:03:25 | bung | it's like react functional component ? |
08:05:11 | * | endragor quit (Remote host closed the connection) |
08:05:38 | * | endragor joined #nim |
08:07:59 | Araq | a class change does cause a redraw, no idea what's happening |
08:08:49 | * | hoijui quit (Quit: Leaving) |
08:09:47 | * | endragor quit (Ping timeout: 240 seconds) |
08:12:03 | FromDiscord | <Varriount> Araq: Does Nim default to stdcall on Windows for C imported procedures? |
08:12:50 | FromDiscord | <Varriount> C2Nim is throwing a fit over calling conventions in function pointer type declarations |
08:13:21 | FromDiscord | <Varriount> so I'm likely going to have to do #def __stdcall |
08:15:43 | * | solitudesf quit (Ping timeout: 258 seconds) |
08:17:35 | bung | hmm no idea, it compare to native dom afaik, so the vdom changed I think it should re render that node |
08:20:44 | * | endragor joined #nim |
08:23:01 | * | oddp joined #nim |
08:24:25 | FromDiscord | <exelotl> #? replace("\t", " ") ---> holy shit lol |
08:26:03 | bung | oh, guess I need manage all state in buildHtml, so it compare to old vnode |
08:35:43 | FromDiscord | <Varriount> @exelotl Yep. |
08:36:51 | FromDiscord | <Varriount> Personally, out of all the "unused" features, I like source code filters the most. Mainly because you could theoretically use them with an appropriate DSL to do neat templating tricks. |
08:45:50 | * | Vladar quit (Quit: Leaving) |
08:56:26 | * | fredrikhr joined #nim |
09:12:36 | * | endragor quit (Quit: Leaving...) |
09:14:07 | * | endragor joined #nim |
09:19:13 | * | Shucks joined #nim |
09:31:56 | bung | I manage state as `tdiv(class=fmt"slider__item {self.trigger} {classes[i]}",data-index = $i)` |
09:32:07 | bung | if still not redraw to dom |
09:32:10 | bung | it |
09:44:45 | FromGitter | <alehander92> bung it doesnt work like that |
09:44:56 | FromGitter | <alehander92> at least i think in upstream karax |
09:45:11 | FromGitter | <alehander92> vnode is probably compared to previous vnode internally |
09:45:24 | FromGitter | <alehander92> or not, i really dont remember well |
09:45:50 | FromGitter | <alehander92> otherwise are you sure classes[i] is different when i changes |
09:46:28 | bung | yeah I log it out, it changes infinitely |
09:46:49 | bung | maybe causes by am using a ref ? `carousel(nref = refCarousel)` |
09:48:28 | bung | not sure, as it always new a Commonent,so the father node will change |
09:48:40 | bung | commponent |
09:58:20 | Shucks | heya nimlers |
10:08:08 | skrylar[m] | hello Shucks |
10:10:59 | * | maier quit (Ping timeout: 240 seconds) |
10:18:38 | * | Shucks quit (Quit: Leaving) |
10:22:17 | * | abm joined #nim |
10:24:53 | FromDiscord | <Shucks> https://streamable.com/bsatkr |
10:24:53 | FromDiscord | <Shucks> ;D |
10:25:58 | FromDiscord | <Recruit_main707> Is it done in Nim? |
10:26:03 | FromDiscord | <Shucks> sure |
10:26:21 | FromDiscord | <Recruit_main707> cool |
10:27:01 | FromDiscord | <Shucks> Yea nim fits perfectly fine to hack games haha |
10:27:37 | * | opDispatch quit (Quit: Konversation terminated!) |
10:28:32 | FromDiscord | <Recruit_main707> This is external though, internal gets messier |
10:33:00 | FromDiscord | <Shucks> Im internal on swbf |
10:33:34 | FromDiscord | <Shucks> which is much less code than external tbh |
10:54:28 | * | maier joined #nim |
11:20:19 | * | fredrikhr quit (Ping timeout: 246 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:27 | * | Kaivo quit (Quit: WeeChat 2.8) |
12:06:43 | * | supakeen joined #nim |
12:14:04 | Yardanico | !status |
12:14:06 | FromDiscord | Uptime - 5 days, 3 hours, and 19 minutes |
12:18:51 | FromDiscord | <Yardanico> I don't play enough games nowadays to be interested in hacks 😛 |
12:19:07 | narimiran | woohoo, no more time travelling! |
12:19:34 | Yardanico | narimiran: yeah, because you can't use commands from Discord anymore :P |
12:19:47 | Yardanico | and on IRC they require you to be in a whitelist and ircord checks if you're authorized on freenode |
12:19:53 | Yardanico | it requires* |
12:21:14 | FromDiscord | <Yardanico> About game hacking - I only made one proper internal hack 1.5 years ago for Foxhole (it was in C++ though, DLL injecting, ImGui and all that, Unreal SDK generator and stuff). I rarely play games nowadays |
12:21:26 | * | fredrikhr joined #nim |
12:21:46 | FromDiscord | <Yardanico> I also hacked some Unity games (back then Unity Webplayer was popular), but it's not so hard since you could just disassemble and modify the .NET binaries |
12:23:44 | * | letto_ joined #nim |
12:24:14 | * | letto_ quit (Client Quit) |
12:25:04 | FromDiscord | <Shucks> Its awesome that I don't have to use cpp anymore |
12:25:14 | * | letto quit (Ping timeout: 272 seconds) |
12:25:24 | FromDiscord | <Yardanico> Well I used C++ because that Unreal SDK generator was outputting C++ |
12:25:38 | FromDiscord | <Yardanico> and my internal was quite small anyway, so I didn't bother with wrapping the sdk generator output with Nim's C++ backend |
12:25:54 | FromDiscord | <Shucks> Almost everything can be done in nim except my asm stuff. Which might be because im not experienced enough with at&t and nim itself |
12:26:01 | * | letto joined #nim |
12:26:36 | FromDiscord | <Shucks> That sdk generators almost give structs for the internal classes. c2nim is pretty good with it ;D |
12:27:05 | FromDiscord | <Yardanico> Well, for Unreal it's more complex |
12:27:12 | FromDiscord | <Yardanico> since it's all vtables and stuff |
12:27:22 | FromDiscord | <Shucks> yea |
12:27:26 | FromDiscord | <Shucks> never did a ue game |
12:27:30 | FromDiscord | <Shucks> not in cpp either |
12:27:44 | bung | I log "updateStyles" it output once for first item, well I have multiple items why is that ? |
12:27:51 | FromDiscord | <Yardanico> yeah it's just that most multiplayer Unreal Engine use an anti-cheat, Foxhole did not 🙂 |
12:28:00 | FromDiscord | <Yardanico> I had fun with my internal hack, and of course never released it to public |
12:28:17 | FromDiscord | <Yardanico> the sources are still in a private github repo though (but they're outdated a lot, Foxhole had tons of updates since that) |
12:29:15 | FromDiscord | <Yardanico> 😛 https://media.discordapp.net/attachments/371759389889003532/732212040315174962/unknown.png |
12:29:26 | FromDiscord | <Shucks> ^.^ |
12:29:38 | FromDiscord | <Shucks> my current internal with nim on swbf https://media.discordapp.net/attachments/371759389889003532/732212136129986600/swbfesp.png |
12:29:45 | FromDiscord | <Yardanico> ulala |
12:29:49 | FromDiscord | <Yardanico> what about anti-cheat? |
12:30:15 | FromDiscord | <Shucks> they taking screenshots. I've hooked bitblt (windows api to record) and deactivate the drawings once its called |
12:30:27 | FromDiscord | <Yardanico> only that? no stuff like BattlEye or EAC? |
12:30:28 | FromDiscord | <Yardanico> lol |
12:30:32 | FromDiscord | <Shucks> naw ;p |
12:30:37 | FromDiscord | <Yardanico> what the heck |
12:31:19 | FromDiscord | <Shucks> well punkbuster. But i'm not sure what it actually does. Guess it just scans for the public stuff |
12:35:12 | supakeen | It's a well kept secret; though with modern anti-cheat engines you indeed have no idea what they do they can be sent random instructions to perform on any machine suspected of doing more (or any machine really). |
12:35:39 | supakeen | It's pretty great having a rootkit on your system with remote access >_< |
12:35:46 | FromDiscord | <Yardanico> well some anti-cheats are well-known by hack developers |
12:35:50 | FromDiscord | <Yardanico> and reversed a lot |
12:37:26 | * | krux02 joined #nim |
12:39:17 | * | xet7 quit (Quit: Leaving) |
12:43:19 | FromDiscord | <Shucks> Some anticheats are really to much. Valorant's anticheat just installs a driver or something which has to be started once you boot your machine. |
12:47:20 | * | Jjp137 quit (Ping timeout: 244 seconds) |
12:47:37 | * | Jjp137 joined #nim |
12:49:11 | * | Vladar joined #nim |
12:49:36 | * | solitudesf joined #nim |
12:50:18 | FromDiscord | <Shucks> I feel like vscode's code suggestions are way to slow for me. Does someone else faces this issue on windows or is it something related to my machine? |
12:50:25 | * | solitudesf quit (Remote host closed the connection) |
12:50:50 | * | solitudesf joined #nim |
12:51:05 | FromDiscord | <lqdev> they slow down as your project gets bigger |
12:51:15 | FromDiscord | <lqdev> I noticed that in vim, too |
12:51:18 | shashlick | Might be some configurable timer |
12:51:53 | shashlick | @lqdev is freetype c++? |
12:51:59 | FromDiscord | <lqdev> it's C |
12:52:02 | shashlick | Checked out the issue you saw |
12:52:17 | shashlick | Is int(x) valid c? |
12:52:37 | FromDiscord | <lqdev> no, it's C++ |
12:52:52 | shashlick | That's what's in that enum you had trouble with |
12:52:53 | FromDiscord | <lqdev> but freetype does `(FTUInt)(0)` which is valid C |
12:53:03 | FromDiscord | <lqdev> it's the same as `(FTUInt)0` |
12:53:07 | shashlick | Ok so it is a cast |
12:53:14 | FromDiscord | <lqdev> yes |
12:53:37 | FromDiscord | <Clyybber> is the suggestion getting slower a nimsuggest issue? |
12:53:56 | shashlick | That must be a tree sitter bug since it treats it as a call, not a cast |
12:55:43 | FromDiscord | <lqdev> @Clyybber likely it's more due to the lack of incremental compilation. at this point, compile times for me are reeeeeeeally long and it's starting to become quite a pain |
12:56:14 | FromDiscord | <lqdev> but if nimsuggest doesn't depend on the compiler (which I doubt), then it might be nimsuggest's own issue |
12:56:28 | * | nikita` joined #nim |
12:56:37 | FromDiscord | <Clyybber> ok, so its likely not a vim/vscode issue |
12:56:51 | FromDiscord | <Clyybber> are you using nimterop? |
12:57:06 | FromDiscord | <Clyybber> doesn't nimterop have a relatively big impact on compile times? |
12:57:36 | FromDiscord | <lqdev> it does, but I'm not using nimterop |
12:58:00 | shashlick | Nimterop has an effect since I need regex and it imports a bunch of stuff |
12:58:16 | shashlick | Every additional module or file adds a lot of base time to compile or check |
12:58:39 | shashlick | I did try optimizing quite a bit but no control over that |
12:58:41 | FromDiscord | <lqdev> yeah |
12:58:51 | FromDiscord | <lqdev> as I said, it's all because we don't have IC yet |
13:00:42 | shashlick | Also now cimport includes a file instead of parsing the code as a string so it should be marginally faster - Nim would know that the cached code file hasn't changed |
13:02:03 | shashlick | If not specified, the file is in cache, else it gets generated where you want |
13:14:22 | FromDiscord | <Shucks> So I made some changes on the settings. Seems like its faster now: https://paste.sh/yMD8NTRb#_RzSG4befG9IyS8ZWDkTeelT |
13:27:43 | * | nikita` quit (*.net *.split) |
13:27:43 | * | Vladar quit (*.net *.split) |
13:27:44 | * | casaca quit (*.net *.split) |
13:27:45 | * | FromDiscord quit (*.net *.split) |
13:27:45 | * | FromGitter quit (*.net *.split) |
13:27:56 | * | def- quit (*.net *.split) |
13:28:09 | * | nikita` joined #nim |
13:28:09 | * | Vladar joined #nim |
13:28:09 | * | casaca joined #nim |
13:28:09 | * | FromDiscord joined #nim |
13:28:09 | * | FromGitter joined #nim |
13:28:09 | * | def- joined #nim |
13:28:23 | FromDiscord | <--HA--> Is there a way to have the field names of an object type available in a statically checkable way? Not sure if I put my question very well. In this example https://play.nim-lang.org/#ix=2rx0 I would like to have the strings "fieldA" and "fieldC" as something that can be checked by the compiler. Like if I had an Enum of all the fields. |
13:28:37 | FromDiscord | <--HA--> I could of course make that enum but I was wondering if there was a better way and without duplication |
13:28:37 | FromDiscord | <Yardanico> you can use macros |
13:28:43 | FromDiscord | <Yardanico> wait, what do you want exactly? |
13:28:54 | FromDiscord | <Yardanico> " field names of an object type available in a statically checkable way" - you can check them in macros |
13:29:23 | FromDiscord | <--HA--> In that examle code not accidentaly type fieldX and that is not a valid field name |
13:31:47 | FromDiscord | <mratsim> @--HA-- use "when" instead of if in your example and put {.error: "Invalid field name".} for the conditional that you don't want to compile |
13:32:30 | FromDiscord | <mratsim> https://play.nim-lang.org/#ix=2rx1 |
13:33:00 | FromDiscord | <mratsim> or maybe I misunderstood? |
13:33:23 | FromDiscord | <mratsim> in anycase if you type the wrong field, the compiler will prevent compilation |
13:33:40 | FromDiscord | <mratsim> you'll get undeclared field/identifier |
13:34:00 | FromDiscord | <--HA--> Interesting. Yes, so if I type a wrong field name string it does not compile was my goal. |
13:34:18 | FromDiscord | <mratsim> Any typed language does that |
13:35:50 | FromDiscord | <lqdev> ah, the XY problem |
13:35:52 | FromDiscord | <lqdev> my favorite |
13:37:31 | FromDiscord | <--HA--> Hm no, your example is not what I thought it was. I'm finding it difficult to formulate my question. Especially since I notice now my example is a bad one, too. Basically I want to be able to type a few field names in an array (or whatever) and be sure those are existing names for the object I want to use them on. |
13:39:25 | FromDiscord | <lqdev> concepts? |
13:39:55 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2rx4 |
13:42:11 | FromDiscord | <--HA--> Maybe I don't even need to worry about it if the first part I thought was possible can not be done. Is there a way to do this? https://play.nim-lang.org/#ix=2rx5 |
13:43:32 | FromDiscord | <lqdev> no, because Nim is not dynamically typed. |
13:43:38 | FromDiscord | <lqdev> what are you *really* trying to do? |
13:44:30 | FromDiscord | <Yardanico> @lqdev well technically it is possible with some macro and enum magic, but yeah, I think it shouldn't be done this way |
13:44:31 | FromDiscord | <mratsim> well technically you can |
13:44:53 | FromDiscord | <lqdev> @Yardanico as I said, this sounds like the XY problem |
13:44:55 | FromDiscord | <Yardanico> yeah |
13:45:07 | FromDiscord | <mratsim> for example: https://github.com/status-im/nim-cookbook/blob/master/dynamic_approximating_dynamic_types.nim |
13:46:42 | * | RaycatWhoDat joined #nim |
13:47:01 | FromDiscord | <mratsim> in any case, unless you get more experimented in Nim or in your domain, what you are trying to do is probably wrong |
13:47:31 | FromDiscord | <mratsim> i.e. you wouldn't be able to do that in statically typed languages (C, C++, Rust, Go, Java, ...) |
13:47:49 | RaycatWhoDat | Does anyone here know how one could make a variadic zip function? |
13:48:02 | FromDiscord | <mratsim> yes |
13:48:27 | FromDiscord | <mratsim> You use: https://github.com/numforge/loop-fusion↵or https://github.com/zero-functional/zero-functional |
13:48:56 | RaycatWhoDat | Oh, sweet. Thanks! |
13:49:34 | shashlick | @Yardanico did you get my message from yesterday |
13:49:43 | FromDiscord | <Yardanico> about your updated wrapper? yeah |
13:49:51 | shashlick | Ok cool |
13:51:23 | shashlick | Any other findings? What other gui libs need updated wrappers? |
13:53:23 | FromDiscord | <lqdev> I wonder how Nim does overload resolution, given default parameters and that we can just swap them around as much as we want |
13:53:32 | FromDiscord | <lqdev> like, the algorithm |
13:55:58 | FromDiscord | <--HA--> Yeah maybe I just have to do it differently in nim. I'm used to ruby. What I want to do is run the same code on a number of fields but I don't want to type out doStuff(obj.fieldA), doStuff(obj.fieldB),and so on but rather iterate over a list of fields and ideally at the same time make sure that list has only valid field names |
14:04:42 | FromDiscord | <haxscramper> You can use `fieldPairs` to iterate over all fields in object/tuple at runtime. https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CT To get fields from type at *compile-time* (i.e iterate over all fields in type definition) you can use `typed` macro (something like this: https://play.nim-lang.org/#ix=2rxb ) |
14:06:06 | * | abm quit (Ping timeout: 256 seconds) |
14:06:53 | FromDiscord | <--HA--> Imagine the type had 30 fields and I wanted to do something on maybe 10 of those but not type out all the code repeatedly. Like this https://play.nim-lang.org/#ix=2rx5↵The fieldPairs approach works but then I get no checking of my field names, which would be ok, I just thought there might be a relativly simple solution to that I was missing |
14:07:25 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:07:37 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2rxd |
14:07:38 | * | Kaivo joined #nim |
14:07:51 | * | fredrikhr joined #nim |
14:08:21 | FromDiscord | <lqdev> you might be able to create a macro for what you need |
14:16:25 | FromDiscord | <--HA--> Thanks everyone. I'll check it out |
14:17:00 | FromGitter | <bung87> I use RSeq, it only track resize there's track pragma attach to item render proc still not rerender the item |
14:22:50 | * | fredrikhr quit (Read error: Connection reset by peer) |
14:23:18 | * | fredrikhr joined #nim |
14:27:57 | FromDiscord | <Yardanico> are =sink and = hooks available for refc? |
14:29:31 | * | lritter joined #nim |
14:31:18 | FromDiscord | <Yardanico> or maybe I did something wrong |
14:32:04 | FromDiscord | <Yardanico> if I have a value like "let a = newValue(5)" and it has custom =destroy, =sink and =, and I do "let a2 = a", will = be called? |
14:32:15 | FromDiscord | <Yardanico> so I can copy the underlying value with sciter's API |
14:32:21 | FromDiscord | <Yardanico> and have copy semantics for values |
14:33:35 | FromDiscord | <Yardanico> right now if I do "let a2 = a" `=` is not called and when printing it's the same exact value |
14:34:21 | FromGitter | <alehander92> oh man |
14:34:30 | FromGitter | <alehander92> i had an interview and i forgot what typeclasses are |
14:34:37 | FromGitter | <alehander92> now i am not even sure i know it |
14:35:31 | FromGitter | <alehander92> ah constraints |
14:35:46 | FromGitter | <alehander92> what's new in nim yardanico |
14:36:18 | FromDiscord | <Recruit_main707> new T: ref T |
14:36:24 | FromDiscord | <Recruit_main707> afaik |
14:36:31 | FromDiscord | <Yardanico> @alehander92 arc optimizer PR |
14:36:51 | FromDiscord | <Recruit_main707> Took that too literally XD |
14:38:28 | FromDiscord | <Yardanico> isn't that sexy |
14:38:32 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rxn |
14:38:38 | FromDiscord | <lqdev> no |
14:38:45 | FromDiscord | <Yardanico> 😦 |
14:38:55 | FromDiscord | <lqdev> > x.impl.isNil() |
14:38:57 | FromDiscord | <lqdev> what is this |
14:39:01 | FromDiscord | <Yardanico> ? |
14:39:01 | FromDiscord | <lqdev> just `x.impl != nil` |
14:39:04 | FromDiscord | <Yardanico> no |
14:39:09 | FromDiscord | <Yardanico> isn't isNil better? |
14:39:13 | FromDiscord | <lqdev> no |
14:39:16 | FromDiscord | <Yardanico> why? |
14:39:23 | FromDiscord | <lqdev> the above gets rewritten to it |
14:39:25 | FromDiscord | <Yardanico> I think .isNil is recommended over nil |
14:39:32 | FromDiscord | <lqdev> and there isn't an `.isntNil` |
14:39:33 | FromDiscord | <Clyybber> doesn't matter |
14:39:54 | disruptek | it could be better if non-nil refs get impl. |
14:40:39 | FromDiscord | <Clyybber> I think it used to be that way |
14:40:47 | FromDiscord | <Clyybber> but since its better to just take the plunge (and now we did) |
14:40:52 | FromDiscord | <Clyybber> it got removed |
14:41:04 | bung | isNil is not prefered |
14:41:10 | FromDiscord | <Clyybber> So, yeah isNil isn't really any better than != nil |
14:41:28 | FromDiscord | <lqdev> honestly, all this arc business doesn't matter much to me. all i want to make me happy is incremental compilation |
14:41:34 | FromDiscord | <lqdev> which, afaik, is on hold. |
14:41:36 | FromDiscord | <lqdev> damn. |
14:41:52 | FromDiscord | <Yardanico> hmm, I read somewhere that isNil was preferred. |
14:41:54 | FromDiscord | <Yardanico> weird |
14:41:58 | bung | the main resaon I guess is it introduce more bultin proc |
14:42:02 | disruptek | i prefer isNil. |
14:42:17 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rxo |
14:42:24 | FromDiscord | <Yardanico> seems to work now |
14:42:28 | FromDiscord | <Clyybber> @Yardanico Probably during the 0.18 times |
14:42:32 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rxp |
14:42:49 | FromDiscord | <Clyybber> but nowadays there is not difference. Although maybe isNil is better for drNim |
14:43:36 | Oddmonger | when i create a string seq with : var se = new_seq[string](1] , it creates a seq with typeof TaintedString |
14:44:06 | Oddmonger | var se = @["toto"] would create a seq of strings |
14:44:21 | FromDiscord | <lqdev> iirc `!= nil` didn't use to work back in 0.19.0, but I may be wrong. |
14:44:21 | FromDiscord | <Yardanico> uh no |
14:44:29 | FromDiscord | <Yardanico> it will only create TaintedString if you have tainted mode on |
14:44:34 | FromDiscord | <Yardanico> I think it's mostly abandoned nowadays |
14:45:24 | Oddmonger | if i have well understood, TaintedString has to be casted to string , for using as a string parameter ? |
14:45:49 | FromDiscord | <Clyybber> not casted, but converted |
14:45:57 | FromDiscord | <Clyybber> and only in taintedstring mode |
14:46:45 | Oddmonger | hummm ok , for now i will stick to @[…] notation |
14:47:01 | bung | any recommanded karax project? or I should give up try to use it |
14:47:24 | Oddmonger | i'm doing my tests with inim, maybe it would be different with the compiler |
14:48:25 | FromDiscord | <Yardanico> @Bung not sure what you mean 😛 |
14:50:08 | bung | Yardanico ah, I feel failure while using karax, it always suprised me, no framework like it, I have experience of backbone,angular,vue,react |
14:51:13 | bung | so am wonder if there is complete open source project use karax, so I can find something |
14:51:42 | FromDiscord | <Yardanico> nim forum |
14:51:50 | FromDiscord | <Yardanico> https://github.com/nim-lang/nimforum |
14:53:37 | bung | oh, thanks! didnot know it use karax |
14:55:10 | FromDiscord | <Yardanico> seems like my hooks work fine for sciter's values now |
14:55:20 | FromDiscord | <Yardanico> and they allow for proper copy semantics which is intuitive for primitive values |
14:55:35 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/732248863422808084/unknown.png |
14:56:35 | FromDiscord | <exelotl> eh I don't really like isNil either... if it's different than `x == nil` then something is very wrong, but if it's the same as `x == nil` then what's the point :P |
15:02:54 | FromGitter | <oskca> @phillvancejr hi, have you fond a way to subclass a C++ object to interact with wxWidgets? |
15:03:26 | FromDiscord | <abisxir> Hi everyone, I was looking to understand something about destructors but could not find a proper explanation.↵Unfortunately the documentation about nim is not rich yet, can I ask my question here or I should write it somewhere else? |
15:05:43 | FromDiscord | <exelotl> @abisxir ask away! (though I personally won't be able to answer much lol) |
15:06:06 | FromDiscord | <abisxir> Cool @exelotl |
15:07:11 | FromGitter | <oskca> hi, @Araq, I'm using wxnim recently, it's great, but I havn't found a way to subclass wxWidget c++ class to handle some event like `wxDropTraget`, object of wxDropTarget doesn't work |
15:10:13 | FromDiscord | <abisxir> sent a long message, see http://ix.io/2rxu |
15:10:28 | FromDiscord | <Yardanico> @oskca are you using araq's wxnim or pmunch's wxnim? |
15:10:35 | FromDiscord | <Yardanico> pmunch's wxnim is more updated |
15:10:39 | FromDiscord | <Yardanico> https://github.com/pmunch/wxnim |
15:10:46 | FromDiscord | <Yardanico> @abisxir well you can do it certainly |
15:11:06 | FromDiscord | <abisxir> I know that if A = object, it I could write `=destroy` hook but what about ref objects? |
15:11:20 | FromDiscord | <abisxir> (edit) removed 'it' |
15:11:26 | FromGitter | <oskca> @Yardanico I'm using pmunch's wxnim |
15:11:56 | FromGitter | <oskca> and found it really good to gui work with `genui` macro |
15:12:04 | FromDiscord | <Yardanico> @abisxir you can have AObj = object ... A = ref AObj |
15:12:08 | FromDiscord | <Yardanico> and set a destroy hook for AObj |
15:12:36 | FromDiscord | <abisxir> I checked it, never reaches that point. |
15:12:51 | FromGitter | <oskca> but it seems there's is noway to subclass a c++ object and export back it to c++ world |
15:12:53 | FromDiscord | <Yardanico> it does, maybe not with default GC since it might not have time to collect |
15:12:58 | FromDiscord | <Yardanico> lemme show you an example |
15:13:38 | FromDiscord | <abisxir> In this example, it just call destructor for obj type never for ref type: |
15:13:43 | FromDiscord | <abisxir> sent a long message, see http://ix.io/2rxx |
15:14:28 | FromDiscord | <Yardanico> well refc destroy hooks might not be instant, I don't exactly know |
15:14:32 | FromDiscord | <Yardanico> with arc your example works as expected |
15:15:12 | FromDiscord | <abisxir> Hummm, can you show your example? @Yardanico |
15:15:24 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2rxA |
15:15:25 | FromDiscord | <Yardanico> with arc it works correctly |
15:15:51 | FromDiscord | <abisxir> arc is compiler option? |
15:16:12 | * | maier quit (Ping timeout: 265 seconds) |
15:16:50 | FromDiscord | <Yardanico> --gc:arc |
15:17:13 | FromDiscord | <Shucks> Arc is a new (?) garbage collector. With that said I want to mention that I don't get any of my stuff running with arc. Is there some documentation what I have to watch out for using arc? |
15:17:20 | FromDiscord | <Yardanico> it's not a GC, but yes |
15:17:24 | FromDiscord | <Yardanico> it's a new memory management model |
15:17:45 | FromDiscord | <Yardanico> @Shucks well first of all, for latest arc fixes you should be at least on 1.2.4, and documentation - well, not really |
15:17:52 | FromDiscord | <Yardanico> but some casts valid with refc are not valid with arc |
15:18:02 | FromDiscord | <Yardanico> (because they're not correct in nim at all, but refc allows them) |
15:18:32 | FromDiscord | <Shucks> Im on 1.2.4 but I guess didn't tried it again with 1.2.4. Gonna check it out |
15:18:41 | FromDiscord | <Yardanico> well you should show your error logs and stuff 😛 |
15:19:17 | FromDiscord | <Shucks> Yea well i'm into that internal game hacking stuff. Debugging a injected dll is still a pain =/ |
15:19:29 | FromDiscord | <abisxir> @Yardanico it works 🙂 |
15:19:42 | FromDiscord | <Yardanico> @abisxir arc is still in a beta state though, so not all libraries work with it |
15:21:07 | FromDiscord | <abisxir> @Yardanico Good to know, however I do not use at the moment for production so I can play around, thanks. |
15:23:25 | FromDiscord | <gingerBill> Minor question. With Nim's Channel type, is there a way to do a nondeterminstic choice on multiple channels built-in e.g. Go's select statement? |
15:23:54 | FromDiscord | <lqdev> what does the select statement do? |
15:23:57 | FromDiscord | <exelotl> @abisxir if you want to learn more about arc, araq did a good talk on it for NimConf last month: https://www.youtube.com/watch?v=aUJcYTnPWCg |
15:25:57 | FromDiscord | <gingerBill> Go's select statement (non deterministic choice in CSP speak) allows you to wait on multiple channel operations |
15:26:38 | FromDiscord | <abisxir> @exelotl Cool 🙂 |
15:27:20 | FromDiscord | <Anuke> Is there some way to cross-compile from Linux->Windows with nimterop? Looking at the nimterop's `shell.nim`, there are multiple chunks of code with `when defined(Windows):` that run when I'm using mingw as my compiler (`--gcc.exe:x86_64-w64-mingw32-gcc`), leading to use of `cmd` (which fails). It also uses backwards slashes in the paths when executing.↵↵Context: I'm trying to compile the soloud wrapper. My code works on Linux. |
15:28:16 | FromDiscord | <Recruit_main707> maybe you can do -d:linux, i am not sure at all though |
15:28:37 | FromDiscord | <lqdev> @Anuke no, that's not supported. |
15:28:38 | FromDiscord | <Yardanico> @Anuke i mean if you're cross-compiling you should always do --os:windows |
15:28:46 | FromDiscord | <Yardanico> not sure if nimterop supports it though |
15:28:48 | FromDiscord | <lqdev> @Yardanico the problem is nimterop |
15:29:21 | FromDiscord | <lqdev> nimterop has some issues when dealing with windows, because it can't detect the OS the program is being built on |
15:29:33 | FromDiscord | <Anuke> I do use `--os:windows`, and it compiles/runs when I'm not using nimterop |
15:29:51 | FromDiscord | <lqdev> ping shashlick |
15:30:11 | FromDiscord | <lqdev> ↑ he can explain the situation better to you |
15:33:35 | Araq | gingerBill: you can tryRecv or peek but it's a crude mechanism |
15:33:37 | shashlick | this is a nim issue - I can hack around it but it is problematic |
15:33:53 | Araq | shashlick, ha, we'll see about that :P |
15:33:56 | shashlick | as soon as you set --os:windows, every when defined goes down the windows route |
15:34:03 | shashlick | so anything compile time won't work |
15:34:22 | shashlick | there's no concept of build os vs target os |
15:34:51 | FromDiscord | <Anuke> Could I generate the wrapper file, then import that file instead of running nimterop every time? |
15:35:15 | shashlick | yes that's supported now |
15:35:17 | shashlick | might still be bugs but that's the aspiration |
15:35:17 | FromDiscord | <lqdev> yes, you can pass an extra `nimFile` argument to cImport |
15:35:40 | * | NimBot joined #nim |
15:35:46 | Araq | shashlick, there is nimscript.buildOS |
15:35:47 | bung | oh I got the point, I can use runDiff directly |
15:36:08 | shashlick | but i'm in the VM, not in nimscript |
15:36:18 | shashlick | anyway, i cannot use any of the stdlib then |
15:36:32 | FromDiscord | <Clyybber> @gingerBill Theres a prototype to do the CSP transformations as a macro |
15:36:34 | shashlick | echo DirSep will print '\' on linux |
15:37:13 | Araq | well you said --os:windows, what else should it do |
15:37:39 | FromDiscord | <gingerBill> @Clyybber whereabouts? |
15:38:18 | FromDiscord | <Clyybber> https://github.com/zevv/nimcsp but its not finished afaik |
15:38:19 | FromDiscord | <lqdev> @Yardanico there's a thing for you to fix in ircord: you don't escape \ when bridging from IRC to Discord |
15:38:33 | FromDiscord | <Yardanico> should I? |
15:38:41 | FromDiscord | <Yardanico> i don't really handle markdown at all currently |
15:38:45 | FromDiscord | <lqdev> um, yes? https://media.discordapp.net/attachments/371759389889003532/732259724946571375/unknown.png |
15:39:40 | disruptek | gingerBill: my fork is a little more advanced. |
15:40:09 | disruptek | but this is cps, not csp. |
15:40:16 | Araq | lol |
15:40:24 | disruptek | it's a completely different animal. |
15:40:53 | shashlick | --os:windows is the target |
15:41:14 | shashlick | The premise of os is cross compilation |
15:41:35 | shashlick | Why should it affect compile time |
15:41:53 | disruptek | when else should cross compilation occur? |
15:42:27 | shashlick | The vm is on the build os and should not get affected by os:windows which is meant for the code gen |
15:43:05 | Araq | const DirSep = when defined(windows): '\\' else: '/' |
15:43:15 | Araq | it's not VM related |
15:43:33 | disruptek | shashlick: make a pr to perform compilation without the vm. |
15:43:34 | Araq | echo DirSep # --os:windows, should produce '\\' |
15:43:45 | shashlick | Yes but when you call dirsep in the vm it should know its still on Linux |
15:43:47 | disruptek | the vm is dead code anyway. |
15:44:03 | Araq | disruptek, it's not (yet) |
15:44:14 | disruptek | oh right. |
15:44:29 | FromGitter | <alehander92> Recruit haha |
15:44:36 | FromGitter | <alehander92> what happens to the vm |
15:44:49 | Araq | shashlick, the problem is real but the solution cannot be that everybody has to be constantly reminded of the fact that 'when defined' needs special casing for cross compiling |
15:44:54 | disruptek | what happens in the vm stays in the vm. |
15:45:05 | FromGitter | <alehander92> i missed that |
15:45:08 | FromGitter | <alehander92> i am writing C these days |
15:45:29 | shashlick | If the vm ignores --os, it will just work |
15:45:30 | disruptek | you really forgot what a typeclass is? |
15:45:38 | FromGitter | <alehander92> i think |
15:45:38 | FromDiscord | <gingerBill> Thank you |
15:45:43 | disruptek | yeesh, dude we need you writing more nim. |
15:45:44 | FromGitter | <alehander92> i never really knew what it is |
15:45:45 | shashlick | Nothing ends users need to do, or even the stdlib |
15:45:59 | FromGitter | <alehander92> i mean, except some kind of intuitive-based overall impression |
15:46:15 | FromGitter | <alehander92> now i feel it's a collection of constraints? |
15:46:26 | disruptek | dude, it's hardly even a thing. |
15:46:34 | FromGitter | <alehander92> i even read it's doing ad hoc polymorphism |
15:46:35 | disruptek | it's just an `or`. |
15:46:49 | FromGitter | <alehander92> it was like something like a haskell interview |
15:46:55 | disruptek | it's as simple as it looks in your editor. |
15:47:02 | disruptek | funny, that. |
15:47:40 | FromDiscord | <Clyybber> I think the typeclasses he meant are more like concepts in nim |
15:47:52 | FromDiscord | <Clyybber> as in a set of properties that define a typeclass |
15:48:03 | disruptek | in haskell, sure. |
15:48:15 | FromDiscord | <Clyybber> its equivalent to the concept of a class in mathematics as opposed to a set |
15:48:20 | FromGitter | <alehander92> yeah i was trying to explain that a typeclass is like a group of predicates |
15:48:21 | FromGitter | <alehander92> on types |
15:48:26 | FromDiscord | <Clyybber> yeah, thats correct |
15:48:30 | disruptek | sounds fine to me. |
15:48:31 | FromGitter | <alehander92> but i feel they were looking at me funny |
15:48:35 | Araq | shashlick, as I said, DirSep is a const and the VM isn't even involved |
15:48:37 | FromGitter | <alehander92> no, they were cool |
15:48:45 | FromGitter | <alehander92> they didn't even ask me about monads |
15:48:46 | FromDiscord | <Anuke> After un-including the nimterop generator file and copying the generated `nimFile` into my project, I get linker errors after building, e.g. `undefined reference to `Soloud_init'`. This is on Linux, no cross-compilation. Do I need to give it some additional pragmas that aren't included in the generated file? |
15:49:09 | FromGitter | <alehander92> i talked to them about nim a bit` |
15:49:19 | FromGitter | <alehander92> they were like what are its strongest points |
15:49:25 | FromGitter | <alehander92> and i started with the type system |
15:49:30 | shashlick | Araq: I won't claim to understand the details, just the symptoms which you understand |
15:49:50 | FromGitter | <alehander92> like advertising bmw engines to airplane people |
15:50:15 | shashlick | given how powerful the vm is, i'd like to use it in the cross-compilation scenario |
15:50:17 | FromGitter | <alehander92> but i think the z3 thing usually picks up a bit of interest |
15:50:25 | FromGitter | <alehander92> z3<->nim* |
15:50:29 | shashlick | but i'm also moving more of nimterop into runtime so that I don't have to keep fighting the vm |
15:50:45 | shashlick | Anuke: what does your wrapper and generated output look like |
15:51:50 | FromDiscord | <Anuke> nimterop code: https://play.nim-lang.org/#ix=2rxE |
15:52:29 | FromDiscord | <Anuke> generated code: https://play.nim-lang.org/#ix=2rxI |
15:53:04 | shashlick | Anuke: cCompile and getHeader doesn't get forwarded to nimFile |
15:53:21 | shashlick | lines 26 - 46 |
15:53:30 | shashlick | that's still an open for standalone wrappers |
15:56:22 | FromDiscord | <Anuke> I see |
15:58:49 | FromDiscord | <Anuke> It compiles on linux again, but on mingw `cCompile` calls `shell -> execAction`, which leads to me to the same problem |
16:03:04 | FromDiscord | <Yardanico> @shashlick seems like I found pure-C sciter headers |
16:03:09 | FromDiscord | <Yardanico> https://github.com/sciter-sdk/go-sciter/tree/master/include in here |
16:03:21 | FromDiscord | <Yardanico> "This binding ueses a tailored version of the sciter C Headers, which lives in directory: include. The included c headers are a modified version of the sciter-sdk standard headers." |
16:05:33 | shashlick | special stuff for Go, no fair |
16:05:41 | shashlick | Anuke: let me see |
16:05:56 | FromDiscord | <Yardanico> @shashlick well that person did go bindings from the C headers too |
16:06:04 | FromDiscord | <Yardanico> I will try to use their headers, just so we have less hassle |
16:07:57 | shashlick | Anuke: looks like cCompile doesn't use walkDir - back when it was implemented, that wasn't allowed in the VM |
16:08:11 | shashlick | so had to spawn to shell |
16:08:26 | * | narimiran quit (Ping timeout: 256 seconds) |
16:08:45 | shashlick | regardless, more of the same - walkDir might not work as expected in cross-compilation scenario |
16:09:46 | shashlick | are you still trying to cross compile |
16:10:05 | shashlick | @Yardanico - is everything accessible |
16:10:14 | FromDiscord | <Yardanico> well wdym? |
16:10:44 | shashlick | are all procs still available or only a subset |
16:13:07 | FromDiscord | <Yardanico> well it seems to even work without --noHeader with a bit of manual fixes |
16:13:27 | FromDiscord | <Yardanico> although I think I'll still use --noHeader because otherwise it's a bit pointless |
16:13:36 | FromDiscord | <Yardanico> since I only will use sciter as a library since I don't have access to it's source code 🙂 |
16:14:03 | FromDiscord | <Yardanico> and the go-sciter header version is a bit outdated |
16:14:45 | shashlick | about `noHeader` - While `{.header.}` can be omitted for convenience, it does prevent wrapping of `static inline` functions as well as type checking of the wrapper ABI with `-d:checkAbi` at compile time. |
16:14:53 | shashlick | Further, anonymous nested structs/unions within unions will be rendered incorrectly by Nim since it is unaware of the true memory structure of the type. The user will need to choose based on the library in question. |
16:15:31 | disruptek | shashlick: you sound like your README. |
16:15:42 | FromDiscord | <Anuke> Even when I replace some of the `defined(...)` values with `true/false`, I still run into problems (probably caused by the different path separator). I might try a different sound library, or get a separate build server for this |
16:15:42 | shashlick | I just channeled the readme 😄 |
16:15:59 | FromDiscord | <Yardanico> @shashlick well yeah, but as I said for me using the header version makes to sense |
16:16:00 | shashlick | Anuke: do you have to cross-compile? |
16:16:23 | shashlick | just highlighting the cons Y, hard lessons let's say |
16:16:33 | FromDiscord | <Yardanico> "loading" sciter APIs is really simple |
16:17:00 | FromDiscord | <Anuke> I don't *have* to, but it's convenient to just run one command on my main machine and have all the binaries built for distribution |
16:17:03 | FromDiscord | <Yardanico> you just load the dll, find the SciterAPI symbol, cast it to a SciterAPI_ptr type and call that as a procedure |
16:17:08 | FromDiscord | <Anuke> (and it's worked until now) |
16:17:11 | FromDiscord | <Yardanico> and you get a pointer to a struct with all functions |
16:17:15 | FromDiscord | <Yardanico> like an interface |
16:18:15 | shashlick | Anuke: making cross-compilation work is a big effort so I won't commit to that right now, but let's say i'll remove the cCompile dep on execAction and make sure cCompile and cDefine gets rendered in the generated wrapper |
16:19:52 | FromDiscord | <Anuke> Alright, thanks |
16:19:55 | FromDiscord | <Yardanico> btw @shashlick, I don't think your wchar_t thing is right for the C backend |
16:20:07 | FromDiscord | <Yardanico> maybe you wanted to do when not defined(cpp) ? |
16:20:34 | FromDiscord | <Yardanico> wchar_t with importc just works for me |
16:21:02 | * | Trustable joined #nim |
16:21:12 | FromDiscord | <Yardanico> with both clang/gcc, although I'm not sure when they got that support for using "wchar_t" in C |
16:21:57 | shashlick | that was from timothee, not sure on details |
16:21:58 | FromDiscord | <Yardanico> ah actually in C it's in stddef.h |
16:22:09 | FromDiscord | <Yardanico> type wchar_t* {.importc.} = object works for me with C backend |
16:22:09 | shashlick | is it wrong? https://github.com/nimterop/nimterop/blob/master/nimterop/toastlib/getters.nim#L136 |
16:22:19 | FromDiscord | <Yardanico> yeah, seems so |
16:22:20 | FromDiscord | <Yardanico> for the C backend |
16:22:34 | FromDiscord | <Yardanico> see e.g. https://pubs.opengroup.org/onlinepubs/7908799/xsh/stddef.h.html |
16:22:37 | FromDiscord | <Yardanico> or https://www.tutorialspoint.com/c_standard_library/stddef_h.htm |
16:22:51 | FromDiscord | <Yardanico> stddef.h defines wchar_t in the C library |
16:23:23 | FromDiscord | <Yardanico> or https://en.wikibooks.org/wiki/C_Programming/stddef.h#Type_wchar_t |
16:24:18 | FromDiscord | <Yardanico> so basically in "else" you would want to replace header with "stddef.h" |
16:24:28 | FromDiscord | <Yardanico> since that else is for other backends than cpp |
16:24:28 | shashlick | hopefully @timotheecour can respond to that |
16:24:33 | shashlick | else appreciate a PR |
16:25:28 | shashlick | just changing to stddef.h in else? that's easy enough |
16:25:42 | FromDiscord | <Yardanico> yeah |
16:25:53 | FromDiscord | <Yardanico> type wchar_t* {.importc, header: "stddef.h".} = objec |
16:25:59 | FromDiscord | <Yardanico> t |
16:26:36 | shashlick | Ok I'll take care of it |
16:35:15 | FromDiscord | <Yardanico> what's the proper way to pass a Nim procedure to a C API function that expects a pointer to a procedure? |
16:35:31 | FromDiscord | <Yardanico> just cast the proc like cast[ptr CProcType](myNimProc) ? |
16:36:33 | FromDiscord | <Yardanico> because I'm trying to compile it with cpp backend (just for fun), and I'm getting for example |
16:36:38 | FromDiscord | <Yardanico> error: cannot initialize a parameter of type 'tyProc__H5cILfOL8wUwLVLz7ePbLQ *' (aka 'bool (**)(void *, void *)') with an lvalue of type 'bool (void *, void *)' |
16:37:23 | FromDiscord | <Yardanico> where I'm doing cast[ptr SciterElementCallback](elemFoundCb) and the C API function is proc SciterSelectElements*(he: HELEMENT; CSS_selectors: LPCSTR; callback: ptr SciterElementCallback; param: LPVOID): INT {.importc, cdecl.} |
16:37:49 | * | ForumUpdaterBot quit (Remote host closed the connection) |
16:37:57 | * | ForumUpdaterBot joined #nim |
16:43:00 | FromDiscord | <dom96> Why do you need to cast? |
16:43:12 | FromDiscord | <dom96> You should be able to give the proc the signature that is needed |
16:43:50 | FromDiscord | <Yardanico> well I'm using nimterop |
16:43:55 | FromDiscord | <treeform> hmm I am getting this error can I changed nothing? `io.nim(342): error C2664: 'BOOL SetHandleInformation(HANDLE,DWORD,DWORD)': cannot convert argument 1 from 'int' to 'HANDLE'` I did not install new nim, I did not install new VC++, but now I am getting strange cast error? |
16:44:00 | FromDiscord | <Yardanico> so, for context |
16:44:02 | FromDiscord | <Yardanico> typedef BOOL SC_CALLBACK SciterElementCallback( HELEMENT he, LPVOID param ); |
16:44:09 | FromDiscord | <Yardanico> SCDOM_RESULT SCFN( SciterSelectElements)(HELEMENT he, LPCSTR CSS_selectors, SciterElementCallback* callback, LPVOID param); |
16:44:32 | FromDiscord | <treeform> Can a windows update break Nim? |
16:44:32 | FromDiscord | <dom96> using nimterop shouldn't change anything |
16:44:35 | FromDiscord | <Yardanico> for that nimterop makes SciterSelectElements*: proc (he: HELEMENT; CSS_selectors: LPCSTR; callback: ptr SciterElementCallback; param: LPVOID): INT {.cdecl.} |
16:44:39 | FromDiscord | <Yardanico> see ptr here |
16:45:09 | FromDiscord | <dom96> > Can a windows update break Nim?↵@treeform are you using vcc? I guess that might have been updated using Windows Update? |
16:46:41 | FromDiscord | <dom96> @Yardanico have a look at some mature wrappers/libraries and see how they pass callbacks |
16:47:06 | FromDiscord | <KrispPurg> Is there a quicker way to get the first key from the table? |
16:47:23 | FromDiscord | <Yardanico> "first" key? |
16:47:28 | FromDiscord | <Yardanico> tables are not ordered |
16:47:32 | FromDiscord | <Yardanico> you need an OrderedTable for order |
16:49:04 | FromDiscord | <KrispPurg> well, besides the orderedtable |
16:49:30 | FromDiscord | <Yardanico> why? |
16:49:43 | * | waleee-cl joined #nim |
16:50:37 | FromDiscord | <Yardanico> @dom96 well the existing solutions are not really a reference to me because Sciter does something like an interface - it gives you a struct with pointers to its' functions |
16:51:27 | FromDiscord | <Yardanico> or maybe it's just because sciter does some double reference stuff and that's why it needs *, idk |
16:51:57 | Oddmonger | if i do: var a="toto" |
16:52:05 | bung | in karax can I run diff by vnode key ? otherwise it add all new items, I meant to reset |
16:52:08 | Oddmonger | var b=addr(a) |
16:52:18 | FromDiscord | <KrispPurg> Well, in order for me to insert a message to the table, if a limit to the table has reached then it will delete the first element then add it to the table |
16:52:20 | Oddmonger | how can i display the address ? |
16:52:34 | Oddmonger | i get template errors with echo b |
16:52:50 | FromDiscord | <treeform> @dom96 yes I am using VC++ does Windows Update update VC++? Can VC++ auto update? |
16:54:00 | FromDiscord | <dom96> No idea, I'm just speculating |
16:56:49 | FromDiscord | <Yardanico> @Oddmonger echo cast[uint](b) |
16:56:51 | FromDiscord | <Yardanico> for example |
16:56:56 | FromDiscord | <Yardanico> or "repr b" |
16:56:59 | FromDiscord | <Yardanico> should also work |
16:57:03 | FromDiscord | <Yardanico> echo repr b |
16:57:30 | Oddmonger | ahh thank you |
17:13:05 | FromDiscord | <Varriount> treeform: What behavior are you seeing? |
17:20:17 | * | endragor quit (Remote host closed the connection) |
17:20:45 | * | endragor joined #nim |
17:26:21 | FromDiscord | <Shucks> Woop woop code runs with arc |
17:26:25 | FromDiscord | <Clyybber> \o/ |
17:26:26 | Zevv | Clybber: it's not not finished, it even hasn't properly started |
17:26:34 | disruptek | rude. |
17:26:37 | FromDiscord | <Clyybber> But it does *something* right? |
17:26:49 | FromDiscord | <Shucks> I guess I really made some casts which don't have to be ;p |
17:27:28 | Zevv | Well, it's not like it's running or something. It does some of step 1-out-of-3 for the required transformations |
17:28:44 | FromDiscord | <Clyybber> Oh, I thought it already worked a bit |
17:29:10 | FromDiscord | <Clyybber> disruptek: How far did you continue it? |
17:29:57 | disruptek | about this far: --> <-- |
17:30:03 | FromDiscord | <Clyybber> nice |
17:30:04 | Zevv | He fixed some of step 1 |
17:30:24 | disruptek | well, i haven't pushed to zevv's branch recently. |
17:31:09 | * | endragor quit (Ping timeout: 272 seconds) |
17:31:20 | Zevv | there's no local lifting yet, and I'm not sure how nasty that will become. Ar4q mentioned something undocumented in the compiler, but I'm not sure if that can do the work for us at macro-time |
17:31:20 | disruptek | i'm noodling around trying to figure out how i want tests to work right now, because i started to get bogged down in optimizations. |
17:31:39 | Zevv | I don't have a holiday project yet, so I might or might not pick it up |
17:31:42 | Zevv | depends on how bored I get |
17:32:05 | disruptek | i will be working on local lifting today. |
17:32:09 | Zevv | \o/ |
17:32:09 | * | clemens3 quit (Read error: Connection reset by peer) |
17:32:12 | Zevv | dude |
17:32:31 | FromDiscord | <Clyybber> disruptek: NICE!!! |
17:32:40 | disruptek | ? |
17:32:52 | FromDiscord | <Clyybber> i'm hyped bro |
17:33:57 | Zevv | use that energy man, lift some locals! |
17:34:28 | * | clemens3 joined #nim |
17:34:31 | FromDiscord | <lqdev> someone said… LOCAL LIFTING? |
17:34:43 | FromDiscord | <Clyybber> I'm wrestling with scopes rn |
17:34:46 | Zevv | yeah, we could use some muscle! |
17:34:53 | FromDiscord | <Yardanico> i'm fishing with my hooks rn |
17:35:13 | disruptek | the control flow seems harder, honestly. |
17:35:21 | FromDiscord | <lqdev> #11274 please |
17:35:22 | disbot | https://github.com/nim-lang/Nim/issues/11274 -- 3Parameter default value equal to another parameter - works only from top level ; snippet at 12https://play.nim-lang.org/#ix=2r6J |
17:38:06 | FromDiscord | <Clyybber> @lqdev Hmm, interesting issue |
17:38:36 | FromDiscord | <Clyybber> I think we need to do some restrictions on default values |
17:38:42 | disruptek | Zevv: i think we've done 3 of 5 xfrms. |
17:38:47 | FromDiscord | <Clyybber> For example that they can only depend on other parameters left of them |
17:39:00 | FromDiscord | <lqdev> yeah, but that's what the example does. |
17:39:16 | Zevv | disruptek: of only bare bone control flow. no for loops, for example |
17:39:25 | Zevv | but fair enough, 3 out of 5 sounds about right |
17:39:29 | disruptek | i'm okay with that. |
17:39:34 | FromDiscord | <lqdev> also, nim devs - anyone working on IC? |
17:39:40 | disruptek | nope. |
17:39:42 | FromDiscord | <lqdev> or is it still on hold? |
17:39:46 | FromDiscord | <lqdev> damn |
17:40:35 | disruptek | the mangling branch solves some bugs in my ic branch, but the mangling branch doesn't work yet, either. |
17:40:45 | FromDiscord | <Clyybber> :p |
17:40:45 | disruptek | what can i say... i'm a terrible programmer. |
17:40:50 | FromDiscord | <Clyybber> nah |
17:41:16 | FromDiscord | <Clyybber> maybe you are just tackling the hard stuff |
17:41:22 | FromDiscord | <Clyybber> which is great |
17:41:54 | disruptek | the blocker for mangling is that we need to figure out how to resolve mangling between multiple modules that may/may-not be compiled yet. |
17:42:06 | disruptek | it's an annoying problem. |
17:42:09 | Araq | disruptek, please tell me more |
17:43:32 | disruptek | well, it feels like it should be sufficient to just fold two modules and get them to agree on a foreign symbol, but i had trouble making it work. |
17:44:19 | Araq | you mean because of the conflict resolution rule? |
17:44:34 | disruptek | i think modules have to have a hierarchy so that subsequent eval doesn't change a dominant symbol collision. |
17:44:43 | disruptek | yes, conflict resolution. |
17:44:55 | disruptek | we could use file index, for example. |
17:45:11 | Araq | you set s.loc.r = computeName(s.getModule, s) |
17:45:25 | Araq | s's module has the count table |
17:45:47 | Araq | you cannot produce the name without the BModule that 's' belongs to |
17:46:02 | Araq | (sorry if I'm stating the obvious) |
17:47:01 | disruptek | this is done. |
17:48:30 | Araq | well if you store the mangled name in s.loc.r consistency is ensured |
17:48:54 | * | rockcavera joined #nim |
17:51:02 | bung | `autocomplete(self.searchBox, onSelect,nref=autoRef);...;proc cb(httpStatus: int; response: cstring) = autoRef.choices.add(data[j].show.name)` |
17:52:00 | bung | what's problem with my code ? I want manage state out of the component |
17:52:47 | bung | it will only add one item, then ` at Array.HEX3Aanonymous_11925001 (app.js:3076)` |
17:52:49 | bung | at broadcast_11511313 (app.js:3329) |
17:53:11 | Araq | use the nativenodes.nim ideas for components |
17:53:20 | * | fredrikhr quit (Read error: Connection reset by peer) |
17:53:46 | * | fredrikhr joined #nim |
17:54:03 | Araq | everything else is unreliable and components are fundamentally at odds with DOM diffing |
17:55:43 | bung | oh , I check the code, very new to me , let me try it |
17:55:52 | disruptek | hmm, mangling branch is passing tests. |
17:57:47 | disruptek | ah, it fails stdlib/tmath.nim. |
17:59:17 | FromDiscord | <Clyybber> guddamn math |
17:59:46 | FromDiscord | <Clyybber> Aaah, finally got my PR to work |
18:03:14 | FromDiscord | <Yardanico> Pony is dying! |
18:03:21 | disruptek | give it water. |
18:04:24 | FromDiscord | <Clyybber> @Yardanico but less so now :D |
18:05:12 | FromDiscord | <Clyybber> optimized the temporary, now it doesn't have to die uninitialized |
18:07:52 | FromDiscord | <Yardanico> oh nice |
18:11:38 | disruptek | lqdev: if you want to pick up mangling, i'm happy to help. |
18:11:57 | disruptek | getting it merged would make ic a much smaller diff. |
18:13:52 | bung | Araq I cant't get the idea, I tried code like this https://play.nim-lang.org/#ix=2ryf |
18:16:40 | bung | I have a Carousel component ,since it just request initial data so I `runDiff(kxi,self.expanded,render(self))` just fine. |
18:17:11 | FromDiscord | <dom96> > Pony is dying!↵@Yardanico it is? |
18:17:21 | FromDiscord | <Yardanico> not anymore |
18:17:22 | FromDiscord | <Yardanico> but it was |
18:17:22 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/95938164f0609171893574370af9ebbe255be90d/tests/destructor/tmove_objconstr.nim#L50 |
18:17:38 | FromDiscord | <dom96> lol, I thought you meant the programming language |
18:17:52 | FromDiscord | <Clyybber> lol |
18:18:10 | bung | well with search result, it add newer items while I meat to reset |
18:21:12 | FromGitter | <alehander92> me too |
18:22:21 | Araq | bung, if you rebuild the list anyhow there is no point in dthunk vnodeToDom |
18:29:25 | * | opal quit (Remote host closed the connection) |
18:29:57 | * | clemens3 quit (Read error: Connection reset by peer) |
18:30:23 | bung | hmm , I use unsafe proc now ,proc runDiff*(self:AutocompleteComponent) = runDiff(kxi,list,myList(self)) |
18:30:39 | * | opal joined #nim |
18:32:51 | * | clemens3 joined #nim |
18:34:00 | * | endragor joined #nim |
18:35:15 | bung | hmm, now every thing as I expected as I manually runDiff to every changed node |
18:38:22 | * | maier joined #nim |
18:38:50 | * | endragor quit (Ping timeout: 256 seconds) |
18:39:54 | * | bung quit (Quit: Lost terminal) |
18:42:56 | * | xet7 joined #nim |
18:43:12 | FromDiscord | <Yardanico> guess I should split this over multiple lines 😄 |
18:43:14 | FromDiscord | <Yardanico> cast[ptr seq[tuple[key, value: SciterVal]]](param)[].add (SciterVal(impl: pkey), SciterVal(impl: pval)) |
18:47:55 | * | endragor joined #nim |
18:49:22 | FromDiscord | <Clyybber> Araq: https://github.com/nim-lang/Nim/pull/14964 is now ready :D |
18:49:23 | disbot | ➥ injectdestructors fixes and refactor |
18:50:37 | FromDiscord | <Yardanico> doesn't look pretty and I don't even know if what I'm doing is correct, but kinda works https://media.discordapp.net/attachments/371759389889003532/732308013997883474/unknown.png |
18:50:50 | FromDiscord | <Yardanico> I'm just not sure about threading with sciter |
18:50:55 | FromDiscord | <Yardanico> does it use separate threads or not and other stuff |
18:51:16 | livcd | there were definitely issues with goroutines |
18:51:23 | FromDiscord | <Yardanico> (it just has a special param for callbacks so you can pass any pointer for your data) |
18:53:20 | * | endragor quit (Ping timeout: 256 seconds) |
18:53:44 | livcd | Yardanico: did you manage to wrap it already? :O |
18:54:35 | FromDiscord | <Yardanico> nonono |
18:54:47 | FromDiscord | <Yardanico> I mean you can already use it with low-level APIs |
18:55:03 | FromDiscord | <Yardanico> I'm just adapting code from the old wrapper and also simplifying some parts a bit |
18:55:05 | FromDiscord | <Yardanico> I ported the value procedures |
18:55:12 | FromDiscord | <Yardanico> so you can have a high-level wrapper for sciter values |
18:55:55 | FromDiscord | <Yardanico> I wrapped the raw pointer to the sciter value in an object which has custom =, =destroy and =sink |
18:55:59 | FromDiscord | <Yardanico> and so far it actually works pretty well |
18:58:07 | Araq | Clyybber: great but I don't understand it |
18:58:30 | Araq | what's wrong with my approach? it was more explicit |
18:58:42 | FromDiscord | <Clyybber> But it didn't retain the order |
18:58:59 | FromDiscord | <Clyybber> And my approach is simpler |
18:59:06 | FromDiscord | <Clyybber> We assign the result to a temporary now if needed |
18:59:18 | Araq | for you. for me it's just different :P |
18:59:22 | FromDiscord | <Clyybber> And insert the =destroy calls, and return the temporary |
19:00:25 | Araq | beware of 'let a = "string" ' |
19:00:48 | FromDiscord | <Clyybber> took care of all that |
19:01:01 | Araq | my cursorfier turns it into plain copyMems |
19:01:20 | FromDiscord | <Clyybber> ah! |
19:01:21 | Araq | of 2 machine words, so soon enough it won't test what you want to test anymore |
19:01:22 | FromDiscord | <Clyybber> nice |
19:01:34 | Araq | maybe we need --cursorInference:off |
19:01:39 | disruptek | #14971 |
19:01:41 | disbot | https://github.com/nim-lang/Nim/issues/14971 -- 3OrderedTable del and pop are slow ; snippet at 12https://play.nim-lang.org/#ix=2ryn |
19:01:43 | disruptek | !repo skiplists |
19:01:44 | disbot | https://github.com/disruptek/skiplists -- 9skiplists: 11generic skip list implementations 15 1⭐ 0🍴 |
19:01:59 | FromDiscord | <Clyybber> Araq: Does cursor inference apply to all types? |
19:02:03 | FromDiscord | <Clyybber> Or only ref types? |
19:03:28 | FromDiscord | <Clyybber> I mean I can change the tests to use something other than string instead |
19:04:49 | * | Vladar quit (Quit: Leaving) |
19:05:55 | FromDiscord | <Clyybber> Araq: Do we have a way to tell testament to run a testcase with different commands? |
19:06:05 | FromDiscord | <Clyybber> for testing option combinations |
19:06:14 | Araq | yeah it supports 'matrix' |
19:06:23 | Araq | but I forgot its name |
19:06:41 | Araq | and it's not for ref-only types, it's for all types that have a non-trivial destructor |
19:06:51 | Araq | so you're out of luck :P |
19:06:55 | FromDiscord | <Clyybber> :D |
19:06:58 | Araq | more importantly though |
19:07:19 | Araq | the code is now convoluted IMO, the cleaner approach would be to "statementize" the AST first |
19:07:31 | * | dannyhpy joined #nim |
19:07:38 | Araq | and then compute =sink, =, =destroy on the statementized AST |
19:07:53 | Araq | it would also make my optimization phases simpler |
19:08:12 | Araq | currently we need to deal with e.g. nkIfExpr in 4 places |
19:08:12 | FromDiscord | <Clyybber> I thought about that too, and we actually in a way do that now |
19:08:26 | FromDiscord | <Clyybber> but statementizing it before looses information |
19:08:34 | FromDiscord | <Clyybber> we use for optimization |
19:08:40 | Araq | which information? |
19:08:40 | FromDiscord | <Clyybber> for example in moveOrCopy |
19:09:44 | Araq | also: the fact that we translate 'try' in the C backend means I cannot apply wasMoved+destroy elision as often as I would like |
19:10:15 | Araq | quite a legacy system now |
19:10:31 | FromDiscord | <Clyybber> when we statementize before processing we will end up with unneccessary temporaries |
19:10:33 | FromGitter | <deech> I can separate a closure into a function pointer and an environment with `rawProc` and `rawEnv` but how do I go the other way? Reforming a closure with a fp and env? |
19:10:35 | FromDiscord | <Clyybber> for example in moveOrCopy |
19:10:46 | FromDiscord | <Clyybber> but I agree that we should move this stuff out of cgen |
19:11:20 | Araq | the temporaries are no sweat for the cursorfier |
19:12:05 | Araq | deech: you can maybe construct a tuple and 'cast' it to a closure |
19:12:22 | Araq | but I have never done that and the GC wants to own the closure |
19:13:25 | FromGitter | <deech> Right now I'm wrapping it like: `proc () = cast[proc () {.nimcall}](f)(env)`. Not sure if that's safe or not. |
19:15:06 | * | vicfred joined #nim |
19:16:13 | Araq | compile with --gc:arc and ask valgrind about it :-) |
19:16:25 | Araq | looks ok from here |
19:16:48 | FromGitter | <deech> Yep will do. Just wanted to make sure there wasn't some stdlib function I was missing. |
19:17:52 | * | oriba joined #nim |
19:18:00 | FromDiscord | <Varriount> Araq, clyyber: I know I don't do any compiler programming, but a cleaner codebase sounds like a good direction to go in. |
19:20:57 | Araq | nothing we do is a substitute for reading a good book about compiler construction |
19:21:03 | disruptek | rude. |
19:21:17 | Araq | sorry |
19:23:26 | * | Shucks joined #nim |
19:23:29 | Shucks | Hey Shucks! |
19:23:37 | FromDiscord | <Shucks> Hey |
19:23:48 | FromDiscord | <Yardanico> Hello Yardanico! |
19:23:50 | Yardanico | hi there! |
19:23:59 | FromDiscord | <Shucks> Oh, you got a twin aswell |
19:24:02 | FromDiscord | <Varriount> O_o |
19:24:09 | * | Araq sighs |
19:24:11 | disruptek | disbot: ignore these knuckleheads. |
19:24:12 | disbot | on it. 👍 |
19:24:25 | disruptek | Araq: it's just a culture clash, man. |
19:24:36 | disruptek | 'mericans would rather talk than listen, write than read. |
19:24:49 | FromDiscord | <Shucks> Everyone should have that irc bots. So I can finally kick off that discord malware ;p |
19:24:52 | FromDiscord | <dom96> o/ |
19:24:53 | dom96 | \o |
19:24:59 | FromDiscord | <Yardanico> 🤦 |
19:25:10 | FromDiscord | <Yardanico> xdd |
19:28:10 | FromDiscord | <Yardanico> I guess for high-level sciter wrapper I'll just look in how python/go wrappers do it |
19:28:40 | FromGitter | <alehander92> AMERICA |
19:28:45 | FromDiscord | <Yardanico> lol |
19:29:14 | FromGitter | <alehander92> am i late |
19:29:25 | FromGitter | <alehander92> for the spam evening |
19:31:05 | FromDiscord | <dom96> https://tenor.com/view/noice-brooklyn-ninenine-b99-smile-gif-11928987 |
19:31:10 | FromDiscord | <dom96> 4 files changed, 69 insertions(+), 19 deletions(-) |
19:31:25 | FromDiscord | <Clyybber> Varriount: For sure |
19:32:02 | FromDiscord | <Yardanico> @dom96 mine was cooler 😛 |
19:32:11 | FromDiscord | <Yardanico> I got 77.777MiB peak mem with nim compiler yesterday |
19:32:14 | FromDiscord | <Clyybber> Araq: So good to merge? |
19:33:51 | FromDiscord | <dom96> @Yardanico 69.69696969 would have been cooler |
19:35:27 | * | endragor joined #nim |
19:35:29 | Araq | <Clyybber>, no, I need to review it carefully |
19:35:38 | Araq | and I need a break. good night |
19:35:42 | Araq | oh |
19:35:52 | Araq | but you can already rewrite your template |
19:35:56 | Araq | into a proc |
19:36:02 | Araq | long templates suck |
19:36:05 | Araq | bbl |
19:36:10 | FromDiscord | <Clyybber> Tried that, but because of captures it doesn't work |
19:36:19 | FromDiscord | <Clyybber> good night |
19:39:18 | * | fredrikhr quit (Read error: Connection reset by peer) |
19:39:41 | * | fredrikhr joined #nim |
19:41:08 | FromGitter | <alehander92> oi |
19:44:01 | * | endragor quit (Ping timeout: 264 seconds) |
19:51:18 | * | fredrikhr quit (Read error: Connection reset by peer) |
19:51:43 | * | fredrikhr joined #nim |
19:54:15 | FromGitter | <bung87> can I mapping new TypeA to js object constructor? |
20:06:09 | * | haxscramper joined #nim |
20:10:13 | * | xet7 quit (Quit: Leaving) |
20:13:54 | * | maier quit (Ping timeout: 240 seconds) |
20:30:56 | * | narimiran joined #nim |
20:33:47 | * | haxscramper quit (Remote host closed the connection) |
20:36:49 | * | endragor joined #nim |
20:39:19 | FromDiscord | <Yardanico> lol https://media.discordapp.net/attachments/371759389889003532/732335365830213745/unknown.png |
20:40:44 | FromDiscord | <Shucks> fake. It says simple calculator. That calculation isn't simple at all! |
20:40:59 | * | endragor quit (Ping timeout: 240 seconds) |
20:42:23 | FromDiscord | <Yardanico> although I did the whole thing in the native part |
20:42:38 | FromDiscord | <Yardanico> a better solution is to expose native functions to TiScript (Sciter's scripting language) |
20:42:48 | * | endragor joined #nim |
20:42:52 | FromDiscord | <Yardanico> because UI is usually callbacks, and backend is linear usually |
20:43:36 | FromGitter | <alehander92> bung87 it depends |
20:43:45 | FromGitter | <alehander92> object construction should be .. object construction |
20:43:59 | FromGitter | <alehander92> it should do the `new` thing anyway if its ref i think |
20:44:09 | FromGitter | <alehander92> (without needing to write new) |
20:45:26 | FromDiscord | <Wikipedia> that is cool calculator |
20:45:36 | FromDiscord | <Shucks> Which ui framework are you using? |
20:45:48 | FromDiscord | <Shucks> Gosh im highlighting myself all the time. Gonna quit discord lol |
20:50:20 | shashlick | @lqdev - you around? |
20:51:27 | FromDiscord | <Yardanico> @Shucks playing around with sciter |
20:57:01 | * | endragor quit (Ping timeout: 258 seconds) |
20:57:07 | * | narimiran quit (Ping timeout: 246 seconds) |
20:57:43 | FromGitter | <bung87> alehander92 well, I can do `new TypeA`, but how to do `new TypeA(p)`, I see some mapping as `newTypeA` |
20:59:55 | FromDiscord | <Varriount> Is it possible to change a discriminator field in an object without copying it? I seem to recall some changes made recently that affected that functionality |
21:00:14 | * | bung joined #nim |
21:03:08 | FromDiscord | <lqdev> shashlick: hold on a sec, I'm playing Worms |
21:05:11 | FromDiscord | <lqdev> alright |
21:05:17 | FromDiscord | <lqdev> shashlick: what is it? |
21:09:13 | shashlick | https://github.com/tree-sitter/tree-sitter-c/issues/49 is why that type in freetype wasn't getting rendered properly |
21:09:15 | disbot | ➥ Cast using non-standard type leads to call_expression ; snippet at 12https://play.nim-lang.org/#ix=2rz1 |
21:09:34 | shashlick | wanted to check what was in your freetype_include.h |
21:11:48 | * | endragor joined #nim |
21:13:06 | FromDiscord | <lqdev> ```c↵#include <ft2build.h>↵#include FT_FREETYPE_H↵``` |
21:13:39 | shashlick | okay cool |
21:13:43 | shashlick | i have a working wrapper if you want |
21:14:35 | FromDiscord | <lqdev> no need for that, I'm good with my minimalist wrapper |
21:15:11 | shashlick | okay cool |
21:17:04 | * | endragor quit (Ping timeout: 246 seconds) |
21:18:20 | shashlick | https://gist.github.com/genotrance/cf45b0ce3e7c57f32b7673cf64f977b9 if anyone needs it |
21:28:54 | FromDiscord | <Yardanico> well, seems like it's not so simple with destroy |
21:28:58 | FromDiscord | <Yardanico> so basically the issue I'm having with values |
21:29:08 | FromDiscord | <Yardanico> is that I sometimes need to pass the underlying pointer to sciter without destroying it |
21:29:15 | FromDiscord | <Yardanico> so I'm wondering what to do 🤔 |
21:29:19 | FromDiscord | <Yardanico> "ref object" for GC_ref and stuff? |
21:31:07 | FromGitter | <alehander92> @bung87 sorry! |
21:31:12 | FromGitter | <alehander92> you can't |
21:31:24 | FromGitter | <alehander92> just do `TypeA(field: values, field2: value2)` |
21:33:58 | bung | oh, so it has this context sematic match the js constructor |
21:37:45 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:38:57 | * | endragor joined #nim |
21:41:18 | * | fredrikhr quit (Read error: Connection reset by peer) |
21:41:46 | * | fredrikhr joined #nim |
21:46:44 | * | endragor quit (Ping timeout: 265 seconds) |
21:57:41 | * | debased joined #nim |
22:19:11 | * | fredrikhr quit (Read error: Connection reset by peer) |
22:19:38 | * | fredrikhr joined #nim |
22:25:10 | FromGitter | <alehander92> i hope so |
22:28:55 | * | justsomeguy joined #nim |
23:04:22 | * | bung quit (Quit: Lost terminal) |
23:18:25 | * | vicfred_ joined #nim |
23:19:23 | * | Trustable quit (Remote host closed the connection) |
23:19:23 | * | vicfred quit (Ping timeout: 240 seconds) |
23:21:59 | * | krux02_ joined #nim |
23:24:18 | * | krux02 quit (Ping timeout: 244 seconds) |
23:35:03 | * | D_ quit (Ping timeout: 260 seconds) |
23:37:01 | * | D_ joined #nim |
23:38:11 | * | oddp quit (Ping timeout: 240 seconds) |
23:41:19 | FromGitter | <sealmove> hi, is it possible to write the result of a macro in a file as concrete nim code? |
23:42:05 | FromDiscord | <Rika> `writeFile(result.repr)` is what i would do 😛 |
23:42:11 | FromDiscord | <Rika> i mean, forgot the filename |
23:42:26 | FromDiscord | <Yardanico> also you should be vary of gensym'd symbols |
23:42:39 | FromDiscord | <Rika> that i do not know how to fix |
23:44:24 | FromGitter | <sealmove> I get "Error: request to generate code for .compileTime proc: newLetStmt" |
23:46:39 | FromGitter | <sealmove> Hmm, do I have to do writeFile(result.repr) in the macro body? |
23:47:01 | FromDiscord | <Rika> yes (i forgot the filename, its writeFile(filename, result.repr)) |
23:47:05 | FromGitter | <sealmove> Because I tried to use newLetStmt and other such procs in a proc |
23:47:37 | FromDiscord | <Yardanico> well you can only use those in a compileTime proc |
23:52:08 | FromGitter | <sealmove> Hmm ok, I want to provide 2 options, 1: write the result of the macro in a file, 2: inject the result of the macro (normal macro call). Obviously I don't want to repeat the code in the macro body. So how do you compose macro bodies? |
23:52:34 | FromGitter | <sealmove> If you can't use procs I mean... |
23:52:51 | FromDiscord | <Yardanico> you can use procs |
23:52:56 | FromDiscord | <Yardanico> they just need to be called in a static context |
23:53:12 | FromDiscord | <Rika> add {.compileTime.} pragma 😛 |
23:58:06 | FromGitter | <sealmove> the problem is that I don't want to do the writeFile in the macro, so the way I see it I want the result of the macro to be *returned* as NimNode for example |
23:58:23 | FromGitter | <sealmove> and decide whether to write it in a file or not later |
23:59:31 | FromDiscord | <Rika> macros dont return nimnodes, procs do |