00:15:34 | * | def-pri-pub joined #nim |
00:15:34 | * | def-pri-pub quit (Changing host) |
00:15:34 | * | def-pri-pub joined #nim |
00:18:07 | FromGitter | <zacharycarter> how do you do eager matching on libnames for dll imports |
00:18:16 | FromGitter | <zacharycarter> I want to do something like - const LibName = "Assimp32|64.dll" |
00:19:48 | skrylar | hrmm |
00:19:53 | skrylar | macros don't like you redefining []= |
00:20:56 | skrylar | oh nvm |
00:22:54 | skrylar | zacharycarter did that set of easing routines ever turn out to be useful |
00:23:00 | skrylar | i never made the tweening module they were for :\ |
00:30:55 | * | skrylar quit (Remote host closed the connection) |
00:33:15 | FromGitter | <zacharycarter> I haven't used them yet skrylar but I imagine they will be once I start to need them |
00:33:34 | FromGitter | <zacharycarter> there is zero easing logic in zengine atm so as soon as I need some I imagine it will become useful |
00:34:02 | FromGitter | <zacharycarter> sprite animations are about to be a thing so I imagine we could find some use there |
00:48:31 | * | nitely joined #nim |
00:49:02 | FromGitter | <mratsim> Is it normal on Travis to wait for 10+min to get a MacOS machine? (and I’m still waiting …) |
00:49:24 | FromGitter | <superfunc> @mratsim they've been having issues |
00:49:26 | FromGitter | <superfunc> https://www.traviscistatus.com/incidents/4qylrqvy50gy |
00:51:31 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
00:52:00 | FromGitter | <zacharycarter> @mratsim do you have any good resources for learning about scientific computing? like intro level stuff? |
00:55:32 | FromGitter | <mratsim> @superfunc thanks |
00:56:02 | FromGitter | <mratsim> @zacharycarter I can only help you regarding deep learning and data science. The reference is: http://www.fast.ai/ |
00:56:10 | FromGitter | <zacharycarter> thanks |
00:58:26 | FromGitter | <mratsim> And bonus: this is the project/excuse that got me started on Nim: https://karpathy.github.io/neuralnets/. (Before I only did project euler code) |
01:00:03 | FromGitter | <mratsim> Both are target at programmers that want to start with deep learning/neural net. The first one will give you high level tools, understanding while the second one is on low level implementation |
01:02:47 | * | def-pri-pub joined #nim |
01:02:47 | * | def-pri-pub quit (Changing host) |
01:02:47 | * | def-pri-pub joined #nim |
01:05:16 | FromGitter | <mratsim> And there are 2 hello world in Data Science: ⏎ ⏎ 1) Predicting survivors/dead in the Titanic: https://www.kaggle.com/c/titanic (general machine learning ⏎ 2) Recognising 60k+ handwritten digits from bank cheques: https://www.kaggle.com/c/digit-recognizer ⏎ ... [https://gitter.im/nim-lang/Nim?at=59b48fcc210ac2692011b52d] |
01:09:01 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
01:09:34 | FromGitter | <zacharycarter> thank you this is awesome |
01:12:10 | FromGitter | <zacharycarter> weird I"m getting "could not find symbol: glCreateShader" errors on windows |
01:12:47 | * | yglukhov joined #nim |
01:13:46 | * | jsgrant joined #nim |
01:15:52 | * | FromGitter * zacharycarter hopes someone else can try out some opengl loading code on windows |
01:17:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
01:21:30 | * | xet7 quit (Quit: Leaving) |
01:22:25 | * | xet7 joined #nim |
01:23:32 | FromGitter | <superfunc> @mratsim looks like mac builds are slowly being kicked on again, my PR just had the mac build finally start |
01:27:04 | * | chemist69 quit (Ping timeout: 255 seconds) |
01:32:07 | * | libelulu6 quit () |
01:40:51 | * | chemist69 joined #nim |
01:41:51 | * | couven92 joined #nim |
01:41:56 | * | couven92 quit (Read error: Connection reset by peer) |
01:47:32 | * | enthus1ast- quit (Ping timeout: 246 seconds) |
01:50:59 | * | arnetheduck joined #nim |
02:01:38 | * | PMunch quit (Quit: Leaving) |
02:09:39 | FromGitter | <zacharycarter> if anyone can do me a solid and try building and running frag on windows and linux flavors I'd be extremely grateful |
02:19:24 | FromGitter | <zacharycarter> I've been trying on my VMs but failing |
02:19:56 | * | pilne joined #nim |
02:22:48 | * | vlad1777d quit (Remote host closed the connection) |
02:22:53 | FromGitter | <zacharycarter> sorry I meant zengine |
02:40:49 | subsetpark | Good news y'all - I will be giving a talk on Nim at PyGotham in October |
02:41:20 | FromGitter | <zacharycarter> :D |
02:41:23 | FromGitter | <zacharycarter> please record it! |
02:41:40 | FromGitter | <zacharycarter> or have slides or something |
02:41:54 | FromGitter | <zacharycarter> I love talks on Nim |
02:43:00 | subsetpark | Me too... I'll just have to figure out what I'm gonna say first |
02:45:43 | FromGitter | <zacharycarter> :P |
02:55:29 | * | def-pri-pub joined #nim |
03:08:21 | * | Sembei joined #nim |
03:14:41 | * | yglukhov joined #nim |
03:20:01 | * | yglukhov quit (Ping timeout: 240 seconds) |
03:21:05 | FromGitter | <zacharycarter> I'm going to write a roguelike tutorial with zengine |
03:21:18 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/md7s/Screen-Shot-2017-09-09-at-11.20.48-PM.png) |
03:21:31 | * | rauss joined #nim |
03:22:47 | * | jago joined #nim |
03:25:47 | * | jago quit (Client Quit) |
03:41:21 | * | def-pri-pub quit (Ping timeout: 248 seconds) |
04:00:58 | * | def-pri-pub joined #nim |
04:01:25 | * | def-pri-pub quit (Client Quit) |
04:11:30 | * | mahmudov joined #nim |
04:16:18 | * | dddddd quit (Remote host closed the connection) |
04:26:27 | * | Jesin joined #nim |
04:32:21 | * | mahmudov quit (Remote host closed the connection) |
04:32:51 | * | mahmudov joined #nim |
04:42:33 | * | skrylar joined #nim |
04:49:55 | * | endragor joined #nim |
04:56:06 | * | pilne quit (Quit: Quitting!) |
05:15:52 | * | haha_ joined #nim |
05:22:01 | * | haha_ quit (Ping timeout: 240 seconds) |
05:27:17 | * | haha_ joined #nim |
05:47:12 | * | MyMind joined #nim |
05:48:41 | * | Sembei quit (Ping timeout: 240 seconds) |
05:56:48 | * | arnetheduck quit (Ping timeout: 248 seconds) |
05:57:09 | * | haha_ quit (Quit: haha_) |
06:10:05 | * | haha_ joined #nim |
06:18:11 | * | yglukhov joined #nim |
06:22:21 | * | yglukhov quit (Ping timeout: 240 seconds) |
06:25:01 | * | sz0 joined #nim |
06:29:21 | * | miran joined #nim |
06:40:45 | * | solitudesf joined #nim |
06:45:05 | * | Sentreen quit (Ping timeout: 240 seconds) |
06:45:41 | * | mahmudov quit (Ping timeout: 240 seconds) |
06:51:15 | * | jsgrant quit (Quit: jsgrant) |
06:51:37 | * | jsgrant joined #nim |
06:53:20 | * | haha_ quit (Quit: haha_) |
06:56:11 | * | jsgrant quit (Client Quit) |
06:56:31 | * | jsgrant joined #nim |
06:58:04 | * | Sentreen joined #nim |
07:08:54 | * | nitely quit (Ping timeout: 260 seconds) |
07:32:50 | * | claudiuinberlin joined #nim |
07:52:44 | * | nsf joined #nim |
08:20:36 | * | yglukhov joined #nim |
08:24:41 | * | yglukhov quit (Ping timeout: 240 seconds) |
08:33:56 | * | sz0 quit (Quit: Connection closed for inactivity) |
08:36:15 | FromGitter | <Varriount> @zacharycarter If you need any writing advice or review, feel free to ping me. |
08:53:25 | * | mahmudov joined #nim |
08:56:05 | * | Yardanico joined #nim |
08:58:42 | FromGitter | <mratsim> @dom96: You closed this https://github.com/dom96/choosenim/issues/18 but I still have the error, is it because you replaced it by: https://github.com/dom96/choosenim/issues/33 |
09:00:16 | FromGitter | <mratsim> The label changed from High priority to Low priority as well :/ it prevents me from using choosenim for TravisCI on Mac |
09:00:52 | FromGitter | <mratsim> ah no silly me, I need to use choosenim devel |
09:16:14 | * | jsgrant quit (Quit: jsgrant) |
09:16:37 | * | jsgrant joined #nim |
09:20:04 | * | haha_ joined #nim |
09:20:27 | * | Arrrr joined #nim |
09:20:27 | * | Arrrr quit (Changing host) |
09:20:27 | * | Arrrr joined #nim |
09:21:12 | * | jsgrant quit (Client Quit) |
09:21:35 | * | jsgrant joined #nim |
09:25:53 | FromGitter | <mratsim> I’m searching https://dev.to/ and the only results for Nim are completely unrelated, some guy called “Scott Nimrod” >_> |
09:32:05 | * | endragor quit (Remote host closed the connection) |
09:35:00 | * | endragor joined #nim |
09:37:18 | Yardanico | well i've never heard about this website before |
09:39:01 | * | endragor quit (Ping timeout: 240 seconds) |
09:42:25 | Arrrr | What code style do you prefer? I think 2 could be faster https://gist.github.com/anonymous/46731da1c984f255bd65caa49952d69c |
09:46:58 | * | endragor joined #nim |
09:47:57 | FromGitter | <zacharycarter> thanks @Varriount I'll probably take you up on that once I'm a bit further along |
09:51:27 | * | endragor quit (Ping timeout: 248 seconds) |
09:57:45 | FromGitter | <Varriount> Arr: Any reason the enum members can't be assigned those numbers? |
10:01:48 | FromGitter | <mratsim> @Yardanico dev.to seems like Medium with only devs as audience |
10:05:24 | * | couven92 joined #nim |
10:06:22 | * | vlad1777d joined #nim |
10:11:50 | FromGitter | <zacharycarter> I need to start writing something like - https://github.com/Thraka/SadConsole for zengine |
10:16:10 | Yardanico | well it's made for console :) |
10:16:16 | Yardanico | yeah, we need gui toolkit for console :D |
10:16:29 | Yardanico | *TUI |
10:16:47 | FromGitter | <zacharycarter> yeah but it uses monogame behind the scenes so it's just a terminal emulator |
10:23:32 | * | yglukhov joined #nim |
10:24:56 | Yardanico | well you would need to make pluggable backend support for zengine then :) |
10:25:02 | Yardanico | and gui toolkit in zengine itself |
10:26:36 | * | ShalokShalom_ joined #nim |
10:26:47 | FromGitter | <zacharycarter> this roguelike has some kickass graphics |
10:26:54 | FromGitter | <zacharycarter> https://www.reddit.com/r/roguelikedev/comments/6yieqt/testing_nonsquare_tiles_on_a_square_grid_what_do/ |
10:27:53 | * | yglukhov quit (Ping timeout: 255 seconds) |
10:28:15 | FromGitter | <zacharycarter> Yardanico: aye |
10:29:35 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
10:32:44 | federico3 | zacharycarter: text-based yet enjoyable, it's brilliant |
10:33:23 | FromGitter | <zacharycarter> federico3: I agree! I wish I knew how he was rendering those walls |
10:33:29 | Yardanico | look at his code ? :) |
10:33:49 | federico3 | how? |
10:34:20 | Yardanico | ah, sorry |
10:34:23 | Yardanico | but you cna read his comments |
10:35:06 | Yardanico | btw his twitter - https://twitter.com/Sin_tel |
10:35:14 | federico3 | "The tiles are 8x12 but they are drawn on an 8x8 grid. Make sure everything is drawn back to front, so the extra 4 pixel can overlap" |
10:35:44 | FromGitter | <zacharycarter> whoa that is rad |
10:35:50 | Yardanico | also he applies some effects |
10:35:54 | Yardanico | bloom, scanlines |
10:36:04 | Yardanico | in ascii game lol |
10:36:16 | Yardanico | wait, is this game run in an terminal? |
10:36:21 | FromGitter | <zacharycarter> no way |
10:36:28 | Yardanico | or it's ascii-like, but in normal window? |
10:36:33 | FromGitter | <zacharycarter> yaeh |
10:36:33 | federico3 | and coloring... but even the explosions are done with the font alone |
10:36:59 | federico3 | Yardanico: it's scrolling smoothly... |
10:37:05 | * | smt` joined #nim |
10:39:59 | * | smt quit (Ping timeout: 248 seconds) |
10:42:01 | FromGitter | <zacharycarter> okay I think I get it |
10:42:10 | FromGitter | <zacharycarter> the walls are just images 8x12 |
10:42:12 | FromGitter | <zacharycarter> on an 8x8 grid |
10:42:37 | FromGitter | <zacharycarter> going to try to play with this concept real quick |
10:42:38 | federico3 | zacharycarter: everything, not only the walls - and they are not "images" but font characters |
10:42:48 | FromGitter | <zacharycarter> are they actually characters? |
10:43:06 | FromGitter | <zacharycarter> I guess he made his own font? |
10:50:40 | * | enthus1ast- joined #nim |
11:07:48 | * | yglukhov joined #nim |
11:09:45 | * | arnetheduck joined #nim |
11:11:28 | * | dddddd joined #nim |
11:15:10 | FromGitter | <mratsim> so @zacharycarter when is Nim wrapper for Love2D (the engine he uses) ? |
11:16:27 | Yardanico | it uses SDL |
11:16:40 | Yardanico | IIRC |
11:16:43 | FromGitter | <krux02> @mratsim shameless self advertisement: https://github.com/krux02/opengl-sandbox |
11:16:50 | FromGitter | <krux02> not love2d |
11:17:15 | FromGitter | <krux02> great macro library to easily use opengl functionality efficiently |
11:17:40 | FromGitter | <zacharycarter> @mratsim heh I have no idea |
11:17:55 | FromGitter | <zacharycarter> I imagine it's possible since it's written in Lua |
11:17:56 | FromGitter | <krux02> It runs on all platforms with a half decent OpenGL implementation (excludes MacOS) |
11:17:57 | FromGitter | <zacharycarter> and things like |
11:18:04 | Yardanico | well it would be not efficient |
11:18:08 | FromGitter | <zacharycarter> https://github.com/jangko/nimLUA |
11:18:12 | FromGitter | <zacharycarter> no probably not |
11:18:39 | FromGitter | <ephja> IIRC a lot of it is written in C++ |
11:18:39 | FromGitter | <zacharycarter> my advice is to pick a Nim project, like zengine or opengl sandbox or nimgame etc and contribute! |
11:18:53 | FromGitter | <mratsim> Yep I saw it before @krux02, looks really nice. Maybe someday I will try learning game dev. |
11:18:58 | FromGitter | <zacharycarter> and if you don't want to do that, use godot nim |
11:19:22 | FromGitter | <krux02> did you see the video? |
11:20:26 | FromGitter | <mratsim> where is it? I can’t find a link |
11:20:35 | * | loc8 joined #nim |
11:20:46 | FromGitter | <krux02> https://www.youtube.com/watch?v=JO0iqGDgFqA |
11:20:55 | loc8 | Are generic types handled at compile time? |
11:20:58 | FromGitter | <mratsim> ah “Demo” at the top |
11:20:58 | FromGitter | <krux02> it doesn't cover everything |
11:21:03 | FromGitter | <krux02> loc8: yes |
11:21:09 | FromGitter | <krux02> like c++ templates |
11:21:40 | FromGitter | <mratsim> You should put 10 seconds of it as an animated GIF directly at the beginning of the readme |
11:21:54 | loc8 | I have a `Type[T] = object of RootObj` and I extend it with `String* = ref object of Type[string]` |
11:22:10 | loc8 | on the `newString` proc, I create the new object normally |
11:22:34 | loc8 | It receives a `T` and stores it at the property `value: T` of `type` |
11:22:46 | loc8 | It works normally with regular variables, but the compiler complains if it's a const |
11:22:59 | Yardanico | can you give an example code snippet? |
11:23:02 | loc8 | Yup |
11:23:07 | Yardanico | on gist for example |
11:24:24 | Yardanico | well maybe you're trying to create a "ref" type as a const |
11:24:32 | Yardanico | oh wait this would work |
11:24:53 | Yardanico | ah, no |
11:25:33 | FromGitter | <mratsim> btw I remember a recommendation/suggestion to use `object {.inheritable.}` instead of `object of RootObj`, is there any practical difference? |
11:26:19 | FromGitter | <mratsim> well more like `customType {.inheritable.} = object` I suppose |
11:26:20 | FromGitter | <krux02> @mratsim I guess that RootObj increases the size of the object |
11:26:36 | loc8 | Yardanico, https://gist.github.com/10c8/42d3e849251756721666972b014b567a |
11:26:45 | Yardanico | yeah |
11:26:47 | FromGitter | <krux02> but I am not sure here |
11:26:51 | loc8 | Can't create const refs? |
11:26:51 | Yardanico | you can't make ref types as const |
11:26:54 | Yardanico | loc8, you can't |
11:27:01 | Yardanico | because they're references |
11:27:17 | Yardanico | ah wait |
11:27:31 | FromGitter | <ephja> I dunno why RootObj would take up more space |
11:27:44 | loc8 | It still gives me an error even when it's an `object of Type[string]`, not ref |
11:27:53 | FromGitter | <krux02> loc8: my hint, if you try to avoid ref types, you will realize you won't need them |
11:27:56 | Yardanico | well yeah |
11:28:01 | Yardanico | there's some different error |
11:28:27 | loc8 | Same one, `cannot create null element for: [T]` |
11:28:37 | Yardanico | I mean it's not related to ref |
11:28:41 | loc8 | Oh got it |
11:29:59 | FromGitter | <mratsim> @krux02 The part around 11:16 is worth a GIF in my opinion: https://youtu.be/JO0iqGDgFqA?t=676 |
11:30:13 | loc8 | Any idea what it's related to then> |
11:30:19 | loc8 | ? |
11:30:44 | Yardanico | well it's already reported |
11:30:46 | Yardanico | on github |
11:30:46 | Yardanico | https://github.com/nim-lang/Nim/issues/6014 |
11:31:14 | loc8 | So it's a bug |
11:31:16 | Yardanico | yes |
11:31:18 | FromGitter | <krux02> @mratsim you mean the postprocessed cube? |
11:31:28 | FromGitter | <mratsim> yeah |
11:31:57 | FromGitter | <krux02> I will think about it. And yes it shows some non trivial to implement processing steps at the same time |
11:32:07 | FromGitter | <krux02> but still it is very simple |
11:32:44 | FromGitter | <mratsim> Showing that only a few lines of code allow that is good, and OpenGL is graphics, so talk with graphics ;) |
11:33:25 | FromGitter | <krux02> well I am a bit tied to opengl I never really learned another rendering API |
11:33:42 | FromGitter | <krux02> there isn't that much choise on Linux |
11:33:49 | Yardanico | yeah |
11:34:03 | Yardanico | and opengl is most cross-platform and supported everywhere |
11:34:08 | FromGitter | <krux02> there is Vulkan, but that is new and I am not exited to be the first who seens all the bugs |
11:34:40 | FromGitter | <mratsim> Why are you using Nim then ;) |
11:34:43 | FromGitter | <krux02> Yardanico: well you would guess, but opengl support on MacOS is pretty weak |
11:35:18 | Yardanico | lol, I didn't knew |
11:35:28 | Yardanico | do they have their own API? |
11:37:13 | FromGitter | <krux02> http://www.g-truc.net/doc/OpenGL%204%20Hardware%20Matrix.pdf |
11:37:35 | * | Sentreen quit (Ping timeout: 248 seconds) |
11:37:37 | * | solitudesf quit (Ping timeout: 248 seconds) |
11:37:40 | FromGitter | <krux02> yes they have their own API now called metal and since then OpenGL hasn't been developed further |
11:37:44 | FromGitter | <krux02> on Apple |
11:37:57 | FromGitter | <krux02> the newest version Apple supports is now 7 years old |
11:38:08 | Yardanico | wow |
11:38:46 | Yardanico | ok, but I can't really say anything about that because I don't own any of the Apple products :) |
11:39:03 | FromGitter | <krux02> good for you |
11:39:09 | FromGitter | <krux02> me neither |
11:39:11 | Yardanico | only hackintosh on my PC (just wanted to test macOS) |
11:39:22 | Yardanico | it works without any issues, but it's not for me |
11:39:25 | FromGitter | <krux02> I once had an Apple ][ from my father in my room when I was little |
11:39:43 | FromGitter | <krux02> I played frogger |
11:39:50 | * | endragor joined #nim |
11:40:08 | FromGitter | <krux02> that's my experience with apple, and back then my father decided Apple is too expensive |
11:40:48 | Yardanico | well it is quite expensive in Russia too comparing it to the average salaries :P |
11:41:02 | FromGitter | <krux02> I found an old catalog with apple products, the floppy drive alone was 600$ |
11:42:34 | FromGitter | <ephja> I don't have a floppy drive :/ |
11:44:23 | * | vendethiel- joined #nim |
11:45:10 | FromGitter | <mratsim> I use a MacBook Pro as my main machine. It’s quite nice. I remember on KDE4 Archlinux, having to fiddle with X every time I plugged a second screen. Also suspend / hibernating not working because of an USB device. And the best thing: battery life. |
11:45:24 | FromGitter | <zacharycarter> yeah I like my macbook pro as well |
11:45:30 | FromGitter | <zacharycarter> even if it doesn't support the latest opengl extensions |
11:45:35 | * | Ven`` quit (Ping timeout: 240 seconds) |
11:45:36 | FromGitter | <zacharycarter> :shrug: |
11:46:02 | FromGitter | <krux02> well I don't have the latest opengl extensions as well |
11:46:14 | FromGitter | <krux02> but at least within the last 7 years there has been development |
11:46:21 | FromGitter | <krux02> there was momentum |
11:46:29 | FromGitter | <krux02> on Apple it is just no momentum at all |
11:47:01 | FromGitter | <krux02> I run on MESA software renderer, and that one has better extension support than APPLE drivers |
11:47:37 | FromGitter | <krux02> I am talking about mesa software rendering, and that one was never something you wanted to use |
11:47:47 | Yardanico | you don't have a GPU? |
11:49:36 | FromGitter | <krux02> well I have a used laptop that is too many years old and was never good at graphics with intel chip |
11:49:47 | FromGitter | <krux02> my later opengl Version is 2.1 |
11:50:13 | FromGitter | <krux02> I don't want to use that version, I wanted at least to use a core version so I switched to software opengl |
11:50:44 | FromGitter | <krux02> it has the nice sideeffect that all examples in the examples folder run smoothly on software rendering |
11:51:32 | * | Sentreen joined #nim |
11:58:51 | FromGitter | <zacharycarter> def-pri-pub: when you get to being around please ping me, I have a question about the 2d texture in 3d space thing |
12:01:16 | * | jsgrant quit (Quit: jsgrant) |
12:01:40 | * | jsgrant joined #nim |
12:06:11 | * | jsgrant quit (Client Quit) |
12:06:22 | * | SusWombat quit (Ping timeout: 264 seconds) |
12:06:34 | * | jsgrant joined #nim |
12:10:22 | * | SusWombat joined #nim |
12:13:37 | FromGitter | <zacharycarter> wondering if you mean something like - |
12:13:38 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/MJe9/Screen-Shot-2017-09-10-at-8.13.19-AM.png) |
12:13:41 | FromGitter | <zacharycarter> or if you mean billboarding, or something else |
12:21:32 | * | loc8_ joined #nim |
12:24:00 | * | loc8 quit (Ping timeout: 240 seconds) |
12:51:15 | * | jsgrant quit (Quit: jsgrant) |
12:53:56 | * | jsgrant joined #nim |
12:56:12 | * | jsgrant quit (Client Quit) |
12:56:33 | * | jsgrant joined #nim |
12:59:07 | FromGitter | <abijahm> guys parse url with doubleslashes throws a valueerror causing asynchttpserver to crush ⏎ ⏎ ```localhost:8080// -- crashes the server``` [https://gitter.im/nim-lang/Nim?at=59b5371b162adb6d2e881853] |
12:59:45 | Yardanico | well I think you should report this |
13:11:14 | * | jsgrant quit (Quit: jsgrant) |
13:11:35 | * | jsgrant joined #nim |
13:16:11 | * | jsgrant quit (Client Quit) |
13:16:32 | * | jsgrant joined #nim |
13:17:24 | * | ShalokShalom_ is now known as ShalokShalom |
13:17:47 | FromGitter | <mratsim> BTW, is that intended that this snippet gives “undeclared identifier ‘a’” ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Seems like if-else has a different scope [https://gitter.im/nim-lang/Nim?at=59b53b7b210ac2692013cbfb] |
13:18:05 | * | arnetheduck quit (Ping timeout: 246 seconds) |
13:18:36 | * | arnetheduck joined #nim |
13:21:23 | Yardanico | нуы |
13:21:24 | Yardanico | yes |
13:21:28 | Yardanico | it has a different scope |
13:22:14 | Yardanico | why it wouldn't? |
13:22:30 | * | Pisuke joined #nim |
13:24:01 | * | MyMind quit (Ping timeout: 240 seconds) |
13:24:19 | * | Sembei joined #nim |
13:25:16 | FromGitter | <mratsim> Using this syntax to keep the let and the conditional ⏎ ⏎ ```let a = if true: 0 else: 1``` [https://gitter.im/nim-lang/Nim?at=59b53d3c210ac2692013d2c8] |
13:25:24 | * | haha_ quit (Quit: haha_) |
13:25:49 | Yardanico | well yeah |
13:25:52 | Yardanico | you can also have this |
13:26:14 | FromGitter | <Yardanico> ```let a = ⏎ if true: ⏎ 0 ⏎ else: ⏎ 0``` [https://gitter.im/nim-lang/Nim?at=59b53d76bc46472974170445] |
13:26:44 | FromGitter | <Yardanico> so you can have many statements here |
13:26:47 | FromGitter | <mratsim> but in practice I start having big code block and redundant testing (actual application) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b53d97bac826f0549d3e56] |
13:26:57 | * | Pisuke quit (Ping timeout: 248 seconds) |
13:27:20 | FromGitter | <Yardanico> b.strides[int(b_is_colMajor)] ⏎ lol |
13:27:25 | FromGitter | <Yardanico> :) |
13:29:16 | FromGitter | <mratsim> mmmh, well it works technically lol. but actually you could have strides[2] and strides[3] for more general implementation :P |
13:29:19 | * | haha_ joined #nim |
13:30:00 | Yardanico | case statement then |
13:30:48 | Yardanico | you can do this(lol): |
13:30:53 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b53e8cc101bc4e3aac4fa2] |
13:31:00 | FromGitter | <mratsim> na that’s fine, I can leave with the code, I ws just curious of if (bunch of let) else: (bunch of let) |
13:31:44 | FromGitter | <Yardanico> well "if" should really have a new scope |
13:32:11 | FromGitter | <Yardanico> it has in all major languages |
13:33:16 | * | haha_ quit (Client Quit) |
13:34:49 | FromGitter | <mratsim> In major language, since they don’t have the let/var distinction they use the following ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b53f794e50cfde27235104] |
13:35:12 | Yardanico | well "let" is only used for programmer |
13:35:18 | Yardanico | in nim (for now) |
13:35:35 | Yardanico | but yeah, use if 1: something else: another |
13:52:53 | * | vivus joined #nim |
14:00:38 | * | endragor_ joined #nim |
14:03:43 | * | endragor quit (Ping timeout: 248 seconds) |
14:04:16 | * | endragor joined #nim |
14:07:57 | * | endragor_ quit (Ping timeout: 260 seconds) |
14:10:04 | * | relax joined #nim |
14:10:36 | * | solitudesf joined #nim |
14:14:40 | * | haha_ joined #nim |
14:14:41 | * | mahsav quit (Ping timeout: 255 seconds) |
14:17:52 | * | relax quit (Ping timeout: 260 seconds) |
14:25:18 | * | ryanhowe quit (Read error: Connection reset by peer) |
14:31:41 | * | Matthias247 joined #nim |
14:38:31 | * | Elronnd quit (Ping timeout: 276 seconds) |
14:43:04 | * | jsgrant quit (Quit: jsgrant) |
14:45:41 | * | mahsav joined #nim |
14:48:51 | * | pilne joined #nim |
14:55:09 | * | mahmudov quit (Ping timeout: 252 seconds) |
15:12:01 | * | arnetheduck quit (Ping timeout: 248 seconds) |
15:19:55 | * | ipjk joined #nim |
15:41:41 | * | solitudesf quit (Remote host closed the connection) |
15:42:05 | * | adam12 joined #nim |
15:42:12 | * | haha_ quit (Quit: haha_) |
15:45:44 | * | yglukhov quit (Remote host closed the connection) |
15:51:27 | * | Arrrr quit (Ping timeout: 248 seconds) |
15:55:04 | * | Arrrr joined #nim |
15:55:04 | * | Arrrr quit (Changing host) |
15:55:04 | * | Arrrr joined #nim |
15:57:30 | * | Yardanico quit (Read error: Connection reset by peer) |
16:01:00 | * | Yardanico joined #nim |
16:15:33 | * | BigEpsilon joined #nim |
16:16:35 | * | ryanhowe joined #nim |
16:21:32 | FromGitter | <BigEpsilon> Hi, what is the correct way to emit a warning during compilation phase ? |
16:22:35 | ipjk | Maybe, static: echo "[warning] this shouldn't happen"? |
16:23:14 | FromGitter | <BigEpsilon> I want to emit a warning when a circular dependency is detected between other things than types or consts when using the reorder pragma |
16:24:40 | FromGitter | <BigEpsilon> but this wont get the color like compiler warnings and hint right ? |
16:25:33 | Yardanico | ipjk, no |
16:25:51 | Yardanico | use this pragma |
16:25:56 | Yardanico | {.warning: "sample text"} |
16:26:04 | Yardanico | {.warning: "sample text".} |
16:26:42 | ipjk | Oh, cheers for the heads up |
16:26:56 | FromGitter | <BigEpsilon> thanks for you both ! |
16:26:56 | * | Elronnd joined #nim |
16:27:00 | * | Elronnd quit (Client Quit) |
16:27:06 | ipjk | https://nim-lang.org/docs/manual.html#pragmas-warning-pragma |
16:27:19 | ipjk | Seem to be quite some usefull ones |
16:27:36 | * | nexxus joined #nim |
16:27:36 | * | Elronnd joined #nim |
16:28:04 | FromGitter | <BigEpsilon> in fact it is not realy a compile time warning that I need sry |
16:28:27 | FromGitter | <BigEpsilon> it is during the processing of a pragma |
16:28:50 | FromGitter | <BigEpsilon> in the compiler |
16:29:08 | Yardanico | ah |
16:29:11 | FromGitter | <BigEpsilon> so it's a runtime warning in the compiler |
16:29:13 | Yardanico | then search compiler source ? :) |
16:29:28 | FromGitter | <BigEpsilon> yes 'ill search for that warning pragma |
16:29:36 | FromGitter | <BigEpsilon> and see what it does |
16:29:46 | FromGitter | <BigEpsilon> thks |
16:32:06 | * | Jesin quit (Quit: Leaving) |
16:33:31 | * | Trustable joined #nim |
16:33:36 | Yardanico | BigEpsilon: so what kind of warning you want to output? |
16:34:31 | FromGitter | <BigEpsilon> "Circular dependency detected starting at line X, reorder pragma may not be able to function properly" |
16:34:41 | FromGitter | <BigEpsilon> something of that kind |
16:34:46 | * | Jesin joined #nim |
16:35:37 | * | tjyoco joined #nim |
16:36:05 | FromGitter | <BigEpsilon> I can indicated all the nodes which are in this dependency, but it may become to verbose |
16:36:11 | * | dddddd quit (Remote host closed the connection) |
16:36:21 | Yardanico | ah |
16:36:25 | Yardanico | it seems you need to use "message" |
16:36:53 | FromGitter | <BigEpsilon> yes I found it in msgs |
16:37:05 | FromGitter | <BigEpsilon> I'm adding it now |
16:41:20 | FromGitter | <BigEpsilon> ```code paste, see link``` |
16:41:46 | FromGitter | <BigEpsilon> treorder.nim(15, 1) Warning: Circular dependency detected. reorder pragma may not be able to reorder some nodes properely [User] |
16:41:56 | * | MyMind joined #nim |
16:42:20 | FromGitter | <BigEpsilon> what do you think about such a warning ? |
16:42:35 | Yardanico | well it's OK probably |
16:43:03 | SusWombat | Could anyone tell me what i did wrong here? https://hastebin.com/yuvimicire.nim i get "index out of bounds" |
16:43:30 | * | Sembei quit (Ping timeout: 240 seconds) |
16:46:13 | * | yglukhov joined #nim |
16:46:54 | FromGitter | <BigEpsilon> in the loop |
16:47:05 | FromGitter | <BigEpsilon> you add a seq of size 0 |
16:47:16 | FromGitter | <BigEpsilon> then try to access its element |
16:47:32 | FromGitter | <BigEpsilon> you most create it with size width |
16:47:49 | FromGitter | <BigEpsilon> world.add(newSeqint8 (0)) |
16:47:56 | FromGitter | <BigEpsilon> becomes |
16:48:25 | FromGitter | <BigEpsilon> ```world.add(newSeq[int8](width))``` |
16:49:24 | SusWombat | oh |
16:49:41 | SusWombat | shouldnt .add resize it? |
16:50:08 | Yardanico | well just remove 0 |
16:50:08 | FromGitter | <BigEpsilon> it resize the first seq |
16:50:21 | FromGitter | <BigEpsilon> the one that contains your height seqs |
16:50:24 | Yardanico | but you don't actually need a nested seq here :) |
16:50:39 | * | yglukhov quit (Ping timeout: 248 seconds) |
16:50:57 | tjyoco | Yeah a seq[tuple[int8, int8]] would be easier right? |
16:51:09 | Yardanico | well I mean you can do that with just seq[int8] |
16:51:13 | FromGitter | <BigEpsilon> Yes if your code need to be fast, you better use a seq of size width*height |
16:51:50 | FromGitter | <BigEpsilon> easier maybe but slower than using a just a seq on int8 |
16:52:02 | FromGitter | <BigEpsilon> of* int8 |
16:52:25 | Yardanico | https://gist.github.com/Yardanico/08b8b7a47fb79a24c870a67c191fd6bd |
16:52:27 | Yardanico | tjyoco, ^ |
16:52:56 | Araq_ | BigEpsilon: I'm not that happy with your PR :-) |
16:53:11 | tjyoco | ahh nice |
16:53:18 | FromGitter | <BigEpsilon> tell me about it :) |
16:53:25 | Araq_ | you introduced special cases, overfitting the test suite |
16:53:44 | Araq_ | instead you should have documented precisely why which test fails ;-) |
16:54:01 | Araq_ | and then we can make these tests {.reorder: off.} |
16:54:08 | FromGitter | <BigEpsilon> Oh I did |
16:54:09 | SusWombat | Thanks guys |
16:54:14 | FromGitter | <BigEpsilon> In the PR |
16:54:26 | FromGitter | <BigEpsilon> I explained why this tests failed |
16:54:27 | Araq_ | must have missed this then |
16:54:35 | Yardanico | SusWombat, well I don't know if it would help you :) |
16:54:44 | FromGitter | <BigEpsilon> Its a test that uses the reorder pragma |
16:54:45 | Yardanico | but yeah, it should work |
16:55:06 | SusWombat | Yardanico, well i meant for pointing me to my mistake. your grid thing is intresting tho |
16:55:32 | Yardanico | well it requires one multiplication and one addition at each index access |
16:55:35 | FromGitter | <BigEpsilon> @Araq_, see my last comment : https://github.com/nim-lang/Nim/pull/6326 |
16:55:39 | Yardanico | *indexed access |
16:56:10 | tjyoco | can anyone inform me as to what "Error: internal error: openArrayLoc: ResourceType" means? |
16:56:25 | Yardanico | tjyoco, some internal compiler error, report it |
16:56:50 | * | mahmudov joined #nim |
16:57:22 | tjyoco | Yardanico, ah okay, because it was working one minute and haven't been able to get it to work since. Open an issue on GitHub then? |
16:57:28 | FromGitter | <BigEpsilon> My PR does not enable the reorder pragma by default, because at don't believe it should be, like I explained in the PR |
16:57:55 | * | loc8_ quit (Ping timeout: 246 seconds) |
16:57:56 | Araq_ | BigEpsilon: it should be "opt-out", not "opt-in" |
16:57:57 | Yardanico | tjyoco, yeah, and share your code snippet with us here |
16:58:42 | FromGitter | <BigEpsilon> May be after more testing ? |
16:59:28 | Araq_ | well I don't understand your remarks |
16:59:39 | FromGitter | <BigEpsilon> The Compiler compiles with reorder enabled but for that I had to be very strict in the reordering |
16:59:40 | SusWombat | oh ... just know i fully realize why my code didnt work ... embarrasing |
16:59:47 | Araq_ | this test was written by me and used to work |
17:00:19 | FromGitter | <BigEpsilon> yes i can make it succeed, but it will break a lot of working code |
17:01:10 | FromGitter | <BigEpsilon> foo() is a command |
17:01:22 | FromGitter | <BigEpsilon> and defined() is another |
17:01:47 | FromGitter | <BigEpsilon> I have to keep their original order, other wise alot of code will be broken |
17:02:11 | FromGitter | <BigEpsilon> this introduces a circular dependency in that test |
17:02:22 | FromGitter | <BigEpsilon> so the original order is kept |
17:02:27 | FromGitter | <BigEpsilon> an the test fails |
17:02:42 | Araq_ | 1. within push/pop you can reorder |
17:02:55 | FromGitter | <Bennyelg> How Can I handel AsyncRequest? ⏎ newHttpClient is good enuge ? |
17:03:01 | FromGitter | <Yardanico> No |
17:03:18 | FromGitter | <Yardanico> You handle it with async http server |
17:03:58 | FromGitter | <BigEpsilon> Yes this can be enabled but needs some work |
17:04:52 | Araq_ | 2. which cycle prevents the reordering from working? |
17:05:04 | Araq_ | it *used* to work :P |
17:06:12 | tjyoco | Yardanico, this is my project with the error https://github.com/Tyler-Yocolano/nimbomb/tree/internal-error, I'm really not sure how to simplify it down for an issue report. |
17:06:32 | FromGitter | <BigEpsilon> when defined(testdef): depends on foo() |
17:07:20 | FromGitter | <BigEpsilon> and the definition of foo depends on whendep |
17:07:41 | FromGitter | <BigEpsilon> and when whendep depens on "when defined(testdef):" |
17:08:48 | FromGitter | <BigEpsilon> This is the circular dependency |
17:10:31 | Araq_ | hmmm |
17:10:39 | FromGitter | <BigEpsilon> without this restriction some a lot of tests will fail |
17:10:55 | Araq_ | ok I believe you |
17:11:16 | FromGitter | <BigEpsilon> I introduced all this restriction will trying to compile the compiler and make all the test succeed |
17:11:51 | FromGitter | <BigEpsilon> Is it possible to make the reordering during the semantic phase ? |
17:12:07 | Araq_ | yeah but I feared the complexity :P |
17:12:09 | FromGitter | <BigEpsilon> when we would have real dependencies |
17:12:35 | Araq_ | yes but when I tried that I had to rewrite all of the semantic pass |
17:12:53 | FromGitter | <BigEpsilon> I can tell you complexity escalated quicly when I started compiling system.nim :-) |
17:13:11 | FromGitter | <BigEpsilon> I understand |
17:13:13 | Araq_ | system.nim is a special case |
17:13:23 | Araq_ | we can disable it for system, as I said |
17:13:58 | FromGitter | <BigEpsilon> not just system, the compiler |
17:14:50 | FromGitter | <BigEpsilon> Its your call if you want to enable it by default, and disable it for specific cases |
17:14:53 | * | Jesin quit (Quit: Leaving) |
17:15:20 | FromGitter | <BigEpsilon> personaly I dont feel I need it for other cases than when using code generated by c2nim |
17:17:04 | FromGitter | <BigEpsilon> but top level commands will always be a problem for reordering |
17:18:17 | Araq_ | well for now it'll stay disabled |
17:19:17 | FromGitter | <BigEpsilon> yes I think it should |
17:19:25 | Araq_ | and c2nim can produce {.reorder: on.} |
17:20:51 | FromGitter | <BigEpsilon> do you have any plan to introduce forward type declaration into nim like for procs ? |
17:21:06 | FromGitter | <BigEpsilon> it is also a solution for the same problem |
17:28:52 | * | haha_ joined #nim |
17:31:21 | * | BigEpsilon quit (Ping timeout: 252 seconds) |
17:31:41 | * | endragor quit (Remote host closed the connection) |
17:35:29 | * | yglukhov joined #nim |
17:42:54 | * | couven92 quit (Ping timeout: 252 seconds) |
17:45:23 | * | couven92 joined #nim |
17:53:24 | Araq_ | BigEpsilon: yes indeed, they are needed too |
18:02:46 | FromGitter | <zacharycarter> @Yardanico can I steal said grid? |
18:05:04 | * | yglukhov quit (Remote host closed the connection) |
18:05:34 | * | yglukhov joined #nim |
18:06:12 | ipjk | Isn't an array better if you know the size? |
18:06:22 | FromGitter | <zacharycarter> yes |
18:06:32 | FromGitter | <zacharycarter> but you have to know the size at compile time |
18:10:28 | Yardanico | well steal it |
18:10:38 | Yardanico | I just ported it from some C++ project :D |
18:10:43 | Yardanico | found it here |
18:11:41 | Yardanico | well yeah, it can be changed to array |
18:11:49 | Yardanico | but I don't think it would be a lot faster |
18:12:07 | FromGitter | <zacharycarter> thank you |
18:16:39 | * | haha_ quit (Quit: haha_) |
18:16:45 | Yardanico | well yeah |
18:16:50 | Yardanico | I get exact same results with seq and array |
18:17:06 | Yardanico | if size is known |
18:17:54 | Yardanico | https://gist.github.com/Yardanico/58a3e375cc1998c56caf0056feb32f23 |
18:18:21 | Yardanico | compile with -d:release -r as usual |
18:18:43 | * | haha_ joined #nim |
18:22:32 | ipjk | both are the same, right? |
18:22:39 | ipjk | no newArrayGrid |
18:22:49 | Yardanico | ah |
18:22:50 | Yardanico | LOL |
18:22:53 | Yardanico | xD |
18:23:52 | ipjk | and I think you should grow the grids quite a bit from 10 |
18:24:10 | Yardanico | well why? |
18:24:14 | Yardanico | nimbench is used for benchmarking |
18:25:06 | Yardanico | hmm, nim for some reason emits 9223372036854775807 as an array size |
18:27:31 | Yardanico | IDK how to make ArrayGrid work properly :P |
18:27:54 | * | tjyoco quit (Ping timeout: 260 seconds) |
18:32:11 | * | endragor joined #nim |
18:35:53 | * | dddddd joined #nim |
18:37:00 | * | endragor quit (Ping timeout: 240 seconds) |
18:38:58 | * | PMunch joined #nim |
18:46:54 | ipjk | var grid = newArrayGrid[20, int](10, 10) doesn't work? |
18:47:52 | Yardanico | yes |
18:48:07 | Yardanico | and it would be 100, not 20 :) |
18:48:29 | ipjk | Ah, you're right. |
18:48:39 | Yardanico | I don't know how to make it work |
18:57:30 | * | tjyoco joined #nim |
19:00:36 | * | endragor joined #nim |
19:00:50 | * | ryanhowe quit (Quit: ryanhowe) |
19:04:22 | * | loc8_ joined #nim |
19:06:00 | * | endragor quit (Ping timeout: 240 seconds) |
19:06:13 | livcd | is there a nim blog you guys can recommend ? |
19:06:45 | federico3 | livcd: https://planet.nim-lang.org/ collects Nim blogs |
19:08:05 | ipjk | Could it be a compilerbug? |
19:09:39 | Yardanico | ipjk, I don't really know |
19:09:51 | Yardanico | we need someone who is fluent in Nim :) |
19:14:38 | federico3 | nimprof is breaking a multithreaded application when imported |
19:18:10 | * | Yardanico_ joined #nim |
19:18:14 | * | Yardanico_ quit (Remote host closed the connection) |
19:20:30 | * | Yardanico quit (Ping timeout: 240 seconds) |
19:34:49 | livcd | what is this {.inline.}= syntax ? |
19:40:18 | * | haha_ quit (Quit: haha_) |
19:42:01 | livcd | ah foun dit |
20:04:54 | FromGitter | <Bennyelg> freaking vscode STOPed show goto difinition |
20:05:01 | FromGitter | <Bennyelg> this is hell to program like this. |
20:07:59 | Arrrr | if you want to specify a integer as a generic, use T: static[int] |
20:13:42 | FromGitter | <zacharycarter> @Bennyelg the tooling for Nim isn't as advanced as other languages, but I wouldn't describe it as hell either |
20:14:36 | FromGitter | <Bennyelg> I was handling it just fine till 3 days ago somehow after I installed the nim via git instead of the brew |
20:14:54 | FromGitter | <Bennyelg> The goto difinition and auto completion stoped |
20:15:05 | * | Arrrr quit (Ping timeout: 240 seconds) |
20:15:30 | FromGitter | <zacharycarter> sounds like an issue with the vscode extension |
20:15:37 | FromGitter | <zacharycarter> or nimsuggest |
20:15:49 | FromGitter | <Bennyelg> how do I check if I have nimsuggest installed |
20:16:04 | FromGitter | <Bennyelg> ➜ bin git:(master) ✗ nimsuggest ⏎ zsh: command not found: nimsuggest |
20:16:45 | tjyoco | When i've gotten nim from git ive had to go to the nim folder and do .\koch nimsuggest |
20:17:00 | FromGitter | <zacharycarter> I think ./koch tools works too |
20:17:26 | tjyoco | oh does that just build all of them? |
20:17:31 | FromGitter | <zacharycarter> yup |
20:17:35 | FromGitter | <zacharycarter> including nimble |
20:17:45 | FromGitter | <Bennyelg> working on it , thanks |
20:19:34 | FromGitter | <zacharycarter> sure |
20:21:27 | FromGitter | <Bennyelg> Yea, Fixed |
20:21:29 | FromGitter | <Bennyelg> finally |
20:22:25 | FromGitter | <zacharycarter> |
20:27:15 | * | Trustable quit (Remote host closed the connection) |
20:30:00 | FromGitter | <Bennyelg> I tried to nimble push for the first time, my package |
20:30:04 | FromGitter | <Bennyelg> this is what Im getting |
20:30:04 | FromGitter | <Bennyelg> ➜ csvql git:(master) ✗ nimble publish ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b5a0cc177fb9fe7ea3d56d] |
20:30:09 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b5a0d1cfeed2eb65f1b95d] |
20:31:26 | TheManiac | Hi, me again, with my newbie questions |
20:31:41 | TheManiac | Is it possible to make type restrictions recursive? |
20:31:56 | TheManiac | i.e. are there a few magic words that I would have to add to https://play.nim-lang.org/?gist=f7d0515324d892daf27087ff7e6c6f6c to make it compile |
20:32:25 | TheManiac | ```Error: cannot instantiate Node |
20:32:26 | TheManiac | got: (type N: enum, type T: string or seq) |
20:32:26 | TheManiac | but expected: (N: enum, T: string or seq)``` is baffling me |
20:33:53 | * | loc8_ quit (Quit: WeeChat 1.9) |
20:34:20 | TheManiac | other than missing `type`, I feel I've satisfied the compiler god... |
20:50:44 | FromGitter | <zacharycarter> hrm let's say I have a bunch of constants declared and I want to select a random one - what would be the best way of going about implementing this? |
20:51:12 | TheManiac | put them in an array and select a random member of the array? |
20:51:47 | FromGitter | <zacharycarter> I was thinking of something a little more elegant - something that didn't me require to keep another listing of them |
20:51:55 | FromGitter | <zacharycarter> @Bennyelg please consult @dom96 on that one |
20:52:22 | FromGitter | <Bennyelg> @zacharycarter thanks. |
20:52:34 | TheManiac | If they're all super related, you could make them the values of an enum? |
20:52:54 | tjyoco | I was about to suggest that |
20:53:19 | TheManiac | Hopefully that says good things about us :) |
20:53:41 | FromGitter | <zacharycarter> could I write like macro that would let me identify all the constants in the file and then select one at random? |
20:53:50 | tjyoco | I'm not confident in my nim-fu at all |
20:54:01 | FromGitter | <zacharycarter> I'm a macro noob btw so if that question is laughable please just ignore it :P |
20:54:21 | tjyoco | what type are your constants? |
20:54:22 | TheManiac | no doubt, but I'm going to ask the obvious question, why would you want to do such a thing? |
20:54:37 | FromGitter | <zacharycarter> I have this file - |
20:55:02 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
20:55:25 | * | TheManiac generally assumes you can do anything in macros if your fu is strong enough |
20:55:49 | * | TheManiac wonders if you could rewrite lex & yacc as a nim macro executed at compile time :) |
20:56:17 | * | TheManiac 's fu however is weak - sad |
20:56:36 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=7831cc33dca29209155fd1f3a50aafab |
20:56:39 | FromGitter | <superfunc> A macro could do that, not sure if its warranted here |
20:56:57 | FromGitter | <zacharycarter> ideally I have a proc / template / macro / something where I can say randomColor and return one of those const values |
20:57:15 | FromGitter | <zacharycarter> and I'd prefer to not have to redeclare them as another array / set / anything to keep maintenance low |
20:57:56 | * | Snircle joined #nim |
20:58:01 | TheManiac | That definitely feels worth of a 'DefaultColors' enum |
20:58:09 | TheManiac | s/worth/worthy/ |
20:58:22 | tjyoco | TheManiac, since your N is always an enum, can't you just take that out of the type definition and put it in the constructor |
21:00:03 | TheManiac | possibly |
21:00:53 | TheManiac | It's operating in an environment where there are several different types of enum floating around (representing different kinds of node), so it's out here to allow me to type check that it's the same enum as I'm expecting |
21:01:51 | TheManiac | and the N: enum is defined by the user, not in this file (if you see what I mean), hence needing to parameterise it as it's not known in advance |
21:02:04 | tjyoco | could you create your own `==` operator and just compare the x.kind == y.kind |
21:02:27 | TheManiac | yes, but wouldn't that only get caught at runtime? |
21:02:43 | TheManiac | I want it to note compile if you pass in the wrong type of enum when you create a Node |
21:02:48 | tjyoco | Oh i see what you mean now |
21:03:47 | TheManiac | I've obviously stripped this down, but I have functions like `dosomething[N, T](rule: Rule[N, T], node[N, T])` |
21:04:07 | TheManiac | so I need to make sure that Rule and Node have the same N & T |
21:04:24 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/2PFB/Screen-Shot-2017-09-10-at-5.04.04-PM.png) |
21:04:25 | FromGitter | <zacharycarter> now for glyph rendering |
21:04:29 | TheManiac | s/node/node: Node[N, T]/ |
21:05:26 | TheManiac | 壟 (assuming that that's the output you were hoping for :)) |
21:06:10 | FromGitter | <zacharycarter> meh I just wrote a random color proc to return values between 0 and 255 :P |
21:06:14 | FromGitter | <zacharycarter> but same effect |
21:06:26 | FromGitter | <zacharycarter> I'm trying to create a console / terminal emulator on top of my game engine for roguelikes |
21:12:03 | * | sz0 joined #nim |
21:12:23 | FromGitter | <zacharycarter> need to figure out how to center text over those rectangles now |
21:28:48 | * | deavmi quit (Quit: Lost terminal) |
21:33:39 | * | endragor joined #nim |
21:38:05 | * | endragor quit (Ping timeout: 240 seconds) |
21:39:39 | tjyoco | maybe a dumb question but how should getters/setters look in nim |
21:40:12 | FromGitter | <zacharycarter> probably shouldn't have them |
21:40:54 | tjyoco | What do I do if I want a read-only type of variable |
21:40:59 | FromGitter | <zacharycarter> don't expose it |
21:41:21 | FromGitter | <zacharycarter> or declare it with let if that's what you mean |
21:41:23 | FromGitter | <zacharycarter> then it will be immutable |
21:42:15 | tjyoco | How do you declare an objects field like that then? |
21:43:25 | * | miran quit (Remote host closed the connection) |
21:43:40 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b5b20c162adb6d2e8a10eb] |
21:43:42 | FromGitter | <zacharycarter> something like that |
21:45:33 | tjyoco | Hm, I thought you meant I could declare a field using let or something like that. Because I have ref objects that I want to read some fields but not be able to change them. oh well |
21:46:37 | FromGitter | <zacharycarter> I don't think you can declare a field as being immutable |
21:47:26 | * | PMunch quit (Quit: leaving) |
21:48:54 | * | vlad1777d quit (Remote host closed the connection) |
21:50:36 | FromGitter | <zacharycarter> I imagine the way to do it is provide accessor procs to the fields you want and then don't expose them |
21:51:22 | obadz | does the document explain how new() works anywhere? |
21:52:02 | tjyoco | So no shortcuts basically. Just getFoo*(bar: Bar) : type = return bar.foo; everytime |
21:52:32 | tjyoco | obadz, https://nim-lang.org/docs/system.html#new,ref.T |
21:53:20 | obadz | tjyoco: thanks. so it takes a var ref T. how's that different from a ref T ? |
21:53:43 | FromGitter | <superfunc> @obadz that means its mutable |
21:53:46 | obadz | or is that like a var (ref T) |
21:53:55 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/QiMm/Screen-Shot-2017-09-10-at-5.53.39-PM.png) |
21:53:55 | obadz | superfunc: aren't all refs mutable? |
21:54:47 | tjyoco | zacharycarter, that looks harder to understand than dwarf fortress |
21:55:12 | FromGitter | <zacharycarter> well it's totallyr andom atm |
21:55:40 | tjyoco | just messing around lol |
21:55:42 | FromGitter | <zacharycarter> :P |
21:55:59 | FromGitter | <zacharycarter> I guess I can start coding the roguelike now? |
21:57:08 | tjyoco | are you just using sdl2 |
21:57:30 | * | mahmudov quit (Ping timeout: 240 seconds) |
21:58:48 | FromGitter | <zacharycarter> nope |
21:58:49 | tjyoco | @obadz I think when something says var in front that means that the object you pass is changed directly. Not having that creates a copy and changes only the copy |
21:59:14 | FromGitter | <zacharycarter> tjyoco: this uses my game engine https://github.com/zacharycarter/zengine |
21:59:35 | obadz | is var ref T the same as var (ref T) ? |
21:59:49 | obadz | i.e. it's really a mutable cell containing a reference? |
21:59:59 | obadz | would kind of be a **T in C |
22:02:21 | obadz | https://gist.github.com/obadz/c331c7657de7877c58658d04c1e4e56c ⇐ finalizer doesn't seem to be called. Is that normal? |
22:04:31 | FromGitter | <mratsim> @ipjk, @Yardanico: you can also copy paste the code from andrea’s linalg and neo (static array and seq, your choice) and rename the field. |
22:09:33 | FromGitter | <zacharycarter> obadz: I has no idea... it looks to me like it should be getting called but Araq or someone who knows the language better than I do would be a better person to ask |
22:19:37 | FromGitter | <superfunc> the vscode plugin is pretty nice, im enjoying it over the nim.vim one, and their vim emulation is solid enough for me |
22:20:35 | adam12 | Does ctrl-z (suspend) insert any characters? That's the hardest part of me switching editors (and finding :wq in files that don't compile :\) |
22:20:41 | obadz | @superfunc: have you tried this one: https://github.com/baabelfish/nvim-nim ? |
22:21:12 | adam12 | obadz: Oh very nice. I just installed zah/nim.vim today. |
22:21:21 | obadz | adam12: me too :) |
22:21:36 | FromGitter | <superfunc> @obadz: I havent, I saw it hadn't been updated in forever so I kinda didnt bother |
22:23:04 | FromGitter | <superfunc> I'll give it a shot today |
22:23:18 | obadz | (I haven't tried it myself) |
22:25:19 | * | FromGitter * superfunc rolls the dice |
22:38:27 | FromGitter | <cabhishek> @adam12 did zah/nim.vim work as expected? I couldn't get it work for error checking and code navigation |
22:41:18 | adam12 | @cabhishek Only spent a few minutes with it so far. Haven't tried error checking or code navigation. Syntax highlighting looks OK |
22:41:40 | adam12 | I haven't touched nim since 2015. Just taking another look at it now and realized I needed syntax highlighting :) |
22:44:39 | FromGitter | <cabhishek> @adam12 ok! well, syntax highlighting works great. But that's all I could get it to work out of the box. |
22:48:10 | * | ipjk quit (Quit: Leaving) |
22:50:24 | * | tjyoco quit (Ping timeout: 260 seconds) |
22:52:22 | * | tjyoco joined #nim |
22:53:49 | tjyoco | im using the nim/vim plugins for vscode as well and they work pretty darn good. I tried forever and syntax highlighting was the only thing I could get working in Vim so I gave up. |
23:03:54 | FromGitter | <zacharycarter> anyone good with strscans module? |
23:04:15 | FromGitter | <zacharycarter> I'm trying to capture a word between two qutoation marks using scanf |
23:04:18 | FromGitter | <zacharycarter> assert scanf(subStr, "file=\"$w\"", texFileName) |
23:04:21 | FromGitter | <zacharycarter> not working... |
23:17:01 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:20:05 | * | tjyoco quit (Quit: Page closed) |
23:22:07 | * | enthus1ast- quit (Ping timeout: 260 seconds) |
23:22:36 | FromGitter | <cabhishek> @zacharycarter https://play.nim-lang.org/?gist=2f3fb7480579146f719fbdb630a90a08 something like this? |
23:23:41 | * | SusWombat quit (Ping timeout: 240 seconds) |
23:23:46 | * | enthus1ast- joined #nim |
23:24:47 | * | xet7 quit (Ping timeout: 248 seconds) |
23:25:43 | * | xet7 joined #nim |
23:27:37 | * | SusWombat joined #nim |
23:28:35 | * | nsf quit (Quit: WeeChat 1.9) |
23:36:35 | * | dddddd quit (Ping timeout: 240 seconds) |
23:39:34 | * | couven92 quit (Read error: Connection reset by peer) |
23:40:54 | * | sz0 quit (Quit: Connection closed for inactivity) |
23:50:00 | * | smt` quit (Quit: Leaving) |
23:54:58 | * | ryu0 joined #nim |
23:58:52 | * | mahmudov joined #nim |