<< 04-05-2020 >>

00:05:03*Hideki joined #nim
00:05:26*Hideki is now known as Guest43628
00:11:46*krux02_ quit (Remote host closed the connection)
00:43:29*zacharyc1rter joined #nim
00:43:29*zacharycarter joined #nim
00:43:30*zacharyc2rter joined #nim
00:43:47*ryan__ is now known as the_tong
00:48:08*Guest43628 quit (Remote host closed the connection)
01:47:47*chemist69 quit (Ping timeout: 260 seconds)
01:49:52*chemist69 joined #nim
02:12:45*mono joined #nim
02:15:54*monok quit (Ping timeout: 272 seconds)
02:16:14FromDiscord<Avahe> @Elegant Beef Does your wm support multiple monitors?
02:16:26FromDiscord<Never Listen To Beef> Yep
02:16:47FromDiscord<Never Listen To Beef> I used xrandr through shell since i didnt realize there was an xrandr lib in the x11
02:17:09FromDiscord<Avahe> Oh okay, I'm just now starting to look into it
02:17:47FromDiscord<Never Listen To Beef> But again i dont know how to properly do xlib stuff
02:17:53FromDiscord<Never Listen To Beef> so no clue if what i did is a bodge
02:18:16FromDiscord<Avahe> I'll check dwm to see what they do
02:22:54FromDiscord<Avahe> @Elegant Beef they are using xinerama somehow
02:23:30FromDiscord<Avahe> XineramaQueryScreens, probably has a nim wrapper
02:23:47*muffindrake quit (Ping timeout: 240 seconds)
02:25:44*dddddd quit (Remote host closed the connection)
02:26:15*muffindrake joined #nim
02:32:39*mono quit (Remote host closed the connection)
03:18:06zacharyc1rterwhy doesn't this compile? https://play.nim-lang.org/#ix=2kGT
03:20:28zacharyc1rtermaybe I need to do `addr data[0]`
03:20:33PrestigeI think because Foo isn't an array? It's a type that has that array
03:20:49zacharyc1rteryeah I do
03:20:51Prestigeoh I misread
03:20:57zacharyc1rterC arrays are just pointers
03:21:03zacharyc1rterthat's why it works in C and not nim
03:21:23FromDiscord<Varriount> zacharyc1rter: `Foo` is an object. You can't modify object values in parameters.
03:21:30zacharyc1rterjust need to do `cast[ptr FooBar](addr f.data[0])
03:21:33zacharyc1rter`
03:21:54FromDiscord<Varriount> Oh, wait, I misread.
03:28:01*dannyfritz[m] joined #nim
03:32:03FromGitter<codenoid> stay healthy
03:35:04FromDiscord<Rika> well i've already failed that
03:37:07*vqrs quit (Ping timeout: 240 seconds)
03:42:09*waleee-cl quit (Quit: Connection closed for inactivity)
03:42:34*vqrs joined #nim
03:46:52FromDiscord<KingDarBoja> What Rika?
03:51:15*nsf joined #nim
03:51:48*xcm quit (Remote host closed the connection)
03:54:31*xcm joined #nim
04:01:55FromGitter<codenoid> :(
04:05:51FromDiscord<Rika> i've been pretty heavily underweight much before the lockdowns started
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:43*supakeen joined #nim
04:08:12*rockcavera quit (Remote host closed the connection)
04:23:34*thomasross quit (Ping timeout: 265 seconds)
04:30:09FromDiscord<KingDarBoja> :/
04:33:29FromDiscord<KingDarBoja> That sucks
04:53:54*mwbrown quit (Ping timeout: 240 seconds)
04:56:05*mwbrown joined #nim
05:01:17*Hideki joined #nim
05:01:40*Hideki is now known as Guest55443
05:08:46*audiofile quit (Quit: Going offline, see ya! (www.adiirc.com))
05:16:57*letto_ quit (Quit: Konversation terminated!)
05:19:02*Guest55443 quit (Remote host closed the connection)
05:20:35*letto joined #nim
05:25:17*chemist69 quit (Ping timeout: 244 seconds)
05:26:27*chemist69 joined #nim
05:27:46skrylar[m]hmm we have cooking utensils so its mostly just been a case of having to fire up the pressure cooker every couple days to process more beans or something. but this is ranching state and they are opening stuff back up, so i don't suspect the beef shortages are going to get that bad here.
05:28:07zacharyc1rterwoot
05:28:12zacharyc1rtermy fiber based job system works now on osx
05:29:07skrylar[m]i feel odd for being one of the few people who hasn't done any task/async work on nim. closest i came was the overwatch ecs, but that's not a task system either. xD
05:29:09zacharyc1rterof course I'm not using real fibers there
05:30:21skrylar[m]am quite tired of text processing though.
05:30:46FromDiscord<Rika> is your line-breaker optimized for raggedness?
05:31:27skrylar[m]no i tweaked it last night; remembered there was a special trick to it, then git reset it by accident and coded it again.
05:32:31skrylar[m]its a small pile of optimizations from a couple people and a very tiny bit from me, basically does greedy fill to the margin and then does the dynamic programming pass to cut words back from the margin until that stops getting improvements, and then added an optional fork limit from adobe so you can pretty well box in its worst case performance
05:33:09skrylar[m]otherwise it just tries to minimize distance of all lines to the margin within as many lines its permitted to scan at one time, so its basically the tex breaker-lite
05:33:15zacharyc1rterhttps://gist.github.com/zacharycarter/ce87fc63641f51d713b7b15b5603b6d2
05:33:39FromDiscord<Rika> have you seen this?
05:33:46FromDiscord<Rika> https://xxyxyz.org/line-breaking/
05:34:15skrylar[m]not this specifically no
05:34:29FromDiscord<Rika> maybe it'll be helpful
05:34:48skrylar[m]need to do some memory tweaks and get the amount of fields down cause each letter uses more memory than i'd really like, but meh. and then need a style field for the shaders
05:35:57*narimiran joined #nim
05:36:35skrylar[m]hm. the binary search one sounds weird
05:38:00skrylar[m]https://gist.github.com/Skrylar/179648d5856ae49087ad34a87d0740f9 right now it just uses the dynamic programming one with some opportunistic a-b pruning
05:44:39*zacharycarter left #nim (#nim)
05:45:17*zacharyc1rter is now known as zacharycarter
05:48:24AraqYardanico: now it works
06:09:03*solitudesf joined #nim
06:22:32*xcm quit (Read error: Connection reset by peer)
06:24:38*xcm joined #nim
06:32:52*covidian is now known as off
06:32:53*off is now known as covidian
06:33:02*zacharyc2rter quit (Ping timeout: 272 seconds)
06:33:02*zacharycarter quit (Ping timeout: 272 seconds)
06:35:14*silvernode joined #nim
06:37:52*PMunch joined #nim
06:39:22silvernodeDoes anyone recall off the type of their head how to get the type of a variable and echo it back? I tried the proc: 'typeof(myVar)' but nothing printed back when using echo
06:42:48silvernodeNever mind, I think I figured it out
06:42:58FromDiscord<Rika> try it again
06:53:52*Jesin quit (Ping timeout: 256 seconds)
06:57:06*silvernode quit (Ping timeout: 272 seconds)
07:04:52*sz0 joined #nim
07:06:48*zacharyc1rter joined #nim
07:06:48*zacharycarter joined #nim
07:09:50*covidian is now known as off
07:09:51*off is now known as covidian
07:11:32*zacharyc1rter quit (Ping timeout: 260 seconds)
07:11:32*zacharycarter quit (Ping timeout: 260 seconds)
07:13:31*covidian left #nim ("Konversation terminated!")
07:39:48*Vladar joined #nim
07:43:14*zacharyc1rter joined #nim
07:43:14*zacharycarter joined #nim
07:47:57*sentreen_ joined #nim
07:48:24*zacharyc1rter quit (Ping timeout: 272 seconds)
07:48:24*zacharycarter quit (Ping timeout: 272 seconds)
07:50:45*sentreen quit (Ping timeout: 256 seconds)
08:28:32*WilhelmV1nWeiner quit (Quit: leaving)
08:28:47*WilhelmVonWeiner joined #nim
08:33:10*fredrikhr joined #nim
08:36:57Araqleorize, if you write osproc2 please keep the 'startX' vs 'execX' distinction
08:38:35*xcm quit (Remote host closed the connection)
08:40:47*xcm joined #nim
08:44:47FromDiscord<Yardanico> @Araq wow amazing, thanks
08:45:09Araqin the end, it was a hard to find DFA bug
08:45:42Araqbug every fix brings us closer to 'koch boot --gc:arc' working
08:47:55Araqwow this new 'nim r foo.nim' is *nice*
08:48:35FromDiscord<Yardanico> Yeah finally I won't have to add weird gitignore rules to ignore files without extensions
08:49:45Zevvwhat is new about "nim r"?
08:49:58*Jesin joined #nim
08:50:03narimiranZevv: notice the lack of `c` between `nim` and `r`
08:50:04FromDiscord<kodkuce> rror: getAppFilename failed. (Error was: Unable to read /home/me/.choosenim/current. (Error was: No installation has been chosen. (File missing: /home/me/.choosenim/current)))
08:50:04FromDiscord<kodkuce> Info: If unexpected, please report this error to https://github.com/dom96/choosenim
08:50:25Zevvnarimiran: oh right :)
08:50:42FromDiscord<kodkuce> @dom96 hmm i put choosenim in other dir 😦
08:53:08FromDiscord<Yardanico> @Zevv binary is put into nimcache dir
08:53:28FromDiscord<Yardanico> Not the directory with the source file
08:55:13Zevvah sweet!
08:55:59FromDiscord<kodkuce> my choosenim path /home/me/Documents/Apps/Nim/Choosenim 😦 i did not wanted to blaot home
08:56:05FromDiscord<Yardanico> Now I only need to figure out how to change c -r to r in vscoee
08:56:08FromDiscord<Yardanico> *vscode
08:57:51FromDiscord<XeroOl> hello
08:58:18FromDiscord<XeroOl> is there an idiomatic way to create a two dimensional array in nim?
08:58:32FromDiscord<XeroOl> ie seq[seq[int]]
08:58:34FromDiscord<Rika> what do you mean?
08:58:42FromDiscord<XeroOl> it seems like initializing this is going to need loops
08:59:07FromDiscord<Rika> var a: seq[seq[int]] = @[@[]]?
08:59:17FromDiscord<Rika> does that even work actually hmm
08:59:28FromDiscord<XeroOl> well that's just a list in a list
08:59:40FromDiscord<XeroOl> I'm hoping for more of like a 100x100 grid of 0's
08:59:45FromDiscord<Rika> 2d arrays are lists in lists
08:59:53FromDiscord<XeroOl> yeah that's what I mean
09:00:16FromDiscord<XeroOl> is there a constructor for a list that just says to do a thing a bunch of times?
09:00:17FromDiscord<Rika> import sequtils; @[0.repeat y].repeat x
09:00:28FromDiscord<Rika> i think?
09:00:38FromDiscord<XeroOl> I will look into sequtils
09:00:39FromDiscord<Recruit_main707> var a: array[100, array[100, int]] is initialised to 0s iirc
09:00:43FromDiscord<Rika> actually no, just 0.repeat(y).repeat(x)
09:00:49*ryan_ joined #nim
09:00:53FromDiscord<XeroOl> yeah that looks probably ideal
09:00:55FromDiscord<Rika> @Recruit_main707 thats if the number is defined compile-time
09:01:14FromDiscord<XeroOl> I need it to be seq in my particular case, but the array example is good to keep in mind
09:01:16FromDiscord<Rika> if its always 100x100, then go with array
09:01:21FromDiscord<Recruit_main707> if its a seq, newSeq wont initialise it also?
09:01:36FromDiscord<Rika> no, you'll need at least one loop for that
09:01:38FromDiscord<Rika> lets see
09:01:48FromDiscord<XeroOl> I think you can do an initializer list maybe
09:01:54FromDiscord<XeroOl> I think you can do an initializer list maybe?
09:02:02Araqfor big matrixes like that use a special Nimble package like arraymancer
09:02:04FromDiscord<Rika> !eval import sequtils; echo 0.repeat(2).repeat(2)
09:02:07NimBot@[@[0, 0], @[0, 0]]
09:02:27Araqdon't tinker with nested seqs for that, it's messy and slow
09:02:34*the_tong quit (Ping timeout: 240 seconds)
09:02:44FromDiscord<XeroOl> what would you recommend then?
09:02:48FromDiscord<Rika> oh yeah, you did mention it was rectangular
09:02:51FromDiscord<Rika> use arraymancer
09:02:57Araqarraymancer
09:03:09FromDiscord<XeroOl> I'm hoping to have a growable two dimensional grid
09:03:23FromDiscord<Yardanico> https://github.com/mratsim/Arraymancer
09:04:24FromDiscord<XeroOl> I just need a two dimensional array
09:04:43FromDiscord<XeroOl> is this useful even if I'm not planning on doing machine learning magic?
09:05:00Araqthen you might go with the nested seqs
09:05:21FromDiscord<Yardanico> @XeroOl yeah it's useful even if you don't do machine learning
09:08:50FromDiscord<XeroOl> hmm, I could maybe try applying gpu magic
09:08:58FromDiscord<XeroOl> I'm not even sure what I want to do for this problem
09:09:10FromDiscord<XeroOl> I'll definitely look into arraymancer, thanks a lot
09:11:44FromDiscord<XeroOl> how do I use a nim package in my code?
09:12:13FromDiscord<XeroOl> sorry, I'm entirely new to nim, so it's my first time figuring out third party libraries
09:12:25Araqnimble install arraymancer
09:12:39FromDiscord<XeroOl> okay
09:12:48FromDiscord<XeroOl> and then do I just `import arraymancer` in the code?
09:13:06Araqdepends but yes.
09:13:14FromDiscord<Recruit_main707> the readme in github has a few examples
09:13:49FromDiscord<XeroOl> ahh, I see the examples now
09:14:06FromDiscord<XeroOl> I scrolled too far down before I decided to use it, and the later examples didn't have the import
09:15:42FromDiscord<XeroOl> okay, I've got it working, thank you very much
09:21:42FromDiscord<Never Listen To Beef> I always forget people actually use multidimensional arrays
09:21:52FromDiscord<Recruit_main707> you could try using something like this:
09:21:52FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2kIy
09:21:52FromDiscord<Recruit_main707> it probably fits better your problem
09:23:34FromDiscord<Recruit_main707> (i didnt change the name of populate_array, it should be populate_matrix)
09:24:40FromDiscord<XeroOl> the (0).repeat(a).repeat(b) seemed more concise to me
09:24:42FromDiscord<Yardanico> Time to test more Nim libraries and apps with arc/orc I guess
09:24:44FromDiscord<XeroOl> for the seq case
09:25:27FromDiscord<Recruit_main707> up to you :)
09:25:33AraqYardanico: definitely
09:25:59FromDiscord<Recruit_main707> you canot change the gc in playground can you??
09:26:52dom96Ahh, what a fun AMA
09:30:11*abm joined #nim
09:32:04Yardanicodom96: maybe you already saw but Araq fixed arc for irc module (it turned out to be not related to async at all) :)
09:32:26dom96cool, what was the issue?
09:32:49Yardanicohttps://github.com/nim-lang/Nim/issues/14207
09:32:50disbotwrong sink parameter passing
09:33:58Yardanicothis snipped outputted "abc" before
09:35:58Araqwas a "fun" bug
09:36:26Yardanicoyeah i'm really surprised, I would've never thought it wouldn't be related to async at all
09:38:04Araqit's your coding style man, it sux ;-)
09:38:28Araqyou use methods, for example
09:38:47Yardanico?
09:38:54Yardanicoi don't really use them, wdym :P
09:39:09Araqnah, I'm kidding. but it is true that different styles trigger different codepaths, unfortunately
09:39:14Yardanicoah
09:39:27Araqso this time 'return x' was worse than 'result = x; return'
09:40:28Yardanicook so apparently jester doesn't compile with orc
09:41:25Araqwhy not?
09:41:52Yardanico" Error: type mismatch: got <proc (req: sink Request): Future[system.void]{.closure, gcsafe, locks: <unknown>.}, Settings>" but expected ... "proc run(onRequest: OnRequest)"
09:42:09Yardanicosink inference again I guess, will try to understand where it fails
09:42:18Yardanicoits a proc accepting an async proc as an argument
09:42:44Yardanicooh well found where to put nosinks
09:43:12Yardanicoi'll try to minimize
09:44:06Araqah that one is known
09:44:35Yardanicoah okay
09:44:40Araqand that one is sink *inference*, it doesn't understand proc types
09:45:15Araqand it cannot without breaking modularity so we'll probably only enable for the stdlib... sucks
09:46:08Yardanicoyeah compiling nimble with arc fails for relatively same reason
09:46:46Yardanicosequtils.map accepts a proc(s: string) but the passed proc is proc(s: sink string)
09:47:17Yardanicoafter adding nosinks to two proc arguments it compiles fine
09:47:32YardanicoI mean to two procs passed as arguments (in different places) *
09:48:02Araqthe old .procvar design would have helped us :-/
09:51:21Yardanicohmm what could go wrong if I add --gc:arc as the default one in my user-wide nim config :P
09:54:59Araqnothing do it.
09:55:26Araqlikewise, what could go wrong if I re-implement nimscript from scratch
09:55:38Yardanicoalso seems like nimble test suite fails for --gc:arc, not sure why
09:55:41Yardanico" Error: Downloaded package's version does not satisfy requested version range: wanted 0.6 got " :P
09:55:52Yardanico"... got ." *
09:55:57Yardanicodot
09:56:11Araq^ now that looks like a move optimizer bug. again
09:56:17Yardanicoyay
09:56:27Araqcreate a snippet reproducing the problem please
09:56:40Yardanicowell yeah I'll try again but nimble isn't exactly very small :D
09:57:19Araqbut nimble's version parsing code is
09:57:25Yardanicoah right
09:57:55Yardanicoyeah I can reproduce it with "nimble install https://github.com/nimble-test/packagebin2", now gonna read nimble src
09:58:53Yardanicoor even better "nimble install https://github.com/babel-test/[email protected]"
09:59:04dom96just run the version.nim file
09:59:07dom96there are tests in there AFAIK
09:59:16dom96they might already fail
09:59:16Yardanicoyou're right
09:59:17Yardanicothere are
09:59:20Yardanicoi'll try
09:59:43Yardanicobut they all pass :P
09:59:58Yardanicoso it's not as simple
10:00:23Araqfwiw all GC tests are green with --gc:orc
10:00:41Araqso it's not exactly vaporware
10:01:02Araqbut now it's time to run bigger projects, yes
10:02:17*xcm quit (Remote host closed the connection)
10:02:27*lritter joined #nim
10:04:28*xcm joined #nim
10:05:09Zevvlike, the nim compiler, just to pick one
10:05:25YardanicoZevv: well yeah that's one of the targets, but it's too early for that I guess :P
10:05:34Yardanicoit's better to debug some other smaller projects before the compiler
10:05:36Zevvhaha that would be the ultimate test, right
10:06:07AraqZevv, clyybber is doing that
10:06:44Araqand I will too but today's todo is "reimplement nimscript"
10:06:51Yardanicook found a bit of clue, getPkgInfo returns an empty PackageInfo object with arc
10:07:11Yardanicolet pkginfo = getPkgInfo(result[0], options)
10:07:41Yardanicohmm I'll just try copying some procs to try to reproduce it
10:09:59dom96Araq, ehh wat?
10:10:09dom96why are you reimplementing nimscript
10:10:41Araqcause the current impl sucks and causes on-going costs
10:11:19dom96just kill the feature :P
10:11:34Araqyou probably misinterpret what 're-implement' implies
10:11:58dom96I've been playing with the idea of just writing a simple parser for "above the fold" metadata in Nimble
10:12:02dom96and compiling each `task` into an exe
10:12:38Araqjust work on lockfiles instead please
10:12:52Araqor any other of the improvements we wrote RFCs for
10:13:21dom96I'd love to work on lockfiles, but there is someone who has a grant from Status working on them
10:13:24dom96I'm still waiting for news
10:13:51Araqparsing the code is as simple as 'import compiler / parser' anyway, we had the code
10:14:12Araqbut we decided it's better to let Nim do the parsing
10:14:35Araqdom96, ok, so do this instead:
10:14:47dom96hah, was just looking at the map on gitter.im and saw FromIRC on #nim pop up
10:14:47Araqmake Nimble not swallow the compiler's warning messages
10:15:53dom96in what context?
10:16:13Araq'nimble build/c/cpp/js'
10:16:36dom96I'm pretty sure compiler's messages are not swallowed for c/cpp/js
10:16:54Araqthey are also put into red dots and stuff
10:17:02dom96so which is it?
10:17:08dom96the red dots or that warnings are swallowed
10:17:17Araqboth
10:17:26dom96I cannot take you seriously if I cannot trust that this actually affects you
10:17:39dom96since you do not seem to know in which instances this actually happens for me to fix it
10:17:51dom96make an issue with a paste
10:17:54Araqwell currently I'm not running Nimble
10:17:56dom96showing the problem
10:17:56*solitudesf quit (Ping timeout: 256 seconds)
10:18:11Araqthe problem is already in Nimble's issue tracker
10:18:53AraqI don't need to prove you that I use Nimble because I haven't used it in the last months. I might use it again though
10:19:27dom96link me to the issue at least so that I know what you're referring to
10:19:37dom96like I said, it shouldn't happen for `c/cpp/js`
10:20:05Araqhttps://github.com/nim-lang/nimble/issues/572
10:20:08disbot`nimble build` should display warnings produced by the nim compiler ; snippet at 12https://play.nim-lang.org/#ix=2kJ4
10:21:08FromGitter<jorjun_twitter> Three.js first webGL demo
10:21:10dom96right, so it's just `nimble build`
10:21:15dom96and like I said in that issue
10:21:16FromGitter<jorjun_twitter> https://pastebin.com/aJbtUsyk
10:21:18dom96it is up for the debate
10:21:29dom96if you want that to happen then make your case known in the issue
10:22:37AraqI did, now what? are you gonna ignore it for 2 more years
10:23:50dom96Replied
10:24:12dom96it comes down to `build` being a nimble-only command
10:24:17FromGitter<capocasa> Is there a common way to use "try" without an extra scope, the better to use let? ⏎ ⏎ Right now I do: ⏎ ⏎ var a ... [https://gitter.im/nim-lang/Nim?at=5eafed517975db7ebfe272e1]
10:24:41dom96Also, FYI `build` is called when installing packages
10:24:47FromDiscord<Rika> jorjun: time to show this to my js friends
10:24:50dom96I don't want to see warnings spammed in my CLI when installing packages
10:24:56dom96so no, I will not fix this.
10:25:12FromDiscord<Rika> what if some people do
10:25:16dom96unless you can give me a good argument why I should
10:25:24FromDiscord<Rika> (i think i do, i wanna see if some package is beyond fixing)
10:25:27Araqwell how about
10:26:06Araq"nimble build is for end-users of Nim software." is completely unreasonable as Nimble is not for end-users of Nim software at all, therefore are installers/bundlers
10:26:33FromDiscord<Rika> capocasa: https://play.nim-lang.org/#ix=2kJ6
10:26:34dom96Nimble is for end-users of Nim software
10:26:36Yardanicook managed to reduce it to a single 1.4k loc file (copying stuff from different source files into one)
10:26:37Araqand if you won't fix it, close the issue
10:27:03dom96fair enough
10:27:32Araqand it implies that I keep to have in mind *all the time* not to use 'nimble build'
10:27:57Araqbut instead to use 'nimble c', I fail to see how that is a good user experience for anybody
10:28:14FromGitter<alehander92> morning
10:28:17FromGitter<alehander92> lunch&
10:28:18FromGitter<alehander92> *
10:28:39*liblq-dev joined #nim
10:30:40FromDiscord<Rika> capocasa: did you see what i posted? or is gitter like discord where you need to ping them with some id or something
10:30:45dom96Araq, you can clearly see that `nimble build` gives you no compiler messages
10:30:57dom96it surely doesn't take much to make the leap that it won't show you warnings
10:31:16FromDiscord<Rika> one can assume that it just has verbosity lowered
10:31:20FromDiscord<Rika> instead of having it off
10:31:55dom96that is a fair assumption, and that is the case AFAIK
10:32:54Araqdom96, it's ok, moving on
10:35:12Araqhttps://github.com/nim-lang/nimble/issues/130 I'd close this, no idea what people want plus semver is crap
10:35:14disbotRequire Semantic Versioning ("Semver") ; snippet at 12https://play.nim-lang.org/#ix=2kJ8
10:35:21FromGitter<capocasa> @Rika Cool, thanks!!! (I think gitter looks for @username)
10:36:50Araqor this one https://github.com/nim-lang/nimble/issues/315 'nimble init' does that now
10:36:52disbotStandardising nimble package structure ; snippet at 12https://play.nim-lang.org/#ix=2kJa
10:36:58*PMunch quit (Quit: leaving)
10:37:01Araqjust go through your issues and clean them up
10:37:13FromDiscord<Rika> `Test for features, not for versions` damn this is actually really smart
10:37:22dom96Araq, I do that when I have time to work on Nimble
10:37:33dom96But so far I didn't have the time
10:37:36*Trustable joined #nim
10:37:42Araqdom96, sorry you were talking about implementing yet another parser
10:37:48dom96Nimble is an official Nim-lang project, it may be time to commit some of your time to it
10:37:55Araqso I figured I'd give you better tasks
10:38:02*PMunch joined #nim
10:38:03dom96I'm not actually going to do it lol
10:38:18Araqok, misunderstanding here
10:38:39dom96Lack of lock files is actually hindering me, so I would consider working on it assuming that nothing comes of the work from the Status grant
10:38:54dom96I pinged zah to ask what's going on with it
10:46:08dom96Can we get a similar HCR demo? https://twitter.com/v_language/status/1257256122647482370
10:46:57FromDiscord<Rika> has anyone actually seen someone talk about v in a non-controversial way?
10:47:11Yardanicodom96: we had a similar demo years ago, even before HCR existed :P
10:47:45YardanicoI think I saw it on youtube
10:48:11dom96Rika: plot-twist, I'm actually writing my game in V :P
10:48:12FromDiscord<Rika> got a link? how would this exist if not for HCR...
10:48:31FromDiscord<Rika> dom96: o_o
10:48:38Yardanico@Rika because you can make it without HCR
10:48:44Yardanicojust do a separate lib and watch if that file changes
10:48:50Yardanicoif it does - reload that dynamic library at runtime
10:49:05Yardanicoofc for more complex projects that makes things really hard, but for demos it's ok
10:49:07FromGitter<alehander92> which is what hcr does internally, right?
10:49:15dom96what is the state of HCR in Nim?
10:49:26dom96It would actually be pretty sweet to use for my game
10:49:41FromDiscord<Recruit_main707> non existent? :p
10:49:53Yardanicohttps://www.youtube.com/watch?v=48X4PeHxkNg
10:49:54Yardanico2016
10:50:02euantorAll I know is that the tests fail on the BSD systems I've tested on, as that's the only time I've looked at HCR
10:50:06FromGitter<alehander92> it should be usable
10:50:18FromGitter<alehander92> but probably there might be some issues setting it up
10:50:40FromGitter<alehander92> trying to use it for an actual usecase would probably help a lot :P
10:50:59shashlickAraq what's your plan for nimscript
10:54:19*liblq-dev quit (Quit: WeeChat 2.8)
10:58:17FromDiscord<Rika> question: why is there a `DateTime`, a `Time`, but not `Date` in the `times` module?
10:58:28YardanicoAraq: I think I got a rough idea of the bug, basically nimble does "try: result = readPackageInfo(file, options) except ValidationError: check if it's a warning and output, if it's an error - raise"
10:58:42Yardanicoand with default GC this "result = readPackageInfo(file, options)" is still set even if the exception is raised
10:58:54YardanicoI mean the result contains package info even if the exception was raised
10:59:17Yardanicomaybe that's not the primary cause though, I still didn't made it into a smalle xample
11:01:56dom96what's more likely is that the `result` is not being initialised with a default value under arc
11:02:14Yardanicowell if nimble doesn't throw an exception it works fine
11:03:46YardanicoI mean the ValidationError
11:04:56dom96yeah, because the `result` gets set
11:05:03dom96if it throws an exception it doesn't get set
11:05:13Yardanicowell it throws an exception without arc as well
11:05:26Yardanicobut "result" is still set to the info from the .babel file
11:05:37Yardanicobut with arc it's being reset to defaut value or something like that
11:07:19*dddddd joined #nim
11:07:19*idf quit (Read error: Connection reset by peer)
11:07:28FromDiscord<clyybber> @Recruit_main707 no. Its very well existant.
11:07:56FromDiscord<Recruit_main707> w/ dlls from what ive saaw
11:08:27FromDiscord<clyybber> yeah, so?
11:08:27Yardanicoi forgot, how do I make nim don't output ANYTHING?
11:08:32FromDiscord<clyybber> There is no other way to do it.
11:08:33Yardanicojust silently compile the binary and run
11:08:38FromDiscord<clyybber> In a compiled language
11:08:46dom96clyybber: how difficult is the setup?
11:09:02FromDiscord<Recruit_main707> i just didnt know dlls could be recompiled that way
11:09:06FromDiscord<clyybber> dom96: Its pretty easy. I think it has a section in the manual
11:09:16Yardanico@Recruit_main707 it's not about recompilation really
11:09:29Yardanicobasically your main app has a watch dog to check if a library changed
11:09:34Yardanicoif it changed - reloads that library
11:09:42FromDiscord<clyybber> @Recruit_main707 Binaries like .exe can't on windows. But dll's can. So thats why it uses dlls
11:09:50FromDiscord<clyybber> *executable
11:10:36FromDiscord<Recruit_main707> is there some kind of guide on this or it just works out of the box?
11:10:52FromDiscord<Recruit_main707> hot reloading would be very helpful for my project
11:10:56FromDiscord<clyybber> Basically, you first need to compile the nimhcr.nim file
11:11:05FromDiscord<clyybber> And then compile your project with --hotcodereloading:on
11:11:46dom96hrm, I'll have to try that
11:12:44FromDiscord<clyybber> Oh, maybe I'm stupid and compiling nimhcr manually isn't required anymore
11:12:47FromDiscord<clyybber> dom96: See https://nim-lang.github.io/Nim/hcr.html
11:14:09FromDiscord<clyybber> Ah, no its still required. See the Native Targets section
11:16:19FromGitter<alehander92> Yardanico you should turn hints and warnings off
11:16:21FromGitter<alehander92> i think
11:16:27Yardanicoyeah I've done it now
11:16:29Yardanico--hints:off -w:off
11:16:53FromGitter<alehander92> does it still output stuff
11:16:59Yardanicono
11:17:01Yardanicosilent
11:17:25FromGitter<alehander92> yeah we do it in our tup file watcher build setup
11:17:25YardanicoAraq: I reproduced it but IDK if it's an error or incorrect usage of exceptions
11:17:35AraqYardanico, show me
11:17:41FromGitter<alehander92> much easier when you build many files (but warnings should be ideally on .. indeed ..)
11:17:42Yardanicohttps://gist.github.com/Yardanico/374439055ce14b8115a0846d94d87145
11:17:49Yardanicooutputs "testlol" with default GC, nothing with arc
11:18:01Yardanicoi mean empty string
11:20:26Yardanicois that what you call undefined behaviour? :D
11:21:44Araqhuh
11:22:00*fredrikhr quit (Read error: Connection reset by peer)
11:22:22AraqI don't know what --gc mode produces the correct behaviour
11:22:26*fredrikhr joined #nim
11:22:27Yardanicolol
11:22:57Araqthe new impl seems better
11:23:32Araqwhy would result.mypath have any info when there was an exception
11:23:51Yardanicowell yeah I was confused too, but nimble relies on this for validation errors
11:24:27Araqso Nimble relies on old Nim bug
11:24:33Araqwe should fix Nimble
11:29:54Yardanicoso to track it should I open the bug in nimble or nim?
11:30:15*zacharycarter joined #nim
11:30:16*zacharyc1rter joined #nim
11:31:28*fredrikhr quit (Read error: Connection reset by peer)
11:31:53*fredrikhr joined #nim
11:32:51*xcm quit (Remote host closed the connection)
11:33:16Araqnimble
11:33:34Yardanicoyeah I made https://github.com/nim-lang/nimble/issues/798
11:33:37disbotNimble doesn't work with --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2kKF
11:35:33*xcm joined #nim
11:35:43Yardanicowell time to test something else then I guess :D
11:40:00FromDiscord<Rika> i've been using nim for so long, yet still do not know how to fix a `Cannot prove that 'result' is initialized.`
11:40:18Yardanicoresult = Object(fields)
11:40:31FromDiscord<Rika> why?
11:40:41FromDiscord<Rika> why is that needed?
11:40:46Yardanicowell you don't have to specify all fields there
11:40:52Yardanicoresult = Object(); result.fieldA = stuff
11:40:54YardanicoI guess
11:41:26FromDiscord<Rika> still dont understand why its needed, isnt result default(type) at start?
11:41:40Yardanicowhat's the type of "type" ?
11:42:04FromGitter<alehander92> if its ref Object its nil by default iirc
11:42:10Yardanicoyeah
11:42:11FromGitter<alehander92> ref object*
11:42:14Yardanicoand that's not really "initialized" :P
11:42:15FromDiscord<Rika> its not a ref
11:42:31FromDiscord<Rika> which is why im baffled
11:42:36FromGitter<alehander92> so what is it
11:43:31*cgfuh joined #nim
11:44:15FromDiscord<Rika> its just an object, no variants either
11:44:21AraqRika: it contains something that needs explicit inits, like a range[1..3]
11:45:18FromDiscord<Rika> oh, so if it *contains* a ref object, itll warn this too?
11:48:57YardanicoAraq: ok, compiler crash with --gc:arc for nim-regex :P
11:49:02FromDiscord<Rika> oh, i see, so DateTimes require initialization
11:49:11FromDiscord<Rika> perhaps due to the ranges
11:50:40Yardanicohttps://github.com/nitely/nim-regex and compiler stacktrace https://gist.github.com/Yardanico/14e9d16fafe59198c43e2e1b1a5ec218
11:50:45Yardanicothat's interesting is what it fails in C backend
11:50:53*monokrom joined #nim
11:50:58Yardaniconim c --gc:arc src/regex.nim
11:51:09FromGitter<alehander92> so probably the error message
11:51:16FromGitter<alehander92> should somehow hint at what type is unitialized
11:51:26FromGitter<alehander92> i agree it seems a bit hard to debug otherwise
11:52:12FromGitter<alehander92> (what is the chain of "uninitializated" fields but maybe thats hard)
11:52:53FromDiscord<Rika> alehander92: it only shows if you use the `Type()` style initialization and not rely on result being default'ed
11:54:09FromGitter<alehander92> yeah, but i guess it just shows one level further?
11:54:13FromGitter<alehander92> which is natural
11:54:18FromGitter<alehander92> if its A.b.c.d.e
11:54:36FromGitter<alehander92> from A -> unitialized you just get to A() -> b: unitialized
11:54:45FromDiscord<Rika> i guess yeah
11:54:47FromGitter<alehander92> but still the error would be good to show b.c.d.e
11:55:09FromGitter<alehander92> but i guess "PRs would be welcome" :P :D
11:56:32*nsf quit (Quit: WeeChat 2.8)
11:57:29Yardanicooh loool
11:58:04YardanicolookupFieldAgain for some reason gets this as a type: https://gist.github.com/Yardanico/1e8c54a798b2989751ab8bac076c3276
11:58:09Yardanicowell it's understandable, nim-regex works at compile-time
11:58:14Yardanicobut that's some heavy static usage :P
12:00:10YardanicoI tried to do "ty = ty.skipTypes(skipPtrs + {tyStatic})" (that's obviously incorrect) and got tons of errors at c compiler stage instead :P
12:00:17Yardanico"error: conversion to non-scalar type requested"
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:41*supakeen joined #nim
12:10:25*rockcavera joined #nim
12:25:06*NimBot joined #nim
12:32:33YardanicoAraq: found another arc bug with iterators (default inline ones) and imports
12:32:50Yardanicohttps://gist.github.com/Yardanico/77cc01f12fcc37ee6c31cbfe03b2ca19
12:33:02Yardanicofound in nimcrypto (it uses import for importing all tests)
12:33:28Yardaniconimcrypto itself works btw
12:34:07*zacharyc1rter quit (Ping timeout: 260 seconds)
12:34:08*zacharycarter quit (Ping timeout: 260 seconds)
12:34:11Yardanicoah wait wrong example I think
12:34:29Yardanicoah nvm it's the right one
12:34:38Yardanicoworks with default GC (compiles fine), errors at C compiler stage with arc
12:36:49Yardanicohttps://github.com/nim-lang/Nim/issues/14219 just to track it
12:36:51disbotARC codegen bug ; snippet at 12https://play.nim-lang.org/#ix=2kLa
12:37:22*Kaivo joined #nim
12:37:56Yardanicofails on 1.2 too, so not a regression I guess
12:38:27*thomasross joined #nim
12:53:47*krux02 joined #nim
13:04:58*fredrikhr quit (Read error: Connection reset by peer)
13:05:21*fredrikhr joined #nim
13:17:35*audiofile joined #nim
13:18:35FromDiscord<Rika> just noticed httpbeast's being beat by pico.v, is that normal? is it normal for microframeworks to be faster than platforms
13:19:06Yardanicoalmost nothing beats picohttpparser
13:19:12Yardanicobut it's not so useful for real world usage
13:19:22dom96orly
13:19:23dom96link?
13:19:34YardanicoI mean for parsing http
13:19:41Yardanicohttps://github.com/h2o/picohttpparser
13:19:50dom96no, link to the bench results
13:20:54FromDiscord<Rika> yardanico, are you referring to me?
13:21:05FromDiscord<Rika> https://www.techempower.com/benchmarks/#section=test&runid=f9cc9020-a381-4cb0-9614-4fc27c033b5c&hw=ph&test=json
13:21:21FromDiscord<Rika> json and plaintext, pico.v is super high
13:21:35FromDiscord<Rika> in fact pico.v is top on plaintext
13:21:42PMunchGood AMA by the way dom96
13:22:25dom96Rika: these benchmark results look a bit broken to me
13:22:51FromDiscord<Rika> yeah which is why i was questioning if it was normal
13:22:59dom96httpbeast going from 92% on plaintext to 58%?
13:23:03dom96seems unlikely
13:23:04FromDiscord<Rika> it does say something about a "realistic implementation approach" or so
13:23:33dom96but who knows
13:24:37Yardanicothis is the run results for next to last commit
13:24:38Yardanicohttps://www.techempower.com/benchmarks/#section=test&runid=64be2110-3011-48ae-8416-30c0ac0609c1&hw=ph&test=json
13:24:44Yardanicoits quite flaky
13:24:53Yardaniconow some Java http lib is #1 xd
13:26:33Yardanicoidk if you guys consider that "a realistic approach", but I don't :D
13:26:34Yardanicohttps://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/V/pico.v/main.v
13:26:39FromDiscord<Rika> do they conduct many tests or do they just run it once per and call it a day?
13:26:55Yardanicoonce per commit, that's like CI
13:27:12FromDiscord<Rika> also i got the link from a tweet from vlang's twitter, and theres a tweet under it that says this
13:27:13FromDiscord<Rika> https://twitter.com/Beranek1582/status/1235303139470868482
13:27:14Yardanicoit takes like 100 hours in total for one commit to complete
13:27:20Yardanicoyes ikr
13:27:25Yardanicothat's why it's not really realistic at all
13:28:03Yardanicocheck out https://github.com/S-YOU/pico.v for source, I can implement the same in nim lol
13:28:07Yardanicojust wrap picoev and picohttpparser
13:28:08FromGitter<alehander92> well its not like python isnt based on C libs
13:28:15FromGitter<alehander92> for all kinds of things
13:28:25FromGitter<alehander92> thats why its so hard to define good benchmarks
13:29:39FromDiscord<Rika> maybe next time benchmarks must require pure implementations or something, though its just as hard to define those
13:29:59FromGitter<alehander92> but this would compare ecosystems, not languages
13:30:00Yardanicothese are synthetic bencmarks anyway :P
13:30:04FromGitter<alehander92> which might be valid :P
13:30:18FromGitter<alehander92> but thats the thing: its very hard to measure everything in the same time
13:30:30*fredrikhr quit (Read error: Connection reset by peer)
13:30:45FromGitter<alehander92> on theory you could probably write similarly-quick code for many things in most system langs
13:30:53FromGitter<bung87> why not try nodejs/http-parser
13:30:57*fredrikhr joined #nim
13:30:59FromGitter<alehander92> so it is probably indeed better to just compare real world projects
13:31:25*reyan joined #nim
13:31:26dom96yeah, this is ridiculous lol
13:31:27FromGitter<alehander92> and keep in mind that language used is just one part of the whole thing
13:32:25dom96I'll create a compiler which compiles only enough to support the bare essentials of routing and calling C functions
13:32:31*couven92 joined #nim
13:32:31Yardanico :P
13:32:32FromDiscord<Rika> idk i really just found it sketchy that vlang was proud of this
13:32:36FromGitter<alehander92> dom96 that's a lame argument
13:32:36dom96then wrap pico and put it to the top of the leaderboard
13:32:56FromGitter<alehander92> just wrapping pico might be lazy, but it reveals a much bigger problem with benchmarks
13:33:06dom96also I'm suspicious of V's use of [inline]
13:33:09FromGitter<alehander92> that overally its not really about the language
13:33:25FromGitter<alehander92> but about the engineering / domain effort put in a certain lib
13:33:35dom96yes, it is
13:33:46dom96these benchmarks mean nothing when it comes to being in the top 50
13:33:48FromDiscord<Rika> isnt that the point of a benchmark
13:33:58Yardanico"realistic approach" :D
13:34:02Araqhere is an idea
13:34:03dom96as long as you're there you can be confident that languages are in the same ballpark
13:34:17FromDiscord<Rika> i should really stop trusting benchmarks at all
13:34:18FromGitter<alehander92> yeah, ballparks is all it matters for probably 75% of cases
13:34:19Araqlet's come up with a set of benchmarks that doesn't suck
13:34:35Yardanicoand make nim the fastest in them lol
13:34:38dom96it's impossible
13:34:39FromGitter<alehander92> you'll receive the nobel peace prize
13:34:43FromDiscord<Rika> how about serving a static page like nim's docs?
13:34:52FromDiscord<Rika> that would certainly be realistic, no?
13:34:52Yardanicothat's even stupidier
13:34:58AraqI can give you decent benchmarks
13:35:16Araqbut I have no clue how we get people to stop looking at stupid benchmarks
13:35:24Araqand no, Nim wouldn't win every benchmark
13:35:38*fredrikhr quit (Ping timeout: 256 seconds)
13:35:59FromGitter<alehander92> i think people need "science " studies
13:36:30FromGitter<alehander92> or just to make peace with comparing projects, not languages
13:37:11FromGitter<alehander92> realistically, the most sensible small benchmarks would be ones comparing idiomatic usage
13:37:34FromGitter<alehander92> at least thats a good proposal i read about such a site
13:37:42dom96PMunch, oh yeah, thanks btw! Glad you enjoyed the AMA :)
13:37:52Araqwhich is btw what I'm working on all day long, make idiomatic Nim fast, not the C-like Nim you can write since a decade
13:38:19reyanHi, I'm trying to pick up nim and thought I could create a program to patch a binary file, using a filestream. However when I call writeData as in the stream module documentation (with var buffer = 0x0D for instance), it writes 0x0D where expected but also zeroes out multiple bytes after. Did I miss something? sizeof(buffer) is 8 which seems correct
13:38:22Araqand even the C-like Nim isn't bad at all
13:38:32FromGitter<zacharycarter> Araq: I'm going to author an RFC to extend codegendecl to work with type definitions. Do you have any major issues with this idea, before I write the RFC?
13:38:57Araqmotivate it well, zacharycarter
13:39:05FromGitter<zacharycarter> Okay
13:39:09FromGitter<alehander92> Araq yeah, but one can always just emit C
13:39:15Yardanicoreyan: what proc are you using?
13:39:16FromGitter<alehander92> so its very hard to compare languages imo
13:39:28FromGitter<alehander92> if one cant put a boundary on what is unidiomatic usually
13:39:40Yardanicoby default nim number literals are of "int" type
13:39:45FromGitter<alehander92> on the other hand just putting a single emit somewhere as a 5x speedup can still be idiomatic
13:40:02Yardanico!eval echo typeof(0x0D)
13:40:05NimBotint
13:40:05Araqalehander92: I never used 'emit' for speed in my entire life
13:40:11reyanyardanico: I'm using proc writeData(s: Stream; buffer: pointer; bufLen: int)
13:40:17Yardanicoreyan: why?
13:40:24Yardanicojust use https://nim-lang.org/docs/streams.html#write%2CStream%2CT
13:40:32FromDiscord<Rika> sizeof gives byte size, not bit size, no?
13:40:42Yardanicoit gives byte size of course
13:40:49FromDiscord<Rika> i dont know why i asked that
13:40:49Yardanicoint64 is 8 bytes on 64-bit :)
13:40:53FromDiscord<Rika> i'm a special person
13:40:55dom96hah, why does that proc's docs state its implementation
13:41:00reyanwow ok
13:41:10reyanI thought it was bit size sorry
13:41:12reyanthanks a lot
13:41:18Yardanicoreyan: if you want to write a byte, do it like
13:41:34FromGitter<alehander92> => cant define idiomatic super well => people cant agree on rules => no benchmarks
13:41:37FromDiscord<Rika> yes, i totally asked that because i thought reyan thought it was bit size, not that i am stupid, of course
13:41:47Yardanico"let byt = byte(0x0D); mystream.write(byt)"
13:41:56Yardanicoor "let byt = 0x0D'b" and then the same write
13:42:15Yardanicoah wait no, there's no "b" suffix
13:42:19FromDiscord<Rika> i8?
13:42:20Yardanico'u8 for uint8
13:42:26Yardanicoor 'i8 for int8
13:42:30FromDiscord<Rika> ah ofc unsigned
13:42:34FromDiscord<Rika> man i am on a stupidity roll
13:42:41reyanok that makes sense. By the way I really like nim so for so thanks for your work
13:42:48FromDiscord<Rika> the apostrophe is optional btw
13:43:01Yardanico@Rika wdym
13:43:13FromDiscord<Rika> you can write 0i8 just fine afaik
13:43:14Yardanico!eval echo typeof 0x0Di8
13:43:16NimBotint8
13:43:19Yardanicolol
13:43:23FromDiscord<Rika> told ya
13:44:13Yardanicoah found it " For notational convenience the apostrophe of a type suffix is optional if it is not ambiguous (only hexadecimal floating point literals with a type suffix can be ambiguous)"
13:44:15reyanWell that works perfectly. Thanks again and have a great day
13:44:55FromGitter<alehander92> Araq ok, i am just giving an example
13:45:03*CcxWrk quit (Remote host closed the connection)
13:45:08FromGitter<alehander92> that people can often argue about what is idiomatic in language X
13:45:18*CcxWrk joined #nim
13:45:21FromGitter<alehander92> it might be a different pattern in other lang
13:47:49Araqwell you need precise rules about what code is allowed in benchmarks
13:48:00Araqusually inline asm isn't and neither should be 'emit'
13:48:10*someunknownuser joined #nim
13:48:33FromGitter<alehander92> yeah, but what is e.g. C-like in Nim or Java-like in Clojure etc
13:48:41FromGitter<alehander92> is not so obvious
13:49:11FromGitter<alehander92> after all, what is an idiomatic lib or program or dsl is almost always subjective for real world code
13:49:33*ftsf quit (Ping timeout: 265 seconds)
13:49:35FromGitter<alehander92> and success can even change that: e.g. probably rails changed some things about how people write ruby
13:49:51dom96I wonder if we could have a "it has to be written purely in that language" rule
13:50:01dom96of course, there will always be edge cases
13:50:22dom96but I think they can be managed
13:50:25Araqif you want to benchmark *language* implementations, you must not use libraries
13:50:26dom96maybe we can suggest that to techempower
13:50:32Yardanicodom96: well V can translate c code to V
13:50:35FromGitter<alehander92> a kernel running a filesystem and a server written all in language :D
13:50:41Yardanicoand if you do that all your code will be technically in V
13:50:45Yardanicosame goes for Zig for example
13:50:55Araqsame for Nim
13:51:04dom96Yardanico, I seriously doubt this process is easy
13:51:12Araqif I understand the problem well enough. but anyhow, as I said
13:51:12FromGitter<alehander92> dom96 ok ... and nim imports C headers , stdlib, libc
13:51:24Araqif you want to benchmark languages, don't benchmark libraries
13:51:26dom96alehander92: yes, which is why I talked about edge cases
13:51:31dom96libc is fair game
13:51:34Yardanicodom96: well zig for example uses clang itself to translate C to Zig
13:51:42FromGitter<alehander92> but people will disagree about what is edge case :)
13:51:54FromGitter<alehander92> thats the whole thing
13:52:06dom96alehander92: quite likely, but probably some sort of concensus can be reached
13:52:29Araqedge cases exist but "nim's regex handling is slow" is not benchmark for nim
13:52:31dom96you could even have multiple purity categories
13:52:56FromGitter<alehander92> e.g. if X can emit everything by itself, e.g. go didnt even use libc IIRC in some cases
13:53:04FromGitter<alehander92> and go fans can say "ah this is cheating"
13:53:27dom96that's called being petty IMO
13:53:47FromGitter<alehander92> and petty people love benchmarks
13:53:51dom96In fact, a good rule could be: if every program written in a a language requires that library then it's fair game
13:54:13dom96you certainly cannot say that about pico
13:54:14dom96for V
13:54:18Araqit's true though, the Go people redefined what "dependency free" meant so now you have to statically link libc
13:54:28FromDiscord<Rika> requires that function (as in functionality, not proc) can also be a good rule
13:54:55dom96I think that's a fool proof rule to be honest
13:54:56skrylar[m]think i liked v over zig. beef seems okay but getting a working beef compiler is a pita
13:54:58FromGitter<alehander92> dom96 ok, but many programs dont really need a lot of libc stuff
13:54:59dom96I might suggest it later today to them
13:55:00FromDiscord<Rika> it has to be a broad definition though for what i mentioned
13:55:08Araqfor reasons unknown to mankind (on an OS with /usr/include I consider libc part of the deal...)
13:55:18FromDiscord<Rika> like "emit pragma" and not "this specific proc"
13:55:36FromDiscord<Rika> why'd you like v over zig?
13:55:41dom96alehander92: they need some stuff though
13:55:45dom96doesn't matter how much
13:55:52FromGitter<alehander92> i overally like those ideas dom96 , just i expect that almost any benchmark setup would always lead to disagreements and pettiness
13:55:52dom96they always need something
13:55:55FromGitter<alehander92> it is just how it is :D
13:56:09*muffindrake quit (Quit: muffindrake)
13:56:30dom96if they don't like this idea I'll just write a blog post with a list that excludes impure implementations ;)
13:56:49Araqdom96: not that's the spirit! :-)
13:56:51FromDiscord<Rika> pico.v just feels like a library specifically made for benchmark "cheating" in my eyes
13:56:51Araqbbl
13:57:08FromGitter<alehander92> Rika what i dont agree with in your sentiment is that
13:57:20FromGitter<alehander92> it showcases a real world valid usage
13:57:33FromGitter<alehander92> a lot of python's success is based literally on glueing fast c libs
13:57:41FromDiscord<Rika> that is true
13:57:57FromGitter<alehander92> so even if you have such benchmarks
13:58:01FromDiscord<Rika> okay so now i have a new though
13:58:03FromDiscord<Rika> t*
13:58:07FromGitter<alehander92> and you exclude e.g. Xframework in python
13:58:28FromDiscord<Rika> some benchmarks are only really meant to compare library implementations and not languages or backends or whatever
13:58:36FromGitter<alehander92> final users wouldnt care as they dont care for "pure language usage" but for ease+speed
13:58:51FromDiscord<Rika> maybe there can be a benchmark meant to showcase a language's performance, but i know of none
13:58:57FromGitter<alehander92> maybe
13:59:16FromGitter<alehander92> but then i think you need to either measure small programs like the shooting game(?)
13:59:23dom96the problem with many of these is that they are not made for real-world usage
13:59:38dom96I would need to see proof to believe it
13:59:46dom96For example, httpbeast is actually used by Jester
13:59:49FromGitter<alehander92> dom96 but e.g. if you compare ML frameworks
13:59:55FromGitter<alehander92> you would exclude many python ones
13:59:55dom96and runs in production
14:00:07FromGitter<alehander92> and you again wouldn't really show useful results
14:00:28dom96This would just be another filter, people can choose to use it or not
14:00:41FromGitter<alehander92> agree, it would be interesting for sure
14:00:41dom96I think giving users a different way to look at the results is always good
14:00:48FromDiscord<clyybber> zig invents. V doesn't
14:01:03FromDiscord<clyybber> well V invents on the PR side I guess :p
14:01:10stefantalpalaruHow do you get the next value from an iterator explicitly, outside a "for" loop?
14:01:13FromGitter<alehander92> and also another valid argument after all is that if language X makes it very easy to base stuff on language Y's code
14:01:15*muffindrake joined #nim
14:01:19Yardanicostefantalpalaru: I think you can't really do that
14:01:20FromGitter<alehander92> that's still useful, nim also markets that
14:01:23Yardaniconim iterators are inline by default
14:01:30Yardanicoyou probably can with a closure iterator though
14:01:31FromDiscord<clyybber> stefantalpalaru: I don't think there is a way. Even for closure iterators
14:01:39FromDiscord<clyybber> As in its not exposed.
14:02:00stefantalpalaruThere must be an internal method/proc that the compiler calls in for loops, right?
14:02:09FromGitter<alehander92> you just call the iterator
14:02:15FromGitter<alehander92> until its finished, or not?
14:02:17FromDiscord<clyybber> Oh, maybe its just a matter of a proc taking a closure iterator and doing `for i in iterator: return i`
14:02:41FromDiscord<clyybber> I think that may work
14:02:41dom96stefantalpalaru, var state = myIterClosure(); state() # if it returns default(RetType) then it's finished IIRC
14:03:02FromDiscord<Rika> you can do myIterClosure.finished afaik
14:03:04dom96yeah
14:03:04stefantalpalaruWhat I want is someIterator.next(), dom96.
14:03:15dom96state() is that
14:03:18FromDiscord<Rika> if it is finished after getting the value, the value is junk
14:03:39FromDiscord<Rika> oh if state is the closure then its state.finished
14:03:42*zacharyc1rter joined #nim
14:03:43*zacharycarter joined #nim
14:03:49*fredrik92 joined #nim
14:07:50*someunknownuser quit (Quit: someunknownuser)
14:07:55*couven92 quit (Ping timeout: 260 seconds)
14:08:29disrupteki hate the corner this compiler has put me in.
14:09:35*reyan quit (Quit: Leaving)
14:09:48FromDiscord<clyybber> disruptek: WDYM?
14:14:06narimiranstefantalpalaru: related? https://github.com/nim-lang/RFCs/issues/1
14:14:08disbot[RFC] Better iterators syntax
14:16:21stefantalpalaruYes.
14:17:42PMunchDamn it, I found another thing I need in the OpenSSL wrapper that's not there..
14:17:54PMunchWhy is it only partially wrapped?
14:19:52federico3PMunch: please open bugs and I'll add stuff
14:19:55disruptekclyybber: i now have to undo/redo/debug/rebug the backend mutations i introduced.
14:20:34PMunchI can just add them myself and create a PR like I did last time
14:20:39federico3https://mastodon.in.th/@sirn/104110103788846643 we need "demos" like this somewhere on the website
14:20:53PMunchBut I'm using this for production and it looks a bit sketchy to depend on a development version of Nim
14:21:27PMunch(Not that I think anyone at work has actually looked at the code or my build scripts :P)
14:22:24Yardanicohttps://c3po.bashell.com/media/5eb02254e206d26b7aa4ff41 seems like nim in haiku is really outdated :P
14:22:27FromGitter<bung87> any idea about js generated code `chckRange(s_7355039[0],-2147483648, 2147483647)` where `is` string `M`
14:22:47Yardanicowdym "any idea"?
14:22:52Yardanicoit checks if the first value is in "int32" range
14:23:02Yardanicofirst element of s_7355039, whatever that is
14:23:12FromGitter<bung87> that's a long string
14:23:26FromGitter<bung87> it will get first char
14:23:39FromGitter<bung87> then throw error
14:23:56Yardanicoshow the nim code which makes this error :P
14:27:49Yardanicofederico3: btw related to nimpy - a fully statically (yes again :D) linked with musl example from the nimpy readme is only 100kb
14:28:02Yardanicowith -d:danger --gc:arc
14:28:07Yardanico(yes nimpy seems to work with arc)
14:28:26Yardanicoah right, nimpy even has tests for it
14:28:44FromGitter<bung87> hold on ,I write a simple example
14:30:33Yardanicofederico3: https://i.imgur.com/4hwL1Vw.png
14:30:41Yardanico:D
14:31:05Yardanicowith --panics:on I get 4kb less
14:31:35FromGitter<bung87> https://github.com/bung87/datetime_parse nimble testjs
14:31:35federico3why using musl and optimizing for size tho? It's not really the use case for nimpy
14:31:56Yardanicowell yeah I know nimpy is for speeding up python usually
14:32:28Yardanico@bung87 lemme check
14:33:08FromDiscord<Rika> oh damn that looks cool
14:33:14disruptekleorize: ping
14:33:21FromDiscord<Rika> does the zig compiler makes musl easier to use?
14:33:51Yardanicoit bundles a lot of libc headers and musl
14:34:04Yardanicoso you don't have to use different cross-compilers and just use different targets
14:34:09Yardanicoyou can cross-compile for windows too
14:38:35Yardanicohttps://i.imgur.com/0cRDcPY.png
14:39:15Yardanico-d:windows is not needed though
14:45:40*waleee-cl joined #nim
14:49:03FromGitter<Bennyelg> hey, how can I mimic abstract class in him ?
14:49:04FromGitter<Bennyelg> nim
14:49:16disruptekwhy?
14:49:30disruptek~concepts
14:49:30disbotconcepts: 11user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts -- disruptek
14:52:23FromDiscord<Rika> theyre not exactly the same though, no?
14:53:17*ptdel joined #nim
14:55:51disrupteki dunno; i'm terrible with lingo.
14:56:04livcdWhat happened today in Nim's world? Any drama?
14:56:11Yardanico@treeform yeah it works just fine https://i.imgur.com/Q6SZoxd.png
14:56:19FromGitter<bung87> @Yardanico it's like code gen bug? no idea why it using first char as index
14:56:31FromGitter<Bennyelg> I wangt to do something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5eb02d1ef0377f163167b5dd]
14:56:41FromGitter<Bennyelg> what is the correct way :/
14:56:59disruptekyou cannot dispatch on return type.
14:57:09Yardanicouprof also has system-wide profiling
14:57:34FromGitter<Bennyelg> @disruptek
14:57:35disruptekif all you do is discard, then simply remove all the `[T]` and `: T` and you're done.
14:57:49FromGitter<Bennyelg> but I do want to return things
14:57:56FromGitter<Bennyelg> as the signature probably implies somehow
14:58:02FromGitter<Bennyelg> get -> T will be seq[Student]
14:58:06FromGitter<Bennyelg> or something similar
14:58:09disruptekthen write that.
14:58:15FromGitter<Bennyelg> I want to overwrite it on the StudentRepository
14:58:21FromDiscord<Rika> make them getStudent(): seq[Student] or something
14:58:22FromGitter<Bennyelg> but is it the correct way ?
14:58:36disruptekyou need to make Repository generic.
14:58:46FromGitter<Bennyelg> I want some single interface that everyone will implement
14:59:08disruptektype Repo[T] ... members: seq[T] or whatever.
14:59:10FromGitter<Bennyelg> ```type ⏎ Repository*[T] = ref object ⏎ db: Database``` [https://gitter.im/nim-lang/Nim?at=5eb02dbeb6dd230697a5479b]
14:59:17FromGitter<Bennyelg> cool
15:00:26FromGitter<Bennyelg> and how I overwrite repository[T] methods ?
15:00:31FromGitter<Bennyelg> or procs if to be correct
15:00:44Yardanicohttps://i.imgur.com/mFJJ3wp.png really nice stuff
15:00:50Yardanicoguess I'll use it when benchmarking :D
15:01:08FromGitter<bung87> @Bennyelg https://github.com/bung87/db_adapter/blob/master/src/db_adapter.nim check this
15:01:23FromDiscord<Rika> damn that looks nice
15:01:48disruptekYardanico: what are we looking at?
15:01:59disruptekuprof?
15:02:02Yardanicoyes
15:02:04Yardanicoamd uprof
15:09:30PMunchhttps://github.com/nim-lang/Nim/pull/14223
15:09:31disbotAdd procedures to read RSA keys from BIO format
15:09:40PMunchfederico3 ^
15:12:13federico3PMunch: lil' bit of tests perhaps? :)
15:13:24PMunchAre there tests for this module?
15:13:46PMunchI did test it with my usecase though, so I know that it works right now
15:14:02PMunchLike it's not a blind wrap
15:14:13federico3there are
15:14:35federico3including https://github.com/nim-lang/Nim/tree/devel/tests/untestable
15:15:12federico3https://github.com/nim-lang/Nim/blob/d5b7e9902cf9ac2c24be8792555cb017d268ce91/tests/stdlib/thttpclient_ssl.nim and so on
15:32:21*abm quit (Read error: Connection reset by peer)
15:38:47FromGitter<bung87> @Yardanico have you checked?
15:39:14Yardaniconot yet, I'll try to see now :P
15:40:18Yardanicooh I see what you're trying to do
15:40:22FromGitter<bung87> ok,thanks!
15:40:23Yardanicoyou're trying to use a JS string
15:40:34Yardaniconim strings in JS are not simply JS strings
15:41:07FromGitter<bung87> so how to pass js string to the parse
15:41:33FromGitter<bung87> it's just js primitve type
15:41:47YardanicoI guess you could try with makeNimstrLit
15:42:33Yardanicoyeah it works that way
15:42:41Yardanicoyou have to do " module.exports = {parse, makeNimstrLit}"
15:42:54Yardanicoand then create nim string like const s = parse.makeNimstrLit("your string")
15:43:01Yardanicoand then parse.parse(s)
15:43:23Yardanicobut really you should understand that nim's compiled JS is not really supposed to be used in other JS code
15:43:35*PMunch quit (Ping timeout: 260 seconds)
15:45:26FromGitter<jason_koch_twitter> inotify
15:45:35Yardanico@bung87 https://gist.github.com/Yardanico/4d10f2f44e7fb1a0bb7b6b9683e28487
15:46:24Yardanicoit seems to actually work
15:46:36FromGitter<bung87> yeah, got it work
15:46:57*PMunch joined #nim
15:47:01*abm joined #nim
15:47:05Yardanicobut yeah, as I said Nim's compiled JS code is not supposed to be used in other JS code, so you're in undiscovered territory :)
15:48:47FromGitter<bung87> hmm, the problem I leave it for months, finally it solved, thank you.
15:50:08FromGitter<bung87> I'll keep that in mind, I thought primitve type will be translate during compile time... and also there's -d:nodejs
15:50:37*reyan joined #nim
15:50:56FromGitter<bung87> anyway it could generate a js module, just need extro proc export
15:51:15Yardanicoalso beware that -d:nodejs isn't supported that wel
15:51:17Yardanicowell(*
15:51:27Yardanicomain target for nim's JS backend is browser
15:53:26FromGitter<bung87> I get it, better to write all in nim and generate single one bundle file.
15:55:00FromGitter<bung87> I have a idea, if have a js ast parser in nim ,that would be well support?
15:55:49reyanHi. I'm still trying to work on an application to patch binary files, however while it's really easy to replace a byte, I don't see how I could do to add some bytes in the middle of the file. Should I create a new file and merge byte arrays from the original file around the data I want to add?
15:57:39Yardanicodid you see https://nim-lang.org/docs/streams.html#setPosition%2CStream%2Cint ?
15:59:48reyanYeah I did but when I setPosition() somewhere and then write data it just replaces data that was there before. I don't see how I could add new data (changing the file size)
16:00:11Yardanicooh
16:01:44FromGitter<nothratal> hello together
16:01:53FromGitter<nothratal> is there a naming convention for nim packages?
16:02:05*silvernode joined #nim
16:04:22zacharycarterNim doesn't have packages
16:04:28zacharycarterit's not like Java
16:05:02FromGitter<kaushalmodi> hmm?
16:05:19FromGitter<kaushalmodi> I called them packages/modules/etc
16:05:21zacharycarterwell I'm not really sure what you mean by packages either
16:05:28zacharycarterthey are modules yes
16:05:36FromGitter<kaushalmodi> what's the difference
16:05:47Yardanicopackages can have multiple files
16:05:48zacharycarterbut packages in my mind is like - com.foo.bar
16:05:52zacharycarteryes
16:05:59Yardanico@nothratal did you mean packages as in libraries?
16:06:03Yardanicoor as in individual files?
16:06:06zacharycarteryeah I'm really not sure what he means
16:06:20FromGitter<kaushalmodi> Yardanico: Ah. I see. TIL
16:06:20FromGitter<bung87> bad question
16:06:54FromGitter<kaushalmodi> That's correct: It's not clear naming convention of what exactly.
16:07:29FromGitter<kaushalmodi> If it's naming the modules, then you usually name them in snake-case and you cannot use hyphens in the names.
16:08:14FromGitter<kaushalmodi> Some people name modules in lower camelCase, but that's not very common
16:08:29FromGitter<kaushalmodi> It's usually all lower or lower snake-case
16:08:55FromGitter<nothratal> ohh sorry, of course I mean libraries :D
16:09:12Yardanicowell all libraries have a main nim file anyway
16:09:16Yardanicoor you import files
16:09:29Yardanicoso usually lowercasename
16:09:35Yardanicoor snake_case_name
16:21:00*fredrik92 quit (Read error: Connection reset by peer)
16:21:26*fredrik92 joined #nim
16:22:47*solitudesf joined #nim
16:25:39*solitudesf- joined #nim
16:28:51*solitudesf quit (Ping timeout: 260 seconds)
16:28:57*solitudesf- is now known as solitudesf
16:29:48*fredrik92 quit (Ping timeout: 260 seconds)
16:30:52*companion_cube quit (Quit: WeeChat 2.3)
16:33:32*krtekz joined #nim
16:35:11*fredrikhr joined #nim
16:49:41FromDiscord<bedwardly-down> Morning all. How's the nim stuff going?
16:52:52skrylar[m]currently studying a few older game engines and remarking how little a lot of them do
16:53:10skrylar[m]well libgdx does some amount. corona and love2d quite small
16:54:32disruptek~stream
17:00:36Yardanico~stream
17:00:40Yardanico:c
17:01:38krtekzDoes Nim plan to target wasm?
17:01:50Yardanicokrtekz: not via a yet another backend
17:01:54Yardanicoyou can already use emscripten
17:02:09zacharycarteror nlvm
17:05:26skrylar[m]i dunno. a wasm backend would be nice if it just happened to be there
17:12:33leorizedisruptek: pong
17:18:53audiofilecan someone bounce some ideas off me for some nim project during the hols?
17:19:20audiofileI'm not an expert by any means, not even intermediate rn so tempered expectations please! >_>
17:19:44leorizetry to fix some simple compiler bugs? :P
17:19:46FromDiscord<mratsim> bounce(idea)
17:19:47Yardanicoaudiofile: I think you might like https://github.com/florinpop17/app-ideas
17:20:45audiofileyeeees, nice ty Yardanico
17:21:08audiofileleorize I almost flunked my compilers course :/ if I could, I definitely would!
17:21:46leorizedon't worry, building a compiler is different from fixing a built one
17:21:59audiofileoh, I'm all ears now then
17:22:02Yardanicospoiler: it's easier
17:22:07audiofileare they the issues tagged with <easy>
17:22:12Yardanicothere are
17:22:17Yardanicobut that's subjective :P
17:22:23audiofileI bet haha
17:22:31Yardanicohttps://github.com/nim-lang/nim/issues?q=is%3Aopen+is%3Aissue+label%3AEasy
17:24:14audiofilethanks, honestly most of them dont make much sense to me right now but I've bookmarked this
17:24:36audiofilesome issues refer to other fixes as they are similar so I can give that a go
17:25:36audiofilehttps://github.com/nim-lang/Nim/issues/8212#issuecomment-402985473 sounds easy >_>
17:26:02FromDiscord<mratsim> It's a trap
17:26:54FromDiscord<mratsim> you can {.emit:"__FUNC__".} in the C code but without emit you need to modify the compiler
17:27:23audiofileouch
17:27:38audiofilewe need an 'easy but trap' tag haha
17:28:07FromDiscord<mratsim> well the compiler modification is explained https://github.com/nim-lang/Nim/issues/8212#issuecomment-493944503
17:28:43FromDiscord<mratsim> but you need to create a new proc because modifying `instantiationInfo` return type is not backward compatible
17:28:52FromDiscord<mratsim> so the hard thing is coming up with a new name
17:28:58audiofileah I see
17:29:11audiofileyeah
17:29:36FromDiscord<mratsim> something like procContext or callingContext
17:30:32audiofileoh right, there's the proper naming convention which must not be ignored
17:32:43*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
17:32:51leorizemratsim: do you think there's anything from nim-stew that can find a new home here? https://github.com/nim-lang/fusion
17:34:07leorizenim stew has been collecting some really useful modules and I think we should start adding them to the "external stdlib" now that the barrier is lowered
17:37:32*audiofile quit (Quit: Going offline, see ya! (www.adiirc.com))
17:41:00*disbot quit (Ping timeout: 256 seconds)
17:41:35*disruptek quit (Ping timeout: 256 seconds)
17:45:03reyanWell I'm almost finished it's probably not how it should be done but at least it seems to work. I've got all I need in a seq[byte] and I'm not sure how to write it back to a binary file. Maybe I missed something in IO or stream module?
17:47:52leorizewriteData should work
17:48:23leorizeactually you can do this too, but it's undocumented: s.write(cast[string](your seq[byte]))
17:48:39leorizethis is because string and seq[byte] has the same underlying representation
17:48:48leorizeit's a supported thing but we don't document it
17:50:48reyanWhen using writeData I'm forced to use a fixed length array as a buffer right? Because right now I'm filling the buffer byte by byte from the seq which is probably not how it should be done
17:51:51*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:52:24leorizeyou can use a seq
17:52:33leorizewriteData is a low-level proc
17:53:25reyans.write(cast[string](your seq[byte])) worked perfectly. Thanks. And I can use a seq as a buffer? I didn't manage to while reading the file
17:54:09*krtekz left #nim (#nim)
17:54:27leorizehttps://play.nim-lang.org/#ix=2kNj
17:54:38leorizewhere's a proc that should have been in the stdlib instead
17:54:46*Lord_Nightmare joined #nim
17:54:47leorizeit works with both strings and seqs
17:55:28*disbot joined #nim
17:56:28*disruptek joined #nim
17:56:39reyanThanks a lot!
17:57:54FromDiscord<mratsim> @leorize, endians2, byteutils
18:01:19*Kaivo quit (Quit: WeeChat 2.8)
18:02:27leorizeshould this be discussed on nim-stew issue tracker first?
18:02:35leorizeor should I just add it then tag people in?
18:04:23FromDiscord<mratsim> the second solution seems good
18:19:25FromDiscord<Avatarfighter> Hello everyone
18:19:47YardanicoAraq: is this supposed behaviou for ARC? the error is in the comment https://gist.github.com/Yardanico/5a9f7e9842101443ebf662c58340f406
18:20:14shashlickdoes anyone know how to autolink issues on github from a markdown file?
18:20:15FromDiscord<Avatarfighter> Leorize, any chance you could be my saviour with endians again like last time? I believe I'm just doing what I'm going wrong
18:20:51leorizesure
18:23:21FromDiscord<Avatarfighter> might take a minute I lost the file I had an issue with in the labyrinth known as my current project
18:25:46FromDiscord<Avatarfighter> https://www.paste.org/104912 so I'm like 90% sure that I'm doing this wrong but I'm trying to convert an array holding int8s from one endian to the other but having some issues on the expected output
18:27:52FromDiscord<Avatarfighter> I forgot to add but I'm using the std endians lib
18:29:45leorizeyou failed the moment you cast :)
18:29:57FromDiscord<Avatarfighter> i knew it
18:30:01FromDiscord<Avatarfighter> I was so sure it was that
18:30:40leorizehmmm actually
18:31:08FromDiscord<Recruit_main707> he should pass the 0th element address shouldnt he?
18:31:09FromDiscord<Avatarfighter> i still don't see what I would do even when I converted the endian without casting :L
18:32:08leorizeAvatarfighter: lol
18:32:10leorizeI found the problem
18:32:23leorize64 bits is 8 bytes
18:32:28FromDiscord<Avatarfighter> fuck
18:32:42FromDiscord<Avatarfighter> yeah that definitely helps
18:32:51FromDiscord<Avatarfighter> welp that was meant to be int32
18:33:32*reyan quit (Quit: Leaving)
18:33:42FromDiscord<Avatarfighter> I got so used to writing 64 I guess I just autocompleted what I was writing and wrote it, thanks again for the help leorize lol
18:36:10*silvernode quit (Ping timeout: 265 seconds)
18:40:02FromDiscord<Avatarfighter> welp I give up the endian lib is nice but nim stew has a nicer api for their endian lib
18:49:17FromDiscord<mratsim> the nicest part is that it works at compile-time
18:49:31FromDiscord<mratsim> so you can pre-serialize things
19:14:41*ptdel joined #nim
19:24:06FromDiscord<bedwardly-down> @disruptek `Downloading https://github.com/genotrance/nimterop using git
19:24:07FromDiscord<bedwardly-down> Tip: 40 messages have been suppressed, use --verbose to show them.
19:24:07FromDiscord<bedwardly-down> Error: Could not read package info file in /tmp/nimble_25781/githubcom_genotrancenimterop_0.3.3/nimterop.nimble;
19:24:07FromDiscord<bedwardly-down> ... Reading as ini file failed with:
19:24:07FromDiscord<bedwardly-down> ... Invalid section: .
19:24:09FromDiscord<bedwardly-down> ... Evaluating as NimScript file failed with:
19:24:12FromDiscord<bedwardly-down> ... /tmp/nimble_25781/githubcom_genotrancenimterop_0.3.3/nimterop/docs.nim(80, 19) Error: undeclared identifier: 'paramCount'
19:24:13FromDiscord<bedwardly-down> ... printPkgInfo() failed.
19:24:15FromDiscord<bedwardly-down> /home/justa/Source/git/nimph/nimph`
19:29:02PMunchPlease don't paste stuff into Discord
19:29:03shashlickplease update your nim to latest devel
19:29:14PMunchIt comes through on IRC
19:35:01FromGitter<alehander92> no problem
19:51:04*lritter quit (Quit: Leaving)
19:51:10FromDiscord<arnetheduck> fwiw, fusion seems to have the same issues as stdlib in its stated goals, in terms of maintenance: it thinks it's a good idea not to remove code - this means that it'll be full of unmaintained crap that's not up to date with recent nim versions, idioms or the world at large.. preserving the past is great: git does that, and really really well - you get an immutable copy of some file at some point and you can rely on it not changing - yo
19:51:52FromDiscord<arnetheduck> ie the berlin wall fell - the same thing happens with code - some things that were though of as great ideas by someone at some point in time really.. weren't
19:54:45FromDiscord<dom96> https://github.com/TechEmpower/FrameworkBenchmarks/issues/5680
19:54:54FromDiscord<dom96> As promised, let's see what they say
19:55:55FromDiscord<arnetheduck> what would be nice for fusion would be a tracked release system: these modules work well with nim 1.x - so there's a fusion-1.0, fusion-1.2 etc for every module, and things only make it to the next version when they actually work with that version idiomatically - ie use or at the very least don't contradict features introduced in newer versions - and modules shouldn't qualify automatically: they should be ported to the new version only
19:57:59*PMunch quit (Quit: leaving)
20:07:02*tane joined #nim
20:07:03*opal quit (Ping timeout: 240 seconds)
20:14:55*opal joined #nim
20:22:11leorizeAraq ^
20:24:07dom96My opinion is still that fusion really does not seem like something worth investing time into
20:24:16FromDiscord<Avatarfighter> Question for anyone who knows but does "shr" zerofill?
20:25:24*couven92 joined #nim
20:29:02*fredrikhr quit (Ping timeout: 272 seconds)
20:38:01*couven92 quit (Ping timeout: 264 seconds)
20:38:24FromDiscord<mratsim> zerofill?
20:39:16Yardanicohttps://forum.nim-lang.org/t/4891 relevant
20:42:00FromDiscord<mratsim> ugh, the shr changes were ugly. Not much on the forum changes, but compile-time shr and constant-folded shr had consistency issues
20:48:14*narimiran quit (Ping timeout: 256 seconds)
21:04:31FromDiscord<Avatarfighter> Yardanico: Thanks for the forum post 🙂
21:05:10Yardanicowhich one?
21:05:13Yardanicomathexpr? :P
21:05:41FromDiscord<Avatarfighter> The one you posted about right shift 😛
21:05:47Yardanicooh ok
21:05:54FromDiscord<Avatarfighter> I'm having trouble figuring out if the shr is arithmetic or not so I'm just going to pretend it isn't unless something breaks lmao
21:05:58Yardanicoby mathexpr I meant https://forum.nim-lang.org/t/3196
21:06:02FromDiscord<Avatarfighter> but I'm interested in the mathexpr one if you have a link
21:06:22FromDiscord<Avatarfighter> I'll give it a read thanks for the link 👍
21:07:21FromDiscord<mratsim> is there a use case for right shifting on negative int?
21:08:22Araqarnetheduck: well I don't agree and time will prove me right/wrong. programming languages are more like OSes, they gain traction when old stuff continues to run
21:10:11FromDiscord<Avatarfighter> @mratsim the only use case I've personally seen is in cryptographic functions and even then it would take me a bit to find an example
21:14:29Araqthey never renamed 'cp' to 'copy' in Unix land or 'man' to something sane. And here we are, Unix dominating everything.
21:15:05Araqand what used to be sloppy naming is now something "cultural", enjoy
21:16:11FromDiscord<mratsim> @Avatarfighter you don't use signed integer in cryptography
21:16:33Araqmeanwhile in Nim land, the old AssertionError just became an AssertionDefect, wtf
21:17:06FromDiscord<mratsim> Next step, finding a more descriptive name for typedesc
21:18:22leorizeAraq: C++ also got rid of COW strings in C++11, citing safety issues and potential performance problem in threaded environment
21:19:15FromDiscord<Avatarfighter> @mratsim I stand corrected I went to look for an example because I thought that signed integers could be used but I found none thanks for the clarification 🙂
21:19:17Araqleorize, I know but it's not directly applicable
21:20:35leorizewell, if you ever write an RFC for how you want this to be implemented, I can give it a go
21:20:48FromDiscord<mratsim> Rust seems to also be struggling with strings and/or allocator: https://www.christianfscott.com/making-rust-as-fast-as-go/
21:21:12leorizeisn't there a huge update about how the two algo are not comparable?
21:21:19leorizeand yes I did an implementation here yesterday
21:21:34*Vladar quit (Quit: Leaving)
21:21:35leorizestill not as fast as go, but it's the best I can do while preserving the algo
21:21:36krux02mratsim: typeargument, because they are used for arguments only.
21:21:40krux02(by now)
21:22:18FromDiscord<mratsim> I think a memory pool in the standard library would be helpful (especially given the number of gamedevs)
21:22:26FromDiscord<mratsim> and then we can have PooledStrings
21:22:48leorizehttps://irclogs.nim-lang.org/03-05-2020.html#18:55:59
21:22:49FromDiscord<mratsim> @krux02 typeargument is loooooong
21:23:10leorizeI think memory pool should be a nim-fusion thing
21:23:11krux02you didn't ask for "short"
21:23:21leorizetypearg? :P
21:23:30krux02tArg
21:23:44krux02trg
21:23:58FromDiscord<mratsim> typeArg is not bad
21:24:02leorizeType[T] :)
21:25:00krux02I am actually ok with `typedesc`.
21:25:25krux02It is ok, not great. But not worth the hassle to change.
21:27:17FromDiscord<mratsim> and that's how you get "mv" and "cp" 😉
21:27:25FromDiscord<mratsim> QED
21:28:40*dddddd_ joined #nim
21:30:16*filcuc joined #nim
21:30:37FromGitter<alehander92> ok, so down between the compiler dsl POC lib/singularity-inspired kernel toy/algo2cartoon generator/inim+hcr combo to try to propose for the conf
21:31:20*dddddd quit (Ping timeout: 258 seconds)
21:32:19FromDiscord<mratsim> I'm quite interesting in REPL / HCR
21:32:23FromDiscord<mratsim> interested*
21:32:43FromDiscord<mratsim> no idea about what is a singularity kernel but that sounds like something that hacker news might enjoy
21:33:45FromGitter<alehander92> no, its an older microsoft research os which Araq reminded me sounds like my dreamy toyings
21:33:47FromGitter<alehander92> the other day
21:35:12FromGitter<alehander92> but my idea is just to run some nim code on bare metal and map processes and filesystem data just to bare nim values+functions
21:42:11*xcm quit (Remote host closed the connection)
21:44:26*xcm joined #nim
21:52:58*solitudesf quit (Ping timeout: 260 seconds)
21:52:59*Trustable quit (Remote host closed the connection)
21:59:06Yardanicoif you guys test your libraries (or other people's libraries) with arc/orc, please report it in https://github.com/nim-lang/Nim/wiki/Status-of-gc:arc-and-gc:orc-(library-compatibility)
22:01:08krux02Araq: I have problems with printing enum values from gdb
22:01:37krux02for some reason the types of the enums are now just unsigned integers integers.
22:02:09krux02do you know if something in the code generator for enums and sets changed?
22:02:09Araqkrux02, we didn't really change that
22:02:19krux02hmm
22:02:27Araqwe did change $ for enums though, it's now done via a macro
22:03:06krux02well the gdb script depends on the NTI runtime type information of enums
22:03:24krux02if that isn't generated anymore gdb can't print enums anymore.
22:03:53AraqNTI isn't used anymore by $
22:04:02AraqI think, so that's what's going on
22:05:10krux02But it is also that the enum value itself does not have an enum type anyomore.
22:05:59*tane quit (Quit: Leaving)
22:06:11krux02The generated type is just an usigned char.
22:06:17krux02At least that is what gdb tells me now.
22:06:34krux02so it can't look up NTI, even if it would be there.
22:06:55krux02In other words gdb pretty printing for enums is now completely broken.
22:07:50krux02But I guess it is my fault. I wrote a test for it. But I didn't integrate it the test suite.
22:07:57Araqwe can generate enums for C just like we do for C++
22:08:11Araqthen gdb should be able to pick it up
22:08:23krux02what is the difference there?
22:08:42Araqmostly ((EnumType)8) vs 8
22:08:46Araqin the produced code
22:09:20AraqC enums are always int though in C89 and Nim's enums are most often bytes
22:09:31krux02ok
22:09:40krux02let me test c++ mode then
22:10:09Araqit would be nice if we don't have to use NTI, NTI is also gone for arc
22:10:33AraqNTI is not exactly future-proof :-)
22:12:19Araqand I said it before but here it is once again, if we get typeArg and its spec/implemetnation right, I'm all for it. then we can deprecate typedesc but don't have to "fix" its broken behaviour (and thus breaking so much stuff out there)
22:13:13Araqseems to be much more feasible and less work then changing typedesc
22:13:53*filcuc quit (Ping timeout: 258 seconds)
22:16:34FromDiscord<mratsim> @Yardanico, AFAIK async and threads are still a pending issue with arc
22:16:51Yardanicowell async leaks memory, but yeah it kind of works with orc
22:17:10FromDiscord<bedwardly-down> @Never Listen To Beef , this should have a nim target: https://github.com/rusthon/Rusthon
22:19:12krux02yea I know NTI is not future-proff, but it is all I have
22:19:33krux02what I wonder though is, why Nim enums are not compiled to C enums
22:20:23Araqas I said, because C enums are 'int' and that's too big
22:20:58krux02ok that is true, I forgot about that.
22:21:58krux02only c++ for the help here.
22:22:45krux02would be nice if the c++ backend would just use the c++11 enums, then I would not need to create a hack for printing.
22:23:04krux02sets would not be solved though.
22:23:38krux02but theu would not be a problem.
22:25:32FromDiscord<mratsim> @Yardanico, but async programs, like servers tend to run for a long time, those are not missiles so leaking memory is problematic
22:25:38Yardanicoyeah
22:26:54Araqthey don't leak with 'orc', current bugs not considered
22:27:02FromDiscord<mratsim> I would love to have resumable function as first-class
22:28:22Araqyou need to write an rfc so that everybody understands why resumable functions are not closure iterators
22:29:00FromDiscord<mratsim> Btw, I've had some thoughts on how to have Weave play well with async, here is an easy idea: https://github.com/mratsim/weave/issues/22#issuecomment-623408684
22:29:34Araqyeah I read it. it's a bit what I suggested
22:29:39Araq*a bit like
22:30:29FromDiscord<Generic> well what is the difference between resumable functions and closure iterator. I always thought of of the first being an exploitation of the latter
22:30:35FromDiscord<Generic> ?
22:31:44FromDiscord<Generic> or are resumeable functions basically like threads with their own stack and context except they are cooperative?
22:32:30Araqprobably something like proc resumable(state: var int; otherArgs) so that you get the goto state machine inside but without the closure allocation overhead
22:33:49FromDiscord<Generic> I see, so basically like a closure iterator except you have to manage the state yourself?
22:35:27Araqnot really "manage" but it's exposed so that you can start/stop/continue it
22:35:40FromDiscord<exelotl> resumable functions -- so coroutines?
22:38:05FromDiscord<exelotl> usage being similar to e.g. Lua? https://www.lua.org/pil/9.1.html
22:39:51FromDiscord<mratsim> My use case would be to make it easier to implement IO-tasks and CPU-bound tasks
22:40:57FromDiscord<mratsim> for example if I have a task that is actually a `while True` loop, I basically lose a thread.
22:43:42*xcm quit (Read error: Connection reset by peer)
22:45:36*xcm joined #nim
22:46:19FromGitter<alehander92> hm is nti being removed
22:47:16Yardanicoit's not in arc
22:52:50*abm quit (Read error: Connection reset by peer)
23:11:18*GallantAKT joined #nim
23:21:14*GallantAKT quit (Ping timeout: 260 seconds)
23:44:09*NimBot joined #nim
23:48:46FromDiscord<Never Listen To Beef> @bedwardly-down you clearly overestimate my knowledge, i can barely write nim code nevermind write a transpiler
23:54:29*krux02_ joined #nim
23:58:40*krux02 quit (Ping timeout: 272 seconds)
23:58:43*ftsf joined #nim