<< 24-11-2019 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:01:12*stefantalpalaru joined #nim
00:01:49*junland joined #nim
00:02:43*stefantalpalaru quit (Changing host)
00:02:43*stefantalpalaru joined #nim
00:10:04*Amun_Ra quit (Read error: Connection reset by peer)
00:12:33*ng0 quit (Quit: Alexa, when is the end of world?)
00:22:25*norm joined #nim
00:22:47*norm is now known as Guest86127
00:26:07*krux02_ joined #nim
00:30:03*krux02 quit (Ping timeout: 265 seconds)
00:30:40*Guest86127 quit (Quit: Leaving)
00:51:31*tklohna quit (Ping timeout: 252 seconds)
01:50:38*uu91 quit (Read error: Connection reset by peer)
01:50:56*uu91 joined #nim
02:03:46FromDiscord_<onelivesleft> Is there a way to write into an object member when you know the object address and the offset to the member?
02:10:02blackbeard420how do you get nimble to link to an external c library?
02:24:34FromDiscord_<exelotl> @onelivesleft something like this? https://play.nim-lang.org/#ix=22Hp
02:27:45sealmovehey, regarding nimble project structure, how does "private" folder work? what does it do in practice?
02:29:29*uu91 quit (Read error: Connection reset by peer)
02:29:47*uu91 joined #nim
02:30:33*uu91 quit (Read error: Connection reset by peer)
02:30:47*uu91 joined #nim
02:34:18*uu91 quit (Read error: Connection reset by peer)
02:34:31*uu91 joined #nim
02:35:56*uu91 quit (Read error: Connection reset by peer)
02:36:11*uu91 joined #nim
02:39:25FromDiscord_<WilliamDraco> I'm trying to write a seq[array[3, string]] out to file: new-line for each seq with the array concatenated. This is problematic both due to:
02:39:25FromDiscord_<WilliamDraco> 1. I need to preserve escape characters from the strings within the array
02:39:26FromDiscord_<WilliamDraco> 2. It's crazy slow the way I am doing it.
02:39:26FromDiscord_<WilliamDraco> https://play.nim-lang.org/#ix=22Ht
02:39:26FromDiscord_<WilliamDraco> Suggestions for a better way would be much appreciated.
02:41:39FromDiscord_<onelivesleft> @exelotl excellent, thanks!
02:42:43*leorize quit (Quit: WeeChat 2.5)
03:24:52*uu91 quit (Read error: Connection reset by peer)
03:25:05*uu91 joined #nim
03:25:42*krux02_ quit (Remote host closed the connection)
03:57:15*nif quit (Quit: ...)
03:57:25*nif joined #nim
04:11:24sealmoveZevv: I need your help desperately! In npeg I get an error "wrong number of arguments". I suspect it is caused because I don't run the grammar .nim file directly. :S
04:13:32sealmovehttps://github.com/sealmove/nimitai/tree/master/tests
04:14:14sealmoveI get the error when trying to compile test.nim (the one from the above link)
04:15:07sealmovenimitai/nimitai/private/ksypeg.nim(68, 18) Error: wrong number of arguments
04:15:20sealmoveHas to do with captures.
04:18:50*chemist69 quit (Ping timeout: 246 seconds)
04:21:03*chemist69 joined #nim
04:22:01*kotrcka joined #nim
04:25:21sealmoveHmm, I had the grammar in a proc which takes static[string] as argument. As soon as I changed the argument to plain string the error disappeared.
04:25:31sealmoveCan't see how it's related, but whatever
04:34:55sealmoveSomething strange happened there (error msg was very weird), but ultimately it doesn't seem like a problem worth investigating. Sorry for the heads-up...
04:35:49sealmove.ksy parsing is done :-) !! now it's codegen time
04:37:31disruptek!repo sealmove/ yaml
04:37:32disbotno results 😢
04:37:35disruptekhmm.
04:37:42disruptek!repo yaml
04:37:43disbothttps://github.com/flyx/NimYAML -- 3YAML implementation for Nim 7& 5 more...
04:37:49disruptek!repos yaml
04:37:50disbothttps://github.com/flyx/NimYAML -- 3YAML implementation for Nim
04:37:50disbothttps://github.com/nim-appkit/yaml -- 3Robust YAML parser for Nim.
04:37:52disbothttps://github.com/nonylene/yaml2json -- 3Convert yaml to json 7& 3 more...
04:37:56sealmove!repos nimitai
04:37:56disbothttps://github.com/sealmove/nimitai -- 3Implementation of Kaitai Struct as a macro in Nim
04:38:50disruptek!repos yaml stars:>3
04:38:50disbothttps://github.com/flyx/NimYAML -- 3YAML implementation for Nim
04:38:51disbothttps://github.com/nim-appkit/yaml -- 3Robust YAML parser for Nim.
04:38:52disbothttps://github.com/disruptek/openapi -- 3OpenAPI Code Generator for Nim
04:42:49disruptek!issue author:disruptek cpp
04:42:51disbothttps://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling
04:42:58disruptekla la la
04:45:39*uu91 quit (Read error: Connection reset by peer)
04:45:56*uu91 joined #nim
05:14:36*uu91 quit (Ping timeout: 240 seconds)
05:14:39madpropsis there a case `of "a" or "A"` thing?
05:16:01*uu91 joined #nim
05:20:37*bacterio joined #nim
05:35:01shashlickof "A", "a":
05:38:25*njoseph quit (Ping timeout: 265 seconds)
05:51:27*theelous3 quit (Ping timeout: 252 seconds)
06:05:42*njoseph joined #nim
06:06:28*nsf joined #nim
06:34:10*solitudesf joined #nim
06:39:24*dddddd quit (Remote host closed the connection)
06:54:59*nixfreak quit (Ping timeout: 276 seconds)
06:56:12*nixfreak joined #nim
06:57:18*kotrcka left #nim (#nim)
07:16:32*thomasross is now known as Guest33074
07:16:32*thomasross_ joined #nim
07:16:32*Guest33074 quit (Killed (karatkievich.freenode.net (Nickname regained by services)))
07:16:32*thomasross_ is now known as thomasross
07:18:34shashlickAraq: how does nimble scanning work? lazyPaths gets loaded but isn't used anywhere
07:19:42*narimiran joined #nim
07:22:57*uu91 quit (Read error: Connection reset by peer)
07:23:21*uu91 joined #nim
07:24:32madpropsnot sure how to store this type in a seq.. http://i.imgur.com/lFSmvX4.png
07:24:48madpropsseq[(PathComponent, string)] doesn't work
07:24:53madpropsneither adding kind: and path:
07:38:19madpropsnvm
07:38:23madpropsjust had to copy it exactly
07:46:56*solitudesf quit (Ping timeout: 240 seconds)
07:47:48*thomasross quit (Ping timeout: 245 seconds)
07:48:51Zevvsealmove: oi
07:50:25*Zevv quit (Quit: leaving)
07:51:15*Zevv joined #nim
07:53:57*thomasross joined #nim
07:53:57Zevvdisruptek: you again inspired me to learn new things in life. For example, this morning I read the irssi documentation to find an option to protect me from the (quote the manual) "angry fruit salad syndrome in some channels"
07:58:19madpropsis there an inline echo ?
08:00:00*gmpreussner quit (Quit: kthxbye)
08:04:48*gmpreussner joined #nim
08:08:26FromDiscord_<Kaynato> I seem to be able to use arraymancer to build for -d:mkl now, but it hangs on -d:cuda and says cudnnCreate is undefined for -d:cudnn, strangely enough
08:09:19FromDiscord_<Kaynato> Starting to get the impression that my system environment is completely unsuited for proper development and also that I am probably clueless about C++, haha... Spent a couple more hours trying to get nimtorch to work, to no success whatsoever. Decided that I might as well try to get libtorch working on C++ so I could settle for using nimline with libtorch, but the resulting EXE couldn't find an ordinal in torch.dll, which I don't know the
08:10:06FromDiscord_<Kaynato> All this is exceptionally strange since I am definitely able to use torch with CUDA+CUDNN properly in python
08:24:33FromGitter<mratsim> @kaynato did you change the path were the nim.cfg looks for Cuda on windows?
08:33:00*lritter joined #nim
08:35:53FromDiscord_<Kaynato> Yes
08:36:30FromDiscord_<Kaynato> All the nvccs point to the right place, include and lib were also moved
08:37:08FromDiscord_<Kaynato> I was able to get just plain nimcuda examples working, though that probably doesn't count for much
08:41:40FromDiscord_<kodkuce> @WilliamDraco if you want to echo /n too put it in """/n"""
08:41:44FromDiscord_<kodkuce> i think 🙂
09:19:58*NimBot joined #nim
09:24:39*tklohna joined #nim
09:42:59*narimiran quit (Ping timeout: 265 seconds)
10:07:41*fanta1 joined #nim
10:32:40FromDiscord_<mratsim> After 2 years
10:32:40FromDiscord_<mratsim>
10:32:41FromDiscord_<mratsim> community/nim 0.18.0-1 1.0.2-1 -6.28 MiB 5.61 MiB
10:33:07FromDiscord_<mratsim> @Kaynato does neo works on GPU for you then?
10:33:07livcdwhat's that ?
10:33:12FromDiscord_<mratsim> Archlinux
10:42:10*solitudesf joined #nim
10:42:54*solitudesf quit (Client Quit)
10:43:15*solitudesf joined #nim
11:00:00sealmoveZevv: oi
11:19:23*krux02 joined #nim
11:22:35*ng0 joined #nim
11:44:43*krux02 quit (Remote host closed the connection)
11:47:01*Perkol joined #nim
11:48:05livcd https://embark.status.im/news/2019/11/18/nim-vs-crystal-part-1-performance-interoperability/
11:49:55*clyybber joined #nim
11:52:05FromGitter<zetashift> uses json instead of packedjson welp
11:53:18Zevvsealmove: whats up
11:53:48sealmovemaking progress :)
11:53:52sealmoveyou?
11:59:00*Perkol quit (Remote host closed the connection)
12:00:14*tribly quit (Quit: WeeChat 2.6)
12:00:57*tribly joined #nim
12:07:49sealmovenow trying to generate relative paths in a macro
12:11:33ZevvNothing much here. Doing some MQTT stuff
12:16:43sealmoveintresting!
12:17:49Zevvnot really, actually :)
12:18:01*nsf quit (Quit: WeeChat 2.6)
12:18:17ZevvThe protocol is dead simple, the most complicated stuff is getting state logic right to get stuff to be robust and reconnect and stuff
12:18:41sealmovewhat do you need it for?
12:19:54ZevvI've been building industrial DSL/WWAN routers for one of my customers over the last years, and we need a provisioning system. Embedded side is lua, but for the central side I want to make the stuff in Nim and wasn't too happy with the existing mqtt libs
12:22:13sealmoveUsing Nim for work, I'm jealous
12:22:40ZevvI just don't tell my customers until after it's too late to change it to anything else :)
12:23:09ZevvI do "proof of concepts" in Nim. And everyone knows how it goes met POCs - it's just put in production in the end
12:23:21sealmove:D
12:23:38enthus1astZevv: wrapped an mqtt lib? Have repo link?
12:25:49Zevvno it's native nim
12:25:50Zevvnot wrapped
12:25:55enthus1asteven better
12:26:03enthus1astis it public?
12:26:11Zevvsure: https://github.com/zevv/nmqtt/
12:26:31Zevvwork in progress tho, no docs and tests, but it's functional
12:26:47enthus1astnice will have a look
12:27:22sealmoveif you do `import x`, can you learn where x imported from? is there a way to detect it?
12:27:23*ng0 quit (Remote host closed the connection)
12:27:37ZevvHm how do I get only the message from an exception? The .msg field has the whole stack in there
12:27:46Zevvsealmove: I always ask nim.nvim :)
12:27:57enthus1astgetCurrentExceptionMsg
12:28:17sealmovebut I want to use this info to generate import statement in macro
12:28:28*ng0 joined #nim
12:28:36sealmoveor well... people will use nimble to install package, can I assume a path?
12:28:51Zevventhus1ast: no, also has a full stack in there
12:32:01enthus1astmqtt's "#" is super hardcore , i bet there's a lot of fishy things going on on these test hubs
12:32:48sealmoveI think this answers my question: https://forum.nim-lang.org/t/3547A
12:38:36*luis_ joined #nim
12:40:57sealmoveoh nim.nvim?
12:41:11sealmovei misread it for nim vm lol
12:50:11*luis_ quit (Ping timeout: 246 seconds)
12:53:04sealmoveoh $hit... I think I have to generate npeg grammar with macros
12:53:14sealmoveis that even possible?
12:53:50sealmoveI mean, how does npeg usually goes? You parse, then you use the information stored from parsing to generate code in a macro, right?
12:54:22sealmoveBut the information is stored in vars, and vars can't be evaluated at CT
13:03:09sealmovenpeg -> var stack -> macro generate() doesn't work :(
13:03:47sealmoveping Zevv
13:10:26*solitudesf quit (Ping timeout: 240 seconds)
13:15:16*kcvinu joined #nim
13:15:30kcvinuHi all
13:17:39kcvinuAssume that i write a constructor proc with one int parameter for a type (say "Person").
13:18:34kcvinuThen is it possible - var aPerson = new Person(30)
13:18:54kcvinuDoes this call the constructor ?
13:19:07sealmovethere is no constructor in Nim
13:19:37enthus1astPerson(age: 30) or your proc newPerson(30)
13:19:41sealmoveyou use this syntax: `Person(field1: val1, field2: val2 ...)
13:20:00Zevvi think we can make that work, but ther might be a better way
13:20:36sealmoveZevv I used {.compileTime.} pragma for vars, but I get the usual "Error: VM is only allowed to 'cast' between integers and/or floats of same size" error
13:20:48sealmovewhich I don't understand
13:20:57Zevvlook into parsegrammar.nl, there npeg parses nim ast to build its IM
13:21:11Zevvyou can skip that step and build IM yourself
13:22:32sealmovewhere is parsegrammar.nl?
13:23:52kcvinusealmove Thanks for the reply
13:23:54sealmovebut... I am able to build IM just fine, the problem is that I want to use this IM to generate Nim code (with macro)
13:25:30Zevvsorry, it's parsepatt.nim
13:25:44Zevvit uses primitives from patt.nim to build the grammar
13:25:48Zevvyou can call these primitives yourself
13:26:18Zevvthen we only need a way to get this manually generated grammar back into npeg
13:26:25Zevvbut that should be fairly trivial
13:27:18sealmovehmm
13:27:36sealmovedo you have any clue regarding the above error?
13:27:42Zevvlet me see if I can whack up an example
13:28:09sealmove.nimble/pkgs/npeg-0.21.1/npeg.nim(142, 39) Error: VM is only allowed to 'cast' between integers and/or floats of same size
13:28:15sealmoveI get this quite often
13:28:22kcvinusealmove - you use this syntax: `Person(field1: val1, field2: val2 ...)
13:28:45kcvinuthat syntax is not attractive when you have 10 or 15 properties
13:29:44sealmovekcvinu: The idiom is to create procs like enthus1ast suggested. From example `newPerson(30)`
13:30:09Zevvsealmove: one thing at a time :)
13:30:18kcvinusealmove, So there is no other way.
13:30:29Zevvsealmove: are you trying to do matchFile in the VM?
13:30:37Zevvdoesn't work - use readFile()/staticRead() and then match()
13:31:08sealmovekcvinu: well, there is no real constructor in Nim. But you can use `Person(field1: val1, field2: val2 ...)` syntax without having to initialize all fields.
13:31:36sealmoveZevv: oh! I hope this it!
13:31:53sealmoveyes I am doing matchFile...
13:31:58sealmovelet me see
13:32:07Zevvhm manual consruction of grammars is possible, but I need to export a lot more
13:32:08kcvinusealmove , Um. Okay, but that is not what i wanted. Anyway, i can manage with procs
13:32:09Zevvand wors - document all that
13:32:47*abm joined #nim
13:33:06sealmovekcvinu: do you dislike having to name a proc?
13:33:19sealmoveinstead of simple `new Person`?
13:34:15kcvinusealmove No. I better use "newPerson(value : int)"
13:34:22*ng0 quit (Quit: Alexa, when is the end of world?)
13:34:34sealmoveZevv: I think I don't need manual construction of grammar in this case after all, but it's an interesting idea, possibly useful.
13:35:22Zevvstill I'm trying to see how far I can go with this
13:40:59sealmoveafter using staticRead: `Error: internal error: (filename: "vmgen.nim", line: 179, column: 16)`
13:41:44*kcvinu quit (Remote host closed the connection)
13:42:35Zevvyeah and there you have it - what I was afraid of
13:42:40Zevvwe're overstressing the VM
13:42:43sealmoveyup
13:42:54ZevvI had this one before, something runs out of 0x7fff something somewhere
13:43:05sealmovethat's correct
13:43:37sealmovethe line 179 is: `internalAssert(c.config, -0x7fff < diff and diff < 0x7fff)`
13:44:37*krux02 joined #nim
13:44:51ZevvYep. I've seen it but not yet reported it
13:44:55ZevvThis Is The Time for that
13:50:08sealmovewell, keep me up to date please!
13:50:20*tklohna quit (Ping timeout: 276 seconds)
13:51:33Zevvyou file it?
13:51:35Zevvor me?
13:52:44Zevvhm the infrastructure for manual parsers is almost there, but not quite
13:52:47sealmoveI think it's easier for you to reproduce in a minimal example? But if you are busy I can do it.
13:53:42Zevvbut it would look something like this: http://ix.io/22JD/nim
13:53:45sealmovewhat advantage will manual parser bring to table?
13:53:56Zevvwell, you can build parsers programattically
13:54:16Zevvbut it hurts my head thinking about the working of the whole thing then :)
13:54:40*tane joined #nim
13:54:56sealmovebut isn't the whole point of npeg to have parsers auto-generated, and not build them programatically?
13:55:06Zevvyes but no but yes but no but
13:55:21Zevvlet me rephrase that correctly: you can build *grammars* programatically
13:57:57sealmoveand the code snippets that run when a match happens?
13:58:00sealmovewhat happens with them?
13:59:04disruptekshashlick: i can tell you anything you need to know about lazypaths.
14:06:26*dddddd joined #nim
14:06:54*nsf joined #nim
14:11:36FromDiscord_<mratsim> @Clyybber, any idea what generates those blitTmp? all my procs use sink arguments so I think it' destructors related
14:11:42FromDiscord_<mratsim>
14:11:42FromDiscord_<mratsim> https://cdn.discordapp.com/attachments/371759389889003532/648163841191968822/DeepinScreenshot_select-area_20191124150943.png
14:14:08clyybberthats sink arguments
14:14:20clyybberit is too prevent an edge case with self assigns
14:14:32clyybberI plan on eliding those where possible
14:14:46clyybberBut so far you have to bet on the C compiler to optimize these out :/
14:18:17Zevvsealmove: good question :(
14:20:17FromDiscord_<mratsim> not the issue, I can't compile anymore
14:20:26FromDiscord_<mratsim> I'll open an issue
14:20:28clyybberyeah
14:20:36clyybberI'll check it out later, kinda busy rn
14:23:07sealmoveZevv: is it possible (yet less convinient) to do everything that you would do in these matching snippets, just using the `captures` proc?
14:24:10Zevvit would I guess
14:24:26Zevvbut were kind of pulling npeg up a pole by its guts like this
14:26:42*fanta1 quit (Quit: fanta1)
14:28:12sealmovewell, it doesn't have to be beautiful
14:28:20sealmovemost users will use the peg macro
14:28:38sealmovethis is for edge cases where you want npeg in a macro
14:28:48sealmoveif it works it's fine with me
14:29:43sealmovelet me know if manual peg construction is ready!
14:34:22sealmovedo you think I should hand-write the .ksy parser for now? until npeg and/or nim vm is up to the task?
14:34:59sealmove(switching from weechat to discord)
14:35:00*sealmove quit (Quit: WeeChat 2.6)
14:42:06*Hideki_ joined #nim
14:44:03*drewr quit (Ping timeout: 245 seconds)
14:49:23*Mister_Magister quit (Excess Flood)
14:50:43*Mister_Magister joined #nim
14:50:53*onionhammer quit (Ping timeout: 268 seconds)
14:51:15*onionhammer joined #nim
14:52:03FromDiscord_<mratsim> I'm restarting your 32-bit job @narimiran, it failed with "Failed to deploy" https://travis-ci.org/nim-lang/Nim/jobs/616209430
14:59:16FromDiscord_<sealmove> might be related: http://github.com/nim-lang/Nim/issues/11084
15:11:25*solitudesf joined #nim
16:02:59Zevvdom96 here?
16:03:24FromDiscord_<funcmike> "The effect system (raises: []) does not work with async procedures." -> any plans to fix this?
16:03:54dom96Zevv, yes
16:04:05*uvegbot quit (Ping timeout: 246 seconds)
16:04:57*sealmove joined #nim
16:05:10Zevvah sweet - do you happen to know: the async recvInfo docs say it will return *up to* the requested amount
16:05:53Zevvis this really the case for async?
16:06:45*uvegbot joined #nim
16:07:39dom96yes, it is
16:08:02Zevvhm ok thanks for confirming
16:08:05*Hideki_ quit (Remote host closed the connection)
16:09:10Zevvsince I get 0 bytes in some cases, related to SSL it seems
16:09:14*Hideki_ joined #nim
16:09:27dom960 bytes means the socket has been disconnected
16:09:47Zevvyes, but afaik it hasn't - investigating
16:12:33*MrAxilus left #nim ("User left")
16:13:38*Hideki_ quit (Ping timeout: 245 seconds)
16:13:54Zevvif feels like something fishy is happening in the SSL layer. the socket itself is not disconnected from the other side, some data has been sent to and fro and then I get 0 bytes just like that. a pain to debug ssl stuff though
16:14:21*Hideki_ joined #nim
16:15:36*Hideki_ quit (Remote host closed the connection)
16:20:23*Hideki_ joined #nim
16:23:16sealmoveZevv did you reproduce the 0x7fff error?
16:24:13Zevvyeah but not with a simple example. I need a hefty parser at compile time
16:25:43dom96Zevv, is this easily reproducible>?
16:26:10Zevvdom96: not yet, and I'm probably wrong
16:26:20*Hideki_ quit (Ping timeout: 276 seconds)
16:26:23shashlick@disruptek I see code where lazyPaths gets populated
16:26:23Zevvit is usually just me with this kind of tings
16:26:40shashlickBut where does it get used?
16:26:59disruptekyou mean, where in the compiler?
16:29:09sealmovehow is parser's "heftiness" measured?
16:29:52*narimiran joined #nim
16:30:31shashlickYes
16:30:37*Trustable joined #nim
16:32:31shashlickBasically I want to find out how the compiler figures out where nimbleDir is
16:32:58disruptekit doesn't really work that way.
16:33:03*theelous3 joined #nim
16:33:41disrupteknimbleDir is just a hint to the compiler that means, "add any package-looking directory within to your search paths"
16:33:56shashlickYes there's a flag where you can set it
16:34:01disrupteknimph supports multiple nimbleDirs now. it all just works.
16:34:23shashlickBut there's no active code to look in ~/.nimble or AppData
16:34:38disruptekyes, because it's set in the config.
16:34:55disruptekit only gets used when the compiler actually needs to search.
16:35:11disrupteksee `rawFindFile2()` in compiler/options.nim
16:36:45disruptekthe user can setup any combination of nimbleDirs and the compiler will use them best it can. it's pretty neat.
16:37:12disruptekreally makes using nimterop much easier, because it's always tricky to install in localdeps.
16:37:32disrupteknow i can just point to userdeps for nimterop and localdeps for anything else. very nice.
16:37:57shashlickOk so the default nimbledir simply comes from nim.cfg
16:38:02disruptekright.
16:38:36shashlickhttps://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L46
16:39:03shashlickI don't even think that's complete
16:39:19disruptekwhaddya mean?
16:40:00shashlickIf not windows sets it to global value
16:40:09shashlickWhich means it shouldn't look in home
16:40:21shashlickBut that's not how the compiler behaves on posix
16:41:22disrupteknimblePath is cumulative; it sets both those directories.
16:41:46shashlickOk that makes sense
16:41:49*tklohna joined #nim
16:42:13shashlickOk I get it now
16:42:30*nerian joined #nim
16:42:53disruptekthe whole thing works much better if you don't try to fight the tools the compiler gives us.
16:43:24narimiranclyybber: believe it or not, that commit that should not be related to the failings *is* the cause of them :)
16:43:39Zevvsealmove: I'll tell you when we know the source of 0x7fff
16:44:07sealmoveZevv: I am currently investigating it
16:44:07Zevv0x1fff is not hefty, 0x3fff is pretty heft, 0x7fff is _very_ hefty, and anythin above is *too* hefty
16:44:33sealmovebut what is this number? pointer to internal vm memory?
16:44:39sealmoveindex i mean
16:46:06*Hideki_ joined #nim
16:47:16solitudesfwhat the heck, nimble doesnt install disruptek's github wrapper, literally just skips src/ directory
16:47:52Zevvsealmove: this is my test case http://ix.io/22KC/nim
16:47:54Zevvprotobuf compiler
16:49:14sealmoveyeah, I have something very similar: https://github.com/sealmove/nimitai/blob/master/nimitai/private/ksypeg.nim
16:49:30Zevvsealmove: indeed it seems to be a relative offset that gets placed in code ("patched"), and it needs to fit in the upper 16 bits of a 32 bit word
16:49:55Zevvthis feels like the small memory model in DOS where you relative jumps could only be 32K
16:50:17*Hideki_ quit (Ping timeout: 246 seconds)
16:51:01sealmovethis is so frustrating because the limitations are not clearly explained
16:51:01Zevvso it seems to be some hard limit of the VM instruction format
16:51:15ZevvTInstr is 32 bit
16:51:20Zevvif it doesn't fit, it doesn't fit
16:51:35sealmovewhere should you draw the line and not use VM?
16:51:42sealmovenobody knows
16:52:00Zevvwhat restrictions would one expect of a VM?
16:52:21Zevvbest case it can run any 'reasonable' size program, where 'reasonable' should probably be limited by the host
16:52:58sealmoveso you are saying this is definately a bug to be adressed?
16:53:14ZevvNot up to you or me, but we should file it
16:54:09sealmoveit will be sad if it doesn't get fixed, because Nim should shine in metaprogramming
16:54:44sealmoveunless what we are trying to do is considered not a use-case of the VM
16:54:45disruptekwe're already running into those limitations, and it's early days for what's possible (read: probable) with nim's mp.
16:55:23sealmovemp?
16:55:30sealmoveah metaprogramming
16:57:36Zevvhttps://github.com/nim-lang/Nim/issues/12727
16:57:39disbotError: internal error: (filename: "vmgen.nim", line: 179, column: 16); snippet at 12https://play.nim-lang.org/#ix=22KE 😏
16:58:19ZevvWhy the _hell_ is there a *smiley* there? Are we, like, 13 years old?
17:01:28disruptekyep.
17:04:04Zevv\o/
17:05:04sealmovethanks for reporting, I'll try my best to make a as-minimal-as-possible example.
17:05:13FromGitter<Willyboar> nope but we feel like 13 :P
17:05:25ZevvI think you should be able to generate just some kind of long program with loops or braches and you should be able to hit it
17:05:36FromGitter<Willyboar> !help
17:05:56FromGitter<Willyboar> !disbot
17:06:07sealmovefirst I'll check if the problem is npeg + staticRead
17:15:09*dillonb joined #nim
17:17:32disrupteksolitudesf: sorry; i don't really test it with nimble.
17:25:19solitudesfcan you at least add the `bin` field
17:25:41*abm quit (Quit: Leaving)
17:25:47disruptekwhat would that do?
17:26:10solitudesfenables `nimble build`
17:26:18solitudesfbut i guess thats not a priority for you
17:27:00FromGitter<Willyboar> https://embark.status.im/news/2019/11/18/nim-vs-crystal-part-1-performance-interoperability/ in this article somewhere in the middle says about native nim html DSL. There is such a thing?
17:27:18FromGitter<Willyboar> I only know htmlgen
17:27:43disrupteksolitudesf: what would that even do? it's a library, not a binary.
17:28:03solitudesfhuh, i guess im retarded then
17:28:13disruptekwhat are you trying to do?
17:28:53solitudesfwait, but it uses cligen
17:29:11FromGitter<Willyboar> A! Sorry it is an external library.
17:29:38disrupteksolitudesf: what package are we talking about? i thought you said `github wrapper`.
17:29:48disruptek!repo disruptek/github
17:29:49disbothttps://github.com/disruptek/github -- 11github api v3 for nim
17:31:00solitudesfits two separate issues
17:31:28solitudesfnimble install on this package doesnt install src and its contents
17:32:30disruptekmaybe a nimble person can tell me how to fix that or submit a pr.
17:34:54FromDiscord_<krab4t> -opt:speed test?
17:43:15*nif quit (Quit: ...)
17:43:26*nif joined #nim
17:43:30*kcvinu joined #nim
17:43:38kcvinuHi
17:43:49kcvinuHow to use timer in Nim ?
17:44:12sealmoveZevv: https://play.nim-lang.org/#ix=22KQ
17:44:33kcvinuI need to start a timer and after a few milliseconds, i want the elapsed time
17:44:40Zevvsealmove: and *boom* it goes
17:44:42sealmovea proper error message is shown on Nim Playground
17:45:25disrupteksolitudesf: what's the 2nd issue?
17:46:07sealmove"npeg-0.21.0/npeg/codegen.nim(133, 15) Error: VM problem: too many registers required"
17:46:19sealmovenow Nim blames you Zevv
17:46:21sealmovelol
17:46:28Zevvnimversion?
17:46:49sealmove"latest" from playground
17:46:55sealmovejust run it online
17:47:40Zevvon my machine with devel I get the 'Error: internal error: (filename: "vmgen.nim", line: 179, column: 16)'
17:48:09FromDiscord_<Rika> kcvinu, https://play.nim-lang.org/#ix=22KR
17:48:34sealmoveyes, I get the same on my machine
17:48:53FromDiscord_<Rika> i think https://nim-lang.org/docs/monotimes.html would be best if you're only doing durations
17:49:23*solitudesf quit (Read error: Connection reset by peer)
17:50:26kcvinuFromDiscord_ Thanks, :)
17:51:58Zevvsealmove: the VM registers was fixed by araq quit recently
17:52:11*solitudesf joined #nim
17:52:27sealmoveah I see
17:52:43Zevvwe just need to extend the VM instruction type to 64 bits
17:53:10sealmoveyes!!
17:53:42*Hideki_ joined #nim
17:54:27sealmovejezz 0x7fff is only 16bit
17:54:53sealmovemake it 32bit if not 64
17:55:31Zevvno the TInstr is 32 bit, and the 16 of that re used for offsets, or something like that
17:58:06sealmoveThis is a real block for me. I mean, even if I hand-write the parser, there is no guarantee it will run at CT.
17:58:28disruptekget someone to write it who can make that guarantee.
17:58:38sealmovehow?
17:58:52disruptekthreaten the safety of their family.
17:58:56sealmovelol
17:59:01sealmoveI think nobody can guarantee it
17:59:24disruptekwho have you threatened so far?
18:01:18disrupteksolitudesf: what's the 2nd issue you ran into?
18:02:04FromDiscord_<Kaynato> @mratsim Neo works for me
18:04:49sealmoveI am scared there is a good reason Araq used 32bit instructions
18:06:59*sealmove quit (Quit: WeeChat 2.6)
18:08:08*sealmove joined #nim
18:08:43solitudesfdisruptek, its the library/binary misunderstanding. whatever.
18:09:14disruptekokay; i'll fix it soon. lemme know if i can help otherwise.
18:11:56disrupteksolitudesf: if you want a github client, checkout `hub`.
18:14:53*Hideki_ quit (Ping timeout: 276 seconds)
18:16:59lqdev[m]all right. still highly WIP, but tell me what you think about the concept https://github.com/liquid600pgm/rdgui
18:21:24FromDiscord_<Kaynato> Getting arrayfire bound to nim. Just trying out the old binding library from a few years back and it seems that `clong` and `cint` are equivalent types? It's not allowed to define an operator for both?
18:24:07FromDiscord_<Kaynato> If cint == clong for some architectures, I should check that and only define both procs when it's not the case...?
18:25:45*kcvinu quit (Remote host closed the connection)
18:27:20clyybbernarimiran: HUh, how?
18:27:52narimiranclyybber: no idea how, but reverting that helped
18:29:02clyybbernarimiran: Interesting, btw regarding the range op syntax
18:29:26clyybberI was the one who changed it in the compiler to be spaced
18:29:39clyybberBut in hindsight I don't think it was a good idea
18:30:08clyybberIt looks more like a range if its together as it shows that its some kind of connection if that makes sense
18:30:22clyybberAt least I find it more readable
18:33:52*solitudesf- joined #nim
18:34:10*narimiran quit (Ping timeout: 265 seconds)
18:34:44Zevvsealmove: I go a 10 line reproduction. Just create AST with a long while so the JumpBack can not be encoded in the VM op
18:34:57*narimiran joined #nim
18:35:07sealmoveZevv: great!
18:35:14narimiranclyybber: sorry my net is wonky
18:35:26narimiranso you probably didn't see my previous message
18:36:04clyybberyeah
18:36:19narimiranyeah, i get your reasons for no spaces, but now nimpretty "likes" spaces and stuff is automatically formatted with spaces
18:36:41*solitudesf quit (Ping timeout: 252 seconds)
18:36:44clyybberOh :( I thought nimpretty just wants consistent spacing ..
18:36:54*PMunch joined #nim
18:36:54narimirani personally am undecided, sometimes i like spaces, sometimes they feel like they don't belong there
18:37:19sealmoveZevv: can I adopt this snippet in my README.md?
18:37:40Zevvnope, it's copyrighted by me. I do sell licenses, though
18:38:45Zevvdude, seriously, is there any reason you could *not*? :)
18:40:35FromDiscord_<mratsim> @Kaynato ah but Neo doesn't use Cudnn, so that would mean Cuda works but not cudnn
18:41:13sealmove':]
18:42:45Zevvsealmove: I might be mistaking, but it seems that the VM instructions for jumps have 8 bits unused
18:43:08Zevvthe 32 bits are split into opcode, regA regB and regC, or regBx which is B+C
18:43:20ZevvOffsets are stored in regBx only, while regA *seems* unused in these cases
18:43:33Zevvso we can introduce a 24 bit regaX
18:43:52Zevvuntil araq comes along and mentions something obvious I missed
18:45:45Zevvoh wrong already. PNode is in rega. what is PNode
18:46:33Zevvno not true. I shall shut up now until I know what I'm talking about
18:48:26sealmoveAlthough I am a bit disappointed, this topic is very interesting. I am excited to hear what Araq has to say.
18:49:23clyybberZevv: A PNode can
18:49:29clyybbert fit into 32 bit
18:49:36clyybberits a ref object
18:49:43Zevvno of course not, I was just rambling
18:49:48clyybberkk
18:50:16Zevvbut my earlier statement seems to hold that there is always 0 in rega for opJmpBack at least
18:51:01clyybbernice
18:51:18clyybberthe vm also has support for large instructions fwiw
18:51:27sealmoveHOW?
18:51:47sealmovetell me there is a compiler switch :D
18:53:01clyybberhttps://github.com/nim-lang/Nim/blob/devel/compiler/vmdef.nim#L247
18:53:19sealmoveI see
18:53:36sealmoveBut we are talking about the whole adressing mode
18:54:00sealmoveOr just jmps?
18:54:11Zevvfor now it's jumps, until we run into something else
18:56:37*uu91 quit (Read error: Connection reset by peer)
18:56:51*uu91 joined #nim
18:57:16clyybbermratsim: THe only changes the last two days to destructor stuff were https://github.com/nim-lang/Nim/commit/8b2f8f5430e8c328efe5bce94e397f15e3c501af and https://github.com/nim-lang/Nim/commit/c85e266d1d6553fe14ecd28af7a58687672c859d afaik
18:57:23clyybberAnd one of them has been reverted now
18:57:31clyybberSo maybe you should try again
18:57:55Zevvwell, this fixes it for my 'while' example, see if I can make it more generic
19:08:21FromDiscord_<mratsim> @Clyybber I've added the offending commit at the bottom of my issue
19:09:01FromDiscord_<mratsim> it's this one: https://github.com/nim-lang/Nim/commit/c85e266d1d6553fe14ecd28af7a58687672c859d
19:09:12FromDiscord_<mratsim> basically destructors were never injected in the past
19:09:28FromDiscord_<mratsim> but the codegen doesn't properly declare the related temporaries
19:21:51*solitudesf-- joined #nim
19:24:55*solitudesf- quit (Ping timeout: 265 seconds)
19:27:26*nif quit (Quit: ...)
19:28:40*nif joined #nim
19:30:12FromDiscord_<Kaynato> I think I am getting closer to getting this working. is `operators_broadcasted_cuda.nim.cpp` supposed to be `.cu`?
19:32:07*ng0 joined #nim
19:51:58FromDiscord_<Kaynato> Wait, how am I able to get cuda working with neo while being unable to get it working with arraymancer
19:55:17*nerian quit (Quit: Leaving)
19:57:18*lritter quit (Ping timeout: 265 seconds)
19:58:13FromDiscord_<Kaynato> @mratsim: Should I be seeing nvcc being called at some point when compiling with -d:cuda? From what I can tell, compilation throws errors on ` gcc.exe -c -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN -I"E:/Program Files/nim-1.0.2/lib" -IE:/Cloud/Sync/Sync/Dev/_Project/nim/test/src -o C:/Users/MAIN/nimcache/array_d/@m..@s..@s..@s..@s..@s..@s..@s..@s..@sC@c@sUsers@[email protected]@[email protected]@stensor@soperators_broadcasted_cuda.nim
20:06:50*luis_ joined #nim
20:17:13clyybbermratsim: Ah, I see
20:26:17*krux02 quit (Remote host closed the connection)
20:27:19Zevvsealmove: just looked another minute into this, but it's not going to fit for other generic cases. There's also FJump which is 'jump if expression', where the other bits are used
20:30:41madpropshmm seems somePath.joinPath("../something") doesn't work
20:30:51madpropsit's not taking into account the ".."
20:32:10madpropspath = getCurrentDir().joinPath(path)
20:32:15madpropspath is "../sym"
20:32:43madpropsohh nvm
20:32:51madpropsmy fault, im running it from a subdir
20:34:47*nsf quit (Quit: WeeChat 2.6)
20:50:57*drewr joined #nim
20:54:51FromDiscord_<onelivesleft> the compiler can weed out const conditions without using templates, right? like if I do `const debug = false` `if debug: blah`, the compiler will skip it?
20:55:21clyybberwhen debug: blah
20:55:25clyybberthen yeah
20:57:02sealmoveZevv: Ok so we want 64bit instructions
20:58:54FromDiscord_<onelivesleft> ty
20:58:58Zevvyeah, I'm trying to see how far I can push that without understanding all the details. My ops are now 64 bits with 16/32 bit registers
20:59:24Zevvbut the bit fiddling is in several places, so I need to catch'em all
20:59:28sealmovewow you are doing it, nice
21:01:30Zevvnah, just playing around to learn how stuff works for now
21:02:21*solitudesf- joined #nim
21:04:04FromDiscord_<Kaynato> I'm calling a function imported from c that takes `*float` as an arg, since it consumes arbitrary length float arrays. How do I pass it the right value from nim?
21:04:57*solitudesf-- quit (Ping timeout: 240 seconds)
21:05:16PMunchHmm, when using nimterop is there a way to specify which GCC it should use for the preprocessing?
21:05:56*narimiran quit (Ping timeout: 265 seconds)
21:06:31*luis_ quit (Quit: luis_)
21:06:57*luis_ joined #nim
21:07:21shashlickYou can get $CC
21:07:24shashlickSet
21:08:47PMunchHmm, well that worked. But it doesn't pass on "passC" definitions either..
21:11:49Zevvsealmove: time for ZzZzz. I see no reason why this would not work, but downside is of course double the code size. Alternative would be to add double-word "long jump" alternatives, which increases vmgen and vm complexity.
21:12:46sealmovemaybe we can make compiler switches for this
21:12:51Zevvbah
21:13:04sealmovewhy not, it's nice to be able to control such stuff
21:13:07Zevvnoone ever said "there's only 173 of those yet, so 174 is probably just fine as well"
21:13:54sealmovewell, we need to hear from Araq before thinking anything :P
21:14:02sealmovegn!
21:14:06Zevvsure, you too
21:14:08Zevvlater!
21:24:41shashlick@PMunch passC go thru Nim, I don't intercept them
21:24:48shashlickWhat do you need to pass
21:25:12PMunchI managed to get one through cDefine
21:25:25shashlickOk cool
21:25:37PMunchBut -mmcu=atmega328p wasn't possible to define that way
21:26:20PMunchSo I made a little shell script with "avr-g++ -mmcu=atmega328p $@" in it
21:27:50PMunchBut now it's generating a "type" block, but it skips both the types so it just outputs the type keyword and a bunch of comments which makes Nim fail..
21:28:16shashlickYou could just define CC like that for now
21:28:21shashlickNot sure if that will work
21:28:24PMunchNot that I really see why it's skipped..
21:28:31shashlickBut a good requirement
21:28:42PMunchOh I could define CC directly like that?
21:28:49shashlickYou could try
21:29:03PMunchYeah it worked
21:29:14PMunchOr well, it fails on the same error
21:38:37shashlickSorry have to run for an event but will help later if you need
21:49:00*Trustable quit (Remote host closed the connection)
21:58:26*tane quit (Ping timeout: 240 seconds)
22:00:55*PMunch quit (Read error: Connection reset by peer)
22:01:13*clyybber quit (Quit: WeeChat 2.6)
22:05:56*uvegbot quit (Ping timeout: 240 seconds)
22:10:39*uvegbot joined #nim
22:11:21*Hideki_ joined #nim
22:16:01*Hideki_ quit (Ping timeout: 265 seconds)
22:17:27*uu91 quit (Read error: Connection reset by peer)
22:18:31*uu91 joined #nim
22:19:30planetis[m]dump question ahead: how can i count the number of iteration of countup with a step bigger than 1?
22:19:57disruptekdivision?
22:22:40planetis[m]thanks disruptek
22:40:38madpropsworking on this. still early stages https://github.com/madprops/lq
22:56:02*solitudesf- quit (Ping timeout: 240 seconds)
22:57:05FromDiscord_<krab4t> make it for windows too 🙂
23:06:35*luis_ quit (Quit: luis_)
23:07:03*luis_ joined #nim
23:13:56*uu91 quit (Ping timeout: 240 seconds)
23:14:26*uu91 joined #nim
23:20:18FromDiscord_<onelivesleft> What is the best practice for when your module requires another module to work? For instance, I have a module which creates a macro with an `init_table` in it; if my module is imported then `tables` must also be imported, or `init_table` will not be found.
23:22:49*uu91 quit (Read error: Connection reset by peer)
23:23:11*uu91 joined #nim
23:27:46zedeusyou can export that function or the entire module
23:28:02zedeusor use bindSym in the macro
23:29:02FromDiscord_<onelivesleft> cool, ty
23:43:17*tklohna quit (Ping timeout: 246 seconds)