<< 15-07-2019 >>

00:05:12*huuskes quit (Read error: Connection reset by peer)
00:23:39*stefanos82 quit (Quit: Quitting for now...)
00:27:42*bozaloshtsh joined #nim
00:27:42*bozaloshtsh quit (Changing host)
00:27:42*bozaloshtsh joined #nim
00:28:01*PMunch quit (Remote host closed the connection)
01:12:59*NimBot joined #nim
01:18:56*terorie quit (Remote host closed the connection)
01:59:00*ng0_ joined #nim
02:02:28*ng0 quit (Ping timeout: 260 seconds)
02:09:49*dddddd quit (Remote host closed the connection)
02:45:43*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
02:46:38*laaron joined #nim
02:49:03*xet7 quit (Quit: Leaving)
02:56:07*xet7 joined #nim
03:15:53*lritter quit (Ping timeout: 245 seconds)
03:16:58*lritter joined #nim
03:18:53*fjellfras joined #nim
03:27:06skrylar[m]@dom96 thrift is an ok format, although the lack of unsigneds is :-|
03:27:54skrylar[m]CBOR is neat and straightforward. MsgPack is fine too i guess
03:29:09skrylar[m]main win of cbor over msgpack is it can understand arrays of unknown length (in case you end up dealing with a broken system like delphi or java where you sometimes end up with aserialization interface that isn't allowed to ask how many items its about to store) and optional type tagging so you can go "this is a binary, but it's of type 7." which probably doesn't matterto almost anyone anymore, but meh.
03:34:54*lritter quit (Quit: Leaving)
04:00:27*fjellfras quit (Quit: Leaving)
04:01:46*fjellfras joined #nim
04:05:24*fjellfras quit (Client Quit)
04:06:10FromGitter<zacharycarter> thanks for sharing CBOR that does look nice
04:06:41*fjellfras joined #nim
04:08:19*fjellfras quit (Remote host closed the connection)
04:09:24*fjellfras joined #nim
04:09:46*fjellfras quit (Remote host closed the connection)
04:10:49*fjellfras joined #nim
04:22:26*fjellfras quit (Ping timeout: 248 seconds)
04:25:22*brakmic joined #nim
04:25:56*fjellfras joined #nim
04:31:45*brakmic_ joined #nim
04:32:22*brakmic quit (Ping timeout: 258 seconds)
04:35:04*nsf joined #nim
04:39:44*brakmic_ quit ()
04:39:53FromGitter<Obround> Is there a way to run Nim code inside Nim? Something like python's `exec` function?
04:59:19FromGitter<zacharycarter> Kind of - using hot code reloading or shared libraries
04:59:26FromGitter<zacharycarter> but remember Nim has to be compiled - Python is interpreted
04:59:56FromGitter<zacharycarter> you can use Nimscript and execute that at runtime
05:00:19FromGitter<zacharycarter> anywho - off to work
05:03:10skrylar[m]not like 'exec' no
05:03:58skrylar[m]as zach said its sort like trying to eval c code from a c program.
05:12:28*narimiran joined #nim
05:54:46*solitudesf joined #nim
05:55:00*absolutejam4 joined #nim
06:05:22*actuallybatman quit (Ping timeout: 248 seconds)
06:21:54FromGitter<zacharycarter> skrylar[m] - did you by any chance see my message about adding BC7 to your dds loader?
06:22:57FromGitter<zacharycarter> I already did it on my end - but I'm not sure if you'd be interested in me PRing the changes o rnot
06:24:56*Trustable joined #nim
06:34:37*actuallybatman joined #nim
06:34:38*Trustable quit (Remote host closed the connection)
06:42:46*absolutejam4 quit (Ping timeout: 246 seconds)
06:45:58*Senketsu quit (Quit: WeeChat 2.5)
06:50:18*Vladar joined #nim
06:50:19*Vladar quit (Remote host closed the connection)
06:50:29*macsek1911[m] quit (*.net *.split)
06:50:29*zeroDotTwenty[m] quit (*.net *.split)
06:50:29*Swednec8 quit (*.net *.split)
06:50:30*mattisme quit (*.net *.split)
06:50:30*FromGitter quit (*.net *.split)
06:50:30*nimblepoultry quit (*.net *.split)
06:50:30*snowolf_ quit (*.net *.split)
06:50:36*skrylar[m] quit (*.net *.split)
06:50:36*narimiran[m] quit (*.net *.split)
06:50:37*BitPuffin quit (*.net *.split)
06:50:37*sentreen quit (*.net *.split)
06:50:38*zestyr quit (*.net *.split)
06:50:38*vegai quit (*.net *.split)
06:50:42*oculux quit (Quit: blah)
06:50:48*Senketsu joined #nim
06:51:21*oculux joined #nim
06:51:23*oculux quit (Client Quit)
06:51:53*oculux joined #nim
06:52:27*oculux quit (Client Quit)
06:53:54*Eyess quit (Ping timeout: 248 seconds)
06:54:04*oculux joined #nim
06:55:21*SunDwarf joined #nim
06:57:48*Vladar joined #nim
06:59:05*actuallybatman left #nim ("ERC (IRC client for Emacs 26.2)")
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:30*gmpreussner joined #nim
07:06:00*Senketsu quit (Quit: WeeChat 2.5)
07:07:41*Senketsu joined #nim
07:08:09*Senketsu quit (Client Quit)
07:09:29*Senketsu joined #nim
07:16:20*skrylar[m] joined #nim
07:16:20*narimiran[m] joined #nim
07:16:20*BitPuffin joined #nim
07:16:20*sentreen joined #nim
07:16:20*zestyr joined #nim
07:16:20*vegai joined #nim
07:16:46*macsek1911[m] joined #nim
07:16:46*zeroDotTwenty[m] joined #nim
07:16:46*mattisme joined #nim
07:16:46*Swednec8 joined #nim
07:16:46*FromGitter joined #nim
07:16:46*nimblepoultry joined #nim
07:16:46*snowolf_ joined #nim
07:19:30*SunDwarf quit (Ping timeout: 248 seconds)
07:21:23*SunDwarf joined #nim
07:21:50*Ivo joined #nim
07:22:16IvoHi, the nim playground is telling me this has an indentation error, but I don't get how it's wrong T_T Can anyone explain it to me? http://ix.io/1Oy5/nim
07:24:32Vladarwhere's the = at the end of proc title?
07:31:18IvoVladar, ahhh, never "noticed" that bit of syntax before. Thankyou!
07:31:34Vladarnp
07:32:14*absolutejam4 joined #nim
07:34:49leorizeIvo: when you share to ix with the playground, the link in your URL bar will also update. You can share that link instead :)
07:37:50Ivofirst nim program ! https://play.nim-lang.org/#ix=1Oyc does this look pretty nymionic?
07:38:57leorizelooks nice, although some changes could be made:
07:39:08leorize- make your proc take in openArray instead of seq
07:39:20leorizethis will make it compatible with both seq & normal arrays
07:39:20Ivoif I'm supposed to call `isAlphaAscii` on a single char, what would be the best way to say get the char of the first letter in a string to call it on?
07:39:43leorizestring[0] ?
07:40:13leorize- don't use `return` unless it's control flow semantic is required
07:40:21leorizeuse the built-in result variable instead
07:40:27Ivooh that will return a char instead of a length 1 string?
07:40:35leorizeyea
07:40:36narimiran$string[0]
07:40:45Ivoyou need the $ then?
07:41:11IvoI thought I might try to make a nim kata for this codewars question https://www.codewars.com/kata/58e24788e24ddee28e000053
07:41:21Ivoso that's what the program is solving
07:41:41leorizethe $ is for converting to string
07:42:43leorizeIvo: initTable is no longer required
07:42:54Ivoso string[0] gets a char and $string[0] gets a string
07:43:30leorizeyea
07:43:37Ivoleorize, is it still required in 0.17? thats what codewars is currently running
07:43:54*actuallybatman joined #nim
07:43:58leorizeyea, it's required in 0.17
07:44:01narimiran0.17?? wow
07:44:04leorizeyou should bug them to update to 0.20
07:46:31Ivowould 0.17 nim code be likely to break at all on 0.20?
07:46:57leorizecertainly
07:47:14leorize0.17 is extremely old at this point
07:47:15Ivoso wouldn't have to worry about updating any existing code
07:48:19leorize0.17 is > 2 years old at this point
07:51:52IvoI think maybe you'd ask in https://github.com/Codewars/codewars-runner-cli/issues
07:51:58leorizeIvo: here's my modification of your snippet: https://play.nim-lang.org/#ix=1Oyd
07:52:17*Senketsu quit (Quit: WeeChat 2.5)
07:52:55leorizediff it against your original code :)
07:53:05IvocamelCase is default casing for nim?
07:53:20leorizeit's the recommended one
07:53:25Ivohmm I guess from std library functions lol
07:53:43leorizemainly because Araq hates snake_case :p
07:53:56leorizebut feel free to write your library in snake_case
07:54:05IvoI dunno if `op[2].contains(Letters)` is canonical way to check if `op[2]` is a letter
07:54:06leorizewe can use it with camelCase thanks to a certain feature anw
07:54:35leorizeIvo: use this `Letters in op[2]`
07:54:59leorize`a in b` is a syntactic sugar for `b.contains a`
07:55:25Ivonot `op[2] in Letters` ?
07:56:03Ivo`{single char} in {set of chars}` ?
07:56:03leorizeit's not even correct in English
07:56:08leorizeyea
07:56:36IvoI mean `{set of chars}.contains {single char}` makes sense
07:56:57narimiranleorize: look at your line 13
07:57:05Ivoso it should be `op[2] in Letters` right?
07:57:09leorizeyea, forgot that :p
07:57:13narimiranIvo: yep
07:57:19leorizeIvo: no, `Letters in op[2]`
07:57:26Ivo:S
07:57:36narimiranleorize: what?
07:57:50leorizeif op[2] contains Letters, then logically you'd check if Letters in op[2] :p
07:57:56leorizehttps://play.nim-lang.org/#ix=1Oyg
07:57:58leorizeI'm not kidding
07:57:59Ivoop2 is a single character
07:58:15leorizewell, but it's a string
07:58:27Ivoi though string[n] is character
07:58:33Ivono wait that's wrong
07:58:41leorizesplit produces seq[string]
07:59:08narimiranaaa, it's a split. i didn't read the code properly, sorry
07:59:13Ivoso you could use `op[2][0] in Letters` ?
07:59:35leorizeyea, although it wouldn't change much
07:59:53Ivowell the orientation of the `in` makes 10x more sense to me as a pythoneer xD
08:00:20leorizewhich is probably why narimiran got tripped by it as well :p
08:00:58Ivooh so `{func} {arg1} {arg2}` is an alternative call syntax to `{func}({arg1}, {arg2})` ?
08:01:09leorizeno
08:01:32Ivospecial-ish case for `inc` and `dec`?
08:01:37leorizehttps://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
08:01:54leorizeit's more of `{func} {arg1}, {arg2}`
08:02:23Ivooh just with the ,
08:02:36Ivoso you could also do `op[2].dec` ?
08:02:42leorizeyep
08:03:50leorizea lot of features in Nim is designed to make your code more readable :)
08:04:21Ivokewl
08:05:38Ivowhat concurrency programming models does nim have?
08:05:52Ivothis is a thing yet/soon ? https://nim-lang.org/docs/coro.html
08:06:02leorizeit's dropped actually
08:06:06FromGitter<mratsim> just use async
08:06:06leorizewe use async/await
08:08:27leorizeasync is a bit under-documented though
08:08:45livcdshould one use nim-chronos or std async ?
08:08:58Ivoit's not mentioned in https://nim-lang.org/docs/manual.html yet?
08:09:18leorizeit's not a language feature
08:09:28leorizebut a library implementation :)
08:09:46leorizeyou'll find the docs in the asyncdispatch module
08:09:55leorizeand iirc someone is writing an async tutorial
08:11:10leorizelivcd: I'd use std async because it's compatible with threadpool now :p
08:11:16Ivoit says await is a keyword tho, so that should be in the statements section?
08:11:25livcdleorize: what does that mean ? :O
08:12:17leorizeIvo: it's a keyword in `{.async.}` proc
08:12:29leorizeyea, we certainly needs more docs on this
08:12:55Ivo...right, well i probably need to get more familiar with basic nim first anyways. Thank you for the help
08:12:57leorizelivcd: https://github.com/nim-lang/Nim/pull/11724
08:13:31leorizeyou'll now be able to await a `spawn`-ed proc
08:14:03leorizewhich will allow you to use both threadpool and asyncdispatch seamlessly :D
08:14:18livcdthat sounds amazing?
08:17:12Zevvleorize: has not been merged to devel yet, has it?
08:17:22leorizeyea :p
08:18:33livcdi just heard dom96 say instead of koch cock
08:21:38*floppydh joined #nim
08:26:24*skrylar[m] quit (*.net *.split)
08:26:25*narimiran[m] quit (*.net *.split)
08:26:25*BitPuffin quit (*.net *.split)
08:26:25*sentreen quit (*.net *.split)
08:26:25*zestyr quit (*.net *.split)
08:26:25*vegai quit (*.net *.split)
08:27:06*macsek1911[m] quit (*.net *.split)
08:27:06*zeroDotTwenty[m] quit (*.net *.split)
08:27:06*Swednec8 quit (*.net *.split)
08:27:06*mattisme quit (*.net *.split)
08:27:06*FromGitter quit (*.net *.split)
08:27:07*nimblepoultry quit (*.net *.split)
08:27:07*snowolf_ quit (*.net *.split)
08:27:15dom96livcd, err?
08:28:37*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
08:29:43livcddom96: maybe i am just imagining
08:30:29*laaron joined #nim
08:30:59*laaron quit (Client Quit)
08:31:15*sentreen joined #nim
08:32:13*Senketsu joined #nim
08:32:22dom96livcd, where did you hear me say that?
08:35:38*snowolf joined #nim
08:35:45*laaron joined #nim
08:36:15*nimblepoultry joined #nim
08:36:16*macsek1911[m] joined #nim
08:36:19*mattisme joined #nim
08:36:30*vegai joined #nim
08:36:38*Swednec8 joined #nim
08:36:52*zestyr joined #nim
08:37:02*FromGitter joined #nim
08:37:50*zeroDotTwenty[m] joined #nim
08:41:27*narimiran[m] joined #nim
08:41:27*skrylar[m] joined #nim
08:41:58Araq--styleCheck:error is shipping :P
08:42:32*BitPuffin joined #nim
08:50:12*Senketsu quit (Quit: WeeChat 2.5)
08:52:04skrylar[m]@zacharycarter people are always welcome to send PRs. if they are not complete dumpster fires i accept them.
08:52:37skrylar[m]although for bc7 i suspect that's just another fourcc code so its highly likely to be accepted :p
08:52:45*Senketsu joined #nim
08:52:47FromGitter<zacharycarter> that's all it took really :P
08:52:53FromGitter<zacharycarter> okay cool I will do the PR this evening
08:53:12leorizeskrylar[m]: are you still working on your gui toolkit?
08:53:49skrylar[m]leorize: very slowly
08:54:37livcddom96: first part of the video leorize shared
08:54:38*Senketsu quit (Client Quit)
08:54:43skrylar[m]nfltk should be back in working order as of a few days ago; the haiku-based one has a working messenger system (without concurrency support), AppKit is stalled on gdk3 integration
08:56:46*Senketsu joined #nim
08:57:21leorizelivcd: I don't remember sharing any video :p
08:57:48livcdleorize: oops :X gh then
09:04:02*absolutejam4 quit (Ping timeout: 248 seconds)
09:04:37*shomodj joined #nim
09:07:11*absolutejam4 joined #nim
09:11:51*brakmic joined #nim
09:19:02FromGitter<mratsim> @leorize async is compatible with threadpools but there is no scheduler/multiplexer like for goroutines that automatically distribute tasks on hardware/software threads
09:19:38FromGitter<mratsim> so you need to do it manually (not that I think it's bad, a general purpose scheduler would have a lot of overhead and be very complex to maintain)
09:20:58*abm joined #nim
09:32:51FromGitter<ahcm> is it possible to restrict an enum in the function signature?
09:33:35FromGitter<ahcm> Say one that takes Filemode but fmWrite should not be allowed
09:35:24FromGitter<mratsim> use a set or a range
09:35:52leorizewell if you don't want writes, then don't take anything since only fmRead met your criteria :p
09:35:58FromGitter<mratsim> mmm set would require runtime check
09:36:18FromGitter<mratsim> range would require good ordering in the enum
09:36:43leorizethe FileMode enum wasn't designed for use in set
09:37:00Araqbtw this is the last week before my 2 week holidays start
09:37:09FromGitter<ahcm> I just don't want to allow overwrite, fo a DB like thing
09:37:27FromGitter<ahcm> I can raise an exception but compile time check would be so nice
09:37:54leorizeFileMode enum is not designed for that so you'd have to filter it yourself
09:38:25FromGitter<ahcm> Or use my own enum, OK, THX
09:38:33ZevvI guess it's not specifically about FileMode, but more about compile time checking of enum ranges
09:39:10leorizealthough I gotta say the FileMode enum is certainly not Nim :p
09:39:26FromGitter<mratsim> require a static enum as input and use `static: assert forbidden notin Allowed`
09:40:28*a_b_m joined #nim
09:40:29Araqnot Nim?
09:40:33Araqwhat do you mean?
09:41:08leorizeit could be designed to use with set[T] instead of fmReadWrite
09:41:49FromGitter<mratsim> but you can't pass sets to raw C proc that expect a flag
09:42:31leorizethe io module procs are high-level abstraction
09:42:34FromGitter<mratsim> I use this approach for C flags: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L43-L72
09:42:46leorizepretty sure there's already some conversion going on there
09:43:05FromGitter<mratsim> fmRead is also in system.nim for writeFile or (or write?)
09:43:06*solitudesf quit (Ping timeout: 272 seconds)
09:44:24leorizehttps://github.com/nim-lang/Nim/blob/devel/lib/system/io.nim#L428 <--- this is how it's currently done
09:44:25*abm quit (Ping timeout: 258 seconds)
09:44:37*absolutejam4 quit (Ping timeout: 245 seconds)
09:44:47*ng0_ is now known as ng0
09:45:38leorizewell but such a change to the io module is too late at this point :p
09:45:52*actuallybatman quit (Ping timeout: 245 seconds)
09:46:49FromGitter<mratsim> I'm surprised that the OS procs are parametrized by a string instead of int code
09:47:10leorizeit's easier to extend without breaking changes that way
09:47:31leorizeopenbsd's pledge also work like that
09:48:08FromGitter<mratsim> looking at the manual: c_fdopen
09:48:16FromGitter<mratsim> http://man7.org/linux/man-pages/man3/fopen.3.html sorry
09:48:48*clyybber joined #nim
09:48:53AraqC's IO wasn't designed for efficiency or type safety
09:49:48FromGitter<mratsim> well it's IO so I guess it will be dominated by disk speed anyway
09:51:56Araqnah it's super silly when "everything is a file (but not a disk access)"
09:58:35*absolutejam4 joined #nim
09:59:57*dddddd joined #nim
10:01:25clyybberAraq: =move is starting to get really weird.. No leaks and runs as expected on CPP backend, but FATAL dangling references exist on C backend: http://ix.io/1OyA
10:02:59shashlickWow lots of action for two days
10:04:35*Senketsu quit (Quit: WeeChat 2.5)
10:04:47*couven92 quit (Read error: Connection reset by peer)
10:05:20*couven92 joined #nim
10:07:28FromGitter<mratsim> Everything could be a function :P
10:08:57Araqwell it starts with the wrong name ("it's a stream ffs") and goes downhill from there. Env vars are not "files". Command line arguments are not "files".
10:10:17Araqin fact, Windows beats Unix on its homeground as on Windows everything is a "handle" and you can waitForMultipleObjects on it
10:10:55*surma quit (Ping timeout: 250 seconds)
10:11:07*surma joined #nim
10:13:36FromGitter<mratsim> but in windows file access locks by default, which is a pain
10:15:34*absolutejam4 quit (Ping timeout: 246 seconds)
10:17:43Araqboth systems are full of design bugs. But nobody designs a new "Windows like" OS.
10:22:31*brakmic_ joined #nim
10:22:37*brakmic_ quit (Remote host closed the connection)
10:22:40*brakmic quit (Read error: Connection reset by peer)
10:23:15*brakmic joined #nim
10:28:00FromGitter<kayabaNerve> Can't you lock the file lookup table?
10:28:25FromGitter<kayabaNerve> ... something like that. Basically lock the file used to access files, therefore stopping the filesystem from working?
10:36:34*fjellfras quit (Quit: Leaving)
10:41:50*stefanos82 joined #nim
10:47:24*absolutejam4 joined #nim
10:47:37*noonien quit (Quit: Connection closed for inactivity)
10:51:58*absolutejam4 quit (Ping timeout: 246 seconds)
11:01:49*a__b__m joined #nim
11:05:26*a_b_m quit (Ping timeout: 244 seconds)
11:06:58*abm joined #nim
11:08:04*laaron quit (Remote host closed the connection)
11:09:03*a__b__m quit (Ping timeout: 244 seconds)
11:11:21*laaron joined #nim
11:11:54*tjmac joined #nim
11:15:17FromGitter<ahcm> One uses existsDir for isDir?
11:15:52*a_b_m joined #nim
11:16:39Araqyeah, I think so
11:19:13*abm quit (Ping timeout: 245 seconds)
11:26:39*absolutejam4 joined #nim
11:33:18*absolutejam4 quit (Ping timeout: 272 seconds)
11:35:50FromGitter<ahcm> len returns int? Why not uint64?
11:36:22*absolutejam4 joined #nim
11:36:23Araqbecause it would be worse
11:36:50Araq1. unsigned als implies "modulo semantics", usually not what I need for 'length'
11:36:54Araq*also
11:37:23FromGitter<ahcm> so x = readFile(); len(x) ?
11:37:27Araq2. I enjoy that code like 'for i in 0 .. x.len - 3' just works
11:37:32*laaron- joined #nim
11:39:00Araqwhat about the 'readFile' example? who tells me that I'm not a filesystem that can have files larger than high(uint64) anyway
11:39:58FromGitter<ahcm> so if len() is restricted to in32 how do you work with bigger files/strings?
11:40:18Araqlen is int, not int32
11:40:54*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
11:40:57Araqon a 64 bit CPU, int is 64 bits
11:41:04FromGitter<ahcm> but expression 'len(data)' is of type: int
11:41:24FromGitter<ahcm> Darwin andys-mba.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
11:41:55Araqint is not int32.
11:42:24FromGitter<ahcm> so I have to cast int to BiggestInt?
11:42:29*absolutejam4 quit (Ping timeout: 258 seconds)
11:42:40FromGitter<ahcm> because just a + does not work
11:42:50FromGitter<ahcm> just trying too understand
11:43:26Araqit depends, but BiggestInt(x) might be required
11:44:16FromGitter<ahcm> i have offset : BiggestInt and then offset + len(readFile())
11:44:41FromGitter<ahcm> Is there a better way? maybe not use BiggestInt?
11:45:27narimiranyes, use `offset: int` if you can
11:46:03FromGitter<ahcm> but Fileinfo has: size*: BiggestInt
11:46:32*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
11:48:00AraqBiggestInt(len(readFile())) is also ok
11:48:36*leorize quit (Ping timeout: 260 seconds)
11:49:32*ng0 quit (Ping timeout: 260 seconds)
11:50:31Araqis it just me or does https://github.com/nim-lang/Nim/issues/11723 work?
11:51:46*laaron joined #nim
11:52:43*ng0 joined #nim
11:52:55*leorize joined #nim
11:56:40*ng0 quit (Client Quit)
11:58:05narimiranit is just you
11:58:36narimiran(disclaimer: my nim devel is from friday)
12:10:44*a__b__m joined #nim
12:14:41*a_b_m quit (Ping timeout: 258 seconds)
12:15:47*absolutejam4 joined #nim
12:15:47clyybberAraq: How does the danling ref detection work? I dont really understand where the refcount gets saved..
12:15:58clyybbers/saved/stored
12:18:52clyybberI mean I cant find the code that increases or decreases the rc field
12:20:29Zevvcan someone try to run a little snippet for me on windows?
12:20:56*absolutejam4 quit (Ping timeout: 268 seconds)
12:21:19Zevvhttp://paste.ubuntu.com/p/QhvG8d6FS2/
12:21:23Zevvwhat is the output of that
12:23:16clyybberfish: Unknown command ELF\cb\ca\ca
12:23:25clyybber/tmp/nimtest (line 1):
12:23:27clyybber ELF
12:23:41leorizeclyybber: https://github.com/nim-lang/Nim/blob/8513f50a8d584a36667e789059407b7ad6135878/lib/core/runtime_v2.nim#L79
12:24:25leorizethe code that modify the ref count is right above
12:25:38clyybberOh boi, how could I have overlooked that.. I thought the nimWeakRef was only for normal refs, but in debug mode they share the same code of course
12:25:43clyybberThanks leorize
12:27:12clyybberTbf, I cant find them in the generated C code
12:28:19Zevvsorry, wrong snippet: http://paste.ubuntu.com/p/2XnvT9NRs2/
12:29:32clyybbersame output
12:30:22clyybbernevermind
12:30:27clyybberthe output is 1
12:31:15clyybberand the earlier snippets output is 1 too
12:31:27Zevvon windowS?!
12:31:32clyybberno, on linux
12:31:34Zevvyeah :)
12:32:03Zevvthat was the point, thanks for confirming :)
12:33:26alexander92why is the danling error so simple, doesnt it at least include an address
12:40:13clyybberI dont understand how I get a dangling ref error, when no code even touches the rc field..
12:40:24clyybberalexander92: Yeah, that could be improved
12:41:54alexander92is it possible you get a data corruption
12:41:56alexander92somehow
12:42:27clyybberHmm, but its really weird, on CPP it runs without problems
12:42:28alexander92run it under gdb(or rr), put a watchpoint on the failing rc field
12:42:40clyybberoh, you can do that?
12:42:54clyybberthats amazing
12:43:15alexander92(under rr you can directly reverse-continue to monitor changes in it, in gdb you have to restart and somehow hit it again, not sure how deterministic it is)
12:43:28alexander92well, i assume its some kind of an int value, right?
12:43:55clyybberyea
12:43:58alexander92you can put watchpoints on addresses of such primitive values and debuggers can stop on each change
12:44:16alexander92the problem is that usually there are max 4 hardware watchpoints on most pc-s iirc
12:44:25alexander92so you cant really watch too many things at once
12:45:46alexander92(but i recommend https://github.com/mozilla/rr : it exposes a gdb server, so you use it exactly as gdb, but you can step/continue back and also reproduce the same run of a program many times)
12:46:17alexander92so thats useful sometimes if its hard to guess how something is exactly changed/touched
12:53:53*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
12:54:39*laaron joined #nim
12:58:44*shomodj_ joined #nim
13:01:17*shomodj quit (Ping timeout: 245 seconds)
13:03:14*absolutejam4 joined #nim
13:09:10*absolutejam4 quit (Ping timeout: 246 seconds)
13:10:27*a_b_m joined #nim
13:11:48FromGitter<zacharycarter> I wish window had some decent debugging / profiling tools
13:12:16FromGitter<zacharycarter> non-commercial ones I mean
13:14:13*a__b__m quit (Ping timeout: 245 seconds)
13:18:36skrylar[m]there's always tracy?
13:19:37skrylar[m]https://bitbucket.org/wolfpld/tracy or https://www.hawktracer.org/ depending on use
13:22:52*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
13:25:33*laaron joined #nim
13:25:40*leorize quit (Ping timeout: 260 seconds)
13:27:24FromGitter<zacharycarter> yeah - but nothing like Valgrind or rr
13:28:28*leorize joined #nim
13:31:17clyybberzacharycarter: Maybe valgrind works in the linux subsystem?
13:33:01clyybberHmm, no this is kinda weird: http://ix.io/1Ozo
13:33:03clyybberbbl
13:33:06*clyybber quit (Quit: WeeChat 2.5)
13:33:45*absolutejam4 joined #nim
13:34:21*PMunch joined #nim
13:34:44skrylar[m]you could always just not use windows ^_^
13:34:46*skrylar[m] ducks for cover.
13:41:01alexander92actually microsoft were adding interesting stuff to their mdbg
13:41:12alexander92windbg*
13:41:34alexander92but i havent used it iirc, as i dont use windows often
13:56:01*sniffdtek joined #nim
14:00:51Araqget some clang for windows build that supports the sanitizers
14:01:10FromGitter<zacharycarter> yeah - that's an option
14:06:53Araqthere is also Dr.Memory
14:09:20*natrys joined #nim
14:15:06FromGitter<zacharycarter> that one I have used
14:18:58Araqhow was it?
14:23:58*brakmic quit ()
14:25:38*Senketsu joined #nim
14:27:22FromGitter<zacharycarter> pretty limited / not great - but it could very well be that if you know how to use it properly, it's more poewrful
14:28:04FromGitter<zacharycarter> https://github.com/nim-lang/Nim/issues/11718 - I used it to try to figure out what was causing this issue
14:29:36Zevvyeah, did you figure that one out in the end?
14:31:14ZevvIt was quite late already when I looked into that, but I believe the offending symbol was declared static in the generated C code, so the run time linker is not able to resolve the symbol from the shared lib later
14:31:19Zevvsomething like that
14:32:08*jxy quit (Quit: leaving)
14:32:13*nsf quit (Quit: WeeChat 2.4)
14:32:16*Senketsu quit (Quit: Leaving)
14:32:28*jxy joined #nim
14:33:06*Senketsu joined #nim
14:33:26FromGitter<zacharycarter> I didn't
14:33:41FromGitter<zacharycarter> I gave up on using HCR for now and am instead using nimscript
14:36:03Zevv:(
14:37:20*Senketsu quit (Client Quit)
14:37:58*pydsigner quit (Ping timeout: 245 seconds)
14:38:08*pydsigner joined #nim
14:38:26*Senketsu joined #nim
14:43:37*PMunch quit (Remote host closed the connection)
14:47:20*nsf joined #nim
14:48:03disruptekwow, nim's re api looks really well thought out. who do i have to blame for this?
14:50:46*Senny joined #nim
14:51:18*Senny quit (Client Quit)
14:51:22*Senketsu quit (Quit: Leaving)
14:54:14FromGitter<mratsim> maybe the fact that there are 4 regexps in Nim :P
14:54:25*Karol37 joined #nim
14:55:13FromGitter<mratsim> oh re2 has been removed
14:55:20FromGitter<mratsim> there is also strscans
14:55:28FromGitter<mratsim> and pcre
14:55:52*alexander92 quit (Ping timeout: 245 seconds)
14:56:10Karol37Hello all! Could anyone explain me why this code doesn't work? ("callback" message is never run)
14:56:34disrupteki thought re was pcre.
14:56:43FromGitter<mratsim> pcre is raw pcre
14:56:52Zevvre is pcre with sugar
14:56:57FromGitter<mratsim> @Karol37, what's the code?
14:57:01Karol37the only way is to make "future.waitFor()" which I don't want to do because I don't want block main thread
14:57:03disruptekyeah, so some nimmer made re. it's nice.
14:57:12Karol37import asyncdispatch
14:57:20leorizeKarol37: don't paste on IRC
14:57:24leorizeuse play.nim-lang.org
14:57:33Karol37sorry
14:57:37Karol37I'll do that
14:57:39disruptekalso, don't sweat it.
14:57:46Zevv:)
14:58:10leorizeit's rather nice that we can now link to the playground :p
14:59:22disruptekit'd be cool if a bot would post a link to the playground when someone hits a button in the playground.
14:59:33Karol37OK
15:00:02leorizeit'd be too easy to spam IRC like that :P
15:00:27disruptekno one would bother. also, the bot could be a little smarter than the average bear.
15:01:19Karol37here is the code https://play.nim-lang.org/#ix=1OzV
15:01:30narimirandisruptek: how would you prevent people from anonymously share some bad/illegal content?
15:02:04disruptekdo you really think this is a practical problem?
15:02:24leorizeand what if I just want to share code to friends but not the world?
15:02:38disruptekwhat if you do?
15:02:48narimiranleorize: you just don't click "share on IRC" button?
15:02:58leorizeKarol37: you didn't run `poll()`
15:03:08leorizenarimiran: oh, yea, I misread the proposal a bit :p
15:03:29ZevvKarol37: runForever() instead of while true:discard
15:03:43Zevvnot that once the timer expires you get an exception
15:03:51Zevvbecause nothing is left in the event queue
15:04:42Karol37so what should I do inside while loop? feature.poll(100) should do the job?
15:05:12Araqdisruptek, I wrote most of re.nim and usually don't get praise for it :P
15:05:22Araqdidn't you mean 'nre'?
15:06:08FromGitter<mratsim> ah right nre
15:06:18disruptekoh, that's the 4th one.
15:06:19FromGitter<alehander42> By
15:06:24leorizeKarol37: just poll until the future finish
15:06:29leorizelike this: https://play.nim-lang.org/#ix=1OzX
15:06:38disrupteki have only looked at re so far.
15:07:03disruptekthe problem i have with most re libs is that every language is different enough that i have to look up how to do anything.
15:07:09disruptekand that's a pain in the ass.
15:07:28disruptekand re may be inuitive enough for me that it's a gamechanger.
15:07:45Karol37leorize: thank you very much! :) It works like a charm! :)
15:07:59disruptekif i don't have to look something up, i'm about 40-50x more productive.
15:08:13Karol37I have to read 'poll' documentation to understand it better.... :/
15:08:32disrupteksweet. another satisfied customer. :-)
15:10:01disruptek"If you love sequtils.toSeq we have bad news for you."
15:10:05disrupteklol
15:10:43disruptektoo bad that lib wasn't named seqsutils. i was rolling over here.
15:12:45Karol37disruptek: nim has some hard parts but it is nice language overall
15:13:03disruptekyeah, i like it a lot.
15:13:22*sentreen quit (Ping timeout: 245 seconds)
15:14:10*natrys quit (Quit: natrys)
15:15:24*Senketsu joined #nim
15:19:11lqdev[m]shashlick: any news on support for unions/nested structs in nimterop?
15:22:42disruptekwhat i was trying to say, i guess, is that not having to lookup how to use re means that i can afford the time it takes to use it, which means it gets more use, which elevates my toolset dramatically.
15:24:58Araqwell thank you. I'd still rather have working auto-completion
15:25:01lqdev[m]oh no this again `type mismatch: got <proc (vm: ptr WrenVM, text: cstring){.cdecl, gcsafe, locks: 0.}> but expected 'WrenWriteFn = proc (vm: ptr WrenVM, text: cstring){.cdecl.}'`
15:25:08lqdev[m]what am I supposed to do then!?
15:25:35Araqcheck for duplicate WrenVM declarations
15:26:08Araqwe improved these error messages, but *shrug* they are never good enough
15:26:21disruptekworking auto-completion?
15:26:51Araqdisruptek, that thing that Delphi got right in 1990
15:26:55lqdev[m]ah, that makes sense. I just made another `WrenVM` object and I was going to use `wrap.WrenVM` for the C-wrapped one
15:27:16disruptekthe graph technique?
15:27:26disruptekthe same algo in crosswords. :-)
15:27:31Araqit was later called "IntelliSense"
15:28:04Araqyou would type in a dot and it would tell you what options are available.
15:28:45Araqyou could also click on identifier and jump to its declaration, fancy stuff.
15:28:50disruptekright. i've only ever used an ide for c# code; it was probably the killer feature.
15:29:08Araqlol
15:29:13disruptekbut, i dunno, i'm just a vi guy through and through.
15:29:29disruptekand i had it setup in nvim but it was just too annoying.
15:30:04disruptekiirc, intellisense even produces the code with locally-scoped variable names.
15:30:53Araqit's not a "killer feature" in 2019.
15:30:58Araqit's standard.
15:30:59disrupteki recall thinking, "if you're so damned smart, why don't you write the thing?"
15:31:17disruptekyes, but i mean that'd be the only reason i would ide.
15:32:03AraqI've yet to see a productive Vi(m) user. IME they are all living in some illusion and need a hard slap in the fact to wake up.
15:32:16Araq*in the face.
15:32:37disrupteki don't use it all that cleverly, but maybe you'll watch me stream and tell me i'm nuts sometime.
15:32:49AraqI will.
15:33:12*nsf quit (Quit: WeeChat 2.4)
15:33:54leorizeI'm certain that I'm more productive in my nvim setup than VSC
15:34:07leorizethat's after I wrote nim.nvim :p
15:34:18disruptekzevv can attest to the fact that if you are of a certain age, you grew up over low bandwidth text interfaces.
15:34:22disruptekthat's just how you roll.
15:34:30Zevvdisruptek: why me?
15:34:43disrupteki think you're a sysadmin type who uses a text editor.
15:34:46ZevvI'm not *that* old
15:35:01ZevvI do my irc over ssh on an android phone
15:35:03disruptekno, i'm saying you know what i'm talking about.
15:35:08Zevvthats pretty modern :)
15:35:19disruptekgame, set, match.
15:35:51Zevvhehe. I did start at 300/1200, long ago
15:35:52disruptekif you were modern you'd be using quasseldroid or w/e.
15:37:46*absolutejam4 quit (Ping timeout: 272 seconds)
15:41:50*lritter joined #nim
15:43:24*sniffdtek quit (Remote host closed the connection)
15:43:40*sniffdtek joined #nim
15:49:31disruptekso isn't algo from a paper in the '90s? earlier? '85? surely there is a commodity implementation in C?
15:59:34*a__b__m joined #nim
16:03:07*a_b_m quit (Ping timeout: 246 seconds)
16:03:41*lqdev[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/yafZlmJloDsJuNpVRHbiRdAX >
16:03:44lqdev[m]codegen bug?
16:04:27lqdev[m]maybe I forgot to include a file, or something
16:06:51Araqbug in your wrapper
16:06:54Araqmost likely.
16:08:26*Karol37 quit (Remote host closed the connection)
16:10:14*Trustable joined #nim
16:14:36*leorize quit (Ping timeout: 260 seconds)
16:14:54*leorize joined #nim
16:24:21*Senketsu quit (Quit: Leaving)
16:27:59*Senketsu joined #nim
16:28:24*sentreen joined #nim
16:35:14*nullnullnull joined #nim
16:36:00*clyybber joined #nim
16:37:45*nsf joined #nim
16:39:19*sentreen quit (Ping timeout: 268 seconds)
16:41:37nullnullnullis there a way to make a thread timer to terminate the app after X seconds for example? (it will not block the user input)
16:42:32clyybberAraq: Any idea/intuition how that can happen: http://ix.io/1Ozo ? It only happens on the C backend.
16:44:09*a__b__m quit (Quit: Leaving)
16:45:07leorizeunchecked nil access?
16:45:52clyybbervalgrind says no
16:46:01clyybberno invalid read or write
16:46:57clyybberNevermind, gdb watchpoint might have mislead me
16:47:14clyybberit must be something different
16:47:38*actuallybatman joined #nim
17:05:30Zevvclyybber: is this something I can reproduce?
17:10:37disrupteknullnullnull: sure, just asyncsleep.
17:11:49nullnullnull@disruptek, can u give me an example how to do it? i tried this: sleep(1000); echo ("done")
17:12:32clyybberZevv: Yeah, but you have to checkout my branch and build nim from there.. so It's a bit of work.
17:12:38Zevvwhere is it?
17:12:39clyybberAlso I can reproduce it on two machines
17:12:54disrupteknullnullnull: https://nim-lang.org/docs/asyncdispatch.html#sleepAsync -- sorry, i always confuse sleepAsync with asyncSleep.
17:14:05nullnullnull@disruptek, thanks mate, I will check it out
17:14:23disrupteki don't have a canonical reference for async in nim, but that's what you'll probably want to use, as it's probably closest to your ultimate code.
17:14:23clyybberThis is the PR: https://github.com/nim-lang/Nim/pull/11248 , heres the reproduction code: http://ix.io/1OhF , and compile it with --newruntime
17:14:39clyybberAlso, for valgrind and the like I also do -d:useMalloc
17:15:06nullnullnull@disruptek, yeah, the goal is to keep the app responding (like a timer in background to exec code)
17:15:44clyybberAnd now I got gdb to crash;; nice :D
17:15:54Zevvsweet
17:16:26disruptekyou gotta give clyybber props for embarking on this adventure.
17:16:33Zevv"[FATAL] unpaired dealloc
17:16:35Zevvis that the one?
17:16:40Zevv[FATAL] dangling references exist
17:16:42Zevvor that
17:16:51ZevvSIGSEGV: Illegal storage access. (Attempt to read from nil?)
17:16:53Zevvor that :)
17:17:57clyybberdangling references exist
17:18:02clyybberbut only on C backend
17:18:48ZevvI was running your previous ix.io snippet - this one builds and does "haha" "nonshaha" only, and valgrind is happy
17:19:04clyybberOh, I don't know which one that i
17:19:07clyybbers
17:19:10clyybberI forgot :D
17:19:23nullnullnullhmmm "Error: undeclared identifier: 'await'" but I've already declared this: import asyncdispatch
17:19:34Zevvbut with http://ix.io/1OhF I see no problems
17:19:55disrupteknullnullnull: await is only usable inside an {.async.}-annotated proc.
17:20:23nullnullnulloh
17:20:27clyybberZevv: Yeah, I'm struggling with this one: http://ix.io/1OhF
17:20:31clyybberI posted it above
17:20:56nullnullnull@disruptek, yeah sorry I'm new to nim ;)
17:20:57Zevvthan one runs just fine here on c6a119bdc
17:21:13disrupteknullnullnull: everyone had to start somewhere. ;-)
17:21:26clyybberZevv: With 'nim c --newruntime' ?
17:21:29Zevvyes
17:21:33clyybberHuh, wth
17:22:30clyybberWhat about 'nim c --newruntime -d:useMalloc' ?
17:22:45Zevvsame
17:23:13Zevvhttp://ix.io/1OAz
17:23:50clyybberZevv Ah, thats the old snippet
17:23:57Zevvdang
17:24:17clyybberOh, nevermind
17:25:04Zevvdouble checked, it *is* http://ix.io/1OhF. But ok, nevermind :)
17:25:27clyybberOh
17:25:42*clyybber posted the wrong snippet, and is now shamefully hiding
17:26:21clyybberThats the one: http://ix.io/1OyA
17:26:30clyybberI pasted the wrong one
17:26:40Zevvyeah, that was the one I first tested
17:26:46Zevvand gave me 3 different crashes
17:26:57clyybberAll at the same time??? :p
17:27:08Zevvquantumbug
17:27:22Zevvvalgrind is not happy here.
17:27:32*tjmac left #nim ("-bye")
17:27:48clyybberZevv: With --newruntime -d:useMalloc ?
17:27:56Zevvyes
17:28:16clyybberDoes valgrind say invalid read, or only leaking memory?
17:28:42Zevvonly warning on conditional-jump-uninit-memory, usually red haring
17:28:44Zevvherring
17:29:11Zevv*but* since I get 2 different crashes alternating, something is up here
17:30:56clyybberHmm, ok thats really weird
17:31:03clyybberWhat happens with nim cpp ?
17:31:17Zevvall is well
17:31:32clyybberThats so fucking weird
17:32:10ZevvI'm chewing through the C code now
17:34:50clyybberI tried using gdb watchpoints on the hidden RefHeader, but it crashes after telling me the value has been set from 0 to <unreadable>
17:35:22ZevvI'm wrapping my head around the seventeen casts in that line
17:35:34Zevvit has more brackets then a lisp compiler in lisp
17:36:23disruptekcareful you aren't castrated.
17:38:04*sniffdtek quit (Remote host closed the connection)
17:38:22*sniffdtek joined #nim
17:53:44clyybberbbl, Zevv I check the irclogs so pls dont hesitate to @ me
17:53:46*clyybber quit (Quit: WeeChat 2.5)
17:53:49Zevvk
17:54:31*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:56:06*laaron quit (Remote host closed the connection)
17:56:32*shomodj joined #nim
18:03:22*floppydh quit (Quit: WeeChat 2.5)
18:10:56*brakmic joined #nim
18:11:39*solitudesf joined #nim
18:14:54*brakmic_ joined #nim
18:18:24*brakmic quit (Ping timeout: 244 seconds)
18:18:47*brakmic joined #nim
18:22:01*brakmic_ quit (Ping timeout: 244 seconds)
18:22:24*absolutejam4 joined #nim
18:36:29FromGitter<Obround> Is there some way you can alias `echo` under a different name?
18:36:40FromGitter<Obround> Like `my_echo`?
18:37:18kungtotteWhat's your actual goal with this? This sounds a bit like an X/Y problem.
18:38:35FromGitter<Obround> I'm writing a compiler that transpiles to Nim, and echo is not called echo
18:39:02*sniffdtek quit (Remote host closed the connection)
18:39:20*sniffdtek joined #nim
18:39:24skrylar[m]Compiling to nim compiling to c 😆
18:40:06kungtotteIf you're transpiling something, why do you need to rename it anyway? If it's called print in the source language, print should map to echo in Nim shouldn't it?
18:41:19FromGitter<Obround> Yes, but I don't want echo to be a reserved keyword that does nothing...
18:42:57*sniffdtek quit (Remote host closed the connection)
18:43:15*sniffdtek joined #nim
18:43:56FromGitter<Obround> Nvm, I found a solution: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d2cc96ce190903936ef1a52]
18:43:56*sniffdtek quit (Remote host closed the connection)
18:44:53*abm joined #nim
18:45:20*leorize quit (Ping timeout: 260 seconds)
18:52:54nullnullnullguys what's wrong with this line: await sleepAsync(2000) , I'm trying to run some code in background (but the app keeps waiting for the sleep async to end)
18:54:42blackbeard420is there a way to set --threads:on for the nim plugin in vscode? ive set "nim.buildCommand": "--threads:on c" and still no completion for anything related to threads
19:03:00blackbeard420nevermind, added --threads:on to my nim.cfg and it works
19:09:21*sniffdtek joined #nim
19:15:58*sentreen joined #nim
19:21:10AraqObround: 'echo' is not a keyword in Nim
19:25:59nullnullnullor how to check if thread task is complete (on background)
19:28:51*Trustable quit (Remote host closed the connection)
19:32:29Zevvdamn clybber, this is quite the introduction to move semantics
19:32:49Zevvdamn clybber, this is quite the introduction to move semantics
19:45:58*stefantalpalaru joined #nim
19:46:17stefantalpalaruHow do I create a type alias for a ref type?
19:46:35Araqtype Alias = Stuff
19:47:06stefantalpalaruIt doesn't seem to work when Stuff is a ref type.
19:47:26Araqit's used 5 billion times in Nim's core
19:47:41lqdev[m]type SomeRef = ref Some
19:48:02*jjido_ joined #nim
19:48:21lqdev[m]what error are you getting?
19:50:00Zevv@clyybber: no clue yet why, but the =move at the end of the seq add is taking one too many refs of value in the C code. It sets the pointer itself to NULL instead of its contents, so the button is not moved and is still in `b`
19:50:45*brakmic quit (Read error: Connection reset by peer)
19:51:07*brakmic joined #nim
19:51:26stefantalpalaruMy bad. The problem wasn't with the type alias.
19:52:21*nsf quit (Quit: WeeChat 2.4)
19:53:10*brakmic quit (Read error: Connection reset by peer)
19:53:16*brakmic_ joined #nim
19:54:17Araqshashlick, I finally did it, c2nim is free of the compiler API dependency
19:56:20Zevv@clybber: took me an hour or two to understand how it all fits together, and just now I see the C compiler is complaining about the exact same thing :)
19:57:04Araqclybber is away?
19:57:17Zevvyeah but he told me to @ him anyway since he will read up
19:57:32*brakmic_ quit (Client Quit)
19:57:54*brakmic joined #nim
19:58:48Araqah ok
20:00:35*Obrx joined #nim
20:02:01*Obrx quit (Remote host closed the connection)
20:02:50*Obrx joined #nim
20:04:07*Obrx quit (Remote host closed the connection)
20:04:45*stefantalpalaru quit (Quit: stefantalpalaru)
20:06:18Zevvwell, I see why the C code goes wrong, that is obvious now. But I can not quite follow where/how this is generated from the Nim world
20:06:52*Vladar quit (Remote host closed the connection)
20:10:54shashlick@Araq - brilliant! How did you pull that off?
20:11:23*jjido_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:19:21*absolutejam joined #nim
20:21:22*absolutejam4 quit (Ping timeout: 244 seconds)
20:31:52*clyybber joined #nim
20:33:31clyybberZevv: Amazing, thanks so much dude
20:34:23clyybberYou mean the move in add_xi2... ?
20:34:25Zevvsomething something moveOrCopy something
20:34:45Zevvyeah. The C code gen adds an superfluous & to the **value
20:35:36Zevvc++ uses ref there, so that's one indirection less
20:35:37clyybberYep, but even removing that doesnt seem to fix the issue
20:35:45Zevvit does for me
20:35:57Zevvif I change that, 'b' is NULL after the add
20:36:00clyybberoh, so my compile script is broken I guess
20:36:05clyybberthanks gonna try again
20:36:32Zevvif you fix it, let me know, I got a long way figuring out how it all connects togetehr, but I'm not quite there yet
20:36:50clyybberThe change is in stdlib_system.nim.c:2550 right?
20:36:52ZevvI'm suspecting the genMove at injectdestructirs.nim:649
20:37:07clyybberZevv: I think its the C codegen
20:37:17ZevvI guess to
20:37:34Zevvits line 2563 for me
20:37:38clyybberAh, no you are right
20:37:39Zevveqmove__mWsu5ftDgPiIZZo1TM3y0Q(&(*(*xu).p).data[oldLen], &value);
20:38:03clyybberIts probably in injectdestructors
20:38:13*brakmic quit (Ping timeout: 246 seconds)
20:38:19clyybberZevv: Yeah, thats at 2550 here for some reason
20:38:36clyybberalso for some reason, sometimes the compile script doesnt work
20:38:59clyybberwooow
20:39:02clyybberit worked
20:39:20Zevvsweet
20:39:28Zevvroot cause?
20:39:52clyybberThe makeAddrExp in injectdestructors.nim:353
20:40:08Zevvno waty
20:40:10clyybberThat isnt required when the moved variable is a sink param
20:40:18clyybbersince sink params are now passed by addr
20:40:35Zevvah makes sense
20:40:51clyybberIt's easy to fix, but damn I would never have caught that codegen error
20:40:55clyybberso thanks a lot :DD
20:41:05Zevvyw
20:41:22*narimiran quit (Ping timeout: 246 seconds)
20:42:15Zevvso, how long to the finish line you guess?
20:42:32clyybberWell, inheritance I need to figure out
20:43:06clyybberBut maybe I'm overthinking something there, and it will just work (doubt it)
20:43:24dom96Araq, why does packedjson have this weird JsonTree?
20:44:48dom96also kinda doubting this will be efficient for generating JSON
20:45:20Zevvwell good luck clyybber, I'm off to take a nap
20:46:04clyybberThanks, good night
20:46:47*Serenitor joined #nim
20:47:28*brakmic joined #nim
20:48:11*brakmic quit (Read error: Connection reset by peer)
20:48:16*brakmic_ joined #nim
20:48:42*Serenitor quit (Client Quit)
20:49:02*Serenitor joined #nim
21:00:08FromGitter<brentp> does nimble install now use `-d:danger` ? or just `-d:release` ?
21:00:25clyybberZevv: Just -d:release afaik
21:00:40clyybberAh wrong tag
21:00:56FromGitter<brentp> but nimble will use my nim.cfg ?
21:02:09FromGitter<brentp> seem so
21:11:07clyybberYeah it will
21:11:08*clyybber quit (Quit: WeeChat 2.5)
21:15:59*PMunch joined #nim
21:16:34shashlick@Araq - I see you pulled in all compiler code into c2nim - but now it won't build with older versions of nim
21:17:38FromGitter<mratsim> I think people can choosenim devel just for c2nim though
21:17:41AraqI doubt ast.nim etc use advanced Nim features
21:17:54*Ivo quit (Ping timeout: 248 seconds)
21:17:55shashlickwell, i just tried 0.19.6 and it breaks
21:18:09shashlickcompiler\pathutils.nim(13, 22) Error: cannot open file: pathnorm
21:18:15FromGitter<mratsim> c2nim is something that you only use at the beginning of a project
21:18:21FromGitter<mratsim> and you can use an older release
21:18:40shashlickperhaps c2nim can also post release binaries
21:19:52Araqshashlick, seems like an oversight to me
21:20:10FromGitter<mratsim> uh Araq, did you misunderstand me here? https://github.com/nim-lang/RFCs/issues/154
21:20:32FromGitter<mratsim> I'm not saying to remove dereferencing
21:20:58Araqbut I don't want to copy pathnorm so IMO c2nim should simply require 0.20
21:23:00Araqmratsim: yes but what are you saying?
21:23:29FromGitter<mratsim> that for explicit dereferencing, we should have `deref` (or something else) instead of `[]`
21:23:52FromGitter<mratsim> i.e. I'm only talking about explicit dereferencing, not the implicit one for ref or ptr object fields
21:23:54shashlickin all honesty, i'd rather have seen nim expose the compiler API for the installed compiler
21:24:06shashlickthen the building compiler and compiler API will be the same
21:24:11shashlickand you wouldn't see any of these issues
21:24:24shashlickthen if there were any variations, c2nim could just have a when NimVersion calls
21:24:36Araqmaybe but c2nim doesn't really require the Nim compiler anyway
21:24:52Araqonly the renderer and when we change that, all c2nim tests could break
21:25:03Araqso it was fragile
21:25:03*jjido joined #nim
21:25:11shashlickagreed, but any tool that wants to leverage the compiler API will be built with an installed version of compiler
21:25:36Araqin general, ok, but c2nim is not "any tool"
21:25:40shashlickso letting `import compiler` just point to the `path\to\nim\compiler` would be cool
21:26:05shashlickor even `std/compiler`
21:26:06Araqthat's effectively how I always built c2nim
21:26:17Araqnim c --noNimblePath --path:../nim c2nim
21:26:43Araqbut then I build c2nim against devel
21:26:49Araqand the tests can be off.
21:26:53Araqbeen there, done that.
21:27:05Araqthe new way should be better.
21:27:34shashlickwhy would the tests be off?
21:27:44Araqrenderer.nim differences
21:28:23*shomodj quit (Ping timeout: 245 seconds)
21:28:27shashlickok - I understand the compiler API doesn't need to get updated all the time, but only request would be to make it more backwards compatible
21:29:07shashlickcause `nimble install c2nim` failures shouldn't require a nim compiler update
21:29:34shashlickno doubt you can build and install it with latest and then use the compiler version you want, but you know what i mean
21:30:03*shomodj joined #nim
21:32:03shashlicktested with 0.20.0 and it works
21:33:15dom96yep, no difference from packedjson
21:33:43Araqdom96, interesting, I would seriously doubt that
21:34:32Araqshashlick, so what to do? require 0.20 or ship 'pathnorm' with it?
21:34:38AraqI don't care either way
21:34:41dom96Araq, it still alllocates twice
21:34:56dom96well, actually far more than twice
21:35:06dom96for each JsonNode + to generate the JSON string
21:35:28shashlick@Araq - no need for extra work now, going forward is fine
21:35:30disruptekperhaps why json is slower than xml.
21:35:38Araqmaybe if you use it in some bad way, dom96
21:35:57shashlickyou could pin 8f1705509084ae47319f6fcfb131e515b134e0f1 to 0.9.15 - last version that worked with 0.19.6
21:36:03dom96I use it pretty naively, but I don't get how this many allocs won't cause issues
21:36:18dom96I need to generate some binary format anyway
21:36:27dom96which I will do with as few allocs as possible
21:36:30*sealmove joined #nim
21:36:55Araqshashlick, I don't know how to do that
21:37:23dom96omg
21:37:31dom96I've literally done that at least twice for c2nim
21:37:42shashlickhold, i'm testing something
21:38:02Araqdom96, yeah... guess what. I don't care
21:38:08dom96You.Should.Always.Ping.Your.Dependencies.
21:38:11dom96*Pin
21:38:18AraqI don't have any, anymore.
21:38:39dom96no? Then why are we talking about installing c2nim via nimble?
21:38:55Araqdunno, ask shashlick
21:39:26AraqI'm happy with the setup now.
21:39:48shashlick@dom96 - Araq has moved all compiler API dependencies into the c2nim repo, so no longer need to install compiler API as a nimble package
21:40:10shashlickhowever, nim 0.19.6 binary cannot build it anymore
21:40:27shashlickso in my mind, compiling nim and API in c2nim could still conflict
21:40:32dom96That's not a bad solution
21:41:00dom96But it seems like you've already found issues with it :)
21:41:14Araqc2nim now requires 0.20. *shrug*
21:41:22Araqwe are about to release 0.20.2 btw
21:41:32shashlickit's the same issue as before, except instead of compiler API, it is now in the codebase
21:41:35Araqand 0.20 is our LTS
21:41:53shashlicki was suggesting that `import compiler` should become `import std/compiler` which would just refer to the installed nim's compiler dir
21:42:04dom96So now instead of changing a single commit hash you'll copy and paste Nim source code
21:42:15shashlickthat way the compiling binary and the APi will be looking at the same code
21:42:47Araqdom96, hardly. c2nim only needs some way to produce Nim source code
21:42:59Araqit happens to use the compiler's AST and renderer for it
21:43:07Araqand now it has its own version of it
21:43:09dom96and your copy of the compiler source code will have no useful Git history
21:43:27dom96just tons of commits saying "Update compiler source code"
21:43:46dom96and then you'll get people making changes to the compiler source code via PRs
21:43:57dom96and you'll need to tell them "oh no, you need to do that in this other repo"
21:44:08Araqyou lost me
21:44:21shashlickaraq, same could have been accomplished by pinning to a specific compiler API, which is what i had done in nimgen - i was pointing to an older c2nim version
21:44:25*Senketsu quit (Quit: WeeChat 2.5)
21:45:11shashlickhowever, it eventually broke due to the -d:nimOldCaseObjects change
21:45:19*Senketsu joined #nim
21:45:43Araqyes. so? do you really think I don't know how c2nim works or how its nimble package was setup?
21:46:29Araqit's time we tried something new. and the current setup is new and makes sense.
21:46:37shashlickwell, all i'm saying is that in the future, c2nim might break since devel compiler doesn't work with c2nim's cached version
21:46:52AraqI don't think this is how it works...
21:46:55shashlickthen you will bump up the c2nim cached copy and it won't work with older versions again
21:46:58disruptekactually, that will keep it from breaking.
21:47:08shashlickwell, it broke right now with 0.19.6
21:47:28Araqyeah and you know what?
21:47:42Araqfurther cleanup of the compiler/*.nim files would also have prevented this
21:47:50disruptekbut, going forward the c2nim logic will only change lockstep with its compiler changing.
21:47:51AraqI only did some minimal cleanup
21:48:11Araqas I said, c2nim needs *some* ast.nim + renderer.nim
21:48:20shashlick@disruptek - you are assuming that people build c2nim only with the latest compiler
21:48:25Araqit doesn't need lexer.nim, yet it depends on it
21:48:49Araqthere is a bunch of stuff in there that we can eventually remove
21:48:52shashlickI see
21:49:15shashlicki was presuming it is a copy, felt that would be most maintainable
21:50:16Araqalso, pathnorm is a stdlib module, new in 0.20
21:50:55Araqat what point is c2nim allowed to use new stdlib modules? does it always need to compile with 0.19.x? :P
21:51:40shashlickhey, I have grey hair already so old is gold 😉
21:52:24shashlick0.19.6 is n - 1 so isn't unreasonable, but since we aren't 1.0 yet, i'll let it go
21:55:24Araqwell as I said, copy pathnorm to c2nim and make c2nim compatible with 0.18. or maybe 0.16
21:57:10*brakmic_ quit ()
21:57:24Araqor clean it up so that it doesn't require pathnorm
21:57:25shashlickshould it just go in the root dir?
21:57:41shashlickokay let me see
21:57:53Araqcompiler / pathnorm probably
21:58:36Araqbut if you patch it, also patch .travis.yml so that an old Nim is installed
21:58:45Araqgood night
22:00:37shashlicknope, not trivial since we also need relativePath which is new in os
22:00:47shashlickwell, let me see
22:03:58*sniffdtek quit (Remote host closed the connection)
22:09:13*absolutejam quit (Ping timeout: 245 seconds)
22:12:29FromGitter<Varriount> Araq: Is there anything preventing short string optimization?
22:13:31Araqvarriount: no, but since string literals do not allocate/copy anymore either with --newruntime I doubt SSO is necessary
22:14:10FromGitter<Varriount> What about for token/parser code?
22:16:24shashlickAraq - doesn't seem trivial - you need `/` which pulls in a bunch of code
22:17:28*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:17:33Araqwhat about it? you can use setLen(x, 0) and reuse the memory
22:22:03FromGitter<mratsim> oh literals don't allocate, nice.
22:26:25*nullnullnull quit (Remote host closed the connection)
22:35:45AlexMaxIs getting rid of an old version of nim with choosenim just a matter of rm -rf ~/.choosenim/toolchains/nim-<ver>/?
22:36:42PMunchPretty sure
22:42:54*Senketsu quit (Quit: WeeChat 2.5)
22:43:43*Senketsu joined #nim
22:47:33*solitudesf quit (Ping timeout: 245 seconds)
22:58:10*Senketsu quit (Quit: WeeChat 2.5)
22:58:57*Senketsu joined #nim
23:01:48*NimBot joined #nim
23:10:26*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:27:08*Serenitor quit (Quit: Leaving)
23:50:42*stefanos82 quit (Quit: Quitting for now...)