00:05:30 | * | vlad1777d quit (Ping timeout: 260 seconds) |
00:06:06 | * | couven92 quit (Quit: Client Disconnecting) |
00:07:40 | enthus1ast | sounds like a fun project piotrklibert |
00:09:49 | dom96 | nice! awesome project :) |
00:12:59 | * | yglukhov quit (Remote host closed the connection) |
00:19:07 | zachcarter | btw all - 7drl starts this weekend in case anyone is interested |
00:19:28 | zachcarter | I just finished creating bindings to http://foo.wyrd.name/en:bearlibterminal for Nim if anyone wants them |
00:20:09 | zachcarter | I should probably make a thread on the Nim forum - I’ll do that now |
00:22:24 | enthus1ast | too much cool things to try : ) |
00:27:07 | * | yglukhov joined #nim |
00:31:57 | * | yglukhov quit (Ping timeout: 260 seconds) |
00:34:18 | * | Snircle quit (Remote host closed the connection) |
00:42:44 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:53:18 | * | kafke joined #nim |
01:03:02 | * | yglukhov joined #nim |
01:07:25 | * | yglukhov quit (Ping timeout: 260 seconds) |
01:50:20 | * | yglukhov joined #nim |
01:55:00 | * | yglukhov quit (Ping timeout: 258 seconds) |
01:56:38 | * | Kingsquee joined #nim |
02:09:59 | subsetpark | zachcarter: I've been working on a Roguelike in Nim! |
02:10:08 | zachcarter | oh awesome! |
02:10:30 | zachcarter | have anything to share? |
02:10:38 | * | bjz joined #nim |
02:10:50 | zachcarter | also: are you using any libraries or writing everything yourself? |
02:11:07 | zachcarter | subsetpark: I’m currently working on a 2d game framework similar to libgdx for Nim |
02:11:24 | subsetpark | Honestly, I've just been using ncurses... |
02:11:47 | zachcarter | maybe a switch to bearlibterminal is in your future :) or my library when it’s a bit further along |
02:11:51 | subsetpark | It's pretty clunky but I don't know what the state of the art is. This is my first game |
02:12:02 | zachcarter | very cool :D |
02:12:08 | zachcarter | you should do 7drl! |
02:12:43 | zachcarter | I’m just going to work hard on my game library for 7 days :P |
02:13:12 | subsetpark | bearlibterminal looks rather heavy - it provides roguelike output inside of its own graphic buffer, right? |
02:13:46 | zachcarter | it uses immmediate mode OpenGL for rendering to my knowledge |
02:14:03 | zachcarter | I dug into the source code a bit at one point |
02:14:27 | zachcarter | it’s essentially a terminal emulator |
02:14:43 | zachcarter | which a lot of roguelikes end up using since ncurses is… well ncurses. |
02:14:57 | zachcarter | it’s also truecolor to my knowledge |
02:15:11 | subsetpark | Yes, I think that would feel like a betrayal to me... :) My roguelike origins are firmly in ASCII |
02:15:21 | zachcarter | oh you can still do ASCII with it |
02:15:33 | zachcarter | it’s meant for ASCII |
02:15:40 | zachcarter | it has a interface similar to ncurses |
02:15:54 | subsetpark | ah ok |
02:16:22 | zachcarter | https://gist.github.com/zacharycarter/61037bd748633c70d218e2f5e6001c53 |
02:16:40 | subsetpark | very neat |
02:16:59 | zachcarter | here’s a screenshot of one of the demos I ported to nim - http://i.imgur.com/apNqlbu.png |
02:19:18 | zachcarter | subsetpark: my friend notostraca and I, who maintains squidlib, have been talking about writing something for doing region encoding using bitsets |
02:19:31 | zachcarter | region encoding of on/off information |
02:19:43 | zachcarter | in Nim, probably using simd if we can |
02:22:33 | * | arnetheduck quit (Ping timeout: 260 seconds) |
02:22:45 | zachcarter | I used his havily for my map generator in java : |
02:22:56 | zachcarter | https://github.com/zacharycarter/mapgen |
02:25:56 | * | chemist69 quit (Disconnected by services) |
02:26:01 | * | chemist69_ joined #nim |
02:26:18 | * | yglukhov joined #nim |
02:29:46 | * | Nobabs27 joined #nim |
02:30:39 | * | yglukhov quit (Ping timeout: 258 seconds) |
02:56:19 | * | Nobabs27 quit (Quit: Leaving) |
03:02:13 | subsetpark | Yeah definitely seems like I might as well give it a shot... |
03:07:50 | zachcarter | if you have any questions I can help you |
03:09:10 | zachcarter | subsetpark ^ |
03:09:31 | subsetpark | Awesome thanks :) |
03:10:05 | zachcarter | np! |
03:10:11 | zachcarter | I love procgen / roguelikes |
03:10:45 | zachcarter | I plan on doing a lot of procgen in my game |
03:13:53 | * | yglukhov joined #nim |
03:18:33 | * | yglukhov quit (Ping timeout: 260 seconds) |
03:31:45 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
03:38:40 | * | yglukhov joined #nim |
03:39:32 | * | jackv quit (Quit: ZNC - 1.6.0 - http://znc.in) |
03:41:30 | * | jackv joined #nim |
03:43:17 | * | yglukhov quit (Ping timeout: 260 seconds) |
03:56:38 | * | brson quit (Quit: leaving) |
04:32:47 | * | jabb joined #nim |
04:33:00 | jabb | http://ideone.com/H6TPVa regarding this. why must i unref the string? |
04:41:20 | * | bjz joined #nim |
04:57:33 | zachcarter | almost done with version 1.0 of the public API for these nuklear bindings |
05:00:36 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
05:45:43 | * | Pisuke quit (Read error: Connection reset by peer) |
05:46:52 | * | Pisuke joined #nim |
05:54:51 | libman | Excellent zachcarter. Looking forward to finding the time to try them. |
05:55:02 | zachcarter | https://gist.github.com/zacharycarter/f426e503d15f967e480fb33230273639 |
05:55:16 | zachcarter | everything is wrapped with a nimian proc now |
05:55:25 | zachcarter | I still have to fix return types to not be int32 and bools instead |
05:55:53 | zachcarter | libman: I’ve been using them in my own project, they’ve been working well |
05:57:52 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
05:58:14 | zachcarter | hopefully someone can help with portng over some more examples from nuklear |
06:09:49 | * | shashlick quit (Ping timeout: 260 seconds) |
06:10:17 | * | shashlick joined #nim |
06:33:26 | * | Lord_Nightmare joined #nim |
06:45:19 | * | nsf joined #nim |
07:03:18 | zachcarter | or whoever wrote tables :P |
07:08:58 | zachcarter | whoops wrong chat haha |
07:16:17 | * | ofelas quit (Remote host closed the connection) |
07:16:34 | * | ofelas joined #nim |
07:43:35 | * | abeaumont quit (Ping timeout: 264 seconds) |
08:17:02 | * | zachcarter quit (Quit: zachcarter) |
08:17:22 | * | rokups joined #nim |
08:27:46 | * | Andris_zbx joined #nim |
08:40:55 | * | libman quit (Quit: Connection closed for inactivity) |
09:02:44 | * | PMunch joined #nim |
09:16:41 | * | Arrrr joined #nim |
09:16:41 | * | Arrrr quit (Changing host) |
09:16:41 | * | Arrrr joined #nim |
09:21:33 | * | Vladar joined #nim |
09:22:43 | * | yglukhov joined #nim |
09:36:04 | * | vendethiel joined #nim |
09:36:29 | * | couven92 joined #nim |
09:47:18 | * | bjz joined #nim |
10:16:01 | * | GustavoLapasta joined #nim |
10:27:52 | * | libman joined #nim |
10:42:04 | * | yglukhov quit (Remote host closed the connection) |
10:46:09 | * | yglukhov joined #nim |
10:54:14 | * | yglukhov quit (Remote host closed the connection) |
10:56:12 | * | bjz_ joined #nim |
10:58:13 | * | bjz quit (Ping timeout: 260 seconds) |
10:58:56 | * | yglukhov joined #nim |
11:00:25 | * | yglukhov_ joined #nim |
11:03:09 | * | yglukhov quit (Ping timeout: 240 seconds) |
11:04:45 | * | yglukhov_ quit (Ping timeout: 260 seconds) |
11:05:09 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
11:09:44 | * | yglukhov joined #nim |
11:16:41 | PMunch | I'm trying to work with xlib and when getting the value from the WM_CLASS atom I get "two consecutive null terminated strings" |
11:16:48 | PMunch | I also get the length of the total data |
11:17:06 | PMunch | Obviously when I cast this to a Nim string I get the first of the two strings |
11:17:26 | PMunch | And it's length is obviously lower than the total length of the data |
11:17:42 | PMunch | But I'm struggling to get the second string |
11:17:48 | PMunch | s2 = $(cast[cstring](classPtr+(s1.len))) |
11:18:04 | PMunch | Tried that but to no avail, I get a Illegal storage access error when I try to run it |
11:18:20 | PMunch | Same if I just try to get the second character by doing cast[char](cast[ptr cuchar](classPtr+1)[]) |
11:18:55 | PMunch | Getting the first character with cast[char](classPtr[]) works fine |
11:21:21 | Araq | hmm seems ugly, but correct |
11:24:37 | * | ofelas quit (Read error: Connection reset by peer) |
11:24:49 | PMunch | Hmm, now I'm trying to copy it into an array |
11:25:11 | * | ofelas joined #nim |
11:27:30 | PMunch | http://ix.io/nSB |
11:27:35 | PMunch | Why doesn't that work? |
11:27:56 | PMunch | It just prints a bunch of newlines |
11:31:05 | PMunch | Never mind, it was to,from; not from,to |
11:36:38 | * | yglukhov quit (Remote host closed the connection) |
11:37:50 | * | yglukhov joined #nim |
11:41:51 | PMunch | Hmm, it really doesn't like to access the middle of a memory address |
11:41:58 | PMunch | copyMem(characters.addr,cast[ptr cuchar](classPtr+s1.len),classLen) also fails |
11:44:52 | PMunch | http://ix.io/nSF that works, but it is limited to the length you define for your array.. |
11:49:47 | PMunch | http://ix.io/nSG arguably still a hack but that also works and is not as limited |
11:50:16 | * | GustavoLapasta quit (Quit: Leaving) |
11:51:37 | PMunch | http://ix.io/nSH less of a hack, but still a bit annoying that I just can't get the offset directly |
11:55:12 | PMunch | Aha! This: http://ix.io/nSL works. So it seems that I just couldn't add to a pointer directly, but casting it to an int, add to it, then cast it back to a ptr works |
12:00:46 | * | yglukhov quit (Remote host closed the connection) |
12:02:26 | * | yglukhov joined #nim |
12:02:29 | * | yglukhov quit (Remote host closed the connection) |
12:02:30 | * | Snircle joined #nim |
12:04:57 | * | yglukhov joined #nim |
12:07:38 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
12:10:14 | * | Ven joined #nim |
12:10:23 | * | bjz joined #nim |
12:10:50 | Araq | yeah but I assumed you had an overloaded + for this :P |
12:11:04 | * | elrood joined #nim |
12:11:10 | Araq | how can it crash and not compile at the same time? |
12:12:17 | PMunch | Ah, no I was just using the regular +. And all the above code compiles |
12:12:23 | PMunch | Just crashes when I run it |
12:12:38 | Araq | classPtr+s1.len is not valid Nim code |
12:12:45 | Araq | what is classPtr's type? |
12:12:51 | PMunch | ptr cuchar |
12:14:06 | PMunch | echo classPtr+5 |
12:14:07 | Araq | Error: type mismatch: got (ptr cuchar, int) |
12:14:07 | Araq | but expected one of: |
12:14:07 | Araq | proc `+`(x, y: float32): float32 |
12:14:09 | Araq | … |
12:14:10 | PMunch | That compiles and runs fine |
12:14:43 | Araq | var classPtr: ptr cuchar |
12:14:43 | Araq | echo classPtr + 5 |
12:14:49 | Araq | doesn't compile here |
12:15:15 | PMunch | This is with {.experimental.} and I have a bunch of converters. But none of them from "ptr cuchar" |
12:15:28 | PMunch | http://ix.io/nSO <- converters |
12:15:35 | Araq | .experimental does auto deref for you :P |
12:15:47 | PMunch | Aah |
12:16:03 | PMunch | Oh yeah, without it I get a compilation error |
12:16:15 | PMunch | I'm using it for wxWidgets |
12:16:39 | Araq | I see. too bad I can't see a good solution for this problem |
12:17:26 | PMunch | The best "fix" would probably be to rewrite the wxWidgets wrapper |
12:17:33 | PMunch | Or rather to write an abstraction layer |
12:17:44 | Araq | C++ interop pretty much requires .experimental |
12:17:56 | Araq | because of the 'this' pointer mess |
12:20:17 | PMunch | What's the alternative? |
12:20:26 | PMunch | After all my wxWidgets code is generated from my macro |
12:20:39 | PMunch | So I could build it into the macro |
12:21:21 | Araq | perhaps. but this feature of .experimental should become the default too |
12:21:57 | Araq | so the problem that 'ptr cuint + number' compiles persists |
12:25:24 | PMunch | Hmm, then it's an issue |
12:25:48 | PMunch | Maybe define a + for ptr and numbers? |
12:26:11 | PMunch | Or wait, that would blur the line for what intPtr+5 did |
12:26:32 | * | zachcarter joined #nim |
12:27:24 | zachcarter | morning all - I was introducing Nim to a buddy last night and he pointed out some inconsistencies in Nim that I didn’t have answers to |
12:29:06 | zachcarter | why is there like <literal>.newSomething and <literal>.toSomething, specifically in the tables module when these patterns aren’t present throughout the rest of Nim? usually a ref is created with the new keyword |
12:29:56 | zachcarter | or addr |
12:30:04 | krux02 | well yea, there are inconsistencies |
12:30:12 | krux02 | I realized it on my own |
12:30:30 | krux02 | but that is something I even introduced in my own code without knowing it |
12:31:05 | zachcarter | yeah I know it’s easy to do, I think he was more wondering just - why like is there any underlying reason or is it something that has just occurred in the language and is it going to be addressed at any point? |
12:31:13 | krux02 | in C++ I had the convention, to add methods toSomething to a class, |
12:31:28 | krux02 | a newSomething fits in more for a free function |
12:31:57 | krux02 | and without really realizing it, I just applied it to nim |
12:32:01 | zachcarter | ah okay |
12:32:26 | krux02 | but there I can interchange methods (meaning dot call syntax) and free functions arbitrarily |
12:32:33 | zachcarter | right |
12:32:34 | PMunch | Probably (hopefully) going to be addressed at some point |
12:32:37 | krux02 | I changed a few times and wonder what is better |
12:32:41 | FromGitter | <dom96> No underlying reason, just an inconsistency. It should be renamed to initTable. |
12:32:54 | PMunch | There have been mentions of renaming stuff in the standard library |
12:33:05 | FromGitter | <dom96> Well, maybe Araq has a reason |
12:33:13 | FromGitter | <dom96> But I am not aware of one |
12:33:27 | zachcarter | okay cool - I’ll let him know thank you for the explanation guys :D |
12:33:34 | krux02 | dom96 not sure if initTable is better, because init is usually used to initialize an object that is already allocated, where new and create also allocate it |
12:33:53 | zachcarter | I think a table literal would be nice |
12:34:32 | Araq | {"key": "value"}.toTable() ? |
12:34:41 | zachcarter | that’s the inconsistency we’re talking about Araq |
12:34:50 | zachcarter | why the need for toTable? |
12:35:05 | zachcarter | or newTable |
12:35:18 | Araq | because there is the problem of ordered vs unordered tables |
12:35:31 | Araq | if you do it like Python, you copy Python's big mistake |
12:35:43 | krux02 | what does python do? |
12:35:46 | zachcarter | I hadn’t thought / considered this |
12:36:22 | Araq | we don't copy other's mistakes, we make completely new mistakes in Nim :-) |
12:36:31 | zachcarter | :P |
12:37:04 | Araq | ok, so the question is why 'toTable' and not 'initTable' |
12:37:11 | krux02 | well there is also the way how c++ can do things |
12:37:14 | zachcarter | here was his question |
12:37:19 | zachcarter | verabtim in IRC last night |
12:37:33 | zachcarter | jab: {"haha": "bar"} seems to be syntactic sugar for [("haha": "bar")] |
12:37:33 | zachcarter | [01:35am] jab: which is just an array |
12:37:35 | zachcarter | [01:35am] jab: i'm seeing some inconsistencies |
12:37:36 | zachcarter | [01:35am] jab: <literal>.newSomething |
12:37:38 | zachcarter | [01:36am] jab: <literal>.toSomething |
12:37:39 | zachcarter | [01:36am] jab: and then all the new, etc keywords to create references |
12:37:40 | zachcarter | [01:36am] jab: TableRef/Table |
12:37:41 | zachcarter | [01:36am] jab: vs SomeObj, Some |
12:37:51 | * | Ven quit (Ping timeout: 258 seconds) |
12:38:11 | krux02 | I personally think the definition of TableRef is completely redundant |
12:38:16 | zachcarter | this spawned these questions |
12:38:17 | zachcarter | jab: why not just a real literal for table? |
12:38:18 | zachcarter | [01:38am] jab: and is newFoobar a common theme |
12:38:19 | zachcarter | [01:39am] jab: and when should i use the naming pair: Foo/FooObj vs FooRef/Foo |
12:38:40 | krux02 | ref Table is one character more, and it has the advantage that it does not need to be defined |
12:38:56 | zachcarter | for the last question I pointed him to - https://nim-lang.org/docs/nep1.html |
12:38:57 | Araq | well you cannot be "consistent" if the problem domain forces you to do the 'ref object' vs 'object' tradeoff |
12:39:12 | * | yglukhov quit (Remote host closed the connection) |
12:39:14 | Araq | the semantics are not "consistent" to begin with. |
12:39:28 | Araq | so it would be a mistake to conflate these two too much, IMO. |
12:40:10 | * | Ven joined #nim |
12:40:29 | * | BitPuffin|osx joined #nim |
12:41:00 | Araq | so the question is why is toTable not called initTable? because I think of it more as a type conversion than a type construction. |
12:41:19 | Araq | but I suppose you're right and it's pointlessly inconsistent. |
12:42:23 | * | tankfeeder joined #nim |
12:43:17 | * | yglukhov joined #nim |
12:43:21 | flyx | well in C++ a constructor is by default an implicit type conversion. not saying that C++ does anything right. |
12:43:48 | flyx | there seems to be little difference between the two. |
12:43:59 | Araq | yeah but that's just nuts and you have to type 'explicit' to avoid it |
12:44:06 | * | yglukhov quit (Read error: Connection reset by peer) |
12:44:24 | krux02 | flyx only when it has exactly one argument and does not have an ``explicit`` tag |
12:44:32 | * | yglukhov joined #nim |
12:44:34 | flyx | I know the details. |
12:44:52 | krux02 | what I do like is the initializer list |
12:45:01 | flyx | just wanted to point out that conversion vs construction is blurry |
12:45:16 | Araq | yeah, excellent point. |
12:45:17 | krux02 | and that would map pretty well to openArray in Nim |
12:45:17 | flyx | because in fact, you always construct a new copy |
12:45:52 | * | yglukhov quit (Read error: Connection reset by peer) |
12:45:54 | zachcarter | good point flyx |
12:46:01 | krux02 | proc table[Key,Value](openArray[tuple[Key,Value]]) |
12:46:11 | * | yglukhov joined #nim |
12:46:41 | flyx | krux02: well that's almost what toTable() does |
12:47:02 | flyx | or, rather, exactly |
12:47:39 | krux02 | yes, I just think the to prefix should be avoided at all |
12:47:48 | krux02 | the package is called tables |
12:47:52 | krux02 | the type is called Table |
12:48:00 | krux02 | so table is a nice way to construct it |
12:48:07 | krux02 | it also looks more declarative |
12:48:32 | Araq | it should also look expensive because it is :P |
12:48:48 | zachcarter | $table |
12:48:54 | zachcarter | $$$table |
12:49:03 | flyx | heh |
12:49:11 | Araq | that said, I don't think I use toTable anywhere in my code |
12:49:26 | zachcarter | I don’t either - I think he was just digging for things to poke at in the language |
12:49:29 | krux02 | flx: oh yea, you are right XD |
12:49:31 | Araq | if I use a table, I don't know its contents |
12:49:51 | Araq | so why would the "default" constructor be burdened with a rare use case |
12:50:41 | * | yglukhov quit (Ping timeout: 260 seconds) |
12:51:23 | zachcarter | the only time I ever desire hash table literals is when I’m defining lookup tables |
12:51:57 | Araq | if we keep the initTable and newTable (and we should) the overloading makes sense since toTable only works with Table and not with TableRef, right? |
12:52:23 | Araq | so that would be an argument to change toTable to use the same names |
12:53:16 | Araq | zachcarter: I use arrays or a case statement when I know things at compiletime, I uses tables when I don't know it at compiletime |
12:53:36 | Araq | but then I very rarely have some "partial knowledge" of my key, value pairs |
12:53:50 | Araq | so toTable is mostly useless :-) |
12:53:58 | zachcarter | like for instance |
12:54:12 | FromGitter | <dom96> The reason that toTable should be called initTable is because we have two newTable procedures. |
12:54:25 | FromGitter | <dom96> We don't have a toTableRef |
12:55:21 | Araq | dom96: agreed. |
12:55:57 | zachcarter | actually nevermind, I don’t really have any cases at the moment where I’m using tables like that |
12:56:04 | FromGitter | <dom96> Hrm, I guess I should change ``newTable`` in my Nim reference to ``initTable`` |
12:56:36 | FromGitter | <dom96> @Araq: glad you agree :) |
12:56:49 | zachcarter | he had another question |
12:57:05 | zachcarter | http://ideone.com/H6TPVa |
12:57:09 | krux02 | well the tables litteral, even though it is acutally a rare use case in real code, it is very important in the process to learn how tables work |
12:57:24 | zachcarter | I pointed him to the last bit of - https://nim-lang.org/docs/gc.html |
12:57:37 | krux02 | throw away code that is just written to try out the hevariour of tables is full of toTable([...]) |
12:57:39 | zachcarter | not sure if I was correct in doing so |
12:58:03 | * | yglukhov joined #nim |
12:58:34 | zachcarter | jab: i have a ptr type with a member to GC |
12:58:34 | zachcarter | [11:32pm] jab: i free the ptr, i can see why the reference is untraced so i need to manually remove it BUT, why isn't it freed in the first place? |
12:58:51 | zachcarter | I was thinking his use of alloc0 ? |
13:00:39 | krux02 | what is with alloc0? |
13:00:55 | * | libman quit (Quit: Connection closed for inactivity) |
13:00:59 | Araq | ptr type with GC member requires an unpaired GC_unref() call, not sure our docs cover that -.- |
13:01:09 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:01:11 | * | yglukhov quit (Remote host closed the connection) |
13:01:15 | krux02 | it can be replaced with ``create``, but that doesn't clear what he is trying to say |
13:01:19 | Araq | I'm also not sure that is tested |
13:01:23 | * | yglukhov joined #nim |
13:01:31 | krux02 | zachcarter, what is the problem with that code, and what is it supposed to do? |
13:01:51 | Araq | in general ptr type to GC'ed memory is *rare* and once I thought the compiler should warn about this combination |
13:01:54 | zachcarter | # tell the GC that the string is not needed anymore: not sure why???? |
13:01:54 | zachcarter | GCunref(d.s) |
13:02:03 | zachcarter | wondering why the GCunref is necessary |
13:02:19 | zachcarter | gotcha thank you Araq |
13:02:35 | Araq | actually. |
13:02:37 | * | Arrrr quit (Ping timeout: 240 seconds) |
13:02:41 | Araq | I think this part of the manual is wrong. |
13:02:48 | Araq | thanks for pointing it out. |
13:03:01 | zachcarter | I’ll forward your thanks onto jab |
13:03:13 | zachcarter | I’ve been trying to get him in here… he’s west coast US so time zones don’t exactly marry up wel |
13:03:16 | zachcarter | well* |
13:03:17 | Araq | actually the GC_unref needs to be paired |
13:03:21 | Araq | with GC_ref |
13:03:28 | zachcarter | okay |
13:03:29 | Araq | for this example to work. |
13:04:10 | * | yglukhov quit (Remote host closed the connection) |
13:04:44 | Araq | bbl |
13:04:50 | krux02 | well ten hours difference for me |
13:06:58 | zachcarter | yeah exactly : |
13:07:47 | krux02 | Araq: Would you accept a pull request, that allows setLen to work on nil strings/seq types as long as the the default of seq/string vars is still nil? |
13:08:44 | krux02 | setLen is rarely called, therefore for performance it hardly makes a difference |
13:09:44 | krux02 | it would just render the proc newSeq(var self; len: int) redundant |
13:10:35 | * | yglukhov joined #nim |
13:19:14 | FromGitter | <endragor> `s.setLen(n)` crashing when `s` is `nil` makes more sense to me than silently doing nothing |
13:20:06 | krux02 | endragor: I am not talking about silently doing nothing, I am talking about to create a new seq of that lenth |
13:20:53 | krux02 | http://ix.io/nSV |
13:22:55 | * | yglukhov quit (Remote host closed the connection) |
13:23:15 | * | yglukhov joined #nim |
13:24:05 | FromGitter | <endragor> ah, alright. I wouldn't mind that, unless there were reasons not to do that from the beginning. the `nil` case was thought out given that the doc explicitly mentions you shouldn't use setLen on `nil`. |
13:26:26 | * | yglukhov quit (Remote host closed the connection) |
13:30:10 | * | arnetheduck joined #nim |
13:31:01 | * | yglukhov joined #nim |
13:32:55 | krux02 | yes but that's inconsisten, because len on nil actually does work |
13:34:04 | FromGitter | <dom96> What's next? ``add`` on ``nil`` should also allocate a new string/seq for us? |
13:34:06 | krux02 | http://ix.io/nSW |
13:35:08 | FromGitter | <dom96> I don't think that `len` should work on `nil` in the first place. |
13:35:26 | FromGitter | <andreaferretti> I think it should :-) |
13:36:04 | FromGitter | <dom96> Why? |
13:36:05 | FromGitter | <andreaferretti> and arguably `add` on nil should allocate |
13:36:15 | FromGitter | <andreaferretti> because people are going to introduce errors |
13:36:16 | krux02 | I think nil on seq shouldn't be a thing in the first place |
13:36:22 | FromGitter | <andreaferretti> I agree |
13:36:26 | FromGitter | <andreaferretti> but since it is |
13:36:32 | FromGitter | <andreaferretti> we'd better treat it without crashing |
13:36:52 | FromGitter | <dom96> You should have the discipline to initialise your seq/strings instead of relying on these workarounds. |
13:37:11 | FromGitter | <andreaferretti> ah well, I do |
13:37:12 | FromGitter | <dom96> Which are just plain confusing a lot of the time. |
13:37:18 | * | yglukhov quit (Remote host closed the connection) |
13:37:19 | flyx | well wasn't the plan to make `not nil` default anyway? |
13:37:22 | FromGitter | <andreaferretti> but it is a safety for the cases when people don't |
13:37:26 | FromGitter | <andreaferretti> including me of course |
13:37:35 | FromGitter | <andreaferretti> safety ne |
13:37:37 | FromGitter | <andreaferretti> net |
13:37:49 | krux02 | flyx: yes, but it isn't yet |
13:37:52 | FromGitter | <dom96> It's better to crash and fix the bug than silently "work" and have a bug later in your program. |
13:38:08 | FromGitter | <dom96> (Which is harder to find) |
13:38:09 | krux02 | and for me "not yet" is a bit too far away in the future |
13:38:12 | FromGitter | <andreaferretti> that may also be a valid position |
13:38:27 | flyx | I side with dom96 on this one. |
13:38:43 | krux02 | dom96: well no |
13:38:58 | FromGitter | <dom96> flyx: yay :) |
13:39:19 | krux02 | dom96: the idea is that setLen is exalcly that, a perfect initialization |
13:40:25 | * | libman joined #nim |
13:40:45 | krux02 | I have serialization/deserialization code, and whenever I deserialize data into an object, I have to always put the branch in there: |
13:41:16 | krux02 | is s not nil: s.setLen(n) else: s.newSeq(n) |
13:42:07 | krux02 | all the time I write into a seq, I have to put this branch |
13:42:21 | FromGitter | <dom96> So why don't you refactor that into a function? |
13:42:47 | krux02 | because it should also work with an object that already exists, becaues it is semantically an assignment of serial data to an object |
13:42:58 | krux02 | dom96: I did |
13:43:05 | krux02 | I posted it |
13:43:10 | krux02 | http://ix.io/nSW |
13:43:26 | krux02 | sorry wrong one |
13:43:37 | krux02 | http://ix.io/nSV |
13:45:19 | krux02 | dom96: on the other hand what is the problem with when things just work? |
13:46:01 | FromGitter | <dom96> The problem is that this introduces a major inconsistency. |
13:46:19 | FromGitter | <dom96> Either we treat every ``nil`` transparently |
13:46:23 | FromGitter | <dom96> or we don't treat any |
13:46:40 | FromGitter | <endragor> ref types with value semantics already introduce a major inconsistency :-P |
13:46:59 | FromGitter | <dom96> Right now we are moving towards a situation where you have to remember that `len` will give you "0" when your seq is nil |
13:47:24 | FromGitter | <endragor> so some people are preferring to go towards "value" part of the seq/string semantics |
13:47:39 | FromGitter | <dom96> @endragor example? |
13:47:44 | FromGitter | <endragor> example of what? |
13:47:49 | FromGitter | <endragor> I mean the current discussion |
13:48:10 | krux02 | well I like to treat my seq like an std::vector, empty by default |
13:48:47 | krux02 | and I personally don't see the problem to treat nil as the general empty seq |
13:49:27 | FromGitter | <dom96> @endragor example of "ref types with value semantics", I guess you're saying that sequences have value semantics? |
13:49:28 | krux02 | an endragor already pointed out, seq is a ref type with value semantics |
13:49:51 | krux02 | and it doesn't make sense to have value semantic where you constantly have to check if something is nil or not |
13:50:13 | FromGitter | <dom96> What value semantics do seqs have? |
13:50:22 | krux02 | copy on assignment |
13:51:31 | krux02 | http://ix.io/nT0 |
13:52:50 | * | yglukhov joined #nim |
13:53:47 | * | hjsagg quit (Ping timeout: 264 seconds) |
13:53:57 | krux02 | http://ix.io/nT1 |
13:55:24 | krux02 | also treading nil just like an empty sequence is how the stb library works |
13:56:01 | krux02 | https://github.com/nothings/stb/blob/master/stretchy_buffer.h |
13:57:47 | krux02 | the entire thing fits in 70 lines of well readable C code |
13:59:10 | krux02 | ok well readable is an exaggeration, but it is very well structured |
14:00:18 | * | Salewski joined #nim |
14:00:41 | krux02 | dom96: do you have a use case, where you would want setLen to crash? |
14:00:49 | krux02 | (when it is nil) |
14:03:42 | Salewski | Short streams module question: |
14:03:51 | Salewski | import streams |
14:03:57 | Salewski | var s = newStringStream() |
14:04:08 | Salewski | s.write("aa bb cc dd"); s.setPosition(3) ;s.write("xx") |
14:04:12 | Salewski | echo s.data; s.close |
14:04:20 | Salewski | # output is "aa xx cc dd" # Is it possible to get "aa xx", something like s.setLen() ? |
14:04:27 | Salewski | done. |
14:05:14 | flyx | Salewski: well you can do setLen on s.data, but that would invalidate the pos |
14:05:34 | * | hjsagg joined #nim |
14:05:45 | Salewski | Yes, that was my fear! |
14:06:03 | krux02 | dom96: took me 5 minutes to find an example in the compiler, wher the setLen that works on nil would simplify the code |
14:06:57 | flyx | Salewski: write a proc cut(s: StringStream, at: int) = s.setPosition(at); s.data.setLen(at) |
14:08:01 | Salewski | flyx: OK, thanks. I was not sure if that would work, but I will try it. |
14:08:20 | flyx | Salewski: I am also not sure that it will work ;) |
14:08:29 | FromGitter | <dom96> krux2: I don't have a use case, I just don't want to end up confused just like I have been a couple of times because of 'len's new behaviour. |
14:08:47 | FromGitter | <dom96> If anything maybe we should initialise all sequences/strings when they are defined? |
14:09:38 | FromGitter | <dom96> To be honest, I have more of an issue with len's behaviour because I use it for debugging a lot. |
14:10:16 | * | yglukhov quit (Remote host closed the connection) |
14:10:44 | krux02 | dom96: I wrote some gdb scripts that embed in Nim that tell you all you need to know about a seq when you print it |
14:11:05 | * | yglukhov joined #nim |
14:12:39 | * | yglukhov quit (Remote host closed the connection) |
14:12:53 | * | yglukhov joined #nim |
14:13:43 | krux02 | it just has some problems, because I can not write a regular expression to detect sequence types |
14:17:25 | FromGitter | <dom96> I still primarily use ``echo`` for debugging |
14:24:39 | * | tankfeeder quit (Quit: Leaving) |
14:24:41 | * | yglukhov quit (Remote host closed the connection) |
14:25:05 | * | yglukhov joined #nim |
14:26:12 | * | yglukhov quit (Remote host closed the connection) |
14:26:41 | * | hjsagg quit (Ping timeout: 246 seconds) |
14:27:21 | * | yglukhov joined #nim |
14:29:33 | * | Salewski left #nim (#nim) |
14:31:25 | krux02 | dom96: do you do it, because debugging with gdb just doesn't work well enough? |
14:31:57 | * | yglukhov quit (Ping timeout: 260 seconds) |
14:33:13 | Araq | krux02: it never does for me and that's not because debuggers don't work. |
14:33:20 | Araq | er, I mean |
14:33:30 | Araq | and that's because debuggers don't work. |
14:33:59 | Araq | my programs fail at the Nth iteration, not at the first iteration. |
14:34:31 | Araq | so this means I need conditional breakpoints. these are slow and you have to type them without intellisense |
14:35:33 | Araq | it's code you type that is essentially free of tooling. no intellisense, no version control |
14:36:23 | Araq | so I insert 'if's into my code, not only 'echos' |
14:36:39 | Araq | and avoid debuggers. |
14:38:01 | Araq | it's very nice when you can attach a debugger later, to program that is about to crash / crashed :-) |
14:38:27 | cheatfate | Araq, you can but on windows only |
14:38:35 | cheatfate | just in time debugger |
14:39:38 | * | rauss joined #nim |
14:39:57 | FromGitter | <andreaferretti> you can in smalltalk as well :-) |
14:40:22 | Araq | or debuggers that support "go back in time", that's useful too. |
14:40:57 | Araq | but usually not available. |
14:41:17 | Araq | tried "undo GDB" once, never got it to work |
14:41:45 | Araq | (no "go back in time" doesn't mean to go back one assembler instruction...) |
14:49:53 | krux02 | cheatfate: you can attach gdb to running programs as well |
14:50:20 | krux02 | Araq: I use debuggers for much simpler things |
14:50:40 | krux02 | I use them to understand how code executes |
14:50:55 | krux02 | I want to visualize how the code executes and where it executes |
14:51:02 | krux02 | I want to see how it changes variables |
14:51:09 | krux02 | just to understand how code that I did not write works |
14:51:51 | krux02 | but that's just a horrible experience with command line debuggers like gdb |
14:53:39 | krux02 | and in visual debuggers it is hard in Nim, because most of them don't understand Nim at all |
14:54:34 | krux02 | Araq: what's do you think is the safest way to detect, if a type in GDB is a sequence type |
14:55:01 | krux02 | currently all I have is a regular experssion on the name "^TY_.*$" |
14:55:20 | krux02 | but that doesn't really work |
14:56:39 | krux02 | easiest for me would it be, when seq types had a tag in them, like "TY_seq_<hash>", then I could just add that to the regular expression |
14:57:24 | * | hjsagg joined #nim |
14:57:40 | cheatfate | krux02, but gdb can expand appropriate C type, so you can use this to get if this sequence or not? |
14:58:48 | Araq | krux02: patch the codegen then? |
14:59:05 | Araq | most codegen patches improve Nim's debugging support these days :-) |
14:59:30 | cheatfate | Araq, bad joke :) |
14:59:47 | cheatfate | name mangling don't improve debugging :) |
15:00:20 | Araq | name mangling is required for correctness, C doesn't support overloading or namespaces |
15:00:22 | krux02 | Araq: so you would be open to change the generated Name? |
15:00:29 | Araq | krux02: yeah |
15:00:48 | krux02 | ok, I get it. |
15:01:22 | cheatfate | Araq, and what happens if i declare type like mysuperseq[T] = seq[T] |
15:01:26 | krux02 | I won't send any pull request unless I actually have gdb support that actually also uses it |
15:02:11 | krux02 | weatfate: unless it is ``distinct`` it should not do anything different than seq[T] would generate |
15:02:14 | * | yglukhov joined #nim |
15:02:39 | krux02 | cheatfate: sorry for spelling your name incorrectly |
15:03:15 | cheatfate | so if distinct is specified, then this way with regexp of "TY_seq_<hash>" is broken? |
15:03:39 | Araq | no, it's not broken. the codegen removes 'distinct' |
15:05:12 | cheatfate | anyway i think its better to make dependency on generated C type. |
15:05:18 | cheatfate | not on name of type |
15:06:45 | * | yglukhov quit (Ping timeout: 260 seconds) |
15:07:22 | Araq | for enums and sets we need additional debugging info, the compiler has some (disabled) code for that |
15:10:10 | * | xet7 joined #nim |
15:12:33 | cheatfate | Araq, and now you need to generate better `syms` file :) |
15:13:00 | cheatfate | to include support for enums and sets :) |
15:13:21 | cheatfate | i told you `line format` is not a good way to doing it :) |
15:14:59 | Araq | you also told me to use a binary file format that nobody can parse without an API. |
15:15:06 | Araq | :P |
15:15:24 | federico3 | is there the "dual" of varargs? foo(i[0], i[1], i[2].....) |
15:16:19 | FromGitter | <andreaferretti> I am working on a slightly old program which used asynchttpclient |
15:16:39 | FromGitter | <andreaferretti> it seems that a certain point, `response.body` changed from synchronous to asynchronous |
15:16:52 | FromGitter | <andreaferretti> does anyone know when did this happen? |
15:16:55 | FromGitter | <andreaferretti> more or less |
15:17:02 | Araq | was a recent commit |
15:17:12 | FromGitter | <andreaferretti> after 0.16.2? |
15:17:17 | Araq | most recent commit to asynchttpclient |
15:17:24 | FromGitter | <andreaferretti> ok thank you |
15:17:26 | Araq | there is no 0.16.2 |
15:17:28 | FromGitter | <andreaferretti> I will have a look |
15:17:30 | FromGitter | <andreaferretti> uh |
15:17:42 | FromGitter | <andreaferretti> you're right |
15:17:51 | FromGitter | <andreaferretti> I was sure we were on 0.16.3 |
15:17:55 | FromGitter | <andreaferretti> go figure |
15:18:04 | Araq | yeah it's a tough problem, this change means we need to either revert it |
15:18:10 | Araq | or call it 0.17.0 |
15:18:25 | subsetpark | .17 makes the language sound more mature :) |
15:18:55 | Araq | subsetpark: we follow the tick-tock model of development though |
15:19:03 | subsetpark | oh yeah true |
15:19:04 | Araq | at least that's what I'm trying to do. |
15:19:10 | subsetpark | ok, 0.18.0 it is, agreedb |
15:19:14 | Araq | no lol |
15:19:32 | Araq | release with breaking changes, patch release |
15:19:39 | subsetpark | i'll submit to hacker news "Nim 0.18.0 released" and link to the GH repo |
15:19:44 | Araq | and then again release with breaking changes, patch release |
15:20:51 | Araq | there is however another bugfix that means old code stopped working. |
15:21:13 | Araq | the compiler got stricter with its effect system in combination with methods. |
15:23:45 | PMunch | I remember there was a way to jump out of nested for loops in Nim, but I've forgotten how I did it. Anyone? |
15:24:41 | * | hjsagg quit (Ping timeout: 268 seconds) |
15:27:10 | Araq | block foo: ... break foo |
15:27:19 | FromGitter | <andreaferretti> one more thing |
15:27:32 | FromGitter | <andreaferretti> I see there are a few shared data structures |
15:27:36 | FromGitter | <andreaferretti> sharedtable |
15:27:40 | FromGitter | <andreaferretti> and others |
15:28:00 | FromGitter | <andreaferretti> how do they work? do they allocate on the shared heap? are they threadsafe? |
15:28:13 | Araq | yes and yes |
15:28:15 | * | vlad1777d joined #nim |
15:28:39 | FromGitter | <andreaferretti> great! |
15:28:50 | FromGitter | <andreaferretti> why didn't I know? |
15:28:57 | FromGitter | <andreaferretti> they seem not to be mentioned anywhere |
15:29:02 | * | abeaumont joined #nim |
15:30:26 | * | zama quit (Quit: leaving) |
15:32:27 | * | zama joined #nim |
15:34:41 | * | yglukhov joined #nim |
15:36:10 | cheatfate | andreaferretti: we have only sharedtable... which is really slow |
15:37:36 | krux02 | locking shared data is slow |
15:37:53 | FromGitter | <andreaferretti> and sharedqueue I think? |
15:38:53 | * | nsf quit (Quit: WeeChat 1.7) |
15:38:53 | FromGitter | <andreaferretti> and sharedlist and sharedstring |
15:39:14 | cheatfate | we dont have sharedqueue |
15:39:33 | FromGitter | <andreaferretti> I see... but I think it used to be there |
15:39:40 | FromGitter | <andreaferretti> I saw it a few days ago |
15:39:51 | cheatfate | sharedlist and sharedstring of course uses same one lock algorithm |
15:40:01 | cheatfate | the only fast thing we have is lockfreehash |
15:40:32 | cheatfate | but i never tested it |
15:40:35 | krux02 | There should be a substitute for the Go channel |
15:40:56 | krux02 | and that should be the shared queue |
15:41:06 | Araq | agreed but I cannot do everything |
15:41:22 | Araq | it also needs to support async events |
15:41:22 | krux02 | ok, understood |
15:41:58 | Araq | though I'm a fan of dataflow variables |
15:42:23 | krux02 | what is a dataflow variable |
15:48:20 | Araq | a simple datastructure, you can write to it once and read from it as often as you like |
15:48:36 | Araq | reading blocks until the value is available |
15:48:57 | cheatfate | Araq, and this variable not uses lock? |
15:49:02 | Araq | no dataraces possible, deadlocks are deterministic |
15:49:25 | Araq | cheatfate: it does use a lock and condition variable under the hood |
15:49:47 | Araq | its value lies in its simplicity and safety. |
15:50:04 | cheatfate | so dataflow variable in array is pretty expensive? |
15:51:25 | Araq | yes. but you can use an array of "dataflow arrays" |
15:51:53 | Araq | the wrapped value doesn't have to be an atom, it can be an array |
15:51:58 | cheatfate | then this becomes `lock striping` |
15:52:01 | Araq | yes |
15:53:55 | * | mrPerro joined #nim |
16:00:38 | krux02 | I know that datastructure from Scala where it is called Future |
16:00:57 | krux02 | but it's everywhere |
16:01:11 | krux02 | I just didn't the the name dataflow variable |
16:01:36 | * | abeaumont quit (Ping timeout: 240 seconds) |
16:02:15 | Araq | Futures are more powerful and less safe |
16:02:41 | Araq | usually you can wait for Future 1 or 2 and then you introduce nondeterminism |
16:02:42 | krux02 | let file : Future[MyType] = future(parseFile("filename")) |
16:03:04 | krux02 | how? |
16:03:15 | Araq | await foo or bar |
16:04:03 | krux02 | and? then? |
16:04:31 | Araq | then you introduced non deterministic behaviour. |
16:04:50 | krux02 | I am not sure what your await structure essentially means |
16:05:06 | krux02 | does it mean it waits for one of them? |
16:05:10 | Araq | Nim's async await statement, for instance |
16:05:22 | Araq | yes, it means it waits for the 'or' |
16:05:29 | krux02 | ah, ok I haven't used that one yet |
16:06:32 | Araq | with strict dataflow variables you can't do it, you can only do read(foo) and then read(bar) |
16:06:33 | krux02 | ok, but isn't or always immediate? |
16:07:20 | krux02 | I did not understand your await example, it does not have read |
16:07:35 | krux02 | is both foo and bar a future? |
16:07:48 | krux02 | and if yes, whot does it mean to have an or of a future? |
16:08:12 | * | PMunch quit (Quit: leaving) |
16:08:19 | Araq | don't get lost in the details. |
16:08:52 | krux02 | Well I did not do a lot with futures, I just made file loading async |
16:09:07 | Araq | my point is: when the system allows for "wait for whatever comes first" then you introduced non-deterministic behaviour. |
16:09:25 | elrood | you could introduce a feature to check whether a dataflow variable access would block, to make futures and dfv likely powerful and safe ;) |
16:10:02 | krux02 | well yea it is nondeterministic, but but that is also the point of it, isn't it? |
16:10:22 | Araq | yes, and it's the point of a dfv to not allow this :P |
16:10:41 | * | Sembei joined #nim |
16:11:05 | krux02 | ok |
16:12:07 | krux02 | But I think scala's future are exactly what you call a dfv. |
16:12:20 | krux02 | I don't think they support wait for whatever comes first |
16:12:38 | krux02 | at least not when I programmed scala (in 2010) |
16:16:24 | * | SusWombat joined #nim |
16:16:36 | * | arnetheduck quit (Ping timeout: 240 seconds) |
16:17:52 | Araq | oh alright |
16:33:36 | * | Sembei quit (Ping timeout: 258 seconds) |
16:39:37 | * | vlad1777d quit (Ping timeout: 240 seconds) |
16:41:40 | * | vlad1777d joined #nim |
16:52:24 | * | brson joined #nim |
16:56:46 | * | Andris_zbx quit (Remote host closed the connection) |
16:57:46 | * | Sembei joined #nim |
17:04:21 | SusWombat | Hey guys i did discover nim yesterday and browsed the forums aswell. There was a discussion about the autocomplete not really working. Is this problem now solved? |
17:12:59 | Calinou | hi SusWombat :) |
17:13:11 | SusWombat | Calinou, Hi! |
17:13:15 | Calinou | SusWombat: usually, autocomplete works best in Visual Studio Code with the Nim add-on installed |
17:13:25 | Calinou | (VSCode is likely to be the best editor for doing Nim right now) |
17:13:32 | Calinou | (it's a very good editor for other languages too) |
17:13:44 | SusWombat | Well id prefer emacs but yeah vsc is fine |
17:14:16 | SusWombat | Calinou, now that i see you in here i kinda want nim bindings in godot :D |
17:20:12 | * | nsf joined #nim |
17:22:01 | * | kafke quit () |
17:28:46 | * | Arrrr joined #nim |
17:33:20 | * | Nobabs27 joined #nim |
17:36:18 | Calinou | yeah, me too |
17:42:12 | * | rokups quit (Quit: Connection closed for inactivity) |
17:43:21 | enthus1ast | godot looks kuhl |
17:44:00 | dom96 | Calinou: hey, any chance you could have a go at fixing that issue you saw on my version of the new website? |
17:45:00 | dom96 | (or give me pointers on how to do it? I'm a noob at pure grids) |
17:52:17 | enthus1ast | dom96: is the new website "mobile friendly"? |
17:52:33 | Calinou | enthus1ast: yes, it is |
17:56:31 | * | Trustable joined #nim |
17:58:09 | Calinou | dom96: the navbar fix is literally 1-line, if you want to keep a fixed navbar on all displays |
17:58:17 | Calinou | I'll see if I can make it fixed only on mobile devices, if that's your preference |
17:58:32 | dom96 | Calinou: I'd rather not have it fixed anywhere |
17:58:47 | dom96 | But I can live with it only on mobile |
17:59:03 | dom96 | The issue I am referring to is aligning the menu to the right properly |
17:59:10 | Calinou | non-fixed navbars don't make for good user experience on mobile, I find, because if you want to go to a page, you need to scroll all the way up |
17:59:53 | * | hjsagg joined #nim |
17:59:56 | dom96 | Yeah, I can understand that. |
18:00:12 | dom96 | So yeah, I'm happy with a fixed navbar on mobile. |
18:00:27 | Calinou | now, I made the navbar fixed on mobile, but static on desktop |
18:00:46 | Calinou | I'll look into the alignment issue |
18:01:32 | * | yglukhov quit (Remote host closed the connection) |
18:02:02 | dom96 | thanks |
18:04:23 | * | Sembei quit (Ping timeout: 256 seconds) |
18:06:20 | jabb | is there any way to avoid having to implement functions on an object for ref Object and var Object? |
18:06:50 | jabb | i see a common pattern in the stdlib is to just have a private Impl proc |
18:08:07 | dom96 | jabb: If you need reference semantics then you should use 'ref Object' exclusively |
18:08:22 | Calinou | whoa, I broke something in Firefox but not in Chromium |
18:11:09 | * | yglukhov joined #nim |
18:11:45 | Calinou | ok, fixed it in Firefox and Chromium |
18:11:52 | Calinou | I'm on Linux so I can't test Edge right now, will do later |
18:11:58 | Calinou | dom96: can I commit it to your branch? |
18:12:03 | dom96 | Calinou: sure. |
18:12:05 | Calinou | then merge the branch into master, if it's good to go |
18:12:24 | dom96 | No worries about Edge, we can run it through browsershots at the end (or whatever the popular service for that is nowadays) |
18:12:42 | dom96 | Feel free to merge into master. I will continue working inside that branch though |
18:12:49 | dom96 | There is still a lot to do |
18:14:01 | * | odc_ joined #nim |
18:15:14 | Calinou | browserstack is probably the service you're thinking about, they offer free licenses for open source developers I think :) |
18:15:29 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:15:41 | dom96 | Nope, http://browsershots.org/. |
18:15:46 | dom96 | I used it in the good old days |
18:16:43 | * | odc_ is now known as odc |
18:17:22 | Calinou | dom96: what's the merge strategy we use? Merge commits, squash and merge, or rebase? |
18:17:30 | dom96 | merge |
18:17:34 | Calinou | merge commits? |
18:18:57 | dom96 | yeah |
18:19:05 | dom96 | no squashing and no rebasing |
18:19:10 | Calinou | ok |
18:19:28 | * | yglukhov joined #nim |
18:19:29 | dom96 | Squashing in some circumstances (if it really is just a little change made over many commits) |
18:20:10 | jabb | Calinou, so anyone who wants to create the object on the stack will have to create a ref to call that proc |
18:20:13 | jabb | ? |
18:20:55 | jabb | urm, wait. my questio is ref and var both have "ref" semantics |
18:21:24 | jabb | https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/tables.nim#L121 here are two procs that have var Table, and ref Table |
18:21:33 | jabb | is there a way to avoid this duplication? |
18:22:06 | jabb | they're semantically the same. one just takes a reference to a stack object |
18:23:30 | dom96 | jabb: was that question directed at me? |
18:23:40 | jabb | anyone bwahaha |
18:23:41 | Calinou | ok, merged to master |
18:23:53 | Calinou | this is the first time I do branch merges using Git CLI, forgive me if I did something wrong :p |
18:23:58 | * | yglukhov quit (Ping timeout: 240 seconds) |
18:24:16 | Calinou | followed this: http://stackoverflow.com/questions/5423517/how-do-i-push-a-local-git-branch-to-master-branch-in-the-remote/5434370#5434370 |
18:24:29 | Calinou | I don't work with branches that often, I hope it's right |
18:24:53 | dom96 | jabb: You might be able to write: proc clear[A,B](t: var Table[A, B] | TableRef[A,B]) = ... |
18:25:53 | dom96 | Calinou: Looks good :) |
18:26:06 | jabb | var Table and TableRef are semantically the same. so it's weird there isn't an mechanism to encapsulate both |
18:26:09 | Calinou | ok :) |
18:26:38 | dom96 | Calinou: ProTip: A good way to check is by looking here: https://github.com/nim-lang/website/branches (if something went wrong then you wouldn't see '0|0') |
18:27:06 | Xe | did the nim site finally get moved out of the main repo? |
18:27:23 | dom96 | Xe: the new site is being developed in a new repo :) |
18:27:48 | Calinou | it's just a prototype (made using Jekyll) for now |
18:28:44 | dom96 | jabb: hrm, perhaps, although I have a feeling that there are some differences in semantics |
18:28:52 | Xe | dom96: nice, gonna be great to see nim2017 |
18:31:53 | jabb | dom96: the difference, in c++ terms, seems to be a one a pointer, the other is a reference |
18:32:51 | jabb | in c++, however, you don't have to deal with unified call syntax meddling with what functions can be called if a type is a ref, ptr, etc |
18:33:30 | jabb | go solves this with whatever you call the function with, it will be "morphed" into a reference or a value appropriately |
18:33:49 | FromGitter | <piotrklibert> @jabb about the ref and var types, I ran into this at some point and out of curiosity tried something like this: ⏎ ⏎ proc fT: ref SomeType | var SomeType (arg: T): t = ... ⏎ ⏎ and it seemed to work ok. But in the end I didn't need it. [https://gitter.im/nim-lang/Nim?at=58b8658cde5049082238c3d4] |
18:35:02 | jabb | why didn;t you need it? |
18:36:02 | FromGitter | <piotrklibert> Also, `type T = ref SomeType | var SomeType` also compiled and worked :) |
18:36:25 | jabb | they will have different assignment semantics |
18:37:47 | FromGitter | <piotrklibert> Ah, it was in the interpreter, about the object which held interpreter state. I allocated it once at the start and didn't need to allocate another one during runtime, so I settled for `var TclContext` everywhere. |
18:38:39 | jabb | that's application specific it sounds like, for a library maintainer you will have to cover both bases right? |
18:38:49 | * | Ven quit (Ping timeout: 260 seconds) |
18:40:59 | * | Ven joined #nim |
18:43:29 | FromGitter | <piotrklibert> It looks like it, looking at the collections/tables.nim at least. |
18:44:08 | * | abeaumont joined #nim |
18:46:24 | demi- | python used to be my go-to language for writing something quick and messy but now it is starting to be nim; which is exceptionally nice tbh |
18:50:20 | federico3 | is there the "dual" of varargs? foo(i[0], i[1], i[2].....) |
18:55:00 | federico3 | perhaps https://forum.nim-lang.org/t/1186#7312 |
18:57:46 | SusWombat | Hey guys :) I want to learn nim to use it to prototype a game using sdl2. Now my problem is there are 2 wrappers/bindings. Can anyone give me some input on which to use? (im also new to sdl) |
18:58:09 | * | Amun_Ra quit (Remote host closed the connection) |
18:58:43 | * | yglukhov joined #nim |
18:58:52 | * | Amun_Ra joined #nim |
18:59:46 | ldleworker | We should start an icon challenge in #nim-offtopic if you get the boilerplate going |
19:02:34 | * | Matthias247 joined #nim |
19:03:05 | * | yglukhov quit (Ping timeout: 260 seconds) |
19:11:56 | Araq | jabb: you can have 'var T' and use .experimental to get auto-deref on the first arg. but that can have surprsing results as zachcarter has shown us recently :-) |
19:20:44 | * | yglukhov joined #nim |
19:21:10 | * | couven92 quit (Read error: Connection reset by peer) |
19:23:58 | * | Ven quit (Ping timeout: 240 seconds) |
19:27:12 | * | Ven joined #nim |
19:31:51 | dom96 | SusWombat: This one is in the Nim-lang org so it's technically supported by us (nim devs) officially. https://github.com/nim-lang/sdl2 |
19:32:03 | SusWombat | dom96, ok thanks |
19:32:06 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
19:32:37 | * | scriptum joined #nim |
19:35:28 | * | abeaumont quit (Ping timeout: 240 seconds) |
19:44:03 | Vladar | SusWombat: and sdl2_nim is supported by me, has nice docs https://vladar4.github.io/sdl2_nim/ and a WIP game engine ;-) https://github.com/Vladar4/nimgame2 |
19:47:26 | dom96 | Vladar: Why the decision to write your own? :) |
19:48:26 | * | bjz joined #nim |
19:48:41 | Vladar | dom96: I started it before there was official available |
19:49:06 | dom96 | Vladar: oh. Our bad heh |
19:49:12 | dom96 | I wonder if we could merge our efforts. |
19:50:23 | demi- | yglukhov: any plans to update this (https://github.com/yglukhov/plists) to support binary plists? :) |
19:51:10 | yglukhov | demi-: not really. but prs are welcome ;) |
19:51:16 | demi- | :( |
19:52:21 | zachcarter | SusWombat: I’m also working on a cross-platform 2d | 3d game library ala libgdx for Nim, but it’s no wher enear ready for production |
19:52:52 | zachcarter | no where* |
19:53:32 | SusWombat | ok thanks guys! |
19:53:34 | zachcarter | but if you have any questions about sdl2 stuff I’m happy to help |
19:54:10 | dom96 | It's awesome to see so many people using Nim for games |
19:54:23 | zachcarter | dom96: agreed |
19:54:36 | Vladar | dom96: well two wrappers aren't so different, but sources structure is, and some structures too, like {.union.} for events |
19:54:39 | FromGitter | <barcharcraz> yeah it's really started to gain momentium in the last few months |
19:55:37 | Vladar | plus full documentation, of course |
20:01:13 | dom96 | well, I dunno. I'm not the primary user of either of these. |
20:01:26 | dom96 | yglukhov: you use the official one right? Any thoughts? |
20:04:15 | * | BitPuffin|osx joined #nim |
20:13:43 | yglukhov | dom96: dont really care. i use official because (a) its ok and (b) i can contribute to it in case it doesnt. no offense but i find it a (a) waste of time and (b) bad for nim ecosystem to provide several instances of pretty much the same thing. of course the "primary" maintainers should be accepting enough to encourage contribution. i really think that is the main mistake of D which didnt let it evolve when there was good time for it. |
20:14:01 | * | rauss quit (Ping timeout: 260 seconds) |
20:14:33 | dom96 | yglukhov: I agree, which is why I would like for Vladar's and nim-lang's repos to be merged. |
20:15:16 | * | nsf quit (Quit: WeeChat 1.7) |
20:15:42 | yglukhov | to even more outline this point of view, i have transfered ownership of my jnim repo to vegansk. because some time ago he told me he was working on the same thing but more advanced, so i thought it would be good to shut down my lib and start working together on a new one |
20:16:01 | * | rauss joined #nim |
20:19:46 | * | Arrrr quit (Read error: Connection reset by peer) |
20:20:25 | dom96 | that's brilliant :) |
20:21:26 | federico3 | can I detect if header is present at compile time and add a flag to the linker accordingly? |
20:22:28 | yglukhov | federico3: linker doesnt make use of headers. whats the relation? |
20:22:48 | FromGitter | <barcharcraz> well a specific header may require some linker flag |
20:23:01 | FromGitter | <barcharcraz> if you are to actually use it |
20:23:16 | yglukhov | just the fact that it exists doesnt imply it is used |
20:23:22 | yglukhov | =) |
20:23:58 | * | Ven quit (Ping timeout: 240 seconds) |
20:24:04 | federico3 | I need to pass -lsystemd to gcc :) |
20:24:08 | yglukhov | but yeah, you can refer to file system in compile-time, so it should be possible. also you can execute other programs. |
20:24:31 | * | babs_ joined #nim |
20:24:51 | yglukhov | federico3: so why not to check for libsystemd existance? |
20:24:54 | dom96 | I asked this a couple of days ago but didn't get any replies: anyone remember who managed to embed DLLs inside an exe and get the application to run? They created a macro for this not too long ago, but I can't remember who it was :\ |
20:25:10 | FromGitter | <barcharcraz> there was a security paper on it |
20:25:28 | FromGitter | <barcharcraz> it's not hard if you want to just extract them on first run and then run the exe |
20:25:39 | FromGitter | <barcharcraz> if you want to actually LOAD the dlls from memory it's quite hard |
20:25:45 | FromGitter | <barcharcraz> not impossible |
20:25:56 | FromGitter | <barcharcraz> but very system dependent and fickle |
20:26:07 | FromGitter | <barcharcraz> you essentially have to rewrite much of the dynamic loader |
20:26:16 | federico3 | yglukhov: I'm not sure where I can do the check and how to add that flag dynamically |
20:26:29 | FromGitter | <barcharcraz> let me see if I can find the paper dom96 |
20:27:03 | Araq | dom96: zachcarter iirc |
20:27:06 | dom96 | barcharcraz: probably not too difficult, but somebody here managed to do it so it would be much easier to just copy their code :) |
20:27:15 | FromGitter | <barcharcraz> https://github.com/fancycode/MemoryModule |
20:27:23 | * | Nobabs27 quit (Ping timeout: 264 seconds) |
20:27:30 | FromGitter | <barcharcraz> it's a good way to avoid your dll being scanned by security programs |
20:27:32 | * | Ven joined #nim |
20:27:41 | yglukhov | federico3: take a look at https://github.com/yglukhov/linktools |
20:27:56 | zachcarter | wasn’t me |
20:28:01 | dom96 | My motivation is to avoid having to deal with static libraries on Windows. It seems much easier to embed a DLL inside the exe. |
20:28:02 | zachcarter | not sure who it was |
20:28:09 | federico3 | yglukhov: very nice |
20:28:21 | dom96 | And I might even end up doing the same thing on macOS |
20:28:33 | zachcarter | it would be nice |
20:28:38 | FromGitter | <barcharcraz> I mean static libs do work on windows |
20:28:49 | yglukhov | nimble install it; and then just: when libHasSymbol("mylib", "mySymbol"): {.passL: "mylib".} |
20:28:57 | yglukhov | federico3 * |
20:28:59 | dom96 | I guess I'll need to look through the IRC logs to find it |
20:29:05 | Araq | dom96: I would avoid it |
20:29:10 | dom96 | Araq: why? |
20:29:30 | FromGitter | <barcharcraz> it will cause problems with anti-malware and various security things |
20:29:39 | FromGitter | <barcharcraz> for one thing |
20:29:48 | Araq | it might have unforeseen consequences |
20:29:59 | Araq | better use an exe packer |
20:30:02 | Araq | let's see |
20:30:05 | FromGitter | <barcharcraz> http://www.harmonysecurity.com/files/HS-P005_ReflectiveDllInjection.pdf |
20:30:27 | dom96 | but static linking is such a PITA :\ |
20:30:50 | FromGitter | <barcharcraz> I used to static link my nim execs |
20:30:53 | demi- | static linking is terrible :( |
20:31:48 | dom96 | I will need to link openssl and gzip at least |
20:31:58 | dom96 | And I bet I will need to compile them manually |
20:32:30 | federico3 | staticlinking openssl in? ouch |
20:32:37 | FromGitter | <barcharcraz> it can be done |
20:32:42 | FromGitter | <barcharcraz> I think I have done it |
20:32:46 | FromGitter | <barcharcraz> but yeah |
20:32:49 | FromGitter | <barcharcraz> it's not fun at all |
20:32:59 | * | xet7 quit (Quit: Leaving) |
20:32:59 | yglukhov | were doing it for android and ios |
20:33:07 | FromGitter | <barcharcraz> vcpkg has recipies to build static versions on windows |
20:33:16 | FromGitter | <barcharcraz> I think |
20:33:39 | federico3 | dom96: do you really need SSL to bootstrap the compiler? ;) |
20:33:54 | dom96 | federico3: Yes, in order to download the compiler. |
20:35:16 | federico3 | dom96: can the compiler downloaded over http instead? The "shim" can contain the checksum of the version is going to pull |
20:35:49 | FromGitter | <barcharcraz> I know curl for one can use winssl, mbedtls and many others |
20:35:53 | * | xet7 joined #nim |
20:35:54 | FromGitter | <barcharcraz> that are all easier to build on windows |
20:36:07 | FromGitter | <barcharcraz> winssl is not really "trusted" but it depends on your thread model |
20:36:20 | dom96 | federico3: It could be... but I also want to support builds from GitHub |
20:36:20 | * | Sembei joined #nim |
20:36:59 | * | BitPuffin|osx quit (Ping timeout: 264 seconds) |
20:37:00 | FromGitter | <barcharcraz> mbedtls would very likely be easier to deal with |
20:37:04 | FromGitter | <barcharcraz> on windows at least |
20:37:09 | FromGitter | <barcharcraz> I'm not sure about mobile |
20:37:14 | federico3 | dom96: if it's only a shim it can first download nim+nimble |
20:37:17 | dom96 | I think I might just risk unforeseen circumstances with the embedding of DLLs |
20:37:27 | yglukhov | why not use winapi to download? or even better, use winapi to implement sslcontext. or even more better, implement ssl in nim! =) |
20:37:41 | federico3 | like tripping antivirus checks? |
20:37:47 | dom96 | yglukhov: I would love to, all of that would take far too much time. |
20:37:49 | FromGitter | <barcharcraz> yglukhov: Nobody really trusts secure channel |
20:38:15 | federico3 | ssl in nim, hey!? |
20:38:22 | FromGitter | <barcharcraz> plz no |
20:38:47 | Araq | dom96: http://superuser.com/questions/42788/is-it-possible-to-execute-a-file-after-extraction-from-a-7-zip-self-extracting-a |
20:39:12 | Araq | it's rather complex to setup but at least it's all command line and so can be automated |
20:39:42 | Araq | and it might work on other OSes too with 7z, but not sure |
20:39:59 | FromGitter | <barcharcraz> trying to directly embed dlls may just get you straight up immediately blocked by some antivirus software |
20:40:27 | dom96 | Hrm, go's tls module is only like 300 LOC https://golang.org/src/crypto/tls/tls.go |
20:40:43 | dom96 | But I bet there are other modules that are larger |
20:40:51 | demi- | huh |
20:41:00 | dom96 | (which it depends on) |
20:41:08 | federico3 | dom96: but the crypto is implemented externally |
20:43:00 | Araq | there is even a youtube video of how to do that: https://www.youtube.com/watch?v=Gh7JDNT-Luc |
20:45:05 | * | couven92 joined #nim |
20:46:20 | Araq | http://7zip.bugaco.com/7zip/MANUAL/switches/sfx.htm |
20:46:33 | * | babs__ joined #nim |
20:46:48 | Araq | ^ use this and if you're stuck, try something else. but try this first. |
20:47:09 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:47:27 | dom96 | I dunno. |
20:47:37 | dom96 | It seems to me like this would have similar problems with AVs |
20:48:10 | Araq | AVs can deal better with this than with custom solutions. |
20:48:36 | * | babs_ quit (Ping timeout: 240 seconds) |
20:48:40 | dom96 | ok, well, we've got a couple of options in any case. |
20:48:55 | Araq | plus offering the same as a .zip file is easy enough when you setup 7z already |
20:49:42 | Araq | show some respect, I spent some time researching these things -.- for Nim's installer. |
20:50:51 | federico3 | yglukhov: oh, I can do {.passL: "...".} |
20:51:57 | dom96 | Araq: I appreciate your help! |
20:58:07 | * | kulelu88 joined #nim |
20:59:17 | * | shashlick quit (Ping timeout: 260 seconds) |
20:59:23 | * | Trustable quit (Remote host closed the connection) |
21:00:06 | * | shashlick joined #nim |
21:00:09 | cheatfate | just to clarify, if AV will signal on dll loaded in memory, this AV must be notified because it bug |
21:00:36 | * | yglukhov quit (Remote host closed the connection) |
21:00:43 | cheatfate | nothing except VirtualAlloc/VirtualFree/VirtualProtect is used |
21:01:01 | cheatfate | and usage of this functions is absolutely legal |
21:01:15 | cheatfate | exe packers using same technology |
21:02:34 | cheatfate | the main problem is how AV detects exe packed files is calculating entropy of compressed/crypted binary |
21:03:04 | cheatfate | so you need to stay with not high entropy in finish exe file |
21:03:15 | cheatfate | so you can avoid AV |
21:03:40 | cheatfate | even warnings |
21:04:09 | * | BitPuffin|osx joined #nim |
21:05:03 | * | rauss quit (Quit: WeeChat 1.7) |
21:05:12 | cheatfate | about about 7z self extracting archive, first of all if you need to avoid AV, you can sign it... |
21:05:23 | FromGitter | <barcharcraz> that is a good point |
21:05:33 | cheatfate | but anyway most AV can unpack self extracted 7z archives |
21:05:52 | cheatfate | and check executables stored inside |
21:06:08 | * | hjsagg quit (Quit: No Ping reply in 180 seconds.) |
21:06:09 | cheatfate | so there will be no warnings, until you dont crypt your 7z file |
21:06:27 | * | brson quit (Quit: leaving) |
21:06:50 | * | bjz joined #nim |
21:07:01 | cheatfate | but anyway windows users dont like to run `.exe` files downloaded from net. |
21:07:20 | cheatfate | but they agree to run `.msi` signed installers |
21:07:25 | FromGitter | <barcharcraz> yes, it's loading dll's direct from memory that may cause problems. Probably not with windows defender and friends but rather with more intrusive "security" software |
21:08:01 | cheatfate | barcharcraz: this is not true, just because such loading is common scheme |
21:08:19 | FromGitter | <barcharcraz> [citation needed] |
21:08:30 | FromGitter | <barcharcraz> I know the dll ends up mapped to memory |
21:08:57 | FromGitter | <barcharcraz> but bypassing the normal loader and search mechanism (kernel32) is not something I've seen much |
21:09:43 | * | hjsagg joined #nim |
21:09:47 | cheatfate | barcharcraz: virtualalloc, virtualfree, virtualprotect - its common scheme? |
21:10:50 | cheatfate | memory access in your process memory space is common scheme? |
21:12:42 | dom96 | Would an AV complain about an exe writing a DLL to the hard drive and then loading it? |
21:13:29 | FromGitter | <barcharcraz> probably not |
21:14:04 | FromGitter | <barcharcraz> and yeah cheatfate, but messing with your own image header is pretty strange |
21:14:06 | ldleworker | dom96: lol |
21:15:08 | cheatfate | dom96, of course it can |
21:16:20 | dom96 | Well, in the sense that an AV can complain about anything, right? But is it likely to complain? |
21:16:41 | cheatfate | barcharcraz: no modifications will be made to own image header, you even dont need to modify EPROCESS structure in runtime |
21:17:28 | elrood | dom96, don't you think your utilities and installers should look as trustworthy and rock-solid as possible? dll-embedding is nice as a proof-of-concept experiment, but it definitely isn't something one should consider using for basic tools in the context of a new-ish and unestablished language |
21:18:04 | cheatfate | AV works like score meter, so `drop unsigned dll and load it to memory` its like 50 points, but `drop signed DLL and load it to memory` is like 5 points |
21:18:24 | elrood | besides, statically embedding dlls is like cherry-picking the worst of both worlds, and this may-an-av-complain-or-may-it-not-pseudophilosophical discussion is not leading anyone anywhere |
21:18:51 | dom96 | elrood: I do. But I also want to lower the barrier to entry as much as possible for newcomers. |
21:19:19 | * | bjz quit (Read error: Connection reset by peer) |
21:19:23 | dom96 | Perhaps I am going too far and I should just give them a zip with an .exe and some DLLs |
21:19:27 | elrood | if something looks fishy, people will drop it like a hot potato, which is not something you'd want for nim's tools, and especially not for newcomers |
21:19:56 | cheatfate | if you want to distribute binary for windows, first you need to get certificate, and then you need to make `.msi` installer... |
21:20:01 | ldleworker | "Think C#" |
21:20:11 | ldleworker | has been by advice for Nim from the start |
21:20:34 | ldleworker | (As in, highly polished and nothing seems out of place or grinds inoperatively against any other part, etc etc) |
21:21:43 | krux02 | cheatfate: so basically windows is a closed system now. |
21:22:06 | FromGitter | <barcharcraz> code signing is not a bad thing |
21:22:28 | FromGitter | <barcharcraz> and you don't need it, but it makes you look legit |
21:22:47 | FromGitter | <barcharcraz> and makes it easier to use nim for security related thigns |
21:23:00 | FromGitter | <barcharcraz> bagh fingers are hard |
21:23:03 | FromGitter | <barcharcraz> hard to spell |
21:23:52 | krux02 | yea, I was just excaggerationg |
21:24:02 | krux02 | exaggerating |
21:24:18 | krux02 | also hard to spell |
21:24:35 | FromGitter | <barcharcraz> eggseggseggsetrating |
21:25:02 | krux02 | yea |
21:25:50 | krux02 | I am on Linux, if I would be forced to develop something on Windows, I would be most happy, when I can install Nim via msys2 (probably becaues of my Arch linux background) |
21:25:53 | dom96 | Yeah... I won't bother with certificates. For now at least. |
21:26:06 | dom96 | Unless it's a barrier to the software working. |
21:26:10 | krux02 | (if have no idea if it actually exists) |
21:26:23 | dom96 | Which I guess Windows' smart screen (or whatever it's called) might cause. |
21:27:48 | krux02 | well, I think the best certificate to be, is open source software. |
21:27:49 | dom96 | I wonder if the Rust guys distribute rustup as a single exe for Windows |
21:28:01 | krux02 | And a lot of "smart" people think the same way |
21:28:13 | krux02 | so yea I agree, don't bother too much about certificates |
21:28:16 | dom96 | I know that on macOS it can be grabbed by copying and pasting a single command (which itself isn't the safest thing in the world...) |
21:28:19 | krux02 | that is for closed source software |
21:28:52 | demi- | dom96: hm? |
21:29:19 | federico3 | krux02: however various distros have multiple layers of signatures |
21:30:13 | dom96 | demi-: curl https://sh.rustup.rs -sSf | sh |
21:30:29 | demi- | oh, ew |
21:30:35 | krux02 | what I mean is, when windows tells me that Software X is not trusted code, but software X has full sourcecode published on the internet, then I say, ok then I can take the risk, but when it is a software that is completely closed, I might not take the risk |
21:30:38 | demi- | curl-to-shell is awful |
21:30:45 | dom96 | perhaps, but it's oh-so-convenient |
21:31:02 | elrood | dom96, quite frankly, if i was a newly introduced to nim and was presented with an installer which as its first action would try to connect to the net and download and run a bunch of stuff, i'd be less than delighted |
21:31:32 | elrood | mozilla can get away with it, being a trusted company, but nim? i'd turn my back in an instant, and probably a lot of people feel the same way |
21:31:41 | dom96 | elrood: really? :( |
21:32:03 | dom96 | That sucks. But keep in mind that this would be just one way to install Nim |
21:32:14 | elrood | i know it's convenient for you, but i'd really think twice about providing a batteries-included package for the newcomers instead of what you are considering |
21:32:35 | dom96 | And I would do my best to explain what the exe does |
21:32:43 | * | brson joined #nim |
21:32:43 | ldleworker | I think you're being hyperbolic and catastrophizing, elrood |
21:33:12 | ldleworker | I mean the language you're using is obviously intending to illustrate your concern in the most severe sense imaginable |
21:33:30 | elrood | i don't think so, but i appreciate your opinion |
21:33:37 | ldleworker | Lots of software today connects to the internet and downloads the actual content of the installer, not just "trusted corporations" like mozilla |
21:33:39 | krux02 | I think Nim should be distributed with a processing like IDE (aporia for now should do it) |
21:35:00 | cheatfate | krux02, Aporia is NOT IDE |
21:35:09 | krux02 | I should stop being part of this discussion, because I have absolutely no idea of the current state of Nim on Windows, but I guess the best batteries included package would be a setup that downloads the componets that you can select in a checklist. |
21:35:46 | dom96 | Actually, our current Windows installer (which is broken btw) downloads things from the net. |
21:35:47 | krux02 | cheatfate: well it does the job of letting the user quickly play around with Nim |
21:36:16 | cheatfate | krux02, php & python distros don't have even editor bundled... |
21:36:21 | ldleworker | dom96: the vast majority of users will turn their backs! |
21:36:29 | ldleworker | Seems like a thing you could instrument. |
21:36:47 | ldleworker | How many downloads resulted in requests to fetch the data? How many times was the data fully fetched? |
21:37:06 | krux02 | cheatfate: yes, but they are php and python they don't need to attract newcomers anymore, python is taught at universities |
21:37:38 | cheatfate | krux02, but they dont have editors inside from the beginning... |
21:37:46 | * | Sembei quit (Ping timeout: 268 seconds) |
21:38:00 | krux02 | cheatfate: well python had idle in the past |
21:38:24 | krux02 | well it actually still has idle |
21:38:31 | krux02 | just tested it |
21:38:31 | dom96 | ldleworker: You mean I should look at the analytics? |
21:38:48 | ldleworker | Yeah to vet elrood's fear unknowing and doubt |
21:39:08 | ldleworker | krux02, idle is seen as a joke |
21:39:12 | ldleworker | because it is |
21:39:13 | cheatfate | if we are talking about python windows distribution i dont see any `idle.exe` |
21:39:34 | Araq | once 0.17.0 is out, Nim's windows distribution is excellent, all things considered, IMHO. |
21:39:37 | * | brson quit (Ping timeout: 268 seconds) |
21:40:39 | elrood | while i do find ldleworker's sarcasm slightly amusing and don't take it the wrong way, i'd really consider making the installers for such basic tools as a compiler and package manager look legit and trust-instilling as a primary goal |
21:40:41 | krux02 | well idle did not stand the test of time, and when nim does become popular and bundles aporia in the current state, then yea it could become a joke too. But that is not the point. |
21:40:43 | cheatfate | there can be many installers for windows, pure nim, pure nim + mingw bundled, pure nim + mingw + pcre + sqlite3 + openssl bundled |
21:41:12 | FromGitter | <barcharcraz> can confirm nim's windows distribution is quite good |
21:41:14 | krux02 | ceatfate: it should be just one installer with checkboxes (imho) |
21:41:18 | ldleworker | standing the test of time means that you were at some point fully functional |
21:41:23 | FromGitter | <barcharcraz> and working with nim on windows is even better |
21:41:24 | ldleworker | IDLE never was |
21:41:44 | krux02 | well, I have no idea |
21:41:44 | cheatfate | krux02, stop breaking my nickname, please |
21:41:46 | ldleworker | Which is no surprise given an editor has no place in such a distribution |
21:41:58 | FromGitter | <barcharcraz> it is idle.pyw not idle.exe |
21:42:07 | FromGitter | <barcharcraz> hence why you don't see idle.exe |
21:42:15 | krux02 | cheatfate: sorry |
21:43:38 | krux02 | and it is somewhat required, because nobody wants an interactive shell in windows cmd.exe |
21:44:02 | krux02 | or at least was, I don't know if something has changed in that respect |
21:44:08 | dom96 | elrood: I'm glad you don't take it the wrong way. FWIW it was nice to hear your thoughts so please don't be discouraged from giving your honest opinion. |
21:46:23 | dom96 | elrood: in the long-run trust-instilling is the goal. In the short-term I don't want anyone to be prevented from using Nim because they can't get it to work on Windows. |
21:47:17 | dom96 | I remember when I was hunting for a new programming language, thinking "omg, how come everything is so broken, nobody seems to care about these things. I bet I would do better" |
21:47:25 | dom96 | As a teenager that is easy to think :) |
21:47:49 | dom96 | Back then Nim was actually one of the best on Windows |
21:48:07 | Xe | krux02: type the first few letters and hit tab |
21:49:11 | * | mrPerro quit (Quit: Leaving) |
21:49:20 | krux02 | Xe, just tested. Found a new feature. |
21:49:41 | Xe | krux02: the same thing works in most command line shells |
21:51:07 | elrood | dom96, and it probably still is. Araq's proposal of using a proven approach with a 7zip self-extracting archive has its charm, as does a .msi - i just wouldn't get too experimental with first-impression tools at this stage |
21:55:15 | * | GaveUp quit (Ping timeout: 276 seconds) |
21:56:42 | dom96 | Sure, and I will try that. |
21:56:55 | dom96 | .msi would be more of a replacement for our installer. |
21:57:17 | dom96 | We've used inno and NSIS. Both turned out crap. |
21:57:25 | dom96 | I sorta doubt that msi is any better :) |
21:57:47 | FromGitter | <barcharcraz> .msi is the "official" installer format |
21:57:49 | Xe | NSYS is the worst parts of assembly, javascript and C combined with the false promises of Oracle Java |
21:57:58 | FromGitter | <barcharcraz> intended to replace NSIS and inno |
21:58:02 | FromGitter | <barcharcraz> which cam before afaik |
21:58:05 | FromGitter | <barcharcraz> *came |
22:03:27 | * | Lord_Nightmare quit (Ping timeout: 240 seconds) |
22:03:46 | elrood | actually, we found NSIS to be quite malleable and while not necessarily pleasant at least adequate for its limited job back in the day, i am kind of surprised you found it unusable |
22:04:47 | elrood | assuming it or its successor hasn't become substantially worse in the meantime, it's been some years, that is |
22:08:54 | * | Lord_Nightmare joined #nim |
22:09:45 | Araq | elrood: the problem is it hasn't kept up with newer Windows versions |
22:12:21 | elrood | ah, i see, a pity. after winamp's decline nullsoft probably had little incentive to keep maintaining it |
22:18:40 | * | xet7 quit (Quit: Leaving) |
22:19:27 | dom96 | I have a sort of nostalgic respect for nullsoft |
22:19:41 | dom96 | But yeah, NSIS has become rather obsolete |
22:23:18 | euantor | Should just distribute floppy disks with the binaries on |
22:23:34 | euantor | Seems like Windows installer technology hasn't moved on much since then |
22:23:44 | FromGitter | <barcharcraz> well msi happened |
22:23:55 | FromGitter | <barcharcraz> MS decided to make a standard format |
22:24:00 | FromGitter | <barcharcraz> fairly simple, but standard |
22:24:17 | euantor | True, unfortunately a lot of companies have other ideas |
22:24:34 | euantor | Like exe downloads that you download in order to download some other stuff |
22:25:04 | euantor | case: see microsoft office |
22:25:07 | FromGitter | <barcharcraz> *cough* adobe *cough* |
22:25:18 | FromGitter | <barcharcraz> OK but that does some cool stuff |
22:25:20 | dom96 | I had this thought that for v1 we should create a Delphi-styled CD box for Nim :) |
22:25:24 | FromGitter | <barcharcraz> like office actually streams the application |
22:26:09 | * | GaveUp joined #nim |
22:26:24 | euantor | It looks like Microsoft are pushing users towards UWP these days anyway, and in the future it'll be possible to only install apps from the Microsoft Store |
22:26:28 | elrood | you think CDs will still be a thing when nim reaches 1.0 status? ;) |
22:26:32 | enthus1ast | or the old bsd logos/arts |
22:26:56 | dom96 | elrood: hah |
22:28:04 | enthus1ast | whats the issue with nsis? |
22:28:33 | enthus1ast | It seems that its downloading stuff and adds things to the path? |
22:28:50 | enthus1ast | what else do you want? |
22:29:16 | dom96 | elrood: I guess it'll be one of these: https://youtu.be/8PVeLqWnaXk?t=13 |
22:30:01 | dom96 | Can't wait to upload the Nim compiler to my brain. |
22:30:53 | dom96 | enthus1ast: It doesn't handle UAC properly. |
22:31:12 | dom96 | enthus1ast: And cannot download from our new SSL website |
22:31:41 | enthus1ast | oh |
22:31:58 | enthus1ast | thats bad |
22:32:16 | FromGitter | <barcharcraz> huh |
22:32:21 | FromGitter | <barcharcraz> manifest it |
22:32:25 | FromGitter | <barcharcraz> that will fix uac |
22:32:39 | FromGitter | <barcharcraz> or just use msi |
22:36:50 | dom96 | Well, since this is pretty much NIH central, I was thinking about developing a NSIS replacement in Nim :P |
22:37:25 | enthus1ast | yeah me to |
22:38:12 | dom96 | If done well I think it might even be Nim's killer library. |
22:39:43 | elrood | mhm, take a language with focus on performant native code and elegance, and make an installer library its killer application ;P |
22:40:51 | enthus1ast | in fact it would be an installer only for windows |
22:40:59 | enthus1ast | and windows has msi |
22:41:11 | enthus1ast | the rest has others |
22:41:24 | Araq | enthus1ast: the NSIS installer does not work! |
22:41:38 | Araq | installing to c:\program files silently fails |
22:41:51 | Araq | downloads don't work anymore because we moved to https |
22:41:52 | dom96 | Nim's focus is metaprogramming. Nim's expressiveness would be perfect for defining installers. |
22:42:19 | dom96 | Other ideas for a killer app are of course welcome :) |
22:43:33 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:44:22 | elrood | an AI for inventing roundishly shaped objects that'd ease transportation and relocation problems would be nice.. ;) |
22:45:28 | enthus1ast | monitor/control multiple servers in a self forming network |
22:45:46 | enthus1ast | so me as a admin only need to doubleclick |
22:46:54 | enthus1ast | mix of chef / pupped / saltstack / tinc |
22:47:14 | elrood | that's neglecting that a crucial part of being and admin is to make yourself indispensable, though |
22:47:45 | enthus1ast | i thing the crucial part is that i dont have "really" work |
22:47:49 | enthus1ast | at work |
22:48:48 | elrood | which only works until HR calls one in for a casual interview |
22:49:34 | enthus1ast | mime.nim |
22:59:07 | * | couven92 quit (Quit: Client Disconnecting) |
23:05:22 | * | abeaumont joined #nim |
23:05:57 | SusWombat | Can i debug nim code? |
23:06:25 | Calinou | I think you can use basic gdb features, but I'm not sure |
23:07:07 | * | Vladar quit (Quit: Leaving) |
23:07:15 | SusWombat | ok |
23:14:47 | * | aedigix- quit (Ping timeout: 264 seconds) |
23:24:24 | * | aedigix joined #nim |
23:25:32 | * | nsf joined #nim |
23:27:23 | * | abeaumont quit (Ping timeout: 256 seconds) |
23:28:15 | * | elrood quit (Quit: Leaving) |
23:28:29 | * | Kingsquee joined #nim |
23:29:22 | Xe | SusWombat: why wouldn't you be able to? |
23:29:45 | SusWombat | Xe, im completely new. So i didnt know if there is a debugger or something |
23:30:35 | Xe | SusWombat: compile with `--debugger:native` |
23:31:40 | SusWombat | what does that do Xe |
23:32:37 | Xe | --debugger:native|endb use native debugger (gdb) | ENDB (experimental) |
23:32:47 | Xe | read the manual if in doubt |
23:32:52 | SusWombat | ok ty |
23:33:05 | Xe | https://nim-lang.org/docs/manual.html |
23:33:11 | Xe | keep this tab pinned |
23:33:20 | Xe | it'll help you so much it's not funny |
23:36:30 | SusWombat | ok |
23:41:55 | * | vlad1777d quit (Quit: Leaving) |
23:45:36 | * | hjsagg quit (Ping timeout: 240 seconds) |
23:47:26 | * | brson joined #nim |
23:48:41 | * | hjsagg joined #nim |
23:51:43 | * | client_ joined #nim |
23:51:43 | * | ofelas quit (Read error: Connection reset by peer) |
23:52:10 | * | ofelas joined #nim |
23:52:24 | Araq | Xe: interesting. the manual, not the index or some stdlib reference? |
23:52:59 | * | hjsagg quit (Ping timeout: 246 seconds) |
23:54:45 | * | kulelu88 quit (Ping timeout: 260 seconds) |
23:57:06 | Xe | Araq: i use the manual and work out from there into stdlib docs |
23:57:23 | Xe | i work in multiple languages so i usually keep the spec for each language up in a tab |
23:58:26 | Xe | it also explains the command line flags |
23:58:51 | Xe | (which is where i look first when things go contrary to what i think they should, nim is pretty good about being easy to guess |
23:58:55 | Xe | ) |
23:59:32 | Araq | no it doesn't list command line flags |
23:59:57 | Araq | that would be https://nim-lang.org/docs/nimc.html |