<< 16-09-2017 >>

00:06:48*dom96 left #nim (#nim)
00:06:48*dom96 joined #nim
00:13:17FromGitter<zacharycarter> dungeon generator is getting there - https://imgur.com/a/LHnIb
00:14:58*endragor joined #nim
00:15:41FromGitter<mratsim> Soon, path of exile in Nim? ;)
00:17:33FromGitter<zacharycarter> :D
00:19:43*endragor quit (Ping timeout: 248 seconds)
00:37:56*yglukhov joined #nim
00:42:36*yglukhov quit (Ping timeout: 252 seconds)
00:45:48*Jesin quit (Quit: Leaving)
01:00:15FromGitter<zacharycarter> https://imgur.com/a/cdiX7
01:04:38TjYocoPlanning on porting NetHack?
01:21:04*adeohluwa quit (Quit: Connection closed for inactivity)
01:36:51*SusWombat quit (Remote host closed the connection)
01:38:13FromGitter<zacharycarter> nope
01:38:43FromGitter<zacharycarter> just making a library for generating roguelike maps
01:39:01*BitPuffin|osx quit (Ping timeout: 240 seconds)
01:39:02FromGitter<zacharycarter> implementing various algos
01:45:12*arnetheduck joined #nim
02:01:12*chemist69 quit (Ping timeout: 246 seconds)
02:13:54*chemist69 joined #nim
02:15:33*TjYoco quit (Quit: Leaving)
02:26:32*Jesin joined #nim
02:35:07*relax joined #nim
02:40:07*yglukhov joined #nim
02:44:47*yglukhov quit (Ping timeout: 248 seconds)
02:54:15*endragor joined #nim
02:59:12*endragor quit (Ping timeout: 260 seconds)
03:53:53*Ven`` joined #nim
03:54:35*vendethiel- quit (Ping timeout: 240 seconds)
04:20:46*dave24 quit (Ping timeout: 264 seconds)
04:20:46*adamchainz quit (Ping timeout: 264 seconds)
04:20:46*adam12 quit (Ping timeout: 264 seconds)
04:21:58*bodie_ quit (Ping timeout: 264 seconds)
04:22:34*xet7 quit (Ping timeout: 264 seconds)
04:22:34*scriptum quit (Ping timeout: 264 seconds)
04:22:34*shodan45 quit (Ping timeout: 264 seconds)
04:22:35*SunDwarf quit (Ping timeout: 264 seconds)
04:23:01*dave24 joined #nim
04:23:10*nexxus quit (Ping timeout: 264 seconds)
04:24:20*nexxus joined #nim
04:26:09*shodan45 joined #nim
04:27:35*SunDwarf joined #nim
04:27:52*adam_ joined #nim
04:28:35*adamchainz joined #nim
04:28:58*bodie_ joined #nim
04:32:22*yglukhov joined #nim
04:34:56*scriptum joined #nim
04:35:14*xet7 joined #nim
04:37:12*yglukhov quit (Ping timeout: 260 seconds)
04:42:41FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/E4Qj/Screen-Shot-2017-09-16-at-12.42.06-AM.png)
04:48:04*ShalokShalom joined #nim
04:48:27*smt` is now known as smt
04:48:39*ShalokShalom quit (Read error: Connection reset by peer)
04:50:20*haha_ joined #nim
05:13:13*dddddd quit (Remote host closed the connection)
05:19:47*ShalokShalom joined #nim
05:38:32*zza joined #nim
05:38:46*zza left #nim (#nim)
05:41:19*relax quit (Ping timeout: 248 seconds)
06:04:06*haha_ quit (Quit: haha_)
06:05:41*alex2 joined #nim
06:07:32*Vladar joined #nim
06:08:54Araqcan somebody try this https://github.com/nim-lang/Nim/issues/6385 ?
06:16:06*alex2 quit (Read error: Connection reset by peer)
06:16:07*jsgrant quit (Quit: jsgrant)
06:16:29*jsgrant joined #nim
06:17:36*Elronnd is now known as ^-^
06:17:49*^-^ is now known as Elronnd
06:21:03*jsgrant quit (Client Quit)
06:21:29*jsgrant joined #nim
06:34:32*yglukhov joined #nim
06:38:41*yglukhov quit (Ping timeout: 240 seconds)
06:43:04*claudiuinberlin joined #nim
06:43:48*haha_ joined #nim
06:58:44*kobi7 joined #nim
06:59:41*endragor joined #nim
06:59:42*smt` joined #nim
07:03:27*smt quit (Ping timeout: 248 seconds)
07:10:28*solitudesf joined #nim
07:24:13*nsf joined #nim
07:30:48*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:42:32*claudiuinberlin joined #nim
07:50:32FromGitter<mratsim> Done, your suggestion works
07:51:26AraqPR ready?
07:53:04Araqalso ... I had a good idea wrt enums for v0.18. Let them default to '.pure', you can get the current enums with '.inject.', BUT if the pure enum field is not ambiguous, it will be resolved
07:57:18kobi7hello
08:00:18Araqhi
08:02:41*Yardanico joined #nim
08:06:07*jsgrant quit (Quit: jsgrant)
08:06:30*jsgrant joined #nim
08:09:58*haha_ quit (Quit: haha_)
08:11:03*jsgrant quit (Client Quit)
08:11:28*jsgrant joined #nim
08:16:00*Yardanico quit (Remote host closed the connection)
08:19:18*yglukhov joined #nim
08:45:20*Trustable joined #nim
08:54:58*yglukhov quit (Remote host closed the connection)
08:58:37FromGitter<mratsim> @Araq, where should I put the corresponding test?
08:59:02Araqtests/stdlib
09:00:35FromGitter<mratsim> tjsontestsuite?
09:02:49kobi7hi Araq, is c2nim an actual translator or a binding generator?
09:04:01Araqboth
09:04:17FromGitter<Bennyelg> Goood Monrinig.
09:04:19kobi7what do you mean?
09:04:21FromGitter<Bennyelg> Morning *
09:06:45kobi7what does it do wrt mallocs or other things that don't fit the nim concepts?
09:06:48*yglukhov joined #nim
09:07:46*yglukhov quit (Remote host closed the connection)
09:08:08Araquh, 'malloc' is translated to 'malloc' why not try it out?
09:08:08FromGitter<Bennyelg> What should I look for in nim documentation to get information about all the {.borrow.} , {.pure.} {.inject.} values ..
09:08:26Araqalready gave you links.
09:08:53kobi7sorry for the pointy questions. just trying to get a feel of where nim is at. As a language it seems ideal, but how is the practical side...
09:09:47Araqdon't "feel", install it and try it out
09:10:42kobi7I did install it, just yesterday though, so no experience whatsoever yet.
09:11:00kobi7the feel i mean - what stage and how mature things are
09:15:56FromGitter<mratsim> I would say it really depends on your domain (web, games, science, GUI, command line tools …) but in my opinion Nim as a language is in pretty good shape, the ecosystem has yet to be build for many things though
09:16:26FromGitter<mratsim> If you like building things from scratch you’re in luck
09:17:20FromGitter<mratsim> And you can always use bindings to C/C++/Obj-C/Javascript
09:18:18kobi7thanks, to a certain extent I do like writing libs etc, but i need a solid stdlib, otherwise it's too much time wasted building all the basic blocks
09:19:07kobi7mratsim: so those are the compiler targets or backends?
09:19:52kobi7I assume I cannot mix them together in a single project. is that correct?
09:20:02FromGitter<mratsim> you can compile to each of those languages, then Nim call GCC/clang to generate machine code.
09:20:58FromGitter<mratsim> well, you can probably mix javascript and C by using a NodeJS-C library. There is a Nim-electron example that does that
09:21:06kobi7I've mostly used C# as a (working) programmer, but always liked the alternatives
09:22:03kobi7I think, it must be easier to port from python, than to use js, higher quality libs, and much similar syntax/concepts
09:22:08FromGitter<mratsim> This repo: https://github.com/PMunch/nim-electron
09:22:59FromGitter<mratsim> Yes it is much easier to port Python code to Nim than JS to Nim
09:23:21Araqhow can I see the changed caused by merged branches?
09:24:11*Yardanico joined #nim
09:24:34FromGitter<mratsim> Something like that? https://github.com/nim-lang/Nim/commit/28bdf0ac80ad4f44515874e03720c70156903f6b
09:24:50Yardanicohello everyone!
09:24:56FromGitter<mratsim> hey Yardanico
09:25:48kobi7mratsim: is vscode as nim IDE a good choice?
09:25:59FromGitter<mratsim> the best actually
09:26:01kobi7and thanks for all the useful answers
09:26:25FromGitter<mratsim> you’re welcome
09:26:36*haha_ joined #nim
09:26:52kobi7cool. I thought it required something like a language server, or something like that
09:27:11Yardanicokobi7, yes it does
09:27:22Yardaniconim has it's own "language server" - nimsuggest
09:27:31Yardanicoand vscode nim extension uses it
09:27:37Yardanicoso you get autocompletion
09:27:37kobi7cool. i'm very new to the scene :-)
09:28:20YardanicoI don't know about other languages, but "nimsuggest" uses compiler, so it can resolve very complicated stuff like macros/templates/custom operators
09:28:26FromGitter<mratsim> @Araq I added the test case in lib/stdlib, is that good with you: http://img.ctrlv.in/img/17/09/16/59bcee889fc68.png
09:29:38kobi7Are there plans for other targets? I have some experience with the Haxe language, and they have multiple targets. maybe outputting haxe code is wise as it'll give access to all their backends (cs, java, cpp, js, hl, ...)
09:29:56Yardanicokobi7, well it would require to write more platform-specific code
09:30:05Yardanicoand I think C/C++ and JS is enough today :)
09:30:16FromGitter<mratsim> There was PHP xD
09:30:20Yardanicoit's still here
09:30:48Yardanicobut it isn't a "serious" backend right now
09:30:52kobi7they also have php, and python, and neko
09:31:02kobi7php was never serious ;-)
09:31:09Yardanicokobi7, what's the point?
09:31:17Yardanicoanyway you gonna write tons of language-specific code
09:31:17FromGitter<mratsim> I think having Haxe would make Nim dependent on Haxe bugs, it’s probably best as a third party lib as Haxe is as young as Nim
09:31:38*yglukhov joined #nim
09:31:48kobi7for example, mobile apps from the same codebase
09:31:49FromGitter<mratsim> I’d rather have Nim—> LLVM IR backend
09:31:50Araqmarsim: obviously not since it fails. files starting with 't' are run as tests
09:32:00Yardanicomratsim: it's already here
09:32:01Araqyou need to rename the module
09:32:05Yardanicohttps://github.com/arnetheduck/nlvm
09:32:18Yardanicobut it doesn't have threads, stack traces, debug info
09:32:27Yardanicobut it already passes ~90% of tests
09:32:38FromGitter<mratsim> @Araq, yes it fails, I did the test before doing the fix to make sure the test is correct ;)
09:33:30kobi7were there attempts on a mobile app using nim?
09:33:36Yardanicokobi7, you can do that already
09:33:44*Matthias247 quit (Read error: Connection reset by peer)
09:33:55kobi7oh, i thought android required java code
09:34:00Yardanicofor example, https://github.com/yglukhov/nimx is cross-platform GUI written in Nim (it uses SDL)
09:34:19Yardanicokobi7, well you would have some boilerplate in java
09:34:30Yardanicokobi7, https://github.com/yglukhov/nim-sdl-template
09:34:30kobi7looks super cool
09:34:44kobi7I see.
09:36:05kobi7Can nim be suitable for embedded? (assume GC is fine)
09:36:22Yardanicokobi7, yes
09:36:34Yardaniconim also has region-based GC which is useful for embedded
09:36:57Yardanicokobi7, don't forget than the most supported nim backend - C
09:37:03Araqer actually that thing is still in development and not in good shape
09:37:12AraqI mean the region-based MM.
09:37:13FromGitter<mratsim> Nim compiles to Obj-C but I don’t think anyone tried on iPhone. You can also compile to JS and do React Native-like stuff. And android compilation is apparently relatively easy: @PMunch developped an Android game in Nim in a GameJam (2 day coding/disgn/art hackathon) - https://github.com/PMunch/TromsoGameJam2017
09:37:35Yardanicomratsim: I'm pretty sure someone have already tried it :)
09:37:53*Matthias247 joined #nim
09:38:09kobi7very nice. Was nim used for some ambitious projects? (aside from the compiler, i mean)
09:39:55FromGitter<mratsim> @zacharycarter is building a game engine. @Araq developed Karax for Single Page web application. I’m trying to build a Deep Learning library in Nim in my case.
09:40:18Yardanicowell there's bigger projects too AFAIK
09:40:48kobi7Is that part of work - that is, people are getting paid for it?
09:41:26*Matthias247 quit (Read error: Connection reset by peer)
09:41:30kobi7I mean the projects you mentioned
09:41:32FromGitter<k0pernicus> @mratsim Interesting - I plan to use Nim later for NLP and statiscal ML
09:41:36kobi7it's hard to sustain otherwise...
09:41:45FromGitter<k0pernicus> Statistical*
09:42:00Araqkobi7: some are paid, some are not
09:42:22Araqfyi it's 'git log -m -p file'
09:42:47kobi7I hope those who are not, don't get burned out by the volunteer effort
09:43:32Yardanicokobi7, what do you meen by volunteer effort? people use Nim for their projects or for fun - they're trying to give something back (e.g. improve the language)
09:43:34kobi7there are now platforms like patreon, where the "crowd" can donate/fund
09:43:40Yardanicoyes, there's for nim
09:43:45arnetheducknlvm has debug info
09:43:52Yardanicoarnetheduck, ah, sorry, README said it didn't :)
09:44:02Yardanicokobi7, https://salt.bountysource.com/teams/nim
09:44:02arnetheduckit's more recent than the readme ;)
09:44:17FromGitter<mratsim> @k0pernicus Interesting, NLP is so much tougher than images, I tried to use image + text recognition in a past Kaggle competition but failed miserably.
09:44:27kobi7Yardanico: maintaining a library is hard work
09:44:38Yardanicokobi7, well not that hard
09:44:47YardanicoI mean big library - maybe
09:44:54Yardanicobut with nim it can be easier sometimes :)
09:45:04kobi7I guess it depends - i mean from the time you spend on it, requests of users, etc.
09:45:45kobi7I think open source doesn't have to be serving others without any compensation
09:45:53FromGitter<mratsim> I’d rather develop something fun, than code CRUD at work :), and to be honest I’m not even a developer and never was.
09:46:35kobi7Yardanico: what do you use for gui (desktop) programs? wxwindows, IUP ?
09:46:55Yardanicokobi7, well I don't develop gui programs :)
09:46:58Yardanicohmm, code snippet in crystal lang: https://gist.github.com/Yardanico/ea76f6c6fe2e048a7537aa95317d281f
09:47:06kobi7heh
09:48:18kobi7crystal? sounds like a drug. is that the ruby compiler thing?
09:48:29kobi7:-)
09:48:38Yardanicowell yeah, a language with ruby-like syntax
09:48:43YardanicoI don't use it, just saw this snippet
09:48:45*haha_ quit (Read error: Connection reset by peer)
09:49:16kobi7tbh the old name (nimrod) has some bad connotations where I live
09:49:26Yardanicokobi7, yeah, that's why it was renamed to Nim
09:49:47*haha_ joined #nim
09:49:53YardanicoAnd first result in google by "Nim" query is nim :)
09:51:23*endragor quit (Remote host closed the connection)
09:52:26*Matthias247 joined #nim
09:55:19FromGitter<mratsim> And @kobi7 regarding maintaining, it’s easier I think to maintain code in it: ⏎ ⏎ 1) less noise per line -> easier reading (looking at you Rust) ⏎ 2) statically typed -> compiler helps (looking at you Python) ⏎ 3) fast to compile -> you don’t have to wait to add tests (looking at you C++) ... [https://gitter.im/nim-lang/Nim?at=59bcf507c101bc4e3ad32400]
09:56:06Yardanicoand metaprogramming :)
09:56:23Yardanicoso for example you can create sync/async procedures with {.multisync.} pragma from AsyncDispatch
09:57:02FromGitter<mratsim> Oh, and generics mean less code duplication (looking at you Rust and C)
09:57:27kobi7yes, the language itself looks very good to me
09:57:33Yardanicomratsim: rust has generics :)
09:57:42FromGitter<mratsim> I guess the only concurrence from that is Haskell :?
09:57:45Yardanicobut IDK if they're better than Nim generics or not
09:58:12*Matthias247 quit (Read error: Connection reset by peer)
09:59:16kobi7when i worked as a coder in c#, we had a huge solution with about 60 projects in it. when there was a change in the dependent libs, the build took minutes. that was aweful for productivity. sometimes you could build in isolation, but when u couldn't.... awful experience. since then I regard compiler speed as productivity feature
09:59:29FromGitter<mratsim> I was speaking of integer generics actually? Last time I checked they generated Array procs only for for array of size 1..32
10:00:15Yardanicokobi7, well nim compiler is pretty fast, and maybe someone will fix incremental compilation in the future :)
10:03:42Yardanicomratsim: it seems there's a third party package for that
10:03:49Yardanicohttps://github.com/fizyk20/generic-array
10:04:19kobi7in terms of object oriented, does nim have the concept of interface ?
10:04:33Yardanicokobi7, it doesn't have interface, but it has concepts :)
10:04:39Yardanicobut they are very different things
10:04:58kobi7heh, that's the name? concept?
10:05:01Yardanicoprobably you'll able to use concepts like interfaces when vtref concepts will be implemented
10:05:10Yardanicokobi7, yeah, but they're only a compile-time thing now
10:05:17Araqan interface is just use a tuple of closures, I dunno why it's so hard to understand
10:06:44Araqcould use a macro to make it more convient to use
10:06:49kobi7some languages have them by name, others match by their structure
10:06:56*endragor joined #nim
10:07:14kobi7I don't use inheritance much but I like traits
10:07:36kobi7and structural matching is a good feature imho
10:08:22kobi7i'll read some about 'concepts' - sounds original :)
10:08:41Yardanicokobi7, https://nim-lang.org/docs/manual.html#generics-concepts
10:13:30FromGitter<mratsim> I think there should be a module in stdlib called interface, and done :P
10:14:54kobi7thanks
10:15:20Araqmratsim: do you volunteer?
10:16:08FromGitter<mratsim> I have my plate full already :P, and I don’t use OO, interfaces, etc.
10:16:31kobi7Araq: can I understand concepts as type invariants or is it more like structural typing?
10:17:50kobi7sorry gtg
10:17:57kobi7see you and thank you for all the info
10:18:12*kobi7 quit (Quit: Leaving)
10:21:19FromGitter<mratsim> @Yardanico: here is the Rust code for implementing Array default functions in Rust - https://github.com/rust-lang/rust/blob/f861b6ee46465097eec266c160ac53e230df7cf0/src/libcore/array.rs#L206-L234
10:21:33FromGitter<mratsim> If you use array with len bigger than 32 you have to implement everything yourself
10:21:46Yardanicowell this package seems to do all the stuff itself
10:29:08*dddddd joined #nim
10:30:23*wgf_ joined #nim
10:34:38*yglukhov quit (Remote host closed the connection)
10:37:28*yglukhov joined #nim
10:37:52*smt_ joined #nim
10:41:08*smt` quit (Ping timeout: 240 seconds)
10:44:03*Yardanico quit (Remote host closed the connection)
10:48:20*wgf_ left #nim ("Leaving")
10:55:43*Snircle joined #nim
10:58:34FromGitter<Bennyelg> @Yardanico If Im creating distinct string, and querying SqlQuery("query") how I can call also sql"query"
10:58:55FromGitter<Bennyelg> @Yardanico I want to create this implementation to avoid Sql Injection of course.
11:00:55FromGitter<Bennyelg> just template sql(query: string): SqlQuery ?
11:01:28*endragor_ joined #nim
11:04:24*gokr quit (Ping timeout: 240 seconds)
11:05:03*couven92 joined #nim
11:05:14*endragor quit (Ping timeout: 255 seconds)
11:06:09*endragor joined #nim
11:09:58*endragor_ quit (Ping timeout: 264 seconds)
11:21:33*endragor_ joined #nim
11:24:27*endragor quit (Ping timeout: 252 seconds)
11:35:24*yglukhov quit (Remote host closed the connection)
11:36:13AraqBennyelg: that's what the other db modules use, yes
11:41:13FromGitter<zacharycarter> anyone have any suggestions for other dungeon generation methods that they'd like to see in this RL library?
11:48:33*rokups joined #nim
11:51:57*ShalokShalom_ joined #nim
11:54:58*ShalokShalom quit (Ping timeout: 264 seconds)
12:04:47*ShalokShalom_ is now known as ShalokShalom
12:08:07*gokr joined #nim
12:13:04*nsf quit (Quit: WeeChat 1.9)
12:15:54*PMunch joined #nim
12:28:47PMunchHmm, I'm trying to set up a simple build environment for Nim in a Windows VM and I'm having some trouble
12:30:55PMunchI ran the finish.exe program as stated, but after a window flashed by nothing more happened..
12:31:54PMunchAnd I just realised that koch is the german word for chef :P
12:32:18PMunchAfter seeing the chefs hat icon :P
12:32:59*endragor_ quit (Remote host closed the connection)
12:42:29PMunchAh, the installation for Windows is a binary distribution :P
12:42:36PMunchThat explains a thing or two
12:42:37*forcefaction joined #nim
12:44:21*Ven`` quit (Remote host closed the connection)
12:44:39*Ven`` joined #nim
12:45:17forcefactionhello there, how do you convert a BiggestInt to a string ?
12:46:09PMunch$
12:46:24PMunch$ is the general "to string" proc in Nim
12:46:32PMunchSo if you need a string of something use $
12:47:09PMunchSo "var x:BiggestInt = 5; echo $x"
12:48:03forcefactionthank you, good to know :DD
12:52:54PMunchHmm, now I'm getting plenty of "size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative" errors
12:53:07PMunchI guess that means that Nim and GCC disagree on the target architecture?
12:59:33*madmalik joined #nim
12:59:53*Yardanico joined #nim
13:02:05*forcefaction quit (Ping timeout: 240 seconds)
13:03:33*endragor joined #nim
13:04:42*endragor_ joined #nim
13:04:58PMunchAha, Nim in action to the rescue :)
13:08:28*scriptum quit (Ping timeout: 240 seconds)
13:08:46*endragor quit (Ping timeout: 264 seconds)
13:12:54PMunchIs MinGW for 32bit only?
13:16:13YardanicoPMunch, no
13:16:22YardanicoPMunch, https://sourceforge.net/projects/mingw-w64/
13:16:26Yardanico"MinGW-w64 - for 32 and 64 bit Windows"
13:16:39PMunchOh, it's a different install not linked from their site?
13:16:43YardanicoPMunch, yeah
13:16:55Yardanicothis mingw is better probably
13:17:03Yardanicoyou can install mingw with gcc 7.1.0
13:17:04PMunchI found that but assumed it was a virus/phishing attempt..
13:17:50*mahmudov joined #nim
13:24:47*gokr quit (Ping timeout: 248 seconds)
13:29:18AraqPMunch: https://nim-lang.org/install_windows.html
13:29:26AraqThe following versions of MingW are known to work with the latest version of Nim.
13:29:26Araq32 bit - mingw32-6.3.0.7z
13:29:26Araq64 bit - mingw64-6.3.0.7z
13:30:21PMunchAha, that would probably have been a better way to get MinGW -__
13:30:52Araqthere is a reason we provide it for you ;-)
13:31:05Araqmingw got worse and worse to install
13:31:21Yardanicowell mingw-w64 was very easy to install
13:31:34AraqYardanico: from which site?
13:31:41AraqI tried lots of.
13:31:53YardanicoAraq, https://sourceforge.net/projects/mingw-w64/files/?source=navbar online installer here
13:32:04Araqoh that online installer, spare me
13:32:04Yardanicoah sorry wrong link
13:32:39AraqPMunch: finish.exe can download for you too
13:32:51Araqin fact, it can fixup your configuration
13:33:23PMunchFinish didn't seem to do anything
13:33:31PMunchI ran it but it just flashed a window
13:33:48PMunchWhen launched from the terminal it just showed me a Nim error message about a file not being found
13:33:55PMunchIIRC
13:36:27*Trustable quit (Remote host closed the connection)
13:39:16Araqnever heard this one before
13:39:29Araqcan you run it in a terminal and report the error?
13:40:44PMunchWorking on it
13:40:55PMunchBut this emulated Windows is pure pain..
13:41:15PMunchRight now I'm fighting Edge to let me paste something into pastebin..
13:41:29Yardanicouse gist :P
13:41:44PMunchThen I have to log in don't I?
13:41:49Yardanicoyou don't
13:41:53Yardanicoor wait
13:42:01Yardanicoyeah
13:42:04Yardanicoyou can post anonymous gist
13:42:08PMunchpastebin.com/ahvhk4vK
13:42:14PMunchThat should be the right URL
13:42:27YardanicoPMunch, https://gist.github.com/anonymous/a08cd703168b771ee2270627b1b616b3
13:42:53YardanicoI've posted it from incognito mode in browser
13:46:24AraqPMunch: most interesting, it means you have no user specific PATH environment variable
13:46:41PMunchHuh
13:46:50Araqfinish.exe should work anyway but I guess my fix wasn't good enough
13:46:53PMunchIn system settings I can see a "Path" variable
13:47:00PMunchBut no "PATH"
13:47:07Araq*user* specific path?
13:47:22PMunchOh, not sure how that works on Windows..
13:47:31Araqnot the global one, we can't modify that without admin rights ;-)
13:48:10Araqinstall this please https://www.rapidee.com/en/about
13:48:55PMunchAdded an empty "PATH" variable to my user config, and it works now
13:49:09Araqof course it does, I told you.
13:49:11Araq:P
13:49:19PMunchBut I get another error "libiconv-2.dll is missing".
13:49:34PMunchFrom cc1.exe
13:49:41PMunchIn a visual pop-up
13:50:16PMunchOh wow, there were many more of them
13:56:31PMunchHmm, got everything to compile without errors or warnings now. But when I start the program I just get a "The application was unable to start correctly." error -_-
13:56:46PMunchProbably something to do with SDL2 though..
14:00:03YardanicoSDL2 dlls ? :)
14:00:10Yardanicorun your app from console to see the error
14:00:31PMunchTried that first
14:00:39PMunchDidn't give me any output at all
14:01:06Yardanicodon't compile it with --app:gui
14:01:14PMunchI didn't
14:02:19PMunchI compile with "nim c --noMain --threads:on --tlsEmulation:off --passL:-lmingw32 --passL:-lSDL2main --passL:-lSDL2 --passL:-mwindows main.nim
14:03:36*endragor_ quit (Remote host closed the connection)
14:04:12*endragor joined #nim
14:04:38*gokr joined #nim
14:08:21*endragor quit (Ping timeout: 240 seconds)
14:15:14*vendethiel- joined #nim
14:16:35*Ven`` quit (Ping timeout: 240 seconds)
14:19:45PMunchHmm, the error seems to be something to do with 32/64 bit version errors...
14:26:38PMunchI'm starting to think if it wouldn't be easier to cross compile..
14:39:09FromGitter<edubart> what is a quick way to sum two seq[int] of the same size element-wise ?
14:40:36PMunchedubart, a loop?
14:40:38FromGitter<edubart> I think sequtils misses a map2 proc to apply a function to two seqs and return a new seq as result
14:40:52PMunchMaybe have a look at nimfp
14:41:02FromGitter<edubart> I wanted one liner
14:43:08Yardanicouse zip and map?
14:44:14Yardanicoedubart: zip(a, b).mapIt(it[0] + it[1]) if you have two seqs - "a" and "b"
14:44:22Yardanicoand you need to import "sequtils"
14:44:41FromGitter<edubart> hmm that should work
14:45:06Yardanicoand as you see you don't need any typing here :)
14:45:41Yardanicohttps://play.nim-lang.org/?gist=0daefb14e1dbadf582a4062bc5975f56
14:46:43FromGitter<edubart> that's odd, I was unaware of that kind of magic, no need to declare the "it"
14:46:51Yardanicowell it's not a magic
14:46:56Yardanicoit's an injected variable
14:47:01Yardanicoit uses metaprogramming :)
14:47:19Yardanicoedubart: it's not even a macro, just a template
14:47:20Yardanicohttps://github.com/nim-lang/Nim/blob/master/lib/pure/collections/sequtils.nim#L604
14:47:42PMunchWell would you look at that, cross-compile was a breeze..
14:48:03FromGitter<edubart> cool
14:48:09Yardanicoand this template isn't much complicated
15:01:05FromGitter<mratsim> oh oh cool @Yardanico, and here I was waiting for inline iterator chaining to work, I can just forgo iterators and use templates. Now I have to hunt the 20 lines to update ….
15:01:34*gokr quit (Ping timeout: 264 seconds)
15:03:13AraqPMunch: you need to setup your PATH for gcc too then, finish can do it for you
15:03:31Araqedubart: math.sum exists iirc
15:03:44PMunchAraq, I had GCC working fine
15:03:51PMunchIt was the compiled output that was failing
15:03:59PMunchBut cross compiling solved the entire problem :)
15:04:35YardanicoAraq, afaik "sum" wouldn't work with two seqs
15:04:45Yardanicoah
15:04:46Yardanicoyeah, sorry
15:04:52Yardanicosum(seq1) + sum(seq2) lol
15:05:12AraqYardanico: lib/pure/stats.nim ? often overlooked
15:05:13*endragor joined #nim
15:05:15Araqbut it's awesome
15:05:36YardanicoAraq, I've never heard about this module in nim stdlib before :P
15:06:08Araqgives you sum, average etc with O(1) storage requirements
15:06:10FromGitter<mratsim> I think the point was zip(a, b).mapIt(it[0] ``op`` it[1])
15:06:24Yardanicowell with math.sum it's much simpler
15:06:28Yardanicosum(a) + sum(b)
15:06:45Araqtrue for this case
15:06:49FromGitter<mratsim> op being an user defined function
15:06:52Araqbut stats.nim is more powerful
15:09:57FromGitter<mratsim> Interesting it uses the Welford method to compute running variance and avoids overflows: https://github.com/nim-lang/Nim/blob/master/lib/pure/stats.nim#L81-L98
15:09:58*endragor quit (Ping timeout: 264 seconds)
15:12:56Yardanicoit seems https://github.com/jlp765 is the author :)
15:13:15Yardanicocool thing - even after two years it still works without any backwards compatibility issues
15:19:18*Arrrr joined #nim
15:19:18*Arrrr quit (Changing host)
15:19:18*Arrrr joined #nim
15:20:02*rauss quit (Quit: WeeChat 1.9)
15:20:57*rauss joined #nim
15:25:48Arrrr"prepared stdlb for new integer arithmetic rules" [fear intensifies]
15:26:18*ipjk joined #nim
15:29:34FromGitter<mratsim> 1 + 1 = 3?
15:29:48Yardaniconoo
15:32:27obadz@mratsim: is there not a way to tell nimble where to find its dependencies and where to install its output?
15:33:10FromGitter<mratsim> why do you need to tell nimble where to find dependencies?
15:34:23FromGitter<mratsim> if you want to ask nimble to download directly for github there is indeed an option for that
15:34:31FromGitter<mratsim> from*
15:38:09Yardanicowho is the author of arch linux nim package ? :)
15:38:10AraqArrrr: x mod 3 does not produce range[0..2] anymore
15:42:29YardanicoAraq, is "CC = concept c of CB" allowed ?
15:43:23Araqno, just call the concept like 'x is CB'
15:43:38AraqCC = concept c\n c is CB
15:43:48Yardanicook, then this is indeed a bug :)
15:48:48Araqwell zahary planned this feature, is it implemented already?
15:49:34YardanicoAraq, https://github.com/nim-lang/Nim/issues/6390
15:50:21Yardanicomaybe "of CB" is just ignored
15:50:25Yardanicoand concept is matched to any type?
15:51:14*scriptum joined #nim
15:55:04*salewski joined #nim
15:56:33salewskiAraq, should cstring(nil) not be nil? (six lines of code follows...)
15:56:40salewskivar
15:56:47salewski s: string = nil
15:56:53salewski cs: cstring
15:56:59salewskics = cstring(s)
15:57:06salewski s: string = nil
15:57:13salewskiecho cs # crash
15:57:17salewski#done
15:57:43Araqcstring(nil) is not the same as cstring(string_of_value_nil)
15:58:06Araqbut this is work in progress, I'm removing nil from strings/seqs anyway
15:58:21salewskiI know, so I posted the example.
15:58:32*RPG joined #nim
15:58:45Araqso ...? you think I'm unaware of this behaviour?
15:58:56*RPG is now known as Guest89124
15:59:24salewskiSo I shall not post an issue to github issue tracker?
15:59:52salewski(A user of gintro observed this, I can fix it easily...)
16:00:38Yardanicosalewski, maybe something like this? https://github.com/nim-lang/Nim/issues/1577
16:00:47Yardanicowell it's related
16:00:58*scriptum quit (Ping timeout: 264 seconds)
16:01:17*relax joined #nim
16:01:47salewskiOh, removing nil can be a problem! Nil and empty string is very different, not only in GTK.
16:02:25Yardanicowell but there would be less SIGSEGVs in pure nim code ? :)
16:02:40salewskiFor example gtk_frame_new() nil as string arguments that we want no label, that is different from empty string "".
16:03:20Araqsalewski: we can have a conversion from Option[string] to cstring then
16:03:22Yardanicoalso I think making seqs and strings not nil by default would make it easier to finish "not nil" ?
16:03:31Araqand options in general need better support in Nim
16:03:48AraqYardanico: 'not nil' is also affected, sure
16:04:22salewskiOK.
16:05:47*solitudesf quit (Remote host closed the connection)
16:07:27*relax quit (Ping timeout: 248 seconds)
16:09:14FromGitter<Bennyelg> Why the "Return" word is optional :|
16:09:21FromGitter<Bennyelg> so confusing.
16:10:06Yardanicowell it's not confusing :)
16:10:15FromGitter<ephja> a lot of things are, if you're new
16:10:27Yardanicowell yeah
16:10:28FromGitter<Bennyelg> Yea :D
16:10:41FromGitter<Bennyelg> Is this a valid return from proc ? seq[seq[string]] | seq[Table[string, string]]
16:10:50FromGitter<Bennyelg> I can do that right ? :D
16:10:55Yardanicoehm
16:11:01Yardanicoonly if your proc is generic
16:11:09FromGitter<Bennyelg> oh
16:11:11FromGitter<Bennyelg> I see
16:11:18Yardanicowhy do you want it?
16:11:36Yardanicojust make a seq[seq[string]] thing and an optional proc which will return seq[Table[string, string]]
16:12:53*TjYoco joined #nim
16:14:57*miran joined #nim
16:22:28TjYoco@zacharycarter are you planning on a physics engine for zengine or using a c-lib bindings?
16:25:05*salewski quit (Quit: WeeChat 1.9)
16:35:33*endragor joined #nim
16:40:05*endragor quit (Ping timeout: 240 seconds)
16:42:11*relax joined #nim
16:48:27*def-pri-pub joined #nim
16:48:54def-pri-pubzacharycarter: waz up?
16:52:17*relax quit (Ping timeout: 248 seconds)
17:05:44miranquick question about file handling: i'm using `open` to read from a file. is using a `close` a must or it doesn't matter?
17:09:03ArrrrI think no other process will be able to operate on that file until your program exits
17:10:23*def-pri-pub quit (Ping timeout: 248 seconds)
17:10:40miranArrrr: so if program takes less than a second and/or nothing else will use that file, it shouldn't matter?
17:12:20*def-pri-pub joined #nim
17:12:30ArrrrI think you are right. Make an experiment with a program that opens it and then sleeps for a minute, and then try to open it in the meantime
17:12:45mirangood idea, thanks
17:15:25FromGitter<zacharycarter> def-pri-pub: hey
17:15:41FromGitter<zacharycarter> TjYoco: good question, I'm leaning towards c lib binding probably
17:15:45FromGitter<zacharycarter> https://imgur.com/a/alwAx
17:16:26FromGitter<zacharycarter> unless someone wants to write a physics engine in Nim in which case I'd gladly use a pure Nim one
17:17:55Araqmiran: close is required, you can write a 'withFile' template in order to not be able to forget it
17:19:37*haha_ quit (Quit: haha_)
17:21:30YardanicoAraq, was there any discussions about adding something like python "with" to nim?
17:21:46*relax joined #nim
17:21:55obadzYardanico: seems like that should be doable with a macro?
17:22:06AraqYardanico: that's just a template
17:22:10Yardanicoah, yes, sorry :)
17:22:19Yardanicobut maybe add it to system.nim ? :)
17:22:44Araqnot system.nim.
17:22:51Yardanicofuture?
17:23:11Araqno.
17:23:26Araq"extensions.nim" ? dunno
17:23:40Yardanicoyeah, and we can add other stuff like oop macro to it :D
17:23:59Araqand an 'interface' macro
17:24:04Yardanicoyeah
17:24:17Yardanicohmm, is there any difference between "yes" and "yeah" ?
17:24:27Araqno.
17:24:35Araqnah.
17:24:40*def-pri-pub quit (Ping timeout: 255 seconds)
17:24:42Yardanicook :P
17:25:29Yardanicooh wait, "with" is a keyword?
17:26:25*def-pri-pub joined #nim
17:27:10Arrrrwhat is `with` ?
17:27:38YardanicoArrrr, context manager in python
17:27:41Yardanicoand reserved keyword in nim
17:27:52Arrrrwhat does it do in python?
17:28:15AraqYardanico: open/close are unnatural words for locks so I think withLock / withStream is better for Nim
17:28:54Araq'with' and 'without' are keywords but are currently unused
17:29:06Araqwe could remove them again from the language
17:29:12Yardanicoagain?
17:29:19Yardanicoe.g. they was removed and added again?
17:29:28FromGitter<ephja> are destructors not enough?
17:29:32Araqwell obviously at one point they were added
17:31:05*relax quit (Ping timeout: 240 seconds)
17:31:17*def-pri-pub quit (Ping timeout: 260 seconds)
17:31:35*TjYoco quit (Ping timeout: 240 seconds)
17:32:05Yardanicowell python has special __exit__ and __enter__ methods for "with" statement
17:32:53*def-pri-pub joined #nim
17:33:13obadz$ nimble tasks
17:33:16obadzSIGSEGV: Illegal storage access. (Attempt to read from nil?)
17:33:23Yardanicolol
17:33:32Yardanicoreport it
17:33:33AraqYardanico: oh right, these fit better
17:35:48*Jesin quit (Quit: Leaving)
17:36:21Yardanicogithub is very confused about syntax highlighting with braces syntax :P https://github.com/nim-lang/Nim/blob/a94a0f27f2252e06427364665e1cbb9a6bce5af7/tests/parser/tbraces.nim
17:36:49Yardanicooh wow
17:37:00Yardanico"concept" is used only once in whole nim stdlib
17:37:14Yardanicoin jsffi
17:37:20FromGitter<ephja> care to work on a container interface? ;9
17:37:25FromGitter<ephja> ;)
17:37:28*Jesin joined #nim
17:38:46FromGitter<ephja> I'd like to provide abstractions over C libs with minimal overhead
17:39:49Yardanicowell with nim I learned some low-level stuff (even if I didn't write low-level code)
17:39:50*yglukhov joined #nim
17:39:56YardanicoI mean general low-level stuff
17:41:51*gangstacat quit (Quit: Ĝis!)
17:43:33*yglukhov quit (Remote host closed the connection)
17:43:51Yardaniconim is a strange language: it's high-level and low-level at the same time :P
17:44:54*yglukhov joined #nim
17:44:57*yglukhov quit (Remote host closed the connection)
17:45:38FromGitter<ephja> so someone else has already made a PR for iterating over enums with holes etc
17:46:27FromGitter<ephja> the PR stack is getting taller :p
17:46:34*yglukhov joined #nim
17:47:09*gangstacat joined #nim
17:48:15*jsgrant quit (Remote host closed the connection)
17:48:36FromGitter<ephja> hm what to work on now
17:52:20FromGitter<mratsim> I have suggestions :p
17:52:50*couven92 quit (Remote host closed the connection)
17:53:12FromGitter<ephja> does anyone know if any of the completion plugins work for modules that are meant to be included?
17:53:16*couven92 joined #nim
17:54:01Yardanicolet me check
17:54:24Yardanicoyes
17:54:34Yardanicovscode + nim extension (it uses nimsuggest) works
17:54:38FromGitter<ephja> huge parts of the compiler code relies on includes
17:54:54Yardanicowell nimsuggest doesn't play well with compiler
17:54:57FromGitter<ephja> Yardanico: I don't think it works at all with included files for me
17:55:03Yardanicohmm, strange
17:55:22FromGitter<ephja> I think it got even more broken when I updated nimsuggest
17:55:31Yardanicovery strange
17:56:12FromGitter<mratsim> It works only once I have compiled at least once
17:56:15Yardanicowell it really works for me
17:56:25*endragor joined #nim
17:56:41Yardaniconimsuggest can crash sometimes if you use it at compiler files :)
17:56:51Yardanicobut mostly it works too
17:59:38FromGitter<ephja> I'll try to build the compiler then
18:00:09FromGitter<ephja> Yardanico: how do you check if it has crashed?
18:00:21Yardanicowell
18:00:40Yardanicofirstly - if all my RAM is taken by Nimsuggest (but this isn't techically a crash)
18:00:58FromGitter<ephja> oh. yeah I know about the leaks
18:01:25Yardanicosecondly - if vscode shows <Error type> if you hover some type
18:01:29Yardanicoand the best way
18:02:04FromGitter<ephja> I can often find what I want by grepping though
18:02:23Yardanicoctrl+shift+p -> toggle developer tools -> look in log for errors like "nimsuggest closed with code: 1" or "nimsuggest returns unknown port number: SIGSEGV: Illegal storage access."
18:02:26Yardanicoin vscode
18:03:12Yardanicohttps://i.snag.gy/wsUqcu.jpg
18:03:16FromGitter<ephja> thanks
18:05:55*yglukhov quit (Remote host closed the connection)
18:06:03*TjYoco joined #nim
18:06:26*gokr joined #nim
18:08:11TjYoco@zacharycarter I would like to put my ME degree to some use so I'll look into it and let you know If I come up with something.
18:11:39FromGitter<zacharycarter> that'd be awesome!
18:11:52FromGitter<zacharycarter> keeping my fingers crossed
18:11:55FromGitter<zacharycarter> :)
18:14:21TjYoco@zacharycarter, would you be okay with a generic physics engine, like how you can use Chipmunk and Box2d anywhere or would you be more comfortable w/ it being zengine specific?
18:14:32FromGitter<Bennyelg> @Yardanico How Should I implement it, I am working on prestoDb cursor to be able create cursor(useTableCur=true) which cause the result sets of fetchone, fetchmany and fetchall as a seq[table[string, string]] instead of seq[seq[string]]
18:14:42*yglukhov joined #nim
18:14:43FromGitter<zacharycarter> I'd be fine with a generic one
18:14:55FromGitter<zacharycarter> thing is TjYoco - zengine is going to need both a 3d and 2d engine
18:15:49FromGitter<zacharycarter> but I mean even if it was just 2d or 3d that'd be fine too
18:15:54FromGitter<zacharycarter> can always supplement it with a C engine
18:16:04TjYoco@zacharycarter, yeah I noticed that and will definitely keep it in mind. I also had to deal with Unity in 2d before they actually had Unity2D
18:16:09YardanicoAraq, can I put https://github.com/nim-lang/Nim/issues/6379 to https://github.com/nim-lang/Nim/blob/devel/tests/vm/tvmmisc.nim ?
18:16:34*haha_ joined #nim
18:16:53Yardanicoor create something like "talgsort.nim" ?
18:18:22*SusWombat joined #nim
18:18:49*SusWombat quit (Client Quit)
18:21:51*def-pri-pub quit (Ping timeout: 248 seconds)
18:21:55FromGitter<Smaehtin> Is there a way to combine `from x import nil` and `import x as y`? I tried `from x import nil as y`, but that doesn't work :D
18:22:34YardanicoSmaehtin: https://forum.nim-lang.org/t/3154
18:22:45Yardanicopython-like import: from foo as f import nil
18:22:57Yardanicoe.g. "import foo as f" in python - "from foo as f import nil"
18:23:31FromGitter<Smaehtin> Oh, I don't know how I missed that! Thanks!
18:24:01*def-pri-pub joined #nim
18:24:01*def-pri-pub quit (Changing host)
18:24:01*def-pri-pub joined #nim
18:24:57*def-pri-pub quit (Client Quit)
18:26:13FromGitter<ephja> should the iterator interface look anything like the one for D? I dunno how much different you can make it
18:29:40AraqYardanico: yes, please do that
18:29:54Yardanicoso "talgsort" ?
18:33:37*rokups quit (Quit: Connection closed for inactivity)
18:36:24Yardanicohttps://github.com/nim-lang/Nim/pull/6391
18:38:17Yardanicooh, and also I should add a test-case for https://github.com/nim-lang/Nim/issues/6086 ?
18:38:40Yardanicowell it's the same thing - str handling in VM
18:41:16couven92Araq, I'm working with COM in Windows... when I call CoGetInstance I get a pointer to an interface instance... Windows gives me addref and release functions for each interface... That screams tracing reference to me... how can I get this done properly in Nim? create a ref type that stores the pointer and call `new` with a finalizer?
18:42:20FromGitter<Bennyelg> How Can I generate seq depends of the input of the proc ?
18:42:38Yardanicoone sec
18:42:46AraqYardanico: no, tvmmisc is fine
18:42:53YardanicoAraq, ah, sorry then :)
18:42:58YardanicoAraq, should I also add https://github.com/nim-lang/Nim/issues/6086 ?
18:43:23Araqcouven92: that's currently the best way to do it
18:43:46AraqYardanico: yep
18:45:14ArrrrDo destructors actually work? from the manual "Be aware that destructors are not called for objects allocated with new."
18:51:37Araqthey do not
18:51:40YardanicoAraq, maybe also add https://github.com/nim-lang/Nim/issues/6083 ? :P
18:56:00Araqsure
19:01:43*endragor quit (Remote host closed the connection)
19:02:18*endragor joined #nim
19:03:59YardanicoAraq, https://github.com/nim-lang/Nim/pull/6392
19:06:58*endragor quit (Ping timeout: 264 seconds)
19:17:42YardanicoAraq, also, how can I understand if I should make a test-case for issue or not?
19:18:54Araqlook at the bugfix, if the chance of a regression are slim a test would only consume energy
19:19:59YardanicoAraq, well sometimes there's no bugfix - e.g. some issues from a year ago with no comments, which compile fine in devel
19:22:18Yardanicohttps://github.com/nim-lang/Nim/issues/4749 :)
19:29:50FromGitter<superfunc> @Yardanico 3 bugs one fix, now thats efficiency :)
19:30:02Yardanicoone "fix" :)
19:30:13Yardanicoe.g. they all are fixed by another PR, I just added test-cases
19:30:53FromGitter<superfunc> Still important tho
19:32:47*planetis[m] joined #nim
19:35:31*Pisuke joined #nim
19:37:21*MyMind quit (Ping timeout: 240 seconds)
19:44:46*Arrrr quit (Ping timeout: 264 seconds)
19:45:32*Arrrr joined #nim
19:45:38*mahmudov quit (Ping timeout: 246 seconds)
19:48:59FromGitter<Bennyelg> https://gist.github.com/6dc4a9ab83a0913586a4476ec46d5ea7
19:49:11FromGitter<Bennyelg> how to make this thing work
19:54:02yglukhovBennyelg: s/if/when
19:54:24FromGitter<Bennyelg> change the if to when ?
19:54:49yglukhovBennyelg: and line 7 is wrong. for seq[seq[...]] the literal should be @[@[...]]
19:54:58yglukhovchange the if to when - yup
19:55:24FromGitter<Bennyelg> as I expected : in.nim(4, 10) Error: cannot evaluate at compile time: c
19:55:41Yardanicoyour boolean should be known at compile-time
19:55:47yglukhovoh, actually sorry, your sample is wrong.
19:56:03yglukhovwhat are you trying to achieve?
19:56:42FromGitter<Bennyelg> I'm creating a cursor, but I want to add an optional cursor which result seq[Table[string, string]] instead of the regular behavor of seq[seq[string]]
19:57:04Yardanicowrite two procs?
19:57:43FromGitter<Bennyelg> I want to achieve this if The user pass the useCursor: true
19:58:22FromGitter<Bennyelg> well, Another cursor with different signature? but It depends on the fetchAll, fetchMany fetchOne which all return seq[sqe[string]]
19:58:26yglukhovBennyelg: ok, then just use static[bool] as an argument type
19:58:45yglukhovand branch on it with `when` stmt
19:58:49Yardanicoyeah, and useCursor should be known at compile-time
19:59:41yglukhovBennyelg: but that just doesn't right conceptually...
19:59:46FromGitter<Bennyelg> yea it's known when compile time, I just wondring How I modify everything
19:59:50FromGitter<Bennyelg> Yea
19:59:50yglukhov* doesnt sound right
19:59:59Yardanicoyeah, why do you really want a table?
20:00:04FromGitter<Bennyelg> I am wondering what to do
20:00:07FromGitter<Bennyelg> I'll Explain
20:00:17FromGitter<Bennyelg> Assuming the user is creating this: ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59bd82d1614889d475078ded]
20:01:42*nsf joined #nim
20:02:16FromGitter<Bennyelg> ```code paste, see link``` ⏎ ⏎ If The user wont specify the cursorTable=true ⏎ he will just get [["benny", "abc"], ...] [https://gitter.im/nim-lang/Nim?at=59bd83487b7d98d30d0304ac]
20:04:35yglukhovBennyelg: You would likely want to have 2 cursor types then, and two procs `seqCursor` and `tableCursor` instead of `cursor`.
20:04:53FromGitter<Bennyelg> mmm, maybe
20:05:12FromGitter<Bennyelg> I still wondering because in python you can just pass the argument and return what ever you want :D
20:05:14FromGitter<Bennyelg> hehehe
20:05:24FromGitter<Yardanico> python is dynamically typed
20:05:27FromGitter<Yardanico> and nim is statically typed
20:06:05yglukhovi mean, nim surely allows the static[bool] way of doing things, but your API will not be obvious then.
20:06:16FromGitter<Bennyelg> Yea
20:06:16*endragor joined #nim
20:06:22FromGitter<Bennyelg> I'll create 2 diff of cursors
20:06:26FromGitter<Bennyelg> this will resolve my issues
20:07:33*haha_ quit (Quit: haha_)
20:10:04yglukhovBennyelg: as a side note, the types like seq and Table do not look like cursor types. seeing such types in the api i would assume that the cursor fetches everything in one go, which is normally not what you would want from a cursor.
20:10:58FromGitter<Bennyelg> cur.fetchall(), fetchone(), fetchmany(size) has a nice understanding of what they doing
20:11:07*endragor quit (Ping timeout: 260 seconds)
20:14:25*couven92 quit (Ping timeout: 248 seconds)
20:27:32FromGitter<mratsim> @Bennyelg I had something like that in my lib, result polymorphism depending on a static type input: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/init_deprecated.nim#L15-L39
20:27:52FromGitter<mratsim> in the end I just decided to have 2 procs
20:28:40*couven92 joined #nim
20:36:11FromGitter<ephja> have you defined iterators as well? so as to not waste space
20:37:34*azuri5 joined #nim
20:45:29*miran quit (Ping timeout: 246 seconds)
20:57:02*gokr quit (Ping timeout: 246 seconds)
20:57:27FromGitter<zacharycarter> https://imgur.com/a/CFAKM
20:57:30FromGitter<zacharycarter> spaceship layouts inc
20:58:37*Jesin quit (Quit: Leaving)
21:07:46*endragor joined #nim
21:11:42*Vladar quit (Quit: Leaving)
21:12:22*endragor quit (Ping timeout: 260 seconds)
21:19:36FromGitter<Bennyelg> @mratsim checking, thanks
21:20:23FromGitter<ephja> I have no idea how to make asserts work with the tester
21:21:01Yardanicoehm?
21:21:28Yardanicoephja: it seems they work? https://github.com/nim-lang/Nim/commit/ae7fe5087f3e4f6ddc572254ae3ddcc8324099f1
21:21:59FromGitter<Bennyelg> 3 questions: ⏎ what does ⏎ typedesc, static, auto means
21:22:26FromGitter<Yardanico> you don't need typedesc and auto :)
21:22:37FromGitter<Yardanico> typedesc - "type description", type itself
21:22:57FromGitter<Yardanico> "auto" - compiler automatically tries to understand which type you want to write
21:23:14FromGitter<Bennyelg> I c, thanks :))
21:23:17FromGitter<Yardanico> like type inference, but also in proc arguments and return type
21:23:27FromGitter<Yardanico> static - variable must be known at compile time IIRC
21:23:30FromGitter<Bennyelg> when you specify something like proc s[T: someX] what does it mean
21:23:55*yglukhov quit (Remote host closed the connection)
21:24:10FromGitter<Yardanico> it means this is generic proc
21:24:11*yglukhov joined #nim
21:24:21*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:24:24FromGitter<superfunc> `s` takes any type `T` such that the `T` satisfies the constraint `someX`
21:24:28*haha_ joined #nim
21:24:38FromGitter<Bennyelg> great!
21:24:43FromGitter<Bennyelg> and one last stupid question
21:25:12*yglukhov quit (Remote host closed the connection)
21:25:25FromGitter<Bennyelg> can I set a default value to an object? for example: ⏎ type s ⏎ Www = ref object ⏎ ⏎ ``` element: bool = false``` [https://gitter.im/nim-lang/Nim?at=59bd96c5177fb9fe7eccaf98]
21:25:39FromGitter<Yardanico> just make a constructor?
21:25:44FromGitter<Yardanico> like newMyObj
21:25:47FromGitter<k0pernicus> make a constructor
21:25:47FromGitter<superfunc> Yeah I would just set it in the new function
21:26:00FromGitter<Yardanico> @Bennyelg also, about your cursor stuff, write it like this
21:26:07FromGitter<Bennyelg> but I'll have to call it. ⏎ I want it to be set at compile time
21:26:22FromGitter<Bennyelg> I'm still trying to figure this out (the constructor stuff)
21:26:28FromGitter<Yardanico> you can't have "ref" type at compile-time
21:26:39FromGitter<Yardanico> since it's a "ref" - reference
21:27:01FromGitter<Yardanico> about your cursor stuff: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bd9725614889d47507e9c3]
21:27:25FromGitter<Bennyelg> oh, I tried something simillar lets see if this thing is work
21:29:42FromGitter<ephja> Yardanico: `assert false` yeah that seems to pass
21:30:09Yardanicovery strange
21:34:14*Yardanico quit (Remote host closed the connection)
21:39:15*shaiekx joined #nim
21:39:20shaiekxhello
21:40:57FromGitter<ephja> fails with `output: ""` (reExitcodesDiffer). the exitcode is 1 because the assert fails, but if I put `exitcode: 0` in the spec then it works. nothing ever works
21:41:17shaiekxI´ve been trying to get something to work for some time now and wonder if someone here can tell me what the problem with my code is
21:41:44shaiekxhttps://i.imgur.com/uSwW09V.png
21:42:04shaiekxThe code above functions
21:42:26shaiekxBut when I try to load the page 2 times right after each other I have to wait for the process to close from the first session
21:42:44shaiekxI think this is caused by waitForExit(process)
21:43:11*Trustable joined #nim
21:43:46shaiekxI want to add logic after waitForExit but i also want my page not to be blocked by new connections
21:46:02FromGitter<ephja> Yardanico: it actually fails if any of the assertions are wrong?
21:47:04*jsgrant joined #nim
21:48:40FromGitter<Bennyelg> @Yardanico when you do such thing with the static[bool] cant you pass default value to the method for example false, to be as default to avoid passing flase?
21:48:42FromGitter<Bennyelg> false*
21:49:02FromGitter<ephja> I dunno if anything is wrong on Windows. I'm going to try it on linux as well
21:49:53FromGitter<mratsim> @Bennyelg static[bool] = false, args with default value must be after all args without default
21:50:23FromGitter<mratsim> and you need Nim 0.17.2 or more, there was an issue fixed so that it’s allowed
21:50:24FromGitter<Bennyelg> I didn't get you Mamy,
21:50:32FromGitter<Bennyelg> I am using 0.17.2
21:51:03FromGitter<mratsim> proc foo(a: static[bool] = false): auto = ….
21:51:05*haha_ quit (Read error: Connection reset by peer)
21:51:22*couven92 quit (Ping timeout: 264 seconds)
21:51:37FromGitter<Bennyelg> not working, it said cant evaluate at compile time
21:51:58FromGitter<mratsim> what is the “a” you pass to it?
21:51:59*Arrrr quit (Quit: Leaving.)
21:52:10FromGitter<Bennyelg> bool
21:52:13*haha_ joined #nim
21:52:15FromGitter<Bennyelg> proc fetchOne*(cur; asTable: static[bool] = false): seq[string] | Table[string, string] =
21:52:20FromGitter<mratsim> yeah but when do you know it’s value?
21:52:35FromGitter<Bennyelg> before compilation thats for sure,
21:52:47FromGitter<Bennyelg> if I remove the false it's working but I have to pass it
21:52:53FromGitter<Bennyelg> on each function call
21:52:57FromGitter<mratsim> ah
21:53:00*azuri5 left #nim ("Leaving")
21:53:12FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bd9d481081499f1f3dbace]
21:53:36FromGitter<ephja> that might not work atm
21:53:59FromGitter<ephja> a lot of things involving static parameters or typedescs don't
21:54:15FromGitter<Bennyelg> :(
21:55:10FromGitter<mratsim> mmmh, the static param default value bugs I had are this (closed)https://github.com/nim-lang/Nim/issues/5864 and this (open) https://github.com/nim-lang/Nim/issues/6339
21:55:59FromGitter<mratsim> do a small test case and report it on the bug tracker, that would be quite helpful
21:59:18ipjkzacharycarter: thanks for the help yesterday. I picked it up again today, and I've seemed to have come forward.
22:04:08*couven92 joined #nim
22:04:23*couven92 quit (Remote host closed the connection)
22:07:28FromGitter<Bennyelg> @Yardanico I managed to do it, ⏎ https://github.com/Bennyelg/nimPresto/blob/tableCursorWIP/db_presto.nim ⏎ Not My best solution, but it works pretty nice, ⏎ Thanks , gn :) [https://gitter.im/nim-lang/Nim?at=59bda0a0210ac269203d613c]
22:10:28FromGitter<ephja> interesting addition to the `using` feature
22:10:41*Trustable quit (Remote host closed the connection)
22:16:05*dddddd quit (Ping timeout: 240 seconds)
22:27:02FromGitter<Yardanico> Well it was my idea to add it here :)
22:29:43shaiekxCan someone take a look at this: https://pastebin.com/kg80vrxm
22:29:59shaiekxBasically I want the openProc not to block new connections
22:30:13shaiekxbut still remain functionality of waitForExit is this possible?
22:30:36*zama quit (Remote host closed the connection)
22:32:00*Jesin joined #nim
22:34:44TjYocoI could be very wrong, so someone please advise. But, my first guess would be threading
22:35:36*haha_ quit (Quit: haha_)
22:36:08TjYocoimport threadpool, spawn openProc()?
22:38:04shaiekxThat does fix my problem amazing
22:38:21shaiekxBut I do wonder if this is _the_ way to do it
22:40:24*nsf quit (Quit: WeeChat 1.9)
22:43:39FromGitter<ephja> @Yardanico I dunno what is going on, if indeed one of your tests do fail when some assertion is wrong
22:46:43dom96shaiekx: no async support for osproc at the minute, so yeah, you do need to create a new thread.
22:54:56shaiekxAh.
22:55:20shaiekxThanks for the explanation dom96 and example TjYoco
22:56:01shaiekxWill there be async in the future for osproc and how much worse or better is using a thread?
22:59:02dom96There will likely be one, but it will actually use a thread behind the scenes.
23:09:03*endragor joined #nim
23:13:27*endragor quit (Ping timeout: 246 seconds)
23:37:36*def-pri-pub joined #nim
23:37:52def-pri-pubzacharycarter: If you're here, I'm stuck: https://github.com/zacharycarter/zengine/issues/41
23:44:54FromGitter<zacharycarter> def-pri-pub: i'll take a look in just a min
23:45:02FromGitter<zacharycarter> ipjk: np
23:45:49*PMunch quit (Quit: leaving)