00:18:28 | * | def-pri-pub joined #nim |
00:24:45 | * | JHonaker joined #nim |
00:30:59 | * | chrisheller quit (Remote host closed the connection) |
00:54:31 | * | JHonaker quit (Ping timeout: 260 seconds) |
01:05:04 | * | planhths quit (Quit: Konversation terminated!) |
01:17:34 | * | lockdown quit (Quit: leaving) |
01:35:14 | * | brson quit (Quit: leaving) |
02:35:59 | * | dddddd quit (Remote host closed the connection) |
02:58:44 | * | pilne quit (Quit: Quitting!) |
03:10:08 | * | vlad1777d joined #nim |
03:10:27 | * | chrisheller joined #nim |
03:36:05 | * | vlad1777d quit (Quit: Leaving) |
03:53:40 | * | daaf joined #nim |
04:07:39 | FromGitter | <zacharycarter> can finally make tiled maps with frag |
04:08:01 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/58l8/Screen-Shot-2017-05-23-at-12.03.22-AM.png) |
04:12:37 | ftsf | \o/ |
04:12:49 | ftsf | awesome |
04:14:16 | * | literal quit (Ping timeout: 260 seconds) |
04:14:31 | FromGitter | <zacharycarter> :D thanks |
04:14:58 | * | literal joined #nim |
04:16:17 | FromGitter | <zacharycarter> I think frag is in for a big clean up / refactoring effort and then I need to work on android support a bit more, but it's getting damn close to ready for an alpha |
04:16:51 | * | SusWombat quit (Remote host closed the connection) |
04:22:06 | * | SusWombat joined #nim |
04:23:38 | * | smt joined #nim |
04:23:41 | * | vivus quit (Ping timeout: 246 seconds) |
04:23:49 | def-pri-pub | I recently discovered RayLib. It's made in Pure C and is XNA like. I'm kind of tempted to start bindings on it: |
04:23:52 | def-pri-pub | http://www.raylib.com/index.html |
04:24:03 | * | vivus joined #nim |
04:24:12 | def-pri-pub | Or at least see how well c2nim could generate some. |
04:27:19 | * | daaf quit (Remote host closed the connection) |
04:28:14 | FromGitter | <zacharycarter> interesting |
04:31:41 | * | daaf joined #nim |
04:36:38 | FromGitter | <zacharycarter> def-pri-pub: how does it handle html5? |
04:37:47 | FromGitter | <zacharycarter> ah webgl I see |
04:40:58 | FromGitter | <zacharycarter> or emscripten can't tell |
04:49:14 | FromGitter | <zacharycarter> okay definitely emscripten |
04:49:29 | * | daaf quit (Ping timeout: 255 seconds) |
05:15:07 | * | def-pri-pub quit (Quit: leaving) |
05:33:19 | * | vlad1777d joined #nim |
06:01:44 | * | skrylar joined #nim |
06:02:22 | skrylar | morning |
06:15:16 | * | nsf joined #nim |
06:15:48 | FromGitter | <Varriount> Hey |
06:17:34 | FromGitter | <zacharycarter> o/ |
06:17:43 | FromGitter | <zacharycarter> hrm I wish the new json macro supported optional fields |
06:28:08 | FromGitter | <Varriount> "Error: cannot prove 'newSeq(0)' is not nil" |
06:30:22 | * | Vladar joined #nim |
06:35:35 | * | BennyElg joined #nim |
06:36:15 | * | BennyElg_ joined #nim |
06:36:15 | * | BennyElg quit (Read error: Connection reset by peer) |
06:37:11 | * | BennyElg joined #nim |
06:37:11 | * | BennyElg_ quit (Read error: Connection reset by peer) |
06:53:28 | * | Trioxin quit (Ping timeout: 240 seconds) |
06:53:51 | FromGitter | <Varriount> Looks like system.nim needs to be annotated |
07:14:53 | * | Arrrr joined #nim |
07:14:53 | * | Arrrr quit (Changing host) |
07:14:53 | * | Arrrr joined #nim |
07:26:14 | FromGitter | <Varriount> @zacharycarter I've written the bulk of the type generation code for the AWS API in less than 300 lines of code. |
07:30:48 | ftsf | whoa |
07:31:30 | * | chemist69 joined #nim |
07:32:49 | * | Tiberium joined #nim |
07:34:22 | FromGitter | <Varriount> ftsf: ? |
07:34:29 | ftsf | that's awesome! |
07:34:57 | FromGitter | <Varriount> ftsf: I have yet to do structure generation though. That's probably going to be another 50-100 |
07:35:15 | ftsf | still sounds better than boto =) |
07:35:21 | FromGitter | <Varriount> ftsf: https://gist.github.com/Varriount/32fdd9b380246e9df605012276104891 |
07:35:32 | ftsf | although i have not much need for AWS APIs any more since i quit my day job |
07:35:53 | * | chemist69 quit (Client Quit) |
07:36:10 | FromGitter | <Varriount> ftsf: Boto3 is... weird |
07:36:15 | ftsf | it is |
07:36:22 | ftsf | both botos are pretty bad |
07:36:28 | FromGitter | <Varriount> I mean, I understand the type generation at runtime, it's just an odd paradigm |
07:36:47 | ftsf | it makes sense considering the moving target |
07:36:54 | ftsf | but it's very unwieldy to use |
07:37:28 | FromGitter | <Varriount> `ec2 = boto3.client('ec2') # have to pass 'ec2' everywhere` |
07:37:36 | * | Andris_zbx joined #nim |
07:38:56 | * | chemist69 joined #nim |
07:38:59 | FromGitter | <Varriount> ftsf: Regarding the code I posted, do you think it would make more sense to move the 'quote do' sections to actual templates? |
07:39:33 | ftsf | tbh i'm not familar with the quote do syntax |
07:39:43 | ftsf | not much exp with macros/templates |
07:40:16 | FromGitter | <Varriount> quote do is kinda like inline templates |
07:40:48 | FromGitter | <Varriount> it turns to body into an AST, and substitutes the backticked idents |
07:41:14 | ftsf | oh nice |
07:41:29 | FromGitter | <Varriount> No manual ast construction. :D |
07:41:35 | ftsf | yeah, sounds much nicer |
07:41:46 | ftsf | i'd leave them as quote do, seems more readable |
07:41:54 | ftsf | and readability is king |
07:42:24 | FromGitter | <Varriount> ^ Exactly why I prefer Nim |
07:43:03 | ftsf | yeah, when in doubt, go for the more readable option |
07:44:29 | * | libman quit (Quit: Connection closed for inactivity) |
07:46:15 | FromGitter | <Varriount> ftsf: By the way, is your game going to be on GOG too? |
07:46:45 | ftsf | hmm maybe, seems the requirements for indie games on GOG are much higher |
07:47:04 | ftsf | they're a lot more choosy |
07:47:23 | FromGitter | <Varriount> I ask, as I prefer to buy my games without DRM/Steam requirements |
07:47:43 | ftsf | mmm that's why it's on itch.io |
07:47:50 | FromGitter | <Varriount> Ah, ok. |
07:47:51 | ftsf | and don't think steam requires you to have DRM |
07:49:50 | FromGitter | <Varriount> No, but it makes it complicated when I want to play multiplayer games with my siblings. |
07:50:22 | ftsf | ahh i mean, you can download a DRM free game on steam and copy it to another computer and run it and it should be fine |
07:50:25 | * | gokr joined #nim |
07:50:44 | FromGitter | <Varriount> Usually we can afford to buy copies, but when there are games that are $60+ , buying 4 copies is somewhat expensive |
07:50:58 | ftsf | you should use the family sharing functionality |
07:51:16 | ftsf | you can buy one copy and share it amongst your "family" |
07:51:24 | ftsf | although i don't think you can both play at the same time |
07:51:57 | skrylar | you can't |
07:52:09 | skrylar | if someone tries to borrow a game in your library then the othe rguy can't play anything |
07:53:52 | FromGitter | <Varriount> Yeah. We use that to cut down on costs |
08:06:47 | FromGitter | <ephja> I've never used quote, but I do define templates and pass them to getAst whenever possible |
08:07:30 | * | BennyElg quit (Remote host closed the connection) |
08:07:50 | * | BennyElg joined #nim |
08:08:41 | FromGitter | <Varriount> ephja: How well does that technique handle passing in idents and literals? |
08:09:37 | * | vivus quit (Quit: Leaving) |
08:15:54 | FromGitter | <Varriount> Araq: Why would I be getting a "cannot prove not nil" error for a member that is an object? |
08:16:24 | * | xet7 quit (Quit: Leaving) |
08:24:35 | FromGitter | <ephja> @Varriount "template t(x: untyped) = x + x" does of course accept identifiers and literals, and the resulting AST might look like this ⏎ `StmtList(StmtList(Infix(OpenSymChoice(Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sy ⏎ m(+), Sym(+), Sym(+)), Ident(!"x"), Ident(!"x"))))` ⏎ or this ⏎ `StmtList(StmtList(Infix(OpenSymChoice(Sym(+), Sym(+), Sym(+), |
08:24:35 | FromGitter | ... Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sym(+), Sy ... [https://gitter.im/nim-lang/Nim?at=5923f1c3f3001cd3424cada2] |
08:25:01 | FromGitter | <ephja> that's not the most concise example. anyway, did I understand you correctly? |
08:25:31 | FromGitter | <Varriount> Possible. If you look at the link to the gist I posted, there are several procedures that use `quote do`. |
08:26:03 | FromGitter | <Varriount> In those procedures, I have to manually turn certain members of the "Shape" type into literals or idents |
08:26:32 | FromGitter | <Varriount> How would I pass those variables into a template? |
08:30:56 | FromGitter | <ephja> I wonder if 'quote' is better though. it's very concise |
08:31:04 | * | couven92 joined #nim |
08:36:39 | FromGitter | <ephja> @Varriount this seems to work ⏎ ⏎ ```template t(x: NimIdent) = type x = ref object``` [https://gitter.im/nim-lang/Nim?at=5923f4979f4f4ab05bf07ad7] |
08:40:06 | * | m712 quit (Quit: bye-nyan!) |
08:43:04 | FromGitter | <ephja> but it does compile even if the parameter is of some other type, and the actual type ends up being whatever is passed in, which would be a NimIdent in my case. time for some more bug report hunting then |
08:46:00 | * | erwana[m] quit (Remote host closed the connection) |
08:46:03 | * | hohlerde quit (Remote host closed the connection) |
08:46:04 | * | dyce[m] quit (Read error: Connection reset by peer) |
08:46:05 | * | Jipok[m] quit (Read error: Connection reset by peer) |
08:46:07 | * | mindB quit (Read error: Connection reset by peer) |
08:46:08 | * | ehmry[m] quit (Remote host closed the connection) |
08:46:08 | * | jivank[m] quit (Remote host closed the connection) |
08:46:08 | * | TheManiac quit (Read error: Connection reset by peer) |
08:46:09 | * | MrAxilus[m] quit (Read error: Connection reset by peer) |
08:46:09 | * | Guest73656[m] quit (Read error: Connection reset by peer) |
08:46:11 | * | vopi181[m] quit (Read error: Connection reset by peer) |
08:46:11 | * | M-Quora quit (Remote host closed the connection) |
08:46:12 | * | stisa quit (Remote host closed the connection) |
08:48:33 | * | gmpreussner quit (Ping timeout: 240 seconds) |
08:48:33 | * | Araq quit (Ping timeout: 240 seconds) |
08:49:03 | * | dom96 quit (Ping timeout: 240 seconds) |
08:49:05 | * | Araq joined #nim |
08:49:23 | * | vqrs quit (Ping timeout: 260 seconds) |
08:49:29 | * | erwana[m] joined #nim |
08:51:30 | * | gmpreussner joined #nim |
08:53:05 | * | dom96 joined #nim |
08:54:15 | * | vqrs joined #nim |
08:56:12 | * | MrAxilus[m] joined #nim |
08:56:12 | * | dyce[m] joined #nim |
08:56:13 | * | M-Quora joined #nim |
08:56:13 | * | ehmry[m] joined #nim |
08:56:19 | * | Guest73656[m] joined #nim |
08:56:19 | * | vopi181[m] joined #nim |
08:56:19 | * | stisa joined #nim |
08:56:19 | * | jivank[m] joined #nim |
08:56:20 | * | TheManiac joined #nim |
08:56:20 | * | Jipok[m] joined #nim |
08:56:20 | * | mindB joined #nim |
08:56:20 | * | hohlerde joined #nim |
09:18:00 | * | adeohluwa joined #nim |
09:21:34 | * | bjz joined #nim |
09:33:46 | FromGitter | <Varriount> ephja: I think if I have to add more to the quote sections, I'll break them out into templates. |
09:41:51 | * | skrylar quit (Ping timeout: 260 seconds) |
09:50:05 | * | Neomex quit (Ping timeout: 255 seconds) |
09:51:45 | * | Neomex joined #nim |
09:55:58 | * | fr1end joined #nim |
09:56:30 | fr1end | Hi. How do I logical-OR things? https://nim-lang.org/docs/manual.html#lexical-analysis-operators says | is an operator, but trying to use it gives Error: undeclared identifier: '|' |
09:56:48 | fr1end | ...interesting, so does the 'or' keyword |
09:56:49 | fr1end | > echo(4 or 2) |
09:56:49 | fr1end | Hint: nrpltmp [Processing] |
09:56:49 | fr1end | nrpltmp.nim(1, 3) Error: undeclared identifier: '|' |
09:56:59 | fr1end | > nim -v |
09:56:59 | fr1end | Nim Compiler Version 0.16.0 (2017-03-12) [Linux: amd64] |
09:57:44 | fr1end | oh, sorry, that was just nrpl repeating the last error |
09:58:59 | chemist69 | you need a boolean expression for `or`, like `4 == 4 or 4 == 2` |
09:59:04 | fr1end | Okay, seems like 'or' does work, but | doesn't by default do logical or |
09:59:41 | fr1end | I need to do bitwise OR, seems or does do it |
09:59:46 | fr1end | > echo(4 or 2) |
09:59:46 | fr1end | Hint: nrpltmp [Processing] |
09:59:46 | fr1end | 6 |
10:00:31 | fr1end | (0b100 | 0b010 = 0b110) |
10:01:46 | chemist69 | ok, so you answered your question. :P |
10:02:21 | fr1end | yeah, sorry |
10:02:38 | fr1end | for the log, if anyone wants to get |, do: |
10:02:39 | fr1end | template `|`(x, y: untyped): untyped = x or y |
10:02:40 | fr1end | echo(4 | 2) |
10:02:46 | fr1end | 6 |
10:03:16 | fr1end | blah. Pasting is cursed. |
10:03:29 | FromGitter | <coffeepots> hey guys, I updated to 0.17 last night and had some trouble with typed blocks in templates and injected variables https://gist.github.com/coffeepots/8884cdfebcf1f941e282da8b0bdd5802 |
10:04:33 | FromGitter | <coffeepots> So I guess the first example 'make1' works, but I was surprised that the variable 'x' doesn't seem to get injected if the template is given a 'typed' block? |
10:05:11 | FromGitter | <coffeepots> if I pass a generic to the template I can't even get it to instantiate but I'm not sure why as the above worked before 0.17 |
10:15:17 | fr1end | How can I index into https://github.com/barcharcraz/nim-assimp/blob/master/assimp.nim#L55 ? I have a for loop that generates ints 0..mesh.vertexCount, and I'm trying to mesh.vertices[vertex] but I get "Error: cannot evaluate at compile time: vertex" |
10:15:28 | fr1end | which I guess means it's trying to do some kind of bounds checking, but it can't |
10:16:11 | fr1end | possibly just cast to UncheckedArray, which seems to be what the other pointers are behind? |
10:20:39 | FromGitter | <Varriount> Hm |
10:21:26 | FromGitter | <Varriount> fr1end: Can you give a link to your code? |
10:23:24 | FromGitter | <Varriount> coffeepots: typed parameters must resolve to a type |
10:24:06 | FromGitter | <Varriount> Since `action` in `make2` is a typed parameter, it errors because `x` in the passed in body isn't declared. |
10:24:29 | fr1end | https://pastebin.com/C8TQes6H |
10:26:37 | FromGitter | <coffeepots> Varriount: That must have changed pretty recently then - are typed parameters now checked earlier? Because before if you inject 'x' you can use it in the block, just as you still can do with untyped |
10:27:04 | FromGitter | <Varriount> Apparently. There's been quite a bit of internal compiler development. |
10:27:31 | FromGitter | <coffeepots> it's weird that the compiler considers var x {.inject.}: T valid in an untyped block, but doesn't resolve in typed |
10:28:39 | FromGitter | <Varriount> As for the last example, ```proc `name`[T]: T =``` is being replaced with ```proc test3[int]: int =``` which doesn't make sense |
10:28:41 | FromGitter | <coffeepots> on top of that not sure why I can't pass in a generic parameter to make3 anymore - has they syntax changed? The second part of the error says 'missing parameter' for the generic yet it's there |
10:28:43 | fr1end | http://assimp.sourceforge.net/lib_html/structai_mesh.html this is what the C structure looks like |
10:29:25 | FromGitter | <Varriount> fr1end: Your error is on which line? |
10:30:28 | fr1end | 42 |
10:32:12 | FromGitter | <coffeepots> Varriount: Ah yes, taking the generic out of the proc declaration seems to work - but it still complains about 'x' being undeclared when the template parameter is typed, despite the inject |
10:34:05 | FromGitter | <coffeepots> The trouble is, in my real code I'm passing in a generic type to the proc, so that's why the example looks a bit weird. Trying to mock up something to see if it works |
10:34:17 | FromGitter | <Varriount> @coffeepots Can you paste your real code? |
10:34:39 | FromGitter | <Varriount> fr1end: The trouble is that for a TMesh, `vertices*: ptr TVector3d` |
10:34:40 | FromGitter | <coffeepots> sadly not as I don't have it here, I could tonight though - it's a quadtree implementation |
10:35:21 | fr1end | I just worked out how to do such a cast, and "let v = cast[UncheckedArray[TVector3d]](mesh.vertices)[vertex] |
10:35:24 | FromGitter | <Varriount> fr1end: You can try casting it to an array of a large length |
10:35:30 | fr1end | " appears to compile, but hopefully it does what it appears to |
10:35:32 | fr1end | yeah |
10:35:54 | fr1end | UncheckedArray (part of standard runtime) is just an array with 100_000_000 size (>_>) |
10:36:07 | fr1end | https://github.com/zah/grip-lang/blob/master/lib/pure/collections/rtarrays.nim#L22 |
10:36:17 | fr1end | it's marked to not be used externally, but... it's there lol |
10:36:35 | FromGitter | <Varriount> fr1end: I suggest you don't try copying it to a local variable. :P |
10:36:58 | fr1end | I wanted to make this neater, is there a way to get references like C++'s? |
10:37:06 | FromGitter | <Varriount> fr1end: There's un updated way to do unchecked arrays: https://nim-lang.org/docs/manual.html#foreign-function-interface-unchecked-pragma |
10:37:15 | FromGitter | <Varriount> fr1end: Howso? |
10:38:16 | fr1end | like, I want to be able to refer to v, n, t, u instead of doing that ridiculous cast and index for every single float I'm copying out |
10:39:49 | fr1end | in C++, that's aiVector3D& v = mesh->mVertices[vertex]; |
10:40:16 | fr1end | and then only a pointer is on the stack (and the optimiser probably elides even that) |
10:41:15 | FromGitter | <Varriount> fr1end: Use a pointer type? |
10:41:46 | fr1end | What do you mean? |
10:43:00 | FromGitter | <Varriount> fr1end: Sorry, I don't think I understand the question. |
10:44:36 | FromGitter | <Varriount> Can you perhaps show me a code sample of what you think the Nim syntax might/should be (even if it's not technically valid)? |
10:44:37 | fr1end | So, what I'm doing here right now, after casting to an UncheckedArray[TVector3d], and then accessing a TVector3d by [vertex], is copying whole TVector3d structures onto the stack |
10:44:43 | fr1end | I think. |
10:44:53 | fr1end | That or it's only putting a reference to the original structure |
10:45:25 | fr1end | I want to only have a refernce to the original structure, just like the C++ would |
10:45:49 | FromGitter | <Varriount> fr1end: You would have to store a pointer to the structure on the stack then. |
10:46:46 | FromGitter | <Varriount> `let v = addr castUncheckedArray[TVector3d (mesh.vertices)[vertex] |
10:46:55 | fr1end | ah, addr |
10:47:12 | fr1end | I was trying 'ptr' |
10:47:51 | fr1end | argh, mesh.nim(42, 64) Error: expression has no address |
10:47:57 | FromGitter | <Varriount> One moment... |
10:49:36 | * | bjz_ joined #nim |
10:49:57 | FromGitter | <Varriount> fr1end: `let v = addr castptr UncheckedArray[TVector3d (mesh.vertices)[vertex]` |
10:50:41 | FromGitter | <Varriount> I would probably either put that cast in a template, or create a new unchecked array type. |
10:51:13 | FromGitter | <Varriount> That wrapper is really odd.. It uses unchecked arrays in some parts, but not in others. |
10:51:28 | * | bjz quit (Ping timeout: 272 seconds) |
10:51:51 | fr1end | OK, looks like "let v = addr cast[ptr UncheckedArray[TVector3d]](mesh.vertices)[vertex] |
10:51:54 | fr1end | " works |
10:55:09 | * | PMunch joined #nim |
10:55:46 | FromGitter | <Varriount> fr1end: Interfacing with C is never easy (unless you're also using C) |
10:58:13 | fr1end | Yeah. Part of the reason I'm trying Nim again is because Rust FFI is such a pain. |
10:59:31 | * | skrylar joined #nim |
11:00:56 | FromGitter | <Varriount> fr1end: Really? |
11:01:38 | fr1end | Yeah. I think I might abandon this though. |
11:02:09 | FromGitter | <coffeepots> I updated my gist to hopefully highlight a bit more what I want https://gist.github.com/coffeepots/2dd94fdb17a9f83a7951341763bff45e |
11:02:30 | fr1end | There's a lot I like about Nim but the same immaturities are there; they'll probably always be there because they're the kind that arise from not enough eyeballs |
11:02:38 | FromGitter | <Varriount> fr1end: Have you looked at what @zacharycarter is doing? |
11:02:49 | * | Snircle joined #nim |
11:02:57 | FromGitter | <coffeepots> has the syntax changed for passing generics to templates maybe? |
11:03:15 | fr1end | do you mean their fork of this assimp wrapper? |
11:03:40 | FromGitter | <Varriount> He has a fork of the wrapper? |
11:03:45 | fr1end | because I just remembered, that's what I'm actually using (but the relevant section I highlighted is teh same) |
11:03:51 | FromGitter | <Varriount> No, I meant http://fragworks.io/ |
11:04:00 | fr1end | https://github.com/zacharycarter/nimassimp |
11:04:05 | FromGitter | <coffeepots> btw fr1end: it sounds like you just need to get used to the low level workings with Nim. It took me a while to get used to it myself but once I did it makes sense |
11:04:54 | FromGitter | <Varriount> fr1end: The reason that 'addr' was needed was that an array represents a block of memory, but not a pointer to a block of memory |
11:05:11 | FromGitter | <weberschm_twitter> hi guys, I'm trying to run the opengl package example (nim c glut_example.nim) but having an error "Cannot open X" |
11:05:51 | fr1end | weberschm_twitter: does glxgears (C language GL demo) definitely work on your system? |
11:06:27 | FromGitter | <weberschm_twitter> yep. do i have to install this https://github.com/nim-lang/x11 "manually"? |
11:06:59 | FromGitter | <Varriount> @weberschm_twitter Is that the exact error message? |
11:07:18 | fr1end | Varriount: This issue was not my concern with nim. It's that the documentation is sparse, concepts are not yet documented well, Nim has the atmosphere of an experimental language still |
11:07:35 | fr1end | given its version number, none of this is surprising |
11:07:39 | FromGitter | <ephja> nim-glfw should also have configuration objects. it's currently very hard to decipher error messages involving calls with 5+ arguments atm |
11:07:43 | FromGitter | <weberschm_twitter> opengl/src/opengl.nim(26, 10) Error: cannot open 'X' |
11:08:04 | FromGitter | <weberschm_twitter> do i have to unpack https://github.com/nim-lang/opengl at a specific location ? |
11:08:14 | FromGitter | <Varriount> fr1end: The problem, as you said, is that we don't have enough contributors. |
11:08:41 | FromGitter | <coffeepots> fr1end: what would you say are the main areas that feel experimental? Concepts perhaps but the base language feels fairly complete to me at least |
11:08:41 | fr1end | absolutely, and I hope that what I've said doesn't undermine the value of the effort the contributors nim DOES have have made |
11:08:47 | FromGitter | <Varriount> We only have 3 core developers. |
11:09:12 | FromGitter | <Varriount> @coffeepots I must admit that documentation (on the standard library) is quite sparse. |
11:09:14 | FromGitter | <ephja> @weberschm_twitter it's not listed as a dependency, so you have to install that package manually |
11:09:33 | FromGitter | <Varriount> Although I feel the language manual is fairly good. |
11:09:55 | fr1end | well, say you take https://nim-lang.org/docs/manual.html#exception-handling |
11:10:07 | fr1end | it doesn't tell you how to create your own exception types |
11:10:07 | FromGitter | <Varriount> Though, documentation on how Nim interfaces with C could be improved in the manual. |
11:10:14 | FromGitter | <ephja> the question is, is it possible to include such a dependency conditionally now with metadata in the form of nim scripts? I'll investigate |
11:10:17 | FromGitter | <coffeepots> newException? |
11:10:23 | fr1end | it tells you about the newException function |
11:10:44 | fr1end | but, you have to search for example code somewhere to find there's an Exception base class you inherit to do that |
11:10:52 | fr1end | which was obvious in retrospect, but... |
11:11:02 | fr1end | I didn't know whether the first argument was just an enum, or what |
11:11:11 | fr1end | that's a random nitpick |
11:11:21 | FromGitter | <weberschm_twitter> @ephja i was just tripping.. not using nibmle |
11:11:23 | FromGitter | <coffeepots> fair enough |
11:11:23 | fr1end | I'm trying to find more concrete examples of problems |
11:12:03 | FromGitter | <coffeepots> I know when I was doing low level stuff i got tripped up by cast[TypeIWant] rather than cast[ptr TypeIWant] |
11:12:11 | FromGitter | <weberschm_twitter> example works nopw |
11:12:34 | FromGitter | <ephja> you have to install it manually anyway |
11:12:43 | * | sz0 joined #nim |
11:12:57 | FromGitter | <weberschm_twitter> i was missing a nimble install opengl |
11:13:16 | FromGitter | <weberschm_twitter> and then apt-get install freeglut3 freeglut3-dev for libglut.so |
11:13:29 | fr1end | the proper thing to do is to, when finding a doc problem, correct it and submit a PR; but nobody does that when trying to solve their problem because of the hole-in-my-bucket effect |
11:13:45 | FromGitter | <Varriount> @coffeepots @fr1end: I just wish that people were more willing to contribute. The documentation is all there in the repository. |
11:14:12 | FromGitter | <ephja> my brain is too hyperactive |
11:14:35 | FromGitter | <Varriount> It's not even as if such changes have to wait for Araq's approval - since it's not compiler internals, dom96 or I could accept them |
11:14:46 | FromGitter | <ephja> it's actually a dependency, so it will simply be redundant on platforms that don't have X11 |
11:15:40 | fr1end | contributor critical mass is a frustrating thing to try to achieve |
11:16:50 | FromGitter | <coffeepots> I was considering writing a blog post, does that count? :) |
11:17:08 | fr1end | the other thing that feels experimental is error messages |
11:17:37 | fr1end | they are pretty obtuse, like, incorrect typing in a function call reports the error at the parenthesis |
11:17:52 | fr1end | as just 'type expected' |
11:18:08 | fr1end | I've written languages before and know that improving that is nontrivial |
11:18:33 | FromGitter | <coffeepots> See, error messages... they do make sense but sometimes you have to 'decipher' them |
11:18:48 | fr1end | these are things that are minor to someone familiar with a language, but most likely to scare away newcomers |
11:19:46 | fr1end | I hope this comes across as constructive, because like I said I do like Nim and I understand why things are the way they are |
11:20:01 | FromGitter | <coffeepots> at least nowadays we get some hints like "did you mean to use a var parameter?" when you try to alter an immutable and "did you meant to use = " when declaring a type like "var thing: newseqint ()" and stuff |
11:20:17 | FromGitter | <coffeepots> we could do more of those type of hints I think |
11:21:15 | FromGitter | <coffeepots> also, when you have a parameter mismatch, it'd be great to have it point out exactly which parameters don't match to any existing signature but I bet that's a lot trickier than it sounds |
11:21:40 | FromGitter | <zacharycarter> morning |
11:21:49 | FromGitter | <zacharycarter> lots of good convo |
11:21:51 | FromGitter | <coffeepots> good morning :) |
11:21:56 | * | yglukhov joined #nim |
11:22:15 | FromGitter | <zacharycarter> yeah Nim is rough around the edges but you can definitely build quite impressive things with it as it stands today |
11:22:35 | FromGitter | <coffeepots> yes, for sure, although my current project is broken after 0.17 :/ |
11:23:07 | FromGitter | <zacharycarter> what's wrong with it? |
11:23:10 | FromGitter | <coffeepots> having said that, the new vtref stuff looks exceedingly cool |
11:23:32 | FromGitter | <coffeepots> well I can't seem to pass a generic to a template in order to create a proc |
11:23:38 | FromGitter | <coffeepots> https://gist.github.com/coffeepots/2dd94fdb17a9f83a7951341763bff45e |
11:24:26 | FromGitter | <coffeepots> and I use this in my quadtree implementation to create custom tree walking procedures, and... without quadtrees, well that's kinda the crux of my whole project |
11:24:51 | FromGitter | <zacharycarter> well... this definitely works on glot.io which is a few versions back I believe |
11:24:54 | PMunch | In jester, is there a way to specify a route that matches both "/chips" and "/chips/"? Currently I have a route for "/chips" and "/chips/@id". |
11:25:01 | FromGitter | <Varriount> By the way, fr1end, have you seen https://play.nim-lang.org/ ? |
11:25:06 | FromGitter | <zacharycarter> hrm |
11:25:10 | FromGitter | <coffeepots> yeah it was working in 0.16 devel but when i updated to 0.17, broke :( |
11:25:18 | FromGitter | <zacharycarter> yeah it's compiling on ^ too |
11:25:47 | dom96 | PMunch: "/chips/?@id" |
11:26:02 | dom96 | Possibly |
11:26:03 | FromGitter | <Varriount> @zacharycarter ^ == HEAD? |
11:26:50 | dom96 | zacharycarter: any luck getting gist integrated with the playground? or a way to specify code as URL params |
11:26:58 | FromGitter | <Varriount> @coffeepots Why does the inner procedure in the make3 template have a generic parameter? |
11:27:25 | PMunch | Hmm, and a nil check to see if it is there or not? |
11:27:33 | FromGitter | <coffeepots> the inner proc takes a quadtree[T], which is simulated with Obj[T] |
11:28:15 | FromGitter | <Varriount> @coffeepots Yes, but the template also takes a generic parameter. |
11:28:17 | FromGitter | <zacharycarter> dom96: I haven't tried yet I was working on frag all weekend but I'll give the playground some love today |
11:28:25 | FromGitter | <zacharycarter> @dom96 ^ |
11:28:34 | FromGitter | <zacharycarter> @Varriount with ^ i meant play.nim-lang.org |
11:28:41 | dom96 | (You don't need the @ to highlight me) |
11:28:50 | FromGitter | <zacharycarter> ah sweet |
11:28:54 | FromGitter | <zacharycarter> forgot you're in IRC |
11:28:59 | FromGitter | <coffeepots> @Varriount yes, how else would you declare what type you want make the proc `name` take? |
11:29:23 | FromGitter | <Varriount> @coffeepots Use the generic parameter the template is taking? |
11:30:20 | FromGitter | <coffeepots> if you take out [T] from proc `name` then it says it can't instiantiate T in Obj[T] in the proc |
11:31:26 | FromGitter | <coffeepots> actually... it works if you take out the [T] from the template... |
11:32:07 | FromGitter | <Varriount> I'm just confused why you have both. One or the other would work. |
11:32:14 | FromGitter | <coffeepots> This just makes the proc generic to anything and not constrained |
11:32:42 | FromGitter | <Varriount> Oh wait, are you not running HEAD? |
11:33:26 | FromGitter | <zacharycarter> dom96: I think I can probably get away with storing snippets in redis and generating GUIDs to share |
11:33:26 | FromGitter | <coffeepots> well the initial idea was to constrain the type, so you'd write make3[Entity] and it would create proc test3Entity (qt: Quadtree[Entity] ... ) |
11:34:08 | FromGitter | <coffeepots> ok here I'm running version 0.17.0, at home I'm running devel |
11:34:22 | dom96 | zacharycarter: Sure, redis will work for that. |
11:35:01 | FromGitter | <Varriount> Yes, which you would do like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59241e6505e3326c67fe4f4c] |
11:35:54 | FromGitter | <coffeepots> @Varriount if you do that it says cannot instantiate T for me |
11:36:14 | FromGitter | <Varriount> Hm. It works on HEAD |
11:36:24 | FromGitter | <coffeepots> wicked, i'll update... |
11:37:22 | FromGitter | <coffeepots> to be honest it's probably better NOT to over specify the type and have the constructed procedures generic anyway (ie; remove [T] from template and let the compiler decide what type to use when you call test3) |
11:37:49 | FromGitter | <stisa> what about keeping T on the template and doing `proc name V:T (obj: Obj[V]): V` ? That should work |
11:38:37 | FromGitter | <coffeepots> @Silvio huh! Thanks that works! |
11:39:17 | FromGitter | <coffeepots> gonna try it on head tho too |
11:41:59 | FromGitter | <Varriount> @coffeepots You might like what I'm working on: https://gist.github.com/Varriount/32fdd9b380246e9df605012276104891 |
11:45:24 | PMunch | Hmm, dom96 get "/role/?@id" didn't match /role or /role/ only /role/<id> |
11:45:58 | dom96 | PMunch: add a ? after the @id |
11:46:41 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
11:46:42 | PMunch | Hmm, didn't match /role |
11:46:52 | PMunch | But matched /role/ and /role/<id> |
11:47:11 | FromGitter | <coffeepots> @Varriount What does the code do? I have trouble decoding what macros do sometimes |
11:47:34 | FromGitter | <coffeepots> pattern matching? |
11:48:02 | PMunch | Yeah I could use the regex thing but it seems a bit overkill.. |
11:49:01 | FromGitter | <Varriount> @coffeepots It creates types based on "shapes". It's going to be used to generate a library for interfacing with the AWS API. |
11:49:28 | FromGitter | <Varriount> There are JSON documents describing the API. I'm going to generate types and procedures from them. |
11:49:43 | * | Tiberium quit (Remote host closed the connection) |
11:51:58 | FromGitter | <coffeepots> whoa niiiice |
11:53:16 | FromGitter | <coffeepots> IMHO Nim just needs more libraries. Seriously thinking of creating a barebones 'gamedev' library to stand alone with common algorithms in |
11:53:47 | PMunch | coffeepots, you are welcome to contribute to my gamelib :) |
11:54:00 | FromGitter | <coffeepots> on that note: @zacharycarter Frag.io is well good! |
11:54:09 | PMunch | https://github.com/PMunch/SDLGamelib |
11:54:38 | PMunch | It's currently based on SDL but I'm considering to create a compile time flag to remove all SDL stuff |
11:54:51 | FromGitter | <Varriount> @dom96 https://github.com/nim-lang/Nim/pull/5872 |
11:54:56 | PMunch | Since a lot of it is general game related stuff (like collisions and tweening) |
11:54:56 | FromGitter | <coffeepots> @PMunch hey I was looking at that just last night! Nice work on all the collision options you have in there |
11:55:09 | PMunch | Thanks, took a while to implement them all :P |
11:55:21 | FromGitter | <coffeepots> I was thinking of basing on opengl as the GLvectorfX are not bad types to work with |
11:55:25 | FromGitter | <coffeepots> I bet! |
11:55:34 | dom96 | PMunch: Just create another route for "/role" and redirect to "/role/" then :) |
11:55:55 | PMunch | dom96, yeah that would work I guess :P |
11:56:14 | PMunch | What's the default return value for a sequence by the way? |
11:56:25 | PMunch | A sequence of length 0, or nil? |
11:56:38 | FromGitter | <coffeepots> @PMunch Do you have a broadphase like quadtree in there? Couldn't see it at first glance |
11:57:13 | FromGitter | <Varriount> PMunch: You mean, what value does `var s: seq[int]` have by default? |
11:57:58 | PMunch | Varriount, yes. But this is a seq[seq[string]]. |
11:58:16 | FromGitter | <Varriount> sequences are nil by default. |
11:58:21 | FromGitter | <coffeepots> We really need a really performant ECS too. I was looking at making one with slotmaps in the hope to avoid hash tables and keep stuff in cache |
11:58:21 | PMunch | coffeepots, not at the moment no. I was thinking of adding it in there but haven't gotten around to it yet |
11:58:43 | FromGitter | <coffeepots> Well I could send you mine but it's probably badly written :D |
11:58:59 | FromGitter | <coffeepots> tbh the crux of the code is only a couple hundred lines at worst |
11:59:13 | FromGitter | <zacharycarter> Thank you @coffeepots |
12:00:03 | * | FromGitter * coffeepots is off to lunch |
12:00:14 | PMunch | Well I've taken a slightly different approach with the tick Ticker and Renderer modules in the gamelib |
12:01:13 | * | Tiberium joined #nim |
12:04:20 | * | Tiberium quit (Remote host closed the connection) |
12:07:05 | * | Tiberium joined #nim |
12:07:58 | * | arnetheduck_ joined #nim |
12:09:14 | * | MrAxilus[m] quit (Remote host closed the connection) |
12:09:16 | * | ehmry[m] quit (Remote host closed the connection) |
12:09:17 | * | dyce[m] quit (Remote host closed the connection) |
12:09:18 | * | vopi181[m] quit (Read error: Connection reset by peer) |
12:09:18 | * | stisa quit (Read error: Connection reset by peer) |
12:09:20 | * | TheManiac quit (Remote host closed the connection) |
12:09:20 | * | hohlerde quit (Read error: Connection reset by peer) |
12:09:20 | * | Jipok[m] quit (Remote host closed the connection) |
12:09:21 | * | M-Quora quit (Read error: Connection reset by peer) |
12:09:21 | * | Guest73656[m] quit (Remote host closed the connection) |
12:09:21 | * | erwana[m] quit (Read error: Connection reset by peer) |
12:09:21 | * | jivank[m] quit (Read error: Connection reset by peer) |
12:09:22 | * | mindB quit (Read error: Connection reset by peer) |
12:13:22 | * | krux02 joined #nim |
12:14:00 | * | erwana[m] joined #nim |
12:16:55 | skrylar | bleh. trying to implement hirise in nim |
12:17:02 | skrylar | but i'm having trouble understanding the actual paper :| |
12:19:01 | PMunch | Aah, dom96 apparently get "/role/?": works |
12:19:21 | dom96 | cool |
12:20:17 | * | MrAxilus[m] joined #nim |
12:20:17 | * | dyce[m] joined #nim |
12:20:18 | * | M-Quora joined #nim |
12:20:18 | * | ehmry[m] joined #nim |
12:20:24 | * | Jipok[m] joined #nim |
12:20:24 | * | hohlerde joined #nim |
12:20:24 | * | jivank[m] joined #nim |
12:20:24 | * | TheManiac joined #nim |
12:20:24 | * | Guest73656[m] joined #nim |
12:20:25 | * | vopi181[m] joined #nim |
12:20:25 | * | stisa joined #nim |
12:20:25 | * | mindB joined #nim |
12:31:26 | skrylar | wat. there's no sort function in the lists module. |
12:32:01 | skrylar | bleh i'll post the mergesort i wrote later maybe dom96 or Araq can cannibalize it |
12:35:27 | krux02 | skrylar, for what are you using lists? |
12:35:51 | krux02 | seq is the type for appendable arrays |
12:37:43 | PMunch | krux02 he said he's using the lists module |
12:37:54 | PMunch | https://nim-lang.org/docs/lists.html |
12:38:09 | PMunch | Basic implementation of linked lists |
12:38:34 | skrylar | i had some code using them withe efl's eina and made a similar module in nim |
12:38:43 | skrylar | it had a sort and sorted insert, so i have functions for that |
12:38:54 | skrylar | if they're wanted for the stdlib i don't mind if they yoink them |
12:39:09 | krux02 | PMunch: I know linked lists. I just wanted to say that seq is probably the better alternative even without knowing the exact use case |
12:39:34 | skrylar | seq implies a lot of shuffling |
12:39:47 | PMunch | krux02, depends. If you need deletion then seqs are out as you can't keep a reference for deleting nodes easily. |
12:40:09 | skrylar | i *do* use a vector/seq for storing "notes" in a midi sense. but i use doubly linked lists for storing the midi events. |
12:40:21 | skrylar | Because when a note is moved, the note on and note off have to be popped and reinserted sorted |
12:40:22 | krux02 | PMunch: I know that is the default argument. But for deletion you normally need to scan though the list to filter out the elements you want to delete |
12:40:36 | krux02 | so it stays linear time |
12:41:32 | krux02 | skrylar: is the midi event a pointer/ref type or a value type? |
12:41:36 | PMunch | krux02, in a single list you would just return the node reference when you insert. Then to delete simply go to the last node (assuming doubly linked) and link that to the next and link the next to your last. |
12:41:44 | PMunch | That's not linear time |
12:41:46 | skrylar | krux02, i think right now its a pointer |
12:42:23 | skrylar | didn't optimize the note part but i did the events themselves |
12:42:34 | skrylar | although the nim port doesn't let you write notes in yet anyway :/ |
12:44:18 | krux02 | my point is, moving memory that is just linear and not scattered around is fast |
12:44:30 | def- | dom96, Araq: Isn't the nim-0.17.0.tar.xz compressed with XZ_OPT=-9? 10 times smaller when I compress it manually with XZ_OPT=-9 tar cfZ nim-0.17.0.tar.xz nim-0.17.0. The scripts I can find in nim repo look fine, so not sure why that's happening |
12:44:32 | * | Tiberium quit (Remote host closed the connection) |
12:45:19 | dom96 | def-: no idea, it was created via 'koch xz' |
12:45:19 | krux02 | so inserting into a seq at the front is very fast compared to iterationg a linked list where every node might be a cache miss |
12:45:31 | krux02 | a cache miss can be up to 200 CPU cycles |
12:46:45 | PMunch | krux02, you don't have to iterate a linked list to add to the front |
12:47:03 | PMunch | You should make your new node point to the old head and then change the head to the new node |
12:48:35 | krux02 | PMunch: I know how linked lists are supposed to be used. The problem is just that it is wrong in practice. The CPU cache eleminates all theoretical advantages of a linked list. |
12:48:58 | PMunch | That depends on how you use them |
12:49:05 | PMunch | But I agree that they are bad for cache purposes |
12:49:27 | krux02 | They also have a lot of overhead |
12:50:03 | PMunch | Recently I tried in Nim to create a seq and a linked list of nodes into which I inserted a series of procs and then ran 100_000 loops through both to execute the procs. Linked list was faster for some reason |
12:50:17 | def- | dom96: ./koch csource -d:release && ./koch xz && ls -lha build/nim-0.17.0.tar.xz |
12:50:26 | def- | 3.6 MB instead of ~20 MB from website |
12:50:43 | krux02 | PMunch: do you have a link? |
12:50:56 | dom96 | def-: you need to build docs too with './koch web0' |
12:51:07 | * | Tiberium joined #nim |
12:51:18 | dom96 | https://github.com/nim-lang/Nim/wiki/Creating-a-release |
12:51:52 | PMunch | krux02, not really. I was just testing it for myself since I needed it for the renderer in gamelib |
12:52:27 | PMunch | https://github.com/PMunch/SDLGamelib/blob/master/gamelib/scenegraph.nim |
12:52:38 | PMunch | That's the current implementation with a double linked list |
12:53:11 | PMunch | I was adding RenderProcs to the seq and linked list |
12:53:12 | def- | dom96: ok, 3.9 MB, but point stands |
12:53:42 | dom96 | Dunno then, I built on a Mac maybe that's why? |
12:53:50 | PMunch | My guess is that the procs doing the rendering invalidates the cache |
12:54:15 | def- | dom96: possible. Should I make it tar and xz separately as a workaround? |
12:54:35 | dom96 | def-: no idea, I didn't implement this. |
12:54:37 | def- | I guess on mac you use gtar. Maybe it's an old version and it doesn't know about XZ_OPT yet |
12:55:55 | PMunch | dom96, by the way. About dumpCode/codeRepr, would dumpAstGen and astGenRepr be better? |
12:56:20 | PMunch | I want to stick with the dumpX Xrepr pattern used for lisp and tree |
12:56:20 | dom96 | yes |
12:57:52 | * | yglukhov quit (Remote host closed the connection) |
13:01:56 | * | yglukhov joined #nim |
13:01:59 | * | yglukhov quit (Remote host closed the connection) |
13:02:47 | PMunch | dom96, there now I renamed it |
13:05:46 | * | yglukhov joined #nim |
13:09:25 | krux02 | PMunch: Well probably you are right the the procs invalidate the cache. |
13:10:00 | PMunch | But I was still surprised to see that the linked list was faster and not only as fast |
13:10:23 | PMunch | IIRC it was a considerate amount as well |
13:10:41 | krux02 | Well I can't explain that. But I am also not 100% sure what you mesured and how |
13:11:59 | krux02 | At least you did the measurement so that is a very good point that you are right |
13:12:14 | krux02 | It just conflicts with my view on the world |
13:12:46 | PMunch | Mine as well |
13:13:16 | PMunch | Did a course on Green computing which was a lot about cache-locality and that stuff. So it was odd to see this behaviour |
13:13:32 | * | yglukhov quit (Remote host closed the connection) |
13:13:55 | krux02 | Well I acutally saw the "seq" implementation and it was not so simple as I thought it to be |
13:14:52 | krux02 | but I thought that at least iterating it should be fast |
13:14:53 | FromGitter | <ephja> so, how come zah's fork always show up first on google searches? |
13:15:03 | PMunch | Basically I created a seq, then in a loop I added 10_000 procs to that seq. The procs were all a simple call to render a texture. Then in the main loop I iterated through both and ran all the procedures. I timed the milliseconds between each frame and converted this to an FPS measurement. |
13:15:32 | krux02 | ephja: google has personalized search results, maybe you were on that page from time to time |
13:18:24 | * | gokr quit (Ping timeout: 260 seconds) |
13:18:57 | * | gokr joined #nim |
13:20:29 | FromGitter | <ephja> I don't think so. nimjs popped up this time when I searched for the system module |
13:21:05 | FromGitter | <ephja> oh well |
13:21:55 | * | yglukhov joined #nim |
13:26:49 | FromGitter | <coffeepots> hey, so whats up with this in test2? https://gist.github.com/coffeepots/9cad1538b434a45cca684f2e99461ce0 |
13:27:03 | FromGitter | <coffeepots> again, if you change actions to be untyped it works! |
13:27:15 | FromGitter | <coffeepots> as typed, injected variable is not visible |
13:31:18 | * | vivus joined #nim |
13:31:38 | vivus | what is the correct syntax for doing this: echo i + ")" + reg_display[i] ? |
13:31:42 | FromGitter | <stisa> I believe with `typed` actions is already type checked before entering the template, so it can't see `x` ( because it doesn't exist yet ) |
13:32:33 | FromGitter | <ephja> & for concatenation |
13:32:45 | vivus | oh yes, not + |
13:33:40 | FromGitter | <ephja> echo will attempt to convert every argument to a string, so you might want to do "echo a, b, x" |
13:33:41 | vivus | woops, still the same error: Error: type mismatch: got (range 0..3(int), string) |
13:34:14 | * | chemist69 quit (Ping timeout: 246 seconds) |
13:35:17 | FromGitter | <ephja> just replace + with , in other words |
13:35:49 | vivus | a, b, x ... worked :) thank you @ephja |
13:39:48 | FromGitter | <coffeepots> @stisa yeah I think you're right. That must have changed recently |
13:40:08 | FromGitter | <coffeepots> since you can apparently return values from untyped, i guess I'll just use that |
13:41:03 | FromGitter | <coffeepots> i kinda thought it'd make more sense to not allow return values from untyped as there's typed, but i guess untyped can be anything so why not |
13:42:28 | FromGitter | <coffeepots> thanks to everyone that's helped me, should be able to get my project back up and running tonight :) |
13:46:01 | * | Trioxin joined #nim |
13:47:43 | * | Lord_Nightmare quit (Ping timeout: 258 seconds) |
13:56:13 | * | Arrrr quit (Read error: Connection reset by peer) |
13:56:48 | * | Neomex quit (Ping timeout: 260 seconds) |
14:01:26 | * | chemist69 joined #nim |
14:03:07 | FromGitter | <ephja> as long as the output passes the semantic phase |
14:12:45 | * | rokups joined #nim |
14:16:52 | krux02 | coffeepots: I think the fact that *untyped* can return values and *typed* can't doesn't make a lot of senso |
14:17:06 | krux02 | I think the old stmt and expr did make more sense |
14:17:41 | krux02 | but you can actually put the type there when your macro/template is supposed to return value of that type |
14:18:07 | krux02 | you can't use return in that case though, you have to use result = ... |
14:19:07 | chrisheller | Anyone know of a Nim memory dumper? e.g. give it address/pointer and a size and it will pretty print the memory contents starting at that address? |
14:19:31 | chrisheller | Didn't see anything in nimble or standard library |
14:20:55 | * | yglukhov quit (Remote host closed the connection) |
14:32:02 | FromGitter | <ephja> krux02: I did try to return an actual literal once, but it didn't work. perhaps it does make more sense to construct a node instead |
14:33:55 | FromGitter | <Varriount> chrisheller: No, although it's a neat idea |
14:34:11 | FromGitter | <coffeepots> @krux02 I agree it is weird that untyped can return values, wait are you saying typed cannot return values? That is very strange! I thought typed == expr and untyped == stmt |
14:34:16 | FromGitter | <Varriount> Like something that would return a hex dump of a memory block? |
14:34:33 | chrisheller | Exactly. |
14:34:59 | FromGitter | <ephja> Araq: "macro m(x: type(enum)): set[x]", "ordinal type expected". reported? |
14:35:04 | chrisheller | I can put something together. I was just surprised that no one else had done that yet |
14:35:54 | * | BennyElg quit (Remote host closed the connection) |
14:36:16 | FromGitter | <ephja> is github being slow for anyone else right now? |
14:38:08 | * | yglukhov joined #nim |
14:38:41 | * | sz0 quit (Quit: Connection closed for inactivity) |
14:42:20 | * | yglukhov quit (Remote host closed the connection) |
14:42:24 | Trioxin | man objective-c is terrible. was just looking on rosetta code |
14:43:09 | demi- | why do you think it is terrible? |
14:43:35 | Trioxin | was just skimming this page and saw this: https://rosettacode.org/wiki/HTTP#Objective-C |
14:44:22 | demi- | that seems like a very outdated code sample, but what about it |
14:47:40 | * | yglukhov joined #nim |
14:48:45 | Trioxin | not very intuitive and is very busy for what it's doing. obj-c is a relatively modern language right? I guess the c++ example isn't much better but I really don't think all that is needed in C++. The C one shows using curl which can be used from just about any language |
14:49:09 | demi- | it is like 30-45 years old |
14:49:55 | Trioxin | maybe I'll edit some of these |
14:50:05 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:50:13 | Calinou | well, it's Apple, what did you expect :P |
14:50:14 | Trioxin | damn look at cobol |
14:50:47 | Trioxin | that's cobol + curl |
14:51:17 | demi- | and that is almost identical to the swift example; which is because they are both using the samne framework, which isn't a great example of the language at all tbh, since the language on its own is basically just the C stdlib plus some small-talk inspired classes |
14:53:22 | vivus | whoa cobol |
14:53:23 | * | yglukhov quit (Remote host closed the connection) |
14:53:59 | * | yglukhov joined #nim |
14:55:08 | Trioxin | random Ada examples look neat. I would be a full-time Ada programmer right now if my USAF recruiter hadn't screwed me over. |
14:55:24 | Trioxin | when I was 18 |
14:56:49 | Trioxin | I imagine they still use it a lot. this was 2002 I think |
14:58:58 | * | Lord_Nightmare joined #nim |
15:00:32 | * | Tiberium quit (Remote host closed the connection) |
15:00:47 | FromGitter | <coffeepots> I do not envy cobol developers |
15:02:25 | * | yglukhov quit (Remote host closed the connection) |
15:03:12 | * | yglukhov joined #nim |
15:03:54 | * | Arrrr joined #nim |
15:03:54 | * | Arrrr quit (Changing host) |
15:03:54 | * | Arrrr joined #nim |
15:05:56 | * | yglukhov quit (Remote host closed the connection) |
15:06:26 | * | yglukhov joined #nim |
15:08:38 | * | Tiberium joined #nim |
15:10:24 | * | m712 joined #nim |
15:16:04 | * | Andris_zbx quit (Remote host closed the connection) |
15:16:14 | FromGitter | <zacharycarter> Hrmm I have some questions about spawn / threadpools |
15:16:39 | FromGitter | <zacharycarter> if a FlowVar.isReady == true and I call the ^ proc on the flow var, shouldn't there be no blocking time? |
15:16:41 | * | adeohluwa joined #nim |
15:18:18 | dom96 | zacharycarter: yep, there shouldn't be. |
15:19:18 | FromGitter | <zacharycarter> hrm that's not what I'm finding, I must be doing something wrong |
15:24:32 | skrylar | meh, will fiddle with hirise again some other time |
15:35:35 | * | gokr quit (Ping timeout: 260 seconds) |
15:37:27 | * | chemist69 quit (Ping timeout: 245 seconds) |
15:47:26 | FromGitter | <zacharycarter> @dom96: not sure what about my code is screwed up, but as a quick test I wrote this: https://gist.github.com/zacharycarter/0c3afefe9594a04ce7dfeed78a80f476 |
15:47:32 | FromGitter | <zacharycarter> might be useful as a simple spawn example |
15:50:41 | * | yglukhov quit (Remote host closed the connection) |
15:54:20 | * | nsf quit (Quit: WeeChat 1.7.1) |
15:59:30 | * | skrylar wonders if += should be overloaded for UIs |
15:59:41 | skrylar | somewindow += somebutton |
15:59:59 | skrylar | I mean it is the logical interpretation of summing a container with a control, but it's also sort of cryptic |
16:00:03 | FromGitter | <ephja> add/&/&=? |
16:00:05 | fr1end | why not & like strings? |
16:00:17 | skrylar | because i haven't used nim in years and i don't know what silly voodoo you do |
16:00:26 | skrylar | other than these like 4 nim files i wrote lol |
16:00:51 | fr1end | same boat lol, had to spend ~hr paging it all back in before I could do anything |
16:01:55 | skrylar | i probably won't use &= tho, personally |
16:02:05 | skrylar | i prefer readability a lot (i mean, smalltalk <3) |
16:02:25 | fr1end | 'readability' ;) |
16:02:40 | * | yglukhov joined #nim |
16:02:46 | fr1end | I don't dislike smalltalk but readable isn't what I'd call it |
16:03:22 | krux02 | ``newLit(1'i8) returns an int literal, not ant int8 literal |
16:04:26 | skrylar | IRC throwSticksAt: fr1end |
16:04:39 | * | chemist69 joined #nim |
16:06:01 | * | Trustable joined #nim |
16:06:20 | * | gokr joined #nim |
16:06:32 | fr1end | (defend self :with lisp) |
16:07:24 | Trioxin | in this example, why does sock have to be defined before the procs? https://github.com/rgv151/libssh2.nim/blob/master/examples/ssh_exec.nim |
16:07:36 | Trioxin | shouldn't it just be before the procs are used? |
16:09:54 | * | mwbrown quit (Quit: Exiting) |
16:14:10 | Trioxin | guess the compiler needs it |
16:14:43 | * | mwbrown joined #nim |
16:16:27 | skrylar | ah poo. varargs in templates don't seem to let you make curry templates |
16:16:42 | skrylar | template (derp) = if something != nil: something(...) |
16:25:11 | krux02 | well that's weird |
16:25:42 | krux02 | int int32 int64 are all distinct types, but float and float64 are not |
16:29:53 | skrylar | might depend on the build |
16:30:26 | skrylar | blah. |
16:30:57 | skrylar | I made a concept type, changed some list functions over to that, and instead of it (correctly) realizing that my type was compatible it just borked that it wasn't the same |
16:32:05 | FromGitter | <ephja> I wonder if I reported that |
16:42:50 | * | brson joined #nim |
16:47:51 | * | BennyElg joined #nim |
16:52:17 | * | gokr quit (Quit: Leaving.) |
16:58:35 | BennyElg | Hey all, how I "Unpack" SELECT results into pre defined type and fill is parameters |
17:00:51 | * | yglukhov quit (Remote host closed the connection) |
17:01:48 | * | couven92 quit (Quit: Client disconnecting) |
17:02:27 | * | rokups quit (Quit: Connection closed for inactivity) |
17:03:40 | demi- | from a DB query you mean? |
17:06:54 | BennyElg | yes |
17:07:25 | BennyElg | for example in go I build struct type with the rows parameters and then assign it to the row with Scan(&myStructInstance) |
17:08:33 | demi- | i think you want this module: https://nim-lang.org/docs/marshal.html |
17:10:30 | BennyElg | Thanks! |
17:11:22 | demi- | hmm, i seem to have found a 404 page in the official documentation, which repo is the correct place to report this? |
17:12:00 | BennyElg | I cant do this? var rows = db.fastRows(sql"SELECT * FROM table") |
17:12:41 | demi- | i think it depends on what your backing store is? |
17:14:27 | BennyElg | An Iterator Object just with nice presentation |
17:14:38 | demi- | oh, you may want this: `sql"SELECT id,<your key> FROM <table name>"` |
17:14:41 | BennyElg | instead of saying for row in con.fastRows.... |
17:14:45 | BennyElg | just saying for row in rows |
17:18:08 | * | nsf joined #nim |
17:18:10 | skrylar | fr1end, y'know, i just got thinking. i think it might be entirely possible to write smalltalk syntax in nim macros. lol |
17:19:08 | fr1end | that would be impressive |
17:19:11 | skrylar | i can't think of a good reason to *do* that, but |
17:19:27 | skrylar | that's a lie |
17:20:04 | skrylar | if you had a scripting interpreter that read smalltalk syntax (it's not that hard; you could transpile ST-80 to javascript and run duktape, or to lua and run luajit) then say "well you can copy/paste it to this nim macro if it needs to be faster." |
17:20:33 | skrylar | i know some people liked using angelscript for that reason. similar enough syntax to C++ that if they needed to speed up a function it needed very little editing |
17:20:44 | skrylar | hmm |
17:31:51 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
17:35:40 | * | pilne joined #nim |
17:36:11 | * | krux02 quit (Ping timeout: 272 seconds) |
17:36:20 | * | krux02 joined #nim |
17:40:17 | skrylar | You know. I suppose `parent=` could logically be suggested as "attach to this" |
17:40:27 | skrylar | It's a weird way of doing it but it does read correctly |
17:46:41 | * | yglukhov joined #nim |
17:49:32 | krux02 | I am procrastinating, and because I did not want to do what I should do, I created a pull request for Nim |
17:49:52 | krux02 | I hope that is not offending anyone |
17:51:08 | * | yglukhov quit (Ping timeout: 258 seconds) |
17:58:44 | FromGitter | <zacharycarter> hrm I can't figure out if this is a bug or not, my flowvar says it's ready but it's still blocking for over a second sometimes, depending what I'm doing in the flow var |
17:58:49 | FromGitter | <zacharycarter> err sorry in the spawned proc I mean |
17:59:26 | FromGitter | <zacharycarter> I'll try to make a self contained example |
18:05:26 | * | mwbrown quit (Quit: Exiting) |
18:07:04 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/97d04f9d864f40ce22cb4a1844e39f3b |
18:07:19 | FromGitter | <zacharycarter> the thread blocks for 0.051s after the flow var claims to be ready |
18:11:32 | FromGitter | <Varriount> @zacharycarter How much data is being copied? |
18:12:28 | FromGitter | <zacharycarter> in the flow var? |
18:12:38 | FromGitter | <Varriount> Yes. |
18:12:43 | FromGitter | <zacharycarter> Hrm just the parsed json |
18:12:55 | FromGitter | <Varriount> Not the tileset information? |
18:13:05 | FromGitter | <zacharycarter> not in this example |
18:13:09 | * | mwbrown joined #nim |
18:13:21 | FromGitter | <zacharycarter> this example is just contrived, in my actual code the blocking is happening for much longer ~2 seconds sometimes |
18:13:30 | FromGitter | <zacharycarter> but the code is structurally similar |
18:13:33 | FromGitter | <Varriount> You might find it worthwhile to run some sort of C benchmarking tool |
18:13:46 | FromGitter | <zacharycarter> if anyone has any suggestions for one I'd appreciate it |
18:14:00 | FromGitter | <Varriount> You're on a Mac, right? |
18:14:03 | FromGitter | <zacharycarter> yessir |
18:19:28 | krux02 | are here Nim maintainers? |
18:21:57 | * | vlad1777d quit (Quit: Leaving) |
18:22:05 | * | yglukhov joined #nim |
18:22:42 | FromGitter | <Varriount> @zacharycarter You can try instruments. It's part of xcode |
18:22:56 | demi- | instruments is very good forcodeprofiling |
18:22:56 | FromGitter | <Varriount> krux02: Araq, dom96, and zah are the maintainers |
18:25:15 | FromGitter | <zacharycarter> hrm yeah trying to get my head around it now |
18:25:32 | FromGitter | <zacharycarter> my app creates log files and every time I start up my app in instruments it crashes saying it can't find the file |
18:25:55 | * | chemist69 quit (Ping timeout: 246 seconds) |
18:27:00 | demi- | zacharycarter, how are you attaching/starting it up? |
18:27:09 | * | chemist69 joined #nim |
18:27:20 | FromGitter | <zacharycarter> I'm just directing time profiler to the binary |
18:27:29 | FromGitter | <zacharycarter> ah I see |
18:27:32 | FromGitter | <zacharycarter> I need to specify a working directory |
18:28:47 | * | dddddd joined #nim |
18:41:25 | * | yglukhov quit (Remote host closed the connection) |
18:42:06 | * | yglukhov joined #nim |
18:49:12 | * | Tiberium quit (Remote host closed the connection) |
18:49:38 | krux02 | well I hate at the moment that the array size is not just an integebr but this weird range thing |
18:49:54 | krux02 | how do I get the bounds of such a range? |
18:52:00 | FromGitter | <Varriount> krux02: You can specify the size of an array.. |
18:52:03 | vivus | high - low ? |
18:52:33 | FromGitter | <Varriount> But yes, high(arr) will give you the highest index, and low(arr) the lowest |
18:56:42 | krux02 | well I am in generic code |
18:56:50 | krux02 | I post an example |
18:57:10 | krux02 | http://ix.io/uG2 |
18:57:35 | krux02 | how do I use N1 and N2? |
18:57:56 | krux02 | if arrays would be just a length, I could simply add N1 and N2 |
18:59:01 | krux02 | scratch.nim(11, 81) Error: ambiguous call; both system.+(x: int, y: int) and system.+(x: float, y: float) match for: (N1.high, N2.high) |
19:00:03 | * | xet7 joined #nim |
19:02:14 | FromGitter | <zacharycarter> not sure what to make of this... |
19:02:15 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/T1GD/Screen-Shot-2017-05-23-at-3.01.49-PM.png) |
19:02:23 | FromGitter | <zacharycarter> that's the section during which the main thread seems to be blocked |
19:03:12 | FromGitter | <ephja> an addInt function? |
19:03:59 | * | yglukhov quit (Remote host closed the connection) |
19:04:10 | FromGitter | <zacharycarter> I just picked a random point in time during the programs execution where the main thread was blocked |
19:04:22 | FromGitter | <zacharycarter> I have no idea how to use this tool / figure out what to do about the thread blocking |
19:04:53 | * | yglukhov joined #nim |
19:05:22 | FromGitter | <Varriount> @zacharycarter If you look at the call stack, you can see it's part of a deep copy operation |
19:05:25 | demi- | zacharycarter, what analysis tool in instruments are you running this under? |
19:08:38 | demi- | zacharycarter: http://help.apple.com/instruments/mac/8.3/ this will probably be helpful if you have never used this before |
19:08:38 | * | yglukhov quit (Remote host closed the connection) |
19:11:04 | FromGitter | <Varriount> krux02: bing |
19:11:05 | FromGitter | <Varriount> https://gist.github.com/Varriount/7df2090adc52e9832647a3fb7b00e399 |
19:11:58 | * | yglukhov joined #nim |
19:12:20 | FromGitter | <Varriount> @zacharycarter Looking at the call stack, it appears `^` (whatever that does) is copying data from one thread to another |
19:12:58 | FromGitter | <Varriount> You might try using a pointer to string or a cstring |
19:13:32 | FromGitter | <zacharycarter> @Varriount gotcha thank you I'll try that |
19:13:41 | FromGitter | <zacharycarter> demi- : thanks |
19:14:49 | FromGitter | <Varriount> @zacharycarter Could I see the code you're using? |
19:15:23 | * | krux02 quit (Remote host closed the connection) |
19:15:29 | FromGitter | <zacharycarter> sure |
19:15:40 | FromGitter | <zacharycarter> @Varriount let me commit really quickly |
19:18:19 | FromGitter | <zacharycarter> @Varriount there's quite a bit of code here but I"ll try to point out the relevant sections |
19:19:12 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/examples/desktop/08-tiled-map/main.nim#L60 |
19:19:31 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/examples/desktop/08-tiled-map/main.nim#L109 |
19:19:50 | * | yglukhov quit (Remote host closed the connection) |
19:20:12 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/src/frag/modules/assets.nim#L165 |
19:20:30 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/src/frag/modules/assets.nim#L313 |
19:21:01 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/src/frag/maps/tiled_map.nim#L217 |
19:23:14 | FromGitter | <Varriount> Is there a single section dealing with the spawn logic? |
19:23:23 | FromGitter | <ephja> those darn suffixes |
19:24:55 | FromGitter | <Varriount> @ephja Still haven't found the cause of that in the highlighting files. Sorry. |
19:24:59 | * | Matthias247 joined #nim |
19:25:09 | FromGitter | <zacharycarter> @Varriount yeah one sec |
19:25:23 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/src/frag/modules/assets.nim#L313 issues the spawn call |
19:26:04 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/src/frag/modules/assets.nim#L313 |
19:26:09 | FromGitter | <zacharycarter> checks to see if the FlowVar is ready |
19:26:29 | FromGitter | <zacharycarter> https://github.com/fragworks/frag/blob/html5/src/frag/modules/assets.nim#L313 is called once it's ready |
19:26:41 | FromGitter | <Varriount> Why are you doing all those casts? You shouldn't need to cast anything |
19:28:36 | FromGitter | <zacharycarter> omg I just linked the same line 3 times lol my bad |
19:28:58 | FromGitter | <zacharycarter> I figured I needed to cast the FlowVarBase instances into their actual types |
19:30:58 | FromGitter | <zacharycarter> not sure how to do it without a cast |
19:31:40 | FromGitter | <Varriount> Wait, you're storing results from 'spawn' s of differing return types in one sequence? |
19:32:13 | FromGitter | <zacharycarter> yes |
19:32:54 | FromGitter | <zacharycarter> well kind of |
19:33:23 | FromGitter | <zacharycarter> I eventually end up populating the assets sequence |
19:33:52 | FromGitter | <zacharycarter> only some of the spawn calls return ref Assets, others return other ref types and then I create and insert a ref Asset after I've retrieved the result from the spawn call |
19:36:07 | * | Ven joined #nim |
19:36:30 | * | Ven is now known as Guest41355 |
19:38:13 | * | Arrrr quit (Read error: Connection reset by peer) |
19:43:59 | FromGitter | <Varriount> @zacharycarter My best guess is that your asset data is being deep copied |
19:44:06 | * | Guest41355 quit (Ping timeout: 272 seconds) |
19:44:41 | * | yglukhov joined #nim |
19:45:22 | FromGitter | <zacharycarter> hrm |
19:45:33 | FromGitter | <zacharycarter> I can try to do a shallow copy instead |
19:46:10 | * | Ven_ joined #nim |
19:46:25 | * | Vladar quit (Remote host closed the connection) |
19:49:35 | FromGitter | <zacharycarter> not sure I have any control over that actually |
19:50:33 | FromGitter | <zacharycarter> I notice the sooner I get out of the spawned procedure, the less time things are locked up for |
19:52:24 | FromGitter | <zacharycarter> in fact @Varriount if I comment out this section of code: https://github.com/fragworks/frag/blob/html5/src/frag/maps/tiled_map.nim#L232-L258 there's basically no blocking |
19:54:56 | FromGitter | <Varriount> @zacharycarter https://nim-lang.org/docs/threadpool.html#^,FlowVar[ref.T] |
19:55:06 | FromGitter | <Varriount> blocks until the value is available and then returns this value. |
19:56:02 | FromGitter | <zacharycarter> yeah but I check to see if the flow var is ready first |
19:56:04 | FromGitter | <zacharycarter> before I call that |
19:56:31 | FromGitter | <zacharycarter> so the proc should have already completed prior to me calling ^ regardless |
19:59:08 | * | Sentreen quit (Read error: Connection reset by peer) |
19:59:23 | * | Neomex joined #nim |
19:59:47 | FromGitter | <ephja> @Varriount ok :smile: |
20:01:14 | * | Sentreen joined #nim |
20:02:53 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:03:12 | * | Sentreen quit (Client Quit) |
20:03:22 | * | Sentreen joined #nim |
20:18:12 | * | Trustable quit (Remote host closed the connection) |
20:21:26 | skrylar | hrm. |
20:21:31 | skrylar | its telling me that float.high is invalid |
20:21:39 | skrylar | is there no such thing as maxfloat? |
20:23:54 | * | bjz joined #nim |
20:25:48 | * | noethics quit (Remote host closed the connection) |
20:26:08 | * | noethics joined #nim |
20:26:19 | FromGitter | <Varriount> I don't think so |
20:32:45 | FromGitter | <Varriount> @zacharycarter I'd try refactoring/commenting your code as much as reasonable, then possibly file an issue |
20:33:55 | PMunch | skrylar, Varriount, of course there's a max |
20:36:00 | PMunch | The highest representable in a float is about 3.402823 × 1038 |
20:37:36 | * | PMunch quit (Quit: leaving) |
20:41:31 | * | vivus quit (Quit: Leaving) |
20:45:39 | * | gokr joined #nim |
20:59:30 | * | Sembei joined #nim |
20:59:39 | * | dddddd quit (Remote host closed the connection) |
20:59:39 | * | smt quit (Remote host closed the connection) |
20:59:47 | * | smt joined #nim |
21:01:25 | demi- | there should be float-max and float-min |
21:03:51 | * | Ven joined #nim |
21:04:15 | * | Ven is now known as Guest25118 |
21:12:50 | gokr | I still think it would be awesome if Nimmers could work together on a good Nim wrapper of Urho3D. I do note that Miguel de Icaza and Microsoft/Xamarin also realized Urho3D is a good engine (they are actively maintaining a wrapper now for). |
21:13:50 | FromGitter | <Varriount> gokr: https://github.com/3dicc/Urhonimo ? |
21:14:08 | gokr | Yeah, but it would need to get updated and improved. |
21:15:01 | gokr | I see so many here building their own game engines in Nim (which I of course applaud and can relate to, always cool to build your own) - but standing on top of Urho3D is a solid superb base. |
21:15:35 | gokr | And Urho3D relies on basically the same base libraries that I see mentioned here over and over (SDL2, Assimp, Bullet etc etc) |
21:21:32 | * | PMunch joined #nim |
21:22:38 | * | couven92 joined #nim |
21:26:51 | PMunch | dom96, there's something wrong with Jester |
21:26:58 | PMunch | resp doesn't terminate a route any longer |
21:30:37 | FromGitter | <zacharycarter> gokr: I built frag mostly as a learning experience, and also with the goal to build something that's usable to others. Using someone's engine is great but at a certain point you're not learning how to write an engine, you're learning how to write game code. |
21:31:18 | FromGitter | <zacharycarter> Or you're learning the specifics of that framework / engine |
21:31:29 | * | Guest25118 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:32:00 | gokr | Yes, and do note my careful words - I just feel that... well a) building a really good game engine (as Urho3D is) is a LOT more work than people may think and b) if we had a stellar Nim wrapper of Urho3D that could very well be a "killer app" for Nim. |
21:32:10 | FromGitter | <zacharycarter> I don't disagree with you that bindings to something like Urho3d, or that engine that def-pri-pub mentioned last night would be nice - I might even use them - but it still wouldn't scratch the itch for learning that level of thigns yourself |
21:32:38 | gokr | I know! :) |
21:33:05 | PMunch | Another benefit of having it in pure Nim is that the Nim compiler is able to not treat it as a black box |
21:33:33 | PMunch | I was working with wxWidgets (C++ bindings) recently and it is also cross-platform |
21:33:48 | PMunch | Which means that it wraps everything into it's own types |
21:34:10 | PMunch | Which is great if you use wxWidgets in C++, but in Nim it's a bit annoying.. |
21:34:40 | * | skrylar quit (Remote host closed the connection) |
21:35:01 | gokr | One idea would be to actually port Urho3D to Nim - but in order for that to not just turn into a "curiosity" it would probably mean you need a few of the core Urho3D devs convinced that Nim is better than C++. |
21:35:19 | gokr | And of course, it would feel (to many) as a lot of work for no big award. |
21:35:40 | FromGitter | <zacharycarter> might as well just write our own game engine in Nim then |
21:35:49 | PMunch | Yeah, we came to that conclusion with wxWidgets as well |
21:36:06 | PMunch | It would be better to have something Nim native, but it would be a lot of work |
21:36:11 | dom96 | PMunch: bug report please |
21:36:13 | gokr | Well, as I said, you may be game engine wizards - but I just have a tremendous respect for the guys behind Urho3D. |
21:37:03 | FromGitter | <zacharycarter> Urho3d is a nice engine for sure, just a lot of work to build and maintain bindings for it |
21:37:21 | FromGitter | <zacharycarter> but if you want to make them I'd surely help test them |
21:37:25 | couven92 | PMunch, though the interesting thing with native GUI is the cross-platform challanges... I actually liked our wxWidgets work, it was fun... :) |
21:37:30 | demi- | dom96: there is a 404 page on the official docs (https://nim-lang.org/docs/sexp.html) where should i be reporting this? |
21:38:33 | PMunch | Aah, the Jester bug seems to be with templates |
21:38:54 | gokr | zacharycarter: You are aware of Urhonimo I guess? |
21:40:28 | FromGitter | <dom96> Dmi |
21:40:36 | FromGitter | <zacharycarter> gokr: I am |
21:40:42 | FromGitter | <dom96> Demi-: Nim repo |
21:40:52 | demi- | ok will do, thanks |
21:41:02 | FromGitter | <zacharycarter> I considered using it before writing my own engine and Araq suggested I do the latter instead of trying to bind to a C++ engine with Nim |
21:41:15 | FromGitter | <zacharycarter> he said he thought it'd be more worhtwhile |
21:41:17 | FromGitter | <zacharycarter> worthwhile* |
21:41:45 | FromGitter | <zacharycarter> since I was attempting to learn engine dev I agreed and started doing a bunch of OpenGl experiments with Nim and then eventually started frag |
21:45:39 | PMunch | Hmm, I'm having a hard time actually figuring out what's wrong dom96 |
21:45:57 | PMunch | I've got two templates that basically wrap some tests up in a try catch |
21:47:17 | PMunch | Wait, I think I've got it |
21:48:42 | gokr | zacharycarter: Cool |
21:49:41 | gokr | Well, I just skimmed a bunch of discussions on the Urho3D forum and I quickly realized (not surprising) that they are (as all core game engine guys) C++ all the way. |
21:50:00 | gokr | And for good reasons, all the libraries they bring together are C++ AFAIK. |
21:50:22 | subsetpark | So I have a Python that I've written in Nim - the way I've been installing it thus far is to run the nim compiler on the machine during install. But I have set things up so that I can distribute just the C source files and distribute them as a normal python extension. The only thing missing is nimbase.h. |
21:50:30 | subsetpark | Should I just include nimbase.h in my package? |
21:51:34 | * | xet7 quit (Remote host closed the connection) |
21:52:00 | gokr | zacharycarter: So I should forget the idea of a good Nim wrapper - since every time I bring it up I get basically zero response. :) |
21:53:29 | FromGitter | <Varriount> Someone might try one day. |
21:53:40 | FromGitter | <Varriount> The problem is that interfacing with C++ is such a pain. |
21:54:02 | FromGitter | <Varriount> Even if you get a binary interface, you have to deal with all the objects - vectors, etc. |
21:54:58 | couven92 | guys... crazy alert: HOw about NimCUDA? |
21:55:00 | PMunch | dom96, https://github.com/dom96/jester/issues/114 |
21:55:17 | couven92 | do we have that? |
21:55:46 | gokr | Varriount: The Urhonimo showed it can be done IMHO. It even includes some fairly advanced demos. |
21:56:33 | FromGitter | <zacharycarter> gokr: my advice is if you want it you're probably going to have to start it yourself |
21:56:44 | gokr | zacharycarter: We did |
21:56:45 | PMunch | couven92, well there is this: https://github.com/jcosborn/cudanim |
21:56:59 | FromGitter | <zacharycarter> yeah but it wasn't maintained |
21:57:14 | * | _orangejuice joined #nim |
21:57:28 | gokr | zacharycarter: I agree, due to various factors we had to put it on ice. |
21:57:30 | FromGitter | <zacharycarter> if you're speaking to UrhoNimo |
21:57:43 | * | _orangejuice left #nim (#nim) |
21:57:54 | FromGitter | <zacharycarter> I think there's interest but there also has to be a driving force behind it |
21:58:00 | gokr | I just mean - we did "start" it. But noone jumped in. |
21:58:15 | FromGitter | <zacharycarter> another interesting engine is this one |
21:58:17 | FromGitter | <zacharycarter> which is pure C |
21:58:54 | FromGitter | <zacharycarter> hrm need to look through irc logs |
21:59:21 | FromGitter | <zacharycarter> http://www.raylib.com/ |
21:59:23 | gokr | When we elected Urho3D for our work at 3DICC I looked at tons of engines and Urho3D stood easily out. |
22:04:51 | gokr | Well, from a cursory look I don't think it's even close to Urho3D. Btw, to see some examples live (emscripten) look at: https://urho3d.github.io/samples/ |
22:05:21 | gokr | For example: https://urho3d.github.io/samples/19_VehicleDemo.html |
22:05:38 | * | brson quit (Ping timeout: 260 seconds) |
22:06:21 | * | brson joined #nim |
22:07:10 | FromGitter | <zacharycarter> I don't see any reason you couldn't build something similar to that with raylib |
22:07:23 | FromGitter | <zacharycarter> but I don't know I haven't used either engine |
22:07:27 | FromGitter | <zacharycarter> both seem fairly capable |
22:08:01 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:10:46 | FromGitter | <zacharycarter> the nice thing about raylib again is it's pure C which is super easy to interface with |
22:14:05 | gokr | No skeletal animation, no networking, no directx and tons more in Urho3D that I don't see in Raylib. BUT... having said that, of course, C is nice and simple. |
22:14:20 | gokr | But I dare say it's not comparable. |
22:16:31 | gokr | I knew very little of game engines before - but I now have a different perspective of all the work going into them. Just stuff like all the shaders, advanced culling techniques, yaddayadda... |
22:17:45 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:19:42 | FromGitter | <zacharycarter> @Varriount remember how you said to file an issue? |
22:19:49 | FromGitter | <zacharycarter> what do you think of this as an example ? |
22:20:14 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/7ab2b31c1e1943241140ce6be7277fca |
22:25:08 | * | subsetpark quit (Ping timeout: 240 seconds) |
22:25:29 | * | subsetpark joined #nim |
22:28:31 | FromGitter | <zacharycarter> I made a better one |
22:32:47 | * | chemist69 quit (Ping timeout: 260 seconds) |
22:32:49 | FromGitter | <zacharycarter> https://github.com/nim-lang/Nim/issues/5878 |
22:34:56 | * | chemist69 joined #nim |
22:37:36 | * | PMunch quit (Quit: leaving) |
22:48:12 | * | Jesin quit (Quit: Leaving) |
22:54:27 | * | libman joined #nim |
22:57:17 | * | Jesin joined #nim |
23:01:03 | * | daaf joined #nim |
23:10:07 | Trioxin | what would be awesome to have in Nim would be persistent, linked data collections |
23:15:43 | * | smt_ joined #nim |
23:17:08 | * | gokr quit (Ping timeout: 240 seconds) |
23:17:36 | * | nsf quit (Quit: WeeChat 1.7.1) |
23:19:16 | * | smt quit (Ping timeout: 255 seconds) |
23:19:17 | * | yglukhov quit (Remote host closed the connection) |
23:21:02 | * | couven92 quit (Quit: Client Disconnecting) |
23:33:38 | * | BennyElg_ joined #nim |
23:33:40 | * | BennyElg quit (Read error: Connection reset by peer) |
23:35:12 | Trioxin | would it be safe to monitor many directories with walkfiles? |
23:38:16 | Trioxin | gobs and gobs |