00:01:16 | rudi_s | I wouldn't call it horseshit, but it's true that it has many issues as well. |
00:03:15 | FromGitter | <Araq> and it's very ironic that Linus rants about how you cannot "fix CVS" (referring to SVN) when he did the very same. you cannot fix Unix, you start from scratch to design an OS that makes sense. or you fail and produce something worse, but at least it would have been something interesting. |
00:06:02 | Trixar_za | You're on Gitter too? |
00:06:38 | FromGitter | <Araq> my IRC client thinks it's OK to reconnect every 5 secs |
00:06:44 | FromGitter | <Araq> so yes. |
00:09:35 | * | elrood quit (Remote host closed the connection) |
00:09:38 | Trixar_za | My friend that works on WSE dragged me on it - it's not bad for what it is. I didn't expect a transport bot though |
00:18:15 | * | PMunch joined #nim |
00:22:59 | * | Demon_Fox quit (Quit: Leaving) |
00:24:39 | * | chemist69 joined #nim |
00:33:14 | * | PMunch quit (Quit: leaving) |
00:33:31 | * | PMunch joined #nim |
00:41:41 | * | Demon_Fox joined #nim |
00:42:31 | * | PMunch quit (Quit: leaving) |
00:44:28 | * | PMunch joined #nim |
00:53:23 | * | libman quit (Remote host closed the connection) |
01:19:06 | * | nsf quit (Quit: WeeChat 1.5) |
01:19:46 | * | PMunch quit (Quit: leaving) |
01:19:52 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:20:12 | * | PMunch joined #nim |
01:39:15 | * | Jesin quit (Ping timeout: 260 seconds) |
01:42:54 | * | Jesin joined #nim |
01:58:21 | * | girvo joined #nim |
01:58:58 | * | girvo waves |
02:00:06 | * | chemist69 quit (Ping timeout: 265 seconds) |
02:02:05 | * | PMunch quit (Quit: leaving) |
02:02:57 | * | ftsf joined #nim |
02:13:16 | * | chemist69 joined #nim |
02:31:37 | * | jivank_ quit (Ping timeout: 248 seconds) |
02:36:37 | * | niv quit (Remote host closed the connection) |
03:12:56 | * | desophos quit (Read error: Connection reset by peer) |
03:15:53 | * | brson quit (Ping timeout: 248 seconds) |
03:19:15 | * | ThisIsZenified quit (Ping timeout: 272 seconds) |
03:19:39 | * | ThisIsZenified joined #nim |
03:58:31 | * | Sentreen quit (Ping timeout: 265 seconds) |
04:10:07 | * | Sentreen joined #nim |
04:53:59 | * | pie__ quit (Changing host) |
04:53:59 | * | pie__ joined #nim |
05:01:25 | * | pleiosaur quit (Remote host closed the connection) |
05:27:09 | * | lxdong joined #nim |
05:33:25 | * | rtr_ joined #nim |
05:47:21 | * | xet7 quit (Quit: Leaving) |
05:48:09 | girvo | Hey all, question: |
05:48:12 | girvo | result, or return? |
05:48:53 | FromGitter | <endragor> girvo: the answer is here: http://nim-lang.org/docs/nep1.html |
05:49:38 | girvo | OMG I've been hoping for something like this! |
05:49:39 | girvo | Thanks! |
06:23:51 | * | xet7 joined #nim |
06:30:10 | * | GustavoLapasta joined #nim |
06:31:33 | * | rtr_ quit (Remote host closed the connection) |
06:39:15 | * | brechtm_ quit (Read error: Connection reset by peer) |
06:39:21 | * | brechtm joined #nim |
06:44:56 | girvo | Really dumb q: quickly dumping a text representation of a ref object? |
06:45:43 | FromGitter | <Araq> $x[] # deref the 'ref' and call $ |
06:45:54 | FromGitter | <Araq> repr x # sooo popular I cannot kill it |
06:48:50 | * | girvo thinks he should move to Gitter |
06:49:11 | girvo | Cheers Araq; I need to define `$` on this type first. Brain fart! |
06:49:19 | * | Trustable joined #nim |
06:51:48 | FromGitter | <Araq> well $ is predefined for 'object', but not for 'ref object' |
06:52:12 | girvo | Oh right! That makes sense |
06:57:11 | * | yglukhov joined #nim |
07:02:49 | * | yglukhov quit (Ping timeout: 272 seconds) |
07:10:35 | girvo | Lastly, safely accessing a string value from a JsonNode, where the key might not exist? I can't see anything in the json module's docs, but I'm prolly just missing it |
07:10:47 | girvo | (Ideally without needing an intermediate variable) |
07:13:33 | * | csoriano_ joined #nim |
07:13:39 | * | csoriano_ is now known as csoriano |
07:14:29 | * | space-wizard quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:14:39 | FromGitter | <endragor> @girvo getOrDefault? |
07:21:25 | girvo | endragor: Thats what I was trying to use, but I can't understand how to use it properly |
07:22:03 | girvo | Say I have a "conf" JsonNode, with an "example" key (and "test" value for that key), I dont' really get how to use getOrDefault |
07:22:25 | girvo | conf["example"].getOrDefault()? Doesn't that still throw a KeyError? |
07:22:33 | girvo | raise* not throw |
07:27:26 | flyx | girvo: no, it will never throw a KeyError |
07:28:46 | girvo | flyx: well I am an idiot then :) |
07:29:00 | FromGitter | <endragor> conf.getOrDefault(“example”) - I guess this is what you mean |
07:29:16 | flyx | ah yes |
07:29:20 | flyx | I misread it |
07:31:02 | girvo | Yeah it sort of is, except I want the "default" in this case to be an empty string instead of "nil", my reading of the docs is that it will be "nil"? |
07:32:05 | * | rtr_ joined #nim |
07:32:11 | girvo | Ah wait! |
07:32:26 | girvo | I combine it with getStr and I should be fine |
07:32:39 | girvo | conf.getOrDefault("example").getStr("default val if needed") |
07:33:03 | girvo | Or.. wait, shit, won't that possibly call "getStr" on nil? |
07:33:22 | girvo | Nope, it will work; "Returns default if n is not a JString, or if n is nil." |
07:33:26 | girvo | Cool :) |
07:33:27 | FromGitter | <endragor> getStr on nil is fine |
07:33:30 | FromGitter | <endragor> right |
07:34:12 | FromGitter | <Araq> @endragor json.nim needs to support blobs, it should use \x, old serializations use \u, problem solved, backwards compatibility restored |
07:34:22 | ldlework | Anyone in SF and want me to buy them a ticket to the roguelike developer conference this saturday? |
07:34:34 | ldlework | they are sold out but I got a hold of the coordinator |
07:34:53 | FromGitter | <endragor> @Araq there is no `\x` in JSON |
07:35:09 | FromGitter | <Araq> yes, it would be a nim specific json extension |
07:36:21 | girvo | Aw getStr won't work with "string not nil" heh |
07:36:30 | FromGitter | <endragor> the grammar strictly defines what can follow `\`. `x` is not in the list |
07:37:07 | FromGitter | <endragor> other parsers may not work with that. are you fine with that? |
07:38:29 | FromGitter | <Araq> yes. do you have an alternative? |
07:40:47 | * | rtr_ quit (Ping timeout: 244 seconds) |
07:46:33 | FromGitter | <endragor> well, the array of charcodes was backward-compatible. I guess your approach is the only viable if we want to keep backward compatibility AND produce human readable strings in marshal. |
07:48:23 | FromGitter | <endragor> as another option, array of charcodes could be used only when the string contains at least a single invalid UTF-8 sequence |
07:48:47 | * | Andris_zbx joined #nim |
07:49:14 | FromGitter | <endragor> that would produce array only for binary, non-UTF-8 data |
07:51:21 | flyx | I suggested some days ago to introduce a `blob` type as distinct string so that blobs can be handled differently. I believe I did not get any feedback on that |
07:59:26 | FromGitter | <endragor> @Araq needs to comment on that. It makes sense, but it still leaves possibility of binary strings that people (and stdlib) will have to deal with. That would make more sense if the language guaranteed that `string` is always a valid UTF-8 sequence (unless unsafe operations are used). Is `blob` the right term here? It’s usually realted to databases. |
08:02:03 | flyx | I think blob is totally fine and is not related to databases (they use it there, but it does not originate from there) |
08:03:22 | flyx | concerning string safeness, I think we get enough safety by returning and using blob as type everywhere where the data is not necessarily a valid UTF-8 string. |
08:04:12 | flyx | the only way the user can then create an invalid string is to add a char which is greater than 0x7F |
08:06:30 | flyx | I believe a lot of other functionality will break too if an input string is not valid UTF-8, so we can either define that it is not necessarily UTF-8, or we define it is and the user is at fault if he inserts invalid sequences |
08:08:17 | * | Raaaa joined #nim |
08:10:06 | * | yglukhov joined #nim |
08:14:24 | * | elrood joined #nim |
08:22:00 | * | nsf joined #nim |
08:22:16 | Araq | flyx: we have TaintedString, maybe that's already a Blob? |
08:22:42 | Araq | it's an Input string, so it's not guaranteed to be UTF-8 |
08:22:57 | * | bjz joined #nim |
08:23:41 | flyx | Araq: well, conceptually it may be, but it surely would be confusing for readers if some proc that expects binary data defines its input type as TaintedString |
08:24:21 | * | girvo quit (Ping timeout: 265 seconds) |
08:25:02 | flyx | also, TaintedString depends on a compile-time switch. I believe blobs should always be distinct. |
08:34:05 | Raaaa | +1 |
08:37:40 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:48:05 | * | spindle joined #nim |
08:54:19 | Araq | if blob == "abc"; blob.add("foo"); blob[1..4]; blob =~ re"foo"; is there some string operation that 'blob' doesn't support? I think it's a bad idea |
08:54:56 | * | bjz joined #nim |
08:55:29 | Araq | and if you add a converter from blob to string nothing is gained. |
08:55:29 | flyx | those in unicode obviously. also, I do not think that blob should support regex |
08:56:06 | Araq | type ReallyUtf8 = distinct string makes more sense then |
08:56:13 | flyx | I only wanted a converter from string to blob because that's safe |
08:56:21 | Araq | with a converter to string |
08:56:57 | Araq | and Unicode working on ReallyUft8, wait no, because unicode is also about validating the unicode. |
08:58:27 | flyx | well, if there is a string type, no-one would think of using ReallyUtf8 |
08:59:23 | flyx | I think we should make the string type our ReallyUtf8 type (as the documentation already suggests). the blob type should be incorporated somehow, and I guess superclassing string will break everything |
08:59:59 | Araq | I think json needs to support blobs and marshal.nim needs to use that and the rest is fine |
09:00:19 | flyx | I will have the same problem in NimYAML |
09:00:46 | * | Trustable quit (Ping timeout: 255 seconds) |
09:01:04 | Araq | NimYAML needs to support lossless input/output, just like anything else |
09:01:37 | flyx | and if I remember correctly, there was also some discussion about using strings in async modules (I do not remember the details) |
09:02:48 | Araq | maybe we need to change the docs that string==blob |
09:03:57 | Araq | the only place where the stdlib converts strings to utf-16 is for the windows api with filenames and paths where it is fine to do so |
09:04:30 | flyx | that, along with declaring an actual UTF8 string type, would conceptually fix the problem, but I worry about the naming. people *expect* a textual sequence when they read "string" as type name |
09:05:19 | FromGitter | <dom96> @ldlework aww man, I wish I was in SF for that. |
09:05:24 | euantor | I must agree it feels a bit odd having the socket stuff return strings when working with binary protocols |
09:05:35 | euantor | It works, just feels different |
09:05:47 | * | fredrik92 joined #nim |
09:05:54 | FromGitter | <dom96> @Araq @endragor is readability of the marshall output really that necessary? |
09:06:08 | flyx | I would probably go for `type blob` as base and `type string = distinct blob` if there was no backwards compatibility to be considered. |
09:06:34 | Araq | define "binary". it's all bits and bytes in computers. |
09:06:58 | flyx | dom96: I think the discussion about the marshaling is just a symptom of the actual problem, which is having the `string` type used for semantically different things |
09:07:09 | FromGitter | <dom96> @euantor why does it feel different? Different from what? I'm fairly sure that most languages use strings by default. |
09:07:09 | flyx | dom96: if we just fix marshal, the problem itself remains |
09:07:33 | euantor | Remember I come from C#. There we pass in a byte array of fixed size |
09:07:50 | euantor | Same with Java if I remember correctly |
09:08:05 | FromGitter | <dom96> @flyx hrm, I'm not entirely clear on what problem we are trying to fix in marshal. |
09:08:45 | euantor | Eg: https://msdn.microsoft.com/en-us/library/8s4y8aff(v=vs.110).aspx |
09:09:01 | Araq | C# and Python were a constant pita with their unicode exceptions |
09:09:06 | Araq | for me. |
09:09:11 | euantor | I know `string` is basically the same thing, the naming is just different for me |
09:09:13 | flyx | dom96: I think the problem is „there can be non-UTF8 content in a string and this is considered an actual use-case because at some places, string is used for non-UTF8 data“ |
09:10:41 | euantor | And yes, Araq, the string handling can be annoying. Constantly having to use things like `System.Encoding.UTF8.GetBytes()` or `System.Encoding.UTF8.GetString()` does lead to a lot of code smell |
09:11:15 | * | Trustable joined #nim |
09:12:00 | flyx | I agree that we do not need an enterprisey solution and UTF-8 as implicit default is fine. |
09:12:54 | FromGitter | <dom96> @flyx okay, but why is that a problem? |
09:13:30 | FromGitter | <endragor> @dom96 re readability: my first PR was to encode each string as array of charcodes, while loading strings the old way for backward compatibility. Araq rejected that. Now I suggest that we put array only for non-UTF-8 strings - readability is kept, performance-wise it adds one additional string traversal to validate UTF-8. ⏎ ⏎ re other languages and strings - I must agree other languages use string only as "sequence of |
09:13:30 | FromGitter | ... **characters**”. sockets and files usually work with byte arrays. |
09:14:03 | * | nairobi joined #nim |
09:14:58 | * | nairobi quit (Remote host closed the connection) |
09:15:01 | flyx | dom96: because the semantic differences are carried as information along with the type. if any marshaling implementation, be it marshal or NimYAML or something else, encounters a string, it cannot know whether this is binary data from somewhere or an actual UTF8 string |
09:15:02 | FromGitter | <endragor> working with binary data doesn’t belong to JSON, as I think - JSON module should expect that user encodes binary data in some way. People often use base-64 for this. |
09:16:07 | flyx | … * are *not* carried along |
09:16:59 | flyx | checking for non-UTF8 sequences in a string is just a heuristic that cannot tell if the data was *meant* as UTF8 string or binary data. |
09:17:58 | flyx | and in my opinion, semantic differences in data usage should lead to distinct types for each semantics, because that's why we have a static type system |
09:18:51 | FromGitter | <dom96> I agree, but we also need to consider the practicality of it. |
09:19:35 | * | girvo joined #nim |
09:20:58 | * | coffeepot joined #nim |
09:21:32 | flyx | the main drawback I see for splitting string in two types is backwards compatibility. but other than that, I do not see a good argument for keeping one string type. how is it less practical to have a distinct blob type? |
09:21:55 | FromGitter | <dom96> We could force all strings to contain only valid UTF-8 sequences and perhaps introduce a ByteString type, but this would break a lot. |
09:23:07 | Araq | no, that's exactly what cause a constant pita in Python |
09:23:15 | Araq | strings should be lossless. |
09:23:38 | Araq | environment variables, unix paths, they are all mostly blobs, not unicode |
09:24:10 | * | girvo quit (Ping timeout: 255 seconds) |
09:24:52 | Araq | Python 3 adds a "byte literal" string b"abc" because it doesn't work. |
09:24:56 | yglukhov | sorry guys, unintentionally forked facebook to nim-lang. removed already. |
09:26:15 | Araq | the very idea of utf-8 was that most programs don't even care all that much about encodings as long as it's lossless |
09:28:10 | * | fredrik92 quit (Read error: Connection reset by peer) |
09:29:39 | Araq | the application layer can also fix problems much better. when my program deals with german text, I know byte 196 means 'Ä', no need to crash with an UnicodeError |
09:30:45 | * | fredrik92 joined #nim |
09:33:48 | flyx | if we retrieve env variables as blobs, will they even work as intended if they contain non-ASCII? the Windows API has a function for retrieving env vars as UTF-8 for this reason, and ' a == "Ä" ' would fail in the code, which I think is undesirable |
09:34:10 | * | bjz quit (Read error: Connection reset by peer) |
09:35:12 | flyx | for paths, I am also not convinced that they „just work“ if we ignore the encoding. however I do not know the details about that |
09:35:13 | cheatfate | dom96, could you please accept https://github.com/nim-lang/Nim/pull/4781 |
09:35:36 | * | bjz_ joined #nim |
09:36:26 | euantor | cheatfate: might it be better to add a constant rather than the rather magic `0x7F000001` |
09:36:32 | * | bjz_ quit (Read error: Connection reset by peer) |
09:37:08 | * | bjz joined #nim |
09:37:30 | flyx | if I load the PATH env as non-UTF8 blob, and then add something like "/Äquator" to it, it will surely break. |
09:38:06 | FromGitter | <dom96> yeah, what euantor said. |
09:38:14 | FromGitter | <dom96> Add it to winlean/posix |
09:38:51 | FromGitter | <dom96> Actually, you should get @Wh1teDuke to test it first. |
09:39:24 | cheatfate | dom96, actually this test is works, and i will not patch stdlib because of test not working... |
09:40:02 | Araq | flyx: why? linux complains about non-utf8? |
09:41:27 | cheatfate | dom96, and actually i think all network communication tests can fail with not properly configured antiviruses and/or firewalls |
09:41:32 | flyx | Araq: if the loaded path itself contains a non-ascii char, the resulting string will contain two different encodings at the same time. so it cannot be used to access a file system resource |
09:43:10 | FromGitter | <dom96> cheatfate: it's a useful constant to have in the stdlib, others might want to use it in the applications. |
09:43:28 | flyx | and the user wonders why this happens because he loaded some Ä as byte 196 from the PATH, and then added some Ä encoding as UTF-8 to it, and then it fails. |
09:43:47 | FromGitter | <dom96> @cheatfate: I know that it works, but it might not fix @Wh1teDuke's issue. |
09:44:11 | FromGitter | <dom96> Don't change things just because you _think_ they fix something |
09:44:26 | cheatfate | dom96, then others can PR it and dispute with you why it is needed... maybe all constants http://lxr.free-electrons.com/source/include/uapi/linux/in.h will be added... |
09:45:18 | FromGitter | <dom96> Why are you so against adding a single constant? |
09:45:34 | FromGitter | <dom96> Jeez. Whatever. |
09:46:16 | FromGitter | <Araq> @dom96 he is not against adding a single constant, he is against this constant fight over minor details hampering his productivity |
09:46:32 | cheatfate | dom96, i think it will work because of this http://stackoverflow.com/questions/3375435/avoid-windows-firewall-popup-with-sockets-on-localhost, there no more reasons why recvFrom works on win64 and not works on win32... |
09:47:06 | FromGitter | <Araq> I like to give him write access for this reason, but he refuses and I dunno why |
09:48:04 | FromGitter | <dom96> Then he should just say that. |
09:48:34 | FromGitter | <dom96> All it takes is "I don't have time for this" |
09:48:46 | cheatfate | I dont want write access because i dont want to break anything, because i still don't understand git |
09:49:17 | FromGitter | <dom96> Instead of making me think that there is some other reason why he thinks the constant shouldn't be added. |
09:50:09 | cheatfate | dom96, other reason is what i heard somedays ago you want to make a plan to make stdlib more clean and pure |
09:53:06 | FromGitter | <dom96> Sure I do. But that doesn't mean we can't add things which are useful. |
09:54:35 | cheatfate | dom96, things becomes useful when somebody asks for them |
09:55:25 | FromGitter | <dom96> I agree, in this case you demonstrated a use for it and so it's useful to you. |
09:58:10 | cheatfate | dom96, adding one constant from 100 needed, is like paying $1 when you need to pay $100. |
10:00:33 | Araq | ok, enough of this now. better stop here before it gets ugly. |
10:01:16 | FromGitter | <dom96> I'm sorry but I don't understand this analogy. |
10:01:37 | FromGitter | <dom96> We already have a couple constants, we add more as they become useful. |
10:02:55 | * | xet7 quit (Remote host closed the connection) |
10:05:06 | euantor | The idea behind a constant as far as I see it is that if somebody comes along in a year to fix another bug, they don't have to Google what on earth `0x7F000001` means. It's not exactly a deal breaker, and can be added in later. |
10:14:16 | * | girvo joined #nim |
10:20:51 | * | girvo quit (Ping timeout: 248 seconds) |
10:22:00 | * | Demon_Fox quit (Quit: Leaving) |
10:27:23 | * | fredrik92 quit (Quit: Leaving.) |
10:31:09 | cheatfate | Araq, now i remembered why bitfields is not working... they breaking compilation |
10:31:17 | cheatfate | because of OFFSET(xxxx) |
10:31:41 | Araq | we can fix that |
10:32:15 | Araq | easily. |
10:34:22 | cheatfate | Araq, do you want me to make reproducible source? |
10:39:59 | * | foocraft joined #nim |
10:42:09 | * | fredrik92 joined #nim |
10:45:26 | * | brechtm_ joined #nim |
10:45:56 | * | planhths joined #nim |
10:48:35 | * | brechtm quit (Ping timeout: 248 seconds) |
10:52:34 | * | gernest joined #nim |
10:56:11 | cheatfate | Araq, and we already have this issue https://github.com/nim-lang/Nim/issues/3523 |
11:02:22 | * | Snircle joined #nim |
11:03:07 | * | xet7 joined #nim |
11:05:21 | * | bjz_ joined #nim |
11:05:29 | * | bjz quit (Ping timeout: 240 seconds) |
11:09:46 | * | foocraft quit (Quit: Leaving) |
11:11:49 | * | fredrik92 quit (Quit: Leaving.) |
11:13:27 | * | fredrik92 joined #nim |
11:14:12 | * | girvo joined #nim |
11:17:18 | * | GustavoLapasta quit (Ping timeout: 264 seconds) |
11:18:31 | * | spindle quit (Remote host closed the connection) |
11:38:13 | * | niv joined #nim |
11:43:05 | * | Jesin quit (Ping timeout: 240 seconds) |
11:43:58 | * | brechtm_ quit (Remote host closed the connection) |
11:44:37 | * | brechtm joined #nim |
11:50:00 | * | Raaaa quit (Quit: Page closed) |
12:11:12 | * | lxdong quit (Ping timeout: 240 seconds) |
12:14:31 | FromGitter | <endragor> is there a pragma version of `—clib` compiler flag? |
12:14:59 | cheatfate | endragor {.passC:"".}, {.passL:"".}? |
12:17:07 | FromGitter | <endragor> yeah, but that requires `when defined(gcc): … elif defined(vcc): …` (for Windows), I thought perhaps there is a compiler-agnostic way |
12:34:33 | * | bjz_ quit (Quit: Textual IRC Client: www.textualapp.com) |
12:35:11 | * | bjz joined #nim |
12:49:37 | ftsf | my nim synth is coming together =) https://www.youtube.com/watch?v=8M512ppoAJM |
12:53:54 | FromGitter | <dom96> @ftsf wow. That is awesome! |
12:54:06 | FromGitter | <dom96> When can I play with it? |
12:54:32 | flyx | does it support soundfonts? |
12:54:45 | * | flyx remembers his old days of fooling around with Mario Paint |
12:54:53 | ftsf | dom96, good question, it's still in a lot of flux and uses lots of undocumented controls, but once i've figured out what i'm doing i'll publish it and hopefully other people can contribute modules for it |
12:55:12 | ftsf | flyx, not yet, i just added a very basic drum sample player |
12:55:24 | FromGitter | <dom96> looks very powerful already |
12:56:18 | FromGitter | <dom96> Although I'm very much clueless about synths |
12:56:34 | FromGitter | <dom96> Any good tutorials about them? |
12:57:44 | ftsf | hmm i'm sure there are... probably some good stuff for Pure Data |
12:58:38 | ftsf | http://en.flossmanuals.net/pure-data/audio-tutorials/simple-synth/ |
13:08:17 | * | planhths quit (Quit: Konversation terminated!) |
13:36:51 | * | vqrs quit (Max SendQ exceeded) |
13:37:06 | * | vqrs joined #nim |
13:46:12 | * | niv__ joined #nim |
13:46:55 | * | niv__ quit (Quit: kbye) |
13:49:25 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
13:49:38 | * | niv quit (Remote host closed the connection) |
13:50:14 | * | niv joined #nim |
13:53:37 | * | xet7_ quit (Remote host closed the connection) |
13:53:47 | * | niv quit (Remote host closed the connection) |
13:54:02 | coffeepot | ftsf fantastic work! Very cool :) |
13:54:08 | * | niv joined #nim |
13:57:33 | ftsf | cheers |
14:03:02 | * | csoriano quit (Quit: csoriano) |
14:03:52 | * | planhths joined #nim |
14:10:02 | ftsf | flyx, soundfonts would be great addition, will have to look into that |
14:10:10 | hohlerde | In nim we don't have a global heap that can be shared between threads, at least not if we use types the GC is aware of. So, channels are an exception to this, aren't they? |
14:10:23 | * | planhths quit (Quit: Konversation terminated!) |
14:10:48 | flyx | ftsf: I have used the fluidsynth library in the past, maybe you can get inspiration from that, it had a pretty clear interface |
14:11:06 | ftsf | flyx, cool, i'll check it out |
14:14:22 | * | xet7_ joined #nim |
14:19:03 | Araq | hohlerde: kind of |
14:19:09 | * | arnetheduck quit (Ping timeout: 244 seconds) |
14:33:39 | * | gernest quit (Quit: gernest) |
14:49:05 | * | foocraft joined #nim |
14:52:00 | * | vqrs quit (Max SendQ exceeded) |
14:54:23 | * | vqrs joined #nim |
14:55:14 | * | krux02 joined #nim |
15:09:19 | * | pie__ is now known as ie_ |
15:09:26 | * | ie_ is now known as pie_ |
15:11:23 | * | kafke joined #nim |
15:18:09 | * | Trustable quit (Remote host closed the connection) |
15:40:21 | * | Snircle joined #nim |
15:44:44 | * | PMunch joined #nim |
15:49:13 | * | PMunch quit (Client Quit) |
15:49:23 | * | PMunch joined #nim |
16:22:24 | * | brson joined #nim |
16:23:58 | * | vqrs quit (Max SendQ exceeded) |
16:25:49 | * | vqrs joined #nim |
16:28:33 | * | pregressive quit () |
16:31:35 | * | rtr_ joined #nim |
16:35:05 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:50:31 | * | yglukhov quit (Ping timeout: 244 seconds) |
16:51:24 | * | yyy joined #nim |
16:52:17 | * | yyy quit (Client Quit) |
16:53:18 | * | libman joined #nim |
16:57:31 | krux02 | is there a way do access an identifier from an outer scope? |
16:57:53 | krux02 | I am in foo() and an identifier is hidden, how can I access the outer name for it? |
16:59:54 | krux02 | the problem is I can't just do renaming, because there is a symbol automatically introduced with the same name as the symbol in outer scope, but I need to explicitly access the outer symbol |
17:00:06 | * | gehenna joined #nim |
17:01:09 | * | space-wizard joined #nim |
17:05:16 | * | Andris_zbx quit (Remote host closed the connection) |
17:05:44 | dom96 | krux02: could you show us your code? |
17:15:21 | * | beaumonta quit (Remote host closed the connection) |
17:15:47 | * | girvo quit (Ping timeout: 248 seconds) |
17:27:40 | * | GustavoLapasta joined #nim |
17:30:16 | FromGitter | <Araq> module.outer |
17:37:41 | * | girvo joined #nim |
17:37:48 | * | yglukhov joined #nim |
17:42:11 | * | yglukhov quit (Ping timeout: 244 seconds) |
17:44:43 | * | nairobi joined #nim |
17:51:21 | * | gehenna quit (Ping timeout: 272 seconds) |
17:51:48 | * | libman quit (Read error: Connection reset by peer) |
17:52:45 | * | girvo quit (Ping timeout: 265 seconds) |
17:55:25 | * | nairobi quit (Remote host closed the connection) |
17:57:13 | * | ehmry left #nim ("matrix is my bouncer") |
17:58:52 | * | gehenna joined #nim |
17:58:53 | * | gehenna quit (Client Quit) |
18:02:01 | * | ehmry[m] joined #nim |
18:08:22 | krux02 | Araq: thanks a lot it works now |
18:08:53 | krux02 | I did not think that I automatically have a module name by file name, not that this name was available within that module |
18:09:06 | * | libman joined #nim |
18:10:30 | krux02 | now I am on a very curiouse mission, I need arguments to a function that need to be known at compile time, because they are required to calculate the generic parameters of a result type |
18:11:17 | krux02 | I have a type Tensor[depth : int, dimensions : array[depth, int]] that is very generic |
18:13:37 | krux02 | I would like to write a transpose function that takes as a compile time argument a permutation like [1,2,0] and returns a tensor, where the result types has the dimension vector of the argument type permuted |
18:14:45 | krux02 | transpose(tensor: Tensor, permutation: auto) : mypackage.Tensor[tensor.depth, permute(tensor.dimensions, permutation)] = ... |
18:15:34 | krux02 | but permutation needs to be known at compile time otherwise I can't use it in the calculation for the result type |
18:17:00 | * | foocraft quit (Read error: Connection reset by peer) |
18:37:23 | * | foocraft joined #nim |
18:39:39 | * | girvo joined #nim |
18:44:02 | * | girvo quit (Ping timeout: 244 seconds) |
19:01:41 | * | yglukhov joined #nim |
19:03:45 | * | nairobi joined #nim |
19:08:04 | * | desophos joined #nim |
19:11:17 | * | pafmaf joined #nim |
19:16:58 | * | nairobi quit (Remote host closed the connection) |
19:20:47 | * | pafmaf quit (Ping timeout: 265 seconds) |
19:41:28 | * | spindle joined #nim |
19:41:30 | * | girvo joined #nim |
19:46:00 | * | girvo quit (Ping timeout: 260 seconds) |
19:47:43 | flyx | krux02: you can do that with a macro. |
19:48:23 | krux02 | flyx: can you be more specific? |
19:48:53 | flyx | macro transpose(tensor, permutation: typed): typed |
19:49:15 | flyx | you can then in the macro ensure that permutation is of kind nnkBracketExpr (I think that's what it is called) |
19:49:37 | flyx | and then its children count is then the length of the array you need to create |
19:49:48 | * | libman quit (Read error: Connection reset by peer) |
19:50:46 | flyx | from that information, you can construct and return an nnkObjConstr (again, that's what I think it is called) which creates the object you want |
19:51:14 | krux02 | nnkBracketExpr is when you have something like this a[i] |
19:51:22 | krux02 | I think you mean just nnkBracket |
19:51:26 | flyx | ah yes |
19:51:39 | flyx | well, you get what I mean |
19:52:16 | krux02 | I know generally how macros work, but int his context it would be especially nice, if it would work without a macro |
19:52:24 | krux02 | just by inference |
19:52:34 | flyx | but is the type you output not the same type as the one you give in? |
19:52:45 | krux02 | no it's not |
19:52:59 | flyx | how does it differ? |
19:53:05 | krux02 | you can imagine Matrix2x3 is not the same as Matrix3x2 |
19:53:54 | krux02 | A tensor is similar to a Matrix, just with the difference that it can does not have two dimensions, but an arbitrary amount of dimensions |
19:54:04 | krux02 | and with a transpose the order changes |
19:54:38 | flyx | ah okay, I see you switch those two |
19:55:00 | * | nairobi joined #nim |
19:55:30 | flyx | proc transpose[I, J](tensor: Tensor[I, array[J, int]], permutation: auto): Tensor[J, array[I, int]] = |
19:55:30 | * | nairobi quit (Read error: Connection reset by peer) |
19:55:39 | flyx | (not sure if that works, but I think it should) |
19:55:48 | * | nairobi joined #nim |
19:56:49 | krux02 | I and J is the same |
19:56:58 | krux02 | the length of the array does not change |
19:58:19 | krux02 | permutation is an array of indices, for example [0,2,1] and then tensor dimensions from [5,6,7] should become [5,7,6] |
19:58:22 | * | PMunch quit (Quit: leaving) |
19:58:31 | * | PMunch joined #nim |
19:58:44 | krux02 | the tensor itself then has in total 5*6*7 elements |
19:58:48 | * | nairobi_ joined #nim |
19:59:13 | krux02 | thats 210 long array of scalar values |
19:59:16 | * | nairobi quit (Read error: Connection reset by peer) |
19:59:31 | * | nairobi_ quit (Remote host closed the connection) |
19:59:59 | flyx | hmm okay, I cannot imagine how that would be possible without a macro |
20:00:45 | * | nairobi joined #nim |
20:01:36 | * | nairobi_ joined #nim |
20:04:32 | krux02 | I am thinking of passing the permutation array as a generic argument |
20:04:35 | krux02 | something like this |
20:05:11 | * | nairobi quit (Ping timeout: 265 seconds) |
20:05:49 | * | nairobi_ quit (Ping timeout: 244 seconds) |
20:05:56 | krux02 | transpose[permutation: static[openarray[int]](tensor: Tensor) : Tensor[tensor.depth, tensor.dimensions.permute(permutation)] = ... |
20:06:10 | krux02 | but it doesn't compile yet :( |
20:06:32 | krux02 | but yea, I think I need to sleep a night about it |
20:06:50 | krux02 | for now it's enough for todayj |
20:07:33 | * | krux02 quit (Quit: Verlassend) |
20:08:55 | * | libman joined #nim |
20:09:42 | * | fredrik92 quit (Quit: Leaving.) |
20:10:33 | * | PMunch quit (Quit: leaving) |
20:19:27 | * | libman quit (Read error: Connection reset by peer) |
20:22:42 | * | nsf quit (Quit: WeeChat 1.5) |
20:30:11 | * | girvo joined #nim |
20:35:23 | * | girvo quit (Ping timeout: 272 seconds) |
20:36:01 | * | yglukhov quit (Remote host closed the connection) |
20:38:13 | * | libman joined #nim |
20:38:57 | * | libman left #nim (#nim) |
20:40:08 | FromGitter | <xxlabaza> Hi all! ⏎ Sorry for stupid question, but I really need help to understand in which case I should use ref object and when it is better to use 'simple' object or even tuple? ⏎ In ordinal languages, I was using heap like "shared zone" - any thread is able to read/write to objects in heap, and if I want not to share it I just not using heap ⏎ In Nim, as I understand, every thread has its own heap, so correct me, if I am not right: ⏎ |
20:40:08 | FromGitter | ... ... [https://gitter.im/nim-lang/Nim?at=57dc58a827a8458f7f1f94ce] |
20:50:23 | FromGitter | <Araq> @xxlabaza it's tough to answer your question since you conflate all things ;-) |
20:53:03 | * | fredrik92 joined #nim |
20:56:40 | rudi_s | Araq: Would you accept a patch which extends PathComponent with e.g. char-device and block-device so it supports all results of stat? - And would you accept a patch to add a wrapper for mkstemp to create temp files in a proper way. And if yes, what would be a good location for the proc? os? |
20:57:52 | Araq | rudi_s: that depends on whether both unix and windows are supported or not |
20:58:28 | Araq | os.nim is supposed to be the "least common denominator", os specific stuff goes to posix.nim or winlean.nim |
21:02:56 | rudi_s | Araq: For PathComponent there is AFAIK no windows equivalent, but it could be used on windows without issues (but will never result in char/block-device) so I guess that's fine for os.nim. |
21:03:08 | * | foocraft quit (Quit: Leaving) |
21:03:23 | Araq | so it would always be false? |
21:04:04 | rudi_s | Araq: No. It's just that PathComponenent never evaluates to pcBlockDevice or pcCharDevice on windows. |
21:04:09 | * | girvo joined #nim |
21:04:24 | * | yglukhov joined #nim |
21:05:23 | FromGitter | <Araq> @xxlabaza objects are as fast as tuples and the heap is not necessarily slower than the stack, CPU caches don't know about the stack vs heap distinction |
21:06:11 | FromGitter | <Araq> and if you need to share between threads, there is a allocShared0 |
21:06:39 | Araq | oh wait, that's an enum. |
21:06:48 | Araq | no chance of getting that into os.nim then, sorry. |
21:07:05 | Araq | would break every exhaustive 'case' statement |
21:07:23 | rudi_s | wtf. |
21:08:17 | * | girvo quit (Ping timeout: 240 seconds) |
21:08:36 | rudi_s | So any enum in the stdlib which is usable in a switch can't ever be changed? |
21:09:13 | Araq | well every change is a breaking change, yes |
21:11:03 | * | yglukhov quit (Ping timeout: 240 seconds) |
21:12:21 | rudi_s | I see. I can understand the reasoning, but won't that hurt extending the language? - Well, I'll have to use the posix part then. |
21:17:08 | * | yglukhov joined #nim |
21:18:16 | FromGitter | <xxlabaza> @Araq ok, I see, but anyway, I don’t understand when I should use “ref object”, “object” and “tuple”? ⏎ ⏎ Ok, I understand the difference between object and tuple - tuple it is just a “values-holder” and object can do OOP things (encapsulation, polymorphism and inheritance). Am I right? ⏎ ⏎ But what to do with "ref object" and "object"? What the pros and cons of allocating memory in stack or in heap within Nim |
21:18:16 | FromGitter | ... language? [https://gitter.im/nim-lang/Nim?at=57dc6198c3e7045a30568d5a] |
21:20:38 | FromGitter | <Araq> same as everywhere else really. try to create a tree on the stack. won't work |
21:21:09 | FromGitter | <Araq> in general you start with 'object' until you hit some limitation |
21:21:21 | FromGitter | <Araq> and then you make it 'ref object' |
21:21:56 | FromGitter | <Araq> many people coming from Python start with 'ref object' though, because that's what they are familiar with |
21:22:02 | * | yglukhov quit (Ping timeout: 265 seconds) |
21:26:38 | rudi_s | Araq: Just noticed that symlinks to dirs are not handled correctly in getFileInfo(): They are reported as pcLinkToFile. |
21:27:33 | * | Ven_ joined #nim |
21:28:16 | * | yglukhov joined #nim |
21:32:17 | * | yglukhov quit (Ping timeout: 240 seconds) |
21:32:31 | rudi_s | The issue, also present in walkDir, is that files in posix have a single type (e.g. link or dir). Therefore either S_ISDIR or S_ISLNK is true, but never both. |
21:33:30 | * | yglukhov joined #nim |
21:37:49 | rudi_s | So a (second) stat is necessary to check where the symlink points to. |
21:38:00 | * | yglukhov quit (Ping timeout: 260 seconds) |
21:40:21 | Araq | fine with me. |
21:40:59 | rudi_s | "Find with me" as in "not a bug" or "send patch please"? |
21:42:28 | Araq | "send patch please" |
21:42:39 | * | GustavoLapasta quit (Quit: Leaving) |
21:43:26 | rudi_s | Will do. |
21:43:27 | * | yglukhov joined #nim |
21:47:53 | * | yglukhov quit (Ping timeout: 264 seconds) |
21:53:27 | * | yglukhov joined #nim |
21:54:33 | * | Ven_ quit (Ping timeout: 240 seconds) |
21:57:21 | * | Ven_ joined #nim |
21:58:09 | * | yglukhov quit (Ping timeout: 276 seconds) |
22:02:05 | * | yglukhov joined #nim |
22:06:14 | * | girvo joined #nim |
22:06:33 | * | yglukhov quit (Ping timeout: 248 seconds) |
22:09:45 | * | Ven_ quit (Ping timeout: 248 seconds) |
22:10:42 | * | girvo quit (Ping timeout: 264 seconds) |
22:11:19 | * | yglukhov joined #nim |
22:11:47 | rudi_s | Just tried running the testsuite and I see quite a few FAILs but the exit code of ./koch tests is 0, is this expected? |
22:11:47 | * | dyce quit (Quit: WeeChat 1.0.1) |
22:11:50 | * | girvo joined #nim |
22:12:38 | Araq | there is a --pedantic switch for that or something |
22:12:52 | Araq | tests are green on travis though |
22:13:31 | rudi_s | Araq: Where can I see the travis output? |
22:15:09 | * | Ven_ joined #nim |
22:15:31 | * | yglukhov quit (Ping timeout: 244 seconds) |
22:16:11 | dom96 | rudi_s: https://travis-ci.org/nim-lang/Nim |
22:16:17 | * | girvo quit (Ping timeout: 240 seconds) |
22:16:36 | dom96 | I've set up GitLab CI for us recently and am getting some failures still on Linux |
22:16:50 | dom96 | so maybe you are running into the same problem |
22:18:40 | dom96 | https://gitlab.com/nim-lang/nim/builds/4141792 |
22:19:06 | dom96 | coro and tostring failing there |
22:19:44 | dom96 | coro is likely due to a dependency being missing |
22:20:03 | dom96 | toString leaves me puzzled, the difference in output is "inf" vs. "-inf" |
22:20:16 | Araq | no, it's nan vs -nan |
22:20:30 | Araq | -nan makes no sense, seems some libc discrepancy |
22:20:38 | dom96 | oh yes |
22:21:20 | dom96 | I guess we should relax that test to accept -nan |
22:21:23 | * | yglukhov joined #nim |
22:23:19 | * | Trustable joined #nim |
22:23:36 | * | Ven_ quit (Ping timeout: 250 seconds) |
22:23:40 | Araq | no way, fix the stdlib |
22:23:55 | Araq | it has all sort of hacks for producing consistent nan results already |
22:24:38 | Araq | MS for instance thinks +00.NAN.bananajoe is a useful way to write nan |
22:25:28 | Araq | what's a negative Not-a-Number? an "almost number"? |
22:25:49 | * | yglukhov quit (Ping timeout: 255 seconds) |
22:27:38 | * | yglukhov joined #nim |
22:29:17 | * | Ven_ joined #nim |
22:36:10 | * | yglukhov quit (Ping timeout: 250 seconds) |
22:40:20 | * | Ven_ quit (Ping timeout: 265 seconds) |
22:41:50 | * | Ven_ joined #nim |
22:43:06 | * | yglukhov joined #nim |
22:46:10 | rudi_s | I'm looking at template rawToFormalFileInfo() in lib/pure/os.nim: Why is sometimes result used and sometimes formalInfo? E.g. result.permissions = {fpUserExec..fpOthersRead} but in the if it's formalInfo.permissions = ... |
22:51:47 | * | yglukhov quit (Ping timeout: 248 seconds) |
22:52:50 | * | Ven_ quit (Read error: Connection reset by peer) |
22:53:22 | * | Ven_ joined #nim |
22:53:23 | * | yglukhov joined #nim |
22:53:32 | rudi_s | Shouldn't this always assign formalInfo? |
22:54:39 | * | elrood quit (Remote host closed the connection) |
22:56:24 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:58:31 | * | yglukhov quit (Ping timeout: 272 seconds) |
23:02:13 | * | yglukhov joined #nim |
23:06:14 | * | girvo joined #nim |
23:06:59 | * | yglukhov quit (Ping timeout: 265 seconds) |
23:07:43 | rudi_s | Why does existsFile() return false for files which are not symlinks nor directories but also not regular files (like a fifo or a char-dev), but getFileInfo will state that it's a file? |
23:08:10 | rudi_s | Shouldn't the check in existsFile() be changed from return stat(filename, res) >= 0'i32 and S_ISREG(res.st_mode) to !S_ISDIR() to be consistent? |
23:08:51 | * | yglukhov joined #nim |
23:10:36 | * | PMunch joined #nim |
23:10:47 | * | Matthias247 joined #nim |
23:10:47 | * | girvo quit (Ping timeout: 265 seconds) |
23:13:40 | * | yglukhov quit (Ping timeout: 265 seconds) |
23:17:40 | * | bjz joined #nim |
23:22:10 | * | yglukhov joined #nim |
23:23:47 | * | Ven_ quit (Ping timeout: 248 seconds) |
23:25:39 | * | Trustable quit (Remote host closed the connection) |
23:26:18 | * | yglukhov quit (Ping timeout: 244 seconds) |
23:27:15 | * | Ven_ joined #nim |
23:28:32 | * | yglukhov joined #nim |
23:35:58 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:36:06 | * | yglukhov quit (Ping timeout: 244 seconds) |
23:41:52 | * | yglukhov joined #nim |
23:42:05 | rudi_s | Araq: ^ |
23:54:30 | * | girvo joined #nim |
23:55:13 | * | yglukhov quit (Ping timeout: 244 seconds) |
23:58:41 | * | girvo quit (Ping timeout: 240 seconds) |