00:02:06 | PMunch | But annoyingly I can't reproduce in a smaller sample.. |
00:04:18 | FromGitter | <kayabaNerve> NVM then |
00:06:00 | FromDiscord | <exelotl> so if I'm understanding correctly, waitFor is similar to await, but await requires the event loop to be running, while waitFor runs the event loop by itself? |
00:08:18 | PMunch | Hmm, it appears that it's a collision |
00:09:40 | PMunch | So it appears that if I have two plugins that use GC stuff one of them will segfault.. |
00:19:22 | * | find0x90 quit (Quit: find0x90) |
00:29:38 | * | mwbrown joined #nim |
00:38:49 | * | arecaceae quit (Read error: Connection reset by peer) |
00:39:34 | * | arecaceae joined #nim |
00:47:52 | FromGitter | <kayabaNerve> @Varriount You got my hopes up. |
00:47:58 | FromGitter | <kayabaNerve> I'm just saying. |
00:48:04 | FromGitter | <kayabaNerve> I thought we had something. |
00:48:10 | FromGitter | <kayabaNerve> But you led me on... |
00:48:54 | FromGitter | <kayabaNerve> Just don't come back years from now and ask where all the nice developers went |
00:49:03 | FromGitter | <kayabaNerve> </joking> :P |
00:59:21 | * | PMunch quit (Quit: leaving) |
01:11:26 | * | dddddd quit (Remote host closed the connection) |
01:30:29 | FromGitter | <Varriount> @kayabaNerve Alas, Cryptocurrently, and Block Chain just don't appeal to me. |
01:30:52 | FromGitter | <Varriount> I'm more of a "this is how you interface with this hardware" kind of guy. :P |
01:31:22 | CodeVance | should div be a keyword in nim? |
01:31:45 | CodeVance | @Varriount blockchains are an illusion |
01:32:27 | FromGitter | <Varriount> CodeVance: Seems a bit niche to be a keyword. |
01:32:58 | CodeVance | karax readme calls div a keyword |
01:33:07 | FromGitter | <Varriount> It's a function: https://nim-lang.org/docs/system.html#div,int,int |
01:33:35 | FromGitter | <Varriount> Karax might use it for it's own internal DSL though. It might be considered a keyword in the DSL. |
01:33:39 | CodeVance | I'll make an issue on karax |
01:41:53 | FromGitter | <kayabaNerve> @Varriount Tox is a decentralized secure chat app. No cryptocurrency or blockchain involved. |
01:45:30 | CodeVance | tox.chat |
01:51:01 | FromGitter | <kayabaNerve> That |
01:55:29 | FromDiscord | <awr> assigning a seq to another seq performs a deep copy right? |
01:55:35 | CodeVance | I still don't understand the difference between type/untyped. I know it has to do with whether code is defined or not but its still confusing |
01:55:47 | CodeVance | I need a flow chart |
01:56:36 | CodeVance | awr I think the default for assignment is deepcopy |
01:57:10 | CodeVance | I think you can do a shallowcopy default if you use the shallow pragma |
01:57:21 | FromDiscord | <awr> okay thanks |
02:14:53 | FromGitter | <Varriount> awr: No, not deepcopy |
02:15:19 | FromGitter | <Varriount> A deepcopy duplicates references (that is, a new reference is created, pointed to a copied block of memory) |
02:16:02 | FromGitter | <Varriount> Sequence and string assignments follow the same semantics that assigning a `struct` in C or an `object` type in Nim do. |
02:16:25 | CodeVance | Creates a new reference pointing to the same obj? |
02:16:34 | FromGitter | <Varriount> Yes. |
02:16:37 | CodeVance | I thought copying the ref is the same result |
02:17:00 | FromGitter | <Varriount> Here, let me write up some pseudocode |
02:21:15 | FromGitter | <Varriount> CodeVance, awr: https://gist.github.com/Varriount/ae5aab05a8771cdd155fe0ae3282f19a |
02:23:09 | FromGitter | <Varriount> So, note that if the element that the sequence contains is a reference, only the reference itself is copied, not the memory it points to. |
02:25:05 | FromGitter | <Varriount> dom96, araq: Is there some failing test that got past the build checks? All the most recent PRs have the same failing set of tests. |
02:28:13 | CodeVance | https://travis-ci.org/nim-lang/Nim/builds |
02:28:35 | CodeVance | Last three seem to fail |
03:16:05 | * | Calinou quit (Remote host closed the connection) |
03:17:14 | * | Calinou joined #nim |
03:42:00 | * | leorize quit (Ping timeout: 256 seconds) |
03:48:32 | * | bevo joined #nim |
04:01:53 | * | skrylar quit (Remote host closed the connection) |
04:06:59 | * | fjvallarino quit (Remote host closed the connection) |
04:07:26 | * | fjvallarino joined #nim |
04:12:21 | * | fjvallarino quit (Ping timeout: 264 seconds) |
04:21:35 | * | crem quit (Ping timeout: 255 seconds) |
04:22:05 | FromDiscord | <DotDash> Coming from Java, what would the equivalent of `Object...` (varargs of any type) be, if it exists? |
04:22:54 | FromGitter | <Quelklef> `varargs[typed, converter]` |
04:22:57 | * | crem joined #nim |
04:23:44 | FromGitter | <Quelklef> If you're doing explicit casting from `Object`, dunno |
04:24:04 | FromGitter | <Quelklef> Because not all Nim values are objects I believe |
04:24:12 | FromDiscord | <DotDash> hmm |
04:24:17 | FromDiscord | <DotDash> doesn't seem to be working in a proc |
04:24:25 | * | lompik joined #nim |
04:24:34 | FromGitter | <Quelklef> what's your converter |
04:24:43 | FromDiscord | <DotDash> '$' for now |
04:24:47 | FromGitter | <Quelklef> hmmmmm |
04:24:48 | FromGitter | <Quelklef> send me the code? |
04:25:27 | FromDiscord | <DotDash> https://gist.github.com/xDotDash/c35d3ae90a8b4111bc726976acf8b484 |
04:25:44 | FromGitter | <Quelklef> how are you calling it |
04:26:15 | FromDiscord | <DotDash> like if I wanted to do `invokeFunction("myfunc", 5, true)` |
04:26:41 | FromGitter | <Quelklef> hmmmm |
04:26:43 | FromGitter | <xDotDash> perhaps there is a more idiomatic way to do it? |
04:27:04 | FromGitter | <xDotDash> I suppose I could just switch to an array |
04:27:51 | FromGitter | <Quelklef> hmm, not working for me either |
04:27:57 | FromGitter | <Quelklef> but the echo declaration is `proc echo(x: varargs[typed, `$`]) {..}` |
04:28:09 | FromGitter | <xDotDash> interesting |
04:28:44 | FromGitter | <Quelklef> doesn't work even with only ``args: varargs[typed, `$`]`` |
04:28:53 | FromGitter | <Quelklef> maybe echo is an exceptional case? |
04:29:06 | FromGitter | <xDotDash> seems like that might be the case |
04:29:21 | FromGitter | <Quelklef> I'm gonna look at the documentation for varargs |
04:30:00 | FromGitter | <Quelklef> we're all dumb |
04:30:06 | FromGitter | <Quelklef> ``varargs[string, `$`]`` |
04:30:17 | FromGitter | <Quelklef> because `` `$` `` converts to string |
04:31:01 | FromGitter | <xDotDash> is varargs just an array underneath? |
04:31:09 | FromGitter | <Quelklef> yeah |
04:31:21 | FromGitter | <Quelklef> `f("a", "b", "c")` gets translated to `f("a", ["b", "c"])` |
04:31:38 | FromGitter | <Quelklef> for `f(string, varargs[string])` |
04:31:52 | FromGitter | <xDotDash> Can't seem to find anything about nim having a spread operator either hm |
04:32:01 | FromGitter | <Quelklef> it doesn't |
04:32:05 | FromGitter | <xDotDash> rip |
04:32:06 | FromGitter | <Quelklef> iirc there's a macro |
04:32:15 | FromGitter | <Quelklef> alternatively, you create a seq, and pass it as the varargs |
04:32:33 | FromGitter | <Quelklef> ala `f("first arg", @["second arg"] & rest_args)` |
04:33:06 | FromGitter | <xDotDash> my preference would have been being able to do `varargs[any]` |
04:33:47 | FromGitter | <Quelklef> I... don't know if that works with the type system |
04:33:51 | FromGitter | <Quelklef> are they homogenous? |
04:33:57 | FromGitter | <Quelklef> can you do `fT (x: varargs[T])`? |
04:34:24 | FromGitter | <xDotDash> I don't think that'll work for my usecase |
04:34:55 | FromGitter | <Quelklef> what's your usecase |
04:34:58 | FromGitter | <xDotDash> but ah yea I think `array[any]` will work |
04:35:08 | FromGitter | <Quelklef> also the `echo` decl is wrapped in a `when(nimvarargstyped)` so idk what's going on there |
04:35:18 | FromGitter | <xDotDash> being able to call an arbitrary function from Java |
04:35:23 | FromGitter | <Quelklef> oh wow I didn't know `any` is a thing |
04:35:38 | FromGitter | <Quelklef> but it's a typeclass, not a type? |
04:36:41 | FromGitter | <xDotDash> nim's type system certainly is interesting |
04:36:48 | FromGitter | <xDotDash> not something I'm particularly used to |
04:36:55 | FromGitter | <Quelklef> yeah, I agree. I quite like it though |
04:37:35 | FromGitter | <xDotDash> but it's definitely something I've always wanted, python syntax with static types |
04:37:49 | FromGitter | <Quelklef> yes! That's actually how I found Nim |
04:37:54 | FromGitter | <Quelklef> by looking for a "typed Python" |
04:38:03 | FromGitter | <xDotDash> hah we are in the same boat :) |
04:38:58 | shashlick | varriount: I mentioned the failing builds earlier in the day, https://irclogs.nim-lang.org/07-07-2018.html#18:30:38 |
04:39:35 | shashlick | one of my PRs are also impacted |
04:40:22 | CodeVance | dotdash unpackVarargs |
04:41:01 | FromGitter | <xDotDash> where can I find that? |
04:42:42 | CodeVance | import macros |
04:43:07 | CodeVance | does your proc need to be a proc? |
04:43:24 | CodeVance | make it a macro |
04:43:36 | CodeVance | then you can change it at compile time |
04:43:39 | FromGitter | <xDotDash> I definitely need a proc somewhere, just haven't fully figured out at which level |
04:44:09 | FromGitter | <Quelklef> Are you working with a lib or doing everything yourself |
04:44:31 | FromGitter | <xDotDash> no nim libs |
04:44:46 | FromGitter | <Quelklef> sounds like a code smell in my opinion |
04:44:48 | FromGitter | <xDotDash> besides the basic stuff |
04:44:53 | * | leorize joined #nim |
04:44:54 | FromGitter | <Quelklef> right |
04:44:59 | FromGitter | <xDotDash> I'm doing some java <-> nim interaction |
04:45:08 | FromGitter | <Quelklef> at runtime? |
04:45:14 | CodeVance | I think its better as a macro |
04:45:23 | FromGitter | <xDotDash> at runtime yes |
04:45:27 | CodeVance | Then build the call from the macro |
04:45:35 | FromGitter | <Quelklef> aw geez |
04:45:36 | FromGitter | <Quelklef> how |
04:45:48 | CodeVance | or nvm |
04:46:24 | FromGitter | <xDotDash> through JNI |
04:46:30 | CodeVance | I think you should look at the js lib. it can call undefined functions at runtime |
04:47:15 | CodeVance | wait . |
04:47:33 | CodeVance | Are you importing the java code |
04:47:33 | CodeVance | ? |
04:47:55 | FromGitter | <xDotDash> The java code is importing the nim code, I'm seeing if I could use nim as a scripting language |
04:48:34 | CodeVance | lol. is it working? |
04:48:43 | FromGitter | <Quelklef> Dunno but maybe check out https://github.com/yglukhov/jnim ? |
04:49:21 | FromGitter | <xDotDash> Yea I've checked out jnim, but that's more of the other way around I think |
04:49:32 | FromGitter | <xDotDash> importing java into nim |
04:49:59 | FromGitter | <xDotDash> it's further on the nim-side than the java-side |
04:50:08 | FromGitter | <Quelklef> Ah |
04:50:24 | FromGitter | <Quelklef> I've never dealt with anything like this before, so I can't help much, but good luck! |
04:50:32 | FromGitter | <xDotDash> Thanks :) |
04:51:30 | CodeVance | using nim as a scripting language will be difficult. If you aren't afraid to do the work it should be possible |
04:52:04 | FromGitter | <xDotDash> It certainly *looks* possible from what I've looked at so far |
04:52:40 | CodeVance | Tell me if you can call a nim proc from java |
04:52:44 | CodeVance | I'm going to go sleep |
04:53:47 | FromGitter | <xDotDash> Well I know for sure you can call a proc from Java using JNI, as long as you export it to C |
05:04:29 | * | donlzx joined #nim |
05:33:47 | * | miran joined #nim |
05:47:18 | * | Trustable joined #nim |
05:57:11 | FromGitter | <Varriount> @xDotDash But the JNI isn't a transparent interface, right? I've heard there are a lot of complexities that need to be kept in mind. |
06:16:45 | Araq | devel is red :-( |
06:16:58 | Araq | shashlick: the method failures landed in devel |
06:17:16 | Araq | not sure how that happened... I only merge green stuff |
06:35:53 | FromGitter | <bevo009> Have you guys seen this recent Eudonix page on Nim? It's quite well presented ⏎ The installing guide is actually pretty good ⏎ https://blog.eduonix.com/web-programming-tutorials/nim-programming-language-syntaxes/ |
06:39:08 | * | ng0 joined #nim |
06:40:01 | * | Trustable quit (Remote host closed the connection) |
06:40:07 | ng0 | is there a way to build koch, after building nim, more verbose? I'm trying to understand where exactly the failure comes from. |
06:40:37 | ng0 | so far I have a couple of guesses. |
06:57:51 | Araq | ng0: edit koch.nim, proc 'boot' |
06:58:06 | Araq | don't be scared, koch.nim is not black magic |
06:59:06 | ng0 | okay, koch.nim was one source I thought of for the failure |
06:59:19 | ng0 | because in the build chroot it fails, but outside of it it works |
07:00:58 | ng0 | I did not start editing because I'm still reading into the language. I can paste the error in a while, I'll have breakfast first. |
07:13:30 | * | nsf joined #nim |
07:18:35 | * | nasusiro joined #nim |
07:25:07 | ng0 | https://d.n0.is/pub/tmp/nim_fail.txt the odd thing is, /bin/sh exists. it's one of the elements which exist in our rather strict build chroot. |
07:25:35 | ng0 | the message itself made me assume it is not koch.nim, but external from it |
07:26:09 | ng0 | although you have an opinionated PATH reset in koch.nim which could be a problem for us |
07:36:05 | * | miran quit (Ping timeout: 276 seconds) |
07:41:22 | ng0 | although this is not used in boot and release |
07:52:41 | ng0 | the order: sh build.sh ; ./bin/nim c koch ; ./koch boot -d:release -d:useGnuReadLine -d:nativeStacktrace ; ./koch tools -d:release is in general okay, right? |
07:52:55 | ng0 | the goal is to have a full-featured nim |
07:55:44 | ng0 | what I did not consider so far was that the last 3 commands could maybe succeed post-install. |
07:55:49 | ng0 | with a wrapped nim |
08:00:47 | * | rokups joined #nim |
08:08:28 | ng0 | because I think it's much better to ask and learn from people than to guess: when I invoke "nim c koch", what exactly does happen internally, breaking it down to "expected file locations, files touched and assumptions on OS side"? |
08:09:11 | ng0 | it's a clear language, but implementors often have their ways to explain more than just code |
08:10:32 | * | leorize quit (Ping timeout: 265 seconds) |
08:11:12 | * | leorize joined #nim |
08:23:40 | FromGitter | <Varriount> ng0: What are you aiming to do? |
08:24:02 | ng0 | complete the nim package for Guix |
08:26:32 | * | yglukhov[i] joined #nim |
08:31:22 | * | skrylar joined #nim |
08:36:04 | FromGitter | <mratsim> @DotDash invokeFunction should be a template: `proc invokeFunction(name: untyped, args: varargs[typed, '$’]) = name(args)` |
08:37:42 | * | nsf quit (Quit: WeeChat 2.1) |
08:39:08 | FromGitter | <kayabaNerve> I think Koch is black magic. Change my mind. |
08:40:50 | * | fjvallarino joined #nim |
08:43:16 | FromGitter | <kayabaNerve> It's possible to use nimx without its AST, right? |
08:43:39 | FromGitter | <kayabaNerve> Can you do that with any Nim AST, even it makes the code ugly as hell? 🤔 |
08:45:04 | FromGitter | <mratsim> Usually Macro are just a way for lazy programmers to avoid having to do type declaration, proc declaration, calling them and so ;) |
08:45:21 | * | fjvallarino quit (Ping timeout: 248 seconds) |
08:46:33 | * | Vladar joined #nim |
08:52:21 | FromGitter | <kayabaNerve> Is AST done through macros? |
08:52:35 | FromGitter | <kayabaNerve> Tbh I don't know. I haven't studied macros/AST |
08:53:44 | * | Hotkeys quit () |
08:56:32 | FromGitter | <kayabaNerve> I probably should |
09:01:51 | * | rosshadden quit (Read error: Connection reset by peer) |
09:03:52 | * | rosshadden joined #nim |
09:03:59 | * | yglukhov[i] quit (Remote host closed the connection) |
09:05:06 | * | 17WABPVIA joined #nim |
09:05:46 | FromGitter | <tim-st> when I wrap a file "header.h" this file is expected inside the nimcache folder when comiling, can I change the folder to look in the same folder for the "header.h" file like the wrapping "wrapper.nim" is? |
09:21:25 | * | donlzx quit (Quit: Leaving) |
09:25:44 | FromGitter | <diegogub> guys, anyone using jester? I'm trying to compile it but I get "jester.nim(5, 38) Error: cannot open 'macrocache'" |
09:25:48 | FromGitter | <diegogub> @dom96 |
09:26:48 | FromGitter | <dom96> You need Nim devel |
09:41:26 | FromGitter | <mratsim> @tim-st look into status-im C library on Github: https://github.com/status-im/nim-secp256k1/blob/master/secp256k1.nim#L4 |
09:41:58 | FromGitter | <mratsim> https://github.com/status-im/nim-decimal/blob/master/decimal/decimal_lowlevel.nim#L14 |
09:42:59 | FromGitter | <mratsim> Alternatively you can use stb image approach of having a C file that just include the .h header: https://github.com/define-private-public/stb_image-Nim/blob/master/stb_image/read.c#L2 |
09:47:48 | * | skrylar quit (Remote host closed the connection) |
09:49:25 | * | NimBot joined #nim |
10:14:54 | * | 17WABPVIA quit (Remote host closed the connection) |
10:19:30 | * | PMunch joined #nim |
10:30:20 | * | yglukhov[i] joined #nim |
10:32:29 | * | Perkol joined #nim |
10:33:46 | FromGitter | <tim-st> @mratsim thanks! |
10:37:31 | * | dddddd joined #nim |
10:46:53 | Perkol | In here https://github.com/zielmicha/libsodium.nim/blob/master/sodium/common.nim What does {.passl:"-lsodium".} mean? |
10:48:03 | FromGitter | <tim-st> described here: https://nim-lang.org/docs/nimc.html#compiler-usage |
10:51:44 | Yardanico | Perkol, it's a C compiler option |
10:51:58 | Yardanico | it means - link the program with libsodium |
10:53:04 | * | TheLemonMan joined #nim |
10:53:25 | * | yglukhov[i] quit (Remote host closed the connection) |
10:54:04 | TheLemonMan | what happened to the CI? the recent builds are all red |
10:54:54 | FromGitter | <kayabaNerve> Araq noticed yet said he only merges green ones... |
10:56:25 | TheLemonMan | what if he's colorblind? |
11:00:54 | FromGitter | <kayabaNerve> He isn't afaik. I'm just saying he knows about the issue, said it wasn't his fault, and that's all I know. I don't know what deviant trying to sabotage Nim caused this. Was Dom jealous due to how much effort he's put in? Was Varriount paid off by the Rust team? 🤔 |
11:02:17 | Yardanico | what happened? |
11:04:55 | Yardanico | ah, I checked gitter, nvm |
11:04:57 | FromGitter | <kayabaNerve> Someone merged code into devel that doesn't pass all the CI tests. I'm being dramatic af about it and trying to see if I can write a new spy thriller on the level of Digital Fortress |
11:05:26 | Yardanico | @kayabaNerve no one expected that such a fix would cause CI failures |
11:06:20 | FromGitter | <kayabaNerve> I'm not blaming anyone :p just trying to make some humor out of it. I'm sorry if it came across differently. |
11:06:36 | Yardanico | https://github.com/nim-lang/Nim/pull/8239 (PR) https://github.com/nim-lang/Nim/issues/8246 (code which fails with the PR )if someone is interested |
11:08:26 | FromGitter | <kayabaNerve> Weird. Thanks for the info |
11:13:46 | * | xet7 joined #nim |
11:20:23 | FromGitter | <dom96> Yeah. I don't get how that's causing the failure. |
11:22:23 | FromGitter | <kayabaNerve> Is it compile or runtime? |
11:23:00 | Yardanico | internal compiler error is compile-time |
11:23:36 | FromGitter | <kayabaNerve> Got it. |
11:23:50 | PMunch | Ugh, I thought I had found my issue with dynlibs and the GC. But trying to replicate it today it doesn't happen.. |
11:23:55 | FromGitter | <kayabaNerve> Sorry. I forgot what it said. Probably should've just checked. |
11:24:20 | FromGitter | <kayabaNerve> @dom96 don't you generally use IRC? |
11:26:16 | Yardanico | @kayabaNerve he does |
11:26:25 | Yardanico | Araq mostly uses IRC too |
11:26:43 | FromGitter | <dom96> Yeah. But not when I'm using my phone |
11:31:49 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
11:45:29 | * | yglukhov[i] joined #nim |
11:50:07 | * | elrood joined #nim |
12:15:13 | PMunch | Ah, I think that was just my mistake.. |
12:16:14 | * | yglukhov[i] quit (Remote host closed the connection) |
12:17:29 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
12:25:50 | * | Perkol quit (Remote host closed the connection) |
12:26:27 | * | nsf joined #nim |
12:27:33 | * | bevo quit (Ping timeout: 252 seconds) |
12:36:32 | PMunch | Araq, how is the rtl supposed to be used for libraries that are dynamically loaded? |
13:08:38 | * | miran joined #nim |
13:52:57 | * | krux02 joined #nim |
13:55:17 | * | yglukhov[i] joined #nim |
13:59:24 | * | PMunch quit (Quit: leaving) |
14:16:22 | * | krux02 quit (Remote host closed the connection) |
14:25:47 | * | krux02 joined #nim |
14:31:05 | * | find0x90 joined #nim |
14:36:18 | * | find0x90_ joined #nim |
14:36:30 | * | find0x90 quit (Ping timeout: 268 seconds) |
14:55:18 | * | fjvallarino joined #nim |
14:59:45 | * | fjvallarino quit (Ping timeout: 264 seconds) |
15:03:56 | * | krux02 quit (Quit: Leaving) |
15:05:22 | * | krux02 joined #nim |
15:18:26 | nasusiro | Araq: I have just read your article https://nim-lang.org/araq/concurrency.html and I wanted to ask: what's your opinion about Go's Goroutines that deal with channels? |
15:24:23 | * | find0x90_ quit (Quit: find0x90_) |
15:32:21 | * | fjvallarino joined #nim |
15:40:01 | * | edcragg quit (Quit: ZNC - http://znc.in) |
15:40:13 | * | edcragg joined #nim |
15:42:16 | * | smt joined #nim |
15:52:33 | * | smt quit (Quit: Leaving) |
16:05:32 | * | dorelix joined #nim |
16:14:40 | Yardanico | do we really need packages like https://github.com/nim-lang/packages/pull/788/files ? |
16:15:09 | Yardanico | https://github.com/k0pernicus/compare/blob/master/src/compare.nim |
16:15:39 | FromGitter | <k0pernicus> @Yardanico It's very not useful :p ⏎ It was just a test to upload packages ;) |
16:15:46 | Yardanico | ah, ok, sorry :) |
16:15:56 | * | nc-x joined #nim |
16:16:10 | Yardanico | I just mean that usually only somewhat medium/big packages are submitted to nimble |
16:16:48 | * | dorelix quit (Quit: Leaving) |
16:16:54 | * | dorelix_ joined #nim |
16:20:12 | * | nc-x quit (Ping timeout: 252 seconds) |
16:25:44 | FromGitter | <k0pernicus> Actually, it can be pretty "dangerous" to submit minimalistic libraries, I agree… ⏎ I remembered when a NPM user removed very used minimalistic libraries: a high number of libraries/binaries failed to work :/ |
16:26:18 | Yardanico | well, that's NPM :) |
16:26:21 | FromGitter | <k0pernicus> But, minimalistic libraries can be pretty useful to test future syntax improvements for example… 🤔 |
16:27:34 | nasusiro | please no...no NPM nonsense with Nim O.o |
16:28:55 | nasusiro | just...just look at their code https://github.com/jonschlinkert/is-odd/blob/master/index.js |
16:29:05 | nasusiro | was this even necessary to be created as a package?! |
16:30:10 | * | yglukhov[i] quit (Remote host closed the connection) |
16:30:22 | FromGitter | <mratsim> @k0pernicus it was “leftpad” that crashed NPM |
16:30:56 | FromGitter | <mratsim> `(n % 2) === 1` huh? is it PHP? |
16:31:00 | FromGitter | <k0pernicus> @mratsim exactly! |
16:35:06 | * | fjvallarino quit (Remote host closed the connection) |
16:35:33 | * | fjvallarino joined #nim |
16:37:48 | shashlick | I wonder what motivated them to make such packages |
16:38:18 | Yardanico | shashlick, that's JS :) |
16:40:10 | * | fjvallarino quit (Ping timeout: 256 seconds) |
16:50:26 | * | nsf quit (Quit: WeeChat 2.1) |
17:15:47 | * | fjvallarino joined #nim |
17:41:10 | * | Trustable joined #nim |
17:50:23 | * | rokups quit (Quit: Connection closed for inactivity) |
17:57:06 | LyndsySimon | I’m consider writing a fairly simple Tetris-like game. I’d like it to support iOS, Android, and web. Is Nim mature enough to do this, and what UI library should I consider? I’m looking at nimx right now, but it seems focused on forms. |
18:04:38 | Araq | mature enough? definitely. |
18:04:58 | Araq | UI library is always a tough question. |
18:05:14 | Araq | SDL2 seems most appropriate |
18:07:54 | pydsigner | Someone made bindings for a nice-looking single-header GUI lib that could be used with SDL but I'm blanking on the name |
18:12:45 | LyndsySimon | nimx looks like it uses SDL2 |
18:14:04 | LyndsySimon | A big problem I have is that I’m not familiar with the C ecosystem. I’m a Python dev by trade and used to having a single list of resources in PyPI. |
18:14:23 | krux02 | LyndsySimon, for a tetris like game the UI is so simple that any UI library would be overkill |
18:14:23 | LyndsySimon | I’ve historically found it very difficult to know what is out there for me to use in nim. |
18:14:48 | krux02 | the game as three menue entries, start quit and highscore |
18:14:56 | LyndsySimon | krux02: I don’t even know how to draw to the screen, much less build to target iOS. |
18:15:35 | krux02 | LyndsySimon, well forget iOS. Apple deprecated OpenGL the only cross platform API for performance rendering |
18:16:35 | krux02 | you can use SDL2 to render to the screen, but the performance of the immediate draw calls for spriets isn't good, even if it has a "Metal" backend. |
18:17:00 | LyndsySimon | I’d really rather not “forget iOS”, consider all of my mobile devices run it. |
18:17:28 | krux02 | And Metal only has an Objective C and Swift binding. So you would also need to write your own wrapper to it. |
18:17:41 | Araq | krux02: for tetris SDL's performance will be fine |
18:17:49 | Araq | even on OSX, with "Metal" |
18:18:09 | Araq | also ... who knows if OpenGL stays deprecated |
18:18:23 | Araq | it was an insane move from Apple |
18:18:58 | krux02 | yes it was. But it was not out of nothing. |
18:19:41 | krux02 | OpenGL version on Apple devices is locked to version 4.1 that version is from 2010. Pretty old if you ask me. And they don't support any improvements that have been made since then. |
18:20:40 | krux02 | I know what their plan is. If they would keep updating OpenGL, then Metal would not have any purpose or performance benefit. And people would not invest in porting to Metal. |
18:21:20 | Araq | well sure, tie devs to the platform by forcing platform specific APIs down their throat |
18:21:35 | * | dorelix_ quit (Ping timeout: 240 seconds) |
18:22:05 | Araq | but it's only bad when MS does it :P |
18:22:19 | krux02 | I don't have a Mac so you could think I am not affected. But I develop a system for GPU programming that is built on OpenGL so I am affected. |
18:22:19 | * | nsf joined #nim |
18:25:12 | krux02 | Well I don't know too much about the internal of DirectX and how everything is tied together. But as far as I know. OpenGL only runs on Windows because third parties want it supported. GPU drivers just support it. There is no Microsof involvement in it. A different thing is Mac. On a mac the OpenGL drivers are tied to the Openrating system. That is good if the operating system wants to keep the drivers up to date, bad |
18:25:12 | krux02 | if the operating system wants to keep the drivers on an outdated level to push their Metal stuff. |
18:25:43 | * | Araq shrugs |
18:26:44 | krux02 | And the hardware on a Mac and on a Linux machine is exactly the same. |
18:26:57 | Araq | I would use SDL2 and call it a day |
18:27:20 | Araq | it will be ported to any bullshit they'll throw at us |
18:27:27 | krux02 | yea sdl2 solves the issue for you. At least that is what you think. But it really lacks a sprite batch drawing routine. |
18:28:07 | Araq | it definitely solves the problem for Tetris. |
18:28:10 | Araq | come on. |
18:28:56 | krux02 | I thought the same when I wanted to do 2d. Yea just do SDL2 and call it a day. For this simple scene it doesn't need high performance. But the performance was not just slow. It was horrible. I enabled software rendering and I got a 10 times porformance boost. It is that slow. |
18:29:27 | Araq | yes, use software rendering |
18:29:34 | krux02 | but yes tetris in software rendering. Yes. It will do the job. |
18:30:09 | * | fjvallarino quit (Remote host closed the connection) |
18:30:09 | krux02 | but normally you don't program tetris to program tetris. It is the first step in learing graphics programming. And 2d rendering with sdl, you will stop there. |
18:30:16 | * | fjvallarino joined #nim |
18:30:55 | krux02 | btw for tetris I really think Processing is a cool environment to implement it. I did it, and it works great. |
18:31:03 | Araq | there are also lots of 3D engines that are pretty good at 2D |
18:31:06 | krux02 | (Sorry it is not Nim). |
18:32:17 | Araq | speaking of which ... what's the difference between a camera and a viewport? |
18:33:55 | Araq | it's like they are stuck in the 80ies of OO software design. underline the nouns in your informal description and turn them into classes. The more nouns, the better. |
18:36:39 | krux02 | for me a viewport is 4 integers, and a camera is 8 floats |
18:37:15 | krux02 | position+size, position+orientation |
18:37:57 | krux02 | but that doesn't matter for tetris at all. There it is just rendering with rect(...) |
18:38:04 | krux02 | it's is very non OO |
18:40:09 | FromGitter | <Quelklef> Anyone know if there's a statically typed language that allows a definition of `someFun : A -> B` and `someFun : A -> C`? |
18:41:43 | krux02 | Quelklef: you mean static dispatch on the return type? |
18:42:08 | FromGitter | <Quelklef> I think so, yes |
18:43:32 | Araq | Quelklef: Scala might allow it |
18:43:56 | krux02 | I don't think so |
18:44:18 | krux02 | Scala is on the JVM and what the JVM doesn't allow Scala also won't allow |
18:44:40 | krux02 | (that is my scala 2.8 knowledge |
18:46:08 | FromGitter | <Quelklef> IIRC C++ allows it for some very particular cases |
18:47:04 | krux02 | Quelklef: not really |
18:47:35 | * | yglukhov[i] joined #nim |
18:47:36 | FromGitter | <Quelklef> Huh, I must have been mistaken. I thought doing `a = f()` vs `const a = f()` could result in different calls |
18:47:41 | FromGitter | <Quelklef> I only used C++ for a bit, though |
18:47:56 | krux02 | Quelklef: no it doesn't |
18:48:11 | FromGitter | <Quelklef> oops |
18:48:13 | krux02 | well let me test it |
18:48:21 | krux02 | i think you men the costness of iterators |
18:49:23 | FromGitter | <Quelklef> it was in `bitset` |
18:49:38 | FromGitter | <Quelklef> `bitset` has both `bool operator[] (size_t pos) const;` and `reference operator[] (size_t pos);` |
18:50:55 | krux02 | Quelklef: do you see the const in the end |
18:51:11 | krux02 | that is the const-ness of the `this` pointer that is in fact an argument |
18:51:27 | FromGitter | <Quelklef> Ah |
18:51:51 | FromGitter | <Quelklef> So it's not on return type then |
18:52:03 | krux02 | yes |
18:52:18 | FromGitter | <Quelklef> Sorry, I had only used C++ for a hot second :P |
18:52:35 | krux02 | well it is some advandced knowledge. |
18:52:46 | krux02 | I would not blame anybody for not knowing |
18:53:07 | krux02 | same with the abs error that I continue to see in project that use math. |
18:53:24 | krux02 | there are cases where abs just turns the argument into integers |
18:53:39 | krux02 | and that is not what you want |
18:53:40 | FromGitter | <Quelklef> ???? |
18:54:33 | FromGitter | <Quelklef> Why though |
18:55:06 | krux02 | http://ix.io/1gvp |
18:55:09 | krux02 | try it |
18:55:35 | krux02 | my output on my machine is 123.000000 |
18:55:49 | krux02 | I let you figure that out on your own. |
18:55:58 | krux02 | One of the reasons I abandon C++ |
18:56:24 | krux02 | btw on Windows it does return 123.456 |
18:56:30 | FromGitter | <Quelklef> `123.000000` for me as well |
18:56:51 | krux02 | write "using namespace std" before main and test it again. |
18:57:41 | FromGitter | <Quelklef> Well that means im calling `std::abs` instead of `cmath::abs` right? |
18:58:08 | krux02 | there is no cmath::abs |
18:58:25 | krux02 | but yes it means you are calling std::abs |
18:58:31 | FromGitter | <Quelklef> oh |
18:58:34 | FromGitter | <Quelklef> what am I calling before? |
18:58:37 | FromGitter | <gemath> Hi, somebody here who knows sth anout the AppVeyor and Travis tests for Nim on github? |
19:00:04 | krux02 | Quelklef, try the version in C as well |
19:00:08 | krux02 | it will surprise you |
19:00:22 | FromGitter | <Quelklef> Ok, my guess is the following: apparently the default `abs` is `int abs(int x)` as well as other integral types, so it's (for some reason) implicitly converting my float to an int before calling `abs`? |
19:00:23 | FromGitter | <Quelklef> Sure |
19:00:27 | krux02 | so with math.h and a c compiler |
19:00:31 | krux02 | and no namespace |
19:01:25 | FromGitter | <Quelklef> `1.000000` |
19:01:30 | krux02 | what? |
19:01:37 | krux02 | that is not what my result is |
19:01:45 | krux02 | http://ix.io/1gvs |
19:01:50 | krux02 | try that on a c compiler |
19:02:03 | FromGitter | <Quelklef> Yeah that's what I have |
19:02:28 | FromGitter | <Quelklef> with gcc, gives 1.000000 |
19:02:33 | krux02 | well I have 123.456 on gcc |
19:02:42 | FromGitter | <Quelklef> huh |
19:03:20 | Yardanico | it's 1.000000 for me on gcc 8.1 |
19:03:23 | Yardanico | krux02, what's your gcc version? |
19:03:39 | Yardanico | lol, it's 123.000000 with clang |
19:03:40 | FromGitter | <Quelklef> im gcc 7.2.0 |
19:03:40 | nasusiro | you do realize that abs() returns an integer value, don't you? |
19:03:45 | Yardanico | (on linux) |
19:03:57 | nasusiro | which gets implicitly type cast to float thanks to %f flag |
19:04:00 | Yardanico | nasusiro, but how the results can be so different? |
19:04:09 | krux02 | nasusiro, yes it does return an integer value and it is implicitly converted to double |
19:04:23 | Yardanico | 123.000000 with clang and 1.000000 with gcc, is that UB? |
19:04:49 | krux02 | nasusiro, no it gets converted to a double because of "double y = abs(...)" |
19:04:55 | krux02 | y is of type double |
19:04:57 | miran | 1.000 here too |
19:05:02 | FromGitter | <Quelklef> But why does it call the `int abs(int)` instead of erroring? yuck |
19:05:41 | nasusiro | krux02: yep, correct. |
19:06:04 | krux02 | on a C compiler it will call "double fabs(double)" because of a macro abs that checks the type of the first argument |
19:06:07 | nasusiro | confusion happens from use multiple languages at the same time |
19:06:10 | krux02 | that is a C only feature |
19:06:32 | krux02 | introduced in c99 |
19:06:39 | krux02 | to implement static dispatch |
19:06:39 | FromGitter | <Quelklef> But shouldn't cpp complain? |
19:06:53 | krux02 | well with -Wconversion yes it does complain |
19:07:18 | krux02 | the problem, when you call -Wall it doesn't complain, you explicitly have to add -Wconversion as well |
19:07:20 | Araq | nasusiro: message passing is not my cup of tea. |
19:07:28 | FromGitter | <Quelklef> Aw man |
19:07:39 | FromGitter | <Quelklef> And then it's just a warning |
19:07:42 | Araq | creates hard to debug situations |
19:07:45 | FromGitter | <Quelklef> That's pretty yikes |
19:08:01 | nasusiro | with GCC 7.3.0 I get 123.000000 |
19:08:09 | nasusiro | Araq: no worries mate. |
19:08:23 | nasusiro | I'm studying Go's concurrency for educational purposes |
19:09:00 | nasusiro | I would like to see how we could some useful tips and tricks from Go's internals for Nim's use |
19:09:16 | nasusiro | the concept of Goroutines looks really cool to me |
19:10:33 | krux02 | I made a mistake I thought calling test.cpp with gcc compiles with the c compiler. it doesn't |
19:10:55 | krux02 | gcc is the entire gnu compiler collection and it picks the compiler on the file ending |
19:11:02 | krux02 | gcc -x c is a c compiler |
19:13:55 | FromGitter | <k0pernicus> @nasusiro goroutines aren't "just" a "pretty-cool-name-for-the-community" name for green threading? |
19:14:09 | Araq | nasusiro: I still believe in Nim's "guards" |
19:14:21 | nasusiro | k0pernicus: nope |
19:14:32 | nasusiro | it's an advanced mechanism that is so cool in use |
19:14:47 | nasusiro | you can have countless goroutines for a single OS thread |
19:15:02 | Araq | that is green threading. |
19:15:20 | FromGitter | <k0pernicus> That is green threading, yep |
19:15:28 | nasusiro | not really. Green threads emulate OS threads, but do not depend on actual OS threads |
19:16:53 | Araq | ? |
19:17:19 | Araq | I guess these terms are not well defined, as usual. |
19:17:41 | Araq | for me green threads is exactly that, you map X green thread onto an OS thread |
19:18:45 | krux02 | Goroutines are not like threads. Threads can be interrupted at any state and then the state of the thread is stored and at a later state resumend. Goroutines are more light weight, because they are more like returning from a resumable function when they yield |
19:18:56 | nasusiro | the runtime handles the threads instead of letting the OS do so |
19:19:10 | nasusiro | so, Go's runtime handles N green threads with M OS threads |
19:19:19 | Araq | huh? a Goroutine can be interrupted at any state. |
19:19:58 | Araq | in fact, that's how the shared GC works, it interrupts the goroutine(s) |
19:21:09 | krux02 | Araq: thought goroutines are not interrupted at any state, when they go to a yield or a possible blocking, the actual system thread that is executing that goroutine continues to execute the next goroutine |
19:21:29 | Araq | what is a 'yield'? Go has no such keyword |
19:21:48 | krux02 | with yield I mean a possible blocking operation such as reading from a channel |
19:21:57 | Araq | it's not cooperative threading |
19:22:13 | Araq | a goroutine can be interrupted by Go's scheduler. |
19:22:48 | krux02 | well then I have no idea of Go works |
19:23:56 | Araq | I studied its GC a bit. I stopped reading when I figured its write barrier relies on "benign" data races |
19:24:20 | Araq | though to be fair Haskell does that too iirc |
19:24:32 | Araq | but it's just nothing I ever want to write and debug |
19:24:35 | krux02 | I am still confused by the word benign |
19:24:47 | krux02 | it looks like a typo of begin |
19:25:25 | krux02 | well I don't believe in a global gc. |
19:25:37 | nasusiro | krux02: think of it as "kind, good" |
19:26:28 | krux02 | I can agree that a gc is helpful to have an easier job at solving certain kinds of problems. But a global gc that has to stop the word and collect everything can really get in the way of real time applications. |
19:26:53 | nasusiro | you mean the work or the world? |
19:26:55 | krux02 | so I really like the Nim model with thread local gc |
19:27:09 | krux02 | world |
19:27:15 | nasusiro | ah cool |
19:28:07 | krux02 | during gc nothing can operate on the data that is being cleaned up. But in thread local GC there is the possibility that the GC just collects one thread while the other threads just continue what they are doing. |
19:28:16 | krux02 | so the program isn't interrupdet just the thread |
19:28:35 | krux02 | removing most of the problems a gc comes with. |
19:29:40 | nasusiro | I don't disagree with you krux02, but what I like about Go is how it handles thousands of concurrent operations without a fuss. I haven't played with Nim's concurrency model yet, but I'm getting there |
19:29:56 | nasusiro | if I can push Nim's limits the same way Go let me do so, I will be more than pleased |
19:30:56 | nasusiro | Go's LWPs are the real power that handle so many concurrent operations and that is something I would like to see in a Nim demo. |
19:32:39 | krux02 | nasusiro, well you can also create lots of objects of type Problem and call the `handle` method in a loop |
19:33:10 | nasusiro | I'm still learning Nim, but I'm taking notes and I will do so as soon as I get there. thank you for letting me know |
19:34:09 | elrood | sometimes this channel just randomly generates comedy gold |
19:34:35 | nasusiro | do you mind to share the fun part elrood? |
19:36:49 | * | lompik quit (Ping timeout: 268 seconds) |
19:36:58 | elrood | too brain-thread-local to be shared, sorry |
19:38:42 | nasusiro | so you just pass by and implicitly offend people with your comments and then you don't justify your sayings? Are you a troll or something? |
19:44:58 | dom96 | whoa, why is what elrood said offensive? |
19:45:10 | elrood | apologies if you feel offended by that, that certainly wasn't intended |
19:45:59 | nasusiro | dom96: if you consider this line "sometimes this channel just randomly generates comedy gold" innocent, I don't know what to say...seriously now. |
19:46:21 | nasusiro | even if I am talking bullshit here, just justify your statement(s) by point me at the right direction |
19:46:22 | livcd | elrood: fascinating. You already apologized to him yesterday as well |
19:46:41 | nasusiro | livcd: you see, that's where you are wrong |
19:46:46 | nasusiro | I was the one who apologized |
19:46:58 | dom96 | I didn't read any of the previous conversation, so maybe I'm completely missing context here |
19:47:23 | livcd | nasusiro: oh true sorry |
19:47:38 | shashlick | when does nim decide to pass -DWIN32_LEAN_AND_MEAN to gcc? |
19:48:20 | nasusiro | you people are so quick to judge anything and everything behind a monitor...bloody hell, I can't find a decent channel without SJWs and public defenders...I have started losing interest in Nim right now -_- |
19:48:59 | krux02 | shashlick have you tried using "grep -i WIN32_LEAN_AND_MEAN" in the nim folder? |
19:49:17 | Araq | nasusiro: relax, there are no SLWs around |
19:50:08 | Araq | and wasn't it you you started with "offensive!" anyway |
19:50:21 | livcd | nasusiro: I would say #go-nuts is more opinionated than #nim |
19:50:47 | nasusiro | I haven't had such problems with #go-nuts so far |
19:50:50 | nasusiro | anyway |
19:51:02 | livcd | you had problems in #nim ? |
19:51:15 | Araq | which problems? it's like I missed some crucial part of the conversation |
19:51:22 | FromDiscord | <exelotl> I'm so confused haha |
19:52:37 | dom96 | This isn't something we should be discussing here. For those who want to discuss this further please jump onto PM with me |
19:52:51 | nasusiro | livcd: did you see me say "#nim"? I said "I haven't had such problems with #go-nuts so far", that is about opinionated issues under Go's channel |
19:52:52 | shashlick | krux02: i searched on github but it was pointless - nimgrep found it in a second locally |
19:54:04 | shashlick | it is included if you import winlean |
19:54:05 | krux02 | yea I also prefer to search locally |
19:54:20 | shashlick | thing is that I don't have that import anywhere and yet it gets added |
19:54:34 | krux02 | github search is not completely useless though I don't want to clone everytghing that I search on |
19:55:38 | livcd | is it only me or gh search became worse ? |
19:56:56 | Araq | that regression is so weird |
19:57:11 | nasusiro | livcd: yeah, it is. let's hope they will fix it eventually. people opened a ticket suggesting Microsoft to open the Github platform as open source so people can start fixing issues and add support to important mechanisms such as a proper search engine for GH |
19:57:35 | Araq | nowhere in tmultim2.nim any typetrait is used |
19:58:13 | * | TheLemonMan joined #nim |
19:58:19 | FromGitter | <xDotDash> where can this ticket be found? |
19:58:30 | TheLemonMan | Araq, yo, #8249 fixes the regression |
19:58:51 | Araq | TheLemonMan: huh? did you fix it? |
19:58:51 | livcd | nasusiro: i hope microsoft invests in Ruby instead :P |
19:59:10 | TheLemonMan | Araq, of course, that's what I'm paid to do |
19:59:37 | nasusiro | livcd: haven't they added the experimental JIT support yet and so incredible performance improvements? |
19:59:45 | Araq | ah ok. mind to share who is paying you? |
19:59:46 | nasusiro | not Microsoft that is, but the Ruby team |
20:00:54 | * | krux02 quit (Remote host closed the connection) |
20:01:49 | dom96 | livcd: Ruby? Blasphemy |
20:02:01 | nasusiro | livcd: now that you mentioned Ruby...I wonder whether they use Crystal for some of their critical parts |
20:03:50 | nasusiro | Araq: you know what it would be cute? To codename Nim's threading mechanism as nima. νήμα in Greek means thread :D |
20:03:53 | FromGitter | <k0pernicus> Ruby, Crystal… It's not the same thing at all… ⏎ Crystal's syntax is inspired by Ruby, but the back-end, libraries and all other stuff are different |
20:04:05 | FromGitter | <k0pernicus> It's like comparing Python and Nim |
20:04:17 | Araq | exept we have py2nim ... |
20:04:20 | * | Araq coughs |
20:05:03 | nasusiro | k0pernicus: I meant in case they want to move some critical parts of GH's infrastructure to a static typed language |
20:05:06 | FromGitter | <k0pernicus> Cython to Nim is included? |
20:05:21 | nasusiro | if Crystal resembles to Ruby, logically it would be easier to learn it in no time |
20:05:39 | FromGitter | <k0pernicus> Think that critical libraries of Python (numpy, scipy, sklearn, …) are written using Cython |
20:05:47 | nasusiro | Cython is a C-extension for Python, so technically does not count |
20:07:33 | * | fjvallarino quit (Ping timeout: 264 seconds) |
20:08:12 | nasusiro | Araq: I'm reading this article of yours https://nim-lang.org/araq/destructors.html and I'm really impressed by the way you write. |
20:08:43 | nasusiro | I wanted to ask you about this article; why you choose the name "destructor" if you are not dealing with actual objects? why not eliminator? |
20:11:09 | * | miran quit (Ping timeout: 264 seconds) |
20:11:27 | * | zahary joined #nim |
20:12:30 | * | xet7 quit (Quit: Leaving) |
20:18:15 | Araq | oh yeah, that article was rather well received, it has follow up posts in the form of RFCs on github |
20:19:07 | nasusiro | oh yeah, I forgot to look at GH |
20:20:13 | livcd | dom96: i just like ruby |
20:21:16 | * | yglukhov[i] quit (Remote host closed the connection) |
20:24:11 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
20:24:16 | FromGitter | <dom96> @zacharycarter ping |
20:26:40 | FromGitter | <citycide> has anyone implemented a "safe call" operator? something to make `if someProc != nil: someProc(...)`nicer when I've got procs dealing with optional proc parameters |
20:27:26 | Araq | nasusiro: a destructor is attached to an object type in Nim. the design is really close to C++'s |
20:27:34 | nasusiro | Araq: ah I see |
20:27:49 | Araq | but now I'm intrigued |
20:28:00 | nasusiro | about what exactly? |
20:28:08 | Araq | do you have an idea what your 'eliminators' could look like? |
20:28:27 | nasusiro | well, think of RAII in a lightweight way |
20:29:03 | nasusiro | sometimes we think in a complex way by default, but the real virtue comes with simplicity |
20:29:25 | nasusiro | if I'm not mistaken, Nim has a try - finally mechanism, am I correct? |
20:32:57 | * | find0x90 joined #nim |
20:33:48 | nasusiro | Araq: so, what happens to variables that go out of scope? do they get freed by the GC or do they get released immediately? |
20:33:59 | * | PMunch joined #nim |
20:43:42 | FromGitter | <Varriount> @citycide Look at the `options` module. |
20:44:47 | FromGitter | <Varriount> @citycide For my command shell program, I have a function that returns a procedure wrapped in an option. It works pretty well. |
20:48:00 | Araq | nasusiro: well the variables themselves are on the stack and get released immediately |
20:48:13 | nasusiro | that's a plus then. |
20:48:20 | Araq | but what they point to - if it's on the GC'ed heap - is GC'ed |
20:51:31 | * | find0x90 quit (Quit: find0x90) |
20:52:07 | nasusiro | hmm... |
20:52:42 | nasusiro | how fast is Nim's GC? |
20:53:39 | FromGitter | <Varriount> nasusiro: Pretty fast. |
20:54:05 | nasusiro | Araq: another question. Is Nim's move mechanism the same as C++11's? |
20:54:35 | * | nsf quit (Quit: WeeChat 2.1) |
20:59:25 | FromGitter | <kayabaNerve> Araq What's up with ref? |
21:00:03 | FromGitter | <kayabaNerve> In that linked article you mentioned a dislike/avoidance/behavior change |
21:00:26 | FromGitter | <kayabaNerve> Has that happened, will that happen... Or did your thoughts change? |
21:03:13 | FromGitter | <kayabaNerve> I'm guessing 1/3 :p |
21:03:44 | FromGitter | <kayabaNerve> If 3, I am curious to know your thoughts/how ref has evolved/reasons to avoid |
21:07:36 | * | Vladar quit (Quit: Leaving) |
21:09:20 | shashlick | araq: when was the tmultim2.nim issue fixed? |
21:10:07 | Araq | shashlick: a couple of hours ago |
21:10:21 | shashlick | ok |
21:10:33 | shashlick | any idea why this is failing: https://travis-ci.org/nim-lang/Nim/jobs/401484249#L3576 |
21:12:47 | shashlick | ok, I had to merge those fixes into my branch anyway, hoping for the best |
21:16:41 | dom96 | Araq: What was the problem? |
21:16:46 | dom96 | That failure puzzles me |
21:19:45 | FromGitter | <Varriount> Has the notation that allows templates to accept code blocks been changed to special-case `else` following the template invocation? |
21:21:59 | FromGitter | <Varriount> I'm receiving errors from the compiler after trying this: https://gist.github.com/Varriount/2b1f0c02db5bdd03574c967924bacd75 |
21:25:00 | nasusiro | Araq: in the aforementioned article that I shared before, in section Strings, where you show how proc `move`*(...) is implemented, why is b.data nil-ed and not dealloc()-ated first and then nil-ed? Is this behavior safe? |
21:26:35 | Araq | 'move' is an ownership transfer, nothing gets destroyed. |
21:26:51 | Araq | well except if 'a' already had data... |
21:27:12 | nasusiro | but we assigned b.data inside a.data... |
21:27:20 | nasusiro | therefore b.data is useless to us now. |
21:28:58 | PMunch | Araq, did you see my request for information about dynlib and GC? |
21:29:03 | PMunch | I really can't get it to work |
21:29:38 | PMunch | Sometimes it works with one plugin, sometimes it just fails, sometimes combinations of plugins fails, but each plugin separately works. |
21:29:40 | Araq | PMunch: https://nim-lang.org/docs/nimc.html#dll-generation read this? |
21:30:02 | Araq | every plugin needs to use 'nimrtl.dll' (which need to build first) |
21:30:07 | PMunch | Yeah I've read that |
21:30:23 | Araq | dom96: system.nim changed the compiler's hash table order |
21:30:33 | Araq | and the compiler never was correct, but lucky |
21:30:42 | dom96 | I see |
21:30:43 | Araq | so a wrong symbol was bound |
21:30:46 | PMunch | And compiled nimrtl and compiled the program with -d:useNimRtl along with all the plugins |
21:32:37 | Araq | nasusiro: move(a, b) means a is the owner of what b used to hold |
21:32:51 | Araq | and so a steals the pointers from b |
21:33:04 | nasusiro | Araq: true. but b has no use anymore, correct? |
21:33:14 | Araq | but b's destructor needs to be prevented from doing bad things, and so b gets nil'ed |
21:33:47 | nasusiro | wait a minute...when you dealloc() b.data, the destructor gets called? |
21:35:20 | PMunch | Araq, this is what I have so far: http://ix.io/1gws |
21:40:14 | * | krux02 joined #nim |
21:41:55 | dom96 | PSA: CVE-2018-13034 in Jester: https://forum.nim-lang.org/t/4028 (our first ever CVE :D) |
21:42:06 | shashlick | many failures on travis mac - is there any plan to get all tests passing on mac? https://travis-ci.org/nim-lang/Nim/jobs/401534177 |
21:42:54 | * | Trustable quit (Remote host closed the connection) |
21:47:33 | nasusiro | dom96: bloody hell...so I guess we should open a champagne now? |
21:48:24 | dom96 | totally |
21:49:04 | nasusiro | lol, I have managed to crash the search inside https://nim-lang.org/docs/manual.html |
21:49:27 | nasusiro | I was typing fast and had a typo; I pressed backspace and it froze now |
21:50:06 | nasusiro | that's under waterfox 56.2.1 |
21:52:28 | PMunch | Loving the way you ended up implementing the modular routes by the way dom96 :) |
21:52:49 | dom96 | PMunch: Yay, glad you like them :) |
21:53:40 | Araq | shashlick: yup |
21:53:54 | Araq | PMunch: hmm tough nut. post it on the forum please |
21:54:40 | nasusiro | Araq: wait a minute...what am I thinking? Indeed by nil-ing b.data you no longer point at the same location where now a.data points. That's exactly how C or C++ do it. Oh man...I've got brain damage with so many languages in my head lol |
21:57:15 | dom96 | Araq: Did you fix this manually? |
21:57:16 | dom96 | https://github.com/nim-lang/Nim/pull/7234#event-1500957290 |
21:57:18 | dom96 | or what? |
21:58:01 | Araq | no. I decided there is nothing to fix. |
21:58:11 | Araq | the way math.nim does it makes sense. |
21:58:55 | dom96 | Oh, I missed your comment |
21:59:16 | CodeVance | Araq: Would using the C++ backend effect compilation speed? Or speed overall. |
21:59:54 | Araq | from my latest experiments compilation times are unaffected |
22:00:20 | Araq | and overall speed increases because of the better exception handling implementation |
22:00:37 | dom96 | Araq: In what world should float ^ float fail? |
22:01:06 | FromGitter | <kayabaNerve> What's the differences between the two anyways? 99.99% of C is valid C++. I doubt we are using any c++ specific features as something that high level would cause slow doesn't |
22:01:13 | Araq | it's pow() and uses a totally different algorithm than ^ |
22:01:26 | dom96 | so? |
22:01:35 | FromGitter | <kayabaNerve> *mainly thinking stl than features *downs |
22:01:39 | dom96 | I and most people really don't care what algorithm it uses |
22:01:46 | dom96 | we just want to apply `^` to two floats |
22:01:54 | Araq | yeah but you don't. |
22:02:11 | Araq | you don't even know what x ^ 0.3 means |
22:02:14 | Araq | :P |
22:02:43 | FromGitter | <kayabaNerve> Whats the difference between ^ and pow? |
22:03:17 | FromGitter | <kayabaNerve> I think a quick sumup would be better than "yeah but you don't" :p |
22:03:23 | CodeVance | speed |
22:03:26 | CodeVance | performance |
22:03:31 | CodeVance | the performance is bad |
22:03:49 | dom96 | Araq: who are these "others" that agreed with you? |
22:04:03 | Araq | just read the issue |
22:04:13 | dom96 | Two people thought it was important enough to create a PR for it |
22:06:04 | Araq | and not important enough to create a PR for it that would even pass the CIs |
22:06:38 | dom96 | lol ok |
22:06:47 | dom96 | I'll recreate the PR if I run into this again |
22:07:15 | PMunch | Hmm, the reset password mail for the forums never arrived.. |
22:07:17 | FromGitter | <kayabaNerve> But do they return different results? If not, why not just use the overall better algorithm. Most people won't care, expect both, and will have a 50/50 chance of picking the slower one... |
22:07:44 | dom96 | PMunch: Spam? |
22:08:14 | PMunch | Not on Gmails end, but my mail forwarder has a really aggressive spam filter.. |
22:08:27 | PMunch | I really should set up something else.. |
22:09:55 | nasusiro | Araq: about using C++ backend, as long as you don't use anything with templates, the speed should be on a par with C |
22:14:58 | CodeVance | If I want to include an "asset" folder. is there a way to do that with nimble |
22:16:27 | FromGitter | <xDotDash> How should I supply a default string if the provided one is nil? |
22:17:57 | CodeVance | if val.isNil: "" else: val |
22:21:10 | FromGitter | <xDotDash> Ah ok |
22:22:02 | CodeVance | is that what you want? |
22:22:54 | * | PMunch quit (Quit: leaving) |
22:23:19 | FromGitter | <xDotDash> Yea, I was just wondering if there was a standard proc for supplying a default value for an arbitrary type/value |
22:25:50 | * | fjvallarino joined #nim |
22:28:06 | dom96 | bah PMunch, why leave now? I just got you your password reset link |
22:28:08 | * | find0x90 joined #nim |
22:34:32 | nasusiro | dom96: don't you have his email? |
22:35:20 | dom96 | true, but if he's gone to sleep by the time he wakes up the link will be expired |
22:39:23 | nasusiro | you have nothing to lose. |
22:42:14 | shashlick | gemath: what you looking for? |
22:48:33 | FromDiscord | <exelotl> hey what color scheme do you use for the code sample on https://nim-lang.org/ |
22:51:12 | * | crem quit (Ping timeout: 256 seconds) |
22:52:43 | nasusiro | exeoltl: it took me a couple of seconds to view the website's source code and it's called dracula |
22:53:03 | nasusiro | https://nim-lang.org/assets/css/highlight/dracula.css |
22:53:15 | * | crem joined #nim |
22:53:20 | nasusiro | here's the actual link for it https://github.com/zenorocha/dracula-theme |
22:55:58 | FromDiscord | <exelotl> oh nice, thanks |
22:57:27 | FromGitter | <kayabaNerve> @xDotDash CodeVance `proc x(y: int = 0) =` ??? |
22:57:54 | FromGitter | <xDotDash> hmm? |
22:57:56 | CodeVance | kayabaNerve? |
22:58:07 | FromGitter | <kayabaNerve> Default values? |
22:58:21 | FromGitter | <kayabaNerve> Why use a if statement when you can just define it in the process declaration? |
22:58:44 | CodeVance | for a proc sure |
22:58:51 | FromGitter | <xDotDash> I was thinking more along the usage of this `"my possibly nil string".elseIfNil("my default")` |
22:59:15 | FromGitter | <kayabaNerve> @xDotDash is it in a proc? |
22:59:25 | FromGitter | <xDotDash> It's in a proc but not an argument for it |
22:59:25 | FromGitter | <kayabaNerve> If so, just use what I said |
22:59:58 | FromGitter | <kayabaNerve> If it's user input, then what CodeVance said |
23:00:04 | * | elrood quit (Quit: Leaving) |
23:00:17 | FromGitter | <xDotDash> yea it's user input, so I am using what he suggested |
23:00:36 | CodeVance | Are you talking about optional? |
23:02:08 | FromGitter | <kayabaNerve> Never mind |
23:02:22 | FromGitter | <kayabaNerve> Optional arguments can be used to prove default values |
23:02:34 | FromGitter | <kayabaNerve> Both terms apply |
23:03:39 | FromGitter | <kayabaNerve> Just trying to help :p sorry I misunderstood the context. I'm happy you found what you needed |
23:05:22 | krux02 | xDotDash: don't use nil strings. It is inteded to remove the nil state of th strins |
23:05:45 | FromGitter | <xDotDash> 👍 |
23:07:19 | krux02 | xDotDash: but for nilable types you can overload the ``or`` operator. |
23:08:00 | krux02 | ``proc `or`[T](a,b: ref T): ref T = if a.isNil: b else: a |
23:08:45 | CodeVance | I thought strings aren't nilable |
23:08:59 | krux02 | that code won't work for strings |
23:09:10 | krux02 | and strings are nilable in the past version of Nim |
23:19:33 | nasusiro | Does Nim has a help() command like Python does? I want to read more about the builtin types and manual does not say almost anything...https://nim-lang.org/docs/system.html#string |
23:21:48 | krux02 | nasusiro: no it does not, and it does not really have a repl, even though there is "nim secret" |
23:22:02 | nasusiro | is that a command? |
23:22:16 | nasusiro | or you mean the TCC repl attempt? |
23:22:29 | krux02 | nasusiro, secret is an argument to the nim compiler |
23:22:58 | krux02 | but it does not use readline at all |
23:23:05 | krux02 | so I recommend to use it with rlwrap |
23:23:27 | krux02 | "rlwarp nim secret" on the command line if you are on linux and have nim on the path and have rlwrap on the path |
23:24:18 | nasusiro | I don't have rlwrap installed, whatever that is... |
23:24:50 | nasusiro | readline line wrapper, cool. |
23:24:50 | krux02 | it is a command line sulution to use 'gnu readlibe' with any program that does not have readline support |
23:25:11 | nasusiro | I'm OK with compiling my code for the moment :) |
23:25:25 | nasusiro | thanks for your kind suggestions though, I appreciate it. |
23:25:36 | krux02 | the problem is readline is gpl, and rlwrap works around that issue and there is basically no integration work needed |
23:27:22 | krux02 | link gpl to something, this something has to be gpl, too. Unless you never release that something at all at any license. |
23:32:47 | nasusiro | what about LGPL then? |
23:33:55 | krux02 | well I don't know a lot about lgpl, but I know Nim isn't LGPL |
23:34:07 | krux02 | and readline is GPL |
23:34:21 | krux02 | so I don't know what lgpl should solve |
23:39:07 | krux02 | I just looked at lgpl. It means that the end user should always be allowed to inspect modify and relink the lpgl part of the program. |
23:47:28 | nasusiro | so, what exactly is the problem with readline's license again? |
23:47:49 | krux02 | nasusiro, well it is gpl |
23:48:00 | nasusiro | again, what's wrong with GPL? |
23:48:07 | krux02 | and gpl basically says, whatever you link with gpl has to be gpl, too. |
23:48:27 | nasusiro | says who? |
23:48:31 | krux02 | the gpl |
23:48:50 | nasusiro | so if I have a source that is under MIT, I'm not allowed to compile it with GPL code? |
23:49:08 | krux02 | well you are allowed |
23:49:24 | krux02 | but the project then has to be gpl |
23:49:30 | krux02 | in simple words |
23:50:25 | krux02 | individual parts may be mit or other licenses, but the whole preject is the logical `and` of all the restrictions the licenses put on the project |
23:50:58 | krux02 | so to say it is gpl is not entirely correct, but being said that gpl is the most restrictive open source license it is practically correct. |
23:51:04 | nasusiro | I still don't understand how readline's license affects its use with any program |
23:51:14 | krux02 | well readline is gpl |
23:51:27 | krux02 | so when you have a project and call link it with readline |
23:51:48 | krux02 | that project has to be licensed as gpl as well. |
23:52:16 | nasusiro | are you referring at char * readline(const char *prompt); or the actual urxvt-readline which is licensed under GPL? |
23:53:09 | krux02 | nasusiro, isn't that function you just reffered to the core function of the gnu readline library? |
23:54:32 | nasusiro | yes |
23:55:19 | krux02 | and when you use that function you inevitably have to link to readline |
23:57:33 | krux02 | it is possible though to split the program into gpl-licensed-part. mit-licensod-part and the union of both parts that is then gpl again. |
23:58:48 | nasusiro | so that's why people are complaining so much about GPL |
23:58:59 | krux02 | probably |
23:59:12 | nasusiro | interesting |
23:59:57 | nasusiro | but I still don't understand your concern about using readline...unless you meant the cases of someone wanting to build a proprietary application |