<< 12-05-2020 >>

00:03:07FromDiscord<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:07FromDiscord<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:37zacharycartershashlick - no let me try that
00:04:31FromDiscord<Rika> also good morning
00:05:05FromDiscord<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:50FromDiscord<Rika> oh shit... i think i just fixed it lmao
00:18:32leorizeI said most, not all
00:18:56shashlickI tried cimgui this morning, it works on the command line itself
00:19:18FromGitter<kaushalmodi> @timotheecour It was about the support of --backend for :test: code blocks
00:19:58FromGitter<kaushalmodi> Then I followed up in a separate PR. Your work made it easy to build that PR on.
00:20:31shashlick@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:31FromDiscord<Never Listen To Beef> What do you mean it works on the command line itself?
00:29:38FromDiscord<exelotl> man, jester with this bootleg template engine is pretty nice :)
00:29:39FromDiscord<exelotl> https://cdn.discordapp.com/attachments/371759389889003532/709562898229362736/unknown.png
00:31:04FromDiscord<exelotl> I guess I should try an ORM
00:34:44shashlickBeef: I meant creating a Nim wrapper of cimgui with nimterop on the command line
00:35:13FromDiscord<Anuke> Question about this Discord nim library: https://github.com/krisppurg/dimscord
00:35:13FromDiscord<Anuke>
00:35:14FromDiscord<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:14FromDiscord<Anuke>
00:35:18FromDiscord<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:18FromDiscord<Anuke>
00:35:18FromDiscord<Anuke> This is being run on a VPS, so obviously I'm not putting my computer to sleep. What's broken here?
00:37:39zacharycartersounds like a question for the author of dimscord
00:37:46FromDiscord<Rika> @KrispPurg
00:38:03FromDiscord<Anuke> *OS is Ubuntu 18.04, if it matters*
00:40:15*zagani quit (Quit: Leaving)
00:42:46zacharycartershashlick: `-f:ast2` worked for cimgui - thanks
00:42:51zacharycarternimterop seems way slower now though
00:42:54zacharycartercompile times are bad
00:47:27PrestigeIs 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:06zacharycarterbut it's an improvement either way! no longer need all those cOverrides
00:48:11zacharycarterand hopefully compile times will get better
00:48:15shashlickRegex has added a lot of dependencies
00:48:19zacharycarterah
00:48:33shashlickBut toast also uses the compiler ast
00:48:47shashlickCan you confirm it is compiled with danger?
00:48:57zacharycarterwell maybe I'll just use nimterop to generate the bindings then
00:49:18shashlickI'll spend some time profiling
00:49:23zacharycarterokay :)
00:49:27shashlickCan you give me some numbers?
00:49:39shashlickOr a wrapper I can test with
00:50:09zacharycarterlet me get some numbers
00:50:12shashlickHope you don't use -f or cDisableCaching()
00:50:28zacharycarterI don't - just `-f:ast2`
00:50:41shashlickNo I mean to Nim itself
00:50:47zacharycarterno neither
00:51:02shashlickFirst time is slow, after that it should be cached
00:51:11shashlickBut ya still willing to profile
00:51:28shashlickIs the toast command itself slow or when called by the wrapper
00:53:23zacharycarterhttps://gist.github.com/zacharycarter/72c333314ca366fc1f58b3c72c8310fb takes 12.919 seconds to compile
00:53:56zacharycarterwith a release build of Nim
00:54:16shashlickThere's no cImport in that
00:54:25zacharycarterno there's not
00:54:34zacharycarterbut it's still taking 12.919 seconds to compile
00:55:16zacharycarternot just the first time either
00:56:01FromDiscord<KingDarBoja> Argh, I hate power ouytages
00:56:11FromDiscord<KingDarBoja> outages*, they cut off my inspiration to code
00:56:15zacharycarteroh wait one second
00:56:21zacharycarterI think I pasted the wrong file shashlick
00:56:37FromDiscord<KingDarBoja> And again, posted on general instead of off-topic 🤦
00:56:59zacharycarterhttps://gist.github.com/zacharycarter/72c333314ca366fc1f58b3c72c8310fb
00:57:10zacharycartershashlick: that's the one taking 12.9 seconds to compile
00:57:41shashlickcan you compile it with the toast command line by itself
00:57:47shashlickthe wrapper should print out the command line
00:57:53shashlickyou can just run that
00:58:10zacharycartermaybe there wasn't much of an increase in compile time - with 0.4.3 it's still taking 12 seconds
00:58:41shashlickwhat about on a second try when caching kicks in
00:58:56zacharycartersame
00:59:24zacharycartermost of the time is spent in compiling nim sources
00:59:30zacharycartertoast seems to be fairly quick
00:59:56zacharycarteris there a way to spit out what toast command is being run?
01:00:11zacharycarterah I see it nevermind
01:00:38zacharycarteryeah toast is fast - it's compiling the nim code
01:01:49zacharycarterwhere the slowness resides
01:01:56PrestigeI suppose seqs are always copy-only.. hmm
01:02:02*exelotl quit (Ping timeout: 260 seconds)
01:03:17shashlickya 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:25shashlicktakes 6 seconds for me
01:03:48zacharycarterI'm streaming too so my machine might be a bit slower
01:03:54zacharycarterbut either way 6 seconds is not great
01:05:28shashlickwhat is a good metric
01:05:40shashlickthat's including compilation of all sources and linking, etc.
01:06:51*konvertex quit (Ping timeout: 260 seconds)
01:06:55zacharycarterI guess whatever it would take to compile the generated wrapper without nimterop in the picture
01:07:07zacharycarterI'm fine taking a hit on the first compilation
01:07:16zacharycarterbut afterwards it should be as fast as compiling the bindings themselves, no?
01:08:43shashlickyes but you are still pulling in cimport, build and all their deps and the compiler will go through them
01:08:54shashlickideally it shouldn't do anything since all that should be cached
01:08:57zacharycarteryeah
01:09:00shashlickperhaps when incremental compilation is faster
01:09:11shashlickanyway, i'm pushing more and more fucntionality into toast
01:09:12zacharycarteruntil then I probably just have to use nimterop like a c2nim
01:09:20zacharycarteror just use toast
01:09:32shashlickso eventually it will become a separate artifact generation step
01:09:44shashlicksome ideas rolling around in my head
01:15:51*dddddd quit (Remote host closed the connection)
01:20:05*minnr joined #nim
01:21:24leorizePrestige: yea, seqs are value types
01:22:10Prestigeleorize: is there no way to get a ref?
01:23:23PrestigeI 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:57Prestigeso inside a proc body when I access that a lot, I was wanting let myBars = this.myTable[myFoo]
01:26:44FromDiscord<Never Listen To Beef> I'm a dumb dumb, but couldnt you just use a ptr?
01:27:03Prestigethat's what I'm curious about, I think I should be able to
01:27:07zacharycarteryou can of course
01:27:11zacharycarterbut it's not a managed pointer
01:27:26zacharycarteralthough the seq's memory will be managed by Nim
01:27:46PrestigeI need to read up on pointers in nim
01:28:09zacharycartercan also do - ```
01:28:11zacharycarterproc box[T](x: T): ref T = new(result); result[] = x```
01:29:14minnrYeah 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:51disruptekit won't be easy to figure out if we can cache nimterop macro stuff.
01:29:55Prestigeah interesting, so that creates a new pointer and assigns its value at the pointer's location to T?
01:30:26zacharycarterit creates a managed ref and assigns the value to the memory at the refs address
01:30:40FromDiscord<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:41Prestigevery neat, thank you
01:30:43zacharycarterNim distinguishes references from pointers - pointers aren't traced by the memory subsystem
01:30:47zacharycarterreferences are
01:31:50zacharycarteryou could also just use a `var` parameter when passing the seq to a proc
01:32:10zacharycarterand essentially a managed pointer will be passed to that proc
01:32:26minnrProbably 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:48Prestigeso I'm grabbing it from `this: WindowManager` which is passed into the proc, WindowManager has that table I was speaking of earlier
01:32:52zacharycarterone way to find out
01:33:34*D_ quit (Quit: No Ping reply in 180 seconds.)
01:34:55zacharycarterwell then a var parameter won't help you
01:35:32zacharycarterI guess if you're worried about efficiency, don't use a seq?
01:35:32*D_ joined #nim
01:35:38zacharycarteruse an array
01:35:52zacharycarteror store pointers to a seq in the table
01:35:59zacharycarterbut just ensure its lifetime
01:36:27Prestigewas mostly trying to make the code more readable
01:36:39zacharycarteror store refs - but be mindful that every time you instantiate a ref you're allocating from the heap
01:37:12zacharycarterI tend to shy away from sequences unless I truly need a dyanmic array
01:37:34zacharycarterusing an array with a sensible size limit usually works just fine
01:37:43zacharycarterand is how most C code is written
01:37:55*a_chou joined #nim
01:37:57PrestigeUsing it for a window manager, so I could probably set a size limit pretty easily
01:38:06zacharycarterI imagine so
01:38:17Prestigeit's a seq for a number of windows in a tag (like a workspace)
01:38:21FromDiscord<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:28PrestigeLOL
01:38:36PrestigeYeah I was thinking a 32 win cap
01:38:42FromDiscord<Varriount> What's `-f:ast2`?
01:38:43Prestigeyou 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:59FromDiscord<Never Listen To Beef> Well 16 is more than enough imo
01:39:02*a_chou quit (Remote host closed the connection)
01:39:03FromDiscord<Never Listen To Beef> If anymore move to the next
01:39:28PrestigeI once tested a wm by spawning a ton of windows and I think it crashed around 16 in a single tag
01:39:40PrestigeIdk how I feel about the wm I'm writing having that happen
01:40:04PrestigeI could just check the limit and not allow it without crashing though...
01:40:06FromDiscord<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:47PrestigeHm
01:40:52*chemist69 joined #nim
01:40:56PrestigeOkay I may do that
01:42:14FromDiscord<Never Listen To Beef> The fucko message?
01:42:44PrestigeLol no just capping the # of windows
01:43:22*vqrs_ quit (Ping timeout: 260 seconds)
01:43:30FromDiscord<Never Listen To Beef> You're no fun
01:43:46FromDiscord<Rika> close a random window when the cap is exceeded 🙂
01:44:02PrestigeHeh
01:44:17PrestigeI'll pop up a window like a windows98 error message
01:44:29FromDiscord<Never Listen To Beef> Just send a notification
01:44:35FromDiscord<Never Listen To Beef> Cmon do the lazy thing
01:45:10*vqrs joined #nim
01:45:38minnrJust 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:33zacharycarterbtw - streaming in case anyone wants to watch me port C to Nim code - https://www.twitch.tv/zachary_carter
01:47:59FromDiscord<Never Listen To Beef> Oh congrats it's still full screened 😄
01:48:04leorize[m]Prestige: you do know you can just use a template, right?
01:48:29zacharycarterthanks - I try
01:48:39PrestigeIn order to not use this.myTable[myFoo] leorize[m] ?
01:51:05FromDiscord<Never Listen To Beef> So now to actually give some critique you're way tooo quite
01:51:17FromDiscord<Never Listen To Beef> quiet*
01:51:32*Guest94046 quit (Ping timeout: 260 seconds)
01:52:21Prestigeoh, 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:53FromDiscord<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:04leorizePrestige: yea
02:18:08*Guest83646 quit (Ping timeout: 272 seconds)
02:18:15leorizeor std / byaddr, though I'm not a fan of that module
02:18:48PrestigeI'll need to look into that, don't have a firm grasp on templates yet
02:20:16leorizealso std / with is a nice macro
02:21:05skrylar[m]table construction syntax is neat.
02:23:15*minnr quit (Quit: Leaving)
02:23:34skrylar[m]`var sprog = shader_from_files("vert.glsl", "frag.glsl", {0: "vpos", 1: "vtex"})`
02:23:45*dadada__ joined #nim
02:25:47FromDiscord<Never Listen To Beef> You mean the tuple array?
02:27:16skrylar[m]yes. its called table construction in the AST
02:29:49FromDiscord<Technisha Circuit> > @Technisha Circuit sup bro
02:29:49FromDiscord<Technisha Circuit> Hi!
02:30:10zacharycarter?
02:30:31FromDiscord<Technisha Circuit> Just replying to @KingDarBoja
02:30:56FromDiscord<KingDarBoja> What's up? 😄
02:30:58zacharycarteroh
02:31:06FromDiscord<KingDarBoja> I really loving Nim
02:31:08zacharycarterlooked like you were saying hi to yourself
02:31:19leorizeguess the bridge doesn't handle that
02:31:31FromDiscord<KingDarBoja> 😄
02:31:38FromDiscord<KingDarBoja> Finished the refactoring of my parser
02:31:43FromDiscord<KingDarBoja> Pushing the changes now yeyy
02:32:54FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim Look leorize-sensei
02:35:19*silvernode joined #nim
02:35:36silvernodeGood evening!
02:36:13FromDiscord<KingDarBoja> Good night 😄
02:36:29silvernodelol
02:37:06FromDiscord<KingDarBoja> Welcome 😄
02:39:58leorizeKingDarBoja: AST looks good, though I'm seeing a cyclic structure over there :P
02:40:36leorizeyour Token is cyclic, which means it's slow and a sign of maybe you're not doing it right :)
02:42:03FromDiscord<KingDarBoja> Cyclic? whereeee?
02:43:18leorizedoubly linked list is cyclic by nature: `[ node ] <-> [ node ]` (ie. they can each keep one another alive)
02:44:04FromDiscord<KingDarBoja> Not sure what you mean 😄
02:45:08leorizeit means that to get rid of the two nodes, trial deletion and stack scanning has to be done
02:45:43FromDiscord<KingDarBoja> Why it is happening, I am really dumb haha
02:46:38leorizeimagine this `var a = Token(); a.next = Token(prev: a)`
02:47:01leorizenow you set `a = nil`
02:47:09leorizethe ref count of `a` is decreased by 1
02:47:12*dadada__ quit (Ping timeout: 256 seconds)
02:47:21leorizebut it's being kept alive by the `.next` node
02:47:31FromDiscord<KingDarBoja> ahh
02:47:50leorizewell the GC can handle this, but it slows things down
02:48:02FromDiscord<KingDarBoja> well I don't need to delete nodes tbh
02:48:06FromDiscord<KingDarBoja> tokens*
02:49:05FromDiscord<Technisha Circuit> Im alive-
02:49:50FromDiscord<KingDarBoja> It is built like that ref in source implementation (JS)
02:50:03FromDiscord<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:13PrestigeCreated this looking from some examples, seems to work: https://play.nim-lang.org/#ix=2lJJ
02:55:23Prestigebut I don't entirely understand it
02:55:59Prestigealso I think that may be creating a copy of the seq[int]..
02:56:23leorizeyea you are
02:56:37leorizeso templates are macros but lightweight :P
02:56:56leorizethey are basically a prebuilt AST with placeholders (which are the parameters)
02:57:18FromDiscord<KingDarBoja> leorize: ?
02:57:33FromDiscord<codic> how do i import a string in nim?
02:57:40FromDiscord<Technisha Circuit> Hahahaha
02:57:41FromDiscord<codic> like `"thing"` would become `import thign`
02:57:44leorizethe AST of whatever parameter will be substituted into the prebuilt AST and substituted into the template call
02:57:46Prestigeoh I think I know what you wanted me to do now leorize
02:57:50FromDiscord<Technisha Circuit> You ask them after i asked you
02:58:00Prestigeperhaps
02:58:37leorizetemplate vals: untyped = table[key] <- boom now you got your own shortcut :)
02:59:01leorizeinstances of `vals` will be transformed into `table[key]` :)
02:59:15FromDiscord<Rika> @codic you dont
02:59:40leorizewell you can, just not recommended
03:00:21PrestigeMight've lost me there, that was supposed to be shorthand for an actual template right?
03:00:43PrestigeI honestly feel like I understand macros better than templates lol
03:01:03leorizegive me some noisy code that you want to simplify
03:01:07leorizeI'll help you with this :P
03:01:36FromDiscord<codic> why isn't it recommended?
03:01:59PrestigeThanks - leorize https://play.nim-lang.org/#ix=2lJL (does not compile, it's the literal function I'm wanting to clean up)
03:02:09FromDiscord<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:14Prestigethere's a lot of this.tagTable[this.selectedTag] that I want to shorten
03:02:56FromDiscord<Rika> @Technisha Circuit you can export variables
03:03:06FromDiscord<Technisha Circuit> How does that work?
03:03:09FromDiscord<Rika> same way
03:03:12FromDiscord<Rika> name*
03:03:18FromDiscord<Technisha Circuit> Ik the lib in python i use uses weakref
03:03:19PrestigeFull source leorize https://github.com/avahe-kellenberger/nimdow/blob/master/src/nimdowpkg/windowmanager.nim#L344
03:03:22FromDiscord<Technisha Circuit> So export?
03:03:27FromDiscord<Rika> var a* = 0
03:03:29FromDiscord<Rika> or something
03:03:38FromDiscord<Technisha Circuit> Oh okay, thanks
03:03:43FromDiscord<Rika> then if you import it'll be there too
03:03:54FromDiscord<Technisha Circuit> Nice!
03:03:56FromDiscord<Technisha Circuit> Thanks!
03:04:10FromDiscord<Technisha Circuit> How about if i have a predefined variable?
03:04:23FromDiscord<Rika> waht do you mean
03:04:54leorizePrestige: https://play.nim-lang.org/#ix=2lJO <- my experiment with `std/with`, may not work
03:05:01leorizeI'll give you one with templates in just a bit :P
03:05:03FromDiscord<Technisha Circuit> For example let's say i have a variable that's passed as an argument
03:05:09FromDiscord<codic> Lemme show you
03:05:15FromDiscord<Technisha Circuit> And i want it to be defined in every file i export
03:05:27FromDiscord<codic> https://hastebin.com/cabuqewava.cs
03:05:33Prestigeleorize: 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:44leorizedoes it work? :P
03:05:50leorizeI haven't tried
03:06:06FromDiscord<Rika> precisely as codic wrote actually
03:06:12PrestigeGotta try, 1 min
03:06:19FromDiscord<Rika> i still dont understand what you mean by passed as an argument
03:06:27FromDiscord<Rika> you cant export variables in procs i dont think
03:06:36FromDiscord<codic> i think he means having an argument to a proc exported
03:06:39FromDiscord<Technisha Circuit> Thanks
03:06:52FromDiscord<Rika> you can export a proc but not its indiv. arguments
03:06:52FromDiscord<codic> ok what
03:06:56FromDiscord<Technisha Circuit> Aw
03:07:11FromDiscord<Rika> you can make another proc w/ the arguments you want to export
03:07:14FromDiscord<Technisha Circuit> Also, how would i import nim files dynamically?
03:07:17FromDiscord<Rika> then that proc calls the all-argument proc
03:07:19FromDiscord<Technisha Circuit> Oh?
03:07:42Prestigeleorize: giving me some errors about undecleared routines
03:07:42FromDiscord<Rika> you cannot import nim files dynamically, you can import dynamic libraries dynamically i guess
03:07:54zacharycarteryou can actually
03:07:58leorizePrestige: oh, can I see the errors?
03:07:58FromDiscord<Rika> https://nim-lang.org/docs/dynlib.html @Technisha Circuit
03:08:15zacharycartersee this library for an example
03:08:19zacharycarteror this project rather
03:08:28FromDiscord<Technisha Circuit> Thanks
03:08:41Prestigehttps://0x0.st/i_0R.txt
03:09:16Prestige'template/generic instantiation of `with` from here'
03:09:20zacharycarterhttps://github.com/sheosi/tart/blob/master/tart/main.nim#L14
03:09:23leorizetry putting a `_` in the `len()`
03:09:28leorizelen(_)
03:09:38FromDiscord<Rika> @KingDarBoja so what do you think about my suru library?
03:09:50FromDiscord<Technisha Circuit> Also, how would i include the python runtime in Nim??
03:09:54FromDiscord<Technisha Circuit> ?*
03:09:55zacharycarterit's not importing at runtime but it is importing based on the contents of a directory
03:09:58Prestigeexpression cannot be called leorize
03:09:59zacharycarterso I guess it's somewhat dynamic
03:10:14FromDiscord<Technisha Circuit> Fhankz Zacharycarter!
03:10:25FromDiscord<codic> > Fhankz
03:10:27zacharycarterthese are some random ass questions
03:10:36FromDiscord<Rika> yeah lmao
03:10:47zacharycarterthere are some projects that bridge Nim and Python - just search on github for them
03:10:47leorizePrestige: I guess it's not that versatile, so here's the template version: https://play.nim-lang.org/#ix=2lJP
03:10:53FromDiscord<KingDarBoja> Rika: which one?
03:10:57zacharycarterI don't know about including the python runtime in Nim
03:11:09zacharycarterI don't like Python so I'd never do that
03:11:24Prestigeleorize: oh wow that's even cleaner. How cool, thanks :)
03:11:40leorizePrestige: for the pascal-style `with` we have this: https://github.com/Zevv/with
03:11:43FromDiscord<Technisha Circuit> Thanks*
03:11:46leorizewhich is basically what I did but automated :P
03:11:56FromDiscord<Technisha Circuit> :p
03:12:04FromDiscord<Rika> @KingDarBoja T_T https://github.com/de-odex/suru/
03:12:40FromDiscord<KingDarBoja> It is pretty good if you ask me
03:12:49FromDiscord<KingDarBoja> I already starred it
03:12:57skrylar[m]neat.
03:13:05FromDiscord<KingDarBoja> Seems smoother than tdqm in Python
03:13:08FromDiscord<codic> i see manjaro. i star.
03:13:15FromDiscord<codic> jk
03:13:16FromDiscord<KingDarBoja> Ofc the use case is still minimal afaik
03:13:26FromDiscord<Rika> T_T
03:13:37FromDiscord<Rika> tqdm is too good
03:13:49FromDiscord<KingDarBoja> Because it is older
03:14:06Prestigeleorize: hm either I broke something or using that template is creating a copy of the seq - going to look into it
03:14:07FromDiscord<KingDarBoja> But if you keeping addding features like multiprocessing
03:14:12FromDiscord<KingDarBoja> Ofc you will beat it hahah
03:14:39FromDiscord<Rika> > multiprocessing
03:14:45FromDiscord<Rika> oh lord, so bars in bars
03:14:49FromDiscord<KingDarBoja> Yup
03:14:50FromDiscord<Rika> or bars over bars
03:14:52FromDiscord<Rika> oh god
03:14:58FromDiscord<Rika> thats gonna be wild and insane
03:15:00FromDiscord<KingDarBoja> Pretty much
03:15:14FromDiscord<KingDarBoja> But even tdqm has flaws on it
03:15:54FromDiscord<codic> all we need is an inquirer.js port
03:16:32FromDiscord<KingDarBoja> https://github.com/tqdm/tqdm/issues/879
03:16:32FromDiscord<Rika> i dont know how i'd support parallel bars...
03:16:43Prestigeleorize: okay it's working. Thanks, this is exactly what I was looking for
03:17:21FromDiscord<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:00FromDiscord<KingDarBoja> Now I need to make the visitor, fuuuuu
03:18:06FromDiscord<KingDarBoja> This is gonna take a while
03:22:11skrylar[m]well tqdm (and others, rust has a few pretty ones) are open if you want spoilers
03:22:26skrylar[m]otherwise probably a multiprogress object that deals with the curses trickery in the background
03:23:42FromDiscord<KingDarBoja> OH DEAR LORD
03:23:46*dadada__ joined #nim
03:24:41FromDiscord<KingDarBoja> This JS code looks like a mess haha
03:24:58skrylar[m]inquiry?
03:25:31FromDiscord<KingDarBoja> No, Graphql-js
03:25:38FromDiscord<KingDarBoja> Some visitor function x.x
03:25:38skrylar[m]oh.
03:25:52*skrylar[m] has just been face deep in cleaning up GL machinery
03:26:17FromDiscord<KingDarBoja> Only two modules left to complete the language directory port 😄
03:27:04FromDiscord<KingDarBoja> I think this is the hardest directory of the port hahaha
03:29:14FromDiscord<KingDarBoja> Ok gonna take a look at Golang impl
03:30:16FromDiscord<KingDarBoja> Ugh, Golang impl is way longer than Python which is longer than JS one lol
03:34:48FromDiscord<Rika> skrylar: do you think its possible without making a multiprogress object
03:37:35zacharycarterback 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:47skrylar[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:58skrylar[m]i guess you could shunt that to global state but it doesn't exactly save anything
03:58:13skrylar[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:16FromDiscord<Rika> i know that
03:59:33FromDiscord<Rika> i'm thinking of just "overwriting" the stdout then restoring it after
04:02:24FromDiscord<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:07FromGitter<gogolxdong> Is there any Groth16 implementation?
04:23:53*dadada__ joined #nim
04:39:20*zacharycarter quit (Ping timeout: 256 seconds)
04:47:21skrylar[m]snark provers?
04:47:31*dadada__ quit (Ping timeout: 246 seconds)
04:52:40FromDiscord<KingDarBoja> How can I declare this in Nim
04:52:48FromDiscord<KingDarBoja> `type VisitFunc func(p VisitFuncParams) (string, interface{})` taken from Golang file
04:52:59FromDiscord<KingDarBoja> VisitFuncParams is a struct
04:53:16FromDiscord<KingDarBoja> `type VisitFuncParams struct {... etc ...}`
04:53:47*dadada joined #nim
04:53:48FromDiscord<Rika> i have no idea how golang function syntax is structured
04:54:11*dadada is now known as Guest10624
04:54:54FromDiscord<KingDarBoja> Neither I mate
04:54:59FromDiscord<KingDarBoja> But JS is worse in this one
04:55:27FromDiscord<KingDarBoja> `export function getVisitFn(visitor: Visitor<any>, kind: string,isLeaving: boolean): Maybe<VisitFn<any>>;`
04:55:43FromDiscord<Rika> at least its prolly more understandable
04:55:49FromDiscord<KingDarBoja> And you haven't seen what does Visitor means, this is a mess
04:56:21FromDiscord<KingDarBoja> https://github.com/graphql/graphql-js/blob/master/src/language/visitor.d.ts 😵
04:56:40FromDiscord<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:04FromDiscord<KingDarBoja> Well, how I can use a proc as type without being defined at the object value?
05:03:18FromGitter<gogolxdong> yes
05:05:17FromDiscord<KingDarBoja> Rika: maybe like this https://play.nim-lang.org/#ix=2lJZ
05:09:20leorizeKingDarBoja: https://nim-lang.org/docs/manual.html#types-procedural-type
05:12:56FromDiscord<KingDarBoja> Ohhh
05:14:00FromDiscord<KingDarBoja> So I can define it like `type myFunName = proc(a: params)`
05:14:23FromDiscord<KingDarBoja> What about the return type?
05:15:22FromGitter<bung87> append `:ReturnType`
05:15:27FromDiscord<KingDarBoja> Oh, I see, doesn't matter, it is still a proc
05:15:33FromDiscord<KingDarBoja> intriging
05:17:03FromDiscord<KingDarBoja> Good night boys!
05:17:32Prestigegn o/
05:17:52*Guest10624 quit (Ping timeout: 256 seconds)
05:19:59Prestigeleorize: Looking for a way to get sys env variables (specifically XDG_CONFIG_HOME) what module would that be in?
05:20:43FromGitter<bung87> https://nim-lang.org/docs/os.html#getEnv,string,string
05:20:54Prestigety @bung87
05:21:20FromGitter<bung87> that's just a question that need you type `env` to search input box
05:21:43Prestigewas looking around for it in the index but couldn't find it
05:22:04FromGitter<bung87> ok that's fine
05:22:18PrestigeI may download the docs so I can ripgrep through proc names
05:23:02FromDiscord<Rika> isnt it already packaged when you download nim
05:23:07FromDiscord<Rika> should be there
05:23:26PrestigeHm that would be useful, I'll poke around and try to find it
05:23:43*dadada__ joined #nim
05:24:06Prestigeaha it is, thanks for the tip
05:33:38*silvernode quit (Ping timeout: 260 seconds)
05:40:57FromGitter<bung87> does nim has static method?
05:44:11FromDiscord<Never Listen To Beef> what?
05:44:43FromGitter<bung87> `TypeA.staticMethod()`
05:45:03FromDiscord<Never Listen To Beef> you're describing a proc afaik
05:45:39FromGitter<bung87> I know that
05:47:26FromGitter<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:13FromGitter<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:30FromDiscord<Never Listen To Beef> Yea idk
06:02:40*ryan_ joined #nim
06:04:52*longer quit (Ping timeout: 246 seconds)
06:09:58FromGitter<kaushalmodi> Prestige: also see https://nim-lang.github.io/Nim/os#getConfigDir
06:10:25FromGitter<kaushalmodi> You might not need to do the getEnv at all as that proc does it for you
06:16:00FromDiscord<Rika> there are no static methods in nim, but you can emulate them lol
06:16:39FromDiscord<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:19PrestigeNeat, thanks @kaushalmodi
06:36:56FromGitter<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:18Araqhttps://www.fastcompany.com/90501691/science-confirms-it-web-sites-really-do-all-look-the-same offtopic, but interesting
06:53:12FromDiscord<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:49Araq:-)
07:30:39*gangstacat joined #nim
07:30:45*kitech1- quit (Max SendQ exceeded)
07:31:15*kitech1 joined #nim
07:33:53FromDiscord<Yardanico> Good morning everyone
07:34:13FromDiscord<Rika> good morning yardanico
07:36:26FromDiscord<Never Listen To Beef> Helloo
07:42:46FromGitter<bung87> years during bootstrap getting popular, all website has a black top navbar..
07:45:27gokrAraq: Hey, all good? Long time no see ;)
07:45:34*letto quit (Quit: Konversation terminated!)
07:45:45gokrAraq: Congrats on the ARC stuff btw, seems awesome.
07:46:52Araqgokr, 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:59Yardanicoseems interesting - https://github.com/robertdavidgraham/wc2 (wc2 - optimizing wc with asynchronous state machine parsing)
07:55:01FromDiscord<Rika> how much memory is allocated by default given the code `var s: seq[int64]`?
07:55:01FromDiscord<KrispPurg> @Anuke use websocket 0.4.0, it's a bug in the new websocket
07:55:08*ryan_ joined #nim
07:55:12Yardanico@Rika you can easily test ;)
07:55:30FromDiscord<KrispPurg> Also, btw it was 1:35 am for me, so I was asleep
07:55:34AraqRika: 1 or 2 machine words
07:56:51FromDiscord<Rika> oh, okay thanks
07:57:06FromDiscord<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:16FromDiscord<KrispPurg> branch*
07:57:19Yardanicoafaik it didn't compile yesterday for me, I'll try again today
07:57:22Yardanicodid you do any new commits?
07:57:32FromDiscord<KrispPurg> Yes
07:57:54FromDiscord<Rika> Yardanico: i dont know how to test ._.
07:58:02FromDiscord<KrispPurg> I pushed channges last night
07:58:44Yardanico/home/dian/.choosenim/toolchains/nim-1.2.0/lib/pure/json.nim(352, 41) Error: type mismatch: got <set[PermEnum]>
07:58:46Yardanico/home/dian/.nimble/pkgs/dimscord-#devel/dimscord/restapi.nim(357, 38) template/generic instantiation of `%` from here
07:58:58Yardanicohmm maybe it doesn't work on 1.2, will try on nim devel
07:59:10FromDiscord<KrispPurg> bruh wat
07:59:22Yardanicoyou're trying to do % for a set
07:59:40FromDiscord<KrispPurg> oh wait I moved that to restapi
07:59:43FromDiscord<KrispPurg> Fuck
07:59:47Yardanicolol
08:00:06FromDiscord<KrispPurg> I haven't commited the restapi one
08:01:10FromDiscord<KrispPurg> Just try getting the old `%`
08:01:46Yardanicoalso I see you have requestGuildMembers, I'll probably try it
08:02:02FromDiscord<KrispPurg> gl
08:02:51FromDiscord<KrispPurg> It hasn't finished caching other uncached member besides requestGuildMembers.
08:40:32FromDiscord<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:18FromGitter<PMunch> Hmm, my internet is super flaky today..
09:06:36FromGitter<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:31FromDiscord<Recruit_main707> could we remove the <FromGitter> thing?
09:08:32FromGitter<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:43FromDiscord<kodkuce> does any nim terminal lib support mouse?
09:09:11FromGitter<PMunch> kodkuce IIRC terminal mouse events are just sent as a special kind of keypress?
09:09:30FromGitter<PMunch> But you might need to tell the terminal that you want them somehow
09:11:42FromGitter<PMunch> Hmm, I wish Nim had a more obvious exception structure..
09:12:05FromGitter<PMunch> Like I want to perform a call to get something from a server but then raise an exception if it fails
09:12:15FromGitter<PMunch> What would that be?
09:12:55FromDiscord<kodkuce> cant you manualy trow execption if it fails?
09:13:12FromGitter<PMunch> Yes, that's what I'm doing
09:13:23FromGitter<PMunch> But what kind of exception should it be?
09:13:36*Cthalupa quit (Ping timeout: 272 seconds)
09:13:49FromDiscord<kodkuce> exeption UnableToFetch 🙂
09:15:40FromDiscord<Yardanico> @Recruit_main707 my bridge handles it
09:15:55FromDiscord<Yardanico> FromGitter itself is a bridge in Crystal though
09:16:26FromDiscord<Yardanico> And it doesn't run on our infrastructure ;)
09:16:54*Cthalupa joined #nim
09:17:15FromGitter<PMunch> Haha, yeah if it had something like that it would be great
09:17:34*Guest98310 quit (Ping timeout: 256 seconds)
09:17:55FromDiscord<Yardanico> IOError ?
09:18:44FromDiscord<Yardanico> HttpRequestError in httpclient inherits from IOError as well
09:18:58FromGitter<PMunch> Hmm, I guess that might be good
09:19:08FromGitter<PMunch> It might not be IO though..
09:19:18FromGitter<PMunch> Could be that the key just doesn't exist on the server
09:20:58FromDiscord<Yardanico> Do a different exception for this one :D
09:21:29FromGitter<PMunch> That's too much work
09:22:03FromGitter<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:33FromGitter<PMunch> Hmm, when using `{.raises: [].}` is there a way to tell Nim that a section is safe even when it's not?
09:23:21FromDiscord<Rika> If key does not exist use key error lol
09:23:38FromDiscord<Rika> No clue on the raises one
09:23:48*dadada__ joined #nim
09:23:58FromGitter<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:25FromGitter<PMunch> @Rika, yeah I'm currently using KeyError
09:24:50FromGitter<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:59AraqPMunch: we have {.gcsafe.}: blocks and also {.noSideEffect.} blocks
09:42:12Araqwe should have .raises: [] blocks too, yay
09:46:41Yardanicobtw when gcsafe will be disabled for gc:arc? :P
09:46:47Yardanicoor at least be a warning
09:47:30*dadada__ quit (Ping timeout: 260 seconds)
09:50:58*liblq-dev joined #nim
09:53:22FromGitter<PMunch> Araq, I mean we do have try: <code> except: discard
09:53:32FromGitter<PMunch> So it's not like it's impossible
09:53:45*dadada joined #nim
09:54:01FromGitter<PMunch> Any input on my question about finilizers by the way?
09:54:08*dadada is now known as Guest18131
09:54:32FromGitter<PMunch> finalizers*
09:55:09Araqlol good point
09:55:26Araqrepeat the question about finalizers but they are broken with arc
09:55:31Araqfixing them...
10:01:27FromGitter<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:49Araqseems ok
10:06:37Yardanicobtw 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:39FromGitter<PMunch> Nice
10:06:47YardanicoI'll run all of them with arc now
10:07:06*Trustable quit (Remote host closed the connection)
10:11:04FromGitter<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:34Yardanicoah seems like i was too optimistic
10:16:21Yardanicoif I globally specify gc: arc it'll fail because stdlib will also try to use that and will fail or something
10:16:38Yardanicoif I have "gc = arc" in config/nim.cfg and do echo "Hello world" it fails
10:16:48Yardanico/home/dian/.nim/lib/system/fatal.nim(49, 5) Error: system module needs: nimDestroyAndDispose
10:17:58Yardanicoand what's interesting is that boehm/markandsweep/none work when specified in global nim config, but not destructors/arc/orc
10:19:08liblq-devdo new() finalizers still work on ARC, and are they deterministic now?
10:19:29Yardanicothey work for simple cases but afaik they're broken so 4raq will redo then :P
10:19:31Yardanicothem*
10:23:15Yardanicooh wait nvm I just put gc = arc in ~/.config/nim/nim.cfg and it seems to work yay
10:24:01Yardanicoah no nvm :D
10:30:26Araqliblq-dev, they mostly work and yes they are deterministic
10:31:33Yardanicoso 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:44Yardanicobecause it gets applied to .nims files as well?
10:32:06AraqPMunch: the effect tracking error messages got much better in 1.2
10:32:32FromGitter<PMunch> This was compiled on devel..
10:38:38FromGitter<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:05FromGitter<PMunch> Where?
10:40:09Yardanicoin this chat
10:40:22Yardanicoleorize and narimiran were talking about improving the UX of the website
10:40:39narimirani've sent a PR
10:40:57narimiranhttps://github.com/nim-lang/website/pull/198
10:41:02narimiranit is like this for now
10:41:14narimiranmore changes and improvements to come in future PRs
10:41:23narimiran(e.g. releases page)
10:43:20FromGitter<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:23FromGitter<PMunch> )
10:44:59FromGitter<PMunch> Pushed a new patch version of nimlsp for those interested
10:45:35FromGitter<PMunch> It fixes a bug where errors from other files would be shown at that line in the current file
10:46:49Yardaniconim extension in vscode was working a bit badly for me lately
10:47:02Yardanicomore crashes (dev tools shows SIGUSR1)
10:47:16FromGitter<PMunch> Huh, the one based directly on nimsuggest?
10:47:19Yardanicoyep
10:47:27Yardanicomaybe it's an issue with my vscode though, idk
10:47:44FromGitter<PMunch> Hmm, I really should get syntax highlighting up and running with nimlsp
10:48:01FromGitter<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:19Yardanicohttps://forum.nim-lang.org/t/6318#38949 lol
11:07:22Yardanicoif(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:01Araqyeah, I have to admit, it wasn't clear to me this works
11:11:00Yardanicooh so it works everywhere, even like echo (call)5 > 0
11:13:29*PMunch joined #nim
11:16:13Araqsure, Nim is usually more consistent than people realize
11:17:57Guest67631does a ptr to a ref object work in NimScript?
11:18:16Yardanicoyou can easily test by using a "static" block :P
11:18:28*Guest67631 is now known as dadada
11:19:12Yardanicospoiler: seems like it does
11:19:36Yardanicohttps://play.nim-lang.org/#ix=2lLw
11:19:38dadadaso a ref to a ref object doesn't, but a ptr does, interesting
11:20:01dadadaat least I think I read somewhere a ref to ref object doesn't work
11:20:45Yardanicohttps://nim-lang.org/docs/nims.html
11:20:48Yardanicohere
11:20:50liblq-devYardanico: this is caused due to the command syntax in expressions, it expects one expr for the proc and one for the argument
11:21:14liblq-devthat's why you can also do C-like casts: (int)x + 2
11:21:21FromGitter<alehander92> PMunch Araq
11:21:24liblq-devbut it's parsed as int(x + 2) and not int(x) + 2
11:21:34FromGitter<alehander92> `{.raises: [].}` is different
11:21:53dadada"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:15Yardanicodadada: More than one level of ref is generally not supported (for example, the type ref ref int).
11:22:23FromGitter<joe733> @FromIRC Nim is usually more consistent than people realize
11:22:26dadadaokay, so this reads like the Neomple want ptrs to work with NimScript, but they can't fix all the bugs
11:22:33FromGitter<alehander92> because it would be similar to a cast, but a runtime exception would still happen if your assumption was wrong
11:22:47PMunchliblq-dev, wait what?!
11:22:53YardanicoXDD
11:23:00liblq-devPMunch: try it
11:23:14FromGitter<joe733> @FromIRC ⏎ ⏎ > Nim is usually more consistent than people realize... ⏎ ⏎ Can Nim unseat Python? [https://gitter.im/nim-lang/Nim?at=5eba872110d5ec031a00c772]
11:23:20PMunchliblq-dev, I'm too scared
11:23:24FromGitter<alehander92> `try: except: discard` would just silently ignore all (but i guess `except: assert/echo` is the best anyway)
11:23:30Yardanico@joe733 don't ping FromIRC, it's a bot
11:23:36FromGitter<alehander92> so yeah probably youre' right
11:23:39liblq-devPMunch: I'll do it for you
11:23:41Yardanicowrite the nickname from <> instead
11:23:43liblq-dev!echo (int)x + 2
11:23:47YardanicoPMunch: https://play.nim-lang.org/#ix=2lLx
11:23:50liblq-devah
11:23:54liblq-dev!eval echo (int)x + 2
11:23:56NimBotCompile failed: /usercode/in.nim(1, 11) Error: undeclared identifier: 'x'
11:24:08PMunch:P
11:24:12liblq-dev!eval let x = 2; echo (int)x + 2
11:24:13FromGitter<joe733> @Yardanico Okay.
11:24:15NimBot4
11:24:19liblq-devthere.
11:24:26Yardanicoliblq-dev: you didn't prove anything here though
11:24:32Yardanico!eval let x = 2; echo int(x) + 2
11:24:34PMunch!eval let x = 2.0; echo (int)x + 2
11:24:35NimBot4
11:24:37NimBot4
11:24:37PMunchSo that should fail
11:24:39PMunchHuh
11:24:49PMunchShouldn't that fail?
11:24:51Yardanicono
11:24:53liblq-devit won't fail because the int lit is automatically converted to a float lit
11:24:54Yardanicoint(x + 2)
11:24:57PMunchIf it is parsed is int(x+2)
11:25:01PMunchOh right
11:25:28PMunch!eval let x = 2.0; let y = 1; echo (int)x + y
11:25:30NimBotCompile failed: /usercode/in.nim(1, 37) Error: type mismatch: got <float64, int>
11:25:35PMunchYeah
11:25:39PMunch!eval let x = 2.0; let y = 1.0; echo (int)x + y
11:25:42NimBot3
11:25:47PMunch!eval let x = 2.0; let y = 1.0; echo x + y
11:25:50NimBot3.0
11:25:53PMunchHuh
11:26:02liblq-devhere's proof: https://play.nim-lang.org/#ix=2lLA
11:26:07Yardanicoliblq-dev: I sent mine above
11:26:11PMunchWhy is this a feature?
11:26:11liblq-devby looking directly at the AST
11:26:15liblq-devit'
11:26:21liblq-devit's a side effect of the command syntax
11:26:24FromDiscord<clyybber> PMunch: Unintentional probably
11:26:26FromDiscord<clyybber> But its great
11:26:31Yardanicobtw 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:37Yardanicothere's literally no reason to
11:26:46FromDiscord<clyybber> theres also no reason not to
11:26:55Yardanicoexcept to confuse people who read thec ode
11:26:56PMunchYardanico, oh yeah, that's just confusing :P
11:27:09PMunchWell
11:27:16PMunchI guess you kinda can read what it does
11:27:23liblq-devmaybe he thought if(unlikely) is a special if statement flag? but I doubt it
11:27:32PMunchif(which is unlikely) x should be equal to y, then do this
11:27:43Yardanicohe used it in another place like this too https://github.com/olliNiinivaara/Nichecache/blob/915317b2349673b1ccf502d39cd3ac3ea4875eb3/src/nichecache.nim#L125
11:27:54PMunchWhat code did he read that did this though?
11:28:00Yardanicothat's what I wonder about
11:28:04liblq-devwho knows
11:28:04YardanicoI've never seen that before in my life
11:28:06PMunchI've been using Nim for years and I've never seen this! :P
11:28:16Yardanicohe used the same in SQLiteral as well
11:28:16liblq-devwell I understood it the second I saw it but
11:28:19Araqsame, he figured out a new idiom, get over it :-)
11:28:20liblq-devwhere'd he get the idea
11:28:36Yardanicohttps://github.com/olliNiinivaara/StashTable/blob/0cb1dc7d578d8b66c5656595cc220963405c03e8/src/stashtable.nim#L233
11:28:39PMunchI kinda like it tbh
11:29:09PMunchWhat's the rule though, like how far does it read before adding the )
11:29:16PMunchThe first , or newline?
11:29:20Yardanicothe whole expression I guess?
11:29:23liblq-devit reads a whole expression I thing
11:29:25liblq-devs/thing/think
11:29:54Yardanicoat least (a)5 + 3,4 doesn't work :P
11:29:59Yardanicoif a accepts two arguments
11:30:16PMunchThis works though: https://play.nim-lang.org/#ix=2lLC
11:30:22Yardanicooof
11:30:27liblq-devno, because the command syntax in expressions can only take one arg
11:30:34liblq-devotherwise there'd be an ambiguity
11:30:43Yardanicoliblq-dev: see PMunch's code
11:31:06liblq-devit's parsed as echo(test(100), 200)
11:31:18Yardanicoah you're right
11:31:43PMunchYeah, just realised :P
11:32:05liblq-devsee:
11:32:06planetis[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:07liblq-devhttps://play.nim-lang.org/#ix=2lLF
11:32:07Yardanicoand then someone says "omg nim is unusuable!11"
11:32:13PMunchIt's weird though: https://play.nim-lang.org/#ix=2lLG
11:32:25YardanicoPMunch: wdym weird?
11:32:29liblq-devYardanico: we need to keep this secret
11:32:29Yardanicoit works as expected here
11:32:56Yardanicoliblq-dev: yes
11:32:57Yardanicoremove the logs
11:33:06YardanicoI'll delete messages from discord
11:33:07FromGitter<capocasa> Has anyone written an ISO week-of-year (weeknum) calculator I could reuse?
11:33:17liblq-devthe command syntax works like regular calls, so you can chain it eg. (makeSomeClosure 123) 123, 456
11:33:32PMunchYardanico, weird as in that case it parses correctly with (test) 100, 200
11:33:41PMunchBut let x = (test) 100, 200 doesnt'
11:33:48Yardanico@capocasa you didn't find what you need in times module?
11:34:02PMunchliblq-dev, oh god..
11:34:03liblq-devPMunch: it doesn
11:34:08liblq-devit doesn't work because
11:34:16liblq-devit's parsed as test(100), 200
11:34:26Yardanico@capocasa what about https://nim-lang.org/docs/times.html#getDayOfWeek%2CMonthdayRange%2CMonth%2Cint
11:34:33PMunchNot in this case: https://play.nim-lang.org/#ix=2lLH
11:34:36liblq-devPMunch: see this https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
11:34:51Yardanicoah sorry nvm
11:34:58FromGitter<capocasa> @Yardanico Thanks for the pointer! times has day-of-year and day-of-week, but not week-of-year
11:35:02planetis[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:27Yardanicowhat about closures?
11:35:52liblq-devwell I'm off to do my English assignment for now, bbl
11:36:15Araqplanetis[m], it's only used for hint messages
11:36:16planetis[m]what about them?
11:36:52Araqread the code more carefully, in reality injectdesturctors doesn't care about closures, they have been lowered to tuples
11:37:41planetis[m]thats intersting
11:38:07PMunchAraq, 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:10FromGitter<alehander92> which reminds me Araq
11:38:19FromGitter<alehander92> what is the proper fix for https://github.com/nim-lang/Nim/issues/14279
11:38:33FromGitter<alehander92> lowering manually the await call arguments inside asyncmacro to tmp variables
11:39:30FromGitter<alehander92> sorry, de-nesting maybe? not sure how to call it
11:39:36planetis[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:54FromGitter<alehander92> or somehow fixing injectdestructors themselv
11:40:04FromGitter<alehander92> i did have a local patch which seemed to fix that bug
11:40:09FromGitter<alehander92> but no idea if it did so correctly
11:40:46Araqplanetis[m], PRs are welcome
11:40:49FromGitter<alehander92> i just ignored the bad case iirc i wasnt sure what i was doing just got it to run
11:40:51planetis[m]ok
11:40:55FromGitter<alehander92> so probably wrong
11:41:23AraqPMunch, it's PR week, I'm working on your PR now
11:41:36Araqalehander92: well create a PR and let me review it
11:44:04alexander92but my question is: in principle is `transformClosureIterator` supposed to be able to deal with nested yields
11:45:34PMunchAraq, sweet :)
11:55:50*Jesin quit (Ping timeout: 260 seconds)
11:56:36FromDiscord<clyybber> Araq: Hey, the ping-pong approach without any joins works and yields a 10% compilation time increase in most arc tests
11:57:03FromDiscord<clyybber> *5-10%
11:57:17Yardanicojust use PGO :P
11:57:21FromDiscord<clyybber> eh, compilation time decrease I mean
11:57:23FromDiscord<clyybber> :D
11:57:26Yardanicoah, decrease?
11:57:27Yardanicolol
12:00:53Araqclyybber: ok... now give us CPS please
12:01:19*a_b_m joined #nim
12:01:36Araqalexander92, cannot answer the question, you know more about this patch than I do, I merely merged it
12:02:53FromDiscord<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:31PMunchHmm, trying to update an example on embedding NimScript in Nim but I'm doing something wrong: http://ix.io/2lLU/nim
12:14:48PMunchscript.nims is just some echo statements and a loop
12:15:03Araqcompare to our tcompilerapi test
12:15:11PMunchOooh
12:16:25PMunchI knew I had seen an easier way of doing this!
12:17:26FromDiscord<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:08Araqa graph without joins sounds dangerous to me
12:19:42Araqcan we get some proof of correctness?
12:20:52FromDiscord<clyybber> Yeah
12:23:50*dadada joined #nim
12:24:14*dadada is now known as Guest45634
12:31:40AraqPMunch, all you need to do is to is to move
12:31:41Araqif symkind == skLet: localError(c.config, a.info, errLetNeedsInit)
12:31:59Araqthe check to after pragma processing so that sfImportc is available
12:32:25PMunchYeah, that's what I was thinking
12:32:39PMunchNow just to figure out where on earth that is :P
12:37:01PMunchOh, it's just further into that procedure isn't it?
12:37:41Araqyeah
12:37:50Araqin fact
12:37:58Araqkoch temp c test.nim
12:38:07Araqtells you the origin of the error via the stack trace
12:38:28PMunchWhat error?
12:40:06AraqError: 'let' symbol requires an initialization
12:40:57PMunchWell yeah, that's from line 535 of semstmts
12:41:22PMunchBut at that point it doesn't have sfImportc yet
12:44:58Araqexactly, so you need to move this test around
12:45:16*muffindrake quit (Quit: muffindrake)
12:47:04*sentreen left #nim (#nim)
12:48:58Araqwanna see my patch?
12:49:02*leorize quit (Remote host closed the connection)
12:49:11PMunchGladly
12:52:06AraqPMunch, https://github.com/nim-lang/Nim/pull/14321/files
12:52:40Araqworked 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:09PMunchAh, I was on the right track :)
12:53:34FromDiscord<Prodigle> Error: undeclared identifier: 'Thread' ? I'm compiling with --threads:on
12:54:29*zacharycarter joined #nim
12:54:36Yardanicoshow code (paste somewhere)
12:54:41Yardanicoand how are you compiling exactly?
12:54:49AraqProdigle: see if your Nim installation is broken
12:54:51FromDiscord<Prodigle> It's this line, inside a Let block
12:54:52FromDiscord<Prodigle> threads: seq[Thread[number:int64, i:int,results seq[seq[long]]]]
12:54:59*rockcavera joined #nim
12:55:45FromDiscord<Prodigle> nim c --run ./main3.nim --threads:on
12:55:57Yardanicothat's not correct :)
12:56:02Yardaniconim c --threads:on --run ./main.nim
12:56:11Yardanicoor even simpler nim c --threads:on -r main.nim
12:56:26FromDiscord<Prodigle> Thanks ^^
12:56:43Yardanicoafter --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:51FromDiscord<Prodigle> Gotcha
12:57:25FromDiscord<Prodigle> Quite confused about the type inside A thread also
12:57:34FromDiscord<Prodigle> e.g when declaring threads: seq[Thread[number:int64, i:int,results seq[seq[long]]]]
12:57:45FromDiscord<Prodigle> The example gives thr: array[0..4, Thread[tuple[a,b: int]]]
12:57:55*Vladar quit (Quit: Leaving)
12:58:03PMunchThat doesn't look correct..
12:58:08PMunchYour code that is
12:58:10Yardanicovar threads: seq[Thread[number:int64, i:int, results: seq[seq[int]]]]
12:58:16Yardanicothere's no "long" in nim
12:58:17PMunchThread only has one argument no?
12:58:21Yardanicoah that too
12:58:24FromDiscord<Prodigle> Yeah, unsure what I'm actually supposed to put here
12:58:33Yardanicovar threads: seq[Thread[tuple[number:int64, i:int, results: seq[seq[int]]]]]
12:58:44PMunchWhat the Thread can be passed as an argument
12:59:02PMunchWhich can only be a single argument (so if you need multiple you need to pass a tuple)
12:59:47Yardanico@Prodigle for easier understanding - https://play.nim-lang.org/#ix=2lMA
13:00:13Yardanico"int" is arch-specific though, you can specify "int64" if you always want int64
13:00:34PMunchAs 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:09FromDiscord<Prodigle> That clears it up a lot 🙂 thanks
13:01:38AraqPMunch, please finish the PR on your own
13:01:53PMunchAnd threads can't return anything (not sure if that is what you're trying to do with `results`)
13:01:53Araqcan't take it over, my own stuff is still broken (sigh)
13:02:05PMunchOh yeah, I'm working on it
13:02:42Yardanico@Prodigle and I would also recommend trying https://github.com/mratsim/weave if you want to do some number crunching
13:03:00YardanicoI mean for multithreading
13:03:51Yardanicobtw I really like how mratsim did the _: typedesc[Weave] stuff :P
13:04:32*muffindrake joined #nim
13:05:10PMunchYardanico, example?
13:05:21*waleee-cl joined #nim
13:06:44YardanicoPMunch: https://github.com/mratsim/weave/blob/master/weave/runtime.nim#L30
13:06:54Yardanicoso you call init(Weave)
13:07:24Yardanicohere it's type Weave, but in some other places it's typedesc afaik
13:07:49Yardanicoah nvm I just got confused, it's all "type Weave", typedesc is for actual types
13:08:33PMunchAh, yeah there was quite a lot of discussion about things like that a while back
13:08:39Yardanicoand what's the conclusion?
13:09:10*NimBot joined #nim
13:09:25Yardanicobtw I wonder why nimbot uses like 500mb ram
13:09:49Yardanicowell it starts with 20mb but grows to 500-600mb ram
13:10:00Araqbecause it caches all messages
13:10:03*krux02 joined #nim
13:10:09Yardanicowait what
13:10:14Araqor maybe because of other bugs :P
13:10:19FromDiscord<clyybber> Araq: https://github.com/nim-lang/Nim/pull/14322 :)
13:11:37Araqhey
13:11:52Araq"unstructured controlflow" doesn't have to be in quotes, it's the correct term
13:12:17Araqinvented by the people who actually understood computing
13:12:56FromDiscord<clyybber> :D
13:14:55Yardanico@clyybber sorry for nitpick but " into to" -> "into two" or I understood incorrectly
13:15:06Araqcan the same be used for 'was variable init'ed' checking?
13:15:09PMunchYardanico, if you want to read parts of that discussion: https://github.com/nim-lang/RFCs/issues/84
13:15:23Araq("definite assignment" checking)
13:15:39FromDiscord<clyybber> Yeah, I actually also changed "initalized"
13:15:58FromDiscord<clyybber> But its not currently used
13:16:12YardanicoPMunch: lol I apparently replied in this issue as well
13:16:15Yardanicodon't remember now :P
13:16:30FromDiscord<clyybber> Yardanico: Oh, yeah :)
13:17:04PMunchYardanico, there was also some discussion here: https://github.com/nim-lang/Nim/pull/7481
13:17:11Yardanicothanks
13:17:16PMunchHaha, not unusual :P
13:17:54*Romanson joined #nim
13:19:15Yardanicohttps://www.reddit.com/r/nim/comments/giaeev/what_are_the_biggest_weaknesses_of_nim_in_your/
13:19:25PMunchHmm, Araq should it also look for sfImportCpp/JS/ObjC
13:19:26*silvernode joined #nim
13:19:27Yardanico"What are the biggest weaknesses of Nim in your opinion?" question posted 42 minutes ago
13:19:55FromDiscord<Prodigle> Anyone have any insight on`Error: Invalid node kind nnkBracketExpr for macros.`$`
13:20:04Araqclyybber: turn every label into a local proc, bam, CPS representation. then you "only" need to do LL on every local proc
13:20:18Yardanico@Prodigle if you want to print a NimNode, use repr or treeRepr
13:20:20Yardanicoor lispRepr
13:20:30FromDiscord<Prodigle> It's for this line
13:20:30FromDiscord<Prodigle> proc calculatePrimes(number: var int64): seq[int64]=
13:20:33Yardanicoor astGenRepr
13:20:40Yardanico@Prodigle show more code please :0
13:20:47leorizeusually treeRepr is the best
13:20:55FromDiscord<Prodigle> I'll pastebin hold on
13:21:11leorizeplay.nim-lang.org please :)
13:22:03FromDiscord<Prodigle> https://play.nim-lang.org/#ix=2lMQ
13:22:56FromDiscord<Prodigle> assuming it's to do with Weave and results[i] = spawn calculatePrimes(number)
13:23:06FromDiscord<clyybber> Araq: Aha! Thats interesting, so we basically already have whats required for CPS.
13:23:32Yardanico@Prodigle I don't think you can return a seq[int64] with weave
13:23:37Yardanicocheck this example https://github.com/mratsim/weave#data-parallelism
13:23:41Yardanicoyou have to use something like bufOut
13:24:14leorizeI think openArray would work too
13:24:48leorizeProdigle: why are you making a `var result` for calculatePrimes?
13:25:23FromDiscord<Prodigle> Oh, I was just trying things to get it to fix
13:25:49FromDiscord<Prodigle> I wonder if I could acces results directly from weave without a return type?
13:25:59FromDiscord<Prodigle> I wonder if I could acceds results directly from weave without a return type?
13:26:03FromDiscord<Prodigle> I wonder if I could access results directly from weave without a return type?
13:27:01FromDiscord<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:12FromDiscord<mratsim> yo will need to deal with synchronization in that case
13:27:35leorizemratsim: have you checked if openarray works as well?
13:27:44Araqbike-shedding time
13:27:46FromGitter<zetashift> @Prodigle careful with consecutive edits in Discord. IRC and Gitter send each edit as a new message
13:27:55leorizeit'd be better to use that instead of telling everyone to use ptr UncheckedArray :P
13:28:05Yardanico@zetashift just wait a bit when I'll put ircord on #nim
13:28:14Araqwhat's Nim's name for shared_ptr?
13:28:14FromDiscord<Prodigle> I'll give it a try
13:28:16leorizeofc, the best would be that everyone move to arc and weave natively supports it's data types
13:28:17YardanicoI can do it right now but that version hasn't been tested a lot :P
13:28:23FromDiscord<mratsim> @leorize, you can pass a pointer to an openarray
13:28:48PMunchAraq, is this a "Language change"?
13:28:50FromGitter<zetashift> @Yardanico ah I didn't know that! Looking forward to it :D
13:28:53Araqleorize, I hope https://github.com/nim-lang/Nim/pull/14316 is a big part of the puzzle
13:29:07Yardanico@zetashift it's been running in #nim-offtopic for quite a while now
13:29:09FromDiscord<mratsim> that sure is a descriptive PR name
13:29:11Yardanicoand #nim-gamedev since it was created
13:29:13AraqPMunch, no, it's a generic type
13:29:19PMunchHuh?
13:29:28PMunchI meant the let can omit value with importc thing
13:29:35Araqnow that 'ref T' remains non-atomic we need an atomic version
13:29:37*silvernode quit (Ping timeout: 264 seconds)
13:29:44Araqargh
13:29:46PMunchFor the changelog entry
13:29:57Araqyeah, it's a language "addition"
13:30:00FromGitter<zetashift> is nim-gamedev on Gitter or Discord?
13:30:05Yardanicoon both
13:30:11Yardanico#gamedev on discord, #nim-gamedev on Gitter
13:30:15Yardanicobut it's not bridged to gitter :P
13:30:28Araqis a SharedRef[T] or a SharedPtr[T] ?
13:30:33Araq*is it
13:30:36FromGitter<zetashift> will it be eventually?
13:30:46PMunchOkay, 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:51leorizeSharedPtr[T] IMO
13:30:51PMunchAt least for C++
13:31:24leorizeSharedRef doesn't make much sense I think
13:31:27Yardanico@zetashift well FromGitter isn't controlled by me
13:31:33Yardanicoit's not a part of nim infrastructure either
13:31:38leorizebut then we already use naming like allocShared, etc.
13:31:45Yardanicomaybe I need to write a gitter<->irc bridge or integrate it directly in ircord
13:32:12FromDiscord<mratsim> ref is how we tag managed pointer so I vote for SharedRef
13:32:23FromDiscord<mratsim> though technically it's a ShareableRef
13:32:26Yardanicohttps://github.com/oprypin/critter is the src for gitter bridge (yes it's crystal)
13:32:50AraqPMunch, yeah, for all targets
13:32:51leorizeYardanico: I can whip up a bridge between the two network via matrix, do you want me to? :)
13:33:06FromDiscord<Prodigle> I looked into openarrays and not sure how I would use them in this scenario
13:33:18Yardanicoleorize: well if you want to you can do it temporarily :P we need someone to create #gamedev on Gitter though
13:33:35YardanicoI can't even load gitter lol
13:33:41leorizethought #nim-gamedev is already a thing? lol
13:33:46Yardanicoit is
13:33:48Yardanicobut not on Gitter
13:33:54leorizewhere is it?
13:33:57leorizeirc?
13:34:11FromDiscord<Prodigle> By the looks they're read-only and I need to create/add to a list of int64's
13:34:13Yardanicoit was created in discord #gamedev and then I asked dom to create #nim-gamedev for IRC bridge
13:35:36PMunchleorize, yup
13:37:12FromDiscord<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:43leorizeI'm not sure if your algo is efficient enough to be threaded
13:38:56PMunchAraq, huh there is no sfImportCpp/JS/ObjC. Does sfImportc cover all of them?
13:41:38Yardanicomy vscode has become too coloured :P https://i.imgur.com/I3QmeNX.png
13:42:16planetis[m]what are the the nim channels in irc? #nim #nim-offtopic #nim-nologs?
13:42:22Yardanico#nim-gamedev
13:43:07leorizeah you already got ircord running in #gamedev
13:43:11Yardanicoyes
13:43:20AraqPMunch, iirc yes
13:43:46Araqyou can read compiler/pragmas.nim to find answers to these questions
13:43:48leorizeI can use matrix to bridge gitter and matrix over, but that's yet-another-bot :)
13:44:56PMunch##nim-iot
13:45:20Yardanicohuh
13:45:43*PMunch_ joined #nim
13:45:44leorizeYardanico: wanna give matrix/gitter bridging to discord a go?
13:46:02YardanicoI can't get gitter to load for me and I wouldn't be able to create a new gitter room anyway :D
13:46:18Yardanicolemme try to clean gitter cookies
13:46:20leorizewell ask Araq to provide us a room under nim-lang :P
13:46:40FromDiscord<clyybber> SharedRef, since its still refcounted, and SharedPtr doesn't make much sense, since a ptr can be shared anyways
13:46:42FromDiscord<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:53dom96leorize: you can literally create a gitter room under any project
13:47:01Yardanicooh really?
13:47:06Yardanicoah I understood
13:47:16Araqon the other hand it's a dangerous thing so it should be called SharedPtr
13:47:43Yardanicodom96: the problem is no one's gonna find it if it's not under nim-lang/ :D
13:48:14dom96Oh, I thought you want one for testing
13:49:07leorize[m]Yardanico: https://t2bot.io/discord/
13:49:21leorize[m]you do the invite the bridge part, I'll do the bridging :p
13:49:47Araqalso ... it's cooldome's work, he gets to decide the name
13:50:07Yardanicoleorize[m]: I hope it'll only work for 1 channel, not for the whole discord?
13:50:13Yardanicobecause that can really mess up a lot of things
13:50:31Yardanicoah nvm I see it now ok
13:50:50Yardanicobut how is that related to Gitter? :D
13:51:11leorizeI told you, I'm gonna do a gitter-matrix-discord bridge :P
13:51:35Yardanicowell we need a gitter room, and then maybe just ask 0prypin so he adds #nim-gamedev
13:51:53Yardanicohis FromGitter already works for #nim and #nim-offtopic for a long time
13:52:19*PMunch_ quit (Quit: WeeChat 2.8)
13:52:25FromGitter<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:34dom96my god
13:52:38leorizeYardanico: it's your call :P
13:52:40dom96why does everyone want so many bridges?
13:52:54Yardanico@capocasa maybe you can create a PR to stdlib?
13:53:08Yardanicoask GULPF though, the current times module is basically theirs :)
13:53:39Yardanicodom96: so 1 person from Gitter can chat with others :D /s
13:53:43FromGitter<capocasa> @Yardanico Gladly, thanks for the pointer!
13:54:07dom96nah, you know what. IRC and Discord are enough
13:54:32dom96One proprietary and one open chat protocol. That's all you need
13:54:43dom96if they want to chat then tell them to download either an IRC client or Discord
13:56:40zacharycarterI think just IRC is enough :P
13:57:48FromDiscord<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:03Yardanicozacharycarter: btw see https://github.com/nim-lang/Nim/issues/13881 was closed
13:58:17zacharycartermratsim: thanks I'll check this out today
13:58:17FromDiscord<mratsim> It should be straightforward enough for me to add it in the weekend.
13:58:52leorizedom96: can you move #14281 to nimble issue tracker?
14:00:17Yardanicoah seems like https://github.com/nim-lang/Nim/issues/13935 is still broken
14:00:56Araqgah, I thought I fixed that one too
14:01:19Yardanicouhh I think even https://github.com/nim-lang/Nim/issues/13881 still fails?
14:01:25Yardanicomaybe I didn't properly update to devel, hmm
14:02:01Araqanyhow this new Nim is so good. I can use .nodestroy on sink parameters to get no overhead
14:02:46Yardanicoyeah https://github.com/nim-lang/Nim/issues/13881 seems to still crash for me, idk why :D
14:02:57Araqthe pieces fit together much better than before. it's time to name this Nim 2...
14:03:12AraqYardanico, worked for me and I fixed the underlying bug
14:03:29Araqmaybe there is also a different bug
14:03:42zacharycartermratsim: the proposed solution sounds sensible to me
14:03:46Yardanicoyeah I'm on 06dfd316127fb2ec05ff69942abd1e279156ac5c (just checked nim -v)
14:03:50Yardanicothat's the last commit
14:04:29zacharycarterif you want help with it this weekend I will be around and can help
14:04:33zacharycarteror anytime this week really
14:07:04FromDiscord<mratsim> for me it's very straightforward, the hardest part is finding a simple enough but interesting enough example to showcase it
14:07:24FromDiscord<mratsim> the RFC basically describes everything I need to add and where
14:07:57zacharycarteryeah
14:09:10FromDiscord<Prodigle> I keep hitting brick walls with this 😅 What should I be doing to do this task multithreaded?
14:09:18Yardanicouse pointers
14:09:36FromDiscord<Prodigle> to a sequence index?
14:10:26zacharycarterwhat GC are you using?
14:10:31FromDiscord<Prodigle> default
14:10:34FromDiscord<Prodigle> I can change
14:10:47zacharycarterokay so allocate on the shared heap using `createShared` or `allocShared` and pass pointers
14:11:01zacharycarterand then use sync primitives
14:11:07FromDiscord<Prodigle> Thanks 🙂 I'll take a look down that route
14:11:26zacharycarterif you have some example code I can try to help you
14:11:41FromDiscord<Prodigle> Sure, hold on a sec
14:13:54FromDiscord<Prodigle> https://play.nim-lang.org/#ix=2lNi
14:13:54FromDiscord<Prodigle>
14:13:54FromDiscord<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:54FromDiscord<Prodigle>
14:13:54FromDiscord<Prodigle> Then this follows on to some example code for results
14:14:02*Trustable joined #nim
14:14:20FromDiscord<Prodigle> So far everything I've tried has hit a brick wall with adding to the seq in a MT environment
14:14:36Yardanicojust use arc and locks /s
14:14:36zacharycarterokay let me play around with this one moment
14:14:42disruptekAraq: come on mumble and explain your cps thoughts today?
14:14:54Yardanicodisruptek: he did yesterday
14:15:10disruptekwut
14:16:07FromDiscord<Prodigle> Yard, arc will let me access sequences in a MT environment?
14:16:29Yardanicoyes, 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:31Yardanicoor boehm
14:16:38liblq-devAraq: 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:39Yardanico(arc and boehm are both shared-heap)
14:16:55Yardanicoliblq-dev: https://github.com/nim-lang/Nim/blob/39290cf88c5047e86dc4894e3190c63d5985f56f/compiler/nimeval.nim#L93
14:17:04Yardanico"Same as ``findNimStdLib`` but uses source files used at compile time, and asserts on error."
14:17:15Yardanicoand findNimStdLib "Tries to find a path to a valid "system.nim" file. Returns "" on failure."
14:17:24liblq-devcool
14:17:41liblq-devhow hard is it to pass binary data between the VM and Nim?
14:18:48liblq-devI heard something about PNodes back in the day which seems cumbersome
14:18:51liblq-devand slow
14:19:10PMunchliblq-dev, I'm playing with this stuff right now :)
14:20:02*letto quit (Ping timeout: 260 seconds)
14:20:21liblq-devPMunch: cool, please share what you find out
14:20:38PMunchFor sure
14:20:40Araqliblq-dev, it's still hard unless you restrict yourself to 'string'
14:20:52Araqbut hey, Nim's strings can contain any byte
14:20:57liblq-devhmm
14:21:11liblq-devand there's distinct string
14:21:11zacharycarterwhere does `time` come from Prodigal? I'm just going to comment it out for now
14:21:32FromDiscord<Prodigle> It's a macro that times everything inside it, not relevant overall
14:22:13FromDiscord<Prodigle> You'll need to comment out the related individualCycles.writeline too
14:23:02FromDiscord<mratsim> @Prodigle, your algorithm is trial division? That is slow
14:23:53YardanicoI think I made it work with arc
14:24:15FromDiscord<Prodigle> Yeah, it's fine being slow
14:24:18FromDiscord<Prodigle> Ohh Yard?
14:24:27Yardanicoah nvm it even works without arc but ok
14:24:37Yardanicohttps://play.nim-lang.org/#ix=2lNl
14:24:55Yardanicoidk if the results are correct or not :P
14:25:22FromDiscord<mratsim> parallelizing that is not trivial, you cannot resize a sequence in parallel
14:25:29Yardanicowell yeah I'm not resizing it
14:26:05zacharycarterhttps://play.nim-lang.org/#ix=2lNm
14:26:06Guest45634can 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:30dadadaI'm working with ptr to refs now, because NimScript doesn't understand refs to refs
14:26:45Yardanicodadada: GC_disable ?
14:26:48dadadabut it can happen that the refs get garbage collected, and this produces ugly bugs
14:27:09Yardanicoit won't work for arc though
14:27:11leorizewhy would you want refs to refs...
14:27:24*letto joined #nim
14:27:35zacharycartermoar pointers!!!!!!!
14:27:53Yardanicoref ref ref ref?
14:27:54dadadaYardanico: well, then it's not really a solution for me
14:27:56FromDiscord<Prodigle> That seems to work Yard! 🙂 I think my nim install is corrupted now though haha
14:28:11Araqdisruptek, will join later, time for a break
14:28:22Yardanicodadada: well arc doesn't have a concept of some waiting or stuff
14:28:26disruptekokay; trying to digest this paper.
14:28:31zacharycarterProdigle: just keep in mind that in Yardanico's example, things could get collected
14:28:38Yardanicodadada: you can do GC_ref
14:28:40Yardanicoand then GC_unref
14:28:42Yardanico:D
14:28:52YardanicoI think it works on arc
14:28:56Araqdisruptek, oh yeah, this paper is superb, and we can copy from it pretty much blindly
14:29:58Yardanicozacharycarter: yeah I never actually made a real big multithreaded app :P
14:30:10Yardanicoi only know the basics like locks and stuff
14:31:00disruptekthis is the async story nim needed.
14:31:38dadadafirst 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:44dadadawith ptrs to refs the thang now has unpredictable pointers that produce errors I can't explain (so probably the GC)
14:31:50FromDiscord<Prodigle> It runs but immediately gets Error: unhandled exception: index out of bounds, the container is empty [IndexError] and fatals
14:32:01Yardanicowhich one?
14:32:36Yardanicozacharycarter: your version doesn't initialize results variable :P
14:32:52Yardanico@Prodigle change results[i] = result to results.add(result)
14:32:54Yardanicothen it might work
14:33:19FromDiscord<Prodigle> Still fails
14:33:20FromDiscord<Prodigle> line isss
14:33:26Yardanicoso which version?
14:33:32FromDiscord<Prodigle> var number = toCalculate[i]
14:33:52Yardanicomaybe you changed "0..6" to something else?
14:33:57FromDiscord<Prodigle> Your code into my main project, I'll playground the whole file
14:34:16FromDiscord<Prodigle> https://play.nim-lang.org/#ix=2lNv
14:35:29FromDiscord<mratsim> I assure you, what you are trying to do will lead to all kind of breakage
14:35:40Yardanicoi told him to use weave twice :P
14:35:47FromDiscord<mratsim> don't pass var seq to create thread
14:36:15Yardanicohe's not doing that in the last example though
14:36:58FromDiscord<Prodigle> I tried weave but the data parallelism was a bit above me
14:37:15FromDiscord<mratsim> if you want to collect result safely, use channels: https://github.com/nim-lang/Nim/blob/8088633250872de8777c7078e636b2379780e107/tests/parallel/tpi.nim
14:38:03FromDiscord<mratsim> What you want to do needs task parallelism
14:38:38FromDiscord<mratsim> The first thing to remember about multithreading is: never ever update the same data concurrently.
14:39:05FromDiscord<mratsim> hence, your result sequence must be allocated fully beforehand
14:39:31FromDiscord<mratsim> and then you can pass a pointer to seq locations if you want to update them in-place
14:39:55FromDiscord<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:27FromDiscord<Prodigle> The channel would allow me to return a dynamic amount of int64's?
14:41:34FromDiscord<mratsim> Nim channels can yes. In Weave I didn't test seq result, they might work with BoehmGC or gc:arc
14:41:54FromDiscord<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:43FromDiscord<mratsim> okay, so you need results = newSeq[seq[int64]](countProcessors())
14:43:03FromDiscord<mratsim> or maybe newSeq[Channel[seq[int64]]](countProcessors())
14:43:52FromDiscord<mratsim> then you for i in 0 ..< countProcessors: spawn(myTask(results[i], a, b, c))
14:44:27FromDiscord<mratsim> in the task, at the end of the compute you do channel.send(myResultSeq)
14:45:34FromDiscord<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:17FromDiscord<mratsim> let's see if I can make it quickly work in the playground
14:46:33FromDiscord<Prodigle> Thanks so much
14:48:46FromDiscord<mratsim> actually since you directly use the result we can skip channels and directly use the Flowvar
14:53:13FromDiscord<Prodigle> I have it running but failing atm so you can probably get it 🙂
14:53:24leorizeanyone interested in an azure pipelines template to setup Nim in your CI for you?
14:53:33leorizeI'll add caching and all that goodness in too :P
14:55:00disruptek~stream
14:55:05disruptekfast async io under linux.
14:55:22disruptekduh.
14:55:25disruptek~stream
14:55:25disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
14:55:25Yardaniconot ic?
14:55:30disrupteknoooooo
14:55:46leorizeone can only work on the compiler for so long
14:55:51leorize:P
14:55:51dom96async io is already fast under linux :P
14:56:07Yardanicodom96: io_uring
14:56:11leorizenot fast enough :P
14:56:37dom96cool. I was thinking of streaming about that too, but realistically I wouldn't have enough time anyway
14:58:03FromDiscord<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:17Yardanicogood thing I'm still a student :P
14:58:18FromDiscord<zetashift> and I think generally with a lot of people in the open source world
14:59:12dom96People grow up, people start needing money to live, people have less time
14:59:14narimirandom96: i've seen you pinged me/us about helping you deploy new forum version. what do you need help with?
14:59:55dom96narimiran, 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:06dom96(or someone else who Araq deems trustworthy)
15:00:14FromDiscord<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:35FromDiscord<Prodigle> I'll take a look! thanks
15:01:37FromDiscord<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:12dom96zetashift: yep, and also I want to set up something that has a chance of supporting me and Nim into the future
15:02:24PMunchHmm, findNimStdLib doesn't work when Nim is installed with choosenim..
15:02:37PMunchBecause the `nim` executable isn't next to `lib`
15:02:39dom96realistically, no matter how fun, implementing io_uring will not get us there
15:03:31leorizePMunch: now you understand the pain of writing tooling :P
15:03:43FromDiscord<zetashift> Good luck! Such endeavors are always a big leap
15:03:51PMunchHaha, trust me, I got my fair share of that with nimlsp..
15:03:52FromGitter<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:05FromGitter<kayabaNerve> First is preferred, second is tolerable if I can get it < 127.
15:04:13FromDiscord<mratsim> @PMunch, could it be the reason for https://github.com/nim-lang/Nim/issues/12293
15:04:16disbotcompiler as a library: findNimStdLibCompileTime fails to find system.nim ; snippet at 12https://play.nim-lang.org/#ix=22qc
15:04:27leorizekayabaNerve: it's a thing used for stacktraces
15:04:34FromDiscord<mratsim> @kayabaNerve, it's 2000
15:04:35dom96zetashift: 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:37leorizeyou don't want to use it in production
15:04:56FromDiscord<mratsim> it's removed when compile with release (or danger?)
15:05:25FromGitter<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:43Yardanico@kayabaNerve -d:nimCallDepthLimit=value
15:05:50PMunch@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:52FromGitter<kayabaNerve> Right.
15:05:59PMunchBut that wouldn't create anything distributable anyways
15:06:02FromGitter<kayabaNerve> I either need to get the current depth at runtime or set that to 127.
15:06:09Yardanicoat runtime?
15:06:11PMunchUnless the user had the same folder structure as you had :P
15:06:22Yardanicowhy not set -d:nimCallDepthLimit=127 at comptime
15:06:47FromGitter<kayabaNerve> I'm not sure if it can go that low. Nim segfaults when you set it too low.
15:07:02Yardanicoworks for me
15:07:03FromGitter<kayabaNerve> Just wanted to check about side effects of too low values before I assume 127 is a valid value
15:07:18Yardanicohm
15:07:32FromGitter<kayabaNerve> *To be clear, I set it to 5.
15:07:40FromGitter<kayabaNerve> It was way too low of a value.
15:07:54YardaniconimCallDepthLimit is a constant
15:08:00FromGitter<kayabaNerve> Yep
15:08:02FromGitter<kayabaNerve> I know
15:08:03Yardanicoread from this line https://github.com/nim-lang/Nim/blob/06dfd316127fb2ec05ff69942abd1e279156ac5c/lib/system/excpt.nim#L538
15:08:12Yardanicowell, so there's no way to set it at runtime
15:08:36FromGitter<kayabaNerve> I'm trying to GET it at runtime
15:08:55FromGitter<kayabaNerve> Or I need to set the constant to 127 and verify I know the effective threshold
15:09:07PMunchThis is why I think Nim should have a --libs switch that just tells you where it finds the libs..
15:09:46FromGitter<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:58PMunchI 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:00FromGitter<kayabaNerve> And even if Nim doesn't, I'm sure unittest does.
15:10:17Yardanico@kayabaNerve you'll have to get the current frame somehow
15:10:20leorizePMunch: it actually does have
15:10:31PMunchIt does?
15:10:38PMunchI just looked through --fullhelp looking for it..
15:10:40leorizenim dump
15:10:58FromGitter<kayabaNerve> Yardanico: Yeah, I found the PFrame type. Don't think I can access it though.
15:11:10PMunchRight! I knew there was some way of doing it..
15:11:34FromGitter<kayabaNerve> Oh. getFrame is a thing. I'll try that. Thanks.
15:12:12FromGitter<kayabaNerve> `echo getFrame().calldepth` works. Thanks.
15:12:29disruptekhttps://arxiv.org/pdf/1011.4558.pdf
15:12:41Yardanicothx
15:12:49Yardanico@kayabaNerve thanks, never knew that :P
15:14:16FromGitter<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:35FromGitter<kayabaNerve> Basically verifying my library won't trigger this no matter the data handed in.
15:15:11FromGitter<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:01FromDiscord<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:12Yardanicowdym "a bad nim install?
15:22:42*krisppurg_ joined #nim
15:22:50FromDiscord<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:31FromDiscord<Prodigle> https://pastebin.com/bNwUZQJ8
15:25:31FromDiscord<Prodigle>
15:25:31FromDiscord<Prodigle> Error is :
15:25:31FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\Concurrency\Nim Concurrency\main3.nim(77) main
15:25:31FromDiscord<Prodigle> D:\Coding\nim-1.0.6\lib\system\fatal.nim(49) sysFatal
15:25:31FromDiscord<Prodigle> Error: unhandled exception: index out of bounds, the container is empty [IndexError]
15:25:51FromDiscord<Prodigle> Line is var number = toCalculate[i]
15:27:14PMunchThat is weird
15:28:00FromDiscord<Prodigle> Yeah, toCalculate is size 7 and the i is 0..6
15:28:51FromGitter<brentp> does anyone have a (docker) setup for building osx binaries on linux for nim projects?
15:29:47PMunchHmm, 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:55nisstyreI think you need xcode or something to make MacOS binaries
15:29:57nisstyrecould be wrong
15:30:00Yardaniconot neccessarily
15:30:05PMunchFor comparison the entire stdlib is 24MB
15:30:06Yardanicoe.g see https://github.com/tpoechtrager/osxcross
15:30:18leorizeyou can use zig to generate osx binaries, yes? :P
15:30:21Yardanicoyes
15:30:32Yardanicoidk if it works good enough though :D
15:31:26FromDiscord<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:40PMunchIf anyone is curious, this is the list of stuff you need: http://ix.io/2lNX
15:38:04PMunchI say need, but a lot of that is probably not strictly speaking required to run the little snippet
15:38:47PMunchNow, if this nimscript stuff was only able to tell me everything it actually used..
15:42:26*krisppurg left #nim (#nim)
15:43:31FromGitter<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:24FromDiscord<mratsim> @Prodigle, your code is missing the "File" setup and "time" setup
15:48:31FromDiscord<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:59FromGitter<nothratal> Am I the only one who experiences bad performance on https://nimble.directory/ ? ⏎ getting constantly 429's and 502's
16:04:45Yardanicodonate a 4gb ram VPS to it :)
16:04:57leorizeping federico3 I guess :P
16:06:34FromGitter<bung87> It current run on ?gb
16:31:35federico3it's not just RAM
16:32:48federico3scaleway got worse and network drives are the bottleneck
16:33:38supakeenfederico3: 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:27supakeenThough it is more a many-little-machines setup :)
16:36:45federico3how little?
16:38:22supakeen4gb varnish cache + 3x 2gb web vms
16:38:41supakeen(and a haproxy in front of that because i serve some more than http)
16:40:18supakeenthough perhaps in your case 'just' adding your own cache might alleviate disk load?
16:43:03federico3the problem is not serving files: it's a buildbot
16:44:02supakeenah i misinterpreted then
16:45:13supakeenperhaps drop an email to digital ocean's open source? i've heard they like to sponsor this kind of thing with resources
16:45:33federico3yep
16:45:46supakeenand they seem already involved with nim itself
16:46:04alexander92kayabaNerve
16:46:10alexander92this does sound dangerous somehow
16:47:25alexander92do 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:04PMunchOkay, 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:31PMunchMeaning this is the subset of things that a trivial nimscript needs to run: http://ix.io/2lOu
17:03:03PMunchFor a grand total of 884KB :)
17:07:24PMunchAnd the sizes of each file should anyone be interested: http://ix.io/2lOv
17:07:55PMunchNot too shabby, but could probably be boiled down a tad further
17:08:41PMunchThat 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:02PMunchGot that down to 1.3MB with -d:danger --opt:size and strip
17:20:56leorizeyou do know you can use --verbosity:3 to trace all read files, right? :P
17:26:55AraqPMunch, unicode.nim is worrying me
17:30:51FromDiscord<dom96> Prometheus is awesome for finding memory leaks:
17:30:51FromDiscord<dom96> https://cdn.discordapp.com/attachments/371759389889003532/709819898066370657/unknown.png
17:35:01euantorPrometheus in general is pretty awesome. Are you just using it as a standard scrape endpoint?
17:37:10dom96I'm using it for all sorts of logging
17:37:27dom96I implemented a collector for Nim's GC a while back and it has been worth its weight in gold :)
17:41:59FromGitter<kragil> is there an easy (fully documented) way to write a modern Android apps in Nim?
17:42:19Yardanicoyou can if you use https://github.com/yglukhov/jnim but you'll wrap all java methods you want to use
17:42:56Yardanicosee https://github.com/yglukhov/android
17:43:07leorizeeasy: no
17:43:16FromDiscord<dom96> fully documented: no
17:43:34FromDiscord<dom96> modern: probably also no to be honest
17:43:46Yardanicowell, certainly far from easy :P
17:43:54FromGitter<kragil> OK, thanks for the honest answers ;-)
17:43:57leorizeandroid is too much java afterall
17:44:12FromDiscord<dom96> Honestly, the only reason you should consider it is if you are writing a game that targets iOS and Android
17:44:30FromGitter<kragil> OK? I want to write a game!
17:44:35FromDiscord<dom96> That's why I'm writing an Android game in Nim.
17:44:49Yardanico@kragil then why do you want "modern android apps"?
17:44:57Yardanicofor me that means material design and all that stuff
17:45:07leorizeI'd write my own android app if it's feasable in Nim
17:45:12leorizeI'm scared of java :P
17:45:28FromDiscord<dom96> yeah, be more specific that you want to write games not apps 😛
17:45:36FromGitter<kragil> Sorry, I just want it to work on new Android handsets
17:46:01FromGitter<kragil> Is there a template that lets me write to the screen with Nim?
17:46:17FromGitter<kragil> and maybe make some noise ;-)
17:46:19FromDiscord<dom96> The way I'm doing it is by piggybacking on SDL
17:46:35FromDiscord<dom96> via my library which I would not recommend as it has no stable API: https://github.com/dom96/gamelight
17:46:59FromGitter<kragil> OK, any recommended ways?
17:47:03FromDiscord<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:30FromDiscord<dom96> hrm, I should at least change the description of this library
17:47:40FromGitter<kragil> No, I am not that experienced, but I find writing Nim Code really easy.
17:48:54FromDiscord<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:56disbotQuestion about static linking a library
17:51:20FromDiscord<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:48FromDiscord<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:36PMunchleorize, well obviously I don't :P
18:25:26PMunchAraq, it's because of this: minilib/strutils.nim:81: from unicode import toLower, toUpper
18:25:41PMunchThat's the only thing that imports from it
18:29:13AraqPMunch, hmm ok
18:30:11PMunchCuriously those are behind a switch "when defined(nimVmExportFixed)"
18:31:09Araqlet me tell you a secret
18:31:14*arecaceae quit (Remote host closed the connection)
18:31:25Araq'when defined(nim***)' is always true
18:32:00PMunchI guess those are just used for some kind of backwards compatibility?
18:32:17PMunchFor an older version of Nim to be able to use a newer versions stdlib?
18:32:21*arecaceae joined #nim
18:35:57PMunchRemoving it got rid of unicode and unicode_ranges saving 88KB bringing the total down to 796KB
18:36:03Araqit's all for bootstrapping, an old Nim compiler must be able to compile new Nim code
18:36:19*Senketsu joined #nim
18:36:34Araqat least to the point that it can build a new Nim compiler
18:36:47livcdare there any easter eggs in the compiler?
18:36:59Yardanicolol
18:37:08Yardaniconot that I know of, maybe if you consider comments an "easter egg" :D
18:38:01krux02depends on your definition of "easter egg".
18:38:14krux02There are many hidden feautures.
18:38:36PMunchLike "nim dump"..
18:38:43Yardanicoit's documented
18:38:52Yardanicohttps://nim-lang.github.io/Nim/nimc.html
18:38:54PMunchIs it?
18:38:58livcdBasically something that makes Araq giggle
18:38:59Yardanico"dump dump all defined conditionals and search paths see also: --dump.format:json (useful with: ` | jq`)"
18:39:13PMunchShould be in --fullhelp IMO
18:40:13*krisppurg_ quit (Quit: Connection closed for inactivity)
18:41:16Yardanicobtw found a cool repo Telegram, [21.04.20 16:03]
18:41:16YardanicoАктуальная информация о борьбе с COVID-19 в России доступна в канале https://t.me/stopcoronavirusrussia.
18:41:19FromDiscord<mratsim> so where can I read about AST2?
18:41:21Yardanicoshit sorry wrong paste
18:41:24Yardanicohttps://github.com/dbohdan/compilers-targeting-c
18:41:37PMunchHaha, what was that Yardanico :P
18:41:42YardanicoPMunch: IDK either
18:41:53Yardanicoseems like a message from telegram about COVID-19
18:41:58FromGitter<bung87> list of language never heard..
18:42:08Yardanicoit includes nim btw
18:42:08PMunchHmm, it would be interesting if Nim could pre-process the stdlib for nimscript into the binary..
18:42:15Yardanicoand I heard about a lot of these languages for sure
18:42:16PMunchSo you wouldn't need to include the stdlib sources
18:43:08*D_ quit (Ping timeout: 244 seconds)
18:43:40FromGitter<bung87> ts2c oh, ts2c someone made this..
18:44:51*D_ joined #nim
18:49:32*letto_ joined #nim
18:50:31FromGitter<bung87> haxe official site has jobs and Shop page
18:50:34*letto quit (Ping timeout: 272 seconds)
18:53:02YardanicoAraq: your orc fix worked, now nim forum works with orc and threads on
18:53:04Yardanicobut leaks memory a lot
18:53:21Yardanicoin just under 10 second of stress-testing it came to use 10gb ram, maybe it's due to httpbeast , idk
18:53:29PMunchOuch
18:53:48disruptek!memory
18:53:48disbot total: 5 Megabytes; free: 528 Kilobytes; owned: 4 Megabytes; max: 5 Megabytes
18:54:02AraqYardanico, use -d:useMalloc and leak detectors
18:54:22disruptekAraq: you too busy to mumble?
18:54:45PMunchHmm, is there an easy package to package stuff in a binary?
18:55:14PMunchSo it would get unpacked on runtime
18:55:21Yardanicoyeah, staticRead :P
18:55:37PMunchI meant something that would take a path and recreate that entire path :P
18:55:44leorize7z sfx
18:55:55FromGitter<bung87> wired , haxe web page makes me assuming it's popular than nim , but it has less stars
18:56:04PMunchJust a simple package, a line or two to use..
18:56:25leorizestars is never a good metric
18:56:54rockcaverasince which version do uint() int() and others convert without overflowing?
18:57:33FromGitter<bung87> the companies used surprised me
18:58:26shashlick@mratsim - i'll reply to the issue, i see what he needs to do
18:58:35YardanicoAraq: seems like memory is getting lost in httpbeast somehow
18:59:13Yardanicohttps://gist.github.com/Yardanico/9c15a2b2eff555fc6de08c5007da100d
18:59:55leorizerockcavera: wdym without overflowing?
19:01:34FromDiscord<Yardanico> Well to be fair I inserted some gcsafe pragmas as nimforum accesses some global variables
19:03:10rockcaveraleorize if I'm not mistaken, in the past let a = 200'u8 | let b = int8(a) launch overflow error
19:03:26PMunchHmm, not sure if this really should be closed: https://github.com/nim-lang/Nim/issues/14253
19:03:28disbotAssignment to `default` leads to assignment for `nodecl` ; snippet at 12https://play.nim-lang.org/#ix=2l7t
19:03:31leorize!eval echo int8 200'u8
19:03:32NimBotCompile failed: /usercode/in.nim(1, 11) Error: 200 can't be converted to int8
19:03:48leorize!eval let a = 200'u8; let b = int8 a
19:03:50NimBot/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:05leorizerockcavera: ^ it's still the case?
19:04:08rockcaveraI'm using devel
19:04:38leorizestill crashing on devel
19:04:47rockcaverahummm
19:08:11AraqYardanico: 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:00krisppurgHiya, is there a way to evaluate code in Nim without using nim's playground?
19:09:19disruptekuse the compiler.
19:09:23disruptek~playground
19:09:23disbotplayground: 11an online in-the-browser IDE for simple Nim experiments at http://argentina-ni.ml/ -- disruptek
19:10:10PMunchdisruptek, why isn't ~playground pointing the the official one?
19:10:12*poohman joined #nim
19:10:43disrupteki like learning spanish while i code.
19:10:46FromDiscord<KrispPurg> well, I mean at runtime.
19:10:51PMunchYes
19:10:55PMunchWait what?
19:11:01PMunchThe playground isn't runtime?
19:11:05PMunchIt compiles and runs your code
19:11:14FromDiscord<Yardanico> He means run Nim code at runtime in your Nim apps I think
19:11:29FromDiscord<Yardanico> @KrispPurg you can embed NimScript in your app but why?
19:11:39leorizekinda like scripting languages' `eval`?
19:11:51PMunchThat's what I'm working on right now :P
19:12:02PMunchHow come everyone started asking about it just as I started working on it?
19:12:36FromDiscord<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:49leorizeI rarely find a case where `eval` is actually useful
19:12:50AraqPMunch, I know the effect too. I think humanity is already some hive mind
19:13:54leorizethe only reason I would need `eval` would be to do poor man's templating in languages that don't have proper metaprogramming
19:14:45PMunchWell I'm planning on using NimScript for configuration
19:14:48PMunchLike nimble does
19:16:59FromGitter<bung87> vote+1
19:20:19FromGitter<bung87> can playground using nimble packages?
19:21:14liblq-devafaik it can use some packages
19:21:54PMunchbung87 it has a list of packages
19:21:54liblq-devones listed here https://github.com/nim-lang/Nim/blob/devel/testament/important_packages.nim
19:21:58PMunchpre-installed
19:22:03PMunchBut not quite that list
19:22:58PMunchRun this in the playground to see them: `static: echo staticExec("ls /playground/nimble")`
19:23:00FromGitter<bung87> oh, I saw this before, that's where it used.
19:24:21FromGitter<bung87> I think should fusion also included.
19:24:42PMunchThat would be a good idea
19:28:03*dddddd joined #nim
19:31:55Guest89744everything from https://nim-lang.org/docs/nimscript.html also works in runtime right?
19:32:04Guest89744so if I want to target nimscript and normal runtime
19:32:13Guest89744I'd better choose rmFile instead of os.removeFile?
19:32:18*Guest89744 is now known as dadada
19:33:37dadadahmm, seems like it doesn't work ... tested with rmFile
19:34:20PMunchWhy doesn't it work
19:35:03dadadaundeclared identifier rmFile
19:35:16dadadaagain, I'm trying this out on runtime, I assume it works in macros
19:35:39PMunchDid you try import nimscript?
19:35:47dadadayeah, says it can't open the file
19:36:06dadadaError: cannot open file: nimscript
19:36:25PMunchHuh
19:36:49FromDiscord<Yardanico> I think you can't use NimScript specific stuff in normal Nim apps
19:37:28dadadadefine specific rmFile vs removeFile ... seems like a good idea to have one that works on both?!
19:37:42dadadawhat would be the counter argument?
19:47:26*Senketsu quit (Ping timeout: 240 seconds)
19:49:59PMunchHuh, curious. I created a seq and an array in NimScript and they both came out as nkBracket (ie. an array literal)
19:57:35PMunchHmm, doesn't tables work in nimscript?
19:58:46FromGitter<bung87> I want fusion included in playground ,and close some issues, dont have that permission..
19:59:15PMunchbung87, what do you mean? Just create a PR to the plaground API?
19:59:19FromDiscord<Varriount> shashlick: What is AST2?
19:59:21PMunchs/API/repo
20:00:00PMunchVarriount, eh it's just a money grab from the makers of AST. No imagination, just the same of stich once again..
20:01:12FromGitter<bung87> just test with fusion package, and put playground link , then close issues
20:01:34PMunchMy script which is trying to use a table fails with this. Any ideas? http://ix.io/2lPz
20:01:45FromGitter<bung87> that's I wanna do
20:02:27PMunchbung87, 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:39PMunchAnd what do you mean by "put playground link"?
20:04:00FromGitter<bung87> so that otherone can check result make sure issues could be closed
20:05:33PMunchI'm sorry but I don't really understand what you want to do here..
20:07:40FromGitter<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:51disruptekdid we put a pointer math lib into stdlib?
20:08:52PMunchAh right
20:09:05PMunchSo create a PR to the playground repo that adds fusion
20:09:06*poohman quit (Ping timeout: 272 seconds)
20:09:49FromGitter<bung87> https://github.com/nim-lang/Nim/blob/devel/testament/important_packages.nim append it here?
20:10:02FromGitter<bung87> I thought it just for testing
20:10:13PMunchNo, not there
20:10:40PMunchHere, in the playground repo: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble
20:10:55FromGitter<Nickiel12> can anyone recommend a library for playing media files? I was looking at cscore, then I realized that it is c#...
20:11:16PMunchNickiel12, what kind of media files?
20:11:23FromGitter<Nickiel12> music files
20:11:36FromGitter<Nickiel12> starting with mp3
20:11:59FromDiscord<Yardanico> libvlc?
20:12:14FromDiscord<Yardanico> I made a bare bones wrapper for it a while ago
20:12:18FromGitter<bung87> @PMunch ok, thanks ! then I can start now : )
20:12:20PMunchhttps://nimble.directory/pkg/libvlc
20:12:38FromDiscord<Yardanico> Need to test it with ast2
20:12:45FromDiscord<Yardanico> But simple MP3 worked for me fine
20:12:55FromGitter<Nickiel12> ok, I will start there! thanks
20:13:30PMunchHmm, so hashVmImpl has an assert false that says "implementation override in compiler/vmops.nim"
20:13:41PMunchBut that should be included with compiler/vm right?
20:15:29FromGitter<bung87> @Pmunch fusion not in nimble directory, it's ok just add its name or add repo url?
20:15:43PMunchAnything that nimble accepts is fine
20:16:07PMunchThat is just a list of nimble dependencies which gets installed by calling "nimble install --depsOnly"
20:18:01FromGitter<bung87> oh ,seached so when inquire install from git it will answered yes
20:18:28PMunchUhm, what?
20:19:34shashlick@Varriount: https://github.com/nimterop/nimterop/blob/master/CHANGES.md
20:19:43FromGitter<bung87> never mind , I check `RUN nimble install --nimbleDir:/installer/nimble -y --depsOnly`
20:21:05FromGitter<bung87> PR created
20:21:43PMunchHmm, so what is the difference between scriptconfig.nim and nimeval.nim?
20:22:12PMunchBoth seem to setup and run NimScript
20:22:41PMunchBut scriptconfig uses a PEvalContext and runs "registerAdditionalOps" on it to get the table stuff defined..
20:26:15FromGitter<Nickiel12> I get an error when importing libvlc, libvlc.nim(39, 8) template/generic instantiation of `cImport` from here
20:26:27FromGitter<Willyboar> https://dev.to/devteam/announcing-the-grant-for-the-web-hackathon-on-dev-3kd1
20:26:58PMunchNickiel12, sounds like nimterop issue. Yardanico?
20:27:30FromGitter<Nickiel12> nimterop does throw an error on that stack trace as well
20:29:27FromGitter<Nickiel12> `nimterop-0.5.2\nimterop\cimport.nim(651, 10) template/generic instantiation of cImport from here`
20:29:39FromGitter<bung87> that's happened when you using a template calls proc not exported
20:30:30FromGitter<Nickiel12> is there anything I can do about it?
20:31:42shashlickNickiel12: please share the error after that
20:31:56FromGitter<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:09FromGitter<bung87> check the file it reported, export all its imported
20:32:52FromGitter<bung87> @PMunch please merge the PR I created
20:32:57disruptekasync still broken for me under orc.
20:33:19PMunchbung87, hold on, first I need to check that it actually works..
20:33:23FromGitter<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:33FromGitter<bung87> `export ` module the macro used
20:35:24FromGitter<bung87> @PMunch ok
20:35:46FromGitter<Nickiel12> where do I do that...
20:37:01FromGitter<bung87> cimport.nim ,see whats it imported , then export all
20:37:46FromGitter<Nickiel12> export it's imports?
20:38:29FromGitter<Nickiel12> so add the rest of the relative imports to the export in this line? ⏎ `import "."/[build, globals, paths, types] ⏎ export types`
20:38:34FromGitter<bung87> yeah, I face same problem several times, there's a opened issue for this
20:39:37FromGitter<bung87> it depends what module the macro used, maybe all the modules
20:40:54FromDiscord<Yardanico> @Nickiel12 sorry I wouldn't be able to help today, only tomorrow (in around 10-15 hours)
20:41:06FromGitter<Nickiel12> ok
20:41:07FromDiscord<Yardanico> I'll test libvlc with latest nimterop then
20:41:08FromGitter<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:20FromGitter<Nickiel12> ok
20:42:02FromGitter<bung87> you can check one by one , as I only have this clue
20:42:08FromGitter<Nickiel12> ok
20:44:11PMunchOkay, I can see what the problem with PNodes are..
20:44:46PMunchI created a simple table and added two entries to it, this is what came out: http://ix.io/2lPQ
20:44:57shashlickNickiel12: please share the full log as a gist
20:45:09PMunchWhich I guess makes sense
20:45:36PMunchBut it's not very optimal in terms of getting useful data from it..
20:46:47FromGitter<Nickiel12> <script src="">https://gist.github.com/Nickiel12/0b03ca834f2132a6f74afde08a162853.js"></script>
20:47:06FromGitter<Nickiel12> https://gist.github.com/Nickiel12/0b03ca834f2132a6f74afde08a162853
20:49:00shashlickthanks - what version of nimterop do you have
20:49:31FromGitter<Nickiel12> 1) 5.2
20:49:33shashlickya says 0.5.2
20:49:50shashlickokay, i need to try this locally - need more details
20:50:43FromGitter<Nickiel12> `nimble install libvlc` is all I did, after I tried to update nimterop, but it was 0.5.2 already
20:51:00FromGitter<Nickiel12> `import libvlc` ⏎ ⏎ `echo "hello there"`
20:51:05FromGitter<Nickiel12> is all that is in my Main.nim
20:51:42shashlicki don't know if yardanico tested this on windows but we need better output from nimterop for sure
20:51:54FromGitter<Nickiel12> is there a way I can get it?
20:54:29shashlickthe line numbers in the output are totally random - don't match what's in the repo
20:55:31shashlicki'll need to debug and get back to you, don't have my windows system up
20:55:51FromGitter<Nickiel12> ok
20:56:24FromGitter<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:50FromGitter<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:53disbotgetCacheValue seems wrong ; snippet at 12https://play.nim-lang.org/#ix=2lPU
21:01:51FromGitter<Nickiel12> is this a `template/generic instantiation of cImport` ? ⏎ `cImport(@[`filename`], bool(`recurse`), `dynlib`, `mode`, `flags`)`
21:06:36shashlickcImport is a macro call - it is failing but the error is not obvious so it says that generic error
21:06:43PMunchHmm, so the marshal module doesn't work for NimScript.. Passing data from NimScript to Nim through JSON feels, dirty..
21:07:49FromGitter<Nickiel12> ok
21:08:01*poohman joined #nim
21:10:11FromGitter<Nickiel12> so it wouldn't say if the function failed, just that something is wrong?
21:14:21FromGitter<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:09FromGitter<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:15FromGitter<Nickiel12> am I supposed to have the libvlc.dll on the Path???
21:20:49FromGitter<bung87> a wrapper module will looking for system wide dll path
21:21:14*Vladar quit (Quit: Leaving)
21:21:48FromGitter<Nickiel12> so that is a yes?
21:22:03FromGitter<Nickiel12> I need to compile the libvlc.dll and add it to the path
21:22:11FromGitter<Nickiel12> or check that I have it at least
21:23:34PMunch@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:20FromGitter<bung87> I checked it just now, seems playground does not have?
21:28:24PMunchAs I said, the image is building now
21:28:31PMunchGive it some time to complete..
21:29:07FromGitter<bung87> ok get it.
21:29:40*sc joined #nim
21:31:02*solitudesf quit (Remote host closed the connection)
21:33:29FromGitter<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:39shashlickNickiel12: have some questions for yardanico, so will need to wait
21:33:45shashlicki don't see how this ever worked
21:33:53FromGitter<Nickiel12> ok
21:34:00shashlickanyway, gotta run for some errands, will get it working soon
21:42:24PMunch!eval import fusion
21:42:26NimBotCompile failed: /usercode/in.nim(1, 8) Error: cannot open file: fusion
21:42:45FromGitter<bung87> building finished ?
21:42:49PMunchYup
21:43:34FromGitter<bung87> !eval import fusion
21:43:36NimBotCompile failed: /usercode/in.nim(1, 8) Error: cannot open file: fusion
21:44:01*abm quit (Ping timeout: 264 seconds)
21:44:26PMunch!eval import fusion
21:44:28NimBotCompile failed: /usercode/in.nim(1, 8) Error: cannot open file: fusion
21:45:30PMunch!eval fusion/btreetables
21:45:32NimBotCompile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'fusion'
21:45:40PMunch!eval import fusion/btreetables
21:45:42NimBot<no output>
21:45:45PMunchYay!
21:46:08*liblq-dev quit (Quit: WeeChat 2.8)
21:46:54FromDiscord<Rika> nice
21:47:44*enthus1ast30 joined #nim
21:47:47leorizePMunch: 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:04FromGitter<bung87> nice ,available now.
21:48:17leorizepeople would just need to point to the docker image and they can get all testing done
21:48:28PMunchleorize, sure don't see why not
21:48:55leorizethe only one being left out will be macos :P
21:48:59enthus1ast_dom96 https://forum.nim-lang.org/search?q=a makes the forum not responding for a few seconds.
21:49:51enthus1ast_my guess is non async sql driver :)
21:50:12leorizedoes sqlite even have an async driver?
21:50:52enthus1ast_i dont know where but i think i saw an (relative new) async sql driver
21:51:29leorizeiirc they had one but then they got rid of it
21:52:30enthus1ast_when i remember correctly the one i saw was not "official"
21:53:52FromGitter<bung87> httpclient does not compile with ssl?
21:53:57FromGitter<bung87> in playground
21:55:30leorizeenthus1ast_: yea the sqlite api have zero async primitives
21:55:45leorizethe only way to do async is to delegate it into an another thread
21:55:56disruptekdude.
21:55:57disruptekleorize.
21:56:03FromGitter<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:03disruptekwhat happened with your iocp stuff?
21:56:14disruptekare they in your new osproc?
21:56:17disruptekand it is done?
21:56:39leorizedisruptek: the pipe thingy is usable but I'm not done with the new osproc yes
21:56:47leorizeyet*
21:57:00disruptekit uses iocp or just named pipes or what?
21:57:07*tane quit (Quit: Leaving)
21:57:17FromGitter<bung87> there is a wrapper ,check need libraries repo
21:57:48leorizedisruptek: randomized named pipes with a lot of restrictions to imitate the security of anonymous pipes
21:57:59FromGitter<awr1> seems like making bindings to libwkhtmltox might be an option
21:59:04FromGitter<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:40FromGitter<bung87> https://github.com/nim-lang/needed-libraries/issues/76
21:59:42disbotSelenium driver
21:59:58*PMunch quit (Quit: leaving)
22:00:07FromGitter<awr1> yeah selenium would also be an alternative
22:00:25FromGitter<bung87> !repo webgui
22:00:27disbothttps://github.com/juancarlospaco/webgui -- 9webgui: 11Web Technologies based Crossplatform GUI Framework with Dark theme 15 25⭐ 3🍴 7& 1 more...
22:02:46dom96awr1: https://github.com/dom96/webdriver/
22:03:07dom96Also have this https://github.com/dom96/geckodriver-travis
22:03:17FromGitter<awr1> yeah i'm actually watching your video on it right now
22:03:21FromGitter<awr1> i saw it in the comments
22:17:44FromGitter<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:44FromGitter<bung87> https://github.com/nim-lang/Nim/issues/12202#issuecomment-627631776
22:26:47disbotparseHtml 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:26FromGitter<bung87> I commented not sure should closed as it solved in fusion htmlparser
22:29:17FromGitter<bung87> https://github.com/nim-lang/Nim/issues/14073 also this one
22:29:19disbothtmlparser 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:26FromGitter<bung87> https://github.com/nim-lang/Nim/pull/12205 also this
22:32:29disbotfix #12202 parseHtml now correctly handles <script> jscode </script>
22:41:16PrestigeMaking a small devlog about my WM in nim if anyone is interested, will be posting soon
22:46:42leorizenice :)
22:47:43FromGitter<bung87> https://github.com/nim-lang/Nim/issues/14056 also this might be closed.
22:47:44disbotxmlparser removes significant white space
22:48:34FromDiscord<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:04leorizeuse ndb
22:49:11leorize!repo ndb
22:49:12disbothttps://github.com/xzfc/ndb.nim -- 9ndb.nim: 11A db_sqlite fork with a proper typing 15 25⭐ 5🍴
22:49:27leorize^ it said that but it has mysql support too
22:49:30*monokrom quit (Quit: Leaving)
22:49:35FromDiscord<exelotl> :O
22:57:37disruptekthanks for the help, leorize.
22:58:01dadadawhich module do I need for these https://nim-lang.org/docs/stackframes.html =
22:58:01dadadastackframes won't import
22:58:01leorizenp :)
22:58:22leorizeit's an internal module
22:58:52leorizeah wait it's not
22:58:58leorizeimport 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:39dadadaleorize: procName doesn't provide any information about the arguments ... is there a simple way for that?
23:15:28leorizeget PFrame and you'll have the location
23:15:36leorizeregarding the arguments, no we don't store them
23:16:02*krux02 quit (Ping timeout: 260 seconds)
23:34:44dadadadoes nim store the sources with fully expanded macros somewhere or is it all happening in memory?
23:34:52dadadaby store I mean on disk
23:35:24dadadaleorize: ping, you seem to know a lot
23:35:43dadada:D thanks for the previous help, too, I'll try my best to give back to the community
23:37:25leorize[m]dadada: all in memory, unfortunately
23:37:36dadadadammit
23:37:55leorize[m]but if you're in a proc, macros.locals should give you a good view on what variables there are
23:38:18dadadaaha
23:38:51dadadayeah, that's pretty great, I want to see the actual code before it's compiled
23:39:05dadadanot the C code though
23:39:06dadada:D
23:39:26dadadaand I assume the C code is also all in memory?
23:39:37dadadamoment, that wouldn't jive with gcc?
23:40:00dadadaI guess you could pipe it into gc
23:40:00leorize[m]ah, it's not in macros, that's in system
23:40:16leorize[m]the C code is on disk
23:40:17leorize[m]in the nimcache
23:41:44dadadais there one C code file per nim module?
23:42:16leorize[m]yep
23:42:31dadadaokay, I think that's pretty neat
23:48:07dadadawhen is the nimcache cleared?
23:48:54*sc quit (Remote host closed the connection)
23:56:06*ftsf joined #nim
23:56:21dadadaleorize[m]: and do you know where is this usually stored on Linux?
23:57:20leorize[m]in the nimcache
23:57:30leorize[m]read the compiler docs for the location
23:58:02leorize[m]iirc there's a proc somewhere that gives you the cache location
23:58:09leorize[m]std/compilesettings comes to mind