00:03:07 | FromDiscord | <Rika> > leor_ze: and to make you feel better, most of them tried to make nim work like python the first two weeks writing nim :P |
00:03:07 | FromDiscord | <Rika> hey i was a python user but i never ever even had the thought of making nim look or work like python |
00:03:37 | zacharycarter | shashlick - no let me try that |
00:04:31 | FromDiscord | <Rika> also good morning |
00:05:05 | FromDiscord | <Rika> i kinda need help figuring out how smoothing a "per second" measure would work; its hard to describe |
00:12:30 | * | dadada quit (Ping timeout: 256 seconds) |
00:14:35 | * | exelotl joined #nim |
00:16:50 | FromDiscord | <Rika> oh shit... i think i just fixed it lmao |
00:18:32 | leorize | I said most, not all |
00:18:56 | shashlick | I tried cimgui this morning, it works on the command line itself |
00:19:18 | FromGitter | <kaushalmodi> @timotheecour It was about the support of --backend for :test: code blocks |
00:19:58 | FromGitter | <kaushalmodi> Then I followed up in a separate PR. Your work made it easy to build that PR on. |
00:20:31 | shashlick | @zacharycarter - `toast -pnr -E_ -F_ -f:ast2 -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS cimgui.h` |
00:21:21 | * | xet7 quit (Remote host closed the connection) |
00:21:49 | * | xet7 joined #nim |
00:23:40 | * | dadada joined #nim |
00:24:04 | * | dadada is now known as Guest94046 |
00:24:31 | FromDiscord | <Never Listen To Beef> What do you mean it works on the command line itself? |
00:29:38 | FromDiscord | <exelotl> man, jester with this bootleg template engine is pretty nice :) |
00:29:39 | FromDiscord | <exelotl> https://cdn.discordapp.com/attachments/371759389889003532/709562898229362736/unknown.png |
00:31:04 | FromDiscord | <exelotl> I guess I should try an ORM |
00:34:44 | shashlick | Beef: I meant creating a Nim wrapper of cimgui with nimterop on the command line |
00:35:13 | FromDiscord | <Anuke> Question about this Discord nim library: https://github.com/krisppurg/dimscord |
00:35:13 | FromDiscord | <Anuke> |
00:35:14 | FromDiscord | <Anuke> When attempting to run an extremely basic bot with event handling, it doesn't start up. The bot appears online briefly, but then goes back offline. Code: https://play.nim-lang.org/#ix=2lI8 |
00:35:14 | FromDiscord | <Anuke> |
00:35:18 | FromDiscord | <Anuke> The code compiles, but gives me the following error, originating from the last line: "Exception message: socket closed. Exception type: It appears that the library has detected that you put your computer to sleep. - Unfortunately, this error is fatal resulting in some errors." |
00:35:18 | FromDiscord | <Anuke> |
00:35:18 | FromDiscord | <Anuke> This is being run on a VPS, so obviously I'm not putting my computer to sleep. What's broken here? |
00:37:39 | zacharycarter | sounds like a question for the author of dimscord |
00:37:46 | FromDiscord | <Rika> @KrispPurg |
00:38:03 | FromDiscord | <Anuke> *OS is Ubuntu 18.04, if it matters* |
00:40:15 | * | zagani quit (Quit: Leaving) |
00:42:46 | zacharycarter | shashlick: `-f:ast2` worked for cimgui - thanks |
00:42:51 | zacharycarter | nimterop seems way slower now though |
00:42:54 | zacharycarter | compile times are bad |
00:47:27 | Prestige | Is there a way to get a ref to a seq rather than a copy if you're assigning it to a new variable? |
00:48:06 | zacharycarter | but it's an improvement either way! no longer need all those cOverrides |
00:48:11 | zacharycarter | and hopefully compile times will get better |
00:48:15 | shashlick | Regex has added a lot of dependencies |
00:48:19 | zacharycarter | ah |
00:48:33 | shashlick | But toast also uses the compiler ast |
00:48:47 | shashlick | Can you confirm it is compiled with danger? |
00:48:57 | zacharycarter | well maybe I'll just use nimterop to generate the bindings then |
00:49:18 | shashlick | I'll spend some time profiling |
00:49:23 | zacharycarter | okay :) |
00:49:27 | shashlick | Can you give me some numbers? |
00:49:39 | shashlick | Or a wrapper I can test with |
00:50:09 | zacharycarter | let me get some numbers |
00:50:12 | shashlick | Hope you don't use -f or cDisableCaching() |
00:50:28 | zacharycarter | I don't - just `-f:ast2` |
00:50:41 | shashlick | No I mean to Nim itself |
00:50:47 | zacharycarter | no neither |
00:51:02 | shashlick | First time is slow, after that it should be cached |
00:51:11 | shashlick | But ya still willing to profile |
00:51:28 | shashlick | Is the toast command itself slow or when called by the wrapper |
00:53:23 | zacharycarter | https://gist.github.com/zacharycarter/72c333314ca366fc1f58b3c72c8310fb takes 12.919 seconds to compile |
00:53:56 | zacharycarter | with a release build of Nim |
00:54:16 | shashlick | There's no cImport in that |
00:54:25 | zacharycarter | no there's not |
00:54:34 | zacharycarter | but it's still taking 12.919 seconds to compile |
00:55:16 | zacharycarter | not just the first time either |
00:56:01 | FromDiscord | <KingDarBoja> Argh, I hate power ouytages |
00:56:11 | FromDiscord | <KingDarBoja> outages*, they cut off my inspiration to code |
00:56:15 | zacharycarter | oh wait one second |
00:56:21 | zacharycarter | I think I pasted the wrong file shashlick |
00:56:37 | FromDiscord | <KingDarBoja> And again, posted on general instead of off-topic 🤦 |
00:56:59 | zacharycarter | https://gist.github.com/zacharycarter/72c333314ca366fc1f58b3c72c8310fb |
00:57:10 | zacharycarter | shashlick: that's the one taking 12.9 seconds to compile |
00:57:41 | shashlick | can you compile it with the toast command line by itself |
00:57:47 | shashlick | the wrapper should print out the command line |
00:57:53 | shashlick | you can just run that |
00:58:10 | zacharycarter | maybe there wasn't much of an increase in compile time - with 0.4.3 it's still taking 12 seconds |
00:58:41 | shashlick | what about on a second try when caching kicks in |
00:58:56 | zacharycarter | same |
00:59:24 | zacharycarter | most of the time is spent in compiling nim sources |
00:59:30 | zacharycarter | toast seems to be fairly quick |
00:59:56 | zacharycarter | is there a way to spit out what toast command is being run? |
01:00:11 | zacharycarter | ah I see it nevermind |
01:00:38 | zacharycarter | yeah toast is fast - it's compiling the nim code |
01:01:49 | zacharycarter | where the slowness resides |
01:01:56 | Prestige | I suppose seqs are always copy-only.. hmm |
01:02:02 | * | exelotl quit (Ping timeout: 260 seconds) |
01:03:17 | shashlick | ya i might need to see how to reduce what gets pulled into the wrapper |
01:03:24 | * | ryan_ is now known as longer |
01:03:25 | shashlick | takes 6 seconds for me |
01:03:48 | zacharycarter | I'm streaming too so my machine might be a bit slower |
01:03:54 | zacharycarter | but either way 6 seconds is not great |
01:05:28 | shashlick | what is a good metric |
01:05:40 | shashlick | that's including compilation of all sources and linking, etc. |
01:06:51 | * | konvertex quit (Ping timeout: 260 seconds) |
01:06:55 | zacharycarter | I guess whatever it would take to compile the generated wrapper without nimterop in the picture |
01:07:07 | zacharycarter | I'm fine taking a hit on the first compilation |
01:07:16 | zacharycarter | but afterwards it should be as fast as compiling the bindings themselves, no? |
01:08:43 | shashlick | yes but you are still pulling in cimport, build and all their deps and the compiler will go through them |
01:08:54 | shashlick | ideally it shouldn't do anything since all that should be cached |
01:08:57 | zacharycarter | yeah |
01:09:00 | shashlick | perhaps when incremental compilation is faster |
01:09:11 | shashlick | anyway, i'm pushing more and more fucntionality into toast |
01:09:12 | zacharycarter | until then I probably just have to use nimterop like a c2nim |
01:09:20 | zacharycarter | or just use toast |
01:09:32 | shashlick | so eventually it will become a separate artifact generation step |
01:09:44 | shashlick | some ideas rolling around in my head |
01:15:51 | * | dddddd quit (Remote host closed the connection) |
01:20:05 | * | minnr joined #nim |
01:21:24 | leorize | Prestige: yea, seqs are value types |
01:22:10 | Prestige | leorize: is there no way to get a ref? |
01:23:23 | Prestige | I have a table of Table[Foo, seq[Bar]] and I'm not wanting to access this.myTable[myFoo][barIndex] over an over, is all I'm trying to do |
01:23:57 | Prestige | so inside a proc body when I access that a lot, I was wanting let myBars = this.myTable[myFoo] |
01:26:44 | FromDiscord | <Never Listen To Beef> I'm a dumb dumb, but couldnt you just use a ptr? |
01:27:03 | Prestige | that's what I'm curious about, I think I should be able to |
01:27:07 | zacharycarter | you can of course |
01:27:11 | zacharycarter | but it's not a managed pointer |
01:27:26 | zacharycarter | although the seq's memory will be managed by Nim |
01:27:46 | Prestige | I need to read up on pointers in nim |
01:28:09 | zacharycarter | can also do - ``` |
01:28:11 | zacharycarter | proc box[T](x: T): ref T = new(result); result[] = x``` |
01:29:14 | minnr | Yeah I was just going to say you could make an object type with a seq as a field, but the box proc looks simpler. |
01:29:51 | disruptek | it won't be easy to figure out if we can cache nimterop macro stuff. |
01:29:55 | Prestige | ah interesting, so that creates a new pointer and assigns its value at the pointer's location to T? |
01:30:26 | zacharycarter | it creates a managed ref and assigns the value to the memory at the refs address |
01:30:40 | FromDiscord | <Rika> ref seq[]s are almost the same as seq[], but the pointer is now managed (from what ive seen in nim, it does not create a double pointer) |
01:30:41 | Prestige | very neat, thank you |
01:30:43 | zacharycarter | Nim distinguishes references from pointers - pointers aren't traced by the memory subsystem |
01:30:47 | zacharycarter | references are |
01:31:50 | zacharycarter | you could also just use a `var` parameter when passing the seq to a proc |
01:32:10 | zacharycarter | and essentially a managed pointer will be passed to that proc |
01:32:26 | minnr | Probably an obvious answer, but for countup(), the docs say "Note: This fails to count to high(int) if T = int for efficiency reasons." Does this just mean if it ever gets to the max int value, it will fail? Thanks. |
01:32:48 | Prestige | so I'm grabbing it from `this: WindowManager` which is passed into the proc, WindowManager has that table I was speaking of earlier |
01:32:52 | zacharycarter | one way to find out |
01:33:34 | * | D_ quit (Quit: No Ping reply in 180 seconds.) |
01:34:55 | zacharycarter | well then a var parameter won't help you |
01:35:32 | zacharycarter | I guess if you're worried about efficiency, don't use a seq? |
01:35:32 | * | D_ joined #nim |
01:35:38 | zacharycarter | use an array |
01:35:52 | zacharycarter | or store pointers to a seq in the table |
01:35:59 | zacharycarter | but just ensure its lifetime |
01:36:27 | Prestige | was mostly trying to make the code more readable |
01:36:39 | zacharycarter | or store refs - but be mindful that every time you instantiate a ref you're allocating from the heap |
01:37:12 | zacharycarter | I tend to shy away from sequences unless I truly need a dyanmic array |
01:37:34 | zacharycarter | using an array with a sensible size limit usually works just fine |
01:37:43 | zacharycarter | and is how most C code is written |
01:37:55 | * | a_chou joined #nim |
01:37:57 | Prestige | Using it for a window manager, so I could probably set a size limit pretty easily |
01:38:06 | zacharycarter | I imagine so |
01:38:17 | Prestige | it's a seq for a number of windows in a tag (like a workspace) |
01:38:21 | FromDiscord | <Never Listen To Beef> I mean if you have more than 32/64 windows on a single tag you're a monster and should close their window manager |
01:38:26 | * | a_chou quit (Client Quit) |
01:38:28 | Prestige | LOL |
01:38:36 | Prestige | Yeah I was thinking a 32 win cap |
01:38:42 | FromDiscord | <Varriount> What's `-f:ast2`? |
01:38:43 | Prestige | you can't even see 32 windows in a twm |
01:38:54 | * | chemist69 quit (Ping timeout: 256 seconds) |
01:38:55 | * | a_chou joined #nim |
01:38:59 | FromDiscord | <Never Listen To Beef> Well 16 is more than enough imo |
01:39:02 | * | a_chou quit (Remote host closed the connection) |
01:39:03 | FromDiscord | <Never Listen To Beef> If anymore move to the next |
01:39:28 | Prestige | I once tested a wm by spawning a ton of windows and I think it crashed around 16 in a single tag |
01:39:40 | Prestige | Idk how I feel about the wm I'm writing having that happen |
01:40:04 | Prestige | I could just check the limit and not allow it without crashing though... |
01:40:06 | FromDiscord | <Never Listen To Beef> Can also `notify-send "Eh fucko you spawned more than 16 windows and i moved the newest one to Tag"` |
01:40:47 | Prestige | Hm |
01:40:52 | * | chemist69 joined #nim |
01:40:56 | Prestige | Okay I may do that |
01:42:14 | FromDiscord | <Never Listen To Beef> The fucko message? |
01:42:44 | Prestige | Lol no just capping the # of windows |
01:43:22 | * | vqrs_ quit (Ping timeout: 260 seconds) |
01:43:30 | FromDiscord | <Never Listen To Beef> You're no fun |
01:43:46 | FromDiscord | <Rika> close a random window when the cap is exceeded 🙂 |
01:44:02 | Prestige | Heh |
01:44:17 | Prestige | I'll pop up a window like a windows98 error message |
01:44:29 | FromDiscord | <Never Listen To Beef> Just send a notification |
01:44:35 | FromDiscord | <Never Listen To Beef> Cmon do the lazy thing |
01:45:10 | * | vqrs joined #nim |
01:45:38 | minnr | Just an update on my question about countup(): it's a runtime error (overflow), but with -d:danger, it doesn't stop at int.max, it starts counting back down... guess I'll use int.max - 1 instead. |
01:47:33 | zacharycarter | btw - streaming in case anyone wants to watch me port C to Nim code - https://www.twitch.tv/zachary_carter |
01:47:59 | FromDiscord | <Never Listen To Beef> Oh congrats it's still full screened 😄 |
01:48:04 | leorize[m] | Prestige: you do know you can just use a template, right? |
01:48:29 | zacharycarter | thanks - I try |
01:48:39 | Prestige | In order to not use this.myTable[myFoo] leorize[m] ? |
01:51:05 | FromDiscord | <Never Listen To Beef> So now to actually give some critique you're way tooo quite |
01:51:17 | FromDiscord | <Never Listen To Beef> quiet* |
01:51:32 | * | Guest94046 quit (Ping timeout: 260 seconds) |
01:52:21 | Prestige | oh, macos |
01:53:47 | * | dadada joined #nim |
01:54:10 | * | dadada is now known as Guest83646 |
02:02:07 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:05:53 | FromDiscord | <Never Listen To Beef> I mean Zach it apparently doesnt even seem to suport geometry so i'd imagine compute would be even further along |
02:06:13 | * | Jjp137 quit (Read error: Connection reset by peer) |
02:06:57 | * | Jjp137 joined #nim |
02:07:07 | * | sagax quit (Quit: Konversation terminated!) |
02:16:02 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:18:03 | * | muffindrake joined #nim |
02:18:04 | leorize | Prestige: yea |
02:18:08 | * | Guest83646 quit (Ping timeout: 272 seconds) |
02:18:15 | leorize | or std / byaddr, though I'm not a fan of that module |
02:18:48 | Prestige | I'll need to look into that, don't have a firm grasp on templates yet |
02:20:16 | leorize | also std / with is a nice macro |
02:21:05 | skrylar[m] | table construction syntax is neat. |
02:23:15 | * | minnr quit (Quit: Leaving) |
02:23:34 | skrylar[m] | `var sprog = shader_from_files("vert.glsl", "frag.glsl", {0: "vpos", 1: "vtex"})` |
02:23:45 | * | dadada__ joined #nim |
02:25:47 | FromDiscord | <Never Listen To Beef> You mean the tuple array? |
02:27:16 | skrylar[m] | yes. its called table construction in the AST |
02:29:49 | FromDiscord | <Technisha Circuit> > @Technisha Circuit sup bro |
02:29:49 | FromDiscord | <Technisha Circuit> Hi! |
02:30:10 | zacharycarter | ? |
02:30:31 | FromDiscord | <Technisha Circuit> Just replying to @KingDarBoja |
02:30:56 | FromDiscord | <KingDarBoja> What's up? 😄 |
02:30:58 | zacharycarter | oh |
02:31:06 | FromDiscord | <KingDarBoja> I really loving Nim |
02:31:08 | zacharycarter | looked like you were saying hi to yourself |
02:31:19 | leorize | guess the bridge doesn't handle that |
02:31:31 | FromDiscord | <KingDarBoja> 😄 |
02:31:38 | FromDiscord | <KingDarBoja> Finished the refactoring of my parser |
02:31:43 | FromDiscord | <KingDarBoja> Pushing the changes now yeyy |
02:32:54 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim Look leorize-sensei |
02:35:19 | * | silvernode joined #nim |
02:35:36 | silvernode | Good evening! |
02:36:13 | FromDiscord | <KingDarBoja> Good night 😄 |
02:36:29 | silvernode | lol |
02:37:06 | FromDiscord | <KingDarBoja> Welcome 😄 |
02:39:58 | leorize | KingDarBoja: AST looks good, though I'm seeing a cyclic structure over there :P |
02:40:36 | leorize | your Token is cyclic, which means it's slow and a sign of maybe you're not doing it right :) |
02:42:03 | FromDiscord | <KingDarBoja> Cyclic? whereeee? |
02:43:18 | leorize | doubly linked list is cyclic by nature: `[ node ] <-> [ node ]` (ie. they can each keep one another alive) |
02:44:04 | FromDiscord | <KingDarBoja> Not sure what you mean 😄 |
02:45:08 | leorize | it means that to get rid of the two nodes, trial deletion and stack scanning has to be done |
02:45:43 | FromDiscord | <KingDarBoja> Why it is happening, I am really dumb haha |
02:46:38 | leorize | imagine this `var a = Token(); a.next = Token(prev: a)` |
02:47:01 | leorize | now you set `a = nil` |
02:47:09 | leorize | the ref count of `a` is decreased by 1 |
02:47:12 | * | dadada__ quit (Ping timeout: 256 seconds) |
02:47:21 | leorize | but it's being kept alive by the `.next` node |
02:47:31 | FromDiscord | <KingDarBoja> ahh |
02:47:50 | leorize | well the GC can handle this, but it slows things down |
02:48:02 | FromDiscord | <KingDarBoja> well I don't need to delete nodes tbh |
02:48:06 | FromDiscord | <KingDarBoja> tokens* |
02:49:05 | FromDiscord | <Technisha Circuit> Im alive- |
02:49:50 | FromDiscord | <KingDarBoja> It is built like that ref in source implementation (JS) |
02:50:03 | FromDiscord | <KingDarBoja> And you don't need to remove those tokens tbf |
02:53:45 | * | dadada joined #nim |
02:54:09 | * | dadada is now known as Guest38854 |
02:55:13 | Prestige | Created this looking from some examples, seems to work: https://play.nim-lang.org/#ix=2lJJ |
02:55:23 | Prestige | but I don't entirely understand it |
02:55:59 | Prestige | also I think that may be creating a copy of the seq[int].. |
02:56:23 | leorize | yea you are |
02:56:37 | leorize | so templates are macros but lightweight :P |
02:56:56 | leorize | they are basically a prebuilt AST with placeholders (which are the parameters) |
02:57:18 | FromDiscord | <KingDarBoja> leorize: ? |
02:57:33 | FromDiscord | <codic> how do i import a string in nim? |
02:57:40 | FromDiscord | <Technisha Circuit> Hahahaha |
02:57:41 | FromDiscord | <codic> like `"thing"` would become `import thign` |
02:57:44 | leorize | the AST of whatever parameter will be substituted into the prebuilt AST and substituted into the template call |
02:57:46 | Prestige | oh I think I know what you wanted me to do now leorize |
02:57:50 | FromDiscord | <Technisha Circuit> You ask them after i asked you |
02:58:00 | Prestige | perhaps |
02:58:37 | leorize | template vals: untyped = table[key] <- boom now you got your own shortcut :) |
02:59:01 | leorize | instances of `vals` will be transformed into `table[key]` :) |
02:59:15 | FromDiscord | <Rika> @codic you dont |
02:59:40 | leorize | well you can, just not recommended |
03:00:21 | Prestige | Might've lost me there, that was supposed to be shorthand for an actual template right? |
03:00:43 | Prestige | I honestly feel like I understand macros better than templates lol |
03:01:03 | leorize | give me some noisy code that you want to simplify |
03:01:07 | leorize | I'll help you with this :P |
03:01:36 | FromDiscord | <codic> why isn't it recommended? |
03:01:59 | Prestige | Thanks - leorize https://play.nim-lang.org/#ix=2lJL (does not compile, it's the literal function I'm wanting to clean up) |
03:02:09 | FromDiscord | <Technisha Circuit> Is there a way for me to predefine variables for any modules i import? A python lib i use can do this and i want to do it in Nim now |
03:02:14 | Prestige | there's a lot of this.tagTable[this.selectedTag] that I want to shorten |
03:02:56 | FromDiscord | <Rika> @Technisha Circuit you can export variables |
03:03:06 | FromDiscord | <Technisha Circuit> How does that work? |
03:03:09 | FromDiscord | <Rika> same way |
03:03:12 | FromDiscord | <Rika> name* |
03:03:18 | FromDiscord | <Technisha Circuit> Ik the lib in python i use uses weakref |
03:03:19 | Prestige | Full source leorize https://github.com/avahe-kellenberger/nimdow/blob/master/src/nimdowpkg/windowmanager.nim#L344 |
03:03:22 | FromDiscord | <Technisha Circuit> So export? |
03:03:27 | FromDiscord | <Rika> var a* = 0 |
03:03:29 | FromDiscord | <Rika> or something |
03:03:38 | FromDiscord | <Technisha Circuit> Oh okay, thanks |
03:03:43 | FromDiscord | <Rika> then if you import it'll be there too |
03:03:54 | FromDiscord | <Technisha Circuit> Nice! |
03:03:56 | FromDiscord | <Technisha Circuit> Thanks! |
03:04:10 | FromDiscord | <Technisha Circuit> How about if i have a predefined variable? |
03:04:23 | FromDiscord | <Rika> waht do you mean |
03:04:54 | leorize | Prestige: https://play.nim-lang.org/#ix=2lJO <- my experiment with `std/with`, may not work |
03:05:01 | leorize | I'll give you one with templates in just a bit :P |
03:05:03 | FromDiscord | <Technisha Circuit> For example let's say i have a variable that's passed as an argument |
03:05:09 | FromDiscord | <codic> Lemme show you |
03:05:15 | FromDiscord | <Technisha Circuit> And i want it to be defined in every file i export |
03:05:27 | FromDiscord | <codic> https://hastebin.com/cabuqewava.cs |
03:05:33 | Prestige | leorize: oh that's neat, it like creates an alias for the variable to _ |
03:05:37 | * | FromDiscord <KingDarBoja> You stealing Rika away from me |
03:05:44 | leorize | does it work? :P |
03:05:50 | leorize | I haven't tried |
03:06:06 | FromDiscord | <Rika> precisely as codic wrote actually |
03:06:12 | Prestige | Gotta try, 1 min |
03:06:19 | FromDiscord | <Rika> i still dont understand what you mean by passed as an argument |
03:06:27 | FromDiscord | <Rika> you cant export variables in procs i dont think |
03:06:36 | FromDiscord | <codic> i think he means having an argument to a proc exported |
03:06:39 | FromDiscord | <Technisha Circuit> Thanks |
03:06:52 | FromDiscord | <Rika> you can export a proc but not its indiv. arguments |
03:06:52 | FromDiscord | <codic> ok what |
03:06:56 | FromDiscord | <Technisha Circuit> Aw |
03:07:11 | FromDiscord | <Rika> you can make another proc w/ the arguments you want to export |
03:07:14 | FromDiscord | <Technisha Circuit> Also, how would i import nim files dynamically? |
03:07:17 | FromDiscord | <Rika> then that proc calls the all-argument proc |
03:07:19 | FromDiscord | <Technisha Circuit> Oh? |
03:07:42 | Prestige | leorize: giving me some errors about undecleared routines |
03:07:42 | FromDiscord | <Rika> you cannot import nim files dynamically, you can import dynamic libraries dynamically i guess |
03:07:54 | zacharycarter | you can actually |
03:07:58 | leorize | Prestige: oh, can I see the errors? |
03:07:58 | FromDiscord | <Rika> https://nim-lang.org/docs/dynlib.html @Technisha Circuit |
03:08:15 | zacharycarter | see this library for an example |
03:08:19 | zacharycarter | or this project rather |
03:08:28 | FromDiscord | <Technisha Circuit> Thanks |
03:08:41 | Prestige | https://0x0.st/i_0R.txt |
03:09:16 | Prestige | 'template/generic instantiation of `with` from here' |
03:09:20 | zacharycarter | https://github.com/sheosi/tart/blob/master/tart/main.nim#L14 |
03:09:23 | leorize | try putting a `_` in the `len()` |
03:09:28 | leorize | len(_) |
03:09:38 | FromDiscord | <Rika> @KingDarBoja so what do you think about my suru library? |
03:09:50 | FromDiscord | <Technisha Circuit> Also, how would i include the python runtime in Nim?? |
03:09:54 | FromDiscord | <Technisha Circuit> ?* |
03:09:55 | zacharycarter | it's not importing at runtime but it is importing based on the contents of a directory |
03:09:58 | Prestige | expression cannot be called leorize |
03:09:59 | zacharycarter | so I guess it's somewhat dynamic |
03:10:14 | FromDiscord | <Technisha Circuit> Fhankz Zacharycarter! |
03:10:25 | FromDiscord | <codic> > Fhankz |
03:10:27 | zacharycarter | these are some random ass questions |
03:10:36 | FromDiscord | <Rika> yeah lmao |
03:10:47 | zacharycarter | there are some projects that bridge Nim and Python - just search on github for them |
03:10:47 | leorize | Prestige: I guess it's not that versatile, so here's the template version: https://play.nim-lang.org/#ix=2lJP |
03:10:53 | FromDiscord | <KingDarBoja> Rika: which one? |
03:10:57 | zacharycarter | I don't know about including the python runtime in Nim |
03:11:09 | zacharycarter | I don't like Python so I'd never do that |
03:11:24 | Prestige | leorize: oh wow that's even cleaner. How cool, thanks :) |
03:11:40 | leorize | Prestige: for the pascal-style `with` we have this: https://github.com/Zevv/with |
03:11:43 | FromDiscord | <Technisha Circuit> Thanks* |
03:11:46 | leorize | which is basically what I did but automated :P |
03:11:56 | FromDiscord | <Technisha Circuit> :p |
03:12:04 | FromDiscord | <Rika> @KingDarBoja T_T https://github.com/de-odex/suru/ |
03:12:40 | FromDiscord | <KingDarBoja> It is pretty good if you ask me |
03:12:49 | FromDiscord | <KingDarBoja> I already starred it |
03:12:57 | skrylar[m] | neat. |
03:13:05 | FromDiscord | <KingDarBoja> Seems smoother than tdqm in Python |
03:13:08 | FromDiscord | <codic> i see manjaro. i star. |
03:13:15 | FromDiscord | <codic> jk |
03:13:16 | FromDiscord | <KingDarBoja> Ofc the use case is still minimal afaik |
03:13:26 | FromDiscord | <Rika> T_T |
03:13:37 | FromDiscord | <Rika> tqdm is too good |
03:13:49 | FromDiscord | <KingDarBoja> Because it is older |
03:14:06 | Prestige | leorize: hm either I broke something or using that template is creating a copy of the seq - going to look into it |
03:14:07 | FromDiscord | <KingDarBoja> But if you keeping addding features like multiprocessing |
03:14:12 | FromDiscord | <KingDarBoja> Ofc you will beat it hahah |
03:14:39 | FromDiscord | <Rika> > multiprocessing |
03:14:45 | FromDiscord | <Rika> oh lord, so bars in bars |
03:14:49 | FromDiscord | <KingDarBoja> Yup |
03:14:50 | FromDiscord | <Rika> or bars over bars |
03:14:52 | FromDiscord | <Rika> oh god |
03:14:58 | FromDiscord | <Rika> thats gonna be wild and insane |
03:15:00 | FromDiscord | <KingDarBoja> Pretty much |
03:15:14 | FromDiscord | <KingDarBoja> But even tdqm has flaws on it |
03:15:54 | FromDiscord | <codic> all we need is an inquirer.js port |
03:16:32 | FromDiscord | <KingDarBoja> https://github.com/tqdm/tqdm/issues/879 |
03:16:32 | FromDiscord | <Rika> i dont know how i'd support parallel bars... |
03:16:43 | Prestige | leorize: okay it's working. Thanks, this is exactly what I was looking for |
03:17:21 | FromDiscord | <KingDarBoja> codic: https://github.com/tj/commander.js#readme |
03:17:37 | * | FromDiscord <KingDarBoja> git gud son |
03:17:40 | * | Guest38854 quit (Ping timeout: 272 seconds) |
03:18:00 | FromDiscord | <KingDarBoja> Now I need to make the visitor, fuuuuu |
03:18:06 | FromDiscord | <KingDarBoja> This is gonna take a while |
03:22:11 | skrylar[m] | well tqdm (and others, rust has a few pretty ones) are open if you want spoilers |
03:22:26 | skrylar[m] | otherwise probably a multiprogress object that deals with the curses trickery in the background |
03:23:42 | FromDiscord | <KingDarBoja> OH DEAR LORD |
03:23:46 | * | dadada__ joined #nim |
03:24:41 | FromDiscord | <KingDarBoja> This JS code looks like a mess haha |
03:24:58 | skrylar[m] | inquiry? |
03:25:31 | FromDiscord | <KingDarBoja> No, Graphql-js |
03:25:38 | FromDiscord | <KingDarBoja> Some visitor function x.x |
03:25:38 | skrylar[m] | oh. |
03:25:52 | * | skrylar[m] has just been face deep in cleaning up GL machinery |
03:26:17 | FromDiscord | <KingDarBoja> Only two modules left to complete the language directory port 😄 |
03:27:04 | FromDiscord | <KingDarBoja> I think this is the hardest directory of the port hahaha |
03:29:14 | FromDiscord | <KingDarBoja> Ok gonna take a look at Golang impl |
03:30:16 | FromDiscord | <KingDarBoja> Ugh, Golang impl is way longer than Python which is longer than JS one lol |
03:34:48 | FromDiscord | <Rika> skrylar: do you think its possible without making a multiprogress object |
03:37:35 | zacharycarter | back online https://www.twitch.tv/zachary_carter |
03:47:40 | * | dadada__ quit (Ping timeout: 246 seconds) |
03:48:12 | * | avatarfighter quit (Ping timeout: 260 seconds) |
03:53:43 | * | dadada joined #nim |
03:54:07 | * | dadada is now known as Guest84854 |
03:57:47 | skrylar[m] | rika: well thats how everyone does it.. when you have more than one bar you have to start dealing with control codes and curses-esque stuff to manage them |
03:57:58 | skrylar[m] | i guess you could shunt that to global state but it doesn't exactly save anything |
03:58:13 | skrylar[m] | tqdm for instance wants you to use it to print lines while progressbars are running or you'll mess up the console |
03:59:16 | FromDiscord | <Rika> i know that |
03:59:33 | FromDiscord | <Rika> i'm thinking of just "overwriting" the stdout then restoring it after |
04:02:24 | FromDiscord | <KingDarBoja> leo: you still there? |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:43 | * | supakeen joined #nim |
04:17:48 | * | Guest84854 quit (Ping timeout: 258 seconds) |
04:19:07 | FromGitter | <gogolxdong> Is there any Groth16 implementation? |
04:23:53 | * | dadada__ joined #nim |
04:39:20 | * | zacharycarter quit (Ping timeout: 256 seconds) |
04:47:21 | skrylar[m] | snark provers? |
04:47:31 | * | dadada__ quit (Ping timeout: 246 seconds) |
04:52:40 | FromDiscord | <KingDarBoja> How can I declare this in Nim |
04:52:48 | FromDiscord | <KingDarBoja> `type VisitFunc func(p VisitFuncParams) (string, interface{})` taken from Golang file |
04:52:59 | FromDiscord | <KingDarBoja> VisitFuncParams is a struct |
04:53:16 | FromDiscord | <KingDarBoja> `type VisitFuncParams struct {... etc ...}` |
04:53:47 | * | dadada joined #nim |
04:53:48 | FromDiscord | <Rika> i have no idea how golang function syntax is structured |
04:54:11 | * | dadada is now known as Guest10624 |
04:54:54 | FromDiscord | <KingDarBoja> Neither I mate |
04:54:59 | FromDiscord | <KingDarBoja> But JS is worse in this one |
04:55:27 | FromDiscord | <KingDarBoja> `export function getVisitFn(visitor: Visitor<any>, kind: string,isLeaving: boolean): Maybe<VisitFn<any>>;` |
04:55:43 | FromDiscord | <Rika> at least its prolly more understandable |
04:55:49 | FromDiscord | <KingDarBoja> And you haven't seen what does Visitor means, this is a mess |
04:56:21 | FromDiscord | <KingDarBoja> https://github.com/graphql/graphql-js/blob/master/src/language/visitor.d.ts 😵 |
04:56:40 | FromDiscord | <KingDarBoja> This is the definition file, it should help but I got lost with all that convoluted stuff |
05:00:31 | * | rockcavera quit (Remote host closed the connection) |
05:02:27 | * | narimiran joined #nim |
05:03:04 | FromDiscord | <KingDarBoja> Well, how I can use a proc as type without being defined at the object value? |
05:03:18 | FromGitter | <gogolxdong> yes |
05:05:17 | FromDiscord | <KingDarBoja> Rika: maybe like this https://play.nim-lang.org/#ix=2lJZ |
05:09:20 | leorize | KingDarBoja: https://nim-lang.org/docs/manual.html#types-procedural-type |
05:12:56 | FromDiscord | <KingDarBoja> Ohhh |
05:14:00 | FromDiscord | <KingDarBoja> So I can define it like `type myFunName = proc(a: params)` |
05:14:23 | FromDiscord | <KingDarBoja> What about the return type? |
05:15:22 | FromGitter | <bung87> append `:ReturnType` |
05:15:27 | FromDiscord | <KingDarBoja> Oh, I see, doesn't matter, it is still a proc |
05:15:33 | FromDiscord | <KingDarBoja> intriging |
05:17:03 | FromDiscord | <KingDarBoja> Good night boys! |
05:17:32 | Prestige | gn o/ |
05:17:52 | * | Guest10624 quit (Ping timeout: 256 seconds) |
05:19:59 | Prestige | leorize: Looking for a way to get sys env variables (specifically XDG_CONFIG_HOME) what module would that be in? |
05:20:43 | FromGitter | <bung87> https://nim-lang.org/docs/os.html#getEnv,string,string |
05:20:54 | Prestige | ty @bung87 |
05:21:20 | FromGitter | <bung87> that's just a question that need you type `env` to search input box |
05:21:43 | Prestige | was looking around for it in the index but couldn't find it |
05:22:04 | FromGitter | <bung87> ok that's fine |
05:22:18 | Prestige | I may download the docs so I can ripgrep through proc names |
05:23:02 | FromDiscord | <Rika> isnt it already packaged when you download nim |
05:23:07 | FromDiscord | <Rika> should be there |
05:23:26 | Prestige | Hm that would be useful, I'll poke around and try to find it |
05:23:43 | * | dadada__ joined #nim |
05:24:06 | Prestige | aha it is, thanks for the tip |
05:33:38 | * | silvernode quit (Ping timeout: 260 seconds) |
05:40:57 | FromGitter | <bung87> does nim has static method? |
05:44:11 | FromDiscord | <Never Listen To Beef> what? |
05:44:43 | FromGitter | <bung87> `TypeA.staticMethod()` |
05:45:03 | FromDiscord | <Never Listen To Beef> you're describing a proc afaik |
05:45:39 | FromGitter | <bung87> I know that |
05:47:26 | FromGitter | <bung87> I am doing tranpile things, just wonder if there is conversation way to other language , (conversation may be the wrong word.) |
05:47:33 | * | dadada__ quit (Ping timeout: 256 seconds) |
05:50:13 | FromGitter | <bung87> if the transpile proccessing does not including a type infer, that wouldnot be easy convert it to proc. |
05:53:47 | * | dadada joined #nim |
05:54:10 | * | dadada is now known as Guest23741 |
05:56:30 | FromDiscord | <Never Listen To Beef> Yea idk |
06:02:40 | * | ryan_ joined #nim |
06:04:52 | * | longer quit (Ping timeout: 246 seconds) |
06:09:58 | FromGitter | <kaushalmodi> Prestige: also see https://nim-lang.github.io/Nim/os#getConfigDir |
06:10:25 | FromGitter | <kaushalmodi> You might not need to do the getEnv at all as that proc does it for you |
06:16:00 | FromDiscord | <Rika> there are no static methods in nim, but you can emulate them lol |
06:16:39 | FromDiscord | <Rika> `proc(unused: typedesc[TheType], args...): ReturnType...` can be used to emulate a static method |
06:17:37 | * | Guest23741 quit (Ping timeout: 264 seconds) |
06:23:47 | * | dadada__ joined #nim |
06:29:19 | Prestige | Neat, thanks @kaushalmodi |
06:36:56 | FromGitter | <bung87> @Rika wow, the key is `typedesc[TheType]` ,thanks that's good |
06:41:09 | * | solitudesf joined #nim |
06:43:43 | * | Vladar joined #nim |
06:52:18 | Araq | https://www.fastcompany.com/90501691/science-confirms-it-web-sites-really-do-all-look-the-same offtopic, but interesting |
06:53:12 | FromDiscord | <Never Listen To Beef> To me that feels like "Science confirms, all books look the same" |
07:03:29 | * | clemens3 quit (Ping timeout: 256 seconds) |
07:05:13 | * | gokr joined #nim |
07:09:57 | * | clemens3 joined #nim |
07:11:25 | * | gangstacat quit (Ping timeout: 240 seconds) |
07:11:49 | Araq | :-) |
07:30:39 | * | gangstacat joined #nim |
07:30:45 | * | kitech1- quit (Max SendQ exceeded) |
07:31:15 | * | kitech1 joined #nim |
07:33:53 | FromDiscord | <Yardanico> Good morning everyone |
07:34:13 | FromDiscord | <Rika> good morning yardanico |
07:36:26 | FromDiscord | <Never Listen To Beef> Helloo |
07:42:46 | FromGitter | <bung87> years during bootstrap getting popular, all website has a black top navbar.. |
07:45:27 | gokr | Araq: Hey, all good? Long time no see ;) |
07:45:34 | * | letto quit (Quit: Konversation terminated!) |
07:45:45 | gokr | Araq: Congrats on the ARC stuff btw, seems awesome. |
07:46:52 | Araq | gokr, hi, thanks. it is, most "important" packages begin to work with arc |
07:47:33 | * | letto joined #nim |
07:54:47 | * | ryan_ quit (Remote host closed the connection) |
07:54:59 | Yardanico | seems interesting - https://github.com/robertdavidgraham/wc2 (wc2 - optimizing wc with asynchronous state machine parsing) |
07:55:01 | FromDiscord | <Rika> how much memory is allocated by default given the code `var s: seq[int64]`? |
07:55:01 | FromDiscord | <KrispPurg> @Anuke use websocket 0.4.0, it's a bug in the new websocket |
07:55:08 | * | ryan_ joined #nim |
07:55:12 | Yardanico | @Rika you can easily test ;) |
07:55:30 | FromDiscord | <KrispPurg> Also, btw it was 1:35 am for me, so I was asleep |
07:55:34 | Araq | Rika: 1 or 2 machine words |
07:56:51 | FromDiscord | <Rika> oh, okay thanks |
07:57:06 | FromDiscord | <KrispPurg> If there's any more crashes try moving to the devel bran and if there are crashes on the devel branch report it to me and I'll fix them. |
07:57:16 | FromDiscord | <KrispPurg> branch* |
07:57:19 | Yardanico | afaik it didn't compile yesterday for me, I'll try again today |
07:57:22 | Yardanico | did you do any new commits? |
07:57:32 | FromDiscord | <KrispPurg> Yes |
07:57:54 | FromDiscord | <Rika> Yardanico: i dont know how to test ._. |
07:58:02 | FromDiscord | <KrispPurg> I pushed channges last night |
07:58:44 | Yardanico | /home/dian/.choosenim/toolchains/nim-1.2.0/lib/pure/json.nim(352, 41) Error: type mismatch: got <set[PermEnum]> |
07:58:46 | Yardanico | /home/dian/.nimble/pkgs/dimscord-#devel/dimscord/restapi.nim(357, 38) template/generic instantiation of `%` from here |
07:58:58 | Yardanico | hmm maybe it doesn't work on 1.2, will try on nim devel |
07:59:10 | FromDiscord | <KrispPurg> bruh wat |
07:59:22 | Yardanico | you're trying to do % for a set |
07:59:40 | FromDiscord | <KrispPurg> oh wait I moved that to restapi |
07:59:43 | FromDiscord | <KrispPurg> Fuck |
07:59:47 | Yardanico | lol |
08:00:06 | FromDiscord | <KrispPurg> I haven't commited the restapi one |
08:01:10 | FromDiscord | <KrispPurg> Just try getting the old `%` |
08:01:46 | Yardanico | also I see you have requestGuildMembers, I'll probably try it |
08:02:02 | FromDiscord | <KrispPurg> gl |
08:02:51 | FromDiscord | <KrispPurg> It hasn't finished caching other uncached member besides requestGuildMembers. |
08:40:32 | FromDiscord | <KrispPurg> @Anuke https://discordapp.com/channels/371759389889003530/371759389889003532/709675506903285821 |
08:47:40 | * | dadada__ quit (Ping timeout: 258 seconds) |
08:53:43 | * | dadada joined #nim |
08:54:07 | * | dadada is now known as Guest98310 |
09:05:18 | FromGitter | <PMunch> Hmm, my internet is super flaky today.. |
09:06:36 | FromGitter | <PMunch> Decided Gitter would be a better bet as it will load past messages whenever I get a bit of network again |
09:08:19 | * | dddddd joined #nim |
09:08:31 | FromDiscord | <Recruit_main707> could we remove the <FromGitter> thing? |
09:08:32 | FromGitter | <PMunch> I have a question about finilizers though. If I create a `ref object` type that just wraps some C pointer, and then create this object with a finilizer that will call the C library `free` function for this particular type, is that correct? |
09:08:43 | FromDiscord | <kodkuce> does any nim terminal lib support mouse? |
09:09:11 | FromGitter | <PMunch> kodkuce IIRC terminal mouse events are just sent as a special kind of keypress? |
09:09:30 | FromGitter | <PMunch> But you might need to tell the terminal that you want them somehow |
09:11:42 | FromGitter | <PMunch> Hmm, I wish Nim had a more obvious exception structure.. |
09:12:05 | FromGitter | <PMunch> Like I want to perform a call to get something from a server but then raise an exception if it fails |
09:12:15 | FromGitter | <PMunch> What would that be? |
09:12:55 | FromDiscord | <kodkuce> cant you manualy trow execption if it fails? |
09:13:12 | FromGitter | <PMunch> Yes, that's what I'm doing |
09:13:23 | FromGitter | <PMunch> But what kind of exception should it be? |
09:13:36 | * | Cthalupa quit (Ping timeout: 272 seconds) |
09:13:49 | FromDiscord | <kodkuce> exeption UnableToFetch 🙂 |
09:15:40 | FromDiscord | <Yardanico> @Recruit_main707 my bridge handles it |
09:15:55 | FromDiscord | <Yardanico> FromGitter itself is a bridge in Crystal though |
09:16:26 | FromDiscord | <Yardanico> And it doesn't run on our infrastructure ;) |
09:16:54 | * | Cthalupa joined #nim |
09:17:15 | FromGitter | <PMunch> Haha, yeah if it had something like that it would be great |
09:17:34 | * | Guest98310 quit (Ping timeout: 256 seconds) |
09:17:55 | FromDiscord | <Yardanico> IOError ? |
09:18:44 | FromDiscord | <Yardanico> HttpRequestError in httpclient inherits from IOError as well |
09:18:58 | FromGitter | <PMunch> Hmm, I guess that might be good |
09:19:08 | FromGitter | <PMunch> It might not be IO though.. |
09:19:18 | FromGitter | <PMunch> Could be that the key just doesn't exist on the server |
09:20:58 | FromDiscord | <Yardanico> Do a different exception for this one :D |
09:21:29 | FromGitter | <PMunch> That's too much work |
09:22:03 | FromGitter | <PMunch> I always dread calling exceptions in Nim because it means that I (probably) need to create a new exception type to encapsulate what I want.. |
09:22:33 | FromGitter | <PMunch> Hmm, when using `{.raises: [].}` is there a way to tell Nim that a section is safe even when it's not? |
09:23:21 | FromDiscord | <Rika> If key does not exist use key error lol |
09:23:38 | FromDiscord | <Rika> No clue on the raises one |
09:23:48 | * | dadada__ joined #nim |
09:23:58 | FromGitter | <PMunch> I want to have it on the top-level of this DLL (because I don't want it to crash), but I have things like `var myJson = %*{"somekey":{}}; myJson["somekey"]["newkey"] = "Hello world"` |
09:24:25 | FromGitter | <PMunch> @Rika, yeah I'm currently using KeyError |
09:24:50 | FromGitter | <PMunch> That code can technically raise a KeyError if "somekey" didn't exist, but logically it never will. |
09:27:30 | * | Trustable joined #nim |
09:40:37 | * | tane joined #nim |
09:41:59 | Araq | PMunch: we have {.gcsafe.}: blocks and also {.noSideEffect.} blocks |
09:42:12 | Araq | we should have .raises: [] blocks too, yay |
09:46:41 | Yardanico | btw when gcsafe will be disabled for gc:arc? :P |
09:46:47 | Yardanico | or at least be a warning |
09:47:30 | * | dadada__ quit (Ping timeout: 260 seconds) |
09:50:58 | * | liblq-dev joined #nim |
09:53:22 | FromGitter | <PMunch> Araq, I mean we do have try: <code> except: discard |
09:53:32 | FromGitter | <PMunch> So it's not like it's impossible |
09:53:45 | * | dadada joined #nim |
09:54:01 | FromGitter | <PMunch> Any input on my question about finilizers by the way? |
09:54:08 | * | dadada is now known as Guest18131 |
09:54:32 | FromGitter | <PMunch> finalizers* |
09:55:09 | Araq | lol good point |
09:55:26 | Araq | repeat the question about finalizers but they are broken with arc |
09:55:31 | Araq | fixing them... |
10:01:27 | FromGitter | <PMunch> I'm using OpenSSL to do RSA encryption in my code. There is a PRSA type that I want to keep in a cache. OpenSSL allocates this for me, and I'm supposed to call `RSA_Free` on it when I'm done with it. I have wrapped this in a `ref object` type and attach a finalizer to that object when I create it which is just a call to `RSA_Free`. Is this correct? |
10:02:17 | * | abm joined #nim |
10:02:49 | Araq | seems ok |
10:06:37 | Yardanico | btw for some reason when testing important packages with arc I forgot I could just add "gc: arc" to ~/.nim/config/nim.cfg so everything will be compiled with arc :P |
10:06:39 | FromGitter | <PMunch> Nice |
10:06:47 | Yardanico | I'll run all of them with arc now |
10:07:06 | * | Trustable quit (Remote host closed the connection) |
10:11:04 | FromGitter | <PMunch> Hmm "Error: can raise an unlisted exception: Exception" would it be possible for this error message to say *where* this error can be raised? |
10:12:34 | Yardanico | ah seems like i was too optimistic |
10:16:21 | Yardanico | if I globally specify gc: arc it'll fail because stdlib will also try to use that and will fail or something |
10:16:38 | Yardanico | if I have "gc = arc" in config/nim.cfg and do echo "Hello world" it fails |
10:16:48 | Yardanico | /home/dian/.nim/lib/system/fatal.nim(49, 5) Error: system module needs: nimDestroyAndDispose |
10:17:58 | Yardanico | and what's interesting is that boehm/markandsweep/none work when specified in global nim config, but not destructors/arc/orc |
10:19:08 | liblq-dev | do new() finalizers still work on ARC, and are they deterministic now? |
10:19:29 | Yardanico | they work for simple cases but afaik they're broken so 4raq will redo then :P |
10:19:31 | Yardanico | them* |
10:23:15 | Yardanico | oh wait nvm I just put gc = arc in ~/.config/nim/nim.cfg and it seems to work yay |
10:24:01 | Yardanico | ah no nvm :D |
10:30:26 | Araq | liblq-dev, they mostly work and yes they are deterministic |
10:31:33 | Yardanico | so apparently when doing nim c -r with gc: arc in global config it works, but with "nimble test" it fails for some reason |
10:31:44 | Yardanico | because it gets applied to .nims files as well? |
10:32:06 | Araq | PMunch: the effect tracking error messages got much better in 1.2 |
10:32:32 | FromGitter | <PMunch> This was compiled on devel.. |
10:38:38 | FromGitter | <sheerluck> yesterday I saw here nice screenshots of new https://nim-lang.org version with big nice buttons about "Install", "Try", "Run", "Docs" an so on. I hope that version will be deployed soon. |
10:40:05 | FromGitter | <PMunch> Where? |
10:40:09 | Yardanico | in this chat |
10:40:22 | Yardanico | leorize and narimiran were talking about improving the UX of the website |
10:40:39 | narimiran | i've sent a PR |
10:40:57 | narimiran | https://github.com/nim-lang/website/pull/198 |
10:41:02 | narimiran | it is like this for now |
10:41:14 | narimiran | more changes and improvements to come in future PRs |
10:41:23 | narimiran | (e.g. releases page) |
10:43:20 | FromGitter | <PMunch> Ooh, looks nice. But those buttons look like they don't align with anything (even though they appear center aligned on the first line of text on the left |
10:43:23 | FromGitter | <PMunch> ) |
10:44:59 | FromGitter | <PMunch> Pushed a new patch version of nimlsp for those interested |
10:45:35 | FromGitter | <PMunch> It fixes a bug where errors from other files would be shown at that line in the current file |
10:46:49 | Yardanico | nim extension in vscode was working a bit badly for me lately |
10:47:02 | Yardanico | more crashes (dev tools shows SIGUSR1) |
10:47:16 | FromGitter | <PMunch> Huh, the one based directly on nimsuggest? |
10:47:19 | Yardanico | yep |
10:47:27 | Yardanico | maybe it's an issue with my vscode though, idk |
10:47:44 | FromGitter | <PMunch> Hmm, I really should get syntax highlighting up and running with nimlsp |
10:48:01 | FromGitter | <PMunch> Then it should be the only plug-in you need to use Nim in an editor like e.g. Vim |
10:49:18 | * | sagax joined #nim |
10:55:42 | * | monokrom joined #nim |
11:00:30 | * | konvertex joined #nim |
11:04:31 | * | Guest18131 quit (Ping timeout: 258 seconds) |
11:06:11 | * | dadada joined #nim |
11:06:34 | * | dadada is now known as Guest67631 |
11:07:19 | Yardanico | https://forum.nim-lang.org/t/6318#38949 lol |
11:07:22 | Yardanico | if(unlikely) position < 0 |
11:09:30 | * | Ekho quit (Quit: An alternate universe was just created where I didn't leave. But here, I left you. I'm sorry.) |
11:10:01 | Araq | yeah, I have to admit, it wasn't clear to me this works |
11:11:00 | Yardanico | oh so it works everywhere, even like echo (call)5 > 0 |
11:13:29 | * | PMunch joined #nim |
11:16:13 | Araq | sure, Nim is usually more consistent than people realize |
11:17:57 | Guest67631 | does a ptr to a ref object work in NimScript? |
11:18:16 | Yardanico | you can easily test by using a "static" block :P |
11:18:28 | * | Guest67631 is now known as dadada |
11:19:12 | Yardanico | spoiler: seems like it does |
11:19:36 | Yardanico | https://play.nim-lang.org/#ix=2lLw |
11:19:38 | dadada | so a ref to a ref object doesn't, but a ptr does, interesting |
11:20:01 | dadada | at least I think I read somewhere a ref to ref object doesn't work |
11:20:45 | Yardanico | https://nim-lang.org/docs/nims.html |
11:20:48 | Yardanico | here |
11:20:50 | liblq-dev | Yardanico: this is caused due to the command syntax in expressions, it expects one expr for the proc and one for the argument |
11:21:14 | liblq-dev | that's why you can also do C-like casts: (int)x + 2 |
11:21:21 | FromGitter | <alehander92> PMunch Araq |
11:21:24 | liblq-dev | but it's parsed as int(x + 2) and not int(x) + 2 |
11:21:34 | FromGitter | <alehander92> `{.raises: [].}` is different |
11:21:53 | dadada | "ptr operations are are hard to emulate with the symbolic representation the VM uses. They are available and tested extensively but there are bugs left."+ |
11:21:59 | * | Ekho joined #nim |
11:22:15 | Yardanico | dadada: More than one level of ref is generally not supported (for example, the type ref ref int). |
11:22:23 | FromGitter | <joe733> @FromIRC Nim is usually more consistent than people realize |
11:22:26 | dadada | okay, so this reads like the Neomple want ptrs to work with NimScript, but they can't fix all the bugs |
11:22:33 | FromGitter | <alehander92> because it would be similar to a cast, but a runtime exception would still happen if your assumption was wrong |
11:22:47 | PMunch | liblq-dev, wait what?! |
11:22:53 | Yardanico | XDD |
11:23:00 | liblq-dev | PMunch: try it |
11:23:14 | FromGitter | <joe733> @FromIRC ⏎ ⏎ > Nim is usually more consistent than people realize... ⏎ ⏎ Can Nim unseat Python? [https://gitter.im/nim-lang/Nim?at=5eba872110d5ec031a00c772] |
11:23:20 | PMunch | liblq-dev, I'm too scared |
11:23:24 | FromGitter | <alehander92> `try: except: discard` would just silently ignore all (but i guess `except: assert/echo` is the best anyway) |
11:23:30 | Yardanico | @joe733 don't ping FromIRC, it's a bot |
11:23:36 | FromGitter | <alehander92> so yeah probably youre' right |
11:23:39 | liblq-dev | PMunch: I'll do it for you |
11:23:41 | Yardanico | write the nickname from <> instead |
11:23:43 | liblq-dev | !echo (int)x + 2 |
11:23:47 | Yardanico | PMunch: https://play.nim-lang.org/#ix=2lLx |
11:23:50 | liblq-dev | ah |
11:23:54 | liblq-dev | !eval echo (int)x + 2 |
11:23:56 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: undeclared identifier: 'x' |
11:24:08 | PMunch | :P |
11:24:12 | liblq-dev | !eval let x = 2; echo (int)x + 2 |
11:24:13 | FromGitter | <joe733> @Yardanico Okay. |
11:24:15 | NimBot | 4 |
11:24:19 | liblq-dev | there. |
11:24:26 | Yardanico | liblq-dev: you didn't prove anything here though |
11:24:32 | Yardanico | !eval let x = 2; echo int(x) + 2 |
11:24:34 | PMunch | !eval let x = 2.0; echo (int)x + 2 |
11:24:35 | NimBot | 4 |
11:24:37 | NimBot | 4 |
11:24:37 | PMunch | So that should fail |
11:24:39 | PMunch | Huh |
11:24:49 | PMunch | Shouldn't that fail? |
11:24:51 | Yardanico | no |
11:24:53 | liblq-dev | it won't fail because the int lit is automatically converted to a float lit |
11:24:54 | Yardanico | int(x + 2) |
11:24:57 | PMunch | If it is parsed is int(x+2) |
11:25:01 | PMunch | Oh right |
11:25:28 | PMunch | !eval let x = 2.0; let y = 1; echo (int)x + y |
11:25:30 | NimBot | Compile failed: /usercode/in.nim(1, 37) Error: type mismatch: got <float64, int> |
11:25:35 | PMunch | Yeah |
11:25:39 | PMunch | !eval let x = 2.0; let y = 1.0; echo (int)x + y |
11:25:42 | NimBot | 3 |
11:25:47 | PMunch | !eval let x = 2.0; let y = 1.0; echo x + y |
11:25:50 | NimBot | 3.0 |
11:25:53 | PMunch | Huh |
11:26:02 | liblq-dev | here's proof: https://play.nim-lang.org/#ix=2lLA |
11:26:07 | Yardanico | liblq-dev: I sent mine above |
11:26:11 | PMunch | Why is this a feature? |
11:26:11 | liblq-dev | by looking directly at the AST |
11:26:15 | liblq-dev | it' |
11:26:21 | liblq-dev | it's a side effect of the command syntax |
11:26:24 | FromDiscord | <clyybber> PMunch: Unintentional probably |
11:26:26 | FromDiscord | <clyybber> But its great |
11:26:31 | Yardanico | btw I wonder why a person used it here https://github.com/olliNiinivaara/Nichecache/blob/915317b2349673b1ccf502d39cd3ac3ea4875eb3/src/nichecache.nim#L99 |
11:26:32 | * | fredrikhr joined #nim |
11:26:37 | Yardanico | there's literally no reason to |
11:26:46 | FromDiscord | <clyybber> theres also no reason not to |
11:26:55 | Yardanico | except to confuse people who read thec ode |
11:26:56 | PMunch | Yardanico, oh yeah, that's just confusing :P |
11:27:09 | PMunch | Well |
11:27:16 | PMunch | I guess you kinda can read what it does |
11:27:23 | liblq-dev | maybe he thought if(unlikely) is a special if statement flag? but I doubt it |
11:27:32 | PMunch | if(which is unlikely) x should be equal to y, then do this |
11:27:43 | Yardanico | he used it in another place like this too https://github.com/olliNiinivaara/Nichecache/blob/915317b2349673b1ccf502d39cd3ac3ea4875eb3/src/nichecache.nim#L125 |
11:27:54 | PMunch | What code did he read that did this though? |
11:28:00 | Yardanico | that's what I wonder about |
11:28:04 | liblq-dev | who knows |
11:28:04 | Yardanico | I've never seen that before in my life |
11:28:06 | PMunch | I've been using Nim for years and I've never seen this! :P |
11:28:16 | Yardanico | he used the same in SQLiteral as well |
11:28:16 | liblq-dev | well I understood it the second I saw it but |
11:28:19 | Araq | same, he figured out a new idiom, get over it :-) |
11:28:20 | liblq-dev | where'd he get the idea |
11:28:36 | Yardanico | https://github.com/olliNiinivaara/StashTable/blob/0cb1dc7d578d8b66c5656595cc220963405c03e8/src/stashtable.nim#L233 |
11:28:39 | PMunch | I kinda like it tbh |
11:29:09 | PMunch | What's the rule though, like how far does it read before adding the ) |
11:29:16 | PMunch | The first , or newline? |
11:29:20 | Yardanico | the whole expression I guess? |
11:29:23 | liblq-dev | it reads a whole expression I thing |
11:29:25 | liblq-dev | s/thing/think |
11:29:54 | Yardanico | at least (a)5 + 3,4 doesn't work :P |
11:29:59 | Yardanico | if a accepts two arguments |
11:30:16 | PMunch | This works though: https://play.nim-lang.org/#ix=2lLC |
11:30:22 | Yardanico | oof |
11:30:27 | liblq-dev | no, because the command syntax in expressions can only take one arg |
11:30:34 | liblq-dev | otherwise there'd be an ambiguity |
11:30:43 | Yardanico | liblq-dev: see PMunch's code |
11:31:06 | liblq-dev | it's parsed as echo(test(100), 200) |
11:31:18 | Yardanico | ah you're right |
11:31:43 | PMunch | Yeah, just realised :P |
11:32:05 | liblq-dev | see: |
11:32:06 | planetis[m] | hi, dumb compiler dev questions, I think in both those cases https://play.nim-lang.org/#ix=2lLD copy can be avoided, right? |
11:32:07 | liblq-dev | https://play.nim-lang.org/#ix=2lLF |
11:32:07 | Yardanico | and then someone says "omg nim is unusuable!11" |
11:32:13 | PMunch | It's weird though: https://play.nim-lang.org/#ix=2lLG |
11:32:25 | Yardanico | PMunch: wdym weird? |
11:32:29 | liblq-dev | Yardanico: we need to keep this secret |
11:32:29 | Yardanico | it works as expected here |
11:32:56 | Yardanico | liblq-dev: yes |
11:32:57 | Yardanico | remove the logs |
11:33:06 | Yardanico | I'll delete messages from discord |
11:33:07 | FromGitter | <capocasa> Has anyone written an ISO week-of-year (weeknum) calculator I could reuse? |
11:33:17 | liblq-dev | the command syntax works like regular calls, so you can chain it eg. (makeSomeClosure 123) 123, 456 |
11:33:32 | PMunch | Yardanico, weird as in that case it parses correctly with (test) 100, 200 |
11:33:41 | PMunch | But let x = (test) 100, 200 doesnt' |
11:33:48 | Yardanico | @capocasa you didn't find what you need in times module? |
11:34:02 | PMunch | liblq-dev, oh god.. |
11:34:03 | liblq-dev | PMunch: it doesn |
11:34:08 | liblq-dev | it doesn't work because |
11:34:16 | liblq-dev | it's parsed as test(100), 200 |
11:34:26 | Yardanico | @capocasa what about https://nim-lang.org/docs/times.html#getDayOfWeek%2CMonthdayRange%2CMonth%2Cint |
11:34:33 | PMunch | Not in this case: https://play.nim-lang.org/#ix=2lLH |
11:34:36 | liblq-dev | PMunch: see this https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
11:34:51 | Yardanico | ah sorry nvm |
11:34:58 | FromGitter | <capocasa> @Yardanico Thanks for the pointer! times has day-of-year and day-of-week, but not week-of-year |
11:35:02 | planetis[m] | I dont get why https://github.com/nim-lang/Nim/blob/devel/compiler/injectdestructors.nim#L385 is used here at all, maybe for async? |
11:35:27 | Yardanico | what about closures? |
11:35:52 | liblq-dev | well I'm off to do my English assignment for now, bbl |
11:36:15 | Araq | planetis[m], it's only used for hint messages |
11:36:16 | planetis[m] | what about them? |
11:36:52 | Araq | read the code more carefully, in reality injectdesturctors doesn't care about closures, they have been lowered to tuples |
11:37:41 | planetis[m] | thats intersting |
11:38:07 | PMunch | Araq, should I do any more changes to this? Or just wait? I think to get the importc flag I need to move this check until it has been parsed into a symbol.. https://github.com/nim-lang/Nim/pull/14258 |
11:38:10 | FromGitter | <alehander92> which reminds me Araq |
11:38:19 | FromGitter | <alehander92> what is the proper fix for https://github.com/nim-lang/Nim/issues/14279 |
11:38:33 | FromGitter | <alehander92> lowering manually the await call arguments inside asyncmacro to tmp variables |
11:39:30 | FromGitter | <alehander92> sorry, de-nesting maybe? not sure how to call it |
11:39:36 | planetis[m] | Araq: my point is the message shouldn't filter out captured vars because you can restructure you code and avoid copies, see this example: https://play.nim-lang.org/#ix=2lLD |
11:39:54 | FromGitter | <alehander92> or somehow fixing injectdestructors themselv |
11:40:04 | FromGitter | <alehander92> i did have a local patch which seemed to fix that bug |
11:40:09 | FromGitter | <alehander92> but no idea if it did so correctly |
11:40:46 | Araq | planetis[m], PRs are welcome |
11:40:49 | FromGitter | <alehander92> i just ignored the bad case iirc i wasnt sure what i was doing just got it to run |
11:40:51 | planetis[m] | ok |
11:40:55 | FromGitter | <alehander92> so probably wrong |
11:41:23 | Araq | PMunch, it's PR week, I'm working on your PR now |
11:41:36 | Araq | alehander92: well create a PR and let me review it |
11:44:04 | alexander92 | but my question is: in principle is `transformClosureIterator` supposed to be able to deal with nested yields |
11:45:34 | PMunch | Araq, sweet :) |
11:55:50 | * | Jesin quit (Ping timeout: 260 seconds) |
11:56:36 | FromDiscord | <clyybber> Araq: Hey, the ping-pong approach without any joins works and yields a 10% compilation time increase in most arc tests |
11:57:03 | FromDiscord | <clyybber> *5-10% |
11:57:17 | Yardanico | just use PGO :P |
11:57:21 | FromDiscord | <clyybber> eh, compilation time decrease I mean |
11:57:23 | FromDiscord | <clyybber> :D |
11:57:26 | Yardanico | ah, decrease? |
11:57:27 | Yardanico | lol |
12:00:53 | Araq | clyybber: ok... now give us CPS please |
12:01:19 | * | a_b_m joined #nim |
12:01:36 | Araq | alexander92, cannot answer the question, you know more about this patch than I do, I merely merged it |
12:02:53 | FromDiscord | <clyybber> alexander92: You should ask yglukhov |
12:04:19 | * | abm quit (Ping timeout: 246 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:44 | * | supakeen joined #nim |
12:07:02 | * | a_b_m quit (Remote host closed the connection) |
12:08:38 | * | abm joined #nim |
12:14:31 | PMunch | Hmm, trying to update an example on embedding NimScript in Nim but I'm doing something wrong: http://ix.io/2lLU/nim |
12:14:48 | PMunch | script.nims is just some echo statements and a loop |
12:15:03 | Araq | compare to our tcompilerapi test |
12:15:11 | PMunch | Oooh |
12:16:25 | PMunch | I knew I had seen an easier way of doing this! |
12:17:26 | FromDiscord | <clyybber> Araq: I'm not sure yet how CPS works/ what its use is for Nim/gc:arc, but I'll read into the stuff you sent me; for now I'll still submit this DFA change since it fixes a critical bug |
12:17:54 | * | dadada quit (Ping timeout: 272 seconds) |
12:19:08 | Araq | a graph without joins sounds dangerous to me |
12:19:42 | Araq | can we get some proof of correctness? |
12:20:52 | FromDiscord | <clyybber> Yeah |
12:23:50 | * | dadada joined #nim |
12:24:14 | * | dadada is now known as Guest45634 |
12:31:40 | Araq | PMunch, all you need to do is to is to move |
12:31:41 | Araq | if symkind == skLet: localError(c.config, a.info, errLetNeedsInit) |
12:31:59 | Araq | the check to after pragma processing so that sfImportc is available |
12:32:25 | PMunch | Yeah, that's what I was thinking |
12:32:39 | PMunch | Now just to figure out where on earth that is :P |
12:37:01 | PMunch | Oh, it's just further into that procedure isn't it? |
12:37:41 | Araq | yeah |
12:37:50 | Araq | in fact |
12:37:58 | Araq | koch temp c test.nim |
12:38:07 | Araq | tells you the origin of the error via the stack trace |
12:38:28 | PMunch | What error? |
12:40:06 | Araq | Error: 'let' symbol requires an initialization |
12:40:57 | PMunch | Well yeah, that's from line 535 of semstmts |
12:41:22 | PMunch | But at that point it doesn't have sfImportc yet |
12:44:58 | Araq | exactly, so you need to move this test around |
12:45:16 | * | muffindrake quit (Quit: muffindrake) |
12:47:04 | * | sentreen left #nim (#nim) |
12:48:58 | Araq | wanna see my patch? |
12:49:02 | * | leorize quit (Remote host closed the connection) |
12:49:11 | PMunch | Gladly |
12:52:06 | Araq | PMunch, https://github.com/nim-lang/Nim/pull/14321/files |
12:52:40 | Araq | worked for my simple tests. you can take my diff into your PR and then it needs a changelog entry and an update to the manual |
12:52:54 | * | leorize joined #nim |
12:53:09 | PMunch | Ah, I was on the right track :) |
12:53:34 | FromDiscord | <Prodigle> Error: undeclared identifier: 'Thread' ? I'm compiling with --threads:on |
12:54:29 | * | zacharycarter joined #nim |
12:54:36 | Yardanico | show code (paste somewhere) |
12:54:41 | Yardanico | and how are you compiling exactly? |
12:54:49 | Araq | Prodigle: see if your Nim installation is broken |
12:54:51 | FromDiscord | <Prodigle> It's this line, inside a Let block |
12:54:52 | FromDiscord | <Prodigle> threads: seq[Thread[number:int64, i:int,results seq[seq[long]]]] |
12:54:59 | * | rockcavera joined #nim |
12:55:45 | FromDiscord | <Prodigle> nim c --run ./main3.nim --threads:on |
12:55:57 | Yardanico | that's not correct :) |
12:56:02 | Yardanico | nim c --threads:on --run ./main.nim |
12:56:11 | Yardanico | or even simpler nim c --threads:on -r main.nim |
12:56:26 | FromDiscord | <Prodigle> Thanks ^^ |
12:56:43 | Yardanico | after --run the first parameter is the name of the source file, and after that all arguments get passed to your program, not to the compiler |
12:56:51 | FromDiscord | <Prodigle> Gotcha |
12:57:25 | FromDiscord | <Prodigle> Quite confused about the type inside A thread also |
12:57:34 | FromDiscord | <Prodigle> e.g when declaring threads: seq[Thread[number:int64, i:int,results seq[seq[long]]]] |
12:57:45 | FromDiscord | <Prodigle> The example gives thr: array[0..4, Thread[tuple[a,b: int]]] |
12:57:55 | * | Vladar quit (Quit: Leaving) |
12:58:03 | PMunch | That doesn't look correct.. |
12:58:08 | PMunch | Your code that is |
12:58:10 | Yardanico | var threads: seq[Thread[number:int64, i:int, results: seq[seq[int]]]] |
12:58:16 | Yardanico | there's no "long" in nim |
12:58:17 | PMunch | Thread only has one argument no? |
12:58:21 | Yardanico | ah that too |
12:58:24 | FromDiscord | <Prodigle> Yeah, unsure what I'm actually supposed to put here |
12:58:33 | Yardanico | var threads: seq[Thread[tuple[number:int64, i:int, results: seq[seq[int]]]]] |
12:58:44 | PMunch | What the Thread can be passed as an argument |
12:59:02 | PMunch | Which can only be a single argument (so if you need multiple you need to pass a tuple) |
12:59:47 | Yardanico | @Prodigle for easier understanding - https://play.nim-lang.org/#ix=2lMA |
13:00:13 | Yardanico | "int" is arch-specific though, you can specify "int64" if you always want int64 |
13:00:34 | PMunch | As you can see from the same example as that array: createThread(thr[i], threadFunc, (i*10, i*10+5)) calls threadFunc with the tuple (i*10, i*10+5), which matches the tuple [a,b: int] that those threads require |
13:01:09 | FromDiscord | <Prodigle> That clears it up a lot 🙂 thanks |
13:01:38 | Araq | PMunch, please finish the PR on your own |
13:01:53 | PMunch | And threads can't return anything (not sure if that is what you're trying to do with `results`) |
13:01:53 | Araq | can't take it over, my own stuff is still broken (sigh) |
13:02:05 | PMunch | Oh yeah, I'm working on it |
13:02:42 | Yardanico | @Prodigle and I would also recommend trying https://github.com/mratsim/weave if you want to do some number crunching |
13:03:00 | Yardanico | I mean for multithreading |
13:03:51 | Yardanico | btw I really like how mratsim did the _: typedesc[Weave] stuff :P |
13:04:32 | * | muffindrake joined #nim |
13:05:10 | PMunch | Yardanico, example? |
13:05:21 | * | waleee-cl joined #nim |
13:06:44 | Yardanico | PMunch: https://github.com/mratsim/weave/blob/master/weave/runtime.nim#L30 |
13:06:54 | Yardanico | so you call init(Weave) |
13:07:24 | Yardanico | here it's type Weave, but in some other places it's typedesc afaik |
13:07:49 | Yardanico | ah nvm I just got confused, it's all "type Weave", typedesc is for actual types |
13:08:33 | PMunch | Ah, yeah there was quite a lot of discussion about things like that a while back |
13:08:39 | Yardanico | and what's the conclusion? |
13:09:10 | * | NimBot joined #nim |
13:09:25 | Yardanico | btw I wonder why nimbot uses like 500mb ram |
13:09:49 | Yardanico | well it starts with 20mb but grows to 500-600mb ram |
13:10:00 | Araq | because it caches all messages |
13:10:03 | * | krux02 joined #nim |
13:10:09 | Yardanico | wait what |
13:10:14 | Araq | or maybe because of other bugs :P |
13:10:19 | FromDiscord | <clyybber> Araq: https://github.com/nim-lang/Nim/pull/14322 :) |
13:11:37 | Araq | hey |
13:11:52 | Araq | "unstructured controlflow" doesn't have to be in quotes, it's the correct term |
13:12:17 | Araq | invented by the people who actually understood computing |
13:12:56 | FromDiscord | <clyybber> :D |
13:14:55 | Yardanico | @clyybber sorry for nitpick but " into to" -> "into two" or I understood incorrectly |
13:15:06 | Araq | can the same be used for 'was variable init'ed' checking? |
13:15:09 | PMunch | Yardanico, if you want to read parts of that discussion: https://github.com/nim-lang/RFCs/issues/84 |
13:15:23 | Araq | ("definite assignment" checking) |
13:15:39 | FromDiscord | <clyybber> Yeah, I actually also changed "initalized" |
13:15:58 | FromDiscord | <clyybber> But its not currently used |
13:16:12 | Yardanico | PMunch: lol I apparently replied in this issue as well |
13:16:15 | Yardanico | don't remember now :P |
13:16:30 | FromDiscord | <clyybber> Yardanico: Oh, yeah :) |
13:17:04 | PMunch | Yardanico, there was also some discussion here: https://github.com/nim-lang/Nim/pull/7481 |
13:17:11 | Yardanico | thanks |
13:17:16 | PMunch | Haha, not unusual :P |
13:17:54 | * | Romanson joined #nim |
13:19:15 | Yardanico | https://www.reddit.com/r/nim/comments/giaeev/what_are_the_biggest_weaknesses_of_nim_in_your/ |
13:19:25 | PMunch | Hmm, Araq should it also look for sfImportCpp/JS/ObjC |
13:19:26 | * | silvernode joined #nim |
13:19:27 | Yardanico | "What are the biggest weaknesses of Nim in your opinion?" question posted 42 minutes ago |
13:19:55 | FromDiscord | <Prodigle> Anyone have any insight on`Error: Invalid node kind nnkBracketExpr for macros.`$` |
13:20:04 | Araq | clyybber: turn every label into a local proc, bam, CPS representation. then you "only" need to do LL on every local proc |
13:20:18 | Yardanico | @Prodigle if you want to print a NimNode, use repr or treeRepr |
13:20:20 | Yardanico | or lispRepr |
13:20:30 | FromDiscord | <Prodigle> It's for this line |
13:20:30 | FromDiscord | <Prodigle> proc calculatePrimes(number: var int64): seq[int64]= |
13:20:33 | Yardanico | or astGenRepr |
13:20:40 | Yardanico | @Prodigle show more code please :0 |
13:20:47 | leorize | usually treeRepr is the best |
13:20:55 | FromDiscord | <Prodigle> I'll pastebin hold on |
13:21:11 | leorize | play.nim-lang.org please :) |
13:22:03 | FromDiscord | <Prodigle> https://play.nim-lang.org/#ix=2lMQ |
13:22:56 | FromDiscord | <Prodigle> assuming it's to do with Weave and results[i] = spawn calculatePrimes(number) |
13:23:06 | FromDiscord | <clyybber> Araq: Aha! Thats interesting, so we basically already have whats required for CPS. |
13:23:32 | Yardanico | @Prodigle I don't think you can return a seq[int64] with weave |
13:23:37 | Yardanico | check this example https://github.com/mratsim/weave#data-parallelism |
13:23:41 | Yardanico | you have to use something like bufOut |
13:24:14 | leorize | I think openArray would work too |
13:24:48 | leorize | Prodigle: why are you making a `var result` for calculatePrimes? |
13:25:23 | FromDiscord | <Prodigle> Oh, I was just trying things to get it to fix |
13:25:49 | FromDiscord | <Prodigle> I wonder if I could acces results directly from weave without a return type? |
13:25:59 | FromDiscord | <Prodigle> I wonder if I could acceds results directly from weave without a return type? |
13:26:03 | FromDiscord | <Prodigle> I wonder if I could access results directly from weave without a return type? |
13:27:01 | FromDiscord | <mratsim> you can put them in a seq or an array and pass a ptr to it and update them through the pointer |
13:27:12 | FromDiscord | <mratsim> yo will need to deal with synchronization in that case |
13:27:35 | leorize | mratsim: have you checked if openarray works as well? |
13:27:44 | Araq | bike-shedding time |
13:27:46 | FromGitter | <zetashift> @Prodigle careful with consecutive edits in Discord. IRC and Gitter send each edit as a new message |
13:27:55 | leorize | it'd be better to use that instead of telling everyone to use ptr UncheckedArray :P |
13:28:05 | Yardanico | @zetashift just wait a bit when I'll put ircord on #nim |
13:28:14 | Araq | what's Nim's name for shared_ptr? |
13:28:14 | FromDiscord | <Prodigle> I'll give it a try |
13:28:16 | leorize | ofc, the best would be that everyone move to arc and weave natively supports it's data types |
13:28:17 | Yardanico | I can do it right now but that version hasn't been tested a lot :P |
13:28:23 | FromDiscord | <mratsim> @leorize, you can pass a pointer to an openarray |
13:28:48 | PMunch | Araq, is this a "Language change"? |
13:28:50 | FromGitter | <zetashift> @Yardanico ah I didn't know that! Looking forward to it :D |
13:28:53 | Araq | leorize, I hope https://github.com/nim-lang/Nim/pull/14316 is a big part of the puzzle |
13:29:07 | Yardanico | @zetashift it's been running in #nim-offtopic for quite a while now |
13:29:09 | FromDiscord | <mratsim> that sure is a descriptive PR name |
13:29:11 | Yardanico | and #nim-gamedev since it was created |
13:29:13 | Araq | PMunch, no, it's a generic type |
13:29:19 | PMunch | Huh? |
13:29:28 | PMunch | I meant the let can omit value with importc thing |
13:29:35 | Araq | now that 'ref T' remains non-atomic we need an atomic version |
13:29:37 | * | silvernode quit (Ping timeout: 264 seconds) |
13:29:44 | Araq | argh |
13:29:46 | PMunch | For the changelog entry |
13:29:57 | Araq | yeah, it's a language "addition" |
13:30:00 | FromGitter | <zetashift> is nim-gamedev on Gitter or Discord? |
13:30:05 | Yardanico | on both |
13:30:11 | Yardanico | #gamedev on discord, #nim-gamedev on Gitter |
13:30:15 | Yardanico | but it's not bridged to gitter :P |
13:30:28 | Araq | is a SharedRef[T] or a SharedPtr[T] ? |
13:30:33 | Araq | *is it |
13:30:36 | FromGitter | <zetashift> will it be eventually? |
13:30:46 | PMunch | Okay, cool. Back to my last question again though, should it also check for sfImportCpp/JS/ObjC. I guess the feature is wanted for all targets? |
13:30:51 | leorize | SharedPtr[T] IMO |
13:30:51 | PMunch | At least for C++ |
13:31:24 | leorize | SharedRef doesn't make much sense I think |
13:31:27 | Yardanico | @zetashift well FromGitter isn't controlled by me |
13:31:33 | Yardanico | it's not a part of nim infrastructure either |
13:31:38 | leorize | but then we already use naming like allocShared, etc. |
13:31:45 | Yardanico | maybe I need to write a gitter<->irc bridge or integrate it directly in ircord |
13:32:12 | FromDiscord | <mratsim> ref is how we tag managed pointer so I vote for SharedRef |
13:32:23 | FromDiscord | <mratsim> though technically it's a ShareableRef |
13:32:26 | Yardanico | https://github.com/oprypin/critter is the src for gitter bridge (yes it's crystal) |
13:32:50 | Araq | PMunch, yeah, for all targets |
13:32:51 | leorize | Yardanico: I can whip up a bridge between the two network via matrix, do you want me to? :) |
13:33:06 | FromDiscord | <Prodigle> I looked into openarrays and not sure how I would use them in this scenario |
13:33:18 | Yardanico | leorize: well if you want to you can do it temporarily :P we need someone to create #gamedev on Gitter though |
13:33:35 | Yardanico | I can't even load gitter lol |
13:33:41 | leorize | thought #nim-gamedev is already a thing? lol |
13:33:46 | Yardanico | it is |
13:33:48 | Yardanico | but not on Gitter |
13:33:54 | leorize | where is it? |
13:33:57 | leorize | irc? |
13:34:11 | FromDiscord | <Prodigle> By the looks they're read-only and I need to create/add to a list of int64's |
13:34:13 | Yardanico | it was created in discord #gamedev and then I asked dom to create #nim-gamedev for IRC bridge |
13:35:36 | PMunch | leorize, yup |
13:37:12 | FromDiscord | <Prodigle> Essentially I'm trying to use weave to parallelize taking in a number, and outputting a seq[int64] of unknown length, then combining all the sequences into a seq[seq[int64]] |
13:37:43 | leorize | I'm not sure if your algo is efficient enough to be threaded |
13:38:56 | PMunch | Araq, huh there is no sfImportCpp/JS/ObjC. Does sfImportc cover all of them? |
13:41:38 | Yardanico | my vscode has become too coloured :P https://i.imgur.com/I3QmeNX.png |
13:42:16 | planetis[m] | what are the the nim channels in irc? #nim #nim-offtopic #nim-nologs? |
13:42:22 | Yardanico | #nim-gamedev |
13:43:07 | leorize | ah you already got ircord running in #gamedev |
13:43:11 | Yardanico | yes |
13:43:20 | Araq | PMunch, iirc yes |
13:43:46 | Araq | you can read compiler/pragmas.nim to find answers to these questions |
13:43:48 | leorize | I can use matrix to bridge gitter and matrix over, but that's yet-another-bot :) |
13:44:56 | PMunch | ##nim-iot |
13:45:20 | Yardanico | huh |
13:45:43 | * | PMunch_ joined #nim |
13:45:44 | leorize | Yardanico: wanna give matrix/gitter bridging to discord a go? |
13:46:02 | Yardanico | I can't get gitter to load for me and I wouldn't be able to create a new gitter room anyway :D |
13:46:18 | Yardanico | lemme try to clean gitter cookies |
13:46:20 | leorize | well ask Araq to provide us a room under nim-lang :P |
13:46:40 | FromDiscord | <clyybber> SharedRef, since its still refcounted, and SharedPtr doesn't make much sense, since a ptr can be shared anyways |
13:46:42 | FromDiscord | <mratsim> @Prodigle how is the length found? Allocating memory in a thread an returning it to another thread requires manual memory management via createShared/allocShared at the moment or use Boehm GC or gc:arc |
13:46:53 | dom96 | leorize: you can literally create a gitter room under any project |
13:47:01 | Yardanico | oh really? |
13:47:06 | Yardanico | ah I understood |
13:47:16 | Araq | on the other hand it's a dangerous thing so it should be called SharedPtr |
13:47:43 | Yardanico | dom96: the problem is no one's gonna find it if it's not under nim-lang/ :D |
13:48:14 | dom96 | Oh, I thought you want one for testing |
13:49:07 | leorize[m] | Yardanico: https://t2bot.io/discord/ |
13:49:21 | leorize[m] | you do the invite the bridge part, I'll do the bridging :p |
13:49:47 | Araq | also ... it's cooldome's work, he gets to decide the name |
13:50:07 | Yardanico | leorize[m]: I hope it'll only work for 1 channel, not for the whole discord? |
13:50:13 | Yardanico | because that can really mess up a lot of things |
13:50:31 | Yardanico | ah nvm I see it now ok |
13:50:50 | Yardanico | but how is that related to Gitter? :D |
13:51:11 | leorize | I told you, I'm gonna do a gitter-matrix-discord bridge :P |
13:51:35 | Yardanico | well we need a gitter room, and then maybe just ask 0prypin so he adds #nim-gamedev |
13:51:53 | Yardanico | his FromGitter already works for #nim and #nim-offtopic for a long time |
13:52:19 | * | PMunch_ quit (Quit: WeeChat 2.8) |
13:52:25 | FromGitter | <capocasa> Couldn't find any week-of-year functions so I wrote them https://forum.nim-lang.org/t/6320#38952 (not librarified yet) |
13:52:34 | dom96 | my god |
13:52:38 | leorize | Yardanico: it's your call :P |
13:52:40 | dom96 | why does everyone want so many bridges? |
13:52:54 | Yardanico | @capocasa maybe you can create a PR to stdlib? |
13:53:08 | Yardanico | ask GULPF though, the current times module is basically theirs :) |
13:53:39 | Yardanico | dom96: so 1 person from Gitter can chat with others :D /s |
13:53:43 | FromGitter | <capocasa> @Yardanico Gladly, thanks for the pointer! |
13:54:07 | dom96 | nah, you know what. IRC and Discord are enough |
13:54:32 | dom96 | One proprietary and one open chat protocol. That's all you need |
13:54:43 | dom96 | if they want to chat then tell them to download either an IRC client or Discord |
13:56:40 | zacharycarter | I think just IRC is enough :P |
13:57:48 | FromDiscord | <mratsim> btw @Zachary Carter you mentioned looking into adding latency/FIFO scheduling for Weave. I think I found a good plan here: https://github.com/mratsim/weave/issues/132 |
13:58:03 | Yardanico | zacharycarter: btw see https://github.com/nim-lang/Nim/issues/13881 was closed |
13:58:17 | zacharycarter | mratsim: thanks I'll check this out today |
13:58:17 | FromDiscord | <mratsim> It should be straightforward enough for me to add it in the weekend. |
13:58:52 | leorize | dom96: can you move #14281 to nimble issue tracker? |
14:00:17 | Yardanico | ah seems like https://github.com/nim-lang/Nim/issues/13935 is still broken |
14:00:56 | Araq | gah, I thought I fixed that one too |
14:01:19 | Yardanico | uhh I think even https://github.com/nim-lang/Nim/issues/13881 still fails? |
14:01:25 | Yardanico | maybe I didn't properly update to devel, hmm |
14:02:01 | Araq | anyhow this new Nim is so good. I can use .nodestroy on sink parameters to get no overhead |
14:02:46 | Yardanico | yeah https://github.com/nim-lang/Nim/issues/13881 seems to still crash for me, idk why :D |
14:02:57 | Araq | the pieces fit together much better than before. it's time to name this Nim 2... |
14:03:12 | Araq | Yardanico, worked for me and I fixed the underlying bug |
14:03:29 | Araq | maybe there is also a different bug |
14:03:42 | zacharycarter | mratsim: the proposed solution sounds sensible to me |
14:03:46 | Yardanico | yeah I'm on 06dfd316127fb2ec05ff69942abd1e279156ac5c (just checked nim -v) |
14:03:50 | Yardanico | that's the last commit |
14:04:29 | zacharycarter | if you want help with it this weekend I will be around and can help |
14:04:33 | zacharycarter | or anytime this week really |
14:07:04 | FromDiscord | <mratsim> for me it's very straightforward, the hardest part is finding a simple enough but interesting enough example to showcase it |
14:07:24 | FromDiscord | <mratsim> the RFC basically describes everything I need to add and where |
14:07:57 | zacharycarter | yeah |
14:09:10 | FromDiscord | <Prodigle> I keep hitting brick walls with this 😅 What should I be doing to do this task multithreaded? |
14:09:18 | Yardanico | use pointers |
14:09:36 | FromDiscord | <Prodigle> to a sequence index? |
14:10:26 | zacharycarter | what GC are you using? |
14:10:31 | FromDiscord | <Prodigle> default |
14:10:34 | FromDiscord | <Prodigle> I can change |
14:10:47 | zacharycarter | okay so allocate on the shared heap using `createShared` or `allocShared` and pass pointers |
14:11:01 | zacharycarter | and then use sync primitives |
14:11:07 | FromDiscord | <Prodigle> Thanks 🙂 I'll take a look down that route |
14:11:26 | zacharycarter | if you have some example code I can try to help you |
14:11:41 | FromDiscord | <Prodigle> Sure, hold on a sec |
14:13:54 | FromDiscord | <Prodigle> https://play.nim-lang.org/#ix=2lNi |
14:13:54 | FromDiscord | <Prodigle> |
14:13:54 | FromDiscord | <Prodigle> Essentially trying to multithread a calculation with toCalculate, each will return a seq[int64] that will end up in an index of results, which is a seq[seq[int64]]. |
14:13:54 | FromDiscord | <Prodigle> |
14:13:54 | FromDiscord | <Prodigle> Then this follows on to some example code for results |
14:14:02 | * | Trustable joined #nim |
14:14:20 | FromDiscord | <Prodigle> So far everything I've tried has hit a brick wall with adding to the seq in a MT environment |
14:14:36 | Yardanico | just use arc and locks /s |
14:14:36 | zacharycarter | okay let me play around with this one moment |
14:14:42 | disruptek | Araq: come on mumble and explain your cps thoughts today? |
14:14:54 | Yardanico | disruptek: he did yesterday |
14:15:10 | disruptek | wut |
14:16:07 | FromDiscord | <Prodigle> Yard, arc will let me access sequences in a MT environment? |
14:16:29 | Yardanico | yes, but you'll also need to make sure you don't have two threads access a seq at the same time so you'll need locks |
14:16:31 | Yardanico | or boehm |
14:16:38 | liblq-dev | Araq: this looks pretty cool, but what does the findNimStdLibCompileTime() proc do? https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim |
14:16:39 | Yardanico | (arc and boehm are both shared-heap) |
14:16:55 | Yardanico | liblq-dev: https://github.com/nim-lang/Nim/blob/39290cf88c5047e86dc4894e3190c63d5985f56f/compiler/nimeval.nim#L93 |
14:17:04 | Yardanico | "Same as ``findNimStdLib`` but uses source files used at compile time, and asserts on error." |
14:17:15 | Yardanico | and findNimStdLib "Tries to find a path to a valid "system.nim" file. Returns "" on failure." |
14:17:24 | liblq-dev | cool |
14:17:41 | liblq-dev | how hard is it to pass binary data between the VM and Nim? |
14:18:48 | liblq-dev | I heard something about PNodes back in the day which seems cumbersome |
14:18:51 | liblq-dev | and slow |
14:19:10 | PMunch | liblq-dev, I'm playing with this stuff right now :) |
14:20:02 | * | letto quit (Ping timeout: 260 seconds) |
14:20:21 | liblq-dev | PMunch: cool, please share what you find out |
14:20:38 | PMunch | For sure |
14:20:40 | Araq | liblq-dev, it's still hard unless you restrict yourself to 'string' |
14:20:52 | Araq | but hey, Nim's strings can contain any byte |
14:20:57 | liblq-dev | hmm |
14:21:11 | liblq-dev | and there's distinct string |
14:21:11 | zacharycarter | where does `time` come from Prodigal? I'm just going to comment it out for now |
14:21:32 | FromDiscord | <Prodigle> It's a macro that times everything inside it, not relevant overall |
14:22:13 | FromDiscord | <Prodigle> You'll need to comment out the related individualCycles.writeline too |
14:23:02 | FromDiscord | <mratsim> @Prodigle, your algorithm is trial division? That is slow |
14:23:53 | Yardanico | I think I made it work with arc |
14:24:15 | FromDiscord | <Prodigle> Yeah, it's fine being slow |
14:24:18 | FromDiscord | <Prodigle> Ohh Yard? |
14:24:27 | Yardanico | ah nvm it even works without arc but ok |
14:24:37 | Yardanico | https://play.nim-lang.org/#ix=2lNl |
14:24:55 | Yardanico | idk if the results are correct or not :P |
14:25:22 | FromDiscord | <mratsim> parallelizing that is not trivial, you cannot resize a sequence in parallel |
14:25:29 | Yardanico | well yeah I'm not resizing it |
14:26:05 | zacharycarter | https://play.nim-lang.org/#ix=2lNm |
14:26:06 | Guest45634 | can I manually force nim not to garbage collect for a while, for example within a code block? |
14:26:09 | * | Guest45634 is now known as dadada |
14:26:30 | dadada | I'm working with ptr to refs now, because NimScript doesn't understand refs to refs |
14:26:45 | Yardanico | dadada: GC_disable ? |
14:26:48 | dadada | but it can happen that the refs get garbage collected, and this produces ugly bugs |
14:27:09 | Yardanico | it won't work for arc though |
14:27:11 | leorize | why would you want refs to refs... |
14:27:24 | * | letto joined #nim |
14:27:35 | zacharycarter | moar pointers!!!!!!! |
14:27:53 | Yardanico | ref ref ref ref? |
14:27:54 | dadada | Yardanico: well, then it's not really a solution for me |
14:27:56 | FromDiscord | <Prodigle> That seems to work Yard! 🙂 I think my nim install is corrupted now though haha |
14:28:11 | Araq | disruptek, will join later, time for a break |
14:28:22 | Yardanico | dadada: well arc doesn't have a concept of some waiting or stuff |
14:28:26 | disruptek | okay; trying to digest this paper. |
14:28:31 | zacharycarter | Prodigle: just keep in mind that in Yardanico's example, things could get collected |
14:28:38 | Yardanico | dadada: you can do GC_ref |
14:28:40 | Yardanico | and then GC_unref |
14:28:42 | Yardanico | :D |
14:28:52 | Yardanico | I think it works on arc |
14:28:56 | Araq | disruptek, oh yeah, this paper is superb, and we can copy from it pretty much blindly |
14:29:58 | Yardanico | zacharycarter: yeah I never actually made a real big multithreaded app :P |
14:30:10 | Yardanico | i only know the basics like locks and stuff |
14:31:00 | disruptek | this is the async story nim needed. |
14:31:38 | dadada | first I did work with simple refs, and the thang worked, but I want the thang to be generalized to work with normal objects and refs, and this would mean that the thang would use refs to refs in NimScript and then the thang wouldn't work there, so I figured if I use ptrs to refs instead the thang could work in normal code and NimScript and also with simple objects, so all issues solved, but now I realized |
14:31:44 | dadada | with ptrs to refs the thang now has unpredictable pointers that produce errors I can't explain (so probably the GC) |
14:31:50 | FromDiscord | <Prodigle> It runs but immediately gets Error: unhandled exception: index out of bounds, the container is empty [IndexError] and fatals |
14:32:01 | Yardanico | which one? |
14:32:36 | Yardanico | zacharycarter: your version doesn't initialize results variable :P |
14:32:52 | Yardanico | @Prodigle change results[i] = result to results.add(result) |
14:32:54 | Yardanico | then it might work |
14:33:19 | FromDiscord | <Prodigle> Still fails |
14:33:20 | FromDiscord | <Prodigle> line isss |
14:33:26 | Yardanico | so which version? |
14:33:32 | FromDiscord | <Prodigle> var number = toCalculate[i] |
14:33:52 | Yardanico | maybe you changed "0..6" to something else? |
14:33:57 | FromDiscord | <Prodigle> Your code into my main project, I'll playground the whole file |
14:34:16 | FromDiscord | <Prodigle> https://play.nim-lang.org/#ix=2lNv |
14:35:29 | FromDiscord | <mratsim> I assure you, what you are trying to do will lead to all kind of breakage |
14:35:40 | Yardanico | i told him to use weave twice :P |
14:35:47 | FromDiscord | <mratsim> don't pass var seq to create thread |
14:36:15 | Yardanico | he's not doing that in the last example though |
14:36:58 | FromDiscord | <Prodigle> I tried weave but the data parallelism was a bit above me |
14:37:15 | FromDiscord | <mratsim> if you want to collect result safely, use channels: https://github.com/nim-lang/Nim/blob/8088633250872de8777c7078e636b2379780e107/tests/parallel/tpi.nim |
14:38:03 | FromDiscord | <mratsim> What you want to do needs task parallelism |
14:38:38 | FromDiscord | <mratsim> The first thing to remember about multithreading is: never ever update the same data concurrently. |
14:39:05 | FromDiscord | <mratsim> hence, your result sequence must be allocated fully beforehand |
14:39:31 | FromDiscord | <mratsim> and then you can pass a pointer to seq locations if you want to update them in-place |
14:39:55 | FromDiscord | <mratsim> or you spawn work and you return the result through a channel and you don't have to deal with shared data. |
14:40:27 | FromDiscord | <Prodigle> The channel would allow me to return a dynamic amount of int64's? |
14:41:34 | FromDiscord | <mratsim> Nim channels can yes. In Weave I didn't test seq result, they might work with BoehmGC or gc:arc |
14:41:54 | FromDiscord | <Prodigle> and I'm not trying to update the same data. Trying to get each thread to create/return their own seperate seq |
14:42:43 | FromDiscord | <mratsim> okay, so you need results = newSeq[seq[int64]](countProcessors()) |
14:43:03 | FromDiscord | <mratsim> or maybe newSeq[Channel[seq[int64]]](countProcessors()) |
14:43:52 | FromDiscord | <mratsim> then you for i in 0 ..< countProcessors: spawn(myTask(results[i], a, b, c)) |
14:44:27 | FromDiscord | <mratsim> in the task, at the end of the compute you do channel.send(myResultSeq) |
14:45:34 | FromDiscord | <mratsim> and after you enqueued all tasks in the main thread you can do finalResults: seq[seq[int64]]; for i in 0 ..< countProcessors: finalResults.add results[i].recv() |
14:46:17 | FromDiscord | <mratsim> let's see if I can make it quickly work in the playground |
14:46:33 | FromDiscord | <Prodigle> Thanks so much |
14:48:46 | FromDiscord | <mratsim> actually since you directly use the result we can skip channels and directly use the Flowvar |
14:53:13 | FromDiscord | <Prodigle> I have it running but failing atm so you can probably get it 🙂 |
14:53:24 | leorize | anyone interested in an azure pipelines template to setup Nim in your CI for you? |
14:53:33 | leorize | I'll add caching and all that goodness in too :P |
14:55:00 | disruptek | ~stream |
14:55:05 | disruptek | fast async io under linux. |
14:55:22 | disruptek | duh. |
14:55:25 | disruptek | ~stream |
14:55:25 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:55:25 | Yardanico | not ic? |
14:55:30 | disruptek | noooooo |
14:55:46 | leorize | one can only work on the compiler for so long |
14:55:51 | leorize | :P |
14:55:51 | dom96 | async io is already fast under linux :P |
14:56:07 | Yardanico | dom96: io_uring |
14:56:11 | leorize | not fast enough :P |
14:56:37 | dom96 | cool. I was thinking of streaming about that too, but realistically I wouldn't have enough time anyway |
14:58:03 | FromDiscord | <zetashift> I hope this doesn't come over as rude, but that's basically how a lot of things with you and Nim end up, not having enough time in the world >< |
14:58:17 | Yardanico | good thing I'm still a student :P |
14:58:18 | FromDiscord | <zetashift> and I think generally with a lot of people in the open source world |
14:59:12 | dom96 | People grow up, people start needing money to live, people have less time |
14:59:14 | narimiran | dom96: i've seen you pinged me/us about helping you deploy new forum version. what do you need help with? |
14:59:55 | dom96 | narimiran, figuring out why the forum locks when used with the prod DB. Seeing as I cannot trust just about everyone with the DB (since it contains real user data), I need either you or Araq |
15:00:06 | dom96 | (or someone else who Araq deems trustworthy) |
15:00:14 | FromDiscord | <mratsim> @Prodigle, here is something that compiles, though I'm not sure what you do with the number div i -> https://play.nim-lang.org/#ix=2lNH |
15:01:35 | FromDiscord | <Prodigle> I'll take a look! thanks |
15:01:37 | FromDiscord | <zetashift> @dom96 that rings very true to me, but not only money but also personal life might take more time |
15:01:56 | * | ftsf quit (Ping timeout: 272 seconds) |
15:02:12 | dom96 | zetashift: yep, and also I want to set up something that has a chance of supporting me and Nim into the future |
15:02:24 | PMunch | Hmm, findNimStdLib doesn't work when Nim is installed with choosenim.. |
15:02:37 | PMunch | Because the `nim` executable isn't next to `lib` |
15:02:39 | dom96 | realistically, no matter how fun, implementing io_uring will not get us there |
15:03:31 | leorize | PMunch: now you understand the pain of writing tooling :P |
15:03:43 | FromDiscord | <zetashift> Good luck! Such endeavors are always a big leap |
15:03:51 | PMunch | Haha, trust me, I got my fair share of that with nimlsp.. |
15:03:52 | FromGitter | <kayabaNerve> Anyone here have experience with the Nim callDepthLimit? As in, either figuring out the current depth OR setting it as low as possible? |
15:04:05 | FromGitter | <kayabaNerve> First is preferred, second is tolerable if I can get it < 127. |
15:04:13 | FromDiscord | <mratsim> @PMunch, could it be the reason for https://github.com/nim-lang/Nim/issues/12293 |
15:04:16 | disbot | ➥ compiler as a library: findNimStdLibCompileTime fails to find system.nim ; snippet at 12https://play.nim-lang.org/#ix=22qc |
15:04:27 | leorize | kayabaNerve: it's a thing used for stacktraces |
15:04:34 | FromDiscord | <mratsim> @kayabaNerve, it's 2000 |
15:04:35 | dom96 | zetashift: thank you. I don't expect it to work out soon, but I have to at least try something that has a non-0 chance of working. |
15:04:37 | leorize | you don't want to use it in production |
15:04:56 | FromDiscord | <mratsim> it's removed when compile with release (or danger?) |
15:05:25 | FromGitter | <kayabaNerve> leorize: I'm referring to the compiler flag that lets you cause recursive code to run longer when it's still recursing. I'm trying to use it to verify a black boxed system isn't infinitely recursing. |
15:05:43 | Yardanico | @kayabaNerve -d:nimCallDepthLimit=value |
15:05:50 | PMunch | @mratsim, ah yes I noticed that it didn't work with the `compiler` package as well. But I just subbed it for my local copy of Nim |
15:05:52 | FromGitter | <kayabaNerve> Right. |
15:05:59 | PMunch | But that wouldn't create anything distributable anyways |
15:06:02 | FromGitter | <kayabaNerve> I either need to get the current depth at runtime or set that to 127. |
15:06:09 | Yardanico | at runtime? |
15:06:11 | PMunch | Unless the user had the same folder structure as you had :P |
15:06:22 | Yardanico | why not set -d:nimCallDepthLimit=127 at comptime |
15:06:47 | FromGitter | <kayabaNerve> I'm not sure if it can go that low. Nim segfaults when you set it too low. |
15:07:02 | Yardanico | works for me |
15:07:03 | FromGitter | <kayabaNerve> Just wanted to check about side effects of too low values before I assume 127 is a valid value |
15:07:18 | Yardanico | hm |
15:07:32 | FromGitter | <kayabaNerve> *To be clear, I set it to 5. |
15:07:40 | FromGitter | <kayabaNerve> It was way too low of a value. |
15:07:54 | Yardanico | nimCallDepthLimit is a constant |
15:08:00 | FromGitter | <kayabaNerve> Yep |
15:08:02 | FromGitter | <kayabaNerve> I know |
15:08:03 | Yardanico | read from this line https://github.com/nim-lang/Nim/blob/06dfd316127fb2ec05ff69942abd1e279156ac5c/lib/system/excpt.nim#L538 |
15:08:12 | Yardanico | well, so there's no way to set it at runtime |
15:08:36 | FromGitter | <kayabaNerve> I'm trying to GET it at runtime |
15:08:55 | FromGitter | <kayabaNerve> Or I need to set the constant to 127 and verify I know the effective threshold |
15:09:07 | PMunch | This is why I think Nim should have a --libs switch that just tells you where it finds the libs.. |
15:09:46 | FromGitter | <kayabaNerve> Because even if I set it to 127, that doesn't mean I have 127 available IIRC. I think a few are used up already. |
15:09:58 | PMunch | I mean I want to distribute the executable to people without Nim installed, so for me I'd need to ship the stdlib (or parts of it) myself anyways |
15:10:00 | FromGitter | <kayabaNerve> And even if Nim doesn't, I'm sure unittest does. |
15:10:17 | Yardanico | @kayabaNerve you'll have to get the current frame somehow |
15:10:20 | leorize | PMunch: it actually does have |
15:10:31 | PMunch | It does? |
15:10:38 | PMunch | I just looked through --fullhelp looking for it.. |
15:10:40 | leorize | nim dump |
15:10:58 | FromGitter | <kayabaNerve> Yardanico: Yeah, I found the PFrame type. Don't think I can access it though. |
15:11:10 | PMunch | Right! I knew there was some way of doing it.. |
15:11:34 | FromGitter | <kayabaNerve> Oh. getFrame is a thing. I'll try that. Thanks. |
15:12:12 | FromGitter | <kayabaNerve> `echo getFrame().calldepth` works. Thanks. |
15:12:29 | disruptek | https://arxiv.org/pdf/1011.4558.pdf |
15:12:41 | Yardanico | thx |
15:12:49 | Yardanico | @kayabaNerve thanks, never knew that :P |
15:14:16 | FromGitter | <kayabaNerve> Yep. Plan is to manually get the depth to ~1850, and then call a function which takes 200 recursions to complete yet only 100 to error. |
15:14:35 | FromGitter | <kayabaNerve> Basically verifying my library won't trigger this no matter the data handed in. |
15:15:11 | FromGitter | <kayabaNerve> I mean, if you call it with a depth of 1, sure, but there's a limit to how much we can protect users. I'm mainly worried about circular data values (pointer to self) |
15:21:39 | * | krisppurg joined #nim |
15:22:01 | FromDiscord | <Prodigle> @mratsim Can you try compile my code that I used yours in? Just want a check it's not a bad nim install |
15:22:12 | Yardanico | wdym "a bad nim install? |
15:22:42 | * | krisppurg_ joined #nim |
15:22:50 | FromDiscord | <Prodigle> Crashes with a generic error message, not sure if I'm using the newest version |
15:22:53 | * | krisppurg__ joined #nim |
15:22:54 | * | krisppurg_ quit (Client Quit) |
15:24:21 | * | krisppurg__ left #nim (#nim) |
15:25:31 | FromDiscord | <Prodigle> https://pastebin.com/bNwUZQJ8 |
15:25:31 | FromDiscord | <Prodigle> |
15:25:31 | FromDiscord | <Prodigle> Error is : |
15:25:31 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\Concurrency\Nim Concurrency\main3.nim(77) main |
15:25:31 | FromDiscord | <Prodigle> D:\Coding\nim-1.0.6\lib\system\fatal.nim(49) sysFatal |
15:25:31 | FromDiscord | <Prodigle> Error: unhandled exception: index out of bounds, the container is empty [IndexError] |
15:25:51 | FromDiscord | <Prodigle> Line is var number = toCalculate[i] |
15:27:14 | PMunch | That is weird |
15:28:00 | FromDiscord | <Prodigle> Yeah, toCalculate is size 7 and the i is 0..6 |
15:28:51 | FromGitter | <brentp> does anyone have a (docker) setup for building osx binaries on linux for nim projects? |
15:29:47 | PMunch | Hmm, okay, so without any modifications to the files themselves I managed to run the test NimScript (just using some basic types, and being called/exposing state) with a 1.5MB subset of the stdlib |
15:29:55 | nisstyre | I think you need xcode or something to make MacOS binaries |
15:29:57 | nisstyre | could be wrong |
15:30:00 | Yardanico | not neccessarily |
15:30:05 | PMunch | For comparison the entire stdlib is 24MB |
15:30:06 | Yardanico | e.g see https://github.com/tpoechtrager/osxcross |
15:30:18 | leorize | you can use zig to generate osx binaries, yes? :P |
15:30:21 | Yardanico | yes |
15:30:32 | Yardanico | idk if it works good enough though :D |
15:31:26 | FromDiscord | <Prodigle> Got it working! Thanks everyone for your help |
15:31:49 | * | ptdel joined #nim |
15:32:14 | * | ptdel quit (Remote host closed the connection) |
15:34:25 | * | lritter joined #nim |
15:37:40 | PMunch | If anyone is curious, this is the list of stuff you need: http://ix.io/2lNX |
15:38:04 | PMunch | I say need, but a lot of that is probably not strictly speaking required to run the little snippet |
15:38:47 | PMunch | Now, if this nimscript stuff was only able to tell me everything it actually used.. |
15:42:26 | * | krisppurg left #nim (#nim) |
15:43:31 | FromGitter | <brentp> ok. i think this is what i was looking for: https://forum.nim-lang.org/t/5569 |
15:43:40 | * | ptdel joined #nim |
15:48:24 | FromDiscord | <mratsim> @Prodigle, your code is missing the "File" setup and "time" setup |
15:48:31 | FromDiscord | <mratsim> approximated time, but the file I can't |
15:54:51 | * | krisppurg_ joined #nim |
15:58:26 | * | dddddd quit (Read error: Connection reset by peer) |
16:03:59 | FromGitter | <nothratal> Am I the only one who experiences bad performance on https://nimble.directory/ ? ⏎ getting constantly 429's and 502's |
16:04:45 | Yardanico | donate a 4gb ram VPS to it :) |
16:04:57 | leorize | ping federico3 I guess :P |
16:06:34 | FromGitter | <bung87> It current run on ?gb |
16:31:35 | federico3 | it's not just RAM |
16:32:48 | federico3 | scaleway got worse and network drives are the bottleneck |
16:33:38 | supakeen | federico3: In case you ever need some hosting 'help' do let me know I've got a bunch of machines that could help out if necessary. |
16:34:27 | supakeen | Though it is more a many-little-machines setup :) |
16:36:45 | federico3 | how little? |
16:38:22 | supakeen | 4gb varnish cache + 3x 2gb web vms |
16:38:41 | supakeen | (and a haproxy in front of that because i serve some more than http) |
16:40:18 | supakeen | though perhaps in your case 'just' adding your own cache might alleviate disk load? |
16:43:03 | federico3 | the problem is not serving files: it's a buildbot |
16:44:02 | supakeen | ah i misinterpreted then |
16:45:13 | supakeen | perhaps drop an email to digital ocean's open source? i've heard they like to sponsor this kind of thing with resources |
16:45:33 | federico3 | yep |
16:45:46 | supakeen | and they seem already involved with nim itself |
16:46:04 | alexander92 | kayabaNerve |
16:46:10 | alexander92 | this does sound dangerous somehow |
16:47:25 | alexander92 | do you plan to explicitly check for calldepth in your recursive function? |
16:48:38 | * | Vladar joined #nim |
16:56:45 | * | Trustable quit (Remote host closed the connection) |
16:58:28 | * | dadada quit (Ping timeout: 272 seconds) |
17:02:04 | PMunch | Okay, wrote a small script that just tries to remove one file at a time and runs the nimscript test. It managed to delete these files: http://ix.io/2lOt |
17:02:31 | PMunch | Meaning this is the subset of things that a trivial nimscript needs to run: http://ix.io/2lOu |
17:03:03 | PMunch | For a grand total of 884KB :) |
17:07:24 | PMunch | And the sizes of each file should anyone be interested: http://ix.io/2lOv |
17:07:55 | PMunch | Not too shabby, but could probably be boiled down a tad further |
17:08:41 | PMunch | That being said, the binary that calls the script is itself 3.1MB when compiled with -d:release, so might not be worth optimising it further |
17:10:02 | PMunch | Got that down to 1.3MB with -d:danger --opt:size and strip |
17:20:56 | leorize | you do know you can use --verbosity:3 to trace all read files, right? :P |
17:26:55 | Araq | PMunch, unicode.nim is worrying me |
17:30:51 | FromDiscord | <dom96> Prometheus is awesome for finding memory leaks: |
17:30:51 | FromDiscord | <dom96> https://cdn.discordapp.com/attachments/371759389889003532/709819898066370657/unknown.png |
17:35:01 | euantor | Prometheus in general is pretty awesome. Are you just using it as a standard scrape endpoint? |
17:37:10 | dom96 | I'm using it for all sorts of logging |
17:37:27 | dom96 | I implemented a collector for Nim's GC a while back and it has been worth its weight in gold :) |
17:41:59 | FromGitter | <kragil> is there an easy (fully documented) way to write a modern Android apps in Nim? |
17:42:19 | Yardanico | you can if you use https://github.com/yglukhov/jnim but you'll wrap all java methods you want to use |
17:42:56 | Yardanico | see https://github.com/yglukhov/android |
17:43:07 | leorize | easy: no |
17:43:16 | FromDiscord | <dom96> fully documented: no |
17:43:34 | FromDiscord | <dom96> modern: probably also no to be honest |
17:43:46 | Yardanico | well, certainly far from easy :P |
17:43:54 | FromGitter | <kragil> OK, thanks for the honest answers ;-) |
17:43:57 | leorize | android is too much java afterall |
17:44:12 | FromDiscord | <dom96> Honestly, the only reason you should consider it is if you are writing a game that targets iOS and Android |
17:44:30 | FromGitter | <kragil> OK? I want to write a game! |
17:44:35 | FromDiscord | <dom96> That's why I'm writing an Android game in Nim. |
17:44:49 | Yardanico | @kragil then why do you want "modern android apps"? |
17:44:57 | Yardanico | for me that means material design and all that stuff |
17:45:07 | leorize | I'd write my own android app if it's feasable in Nim |
17:45:12 | leorize | I'm scared of java :P |
17:45:28 | FromDiscord | <dom96> yeah, be more specific that you want to write games not apps 😛 |
17:45:36 | FromGitter | <kragil> Sorry, I just want it to work on new Android handsets |
17:46:01 | FromGitter | <kragil> Is there a template that lets me write to the screen with Nim? |
17:46:17 | FromGitter | <kragil> and maybe make some noise ;-) |
17:46:19 | FromDiscord | <dom96> The way I'm doing it is by piggybacking on SDL |
17:46:35 | FromDiscord | <dom96> via my library which I would not recommend as it has no stable API: https://github.com/dom96/gamelight |
17:46:59 | FromGitter | <kragil> OK, any recommended ways? |
17:47:03 | FromDiscord | <dom96> I have spent many hours deep in C code trying to figure out why I was getting segfaults, so I wouldn't recommend it 😛 |
17:47:30 | FromDiscord | <dom96> hrm, I should at least change the description of this library |
17:47:40 | FromGitter | <kragil> No, I am not that experienced, but I find writing Nim Code really easy. |
17:48:54 | FromDiscord | <mratsim> @shashlick / @genotrance, a colleague is learning Nim and trying to wrap a C++ lib. I may have missed something in nimterop doc but it seems like we can pass defines but not passC/passL flags? https://github.com/nimterop/nimterop/issues/211 |
17:48:56 | disbot | ➥ Question about static linking a library |
17:51:20 | FromDiscord | <dom96> @mratsim doesn't SQLCipher have a SQLite-like API? |
17:53:11 | * | dadada joined #nim |
17:53:34 | * | dadada is now known as Guest89744 |
18:06:48 | FromDiscord | <mratsim> no idea |
18:07:22 | * | Romanson quit (Quit: Connection closed for inactivity) |
18:13:52 | * | kragil[m] joined #nim |
18:17:07 | * | Jesin joined #nim |
18:24:36 | PMunch | leorize, well obviously I don't :P |
18:25:26 | PMunch | Araq, it's because of this: minilib/strutils.nim:81: from unicode import toLower, toUpper |
18:25:41 | PMunch | That's the only thing that imports from it |
18:29:13 | Araq | PMunch, hmm ok |
18:30:11 | PMunch | Curiously those are behind a switch "when defined(nimVmExportFixed)" |
18:31:09 | Araq | let me tell you a secret |
18:31:14 | * | arecaceae quit (Remote host closed the connection) |
18:31:25 | Araq | 'when defined(nim***)' is always true |
18:32:00 | PMunch | I guess those are just used for some kind of backwards compatibility? |
18:32:17 | PMunch | For an older version of Nim to be able to use a newer versions stdlib? |
18:32:21 | * | arecaceae joined #nim |
18:35:57 | PMunch | Removing it got rid of unicode and unicode_ranges saving 88KB bringing the total down to 796KB |
18:36:03 | Araq | it's all for bootstrapping, an old Nim compiler must be able to compile new Nim code |
18:36:19 | * | Senketsu joined #nim |
18:36:34 | Araq | at least to the point that it can build a new Nim compiler |
18:36:47 | livcd | are there any easter eggs in the compiler? |
18:36:59 | Yardanico | lol |
18:37:08 | Yardanico | not that I know of, maybe if you consider comments an "easter egg" :D |
18:38:01 | krux02 | depends on your definition of "easter egg". |
18:38:14 | krux02 | There are many hidden feautures. |
18:38:36 | PMunch | Like "nim dump".. |
18:38:43 | Yardanico | it's documented |
18:38:52 | Yardanico | https://nim-lang.github.io/Nim/nimc.html |
18:38:54 | PMunch | Is it? |
18:38:58 | livcd | Basically something that makes Araq giggle |
18:38:59 | Yardanico | "dump dump all defined conditionals and search paths see also: --dump.format:json (useful with: ` | jq`)" |
18:39:13 | PMunch | Should be in --fullhelp IMO |
18:40:13 | * | krisppurg_ quit (Quit: Connection closed for inactivity) |
18:41:16 | Yardanico | btw found a cool repo Telegram, [21.04.20 16:03] |
18:41:16 | Yardanico | Актуальная информация о борьбе с COVID-19 в России доступна в канале https://t.me/stopcoronavirusrussia. |
18:41:19 | FromDiscord | <mratsim> so where can I read about AST2? |
18:41:21 | Yardanico | shit sorry wrong paste |
18:41:24 | Yardanico | https://github.com/dbohdan/compilers-targeting-c |
18:41:37 | PMunch | Haha, what was that Yardanico :P |
18:41:42 | Yardanico | PMunch: IDK either |
18:41:53 | Yardanico | seems like a message from telegram about COVID-19 |
18:41:58 | FromGitter | <bung87> list of language never heard.. |
18:42:08 | Yardanico | it includes nim btw |
18:42:08 | PMunch | Hmm, it would be interesting if Nim could pre-process the stdlib for nimscript into the binary.. |
18:42:15 | Yardanico | and I heard about a lot of these languages for sure |
18:42:16 | PMunch | So you wouldn't need to include the stdlib sources |
18:43:08 | * | D_ quit (Ping timeout: 244 seconds) |
18:43:40 | FromGitter | <bung87> ts2c oh, ts2c someone made this.. |
18:44:51 | * | D_ joined #nim |
18:49:32 | * | letto_ joined #nim |
18:50:31 | FromGitter | <bung87> haxe official site has jobs and Shop page |
18:50:34 | * | letto quit (Ping timeout: 272 seconds) |
18:53:02 | Yardanico | Araq: your orc fix worked, now nim forum works with orc and threads on |
18:53:04 | Yardanico | but leaks memory a lot |
18:53:21 | Yardanico | in just under 10 second of stress-testing it came to use 10gb ram, maybe it's due to httpbeast , idk |
18:53:29 | PMunch | Ouch |
18:53:48 | disruptek | !memory |
18:53:48 | disbot | total: 5 Megabytes; free: 528 Kilobytes; owned: 4 Megabytes; max: 5 Megabytes |
18:54:02 | Araq | Yardanico, use -d:useMalloc and leak detectors |
18:54:22 | disruptek | Araq: you too busy to mumble? |
18:54:45 | PMunch | Hmm, is there an easy package to package stuff in a binary? |
18:55:14 | PMunch | So it would get unpacked on runtime |
18:55:21 | Yardanico | yeah, staticRead :P |
18:55:37 | PMunch | I meant something that would take a path and recreate that entire path :P |
18:55:44 | leorize | 7z sfx |
18:55:55 | FromGitter | <bung87> wired , haxe web page makes me assuming it's popular than nim , but it has less stars |
18:56:04 | PMunch | Just a simple package, a line or two to use.. |
18:56:25 | leorize | stars is never a good metric |
18:56:54 | rockcavera | since which version do uint() int() and others convert without overflowing? |
18:57:33 | FromGitter | <bung87> the companies used surprised me |
18:58:26 | shashlick | @mratsim - i'll reply to the issue, i see what he needs to do |
18:58:35 | Yardanico | Araq: seems like memory is getting lost in httpbeast somehow |
18:59:13 | Yardanico | https://gist.github.com/Yardanico/9c15a2b2eff555fc6de08c5007da100d |
18:59:55 | leorize | rockcavera: wdym without overflowing? |
19:01:34 | FromDiscord | <Yardanico> Well to be fair I inserted some gcsafe pragmas as nimforum accesses some global variables |
19:03:10 | rockcavera | leorize if I'm not mistaken, in the past let a = 200'u8 | let b = int8(a) launch overflow error |
19:03:26 | PMunch | Hmm, not sure if this really should be closed: https://github.com/nim-lang/Nim/issues/14253 |
19:03:28 | disbot | ➥ Assignment to `default` leads to assignment for `nodecl` ; snippet at 12https://play.nim-lang.org/#ix=2l7t |
19:03:31 | leorize | !eval echo int8 200'u8 |
19:03:32 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: 200 can't be converted to int8 |
19:03:48 | leorize | !eval let a = 200'u8; let b = int8 a |
19:03:50 | NimBot | /usercode/in.nim(1) in↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: value out of range: 200 notin -128 .. 127 [RangeError] |
19:04:05 | leorize | rockcavera: ^ it's still the case? |
19:04:08 | rockcavera | I'm using devel |
19:04:38 | leorize | still crashing on devel |
19:04:47 | rockcavera | hummm |
19:08:11 | Araq | Yardanico: these globals still need to be protected by lock, usually |
19:08:24 | * | krisppurg joined #nim |
19:08:40 | * | poohman quit (Ping timeout: 258 seconds) |
19:09:00 | krisppurg | Hiya, is there a way to evaluate code in Nim without using nim's playground? |
19:09:19 | disruptek | use the compiler. |
19:09:23 | disruptek | ~playground |
19:09:23 | disbot | playground: 11an online in-the-browser IDE for simple Nim experiments at http://argentina-ni.ml/ -- disruptek |
19:10:10 | PMunch | disruptek, why isn't ~playground pointing the the official one? |
19:10:12 | * | poohman joined #nim |
19:10:43 | disruptek | i like learning spanish while i code. |
19:10:46 | FromDiscord | <KrispPurg> well, I mean at runtime. |
19:10:51 | PMunch | Yes |
19:10:55 | PMunch | Wait what? |
19:11:01 | PMunch | The playground isn't runtime? |
19:11:05 | PMunch | It compiles and runs your code |
19:11:14 | FromDiscord | <Yardanico> He means run Nim code at runtime in your Nim apps I think |
19:11:29 | FromDiscord | <Yardanico> @KrispPurg you can embed NimScript in your app but why? |
19:11:39 | leorize | kinda like scripting languages' `eval`? |
19:11:51 | PMunch | That's what I'm working on right now :P |
19:12:02 | PMunch | How come everyone started asking about it just as I started working on it? |
19:12:36 | FromDiscord | <KrispPurg> Incase, if there is anything wrong with my library say like session_id was reset, I would check and also test rest methods. |
19:12:49 | leorize | I rarely find a case where `eval` is actually useful |
19:12:50 | Araq | PMunch, I know the effect too. I think humanity is already some hive mind |
19:13:54 | leorize | the only reason I would need `eval` would be to do poor man's templating in languages that don't have proper metaprogramming |
19:14:45 | PMunch | Well I'm planning on using NimScript for configuration |
19:14:48 | PMunch | Like nimble does |
19:16:59 | FromGitter | <bung87> vote+1 |
19:20:19 | FromGitter | <bung87> can playground using nimble packages? |
19:21:14 | liblq-dev | afaik it can use some packages |
19:21:54 | PMunch | bung87 it has a list of packages |
19:21:54 | liblq-dev | ones listed here https://github.com/nim-lang/Nim/blob/devel/testament/important_packages.nim |
19:21:58 | PMunch | pre-installed |
19:22:03 | PMunch | But not quite that list |
19:22:58 | PMunch | Run this in the playground to see them: `static: echo staticExec("ls /playground/nimble")` |
19:23:00 | FromGitter | <bung87> oh, I saw this before, that's where it used. |
19:24:21 | FromGitter | <bung87> I think should fusion also included. |
19:24:42 | PMunch | That would be a good idea |
19:28:03 | * | dddddd joined #nim |
19:31:55 | Guest89744 | everything from https://nim-lang.org/docs/nimscript.html also works in runtime right? |
19:32:04 | Guest89744 | so if I want to target nimscript and normal runtime |
19:32:13 | Guest89744 | I'd better choose rmFile instead of os.removeFile? |
19:32:18 | * | Guest89744 is now known as dadada |
19:33:37 | dadada | hmm, seems like it doesn't work ... tested with rmFile |
19:34:20 | PMunch | Why doesn't it work |
19:35:03 | dadada | undeclared identifier rmFile |
19:35:16 | dadada | again, I'm trying this out on runtime, I assume it works in macros |
19:35:39 | PMunch | Did you try import nimscript? |
19:35:47 | dadada | yeah, says it can't open the file |
19:36:06 | dadada | Error: cannot open file: nimscript |
19:36:25 | PMunch | Huh |
19:36:49 | FromDiscord | <Yardanico> I think you can't use NimScript specific stuff in normal Nim apps |
19:37:28 | dadada | define specific rmFile vs removeFile ... seems like a good idea to have one that works on both?! |
19:37:42 | dadada | what would be the counter argument? |
19:47:26 | * | Senketsu quit (Ping timeout: 240 seconds) |
19:49:59 | PMunch | Huh, curious. I created a seq and an array in NimScript and they both came out as nkBracket (ie. an array literal) |
19:57:35 | PMunch | Hmm, doesn't tables work in nimscript? |
19:58:46 | FromGitter | <bung87> I want fusion included in playground ,and close some issues, dont have that permission.. |
19:59:15 | PMunch | bung87, what do you mean? Just create a PR to the plaground API? |
19:59:19 | FromDiscord | <Varriount> shashlick: What is AST2? |
19:59:21 | PMunch | s/API/repo |
20:00:00 | PMunch | Varriount, eh it's just a money grab from the makers of AST. No imagination, just the same of stich once again.. |
20:01:12 | FromGitter | <bung87> just test with fusion package, and put playground link , then close issues |
20:01:34 | PMunch | My script which is trying to use a table fails with this. Any ideas? http://ix.io/2lPz |
20:01:45 | FromGitter | <bung87> that's I wanna do |
20:02:27 | PMunch | bung87, okay, why don't you do it then? (apart from closing issues, I think only I can do that, just leave a comment on the ones you want closed) |
20:02:39 | PMunch | And what do you mean by "put playground link"? |
20:04:00 | FromGitter | <bung87> so that otherone can check result make sure issues could be closed |
20:05:33 | PMunch | I'm sorry but I don't really understand what you want to do here.. |
20:07:40 | FromGitter | <bung87> hmm , first step have fusion installed in playground, then I can write test code with fusion , put the code link under issues and notify someone close it. |
20:08:51 | disruptek | did we put a pointer math lib into stdlib? |
20:08:52 | PMunch | Ah right |
20:09:05 | PMunch | So create a PR to the playground repo that adds fusion |
20:09:06 | * | poohman quit (Ping timeout: 272 seconds) |
20:09:49 | FromGitter | <bung87> https://github.com/nim-lang/Nim/blob/devel/testament/important_packages.nim append it here? |
20:10:02 | FromGitter | <bung87> I thought it just for testing |
20:10:13 | PMunch | No, not there |
20:10:40 | PMunch | Here, in the playground repo: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble |
20:10:55 | FromGitter | <Nickiel12> can anyone recommend a library for playing media files? I was looking at cscore, then I realized that it is c#... |
20:11:16 | PMunch | Nickiel12, what kind of media files? |
20:11:23 | FromGitter | <Nickiel12> music files |
20:11:36 | FromGitter | <Nickiel12> starting with mp3 |
20:11:59 | FromDiscord | <Yardanico> libvlc? |
20:12:14 | FromDiscord | <Yardanico> I made a bare bones wrapper for it a while ago |
20:12:18 | FromGitter | <bung87> @PMunch ok, thanks ! then I can start now : ) |
20:12:20 | PMunch | https://nimble.directory/pkg/libvlc |
20:12:38 | FromDiscord | <Yardanico> Need to test it with ast2 |
20:12:45 | FromDiscord | <Yardanico> But simple MP3 worked for me fine |
20:12:55 | FromGitter | <Nickiel12> ok, I will start there! thanks |
20:13:30 | PMunch | Hmm, so hashVmImpl has an assert false that says "implementation override in compiler/vmops.nim" |
20:13:41 | PMunch | But that should be included with compiler/vm right? |
20:15:29 | FromGitter | <bung87> @Pmunch fusion not in nimble directory, it's ok just add its name or add repo url? |
20:15:43 | PMunch | Anything that nimble accepts is fine |
20:16:07 | PMunch | That is just a list of nimble dependencies which gets installed by calling "nimble install --depsOnly" |
20:18:01 | FromGitter | <bung87> oh ,seached so when inquire install from git it will answered yes |
20:18:28 | PMunch | Uhm, what? |
20:19:34 | shashlick | @Varriount: https://github.com/nimterop/nimterop/blob/master/CHANGES.md |
20:19:43 | FromGitter | <bung87> never mind , I check `RUN nimble install --nimbleDir:/installer/nimble -y --depsOnly` |
20:21:05 | FromGitter | <bung87> PR created |
20:21:43 | PMunch | Hmm, so what is the difference between scriptconfig.nim and nimeval.nim? |
20:22:12 | PMunch | Both seem to setup and run NimScript |
20:22:41 | PMunch | But scriptconfig uses a PEvalContext and runs "registerAdditionalOps" on it to get the table stuff defined.. |
20:26:15 | FromGitter | <Nickiel12> I get an error when importing libvlc, libvlc.nim(39, 8) template/generic instantiation of `cImport` from here |
20:26:27 | FromGitter | <Willyboar> https://dev.to/devteam/announcing-the-grant-for-the-web-hackathon-on-dev-3kd1 |
20:26:58 | PMunch | Nickiel12, sounds like nimterop issue. Yardanico? |
20:27:30 | FromGitter | <Nickiel12> nimterop does throw an error on that stack trace as well |
20:29:27 | FromGitter | <Nickiel12> `nimterop-0.5.2\nimterop\cimport.nim(651, 10) template/generic instantiation of cImport from here` |
20:29:39 | FromGitter | <bung87> that's happened when you using a template calls proc not exported |
20:30:30 | FromGitter | <Nickiel12> is there anything I can do about it? |
20:31:42 | shashlick | Nickiel12: please share the error after that |
20:31:56 | FromGitter | <Nickiel12> `C:\Users\nicho\.choosenim\toolchains\nim-1.0.6\lib\system\fatal.nim(39, 5) Error: unhandled exception: C:\Users\nicho\.nimble\pkgs\nimterop-0.5.2\nimterop\cimport.nim(172, 12) ret == 0` |
20:32:09 | FromGitter | <bung87> check the file it reported, export all its imported |
20:32:52 | FromGitter | <bung87> @PMunch please merge the PR I created |
20:32:57 | disruptek | async still broken for me under orc. |
20:33:19 | PMunch | bung87, hold on, first I need to check that it actually works.. |
20:33:23 | FromGitter | <Nickiel12> so add {.exportc.} to this??? `macro cImport*(filename: static string, recurse: static bool = false, dynlib: static string = "", ⏎ mode: static string = "c", flags: static string = ""): untyped =` |
20:34:10 | * | narimiran quit (Quit: leaving) |
20:34:33 | FromGitter | <bung87> `export ` module the macro used |
20:35:24 | FromGitter | <bung87> @PMunch ok |
20:35:46 | FromGitter | <Nickiel12> where do I do that... |
20:37:01 | FromGitter | <bung87> cimport.nim ,see whats it imported , then export all |
20:37:46 | FromGitter | <Nickiel12> export it's imports? |
20:38:29 | FromGitter | <Nickiel12> so add the rest of the relative imports to the export in this line? ⏎ `import "."/[build, globals, paths, types] ⏎ export types` |
20:38:34 | FromGitter | <bung87> yeah, I face same problem several times, there's a opened issue for this |
20:39:37 | FromGitter | <bung87> it depends what module the macro used, maybe all the modules |
20:40:54 | FromDiscord | <Yardanico> @Nickiel12 sorry I wouldn't be able to help today, only tomorrow (in around 10-15 hours) |
20:41:06 | FromGitter | <Nickiel12> ok |
20:41:07 | FromDiscord | <Yardanico> I'll test libvlc with latest nimterop then |
20:41:08 | FromGitter | <Nickiel12> these are all of the imports at the top of the file ⏎ `import hashes, macros, os, strformat, strutils` ⏎ `import regex` ⏎ `import "."/[build, globals, paths, types]` ⏎ `export types` [https://gitter.im/nim-lang/Nim?at=5ebb09e37c04b92f535c94a8] |
20:41:20 | FromGitter | <Nickiel12> ok |
20:42:02 | FromGitter | <bung87> you can check one by one , as I only have this clue |
20:42:08 | FromGitter | <Nickiel12> ok |
20:44:11 | PMunch | Okay, I can see what the problem with PNodes are.. |
20:44:46 | PMunch | I created a simple table and added two entries to it, this is what came out: http://ix.io/2lPQ |
20:44:57 | shashlick | Nickiel12: please share the full log as a gist |
20:45:09 | PMunch | Which I guess makes sense |
20:45:36 | PMunch | But it's not very optimal in terms of getting useful data from it.. |
20:46:47 | FromGitter | <Nickiel12> <script src="">https://gist.github.com/Nickiel12/0b03ca834f2132a6f74afde08a162853.js"></script> |
20:47:06 | FromGitter | <Nickiel12> https://gist.github.com/Nickiel12/0b03ca834f2132a6f74afde08a162853 |
20:49:00 | shashlick | thanks - what version of nimterop do you have |
20:49:31 | FromGitter | <Nickiel12> 1) 5.2 |
20:49:33 | shashlick | ya says 0.5.2 |
20:49:50 | shashlick | okay, i need to try this locally - need more details |
20:50:43 | FromGitter | <Nickiel12> `nimble install libvlc` is all I did, after I tried to update nimterop, but it was 0.5.2 already |
20:51:00 | FromGitter | <Nickiel12> `import libvlc` ⏎ ⏎ `echo "hello there"` |
20:51:05 | FromGitter | <Nickiel12> is all that is in my Main.nim |
20:51:42 | shashlick | i don't know if yardanico tested this on windows but we need better output from nimterop for sure |
20:51:54 | FromGitter | <Nickiel12> is there a way I can get it? |
20:54:29 | shashlick | the line numbers in the output are totally random - don't match what's in the repo |
20:55:31 | shashlick | i'll need to debug and get back to you, don't have my windows system up |
20:55:51 | FromGitter | <Nickiel12> ok |
20:56:24 | FromGitter | <Nickiel12> I noticed that the output line numbers don't always match up either, though this seems to match what it was talking about |
20:56:50 | FromGitter | <Nickiel12> ` # see https://github.com/nimterop/nimterop/issues/69 ⏎ (result, ret) = execAction(cmd, die = false, cache = (not gStateCT.nocache),` ⏎ ` cacheKey = getCacheValue(fullpaths))` ⏎ doAssert ret == 0, getToastError(result)` [https://gitter.im/nim-lang/Nim?at=5ebb0d9120eaac1853063278] |
20:56:53 | disbot | ➥ getCacheValue seems wrong ; snippet at 12https://play.nim-lang.org/#ix=2lPU |
21:01:51 | FromGitter | <Nickiel12> is this a `template/generic instantiation of cImport` ? ⏎ `cImport(@[`filename`], bool(`recurse`), `dynlib`, `mode`, `flags`)` |
21:06:36 | shashlick | cImport is a macro call - it is failing but the error is not obvious so it says that generic error |
21:06:43 | PMunch | Hmm, so the marshal module doesn't work for NimScript.. Passing data from NimScript to Nim through JSON feels, dirty.. |
21:07:49 | FromGitter | <Nickiel12> ok |
21:08:01 | * | poohman joined #nim |
21:10:11 | FromGitter | <Nickiel12> so it wouldn't say if the function failed, just that something is wrong? |
21:14:21 | FromGitter | <Nickiel12> `cImport(baseDir / "include" / "vlc_messages.h", dynlib = "dynvlc")` this is the line at the top of the bold paths from the stack trace |
21:17:09 | FromGitter | <Nickiel12> could it have something to do with the fact that there isn't a .dll file in the /build directory that it is where all the headers are? |
21:19:15 | FromGitter | <Nickiel12> am I supposed to have the libvlc.dll on the Path??? |
21:20:49 | FromGitter | <bung87> a wrapper module will looking for system wide dll path |
21:21:14 | * | Vladar quit (Quit: Leaving) |
21:21:48 | FromGitter | <Nickiel12> so that is a yes? |
21:22:03 | FromGitter | <Nickiel12> I need to compile the libvlc.dll and add it to the path |
21:22:11 | FromGitter | <Nickiel12> or check that I have it at least |
21:23:34 | PMunch | @bung87, merged the PR, building the new image on the server now |
21:24:25 | * | poohman quit (Remote host closed the connection) |
21:24:51 | * | poohman joined #nim |
21:26:20 | FromGitter | <bung87> I checked it just now, seems playground does not have? |
21:28:24 | PMunch | As I said, the image is building now |
21:28:31 | PMunch | Give it some time to complete.. |
21:29:07 | FromGitter | <bung87> ok get it. |
21:29:40 | * | sc joined #nim |
21:31:02 | * | solitudesf quit (Remote host closed the connection) |
21:33:29 | FromGitter | <Nickiel12> @bung87 I added the libvlc files that come with the official vlc media player to the path, but got the same error as before |
21:33:39 | shashlick | Nickiel12: have some questions for yardanico, so will need to wait |
21:33:45 | shashlick | i don't see how this ever worked |
21:33:53 | FromGitter | <Nickiel12> ok |
21:34:00 | shashlick | anyway, gotta run for some errands, will get it working soon |
21:42:24 | PMunch | !eval import fusion |
21:42:26 | NimBot | Compile failed: /usercode/in.nim(1, 8) Error: cannot open file: fusion |
21:42:45 | FromGitter | <bung87> building finished ? |
21:42:49 | PMunch | Yup |
21:43:34 | FromGitter | <bung87> !eval import fusion |
21:43:36 | NimBot | Compile failed: /usercode/in.nim(1, 8) Error: cannot open file: fusion |
21:44:01 | * | abm quit (Ping timeout: 264 seconds) |
21:44:26 | PMunch | !eval import fusion |
21:44:28 | NimBot | Compile failed: /usercode/in.nim(1, 8) Error: cannot open file: fusion |
21:45:30 | PMunch | !eval fusion/btreetables |
21:45:32 | NimBot | Compile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'fusion' |
21:45:40 | PMunch | !eval import fusion/btreetables |
21:45:42 | NimBot | <no output> |
21:45:45 | PMunch | Yay! |
21:46:08 | * | liblq-dev quit (Quit: WeeChat 2.8) |
21:46:54 | FromDiscord | <Rika> nice |
21:47:44 | * | enthus1ast30 joined #nim |
21:47:47 | leorize | PMunch: do you think we can have more prebuilt docker images for more architectures? it'd be helpful for CI |
21:48:04 | * | enthus1ast30 is now known as enthus1ast_ |
21:48:04 | FromGitter | <bung87> nice ,available now. |
21:48:17 | leorize | people would just need to point to the docker image and they can get all testing done |
21:48:28 | PMunch | leorize, sure don't see why not |
21:48:55 | leorize | the only one being left out will be macos :P |
21:48:59 | enthus1ast_ | dom96 https://forum.nim-lang.org/search?q=a makes the forum not responding for a few seconds. |
21:49:51 | enthus1ast_ | my guess is non async sql driver :) |
21:50:12 | leorize | does sqlite even have an async driver? |
21:50:52 | enthus1ast_ | i dont know where but i think i saw an (relative new) async sql driver |
21:51:29 | leorize | iirc they had one but then they got rid of it |
21:52:30 | enthus1ast_ | when i remember correctly the one i saw was not "official" |
21:53:52 | FromGitter | <bung87> httpclient does not compile with ssl? |
21:53:57 | FromGitter | <bung87> in playground |
21:55:30 | leorize | enthus1ast_: yea the sqlite api have zero async primitives |
21:55:45 | leorize | the only way to do async is to delegate it into an another thread |
21:55:56 | disruptek | dude. |
21:55:57 | disruptek | leorize. |
21:56:03 | FromGitter | <awr1> this is a shot in the dark but is there anything like phantomJS for nim? like a way of rendering a website to a PNG? |
21:56:03 | disruptek | what happened with your iocp stuff? |
21:56:14 | disruptek | are they in your new osproc? |
21:56:17 | disruptek | and it is done? |
21:56:39 | leorize | disruptek: the pipe thingy is usable but I'm not done with the new osproc yes |
21:56:47 | leorize | yet* |
21:57:00 | disruptek | it uses iocp or just named pipes or what? |
21:57:07 | * | tane quit (Quit: Leaving) |
21:57:17 | FromGitter | <bung87> there is a wrapper ,check need libraries repo |
21:57:48 | leorize | disruptek: randomized named pipes with a lot of restrictions to imitate the security of anonymous pipes |
21:57:59 | FromGitter | <awr1> seems like making bindings to libwkhtmltox might be an option |
21:59:04 | FromGitter | <awr1> i need a small utility to watch for visual changes to a certain website every, say, 10 or 15 minutes |
21:59:10 | * | poohman quit (Ping timeout: 256 seconds) |
21:59:40 | FromGitter | <bung87> https://github.com/nim-lang/needed-libraries/issues/76 |
21:59:42 | disbot | ➥ Selenium driver |
21:59:58 | * | PMunch quit (Quit: leaving) |
22:00:07 | FromGitter | <awr1> yeah selenium would also be an alternative |
22:00:25 | FromGitter | <bung87> !repo webgui |
22:00:27 | disbot | https://github.com/juancarlospaco/webgui -- 9webgui: 11Web Technologies based Crossplatform GUI Framework with Dark theme 15 25⭐ 3🍴 7& 1 more... |
22:02:46 | dom96 | awr1: https://github.com/dom96/webdriver/ |
22:03:07 | dom96 | Also have this https://github.com/dom96/geckodriver-travis |
22:03:17 | FromGitter | <awr1> yeah i'm actually watching your video on it right now |
22:03:21 | FromGitter | <awr1> i saw it in the comments |
22:17:44 | FromGitter | <awr1> hm i wonder if chromedriver can take screenshots |
22:20:13 | * | krisppurg quit (Quit: Connection closed for inactivity) |
22:21:43 | * | ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
22:24:01 | * | poohman joined #nim |
22:26:44 | FromGitter | <bung87> https://github.com/nim-lang/Nim/issues/12202#issuecomment-627631776 |
22:26:47 | disbot | ➥ parseHtml does not work (eg: can't find any div) in presence of <script> tags ; snippet at 12https://play.nim-lang.org/#ix=2lQb |
22:27:26 | FromGitter | <bung87> I commented not sure should closed as it solved in fusion htmlparser |
22:29:17 | FromGitter | <bung87> https://github.com/nim-lang/Nim/issues/14073 also this one |
22:29:19 | disbot | ➥ htmlparser doest parse self close tag ; snippet at 12https://play.nim-lang.org/#ix=2j67 |
22:29:46 | * | poohman quit (Ping timeout: 246 seconds) |
22:32:26 | FromGitter | <bung87> https://github.com/nim-lang/Nim/pull/12205 also this |
22:32:29 | disbot | ➥ fix #12202 parseHtml now correctly handles <script> jscode </script> |
22:41:16 | Prestige | Making a small devlog about my WM in nim if anyone is interested, will be posting soon |
22:46:42 | leorize | nice :) |
22:47:43 | FromGitter | <bung87> https://github.com/nim-lang/Nim/issues/14056 also this might be closed. |
22:47:44 | disbot | ➥ xmlparser removes significant white space |
22:48:34 | FromDiscord | <exelotl> is there a way I can do like `db.getRow` but instead of returning a seq[string] it returns a tuple with whatever names and types I want? |
22:49:04 | leorize | use ndb |
22:49:11 | leorize | !repo ndb |
22:49:12 | disbot | https://github.com/xzfc/ndb.nim -- 9ndb.nim: 11A db_sqlite fork with a proper typing 15 25⭐ 5🍴 |
22:49:27 | leorize | ^ it said that but it has mysql support too |
22:49:30 | * | monokrom quit (Quit: Leaving) |
22:49:35 | FromDiscord | <exelotl> :O |
22:57:37 | disruptek | thanks for the help, leorize. |
22:58:01 | dadada | which module do I need for these https://nim-lang.org/docs/stackframes.html = |
22:58:01 | dadada | stackframes won't import |
22:58:01 | leorize | np :) |
22:58:22 | leorize | it's an internal module |
22:58:52 | leorize | ah wait it's not |
22:58:58 | leorize | import with `import std/stackframes` |
22:59:16 | * | enthus1ast_ quit (Remote host closed the connection) |
23:10:04 | * | NimBot joined #nim |
23:10:56 | * | fredrikhr quit (Ping timeout: 258 seconds) |
23:14:39 | dadada | leorize: procName doesn't provide any information about the arguments ... is there a simple way for that? |
23:15:28 | leorize | get PFrame and you'll have the location |
23:15:36 | leorize | regarding the arguments, no we don't store them |
23:16:02 | * | krux02 quit (Ping timeout: 260 seconds) |
23:34:44 | dadada | does nim store the sources with fully expanded macros somewhere or is it all happening in memory? |
23:34:52 | dadada | by store I mean on disk |
23:35:24 | dadada | leorize: ping, you seem to know a lot |
23:35:43 | dadada | :D thanks for the previous help, too, I'll try my best to give back to the community |
23:37:25 | leorize[m] | dadada: all in memory, unfortunately |
23:37:36 | dadada | dammit |
23:37:55 | leorize[m] | but if you're in a proc, macros.locals should give you a good view on what variables there are |
23:38:18 | dadada | aha |
23:38:51 | dadada | yeah, that's pretty great, I want to see the actual code before it's compiled |
23:39:05 | dadada | not the C code though |
23:39:06 | dadada | :D |
23:39:26 | dadada | and I assume the C code is also all in memory? |
23:39:37 | dadada | moment, that wouldn't jive with gcc? |
23:40:00 | dadada | I guess you could pipe it into gc |
23:40:00 | leorize[m] | ah, it's not in macros, that's in system |
23:40:16 | leorize[m] | the C code is on disk |
23:40:17 | leorize[m] | in the nimcache |
23:41:44 | dadada | is there one C code file per nim module? |
23:42:16 | leorize[m] | yep |
23:42:31 | dadada | okay, I think that's pretty neat |
23:48:07 | dadada | when is the nimcache cleared? |
23:48:54 | * | sc quit (Remote host closed the connection) |
23:56:06 | * | ftsf joined #nim |
23:56:21 | dadada | leorize[m]: and do you know where is this usually stored on Linux? |
23:57:20 | leorize[m] | in the nimcache |
23:57:30 | leorize[m] | read the compiler docs for the location |
23:58:02 | leorize[m] | iirc there's a proc somewhere that gives you the cache location |
23:58:09 | leorize[m] | std/compilesettings comes to mind |