00:00:26 | * | a_b_m joined #nim |
00:03:35 | * | abm quit (Ping timeout: 240 seconds) |
00:03:38 | * | BitPuffin quit (Remote host closed the connection) |
00:16:53 | * | FiendKing04 joined #nim |
00:17:16 | * | AlexMax joined #nim |
00:17:39 | * | FiendKing04 quit (Remote host closed the connection) |
00:19:26 | * | CeBe27 joined #nim |
00:21:25 | * | CeBe27 quit (Remote host closed the connection) |
00:22:51 | AlexMax | How do I initialize an array of tuples all at once? |
00:22:55 | AlexMax | https://paste.ee/p/bAgAp |
00:24:40 | zacharycarter[m] | AlexMar: iterate over collection and initialize them? |
00:25:30 | zacharycarter[m] | not sure of a way to do it "all at once" |
00:26:03 | zacharycarter[m] | tuples don't behave the same way Objects do |
00:26:53 | AlexMax | If I do this in C++, https://paste.ee/p/6X2pY it's just baked into the data segment |
00:26:59 | AlexMax | tjat |
00:27:04 | AlexMax | that's what I'm trying to replicate |
00:27:55 | zacharycarter[m] | how does - https://news.ycombinator.com/user?id=sdegutis - get a green name on HN? |
00:29:28 | FromGitter | <kayabaNerve> ```type Vertex = tuple[x, y: int] ⏎ var lines: array[2, Vertex] = [(1, 2), (3, 4)]``` [https://gitter.im/nim-lang/Nim?at=5b6a3967c917d40dc2578952] |
00:29:32 | FromGitter | <kayabaNerve> AlexMax ^^ |
00:30:05 | krux02 | AlexMax: I am not so sure about tha "it's just baked into the data segment" |
00:31:00 | krux02 | sorry, I thought you were using std::vector |
00:31:08 | krux02 | with std::array you might be right |
00:31:21 | krux02 | in nim you create arrays with the [] exressino |
00:32:00 | AlexMax | kayabaNerve: I actually tried that, but got an error |
00:32:13 | AlexMax | rocked.nim(20, 29) Error: type mismatch: got <array[0..2, tuple of (int, int)]> but expected 'array[0..2, Vertex]' |
00:32:50 | AlexMax | https://paste.ee/p/0bTuz |
00:35:18 | AlexMax | krux02: I am right ;) Or rather, godbolt demonstrated it to be so. |
00:36:00 | zacharycarter[m] | AlexMax: try - `array[0..2, Vertex(x, y)]` - wherever you're creating the vertex object |
00:36:08 | krux02 | yes |
00:36:11 | zacharycarter[m] | remember `(..)` = tuple |
00:36:18 | krux02 | you have to prefix each element |
00:36:24 | zacharycarter[m] | `Object(..)` = object |
00:36:43 | zacharycarter[m] | or if you've named the tuple |
00:36:46 | zacharycarter[m] | it's a named tuple |
00:37:42 | AlexMax | krux02: Is that not what I did in my original paste? |
00:38:03 | krux02 | yes it is |
00:38:56 | krux02 | it you really really want to skip the type prefix, you can write a macro for you that transforms tuple initializers to the type of initializers you want, but I don't think it is worth it. |
00:39:14 | zacharycarter[m] | https://gist.github.com/zacharycarter/8fe642f9ee60519aef058eea9ce39fca |
00:39:58 | AlexMax | that's exactly what I did |
00:40:03 | AlexMax | rocked.nim(20, 37) Error: attempting to call undeclared routine: 'Vertex' |
00:40:43 | FromGitter | <kayabaNerve> AlexMax: You must name the fields. |
00:40:49 | FromGitter | <kayabaNerve> Vertex(x: 0, y: 128) |
00:41:02 | krux02 | oops |
00:41:04 | FromGitter | <kayabaNerve> Also, you didn't change your type definition |
00:41:06 | krux02 | sorry |
00:41:11 | FromGitter | <kayabaNerve> ```type Vertex = tuple[x, y: int] ⏎ var lines: array[2, Vertex] = [(1, 2), (3, 4)]``` [https://gitter.im/nim-lang/Nim?at=5b6a3c27359c70045ca01742] |
00:41:12 | krux02 | I totally forgot that |
00:41:28 | AlexMax | there we go |
00:41:40 | FromGitter | <kayabaNerve> If you change your type definition from tuple + fields to instance of tuple, that array will be valid. |
00:41:41 | krux02 | I always work with the glm library, there I have functions to define my vertices |
00:42:00 | krux02 | let data = [vec3f(1,2,3), vec3f(3,2,1)] |
00:42:07 | FromGitter | <kayabaNerve> That said, feel free to do object + fields Vertex(x: 0, y: 128) |
00:42:07 | zacharycarter[m] | oh yeah |
00:42:08 | zacharycarter[m] | forgot about the = tuple |
00:42:09 | zacharycarter[m] | good call kayabaNerve |
00:42:23 | FromGitter | <kayabaNerve> Thanks :P I made sure to test it out in `nim secret` |
00:42:29 | AlexMax | I didn't change my type definition |
00:42:33 | AlexMax | wait |
00:42:49 | FromGitter | <kayabaNerve> It was tuple + fields. You needed to change it to tuple[x,y:int]. Now it's an object and not a tuple at all. |
00:43:14 | AlexMax | oh that's right I changed it on my end in my experiment |
00:43:17 | AlexMax | ugh |
00:43:26 | FromGitter | <kayabaNerve> You had: ⏎ tuple ⏎ x, y ⏎ ⏎ You needed: ... [https://gitter.im/nim-lang/Nim?at=5b6a3cae3a5a2d2f99091610] |
00:43:34 | * | wildlander quit (Quit: Konversation terminated!) |
00:43:51 | AlexMax | Sorry, i got a little mixed up |
00:43:52 | FromGitter | <kayabaNerve> If you have it set to the third, you must use Vertex(x: 0, y: 128). Make it the second and you can use (0, 128) . |
00:43:54 | FromGitter | <kayabaNerve> All good. |
00:44:06 | FromGitter | <kayabaNerve> Just trying to help you ;p |
00:45:14 | krux02 | kayaNerve these code posts from gitter to irc are really broken |
00:45:21 | FromGitter | <kayabaNerve> I should change some of my objects to a tuple... I was doing an .obj parser for my friend. I did have constructors like krux02 but they're still objects... |
00:45:31 | FromGitter | <kayabaNerve> krux02: So get on Gitter :thinking: |
00:45:48 | FromGitter | <kayabaNerve> And no. That's not broken. Gitter doesn't have thinking :( |
00:45:49 | AlexMax | Your second example compiles, but only because you changed the type definition to int |
00:46:06 | FromGitter | <kayabaNerve> You can use int32 but you may have to cast from int literal to int32 |
00:46:13 | FromGitter | <kayabaNerve> I think you would have to do that either way though... |
00:46:15 | AlexMax | oof |
00:46:25 | FromGitter | <kayabaNerve> Or you can define a converter |
00:47:18 | FromGitter | <kayabaNerve> `converter toInt32(x: int): int32 = ((int32) x)` |
00:47:28 | FromGitter | <kayabaNerve> Or `x.int32` |
00:47:31 | FromGitter | <kayabaNerve> or int32(x) |
00:47:33 | krux02 | don't user converters |
00:47:42 | krux02 | especially not that one |
00:48:09 | FromGitter | <kayabaNerve> krux02: It's not the worst idea IMO. It handles int literals when int32 is expected... |
00:48:30 | krux02 | yes it does convert stuff for you and you get basically behavior like in c++, but that behavior is really causing hard to find problems in c++ |
00:48:33 | FromGitter | <kayabaNerve> Don't make it public though, and don't make it global if possible... |
00:48:44 | krux02 | int literals work wher int32 is expected |
00:49:01 | FromGitter | <kayabaNerve> Not according to AlexMax in this example :P |
00:52:20 | AlexMax | krux02: According to documentation int is the size of a pointer |
00:52:28 | AlexMax | which is 64-bits on my machine |
00:52:38 | AlexMax | and I think i also read somewhere that int, int32 and int64 are distinct types |
00:53:04 | AlexMax | and ooo looky looky what I found |
00:53:07 | AlexMax | https://paste.ee/p/jRvob |
00:54:12 | AlexMax | looks to me like it's creating a global C array at TU scope with the values i was looking for |
00:54:25 | AlexMax | which will compile into the data segment |
00:55:07 | krux02 | then you have what you were looking for. |
00:55:13 | AlexMax | indeed |
00:56:46 | AlexMax | also I swear I didn't think of nim because of the crypto annoucement on hackernews |
00:56:56 | FromGitter | <kayabaNerve> krux02 |
00:57:02 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6a3fdd3a5a2d2f99092244] |
00:57:15 | FromGitter | <kayabaNerve> No. int literal won't auto cast to int32. |
00:57:19 | FromGitter | <kayabaNerve> *in this case |
00:57:55 | FromGitter | <kayabaNerve> However, the converter doesn't change anything. Same exact error. |
00:58:12 | FromGitter | <kayabaNerve> You'd need a converter tuple[x, y: int] to Vertex |
00:58:55 | krux02 | int literal will auto cast to int32, the problem is that tuple(int, int) wont auto cast to tuple(int32, int32) |
01:00:00 | FromGitter | <kayabaNerve> Yep. Sorry. That's my point about changing the converter to the tuple. |
01:00:36 | FromGitter | <kayabaNerve> But an Nim won't auto cast an array[tuple[x, y: int]] to array[tuple[x, y: int32]] |
01:00:42 | FromGitter | <kayabaNerve> *But Nim |
01:01:07 | FromGitter | <kayabaNerve> We tried. |
01:01:08 | FromGitter | <kayabaNerve> RIP |
01:01:30 | FromGitter | <kayabaNerve> I am going to create an issue about this to see if it should be allowed or not though |
01:02:25 | FromGitter | <kayabaNerve> I say yes tbh. An array of Vertexes should allow a value that's an array of tuple[x, y: int] with this converter: converter toVertex(x: tuple[x, y: int]): Vertex = (int32(x.x), int32(x.y)) |
01:03:00 | krux02 | no don't create an issue |
01:03:05 | krux02 | it is fine like it is |
01:03:37 | FromGitter | <kayabaNerve> I'm creating an issue to ask if it should be part of the language or not. |
01:03:50 | krux02 | I can tell you, it should not be part of the language |
01:04:14 | krux02 | it would be an explosion in complexity for a feature that has very little use |
01:04:24 | FromGitter | <kayabaNerve> Eh. I'm thinking about it and currently in the middle. I just want to bring it to attention. |
01:04:49 | krux02 | I know that Araq already doesn't like converter very much, expanding on it is not what he is going forward to. |
01:05:01 | krux02 | no please |
01:05:13 | FromGitter | <kayabaNerve> Why can I not just create an issue? |
01:05:15 | krux02 | I want to prevent to bring the attention to non important issues. |
01:05:18 | FromGitter | <kayabaNerve> If it's disliked, it can be closed. |
01:05:32 | krux02 | pleas, don't create an issue. |
01:06:05 | krux02 | there are far to many important things that need to be done in the Nim language. |
01:06:13 | krux02 | I am working on some of them, too. |
01:06:25 | FromGitter | <kayabaNerve> ... I'm creating the damn issue. If it's disliked, it can be closed in less than a minute. The end. |
01:07:29 | krux02 | It is disliked by me. |
01:08:23 | FromGitter | <kayabaNerve> Leave a comment on the issue. |
01:10:26 | FromGitter | <kayabaNerve> krux02 https://github.com/nim-lang/Nim/issues/8563 |
01:10:40 | FromGitter | <kayabaNerve> I'm stepping out now that I've raised attention to it :P Feel free to leave a comment. |
01:11:20 | FromGitter | <kayabaNerve> I do get your concerns. I just feel this can be reviewed quite quickly and either shut down or stated as a bug, and if it's a bug, it's good I raised the issue. |
01:12:09 | krux02 | I can tell you it is not a bug |
01:12:14 | krux02 | it is intentional |
01:12:35 | FromGitter | <kayabaNerve> 'bug' = unimplemented feature that should be implemented in that statement. |
01:12:42 | FromGitter | <kayabaNerve> Sorry for the bad term |
01:14:04 | krux02 | the most important part to get ready for a 1.0 release is to remove features that are not bullet proof. |
01:14:14 | krux02 | every new feature is therefore out of the question. |
01:16:00 | AlexMax | isn't nim getting rid of the gc? |
01:16:33 | FromGitter | <kayabaNerve> Whattttt |
01:16:36 | krux02 | it is getting rid of needing the gc |
01:16:41 | FromGitter | <kayabaNerve> Redoing/changing, not getting rid of lol |
01:16:47 | FromGitter | <kayabaNerve> *I think at leeast. |
01:16:50 | krux02 | so no it is not getting rid of the gc, just the need to have a gc |
01:16:55 | FromGitter | <kayabaNerve> It doesn't need the GC now IIRC. |
01:17:04 | FromGitter | <kayabaNerve> --gc:none :P |
01:17:04 | krux02 | it does need the GC |
01:17:32 | FromGitter | <kayabaNerve> To work fully? Yes. To work? No. I use it on an embedded system that can't even fit the MB the GC adds... |
01:17:59 | krux02 | there is a sublanguag that works with --gl:none but then you can just program in C directly |
01:18:04 | krux02 | seq and string won't work |
01:18:09 | krux02 | good luck with that |
01:18:42 | krux02 | but that is going to change |
01:19:03 | krux02 | so that seq and string will work and gc:none will be a very usable sublanguage |
01:21:55 | * | yglukhov[i] joined #nim |
01:25:15 | * | endragor joined #nim |
01:25:45 | FromGitter | <kayabaNerve> string will |
01:26:05 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
01:26:31 | FromGitter | <kayabaNerve> Nope; you're right |
01:26:32 | FromGitter | <kayabaNerve> NVM |
01:28:10 | * | Frogging10115 joined #nim |
01:29:29 | * | endragor quit (Ping timeout: 244 seconds) |
01:30:04 | * | Frogging10115 quit (Remote host closed the connection) |
01:57:42 | AlexMax | what the heck |
01:57:53 | AlexMax | I was going to use glad to generate an opengl.nim |
01:57:57 | AlexMax | but there's already an opengl.nim |
01:58:12 | AlexMax | and I can't even use glad out of the box because its initializer wants me to pass it an opengl loader |
02:10:18 | AlexMax | well...opengl seems to work okay |
02:11:04 | * | duoi5 joined #nim |
02:14:02 | * | a_b_m quit (Ping timeout: 256 seconds) |
02:15:59 | * | duoi5 quit (Ping timeout: 244 seconds) |
02:20:05 | * | dddddd quit (Remote host closed the connection) |
02:41:11 | * | yglukhov[i] joined #nim |
02:45:41 | * | felco11 joined #nim |
02:45:46 | * | yglukhov[i] quit (Ping timeout: 256 seconds) |
02:46:00 | * | felco11 quit (Remote host closed the connection) |
02:49:09 | * | stefanos82 quit (Quit: Quitting for now...) |
02:49:29 | * | NimBot joined #nim |
02:58:51 | * | mwbrown quit (Ping timeout: 240 seconds) |
02:59:11 | * | mwbrown joined #nim |
03:03:03 | * | endragor joined #nim |
03:11:05 | * | mwbrown quit (Ping timeout: 240 seconds) |
03:12:25 | * | rayman279 joined #nim |
03:12:51 | * | rayman22201 quit (Ping timeout: 240 seconds) |
03:22:02 | FromGitter | <gogolxdong> @PMunch ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6a61d674470f5c9863ca56] |
03:22:14 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6a61e55d1362758b48181a] |
03:22:51 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6a620bc917d40dc25846f5] |
03:23:08 | krux02 | AlexMax, sdl provides one |
03:23:15 | * | mwbrown joined #nim |
03:23:26 | krux02 | i use glad |
03:27:40 | * | sdegutis joined #nim |
03:27:49 | sdegutis | Hey congrats on the thing. |
03:29:38 | AlexMax | krux02: Yeah I realized that, but glad's nim generation seems like an almost afterthought |
03:35:15 | AlexMax | in fact, I'm getting that pit in my stomach where I realize that nim's bindings to popular libraries may or may not always be up to date |
03:35:30 | krux02 | i use it and it really is good enough |
03:35:52 | AlexMax | or may not even exist |
03:36:20 | AlexMax | or perhaps might not work very well on windows? maybe? |
03:37:35 | krux02 | what do you mean with "popular libraries" |
03:37:56 | krux02 | I use glad, that is a generator that works on the specificaiton |
03:38:05 | krux02 | so it is up to date as you want it to be. |
03:38:13 | krux02 | it is not perfect,though. |
03:38:24 | AlexMax | well, I'm making a mental checklist |
03:38:38 | AlexMax | I probably need an OpenGL-compatible GUI library |
03:38:45 | krux02 | but really it is good enough to serous work |
03:38:47 | AlexMax | so that means nuklear or imgui |
03:39:02 | AlexMax | Eventually I'm going to want a scripting language, so that means lua or duktape |
03:39:05 | krux02 | I wrote an ant tweak bar wrapper |
03:40:04 | krux02 | that is a gui librar, but a debug only gui library. |
03:40:42 | krux02 | you should know that almost all libraries you use, you have to partially maintain the wrapper on your own. |
03:41:03 | krux02 | That is the price you have to pay to use a Language with a very small community. |
03:41:17 | AlexMax | Yeah, it's a bummer |
03:41:30 | krux02 | there is no free lunch |
03:41:34 | krux02 | everything has a price |
03:41:52 | AlexMax | It's a balance, how much do I hate C++ vs how much harder are certain things going to be |
03:42:06 | krux02 | c++ is really a broken language by design |
03:42:26 | * | sdegutis quit (Remote host closed the connection) |
03:42:41 | krux02 | I never want to thing about optimizing compilation speed by optimizing headers |
03:42:41 | AlexMax | I really like some of the improvements that have been made to C++ in recent versions |
03:42:58 | AlexMax | but good lord, the langauge has always been complicated and it's only gotten worse |
03:43:00 | krux02 | yea c++ has nice features |
03:43:11 | krux02 | that doesn't fix the N^2 compilation speed problem |
03:43:17 | AlexMax | C++11 and later is...tolerable. Barely. |
03:43:26 | AlexMax | C++98...forget about it. |
03:43:34 | krux02 | I think there is a compilation server for c++ that cashes the templates |
03:44:12 | krux02 | but if you don't use that specific compiler, then your compilation speed will be horrible especially if you use templates |
03:44:28 | krux02 | then c++ has no reflection |
03:44:32 | krux02 | and it has no macros |
03:45:00 | krux02 | so nim really is a more powerful language than c++ |
03:45:35 | FromGitter | <DanielSokil> macros are awesome |
03:46:13 | krux02 | I try keep emotions aside |
03:46:34 | krux02 | macros just allow to do things that would not be possible without them |
03:47:22 | krux02 | for example they allow me to translate Nim code to glsl |
03:47:29 | krux02 | so i can write everything in just nim |
03:47:47 | krux02 | including shaders |
03:49:25 | FromGitter | <gogolxdong> Is there a lib to read hardware information of a machine? |
03:49:40 | krux02 | what do you mean |
03:49:48 | FromGitter | <DanielSokil> ^ |
03:49:50 | krux02 | that is operating system stuff |
03:49:58 | krux02 | so I wold check in os |
03:50:17 | krux02 | when it is not there, maybe you have to actually invoke the operating system |
03:50:19 | FromGitter | <gogolxdong> like network bandwidth. |
03:51:13 | krux02 | lspci is a command line program on linux |
03:51:30 | krux02 | that lists that I have a Gigabit ethernet controller |
03:51:49 | FromGitter | <gogolxdong> know some commands , need it in Nim. |
03:52:02 | FromGitter | <DanielSokil> What is the major differences between Nim GC and Golang GC? |
03:52:33 | krux02 | go is designed around to have a gc |
03:52:41 | FromGitter | <gogolxdong> generally you mean a wrapper of such command? |
03:52:43 | krux02 | nim gc is designed to be optional |
03:52:54 | FromGitter | <DanielSokil> A lot of folks say Golang GC is slow, what makes Nim GC "High Performance". |
03:53:06 | krux02 | the gc is thread local |
03:53:10 | FromGitter | <DanielSokil> So you can also manually free if needed in Nim? |
03:53:19 | krux02 | meaning when the gc is invoked it is not stop the world, but stop the thread |
03:53:37 | krux02 | a thread that does not utilize the gc won't be stopped the the gc |
03:53:42 | krux02 | very real time important |
03:53:52 | krux02 | it means you can do gc stuff and be realtime |
03:54:19 | krux02 | gc stuff you don't manually free |
03:54:41 | krux02 | but you cann manually allocate and free |
03:54:55 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6a698f5d1362758b4843a3] |
03:55:07 | krux02 | I don stee gitter code posts |
03:55:21 | FromGitter | <gogolxdong> why does d exist after dealloc? |
03:56:28 | krux02 | just because memore has been freed for override doesn't mean that it actually contains any different value |
03:56:48 | FromGitter | <gogolxdong> what do you use to post? |
03:56:54 | krux02 | even in c when you free memory it usually still contains the same data |
03:57:05 | krux02 | you just may not access it any more |
03:57:13 | krux02 | ix |
03:57:15 | krux02 | ix.io |
03:57:17 | FromGitter | <DanielSokil> So basically Nim is truly concurrent. |
03:57:46 | krux02 | nothing is "truely" something |
03:58:00 | krux02 | there are just things that are better and things that are worse |
03:58:37 | krux02 | I pesonally don't like GC, because the more memory you have and the more threads you have they become worse |
03:59:12 | krux02 | but for web fuzz they still do a good enough job |
03:59:28 | krux02 | that is why web fuzz is still heavy into GC languages. |
04:00:15 | FromGitter | <DanielSokil> It's great that exercism.io has Nim exercises. |
04:00:47 | krux02 | it really doesn't matter what language you use for programming challenges |
04:01:25 | krux02 | just do python challenges in Nim |
04:01:48 | krux02 | I used to make python challenes in scala and was pretty happy about it |
04:01:59 | FromGitter | <gogolxdong> http://ix.io/1jBC |
04:02:22 | FromGitter | <DanielSokil> `Exercises for Programmers: 57 Challenges to Develop Your Coding Skills Book by Brian P. Hogan` ⏎ Great Book! |
04:03:15 | FromGitter | <gogolxdong> Does this work with --gc:none ? |
04:03:31 | krux02 | don't know |
04:03:37 | krux02 | does it use seq or string? |
04:03:52 | krux02 | does it use seq, string or any ref type? |
04:04:08 | krux02 | if yes, then no |
04:04:16 | krux02 | and vice versa |
04:04:30 | FromGitter | <gogolxdong> it's http://ix.io/1jBC |
04:04:40 | krux02 | but the seq string dependency is going to change |
04:04:41 | FromGitter | <gogolxdong> has a string field. |
04:05:01 | krux02 | the code is wrong btw |
04:05:30 | * | sdegutis joined #nim |
04:05:33 | sdegutis | Hi |
04:05:41 | FromGitter | <gogolxdong> this is what I'm asking. |
04:05:44 | krux02 | sizeof(t) is only the size of a pointer, so 8 bytes, not 16 bytes as you need |
04:06:03 | krux02 | it just works by accident |
04:06:08 | krux02 | sdegutis, hi |
04:06:18 | FromGitter | <NOP0> Hi, will nim have higher kinded types? Thanks |
04:06:25 | krux02 | remove tho ptr before object |
04:06:43 | sdegutis | How is Nim's runtime interfacing with Objective-C types/classes? |
04:06:48 | FromGitter | <gogolxdong> ok , what makes it 16 bytes? |
04:06:53 | krux02 | I am honestly surprised that your code even compilers |
04:07:09 | krux02 | I didn't know that you can use the identifier type for the t argument |
04:07:14 | krux02 | this is really strange |
04:07:32 | FromGitter | <gogolxdong> yes, you can too. |
04:07:42 | krux02 | and if I would work for the language I would just remove that feature from the languae |
04:07:57 | krux02 | it should be typedesc |
04:08:11 | krux02 | but anyway |
04:08:39 | krux02 | I don't even know whay you declare that operator, there is one already predefined in system.nim |
04:09:50 | krux02 | it is called create |
04:11:32 | FromGitter | <gogolxdong> don't know the difference between type and typedesc |
04:11:43 | FromGitter | <gogolxdong> saw them both in Nim. |
04:12:38 | FromGitter | <gogolxdong> removed ptr and field of d is accessible after deallocate. |
04:13:22 | FromGitter | <gogolxdong> http://ix.io/1jBG |
04:14:36 | * | krux02 quit (Ping timeout: 256 seconds) |
04:22:13 | * | nsf joined #nim |
04:25:05 | * | sdegutis quit () |
04:30:55 | Tanger | Anybody here used the einhart unit testing library and wanna weigh in on it compared to the unittest lib? |
04:31:05 | * | Lildirt joined #nim |
04:32:54 | * | Lildirt quit (Remote host closed the connection) |
04:49:51 | * | gangstacat quit (Quit: Ĝis!) |
05:00:31 | * | gangstacat joined #nim |
05:27:42 | * | leorize quit (Ping timeout: 256 seconds) |
05:28:08 | * | bitstoppa joined #nim |
05:30:07 | Araq | gogolxdong: please use --gc:regions instead of --gc:none |
05:30:24 | Araq | they are much easier to work with and support the full Nim language |
05:31:10 | * | bitstoppa quit (Client Quit) |
05:31:21 | Araq | NOP0: we don't need them as much as Rust does as generics are only checked strickly at instantiation time |
05:31:28 | Araq | in Nim. |
06:05:59 | FromGitter | <gogolxdong> yes, --gc:regions works , does it mean ptr uses gc:regions? |
06:07:19 | * | leorize joined #nim |
06:09:33 | FromGitter | <gogolxdong> found --gc:regions works the same with --gc:stack. |
06:10:43 | * | yglukhov[i] joined #nim |
06:13:21 | leorize | isn't --gc:regions just --gc:stack renamed? |
06:15:05 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
06:16:50 | leorize | Araq: Nim doesn't support global nimscript as configuration :( (I'm alaviss on github) |
06:17:10 | FromGitter | <gogolxdong> Is there any solution to record the realtime network traffic and the bandwidth? |
06:17:30 | leorize | the code relating to that part seems simple enough though, would you mind if I add that feature? |
06:24:55 | FromGitter | <gogolxdong> in Nim. |
06:31:05 | * | Vladar joined #nim |
06:43:15 | FromGitter | <gogolxdong> found a c snippet.http://ix.io/1jC6 |
06:43:24 | * | yglukhov[i] joined #nim |
06:48:21 | * | leorize quit (Ping timeout: 240 seconds) |
06:58:01 | * | leorize joined #nim |
07:05:56 | shodan45 | whoa. just saw the status.im thing. |
07:06:18 | shodan45 | that's fairly huge. :) |
07:12:37 | FromGitter | <gogolxdong> how to import and preprocess <net/if.h> in nimgen? |
07:13:37 | * | shodan45 quit (Ping timeout: 248 seconds) |
07:17:24 | * | shodan45 joined #nim |
07:26:43 | * | kline4 joined #nim |
07:30:29 | * | kline4 quit (Remote host closed the connection) |
07:34:48 | * | PMunch joined #nim |
07:45:15 | FromGitter | <mratsim> Nimcache changes ! https://github.com/nim-lang/Nim/commit/ef9dd464668d08520bdcd549836b4a7551e3b601 |
07:52:07 | FromGitter | <gogolxdong> What does that mean? |
07:53:40 | FromGitter | <gogolxdong> ok ,I tried |
07:53:53 | FromGitter | <gogolxdong> it moves .nimcache to ~/.cache |
07:54:25 | FromGitter | <gogolxdong> which keeps project clean. |
07:58:57 | * | abm joined #nim |
08:04:07 | * | gmpreussner joined #nim |
08:04:35 | * | gmpreussner_ quit (Ping timeout: 240 seconds) |
08:26:50 | * | HYP3RBOR3A joined #nim |
08:47:41 | * | HYP3RBOR3A quit (Quit: Leaving) |
08:55:08 | * | dfgg27 joined #nim |
08:55:42 | * | dfgg27 quit (Read error: Connection reset by peer) |
09:05:51 | * | leorize quit (Ping timeout: 240 seconds) |
09:14:40 | * | dddddd joined #nim |
09:17:44 | * | Schroeder5 joined #nim |
09:18:03 | * | Schroeder5 quit (Remote host closed the connection) |
09:23:15 | * | miran joined #nim |
09:27:29 | * | TheLemonMan joined #nim |
09:37:30 | copygirl | When I'm trying to do `quote do: setForegroundColor(`sevColor`)` where `sevColor` is an enum, it gets inserted as a literal int. |
09:37:41 | copygirl | util/log.nim(24, 23) Error: type mismatch: got <int literal(30)> |
09:37:59 | copygirl | Is there something I'm doing wrong or something I have to do to make it work? |
09:42:17 | TheLemonMan | cast it? |
09:42:45 | TheLemonMan | I think that's the same VM problem that turns `bool`s into `int`s |
09:46:06 | copygirl | Thanks, `setForegroundColor(cast[ForegroundColor](`sevColor`))` works. |
09:58:49 | TheLemonMan | I think you may also use "`sevColor`.ForegroundColor" or "ForegroundColor(`sevColor`)" to avoid the forced cast |
10:00:03 | * | sielicki joined #nim |
10:06:04 | * | sielicki quit (Ping timeout: 256 seconds) |
10:09:35 | * | ng0 joined #nim |
10:10:44 | * | ng0 quit (Client Quit) |
10:11:12 | * | ng0 joined #nim |
10:11:17 | * | ng0 quit (Client Quit) |
10:11:28 | * | ng0 joined #nim |
10:11:29 | * | chemist69 joined #nim |
10:12:56 | FromGitter | <mratsim> @copyGirl: use Color(`sevColor`) |
10:13:27 | FromGitter | <mratsim> similar to what I do here: https://github.com/status-im/nimbus/blob/master/nimbus/vm/interpreter_dispatch.nim#L190 |
10:14:52 | * | kambiz25 joined #nim |
10:15:18 | chemist69 | Hi, I am trying to cross-compile on Linux for Windows with the following line (that worked the last time I tried, some months ago): nim --os:windows --cpu:amd64 --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc c myprog.nim |
10:15:24 | chemist69 | Now I get this error: [...] /bin/sh: 1: x86_64-w64-mingw32-gcc.exe: not found |
10:15:30 | chemist69 | Since I am cross-compiling on Linux, why would Nim look for a .exe file? |
10:15:42 | * | kambiz25 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
10:16:06 | chemist69 | This happens on the latest devel version. |
10:16:56 | Araq | because Nim thinks that thing has an .exe extension |
10:17:21 | chemist69 | How can I tell Nim that it doesn't? |
10:22:11 | copygirl | @mratsim Thank you, will do! |
10:29:46 | Yardanico | chemist69, there's an issue for this IIRC |
10:30:03 | Yardanico | https://github.com/nim-lang/Nim/issues/8081 |
10:37:02 | * | data-man joined #nim |
10:39:31 | chemist69 | Thanks, Yardanico, I'll keep an eye on that. |
10:49:58 | copygirl | Using macros, how would you pass varargs through to another function? |
10:51:05 | copygirl | Both `quote do: styledWriteLine(stdout, `m`)` and `result.add(newCall(bindSym"styledWriteLine", bindSym"stdout", m))` result in an error. |
10:51:32 | copygirl | `Error: type mismatch: got <File, varargs[typed]> but expected one of: template styledEchoProcessArg(f: File; color: BackgroundColor)` |
10:51:39 | * | leorize joined #nim |
10:51:43 | Araq | macros.unpackVarargs ? |
10:54:07 | copygirl | What's the usage? The documentation is missing both description and example code. |
10:55:12 | FromGitter | <mratsim> just use `[]` if you need to pass a single arg |
10:55:24 | Araq | it's "intuitively obvious" how to use it ... ;-) |
10:55:44 | Araq | unpackVarargs(f, args) --> |
10:55:51 | Araq | f(arg1, arg2, ... argN) |
10:56:17 | FromGitter | <mratsim> if you need to buidl a new varargs parameter you should use nnkArgList by the way, using nnkBracketExpr will have issues. (had type issues typically) |
10:57:28 | * | rwg23 joined #nim |
10:58:09 | * | rwg23 quit (Remote host closed the connection) |
11:00:36 | Araq | huh, deja-vu |
11:00:46 | Araq | nnkArgList is not even documented |
11:09:14 | FromGitter | <mratsim> it should, I had to discover once in Arraymancer and rediscovered it in loop fusion because otherwise I was loosing getTypInst information: https://github.com/numforge/loop-fusion/commit/9d9dc9fc04f1b6f8e702a16b92cad9243a0a67b9 |
11:09:23 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
11:09:56 | FromGitter | <mratsim> `array[N, typed]` loses getTypeInst info versus `varargs[typed]` |
11:10:45 | FromGitter | <mratsim> or no, forces same type iirc |
11:10:56 | copygirl | I guess you can't do `unpackVarargs(f, arg0, args)` ? |
11:12:21 | FromGitter | <mratsim> you can just `for arg in arg0: f.add arg` and do the same for args no? |
11:15:31 | * | aguspiza joined #nim |
11:17:30 | FromGitter | <mratsim> btw Araq, I think this can be closed: https://github.com/nim-lang/Nim/issues/5868 I have no crash |
11:22:35 | copygirl | Yeah I can I was just hoping there's a prettier way to do this ^^ |
11:27:54 | * | noonien joined #nim |
11:39:38 | FromGitter | <mratsim> you can always rename that fold or reduce ;) |
11:58:05 | Yardanico | https://github.com/ba0f3/uibuilder.nim |
11:58:57 | * | BitPuffin joined #nim |
11:59:47 | copygirl | Another thing I found curious... does cpuTime() not advance if the process is paused? Like on breakpoint when debugging? |
12:10:37 | FromGitter | <mratsim> It counts time spent in the process, I don’t know if gdb time is counted as it is |
12:11:52 | FromGitter | <mratsim> this is called monotonic clock |
12:12:04 | FromGitter | <mratsim> this is different from real time |
12:12:20 | * | a_b_m joined #nim |
12:15:42 | * | abm quit (Ping timeout: 256 seconds) |
12:24:21 | * | aguspiza quit (Ping timeout: 240 seconds) |
12:26:12 | dom96 | oh boy the comments sure are negative on The Register https://forums.theregister.co.uk/forum/1/2018/08/07/nim_funding_ethereum_cryptocurrency/ |
12:27:42 | Yardanico | dom96, and some commentators are wrong |
12:27:45 | Yardanico | "FOO_BAR and fooBar are equivalent..." they are not |
12:27:54 | FromGitter | <mratsim> at one point this comment was also in the negative: https://www.reddit.com/r/programming/comments/95ce7n/statusim_partners_with_the_team_behind_the/e3shk7j/?context=10000 |
12:27:59 | Yardanico | fOO_BAR and fooBar are equivalent, but not FOO_BAR |
12:28:13 | dom96 | yeah, but saying "Well, they're not equal, but fOO_BAR and fooBar are" will make them rage even more |
12:28:54 | * | floppydh quit (Remote host closed the connection) |
12:28:56 | dom96 | mratsim: Thanks to me it no longer is :P |
12:29:25 | FromGitter | <mratsim> I don’t understand how the copypasta comment has so much vote, what does it even mean >_> |
12:29:29 | FromGitter | <mratsim> and thanks =) |
12:29:41 | * | floppydh joined #nim |
12:29:51 | FromGitter | <mratsim> This one is funny: "Perl, by comparison, combines the speed of Python, the readability of Lisp and the extensibility of C…" |
12:33:44 | FromGitter | <mratsim> but anyway, those foobar comments are just bikeshedding. I wouldn’t mind changing it before v1 though |
12:34:03 | FromGitter | <mratsim> could be a top article on HN :P |
12:34:39 | miran | i get it why people are confused and hating it. but what i don't get is - whitespace-hate |
12:35:19 | * | a__b__m joined #nim |
12:38:19 | dom96 | The ship has sailed on style insensitivity |
12:38:21 | dom96 | It's staying |
12:38:37 | dom96 | IMO the same people that still hate significant whitespace also hate "difference" |
12:38:57 | * | a_b_m quit (Ping timeout: 248 seconds) |
12:39:11 | dom96 | It seems to me like they are just working based on feeling and an entrenched opinion that they formed by working with the same crappy languages for decades |
12:46:00 | euantor | you mean I can't write all of my program on one line? I'm out |
12:56:00 | FromDiscord | <awr> hi, i see that the default nimcache location has changed on devel, it puts it in the home folder somewhere |
12:56:09 | FromDiscord | <awr> is there any way i can change it back to the way it was? |
12:56:20 | Calinou | I wish it was just in the XDG cache directory :( |
12:56:26 | Calinou | (and in %TEMP% on Windows) |
13:00:15 | FromDiscord | <awr> also wrt style i think people extremely underestimate how quickly you get used to the flow of nim's syntax |
13:01:13 | euantor | I believe you can set the nimcache directory throuh config, based upon https://github.com/nim-lang/Nim/commit/ef9dd464668d08520bdcd549836b4a7551e3b601#diff-4294909b2a39378c268aacf6d0736474R490 |
13:01:35 | FromDiscord | <awr> when I first started using nim I was a bit annoyed that I couldn't auto-indent anymore like in C++ but as it turns out that's not that big of a deal |
13:02:42 | FromDiscord | <awr> also thank you |
13:07:46 | * | endragor quit (Remote host closed the connection) |
13:19:22 | livcd | I did not check but hopefully aggressive-indent-mode would work with Nim :O |
13:21:06 | FromDiscord | <awr> eh i can live without it |
13:21:10 | * | wildlander joined #nim |
13:21:59 | FromDiscord | <awr> spacemacs tried to do auto-indent on paste with nim code and i just found it annoying so i turned it off |
13:22:55 | FromGitter | <kaushalmodi> livcd: aggressive-indent-mode won't work. Also the nim-mode does auto indentation very well |
13:24:21 | FromDiscord | <awr> Those comments on The Guardian article - lol |
13:24:57 | FromDiscord | <awr> Programming culture is often far too reactionary and not nearly as reflective as it should be |
13:30:51 | livcd | kaushalmodi: ok thx |
13:31:43 | livcd | I switched to VSCode for Nim anyway..wanted the out of the box experience for Nim |
13:42:34 | FromGitter | <Varriount> awr: Reflection tends to be inefficient, and increases binary size too much. :P |
13:45:46 | FromDiscord | <libman> vscode or vim FTW. I hope to switch back to the latter. |
13:45:54 | FromDiscord | <awr> lol |
13:46:51 | FromGitter | <data-man> Only the SublimeText is true editor! :-) |
13:49:02 | FromGitter | <mratsim> @Calinou, I’ve suggested that to Araq instead of hardcoding but I’m not sure if Nim can access env variable: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html “$XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used." |
13:49:30 | Araq | it's called "freedesktop". Nim is not a desktop application. |
13:53:21 | ehmry | freedesktop is a consipracy to destroy linux with stupid standards |
13:54:29 | FromGitter | <kungtotte> I don't get people's problems with style insensitivity nor significant whitespace. People are already indenting their code consistently and if they aren't then that's a them problem. So what does it matter that the language enforces it? I also commented a while ago re: style insensitivity on reddit or HN: if your code breaks because foobar and fooBar are considered the same variable your code is already broken! |
13:56:15 | FromGitter | <mratsim> @ehmry, yes but at least with standards you know that destruction is consistent ;) |
14:01:25 | * | Trustable joined #nim |
14:03:17 | ehmry | I'm fine with it, no sense fighting the redhat |
14:04:39 | * | nsf quit (Quit: WeeChat 2.2) |
14:09:58 | copygirl | Are internal errors ones I should be reporting? |
14:10:00 | copygirl | https://gist.github.com/copygirl/811c025807053db7fa2a78c68f895db7 |
14:10:34 | Araq | please, yes. |
14:11:41 | copygirl | I also ran another one earlier, wish I knew how that one came about. |
14:16:21 | * | jdhorwitz joined #nim |
14:20:30 | * | leorize quit (Ping timeout: 256 seconds) |
14:26:17 | * | miran_ joined #nim |
14:26:21 | * | miran quit (Ping timeout: 240 seconds) |
14:27:05 | * | miran_ is now known as miran |
14:30:54 | zacharycarter[m] | https://blog.netbsd.org/tnf/entry/introduction_to_%C2%B5ubsan_a_clean |
14:33:43 | zacharycarter[m] | Anyone have any thoughts on this one - https://github.com/nim-lang/Nim/issues/8535 ? LemonBoy suggested a possible solution, but it'd be nice to have other folks chime in as well. |
14:38:27 | * | PMunch quit (Quit: Leaving) |
14:38:39 | * | leorize joined #nim |
14:39:17 | Araq | zacharycarter[m], LemonBoy is quickly becoming an expert on the compiler's internals, trust him |
14:41:35 | FromGitter | <arnetheduck> well, the rule for matching identifiers with partial case sensitivity and ignoring underscores is arguably quite.. odd - specially bad when you're working on multiple code bases and languages and none of your standard tools work reliably any more ie grep or editor search) because someone got creative in naming their variables |
14:42:33 | leorize | Araq: why the reaction? https://github.com/nim-lang/Nim/pull/8542#issuecomment-411406540 :P |
14:49:59 | FromGitter | <alehander42> @Araq I have some strange crashes with incrSeqV2 |
14:50:31 | FromGitter | <alehander42> the weird thing is they happen with `-d:release` but not with debug flags: with debug flags all seems to work fine |
14:53:08 | * | ephemer0l_16 joined #nim |
14:54:40 | * | ephemer0l_16 quit (Remote host closed the connection) |
14:55:16 | Araq | alehander42: well I need something reproducible |
14:55:43 | Calinou | freedesktop standards can still be used on servers |
14:55:57 | Calinou | that's why there are fallbacks defined in the specification :) |
14:56:48 | Araq | maybe name them "linux standards" then. |
14:57:05 | Araq | standards that are misnamed to begin with are not particularly trustworthy. |
14:57:08 | Calinou | it's not the kernel's job to define those |
14:57:12 | Calinou | FreeDesktop isn't just for Linux :) |
14:57:25 | FromGitter | <alehander42> @Araq I couldnt easily make a small example, but e.g. if you `nim c test.nim` from https://github.com/zero-functional/zero-functional |
14:57:27 | Araq | right it's for Linux/BSD. |
14:57:30 | FromGitter | <alehander42> it crashes like that |
14:57:38 | FromGitter | <alehander42> but `nimd c test.nim` seems to work |
14:57:40 | Calinou | Freedesktop standards define standards for… free desktops |
14:57:50 | Calinou | (free as in freedom) |
14:57:56 | Araq | ok, so not for servers, got it. :P |
14:58:07 | Araq | or CLI apps |
14:58:12 | Calinou | well, it turns out it works well on servers too (for the most part, some standards don't make sense without a GUI) |
14:58:18 | federico3 | there are applications for OSX as well |
14:58:50 | Araq | OSX is its own OS, it doesn't need foreign standards |
14:59:11 | federico3 | and for windows as well actually |
15:00:46 | livcd | as long as i dont have to open too many electron apps.... |
15:00:52 | FromGitter | <mratsim> what is nimd? Nim Daemon? |
15:02:03 | FromDiscord | <Fiend> Where can I ask a stupid question about the language? My question doesn't seem to be big enough for a forum post. |
15:02:35 | FromGitter | <alehander42> welcome, feel free to ask here |
15:05:20 | FromDiscord | <Fiend> ``` |
15:05:21 | FromDiscord | <Fiend> var stuff:seq[string] = @["test1", "test2", "test3", "test4"] |
15:05:21 | FromDiscord | <Fiend> template `%` (x, y: untyped): untyped = contains(y, x) |
15:05:21 | FromDiscord | <Fiend> echo "test1" % stuff |
15:05:21 | FromDiscord | <Fiend> ``` |
15:05:21 | FromDiscord | <Fiend> this works but if I change % to "test" (any string like that) it stops working |
15:06:42 | FromGitter | <alehander42> you mean it shows false? |
15:06:52 | FromDiscord | <Fiend> it doesn't compile |
15:07:03 | FromDiscord | <Fiend> https://play.nim-lang.org/ here for example |
15:07:15 | dom96 | Please gist/pastebin your code btw |
15:07:30 | dom96 | Discord is relayed to IRC and vice versa |
15:07:36 | dom96 | So it's not easy to copy |
15:07:44 | dom96 | (and also you can spam our channel if you paste too much code) |
15:08:00 | Araq | yeah and only I am allowed to do that :P |
15:08:17 | FromDiscord | <Fiend> https://pastebin.com/tR6aaWWW |
15:08:48 | * | miran quit (Quit: Konversation terminated!) |
15:09:29 | Araq | there are no identifier operators in Nim. use "test1".test(stuff) |
15:09:49 | FromGitter | <mratsim> only a dozen or so symbols can be infix operators |
15:10:11 | Araq | echo "test1" in stuff # works out of the box |
15:10:23 | Araq | because 'in' is a keyword and 'test' is not. |
15:12:37 | FromDiscord | <Fiend> system module seems to have identifier operators so I thought I could create one too |
15:13:05 | FromGitter | <mratsim> those are special |
15:13:12 | FromGitter | <mratsim> you have to use the exact same name |
15:13:39 | FromGitter | <mratsim> but anyway there is `in` as an alias for infix contains |
15:16:24 | Araq | yeah system.nim is not special, it just happens to know Nim's infix keywords |
15:25:30 | FromDiscord | <Fiend> it feels a bit strange because I can use ***** for an operator and it works but I can't use an identifier |
15:25:41 | FromDiscord | <Fiend> it feels a bit strange because I can use `*****` for an operator and it works but I can't use an identifier |
15:27:48 | FromDiscord | <Fiend> I dunno how it was displayed in IRC I'm sorry... I meant that I can use multiple star symbols but not just any string |
15:28:17 | FromGitter | <mratsim> I think it makes parsing and static analysis much easier |
15:30:07 | FromGitter | <alehander42> infix named operators can be a bit confusing too |
15:34:24 | FromGitter | <NOP0> Will nim support higher kinded types? Thanks |
15:35:20 | FromDiscord | <Fiend> named operators are confusing but haskel's parsec feels somewhat great for example |
15:38:19 | * | abm joined #nim |
15:39:50 | * | a__b__m quit (Ping timeout: 256 seconds) |
15:40:18 | * | chemist69 quit (Quit: WeeChat 1.9.1) |
15:42:10 | Araq | NOP0: yes but they are far less important than they are in Rust |
15:43:37 | Araq | Fiend: Haskell can't be parsed without a symbol table and that's problematic for macro systems |
15:43:59 | FromGitter | <NOP0> Araq; Cool, what are they called in nim I want to read up on it |
15:44:14 | Araq | and frankly, Nim really is flexible enough in its syntax, arguably already too flexible. |
15:44:54 | Araq | NOP0: probably 'concept' is the keyword to look for |
15:45:53 | FromGitter | <NOP0> Btw how are they less important? |
15:46:32 | Araq | because generics are checked at instantiation time, not unlike C++, they are far more flexible out of the box |
15:47:31 | Araq | and yes, we know about the resulting problems, everything is a tradeoff. basing generics on a macro-like machinery when the whole point of nim is macros doesn't sound like a bad idea |
15:51:51 | * | leorize quit (Quit: WeeChat 2.2) |
15:52:15 | * | leorize joined #nim |
15:55:54 | * | ripdog8 joined #nim |
15:58:07 | * | ripdog8 quit (Remote host closed the connection) |
16:03:23 | FromGitter | <mratsim> cough *getTypeInst* cough :P |
16:05:17 | * | a_b_m joined #nim |
16:07:05 | * | a__b__m joined #nim |
16:08:04 | FromGitter | <tim-st> good to see that the language server protocol is on the list: https://github.com/nim-lang/langserver |
16:08:33 | * | abm quit (Ping timeout: 248 seconds) |
16:10:55 | * | a_b_m quit (Ping timeout: 244 seconds) |
16:11:21 | * | rayman279 quit (Quit: -a- Connection Timed Out) |
16:11:49 | * | nsf joined #nim |
16:13:00 | * | rayman22201 joined #nim |
16:13:02 | * | Jesin quit (Remote host closed the connection) |
16:13:04 | * | shodan45 quit (Remote host closed the connection) |
16:13:24 | * | shodan45 joined #nim |
16:14:41 | * | drazan quit (Remote host closed the connection) |
16:15:38 | * | data-man quit (Read error: Connection reset by peer) |
16:16:26 | FromGitter | <NOP0> Cool, thanks will check it out |
16:16:51 | FromGitter | <tim-st> (not usable yet) |
16:17:55 | * | data-man joined #nim |
16:28:05 | * | nathanj joined #nim |
16:46:52 | * | Guest4398718 joined #nim |
16:48:01 | * | Guest4398718 quit (Remote host closed the connection) |
16:54:54 | * | meowshten quit (Remote host closed the connection) |
16:55:12 | * | derlafff joined #nim |
17:00:02 | * | Jesin joined #nim |
17:04:58 | * | noonien quit (Quit: Connection closed for inactivity) |
17:13:23 | * | Trustable quit (Remote host closed the connection) |
17:21:28 | * | cryptocat1094 joined #nim |
17:23:05 | * | Immune joined #nim |
17:23:51 | * | Immune quit (Remote host closed the connection) |
17:27:53 | * | Sitri17 joined #nim |
17:33:21 | * | Sitri17 quit (Ping timeout: 240 seconds) |
17:37:55 | * | a__b__m is now known as abm |
17:44:10 | * | derlafff quit (Remote host closed the connection) |
17:44:27 | * | derlafff joined #nim |
17:52:53 | * | host joined #nim |
17:56:49 | * | justyns joined #nim |
17:57:10 | * | justyns quit (Remote host closed the connection) |
17:57:35 | * | host quit (Ping timeout: 240 seconds) |
18:07:38 | FromGitter | <kayabaNerve> krux02 Got something for you |
18:08:22 | FromGitter | <kayabaNerve> The summary on that issue to see if it's an unimplemented feature or outside the language spec. ⏎ "I guess it shouldn't be allowed in the language standard but is accessible through the stdlib." ⏎ sequtils.mapLiterals is the stdlib function. |
18:08:27 | FromGitter | <kayabaNerve> Thanks Araq for the answer. |
18:12:00 | * | stefanos82 joined #nim |
18:17:46 | * | yglukhov[i] quit (Remote host closed the connection) |
18:21:34 | Araq | everybody fine with removing isNil for strings/seqs and even disallowing 'nil' to be passed to 'string'? |
18:22:13 | Araq | it's not that you have much choice... :P I think it will make the language significantly better |
18:24:15 | stefanos82 | can't string be defaulted to ''? |
18:24:35 | Araq | that's implied |
18:25:09 | Araq | strings are "", not nil. (Though the implementation maps "" to nil in order to save an expensive allocation) |
18:26:05 | stefanos82 | I mean when you first create an empty string |
18:26:37 | Araq | what's the difference? |
18:27:08 | stefanos82 | I got confused. when you create an empty string, does it implicitly assigns it a "" as its value or nil? |
18:27:57 | Araq | var x: string # same as |
18:28:00 | Araq | var x: string = "" |
18:28:05 | * | rayman238 joined #nim |
18:28:08 | Araq | does that answer your question? |
18:28:09 | stefanos82 | awesome, just like Golang |
18:28:12 | stefanos82 | sure |
18:28:20 | stefanos82 | therefore, get rid of nil for string(s) |
18:28:27 | Araq | yup. |
18:28:45 | stefanos82 | what about C-strings though? |
18:29:25 | Araq | cstring can be nil or "", both values are converted to the "" Nim string |
18:29:43 | Araq | Nim's "" becomes cstring's "" |
18:30:18 | Araq | you can map Option[string] to nil then if nothing else suffices |
18:30:31 | stefanos82 | does Nim use pointer strings somewhere behind the scenes, where the magic takes place? |
18:30:31 | Araq | (it doesn't come up often) |
18:30:59 | Araq | sure, and in fact, --gc:destructors uses a different string implementation (this WIP) |
18:31:40 | stefanos82 | so, in that case a nil use is necessary or does it have a different type of mechanism to handle such things? |
18:31:57 | * | rayman22201 quit (Ping timeout: 240 seconds) |
18:33:56 | Araq | what do you mean? |
18:35:18 | stefanos82 | in the aforementioned case (--gc:destructors), does Nim needs to use nil behind the scenes or does it use a different logic to handle nil (NULL?) strings? |
18:35:35 | * | Jesin quit (Read error: Connection reset by peer) |
18:36:02 | Araq | hmm it uses a (len, payload) 2 word implementation |
18:36:03 | * | Jesin joined #nim |
18:36:09 | Araq | payload can be nil if len == 0 |
18:38:16 | stefanos82 | I see |
18:49:37 | * | Praise26 joined #nim |
18:49:57 | * | Praise26 quit (K-Lined) |
18:50:50 | * | rayman22201 joined #nim |
18:52:21 | * | rayman238 quit (Ping timeout: 240 seconds) |
18:52:42 | * | rayman217 joined #nim |
18:54:51 | * | rayman22201 quit (Ping timeout: 240 seconds) |
18:58:15 | * | DarkArctic_ joined #nim |
18:59:40 | * | msm9 joined #nim |
19:00:06 | * | msm9 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
19:01:56 | * | DarkArctic quit (Ping timeout: 244 seconds) |
19:03:43 | stefanos82 | it seems PHP channel got filled with vicious people today...I asked a simple, yet naive question and nearly get lynched! |
19:03:53 | stefanos82 | bloody hell man |
19:06:48 | Araq | can happen. |
19:06:59 | stefanos82 | it was so scary...anyway. |
19:08:17 | stefanos82 | btw Araq, I wanted to ask you: is there a way, much like YAML, to organize nim.cfg how a whole project should behave? |
19:08:19 | stefanos82 | for instance |
19:08:44 | stefanos82 | let's say I have the following project structure: bin, src, tests, misc |
19:09:11 | stefanos82 | inside src, tests, and misc I have individual nim.cfg for each directory that behaves differently from each other |
19:09:34 | stefanos82 | can't I have a central .cfg file that tells which directory takes what flags? |
19:11:20 | * | rayman217 quit (Read error: No route to host) |
19:11:34 | * | rayman22201 joined #nim |
19:14:14 | * | DarkArctic_ quit (Quit: Leaving) |
19:21:13 | Araq | I usually avoid a nim.cfg and use relative paths |
19:21:59 | Araq | that's where Nim is heading anyway, use pragmas, relative paths and no config |
19:22:06 | Araq | KISS |
19:22:14 | stefanos82 | very nice |
19:24:02 | * | rayman227 joined #nim |
19:25:56 | * | rayman22201 quit (Ping timeout: 256 seconds) |
19:29:02 | * | yglukhov[i] joined #nim |
19:34:01 | * | Sharker joined #nim |
19:34:18 | * | Sharker quit (K-Lined) |
19:41:24 | * | cryptocat1094 quit (Quit: WeeChat 2.2) |
19:55:02 | FromGitter | <data-man> I hope someday .cfg becomes .toml :-) (in the past month TOML v.0.5.0 was released. It's allowed dotted keys, hex, octal and binary integer formats, local Date-Time and other additions) |
19:55:37 | FromGitter | <kaushalmodi> > I hope someday .cfg becomes .toml ⏎ ⏎ +1 |
20:00:46 | FromGitter | <data-man> Currently only seven libs are v0.5.0 compliant: https://github.com/toml-lang/toml/wiki |
20:11:12 | Yardanico | we need to wait for a stable TOML release ;) |
20:11:14 | Araq | ugh, TOML is at version 0.5? |
20:11:28 | Araq | that immediately kills it for me |
20:11:44 | Araq | that and the fact it supports fucking octals. |
20:12:37 | FromGitter | <kaushalmodi> Thankfully it supports the same `0o` prefix for octals like Nim |
20:12:55 | FromGitter | <kaushalmodi> .. and not plain `0` prefix like Go and other langs |
20:19:31 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
20:42:39 | dom96 | lol |
20:48:17 | FromGitter | <data-man> @dom96: Why you "lolled"? :) |
20:49:08 | dom96 | at TOML discussion |
20:50:57 | * | nsf quit (Quit: WeeChat 2.2) |
20:53:03 | FromGitter | <Varriount> @kaushalmodi @rayman22201 I'm on the East coast. I've even met another Nim dev in-person (and not at a convention). |
21:03:55 | FromGitter | <metasyn> hello~ ⏎ ⏎ i'm giving a talk on nim lang at my company (Splunk) next week, just finished reading nim in action (nice work @dom96!) |
21:04:20 | FromGitter | <metasyn> i was curious if anyone could point me towards references, companies, or "production" examples of nim, since i'm positive lots of people will ask me about that |
21:05:50 | stefanos82 | @metasyn: give them this https://nim-lang.org/blog/2018/08/07/nim-partners-with-status.html |
21:06:41 | Araq | there also was a wiki page about companies that use Nim... |
21:07:19 | FromGitter | <metasyn> That is cool ^ I hadn't seen the status.im thing yet |
21:07:55 | stefanos82 | Araq: where exactly? https://github.com/nim-lang/Nim/wiki |
21:08:03 | stefanos82 | I can't find a direct link to it |
21:08:40 | * | derlafff quit (Remote host closed the connection) |
21:08:57 | * | derlafff joined #nim |
21:09:13 | stefanos82 | oh, down right corner |
21:09:43 | FromGitter | <metasyn> Oh very cool, that is exactly what I was looking for. |
21:10:01 | FromGitter | <metasyn> Thanks @araq / @stefanos82 |
21:10:09 | FromGitter | <metasyn> maybe splunk will be on there someday haha :) |
21:10:15 | stefanos82 | it will ;) |
21:19:58 | FromGitter | <kayabaNerve> I use nimscript... That said, in my FFI stuff, I use pragmas. I use nimscript to enable threads, force C++ over C/set opt size... |
21:20:42 | FromDiscord | <treeform> metasyn, thats in next to South Park?, can I come or its internal only event? |
21:23:13 | FromGitter | <metasyn> @treeform sadly this is an internal talk, but i doubt you'd be interested even so since i'm a total nim n00b :p |
21:24:56 | FromDiscord | <treeform> ok |
21:33:16 | * | NimBot joined #nim |
21:36:27 | * | wildlander quit (Quit: Konversation terminated!) |
21:42:22 | * | yglukhov[i] quit () |
21:43:45 | * | yglukhov[i] joined #nim |
22:03:27 | zacharycarter[m] | metasyn: any chance it could be recorded? |
22:03:38 | zacharycarter[m] | or is that out of the window as well since it's an "internal talk" |
22:04:30 | zacharycarter[m] | also - why toml? what is wrong with ini? |
22:04:59 | zacharycarter[m] | do you really need a markup langauge for config? the entire kubernetes world seems to use yaml and it's infuriating |
22:05:14 | zacharycarter[m] | or you could be like hashicorp and develop your own "programming language" for declaring configs |
22:05:14 | FromGitter | <kaushalmodi> zacharycarter: toml is a solution to that infuriation |
22:05:37 | FromGitter | <kaushalmodi> it's much simpler to parse. I mostly like it for its multi-line string syntax |
22:06:04 | zacharycarter[m] | well I can't change the kubernetes ecosystem :P |
22:06:20 | zacharycarter[m] | but I haven't had much grief with nim's ini config file format or nimscript |
22:06:39 | zacharycarter[m] | I guess a better question would be - what are deficiencies of Nim's current INI cfg file format and what would TOML add to the picture? |
22:11:35 | * | poxifide11 joined #nim |
22:13:04 | * | poxifide11 quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
22:15:03 | FromGitter | <metasyn> @zacharycarter - i will ask about sharing the recording. doesn't seem unreasonable to me |
22:22:38 | ldlework | toml is pretty nice |
22:25:00 | FromGitter | <kaushalmodi> zacharycharter: toml is well-spec'd, pretty tightly spec'd. It has data-types (you can expect certain fields to be only ints vs floats vs dates vs strings, etc). |
22:25:46 | FromGitter | <kaushalmodi> you can have arrays, arrays of arrays (called tables in toml) |
22:27:15 | FromGitter | <kaushalmodi> .. and for INI fans, it looks like it too: https://ptpb.pw/cg9R |
22:27:24 | * | dystopia_ joined #nim |
22:28:51 | * | dystopia_ quit (Remote host closed the connection) |
22:35:19 | * | WSPR14 joined #nim |
22:35:28 | * | WSPR14 quit (K-Lined) |
22:41:23 | zacharycarter[m] | hrm |
22:41:40 | zacharycarter[m] | metasyn: yay! |
22:42:03 | zacharycarter[m] | kaushalmodi: I guess if there is a desire / need for those features, than TOML might be a much better candidate than YAML |
22:49:56 | * | Vladar quit (Remote host closed the connection) |
22:53:52 | * | thomasross_ joined #nim |
22:55:56 | * | FromDiscord_ joined #nim |
23:01:47 | * | deepend- joined #nim |
23:02:18 | * | ldleworker joined #nim |
23:02:47 | * | thomasross quit (*.net *.split) |
23:02:48 | * | deepend quit (*.net *.split) |
23:02:48 | * | Lord_Nightmare quit (*.net *.split) |
23:02:49 | * | ldlework quit (*.net *.split) |
23:02:49 | * | cornfeedhobo quit (*.net *.split) |
23:02:49 | * | FromDiscord quit (*.net *.split) |
23:03:08 | * | Lord_Nightmare2 joined #nim |
23:04:09 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
23:04:21 | * | ven473 quit (Remote host closed the connection) |
23:04:45 | * | ven473 joined #nim |
23:13:25 | * | cornfeedhobo joined #nim |
23:13:31 | * | ldleworker is now known as ldlework |
23:41:43 | AlexMax | so |
23:41:43 | AlexMax | uh |
23:41:50 | AlexMax | this isn't necessary |
23:41:52 | AlexMax | int32(128)\ |
23:41:56 | AlexMax | ignore the \ |
23:42:04 | AlexMax | apparently I can just do this 128'i32 |
23:42:11 | AlexMax | and get an int32 literal |
23:54:23 | * | Jesin quit (Read error: Connection reset by peer) |
23:59:38 | * | Jesin joined #nim |