00:00:20 | FromGitter | <Tatazaki_twitter> So I have a file called 'config.nim' in the root directory of my project, and a file called 'color.nim' in a subfolder called 'visualworks'. How would I go about importing config.nim in color.nim? |
00:01:29 | * | thomasross quit (Remote host closed the connection) |
00:02:15 | * | thomasross joined #nim |
00:02:17 | FromGitter | <Tatazaki_twitter> ...nevermind. (the answer: "../config") |
00:04:47 | * | Jesin joined #nim |
00:16:11 | * | dddddd joined #nim |
00:17:03 | * | mahmudov quit (Ping timeout: 248 seconds) |
00:17:10 | * | Jesin quit (Quit: Leaving) |
00:24:29 | * | yglukhov quit (Remote host closed the connection) |
00:25:23 | * | Jesin joined #nim |
00:25:24 | * | Jesin quit (Remote host closed the connection) |
00:27:45 | * | Jesin joined #nim |
00:30:07 | * | dddddd quit (Quit: Hasta otra..) |
00:36:32 | FromGitter | <zacharycarter> thanks @cabhishek kind of like that... I'm not sure scanf is the right tool for what I'm trying to do |
00:37:47 | FromGitter | <zacharycarter> basically I'm trying to capture all the text between two double quotes |
00:38:06 | FromGitter | <zacharycarter> without resorting to pcre etc |
00:40:14 | FromGitter | <Tatazaki_twitter> does it error or does it keep running? |
00:40:39 | FromGitter | <zacharycarter> does what error? |
00:40:54 | FromGitter | <Tatazaki_twitter> your scanf. |
00:41:35 | FromGitter | <zacharycarter> well that's the thing I'm not sure how to write the scanf to do what I want |
00:42:35 | ryu0 | "\"%[^"]\"" ? |
00:42:52 | FromGitter | <zacharycarter> I think that'd work for C's scanf |
00:42:56 | FromGitter | <zacharycarter> not sure about Nims but I'll try |
00:45:17 | ryu0 | appears nim's scanf has nothing like it. maybe you can try writing a function to extend. it appears to support it. |
00:45:20 | ryu0 | ${} and $[] |
00:47:08 | FromGitter | <zacharycarter> I guess I"ll have to |
00:47:25 | FromGitter | <zacharycarter> I figured there'd already be an easy way to do this |
00:56:29 | * | tjyoco joined #nim |
01:08:07 | * | int0x01 joined #nim |
01:08:57 | * | int0x01 quit (Client Quit) |
01:17:56 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=2a7fe4f311c9e1a1af1ce0fc75b763d7 |
01:23:21 | FromGitter | <zacharycarter> anyone have any idea how to get the last occurrence of a char in a string? |
01:24:12 | * | Jesin quit (Quit: Leaving) |
01:26:33 | * | chemist69 quit (Ping timeout: 252 seconds) |
01:27:00 | FromGitter | <superfunc> @zacharycarter `rfind`? |
01:27:12 | FromGitter | <superfunc> https://nim-lang.org/docs/strutils.html#rfind,string,char,int |
01:28:24 | FromGitter | <zacharycarter> thank you @superfunc |
01:31:25 | FromGitter | <superfunc> np |
01:40:08 | * | chemist69 joined #nim |
01:41:46 | * | Jesin joined #nim |
01:48:11 | * | tjyoco quit (Quit: Page closed) |
01:53:44 | * | Jesin quit (Quit: Leaving) |
02:10:46 | * | Jesin joined #nim |
02:13:04 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:13:12 | * | smt joined #nim |
02:52:22 | * | jsgrant joined #nim |
02:54:14 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/Czrq/Screen-Shot-2017-09-10-at-10.53.58-PM.png) |
03:00:01 | FromGitter | <zetashift> Looks straight outta 2003, I love it |
03:15:34 | * | endragor joined #nim |
03:15:58 | FromGitter | <zacharycarter> :D |
03:17:40 | * | endragor_ joined #nim |
03:17:44 | FromGitter | <zacharycarter> can't quite get these new fonts centered hrm |
03:18:09 | * | endragor_ quit (Client Quit) |
03:19:32 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/zUEp/Screen-Shot-2017-09-10-at-11.19.10-PM.png) |
03:19:59 | * | endragor quit (Ping timeout: 248 seconds) |
03:27:07 | FromGitter | <zacharycarter> bleh maybe I should just use bearlib terminal for this tutorial |
03:29:41 | * | Nobabs27 joined #nim |
03:38:07 | * | Nobabs27 quit (Quit: Leaving) |
03:40:57 | * | jsgrant quit (Read error: Connection reset by peer) |
03:41:03 | * | pilne quit (Quit: Quitting!) |
03:41:13 | * | jsgrant joined #nim |
03:53:27 | * | Nobabs27 joined #nim |
04:06:22 | FromGitter | <zacharycarter> orrrrr I could go graphical and just ditch ascii art |
04:06:25 | FromGitter | <zacharycarter> hrm |
04:17:20 | FromGitter | <zacharycarter> so if I have a grid of 80 x 45 of 12x12 cells, apparently the magic offset is 0.5, 0.5 to get a 12x12 font to render in the center |
04:17:39 | FromGitter | <zacharycarter> how I'm supposed to arrive at that number programmatically / formulaically I have no idea |
04:28:39 | * | yglukhov joined #nim |
04:31:52 | * | vivus quit (Quit: Leaving) |
04:33:00 | * | yglukhov quit (Ping timeout: 252 seconds) |
04:34:50 | * | Nobabs27 quit (Quit: Leaving) |
04:42:39 | * | BigEpsilon joined #nim |
04:45:41 | * | jsgrant quit (Quit: jsgrant) |
04:46:04 | * | jsgrant joined #nim |
04:50:12 | * | jsgrant quit (Client Quit) |
04:50:32 | * | jsgrant joined #nim |
04:50:38 | * | jsgrant quit (Remote host closed the connection) |
05:39:00 | * | BigEpsilon quit (Ping timeout: 252 seconds) |
05:47:33 | * | skrylar quit (Remote host closed the connection) |
06:00:40 | * | BigEpsilon joined #nim |
06:00:51 | * | BigEpsilon quit (Remote host closed the connection) |
06:01:11 | * | yglukhov joined #nim |
06:05:32 | * | yglukhov quit (Ping timeout: 255 seconds) |
06:09:41 | * | obadz quit (Ping timeout: 240 seconds) |
06:13:21 | * | yglukhov joined #nim |
06:13:57 | * | obadz joined #nim |
06:30:49 | * | Sentreen quit (Ping timeout: 255 seconds) |
06:31:20 | * | nsf joined #nim |
06:33:10 | * | yglukhov quit (Remote host closed the connection) |
06:38:15 | * | solitudesf joined #nim |
06:44:11 | * | Sentreen joined #nim |
06:46:08 | * | Vladar joined #nim |
06:53:12 | * | Matthias247 joined #nim |
07:03:33 | * | vivus joined #nim |
07:13:27 | FromGitter | <Grabli66> Hi. "Nim" is more modular language than object-oriented? |
07:22:54 | * | yglukhov joined #nim |
07:24:36 | * | deavmi joined #nim |
07:24:39 | * | claudiuinberlin joined #nim |
07:25:00 | deavmi | That moment when you do your first operator overload and make the most useless use out of `$` :). I'm so happy. |
07:30:37 | FromGitter | <Bennyelg> Hey Guys, How Do I handle Future object of asyncrequest |
07:30:47 | FromGitter | <Bennyelg> I want to read it when it returnes |
07:32:05 | FromGitter | <Grabli66> let result = await yourFuture ? :) |
07:32:16 | FromGitter | <Bennyelg> |
07:32:19 | FromGitter | <Bennyelg> :P |
07:32:24 | FromGitter | <superfunc> you can also set a callback |
07:32:50 | FromGitter | <superfunc> ``` proc (future: Future[string]) = ⏎ echo("value: ", future.read)``` [https://gitter.im/nim-lang/Nim?at=59b63c22210ac26920180a41] |
07:33:02 | livcd | I wonder how much is the js backend used |
07:33:32 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b63c4c177fb9fe7ea6916b] |
07:33:35 | FromGitter | <Bennyelg> what is wrong ? |
07:34:30 | FromGitter | <Grabli66> You can use await only in async proc. You need write let res = waitFor response |
07:34:50 | FromGitter | <Bennyelg> oh Now I undertstand the concept |
07:35:00 | FromGitter | <Bennyelg> So I need to compile it --threads:on? |
07:35:07 | FromGitter | <Grabli66> No |
07:35:26 | FromGitter | <Grabli66> Async does not use threads |
07:35:38 | FromGitter | <superfunc> Async is for concurrency, not parallelism |
07:37:11 | deavmi | How to I create a setter for a Human object (also second question, is there a root like top-type for all objects via inheritance for Nim like in Java, D etc.??) |
07:38:24 | * | PMunch joined #nim |
07:39:14 | deavmi | I have a `proc setAge(obj: Human, age: int) = ` and the body is `obj.age = age`. Gives a compilation error that such an assignment is not allowed |
07:39:45 | FromGitter | <superfunc> deavmi: try `proc setAge(obj: var Human, age: int) = ` as the type sig |
07:40:00 | FromGitter | <superfunc> deavmi: by default, that param is immutable, so it can't be assigned to |
07:40:16 | deavmi | Oh, and var what does that do? Doesn't that take in a refernce or something? |
07:40:19 | deavmi | To the object? |
07:40:26 | deavmi | or just mutable? |
07:41:18 | deavmi | Ah that works. Thanks |
07:43:39 | FromGitter | <superfunc> deavmi: np, https://nim-lang.org/docs/tut1.html#procedures-parameters for more info |
07:43:58 | FromGitter | <superfunc> I'm not sure on your second question, don't really write in OO style personally |
07:44:26 | deavmi | superfunc: Thanks tho :) |
07:44:51 | FromGitter | <superfunc> deavmi: happy to help where I can |
07:45:58 | deavmi | And that's why I love programming language communities. They have the best people (maybe besides Java, they're alright) |
07:46:54 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:48:09 | deavmi | Is the compiler meant to give an error `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` when I do `var kak: prt` |
07:48:14 | * | couven92 joined #nim |
07:48:15 | deavmi | I must be doing something wrong XD |
07:48:46 | deavmi | ah nvm |
07:48:46 | livcd | how good is XML parsing in nim ? as in performance,support,libs |
07:48:47 | deavmi | Got it |
07:49:44 | FromGitter | <superfunc> livcd: the builtin module has been sufficient for my needs |
07:50:05 | FromGitter | <superfunc> https://nim-lang.org/docs/parsexml.html |
07:51:15 | livcd | cool |
07:51:24 | livcd | i wish i could also talk to soap apis but i guess nim is not there yet |
07:51:25 | livcd | or is it ? |
07:51:39 | * | claudiuinberlin joined #nim |
07:51:46 | deavmi | How does one create a pointer variable |
07:51:49 | deavmi | untraced |
07:52:00 | PMunch | addr(x) |
07:52:10 | FromGitter | <Grabli66> proc `=?=`. It's ugly. :) |
07:52:11 | PMunch | Returns an untraced ptr to x |
07:52:32 | deavmi | Thanks |
07:53:13 | deavmi | and once I have the pointer, how do I derefenece it? |
07:53:18 | deavmi | * dereferene |
07:53:21 | PMunch | x[] |
07:53:28 | PMunch | With nothing in the brackets |
07:54:02 | deavmi | ah |
07:54:48 | PMunch | livcd, you certainly could do it with HTTP requests and the xmltools package. But AFAIK there's no ready built module to talk to a SOAP API in Nim |
07:54:54 | PMunch | You could always create one :) |
07:56:57 | deavmi | and with traced (a.ak.a reference types) how does one assign to my `var reffy: ref int` a traced reference |
07:57:44 | deavmi | ah |
07:57:45 | deavmi | also [] |
07:58:06 | deavmi | fordereference |
07:59:08 | * | Arrrr joined #nim |
08:00:04 | PMunch | With reference types Nim is smart enough to automatically dereference |
08:02:57 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:03:07 | * | vivus quit (Quit: Leaving) |
08:05:25 | * | deavmi quit (Quit: leaving) |
08:05:56 | * | deavmi joined #nim |
08:06:22 | * | bozaloshtsh quit (Ping timeout: 264 seconds) |
08:06:57 | * | ldlework quit (Ping timeout: 252 seconds) |
08:07:27 | * | abeaumont quit (Ping timeout: 248 seconds) |
08:07:53 | * | abeaumont joined #nim |
08:08:20 | * | ldlework joined #nim |
08:08:21 | * | bozaloshtsh joined #nim |
08:08:21 | * | bozaloshtsh quit (Changing host) |
08:08:21 | * | bozaloshtsh joined #nim |
08:22:53 | FromGitter | <superfunc> Does anyone know where `seq` is defined in the repo? |
08:23:24 | PMunch | I think it's defined as a magic |
08:23:58 | PMunch | Was there anything in particular you were wondering about? |
08:24:23 | FromGitter | <superfunc> Nope, just wanted to learn about its internals |
08:27:06 | FromGitter | <superfunc> I guess one thing I had been curious about was what its growth factor is |
08:41:16 | * | dom96|w joined #nim |
08:42:18 | * | claudiuinberlin joined #nim |
08:43:42 | Araq_ | it's 1.5 |
08:44:04 | FromGitter | <superfunc> Cool thanks |
08:47:00 | * | claudiuinberlin quit (Client Quit) |
08:48:55 | * | claudiuinberlin joined #nim |
08:50:33 | PMunch | Has anyone tried using Nim and Electron? |
08:51:31 | FromGitter | <k0pernicus> @dom96: Thanks for the comments :-) I will update the code this evening ;-) |
08:51:40 | FromGitter | <k0pernicus> (and make a new PR after that) |
09:20:34 | * | Yardanico joined #nim |
09:30:48 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:33:13 | * | haha_ joined #nim |
09:37:32 | * | mahsav quit (Ping timeout: 260 seconds) |
09:44:34 | * | haha_ quit (Quit: haha_) |
09:50:48 | PMunch | Hmm, is there a js2nim tool? |
09:52:15 | FromGitter | <Bennyelg> Any script with example of using async await |
09:57:34 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
09:58:04 | * | vlad1777d joined #nim |
09:58:04 | * | yingjun joined #nim |
09:58:09 | yingjun | hello there |
09:58:27 | yingjun | I heard Nim not supports compiling to Android? |
09:58:38 | federico3 | Bennyelg: Jester for example? |
09:59:23 | yingjun | can somebody give me some example about how to compile to android? |
10:02:01 | * | dom96|w joined #nim |
10:02:38 | * | dddddd joined #nim |
10:02:43 | Araq | yingjun: hi, I smell a troll here. |
10:03:37 | * | claudiuinberlin joined #nim |
10:03:50 | yingjun | Hi Araq |
10:03:56 | yingjun | glad to talk with you |
10:04:22 | * | couven92 quit (Read error: Connection reset by peer) |
10:06:38 | FromGitter | <Grabli66> Can i assign typedesc to variable? Nim does not want to do that. Error: 'typedesc' metatype is not valid here; typed '=' instead of ':'? |
10:06:57 | yingjun | my another question is about cookie |
10:07:27 | yingjun | can somebody give me an example about saving a cookie from a http request? |
10:08:40 | enthus1ast- | yingjun: server sets the cookie in its response header |
10:09:07 | yingjun | and then? |
10:09:20 | enthus1ast- | then you have it in headers ;) |
10:09:41 | yingjun | I see. Seems there is a 'cookies' module in Nim? |
10:09:53 | * | ldlework quit (Ping timeout: 255 seconds) |
10:10:37 | Araq | wasting our time counts as trolling ;-) |
10:12:02 | * | ldlework joined #nim |
10:15:42 | ryu0 | https://www.youtube.com/watch?v=VjA9uJ2dFCI |
10:17:17 | * | yingjun quit () |
10:17:31 | * | yingjun joined #nim |
10:21:43 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
10:25:56 | * | dom96|w joined #nim |
10:26:33 | * | ShalokShalom_ joined #nim |
10:29:21 | * | ShalokShalom quit (Ping timeout: 248 seconds) |
10:39:29 | PMunch | Just for reference (if someone reads this IRC log). Nim compiles to Android just fine, just check out the nim-sdl-template for example. |
10:39:43 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:03:31 | FromGitter | <Bennyelg> When I write var s = await FutureObject ⏎ How can I get s data? |
11:05:34 | enthus1ast- | s is the data then is suppose |
11:06:33 | * | arnetheduck joined #nim |
11:10:48 | * | mahmudov joined #nim |
11:10:56 | FromGitter | <zacharycarter> s.read() |
11:11:44 | FromGitter | <zacharycarter> maybe not |
11:12:17 | ryu0 | What is the recommended way of learning Nim if you already have experience with other languages? Reading the language reference? |
11:12:56 | Arrrr | Check out `tutorials` https://nim-lang.org/documentation.html |
11:12:57 | Yardanico | Bennyelg: if you do "await", "s" will contain the result |
11:13:10 | FromGitter | <Grabli66> Read manual, read reference, read "Nim in action" :) |
11:13:38 | Arrrr | I read everything i could, asked here and on the forum, and from time to time check out the manual |
11:14:58 | ryu0 | Thanks. |
11:16:33 | * | ryu0 left #nim (#nim) |
11:23:30 | FromGitter | <zetashift> I also liked the Nim By Example site |
11:34:11 | * | claudiuinberlin joined #nim |
11:40:26 | * | yingjun quit (Remote host closed the connection) |
11:41:40 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:43:05 | * | mahsav joined #nim |
11:43:47 | * | yingjun joined #nim |
11:45:02 | * | yingjun quit (Remote host closed the connection) |
11:58:09 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:00:46 | * | claudiuinberlin joined #nim |
12:06:15 | * | Snircle joined #nim |
12:15:27 | Yardanico | https://github.com/nim-lang/Nim/wiki/IRC-guidelines/_compare/b3daddb%5E...b3daddb :) |
12:25:05 | * | enthus1ast- quit (Ping timeout: 248 seconds) |
12:25:12 | PMunch | Hmm, how would you communicate between a Nim JS program running under node and a Nim C program? |
12:26:02 | Araq | websockets |
12:28:26 | * | Matthias247 quit (Read error: Connection reset by peer) |
12:28:27 | yglukhov | or just sockets? =) |
12:28:38 | PMunch | yglukhov, sockets work in JS? |
12:28:50 | yglukhov | should work in node, i think. |
12:29:02 | yglukhov | not in browser, ofc |
12:29:29 | yglukhov | otherwise, how would nodejs become a popular backend platform? |
12:29:42 | PMunch | Haha, good point :P |
12:32:15 | * | ShalokShalom_ is now known as ShalokShalom |
12:45:30 | * | yingjun joined #nim |
12:45:33 | PMunch | Hmm yglukhov I get an error that os is not imported to my system when I try to import net or sockets |
12:46:33 | PMunch | websockets seems like it's the way to go |
12:47:14 | yglukhov | PMunch: oh, you're trying to use nim sockets in nodejs? no, that's not gonna work. You'll have to use something more native to nodejs. |
12:47:38 | yglukhov | if websockets work for you, then you're all set, i guess =) |
12:48:38 | PMunch | Well my goal here is to be able to write a program in Nim which compiles to C (since it requires C libraries). Then I want to write some Nim JS code to interface the application with Electron. I've got Nim JS talking to electron, so now I need a way to bind together my Nim C code and my Nim JS code. |
12:50:48 | * | yingjun quit (Ping timeout: 240 seconds) |
12:51:28 | federico3 | PMunch: are the two codebases running on different hosts or locally? |
12:51:52 | PMunch | Locally |
13:03:36 | PMunch | Okay, got it working now by using net in the Nim C code and https://nodejs.org/api/net.html for the JS side |
13:03:55 | yglukhov | yup, thats what i was talking about =) |
13:05:42 | * | ipjk joined #nim |
13:11:36 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:13:48 | * | mahmudov quit (Remote host closed the connection) |
13:14:13 | * | Matthias247 joined #nim |
13:16:38 | Yardanico | ohhhhh |
13:16:39 | Yardanico | https://github.com/Araq/ormin |
13:16:46 | * | claudiuinberlin joined #nim |
13:18:02 | * | claudiuinberlin quit (Client Quit) |
13:18:11 | Yardanico | I'm not sniping, it's all is github feed :P |
13:18:42 | PMunch | Haha |
13:18:46 | PMunch | Nice project |
13:18:58 | * | claudiuinberlin joined #nim |
13:21:00 | * | dom96|w joined #nim |
13:24:46 | yglukhov | dom96: regarding https://github.com/nim-lang/nimble/pull/404 . does my comment make sense? |
13:26:23 | * | dom96|w quit (Ping timeout: 248 seconds) |
13:31:58 | FromGitter | <dandevelop> has anyone compiled Nim on windows with Visaul C++ ? If so, how did you modify build64.bat? |
13:32:52 | Yardanico | well, I want to ask you.. do you really want to do that? |
13:33:02 | Yardanico | you can build it using mingw and then compile your programs using VCC |
13:33:49 | Yardanico | but I don't really know how to compile Nim itself with VCC, I didn't try to do it |
13:38:14 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:40:04 | PMunch | Hmm, https://github.com/PMunch/nim-electron |
13:40:09 | PMunch | Pretty barebones, but it works |
13:40:10 | FromGitter | <dandevelop> @Yardanico Which mingw installer did you use on Windows? |
13:40:32 | Yardanico | https://sourceforge.net/projects/mingw-w64/ |
13:41:05 | Yardanico | online mingw-w64 installer: https://sf.net/p/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download |
13:41:16 | Yardanico | and yeah, it's gcc 7.1 :) |
13:43:26 | * | tjyoco joined #nim |
13:45:09 | FromGitter | <dandevelop> @Yardanico what did you select for Architecture, threads and exception? |
13:45:27 | Yardanico | arch - select x86_64, others - just default |
13:46:01 | tjyoco | I'm trying to understand macros and I get this 'type expected' error. How do I create procs like this? https://www.hastebin.com/kegewoxoru.nim |
13:46:33 | Yardanico | tjyoco, well you shouldn't use strings in macros for code generation |
13:46:37 | Yardanico | you should use AST |
13:47:17 | tjyoco | ah okay, one of the examples had it on the docs and I thought it looked easier. I'll give AST a shot. |
13:47:45 | Yardanico | tjyoco, well it looks easier for simple stuff maybe, but not for hard stuff |
13:47:53 | Yardanico | tjyoco, what example contains strings as the code? |
13:48:01 | Yardanico | ah, yeah |
13:48:14 | Yardanico | parseStmt and parseExpr can be used for parsing strings into code |
13:48:45 | tjyoco | yeah, its "Generating source code" from nim tut pt2 |
13:49:09 | Yardanico | ah I see |
13:49:09 | * | claudiuinberlin joined #nim |
13:49:27 | Yardanico | but it's not generally recommended |
13:49:33 | * | PMunch quit (Quit: Leaving) |
13:49:33 | tjyoco | gotcha |
13:49:38 | Yardanico | I'll fix your code now |
13:50:04 | tjyoco | thank you! |
13:50:27 | Yardanico | well your code isn't valid because you're trying to make a proc like this |
13:50:38 | Yardanico | proc getx(): x = x |
13:50:45 | Yardanico | so it would return "x" variable of type "x" |
13:51:00 | tjyoco | yeah, how would I get x's typedesc? |
13:51:23 | Yardanico | you would use AST for that :) |
13:52:30 | Yardanico | well I would still do it |
13:52:44 | tjyoco | I'll give it a shot. So just dumptree: >insert example code and duplicate what pops out? |
13:53:15 | Yardanico | well no |
13:53:24 | Yardanico | dumptree is used for getting AST |
13:53:41 | Yardanico | you can use dumpAstGen |
13:53:48 | tjyoco | well, yeah sorry I worded it wrong. But that would help me with structuring the statements correctly |
13:53:49 | Yardanico | but it's generally better to write code in macros by hand |
13:53:57 | Yardanico | e.g. using stuff like newProc |
13:54:13 | tjyoco | I haven't used the dumpAstGen, ill try that |
13:55:41 | * | Arrrr quit (Ping timeout: 240 seconds) |
13:56:00 | tjyoco | Oh, thats very handy. A lot easier than dumpTree lol |
13:56:28 | Yardanico | but generally you would write smaller code if you will do it by hand :) |
13:56:55 | Yardanico | but yeah |
13:57:03 | Yardanico | I've fixed your example |
13:57:17 | Yardanico | https://gist.github.com/Yardanico/dbb6bb1ef876c38cf06ca64ae4252127 |
13:58:03 | FromGitter | <Grabli66> Yardanico, can i store typedesc in some variable. And then create new object from that variable? |
13:58:25 | Yardanico | in a macro? |
13:58:37 | tjyoco | Your a nim-wizard Yardanico thanks |
13:58:40 | FromGitter | <Grabli66> No |
13:58:47 | Araq | hell no, it's called "static typing", you are supposed to know your types |
13:58:57 | Araq | if you don't just use JSON |
13:59:16 | Araq | don't fuck around with typedesc, it's a compiletime-only metatype |
13:59:31 | FromGitter | <Grabli66> Ok |
14:04:54 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:07:59 | * | tjyoco quit (Ping timeout: 260 seconds) |
14:10:06 | * | claudiuinberlin joined #nim |
14:11:14 | * | ldlework quit (Changing host) |
14:11:14 | * | ldlework joined #nim |
14:12:31 | * | tjyoco joined #nim |
14:19:58 | * | sz0 joined #nim |
14:22:54 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:29:12 | * | claudiuinberlin joined #nim |
14:46:20 | * | tjyoco quit (Quit: Page closed) |
14:48:15 | * | yglukhov quit (Remote host closed the connection) |
14:48:33 | * | yingjun joined #nim |
14:52:48 | * | yingjun quit (Ping timeout: 240 seconds) |
14:54:58 | * | Trustable joined #nim |
14:59:37 | * | nigga21 joined #nim |
14:59:55 | * | nigga21 quit (Client Quit) |
14:59:56 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:04:12 | * | spica joined #nim |
15:05:34 | spica | Hey guys. I'm a noob playing with nim. A question. Why does a continue inside a block without look give (SIGSEGV: Illegal storage access. (Attempt to read from nil?))? A bug or a feature? |
15:05:59 | spica | https://pastebin.com/p6n0nnaL |
15:06:40 | spica | block without loop* |
15:09:01 | Yardanico | spica, because it seems to be a compiler error |
15:09:05 | Yardanico | report it on github |
15:09:11 | Yardanico | but using "continue" in a block is pointless |
15:09:32 | Yardanico | "continue" is only used in "while" and "for" |
15:09:35 | Yardanico | loops |
15:09:58 | spica | I know it's pointless, I was trying to see what happens, I was trying to emulate a loop using block and labeled continue, but it didn't work |
15:10:15 | Yardanico | spica, well there's no labeled continue in nim AFAIK |
15:10:29 | Yardanico | but I might be wrong |
15:10:33 | spica | well, I know now. There's in java afaik, so I was just curious |
15:12:12 | livcd | I need to parse xmls and save the output as kv pairs in a database (or convert to huge simple json of { "lah":"lah","lah":"lah",...}. The xmls can have arbitrary structure and what I am interested in would be to just grab all xmlnodes and get values |
15:12:35 | * | arnetheduck quit (Ping timeout: 240 seconds) |
15:12:39 | * | enthus1ast- joined #nim |
15:12:56 | Yardanico | livcd, https://nim-lang.org/docs/parsexml.html ? |
15:13:05 | livcd | how easy / possible would this be in Nim ? ( i mean python/ruby would be better suited for this but I kinda need this standalone binary type of program) |
15:13:19 | Yardanico | well https://nim-lang.org/docs/parsexml.html is a very high performance XML/HTML parser |
15:13:23 | livcd | Yardanico: yes but don't i need to define the data structure first ? (as in knowing how it will look like?) |
15:13:37 | Yardanico | livcd, no, you don't, if you just want to grab all nodes |
15:13:48 | Yardanico | you don't generally need to define the data structure |
15:15:10 | * | spica quit (Quit: Leaving) |
15:15:13 | livcd | ok thanks |
15:23:44 | * | nsf quit (Quit: WeeChat 1.9) |
15:24:41 | livcd | Yardanico: ok right i will do one version in go and one in nim. I will use dictionary for both to get the kv |
15:25:12 | Yardanico | ok, but use string table if you have string:string table :) |
15:25:15 | Yardanico | "strtabs" module |
15:25:22 | Yardanico | it's faster than usual Table[string, string] |
15:26:02 | livcd | Yardanico: thanks |
15:37:34 | Araq | huh? that's news to me |
15:37:46 | Araq | did some benchmarking? |
15:38:52 | * | Arrrr joined #nim |
15:38:52 | * | Arrrr quit (Changing host) |
15:38:52 | * | Arrrr joined #nim |
15:43:42 | * | yglukhov joined #nim |
15:45:21 | Yardanico | Araq, but I thought it would be faster - it says "The strtabs module implements an efficient hash table that is a mapping from strings to strings. " |
15:47:18 | Araq | it predates generics and was kept because it allows case insensitive mappings |
15:47:59 | * | yglukhov quit (Ping timeout: 240 seconds) |
15:49:38 | Yardanico | Araq, oh, thanks then, I didn't knew about it |
15:55:29 | * | claudiuinberlin joined #nim |
16:01:07 | * | yglukhov joined #nim |
16:02:10 | * | Ven`` joined #nim |
16:02:29 | * | vendethiel- quit (Ping timeout: 240 seconds) |
16:04:35 | * | mahsav quit (Ping timeout: 240 seconds) |
16:04:51 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:08:19 | * | StarBrilliant quit (Quit: ZNC - http://znc.in) |
16:08:41 | * | StarBrilliant joined #nim |
16:16:48 | FromGitter | <Grabli66> I am trying to compile with --threads:on, but i get error "'callbackIter' is not GC-safe as it performs an indirect call here". What to do? |
16:19:04 | Yardanico | you use async, right? |
16:19:17 | FromGitter | <Grabli66> Yes |
16:19:27 | Yardanico | then you need to make sure you're not using any global variables |
16:19:41 | Yardanico | or, if you're using them and they're only for one thread, mark then with {.threadvar.} pragma |
16:20:07 | Yardanico | but yeah, it's all about gc safety |
16:21:14 | * | mahsav joined #nim |
16:22:08 | * | claudiuinberlin joined #nim |
16:23:30 | Yardanico | nim has local thread GC heap |
16:24:31 | FromGitter | <Grabli66> I'll try to not use global variables |
16:24:40 | Yardanico | well you can use them |
16:24:55 | Yardanico | but use {.threadvar.} if you're sure you use this variable locally in one thread |
16:25:41 | FromGitter | <Grabli66> I marked my global Table with {.threadvar.}. But it's not helped |
16:26:49 | FromGitter | <Grabli66> And also i got error "a thread var cannot be initialized explicitly" :) |
16:27:32 | FromGitter | <Grabli66> I think it's better rewrite with objects |
16:29:29 | * | sz0 quit (Quit: Connection closed for inactivity) |
16:30:34 | * | solitudesf quit (Remote host closed the connection) |
16:31:35 | * | mal`` quit (Ping timeout: 240 seconds) |
16:31:50 | * | mal`` joined #nim |
16:35:02 | FromGitter | <Grabli66> Ok. I am understood. It does not like callbacks. |
16:35:35 | Yardanico | ah |
16:35:45 | Yardanico | try to mark your callback with {.gcsafe.} pragma |
16:37:01 | FromGitter | <Grabli66> Great. It works. Thanks. |
16:37:12 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
16:37:41 | * | mahsav quit (Read error: Connection reset by peer) |
16:39:13 | * | abeaumont quit (Ping timeout: 255 seconds) |
16:39:36 | FromGitter | <Grabli66> Maybe you know what to do with error "'yield' cannot be used within 'try' in a non-inlined iterator"? |
16:39:39 | * | mahsav2 joined #nim |
16:39:50 | Yardanico | yes |
16:39:53 | Yardanico | don't use "await" in try |
16:40:01 | Yardanico | don't use try at all |
16:40:03 | Yardanico | for await calls |
16:40:15 | Yardanico | https://nim-lang.org/docs/asyncdispatch.html#asynchronous-procedures-handling-exceptions |
16:40:27 | Yardanico | this is the best way for handling exceptions with futures |
16:40:28 | FromGitter | <adamrezich> weird question: there shouldn't be anything wrong with setting a table to nil, right? |
16:40:29 | FromGitter | <superfunc> so await is like yoda |
16:40:34 | FromGitter | <adamrezich> LOL |
16:40:41 | Yardanico | well no :) |
16:40:50 | Yardanico | it's just not a built-in language feature |
16:40:53 | FromGitter | <Grabli66> Ok |
16:40:53 | Yardanico | it's just a macro |
16:42:48 | Yardanico | async/await is easy-to-use if you've used python asyncio for example :) |
16:44:03 | FromGitter | <superfunc> @adamrezich I dont think so, presuming you mean TableRef |
16:44:10 | Yardanico | yeah |
16:44:15 | * | mahsav2 quit (Ping timeout: 248 seconds) |
16:44:15 | Yardanico | well you can do it |
16:44:24 | Yardanico | but any future access to it will throw SIGSEGV |
16:44:28 | FromGitter | <adamrezich> it's actually an OrderedTableRef |
16:44:30 | FromGitter | <adamrezich> but yeah |
16:44:37 | FromGitter | <superfunc> Sure yeah that should be fine |
16:44:54 | FromGitter | <adamrezich> well it's causing an error very rarely and idk why |
16:45:16 | * | relax joined #nim |
16:45:23 | FromGitter | <superfunc> Hmm, what kind of errors? |
16:46:52 | FromGitter | <adamrezich> well so I'm making a complex game engine, and new `Elem`s (entities) are created in the memory manager with a proc `result = castptr Elem (alloc(sizeof(Elem)))`—first off, is that bad? |
16:47:34 | FromGitter | <superfunc> Stepping back, are you sure you need to manage the memory yourself? |
16:47:35 | Yardanico | well you really need custom memory management? |
16:47:38 | Yardanico | yeah |
16:47:48 | FromGitter | <superfunc> It might be better to just controll gc passes instead |
16:47:49 | FromGitter | <adamrezich> I'd like to, for game performance :\ |
16:47:55 | Yardanico | well you wouldn't lose any performance |
16:48:01 | Yardanico | you can set max GC pause for GC |
16:48:13 | Yardanico | https://nim-lang.org/docs/gc.html |
16:48:28 | Yardanico | there's realtime gc |
16:49:02 | Yardanico | The GC is only triggered in a memory allocation operation. It is not triggered by some timer and does not run in a background thread. |
16:50:00 | Yardanico | but yeah, I don't know about much about Nim GC performance because I don't use it for realtime stuff (I don't write software which requires realtime) :) |
16:51:20 | Yardanico | you already can, for example, specify the size of a seq, so it wouldn't reallocate memory |
16:53:02 | FromGitter | <adamrezich> well one of the main goals of my engine is to experiment with object hierarchies and component-based design, in a way that compromises ease of use and performance. it's hard to explain but instead of having a global collection of entities and components or whatever, Elems are created in a hierarchy (with pointers), and they have pointers to Comps (components). traditionally in C++ I'd allocate the Comps in a global |
16:53:02 | FromGitter | ... collection per Comp subclass, but I'm experimenting with having Elems in the hierarchy contain the Comp allocators. thus, I can make an Elem called "world", attach a "PhysicsRealm" Comp to it, then add child Elems to "world" with "CircleCollider" Comps, and it'll allocate them in an allocator in the "world" elem, s ... [https://gitter.im/nim-lang/Nim?at=59b6bf6e177fb9fe7ea9b1a7] |
16:53:14 | FromGitter | <adamrezich> so it could be that I'm having a GC issue, because otherwise it works flawlessly :( |
16:54:25 | Yardanico | well you can make a bug report if you've encoutered some gc bug |
16:54:51 | FromGitter | <superfunc> Yeah, my rec would be to go through standard ref facilities and report any issues you run into, I think it should be possible |
16:55:33 | FromGitter | <adamrezich> lemme trigger the error so I can show you real quick |
17:00:18 | FromGitter | <adamrezich> github: https://github.com/rezich/nch error, caused randomly by spamming spacebar to fire a ton of bullets: https://pastebin.com/cnFxeLfj |
17:00:43 | FromGitter | <Yardanico> Well it's most probably a GC bug |
17:01:53 | FromGitter | <superfunc> The traceback is in gc.nim, but it'd be hard for me to discern rn since its all going through manual memory management |
17:02:10 | FromGitter | <superfunc> Sorry I don't have much time to look at the moment |
17:03:38 | FromGitter | <adamrezich> it's also important to note that i'm allocating Comps by doing `alloc(sizeof(T) * compReg.perPage)`. it's a paged memory manager, allowing the user to specify how many of each specific type of Comp they want per page of each Comp. i.e. you want like 2 PlayerControllers, but 2048 CircleColliders, etc. |
17:03:59 | FromGitter | <adamrezich> but it works 99% of the time, and only crashes when I create a bunch of stuff really fast :\ |
17:04:29 | FromGitter | <superfunc> I'd wait for @Araq to be around, he'd probably have the clearest understanding to help you there |
17:05:15 | Yardanico | yeah :) |
17:06:21 | FromGitter | <adamrezich> k, sounds good |
17:06:51 | FromGitter | <adamrezich> I just tried `--gc:v2` and it does the same thing, with the same error lines in gc.nim, but with the error lines from assign.nim omitted o_O |
17:07:24 | Yardanico | try mark and sweep gc |
17:07:44 | FromGitter | <adamrezich> isn't that gc:v2? |
17:08:22 | Yardanico | no |
17:08:40 | Yardanico | nim also has support for boehm gc and go gc :) |
17:09:39 | FromGitter | <superfunc> `--gc:markAndSweep` |
17:09:53 | Yardanico | yeah |
17:11:13 | FromGitter | <adamrezich> it just makes it crash sooner :( |
17:11:21 | Yardanico | what about boehm gc? :) |
17:11:27 | FromGitter | <adamrezich> I can almost guarantee it's because I'm using a combination of my own alloc stuff and also nim's refs |
17:11:28 | Yardanico | but you should have boehm installed on your PC |
17:11:36 | FromGitter | <adamrezich> how do I do that? |
17:11:38 | FromGitter | <superfunc> I'd guess that its an error in your memory management |
17:11:50 | Yardanico | yeah, you should also use some GC_ref and GC_unref |
17:11:52 | FromGitter | <superfunc> Just manifests itself in the gc's |
17:12:34 | FromGitter | <adamrezich> ooh didn't know about gc_ref and gc_unref |
17:15:23 | FromGitter | <Grabli66> Why my console programm can crash on ctrl+c ? There is no exception, just dialog window that my process crashed. :( |
17:23:01 | Araq | Gabli66: which OS? signal handlers are super unsafe and I don't care about them |
17:23:19 | FromGitter | <Grabli66> Windows |
17:24:01 | FromGitter | <superfunc> @Grabli66 by default SIGINTs are handled, you can disable them |
17:24:18 | FromGitter | <superfunc> Ctrl+C == SIGINT |
17:24:54 | FromGitter | <superfunc> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b6c6e6bac826f054a4c7ef] |
17:30:05 | * | vlad1777d quit (Ping timeout: 240 seconds) |
17:36:31 | * | vlad1777d joined #nim |
17:47:00 | FromGitter | <Grabli66> Strange. Does not work. :) |
17:47:16 | FromGitter | <superfunc> oh, might be linux/mac only, sorry |
17:48:06 | FromGitter | <zacharycarter> @adamrezich maybe consider writing your framework on top of one of the existing engines? |
17:48:11 | FromGitter | <Grabli66> It compiles. But does not work. Ok. I think it's not critical. |
17:48:17 | FromGitter | <zacharycarter> like zengine *wink* *wink* |
17:50:40 | * | yingjun joined #nim |
17:55:05 | * | yingjun quit (Ping timeout: 240 seconds) |
17:55:43 | FromGitter | <adamrezich> @zacharycarter I'll definitely take a look at what you made! but I really want to make my dream engine from scratch, exactly to the specifications I want :3 |
17:56:22 | FromGitter | <zacharycarter> @adamrezich well I saw you using sdl2 etc so I was just thinking instead of using that renderer maybe you can use something built on top of it already |
17:56:26 | FromGitter | <zacharycarter> without reinventing the wheel |
17:57:33 | FromGitter | <zacharycarter> and still accomplish your goal |
17:57:43 | * | PMunch joined #nim |
17:57:56 | FromGitter | <adamrezich> I may very well end up doing that, the entity/component organization structure is what's especially interesting to me at the moment. my goal is to make an engine that lets me quickly prototype and explore 2d gameplay ideas w/ vector graphics |
17:58:56 | FromGitter | <zacharycarter> well zengine is that minus the vector graphics |
17:59:10 | FromGitter | <zacharycarter> lots of primitive drawing functions for both 2d and 3d |
17:59:31 | * | spica joined #nim |
17:59:33 | FromGitter | <zacharycarter> I'm interested to see what you cook up? |
17:59:36 | FromGitter | <zacharycarter> errr up! |
17:59:52 | FromGitter | <adamrezich> well and I eventually want 3d support as well, so I may very well hook up your engine or something else on the backend for graphics stuff |
18:00:18 | FromGitter | <adamrezich> my knowledge of graphics programming is pretty minimal, just basic vector/matrix math :p |
18:00:23 | spica | Hi guys. I'm a bit confused. "var x = int32(someOtherVar)". How does this work? int32 does't seem to be a function in system? Alias for toInt or something? |
18:01:19 | FromGitter | <zacharycarter> @adamrezich yeah I'd highly suggest giving zengine a spin, and checking out the code examples to see what I mean, it's a very unobtrusive library for prototyping so it doesn't dictate much beyond you using SDl2 | OpenGL |
18:01:26 | FromGitter | <zacharycarter> @spica thats' the same as writing |
18:01:48 | FromGitter | <zacharycarter> ``` ⏎ var x = someOtherVar.int32``` [https://gitter.im/nim-lang/Nim?at=59b6cf8c210ac269201b750d] |
18:01:55 | FromGitter | <zacharycarter> it's a cast |
18:02:06 | FromGitter | <zacharycarter> or coercion I guess |
18:02:48 | spica | well it's frigging confusing... number.int, int(number) number.int() toInt(number) |
18:02:56 | spica | kinda confusing |
18:03:55 | spica | number'i64 |
18:04:13 | spica | I guess they are all the same |
18:04:13 | FromGitter | <adamrezich> @zacharycarter yeah will do, for now I'm fine with just drawing lines and circles but as soon as I want to do more complex stuff I'll give zengine a try. it should be super simple to make a "ZengineRenderer" component in my engine, to replace the simple (SDL) Renderer component. ⏎ ⏎ since I know next to nothing about graphics programming: does zengine let you do stuff with shaders? b/c I know you can't with just |
18:04:13 | FromGitter | ... sdl |
18:04:15 | spica | I hope |
18:04:42 | FromGitter | <zacharycarter> spica: https://play.nim-lang.org/?gist=638fd33d762bc3773726767d991cef28 |
18:04:45 | Yardanico | spica, number'i64 - you DECLARE a number with that type |
18:04:58 | Yardanico | if you do int64(somenumber) you create this number and only then convert it to int64 |
18:05:12 | FromGitter | <zacharycarter> @adamrezich yup! you sure can |
18:05:21 | FromGitter | <adamrezich> rad c: |
18:05:51 | * | mahmudov joined #nim |
18:05:54 | FromGitter | <zacharycarter> I wrote this in ~6 hours with zengine |
18:06:11 | spica | okay, thanks |
18:06:24 | FromGitter | <zacharycarter> https://twitter.com/Hahaitsfunny/status/906643667544354821 |
18:06:34 | Yardanico | spica, it's UFCS |
18:06:40 | Yardanico | and optional () :) |
18:06:44 | Yardanico | well sometimes |
18:06:49 | spica | so. is there any difference between: n.int() n int int(n) int n? |
18:06:57 | Yardanico | no |
18:07:00 | spica | great |
18:07:09 | FromGitter | <zacharycarter> UFCS = you can call foo.bar() or bar(foo) |
18:07:15 | Yardanico | yeah |
18:07:17 | FromGitter | <zacharycarter> and since parens are optional |
18:07:18 | Yardanico | int(5) or 5.int() |
18:07:22 | FromGitter | <stisa> pretty sure `n int` won't work |
18:07:23 | FromGitter | <zacharycarter> you can call foo.bar |
18:07:27 | FromGitter | <zacharycarter> err sorry |
18:07:27 | spica | I've also seen that I can write: readLine readline read_line, that's also cool. is it consistent across every function? |
18:07:31 | FromGitter | <zacharycarter> bar foo |
18:07:38 | Yardanico | spica, yes |
18:07:48 | Yardanico | camelCase and snake_case identifiers are equal |
18:07:57 | spica | nice |
18:08:00 | Yardanico | you can you snake_case identifier as a camelCase one |
18:08:16 | Araq | the convention is camelCase though ;-) |
18:08:34 | spica | aha. So since int is not a function in system, is it some alias to a function call? |
18:09:09 | Yardanico | well it's a compiler *magic* |
18:09:15 | Yardanico | (not real magic though) |
18:09:20 | spica | confusing magic |
18:09:21 | Araq | no, it's an ordinary type conversion |
18:09:22 | FromGitter | <stisa> int is a type |
18:09:32 | Araq | the 'int' *type* however is builtin |
18:09:47 | Araq | like in every other language out there (more or less) |
18:09:58 | FromGitter | <adamrezich> when you instantiate a T with T(foo: 0), but T has a foo and a bar, does the bar get set to 0, or is it uninitialized? |
18:10:07 | * | enthus1ast- quit (Ping timeout: 248 seconds) |
18:10:11 | Araq | to 0 |
18:10:11 | FromGitter | <zacharycarter> 0 |
18:10:12 | Yardanico | if it's a value type - it's set to default value |
18:10:27 | Yardanico | if it's a ref - nil? |
18:10:42 | Araq | yup |
18:10:50 | FromGitter | <adamrezich> cool |
18:10:56 | FromGitter | <zacharycarter> alright roguelike library time :D |
18:11:14 | FromGitter | <adamrezich> did you see the one that someone made recently? |
18:11:16 | Yardanico | defaults for value types - https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement |
18:11:21 | FromGitter | <zacharycarter> nope! |
18:11:29 | * | d10n-work joined #nim |
18:11:55 | FromGitter | <adamrezich> erm, I thought I saw one, maybe I didn't |
18:12:20 | FromGitter | <zacharycarter> I made one a while ago but just deleted it as it's not really useful |
18:12:58 | FromGitter | <adamrezich> could've sworn I saw one the other day, maybe not |
18:22:49 | FromGitter | <adamrezich> when do you use `object` vs. `object of RootObj` for defining types? |
18:25:14 | FromGitter | <superfunc> If you want to inherit from it, see: https://nim-lang.org/docs/manual.html#types-tuples-and-object-types |
18:25:27 | FromGitter | <superfunc> The lower area of that section discusses RootObj |
18:26:00 | FromGitter | <superfunc> Key bit "Objects that have no ancestor are implicitly final and thus have no hidden type field." |
18:27:09 | FromGitter | <adamrezich> aha |
18:36:51 | * | abeaumont joined #nim |
18:41:44 | * | spica quit (Quit: Leaving) |
18:51:13 | * | claudiuinberlin joined #nim |
18:51:17 | FromGitter | <adamrezich> what's the difference in use case between tuple and object? aside from inheritance |
18:51:42 | * | vlad1777d quit (Ping timeout: 260 seconds) |
18:52:01 | FromGitter | <adamrezich> (I think I get it but I just want to be sure) |
18:53:12 | Yardanico | https://nim-lang.org/docs/manual.html#types-tuples-and-object-types |
18:53:23 | FromGitter | <superfunc> From the same section I linked to |
18:53:24 | Yardanico | there's a description |
18:56:02 | FromGitter | <adamrezich> yeah I read that I'm just trying to wrap my mind around it |
18:56:43 | FromGitter | <adamrezich> what's the point of named tuples? |
18:57:05 | FromGitter | <superfunc> I'd represent a simple type like a point2d with a named tuple, so I have x and y fields. |
18:57:21 | FromGitter | <superfunc> But I have no need for information hiding or inheritance with such a type. |
18:58:22 | FromGitter | <adamrezich> so, because you don't use the name of the tuple to instantiate it, is tuple instantiation just pattern-matched with tuple types then? |
18:58:51 | Yardanico | yes |
18:58:55 | FromGitter | <adamrezich> i.e. you have to declare all fields of it upon instantiation in order to make it an instance of the desired tuple type, and not just some new tuple type |
18:59:08 | Yardanico | well |
18:59:13 | Yardanico | if your proc returns a tuple for example |
18:59:20 | Yardanico | you can assign separate fields by using result variable |
18:59:45 | FromGitter | <adamrezich> ah, ok. but when you use assignment, you have to set all the fields, right? |
19:00:27 | * | Matthias247 quit (Quit: Matthias247) |
19:01:24 | FromGitter | <superfunc> Yeah |
19:02:11 | FromGitter | <adamrezich> cool. what happens when you do as @Yardanico said above, and have a proc that returns a tuple, but you don't declare all fields of it? are they zeroed or uninitialized? |
19:02:36 | Yardanico | all value types contain binary zero |
19:02:42 | Yardanico | all ref types are nil |
19:03:01 | FromGitter | <adamrezich> gotcha |
19:03:08 | FromGitter | <superfunc> They get there zero value yeah |
19:03:27 | * | vlad1777d joined #nim |
19:03:46 | FromGitter | <superfunc> ```code paste, see link``` ⏎ ⏎ outputs `(x: 3, y: 0)` [https://gitter.im/nim-lang/Nim?at=59b6de12b59d55b823e31e71] |
19:06:38 | Yardanico | you can also can use T: SomeNumber if you want some number :) |
19:06:55 | Yardanico | e.g. all number types like int8, int16, int32, int64, float32, float64 |
19:07:06 | FromGitter | <superfunc> Oh yeah heh, forgot about that |
19:08:15 | FromGitter | <adamrezich> SomeNumber? is that different from Number? |
19:08:38 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/Mtkt/Screen-Shot-2017-09-11-at-3.08.18-PM.png) |
19:08:40 | FromGitter | <zacharycarter> spelunking time |
19:10:59 | FromGitter | <zetashift> Is it using blt or zengine? Or just basic terminal ⭕ |
19:11:02 | Yardanico | adamrezich: SomeNumber is a generic type which covers all number types |
19:11:12 | Yardanico | it's declared in system.nim |
19:11:21 | FromGitter | <adamrezich> oh neat, hadn't seen that before |
19:11:33 | Yardanico | here |
19:11:33 | Yardanico | https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L111 |
19:12:01 | FromGitter | <zacharycarter> @zetashift it's not tied to any rendering output |
19:12:25 | * | nsf joined #nim |
19:12:26 | FromGitter | <zacharycarter> the goal here is a library for generating various types of dungeons, doing FOV, etc |
19:15:30 | * | Matthias247 joined #nim |
19:24:57 | FromGitter | <adamrezich> is it possible to write a constructor for a `ptr object` type without using alloc()? |
19:25:27 | Yardanico | well it's a raw pointer |
19:25:39 | Yardanico | but IDK :) |
19:26:00 | FromGitter | <adamrezich> right, so it needs a cast, which is ugly too. but then again, ptrs are inherently ugly (: |
19:26:25 | * | vlad1777d quit (Ping timeout: 248 seconds) |
19:26:28 | Yardanico | well because they're made for integrating with C/C++ |
19:26:33 | Yardanico | and rarely for performance |
19:27:19 | Yardanico | also it's unsafe |
19:27:59 | FromGitter | <adamrezich> yeah i'm gonna try rewriting things to not use my c++-style memory management stuff, and see how that goes |
19:28:29 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:28:59 | * | relax quit (Ping timeout: 240 seconds) |
19:30:25 | * | mahmudov quit (Ping timeout: 246 seconds) |
19:33:10 | * | vlad1777d joined #nim |
19:35:13 | * | Yardanico quit (Remote host closed the connection) |
19:39:32 | * | Trustable quit (Remote host closed the connection) |
19:39:48 | * | Pisuke joined #nim |
19:39:50 | * | claudiuinberlin joined #nim |
19:40:07 | * | MyMind quit (Ping timeout: 260 seconds) |
19:41:09 | * | mahsav joined #nim |
19:43:29 | * | vlad1777d quit (Ping timeout: 248 seconds) |
19:44:37 | * | Vladar quit (Quit: Leaving) |
19:52:16 | * | yingjun joined #nim |
19:57:00 | * | yingjun quit (Ping timeout: 252 seconds) |
19:57:06 | * | PMunch quit (Quit: leaving) |
19:59:48 | * | ipjk quit (Read error: Connection reset by peer) |
20:01:34 | * | couven92 joined #nim |
20:05:28 | FromGitter | <mratsim> @adamrezich iirc @Araq had some in-depth link about Entity COmponent System and game design |
20:06:05 | FromGitter | <mratsim> I found an implementation tuto in C: https://www.gamedev.net/articles/programming/general-and-gameplay-programming/implementing-component-entity-systems-r3382 |
20:06:48 | FromGitter | <zacharycarter> ECS = evil |
20:06:53 | FromGitter | <mratsim> and a repo with examples: https://github.com/sosolimited/Entity-Component-Samples (note I’m not a game programmer so judge the quality by yourself, it was just in my archives) |
20:06:54 | FromGitter | <zacharycarter> fyi |
20:07:22 | FromGitter | <zacharycarter> I'm not sure if @adamrezich is designing an ECS or more of a scene graph style node component system |
20:08:24 | FromGitter | <mratsim> quote: "well one of the main goals of my engine is to experiment with object hierarchies and component-based design, in a way that compromises ease of use and performance. it's hard to explain but instead of having a global collection of entities and components or whatever, Elems are created in a hierarchy (with pointers), and they have pointers to Comps (components). ..." |
20:09:54 | FromGitter | <zacharycarter> maybe conflating ideas here - ECS's tend to be geared towards organizing game logic |
20:09:57 | FromGitter | <adamrezich> yeah I'm just experimenting with ideas to see what works best. I've made several component-based frameworks in C, C++, and C# before, and I'm trying to figure out a good tradeoff between ease of use, performance, and Nimishness |
20:10:04 | * | vlad1777d joined #nim |
20:10:20 | FromGitter | <adamrezich> that's the thing, I'm designing a scene graph and ECS rolled into one |
20:10:21 | FromGitter | <zacharycarter> but there are also scene graphs that tend to employ node / component hierarchies |
20:10:28 | FromGitter | <zacharycarter> ala unity32 |
20:10:31 | FromGitter | <zacharycarter> 3d* |
20:10:38 | FromGitter | <zacharycarter> ah okay interesting |
20:11:02 | FromGitter | <zacharycarter> I've never really found an ECS I enjoy using, maybe yours will change my perception of them :) (I hope) |
20:11:07 | FromGitter | <mratsim> wasn’t there a #nim-games channel btw? |
20:11:12 | FromGitter | <zacharycarter> if not we need one |
20:12:37 | FromGitter | <mratsim> Well, soon you won’t be needed anyway ;) https://www.theverge.com/2017/9/10/16276528/ai-video-games-game-engine |
20:13:49 | FromGitter | <zacharycarter> yeah once programs start writing programs we're all screwed |
20:13:51 | FromGitter | <mratsim> When I get Arraymancer up to speed, I’m definitely using it for game AI. Google and Blizzard released an AI API for Starcraft 2 for example |
20:14:05 | FromGitter | <zacharycarter> I'm excited for that |
20:14:25 | FromGitter | <mratsim> with some auto/exercise like “Teach your AI to collect minerals and Gas Vespene" |
20:14:33 | FromGitter | <mratsim> s/auto/tuto |
20:14:41 | * | vlad1777d quit (Ping timeout: 255 seconds) |
20:19:59 | FromGitter | <mratsim> Still, there is hope: http://www.commitstrip.com/wp-content/uploads/2016/08/Strip-Les-specs-cest-du-code-650-finalenglish.jpg |
20:20:02 | * | MightyJoe joined #nim |
20:22:12 | * | beatmox_ joined #nim |
20:24:07 | * | Sentreen quit (*.net *.split) |
20:24:08 | * | joshbaptiste_ quit (*.net *.split) |
20:24:08 | * | beatmox quit (*.net *.split) |
20:24:10 | * | cyraxjoe quit (*.net *.split) |
20:24:12 | * | beatmox_ is now known as beatmox |
20:29:28 | FromGitter | <adamrezich> @mratsim @Araq happen to have that link about component systems and game design handy? I'd like to check it out |
20:30:29 | * | joshbaptiste_ joined #nim |
20:30:48 | FromGitter | <mratsim> Try the irc logs with google I guess |
20:30:57 | FromGitter | <mratsim> it was in April May |
20:31:19 | * | Sentreen joined #nim |
20:33:15 | FromGitter | <mratsim> wow looking at google results it seems like every months or so there is a discussion about ECS/EntityComponent System |
20:36:56 | obadz | I see (!) operators here and there in nim code. what does it do? |
20:37:27 | FromGitter | <superfunc> https://devdocs.io/nim/macros#!,string |
20:37:38 | * | Arrrr quit (Read error: Connection reset by peer) |
20:37:52 | FromGitter | <superfunc> Theres a few other uses, just search for `!` in the sidebar |
20:38:36 | FromGitter | <mratsim> Can’t find it @adamrezich :/, it may not have been Araq |
20:38:42 | obadz | ok I think I get it |
20:38:44 | obadz | thanks |
20:40:32 | FromGitter | <adamrezich> @mratsim thanks for looking anyways :) |
20:41:50 | obadz | is it allowed to have a ptr to an object that has a ref member? does the GC keep track of the ref member? |
20:42:07 | * | nitely joined #nim |
20:46:43 | FromGitter | <mratsim> It is allowed, but don’t do wild modifications using the pointer, they won’t be checked by the compiler |
20:49:04 | FromGitter | <mratsim> Except for C intro, in my experience, you don’t really need pointers in Nim. I even benchmarked 2 equivalent implementation of matrix multiplication one with pointers the other with seq + offset, and seq + ofset were faster. (I suppose the compiler could optimize those more aggressively) |
20:49:20 | FromGitter | <mratsim> C intro* |
20:49:28 | FromGitter | <mratsim> interop* |
20:51:45 | FromGitter | <mratsim> (matrix multiplication is a O(n3) memory bound operation, the faster your memory access are, the faster you get your result, the CPU compute is less important that getting data in the cache fast) |
20:53:01 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
20:53:39 | obadz | @mratsim: sure I'm not looking at ptr for speed but only because it seems to be the only way to share memory across threads? |
20:54:26 | FromGitter | <superfunc> channels are available for that |
20:54:48 | obadz | don't think it's appropriate for sharing a 1Gb array |
20:55:16 | FromGitter | <mratsim> You can use pointers no worry |
20:55:52 | FromGitter | <superfunc> oh yeah, didnt realize the size |
20:56:42 | obadz | I'd still want to use channels to control the flow of what's going on but eventually there needs to be something in some shared heap |
20:58:15 | FromGitter | <superfunc> yeah `allocShared` would be what you'll want |
20:59:43 | obadz | @superfunc: how can I copy an object to an allocShared area? |
21:01:25 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=0ea04dc15553f552d20450d3cd148c68 obadz |
21:02:16 | obadz | @zacharycarter: very nice, thanks! |
21:02:56 | FromGitter | <zacharycarter> sure thing |
21:03:36 | FromGitter | <superfunc> Yep, the locks module will probably come in handy for you too |
21:03:58 | FromGitter | <superfunc> The guard pragma is neat and useful for ensuring you grab a lock when accessing |
21:05:36 | obadz | whoooaaa really nice and easy |
21:05:36 | * | nsf quit (Quit: WeeChat 1.9) |
21:06:36 | obadz | also https://devdocs.io/nim/ is super useful, would be nice to have a link to it from https://nim-lang.org/documentation.html |
21:06:54 | FromGitter | <superfunc> obadz: yeah theres a bug open on the website repo for it |
21:07:12 | FromGitter | <superfunc> https://github.com/nim-lang/website/issues/45 |
21:08:06 | FromGitter | <zacharycarter> obadz: if you want to use allocshared - https://play.nim-lang.org/?gist=7cde0920d9ac9fd67b5d45e9d00ed78b |
21:12:31 | * | vlad1777d joined #nim |
21:14:52 | FromGitter | <adamrezich> https://play.nim-lang.org/?gist=6abc1e40b716bcb0c13c76edafc69424 is the syntax on line 31-32 here possible with templates and/or macros? (I haven't messed around with macros at all yet) |
21:16:19 | FromGitter | <superfunc> @adamrezich yeah |
21:16:28 | FromGitter | <superfunc> Easiest way to find out is just use dumpTree |
21:16:47 | FromGitter | <adamrezich> where/on what? |
21:17:05 | FromGitter | <superfunc> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b6fd51bc464729741fd10d] |
21:17:40 | FromGitter | <superfunc> If its valid syntax, dumpTree will succeed and spit out its AST representation at compile time |
21:18:13 | FromGitter | <superfunc> It doesn't need to be a compilable snippet, since you're just dumping the parsed AST |
21:18:55 | FromGitter | <superfunc> Then its just a matter of writing macros that will build up that AST |
21:19:59 | FromGitter | <adamrezich> oh ok |
21:20:04 | FromGitter | <adamrezich> so a template won't work here then? |
21:21:08 | FromGitter | <superfunc> I didn't look too closely at what the code is doing. If the generation needs to be procedural, its a macro, if its simple substitution, it can be a template |
21:22:49 | FromGitter | <adamrezich> basically I want to make it so I don't have to type `proc (elem: Elem) =` when declaring a thing that takes a proc with that signature, if possible |
21:23:45 | FromGitter | <krux02> well I don't really understand what you want exactly, but it sounds like it is possible |
21:24:06 | FromGitter | <adamrezich> in that example, I can do ⏎ ⏎ ```register(MyComp, proc (elem: Elem) = ⏎ echo $elem ⏎ )``` ⏎ ⏎ , but I 'd like to be able to write ... [https://gitter.im/nim-lang/Nim?at=59b6fef6177fb9fe7eab26cc] |
21:24:16 | FromGitter | <krux02> but maybe you want the lambda syntax |
21:24:18 | FromGitter | <adamrezich> (whoops messed up some backticks there) |
21:24:28 | FromGitter | <adamrezich> from future? |
21:24:48 | FromGitter | <superfunc> Yeah, I'd just use the stuff from future |
21:25:01 | FromGitter | <adamrezich> how do you make it not have a return value though? |
21:28:51 | FromGitter | <superfunc> I would presume something like `p: (T) -> void` |
21:30:44 | FromGitter | <zacharycarter> the reason your example doesn't work @adamrezich is that elem isn't defined anywhere |
21:31:18 | FromGitter | <adamrezich> line 21 is where I tried to define it, thinking that's how templates work |
21:39:25 | FromGitter | <zacharycarter> https://play.nim-lang.org/?gist=23b02e99097a9943531073849a9065a4 @adamrezich |
21:40:26 | FromGitter | <zacharycarter> although I'm guessing that's not what you want to do |
21:42:50 | FromGitter | <adamrezich> yeah not quite. it's ok though, I'll delve into macroland with dumpTree eventually |
21:49:51 | FromGitter | <stisa> @adamrezich maybe like this? https://play.nim-lang.org/?gist=9175fa9befc97281f8fdd8197e19d8b7 |
21:50:23 | FromGitter | <stisa> i'm not sure it works properly if you call it multiple times though |
21:53:56 | * | yingjun joined #nim |
21:54:56 | FromGitter | <adamrezich> cool, didn't know about {.inject.}. can't I just put the contents of the template in a `block:`? |
21:58:19 | FromGitter | <stisa> Probably, yeah. Templates open a new scope, so a block is usually not necessary |
21:58:22 | * | yingjun quit (Ping timeout: 260 seconds) |
22:00:34 | FromGitter | <stisa> take a look at https://nim-lang.org/docs/manual.html#templates-hygiene-in-templates too |
22:04:57 | * | MightyJoe is now known as cyraxjoe |
22:05:13 | FromGitter | <adamrezich> awesome, thanks a lot |
22:06:09 | * | enthus1ast- joined #nim |
22:15:27 | FromGitter | <zacharycarter> @Yardanico can you link me to your py2nim stuff |
22:16:22 | FromGitter | <mratsim> What is the equivalent Nim type to “clonglong” ? |
22:16:44 | FromGitter | <mratsim> ah it’s int |
22:17:01 | FromGitter | <zacharycarter> culonglong |
22:17:14 | FromGitter | <zacharycarter> equivalent to uint64 |
22:26:36 | obadz | @zacharycarter: makes sense, thanks. Is there a sizeof equivalent? |
22:26:53 | FromGitter | <zacharycarter> sizeof |
22:27:04 | obadz | ha. easy enough. |
22:27:08 | FromGitter | <zacharycarter> :) |
22:27:37 | obadz | seems like createShared is superior to allocShared though, unless you need raw memory |
22:28:16 | obadz | what kind of allocation strategy does createShared (and I assume allocShared employ?) |
22:29:07 | obadz | s/employ?)/) use?/ |
22:30:15 | FromGitter | <zacharycarter> good question |
22:30:17 | ehmry | are there any conventions or existing cases of completing futures from different threads? I know its hacky but I need to process multiple events from an additional external thread |
22:31:29 | * | vlad1777d quit (Ping timeout: 240 seconds) |
22:36:30 | obadz | also where can I find what the locks pragma does? |
22:40:45 | subsetpark | https://nim-lang.org/docs/manual.html#guards-and-locks |
22:42:38 | FromGitter | <zacharycarter> http://imgur.com/a/gRvkz |
22:42:41 | FromGitter | <zacharycarter> getting some nice looking caves |
22:42:44 | FromGitter | <zacharycarter> now to connect them |
22:43:04 | * | nitely quit (Ping timeout: 260 seconds) |
22:43:17 | subsetpark | zacharycarter is this with your framework? |
22:43:20 | obadz | subsetpark: thx |
22:43:29 | * | couven92 quit (Quit: Bye) |
22:44:18 | FromGitter | <zacharycarter> subsetpark: no I'm writing a roguelike library for Nim |
22:44:31 | FromGitter | <zacharycarter> then my plan is to write a tutorial using it + zengine to make a roguelike |
22:44:54 | subsetpark | Oh very cool |
22:45:03 | subsetpark | I started a roguelike in Nim |
22:45:11 | subsetpark | I don't know why I never put it online... |
22:45:16 | SusWombat | what is the difference between frag and zengine? |
22:45:52 | FromGitter | <zacharycarter> frag = very complex with lots of integration points between different libraries, also abandoned |
22:46:14 | FromGitter | <zacharycarter> zengine = stupid simple, akin to XNA | Allegro, with basic 2d and 3d primitive drawing |
22:46:34 | SusWombat | what libs does it use? |
22:46:38 | FromGitter | <zacharycarter> it's meant to be a prototyping library, but it's capable of whatever you're willing to write on top of it really |
22:46:45 | FromGitter | <zacharycarter> SDL2, OpenGL Assimp |
22:47:15 | FromGitter | <zacharycarter> oh and Nuklear for IMGUI |
22:47:29 | FromGitter | <zacharycarter> but that's totally optional |
22:47:30 | SusWombat | does it support shaders? |
22:47:34 | FromGitter | <zacharycarter> yup! |
22:47:39 | FromGitter | <zacharycarter> along with skeletal animation |
22:47:46 | SusWombat | Hm might need to check it out |
22:47:57 | FromGitter | <zacharycarter> it's really a glorified port of Raylib to Nim |
22:48:05 | FromGitter | <zacharycarter> with my own take and def-pri-pubs take on certain things |
22:48:24 | SusWombat | Does it have "debugging"? |
22:48:39 | FromGitter | <zacharycarter> hrm what do you mean by that? |
22:48:55 | SusWombat | i mean errorhandling/errormessages |
22:49:19 | FromGitter | <zacharycarter> oh, yeah it does |
22:49:46 | SusWombat | ah cool because i think raylib doesnt have |
22:50:07 | FromGitter | <zacharycarter> I tried to plug error messages in where I thought they were sensible |
22:50:30 | FromGitter | <zacharycarter> it probably needs a lot more |
22:50:51 | FromGitter | <zacharycarter> it's stupid simple to use for the most part though and we've built up a few examples, with hopefully lots more to come |
22:51:04 | subsetpark | zacharycarter http://chiselapp.com/user/subsetpark/repository/nogue/home |
22:51:25 | FromGitter | <zacharycarter> :D |
22:52:10 | FromGitter | <zacharycarter> here's the library so far - https://play.nim-lang.org/?gist=71b846eed37ad57ce0f5032d85065a14 |
22:54:44 | subsetpark | Well if you see anything you like in there feel free to steal it |
22:55:25 | FromGitter | <zacharycarter> thank you! |
22:57:17 | subsetpark | I sort of liked the idea - I don't remember why I lost interest. Probably was a pain working with ncurses |
22:58:23 | FromGitter | <zacharycarter> you should resurrect it with bearlibterminal! |
23:02:00 | subsetpark | I probably should... I think at the time I was resisting out of terminal purism, but now I don't care and just want to avoid antiquated APIs :) |
23:02:51 | SusWombat | i still think it sucks that there isnt a crossplatformalternative to ncurses. Atleast i couldnt find one |
23:03:02 | FromGitter | <zacharycarter> yeah we need a nimtermbox |
23:07:32 | subsetpark | sounds like you know your next project zacharycarter... |
23:09:22 | * | chemist69 quit (Ping timeout: 264 seconds) |
23:12:02 | subsetpark | zacharycarter - blt's not on nimble? |
23:14:05 | FromGitter | <ephja> I used it for a chat client. seems to work well |
23:15:35 | FromGitter | <zacharycarter> subsetpark I don't think I ever published the bindings |
23:15:56 | FromGitter | <zacharycarter> they're just on github |
23:16:03 | subsetpark | well get on it man, how else am I gonna write my roguelike now? |
23:16:21 | FromGitter | <zacharycarter> just use the git repo! |
23:16:29 | FromGitter | <zacharycarter> https://github.com/zacharycarter/blt-nim |
23:17:32 | subsetpark | what, you want me to copy in the file? what is this 1996 |
23:17:59 | FromGitter | <zacharycarter> no no no |
23:18:05 | FromGitter | <zacharycarter> are you using nimble? |
23:18:19 | subsetpark | yeah - can you point `requires` at a .git URL/ |
23:18:25 | FromGitter | <zacharycarter> yessir |
23:18:58 | subsetpark | I never knew that! Super cool |
23:19:01 | FromGitter | <zacharycarter> subsetpark - you were curious about AWS lambda and Nim too right? |
23:19:06 | subsetpark | That makes my professional life easier too |
23:19:21 | subsetpark | You could say it was a morbid curiosity, maybe |
23:20:29 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:20:43 | FromGitter | <zacharycarter> a couple folks in here (including myself) now have Nim code running in lambda being called from python |
23:20:50 | FromGitter | <zacharycarter> I'm about to go to production at work with it |
23:21:31 | FromGitter | <zacharycarter> we used https://github.com/jboy/nim-pymod to make it work |
23:23:46 | FromGitter | <zacharycarter> anyone want to help me re-write this in Nim? |
23:23:58 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59b71b0e319100804e22b064] |
23:24:22 | FromGitter | <zacharycarter> because I'm getting hung up on split_sets |
23:25:23 | subsetpark | actually, i'm working on the opposite solution |
23:25:35 | subsetpark | At work I use ctypes to call Nim from Python |
23:26:07 | subsetpark | so I am gonna put together a simple ntypes library that provides ctypes for Nim types |
23:26:53 | FromGitter | <zacharycarter> that will be handy |
23:27:06 | subsetpark | then you compile the nim code to C and distribute the C sources with the Python package; you don't need the nim compiler to install the python package |
23:30:27 | * | Jesin quit (Quit: Leaving) |
23:36:10 | * | Jesin joined #nim |
23:44:40 | * | pilne joined #nim |
23:51:02 | * | def-pri-pub joined #nim |
23:51:10 | def-pri-pub | zacharycarter: heya, you here right now? |
23:51:29 | FromGitter | <zacharycarter> yup |
23:51:41 | def-pri-pub | cool |
23:52:25 | def-pri-pub | How is the 3D texture example coming along? That's probably the next thing that blocking me. I'm going to work on the ZSprite tool in the meantime. |
23:52:48 | FromGitter | <zacharycarter> I have questions about the 3d texture example |
23:53:01 | FromGitter | <zacharycarter> did you see the screenshot I posted the other day? |
23:53:44 | FromGitter | <zacharycarter> https://files.gitter.im/nim-lang/Nim/MJe9/thumb/Screen-Shot-2017-09-10-at-8.13.19-AM.png |
23:53:45 | def-pri-pub | no, |
23:53:52 | FromGitter | <zacharycarter> do you want something like that? |
23:53:54 | def-pri-pub | dats tiny |
23:53:58 | def-pri-pub | really tiny |
23:54:16 | FromGitter | <zacharycarter> hrm let me try to find the og picture |
23:55:01 | FromGitter | <zacharycarter> https://files.gitter.im/nim-lang/Nim/MJe9/Screen-Shot-2017-09-10-at-8.13.19-AM.png |
23:55:19 | def-pri-pub | Yeah, that's what I'd like |
23:55:23 | FromGitter | <zacharycarter> okay |
23:55:32 | def-pri-pub | Can I at least rotate/orient the texture in all three directions? |
23:55:35 | * | yingjun joined #nim |
23:55:41 | FromGitter | <zacharycarter> I need to add billboarding for that |
23:55:48 | FromGitter | <zacharycarter> I'll work on this tonight |
23:55:50 | def-pri-pub | Also, I assume transparnecy works? |
23:55:57 | FromGitter | <zacharycarter> good question |
23:56:06 | FromGitter | <zacharycarter> it needs to |
23:56:21 | FromGitter | <zacharycarter> yeah I'll get all this straightened out tonight |
23:56:36 | def-pri-pub | Eh, I don't think you need bill-boarding per-se. It's moreso that you need orienting for bill-boarding |
23:56:45 | FromGitter | <zacharycarter> right |
23:56:47 | FromGitter | <noctisdb> Ive just been tinkering with moving things around, and editor support for brackets (closest thing to atom like I could find for 32 bit) |
23:56:50 | def-pri-pub | Can you post your work to the repo on a non-master branch? |
23:57:04 | FromGitter | <zacharycarter> well I accidentally deleted the above example |
23:57:07 | FromGitter | <zacharycarter> let me recreate it |
23:57:10 | FromGitter | <zacharycarter> and I'll make a new branch |
23:57:23 | def-pri-pub | ¯\_(ツ)_/¯ |
23:57:34 | FromGitter | <zacharycarter> pretty much |
23:57:43 | def-pri-pub | I do think an actual function should be formalized in zgl.nim |
23:57:46 | def-pri-pub | I can do that for you |
23:58:28 | def-pri-pub | I'll probaby need to shove some OpenGL code anyways in `SpriteBatch` like I orignally planned. |
23:58:57 | * | yglukhov quit (Remote host closed the connection) |