<< 06-05-2020 >>

00:00:02FromDiscord<Rika> but im not sure of the `=destroy` one
00:02:03*brainproxy joined #nim
00:03:52zacharycarteryeah you can destroy things in Nim whenever you want by calling `=destroy`
00:04:02zacharycarterand you can defer it if you want to as well I'm pretty sure
00:04:10zacharycarterand you can write custom destructors
00:04:13zacharycarterso what's the beef?
00:04:34zacharycarterin all seriousness beef looks cool but way less mature than Nim
00:04:43zacharycarterand I don't like IDEs
00:04:50FromDiscord<Rika> Beef is a developing open source, statically-typed programming language, designed and developed by Brian Fiete (one of PopCap founders), whose syntax is mainly derived from C# programming language and targeted for high-performance execution.
00:04:52FromDiscord<Rika> 😛
00:05:42skrylar[m]the universe is trying to keep me honest tho :p any temptation i had for beef died with making several attempts to get it to work, and me not wanting to debug llvm dependencies
00:06:22*brainproxy quit (Ping timeout: 246 seconds)
00:08:01zacharycarterRed looks interesting
00:09:04zacharycarterbut no x86-64 support yet
00:09:57skrylar[m]i liked red until they became a buttcoin
00:14:32skrylar[m]weird. i tried hcr on windows again and in 0.20 it doesn't crash on aftercodereload, but it also doesn't work
00:14:47zacharycarterI wouldn't use hcr
00:14:58skrylar[m]or rather hasmodulechanged doesn't work, but aftercodereload does.
00:15:10zacharycarterif you want to hot reload - do what I did and use cr.h and look at frag
00:15:16zacharycarterall the code is there
00:16:02skrylar[m]no idea why devel crashes and 0.20 works except for `has_module_changed`
00:16:21FromDiscord<KingDarBoja> PopCap? Plants vs Zombies company right-?
00:16:29zacharycarterno idea
00:16:31skrylar[m]yes. successful casual games place
00:16:51skrylar[m]beef has a lot of weird memory stuff because memory fragmentation is a big deal for AAA-devs
00:16:58*brainproxy joined #nim
00:17:26zacharycarterwait - do they develop beef?
00:17:33skrylar[m]the ex-head dev does
00:17:36zacharycarterah
00:17:47*dadada quit (Ping timeout: 256 seconds)
00:17:51skrylar[m]i suspect thats also why append allocators exist
00:18:27zacharycartersome of these features just don't make sense to me
00:18:34skrylar[m]because they make an instance claim a variable size, and any beef object can be forced to the stack with `scope`
00:18:42zacharycarterlike leak detection in real time - there are already tools for this
00:19:01zacharycartercustom allocators w/ manual memory management I mean is that even something to brag about?
00:19:20skrylar[m]they are AAA devs. so, yes
00:19:33zacharycartermixing optimization levels is cool I guess but if you're debugging the app just make a debug build?
00:19:51skrylar[m]eh you'll understand someday i guess
00:20:08zacharycarterwhat will I understand?
00:21:13skrylar[m]AAA devs have more problems than indie devs on pc's do. they can't just tell people to buy more ram for their xbox. so stuff like memory fragmentation is a reality in their world
00:21:23skrylar[m]which is why custom allocators and arenas are a thing for them
00:21:34zacharycarterI wasn't talking about memory fragmentation
00:21:48zacharycarterI was talking about realitime leak detection and custom allocators - like you can do this with C/C++ already
00:21:51skrylar[m]mixed optim happens over there too :\
00:22:00zacharycarterwhich you also have to manually allocate memory for
00:22:18zacharycarterhell you can write custom allocators with Nim too
00:22:31skrylar[m]ey probably mentions it because so many new langs are GC, so he has to say "look, no GC"
00:22:38zacharycarterI guess
00:23:05skrylar[m]defer is nicec
00:24:42skrylar[m]he may do okay when they get the rough edges out of the tooling. i can see it being an easier sell to disgruntled unity users "hey its still C#, but it compiles." since a lot of people wanted ... C#, on bare metal
00:25:03zacharycarterwell they won't want to use it if they have to manually manage memory
00:25:19zacharycarterthey don't have to do that in C#
00:25:36skrylar[m]i dunno. gamedev tend to fight the gc anyway
00:26:00zacharycarteryeah but not unity users haha
00:26:01skrylar[m]ours with the incremental mode turned on is nice
00:27:08skrylar[m]haven't tested doing custom allocs in nim yet though. ex. the items that live in a custom allocator for a single frame part
00:27:35*dadada joined #nim
00:27:35skrylar[m]janet does have an API for this where you can ask for scratch space
00:27:58*dadada is now known as Guest42873
00:30:27zacharycarterI guess the difference is you won't be able to use the stdlib in Nim with custom allocators
00:30:32zacharycarterI don't know if that's the case with beef or not
00:31:11zacharycarterbut lots of people don't use C++'s stdlib
00:31:22zacharycarterso I think this is fine
00:31:58zacharycarterI like Nim's flexibility - if I want to use a custom allocator / manual memory management in certain situations I am free to do so
00:32:06zacharycarterand then in other areas of my program I can rely on the stdlib
00:32:10*covidian is now known as ii
00:32:11*ii is now known as covidian
00:32:18zacharycarterjust like I can in C++
00:32:27zacharycarterbut I have the benefit of ARC / the GC
00:32:37*brainproxy quit (Ping timeout: 246 seconds)
00:32:42skrylar[m]some of those get annoying when strings implicitly call stdlib stuff and you are trying to go gcless
00:32:48skrylar[m]D had this problem
00:33:06zacharycarterwrite your own string impl then
00:33:33skrylar[m]I'm sure someone did
00:33:43leorizeI'm pretty sure nim strings don't implicitly call anything
00:33:55leorizebut I'm not following the conversation so :P
00:34:07skrylar[m]string concat does iirc
00:34:36leorizeahhh you're talking about custom allocators
00:35:34zacharycarteryeah
00:35:50zacharycarterjust don't use any of Nim's memory management if you want to use custom allocators
00:35:55zacharycarterpretend Nim is C and you're fine
00:36:28skrylar[m]i do tend to separate the init from alloc for that reason but.. eh.
00:37:04leorizeit's not too hard to write your own string implementation either, now that we have enough type hooks for basically everything
00:37:20skrylar[m]nothing sells users on a toolchain like "write it yourself" ;)
00:38:01leorizespecialize use cases require specialize tooling :P
00:51:42*Guest42873 quit (Ping timeout: 260 seconds)
00:56:56*brainproxy joined #nim
00:57:26*dadada__ joined #nim
01:02:47*brainproxy quit (Ping timeout: 260 seconds)
01:06:28yumaikasQuestion: Is there a known way to make async/thread safe globals?
01:07:21yumaikas(I'd be fine with a mutex or the like, just wondering if there's a way to do that and convince the compiler it's safe)
01:11:51*brainproxy joined #nim
01:13:37zacharycarteryumaikas: do you mean the global is using GC'd memory?
01:14:12yumaikaszacharycarter: If there's a way to eval a function once, and then let the global be constant, that would work too
01:14:47yumaikas(Basically, a nim version of C#'s Lazy<T> would be ideal)
01:14:56zacharycarteryeah but is the global using GC'd memory or is the memory manually allocated / allocated on the stack?
01:15:26yumaikaszacharycarter: it'd be in global scope. I'm assuming that's GC'd?
01:15:27yumaikashttps://github.com/yumaikas/tabulaScripta/blob/master/webConfig.nim
01:15:29disruptek{.gcsafe.}
01:15:48yumaikasExample of things that I want to do, in some form
01:15:58yumaikas-----------------------------------------------------------^
01:16:22zacharycarterwhat type is the variable?
01:16:43yumaikasstring/int, in most cases
01:16:47zacharycarterint is fine
01:16:49zacharycarterstring is not
01:17:04zacharycarteryou could move the string to the thread but the original reference to the string would become unusable
01:17:08zacharycarterif you're using `--gc:arc`
01:17:36yumaikasI'm not planning on using arc, due to this being a webapp, where non-arc would probably be a better fit
01:18:04zacharycarterotherwise look at this issue" https://github.com/nim-lang/RFCs/issues/142
01:18:47*avatarfighter quit (Ping timeout: 240 seconds)
01:18:49*brainproxy quit (Ping timeout: 246 seconds)
01:21:27*dadada__ quit (Ping timeout: 260 seconds)
01:24:55*dadada__ joined #nim
01:30:35*covidian is now known as ii
01:30:36*ii is now known as covidian
01:30:39*ryan_ joined #nim
01:31:19yumaikasHrm....
01:31:38*yumaikas is trying to think of how that'd interact with a multithreaded jester impl
01:32:56*Tlongir quit (Ping timeout: 256 seconds)
01:33:58FromGitter<Willyboar> disruptek i am here if you need feedback for your game :P
01:34:32yumaikasdom96: Do you have any recommendations on how to handel global/config type things in jester?
01:34:44*chapl quit (Remote host closed the connection)
01:35:45FromDiscord<Zed> disruptek's making a game?? what sort?
01:36:02FromGitter<Willyboar> I dont know yet
01:36:18FromDiscord<Zed> lol
01:36:33FromGitter<Willyboar> maybe is a secret
01:38:11yumaikasdom96: Or do you just live with globals giving memory access warnings?
01:38:22*avatarfighter joined #nim
01:39:20*brainproxy joined #nim
01:40:34*avatarfighter quit (Client Quit)
01:40:41*avatarfighter joined #nim
01:41:14*ryan_ is now known as jiblet
01:41:18*jiblet is now known as tjiblet
01:45:52*chemist69 quit (Ping timeout: 265 seconds)
01:47:37*chemist69 joined #nim
01:47:46*Hideki joined #nim
01:48:09*Hideki is now known as Guest45730
02:10:48*mono joined #nim
02:13:10*monokrom quit (Ping timeout: 256 seconds)
02:21:47*muffindrake quit (Ping timeout: 240 seconds)
02:23:51*NimBot joined #nim
02:24:18*mono quit (Remote host closed the connection)
02:24:22*muffindrake joined #nim
02:33:49zacharycarteryumikas: jester uses httpbeast which relies on multiple threads - maybe look into its implementation
02:34:17zacharycarterultimately if memory is accessed by threads and it's allocated on the heap, it's access needs to be synchronized
02:34:41zacharycarterand remember Nim's default GC uses a thread local heap so threads can't access eachother's heap
02:35:03zacharycarterso you need to either pass pointers and ensure lifetimes of allocations or you need to use channels
02:35:18zacharycarteror you can manually manage memory and allocated from the shared heap
02:35:43zacharycarteror use `--gc:arc` / `--gc:orc` which will eventually become the default memory management solution for Nim
02:37:05zacharycarteryumaikas ^ sorry I misspelled your handle
02:49:25*Guest45730 quit (Ping timeout: 264 seconds)
02:50:39*dadada__ quit (Ping timeout: 256 seconds)
02:53:00*dadada joined #nim
02:53:23*dadada is now known as Guest69279
02:57:07skrylar[m]huh. well a logfmt module went a lot faster than i thought
03:05:17*rockcavera quit (Remote host closed the connection)
03:06:58*zacharyc1rter quit (Ping timeout: 246 seconds)
03:06:59*zacharycarter quit (Ping timeout: 246 seconds)
03:10:32*brainproxy quit (Ping timeout: 260 seconds)
03:13:25skrylar[m]i suppose telemtry would be the same as defer ... macro to bolt on to functions or blocks, have it just write the enter/exit calls
03:16:07*Hideki joined #nim
03:16:31*Hideki is now known as Guest31078
03:16:52*Guest69279 quit (Ping timeout: 256 seconds)
03:24:39disrupteki hate defer.
03:25:14FromDiscord<Rika> why?
03:25:41disruptek!rfc try scope author:disruptek
03:25:42disbothttps://github.com/nim-lang/RFCs/issues/218 -- 3try/except scope -- should it be a thing?
03:27:33*dadada__ joined #nim
03:35:16*brainproxy joined #nim
03:46:15*zacharyc1rter joined #nim
03:46:16*zacharycarter joined #nim
03:50:07*avatarfighter quit (Ping timeout: 244 seconds)
03:50:42*dadada__ quit (Ping timeout: 256 seconds)
03:52:14*dddddd quit (Remote host closed the connection)
03:54:49*thomasross quit (Ping timeout: 264 seconds)
03:57:30*dadada joined #nim
03:57:53*dadada is now known as Guest99744
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:17*tjiblet is now known as tjiblet_thebless
04:06:41*supakeen joined #nim
04:06:49shashlick@leorize took your advice on the ABI issue, see my last comment
04:10:40*zacharycarter quit (Ping timeout: 246 seconds)
04:11:01*zacharyc1rter quit (Ping timeout: 246 seconds)
04:12:25*Guest31078 quit (Remote host closed the connection)
04:14:11*Hideki joined #nim
04:14:35*Hideki is now known as Guest3009
04:17:59*narimiran joined #nim
04:18:49*Guest3009 quit (Ping timeout: 264 seconds)
04:21:10*Guest99744 quit (Ping timeout: 246 seconds)
04:21:19*avatarfighter joined #nim
04:25:07YardanicoGuess it was easier than I expected (compiling Nim for KolibriOS) https://i.imgur.com/IiJUw2G.png
04:25:10Yardanicoos:any ftw
04:25:52Yardaniconow need to port the simplest GUI example from C to Nim :P
04:25:54*avatarfighter quit (Remote host closed the connection)
04:26:01*avatarfighter joined #nim
04:27:33*dadada__ joined #nim
04:28:49Yardanicooh, I don't even have to use makefiles now, can do it fully with nim.cfg
04:35:45*waleee-cl quit (Quit: Connection closed for inactivity)
04:36:53Yardanicohttps://i.imgur.com/6BVHzyN.png
04:36:55Yardanicohttps://i.imgur.com/nLI6wYh.png
04:37:15Yardanicoalthough I still need to do "objdump hello -O binary" manually after that
04:40:46FromDiscord<Avahe> @Elegant Beef So I accidentally fixed an issue with maim which I thought had to do with xatoms, but didn't. What application were you using to test fullscreen requests?
04:41:48*Hideki joined #nim
04:42:11*Hideki is now known as Guest96857
04:48:32FromDiscord<Never Listen To Beef> Firefox/chrome
04:50:25PrestigeCool, thanks
04:51:49*dadada__ quit (Ping timeout: 264 seconds)
04:57:30*dadada joined #nim
04:57:54*dadada is now known as Guest74398
04:58:06*Guest96857 quit (Remote host closed the connection)
05:08:25Yardaniconew day, new bug reports :P https://github.com/nim-lang/Nim/issues/14240
05:08:28disbot[ARC] C compiler error with dynlib pragma calling a proc ; snippet at 12https://play.nim-lang.org/#ix=2kY9
05:21:23*Guest74398 quit (Ping timeout: 256 seconds)
05:27:29*dadada__ joined #nim
05:44:40*hoijui joined #nim
05:53:31Prestige@Elegant Beef got it working for a couple browsers but firefox seems to be doing something different with atoms
05:55:34*Hideki joined #nim
05:55:58*Hideki is now known as Guest73608
06:04:08FromDiscord<Never Listen To Beef> Interesting
06:04:14FromDiscord<Never Listen To Beef> I dont get a fullscreen property
06:04:20FromDiscord<Never Listen To Beef> So i guess i do something wrong
06:07:54dadada__can I get a value from every proc/func/expr, even if the expression doesn't return something, ie. void type, pseudo code: let valOrVoid = funcReturnsValOrVoid()
06:08:12Yardanico"let valOrVoid" there's your problem
06:08:18Yardanicovariables can only have one type ;)
06:08:23Yardanicounless you're in a generic proc of course
06:08:25Yardanicoor something like that
06:09:32dadada__I know, I'm looking for a workaround, doesn't need to be beautiful
06:09:45Yardanicowell I don't understand on what do you need it for :P
06:13:18*Guest73608 quit (Remote host closed the connection)
06:13:32dadada__probably can use https://nim-lang.org/docs/system.html#compiles%2Cuntyped
06:13:35dadada__to make the workaround
06:13:45Yardanicowell yeah but the variable still only can have one type in most contexts
06:13:49Prestige@Elegant Beef still need to figure out why ff is sending different atoms.. vivaldi is sending the correct atoms but it doesn't seem to launch properly at all (invisible ui and errors in the console)
06:14:06YardanicoI would've recommended compiles if you explained better :P
06:14:07PrestigeI'll link my current branch when I push so you can see what I did
06:14:08FromDiscord<Never Listen To Beef> Yea idk im putting my wm on brak for a bit
06:14:14FromDiscord<Never Listen To Beef> break*
06:14:19PrestigeOh ok
06:14:43FromDiscord<Never Listen To Beef> I've got issues with gnome software
06:14:46FromDiscord<Never Listen To Beef> well GTK stuff
06:15:13FromDiscord<Never Listen To Beef> Also im glad math contains Tau
06:15:17FromDiscord<Never Listen To Beef> Im happy for tau
06:16:14PrestigeTau?
06:16:17Yardanicoyeah and my mathexpr lib uses and exposes it to the user :P https://github.com/Yardanico/nim-mathexpr/blob/master/src/mathexpr.nim#L230
06:16:27FromDiscord<Never Listen To Beef> Yea tau is the best circle constant
06:16:40YardanicoPrestige: https://en.wikipedia.org/wiki/Turn_(angle)#Tau_proposals
06:18:26FromDiscord<Rika> wow. that sucks, i always did think tau was more intuitive than pi
06:18:30FromDiscord<Rika> when it came to circles
06:18:37PrestigeOh, neat
06:19:09*solitudesf joined #nim
06:22:46FromDiscord<Never Listen To Beef> Yea tau is, considering it's a direct degrees/360 to get it to a tau ration
06:22:56FromDiscord<Never Listen To Beef> ratio*
06:23:17FromDiscord<Rika> ayy, client.py of slider (an osu (the game) utility library) has been fully translated now
06:23:17FromDiscord<Rika> https://cdn.discordapp.com/attachments/371759389889003532/707477569695645716/unknown.png
06:23:24*PMunch joined #nim
06:24:05Prestige@Elegant Beef if you're interested anyway: https://github.com/avahe-kellenberger/nimdow/commit/1a9cfd1cc8c2b818a7812cade141dc8735ccffab
06:25:32FromDiscord<Never Listen To Beef> So wait you get proper fullscreen properties inside the property change event?
06:26:12PrestigeThat's the next step I suppose, atm I'm just listening for ClientMessages
06:26:26FromDiscord<Never Listen To Beef> Oh
06:26:28FromDiscord<Never Listen To Beef> That's a thing?!
06:26:39PrestigeRead this: https://github.com/avahe-kellenberger/nimdow/issues/12 I made a summary
06:26:40disbotFullscreen windows are not respected
06:27:24FromDiscord<Never Listen To Beef> I dont get why we have client messages and property changes
06:27:44PrestigeIdk but it's probably one of the reasons Wayland exists lol
06:27:48FromDiscord<Never Listen To Beef> Lol
06:29:52voltistAnybody got any idea why `1/(1-exp(-(V-v2)/ka))` would give drastically different results to equation 4 in https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0218738&type=printable
06:30:33FromDiscord<Rika> what page is equation 4
06:30:36PrestigeCan you put it on play.nim-lang.org for us lazy folk?
06:30:41FromDiscord<Rika> 5?
06:30:58voltistCould it be that I have to write those ones as 1.0 to make the nim get it?
06:31:08voltistYeah I'll put a sample up
06:31:13voltistIt's on page 5
06:31:14FromDiscord<Rika> no, / is float div
06:31:32*brainproxy quit (Ping timeout: 272 seconds)
06:31:50FromDiscord<Rika> it should be the same, what are you getting from eq.4
06:32:03narimiranvoltist: put in the comments what do you get from a calculator, so we can see the difference
06:33:07voltistI'll have to look through the paper to find one of the points the equation was fitted to in order to do a proper comparison
06:33:24voltistBecause the nim playground won't do graphs
06:36:41FromDiscord<Rika> afaik nim playground has popular packages installed
06:37:22Yardanicowell not a lot
06:43:41voltisthttps://play.nim-lang.org/#ix=2gcb
06:43:53voltistDoes that work? I've never used nim playground before
06:44:12Yardanicotry to patse again
06:44:15Yardanicoit seems to be the wrong link
06:44:30Yardanicohttp://ix.io/2gcb is not nim :D
06:44:32voltistNo it's right
06:44:41narimirancopy-paste in your own browser before pasting a link here ;)
06:44:41Yardanico?
06:44:58voltisthttps://play.nim-lang.org/#ix=2kYw
06:45:05voltistThat should work
06:45:05*Hideki joined #nim
06:45:19narimiranyeah, that one is better :)
06:45:42*Hideki is now known as Guest16626
06:45:54voltistThis could just be a case of me missreading and typing it in wrong, but I haven't been able to find any mistakes yet
06:46:24*Guest16626 quit (Remote host closed the connection)
06:46:47narimiranmy calculator gives the same value as nim
06:47:15voltistWeird
06:47:53narimiranfor first case
06:49:08narimiranfor the second one i get waaaay different result
06:49:24Yardanicobecause it should be + and not
06:49:24narimiranoh no wait
06:49:25Yardanico-
06:49:33narimiranno, my parentheses were wrong
06:49:37Yardanicoah wait nvm
06:49:42narimiranthe same result in both cases
06:50:08narimiranvoltist: are you sure that your article didn't use lower-precision floats so the article is wrong(er)?
06:50:30voltistI doubt it
06:50:46voltistMore likely they just haven't labelled things right
06:52:41voltistI'm comparing it to the red line (m subscript infinity) on the top left chart on here: https://ndownloader.figshare.com/files/15665561/preview/15665561/preview.jpg
06:59:29*sagax joined #nim
07:01:06PMunchWhere do you get ka and vh from?
07:01:17*brainproxy joined #nim
07:03:43*idf joined #nim
07:04:14voltisthttps://journals.plos.org/plosone/article?id=10.1371/journal.pone.0218738 -> supplementary information -> second document
07:05:54voltistTop section
07:06:04voltistFirst section*
07:06:06voltistSHL1
07:06:28voltistThe figure I get is pretty whacky: https://liamsc.com/figure.png
07:07:35PMunchAren't their voltages measured in mV though?
07:07:47PMunchAccording to the label on the graph
07:08:31voltistYep
07:08:53voltistBut I'm working entirely in mV so it shouldn't matter
07:09:19*Vladar joined #nim
07:10:17*chemist69 quit (Ping timeout: 260 seconds)
07:10:47*chemist69 joined #nim
07:10:54PMunchI still don't see where you get ka and vh from..
07:12:07voltistka is k subscript a
07:12:18PMunchAh, nvh found the document you were talking about
07:12:26voltistAnd VH is "V subscript 0.5"
07:12:28voltistYeah
07:15:27PMunchWhat is vh.. It's given as 11.2 (-6.8) which is weird..
07:15:32*jwm224 quit (Ping timeout: 260 seconds)
07:17:19*jwm224 joined #nim
07:22:40voltistThats the variation I cover in the snippet on nim playground
07:22:55voltistEither way, it produces weird results
07:23:37PMunchYes, I can't get it to give anything close to that table..
07:23:59FromDiscord<Rika> is that calculated or empirical :thonk:
07:24:57voltistWhat could be calculated or empirical?
07:26:07FromDiscord<Rika> no clue, its been a few weeks since ive read a published work
07:36:09voltistYeah this is really weird
07:36:15*hoijui quit (Ping timeout: 256 seconds)
07:36:40voltistIt seems the equation and parameters they gave don't at all describe what they show
07:44:06*Hideki joined #nim
07:44:30*Hideki is now known as Guest53364
07:45:09dadada__is there any standard way to catch stuff that is going to stdout in a variable instead
07:45:18dadada__like a macro stdoutTo var:
07:45:49dadada__writing unit tests currently, and it could be useful there
07:46:35*Guest53364 quit (Remote host closed the connection)
07:49:35FromGitter<Vindaar> @voltist: it really doesn't make any sense. It can't be `1 / (1 - e^-x)`, because that as a singularity at 0, which their function obviously doesn't have. I'd be pretty surprised if they had such a typo in it, but the function they plot is `1 / (1 + e^-x)`(in contrast to h_inf which is `1 / (1 + e^x)`).
07:50:35FromGitter<Vindaar> but maybe I'm just still too tired and can't think properly... :)
07:50:59FromDiscord<Yardanico> @dadada__ I don't think so, although I guess you could shadow echo and/or `stdout` in your macro/template
07:52:34voltist@Vindaar It is very weird
07:58:09FromGitter<Vindaar> in addition they talk about "boltzmann-like functions". To be honest, I don't know the term boltzmann function for something like this. But googling brings up a boltzmann sigmoid: https://www.graphpad.com/guides/prism/7/curve-fitting/reg_classic_boltzmann.htm and that's also what I said above
07:59:50voltistSo you think they accidentally swapped one of the symbols around?
08:00:06FromGitter<eagledot> Could somebody be please able to look at this .
08:00:07voltistAlso thanks for the link
08:00:18FromGitter<eagledot> https://play.nim-lang.org/#ix=2kYM
08:01:46FromGitter<eagledot> It is crashing with default gc used and giving different results with arc.Only works everytime if i donot use any gc. ⏎ I posted this yesterday also.I am stuck on this donot know what am i doing wrong or is it NIM bug.
08:01:55FromGitter<Vindaar> @voltist: I have no idea. I've seen all sorts of craziness in papers, but something so obvious in so many different places seems fishy. I'd have to properly read what they're writing. Can take a look later. Gotta be in a meeting now
08:03:07voltist@Vindaar Ok, cya round
08:03:57*avatarfighter quit (Ping timeout: 260 seconds)
08:06:32*fredrikhr joined #nim
08:30:39*ftsf quit (Ping timeout: 256 seconds)
08:31:27*D_ quit (Ping timeout: 240 seconds)
08:35:02*D_ joined #nim
08:44:37*Hideki joined #nim
08:45:02*Hideki is now known as Guest82747
08:48:45voltist@Vindaar Hmmm, putting their values into that general Boltzmann sigmoid doesn't work either. Unfortunately they haven't published the code for their simulation, so we can't check that
08:54:42FromGitter<Vindaar> this is what I get for different ka:
08:54:44FromGitter<Vindaar> (https://files.gitter.im/nim-lang/Nim/3JOq/activation.png)
08:55:15FromGitter<Vindaar> V_h is just the position at which m_inf = 0.5
08:55:58PMunch@eagledot, where does it crash?
08:56:05PMunchDo you get any stack trace?
08:56:52PMunchCan you share the test4.wav file so we can try the code?
08:56:57PMunchIs this a minimal sample?
08:57:08voltist@Vindaar That seems reasonable
08:58:14voltistAs you say, the consistently contradictory equation in the paper is strange
08:58:49FromGitter<Vindaar> @voltist: code I used: https://play.nim-lang.org/#ix=2kYZ
08:59:15*Guest82747 quit (Ping timeout: 260 seconds)
09:01:12FromGitter<Vindaar> would be interesting to extract data points from the plot they show, fit this function and see what the resulting fit parameters would be for vh, ka
09:01:34voltistYeah
09:02:32FromGitter<eagledot> it just says out of memory with default
09:02:44FromGitter<eagledot> https://gitlab.com/eagledot/webrtcvad-nim ⏎ Everything is in there
09:03:29voltistI might contact the authors and inquire about the apparent mistake
09:03:40voltistOnce I'm sure that we aren't just missing something
09:03:42*krux02 joined #nim
09:04:51dom96yumaikas, yeah, global with threadvar if you want to use threads
09:05:28*hoijui joined #nim
09:06:15PMunchNot sure how the Nim GC handles stuff like this: https://gitlab.com/eagledot/webrtcvad-nim/-/blob/master/webrtcvad_nim.nim#L100
09:07:27FromGitter<eagledot> what do you mean?? ⏎ How should i change it??
09:07:50PMunchAnd does new even work with regular object types? I thought that was supposed to only work for ref types..
09:08:24Yardanico!eval type A = object; echo typeof(new(A))
09:08:25FromDiscord<Recruit_main707> it doesnt, does it?
09:08:27NimBotref A
09:08:34Yardanicoit creates a reference to an object
09:08:54PMunchHuh, so it creates it on the heap and gives you a reference when you do that?
09:08:56PMunchDidn't know
09:09:05Yardaniconeither did I, but I really don't use new()
09:09:19PMunchBut what he does, casts it to a ptr and returns that ptr, that doesn't work right?
09:09:29Yardanicoyeah I don't think that it's correct
09:09:33PMunchOr it works, but it would trip up the GC
09:09:46voltist@Vindaar It's also strange that the V0.5 of their plots seems very different from their parameters
09:09:48Yardanicoright now I'm trying to hack the copied jsgen backend to output processed nim AST as Nim code :P
09:10:08FromDiscord<Recruit_main707> !eval type A = object; var a: A = A(); echo(typeof(a))
09:10:11NimBotA
09:10:15Yardanicoyeah that's not a reference
09:10:21PMuncheagledot, basically what you want to do is to return simply a vadObj or a ref vadObj and then use .addr to get a pointer that you can pass to the C stuff
09:10:21FromDiscord<Recruit_main707> i know :p
09:11:04PMunch(And may I suggest reading the NEP1? This code is a bid hard to read)
09:12:40FromGitter<eagledot> Ok:) ⏎ Will try that. ⏎ I am a newbie just trying to make it work:)
09:17:22FromGitter<eagledot> Can u confirm that was the only error.Could u run it?
09:17:33PMunchSorry, I haven't tried it
09:21:48PMunchOkay, did the changes and tested it. Seems to run, but not sure if it does what it is supposed to do :P
09:23:07*covidian is now known as ii
09:23:08*ii is now known as covidian
09:24:17PMuncheagledot: http://ix.io/2kZ9
09:26:10FromGitter<eagledot> I think it is working:) ⏎ was Stuck on it for two days. ⏎ Seems like `new ` was not a great idea?
09:27:44PMunchWell, the problem here is that you create a garbage collected object (new(vadObj)) then just get a pointer to that and leave the reference behind. So the garbage collector comes around, sees that no-one is referring to the object, and cleans it up.
09:27:46PMunchMore or less
09:30:07FromGitter<eagledot> I get it...but i think i tried first using reference as a pointer on a sample code .Seemed to work that's why i used ,didnot know it would trip the gc so bad!!
09:31:02dadada__Error: unhandled exception: sempass2.nim(396, 19) `b[j].kind == nkType` [AssertionError]
09:31:10dadada__potential compiler bug`
09:31:11dadada__?
09:31:30dom96any assertion failure in the compiler is a bug
09:31:48FromGitter<eagledot> But i understand now that i returned only the pointer disturbing the normal way.
09:33:25PMuncheagledot, the reference object isn't really the issue: http://ix.io/2kZc
09:33:30PMunchAs you can see that also works fine
09:33:53PMunchBut just discarding the reference object in favour of a ptr to the object doesn't work
09:33:59PMunchBecause Nim now thinks you're not using it
09:34:06*Trustable joined #nim
09:34:06FromDiscord<Recruit_main707> dadada: i think its not, i remember something about this, i feel its how macros should work, but its not, this is how i do it: https://play.nim-lang.org/#ix=2kZd maybe its the same case as yours
09:34:52Yardanicomodifying the AST in macros usually is not good
09:35:02Yardanicoit's much better/safer to create new AST nodes in macros and returns these instead
09:35:13Yardanicoi mean modifying the AST you got as arguments
09:35:14FromGitter<eagledot> Yes i understand more clearly now. Thanks:)
09:35:23dadada__Recruit_main707: did you really mean me?
09:36:02PMunchYou could also use the system/ansi_c module to use malloc directly, and then free it yourself manually later on. But of course then you're back to C style manual memory management
09:37:09FromGitter<eagledot> Yes I used malloc when i couldnot figure out. ⏎ If i create something in a function and doesnot return it then it means gc can collect that ?
09:37:15FromDiscord<Recruit_main707> yes, node kinds sometimes dont match ehst you would intuitively think
09:37:29PMuncheagledot, yes
09:39:00PMunchOf course if they are created on the stack they will be automatically cleaned up when the stack frame pops. If they are on the heap then the references will go out of scope when the stack frame pops and the GC will be able to free them.
09:39:14PMunchThis might help a bit: https://peterme.net/nim-types-originally-a-reddit-reply.html
09:39:26*covidian left #nim ("don’t bother even trying")
09:42:41FromGitter<eagledot> OK.Yes. ⏎ I saw your talk . ⏎ Then read it. ⏎ I understand a quite bit about stacks and heaps...but i this case i was in doubt that gc will not free this and takes care even if i am casting..Well i was wrong:) [https://gitter.im/nim-lang/Nim?at=5eb28690f0377f16316d6a8b]
09:44:01FromGitter<eagledot> I was hoping more from the talks for running nim from microcontrollers and IOt..but nonetheless enjoyed it.
09:44:25FromGitter<eagledot> on*
09:45:38PMunchI want to do more on the topic
09:45:54PMunchBut it's a bit limited how much fun you can go through during a 20 minute talk
09:47:26FromGitter<eagledot> Well,if you have more resources for running nim on microcontrollers or can let me know if develop more on this topic.Please let me know. ⏎ I found nim quite fascinating after knowing enough python and C.
09:51:56PMunchNot so much in terms of resources unfortunately..
09:52:03*mjsir911 quit (Remote host closed the connection)
09:52:15PMunchBut that's just because I haven't found the time to write all of it down yet :P
09:52:20*mjsir911 joined #nim
09:57:32*Hideki joined #nim
09:57:54*Hideki is now known as Guest99522
10:03:28FromDiscord<EdgyNerd> what's the best garbage collector if I want more performance and don't really care about memory usage (as long as there isn't any leaks)?
10:03:37FromDiscord<Recruit_main707> arc
10:03:46FromDiscord<Recruit_main707> if you use async, orc
10:03:50Yardanicoif you don't have cycles, compare default vs arc
10:03:55Yardanicoif you do, default (refc) vs orc
10:04:11Yardanicoarc is still sometimes slower than the default GC, but it's really better since it's deterministic
10:05:46PMunchEdgyNerd, the one that performs best when you benchmark you code
10:06:15FromDiscord<clyybber> @EdgyNerd memory regions :p
10:06:28FromDiscord<clyybber> Or essentially, arc but use your own refs
10:07:21FromDiscord<clyybber> If you don't care about memory usage, you can do arena allocation
10:07:38FromDiscord<clyybber> Useful for games
10:08:03FromDiscord<clyybber> Since you can just do whatever you want in a frame/tick and only free at the end of the frame/tick
10:09:30FromDiscord<clyybber> If you simply use objects more and have an updateTick proc, then stack allocation will do fine
10:09:58FromDiscord<clyybber> arena allocation is a bit like stack allocation but independent from the stack
10:10:19FromDiscord<clyybber> But you don't need to care about all this, just use arc or boehm or the default gc :)
10:13:34FromDiscord<EdgyNerd> just tested them all, they're all basically the same (within 0.08 seconds)
10:13:45FromDiscord<clyybber> \o/
10:13:47FromDiscord<EdgyNerd> apart from boehm which is 0.1 seconds slower
10:13:48dom96clyybber: what guarantee do you have that the `free` won't take too long? :P
10:13:59dom96what you really want is Nim's amazing soft real-time GC
10:14:47Yardanico@EdgyNerd can you try with -d:boehmNoIntPtr just for fun?
10:14:52FromDiscord<clyybber> dom96: I don't have any, but a single free at the end of the frame is simpler than a full blown GC
10:15:10*brainproxy quit (Ping timeout: 260 seconds)
10:15:18FromDiscord<clyybber> And if you use a simple bump allocator
10:15:21dom96clyybber: it'll never be a single free though, you'll always have many different objects to free
10:15:38FromDiscord<clyybber> dom96: If you use a bump allocator then its a single free
10:15:48FromDiscord<clyybber> You would free all at once
10:15:57*liblq-dev joined #nim
10:16:07liblq-devdoes Nim have any limit on a proc's parameter count?
10:16:09dom96cool, can we implement that in Nim?
10:16:21FromDiscord<clyybber> dom96: Sure
10:16:30FromDiscord<EdgyNerd> -d:boehmNoIntPtr is 1.5 seconds slower
10:16:37FromDiscord<EdgyNerd> @ Yardanico
10:16:40Yardanicoah ok
10:17:29Yardanicoliblq-dev: lemme try :P
10:17:38PMunchliblq-dev, good question. I guess it might depend on the OS?
10:17:39FromDiscord<mratsim> @EdgyNerd performance depends on the application, if you optimize for throughput it's Boehm or markandsweep, if you optimize for latency it's the default GC
10:18:14liblq-devlike, the largest amount of params I ever had was 15 which is not that much considering it's really just a constructor
10:18:19FromDiscord<clyybber> dom96: Actually its pretty much already there: https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim
10:18:26FromDiscord<mratsim> if you now the max memory reserved, just use an Arena
10:18:51dom96clyybbeer: ahh yes, I remember that. There was an idea that Araq had to free memory after every request for http servers
10:18:53dom96which could work
10:18:54FromDiscord<Recruit_main707> why do slices use gced memory?
10:19:13FromDiscord<mratsim> they own their memory
10:19:24FromDiscord<mratsim> use `toOpenArray` instead (yeah it sucks)
10:19:43FromDiscord<clyybber> dom96: Yeah, nowadays it is possible to implement it via =destroy hooks in arc
10:19:57FromDiscord<mratsim> but there are comment in multiple RFCs related to openarray as value types to change slicing to return openarray instead of seq
10:20:32FromDiscord<Recruit_main707> isnt toOpenArray slow?
10:20:49FromDiscord<clyybber> no
10:20:53dom96mratsim: is zah on holiday? Haven't been able to get in touch with him over gitter
10:21:06FromDiscord<clyybber> dom96: Try telegram
10:21:18FromDiscord<clyybber> he was active yesterday I think
10:21:25FromDiscord<EdgyNerd> also, --gc:regions is 4.5x slower for some reason
10:21:44dom96clyybber: don't know his username
10:21:47FromDiscord<mratsim> toOpenArray is basically moving a pointer + length
10:22:03FromDiscord<mratsim> He is on the Nim FOSDEM groups 😉
10:22:27FromDiscord<clyybber> dom96: I'll ping you on telegram
10:24:58Yardanicoliblq-dev: doesn't seem so
10:25:32Yardanicowell it depends on the C compiler too
10:25:48Yardanicoby the C standard the C compiler should allow for at least 256 arguments iirc
10:25:59Yardanicohttps://i.imgur.com/99lTPRt.png
10:26:05*Guest99522 quit (Remote host closed the connection)
10:26:09PMunchdom96, he was here yesterday according to the IRC logs
10:26:23PMunchOh wait
10:26:27PMunchNot zah..
10:27:03Yardanicothe compiled C file loogs amazing
10:27:05Yardanicolooks* https://gist.github.com/Yardanico/1147d47c20d9c47a9df170d5e0c81c70
10:27:15FromDiscord<mratsim> 256 arguments seem ... excessive ...
10:27:18FromDiscord<clyybber> liblq-dev: Why though?
10:27:35liblq-devidk, I was asking out of curiosity
10:27:44Yardanicolemme try to add the 4th letter
10:27:44PMunchHaha, that looks amazing
10:27:56PMunchImagine finding that in some project
10:28:16Yardaniconim https://gist.github.com/Yardanico/6adb800ca7419a7351ef4fe7ab6e39d4
10:28:29Yardanicopoor github gave up on trying to highlight the first line
10:29:36YardanicoI think I went a little overboard
10:29:44Yardanicothe nim source file is 724kb
10:29:58Yardanicolet's see if the compiler crashes or not
10:30:27Yardanicovscode kinda gives up
10:30:54Yardanicooh right nim compiler gave up too, it doesn't show the colon number anymore
10:31:04Yardanicobut it still reports if there are keywords, let's see if I can fix them all
10:31:49Yardanicopoor poor vscode
10:31:50*dddddd joined #nim
10:31:57Yardanicovscode froze, nice
10:32:13FromDiscord<kodkuce> hmm i wish micro head plugin for nim 😦
10:32:25PMunchHaha, what script are you using to generate these Yardanico?
10:32:36FromDiscord<Recruit_main707> can we use nim slp w/ visual studio??
10:32:43FromDiscord<Recruit_main707> lsp*
10:32:49PMunchWhy not?
10:33:02FromDiscord<Recruit_main707> its just that i dont know how it works :p
10:34:02FromDiscord<Recruit_main707> no highlight though 🤔
10:35:55YardanicoPMunch: it actually worked 0_0
10:36:03PMunchWhat?
10:36:05Yardanicoboth nim compiler and C compiler somehow compiled it
10:36:10Yardanicolemme count number of arguments
10:36:13PMunchWith all four letter combinations?
10:36:21Yardaniconot all
10:36:28PMunchI guess the answer is "don't worry about it"
10:36:48Yardanico123 thousand
10:36:50YardanicoXDDDDDDD
10:37:06Yardanicoand nim compiler actually handles that perfectly fne
10:37:24Yardanicolemme try exportc
10:37:43Yardanicostill works
10:38:06FromDiscord<Recruit_main707> can you use them though
10:38:21Yardanicoyes
10:38:25FromDiscord<Recruit_main707> nim op
10:38:28YardanicoI'm using the random argument and returning it
10:38:58FromDiscord<Recruit_main707> finally all the people that need to pass 123 thousand arguments to their functions can code
10:39:27PMunchHaha :P
10:39:33PMunchOkay that is pretty amazing
10:39:38PMunchDo you have your script?
10:39:45PMunchI want to try 5 letters
10:40:32Yardanicoyeah I'll improve it a bit and share
10:41:02Yardanicobut it's inefficient anyway
10:46:08PMunch5 letters, the nim source file comes out to 102M
10:46:19PMunchCompiling..
10:46:35YardanicoPMunch: https://play.nim-lang.org/#ix=2kZu
10:46:46Yardanicoseems like collect + newSeqOfCap made it much faster
10:47:19YardanicoI only use lowercase because case insensitivity ;)
10:47:40PMunchWell look at you Mr. fancypants :P
10:47:50YardanicoI get 80mb with all lowercase for 5 letters
10:47:53Yardanicotrying to compile
10:47:59PMunchThis is the script I'm using: http://ix.io/2kZv
10:48:04Yardaniconim compiler uses 900mb ram
10:48:12Yardanico1gb
10:48:18Yardanicoits still growing XD
10:48:43Yardanico1.2gb
10:48:54YardanicoI think at this point the C compiler may fail
10:49:11PMunch1882Mb here atm
10:49:26Yardanico1.4gb
10:49:37PMunch2Gb
10:49:42Yardanicolol
10:49:52PMunchI'm going to run out of RAM at this rate..
10:50:01*brainproxy joined #nim
10:50:06YardanicoI have plenty of ram left :P
10:50:18PMunchThis poor machine only have 8Gb
10:50:23PMunchBut I've got 8 more in the mail
10:50:28Yardaniconice
10:50:46Yardanico1.6gb, seems to grow slow
10:50:57PMunchYeah..
10:51:04PMunchMine is at 2.3Gb now
10:51:28YardanicoI couldn't find info on most allowed number of arguments in GCC
10:51:47PMunch2.4Gb
10:51:49narimirani have no idea what two of you are doing, but it seems like you're having a blast :)
10:52:05PMunchHaha, we're trying to see how many arguments you can have in a Nim procedure
10:52:10Yardaniconarimiran: compiling a 80mb nim file with a single proc which has A LOT of arguments
10:52:19narimiran:D
10:52:21Yardanicoyeah my compiler at 1.9gb now
10:52:21PMunchCurrently trying all five letter (lowercase) combinations of arguments
10:52:28PMunchMine is 102M
10:52:38PMunchI wonder why mine is so much bigger..
10:52:48PMunchDo you not have spaces between your commas?
10:52:56YardanicoI have spaces
10:52:58PMunch2.7Gb here
10:53:01Yardanicodata.join(", ")
10:53:02FromDiscord<kodkuce> lol
10:53:31Yardanicowell nim compiler seems flexlible enough
10:53:37YardanicoPMunch: but did you account for keywords?
10:53:40Yardanico:D
10:53:45PMunchNah, I put them all in ``
10:53:49Yardanicoah lol
10:53:50Yardanicothat's smart
10:53:52PMunch;)
10:54:00*PMunch taps forehead
10:54:02Yardanicobtw https://github.com/nim-lang/Nim/pull/14241
10:54:03disbotmake `from` an operator
10:54:09PMunchOr temple rather..
10:54:39PMunchCan't open that until I'm done
10:54:43Yardanicoxd
10:54:48PMunchMy browser has a few too many tabs open
10:54:49Yardanico2.2gb ram now
10:55:01PMunchCurrently at 3Gb
10:55:05Yardanicowtf
10:55:14Yardanicowill it ever end
10:55:22PMunchWho knows
10:55:33PMunchI wonder how far along it is
10:56:55PMunchbrb
10:58:00Yardanicowell it takes 7 secs to compile (including the C step) a 3.5mb file
10:59:13dom96hehe, I tried to obfuscate Nim's C code using my obfuscator and it crashed
11:01:50*lritter joined #nim
11:02:18FromDiscord<Recruit_main707> its already pretty obfuscated
11:02:21FromDiscord<Recruit_main707> :P
11:04:12Yardanicowell not really
11:04:19Yardanicoif you compile --gc:arc -d:danger it'll be pretty clean
11:04:27PMunchDamn it..
11:05:31Yardanicohttps://github.com/nim-lang/Nim/commit/b8e6ea7547344389b5e45c3af249fee9642f028e nice
11:05:44Yardanicobit slices
11:06:08PMunchWhen I generated the file I ran it with `nim c -r test > outp.nim`
11:06:16YardanicoPMunch: yeah I did that at first too
11:06:34PMunchAnd Nim sometimes outputs the CC: test.nim line into the file when you do that..
11:06:38PMunchNot always, but sometimes
11:06:45Yardanicohahaha I understand
11:06:49PMunchBut it had in this case, and it crashed..
11:06:53Yardanicorip
11:07:20Yardanicomy PC crashed because I launched the second one with 20mb nim file but for some reason my RAM usage spiked to 100% and OOM doesn't work well on Linux :P
11:07:29YardanicoOOM killer*
11:07:54*abm joined #nim
11:08:59*dadada__ quit (Ping timeout: 260 seconds)
11:10:31PMunchHahaha
11:10:47PMunchMine is getting back up there, currently at 2.3Gb memory
11:10:48*dadada joined #nim
11:11:12*dadada is now known as Guest45332
11:18:07PMunch3.4Gb
11:18:12FromDiscord<Recruit_main707> PMunch, can you help me setting up lsp for vs?
11:18:17PMunchSure
11:18:18FromDiscord<Recruit_main707> i case you know that is
11:18:30PMunchHuh?
11:18:47FromDiscord<Recruit_main707> i was not sure if you knew how to do it in vs
11:18:50PMunchJust let me grab some lunch first, I'm getting quite hungry
11:18:56FromGitter<sealmove> Hey, I have a seq[byte] and I want to be able to read various integer lengths. Currently I do this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ But it's most likely inefficient. How do I involve casts correctly? [https://gitter.im/nim-lang/Nim?at=5eb29d200b23797ec065c96c]
11:19:56FromGitter<sealmove> My type being: ⏎ ⏎ ``` BitStream = ref object ⏎ data: seq[byte] ⏎ pos: int``` [https://gitter.im/nim-lang/Nim?at=5eb29d5c3d58de7a38f9aa61]
11:22:52PMunchHoly moly! It jubped to 7.3G
11:23:01YardanicoPMunch: yeah probably that's why my PC died
11:23:21federico3Yardanico: try oomd
11:23:28PMunch11.1G virtual..
11:23:35Yardanicowell virtual is virtual
11:23:42Yardanicoapps can use 20TB of virtual memory with no problem
11:23:43PMunchAt this rate it'll fill my swap as well..
11:25:38*brainproxy quit (Ping timeout: 260 seconds)
11:26:56PMunchIt's gone down to 7.1Gb now
11:27:07Yardanicoinb4 C compiler segfaults
11:27:27PMunchHaha yeah
11:27:50*Hideki joined #nim
11:28:13*Hideki is now known as Guest99814
11:29:47Yardanico"Error: internal error: environment misses: mixNumOpened" huh
11:29:57Yardanicoguess a yet another arc-related bug, need to investigate more :P
11:31:51Yardanicoyeah nice I reproduced it
11:31:53Yardanico:DD
11:32:15PMunchHmm, now it's just chilling at 15% CPU but at 7Gb memory consumption..
11:32:57PMunchAnd the file in cache isn't growing, so it doesn't appear to do io
11:35:29PMunch@Recruit_main707, you wanted help setting up nimlsp?
11:36:53FromDiscord<Recruit_main707> ye, i asked it in offtopic so that i dont fill this channel with dumb questions
11:38:29PMunchAh you, pinged me with the wrong name :P
11:39:16*Guest99814 quit (Ping timeout: 256 seconds)
11:42:21*gangstacat quit (Ping timeout: 244 seconds)
11:43:13PMunchHmm, the compiler just quit with error code 137
11:43:17PMunchNo explanation..
11:44:07Yardanicothat's SIGKILL
11:44:13PMunchIf anyone with some spare RAM wants to give it a go: http://ix.io/2kZJ
11:44:17Yardanicoprobably OOM killed it
11:44:20YardanicoOOM killer*
11:44:35PMunchYeah I'm guessing so
11:46:56*hoijui quit (Quit: Leaving)
11:55:36FromDiscord<kodkuce> i have 16gb can test if want
11:56:00FromDiscord<kodkuce> just giv me script
11:56:56FromDiscord<kodkuce> tough free gives me Mem: 13Gi 676Mi 11Gi 51Mi 1.1Gi 12Gi duno why it reports 13 insted 16
11:57:05*brainproxy joined #nim
11:57:31PMunchkodkuce http://ix.io/2kZJ
11:57:43PMunchCompile that, and run it with output to another Nim file
11:57:47PMunchThen compile and run that Nim file
12:00:19FromDiscord<kodkuce> nim c >> tada.txt ?
12:00:24FromDiscord<kodkuce> any flags or just this
12:00:46FromDiscord<kodkuce> flags/args arc danger ... ?
12:01:42FromDiscord<kodkuce> with run?
12:03:14FromDiscord<kodkuce> nim c -r > report.txt
12:03:19FromDiscord<kodkuce> ok will run it like this
12:03:52FromDiscord<kodkuce> hmm it finished wtf
12:03:58Yardanicothat's just creating the file
12:04:05Yardaniconow you need to "nim c -r report.txt"
12:04:36FromDiscord<kodkuce> to run it or to ouput it again to somwere?
12:04:59*PMunch quit (Ping timeout: 260 seconds)
12:05:04FromDiscord<kodkuce> i change it to report.nim cuz beh
12:05:06FromDiscord<kodkuce> anyway
12:05:29FromDiscord<kodkuce> ok will run it now
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:45*supakeen joined #nim
12:06:50FromDiscord<kodkuce> its running duno if i should have used > so terminal output does not slowdown
12:06:59FromDiscord<kodkuce> anyway atm 800mbs
12:10:56*PMunch joined #nim
12:11:12FromDiscord<kodkuce> is there some multythread option fo compiling
12:11:28FromDiscord<kodkuce> my cpu usage only 14% and i have broswer opend
12:11:52PMunch--parallelBuild
12:12:02PMunchWith a number of processors
12:12:10PMunchBut it default to 0 which is auto-detect
12:12:21FromDiscord<kodkuce> oh , duno if should restart now just reached 1.7 GB
12:12:35*rockcavera joined #nim
12:12:37YardanicoPMunch: that won't help
12:12:43Yardaniconim compiler itself is single-threaded
12:12:55PMunchOh, that is only for passing to the C compiler?
12:13:16FromDiscord<kodkuce> nim compile time sux 😄
12:13:33YardanicoPMunch: yeah
12:13:52FromDiscord<kodkuce> ok i go cook something to eat
12:14:23Yardanicobe careful
12:14:32Yardanicoyou might hit 100% ram usage
12:16:36FromDiscord<mratsim> The nim compiler speed is OK though, much faster than C++ or Rust
12:17:19FromDiscord<mratsim> The slow things are generics, especially recursive (but they are still OK), and concepts
12:18:58dom96what about macros? Anyone did any benchmarks?
12:19:46*Trustable quit (Remote host closed the connection)
12:20:22FromDiscord<mratsim> I didn't but macro that don't involve types (getTypeInst in particular) are fast
12:20:41Araqdom96: IME macros are fine, the VM is good. but of course you can run arbitrarily complex code inside a macro
12:20:50FromDiscord<mratsim> the main issue with macros is that they tend to make nimsuggest run to 100%CPU ...
12:21:03FromDiscord<kodkuce> 2.4 GB 😦
12:21:22*PMunch quit (Ping timeout: 246 seconds)
12:21:48FromDiscord<mratsim> Arraymancer needed 3GB of RAM to compile with the whole suite in 0.20 after adding complex supports, now it's back to 1.2GB iirc on 1.2
12:22:16FromDiscord<kodkuce> anyway Nim has incremental compiler right so its not issue like in C++ where you w8 forewer
12:22:27FromDiscord<mratsim> it's not implemented
12:22:34FromDiscord<kodkuce> oh 😦
12:22:36FromDiscord<clyybber> @kodkuce Not yet
12:22:40FromDiscord<clyybber> But we are still faster :p
12:22:46FromDiscord<mratsim> way faster
12:23:02dom96we should really write an article explaining this
12:23:06FromDiscord<clyybber> @kodkuce So no, nim compiler is not slow, but your generated code is crazy :)
12:23:21FromDiscord<clyybber> of course slow is subjective, so..
12:23:25dom96most people assume that since we have two compilers effectively that we have the slowness of C++ and whatever speed Nim has
12:23:37dom96but I assume that we actually generate C++ that compiles quickly
12:23:49FromDiscord<mratsim> I'm surprised someone managed to generate code crazier than zero-functional, npegs or the macro I have in Arraymancer/Laser
12:24:00FromDiscord<kodkuce> i know this is crazy test i did not have any copiler slownest issue at least for my simple stuff, duno how would it be on big project
12:24:15FromDiscord<kodkuce> anyway hope incremental will be a thing 1 day
12:24:47FromDiscord<kodkuce> it really sux week ago i compiled godot head to w8 20 mins
12:24:48Yardanico@mratsim nim-regex macro is also pretty "interesting" :P
12:25:02FromDiscord<mratsim> I hope the compiler doesn't try to recompile files added via {.compile: "foo.c".} over and over. That's one thing that is slow
12:25:04Yardanico@kodkuce enough with jokes :P
12:26:11FromDiscord<kodkuce> 2.7gb
12:28:35*monokrom joined #nim
12:30:17Araqmratsim: it doesn't do that, it uses checksums on the .c files to see if they changed
12:30:39Araqhowever, it puts the object files into nimcache/ and nimcache is project specific
12:32:37*brainproxy quit (Ping timeout: 264 seconds)
12:33:29shashlickAraq how about compiling Nim stdlib files in a global namespace, that way those are only recompiled occasionally
12:34:04FromDiscord<clyybber> shashlick: But we also have dead code elminiation
12:34:14FromDiscord<clyybber> The generated C files aren't the same most of the time
12:34:19Araqshashlick: the stdlib is one thing, external .c files another
12:34:39Araqthere is no reason why we don't use nimcache/external for all external .c files
12:34:45*PMunch joined #nim
12:35:18shashlickAh dead code
12:37:31Araqdead code and also generics, use a fresh Table and see tables.nim.c grow :P
12:38:12shashlickThinking about https://github.com/nimterop/nimterop/issues/205
12:38:13disbotusing zig to generate cross platform wrappers
12:39:00*thomasross joined #nim
12:39:59Araqshashlick: why not instead copy "zig"'s idea, use clang to parse the C(++) code
12:40:14Araq(it's not like nobody else had this idea before...)
12:40:54shashlickThe clang ast?
12:41:28FromDiscord<kodkuce> wtf it stoped before it reached full mem
12:41:32FromDiscord<kodkuce> Hint: report [Processing]
12:41:32FromDiscord<kodkuce> /home/me/Downloads/NimTest/report.nim(1, 1) Error: undeclared identifier: 'CC'
12:41:44Yardanicoyes
12:41:52Yardanicobecause your file contained output from nim itself too
12:42:15FromDiscord<kodkuce> hmm what what
12:42:44*PMunch quit (Ping timeout: 256 seconds)
12:42:50FromDiscord<kodkuce> did i do something wronk?
12:42:57Yardanicokinda
12:44:40*lritter quit (Quit: Leaving)
12:46:56FromDiscord<clyybber> Yardanico: Yay, my fix works for the return case too now :D
12:47:01Yardaniconice :)
12:47:12YardanicoI'm in the process of minimizing another crash with --gc;arc (ICE in the compiler)
12:50:18*lritter joined #nim
12:52:09Yardanicook done :P
12:55:45*PMunch joined #nim
12:58:36Yardanicohmm
12:59:08FromDiscord<clyybber> oh nice :D
12:59:35Yardanicoactually it might be not a bug, but just a fact that destructors don't support -d:nimOldCaseObjects or something
13:00:03FromDiscord<kodkuce> so hmm
13:00:13FromDiscord<kodkuce> should i rerun or what
13:00:20FromDiscord<kodkuce> if you need me still
13:00:51Yardanicohttps://github.com/nim-lang/Nim/issues/14244 not sure if this is supposed to compile at all
13:00:54disbot[ARC] ICE when changing the discriminant of a return value ; snippet at 12https://play.nim-lang.org/#ix=2l06
13:01:07YardanicoI wasn't able to make an example without object variants
13:01:19YardanicoI mean it fails at runtime with default GC and asks to add -d:nimOldCaseObjects
13:04:03*sunwukong joined #nim
13:07:58*zacharyc1rter joined #nim
13:07:58*zacharycarter joined #nim
13:08:38*hoijui joined #nim
13:13:16*brainproxy joined #nim
13:14:56dom96shashlick, I don't get it, what does Zig buy here?
13:14:58*hoijui quit (Ping timeout: 272 seconds)
13:15:08zacharyc1rterooo Zig talk
13:15:36Yardanicodom96: I think it's about using zig to cross-compile the libraries themselves
13:15:46Yardanicoah no
13:15:52YardanicoI didn't understand
13:16:37shashlickSo nimterop relies on the build tools and preprocessor doing their thing and cleaning up the headers
13:16:43Araqand then what, this is all so stupid. so yeah, here is a Windows binary for you that I built on my Linux machine. Does it work for you? - Nope, it crashes, now what? - Oh, I think I don't support Windows then, sorry
13:17:13shashlickSee https://github.com/nimterop/nimterop/blob/master/README.md#why-nimterop
13:17:22Araqand that my friends is the new hot shit in 2020 when you can setup a CI to build and test (!) on every major OS
13:17:42shashlickHis idea is to use zig so that it can be done across many platforms
13:18:25disruptekhonestly, i would rather leverage as much outside tech as possible.
13:18:36Yardanicogood morning disruptek
13:18:38Araqhis "idea" amounts to spam.
13:18:40disruptekparsing C++ is not a competitive advantage.
13:18:54shashlickIt still doesn't address the fact that libraries often depend on the presence of other libraries
13:18:55disruptekhowdy, folks.
13:19:25FromGitter<zacharycarter> I cross compiled from MacOS to Windows but I didn't use zig and the windows binary worked
13:19:32FromGitter<zacharycarter> so you don't need Zig for this, just a cross compilation toolchain
13:19:39FromGitter<zacharycarter> I'd rather install that than LLVM and Zig
13:19:46shashlickAnd cmake and similar do a lot of package detection as well which will won't be covered
13:19:47disrupteki would rather target zig.
13:20:11Yardanico@zacharycarter well the point with zig is that it's all already precompiled with static binaries for you
13:20:13Yardanicojust easier to use
13:20:24FromGitter<zacharycarter> is it?
13:20:25Yardanicoso you don't have to install llvm separately and whatnot
13:20:28Yardanicoyes
13:20:32Yardanicoyou download a single archive
13:20:40disruptekwhy not have a whole community of developers implement and support our backend?
13:20:44FromGitter<zacharycarter> yeah but then I have to learn how to use Zig
13:20:50Yardanico?
13:20:55Yardanicowdmy
13:20:57Yardanicowdym*
13:21:06Yardanico"zig cc" acts *almost* like clang
13:21:10FromGitter<zacharycarter> if I just download a Zig binary I still have no idea of it's cl interface
13:21:11*disruptek limps off for coffee.
13:21:11shashlickIt's a convenience factor of being able to run the library thru cmake and the preprocessor on one configuration
13:22:03shashlickexport CC="zig cc" is all that's needed
13:22:28dom96bah, of course, because the header files that nimterop generates are OS specific
13:23:27shashlickThey are os, compiler and package specific
13:24:22Araqdisruptek: I'd use c2nim and maybe replace its parser by libclang
13:24:49Araqnothing else really works and our ecosystem *needs* the quality of hand written wrappers
13:24:59dom96Araq: I literally wrote a Uni dissertation which uses libclang in a Nim program
13:25:28Araqit's just my opinion, of course, but this idea that having 20 fragile wrappers instead of 5 good ones seems madness to me
13:25:33dom96I've had my eye on reusing my wrapper to generate C/C++->Nim wrappers.
13:26:22dom96I can open source it if someone wants to give it a shot
13:26:44AraqYardanico: I don't care about this "almost like", if we support it, me must ensure it keeps working.
13:27:00Araqand I don't want another factor of 2 for our CI matrix
13:27:02dom96`zig cc` is literally a C compiler
13:27:12dom96I don't see what is "almost like" about it
13:27:16Araqyeah, an *unsupported* one.
13:27:22zacharyc1rterwait but if you change the compiler assembler and linker wouldn't nimterop use those instead?
13:27:47zacharyc1rterisn't there a way to override and say nimteorp work for this specific os / arch?
13:28:36shashlickYes that's my whole point
13:28:53shashlickI delegate to cmake to discover and configure
13:29:00shashlickI delegate to the preprocessor
13:29:13zacharyc1rterso this is specifically a cmake issue?
13:29:20zacharyc1rterif you're not using nimterop with cmake it doens't matter?
13:29:51shashlickNimterop only processes headers after all that is done
13:30:03zacharyc1rteralso you can pass options to CMAKE
13:30:04shashlickThat makes the wrapper platform specific
13:30:09zacharyc1rterliek `set(CMAKE_SYSTEM_NAME Linux)
13:30:09zacharyc1rterset(CMAKE_SYSTEM_PROCESSOR arm)
13:30:15shashlickBut I don't see why it makes it fragile
13:30:18Araqplease (and I'm getting mad here), please understand why in the real world Super Mario Brothers 10 doesn't run on FreeBSD.
13:30:54Araqhint: it's not because the devs cannot setup a cross compiler...
13:30:57dom96shashlick that sounds extremely more fragile than a known-to-work wrapper that is committed to git
13:31:14dom96if I have to depend on cmake of all things then I really do not have a lot of trust in the software
13:31:32zacharyc1rtera lot of projects use cmake though
13:31:33Araqit's because you then need to support the software commercially on an OS no gamer is interested in
13:31:38shashlickC library authors rely on such tools
13:31:39dom96Why can't nimterop generate a wrapper ala c2nim's?
13:31:56dom96shashlick there is a reason I avoid building my own libraries with a passion
13:32:26dom96and use pre-built binaries whenever I can
13:32:27dom96Pretty sure most people are like this
13:32:28Araqdom96: I don't anymore but I upload my DLLs to github now
13:32:29FromDiscord<mratsim> C++ libraries are successful despite cmake, not thanks to ...
13:32:47FromDiscord<clyybber> shashlick: I'm currently trying building nimph and I'm getting this: /home/clyybber/.cache/nim/nimterop/cPlugins/nimterop_790929175.nim(1, 24) Error: cannot open file: nimterop/plugin
13:32:48FromDiscord<clyybber> [AssertionDefect] [AssertionDefect]
13:32:54FromDiscord<mratsim> Compiling any C++ library that depends on Cmake requires booking a weekend for that
13:33:01FromDiscord<mratsim> even popular ones like OpenCV
13:33:05FromDiscord<clyybber> shashlick: Do I need to compiler plugin too?
13:33:08shashlickClyybber that's fixed in head
13:33:14FromDiscord<clyybber> I am on head
13:33:18FromDiscord<clyybber> I just git cloned
13:33:26zacharyc1rtermratsim that's not true, come on
13:33:37shashlickNimterop head?
13:33:43zacharyc1rterusually compiling with cmake involves `mkdir .build && cd .build && cmake .. & make
13:33:49FromDiscord<clyybber> shashlick: Yeah, on the default branch
13:33:59zacharyc1rtermaybe a make install
13:34:12FromDiscord<clyybber> shashlick: I didn't use nimble build tho
13:34:17FromDiscord<clyybber> But instead nim c
13:34:19FromDiscord<clyybber> to compile toast
13:34:23FromDiscord<clyybber> And that worked fine
13:34:34FromDiscord<clyybber> Do I also need to compile nimterop/plugin.nim?
13:34:40dom96zacharyc1rter: mratsim is completely right
13:34:45zacharyc1rterC++'s build tool scene is a nightmare in general and CMake isn't that offensive
13:35:07zacharyc1rterno, he's not... you're bashing CMake when in reality all of the project generators are annoying
13:35:40FromDiscord<clyybber> generators generating files for other generators is indeed crazy
13:35:52Araqthe only problem with cmake is that generates a makefile. it's like somebody wrote a dependency graph analysis in 1970 and everybody is too scared to simply re-implement it. I did it in Python, was under 100 lines of code
13:35:53FromDiscord<clyybber> So yeah, at least CMake is simpler than a lot of the other stuff
13:35:58zacharyc1rterI'm not advocating that CMake is ther ight tool
13:36:08zacharyc1rterbut this is what almost every C++ project generator does
13:36:14zacharyc1rterpremake, cmake GENie, etc...
13:36:24Araqbut at least cmake runs on Windows without cygwin crap
13:36:33zacharyc1rterCMake is simply the most widely used one
13:36:35FromDiscord<mratsim> 2 days trying to get OpenCV to compile and link properly
13:36:36FromDiscord<mratsim> https://cdn.discordapp.com/attachments/371759389889003532/707586616381800499/unknown.png
13:36:38zacharyc1rterif it was premake you'd all be complaininga bout that
13:37:20FromDiscord<mratsim> and then 6 months later, CXX11 ABI changes or whatever, I couldn't link with openexr
13:37:38*gangstacat joined #nim
13:37:38FromDiscord<clyybber> shashlick: Any idea?
13:37:51zacharyc1rterwell that's C++'s fault
13:37:59shashlickSorry laptop crashed and phone is lagging
13:38:04shashlickBrb
13:38:39Araqthere was literally a single cmake setup that lead me build Z3
13:38:39FromDiscord<mratsim> I also lots of issues due to those "findCUDA" "findFFMPEG" etc scripts
13:38:46FromDiscord<mratsim> it's really awful
13:38:50zacharyc1rterokay those are annoying I'll give it that
13:38:55zacharyc1rterthe CMake modules
13:39:10Araqoh yeah, the scripts are much worse than anything I've ever added to koch.nim :P
13:39:36zacharyc1rterbut I still think that you guys are trashing CMake when every other C++ build tool is just as bad
13:39:45zacharyc1rterand if you want something that makes CMake better use fips
13:39:49Araqcmake is better than most
13:39:58FromDiscord<clyybber> make is best, fite
13:40:43shashlickThis is no different than folks complaining about nimble, choosenim or even nim for not solving every scenario perfectly.
13:41:05*hoffentlichja joined #nim
13:41:12zacharyc1rterI guess I missed where this all started
13:41:21shashlickMy point is that this is how the C/C ecosystem works today, I just don't see the point in circumventing them and doing it in some nth unsupported way
13:41:29zacharyc1rterI came in around the point Zig started to be brought up I guess?
13:42:13shashlickfact of the matter is that every C/C++ project that is cross platform has to deal with discovery
13:42:45shashlicknim does that discovery for us so we can happily sit and write mostly cross platform code without effort
13:44:19dom96zacharyc1rter I didn't interpret it as bashing cmake, I interpreted it as bashing needing to compile any big C project. It's always a nightmare no matter what make you use
13:44:46Araqshashlick: and nimterop fights Nim's design, but we don't have to discuss it yet again
13:45:16shashlicki don't think it fights nim's design at all, it is a practical way to make these libraries available to the user base
13:45:45dom96The fact is that Nim has been designed to work with DLLs
13:45:58shashlickeven for DLLs, you need a wrapper
13:46:02dom96And doing so side-steps the C ecosystem
13:46:02Araqit's practical for you but the end user experience is bad, ask disruptek
13:46:05dom96which is a great thing
13:46:20shashlickdisruptek had problems because he avoids nimble
13:46:20dom96so I do not want to bring in a package that will bring that whole ecosystem into my build
13:46:35Araqshashlick: well we can let him answer
13:46:44FromDiscord<clyybber> I think you meant me?
13:46:48shashlicki fixed his bug by discovering nim configuration with nim dump
13:47:01shashlickclyybber: you on irc?
13:47:26FromDiscord<clyybber> nope, currently not
13:47:31FromDiscord<clyybber> are you in offtopic?
13:47:40shashlickgitter?
13:47:49FromDiscord<clyybber> yeah, or irc doesn't matter
13:47:53FromDiscord<clyybber> its bridged
13:48:16shashlickcan you join https://gitter.im/nimterop/Lobby we can see what the issue is without cluttering #nim
13:48:23FromDiscord<clyybber> sure
13:48:47AraqYardanico: https://forum.nim-lang.org/t/6295 how much does it speed the Nim compiler?
13:48:51shashlicklong story short, people have issues all the time and you fix them
13:48:52Araq*speed up
13:49:03disruptekit's one thing or another. why not sidestep the issues with a smarter design?
13:49:10Araqshashlick: the issues are a symptom of an underlying systemic issue
13:49:21disrupteki'm the most expert user of my software and i have problems with it /ALL THE TIME/.
13:49:38shashlickthat could very well be the case
13:50:04shashlickin this case, it is a choice to accelerate with leverage instead of reimplementing everything
13:50:22YardanicoAraq: I didn't test it with the compiler yet - what's the good nim project for the PGO run? compiler itself?
13:51:28Araqshashlick: I completely agree and I've tried to outline the way to a good nimterop
13:51:47shashlickyes and it's been a crawl to get there
13:52:35AraqI'm sorry
13:52:50shashlickit may never get done or be perfect but that's not my goal, it is to enable quick wrappers when users ask
13:52:56AraqYardanico: or compile arraymancer
13:53:00Yardanicoah right
13:53:17shashlickmaintaining top quality wrappers requires talent and a lot of patience - it is not a glamorous job
13:53:41FromDiscord<clyybber> Actually it just requires c2nim and some perl to patch it up :p
13:54:01Yardanicodisruptek: stream today or not?
13:55:22YardanicoI'll try with the compiler itself first just to test
13:55:57shashlickclyybber: try wrapping large cross platform projects
13:56:10shashlickyou can definitely make a one time wrapper
13:56:26disrupteki stream every day, all day.
13:56:44FromDiscord<mratsim> https://pldi20.sigplan.org/program/program-pldi-2020
13:56:44FromDiscord<mratsim>
13:56:44FromDiscord<mratsim> Some stuff on MT solver and verified ranges
13:56:48FromDiscord<mratsim> SMT*
13:57:34shashlickanyway, the point is not to obsolete c2nim or something, it is to offer choice
13:57:42FromDiscord<clyybber> shashlick: I am wrapping vulkan
13:58:08shashlickultimately I want the user to succeed in his project, not create some wrapping masterpiece
13:58:09FromDiscord<clyybber> shashlick: Yeah, you are right, but thats also kind of the problem I guess; It wont obsolete c2nim
13:58:20FromDiscord<clyybber> And for example with awr's cpu package I can't choose
13:58:28shashlickthat never was the goal, c2nim can convert C to nim outright
13:58:31FromDiscord<clyybber> Or with nimph
13:58:34Araqshashlick: I don't mind obsoleting c2nim, I'm not married to the software. but the replacement should be better ;-)
13:58:55shashlickyour issues with nimph aren't due to wrapping
13:59:08shashlickit is since you don't want to use nimble
13:59:09FromDiscord<clyybber> They are due to nimterop
13:59:25FromDiscord<clyybber> Because it's too complex IMO
13:59:32Araqthat's simply not true, I don't mind running 'nimble install nimph' and it didn't work for me
13:59:32disruptekhe can't build nimph because of nimble? 🤣
13:59:34shashlickagain, that's like asking for perfection
13:59:51disruptekdoes the bootstrap work or not?
13:59:52Araq'nimble install nimph' is a pretty basic command
14:00:02shashlickit works for me
14:00:17Araqwell I got it to work too, eventually
14:00:43shashlickbut that's cause all the fixes are in #head and not tagged yet
14:00:55Araqnow I cannot use it because 'nim dump' because 10x slower and nimph is too slow now (just kidding, disruptek )
14:01:08disruptekdo you need a replacement for `bump` that works better for your use-case, shashlick?
14:01:09shashlickits like asking for zero bugs, as all developers here, i don't see how that should discourage usage altogether
14:02:07Araqshashlick: we're not asking for zero bugs, we're asking for a development process that makes the bugs easier to spot, rather than hidden in layers beyond our comprehension
14:02:46disruptekit's not even a code issue, it's an environment issue.
14:02:53disruptektoo many assumptions.
14:03:44AraqI ask for a bike and rather than giving me a bike with a broken tire, you give me a broken bike factory
14:05:18disrupteki'm still getting reproducable crashes in compiler code in nimph.
14:05:29Yardanicook so with default nim build "time nim c -d:danger --hints:off -w:off --compileOnly tests/tests_cpu.nim" (arraymancer) takes ~3.7-3.8 seconds
14:05:35Yardaniconow gonna build nim with PGO+LTO and try again
14:05:38PMunchHmm, what does the "dynlib" pragma actually do?
14:05:56AraqYardanico: btw -d:danger --panics:on the new way to get fastest code
14:06:05YardanicoI know, but we want a fair comparison right? :P
14:06:18YardanicoI mean I'll use -d:release for the compiler
14:06:24FromDiscord<mratsim> dynlib is for dynamically linking 😉
14:06:29disruptekalso, it's compiler code that is compiling system module and running nimscript.
14:06:36AraqYardanico: sure, but you can use -d:danger --panics:on for both runs
14:06:44Yardanicohmm, right
14:07:01Araqoh er
14:07:12Araqyou don't run the compiler under arc so it doesn't matter, sorry
14:07:26Yardanicowell there's still difference between -d:release and -d:danger I guess
14:07:27disruptekit's harmless.
14:07:43Araqwhy can't we run the Nim compiler under arc? what is everybody doing all day long? discussing silly tool chains?
14:07:50Araq:P
14:08:00FromDiscord<clyybber> Araq: Maybe we'll get there today :D
14:08:07FromDiscord<clyybber> Let me try
14:08:08*brainproxy quit (Read error: Connection reset by peer)
14:08:15Yardanicowell I opened 3 new arc-related bugs today :P
14:08:45FromDiscord<mratsim> does createThread works with arc now?
14:08:54disruptekyes.
14:08:57*brainproxy joined #nim
14:09:28FromDiscord<clyybber> Heh, nevermind, still get errors
14:10:29Araqwell you need to fix the move optimizer
14:11:22Yardanico"SIGSEGV: Illegal storage access. (Attempt to read from nil?)" :D guess I'll build with -d:release after all
14:11:49Yardanicothe compiler seems to either crash or say some gibberish about illformed AST
14:11:58Yardanicoit's gone crazy with lto+pgo+danger
14:14:40Yardanicomaybe PGO optimizes too much stuff? anyway will try with -d:release now
14:15:08disrupteki guess i need to stream earlier for danny's benefit.
14:17:40dom96nim-lang.org should have a "live now" section
14:17:45dom96anyone want to implement one?
14:18:12FromDiscord<clyybber> should it?
14:19:10AraqYardanico: gah, that's nasty so PGO breaks the Nim compiler?
14:19:13Yardanicoso with -d:release with lto+pgo tests_cpu from arraymancer takes around 0.2s less to compile :P (--compileOnly), building nim itself takes 0.6s less time
14:19:24YardanicoAraq: maybe PGO just messed up that one time, with -d:release now it's fine
14:19:42Yardanicoand doing "time ~/testsp/compiler/nim c -d:release --compileOnly -w:off --hints:off compiler/nim.nim" is ~0.5s faster (3.9s vs 4.4s)
14:19:59Araqwow
14:20:04Araqthat's pretty good
14:20:31Araqcan we store this profiling info somewhere? is it platform agnostic?
14:21:07Yardanicohmm, I don't really know, need to search or ask someone who knows clang well :P
14:21:39Araqcreate a pull request and see if it breaks our builds :P
14:22:01Yardanicowell I'm using clang's LTO+PGO, I don't know if it's available on the CI
14:22:25Araqthe CI uses clang on OSX at least
14:22:27Yardanicofor GCC it seems to be harder since GCC outputs the profiling data in the ~/.cache/nim/project directory
14:22:36Yardanicoand clang just does it in current dir
14:22:52Yardanicobut I'll try
14:23:38Araqer, sorry, just forget about it, the Nim compiler changes all the time
14:23:57Yardanicowell nightlies maybe can make use of LTO+PGO I guess?
14:24:04Araqtrue
14:25:11FromDiscord<mratsim> still no channels in arc :/ https://github.com/nim-lang/Nim/issues/13936
14:25:12disbotSimple channels with --gc:arc
14:25:34Araqbut wow 3.9s vs 4.4s is quite a speedup. many would heavily refactor the compiler to get that
14:25:44Araq(myself included)
14:26:58Yardanicoyeah, and especially the fact that I used the profile data the arraymancer tests_cpu, not from building the compiler
14:27:23*hoijui joined #nim
14:27:34Yardanicofrom the *
14:27:53*tane joined #nim
14:29:05Yardanicoeven when building my simple mathexpr lib (the repl example) it takes 60ms less (510ms vs 570ms)
14:35:18*NatashaOakl joined #nim
14:37:39*NatashaOakl quit (Client Quit)
14:48:07disruptek~stream
14:48:07disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
14:48:27disruptekunfunner stuff.
14:52:16*pydsigner left #nim ("Leaving")
15:06:20stefantalpalaruIs there any known memory leak involving tables with tuples as keys? Like this one: https://github.com/status-im/nim-beacon-chain/blob/621c2e38a6f073c1c4bb9cf2e6b430796490a6ef/beacon_chain/beacon_node_types.nim#L137
15:07:38Araqstefantalpalaru: no
15:10:32*couven92 joined #nim
15:14:37*fredrikhr quit (Ping timeout: 264 seconds)
15:24:18dom96can we get a wrapper for this? https://microsoft.github.io/microsoft-ui-xaml/
15:28:49*letto quit (Read error: Connection reset by peer)
15:29:33YardanicoAraq: results for compilation time of arraymancer's tests_cpu and compiler with -d:danger and -d:danger + PGO
15:29:34Yardanicohttps://gist.github.com/Yardanico/e5ef5130b43f3d4e6f8c308ee910c1c3
15:29:59Yardanico3.64s 4s vs 3.22s 3.27s
15:31:38*s4mu3lbk joined #nim
15:36:12ozdom96: just compile to JS and use "React Native for Windows". :>
15:37:56*sunwukong quit (Quit: Leaving)
15:37:57liblq-devdoes offsetOf return the byte offset of a field in an object?
15:38:26liblq-devthere's no docs for it in system.nim
15:38:28*fredrik92 joined #nim
15:41:47*couven92 quit (Ping timeout: 240 seconds)
15:53:57*theelous3 joined #nim
16:08:54*s4mu3lbk quit (Remote host closed the connection)
16:09:14FromGitter<awr1> hello all
16:10:22Yardanicogithub announced github discussions
16:10:29Yardanicobasically forums in the repositories
16:12:59*s4mu3lbk joined #nim
16:18:17dom96nice, so they're finally following their "social" mission
16:18:36Yardanicoexample https://github.com/zeit/next.js/discussions
16:21:47dom96cool, some pretty awesome features
16:22:14dom96Guess we can shut down the Nim forum :P
16:24:54*brainproxy quit (Quit: WeeChat 2.8)
16:27:00FromGitter<awr1> now i can finally get rickrolled on github
16:30:15Zevvhow does one enable that?
16:30:53YardanicoI don't think you can yet
16:30:57Zevvright
16:30:58Yardanicobut I guess it'll be open beta soon
16:32:31FromGitter<Conlaoch> Dang it awr1... now I'm gonna have that tune stuck in my head for a couple hours...
16:33:45FromGitter<awr1> https://github.com/nim-lang/Nim/pull/14247 can someone merge this when it passes CI? thanks
16:33:46disbotFix runnable examples for bitops (should fix CI)
16:37:42narimiran@awr1 ping me when it is green
16:39:57*waleee-cl joined #nim
16:42:02FromGitter<kaushalmodi> For a closed source project, few days back, I compiled it with `--gc:arc` and it compiled fine. Today I get this error: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ It does not give a deeper backtrace. ... [https://gitter.im/nim-lang/Nim?at=5eb2e8da3d58de7a38fab92f]
16:42:32FromGitter<kaushalmodi> How can I get a report-worthy backtrace?
16:42:45Yardanicooh yeah I know the error
16:42:47YardanicoI already reported it
16:42:55Yardanicolemme give you the issue link
16:42:58FromGitter<kaushalmodi> The project compiled and compiles fine without `--gc:arc`.
16:43:00*ptdel joined #nim
16:43:08Yardanicohttps://github.com/nim-lang/Nim/issues/14236
16:43:10Yardanicothat's the one
16:43:11disbot[ARC] ICE with static objects ; snippet at 12https://play.nim-lang.org/#ix=2l1f
16:43:46Yardanicostack trace helps but by a bit, the best way is to always make a short example to reproduce ;)
16:44:06Yardanicocheck, maybe you use nim-regex yourself
16:44:12Yardanicoyou can workaround it by not using the nfa macro
16:44:33Yardanico-d:forceRegexAtRuntime for nim-regex
16:45:41*Trustable joined #nim
16:50:51*samuelb_ joined #nim
16:50:52*s4mu3lbk quit (Read error: Connection reset by peer)
16:51:16*samuelb_ is now known as s4mu3lbk
17:08:57*ertp07 joined #nim
17:13:01FromGitter<kaushalmodi> Yardanico: I need the stack trace to understand what part of that huge project is breaking :)
17:13:16FromGitter<kaushalmodi> Just those 2 lines lead me nowhere
17:13:28FromGitter<kaushalmodi> *2 lines of those error messages
17:13:31Yardanicowell you'll only be able to get the compiler stacktrace anyway
17:13:33Yardanicouse ./koch temp c
17:13:39Yardanicoor whatever your backend is
17:14:03FromGitter<kaushalmodi> My project uses cligen and cligen uses regex so probably it's caused by regex
17:14:14Yardanicotry with -d:forceRegexAtRuntime
17:17:11*fredrik92 is now known as fredrikhr
17:18:29FromDiscord<queersorceress> is there a way to force the `dynlib` pragma to rely on a dlopen call rather than forcibly linking a library to the resulting binary?
17:20:14FromDiscord<queersorceress> i'm running into an issue where a third party library wraps the stdlib's db_[mysql|postgres|sqlite] and i only use sqlite, but the binary that gets built is wanting all three libraries to be linkable at run-time
17:21:03FromDiscord<queersorceress> so i want to short-cut it and while i could probably do some magic with linker scripts and rewriting symbols, i really don't want to do that if an easier solution exists
17:22:38FromDiscord<Solitude> its already using dlopen
17:23:26FromDiscord<Solitude> so there is no easy way to conditionally load a library at runtime
17:23:52FromDiscord<EdgyNerd> I tried using the go garbage collector, but got the error 'could not load: libgo.so', where do I get that file?
17:23:54*avatarfighter joined #nim
17:24:28Yardanico@EdgyNerd gccgo
17:24:30Yardanicoyou need that
17:26:02*luis_ joined #nim
17:30:22*avatarfighter quit (Ping timeout: 260 seconds)
17:30:27FromDiscord<SolarOmni> Okay so I'm really rusty with Nim and haven't used it in like 2 years, it seems to have changed a bit. But anyway, I can't remember the flags for the compiler and I can't seem to find them in the manual. Can anyone tell me how to use set where the executable is exported to?
17:30:56luis_Hi guys, how do I set nimble to generate a windows binary?
17:31:07luis_Where do I set the binary type?
17:31:32leorizeSolarOmni: --out:/path/to/where/you/want
17:31:33Yardanicoluis_: nim uses the c compiler, so you need to have a cross-compiler from your platform to windows
17:31:48FromDiscord<SolarOmni> Thanks leorize
17:32:31zacharyc1rterjust use Zig
17:32:41Yardanico^^^
17:32:50Yardanicouse zig to cross-compile nim for windows
17:32:52Yardanicoez
17:33:08FromDiscord<EdgyNerd> I installed gccgo and it still doesn't work for some reason
17:33:19FromGitter<kaushalmodi> Yardanico: After I using that define to enable regex at runtime, I see: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb2f4df9f0c955d7daa2985]
17:33:30Yardaniconice
17:33:37Yardaniconow minify it and create a bug report ;)
17:33:44Yardanicooh its glob\
17:33:47FromGitter<kaushalmodi> yeah
17:33:48Yardanicohmmm
17:33:55Yardanicohttps://github.com/citycide/glob ?
17:34:01FromGitter<kaushalmodi> yes
17:34:37FromGitter<kaushalmodi> I will see if can reproduce that error in a minimal example
17:35:15FromGitter<kaushalmodi> but that error is different from that earlier "unhandled exception: ccgexprs.nim(777, 11) `ty.kind in {tyTuple, tyObject}` [AssertionDefect]"
17:35:23FromGitter<kaushalmodi> I don't know if and how they are related
17:35:32*avatarfighter joined #nim
17:36:38Yardanicoyeah I can replicate it
17:36:41Yardanicolemme try to make a repro
17:36:43Yardanicoso I can report it
17:36:50luis_thanks
17:36:52FromGitter<kaushalmodi> yes! This gives me the same error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb2f5b4adb0ec5c2beb042c]
17:37:29FromGitter<kaushalmodi> Do we need another report so that nim would give more info than just "unhandled exception: ccgexprs.nim(777, 11) ty.kind in {tyTuple, tyObject} [AssertionDefect]"?
17:37:48YardanicoI already have it in the issue I linked
17:38:07Yardanicobut these two are separate issues, one is internal compiler error, other is codegen, although they're maybe related , but probably not
17:48:51*SaraSweet joined #nim
17:50:09FromGitter<kaushalmodi> I added this to that issue thread for packages not working with arc: https://github.com/nim-lang/Nim/issues/14224#issuecomment-624795102
17:50:12disbotLibraries which don't work with ARC ; snippet at 12https://play.nim-lang.org/#ix=2l1L
17:50:32Yardanicowell you don't need to add that
17:50:42Yardanicothis crash is related to nim-regex and I already reported it separately
17:51:00Yardanicohttps://github.com/nim-lang/Nim/issues/14236 is literally this issue
17:51:01disbot[ARC] ICE with static objects ; snippet at 12https://play.nim-lang.org/#ix=2l1f
17:51:02Yardanicofrom nim-regex
17:51:30*SaraSweet quit (Client Quit)
17:51:32Yardanicoand if you look at https://github.com/nim-lang/Nim/issues/14224 I actually opened it because of nim-regex :)
17:51:34disbotLibraries which don't work with ARC ; snippet at 12https://play.nim-lang.org/#ix=2l1L
17:54:48FromGitter<kaushalmodi> ok :)
17:55:03Yardanicoand this bug with glob seems to be in nim-regex too, but it's different
17:55:08Yardanicorelated to inline iterators again
17:55:22Yardanicolike https://github.com/nim-lang/Nim/issues/14219 but that PR didn't fix it
17:55:23disbotARC codegen bug with inline iterators ; snippet at 12https://play.nim-lang.org/#ix=2gcb
17:55:32YardanicoI mean that PR doesn't fix this problem
18:08:22Yardanico@kaushalmodi you should use ./koch temp
18:08:35Yardanicoclone nim compiler git repo (--depth=1) will work
18:08:47Yardanicoand do ./koch temp c --gc:arc otherarguments path/to/your/file.nim
18:09:01YardanicoIf the release version of the compiler will have stack traces enabled it'll be MUCH slower
18:09:18YardanicoI tested and it makes the compiler ~3x slower even with -d:release --stackTrace:on --lineTrace:on
18:09:43FromGitter<kaushalmodi> You said that it will show stacktrace only in the compiler, so I didn't pursue that; I do have `koch` as I build from git. Trying it out ..
18:10:09Yardanicowell wdym "only in the compiler", if you mean where it crashed in the code - there's no such thing
18:10:18YardanicoI don't think nim compiler has that at all
18:10:25Yardanicoif it actually *crashes*, it crashes
18:11:03FromGitter<kaushalmodi> ok, I thought we can know which user Nim file the compiler was attempting to compile before it crashed
18:13:23Yardanico@kaushalmodi and I know a temporary fix to solve your codegen issue
18:13:38Yardanicoin nim-regex nodematch.nim line 116 remove {.inline.} pragma
18:14:04Yardanicothen it actually works
18:18:24*ptdel quit (Remote host closed the connection)
18:19:38*ptdel joined #nim
18:19:40FromGitter<kaushalmodi> I did this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and recompiled that glob snippet, but still the same crash [https://gitter.im/nim-lang/Nim?at=5eb2ffbcadb0ec5c2beb2a80]
18:19:57Yardanicowhich crash?
18:20:07Yardanicodo you run it with -d:forceRegexAtRuntime ?
18:20:27FromGitter<kaushalmodi> ugh, no
18:20:30Yardanicowell you nee to
18:20:31Yardanico:P
18:20:33Yardanico*need
18:20:57FromGitter<kaushalmodi> yep, confirm your fix :)
18:21:05FromGitter<kaushalmodi> *I confirm
18:21:06Yardanicowell I need to reproduce it now
18:21:09Yardanicowith a shorter example
18:21:18Yardanicoit's something to do with inline and inline iterators
18:24:04*ptdel quit (Remote host closed the connection)
18:25:19*ptdel joined #nim
18:33:00FromGitter<Willyboar> I just saw httpbeast is no.1 in web frameworks benchmark
18:33:16*NimBot joined #nim
18:33:32FromGitter<Willyboar> This is very cool
18:40:36FromGitter<Willyboar> But we lack web frameworks to kick their a** totally
18:50:05*s4mu3lbk quit (Remote host closed the connection)
18:56:25*avatarfighter quit (Ping timeout: 240 seconds)
18:58:26*s4mu3lbk joined #nim
19:00:19*avatarfighter joined #nim
19:01:54FromGitter<waghanza> their is also `jester` and `rosencrantz` (pending in https://github.com/the-benchmarker/web-frameworks/issues/335)
19:01:54disbotIntroduce rosencrantz
19:02:07Yardanicojester uses httpbeast
19:02:27FromGitter<waghanza> yep and is from the same author
19:02:35Yardanicoyes
19:03:52FromGitter<Willyboar> I really want to see rosencrantz results
19:04:17FromGitter<waghanza> i'll be glad to reviw any PR
19:04:35FromGitter<Willyboar> there are more
19:04:43FromGitter<Willyboar> whip is fast too
19:05:10FromGitter<Willyboar> it uses httpbeast too
19:06:27*hoijui quit (Quit: Leaving)
19:07:27*luis_ quit (Ping timeout: 240 seconds)
19:13:58*s4mu3lbk quit (Remote host closed the connection)
19:14:29FromDiscord<queersorceress> @Solitude turns out it was simplier than i thought it would be; i was mistaken on one of the dynlibOverride names, so with that plus one linker flag i was able to circumvent the issue entirely.
19:18:40*exelotl joined #nim
19:18:54*ertp07 quit (Ping timeout: 240 seconds)
19:29:15dom96Willyboar: :o
19:29:57dom96It's #3 it seems
19:30:06dom96beaten by a JS framework lol
19:30:22FromGitter<waghanza> any contribution for https://github.com/the-benchmarker/web-frameworks
19:31:02FromGitter<waghanza> disclaimer : this version is not really accurate (I mean I use a local docker), I'm working on a cloud version (backed by digitalocean)
19:31:19FromGitter<Willyboar> you can beat them @dom96
19:31:21FromGitter<Willyboar> :PP
19:31:25FromGitter<waghanza> ;-)
19:31:29*avatarfighter quit (Ping timeout: 244 seconds)
19:31:37dom96the differences are so small that I don't really see much point :P
19:32:16dom96honestly, the top 25 are fast enough.
19:32:24FromGitter<Willyboar> hm crystal lucky drop a lot for a crystal framework
19:32:43FromGitter<waghanza> tep strange
19:32:51dom96thanks for getting httpbeast in there waghanza
19:32:58FromDiscord<queersorceress> if it can load web pages for a user when requested, i think that is considered "fast enough" 😛
19:33:03*ertp07 joined #nim
19:33:07FromGitter<waghanza> you're welcome ❤️ r
19:34:36FromDiscord<dom96> oooh https://github.com/features/codespaces
19:34:42FromDiscord<dom96> I hope Nim is supported
19:35:00Yardanicowell if they support extensions and you can add your own binaries - yes
19:35:17FromGitter<Willyboar> !!! Looks Great
19:36:32FromGitter<Willyboar> I suppose any VS extension will work
19:36:41Yardanicowell Nim extension requires nimsuggest
19:36:47Yardanicofor autocompletion and stuff
19:36:55Yardanicootherwise you'll just have simple syntax highlighting
19:40:21dom96Nim support would require at least the compiler
19:40:37dom96if you can get the compiler onto these online editors then you can surely get nimsuggest
19:41:04FromGitter<Willyboar> When will be available?
19:41:23FromDiscord<queersorceress> if the compiler can be built to a JS target rather than a C target, then that probably would be much easier to make happen
19:41:50Yardanicothat's not exactly easy
19:42:06Yardanicowith wasm it's much more feasible
19:42:37Yardanicobtw reported 4 arc bugs, enough for today I guess :p
19:42:47YardanicoI mean today's total count :P
19:43:12FromDiscord<Recruit_main707> good job
19:43:18Yardanicoyou can help too
19:43:22FromDiscord<Recruit_main707> Araq is probably very happy about this
19:43:29Yardanicojust test random libs/apps in nim with arc
19:43:30Yardanicoez
19:43:41FromDiscord<Recruit_main707> first make my things work
19:50:07FromGitter<Willyboar> I just test arc with whip and with arc is 7-10% faster
19:51:31*ertp07 quit (Read error: Connection reset by peer)
19:53:11*ertp07 joined #nim
19:55:51*Jesin quit (Quit: Leaving)
19:58:23*arecaceae quit (Remote host closed the connection)
19:58:42*arecaceae joined #nim
20:01:14*Jesin joined #nim
20:04:06*narimiran quit (Ping timeout: 272 seconds)
20:06:21*luis_ joined #nim
20:06:22*luis_ quit (Remote host closed the connection)
20:08:24PMunchhttps://play.nim-lang.org/#ix=2l3Y
20:08:25PMunchHmm
20:09:27FromGitter<kaushalmodi> I have an internal CLI app.. is it possible to update the app executable by itself?
20:09:28PMunchSo is there a way to tell Nim about a const that doesn't involve copying the variable value?
20:09:28*Jesin quit (Quit: Leaving)
20:09:53PMunchkaushalmodi, what do you mean? Do you want to run it and it will update itself?
20:10:45FromDiscord<Never Listen To Beef> If so on linux you can just fetch the new version overtop the old one, on windows you'd need to move the old one, then fetch and delete the old one
20:10:49FromGitter<kaushalmodi> I am thinking like "when user runs the self update subcommand, download the latest version from my const download url, quit the app and then overwrite itself in the "post quit phase or something" "
20:11:00FromGitter<kaushalmodi> Just curious
20:11:01Yardanicoyeah that should be possible
20:11:08dom96choosenim does this
20:11:09Yardanicosome apps do this
20:11:11PMunchDefinitely doable
20:11:19FromGitter<kaushalmodi> So what is that "post quit phase"?
20:11:20dom96but it fails on Windows IIRC
20:11:26dom96because it just overwrites itself
20:11:27FromDiscord<Never Listen To Beef> Well you have to do what i said on windows
20:11:41FromGitter<kaushalmodi> On Linux, I get Oserror
20:11:41PMunchAre you allowed to move a running program though?
20:11:46dom96Might be worth creating a package that makes this nice and easy across all platforms
20:11:47FromDiscord<Never Listen To Beef> Move the file then fetch and then remove the original
20:11:53leorizePMunch: a const that doesn't involve copying the value?
20:12:16FromDiscord<Never Listen To Beef> On windows it's a file that is loaded into shared memory, so it can be moved safely afaik
20:12:17*Guest45332 is now known as dadada
20:12:19FromGitter<kaushalmodi> How do I remove the original while it is running?
20:12:33dom96you don't
20:12:47dom96the usual solution is to download to myapp.exe.update
20:12:52PMunchYeah, let's say that there is a `const int VERSION` in the C file. I want to wrap this in Nim, but I don't want to copy the value that is assigned to VERSION, I want it to be whatever the file I link it with is.
20:12:54FromDiscord<Never Listen To Beef> You create a small batch file and invoke that whilst you kill the app inside the batch wait for it to end 😄
20:13:18dom96Actually, I dunno, google how they do it :P
20:13:29FromGitter<kaushalmodi> Yeah, plan B is to deploy an update script
20:13:32leorizePMunch: var VERSION {.importc, header: "the_header_that_defines_it.h".}
20:13:40leorizeoh you need to specify the type to
20:13:45dom96and please create a package out of this so I can use it in choosenim
20:13:46PMunchBut that is a var
20:13:47*Jesin joined #nim
20:13:58leorizePMunch: you can't importc a const
20:14:15leorizeconst is strictly nim compile-time
20:14:20PMunchI know
20:14:21leorizeand let requires initialization :P
20:14:25PMunchBut a let would work
20:14:42PMunchIf Nim would allow me to not give it a value when nodecl is defined
20:14:58leorizeyou should really just copy the value over to nim
20:15:48leorize@kaushalmodi: I haven't tried this again, but IIRC you can move the executable that's running
20:15:53PMunchThat might be hard if it is in a large tree of C macros/conditions
20:15:55leorizethen replace it with the other
20:16:37leorizePMunch: found a way to make it immutable
20:16:42leorizemake it a template or proc
20:16:46leorizeuse {.emit.} :P
20:17:04PMunchBut apparently `let TEST {.importc, nodecl.}: cint = 0` works
20:17:24PMunchHmm, a template with {.emit.} would work as well
20:17:40PMunchAnnoying if you need to do many of them though..
20:17:54leorizewhip up a generator for them
20:17:55liblq-devis fields()/fieldPairs() guaranteed to yield all fields in the correct order?
20:18:00leorizeor template-generating templates :P
20:18:03PMunchCuriously `let TEST {.importc, nodecl.}: cint = default(cint)` doesn't work
20:18:08PMunchIt tries to assign 0 to TEST
20:18:17leorizeliblq-dev: yes, but it doesn't "yield" the fields per-se
20:18:20leorizeit unrolls the loop
20:18:24leorizeso careful with that
20:18:33liblq-devI know, that's what I want
20:18:53liblq-devI was just wondering if I need a macro to preserve the exact order they are declared in an object
20:19:01leorizenow that for loop macros are a thing maybe we can reimplement those things outside of the compier
20:19:02leorizecompiler*
20:19:56PMunchOh right, I forgot about for loop macros
20:19:59FromGitter<kaushalmodi> leorize: I'll try moving the executable
20:20:06PMunchA feature I've yet to abuse :P
20:24:45FromGitter<kaushalmodi> leorize: It works!!!
20:25:05FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb31d2014b48f0698b33997]
20:26:10leorizenice :)
20:26:10*s4mu3lbk joined #nim
20:27:13FromGitter<kaushalmodi> Thanks :) This is a sweet feature.. no need to tell folks to curl and change perms
20:32:03*s4mu3lbk quit (Remote host closed the connection)
20:35:23PMunchhttps://github.com/nim-lang/Nim/issues/14253
20:35:26disbotAssignment to `default` leads to assignment for `nodecl` ; snippet at 12https://play.nim-lang.org/#ix=2l45
20:43:03leorizeon 1.2.0 that one looks even weirder
20:43:22leorizeError: identifier expected, but got '[EOF]'
20:43:27PMunchleorize, my error?
20:43:44leorizeyea, check the playground
20:44:30PMunchOh, that is from a stray ` at the end of line 3
20:44:34PMunchI have edited it out already
20:51:04PMunchIMO the fix should be to make all assignments create an assignment in C. But let should be able to use `nodecl` and/or `importc` (doesn't nodecl imply importc? in a way) and not have to assign a value.
20:51:41PMunchBut I should really get to bed
20:51:48PMunchSee ya!
20:51:49*PMunch quit (Quit: leaving)
21:02:35FromDiscord<queersorceress> i thought emit was deprecated\
21:03:08Yardanicowdym?
21:03:29Yardanicoit won't be deprecated as long as nim has any of its current backends
21:05:02*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:05:06FromDiscord<queersorceress> https://nim-lang.org/docs/macros.html#emit.t%2Cstatic%5Bstring%5D
21:05:18Yardanicothats macros.emit
21:05:23Yardaniconot the emit pragma
21:11:18FromDiscord<Avahe> @Elegant Beef Trying out propertynotify events now, were you getting any wm state changes? I am not
21:16:59*ehmry joined #nim
21:17:28FromDiscord<Never Listen To Beef> Nope
21:18:26FromDiscord<Avahe> I actually am getting an error on this call you are doing: https://github.com/beef331/goodwm/blob/master/src/goodwm.nim#L595
21:20:41FromDiscord<Avahe> You are probably just ignoring the error I think.. you're giving a pointer to an array but it should be a pointer to a cstring
21:21:40FromDiscord<Avahe> Oh jk that is correct because it is an array of longs. Hm, wonder what's happening
21:26:02*chemist69 quit (Ping timeout: 260 seconds)
21:27:03*chemist69 joined #nim
21:33:43*filcuc joined #nim
21:36:07*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:40:50PrestigeI'm attempting to call XGetErrorText https://tronche.com/gui/x/xlib/event-handling/protocol-errors/XGetErrorText.html which takes a cstring as an out param, and I also need to specify the size (sort of like a buffer to fill). How should I go about doing this in nim?
21:41:25PrestigeIf I don't init the cstring nothing is returned, but if I fill the string I get an Illegal storage access error
21:42:23PrestigeUnless I'm doing it correctly and there just isn't an error message, lol
21:47:00FromGitter<awr1> working on a C++ thing again, trying to mess with C++ macros makes me long deeply for nim templates
21:47:44*tane quit (Quit: Leaving)
21:47:58FromDiscord<Never Listen To Beef> @Avahe what file is the error method in?
21:48:12FromDiscord<Never Listen To Beef> Ah nvm
21:48:56FromDiscord<Avahe> I fixed the XChangeProperty part, I was just doing something dumb
21:49:07*Winterfury quit ()
21:49:25FromDiscord<Avahe> but am now onto trying to get XGetErrorText to work
21:50:30*filcuc quit (Ping timeout: 260 seconds)
21:53:20FromDiscord<Avahe> Need a nim guru to take a look, not sure how this is supposed to work with cstring
21:55:22FromGitter<awr1> do you know the size of the buffer or not
21:55:26FromDiscord<Never Listen To Beef> The C method takes a char array, so i dont exactly know
21:55:39FromDiscord<Never Listen To Beef> Well you pass it a buffer and it returns the size with the changed buffer
21:55:47*solitudesf quit (Ping timeout: 260 seconds)
21:55:53FromDiscord<Avahe> I don't, it seems I just need to declare a buffer with some arbitrary size and pass it in
21:56:04FromGitter<awr1> if you don't know the size of the output, you will need to allocate a cstring of a certain "large size"
21:56:15*Vladar quit (Quit: Leaving)
21:56:53FromDiscord<Avahe> Is there a way to declare a string with some size rather than filling " ... "? like char[255]?
21:57:09FromGitter<awr1> i did something like this for a PR recently
21:57:25FromGitter<awr1> https://github.com/nim-lang/Nim/pull/13950/files#diff-bf62676d6697cd4a45cd6e35f6b5468cR35
21:57:26disbotadded extended msg for failed library loads w/ incorrect DLL formats
21:57:45Yardanico@Avahe it really depends on what do you need that for
21:57:57FromGitter<awr1> this is with a stack allocation, fyi
21:58:57FromGitter<awr1> but you can do `var msg: array[1000, char]` for a stack alloc or `var msg = cast[cstring](alloc0(1000))`
21:59:02FromGitter<awr1> for a heap one
21:59:20FromGitter<awr1> and then `dealloc` the underlying pointer.
22:01:02Prestigelooking like I'll have to do that latter since the param specifies a cstring
22:01:02FromGitter<awr1> `var cMsg :array[1000, char]; XGetErrorText(display, code, cast[cstring](addr cMsg[0]), cMsg.len); let msg = $cast[cstring](addr cMsg[0])`
22:01:13Prestigeoh maybe that
22:01:20FromGitter<awr1> you can get a cstring from both
22:01:31FromGitter<awr1> get address to the first ele and cast it
22:02:17FromGitter<awr1> `msg` will allocate a normal nim `string`
22:02:21FromGitter<awr1> via $
22:02:25PrestigeThat worked, thanks!
22:02:41FromGitter<awr1> glad to hear
22:03:25*s4mu3lbk joined #nim
22:06:22FromDiscord<mratsim> I hate generic sigmatch bug
22:06:22FromDiscord<mratsim> https://cdn.discordapp.com/attachments/371759389889003532/707714906748878878/unknown.png
22:06:31liblq-devwhy are types in generic procs not bound from declaration site?
22:07:05*abm quit (Quit: Leaving)
22:07:39liblq-devI have this generic proc https://github.com/liquid600pgm/aglet/blob/master/src/aglet/gl.nim#L304
22:07:53liblq-devand I'm trying to call it from a macro
22:07:59liblq-devbut I'm getting undeclared field errors
22:08:09liblq-devI have to import the `gl` module from my main module which is bad
22:08:32FromDiscord<mratsim> use bindSym instead of ident in your macro
22:08:42FromGitter<awr1> ^ this
22:08:54*vegai quit (Ping timeout: 240 seconds)
22:09:10*vegai joined #nim
22:09:42liblq-devbut it's not a problem with the macro
22:09:57liblq-devlook at this https://github.com/liquid600pgm/aglet/blob/master/src/aglet/arraybuffer.nim#L57
22:10:14liblq-devwhere'd I even use bindSym?
22:11:32*monokrom quit (Remote host closed the connection)
22:11:58FromGitter<awr1> your issue is the `quote do:`
22:12:04FromGitter<awr1> you need to make a call from scratch
22:12:26FromGitter<awr1> `quote do:` i believe is untyped so it won't perform symbol binding
22:12:59liblq-devdang it, and there I was hoping I could make my code shorter
22:14:51FromDiscord<Rika> is it a good idea to import the compiler just to use int128
22:14:56leorizePrestige: you can declare a string with the size you need then use it as a buffer
22:14:57disruptekyep.
22:15:23disruptekDOOOOOIT
22:15:40liblq-dev@awr1 doesn't work
22:15:40disruptekMOAR MOAR MOAR
22:15:50leorizeliblq-dev: just bindsym then quote it in?
22:15:56liblq-devas I said the error occurs in vertexAttrib not the macro
22:15:57FromGitter<awr1> you could maybe do that too
22:16:03FromGitter<awr1> what is your code
22:16:07Prestigeleorize: in another way than awr1 said?
22:16:13leorizeyea
22:16:24leorizevar str = newString(size_here)
22:16:27liblq-dev@awr1 just sent it… https://github.com/liquid600pgm/aglet/blob/master/src/aglet/gl.nim#L304
22:16:30leorizestr.cstring is your buffer
22:16:32Prestigeoh nice, thanks
22:16:34PrestigeI was afk
22:16:40FromGitter<awr1> ah i didn't think of that
22:16:45leorizeremember to setLen() after you got the correct size
22:17:01FromGitter<awr1> no i meant for the macro
22:17:08liblq-devI can't just use `bind` in the proc
22:17:14liblq-devbecause it only works for templates
22:17:35liblq-devwhat I'm getting is: /home/daknus/Coding/Nim/aglet/src/aglet/gl.nim(306, 35) Error: undeclared field: 'GlUint' for type system.int [declared in /home/daknus/.choosenim/toolchains/nim-1.2.0/lib/system/basic_types.nim(2, 3)]
22:17:46FromDiscord<Recruit_main707> !eval echo("i dont think so")
22:17:49NimBoti dont think so
22:18:02FromDiscord<Rika> someone else answer me T_T
22:18:11FromDiscord<Rika> disruptek says ok but i dont trust that dude
22:18:17disruptekwtf
22:18:19FromGitter<awr1> i mean what did you change here
22:18:20FromGitter<awr1> https://github.com/liquid600pgm/aglet/blob/master/src/aglet/arraybuffer.nim#L66
22:18:33leorizeRika: it's ok, as long as the compiler version is new enough
22:18:36liblq-dev@awr I made it construct the AST using basic procs like newCall etc
22:18:43FromDiscord<clyybber> @Rika IMO no
22:18:52disruptekdon't listen to clyybber.
22:18:53FromDiscord<clyybber> Just copy the Int128 file
22:19:03disruptekimport the whole thing.
22:19:16FromDiscord<clyybber> Oh key
22:19:24leorizewe should move int128 into fusion
22:19:33disruptekthe compiler needs it.
22:20:08*lritter quit (Quit: Leaving)
22:20:24FromGitter<awr1> "disruptek says ok but i dont trust that dude"
22:20:28FromGitter<awr1> disruptek is a secret agent /s
22:20:51FromDiscord<clyybber> If int128 gets added to the stdlib it must be made more convinient to use
22:20:53disruptekrika is a secret asian.
22:21:14FromGitter<awr1> int128 should probably get added imo
22:21:58*s4mu3lbk quit (Remote host closed the connection)
22:22:00FromGitter<awr1> it's a weird point of contention because it isn't super well supported in C but there is def. a desire for it
22:23:52FromGitter<awr1> @liblq-dev did you use `newCall(bindSym("vertexAttrib"), ...` etc.
22:24:04liblq-devyes
22:25:37disrupteki'm just finishing up a PR to add int130 to fusion.
22:26:12disruptekshould enough integers to last me through june.
22:27:20FromGitter<awr1> hm
22:27:33FromGitter<awr1> this is weird
22:28:50FromGitter<awr1> shot in the dark: you may want to try `GlUint(index)` and `GlSizei(stride)`
22:30:21liblq-dev@awr1 well, that seems to have worked
22:30:53FromGitter<awr1> may want to raise an issue then
22:33:41FromGitter<awr1> i feel like i have maybe encountered this issue, that the compiler sometimes doesn't like method syntax for converting to user defined types
22:35:48federico3https://github.com/FedericoCeratto/nim-httpauth/issues/5 urgh
22:35:49disbotpostgres and mysql shared libs required even when not used
22:36:22*couven92 joined #nim
22:36:30*fredrikhr quit (Disconnected by services)
22:36:36*couven92 is now known as fredrikhr
22:39:25skrylar[m]that looks like a way higher effort wrapper than the one i use. lol
22:40:16liblq-devskrylar[m]: are you talking about aglet?
22:40:31skrylar[m]correct
22:40:54liblq-devwell my philosophy is to create a wrapper that does not make you deal with low-level C state machine cruft
22:41:32FromGitter<awr1> i have a minimal example
22:41:37FromGitter<awr1> im gonna make an issue
22:41:55skrylar[m]i just have a very thin layer for things like mapping gl types to distinct ints and then unifying the procs on top of that
22:42:09skrylar[m]everything is 'use' mostly because bind was already a keyword
22:42:28liblq-devI named binding-related stuff 'use', too
22:42:42liblq-devbut it's meant to be hidden away from the end user
22:43:51liblq-devI'm mainly inspired by the API design from glium, but I decided to add some cool features that weren't possible there because of safety and all that Rust stuff
22:44:50liblq-devwell anyways I'm out for today. good night everyone
22:44:54*liblq-dev quit (Quit: WeeChat 2.8)
22:44:56skrylar[m]gnight
22:48:55FromGitter<awr1> https://github.com/nim-lang/Nim/issues/14254
22:48:57disbotCross-module refusal of method call syntax for type conversion in generic ; snippet at 12https://play.nim-lang.org/#ix=2l4Q
22:51:56*idf quit (Ping timeout: 272 seconds)
23:04:01PrestigeIs there a whitespace trimming proc for strings? I haven't found anything
23:05:29FromDiscord<Yardanico> strip or unindent depending on what you mean
23:06:10PrestigeThanks
23:12:55PrestigeLooks like that isn't how I should go about finding the "real size" of the filled string.. string returning 1024 instead of the length of the message I received
23:15:26*s4mu3lbk joined #nim
23:19:55FromDiscord<Rika> what're you trying to do
23:19:57PrestigeThis is what's happening https://play.nim-lang.org/#ix=2l57
23:20:21Prestigetrying to get the length of the actual string contents so I can reduce errorMessage to a proper length
23:22:43Prestige@Rika for context the function on line 2 has errorMessage as an out param
23:24:16FromDiscord<Rika> i know
23:24:27FromDiscord<Rika> are you sure its not supposed to be a ptr cstring
23:24:34FromDiscord<Rika> or a ptr char
23:25:40PrestigeI mean the call is working and I get the message back just fine, but len(errorMessage) is still 1024 and I want to reduce it once it's been partially filled
23:25:42FromGitter<awr1> try maybe
23:26:07FromGitter<awr1> `errorMessage.setLen(errorMessage.cstring.len)`
23:26:44FromDiscord<Rika> try echoing just the strip
23:26:51FromDiscord<Rika> and then repr that too
23:27:04Prestigeah errorMessage.cstring.len is what I needed, thanks
23:31:19*s4mu3lbk quit (Remote host closed the connection)
23:48:52*krux02 quit (Remote host closed the connection)
23:56:49*ftsf joined #nim