00:03:33 | * | noonien quit (Quit: Connection closed for inactivity) |
00:04:17 | * | endragor joined #nim |
00:06:09 | leru | Or, I could just look into the code without building something m( |
00:09:13 | * | endragor quit (Ping timeout: 268 seconds) |
00:10:40 | codevance1 | Xd |
00:15:49 | * | jrbrt quit (Quit: jrbrt) |
00:18:39 | * | CodeVance joined #nim |
00:19:38 | * | codevance1 quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
00:34:05 | leru | Do I get it right: there is no trim function for strings? |
00:34:56 | * | darithorn joined #nim |
00:36:47 | * | vivus quit (Quit: Leaving) |
00:36:57 | leorize | leru: you mean a function to strip trailing whitespace from string? |
00:37:34 | leorize | https://nim-lang.org/docs/strutils.html#strip,string,set[char] |
00:37:34 | leru | leorize, leading and trailing, yes |
00:38:02 | leorize | leru: see the link above |
00:38:22 | leru | I see, thank you, leorize |
00:40:08 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:46:17 | * | CodeVance2 joined #nim |
00:47:46 | * | CodeVance quit (Ping timeout: 264 seconds) |
00:53:43 | * | Snircle joined #nim |
00:59:21 | * | leru quit (Ping timeout: 256 seconds) |
01:04:03 | * | endragor joined #nim |
01:08:45 | * | endragor quit (Ping timeout: 264 seconds) |
01:28:18 | * | gangstacat quit (Quit: Ĝis!) |
01:28:34 | * | sz0 quit (Quit: Connection closed for inactivity) |
01:35:51 | shashlick | leru: see docs from older versions like => https://nim-lang.org/0.17.0/manual.html |
02:11:09 | * | brainpro1 quit (Ping timeout: 264 seconds) |
02:20:49 | * | dddddd quit (Remote host closed the connection) |
03:08:47 | * | smt` quit (Read error: Connection reset by peer) |
03:08:58 | * | smt` joined #nim |
03:27:04 | * | athenot joined #nim |
03:30:00 | * | endragor joined #nim |
03:30:22 | * | athenot_ joined #nim |
03:32:09 | * | athenot quit (Ping timeout: 265 seconds) |
04:12:44 | * | rockcavera quit (Remote host closed the connection) |
04:13:39 | * | rockcavera joined #nim |
04:17:17 | * | CodeVance2 quit (Read error: Connection reset by peer) |
04:19:17 | shashlick | why doesn't this work? `echo log2(100000.0)` ==> 16.60964047443681, but `log2(100000.0) == 16.60964047443681` ==> false |
04:28:50 | tersec | There seems to be a regression in the test suite -- in 0.18.0 released, tests/manyloc/argument_parser/ex_wget.nim builds fine, but in current git, it doesn't. |
04:31:48 | tersec | Presumably this could be straightforwardly bisected, but I've not done so. |
04:33:21 | * | Cthalupa quit (Ping timeout: 264 seconds) |
04:33:51 | tersec | (Or, maybe ex_wget.nim isn't valid Nim anymore.) |
04:37:33 | * | Cthalupa joined #nim |
04:37:47 | tersec | shashlick: in general, FP decimal representations aren't necessarily bit-exact in IEEE-754 terms. Do you have any particular reason to believe that invariant should hold? |
04:38:36 | FromGitter | <sherjilozair> Hi. I'm new to Nim. Any documentation on how to use finalizers? |
04:39:21 | * | athenot_ quit (Ping timeout: 240 seconds) |
04:39:45 | tersec | tests/errmsgs/tproper_stacktrace2.nim also seems to have an exit code of 0 (rather than the expected exit code of 1) now, at least on amd64 Linux with git head. |
04:42:52 | tersec | https://nim-lang.org/docs/manual.html#type-bound-operations-destructors ? |
04:45:58 | FromGitter | <sherjilozair> I thought destructors and finalizers are different. And that I should be using finalizers instead of destructors, since the latter is an experimental feature while former is not. |
04:46:55 | FromGitter | <sherjilozair> I want to wrap a C library with RAII semantics. So I want a way to be able to call the `destroy_` functions in C with guarantee. How can I do that? |
04:47:29 | tersec | Ah, right, I'm not sure. They are in some languages, but I don't know Nim that well either, so I won't claim to know whether there are supposed to be distinct. I just knew destructors existed and "Be aware that destructors are not called for objects allocated with new. This may change in future versions of language, but for now the finalizer parameter to new has to be used." in the docs. |
04:47:41 | tersec | Which conflates them. |
04:48:15 | FromGitter | <sherjilozair> Yeah, so I wanted docs of the new operator, and see an example of how it's used. |
04:48:27 | FromGitter | <sherjilozair> With the finalizer parameter, that is. |
04:49:30 | tersec | Right, so I don't know, and will defer to someone with actual knowledge to hopefully address this. |
04:53:32 | * | darithorn quit (Remote host closed the connection) |
05:03:38 | leorize | sherjilozair: they're currently experimental https://github.com/nim-lang/Nim/wiki/Destructors |
05:36:35 | * | xkapastel quit (Quit: Connection closed for inactivity) |
06:10:45 | * | sz0 joined #nim |
06:25:49 | * | Trustable joined #nim |
06:39:43 | * | miran joined #nim |
06:46:40 | * | r3d9u11 joined #nim |
06:53:44 | * | tiorock joined #nim |
06:53:44 | * | rockcavera quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
06:53:44 | * | tiorock is now known as rockcavera |
06:53:44 | * | rockcavera quit (Changing host) |
06:53:44 | * | rockcavera joined #nim |
06:54:30 | * | tiorock joined #nim |
06:58:09 | * | rockcavera quit (Ping timeout: 248 seconds) |
06:58:48 | * | tiorock quit (Remote host closed the connection) |
07:00:45 | * | Trustable quit (Remote host closed the connection) |
07:03:10 | shashlick | sherjilozair: there's try/finally and a defer statement |
07:03:55 | shashlick | Not sure if it helps but worth checking |
07:04:05 | shashlick | https://nim-lang.org/docs/manual.html#exception-handling-defer-statement |
07:06:00 | shashlick | Is it possible to read a file and take a string from that file and then call that as a proc in a macro? Basically name isn't known at compile time |
07:06:21 | * | rockcavera joined #nim |
07:07:16 | shashlick | tersec: I'm not sure, basically the value printed by Nim for the float value isn't exactly the value for == to work |
07:14:34 | FromGitter | <Varriount> shashlick: It should be. |
07:15:40 | * | yglukhov joined #nim |
07:20:09 | * | rockcavera quit (Remote host closed the connection) |
07:22:09 | * | miran quit (Ping timeout: 248 seconds) |
07:23:27 | * | yglukhov quit (Remote host closed the connection) |
07:23:58 | * | yglukhov joined #nim |
07:23:59 | Araq | shashlick: you can macros.parseStmt() |
07:24:49 | * | r3d9u11 quit (Remote host closed the connection) |
07:28:33 | * | yglukhov quit (Ping timeout: 248 seconds) |
07:30:34 | * | yglukhov joined #nim |
07:36:28 | * | rockcavera joined #nim |
07:42:21 | * | r3d9u11 joined #nim |
08:05:31 | * | yglukhov quit (Remote host closed the connection) |
08:06:07 | * | yglukhov joined #nim |
08:10:27 | * | yglukhov quit (Ping timeout: 240 seconds) |
08:18:21 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:01:59 | * | leru joined #nim |
09:15:04 | FromGitter | <Varriount> Araq, dom96: What is the "official" way to create a new project? |
09:15:19 | * | xet7 quit (Quit: Leaving) |
09:15:31 | FromGitter | <Varriount> Sorry, I mean, what is the "current" type of project configuration file standard? |
09:22:37 | * | SenasOzys quit (Remote host closed the connection) |
09:23:53 | * | SenasOzys joined #nim |
09:25:14 | * | yglukhov joined #nim |
09:27:18 | leru | I just tried the iterator example from https://nim-lang.org/docs/tut1.html#iterators |
09:27:31 | leru | Compiler says: Error: attempting to call undeclared routine: 'countup' |
09:27:50 | def- | leru: compiler version? works fine for me with current one |
09:28:09 | def- | countup is defined here: https://nim-lang.org/docs/system.html#countup.i,T,T,int |
09:28:15 | leru | def-, Nim Compiler Version 0.18.1 [Linux: amd64] |
09:29:08 | def- | built from git I assume? Try updating to most recent one |
09:29:18 | leru | it might be defined there, but i actually wanted to use the iterator myself |
09:29:29 | leru | oh, alright. i try |
09:33:43 | leru | def-, that didn't help |
09:33:52 | def- | so other programs compile fine? |
09:35:02 | leru | yes, everything was fine until i added the iterator example |
09:35:36 | def- | correct Nim binary in $PATH? |
09:35:59 | def- | I don't see what would be wrong with countup specifically |
09:37:16 | leru | not countup specifically. it's the iterator statement itself. i wrote my own iterator function, or whatever you call it, and it didn't work either |
09:37:29 | leru | the $PATH is alright |
09:39:21 | * | leorize quit (Ping timeout: 240 seconds) |
09:40:54 | FromGitter | <Varriount> leru: Could you post your file? |
09:41:31 | leru | it's pretty much this https://pastebin.com/uxtk0aAc |
09:42:10 | def- | well, it's an inline iterator |
09:42:13 | def- | can't use it that way |
09:42:29 | def- | I thought you were just trying to get the code from the tutorial working |
09:43:06 | leru | I thought, too |
09:44:22 | def- | Closure iterator seems to be what you want: https://nim-by-example.github.io/for_iterators/ |
09:44:35 | def- | inline iterators get transformed into loops |
09:45:25 | def- | https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators |
09:47:04 | * | yglukhov quit (Remote host closed the connection) |
09:48:10 | * | yglukhov joined #nim |
09:52:33 | * | yglukhov quit (Ping timeout: 255 seconds) |
09:52:52 | leru | I see. Thank you, def-! |
09:57:33 | * | codevance1 joined #nim |
10:01:57 | * | nsf joined #nim |
10:40:19 | federico3 | https://github.com/nim-lang/nim-zmq/pull/8 any zmq user around? |
10:44:57 | Araq | federico3: looks good to me, want me to merge it? |
10:45:32 | federico3 | if you don't mind, yes please |
10:45:55 | Araq | varriount: "nimble init"? register on appveyor/travis with a configuration inspired by Nim's |
10:46:15 | Araq | and ... yeah, that's a good start |
10:50:31 | federico3 | Varriount: if you want something fancier, https://github.com/FedericoCeratto/nim_project_maker |
10:54:17 | * | r3d9u11 quit (Remote host closed the connection) |
11:02:54 | * | dddddd joined #nim |
11:05:17 | codevance1 | Are most people awake now? Isnt everyone american? |
11:09:10 | * | leru_ joined #nim |
11:11:29 | * | leru quit (Ping timeout: 248 seconds) |
11:13:02 | FromDiscord | <claude> no |
11:13:08 | FromGitter | <GULPF> I think Nim has more users in europe |
11:14:18 | * | asdf__ joined #nim |
11:14:27 | leru_ | I don't know, but I'm not american |
11:22:14 | * | brainpro1 joined #nim |
11:22:26 | ehmry | I'm muriccan, but I'm in europe |
11:25:55 | * | asdf__ quit (Ping timeout: 260 seconds) |
11:28:14 | codevance1 | Ya ive realised that people are up at my daytime |
11:32:35 | leru_ | Does Nim have a short way to initialize arrays instead of looping through? |
11:35:33 | FromDiscord | <claude> theres sequtils.fill |
11:41:10 | leru_ | it's neither in the docs nor does my compiler know it |
11:41:43 | FromDiscord | <claude> oh i lied its algorithm.fill |
11:41:44 | leru_ | module algorithm has it |
11:41:48 | FromDiscord | <claude> theres sequtils.newSeqWith though |
11:42:31 | leru_ | There should be something similar for arrays |
11:47:32 | def- | previous discussion here: https://github.com/nim-lang/Nim/issues/2462 |
11:49:42 | FromGitter | <data-man> @dom96 @shashlick: "nim -v" like this? #7714 |
11:52:23 | leru_ | I mean, if there is a newArrWith, why is there no newArrWith? |
11:55:25 | leru_ | *if there is newSeqWith... |
12:11:59 | * | SenasOzys quit (Ping timeout: 256 seconds) |
12:17:15 | FromDiscord | <claude> template newArrayWith*(len: static[int], init: untyped): untyped = |
12:17:15 | FromDiscord | <claude> var result: array[len, type(init)] |
12:17:15 | FromDiscord | <claude> for i in 0 ..< len: |
12:17:16 | FromDiscord | <claude> result[i] = init |
12:17:16 | FromDiscord | <claude> result |
12:19:45 | * | PMunch joined #nim |
12:19:56 | def- | because there is sequtils, but not arrutils :D |
12:22:53 | * | SenasOzys joined #nim |
12:23:48 | * | SenasOzys quit (Remote host closed the connection) |
12:26:48 | * | flasheeprom joined #nim |
12:26:54 | FromGitter | <data-man> @mratsim: If you are interested, yet another image viewer for terminal (cross-platform): https://github.com/stolk/imcat |
12:27:50 | FromGitter | <data-man> Yes! :) |
12:29:45 | flasheeprom | Trying to install gtk3 package gintro , got the message => 'cannot open 'gir' |
12:30:09 | FromGitter | <data-man> @mratsim: I compiled it with new version of stb_image (bugs-fixed). |
12:35:00 | * | r3d9u11 joined #nim |
12:35:23 | * | flasheeprom quit () |
12:36:20 | dom96 | flasheeprom: Can you gist the full nimble output? |
12:38:36 | dom96 | claude: nice, but note that the name should be initArrayWith :) |
12:38:44 | dom96 | (Since arrays are not allocated on the heap) |
12:39:54 | * | leru_ quit (Remote host closed the connection) |
12:41:38 | * | SenasOzys joined #nim |
12:43:34 | * | nsf quit (Quit: WeeChat 2.0.1) |
12:49:11 | * | miran joined #nim |
13:02:21 | * | r3d9u11 quit (Remote host closed the connection) |
13:18:09 | * | sz0 joined #nim |
13:19:09 | * | xkapastel joined #nim |
13:33:21 | * | Lord_Nightmare quit (Ping timeout: 248 seconds) |
13:36:42 | * | Lord_Nightmare joined #nim |
13:37:09 | * | endragor quit (Remote host closed the connection) |
13:45:51 | * | endragor joined #nim |
13:50:21 | * | endragor quit (Ping timeout: 240 seconds) |
13:59:45 | * | endes[m] joined #nim |
14:04:52 | endes[m] | hi |
14:05:10 | FromGitter | <zacharycarter> hi |
14:06:12 | endes[m] | I have this problem: I have a generic that is passed to a C function as a pointer and this function call a nim proc with this pointer. How I can cast the pointer to the original generic type?? |
14:11:41 | codevance1 | This might be wrong but nim does have cast endes |
14:17:52 | endes[m] | Yes but it doesnt works with generics or idk how to use it with generics |
14:18:22 | Araq | mygeneric[typeHere] # instantiate it |
14:18:59 | Araq | you need to instantiate the generic so that it can be passed to the C function. |
14:21:08 | FromGitter | <data-man> Gitter's dark theme is cool! :) |
14:21:13 | endes[m] | The generic is actually intantiate, but the C function calls the nim proc with a pointer argument |
14:21:33 | endes[m] | And I need to cast the pointer to the generic type |
14:21:49 | Araq | C doesn't have generic types |
14:23:28 | endes[m] | The C function recive an adress of the generic |
14:24:04 | endes[m] | And It uses as a parameter for calling the nim proc |
14:24:34 | miran | hey Araq! when the new notNil behaviour for strings and seqs is fully implemented - can we expect v0.18.2? |
14:27:49 | FromGitter | <zacharycarter> dom96: did you by any chance have a moment to look at the PM I sent you via gitter? |
14:28:16 | dom96 | zacharycarter: if you send me a PM on gitter you need to let me know, I rarely check it |
14:29:02 | FromGitter | <zacharycarter> well - I sent it late last night (my time) so no worries |
14:29:14 | FromGitter | <zacharycarter> that's kind of why I was asking - because I figured that was the situation :) |
14:29:32 | FromGitter | <zacharycarter> but if you have a chance to read over it at some point - I'd love some feedback as to whether or not you think it's an idea worth exploring further |
14:30:35 | dom96 | zacharycarter: cool, thanks for the heads up, will read ASAP and reply |
14:30:37 | FromGitter | <data-man> Oh! @Araq I sent you the PM, too. :) |
14:30:43 | FromGitter | <zacharycarter> thank you kindly |
14:30:46 | Araq | miran: no. |
14:31:17 | Araq | it would be 0.19 |
14:31:43 | Araq | and I don't want an 0.19, that is not RC1 |
14:32:00 | miran | yeah, 0.19 makes sense as it is quite large change.... |
14:32:30 | miran | i would like to have this behaviour in the stable branch before i publish my beginners tutorial |
14:33:21 | codevance1 | Miran what about using option? |
14:33:25 | miran | will RC mean feature-freeze and focus on bugfixes? |
14:33:26 | * | gangstacat joined #nim |
14:33:37 | * | gangstacat quit (Remote host closed the connection) |
14:34:06 | * | gangstacat joined #nim |
14:34:13 | miran | codevance1: the thing is, i don't want to introduce beginners to "you need to do `result = @[]`, but only for some more time, then you will not have to do it anymore" |
14:34:39 | codevance1 | Miran, true |
14:36:43 | * | darithorn joined #nim |
14:37:36 | FromGitter | <xmonader> I understand nim prefers composition over inheritance, but i guess its ADTis bit weak to represent some structure or maybe i'm wrong |
14:37:58 | FromGitter | <xmonader> i've couple of ref objects (IntType, StrType, ListType) all inherit from BencodeType |
14:38:46 | Araq | yeah don't. the ADTs are good enough, usually it's wrapped in accessors anyway |
14:38:55 | Araq | we don't use inheritance for json either. |
14:38:56 | FromGitter | <xmonader> and ListType object has underlying seq[BencodeType] and I want to call .encode on all of them .. i guess i need some how to type assert it? |
14:39:10 | Araq | use an ADT. |
14:39:36 | FromGitter | <xmonader> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae487a72d0e228d7bc08215] |
14:40:00 | FromGitter | <xmonader> this is my code do you mind giving me a hand to get it the nim way? |
14:40:25 | FromGitter | <zacharycarter> hrm |
14:40:36 | FromGitter | <zacharycarter> I mean - like the Nim way while still embracing OOP |
14:40:39 | FromGitter | <zacharycarter> or do you want idiomatic Nim? |
14:41:06 | FromGitter | <xmonader> first if i want to use type assert do `case of el` and match against the subclasses? |
14:41:23 | FromGitter | <xmonader> 2nd if i want to use adt which are enums right? |
14:41:29 | Araq | told you to use a 'case object' |
14:41:44 | miran | btw Araq, wasn't there some bug discovered not even one week after 0.18.0, and you wanted to release 0.18.2 ASAP? (yeah, i'm rooting for version bump :)) |
14:42:43 | FromGitter | <zacharycarter> @xmonader - why don't you just use a generic here OR an object variant |
14:43:04 | FromGitter | <xmonader> @Araq is case object an enum ? |
14:43:11 | Araq | you cannot use a generic here. it's runtime polymorphic. |
14:43:36 | FromGitter | <zacharycarter> oh I see what you mean |
14:44:22 | FromGitter | <xmonader> https://nim-lang.org/docs/manual.html#types-object-variants is this what yu guys call a case object? |
14:44:46 | FromGitter | <zacharycarter> no |
14:44:54 | FromGitter | <zacharycarter> err I don't know what a case objec tis |
14:44:57 | FromGitter | <zacharycarter> object is |
14:45:07 | Araq | xmonader: yes. |
14:45:08 | FromGitter | <zacharycarter> but I guess if I were to imagine one it would be akin to it |
14:45:40 | Araq | miran: well too late. |
14:45:47 | FromGitter | <xmonader> I see thanks guys |
14:48:07 | miran | Araq: ok, can you then estimate how long until RC1? is it closer to a month, or 6 months? |
14:49:22 | Araq | I don't answer these questions anymore. |
14:49:39 | Araq | for 6 years it's now "almost there" |
14:50:37 | miran | well, then i'll bore you and dom96 some more about version bump while we wait for "almost there" to come :P :) |
14:51:24 | dom96 | I don't see why we should wait for an RC |
14:51:29 | dom96 | just release 0.19.0 |
14:53:00 | * | miran literally nods his head |
14:55:01 | codevance1 | V1 can come when its ready |
14:55:10 | codevance1 | Theres no need to rush it |
14:55:39 | FromGitter | <xmonader> ```code paste, see link``` ⏎ ⏎ i get cannot instanitate table "got bencodekind, type bencodeType" expected A,B ⏎ ? any ideas? [https://gitter.im/nim-lang/Nim?at=5ae48b6b62316e05050c90b9] |
14:56:00 | FromGitter | <data-man> @Araq: Merge, please https://github.com/nim-lang/c2nim/pull/129 |
14:56:46 | Araq | data-man: oh, thanks. when the tests are green. |
14:57:22 | dom96 | Ideally we should have regular releases |
14:58:01 | codevance1 | Dom define targets then when reached release. |
14:58:29 | dom96 | hrm? |
14:58:52 | miran | dom96: yeah, that would be nice, but i guess regular releases can also be the part of "post V1" plan :) |
14:59:38 | codevance1 | Dom, what would the next regular release need |
15:00:15 | miran | even if they are irregular - more frequent releases might be good for nim exposure (no, i don't mean new version every month) |
15:01:00 | codevance1 | I think regular just means regular. Mostly planned for. |
15:02:29 | * | darithorn quit (Remote host closed the connection) |
15:03:06 | dom96 | codevance1: It's not about what it would need. Regular means it would happen no matter what. |
15:03:35 | codevance1 | Isnt that bad |
15:04:02 | FromGitter | <zacharycarter> I mean that's basically CD |
15:04:06 | FromGitter | <aboisvert> @xmonader in `Table[btString, BencodeType]`, `btString` is not a type |
15:04:16 | codevance1 | What zachary said |
15:04:19 | FromGitter | <zacharycarter> which is a pretty widely adopted pattern in software dev these days |
15:04:29 | FromGitter | <aboisvert> (it's a value of type BencodeType) |
15:04:32 | FromGitter | <zacharycarter> CI/CD |
15:05:02 | FromGitter | <xmonader> @aboisvert but the only allowed types as keys for the table are the ones of string case |
15:05:12 | FromGitter | <xmonader> how can i describe that? |
15:06:09 | * | darithorn joined #nim |
15:07:33 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae48e34dad6fb186ff79af1] |
15:07:35 | FromGitter | <aboisvert> @xmonader I'm not sure that can be expressed using Nim today |
15:07:36 | FromGitter | <zacharycarter> something like that maybe? |
15:09:26 | FromGitter | <xmonader> @zacharycarter I need to try maybe this works |
15:09:37 | FromGitter | <aboisvert> I think there's two parts here: 1) how you want to index the table, and 2) do you want the table's values (of type `BencodeType`) to be statically known to be of the `btString` variant |
15:09:59 | FromGitter | <aboisvert> I'm not sure #2 is possible |
15:10:39 | FromGitter | <xmonader> :( |
15:12:00 | FromGitter | <xmonader> @mratsim no the bencode doesn't always have to to have strings, it can be just 1 int or list of ints |
15:12:36 | FromGitter | <xmonader> the existence of string `bencodedString` is needed for 1- string values, 2- bencode dict keys |
15:13:32 | FromGitter | <aboisvert> It would be nice to be able to express, e.g. something like `BencodeType of [kind: btString]` |
15:15:18 | Araq | Table[string, BencodeType] |
15:17:00 | FromGitter | <xmonader> @Araq but then i won't have used the btString type i defined right? |
15:17:17 | Araq | why would you. |
15:17:32 | Araq | btw JsonNode is already a thing in Nim. |
15:18:14 | Araq | I don't like bijections to JsonNode, JsonNode, it is a thing, use it. |
15:18:21 | FromGitter | <data-man> @Araq: Tests are green. :) |
15:20:33 | FromGitter | <xmonader> Ah I see, apparently haskell does it the same way ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Thank you [https://gitter.im/nim-lang/Nim?at=5ae4914162316e05050ca7b2] |
15:20:52 | * | smt_ joined #nim |
15:24:57 | * | smt` quit (Ping timeout: 264 seconds) |
15:27:06 | * | sz0 quit (Quit: Connection closed for inactivity) |
15:33:09 | * | rockcavera quit (Ping timeout: 256 seconds) |
15:38:17 | * | leru joined #nim |
15:42:58 | FromGitter | <xmonader> how can i forward declare a method? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ encode complains that encode_s isn't defined ? [https://gitter.im/nim-lang/Nim?at=5ae496822b9dfdbc3adbcfd3] |
15:43:39 | miran | put just a header of `encode_s` at the top |
15:43:51 | FromGitter | <xmonader> even the question itself smells, I think there should be a better way do |
15:44:07 | FromGitter | <xmonader> @mratsim header including `method` keyword or without ? |
15:44:38 | miran | https://nim-lang.org/docs/tut1.html#procedures-forward-declarations |
15:44:47 | * | codevance1 quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
15:45:39 | FromGitter | <xmonader> @mratsim i searched in the manual couldn't find the mixin maybe it's another term? |
15:47:03 | FromGitter | <xmonader> forward declaration works my compiler is happy now |
15:47:40 | FromGitter | <xmonader> macros in nim is bit too much i guess for my case .. too many concepts i need to settle on subset of nim :D |
15:48:05 | miran | @mratsim - your messages are not forwarded to IRC!?! |
15:48:19 | FromGitter | <xmonader> I see maybe the encoder object is an overkill |
15:48:49 | dom96 | huh, indeed. mratsim isn't being forwarded, that's odd. |
15:48:58 | dom96 | oprypin ^^ |
15:49:15 | miran | @mratsim - and also i haven't seen them in gitter until i refreshed the page :/ |
15:49:18 | oprypin | wat |
15:49:50 | narimiran[m] | test 1 2 |
15:50:19 | miran | ok, matrix/riot works, it is not that. other people on gitter are visible |
15:50:52 | FromGitter | <mratsim> what about now? |
15:50:57 | miran | now it works |
15:51:14 | FromGitter | <mratsim> okay, so I had a checkbox “use Gitter Next” that I deactivated |
15:51:35 | * | CodeVance joined #nim |
15:51:53 | miran | mistery solved :) |
15:52:00 | FromGitter | <mratsim> it’s strange because I certainly checked that like 3 weeks ago at least |
15:52:10 | FromGitter | <mratsim> the plot thickens actually :D |
15:52:11 | dom96 | huh, what is "Gitter Next"/ |
15:52:14 | dom96 | *? |
15:52:22 | FromGitter | <mratsim> I don’t know :P |
15:52:47 | oprypin | mratsim, gitter's api never pushed your message so i dunno |
15:53:15 | FromGitter | <mratsim> it happened a couple of times this week so I think they broke their Gitter next backend |
15:53:26 | oprypin | if you can reproduce this problem, maybe you should report it to them |
15:53:27 | FromGitter | <mratsim> it’s their devel branch |
15:53:54 | CodeVance | Does nim have a "with" statement (for automatically closing open files/connections) |
15:54:01 | FromGitter | <mratsim> My last interaction with Gitter was so, so. They basically dismissed my issue until I put their nose into it. |
15:54:03 | CodeVance | like in python |
15:54:23 | FromGitter | <mratsim> @CodeVance there is a thread in the forum with several solution |
15:54:34 | CodeVance | mratsim thanks :) |
15:54:40 | FromGitter | <mratsim> also check the “lock/guard” section of the manual |
15:54:59 | FromGitter | <mratsim> a template with body, and release works pretty good |
15:55:02 | miran | CodeVance: https://nim-lang.org/docs/tut2.html#templates see the example above 'macros' |
15:57:04 | CodeVance | miran, can I help with the beginner tutorial writting? |
15:57:32 | leru | What is the current way to set up a http server? Module httpserver "will soon be deprecated in favour of the asyncdispatch", but asyncdispatch needs module sockets and sockets is deprecated... |
15:57:39 | miran | CodeVance: you can help with "beta-testing", once it is in beta stage :) (soon TM) |
15:58:08 | miran | after beta-testing, there will be probably more things to write, add, improve, etc. |
15:58:54 | miran | the best help currently would be to convince our BDFL to release new stable version soonish :) |
15:58:58 | CodeVance | miran, I'm asking cause I wanted to do something similar, but you're already working on it. I'm not as experienced so I'm going to let you go first. and do some other things |
15:59:51 | CodeVance | Ya. maybe just move past that issue. write the tutorial then show him the parts that need stable |
16:00:01 | FromGitter | <mratsim> Does someone know how to solve this macro issue? https://gist.github.com/mratsim/df6d09745d18c391e73ada98525aaf1e. I’m extracting a subtype T from a Context[T] argument to build a Foo[T] but Nim “Cannot Instantiate, got <seq[int]> but expected <int>” I suppose I have to change something in getTypeInst |
16:01:02 | miran | CodeVance: my tutorial is 'almost finished' (or maybe it's better to say: almost ready for beta-testing), so it is better if we don't duplicate our work |
16:01:34 | CodeVance | mratsim, one is seq[int] the other Context[ |
16:01:35 | CodeVance | seq[int]] |
16:02:13 | miran | few days ago we discussed here that what is (also) missing are "do X with nim" kinds of tutorial. maybe you can do something like that if you have experience in some interesting field? |
16:02:33 | CodeVance | Game dev! |
16:02:33 | FromGitter | <mratsim> It’s not that, there is a subtype macro to extract the subtype of Context\[seq\[int\]\] |
16:02:45 | miran | CodeVance: do it!! |
16:02:51 | CodeVance | But I'm still struggeling with gamedev |
16:03:14 | FromGitter | <zacharycarter> well |
16:03:17 | FromGitter | <zacharycarter> I have thoughts on that one |
16:03:19 | FromGitter | <mratsim> do a pong in Nim :P |
16:03:36 | FromGitter | <zacharycarter> probably too many thoughts on it :P |
16:04:05 | CodeVance | mratsim I need to run your code. its obvious either the extraction or the genModel part you didn't implement the same as in genModelFromCtx |
16:04:32 | CodeVance | zachary. Pong is easy luckilu |
16:05:09 | FromGitter | <mratsim> As long as it’s not “Yet another Fibonacci” example |
16:05:13 | FromGitter | <zacharycarter> I think it's been well established that Nim can work really well for 2d games - and can even be used to build libraries or frameworks with the help of libs like SDL2 / GLFW3 and OpenGL etc |
16:05:25 | CodeVance | I think i'd start with pure sdl/sdl2 first then do something else in nimgame2 (since nimgame2 is the most developed i think) |
16:05:29 | FromGitter | <zacharycarter> and if you want to do that - there is a lot of code floating around out there right now showing you different ways to do that |
16:05:29 | FromGitter | <mratsim> “well established” with who? ;) |
16:05:39 | FromGitter | <zacharycarter> well with our own community |
16:05:54 | * | leorize joined #nim |
16:06:02 | FromGitter | <mratsim> a newcomer wouldn’t know though |
16:06:07 | FromGitter | <zacharycarter> so yeah - a tutorial for the public would be great - and I think there is one out there on def-'s old blog |
16:06:14 | CodeVance | I've done pong before Its pretty easy |
16:06:21 | FromGitter | <zacharycarter> but his blog isn't very active so it probably isn't attracting many newcomers |
16:06:21 | * | SenasOzys quit (Ping timeout: 240 seconds) |
16:06:24 | miran | CodeVance: pong is easy *for you* (or anyone with gamedev experience). for me, the logic is easy, but i have no idea how to make graphical part - i would love to have a tutorial on that! |
16:06:46 | CodeVance | miran sometimes you speak latin as well |
16:06:59 | leru | miran, ever tried SDL? |
16:07:02 | FromGitter | <mratsim> Expelliarmus |
16:07:04 | CodeVance | accronyms and field specific words |
16:07:42 | miran | leru: i have zero experience in graphical things. and 0.00001 experience in web-dev (i know there is html and css, that's about it) |
16:08:00 | miran | e.g.? :D :D :D |
16:08:09 | CodeVance | mratsim redefinition of 'ctxSubtype' |
16:08:12 | miran | (i really enjoy meta :) ) |
16:08:32 | CodeVance | mratsim cannot instantiate Conv2DLayer |
16:08:33 | CodeVance | got: <seq[int]> |
16:08:33 | CodeVance | but expected: <T> |
16:09:02 | FromGitter | <mratsim> yes, so basically the type I extracted is not a real type |
16:09:27 | FromGitter | <mratsim> I think I have to transform the NimSym seq and NimSym int into NimIdent, I’m testing that |
16:10:10 | FromGitter | <mratsim> type + macros are a real pain >_> |
16:12:14 | leru | I think a great thing would be Love2d or LÖVE or whatever it is called now to be ported to Nim. It's a great Library for game development |
16:12:23 | shashlick | data-man: I see the logic behind #7714 |
16:12:44 | FromGitter | <zacharycarter> meh |
16:12:52 | FromGitter | <zacharycarter> I think Nim has enough 2d libs |
16:13:02 | FromGitter | <zacharycarter> if people want to help improve / maintain / take over their development |
16:13:07 | * | nsf joined #nim |
16:13:31 | FromGitter | <zacharycarter> I think Nim needs a banging 3d engine - but that's going to take researching and prototyping how to develop certain subsystems and integration patterns I think |
16:13:31 | shashlick | so macros.parseStmt() is the only way to convert a string into a proc? |
16:13:44 | FromGitter | <zacharycarter> and is going to require ditching SDL2 / GLFW3 |
16:13:55 | CodeVance | leru maybe :) at least some of the frontend |
16:14:02 | FromGitter | <zacharycarter> and either require a multi platform input handling / window lib or using like just that code from CSFML |
16:14:10 | FromGitter | <zacharycarter> and not relying on the threading code |
16:14:14 | CodeVance | leru. I don't really see lua2nim anywhere |
16:14:20 | FromGitter | <zacharycarter> even that is suboptimal because tmk CSFML uses STL allocators / collections |
16:14:24 | shashlick | data-man: good to see PRs into c2nim |
16:16:28 | miran | CodeVance: someone mentioned 'NiGui' on reddit as awesome GUI library. if you can do pong tutorial in NiGui (or some other popular nim graphical library), and after that maybe tetris - i would be very interested in that (and i'm sure i wouldn't be the only one) |
16:16:30 | FromGitter | <mratsim> @CodeVance, solved my issue: I indeed had to replace the NimSym by NimIdent: https://gist.github.com/mratsim/df6d09745d18c391e73ada98525aaf1e#file-solution-nim |
16:17:16 | CodeVance | miran nigui mighy be able to do it. plus its light. I'll check |
16:17:23 | FromGitter | <zacharycarter> I have a tetris example in zengine |
16:17:25 | FromGitter | <zacharycarter> :/ |
16:17:37 | FromGitter | <zacharycarter> krux has one in opengl sandbox |
16:17:40 | CodeVance | zachary :) |
16:17:45 | miran | even folks who are very experienced in that field and are working with other languages might be interested to see how to do the same things in nim (much more simply :)) |
16:18:44 | CodeVance | Ya the thing about nigui is that for every feature he includes he adds a demo XD |
16:18:58 | FromGitter | <zacharycarter> nigui isn't a game library though |
16:19:01 | FromGitter | <zacharycarter> it's a gui library |
16:19:04 | CodeVance | So its easy to check it out for how things are done |
16:19:07 | Araq | shashlick: yes |
16:19:13 | CodeVance | nigui, for pong its the same |
16:19:22 | CodeVance | if you don't actually use graphics |
16:19:46 | FromGitter | <zacharycarter> meh - I don't know - I don't get it but maybe you guys are thinking of a use case I'm not |
16:19:54 | CodeVance | Or you could just do a boring gui tut XD |
16:19:57 | FromGitter | <zacharycarter> I've just never used a gui framework to render graphics for a game |
16:21:00 | CodeVance | ok lets examine. I think we should do sdl in nim first. Since that includes the mainloop and all that already |
16:21:14 | CodeVance | that's hidden away with a gui lib |
16:21:41 | FromGitter | <zacharycarter> sdl2 does a LOT |
16:22:25 | * | yglukhov joined #nim |
16:23:45 | FromGitter | <zacharycarter> https://hookrace.net/blog/writing-a-2d-platform-game-in-nim-with-sdl2/ |
16:23:51 | FromGitter | <zacharycarter> exists as well |
16:24:17 | leru | I used SDL with C and C++, but I quit it when I found out about love2d. Way easier to get things done. It does SDL and audio and networking and what not |
16:24:20 | FromGitter | <zacharycarter> could be easily adapted to pong or whatever kind of tut you'd like |
16:24:41 | FromGitter | <zacharycarter> yes - but we have projects in the community that are akin to love2d already |
16:24:45 | FromGitter | <zacharycarter> we really don't need a port of another one |
16:24:54 | FromGitter | <zacharycarter> no matter how fantastic love2d is |
16:25:00 | CodeVance | zachary sdl2 does the usual doesn't it? |
16:25:10 | FromGitter | <zacharycarter> I don't know what the usual is :P |
16:25:22 | CodeVance | I don't actually care about platform stuff. I just want my input true/false |
16:25:26 | FromGitter | <zacharycarter> I also don't know what "doing sdl is" |
16:26:00 | FromGitter | <zacharycarter> I mean if you want a game engine and just to write gameplay code with Nim |
16:26:02 | FromGitter | <zacharycarter> I'd go use godot |
16:26:04 | FromGitter | <zacharycarter> that option is already there |
16:26:05 | CodeVance | love2d is just another 'flavour' If it actually has some strengths then its fine. But I'd have to rexamine it |
16:26:21 | FromGitter | <zacharycarter> as much as I don't love godot or even like it really - if your goal is just to write gameplay code with nim on top of an engine |
16:26:23 | FromGitter | <zacharycarter> you can already do that |
16:26:46 | * | yglukhov quit (Ping timeout: 264 seconds) |
16:26:47 | CodeVance | I wouldn't make pong in godot XD |
16:26:52 | miran | re: "nigui isn't a game library" - now you see how little to i know abot all that stuff ;) |
16:27:06 | FromGitter | <zacharycarter> why wouldn't you make pong in godot? |
16:27:06 | miran | *do |
16:27:12 | FromGitter | <zacharycarter> I think the godot docs even contain a pong tutorial |
16:27:25 | CodeVance | I think nigui has already got a calculator example and a bunch of demos |
16:27:32 | FromGitter | <zacharycarter> again... |
16:27:35 | FromGitter | <zacharycarter> nigui is not a game framework |
16:27:37 | * | leru quit (Remote host closed the connection) |
16:27:37 | CodeVance | and nimgame has two games and a bunch of demos |
16:27:40 | FromGitter | <zacharycarter> it's a cross platform gui framework |
16:27:45 | FromGitter | <zacharycarter> nimgame and nigui are not comparable |
16:27:56 | FromGitter | <zacharycarter> they don't even fall into the same problem domain |
16:28:01 | CodeVance | minsweeper is a gui game :P |
16:28:33 | shashlick | Thanks araq |
16:28:59 | FromGitter | <zacharycarter> if you just want to write a game and you don't care about using a renderer |
16:29:02 | FromGitter | <zacharycarter> then just go write a roguelike IMO |
16:29:05 | FromGitter | <zacharycarter> and use curses |
16:29:27 | FromGitter | <zacharycarter> I mean - if you really want to do something out there and build a game with a gui framework |
16:29:28 | FromGitter | <zacharycarter> more power to you |
16:29:36 | FromGitter | <zacharycarter> but I think you'll struggle mor ethan you're realizing |
16:29:36 | CodeVance | I'd actually like to do that but your better with procedural than I cam |
16:29:39 | FromGitter | <zacharycarter> trying to build a game with nigui |
16:30:00 | FromGitter | <zacharycarter> I think if you want to build games with Nim - check out what's already out there |
16:30:04 | FromGitter | <zacharycarter> ask the authors who are still around questions |
16:30:13 | FromGitter | <zacharycarter> because many of us have already done exactly what you guys are describing |
16:30:20 | FromGitter | <zacharycarter> with Nim |
16:30:50 | FromGitter | <zacharycarter> except for the building a pong game with NiGUI |
16:30:54 | FromGitter | <zacharycarter> I don't think anyone has tried that yet |
16:30:56 | FromGitter | <zacharycarter> :P |
16:31:03 | FromGitter | <data-man> @shashlick: Which the logic? Thousands of projects don't use this way. It's not accidental, do not you think so? |
16:31:19 | CodeVance | zachary, I want to describe how a game works. which isn't something I can do with nimgame2. But I should contact them anyway |
16:31:53 | miran | if lots of stuff is already done/written/explained *somewhere*, can we at least have one place where all that will be linked to make it more visible to the rest of the world? |
16:32:31 | FromGitter | <zacharycarter> https://github.com/VPashkov/awesome-nim |
16:32:32 | miran | you want X? look here, there and there. you want to do Y with Z? explained here |
16:32:37 | FromGitter | <zacharycarter> miran: all of that takes effort |
16:32:52 | FromGitter | <zacharycarter> some of our projects (mine for instance) aren't even well documented |
16:33:30 | FromGitter | <zacharycarter> I think people in the community are happy to do some level of hand holding and guidance |
16:33:43 | FromGitter | <zacharycarter> and even spend time writing and maintaining and documenting nim libs |
16:34:04 | FromGitter | <zacharycarter> but A) there has to be a cut off point for explaining how to do something to someone - that's what books and tutorials are for at the end of the day |
16:34:25 | CodeVance | miran I think I understand what you mean. you want likes to resources. not pkgs |
16:34:33 | FromGitter | <zacharycarter> and B) without a lot of users or contributors - those goals are often difficult to achieve or not realistic or practical |
16:36:39 | FromGitter | <zacharycarter> game dev isn't simple |
16:36:44 | shashlick | data-man: well, so it would be one nim file recompiled and a relink so I agree the cost to put in a unique date won't be too expensive |
16:37:13 | FromGitter | <zacharycarter> to treat it as such is naive - and it isn't difficult because game logic is hard to program - it's difficult because real time simulations are very difficult to run in the first place |
16:37:34 | FromGitter | <zacharycarter> and depending on what your goals are and what you want to achieve - the approach you take with your project will vary greatly |
16:37:57 | FromGitter | <zacharycarter> like - if you don't want to use the built in SDL2 renderer - then you're going to be writing OpenGL code or using GLFW3 or something |
16:38:24 | FromGitter | <zacharycarter> or maybe the SDL2 thread handling code causes issues for you with Nim's memory model and how you'd like to write your engine / game |
16:39:18 | FromGitter | <zacharycarter> like - if all you want to do is write gameplay code - then you need an already built engine or framework - and we have those already at our disposal - maybe they need some work or maintenance / love - but if no one is using them either - and you just port a new one over - I imagine it will eventually end up in the same state |
16:40:07 | FromGitter | <mratsim> I think that boils down to: find someone who likes Nim and likes to write, so that he can show some examples. |
16:40:24 | FromGitter | <zacharycarter> sure |
16:40:38 | CodeVance | I want to help |
16:40:45 | CodeVance | But I don't know where to start |
16:40:47 | FromGitter | <zacharycarter> well - figure out what you want to do first exactly |
16:40:59 | FromGitter | <zacharycarter> you said you don't want to work on any platform stuff - you just want to write game logic |
16:41:02 | shashlick | so macro question -> how do you pass a string to a macro when the string is loaded from a file? so basically it is in a variable? static[string] doesn't work since it isn't known at compile time and other methods simply send the variable name rather than the contents |
16:41:12 | CodeVance | https://github.com/CodeVance/nim-links/blob/master/README.md mratsim. Add some links |
16:41:30 | FromGitter | <mratsim> @shashlick, if it was staticRed it might work |
16:41:32 | CodeVance | or maybe this should be on the nim-wiki |
16:41:33 | FromGitter | <mratsim> read* |
16:41:54 | FromGitter | <zacharycarter> if that's the case - you need to do one of two things: eliminate the platform requirements - IE don't use a graphical renderer, etc... or you find a library / framework / engine that handles that stuff for you |
16:42:33 | FromGitter | <mratsim> @CodeVance, I think this is a nice small project for emulation, the code is quite short: https://github.com/mratsim/chirp8, and obviously def- nimes: https://github.com/def-/nimes |
16:42:36 | FromGitter | <zacharycarter> which one you use - will take some understanding of your goals / requirements and the features of the target you're looking at |
16:42:41 | miran | to get back to the start, we need "do X with nim" tutorials |
16:42:49 | FromGitter | <mratsim> +1 |
16:43:00 | FromGitter | <zacharycarter> well someone needs to write them that has the time and desire and energy |
16:43:21 | FromGitter | <mratsim> I will definitely do some “Do neural networks with Nim”, maybe even “Do an unbeatable pong AI in Nim” :D |
16:43:35 | shashlick | mratsim: so the value has to be read within the macro - I cannot pass it to another? |
16:43:42 | CodeVance | mratsim. I think I'll try each project and write my thoughts on them :) |
16:43:43 | FromGitter | <zacharycarter> once I make a lib / framework / engine I don't want to re-write by the time i'm done with it - I'll write blog posts on how to use it |
16:43:57 | FromGitter | <zacharycarter> but that hasn't happened yet |
16:44:15 | FromGitter | <zacharycarter> although I could certainly write some guides on building roguelikes with Nim |
16:44:18 | FromGitter | <mratsim> @shashlick, to pass from macros to macros you have to use getAST. |
16:44:24 | miran | zachary: CodeVance seems like a man with time and energy |
16:44:36 | FromGitter | <zacharycarter> he does certainly :D |
16:44:41 | CodeVance | only time nothing else |
16:44:48 | CodeVance | not even much time either XD |
16:45:01 | FromGitter | <zacharycarter> time should really be the universal currrency |
16:45:02 | miran | i'm writing general tutorial for beginners |
16:45:03 | FromGitter | <zacharycarter> I guess it already is |
16:45:07 | FromGitter | <zacharycarter> but uh anyways |
16:45:38 | FromGitter | <zacharycarter> playground is first on my todolist - then helping with the AWS sdk - then I'll hopefully get back to some nim / game stuff |
16:45:42 | miran | i could do "do basic linear algebra with nim" but that's not as interesing as X = {gamedev, graphical stuff, NN, etc.} |
16:46:00 | FromGitter | <xmonader> What's parallel fields iterator? |
16:46:21 | * | darithorn quit (Remote host closed the connection) |
16:46:30 | FromGitter | <xmonader> I get parallel fields iterator doesnt work for case objects when setting a value in a map ⏎ ⏎ ``` d[curKey] = obj``` [https://gitter.im/nim-lang/Nim?at=5ae4a565109bb043320f2d95] |
16:46:58 | CodeVance | miran graphical stuff is sometimes boring. Cause its math times 3 |
16:47:01 | FromGitter | <mratsim> https://forum.nim-lang.org/t/2774 |
16:47:24 | * | darithorn joined #nim |
16:47:25 | * | gangstacat quit (Quit: Ĝis!) |
16:47:34 | FromGitter | <mratsim> @xmonader but I don’t know what parallel field iterator are, it sounds like a hyperspace engine from whatever Sci-Fi novel. |
16:48:09 | Araq | it means you need to define your own == |
16:49:04 | FromGitter | <mratsim> inb4 “PR welcome" |
16:49:08 | FromGitter | <zacharycarter> 3d graphics is really just a bunch of linear algebra |
16:49:12 | FromGitter | <zacharycarter> you need to understand matricies |
16:49:33 | FromGitter | <zacharycarter> and it gets more advanced when you get into shaders and lighting models |
16:50:07 | FromGitter | <zacharycarter> but it doesn't require an innate knowledge of the math involved |
16:50:09 | FromGitter | <zacharycarter> it just helps |
16:50:16 | * | SenasOzys joined #nim |
16:50:27 | FromGitter | <xmonader> @Araq sorry but shouldn't case classes be unequal by default? |
16:50:30 | FromGitter | <mratsim> The linear algebra libraries are quite different though, in gamedev it seems like you often work with {x, y, z} coordinate tuple, but not in science |
16:50:40 | FromGitter | <zacharycarter> very true |
16:51:29 | FromGitter | <zacharycarter> you're primarily working with 2d / 3d vectors, matrices, and quaternions |
16:51:47 | FromGitter | <zacharycarter> because you're mostly just defining points in 3d space |
16:51:59 | FromGitter | <zacharycarter> and then performing linear algebra operations on them |
16:52:52 | FromGitter | <zacharycarter> well not linear algebra operations - but operations |
16:53:13 | CodeVance | miran, those are emulators. They aren't nim coded games are they? |
16:53:54 | * | yglukhov joined #nim |
16:54:31 | FromGitter | <mratsim> @CodeVance, what I sent are emulators indeed |
16:54:42 | FromGitter | <mratsim> I think the best games to showcase are the one from Ludum Dare |
16:54:56 | FromGitter | <mratsim> @dom96 ^ |
16:55:36 | FromGitter | <mratsim> there are other gameJam with people using Nim but I don’t have the links |
16:56:09 | FromGitter | <zacharycarter> CodeVance: I'd go check out - https://github.com/zacharycarter/zengine/tree/a9e30eb771553cb572af5df8c7ca89f6661e5e50 - which is a commit from before the wasm branch got merged into zengine - the code was much easier to read at this point because I hadn't introduced the whenDefined plague into my codebase yet. There's a tetris example and some other trivial stuff in there. |
16:56:27 | FromGitter | <zacharycarter> I'm not recommending you use zengine |
16:56:35 | FromGitter | <zacharycarter> but I tried to make / keep the code very clean and simple and readable |
16:57:01 | CodeVance | zachary I understand what you mean |
16:58:21 | CodeVance | zachary are you going to remove the ifDefined? perhaps the stable one should be stable ? |
16:58:36 | CodeVance | or tag that specific commit |
17:00:01 | * | nsf quit (Quit: WeeChat 2.0.1) |
17:00:21 | FromGitter | <zacharycarter> zengine is dead at this point - I don't plan on making any more changes to that repo - I'll most likely end up archiving it once I have the next iteration of my engine design in flight |
17:00:34 | * | noonien joined #nim |
17:00:36 | FromGitter | <zacharycarter> which is going to focus primarily on 3d first and editor support |
17:02:42 | FromGitter | <zacharycarter> I don't have professional experience or really any experience doing what I do when I start out on one of these projects |
17:03:10 | FromGitter | <zacharycarter> I might know how to do certain things - but it's never the case where I've built the same thing or even relatively the same thing before |
17:03:23 | FromGitter | <zacharycarter> so it's always a learning experience and often leads to suboptimal solutions - but it gives me a place to start from next time around |
17:03:39 | CodeVance | is frag wip? |
17:03:56 | FromGitter | <zacharycarter> frag was zengine's predecessor |
17:03:58 | * | Lord_Nightmare2 joined #nim |
17:04:01 | FromGitter | <zacharycarter> so no - it too is dead |
17:04:24 | CodeVance | what ? o_o |
17:04:28 | FromGitter | <xmonader> okay defining equality needed to define hash ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and how do i hash a table? [https://gitter.im/nim-lang/Nim?at=5ae4a99cb01085166ccf19f9] |
17:04:32 | CodeVance | oh I got confused then |
17:04:43 | FromGitter | <data-man> @zacharycarter: You very modest person! :) |
17:05:05 | * | Lord_Nightmare quit (Ping timeout: 248 seconds) |
17:05:07 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
17:05:21 | FromGitter | <zacharycarter> :p |
17:06:25 | FromGitter | <data-man> Have you tried the NixOS? |
17:06:41 | FromGitter | <zacharycarter> not yet - I need to |
17:08:48 | FromGitter | <data-man> While I experimented with it, have saved up many useful links. If you need it, please contact me. :) |
17:09:27 | FromGitter | <zacharycarter> oooo thank you! I certainly will! |
17:11:13 | FromGitter | <data-man> Nix 2.0 finally can cache the list of packages. It pleases. |
17:16:41 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
17:16:57 | ehmry | does nixpkgs have nimble packages now? |
17:18:28 | FromGitter | <data-man> Nim only https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/nim/default.nix ⏎ And old version :( |
17:19:09 | * | Trustable joined #nim |
17:19:12 | FromGitter | <Varriount> @zacharycarter I've made some progress on the XML serialization stuff, mostly with the macro portion. |
17:19:27 | FromGitter | <Varriount> I don't think I'll be able to make much progress this week - I have to study for finals. |
17:19:53 | FromGitter | <zacharycarter> well - you did better than me ;) I'll try to get some things done this weekend / week once I finish fixing the playground situation |
17:19:59 | FromGitter | <zacharycarter> also - good luck on your finals! :D |
17:26:01 | * | gangstacat joined #nim |
17:30:49 | * | gangstacat quit (Client Quit) |
17:31:46 | dom96 | data-man: s/0.17.2/0.18.0/ :) |
17:36:59 | FromGitter | <data-man> @dom96: I've returned to the Arch Linux. The NixOS does not suit me. :) |
17:37:16 | dom96 | oh? How come? |
17:37:56 | * | xet7 joined #nim |
17:39:27 | FromGitter | <zacharycarter> I'm going to update the kernel on the digital ocean server the playground is running on |
17:39:32 | FromGitter | <zacharycarter> I think they have specific docker enabled kernels |
17:39:42 | FromGitter | <zacharycarter> which I hope will solve the problems I'm encountering in getting the daemon to start |
17:41:41 | FromGitter | <data-man> @dom96: No mirrors for packages, very slow update (for me). |
17:45:09 | * | dddddd quit (Remote host closed the connection) |
17:53:03 | * | yglukhov quit (Remote host closed the connection) |
17:59:25 | FromGitter | <xmonader> How to show echo messages from my library in nimble tests? |
18:02:43 | * | yglukhov joined #nim |
18:03:05 | * | yglukhov quit (Read error: Connection reset by peer) |
18:03:16 | * | yglukhov joined #nim |
18:04:10 | FromGitter | <xmonader> @dom96 I used --verbose and --debug flags and still nothing |
18:04:22 | * | yglukhov quit (Read error: Connection reset by peer) |
18:04:59 | * | yglukhov joined #nim |
18:05:20 | dom96 | xmonader: what do you mean by `nimble tests`? |
18:05:28 | dom96 | Do you mean running `nimble test`? |
18:05:33 | dom96 | do you have a custom `test` task? |
18:06:12 | FromGitter | <xmonader> no my basic test1.nim is just like that ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ae4b814270d7d3708174ec1] |
18:06:31 | FromGitter | <xmonader> and i run it with `nimble test` yes |
18:14:00 | dom96 | IIRC there is a bug with the default 'test' task |
18:14:08 | dom96 | Your test1.nim might not be getting executed at all |
18:17:38 | * | NimBot joined #nim |
18:21:18 | dom96 | Try creating something like this: https://github.com/nim-lang/nimble/blob/master/nimble.nimble#L32 |
18:21:25 | * | yglukhov quit (Read error: Connection reset by peer) |
18:22:03 | * | yglukhov joined #nim |
18:37:55 | * | salewski joined #nim |
18:38:29 | salewski | 12:29:45 flasheeprom Trying to install gtk3 package gintro , got the message => 'cannot open 'gir' |
18:39:33 | salewski | Well, I guess you found out yourself -- you may have to install gobject-introspection, for your OS whatever it may be. |
18:39:37 | * | salewski quit (Client Quit) |
18:40:31 | * | rockcavera joined #nim |
18:48:25 | * | xet7 quit (Read error: Connection timed out) |
18:49:07 | * | xet7 joined #nim |
18:51:19 | dom96 | salewski: why is this necessary? |
18:52:11 | dom96 | my god, why does installing gintro spam my terminal? |
18:53:05 | dom96 | and it ended up crashing with a SIGSEGV :/ |
18:53:53 | FromGitter | <zacharycarter> !eval echo "Hello World!" |
18:53:56 | NimBot | Hello World! |
18:54:22 | FromGitter | <zacharycarter> ugh - that took a lot longer to fix than I had hoped it would |
18:54:59 | FromGitter | <zacharycarter> once I stopped focusing on re-writing and focused on fixing instead like you suggested dom |
18:55:14 | FromGitter | <zacharycarter> anywho - now I can work on revamping this sucker |
18:55:34 | CodeVance | Wow |
18:55:40 | CodeVance | !echo 1+1 |
18:55:45 | * | salewski joined #nim |
18:55:54 | FromGitter | <zacharycarter> no you need to do !eval first |
18:55:56 | CodeVance | !eval echo 1+1 |
18:55:58 | NimBot | 2 |
18:56:07 | CodeVance | :3 |
18:56:11 | FromGitter | <zacharycarter> dom created the NimBot |
18:56:18 | salewski | dom, well gintro depends on GTK3 of course. |
18:56:20 | FromGitter | <zacharycarter> I created - https://play.nim-lang.org/ |
18:56:23 | FromGitter | <zacharycarter> which powers the nimbot |
18:56:33 | CodeVance | I think its ought to be on #nim-nologs though XD |
18:56:59 | CodeVance | is playground working now you say? |
18:57:08 | salewski | Maybe that guy has not installed gobject-introspection package for his OS -- how should I know that. |
18:57:08 | FromGitter | <zacharycarter> yes |
18:57:11 | FromGitter | <zacharycarter> well not gists |
18:57:17 | FromGitter | <zacharycarter> because github deprecated anon gists |
18:57:25 | FromGitter | <zacharycarter> but I'm going to overhaul this project |
18:57:34 | FromGitter | <zacharycarter> so I probably wont' provide a fix for that before the overhaul |
18:57:40 | FromGitter | <zacharycarter> I think the overhaul will be more beneficial |
18:57:43 | CodeVance | I can always manual gist |
18:58:00 | CodeVance | is the forum playground working now? |
18:58:08 | CodeVance | BTW how does it work? |
18:58:24 | CodeVance | is it like in-browser or on-server evaluation? |
18:59:19 | FromGitter | <zacharycarter> I imagine the forum one is - because I think it uses the I linked |
18:59:37 | FromGitter | <zacharycarter> no the code is evaluated inside a docker container on the server |
18:59:46 | dom96 | salewski: "could not open" sounds like the Nim compiler cannot find a module |
18:59:53 | dom96 | It's got nothing to do with DLL deps |
19:00:26 | dom96 | zacharycarter: so what was the issue? |
19:00:59 | FromGitter | <zacharycarter> well - I think I updated some packages on the server - and I think one of the packages that got updated was the docker-engine package that I had installed |
19:01:24 | salewski | dom96, yes I am not really sure. Of course there should be no SIGSEGV -- I may have to test with latest compiler. |
19:01:36 | dom96 | salewski: it also shouldn't spam my terminal |
19:01:38 | FromGitter | <zacharycarter> I think the next time the docker daemon was restarted - it failed to come up because the version of docker-engine that had been upgraded to, wasn't supported by the OS kernel |
19:01:46 | FromGitter | <data-man> !eval import sqlite3; echo libversion |
19:01:48 | NimBot | Compile failed: in.nim(1, 22) Error: type mismatch: got <proc (): cstring{.cdecl.}> |
19:02:02 | FromGitter | <zacharycarter> so my initial solution when I first encountered the problem - was to uninstall docker and reinstall it |
19:02:12 | FromGitter | <zacharycarter> but that just made the problem worse - because now I had an even more up to date version of docker installed |
19:02:13 | FromGitter | <data-man> !eval import sqlite3; echo $libversion |
19:02:14 | NimBot | Compile failed: in.nim(1, 22) Error: type mismatch: got <proc (): cstring{.cdecl.}> |
19:02:18 | dom96 | zacharycarter: ahh, you probably have to restart the droplet to get it to run under a new kernel version |
19:02:37 | salewski | dom96, gintro is doing heavy work -- that is reflected in much output. Fine for now, we will remove it when we have more users. |
19:02:40 | FromGitter | <zacharycarter> well - that's what I did eventually - I upgraded the kernel of the droplet and installed the latest and greatest docker |
19:02:43 | FromGitter | <zacharycarter> and things are working now |
19:02:52 | dom96 | salewski: If I was a user that would scare me |
19:02:58 | dom96 | and possibly annoy me |
19:03:40 | salewski | dome 96, see https://github.com/StefanSalewski/gintro/issues/27 |
19:03:43 | dom96 | salewski: If I wasn't testing this package to see if it installs I would have CTRL+C'd the installation as soon as it started spamming |
19:03:54 | salewski | So our recent customer was successful. |
19:04:36 | FromGitter | <data-man> !eval import sqlite3; echo $libversion_number() |
19:04:38 | NimBot | 3011000 |
19:04:56 | FromGitter | <zacharycarter> good NimBot |
19:04:57 | salewski | And I treid install some days ago too, sucessfully, but not with latest compiler, and only on Linux AMD64. |
19:04:59 | FromGitter | <zacharycarter> :P |
19:05:02 | dom96 | salewski: here is the error I got: https://gist.github.com/dom96/13022ad1eeb0d22db49850690c4b9b76 |
19:05:12 | dom96 | This is on macOS |
19:05:17 | FromGitter | <xmonader> Can someone explain this output to me? ⏎ ⏎ ``` S : i12345e ⏎ EPOS: 6 ⏎ int string: 12345e ⏎ PARSED INT: 12 ⏎ I is 12``` [https://gitter.im/nim-lang/Nim?at=5ae4c5ed2b9dfdbc3adc7c9a] |
19:05:18 | dom96 | zacharycarter: :D |
19:06:02 | FromGitter | <data-man> @NimBot: How are you? |
19:06:08 | salewski | Thanks dom86, will investigate. Is that for Linux? |
19:06:55 | FromGitter | <zacharycarter> !eval echo NimVersion |
19:06:57 | NimBot | 0.18.0 |
19:07:01 | FromGitter | <zacharycarter> ooph |
19:07:19 | FromGitter | <data-man> @NimBot: Do you like Nim? |
19:07:20 | Araq | 0.18.0? that's oooolllddd. Nim just got fixed strings and seqs... |
19:07:35 | FromGitter | <zacharycarter> well - it's probably that whole - the docker repo hasn't been updated thing again |
19:07:36 | Araq | well ... i'm still working on it |
19:07:55 | FromGitter | <zacharycarter> should I bug the maintainer to update it so we can use a later version other playground? |
19:08:04 | FromGitter | <zacharycarter> or should I just leave it be? or... |
19:09:10 | salewski | Dom96, well when it is macOS, indeed no one has used gintro or oldgtk3 on macOS already. So it may be hard for me to find the bug. |
19:09:37 | FromGitter | <alehander42> what are "fixed strings" :D |
19:10:09 | dom96 | salewski: that's fine, but please make it so that it doesn't spam my terminal :) |
19:10:28 | dom96 | zacharycarter: btw, it'd be cool if you could support older versions :) |
19:10:55 | FromGitter | <zacharycarter> should be easy enough to do - I can make that happen with the overhaul I htink |
19:10:57 | FromGitter | <zacharycarter> think* |
19:11:33 | salewski | dom96, without output people may tell me just that it does not work. with spam they may tell me the ""last words". Some people are stupid. |
19:12:11 | dom96 | salewski: Change the messages to "Preprocessing <filename>" or something like this then |
19:12:25 | dom96 | You don't need this much granularity |
19:13:22 | FromGitter | <xmonader> is tehre something wrong with slicing in strings? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ output is `1` [https://gitter.im/nim-lang/Nim?at=5ae4c7d215c9b03114475b94] |
19:14:02 | salewski | Well, I have currently one user. So there is not much feedback. But maybe I will make it quit -- less stress for me :-) |
19:14:32 | FromGitter | <xmonader> ok <6 works what the difference between ^6 and < 6 ? in slicing context? |
19:14:39 | salewski | Bye. |
19:15:19 | * | salewski quit (Quit: WeeChat 2.0.1) |
19:18:57 | FromDiscord | <claude> s[1..^6] is s[1..(s.len - 6)], s[1..<6] is s[1..5] |
19:19:28 | FromGitter | <xmonader> argh thanks |
19:28:07 | * | salewski joined #nim |
19:28:26 | * | nsf joined #nim |
19:30:16 | salewski | dom96, well that seems to be a strange problem with your gintro and macos. g_irepository_get_dependencies () seems to return nil, which it should not do. |
19:30:31 | salewski | https://developer.gnome.org/gi/1.56/GIRepository.html#g-irepository-get-dependencies |
19:31:07 | salewski | Have no idea currently, sorry. |
19:41:26 | * | gangstacat joined #nim |
19:42:33 | FromGitter | <xmonader> ok guys on my second day, I wrote a bencode encoder/decoder in nim!! :) |
19:45:09 | * | yglukhov quit (Read error: Connection reset by peer) |
19:45:41 | * | yglukhov joined #nim |
19:46:48 | dom96 | salewski: interesting. Please don't quit, you've created a great project :) |
19:48:16 | FromGitter | <ephja> !eval echo "🤷" |
19:48:18 | NimBot | 路 |
19:52:40 | FromGitter | <data-man> !eval import unicode; echo $toRunes("🤷") |
19:52:43 | NimBot | 路 |
19:53:17 | FromGitter | <data-man> !eval import unicode; echo toRunes("🤷") |
19:53:19 | salewski | Sorry dom96, typo: quiet, not quit. :-) |
19:53:19 | NimBot | 路 |
19:53:54 | dom96 | do make it quiet :) |
19:54:02 | * | yglukhov quit (Read error: Connection reset by peer) |
19:54:36 | * | yglukhov joined #nim |
19:55:39 | salewski | For macos I may check g_irepository_get_dependencies () for nil result, so empty import list. Not necessary from api docs, but maybe macos gtk3 is buggy. |
19:59:00 | FromGitter | <ephja> @data-man huh |
20:01:03 | FromGitter | <ephja> 🤷 |
20:01:24 | dom96 | salewski: that sounds likely :) |
20:02:24 | FromGitter | <xmonader> If anyone interested in reviewing what i learned today https://github.com/xmonader/nim-bencode |
20:07:05 | dom96 | xmonader: awesome, but why are you using methods? |
20:07:29 | * | Trustable quit (Remote host closed the connection) |
20:08:07 | FromGitter | <xmonader> @dom96 i thought it's bit organized `encoder.encode` and `decoder.decode` no? |
20:08:11 | FromGitter | <data-man> @ephja: heh :) |
20:08:16 | * | tiorock joined #nim |
20:08:16 | * | rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services))) |
20:08:16 | * | tiorock is now known as rockcavera |
20:08:28 | dom96 | xmonader: You don't need methods for that, Nim has UFCS |
20:08:42 | dom96 | You only need methods if you're using inheritance and want to override these methods |
20:08:56 | dom96 | also you should defined a ``newEncoder`` proc |
20:09:00 | FromGitter | <xmonader> what is UFCS sorry not really fluent with nim i'd call it my second day |
20:09:11 | dom96 | Unified Function Call Syntax |
20:09:33 | dom96 | echo("Hello World") is the same as "Hello World".echo() |
20:09:58 | FromGitter | <xmonader> ah I see i'll try to update it to procs |
20:10:43 | * | tiorock joined #nim |
20:10:43 | * | tiorock quit (Changing host) |
20:10:43 | * | tiorock joined #nim |
20:10:43 | * | rockcavera is now known as Guest99063 |
20:10:43 | * | Guest99063 quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
20:10:43 | * | tiorock is now known as rockcavera |
20:12:43 | * | rockcavera quit (Remote host closed the connection) |
20:13:45 | FromGitter | <xmonader> @dom96 all updated (y) |
20:14:29 | dom96 | xmonader: nice |
20:14:37 | FromGitter | <xmonader> wow nim doesn't have a bencode library!! |
20:14:55 | FromGitter | <data-man> @xmonader: Yet another Bittorrent lib :) https://github.com/twist-vector/nim-bped |
20:15:32 | FromGitter | <data-man> With methods also |
20:16:05 | FromGitter | <xmonader> nice maybe i pick up somethign or two from this code |
20:16:24 | FromGitter | <xmonader> maybe someone would start writing "idiomatic nim" or effective nim docs with those notes? |
20:17:19 | FromGitter | <xmonader> from my side i'm planning to write another tutorial summing this library and what i learned |
20:22:52 | salewski | xmonader, your Encoder and Decoder objects look like plain dummy objects on first view. I must miss omething. |
20:26:21 | salewski | You pass them as this parameter, but it seems to be never really used? |
20:30:32 | FromGitter | <ephja> a habit from other languages perhaps |
20:33:10 | FromGitter | <xmonader> @salewski yea just for code organization really nothing more |
20:38:23 | * | tiorock joined #nim |
20:38:30 | * | xkapastel quit (Quit: Connection closed for inactivity) |
20:38:59 | * | tiorock quit (Changing host) |
20:38:59 | * | tiorock joined #nim |
20:38:59 | * | tiorock is now known as rockcavera |
20:42:17 | * | xkapastel joined #nim |
20:43:07 | * | salewski quit (Quit: WeeChat 2.0.1) |
21:03:09 | * | yglukhov quit (Read error: Connection reset by peer) |
21:03:21 | * | miran quit (Quit: Konversation terminated!) |
21:03:47 | * | yglukhov joined #nim |
21:12:38 | FromGitter | <Varriount> Araq: When does `ntyInferred` occur in Nim code? |
21:13:20 | FromGitter | <Varriount> Also, `ntyOpt` |
21:14:05 | * | yglukhov quit (Read error: Connection reset by peer) |
21:14:32 | Araq | ntyOpt is dead |
21:14:37 | * | yglukhov joined #nim |
21:14:45 | Araq | ntyInferred is bullshit |
21:15:11 | FromGitter | <Varriount> And `ntyAnd`, `ntyOr`, `ntyNot`? |
21:15:49 | Araq | int | float # ntyOr |
21:16:09 | FromGitter | <Varriount> Ah, ok |
21:16:09 | Araq | similar for the others |
21:16:32 | Araq | if you work on serialization, just bail out on these |
21:18:37 | * | yglukhov quit (Read error: Connection reset by peer) |
21:19:04 | Araq | we need an isConcreteType helper |
21:19:10 | * | yglukhov joined #nim |
21:19:36 | Araq | nim is full of stupid meta-types nobody knows how to handle, not even the compiler itself |
21:20:52 | Araq | see any concept/static[T] related crash. |
21:21:52 | * | yglukhov quit (Read error: Connection reset by peer) |
21:22:29 | * | yglukhov joined #nim |
21:24:29 | FromGitter | <Varriount> Hm, well I might still need to support concepts |
21:25:17 | FromGitter | <Varriount> However there are 4 different type class types: `ntyBuiltinTypeClass`, `ntyUserTypeClass`, `ntyUserTypeClassInst`, and `ntyCompositeTypeClass` |
21:25:49 | FromGitter | <Varriount> Beats me what the difference between some of them are, or how to even get examples of their ASTs |
21:26:35 | Araq | ntyBuiltinTypeClass is something like a standalone 'array' |
21:26:47 | Araq | ntyUserTypeClass is a 'concept' |
21:26:59 | Araq | ntyCompositeTypeClass is or, and, not |
21:27:08 | Araq | ntyUserTypeClassInst is a mystery. |
21:27:23 | FromGitter | <Varriount> Thanks! |
21:27:30 | Araq | well it's an instantiation of a 'concept' |
21:27:44 | Araq | so x.lastSon should be the real type |
21:28:08 | FromGitter | <Varriount> Araq: I really appreciate all this help. I just wish I didn't have to ask you about these things so much. |
21:29:18 | Araq | you're welcome. I think there are doc comments for their compiler siblings |
21:29:21 | FromDiscord | <claude> are auto parameters shorthand for `proc foo[T](x: T)` |
21:29:34 | Araq | tyBuiltinTypeClass, etc. |
21:29:38 | FromGitter | <data-man> @jangko: you around? |
21:30:40 | Araq | varriount: how can you support a 'concept'? |
21:31:39 | Araq | in my limited imagination I never figured out what to do with a concept in a serialization context. |
21:36:04 | FromGitter | <Varriount> Araq: Well, right now I'm just trying to improve the (very brittle) customPragmaValue code |
21:37:18 | FromGitter | <Varriount> Though, with something like concepts you run into the question, "should I retrieve the pragma from the concept definition, or the concrete type, or both?" |
21:38:54 | * | dddddd joined #nim |
21:42:20 | * | gangstacat quit (Quit: Ĝis!) |
21:48:39 | PMunch | Hmm, well that's a bit annoying |
21:49:10 | PMunch | Since set's only cover int16 I can't use it to check unicode scalars like this: if code notin {0..0xD7FF, 0xE000..0x10FFFF} |
21:51:26 | * | darithorn quit (Remote host closed the connection) |
21:51:42 | FromGitter | <Varriount> PMunch: Could you break the scalar into 2 int16's? |
21:52:04 | FromGitter | <Varriount> Or perhaps use a range type? |
21:52:33 | PMunch | Varriount, can't break it into two |
21:52:46 | PMunch | 10FFFF-E000 is still larger than int16 |
21:53:26 | CodeVance | goz |
21:53:50 | PMunch | Range types seemed to work though :) |
21:53:54 | PMunch | Completely forgot about those |
21:55:34 | FromGitter | <Varriount> I think range types are probably the most neglected part of the type system. |
22:02:37 | dom96 | Yay, my dissertation is pretty much complete. |
22:02:54 | PMunch | Oh nice dom96 |
22:04:16 | petersjt014[m] | any way I can do a map after a map? |
22:04:55 | * | petersjt014[m] sent a long message: petersjt014[m]_2018-04-28_22:04:54.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/VmZgBwQrmftgXsdKbEOpmKck> |
22:07:05 | dom96 | petersjt014[m]: yep, one is not to use the do notation |
22:07:41 | dom96 | xmlseq.map((item) => item.child()...).map(...) |
22:07:48 | dom96 | (Import 'sugar' for that) |
22:08:12 | FromGitter | <data-man> @dom96: What subject of the dissertation? |
22:08:26 | dom96 | data-man: A C/C++ Obfuscator written in Nim |
22:10:01 | FromGitter | <data-man> The second dissertation will be "C/C++ Unobfuscator"? :) |
22:11:10 | FromGitter | <Varriount> dom96: Going for your masters already? |
22:11:22 | dom96 | Varriount: nope |
22:11:30 | dom96 | BSc dissertation |
22:12:23 | dom96 | petersjt014[m]: you can also wrap the whole do expression in parenthesis, but that sucks. One of the reasons why I don't use the do notation and think it should be removed from the language. |
22:14:00 | FromGitter | <Varriount> dom96: Wait, why do you think the 'do' notation should be moved? |
22:14:21 | FromGitter | <data-man> Goog luck! I hope that after receiving a bachelor's degree, you will have more time for Nim! :) |
22:14:27 | * | CodeVance quit (Ping timeout: 240 seconds) |
22:15:54 | dom96 | Varriount: Because it doesn't fit the language |
22:16:29 | dom96 | data-man: definitely, but soon enough it will be time to start earning money :/ |
22:16:39 | FromGitter | <ephja> dom96: was it never possible to have multiple statements with =>? |
22:17:07 | dom96 | ephja: IIRC it never was. |
22:17:31 | dom96 | For multiple statements you should just use the boring old 'proc (item: Item) = ...' syntax |
22:18:04 | petersjt014[m] | phooey :| |
22:18:29 | petersjt014[m] | I was having so much fun playing hide from the instance variable |
22:19:59 | FromGitter | <sherjilozair> Hey guys, where does Nim look for headers specified using the `header :` tag in FFI? |
22:20:04 | dom96 | How I would write it: https://gist.github.com/dom96/406341ad69ac8954fd7be81d87679cfb |
22:20:29 | dom96 | sherjilozair: same place a C compiler looks :) |
22:20:47 | FromGitter | <sherjilozair> @dom96 Can it not be in my project directory? |
22:22:46 | dom96 | sherjilozair: possibly passing `--passC:-I./` to Nim might work |
22:22:52 | dom96 | But I'm curious what you're up to |
22:23:10 | FromGitter | <sherjilozair> I'm wrapping SFML. |
22:23:17 | FromGitter | <sherjilozair> From here: https://www.sfml-dev.org/download/csfml/ |
22:23:30 | FromGitter | <zacharycarter> errr |
22:23:37 | FromGitter | <zacharycarter> csfml wrappers already exist though |
22:23:45 | FromGitter | <zacharycarter> or bindings rather |
22:24:03 | FromGitter | <sherjilozair> The maintainer says they're not done well. |
22:24:24 | FromGitter | <sherjilozair> I assume you're referring to this: https://github.com/oprypin/nim-csfml |
22:24:59 | dom96 | I've used them successfully, the only complaint I had with them was the use of `foo=` instead of setFoo (which makes searching in the SFML docs annoying) |
22:25:02 | FromGitter | <sherjilozair> I want to develop a more idiomatic library. |
22:25:03 | FromGitter | <zacharycarter> well - folks have used those bindings with success in the past - so I don't know how horrible the problems actually are |
22:25:44 | dom96 | But if you're writing a wrapper you shouldn't be bundling the header file with it |
22:25:53 | dom96 | It'll be installed on the user's system |
22:26:31 | FromGitter | <sherjilozair> @dom96 I can't be sure it will be installed in user's system right? Why would CSFML be installed in user's system. |
22:27:16 | FromGitter | <sherjilozair> @zacharycarter to use these bindings, you have to call destroy on each object you create right? |
22:27:31 | dom96 | Actually, now that I think about it, you shouldn't be using 'header' but 'dynlib' instead |
22:27:45 | FromGitter | <zacharycarter> I don't know - I never use CSFML / GLFW3 / SDL2 for anything other than windowing and input support |
22:28:08 | FromGitter | <zacharycarter> and I'm probably just going to end up eventually porting a lot of CSFML - minus the rendering and a lot of the system code - to Nim |
22:28:48 | FromGitter | <sherjilozair> @zacharycarter What would you port CSFML for? |
22:28:51 | dom96 | but if a user is developing code with csfml they should have the -dev package installed. |
22:28:56 | FromGitter | <zacharycarter> well I'd port SFML |
22:28:59 | FromGitter | <zacharycarter> not CSFML |
22:29:33 | FromGitter | <zacharycarter> so that Nim would have a pure x-plat windowing library |
22:29:34 | FromGitter | <sherjilozair> Oh the C++ api. Oh yeah, that's possible in Nim. |
22:29:39 | FromGitter | <zacharycarter> no no not the C++ API |
22:29:43 | FromGitter | <zacharycarter> I'd port it to Nim |
22:29:46 | FromGitter | <zacharycarter> not wrap or bind |
22:29:50 | FromGitter | <sherjilozair> Ah I see. |
22:29:56 | FromGitter | <zacharycarter> but again - only windowing and input code |
22:29:59 | FromGitter | <sherjilozair> does nim2cpp exist? |
22:30:03 | FromGitter | <zacharycarter> no |
22:30:12 | FromGitter | <zacharycarter> nim2 anything doesn't exist |
22:30:13 | FromGitter | <zacharycarter> c2nim exists |
22:30:20 | FromGitter | <zacharycarter> and has a cpp, and Nim can compile to C++ |
22:30:21 | FromGitter | <sherjilozair> right I meant cpp2nim |
22:30:29 | dom96 | `nim cpp` is technically nim2cpp :) |
22:30:30 | FromGitter | <zacharycarter> err it has a cpp flag c2nim does |
22:31:50 | FromGitter | <sherjilozair> @dom96 Didn't get what you meant by "-dev package". |
22:32:29 | * | nsf quit (Quit: WeeChat 2.0.1) |
22:32:40 | dom96 | On Ubuntu for example, you'd install csfml-dev which is distinct from csfml. The former installs the header files, the latter just the .so DLL |
22:33:21 | FromGitter | <sherjilozair> @dom96 How would I package the final binary such that users who don't have anything installed can run the binary. |
22:34:00 | dom96 | Depends on your target platform. On Linux you would just tell them to use their favourite package manager to install the dependencies |
22:34:12 | dom96 | You could also statically link with sfml, but that's more involved |
22:34:54 | dom96 | on macOS you'd bundle the .dylib into an app bundle (or tell people to install sfml via homebrew) |
22:35:34 | FromGitter | <sherjilozair> It would have to be bundling. I'm imagining games here. People won't install anything, except right-click a bundle. |
22:36:02 | dom96 | Sure. I've done that successfully for my game: https://ldjam.com/events/ludum-dare/40/coastal-postal |
22:36:09 | FromGitter | <sherjilozair> So is it a better idea to wrap SFML or CSFML? I just saw that Nim can also wrap CPP. |
22:36:49 | FromGitter | <sherjilozair> oh cool, so you used oprypin's nim-csfml for this? |
22:36:56 | dom96 | yep |
22:37:22 | FromGitter | <sherjilozair> So do you think nim-csfml cannot be improved on? |
22:37:25 | dom96 | I'm not sure there would be much benefit to wrapping SFML directly |
22:37:37 | dom96 | only the API I think |
22:37:47 | dom96 | The setters only bothered me IIRC |
22:38:13 | dom96 | Indeed, destructors could make it better. But AFAIK Nim's destructors aren't ready for that yet (Araq can correct me here if I'm wrong) |
22:38:21 | FromGitter | <sherjilozair> But you had to destroy your objects manually. Would you not prefer Python-like contexts? |
22:38:54 | Araq | Python-like contexts? that's just a template in Nim. |
22:39:20 | Araq | the real thing for this are destructors |
22:39:32 | FromGitter | <sherjilozair> @araq |
22:39:49 | FromGitter | <sherjilozair> Destructors would be awesome, but are they ready for use right now? |
22:40:01 | FromGitter | <sherjilozair> What's the timeline on destructors? |
22:40:17 | dom96 | Sure, but doing this isn't too difficult: https://github.com/dom96/ld40/blob/master/ld40.nim#L344 |
22:41:10 | Araq | destructors are ... I dunno. 80% done? |
22:41:12 | * | rockcavera quit (Remote host closed the connection) |
22:42:23 | FromGitter | <sherjilozair> @dom96 this isn't difficult for good programmers, no. But for a library to be useful I think it's important to minimize errors even if the programmer is not careful. |
22:42:25 | Araq | you can give them a try with --newruntime but bugs tagged with that don't yet have priority, sadly. |
22:42:42 | * | CodeVance joined #nim |
22:48:10 | CodeVance | Can someone help me with an error please |
22:48:50 | CodeVance | https://gist.github.com/CodeVance/1b4f541abc850495ce258f84df27b036 |
22:49:13 | dom96 | what's the error? |
22:49:14 | CodeVance | I get Hint: [Link] |
22:49:17 | CodeVance | Hint: operation successful (20500 lines compiled; 27.236 sec total; 38.445MiB peakmem; Debug Build) [SuccessX] |
22:49:18 | CodeVance | Hint: bin\game_core [Exec] |
22:49:18 | CodeVance | game_core.nim(70) game_core |
22:49:18 | CodeVance | game_core.nim(56) newPaddle |
22:49:18 | CodeVance | system.nim(2833) sysFatal |
22:49:18 | CodeVance | Error: unhandled exception: invalid object conversion [ObjectConversionError] |
22:49:19 | CodeVance | Error: execution of an external program failed: 'bin\game_core ' |
22:49:27 | dom96 | Please gist that next time |
22:50:08 | CodeVance | Ok |
22:50:12 | CodeVance | I put it on the gist |
22:52:18 | FromDiscord | <claude> you can't go up in the inheritance tree |
22:52:30 | dom96 | yeah, you can't convert up in the inheritance tree |
22:52:37 | dom96 | You'll need to create the Paddle type directly |
22:53:00 | CodeVance | new and init procs seperately? |
22:53:18 | dom96 | Paddle(pos: pos, size: size, ..., dir: dir) |
22:53:35 | FromDiscord | <claude> or you can do this https://gist.github.com/hlaaftana/0112c9cdfaaf8741b5aa612d4e63a39d |
22:54:19 | dom96 | yes, but please call it `setupGameObj` or something |
22:54:35 | dom96 | initGameObj by convention should return a non-ref GameObj type |
22:54:38 | FromDiscord | <claude> oops, `obj: GameObj` should be `obj: var GameObj` |
22:54:58 | dom96 | and since I'm talking about convention: GameObj should be called Game since it's a ref type |
22:55:00 | Araq | claude: no you can't? |
22:55:20 | CodeVance | init in python was a void type proc |
22:55:32 | CodeVance | is why I used that convention |
22:55:34 | * | smt_ quit (Read error: Connection reset by peer) |
22:56:09 | * | smt joined #nim |
22:56:10 | CodeVance | claude, You might not realise it but I appreciate pointing out where I can improve |
22:56:35 | CodeVance | No to var GameObj? |
22:58:34 | dom96 | CodeVance: If you want some more points: format your code more consistently, it's annoying at first but once you get used to it it's hard to stop :) |
22:58:57 | dom96 | In particular, things like putting space before and after a '=' |
22:59:18 | CodeVance | dom96 I was litterally banging it together. |
22:59:27 | CodeVance | But I'll do so ... in a moment |
22:59:43 | CodeVance | where is nep1 btw |
23:00:07 | CodeVance | I found it |
23:00:28 | dom96 | That document needs to be updated |
23:01:54 | dom96 | There is some advice it gives that is wrong |
23:06:13 | CodeVance | I'll just follow my own common sense then :) |
23:07:29 | dom96 | Just look at any of my projects for a good example of what idiomatic Nim should look like, even Nimble is pretty well formatted: https://github.com/nim-lang/nimble/blob/master/src/nimble.nim ;) |
23:07:48 | FromGitter | <sherjilozair> How can I specify custom location to pick up dylibs from to the nim compiler? |
23:07:59 | CodeVance | XD |
23:08:32 | CodeVance | sher Link pragma |
23:08:32 | CodeVance | The link pragma can be used to link an additional file with the project: |
23:08:32 | CodeVance | {.link: "myfile.o".} |
23:08:49 | CodeVance | Or are you talking about search a folder |
23:09:13 | FromGitter | <sherjilozair> latter yeah. |
23:10:50 | CodeVance | sher PassL pragma |
23:11:01 | CodeVance | https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html |
23:11:06 | CodeVance | IS that the right? |
23:15:06 | dom96 | sherjilozair: dylibs are picked up from the DYLD_LIBRARY_PATH on macOS |
23:15:12 | dom96 | There is no way to tell the Nim compiler to change this |
23:15:25 | dom96 | This is how it is for all applications |
23:32:09 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
23:36:28 | * | Lord_Nightmare joined #nim |
23:49:24 | FromGitter | <Varriount> dom96: How does NEP1 need to be updated? |
23:49:57 | * | skrylar joined #nim |
23:49:59 | skrylar | poof. |
23:50:04 | * | skrylar appears in a puff of logic |
23:51:04 | * | FromGitter * Varriount throws a congratulatory dove at skrylar |
23:51:40 | dom96 | Varriount: hrm, it seems I already updated it at some point |
23:51:45 | dom96 | it could use more details though |
23:52:02 | FromGitter | <Varriount> The only thing I would change is how multi-line parameters should be written. |
23:53:57 | FromGitter | <Varriount> Lately I've fallen in love with something like this: https://gist.github.com/Varriount/3fd164ffa45e3b75616c59aa3bc5c482 |
23:57:07 | skrylar | hum. i looked at our existing protobuf libs. i guess i'm the only one who is a fan of merging the serial/deserial with objects already in the app |
23:57:22 | skrylar | everyone else has been implementing them as objects you create to copy data over in to and then copy again to the bitstream |
23:58:31 | FromGitter | <sherjilozair> @dom96 So this should work? `DYLD_LIBRARY_PATH=\`pwd\`/lib/ nim c -r pong.nim` |
23:58:36 | FromGitter | <sherjilozair> `DYLD_LIBRARY_PATH=`pwd`/lib/ nim c -r pong.nim` |
23:58:40 | FromGitter | <sherjilozair> "DYLD_LIBRARY_PATH=`pwd`/lib/ nim c -r pong.nim" |
23:58:44 | FromGitter | <sherjilozair> but it doesn't. |
23:59:18 | FromGitter | <sherjilozair> I get `could not load: libcsfml-graphics.dylib` |