00:13:17 | * | filcuc joined #nim |
00:41:54 | * | thomasross is now known as Guest4757 |
00:41:54 | * | thomasross_ joined #nim |
00:41:55 | * | Guest4757 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
00:41:55 | * | thomasross_ is now known as thomasross |
00:44:03 | * | filcuc quit (Ping timeout: 240 seconds) |
01:06:52 | * | lritter quit (Ping timeout: 265 seconds) |
01:06:54 | disruptek | so the app is called `nigel`. you give it some aws credentials and it clones a compiler into a lambda proc. now you can build anything up to maybe 100megs, with half a gig of /tmp. you get 3gig of memory for the process. i/o from the client is limited to 6mb. |
01:06:55 | * | lritter_ joined #nim |
01:08:13 | disruptek | so you pass us input; code or whatever, and we write it to /tmp, build it, run it. you get http status codes/response bodies according to the result. |
01:09:20 | disruptek | the result is cached, of course, so that we need not perform the same build on the same input more than once. |
01:11:13 | disruptek | runtime is limited to 5min, but we can always chain if we absolutely have to. |
01:14:42 | disruptek | you can do this with any commit you want to test; you have 75gig of space to work with, and the compiler takes about, i dunno, 150mb? |
01:16:20 | disruptek | obviously, one of the actions that can take place in your function is pulling more data in from elsewhere. |
01:17:18 | * | krux02 joined #nim |
01:17:32 | disruptek | you can fit a lot of compressed source in 6mb. |
01:29:53 | disruptek | when you want to run a test against 500 different versions of the compiler, you just issue a function call with the input as a string. you get futures that resolve into httpresponses with each test result and metadata in the headers. |
01:35:42 | * | cgfuh quit (Quit: WeeChat 2.6) |
01:52:35 | FromGitter | <deech> What does the `{.cursor.}` pragma do? |
01:52:53 | * | NimBot joined #nim |
01:53:08 | disruptek | it gives you a copy that you promise not to mutate, because it's not reference counted. |
01:54:57 | FromGitter | <deech> So it's on you to dealloc it? |
01:55:22 | disruptek | no, you just want to witness it without changing the reference count. |
01:55:35 | disruptek | you wanna see it and you don't want anyone to know you're watching. |
01:55:41 | disruptek | c'mon, we've all been there. |
01:58:52 | FromGitter | <deech> By witness do you mean read it's value? |
01:58:58 | disruptek | yep. |
01:59:45 | FromGitter | <deech> So a type marked {.cursor.} is immutable by convention but not enforced, right? |
02:00:18 | disruptek | i don't remember. |
02:00:37 | disruptek | i thought they were going to be more high-level, i guess. |
02:01:08 | FromGitter | <deech> I think I'm still confused ... |
02:01:11 | disruptek | but, of course, i only know them according to the c. i don't have a sense for how i'd use them in nim. |
02:01:52 | disruptek | try mutating one and see what happens. |
02:03:38 | disruptek | oh i think i misunderstood you. |
02:05:08 | disruptek | the type itself is mutable. it's like a pointer. the target, you don't want to risk mutating because, obviously, you are telling the compiler to let you have that access on your own recognizance. |
02:06:57 | FromGitter | <deech> The prints `(x : @[4,5,6] )`: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2ba2c1a9b30639e2e047e5] |
02:07:00 | disruptek | if you know the target exists, then sure, you can mutate it. |
02:08:42 | disruptek | maybe a better example is an iterator where you don't want ownerhip of the contents to change just because you retrieved an item from the container. |
02:12:39 | FromGitter | <deech> So something like: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2ba4171a1c2739e3f5673a] |
02:14:59 | disruptek | yes, but because the last x is a cursor emitted by items(). |
02:15:47 | disruptek | like, we know we're not going to free a's contents inside the loop. so we can just have a pointer to them that we lend out. |
02:16:31 | disruptek | or, if you want to set the pointer and you may use it, but only before the item is collected, then you use a cursor. |
02:16:43 | disruptek | that way, you permit the collection of the item. |
02:17:25 | disruptek | it happens due to the way arc works that you sometimes need to swap values around without invoking the usual machinery surrounding memory management. |
02:17:33 | disruptek | so, that's how i use it. |
02:17:36 | FromGitter | <kennymalac> Hello, I am trying to copy a callback function into a thread. How do I do this? I can't call a callback within a thread because it complains about the GC |
02:18:02 | FromGitter | <deech> I'm going to have to chew on it a little more but thanks for the info! |
02:18:12 | FromGitter | <kennymalac> I'd just like to copy the callback and be able to call a copy of the function in a separate thread |
02:19:36 | FromGitter | <kennymalac> for context, I'd like to do something like this: proc startWorker(args: tuple[address: string, callback: (string) -> string]) {.thread.} |
02:20:45 | FromGitter | <kennymalac> but the compiler understably complains like so: Error: 'startWorker' is not GC-safe as it calls 'start' |
02:20:58 | FromGitter | <kennymalac> understandably* |
02:23:34 | * | krux02 quit (Remote host closed the connection) |
02:40:09 | * | thomasross_ joined #nim |
02:40:09 | * | thomasross is now known as Guest88773 |
02:40:09 | * | thomasross_ is now known as thomasross |
02:41:07 | * | icebattle quit (Ping timeout: 265 seconds) |
02:42:22 | * | Guest88773 quit (Ping timeout: 268 seconds) |
02:43:05 | FromGitter | <kennymalac> basically I want functors. lol |
02:44:12 | FromGitter | <kennymalac> c++ style that is |
02:45:11 | * | dsiosj joined #nim |
02:45:13 | dsiosj | hi |
02:48:19 | * | dsiosj quit (Remote host closed the connection) |
03:02:20 | * | icebattle joined #nim |
03:06:50 | * | icebattle quit (Ping timeout: 240 seconds) |
03:06:57 | FromGitter | <zetashift> heyho |
03:07:14 | FromGitter | <zetashift> @kennymalac I think most people that know that stuff are currently asleep :( |
03:09:38 | FromGitter | <kennymalac> it's all good |
03:12:35 | * | thomasross quit (Ping timeout: 268 seconds) |
03:20:45 | * | sealmove joined #nim |
03:23:03 | * | thomasross joined #nim |
03:43:12 | FromGitter | <deech> I may have asked this before but what does the `<//>` do here? `next*: <//>(ref DoublyLinkedNodeObj[T])` |
03:48:20 | * | muffindrake quit (Ping timeout: 248 seconds) |
03:48:24 | * | lritter_ quit (Quit: Leaving) |
03:50:45 | * | muffindrake joined #nim |
04:15:48 | disruptek | the <//> is just a placeholder to get early code to work with `owned`. |
04:15:59 | disruptek | doesn't exist in today's nim. |
04:17:23 | disruptek | deech ^ |
04:23:23 | FromGitter | <kennymalac> I found something here https://forum.nim-lang.org/t/3732 |
04:23:32 | * | marmotini_ joined #nim |
04:23:41 | FromGitter | <kennymalac> mabye this is sufficient |
04:29:20 | * | marmotini_ quit (Remote host closed the connection) |
04:29:40 | * | marmotini_ joined #nim |
04:29:40 | * | marmotini_ quit (Remote host closed the connection) |
04:30:05 | leorize | @kennymalac: `deepCopy` can be used to copy closures iirc |
04:30:57 | * | chemist69 quit (Ping timeout: 260 seconds) |
04:32:50 | * | chemist69 joined #nim |
04:33:35 | FromGitter | <kennymalac> oh |
04:36:31 | leorize | https://nim-lang.github.io/Nim/manual#threads-gc-safety <- might be related |
04:37:29 | leorize | in the future the new --gc:arc will ease all this up, but for now that's the best we've got |
04:55:40 | madprops | hmm https://www.reddit.com/r/ProgrammerHumor/comments/etmdw5/trending_nim_projects_this_month_got_link_from/ |
05:01:59 | leorize | if github definition of trending == people contrib + talks all the time, then I wouldn't be surprised |
05:02:40 | leorize | ah, they count by stars rate |
05:02:52 | leorize | then only nim-lang/Nim can held the first spot :P |
05:03:30 | leorize | (and only spot) :P |
05:04:12 | sealmove | eh, nimyaml doesn't work at CT? |
05:05:39 | disruptek | nah. |
05:05:54 | disruptek | we simply cannot go through this again, sealmove. |
05:05:56 | sealmove | :( |
05:06:26 | sealmove | sorry, I just realized it because I hadn't tried to use it before |
05:06:42 | sealmove | oh well, need to make a CT yaml parser, I am now fully determined |
05:07:01 | leorize | make it output JsonNode, please :P |
05:07:20 | sealmove | yes! that's what i need |
05:07:26 | disruptek | i'm not so bothered, but it would greatly simplify my openapi stuff. |
05:08:45 | leorize | you should base it on npeg or lexbase |
05:08:53 | leorize | both of them are solid basis for any parser :P |
05:09:08 | FromGitter | <kennymalac> messing around with @leorize I'll see if it works |
05:09:33 | sealmove | leorize: yeah already worked a lot on npeg, we can now even seperate lexing from parsing. |
05:09:46 | FromGitter | <kennymalac> with deepCopy* |
05:24:31 | FromGitter | <kennymalac> so far I'm very confused by deepCopy and {.gcsafe.} |
05:25:34 | leorize | so {.gcsafe.} have two meanings: |
05:26:09 | FromGitter | <kennymalac> I'm confused that it seems to make the outer proc {.gcsafe.} and where to actually do the copy |
05:26:52 | FromGitter | <kennymalac> I can't seem to do the deepCopy inside of the function called by startWorker |
05:27:22 | leorize | as an annotation: enforce that no GC-ed memory can be passed. This prevents cross-heap sharing. Currently {.thread.} implies this. |
05:28:21 | * | sealmove quit (Ping timeout: 272 seconds) |
05:28:42 | leorize | as a statement: the code block assigned to it will **not** be checked for GC-ed memory, it's a way to bypass the checking (and it's needed in certain cases) |
05:29:34 | FromGitter | <kennymalac> actually i got it to compile but I'm unsure if I'm doing it right |
05:29:38 | FromGitter | <kennymalac> I'll paset |
05:31:14 | * | Jjp137_ quit (Read error: Connection reset by peer) |
05:31:35 | * | sealmove joined #nim |
05:31:48 | * | Jjp137 joined #nim |
05:33:12 | FromGitter | <kennymalac> https://pastebin.com/jnPE6TQa |
05:33:41 | FromGitter | <kennymalac> does this look right @leorize ? i'm unsure where I'm actually supposed to be calling deepCopy |
05:35:19 | leorize | you wouldn't need {.gcsafe.} in startWorker afaict |
05:35:22 | FromGitter | <kennymalac> the problem I have with this is that obviously I don't want the entire start() function to be gcsafe |
05:35:45 | leorize | ok I understand now |
05:36:07 | leorize | you need it inside startWorker |
05:36:35 | FromGitter | <kennymalac> for context: I am making a generic task worker that acts as a dedicated thread listening on a socket for tasks and publishes on a socket |
05:36:38 | * | Jjp137 quit (Read error: Connection reset by peer) |
05:36:58 | leorize | so you want to copy that callback and its environment? |
05:37:28 | * | seni quit (Quit: Leaving) |
05:39:27 | * | marmotini_ joined #nim |
05:39:37 | FromGitter | <kennymalac> it would be nice if I could have that |
05:40:15 | FromGitter | <kennymalac> but if that's too complicated I may just specialize Worker? idk |
05:40:24 | FromGitter | <kennymalac> I didn't really want to have to do that |
05:41:35 | leorize | well for one, closures can't be passed through threads with the default gc |
05:42:07 | FromGitter | <kennymalac> yeah makes sense |
05:42:52 | * | dddddd quit (Ping timeout: 268 seconds) |
05:43:07 | * | marmotini_ quit (Remote host closed the connection) |
05:43:11 | leorize | use --gc:boehm and {.gcsafe.} every path that the compiler complains |
05:43:17 | leorize | --gc:boehm is thread-safe |
05:43:31 | leorize | and trust me, it's better than fighting this mess |
05:43:59 | leorize | also boehm is compatible with all of Nim. It might even be the default if ARC is not here. |
05:46:59 | FromGitter | <kennymalac> ugh I'd rather not , :/ |
05:47:09 | FromGitter | <kennymalac> to be honest I only create the threads once so it's not a big issue |
05:49:47 | FromGitter | <kennymalac> I may just have to specialize task types like I thought I might have to |
05:50:46 | leorize | I think I might know a way out for you |
05:53:40 | * | Jjp137 joined #nim |
05:54:18 | FromGitter | <kennymalac> hm? |
05:55:10 | * | rockcavera quit (Remote host closed the connection) |
05:56:41 | leorize | doesn't worth it tbh |
05:57:15 | leorize | you can rip the env out of the closure, ie: making your worker a generic type with a generic data field |
05:59:12 | FromGitter | <kennymalac> hmmm, I could register the task closure inside the thread, rather than in advance |
05:59:38 | FromGitter | <kennymalac> actually nevermind, I'd have to move the Topic into the thread, I don't want that |
06:00:27 | FromGitter | <kennymalac> okay I'll be back in the morning maybe someone will rip me a new one while I sleep |
06:00:36 | leorize | have you checked out weave? |
06:00:39 | leorize | !repo weave |
06:00:41 | disbot | https://github.com/mratsim/weave -- 9weave: 11A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead 15 102⭐ 7🍴 |
06:03:44 | FromGitter | <kennymalac> nope, looks awesome, using ZeroMQ because of possible customer API calls and zeromq has many libs. though I guess hypothetically I could use that for internal communication |
06:22:09 | * | ikan-keli_2 joined #nim |
06:22:16 | * | nsf joined #nim |
06:22:18 | * | narimiran joined #nim |
06:23:27 | * | ikan-keli_ quit (Ping timeout: 265 seconds) |
06:27:10 | * | nixfreak joined #nim |
07:00:44 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
07:02:41 | * | Pqzcih5 quit (Remote host closed the connection) |
07:03:32 | * | sealmove quit (Quit: WeeChat 2.7) |
07:16:42 | * | nsf quit (Quit: WeeChat 2.7) |
07:27:14 | * | IRC-Source_39 joined #nim |
07:27:39 | * | IRC-Source_39 quit (Remote host closed the connection) |
07:28:05 | * | IRC-Source_46 joined #nim |
07:31:28 | * | IRC-Source_46 quit (Remote host closed the connection) |
07:41:36 | * | solitudesf joined #nim |
07:49:23 | * | cron joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:58 | * | gmpreussner joined #nim |
08:16:28 | * | dadada joined #nim |
08:16:51 | * | dadada is now known as Guest46432 |
08:19:24 | * | Vladar joined #nim |
08:24:33 | * | theelous3 quit (Ping timeout: 260 seconds) |
08:29:01 | * | ng0 joined #nim |
08:31:18 | * | ritchie_ joined #nim |
08:40:40 | narimiran | leorize: ping |
09:19:20 | * | Trustable joined #nim |
09:20:37 | * | cron quit (Quit: Leaving.) |
09:50:16 | livcd | was this posted here already ? https://www.twitch.tv/videos/540046321 |
09:51:24 | Yardanico | Doesn't seem so, I'll post it on forums :) |
09:51:53 | Yardanico | ah I know this guy, I saw his program https://github.com/tsoding/boomer |
09:52:03 | Yardanico | it's an X11 zooming app |
09:52:27 | livcd | he is your landesmann |
09:56:51 | Yardanico | he seems nice and fun :P |
09:57:00 | Yardanico | im actually watching that vid lol |
10:05:02 | Yardanico | "welcome to Nim btw, this is the language that will kill C and C++" best quote xd |
10:05:46 | Yardanico | wow |
10:14:21 | Yardanico | ah it's not his app actually |
10:16:17 | Yardanico | oh wait it is his app, I was confused by different nicknames |
10:26:17 | solitudesf | > he seems nice and fun :P |
10:26:30 | Yardanico | ? |
10:26:40 | solitudesf | if you actually watch him, he becomes pretty annoying |
10:27:23 | solitudesf | he refuses to learn, he's quickly jumping to assumptions, he has some autistic principles and often ridicules the chat |
10:27:53 | Yardanico | well, about the chat - you clearly never been in any "toxic" twitch communities like forsen's chat :P |
10:27:54 | solitudesf | kinda got sick and tired of his attitude, so i dont know if someone else helps him with his nim streams |
10:28:04 | solitudesf | i am often in forsens chat |
10:28:17 | solitudesf | im not talking about chat, im talking about streaner |
10:28:19 | solitudesf | streamer |
10:30:35 | solitudesf | ah, wth, this is not #nim-offtopic |
10:32:52 | * | arecaceae quit (Remote host closed the connection) |
10:33:15 | * | arecaceae joined #nim |
10:54:20 | * | lskbr joined #nim |
10:56:33 | * | lskbr left #nim (#nim) |
11:02:29 | FromDiscord_ | <zidsal> can someone explain the following to me as this behaviour is different to other languages I've worked with: |
11:02:29 | FromDiscord_ | <zidsal> |
11:02:29 | FromDiscord_ | <zidsal> https://pastebin.com/wzPGjgEn |
11:02:29 | FromDiscord_ | <zidsal> |
11:02:29 | FromDiscord_ | <zidsal> the tl;dr is I assign a set to a local variable and mutate it with incl but it doesn't mutate can anyone explain to me why? |
11:03:19 | FromDiscord_ | <Yardanico> You've used `set` for componentBitset right? |
11:03:24 | FromDiscord_ | <zidsal> yup |
11:03:38 | FromDiscord_ | <Yardanico> `set` is not a reference type so in `var componentBitset = world.entityInfo[entity].components;` you actually copy the set to a new memory location |
11:04:02 | FromDiscord_ | <zidsal> ah, gotcha thanks yard |
11:04:10 | Araq | Clyybber: I got 'emplace_back' to work |
11:04:19 | Araq | it's a one liner :P |
11:04:42 | Yardanico | not really a nim-related question, but can anyone explain to me how does https://github.com/belamenso/v/blob/master/src/v.nim#L43 work? |
11:04:54 | Yardanico | that code can represent any ASCII char in a sequence of numbers from 0 to 9 |
11:04:59 | Yardanico | s/in a/as a |
11:13:57 | Yardanico | ah nvm I figured it out |
11:44:33 | * | chemist69 quit (Ping timeout: 272 seconds) |
11:45:02 | * | chemist69 joined #nim |
11:45:28 | FromDiscord_ | <gour> morning, what is the prospect of using nim for writing android app? |
11:45:48 | Zevv | basically like any non-java language |
11:45:57 | Zevv | you can do some essentials like sound and openGL, basic networking |
11:46:04 | Zevv | but nearly any android API's |
11:46:07 | Zevv | similar to C/C++ |
11:46:19 | Zevv | you can cross compile Nim using the Android NDK |
11:46:27 | Yardanico | there's https://github.com/yglukhov/jnim which makes things a bit easier though |
11:47:39 | FromDiscord_ | <gour> i'd need a regular gui app...so dart+flutter are better for this use-case? |
11:53:56 | Yardanico | https://gist.github.com/Yardanico/c6495e6b8d0776ff07b6feabab0b1d17#file-lol-nim xd |
11:54:03 | Yardanico | for https://forum.nim-lang.org/t/5855 |
12:49:34 | * | krux02 joined #nim |
12:52:13 | FromDiscord_ | <Zachary Carter> Time to play more with weave today |
12:52:36 | FromDiscord_ | <Zachary Carter> still have some questions about what exactly I can pass as arguments to a spawned proc |
13:14:41 | FromDiscord_ | <Recruit_main_70007> how can i access Microsoft COM such as ObjCreate?? |
13:15:03 | * | dddddd joined #nim |
13:44:58 | * | Senketsu joined #nim |
13:52:46 | * | kobi7 joined #nim |
13:53:04 | kobi7 | hi guys |
13:54:15 | kobi7 | I am trying to compile `languist` but get some errors. I think the std library paths have changed a little. |
13:54:44 | kobi7 | compiler/ast cannot be found. is it the same as core/macros |
14:00:28 | * | kobi7 quit (Quit: Leaving) |
14:22:17 | FromDiscord_ | <Recruit_main_70007> found winim/com, is that the best solution? |
14:23:46 | FromDiscord_ | <exelotl> Yep |
14:37:43 | * | lritter joined #nim |
14:46:54 | * | Senketsu quit (Quit: WeeChat 2.7) |
14:53:04 | * | Senketsu joined #nim |
14:54:40 | FromDiscord_ | <Recruit_main_70007> var nick = ie.document.getElementById("nick")nick.value = "NimBot" |
14:54:52 | FromDiscord_ | <Rika> ??? |
14:54:59 | FromDiscord_ | <Recruit_main_70007> missed a newline |
14:55:15 | FromDiscord_ | <Recruit_main_70007> var nick = ie.document.getElementById("nick") |
14:55:16 | FromDiscord_ | <Recruit_main_70007> nick.value = "NimBot" |
14:55:52 | FromDiscord_ | <Recruit_main_70007> that code throws me an error: |
14:55:52 | FromDiscord_ | <Recruit_main_70007> Error: unhandled exception: convert from VT_NULL to com object [VariantConversionError] |
14:55:52 | FromDiscord_ | <Recruit_main_70007> what am i doing wrong? |
15:02:21 | * | Hideki_ joined #nim |
15:03:04 | * | tane joined #nim |
15:06:07 | disruptek | i ask myself that every day. |
15:06:46 | Yardanico | 😔 |
15:11:46 | * | solitudesf quit (Remote host closed the connection) |
15:12:55 | * | Senketsu quit (Quit: WeeChat 2.7) |
15:17:59 | * | solitudesf joined #nim |
15:18:19 | * | ng0 quit (Read error: Connection reset by peer) |
15:18:46 | * | ng0 joined #nim |
15:24:58 | * | Senketsu joined #nim |
15:25:39 | * | Senketsu quit (Client Quit) |
15:26:54 | * | Senketsu joined #nim |
15:27:18 | FromDiscord_ | <zidsal> I'm writing an ecs so I need a fast lookup to get a value of type T thats owned by an entity. To do this I have global tabels that are created that map from an Entity to a specific component. However compiling this gives gcc errors. Does anyone know why and how I can get around this? (I've stripped out path information in the stacktrace) |
15:27:18 | FromDiscord_ | <zidsal> |
15:27:18 | FromDiscord_ | <zidsal> https://pastebin.com/ |
15:29:38 | FromDiscord_ | <zidsal> oops https://pastebin.com/QFpfRp9J |
15:31:38 | * | Senketsu quit (Client Quit) |
15:32:56 | * | Senketsu joined #nim |
15:37:11 | * | theelous3 joined #nim |
15:37:26 | FromDiscord_ | <Recruit_main_70007> how can i handle my mouse from Nim?? |
15:37:33 | Araq | C code errors are bugs |
15:37:45 | Araq | zidsal: please report it |
15:39:37 | Araq | but entity component frameworks use seqs and clever 'distinct ints' for the indexing |
15:40:05 | * | Pqzcih5 joined #nim |
15:41:06 | disruptek | Araq: since you're here, got an idea for a reasonable minimal amount of memory needed to build the compiler? linux. |
15:41:53 | disruptek | i can test it, i just figured you could save me a step. |
15:44:24 | * | ptdel joined #nim |
15:48:44 | zedeus | building with `koch boot -f -d:release` mine reached 438 MB, with `-f -d:danger -d:leanCompiler` it reached 369 MB |
15:48:53 | zedeus | may vary depending on the compiler used to compile obv |
15:49:07 | disruptek | thanks, boss. |
15:50:20 | * | lskbr joined #nim |
15:52:19 | lskbr | Only nim to make me use IRC again. Same nick as in Telegram. Amazing language, good work! |
15:54:47 | * | ng0 quit (Quit: leaving) |
15:59:25 | * | Pqzcih5 quit (Remote host closed the connection) |
16:01:48 | * | Pqzcih5 joined #nim |
16:05:48 | * | liber joined #nim |
16:07:53 | Yardanico | lskbr: is that sarcasm or not xD |
16:10:58 | Araq | Yardanico: it's not. |
16:11:04 | Yardanico | yeah I figured it out :) |
16:11:45 | * | liber quit (Remote host closed the connection) |
16:17:16 | FromGitter | <deech> Is there a way to work transform the return value of an FFI call? eg. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ This is a simple example. [https://gitter.im/nim-lang/Nim?at=5e2c6a0c3482927279283919] |
16:18:13 | disruptek | $somecstring |
16:18:53 | FromGitter | <deech> Right but how do get a hold of the return value? |
16:18:53 | disruptek | use a template. |
16:24:40 | Yardanico | @deech you can just define your function as mynameRaw or something |
16:24:50 | Yardanico | and have myname as a procedure which calls mynameRaw and does all conversions |
16:24:52 | Yardanico | or a template |
16:26:22 | disruptek | i regretted not writing a nimish api over git from the outset. just my experience. |
16:27:16 | disruptek | "i'll clean this up later" is just never rational for reasons of craft. |
16:40:57 | * | Hideki_ quit (Remote host closed the connection) |
16:42:03 | * | Trustable quit (Remote host closed the connection) |
16:44:27 | FromGitter | <deech> But a template can't be exported right? |
16:44:34 | disruptek | why not? |
16:44:53 | FromGitter | <deech> Sorry, by exported I meant `exportc`, should have been clearer. |
16:45:04 | Yardanico | ah wait |
16:45:11 | Yardanico | you're EXPORTing a proc as I understand or what? |
16:45:26 | Yardanico | or do you want to somehow get a reference to a return value of a procedure? |
16:45:31 | disruptek | you're exporting a proc to c that yields a nim string? |
16:45:59 | disruptek | that it gets from a c proc? |
16:46:42 | FromGitter | <deech> No, I'm doing an FFI call to a C function that ( in this example ) returns a `const char *` and want to wrap that in a function that returns a `string` and export that some other language runtime can call it. |
16:46:50 | Yardanico | you should be using importc then |
16:47:45 | FromGitter | <deech> Right, but my question is if I wrap the C function with a template can I export that template? |
16:47:59 | FromGitter | <Yardanico> of course, you can export any identifiers in Nim |
16:48:03 | FromGitter | <Yardanico> macros/templates/consts/lets/vars/etc |
16:48:17 | FromGitter | <Yardanico> so something like https://play.nim-lang.org/#ix=28ke |
16:48:33 | FromGitter | <deech> Really? Do the generic arguments just become void pointers or something? |
16:48:41 | FromGitter | <Yardanico> ah sorry, forgot an export marker after ffi |
16:48:44 | Zevv | * |
16:48:49 | Zevv | right |
16:49:11 | FromGitter | <Yardanico> @deech what do you mean exactly? |
16:49:32 | Zevv | deech: let me cook soemthing up |
16:49:38 | disruptek | oh shoot |
16:49:44 | disruptek | =3 |
16:51:27 | lqdev[m] | @Yardanico don't use a template here. always use the least complex construct. |
16:52:24 | solitudesf | @Yardanico, he talks about ffi export, not nim export |
16:52:41 | Yardanico | solitudesf: but he used "exportc" |
16:52:51 | Yardanico | exportc is when you need to export to C, not import a C function, right? |
16:53:23 | Yardanico | and yes I understood what he meant |
16:53:46 | * | lskbr quit (Remote host closed the connection) |
16:53:53 | FromGitter | <deech> Yardanico: I'm doing both, Nim is just the go-between. The goal is the marshall some C resource into a Nim type so Nim's memory management can take care of it and export that function so another language can call it. |
16:54:19 | Zevv | deech: is this what you mean: http://ix.io/28kh |
16:54:23 | * | Guest46432 quit (Ping timeout: 260 seconds) |
16:54:25 | Zevv | or is that too naive |
16:55:01 | * | dadada joined #nim |
16:55:09 | FromGitter | <deech> Yah, except in this case the `hello*` would have an `exportc` pragma as well. |
16:55:26 | * | dadada is now known as Guest50261 |
16:55:38 | Zevv | but where do you want to export that to? |
16:55:42 | Zevv | To Nim, or out of nim |
16:55:45 | FromGitter | <deech> out of nim |
16:55:45 | Yardanico | btw, any particular reason there's no readLines for "File" argument in system? |
16:55:54 | leorize | o/ narimiran |
16:56:16 | Yardanico | ah nvm |
16:56:26 | Zevv | ok, but you still want Nim to take care of the memory management? |
16:56:41 | FromGitter | <deech> Zevv, yeah, nim is a GC-ed glue between a C library and another language. |
16:56:47 | narimiran | leorize: hey! |
16:57:08 | Zevv | deech: hmm but how would you export a Nim string to another language? |
16:57:30 | Pqzcih5 | Hello guys, I wanted to do some packet inspection and test something IP protocol related with nim |
16:57:37 | narimiran | i was wondering if there's a possibility to give azure pipelines some kind of "please wait a bit" time? e.g. wait 5 minutes before starting the whole testing process |
16:57:45 | * | lskbr joined #nim |
16:57:47 | Zevv | "sleep 300" :) |
16:57:56 | leorize | narimiran: why? |
16:58:06 | disruptek | to debounce test runs. |
16:58:10 | Pqzcih5 | Anyone knows any good library like scapy with python |
16:58:23 | FromGitter | <deech> Zevv, that's a good point, I would need another wrapper that took `hello*` and converted back to a `cstring`. Hmm, obviously I need to think more. Thanks! |
16:58:35 | narimiran | the reason for that is: we might merge two PRs, and the first is triggered (while travis and appveyor are not or they will be automatically cancelled), then you merge the second one |
16:58:35 | Yardanico | Pqzcih5: AFAIK there's no such lib, you'll have to use httpclient with threading or async I guess |
16:58:51 | Zevv | Yardanico: I guess he wants to go much lower. |
16:58:59 | narimiran | and then if you don't cancel the first one manually, you're wasting time and resources for unneeded tests |
16:59:03 | Zevv | Binding basic pcap should be trivial, but still |
16:59:08 | Yardanico | ah scapy |
16:59:15 | Zevv | deech: welcome! |
16:59:15 | Yardanico | I thought scrapy |
16:59:34 | Pqzcih5 | I am studing networking and I want to check out things that I learn |
16:59:35 | disruptek | i thought scabbies. |
16:59:40 | Pqzcih5 | haha |
16:59:52 | Pqzcih5 | Zevv: Yeah I want to go really low |
17:00:05 | Zevv | ~repo pcap |
17:00:06 | disbot | no footnotes for `repo`. 🙁 |
17:00:08 | Zevv | !repo pcap |
17:00:09 | disruptek | nim is a good lang for that. |
17:00:10 | disbot | https://github.com/PMunch/nim-pcap -- 9nim-pcap: 11Tiny pure Nim library to read PCAP files 15 3⭐ 2🍴 7& 1 more... |
17:00:41 | disruptek | it's a good lang for scabbies, rickets, and soon, coronavirus. |
17:00:46 | Pqzcih5 | I have seen that I can do raw packets with nim bu, I was watching if there is something already build. So i don't need to reinvent the weel |
17:00:49 | Pqzcih5 | wheel* |
17:01:03 | Pqzcih5 | Zevv: Thank you. I will check it out |
17:01:44 | Zevv | I once fiddled with building an IP stack in nim. I got a lease and was able to do ping, arp and udp. |
17:01:55 | Zevv | but from there it's getting harder steepily |
17:02:02 | Zevv | no one implements TCP for fun |
17:02:31 | Zevv | I should do that again and do it right this time. |
17:02:45 | Zevv | with some tap/tun interfacing for prototyping |
17:03:09 | leorize | narimiran: i dunno, but will try to scrape the logs for that |
17:03:16 | shashlick | I officially have no way to dev/test in windows anymore |
17:03:36 | leorize | docs* |
17:03:41 | shashlick | IT virus scanning has made it impossible |
17:03:47 | Pqzcih5 | Zevv: Well that's good. You should post the library |
17:04:00 | Zevv | nah it was one of my first nim projects, no way |
17:04:03 | shashlick | Tried docker for windows which cannot even extract an image |
17:04:22 | shashlick | Ugh |
17:04:46 | * | lskbr left #nim (#nim) |
17:05:42 | disruptek | shashlick: welcome to the resistance. |
17:06:11 | leorize | shashlick: use a windows vm on linux |
17:06:23 | leorize | since they have openssh now you can just run it then ssh from outside |
17:06:32 | shashlick | Well I can act like it doesn't matter but we have active users |
17:06:52 | shashlick | For all that I then need to remote into some external machine |
17:07:21 | shashlick | Guess I need to just start paying for aws or azure or something |
17:08:01 | shashlick | Is it easy to reproduce an azure pipeline config locally for debugging, like Travis allows |
17:08:27 | shashlick | For windows especially |
17:08:40 | * | lskbr joined #nim |
17:10:38 | * | lskbr quit (Client Quit) |
17:10:56 | shashlick | Am also considering vagrant with hyper v |
17:11:15 | * | lskbr joined #nim |
17:13:12 | * | couven92 joined #nim |
17:14:01 | * | Hideki_ joined #nim |
17:18:49 | Yardanico | damn code golfing nim is fun xd |
17:19:21 | Yardanico | especially the fact that you can actually write your whole nim programs in one line |
17:19:31 | Yardanico | because of ; and () |
17:19:47 | Yardanico | like |
17:19:48 | Yardanico | for i in 0..30:echo (var (a,b)=(0,1);(for _ in 0..<i:(a,b)=(b,a+b));a) |
17:29:29 | FromDiscord_ | <DeltaPHC> Agreed on code golfing being fun. Though, it's occasionally tricky/finicky getting one-liners to work |
17:29:44 | Yardanico | well, with nim it's not that hard if you match the parens the proper way :P |
17:29:56 | Yardanico | and ;'s |
17:31:05 | FromDiscord_ | <DeltaPHC> Sometimes it doesn't necessarily save more chars than newlines and one-space indents, lol |
17:31:09 | Yardanico | yeah |
17:33:13 | leorize | narimiran: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#batching-ci-runs |
17:34:17 | * | nsf joined #nim |
17:44:45 | * | Hideki_ quit (Ping timeout: 265 seconds) |
18:09:40 | * | Senketsu quit (Quit: WeeChat 2.7) |
18:22:26 | * | abm joined #nim |
18:24:36 | * | lskbr left #nim (#nim) |
18:49:11 | FromDiscord_ | <Zachary Carter> @mratsim - I'm looking at https://github.com/mratsim/weave/blob/master/azure-pipelines.yml |
18:50:02 | FromDiscord_ | <Zachary Carter> I downloaded https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z and unzipped it |
18:50:21 | FromDiscord_ | <Zachary Carter> but I don't see any gcc.exe file in the bin folder - I can't tell whether there is some subsequent command to run or not after d/l |
18:50:34 | FromDiscord_ | <Zachary Carter> I already got my example with weave compiling and running on osx but not on windows |
18:53:50 | * | tane quit (Quit: Leaving) |
18:58:15 | leorize | shashlick: do you think it's possible to convert `meson introspect` output into Nim's `{.compile.}`? |
18:59:55 | * | Hideki_ joined #nim |
19:00:57 | Araq | clyybber: seq's add is now emplace_back, roughly :P |
19:03:14 | Yardanico | is "$ echo 'import os; for a in commandLineParams(): echo a' | nim c --hints:off --verbosity:0 -r - foo bar baz" a bug or a feature? |
19:03:22 | Yardanico | (- in bash means to take input from stdin) |
19:03:43 | Yardanico | Asking because of https://github.com/code-golf/code-golf/issues/136 |
19:03:45 | disbot | ➥ Nim swallows first argument? ; snippet at 12https://play.nim-lang.org/#ix=28ld |
19:04:02 | * | Hideki_ quit (Ping timeout: 240 seconds) |
19:04:12 | * | ptdel quit (Ping timeout: 260 seconds) |
19:04:57 | shashlick | @leorize: can you give me some examples? not experienced with meson |
19:06:25 | Araq | dunno, don't care |
19:08:12 | FromDiscord_ | <DeltaPHC> lol, I just ran into that code-golf bug too. Can't complete any of the ones that require command line args |
19:08:18 | Yardanico | yeah :( |
19:11:56 | * | thomasross quit (Remote host closed the connection) |
19:13:14 | * | ptdel joined #nim |
19:16:13 | * | thomasross joined #nim |
19:19:37 | Zevv | was there a specific paper arc was inspired by? |
19:20:19 | Zevv | I want to do some reading up to understand the implementation. I keep guessing all the time now |
19:20:54 | shashlick | @leorize did a little reading |
19:21:28 | shashlick | I'd recommend using meson as is to do the build and pull in the compiled binary rather than using compile |
19:21:36 | FromDiscord_ | <Zachary Carter> never mind I figured out my issue - I guess just not everything got copied the first time |
19:21:40 | shashlick | That's what getHeader does now for configure and cmake |
19:21:53 | shashlick | We can add meson if you think it is worthwhile |
19:22:00 | shashlick | What lib are you looking at |
19:24:33 | Zevv | Pqzcih5: still here? Found my code and put it up. doesn't seem to work, no clue what the state is: https://github.com/zevv/nimip |
19:25:25 | Zevv | there's not much to see there though |
19:26:24 | Araq | Zevv: no. years of research though. |
19:26:59 | * | Vladar quit (Quit: Leaving) |
19:28:07 | Zevv | right |
19:35:58 | Yardanico | is there a proc in the stdlib which allows to split a, say, 100-char string to 5 20-char strings? |
19:36:03 | Zevv | yes |
19:36:28 | Yardanico | what is it called? :P |
19:36:36 | Zevv | I forgot the name. looking it up now |
19:36:50 | Zevv | partition I belive |
19:37:04 | Zevv | https://nim-lang.github.io/Nim/strmisc.html#partition%2Cstring%2Cstring%2Cbool |
19:37:11 | Zevv | no not that one |
19:37:13 | Zevv | dang |
19:37:25 | Yardanico | wow first time seeing strmisc |
19:38:21 | Zevv | argh can't find it |
19:38:48 | Zevv | distribute |
19:38:57 | Yardanico | oh thanks |
19:39:13 | Zevv | oh that is seq only |
19:39:17 | Zevv | pfff |
19:39:36 | Yardanico | hmm, maybe we should have it in algorithm ? and define it for openArray |
19:39:48 | Yardanico | but yeah, thanks |
19:40:09 | Zevv | just make `type string = seq[char]` :/ |
19:40:18 | Yardanico | lol |
19:42:58 | Yardanico | wait, with base64 module you can encode a openarray of ints |
19:43:03 | Yardanico | but can't decode a string to an array |
19:43:06 | Yardanico | *seq |
19:48:11 | * | tobbez quit (Ping timeout: 246 seconds) |
19:54:13 | leorize | shashlick: nothing much, I'm just looking at the possibility of turning the results from configuration tools into Nim's {.compile.} |
19:55:14 | leorize | that'd let us customize everything just via simple flags to the compiler |
19:56:04 | disruptek | wut |
19:56:26 | shashlick | That's where I started but I've run into crashes for more complex libs |
19:56:39 | shashlick | So I've moved onto just using the build system |
19:57:11 | shashlick | Rather than working with a build that has no real testing or support |
19:57:38 | shashlick | GetHeader attempts to abstract everything for Nim regardless of the underlying build system |
19:57:52 | shashlick | Already works well for configure and cmake |
19:58:10 | shashlick | So adding meson, ninja and others is doable for me |
20:02:40 | disruptek | that sounds like a painful path. |
20:07:43 | FromGitter | <shdown> Hello guys, I don’t really know Nim but it seems extremely suitable as a language for OS development (instead of C or C++). So, is it possible to write an OS kernel in Nim (without compiler modifications)? Which features would I have to abandon (I guess GC and stack traces are the most likely candidates)? What are the other potential pitfalls? |
20:07:54 | shashlick | It's not too bad |
20:09:06 | Yardanico | @shdown see https://github.com/dom96/nimkernel https://github.com/tsubota-kouga/mikanOS https://github.com/samanthadoran/Mero |
20:09:35 | Yardanico | and Nim devel recently got --os:any and --gc:arc is also in development so once you implement some basic memory functions AFAIK you should be able to use GC stuff |
20:09:48 | Yardanico | (if I'm wrong please correct me, I'm not exactly sure about gc stuff) |
20:10:08 | Yardanico | well, if you compile with -d:useMalloc that is |
20:10:24 | leorize | the thing is that you don't malloc in a kernel :P |
20:10:47 | Yardanico | 😳 |
20:10:58 | Zevv | shown: it has been done to write a proof of concept kernel |
20:11:15 | Zevv | its also possible to run nim inside the linux kenrel, if that is your kind of thing |
20:11:46 | FromGitter | <shdown> Yardanico: huh, thanks a lot. I guess I should play around with Nim in user mode for now. |
20:11:49 | Zevv | leorize: sure, kernels kernels have a malloc |
20:12:21 | Zevv | that was not very wel englished I suppose |
20:13:17 | leorize | usually ppl would name their as kmalloc or kernel_malloc |
20:13:53 | leorize | dunno if Nim's gonna have pluggable allocators support |
20:15:06 | shashlick | leorize what lib you want with meson |
20:16:22 | leorize | shashlick: nothing in particular :P |
20:16:37 | leorize | I port programs and found meson to be interesting |
20:16:48 | leorize | and it's gonna be adopted by more and more projects in the future |
20:17:12 | Araq | leorize: you can simply name your malloc 'malloc' though, even in kernel space. |
20:18:04 | leorize | yea, though I think there must be some weird reasons that they kept naming it kmalloc and so :P |
20:18:26 | shashlick | if you have an example, i can play around |
20:18:30 | Araq | and you can easily use GCs in an OS, there is nothing about them, you still have a stack, the GC scans it, the end. |
20:18:30 | leorize | I never dive too deep into making a kernel |
20:18:39 | leorize | shashlick: hmm, try dav1d |
20:18:51 | Yardanico | we need a nim kernel example with --os:any and --gc:arc :P |
20:19:02 | leorize | just update nimkernel :P |
20:19:25 | disruptek | i hate docker. |
20:19:59 | Araq | there are valid reasons for disliking GCs, "I cannot use it because I'm writing a kernel" isn't among them. |
20:20:36 | disruptek | don't be afraid of memory. it's quite useful. |
20:20:47 | Yardanico | yeah, what if I want to httpclient.get google.com in my kernel :) |
20:21:06 | Yardanico | well, I mean if you can write kernels with GC in nim some OSdev guys will like that quite a lot |
20:21:16 | Yardanico | since with GC you'll be able to basically use the most of the stdlib |
20:21:57 | Araq | yeah, that's the other myth. "most of the stdlib", what does that mean? |
20:22:07 | Yardanico | everything except OS-specific stuff I guess :D |
20:22:18 | Araq | can you use osproc in your kernel if only it doesn't depend on a GC? |
20:22:30 | Araq | it makes no sense... |
20:22:48 | Araq | how exactly can I use glib and gtk in a kernel? |
20:23:01 | Zevv | at least seqs, strings, tables |
20:23:08 | Araq | I mean, it should be easy, right. they are written in C and C has no GC... |
20:23:21 | Zevv | life without dynamic data structures and containers is hard |
20:23:54 | disruptek | it's like you think there's some special sauce in the c code nim produces. |
20:24:46 | Araq | not it's like "nobody ever really thinks these things through properly" |
20:25:15 | Araq | it's just a bunch of silly myths repeated again and again |
20:25:43 | disruptek | when you don't have perspective, it's hard to tell how deep the pool is. |
20:28:52 | Zevv | the refraction doesnt help either |
20:32:43 | * | narimiran quit (Ping timeout: 268 seconds) |
20:35:19 | * | zyklon quit (Remote host closed the connection) |
20:35:43 | * | zyklon joined #nim |
20:36:25 | Araq | https://lwn.net/Articles/600644/ |
20:38:43 | Araq | "despite regular stack overruns and filesystem having to add workaround after workaround to prevent stack overruns" |
20:39:07 | * | muffindrake quit (Quit: muffindrake) |
20:39:30 | Araq | looks like C isn't good for writing kernels either as you lose control over your stack |
20:39:34 | Yardanico | how do they even do stuff with 8kb stack :O |
20:40:53 | Yardanico | https://cateee.net/lkddb/web-lkddb/16KSTACKS.html lol |
20:41:37 | Araq | non-contiguous stacks are easy in assembler, maybe they used the wrong language for their hyper "efficient" kernel |
20:44:13 | Araq | but all that C programmers can see is how C++'s exception handling or Java's GC doesn't fit their precious kernel development model |
20:44:41 | disruptek | i dunno if that's fair. |
20:47:24 | disruptek | i'm getting that "FAILURE" error, too, now, on head. what was the problem? |
20:48:16 | disruptek | araq's patch, iirc. |
20:48:59 | Yardanico | I LOL'd at "araq-goto-exceptions-for-everybody" |
20:49:48 | Araq | disruptek: huh, the CIs were green |
20:50:11 | * | Trustable joined #nim |
20:50:12 | * | tobbez joined #nim |
20:50:34 | disruptek | hmm, this is an old server i just found in a backwater vpc. thought i would use it for this new ci i'm building. it's linux and gcc-7 i think. |
20:51:49 | Araq | out of memory? |
20:51:53 | Araq | out of file handles? |
20:52:03 | Araq | usually it's one of these for old machines |
20:52:33 | disruptek | well, it's ec2. it's not /that/ old. |
20:52:50 | disruptek | fails after processing `scriptconfig`, right? |
20:53:07 | Araq | dunno |
20:53:28 | disruptek | must be memory. only 1/2 gig here. |
20:53:42 | Araq | yeah, not enough, use a swap file |
20:54:10 | Araq | but let me get this point through: whenever you import C code "because hey, it lacks a GC" and this C code happens to do char buffer[1024]; |
20:54:25 | Araq | you cannot use it in your kernel. |
20:54:32 | Araq | because it would overflow your stack. |
20:54:42 | Araq | so you cannot use "C's stdlib". |
20:55:48 | Araq | even though C lacks exceptions, a GC and good design, you're all on your own anyway. |
20:55:57 | Yardanico | also, a question about history of Nim, is it correct that nim is more influenced by object pascal than python? |
20:56:03 | FromGitter | <kayabaNerve> I have an async question. If I'm waiting for an entry in a table, and don't want to go with a sleepAsync solution, I should use AsyncEvents, right? |
20:56:32 | FromGitter | <kayabaNerve> My main problem is figuring out how to turn the AsyncEvent into something awaitable. |
20:58:55 | disruptek | i just use a future. |
20:59:02 | Araq | Yardanico: certainly but Modula 3 was a bigger influence still, IMO. And Modula 3 also inspired Python fwiw |
20:59:08 | Yardanico | wow really? |
20:59:16 | Araq | I mean I dunno how, but Guido claims that. |
20:59:28 | Yardanico | well I was surprised about Nim having bigger influence from Modula 3, time to see what is Modula 3 :D |
20:59:33 | FromGitter | <kayabaNerve> disruptek: Yep, just got there. Thank you. |
21:07:23 | disruptek | 1.0.6 is frozen, right? |
21:07:52 | Araq | yes |
21:08:01 | Araq | http://u.cs.biu.ac.il/~wiseman/iri-e2008.pdf and oh look, it's a security problem |
21:08:21 | Araq | „An overflow in kernel stack is a common bug in |
21:08:21 | Araq | the Linux operating system. These bugs are difficult |
21:08:21 | Araq | to detect because they are created as a side effect of |
21:08:23 | Araq | the code and not as an inherent mistake in the |
21:08:25 | Araq | algorithm implementation.“ |
21:08:39 | Araq | yep, wrong programming language for the job. |
21:09:23 | Araq | I mean, by the logic that is commonly applied for "language X is unsuitable for kernel development because it's not C." |
21:10:06 | FromDiscord_ | <Recruit_main_70007> any good references for nim vuejs or at least only vuejs? |
21:10:31 | * | muffindrake joined #nim |
21:11:14 | disruptek | karax is friendliest. |
21:11:16 | disruptek | !repo karax |
21:11:18 | disbot | https://github.com/pragmagic/karax -- 9karax: 11Karax. Single page applications for Nim. 15 481⭐ 41🍴 7& 11 more... |
21:13:36 | disruptek | it's too bad nimble doesn't honor github releases. |
21:15:31 | leorize | nimble tries to be VCS-agnostic |
21:16:03 | disruptek | i doubt it. |
21:16:44 | leorize | well there are mecurial-hosted nimble packages out there |
21:17:00 | disruptek | yeah, less than 0.1% of all registered packages. |
21:17:31 | leorize | and they does work with nimble, nimble knows how to clone them |
21:17:41 | disruptek | great. that's really awesome. |
21:17:41 | leorize | I think it was part of the design |
21:17:48 | leorize | then everyone just use git :P |
21:18:08 | disruptek | Prompt: Build failed for '[email protected]', would you like to try installing 'nimterop@#head' (latest unstable)? [y/N] |
21:18:17 | disruptek | of course it did. |
21:18:40 | * | FromGitter quit (Remote host closed the connection) |
21:18:59 | * | FromGitter joined #nim |
21:19:31 | leorize | --debug |
21:19:45 | leorize | I'm aliasing nimble into nimble --debug |
21:19:50 | leorize | much easier to dealt with |
21:23:28 | shashlick | What happened |
21:23:42 | * | NimBot joined #nim |
21:23:58 | disruptek | trying to figure out what treesitter needs so i can build it. |
21:25:24 | disruptek | apparently, my gcc can build nim but not treesitter. |
21:25:31 | Araq | https://blogs.msmvps.com/kernelmustard/2004/08/30/stack-size-matters/ |
21:25:37 | Araq | https://googleprojectzero.blogspot.com/2016/06/exploiting-recursion-in-linux-kernel_20.html |
21:25:44 | Araq | if you want to read more about it |
21:26:35 | leorize | nim don't have a stack size checker last time I checked |
21:27:54 | leorize | you can make a statically oversized array and it wouldn't be caught :P |
21:28:55 | disruptek | obviously, nim isn't the right language, either. |
21:29:42 | leorize | hmm, is this possible to check for this? |
21:29:50 | Araq | only asm is really good for low level stuff. |
21:29:51 | leorize | we can have the compiler compute the needed stack size, right? |
21:31:52 | Araq | I think you still misunderstand me. |
21:32:26 | leorize | I'm not talking about that topic, sorry :p |
21:32:53 | leorize | I'm refering to the one where you can make an array[10000000, int] in Nim that has been posted somewhere in the forum :P |
21:33:18 | leorize | it'd be nice to have the compiler catch that |
21:33:28 | Araq | ah yeah, we should |
21:33:29 | leorize | but I understand if it's just too complicated and not worth it |
21:33:36 | Araq | no, it's useful |
21:33:41 | Araq | and easy enough to do |
21:37:34 | shashlick | disruptek: how are you building tree-sitter |
21:37:35 | leorize | so how should it be done? |
21:37:43 | shashlick | It needs to link with c++ |
21:37:50 | shashlick | See config.nims |
21:37:56 | disruptek | yeah, it was a cmake issue. i fixed it. thanks, though. |
21:38:02 | shashlick | Ok cool |
21:38:06 | disruptek | now trying to sort out openssl. |
21:38:13 | shashlick | What you working on |
21:38:28 | disruptek | ci in aws lambda |
21:38:44 | shashlick | nimph? |
21:38:55 | leorize | Araq: afaict you can set the stack size in most OS-es, but should that be done? |
21:38:56 | disruptek | anything. |
21:39:06 | disruptek | i like big stacks and i cannot lie. |
21:39:38 | Araq | leorize: I'm thinking of an error message or warning |
21:39:54 | Araq | "array too large and you fool put it on the stack" |
21:40:15 | leorize | yea, but how much stack is too large? |
21:40:22 | leorize | for Windows it's 1MB by default |
21:40:29 | leorize | *nix is around 8MB |
21:40:40 | disruptek | whoa. i'm hooked and i can't stop starin'. |
21:40:49 | leorize | but Windows you can set stack size at link time |
21:40:54 | leorize | *nix depends on the environment |
21:41:07 | Araq | just pick some round number, 1_000_000 |
21:41:51 | leorize | so we are going for an approximate? |
21:42:32 | leorize | and do we only check array size or every variables? |
21:43:56 | Araq | local variables |
21:44:04 | leorize | lol, not even rust check for this |
21:44:36 | leorize | https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=7205785734207f1740425634ef29099f |
21:45:09 | leorize | Araq: function calls also consume stack, do we check that? |
21:45:34 | Araq | we have some half assed mechanism in debug mode |
21:46:10 | leorize | I mean statically :P |
21:46:12 | Araq | however, now to something much more important |
21:46:40 | Araq | imagine you're a robot built by aliens. |
21:46:53 | disruptek | they never gave me an imagination. |
21:47:00 | Araq | and you can say "Danger, Will Robinson!" |
21:47:05 | Araq | but nothing else. |
21:47:15 | Araq | how does that work? |
21:47:44 | Araq | now that's what keeps me up at night... |
21:54:31 | * | Ven`` joined #nim |
22:00:24 | * | a_b_m joined #nim |
22:00:27 | * | a_b_m quit (Remote host closed the connection) |
22:01:08 | Araq | ok, I figured it out. it can say more than that. it doesn't want to. |
22:02:50 | * | abm quit (Ping timeout: 240 seconds) |
22:03:08 | disruptek | the remake is horribad. |
22:05:10 | leorize | is this some high iq talks that I am not supposed to understand? :p |
22:05:19 | disruptek | yep. |
22:07:24 | Yardanico | wait nim actually has support for stdin file |
22:07:26 | Yardanico | 0_0 |
22:07:54 | rayman22201 | Hey everyone. Any progress on arc async without me Disruptek? I had work stuff all week so I've been a ghost. |
22:08:03 | Yardanico | https://github.com/nim-lang/Nim/blob/master/compiler/cmdlinehelper.nim#L29 |
22:08:38 | disruptek | no, no one will tell me if we're waiting for closure cursors or what. |
22:08:45 | Yardanico | who |
22:09:05 | rayman22201 | I think Araq is right. Alien robots |
22:09:45 | rayman22201 | I thought it might be, but Araq wasn't sure if that was the real problem. |
22:10:02 | rayman22201 | Closure cursors, not alien robots lol |
22:10:28 | disruptek | alien robots aren't really a problem. |
22:11:31 | rayman22201 | I'm not familiar enough with the code gen to really understand it enough. I need time to grok that part of the compiler. |
22:12:21 | rayman22201 | Alien robots are probably the solution |
22:13:19 | rayman22201 | Or maybe Clyybber is close enough to an alien robot to help 😝 |
22:16:05 | disruptek | clyybber, bring me my alien robot. |
22:16:37 | disruptek | it's amazing to me how long stupid work takes. |
22:18:19 | rayman22201 | 80 / 20 rule at work |
22:27:05 | * | crem quit (Ping timeout: 246 seconds) |
22:27:49 | * | nsf quit (Quit: WeeChat 2.7) |
22:28:52 | * | crem joined #nim |
22:43:04 | * | dddddd_ joined #nim |
22:45:35 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:46:23 | * | dddddd quit (Ping timeout: 272 seconds) |
22:53:47 | * | dddddd_ is now known as dddddd |
22:56:02 | Yardanico | how the heck a guy made a nim quine in 55 chars |
22:56:22 | Yardanico | I've only managed to make the basic one |
22:56:24 | Yardanico | import strutils;var a="import strutils;var a=$#;echo a%a.escape";echo a%a.escape |
22:56:37 | Yardanico | but this is 81 chars (also need newline at the end for full correctness) |
22:57:05 | * | Pqzcih5 quit (Remote host closed the connection) |
22:58:14 | * | Pqzcih5 joined #nim |
23:02:09 | * | Ven`` quit (Read error: Connection reset by peer) |
23:02:15 | * | Ven``_ joined #nim |
23:04:38 | * | Ven``_ quit (Client Quit) |
23:14:26 | FromDiscord_ | <DeltaPHC> That guy is at the top of a lot of things |
23:14:54 | disruptek | let's kill him. |
23:15:22 | Yardanico | @DeltaPHC yeah I know, sometimes I feel like he cheated somehow xd |
23:29:38 | * | ng0 joined #nim |
23:29:38 | * | ng0 quit (Changing host) |
23:29:38 | * | ng0 joined #nim |