00:06:48 | * | dom96 left #nim (#nim) |
00:06:48 | * | dom96 joined #nim |
00:13:17 | FromGitter | <zacharycarter> dungeon generator is getting there - https://imgur.com/a/LHnIb |
00:14:58 | * | endragor joined #nim |
00:15:41 | FromGitter | <mratsim> Soon, path of exile in Nim? ;) |
00:17:33 | FromGitter | <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:15 | FromGitter | <zacharycarter> https://imgur.com/a/cdiX7 |
01:04:38 | TjYoco | Planning 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:13 | FromGitter | <zacharycarter> nope |
01:38:43 | FromGitter | <zacharycarter> just making a library for generating roguelike maps |
01:39:01 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
01:39:02 | FromGitter | <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:41 | FromGitter | <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:54 | Araq | can 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:32 | FromGitter | <mratsim> Done, your suggestion works |
07:51:26 | Araq | PR ready? |
07:53:04 | Araq | also ... 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:18 | kobi7 | hello |
08:00:18 | Araq | hi |
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:37 | FromGitter | <mratsim> @Araq, where should I put the corresponding test? |
08:59:02 | Araq | tests/stdlib |
09:00:35 | FromGitter | <mratsim> tjsontestsuite? |
09:02:49 | kobi7 | hi Araq, is c2nim an actual translator or a binding generator? |
09:04:01 | Araq | both |
09:04:17 | FromGitter | <Bennyelg> Goood Monrinig. |
09:04:19 | kobi7 | what do you mean? |
09:04:21 | FromGitter | <Bennyelg> Morning * |
09:06:45 | kobi7 | what 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:08 | Araq | uh, 'malloc' is translated to 'malloc' why not try it out? |
09:08:08 | FromGitter | <Bennyelg> What should I look for in nim documentation to get information about all the {.borrow.} , {.pure.} {.inject.} values .. |
09:08:26 | Araq | already gave you links. |
09:08:53 | kobi7 | sorry 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:47 | Araq | don't "feel", install it and try it out |
09:10:42 | kobi7 | I did install it, just yesterday though, so no experience whatsoever yet. |
09:11:00 | kobi7 | the feel i mean - what stage and how mature things are |
09:15:56 | FromGitter | <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:26 | FromGitter | <mratsim> If you like building things from scratch you’re in luck |
09:17:20 | FromGitter | <mratsim> And you can always use bindings to C/C++/Obj-C/Javascript |
09:18:18 | kobi7 | thanks, 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:07 | kobi7 | mratsim: so those are the compiler targets or backends? |
09:19:52 | kobi7 | I assume I cannot mix them together in a single project. is that correct? |
09:20:02 | FromGitter | <mratsim> you can compile to each of those languages, then Nim call GCC/clang to generate machine code. |
09:20:58 | FromGitter | <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:06 | kobi7 | I've mostly used C# as a (working) programmer, but always liked the alternatives |
09:22:03 | kobi7 | I think, it must be easier to port from python, than to use js, higher quality libs, and much similar syntax/concepts |
09:22:08 | FromGitter | <mratsim> This repo: https://github.com/PMunch/nim-electron |
09:22:59 | FromGitter | <mratsim> Yes it is much easier to port Python code to Nim than JS to Nim |
09:23:21 | Araq | how can I see the changed caused by merged branches? |
09:24:11 | * | Yardanico joined #nim |
09:24:34 | FromGitter | <mratsim> Something like that? https://github.com/nim-lang/Nim/commit/28bdf0ac80ad4f44515874e03720c70156903f6b |
09:24:50 | Yardanico | hello everyone! |
09:24:56 | FromGitter | <mratsim> hey Yardanico |
09:25:48 | kobi7 | mratsim: is vscode as nim IDE a good choice? |
09:25:59 | FromGitter | <mratsim> the best actually |
09:26:01 | kobi7 | and thanks for all the useful answers |
09:26:25 | FromGitter | <mratsim> you’re welcome |
09:26:36 | * | haha_ joined #nim |
09:26:52 | kobi7 | cool. I thought it required something like a language server, or something like that |
09:27:11 | Yardanico | kobi7, yes it does |
09:27:22 | Yardanico | nim has it's own "language server" - nimsuggest |
09:27:31 | Yardanico | and vscode nim extension uses it |
09:27:37 | Yardanico | so you get autocompletion |
09:27:37 | kobi7 | cool. i'm very new to the scene :-) |
09:28:20 | Yardanico | I don't know about other languages, but "nimsuggest" uses compiler, so it can resolve very complicated stuff like macros/templates/custom operators |
09:28:26 | FromGitter | <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:38 | kobi7 | Are 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:56 | Yardanico | kobi7, well it would require to write more platform-specific code |
09:30:05 | Yardanico | and I think C/C++ and JS is enough today :) |
09:30:16 | FromGitter | <mratsim> There was PHP xD |
09:30:20 | Yardanico | it's still here |
09:30:48 | Yardanico | but it isn't a "serious" backend right now |
09:30:52 | kobi7 | they also have php, and python, and neko |
09:31:02 | kobi7 | php was never serious ;-) |
09:31:09 | Yardanico | kobi7, what's the point? |
09:31:17 | Yardanico | anyway you gonna write tons of language-specific code |
09:31:17 | FromGitter | <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:48 | kobi7 | for example, mobile apps from the same codebase |
09:31:49 | FromGitter | <mratsim> I’d rather have Nim—> LLVM IR backend |
09:31:50 | Araq | marsim: obviously not since it fails. files starting with 't' are run as tests |
09:32:00 | Yardanico | mratsim: it's already here |
09:32:01 | Araq | you need to rename the module |
09:32:05 | Yardanico | https://github.com/arnetheduck/nlvm |
09:32:18 | Yardanico | but it doesn't have threads, stack traces, debug info |
09:32:27 | Yardanico | but it already passes ~90% of tests |
09:32:38 | FromGitter | <mratsim> @Araq, yes it fails, I did the test before doing the fix to make sure the test is correct ;) |
09:33:30 | kobi7 | were there attempts on a mobile app using nim? |
09:33:36 | Yardanico | kobi7, you can do that already |
09:33:44 | * | Matthias247 quit (Read error: Connection reset by peer) |
09:33:55 | kobi7 | oh, i thought android required java code |
09:34:00 | Yardanico | for example, https://github.com/yglukhov/nimx is cross-platform GUI written in Nim (it uses SDL) |
09:34:19 | Yardanico | kobi7, well you would have some boilerplate in java |
09:34:30 | Yardanico | kobi7, https://github.com/yglukhov/nim-sdl-template |
09:34:30 | kobi7 | looks super cool |
09:34:44 | kobi7 | I see. |
09:36:05 | kobi7 | Can nim be suitable for embedded? (assume GC is fine) |
09:36:22 | Yardanico | kobi7, yes |
09:36:34 | Yardanico | nim also has region-based GC which is useful for embedded |
09:36:57 | Yardanico | kobi7, don't forget than the most supported nim backend - C |
09:37:03 | Araq | er actually that thing is still in development and not in good shape |
09:37:12 | Araq | I mean the region-based MM. |
09:37:13 | FromGitter | <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:35 | Yardanico | mratsim: I'm pretty sure someone have already tried it :) |
09:37:53 | * | Matthias247 joined #nim |
09:38:09 | kobi7 | very nice. Was nim used for some ambitious projects? (aside from the compiler, i mean) |
09:39:55 | FromGitter | <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:18 | Yardanico | well there's bigger projects too AFAIK |
09:40:48 | kobi7 | Is 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:30 | kobi7 | I mean the projects you mentioned |
09:41:32 | FromGitter | <k0pernicus> @mratsim Interesting - I plan to use Nim later for NLP and statiscal ML |
09:41:36 | kobi7 | it's hard to sustain otherwise... |
09:41:45 | FromGitter | <k0pernicus> Statistical* |
09:42:00 | Araq | kobi7: some are paid, some are not |
09:42:22 | Araq | fyi it's 'git log -m -p file' |
09:42:47 | kobi7 | I hope those who are not, don't get burned out by the volunteer effort |
09:43:32 | Yardanico | kobi7, 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:34 | kobi7 | there are now platforms like patreon, where the "crowd" can donate/fund |
09:43:40 | Yardanico | yes, there's for nim |
09:43:45 | arnetheduck | nlvm has debug info |
09:43:52 | Yardanico | arnetheduck, ah, sorry, README said it didn't :) |
09:44:02 | Yardanico | kobi7, https://salt.bountysource.com/teams/nim |
09:44:02 | arnetheduck | it's more recent than the readme ;) |
09:44:17 | FromGitter | <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:27 | kobi7 | Yardanico: maintaining a library is hard work |
09:44:38 | Yardanico | kobi7, well not that hard |
09:44:47 | Yardanico | I mean big library - maybe |
09:44:54 | Yardanico | but with nim it can be easier sometimes :) |
09:45:04 | kobi7 | I guess it depends - i mean from the time you spend on it, requests of users, etc. |
09:45:45 | kobi7 | I think open source doesn't have to be serving others without any compensation |
09:45:53 | FromGitter | <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:35 | kobi7 | Yardanico: what do you use for gui (desktop) programs? wxwindows, IUP ? |
09:46:55 | Yardanico | kobi7, well I don't develop gui programs :) |
09:46:58 | Yardanico | hmm, code snippet in crystal lang: https://gist.github.com/Yardanico/ea76f6c6fe2e048a7537aa95317d281f |
09:47:06 | kobi7 | heh |
09:48:18 | kobi7 | crystal? sounds like a drug. is that the ruby compiler thing? |
09:48:29 | kobi7 | :-) |
09:48:38 | Yardanico | well yeah, a language with ruby-like syntax |
09:48:43 | Yardanico | I don't use it, just saw this snippet |
09:48:45 | * | haha_ quit (Read error: Connection reset by peer) |
09:49:16 | kobi7 | tbh the old name (nimrod) has some bad connotations where I live |
09:49:26 | Yardanico | kobi7, yeah, that's why it was renamed to Nim |
09:49:47 | * | haha_ joined #nim |
09:49:53 | Yardanico | And 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:19 | FromGitter | <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:06 | Yardanico | and metaprogramming :) |
09:56:23 | Yardanico | so for example you can create sync/async procedures with {.multisync.} pragma from AsyncDispatch |
09:57:02 | FromGitter | <mratsim> Oh, and generics mean less code duplication (looking at you Rust and C) |
09:57:27 | kobi7 | yes, the language itself looks very good to me |
09:57:33 | Yardanico | mratsim: rust has generics :) |
09:57:42 | FromGitter | <mratsim> I guess the only concurrence from that is Haskell :? |
09:57:45 | Yardanico | but IDK if they're better than Nim generics or not |
09:58:12 | * | Matthias247 quit (Read error: Connection reset by peer) |
09:59:16 | kobi7 | when 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:29 | FromGitter | <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:15 | Yardanico | kobi7, well nim compiler is pretty fast, and maybe someone will fix incremental compilation in the future :) |
10:03:42 | Yardanico | mratsim: it seems there's a third party package for that |
10:03:49 | Yardanico | https://github.com/fizyk20/generic-array |
10:04:19 | kobi7 | in terms of object oriented, does nim have the concept of interface ? |
10:04:33 | Yardanico | kobi7, it doesn't have interface, but it has concepts :) |
10:04:39 | Yardanico | but they are very different things |
10:04:58 | kobi7 | heh, that's the name? concept? |
10:05:01 | Yardanico | probably you'll able to use concepts like interfaces when vtref concepts will be implemented |
10:05:10 | Yardanico | kobi7, yeah, but they're only a compile-time thing now |
10:05:17 | Araq | an interface is just use a tuple of closures, I dunno why it's so hard to understand |
10:06:44 | Araq | could use a macro to make it more convient to use |
10:06:49 | kobi7 | some languages have them by name, others match by their structure |
10:06:56 | * | endragor joined #nim |
10:07:14 | kobi7 | I don't use inheritance much but I like traits |
10:07:36 | kobi7 | and structural matching is a good feature imho |
10:08:22 | kobi7 | i'll read some about 'concepts' - sounds original :) |
10:08:41 | Yardanico | kobi7, https://nim-lang.org/docs/manual.html#generics-concepts |
10:13:30 | FromGitter | <mratsim> I think there should be a module in stdlib called interface, and done :P |
10:14:54 | kobi7 | thanks |
10:15:20 | Araq | mratsim: do you volunteer? |
10:16:08 | FromGitter | <mratsim> I have my plate full already :P, and I don’t use OO, interfaces, etc. |
10:16:31 | kobi7 | Araq: can I understand concepts as type invariants or is it more like structural typing? |
10:17:50 | kobi7 | sorry gtg |
10:17:57 | kobi7 | see you and thank you for all the info |
10:18:12 | * | kobi7 quit (Quit: Leaving) |
10:21:19 | FromGitter | <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:33 | FromGitter | <mratsim> If you use array with len bigger than 32 you have to implement everything yourself |
10:21:46 | Yardanico | well 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:34 | FromGitter | <Bennyelg> @Yardanico If Im creating distinct string, and querying SqlQuery("query") how I can call also sql"query" |
10:58:55 | FromGitter | <Bennyelg> @Yardanico I want to create this implementation to avoid Sql Injection of course. |
11:00:55 | FromGitter | <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:13 | Araq | Bennyelg: that's what the other db modules use, yes |
11:41:13 | FromGitter | <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:47 | PMunch | Hmm, I'm trying to set up a simple build environment for Nim in a Windows VM and I'm having some trouble |
12:30:55 | PMunch | I ran the finish.exe program as stated, but after a window flashed by nothing more happened.. |
12:31:54 | PMunch | And I just realised that koch is the german word for chef :P |
12:32:18 | PMunch | After seeing the chefs hat icon :P |
12:32:59 | * | endragor_ quit (Remote host closed the connection) |
12:42:29 | PMunch | Ah, the installation for Windows is a binary distribution :P |
12:42:36 | PMunch | That 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:17 | forcefaction | hello there, how do you convert a BiggestInt to a string ? |
12:46:09 | PMunch | $ |
12:46:24 | PMunch | $ is the general "to string" proc in Nim |
12:46:32 | PMunch | So if you need a string of something use $ |
12:47:09 | PMunch | So "var x:BiggestInt = 5; echo $x" |
12:48:03 | forcefaction | thank you, good to know :DD |
12:52:54 | PMunch | Hmm, now I'm getting plenty of "size of array 'Nim_and_C_compiler_disagree_on_target_architecture' is negative" errors |
12:53:07 | PMunch | I 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:58 | PMunch | Aha, 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:54 | PMunch | Is MinGW for 32bit only? |
13:16:13 | Yardanico | PMunch, no |
13:16:22 | Yardanico | PMunch, https://sourceforge.net/projects/mingw-w64/ |
13:16:26 | Yardanico | "MinGW-w64 - for 32 and 64 bit Windows" |
13:16:39 | PMunch | Oh, it's a different install not linked from their site? |
13:16:43 | Yardanico | PMunch, yeah |
13:16:55 | Yardanico | this mingw is better probably |
13:17:03 | Yardanico | you can install mingw with gcc 7.1.0 |
13:17:04 | PMunch | I 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:18 | Araq | PMunch: https://nim-lang.org/install_windows.html |
13:29:26 | Araq | The following versions of MingW are known to work with the latest version of Nim. |
13:29:26 | Araq | 32 bit - mingw32-6.3.0.7z |
13:29:26 | Araq | 64 bit - mingw64-6.3.0.7z |
13:30:21 | PMunch | Aha, that would probably have been a better way to get MinGW -__ |
13:30:52 | Araq | there is a reason we provide it for you ;-) |
13:31:05 | Araq | mingw got worse and worse to install |
13:31:21 | Yardanico | well mingw-w64 was very easy to install |
13:31:34 | Araq | Yardanico: from which site? |
13:31:41 | Araq | I tried lots of. |
13:31:53 | Yardanico | Araq, https://sourceforge.net/projects/mingw-w64/files/?source=navbar online installer here |
13:32:04 | Araq | oh that online installer, spare me |
13:32:04 | Yardanico | ah sorry wrong link |
13:32:39 | Araq | PMunch: finish.exe can download for you too |
13:32:51 | Araq | in fact, it can fixup your configuration |
13:33:23 | PMunch | Finish didn't seem to do anything |
13:33:31 | PMunch | I ran it but it just flashed a window |
13:33:48 | PMunch | When launched from the terminal it just showed me a Nim error message about a file not being found |
13:33:55 | PMunch | IIRC |
13:36:27 | * | Trustable quit (Remote host closed the connection) |
13:39:16 | Araq | never heard this one before |
13:39:29 | Araq | can you run it in a terminal and report the error? |
13:40:44 | PMunch | Working on it |
13:40:55 | PMunch | But this emulated Windows is pure pain.. |
13:41:15 | PMunch | Right now I'm fighting Edge to let me paste something into pastebin.. |
13:41:29 | Yardanico | use gist :P |
13:41:44 | PMunch | Then I have to log in don't I? |
13:41:49 | Yardanico | you don't |
13:41:53 | Yardanico | or wait |
13:42:01 | Yardanico | yeah |
13:42:04 | Yardanico | you can post anonymous gist |
13:42:08 | PMunch | pastebin.com/ahvhk4vK |
13:42:14 | PMunch | That should be the right URL |
13:42:27 | Yardanico | PMunch, https://gist.github.com/anonymous/a08cd703168b771ee2270627b1b616b3 |
13:42:53 | Yardanico | I've posted it from incognito mode in browser |
13:46:24 | Araq | PMunch: most interesting, it means you have no user specific PATH environment variable |
13:46:41 | PMunch | Huh |
13:46:50 | Araq | finish.exe should work anyway but I guess my fix wasn't good enough |
13:46:53 | PMunch | In system settings I can see a "Path" variable |
13:47:00 | PMunch | But no "PATH" |
13:47:07 | Araq | *user* specific path? |
13:47:22 | PMunch | Oh, not sure how that works on Windows.. |
13:47:31 | Araq | not the global one, we can't modify that without admin rights ;-) |
13:48:10 | Araq | install this please https://www.rapidee.com/en/about |
13:48:55 | PMunch | Added an empty "PATH" variable to my user config, and it works now |
13:49:09 | Araq | of course it does, I told you. |
13:49:11 | Araq | :P |
13:49:19 | PMunch | But I get another error "libiconv-2.dll is missing". |
13:49:34 | PMunch | From cc1.exe |
13:49:41 | PMunch | In a visual pop-up |
13:50:16 | PMunch | Oh wow, there were many more of them |
13:56:31 | PMunch | Hmm, 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:46 | PMunch | Probably something to do with SDL2 though.. |
14:00:03 | Yardanico | SDL2 dlls ? :) |
14:00:10 | Yardanico | run your app from console to see the error |
14:00:31 | PMunch | Tried that first |
14:00:39 | PMunch | Didn't give me any output at all |
14:01:06 | Yardanico | don't compile it with --app:gui |
14:01:14 | PMunch | I didn't |
14:02:19 | PMunch | I 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:45 | PMunch | Hmm, the error seems to be something to do with 32/64 bit version errors... |
14:26:38 | PMunch | I'm starting to think if it wouldn't be easier to cross compile.. |
14:39:09 | FromGitter | <edubart> what is a quick way to sum two seq[int] of the same size element-wise ? |
14:40:36 | PMunch | edubart, a loop? |
14:40:38 | FromGitter | <edubart> I think sequtils misses a map2 proc to apply a function to two seqs and return a new seq as result |
14:40:52 | PMunch | Maybe have a look at nimfp |
14:41:02 | FromGitter | <edubart> I wanted one liner |
14:43:08 | Yardanico | use zip and map? |
14:44:14 | Yardanico | edubart: zip(a, b).mapIt(it[0] + it[1]) if you have two seqs - "a" and "b" |
14:44:22 | Yardanico | and you need to import "sequtils" |
14:44:41 | FromGitter | <edubart> hmm that should work |
14:45:06 | Yardanico | and as you see you don't need any typing here :) |
14:45:41 | Yardanico | https://play.nim-lang.org/?gist=0daefb14e1dbadf582a4062bc5975f56 |
14:46:43 | FromGitter | <edubart> that's odd, I was unaware of that kind of magic, no need to declare the "it" |
14:46:51 | Yardanico | well it's not a magic |
14:46:56 | Yardanico | it's an injected variable |
14:47:01 | Yardanico | it uses metaprogramming :) |
14:47:19 | Yardanico | edubart: it's not even a macro, just a template |
14:47:20 | Yardanico | https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/sequtils.nim#L604 |
14:47:42 | PMunch | Well would you look at that, cross-compile was a breeze.. |
14:48:03 | FromGitter | <edubart> cool |
14:48:09 | Yardanico | and this template isn't much complicated |
15:01:05 | FromGitter | <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:13 | Araq | PMunch: you need to setup your PATH for gcc too then, finish can do it for you |
15:03:31 | Araq | edubart: math.sum exists iirc |
15:03:44 | PMunch | Araq, I had GCC working fine |
15:03:51 | PMunch | It was the compiled output that was failing |
15:03:59 | PMunch | But cross compiling solved the entire problem :) |
15:04:35 | Yardanico | Araq, afaik "sum" wouldn't work with two seqs |
15:04:45 | Yardanico | ah |
15:04:46 | Yardanico | yeah, sorry |
15:04:52 | Yardanico | sum(seq1) + sum(seq2) lol |
15:05:12 | Araq | Yardanico: lib/pure/stats.nim ? often overlooked |
15:05:13 | * | endragor joined #nim |
15:05:15 | Araq | but it's awesome |
15:05:36 | Yardanico | Araq, I've never heard about this module in nim stdlib before :P |
15:06:08 | Araq | gives you sum, average etc with O(1) storage requirements |
15:06:10 | FromGitter | <mratsim> I think the point was zip(a, b).mapIt(it[0] ``op`` it[1]) |
15:06:24 | Yardanico | well with math.sum it's much simpler |
15:06:28 | Yardanico | sum(a) + sum(b) |
15:06:45 | Araq | true for this case |
15:06:49 | FromGitter | <mratsim> op being an user defined function |
15:06:52 | Araq | but stats.nim is more powerful |
15:09:57 | FromGitter | <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:56 | Yardanico | it seems https://github.com/jlp765 is the author :) |
15:13:15 | Yardanico | cool 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:48 | Arrrr | "prepared stdlb for new integer arithmetic rules" [fear intensifies] |
15:26:18 | * | ipjk joined #nim |
15:29:34 | FromGitter | <mratsim> 1 + 1 = 3? |
15:29:48 | Yardanico | noo |
15:32:27 | obadz | @mratsim: is there not a way to tell nimble where to find its dependencies and where to install its output? |
15:33:10 | FromGitter | <mratsim> why do you need to tell nimble where to find dependencies? |
15:34:23 | FromGitter | <mratsim> if you want to ask nimble to download directly for github there is indeed an option for that |
15:34:31 | FromGitter | <mratsim> from* |
15:38:09 | Yardanico | who is the author of arch linux nim package ? :) |
15:38:10 | Araq | Arrrr: x mod 3 does not produce range[0..2] anymore |
15:42:29 | Yardanico | Araq, is "CC = concept c of CB" allowed ? |
15:43:23 | Araq | no, just call the concept like 'x is CB' |
15:43:38 | Araq | CC = concept c\n c is CB |
15:43:48 | Yardanico | ok, then this is indeed a bug :) |
15:48:48 | Araq | well zahary planned this feature, is it implemented already? |
15:49:34 | Yardanico | Araq, https://github.com/nim-lang/Nim/issues/6390 |
15:50:21 | Yardanico | maybe "of CB" is just ignored |
15:50:25 | Yardanico | and concept is matched to any type? |
15:51:14 | * | scriptum joined #nim |
15:55:04 | * | salewski joined #nim |
15:56:33 | salewski | Araq, should cstring(nil) not be nil? (six lines of code follows...) |
15:56:40 | salewski | var |
15:56:47 | salewski | s: string = nil |
15:56:53 | salewski | cs: cstring |
15:56:59 | salewski | cs = cstring(s) |
15:57:06 | salewski | s: string = nil |
15:57:13 | salewski | echo cs # crash |
15:57:17 | salewski | #done |
15:57:43 | Araq | cstring(nil) is not the same as cstring(string_of_value_nil) |
15:58:06 | Araq | but this is work in progress, I'm removing nil from strings/seqs anyway |
15:58:21 | salewski | I know, so I posted the example. |
15:58:32 | * | RPG joined #nim |
15:58:45 | Araq | so ...? you think I'm unaware of this behaviour? |
15:58:56 | * | RPG is now known as Guest89124 |
15:59:24 | salewski | So I shall not post an issue to github issue tracker? |
15:59:52 | salewski | (A user of gintro observed this, I can fix it easily...) |
16:00:38 | Yardanico | salewski, maybe something like this? https://github.com/nim-lang/Nim/issues/1577 |
16:00:47 | Yardanico | well it's related |
16:00:58 | * | scriptum quit (Ping timeout: 264 seconds) |
16:01:17 | * | relax joined #nim |
16:01:47 | salewski | Oh, removing nil can be a problem! Nil and empty string is very different, not only in GTK. |
16:02:25 | Yardanico | well but there would be less SIGSEGVs in pure nim code ? :) |
16:02:40 | salewski | For example gtk_frame_new() nil as string arguments that we want no label, that is different from empty string "". |
16:03:20 | Araq | salewski: we can have a conversion from Option[string] to cstring then |
16:03:22 | Yardanico | also I think making seqs and strings not nil by default would make it easier to finish "not nil" ? |
16:03:31 | Araq | and options in general need better support in Nim |
16:03:48 | Araq | Yardanico: 'not nil' is also affected, sure |
16:04:22 | salewski | OK. |
16:05:47 | * | solitudesf quit (Remote host closed the connection) |
16:07:27 | * | relax quit (Ping timeout: 248 seconds) |
16:09:14 | FromGitter | <Bennyelg> Why the "Return" word is optional :| |
16:09:21 | FromGitter | <Bennyelg> so confusing. |
16:10:06 | Yardanico | well it's not confusing :) |
16:10:15 | FromGitter | <ephja> a lot of things are, if you're new |
16:10:27 | Yardanico | well yeah |
16:10:28 | FromGitter | <Bennyelg> Yea :D |
16:10:41 | FromGitter | <Bennyelg> Is this a valid return from proc ? seq[seq[string]] | seq[Table[string, string]] |
16:10:50 | FromGitter | <Bennyelg> I can do that right ? :D |
16:10:55 | Yardanico | ehm |
16:11:01 | Yardanico | only if your proc is generic |
16:11:09 | FromGitter | <Bennyelg> oh |
16:11:11 | FromGitter | <Bennyelg> I see |
16:11:18 | Yardanico | why do you want it? |
16:11:36 | Yardanico | just 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:28 | TjYoco | @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:54 | def-pri-pub | zacharycarter: waz up? |
16:52:17 | * | relax quit (Ping timeout: 248 seconds) |
17:05:44 | miran | quick 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:03 | Arrrr | I 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:40 | miran | Arrrr: 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:30 | Arrrr | I 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:45 | miran | good idea, thanks |
17:15:25 | FromGitter | <zacharycarter> def-pri-pub: hey |
17:15:41 | FromGitter | <zacharycarter> TjYoco: good question, I'm leaning towards c lib binding probably |
17:15:45 | FromGitter | <zacharycarter> https://imgur.com/a/alwAx |
17:16:26 | FromGitter | <zacharycarter> unless someone wants to write a physics engine in Nim in which case I'd gladly use a pure Nim one |
17:17:55 | Araq | miran: 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:30 | Yardanico | Araq, was there any discussions about adding something like python "with" to nim? |
17:21:46 | * | relax joined #nim |
17:21:55 | obadz | Yardanico: seems like that should be doable with a macro? |
17:22:06 | Araq | Yardanico: that's just a template |
17:22:10 | Yardanico | ah, yes, sorry :) |
17:22:19 | Yardanico | but maybe add it to system.nim ? :) |
17:22:44 | Araq | not system.nim. |
17:22:51 | Yardanico | future? |
17:23:11 | Araq | no. |
17:23:26 | Araq | "extensions.nim" ? dunno |
17:23:40 | Yardanico | yeah, and we can add other stuff like oop macro to it :D |
17:23:59 | Araq | and an 'interface' macro |
17:24:04 | Yardanico | yeah |
17:24:17 | Yardanico | hmm, is there any difference between "yes" and "yeah" ? |
17:24:27 | Araq | no. |
17:24:35 | Araq | nah. |
17:24:40 | * | def-pri-pub quit (Ping timeout: 255 seconds) |
17:24:42 | Yardanico | ok :P |
17:25:29 | Yardanico | oh wait, "with" is a keyword? |
17:26:25 | * | def-pri-pub joined #nim |
17:27:10 | Arrrr | what is `with` ? |
17:27:38 | Yardanico | Arrrr, context manager in python |
17:27:41 | Yardanico | and reserved keyword in nim |
17:27:52 | Arrrr | what does it do in python? |
17:28:15 | Araq | Yardanico: open/close are unnatural words for locks so I think withLock / withStream is better for Nim |
17:28:54 | Araq | 'with' and 'without' are keywords but are currently unused |
17:29:06 | Araq | we could remove them again from the language |
17:29:12 | Yardanico | again? |
17:29:19 | Yardanico | e.g. they was removed and added again? |
17:29:28 | FromGitter | <ephja> are destructors not enough? |
17:29:32 | Araq | well 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:05 | Yardanico | well python has special __exit__ and __enter__ methods for "with" statement |
17:32:53 | * | def-pri-pub joined #nim |
17:33:13 | obadz | $ nimble tasks |
17:33:16 | obadz | SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
17:33:23 | Yardanico | lol |
17:33:32 | Yardanico | report it |
17:33:33 | Araq | Yardanico: oh right, these fit better |
17:35:48 | * | Jesin quit (Quit: Leaving) |
17:36:21 | Yardanico | github is very confused about syntax highlighting with braces syntax :P https://github.com/nim-lang/Nim/blob/a94a0f27f2252e06427364665e1cbb9a6bce5af7/tests/parser/tbraces.nim |
17:36:49 | Yardanico | oh wow |
17:37:00 | Yardanico | "concept" is used only once in whole nim stdlib |
17:37:14 | Yardanico | in jsffi |
17:37:20 | FromGitter | <ephja> care to work on a container interface? ;9 |
17:37:25 | FromGitter | <ephja> ;) |
17:37:28 | * | Jesin joined #nim |
17:38:46 | FromGitter | <ephja> I'd like to provide abstractions over C libs with minimal overhead |
17:39:49 | Yardanico | well 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:56 | Yardanico | I mean general low-level stuff |
17:41:51 | * | gangstacat quit (Quit: Ĝis!) |
17:43:33 | * | yglukhov quit (Remote host closed the connection) |
17:43:51 | Yardanico | nim 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:38 | FromGitter | <ephja> so someone else has already made a PR for iterating over enums with holes etc |
17:46:27 | FromGitter | <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:36 | FromGitter | <ephja> hm what to work on now |
17:52:20 | FromGitter | <mratsim> I have suggestions :p |
17:52:50 | * | couven92 quit (Remote host closed the connection) |
17:53:12 | FromGitter | <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:01 | Yardanico | let me check |
17:54:24 | Yardanico | yes |
17:54:34 | Yardanico | vscode + nim extension (it uses nimsuggest) works |
17:54:38 | FromGitter | <ephja> huge parts of the compiler code relies on includes |
17:54:54 | Yardanico | well nimsuggest doesn't play well with compiler |
17:54:57 | FromGitter | <ephja> Yardanico: I don't think it works at all with included files for me |
17:55:03 | Yardanico | hmm, strange |
17:55:22 | FromGitter | <ephja> I think it got even more broken when I updated nimsuggest |
17:55:31 | Yardanico | very strange |
17:56:12 | FromGitter | <mratsim> It works only once I have compiled at least once |
17:56:15 | Yardanico | well it really works for me |
17:56:25 | * | endragor joined #nim |
17:56:41 | Yardanico | nimsuggest can crash sometimes if you use it at compiler files :) |
17:56:51 | Yardanico | but mostly it works too |
17:59:38 | FromGitter | <ephja> I'll try to build the compiler then |
18:00:09 | FromGitter | <ephja> Yardanico: how do you check if it has crashed? |
18:00:21 | Yardanico | well |
18:00:40 | Yardanico | firstly - if all my RAM is taken by Nimsuggest (but this isn't techically a crash) |
18:00:58 | FromGitter | <ephja> oh. yeah I know about the leaks |
18:01:25 | Yardanico | secondly - if vscode shows <Error type> if you hover some type |
18:01:29 | Yardanico | and the best way |
18:02:04 | FromGitter | <ephja> I can often find what I want by grepping though |
18:02:23 | Yardanico | ctrl+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:26 | Yardanico | in vscode |
18:03:12 | Yardanico | https://i.snag.gy/wsUqcu.jpg |
18:03:16 | FromGitter | <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:11 | TjYoco | @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:39 | FromGitter | <zacharycarter> that'd be awesome! |
18:11:52 | FromGitter | <zacharycarter> keeping my fingers crossed |
18:11:55 | FromGitter | <zacharycarter> :) |
18:14:21 | TjYoco | @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:32 | FromGitter | <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:43 | FromGitter | <zacharycarter> I'd be fine with a generic one |
18:14:55 | FromGitter | <zacharycarter> thing is TjYoco - zengine is going to need both a 3d and 2d engine |
18:15:49 | FromGitter | <zacharycarter> but I mean even if it was just 2d or 3d that'd be fine too |
18:15:54 | FromGitter | <zacharycarter> can always supplement it with a C engine |
18:16:04 | TjYoco | @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:09 | Yardanico | Araq, 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:53 | Yardanico | or 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:55 | FromGitter | <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:34 | Yardanico | Smaehtin: https://forum.nim-lang.org/t/3154 |
18:22:45 | Yardanico | python-like import: from foo as f import nil |
18:22:57 | Yardanico | e.g. "import foo as f" in python - "from foo as f import nil" |
18:23:31 | FromGitter | <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:13 | FromGitter | <ephja> should the iterator interface look anything like the one for D? I dunno how much different you can make it |
18:29:40 | Araq | Yardanico: yes, please do that |
18:29:54 | Yardanico | so "talgsort" ? |
18:33:37 | * | rokups quit (Quit: Connection closed for inactivity) |
18:36:24 | Yardanico | https://github.com/nim-lang/Nim/pull/6391 |
18:38:17 | Yardanico | oh, and also I should add a test-case for https://github.com/nim-lang/Nim/issues/6086 ? |
18:38:40 | Yardanico | well it's the same thing - str handling in VM |
18:41:16 | couven92 | Araq, 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:20 | FromGitter | <Bennyelg> How Can I generate seq depends of the input of the proc ? |
18:42:38 | Yardanico | one sec |
18:42:46 | Araq | Yardanico: no, tvmmisc is fine |
18:42:53 | Yardanico | Araq, ah, sorry then :) |
18:42:58 | Yardanico | Araq, should I also add https://github.com/nim-lang/Nim/issues/6086 ? |
18:43:23 | Araq | couven92: that's currently the best way to do it |
18:43:46 | Araq | Yardanico: yep |
18:45:14 | Arrrr | Do destructors actually work? from the manual "Be aware that destructors are not called for objects allocated with new." |
18:51:37 | Araq | they do not |
18:51:40 | Yardanico | Araq, maybe also add https://github.com/nim-lang/Nim/issues/6083 ? :P |
18:56:00 | Araq | sure |
19:01:43 | * | endragor quit (Remote host closed the connection) |
19:02:18 | * | endragor joined #nim |
19:03:59 | Yardanico | Araq, https://github.com/nim-lang/Nim/pull/6392 |
19:06:58 | * | endragor quit (Ping timeout: 264 seconds) |
19:17:42 | Yardanico | Araq, also, how can I understand if I should make a test-case for issue or not? |
19:18:54 | Araq | look at the bugfix, if the chance of a regression are slim a test would only consume energy |
19:19:59 | Yardanico | Araq, well sometimes there's no bugfix - e.g. some issues from a year ago with no comments, which compile fine in devel |
19:22:18 | Yardanico | https://github.com/nim-lang/Nim/issues/4749 :) |
19:29:50 | FromGitter | <superfunc> @Yardanico 3 bugs one fix, now thats efficiency :) |
19:30:02 | Yardanico | one "fix" :) |
19:30:13 | Yardanico | e.g. they all are fixed by another PR, I just added test-cases |
19:30:53 | FromGitter | <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:59 | FromGitter | <Bennyelg> https://gist.github.com/6dc4a9ab83a0913586a4476ec46d5ea7 |
19:49:11 | FromGitter | <Bennyelg> how to make this thing work |
19:54:02 | yglukhov | Bennyelg: s/if/when |
19:54:24 | FromGitter | <Bennyelg> change the if to when ? |
19:54:49 | yglukhov | Bennyelg: and line 7 is wrong. for seq[seq[...]] the literal should be @[@[...]] |
19:54:58 | yglukhov | change the if to when - yup |
19:55:24 | FromGitter | <Bennyelg> as I expected : in.nim(4, 10) Error: cannot evaluate at compile time: c |
19:55:41 | Yardanico | your boolean should be known at compile-time |
19:55:47 | yglukhov | oh, actually sorry, your sample is wrong. |
19:56:03 | yglukhov | what are you trying to achieve? |
19:56:42 | FromGitter | <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:04 | Yardanico | write two procs? |
19:57:43 | FromGitter | <Bennyelg> I want to achieve this if The user pass the useCursor: true |
19:58:22 | FromGitter | <Bennyelg> well, Another cursor with different signature? but It depends on the fetchAll, fetchMany fetchOne which all return seq[sqe[string]] |
19:58:26 | yglukhov | Bennyelg: ok, then just use static[bool] as an argument type |
19:58:45 | yglukhov | and branch on it with `when` stmt |
19:58:49 | Yardanico | yeah, and useCursor should be known at compile-time |
19:59:41 | yglukhov | Bennyelg: but that just doesn't right conceptually... |
19:59:46 | FromGitter | <Bennyelg> yea it's known when compile time, I just wondring How I modify everything |
19:59:50 | FromGitter | <Bennyelg> Yea |
19:59:50 | yglukhov | * doesnt sound right |
19:59:59 | Yardanico | yeah, why do you really want a table? |
20:00:04 | FromGitter | <Bennyelg> I am wondering what to do |
20:00:07 | FromGitter | <Bennyelg> I'll Explain |
20:00:17 | FromGitter | <Bennyelg> Assuming the user is creating this: ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59bd82d1614889d475078ded] |
20:01:42 | * | nsf joined #nim |
20:02:16 | FromGitter | <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:35 | yglukhov | Bennyelg: You would likely want to have 2 cursor types then, and two procs `seqCursor` and `tableCursor` instead of `cursor`. |
20:04:53 | FromGitter | <Bennyelg> mmm, maybe |
20:05:12 | FromGitter | <Bennyelg> I still wondering because in python you can just pass the argument and return what ever you want :D |
20:05:14 | FromGitter | <Bennyelg> hehehe |
20:05:24 | FromGitter | <Yardanico> python is dynamically typed |
20:05:27 | FromGitter | <Yardanico> and nim is statically typed |
20:06:05 | yglukhov | i mean, nim surely allows the static[bool] way of doing things, but your API will not be obvious then. |
20:06:16 | FromGitter | <Bennyelg> Yea |
20:06:16 | * | endragor joined #nim |
20:06:22 | FromGitter | <Bennyelg> I'll create 2 diff of cursors |
20:06:26 | FromGitter | <Bennyelg> this will resolve my issues |
20:07:33 | * | haha_ quit (Quit: haha_) |
20:10:04 | yglukhov | Bennyelg: 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:58 | FromGitter | <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:32 | FromGitter | <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:52 | FromGitter | <mratsim> in the end I just decided to have 2 procs |
20:28:40 | * | couven92 joined #nim |
20:36:11 | FromGitter | <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:27 | FromGitter | <zacharycarter> https://imgur.com/a/CFAKM |
20:57:30 | FromGitter | <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:36 | FromGitter | <Bennyelg> @mratsim checking, thanks |
21:20:23 | FromGitter | <ephja> I have no idea how to make asserts work with the tester |
21:21:01 | Yardanico | ehm? |
21:21:28 | Yardanico | ephja: it seems they work? https://github.com/nim-lang/Nim/commit/ae7fe5087f3e4f6ddc572254ae3ddcc8324099f1 |
21:21:59 | FromGitter | <Bennyelg> 3 questions: ⏎ what does ⏎ typedesc, static, auto means |
21:22:26 | FromGitter | <Yardanico> you don't need typedesc and auto :) |
21:22:37 | FromGitter | <Yardanico> typedesc - "type description", type itself |
21:22:57 | FromGitter | <Yardanico> "auto" - compiler automatically tries to understand which type you want to write |
21:23:14 | FromGitter | <Bennyelg> I c, thanks :)) |
21:23:17 | FromGitter | <Yardanico> like type inference, but also in proc arguments and return type |
21:23:27 | FromGitter | <Yardanico> static - variable must be known at compile time IIRC |
21:23:30 | FromGitter | <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:10 | FromGitter | <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:24 | FromGitter | <superfunc> `s` takes any type `T` such that the `T` satisfies the constraint `someX` |
21:24:28 | * | haha_ joined #nim |
21:24:38 | FromGitter | <Bennyelg> great! |
21:24:43 | FromGitter | <Bennyelg> and one last stupid question |
21:25:12 | * | yglukhov quit (Remote host closed the connection) |
21:25:25 | FromGitter | <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:39 | FromGitter | <Yardanico> just make a constructor? |
21:25:44 | FromGitter | <Yardanico> like newMyObj |
21:25:47 | FromGitter | <k0pernicus> make a constructor |
21:25:47 | FromGitter | <superfunc> Yeah I would just set it in the new function |
21:26:00 | FromGitter | <Yardanico> @Bennyelg also, about your cursor stuff, write it like this |
21:26:07 | FromGitter | <Bennyelg> but I'll have to call it. ⏎ I want it to be set at compile time |
21:26:22 | FromGitter | <Bennyelg> I'm still trying to figure this out (the constructor stuff) |
21:26:28 | FromGitter | <Yardanico> you can't have "ref" type at compile-time |
21:26:39 | FromGitter | <Yardanico> since it's a "ref" - reference |
21:27:01 | FromGitter | <Yardanico> about your cursor stuff: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bd9725614889d47507e9c3] |
21:27:25 | FromGitter | <Bennyelg> oh, I tried something simillar lets see if this thing is work |
21:29:42 | FromGitter | <ephja> Yardanico: `assert false` yeah that seems to pass |
21:30:09 | Yardanico | very strange |
21:34:14 | * | Yardanico quit (Remote host closed the connection) |
21:39:15 | * | shaiekx joined #nim |
21:39:20 | shaiekx | hello |
21:40:57 | FromGitter | <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:17 | shaiekx | I´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:44 | shaiekx | https://i.imgur.com/uSwW09V.png |
21:42:04 | shaiekx | The code above functions |
21:42:26 | shaiekx | But 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:44 | shaiekx | I think this is caused by waitForExit(process) |
21:43:11 | * | Trustable joined #nim |
21:43:46 | shaiekx | I want to add logic after waitForExit but i also want my page not to be blocked by new connections |
21:46:02 | FromGitter | <ephja> Yardanico: it actually fails if any of the assertions are wrong? |
21:47:04 | * | jsgrant joined #nim |
21:48:40 | FromGitter | <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:42 | FromGitter | <Bennyelg> false* |
21:49:02 | FromGitter | <ephja> I dunno if anything is wrong on Windows. I'm going to try it on linux as well |
21:49:53 | FromGitter | <mratsim> @Bennyelg static[bool] = false, args with default value must be after all args without default |
21:50:23 | FromGitter | <mratsim> and you need Nim 0.17.2 or more, there was an issue fixed so that it’s allowed |
21:50:24 | FromGitter | <Bennyelg> I didn't get you Mamy, |
21:50:32 | FromGitter | <Bennyelg> I am using 0.17.2 |
21:51:03 | FromGitter | <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:37 | FromGitter | <Bennyelg> not working, it said cant evaluate at compile time |
21:51:58 | FromGitter | <mratsim> what is the “a” you pass to it? |
21:51:59 | * | Arrrr quit (Quit: Leaving.) |
21:52:10 | FromGitter | <Bennyelg> bool |
21:52:13 | * | haha_ joined #nim |
21:52:15 | FromGitter | <Bennyelg> proc fetchOne*(cur; asTable: static[bool] = false): seq[string] | Table[string, string] = |
21:52:20 | FromGitter | <mratsim> yeah but when do you know it’s value? |
21:52:35 | FromGitter | <Bennyelg> before compilation thats for sure, |
21:52:47 | FromGitter | <Bennyelg> if I remove the false it's working but I have to pass it |
21:52:53 | FromGitter | <Bennyelg> on each function call |
21:52:57 | FromGitter | <mratsim> ah |
21:53:00 | * | azuri5 left #nim ("Leaving") |
21:53:12 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59bd9d481081499f1f3dbace] |
21:53:36 | FromGitter | <ephja> that might not work atm |
21:53:59 | FromGitter | <ephja> a lot of things involving static parameters or typedescs don't |
21:54:15 | FromGitter | <Bennyelg> :( |
21:55:10 | FromGitter | <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:59 | FromGitter | <mratsim> do a small test case and report it on the bug tracker, that would be quite helpful |
21:59:18 | ipjk | zacharycarter: 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:28 | FromGitter | <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:28 | FromGitter | <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:02 | FromGitter | <Yardanico> Well it was my idea to add it here :) |
22:29:43 | shaiekx | Can someone take a look at this: https://pastebin.com/kg80vrxm |
22:29:59 | shaiekx | Basically I want the openProc not to block new connections |
22:30:13 | shaiekx | but 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:44 | TjYoco | I could be very wrong, so someone please advise. But, my first guess would be threading |
22:35:36 | * | haha_ quit (Quit: haha_) |
22:36:08 | TjYoco | import threadpool, spawn openProc()? |
22:38:04 | shaiekx | That does fix my problem amazing |
22:38:21 | shaiekx | But I do wonder if this is _the_ way to do it |
22:40:24 | * | nsf quit (Quit: WeeChat 1.9) |
22:43:39 | FromGitter | <ephja> @Yardanico I dunno what is going on, if indeed one of your tests do fail when some assertion is wrong |
22:46:43 | dom96 | shaiekx: no async support for osproc at the minute, so yeah, you do need to create a new thread. |
22:54:56 | shaiekx | Ah. |
22:55:20 | shaiekx | Thanks for the explanation dom96 and example TjYoco |
22:56:01 | shaiekx | Will there be async in the future for osproc and how much worse or better is using a thread? |
22:59:02 | dom96 | There 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:52 | def-pri-pub | zacharycarter: If you're here, I'm stuck: https://github.com/zacharycarter/zengine/issues/41 |
23:44:54 | FromGitter | <zacharycarter> def-pri-pub: i'll take a look in just a min |
23:45:02 | FromGitter | <zacharycarter> ipjk: np |
23:45:49 | * | PMunch quit (Quit: leaving) |