00:11:15 | skrylar | gvim seemed okay. mostly use emacs+evil now |
00:17:29 | * | endragor joined #nim |
00:22:00 | * | endragor quit (Ping timeout: 256 seconds) |
00:36:55 | * | yglukhov joined #nim |
00:41:18 | * | yglukhov quit (Ping timeout: 240 seconds) |
00:51:37 | * | MJCaley joined #nim |
01:15:10 | * | yglukhov joined #nim |
01:19:18 | * | yglukhov quit (Ping timeout: 240 seconds) |
02:08:04 | * | MJCaley quit (Quit: MJCaley) |
02:24:20 | * | chemist69 quit (Ping timeout: 252 seconds) |
02:27:49 | * | yglukhov joined #nim |
02:30:14 | * | gmpreussner quit (Quit: kthxbye) |
02:32:27 | * | yglukhov quit (Ping timeout: 256 seconds) |
02:33:33 | * | xkapastel quit (Quit: Connection closed for inactivity) |
02:34:09 | * | gmpreussner joined #nim |
02:37:32 | * | endragor joined #nim |
02:38:48 | * | chemist69 joined #nim |
02:42:25 | * | endragor quit (Ping timeout: 260 seconds) |
02:44:13 | * | endragor joined #nim |
03:09:07 | skrylar | http://www.aosabook.org/en/index.html neat. |
03:12:18 | * | radagast_04 quit (Quit: radagast_04) |
03:22:21 | * | dddddd quit (Remote host closed the connection) |
03:40:33 | * | yglukhov joined #nim |
03:45:38 | * | yglukhov quit (Ping timeout: 276 seconds) |
04:16:21 | FromGitter | <gogolxdong> How to do string sorting? |
04:18:13 | FromGitter | <Quelklef> wym? |
04:20:35 | FromGitter | <gogolxdong> sort string by dictionary order. |
04:51:28 | * | yglukhov joined #nim |
04:56:33 | * | yglukhov quit (Ping timeout: 268 seconds) |
05:22:51 | * | BitPuffin joined #nim |
05:34:22 | FromGitter | <gogolxdong> got it ,use orderedTable and cmp |
05:54:27 | * | ieatnerds joined #nim |
06:12:39 | * | nsf joined #nim |
06:15:27 | * | arecaceae quit (Remote host closed the connection) |
06:16:19 | * | arecaceae joined #nim |
06:37:49 | * | yglukhov joined #nim |
06:38:21 | FromGitter | <gogolxdong> Shouldn't utc(now()) return 2018-02-06T06:36:46Z rather than 2018-02-06T06:36:46+00:00? |
06:42:37 | * | yglukhov quit (Ping timeout: 260 seconds) |
06:48:01 | FromGitter | <GULPF> that's an issue with `times.format`, but yes I agree |
06:54:05 | FromGitter | <nitely> @gogolxdong for sorting use https://nim-lang.org/docs/algorithm.html#sort,openArray[T],proc(T,T) |
06:55:12 | FromGitter | <gogolxdong> yes, I figured it out according to our scenario. |
06:56:45 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a7951ad7dcd63481f22e835] |
06:58:45 | FromGitter | <nitely> that too :) |
07:03:33 | * | solitudesf joined #nim |
07:05:06 | FromGitter | <gogolxdong> open file with fmReadWrite , readAll() after writing resulted in empty string. |
07:05:52 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a7953cfa3447aac7548eff1] |
07:10:34 | * | rokups joined #nim |
07:19:29 | FromGitter | <survivorm> try `f.setFilePos(0) |
07:19:40 | * | fredrik92 is now known as couven92 |
07:19:50 | FromGitter | <survivorm> before reading |
07:20:06 | FromGitter | <survivorm> @gogolxdong |
07:21:23 | FromGitter | <gogolxdong> yes, get your point |
07:21:57 | * | stisa joined #nim |
07:40:41 | * | yglukhov joined #nim |
07:52:19 | * | Yardanico_ joined #nim |
08:04:31 | * | gokr joined #nim |
08:07:40 | * | yglukhov quit (Remote host closed the connection) |
08:14:03 | * | Vladar joined #nim |
08:15:46 | * | Yardanico_ quit (Read error: Connection reset by peer) |
08:34:23 | * | floppydh joined #nim |
08:35:33 | * | vlad1777d joined #nim |
08:44:50 | planetis[m] | so concepts don't work with recursion? |
08:44:53 | planetis[m] | or a bug? |
08:47:52 | FromGitter | <tim-st> Is it the same to declare a variable (not with `*`) at top of a `file.nim` an access it without passing it as param using procs (without `*`) instead of passing again and again this variable to the proc as an param (regarding performance)? |
08:48:10 | FromGitter | <tim-st> with `*` I mean not public |
08:53:06 | FromGitter | <tim-st> https://gist.github.com/anonymous/c62d224708f31e32ef6eafb54b396172 |
08:54:01 | FromGitter | <tim-st> especially for tuples with many fields it would make life easier, but I dont want to have performance loss |
08:57:18 | planetis[m] | I don't think so 'var' in a parameter is pass by reference |
08:57:57 | FromGitter | <tim-st> People told me "gcc is very clever"; if I would be a gcc developer I properly would have rewritten the code without performance loss |
08:59:02 | FromGitter | <tim-st> *probably |
08:59:56 | * | Vladar quit (Quit: Leaving) |
09:01:19 | FromGitter | <tim-st> Can I compile this and compare it somehow, if it's the same? |
09:05:05 | planetis[m] | you can compare the assebly generated |
09:05:15 | planetis[m] | well if you can grasp assembly |
09:05:49 | planetis[m] | personally I only understand human-resource-machine assembly :) |
09:09:52 | * | PMunch joined #nim |
09:13:00 | planetis[m] | regarding your question i prefer passing as arguments because redability |
09:16:02 | FromGitter | <tim-st> ok thanks, normally I do so, too, now I had a proc where this would be much easier |
09:16:38 | FromGitter | <tim-st> because it's called in different contexts |
09:36:06 | PMunch | I suspect it would be faster as it has to copy less data into the stack frame of the call |
09:36:47 | PMunch | But you might benefit from cache-locality as it's close to the other parameters, so if it's only a pointer it's probably slower |
09:40:47 | * | yglukhov joined #nim |
09:41:31 | * | yglukhov quit (Remote host closed the connection) |
09:41:47 | * | yglukhov joined #nim |
09:57:11 | Araq | https://github.com/nim-lang/Nim/issues/7189 |
09:57:22 | Araq | gitmate.io is doing some work... |
09:57:36 | Araq | but er ... shitty work. |
09:59:43 | FromGitter | <survivorm> too "witty"? 😄 |
09:59:53 | PMunch | Haha :P |
10:04:23 | FromGitter | <survivorm> It's interesting that you get tired of too "witty" tool much faster, than of too silly. If silly means it doesn't do anything at all if it's not completely sure what to do |
10:16:26 | * | rockcavera quit (Ping timeout: 256 seconds) |
10:20:31 | dom96 | Araq: bleh, it's using your account |
10:20:53 | * | radagast_04 joined #nim |
10:31:48 | * | sleepyqt joined #nim |
10:32:52 | * | vlad1777d quit (Ping timeout: 256 seconds) |
10:50:00 | * | rokups quit (Quit: Connection closed for inactivity) |
11:01:37 | * | xet7 quit (Read error: Connection reset by peer) |
11:02:43 | * | xet7 joined #nim |
11:10:45 | * | xet7 quit (Read error: Connection reset by peer) |
11:11:45 | * | xet7 joined #nim |
11:20:42 | * | Vladar joined #nim |
11:21:06 | planetis[m] | do concepts work with recursion? or it's a bug? |
11:21:31 | Araq | recursion? |
11:22:06 | Araq | probably not. |
11:22:34 | planetis[m] | yes https://gist.github.com/konqoro/7756097a123c7397da2dc9db8b164048 |
11:25:51 | * | Arrrr joined #nim |
11:29:30 | Arrrr | The new error message you get from mismatches is more helpful now, but also too verbose. Is it not possible to handle it in a different way? For example https://pastebin.com/mw4RxnUQ |
11:31:30 | Arrrr | What is dislike is reading too many lines and too many words that after the first error you will memorize and will stop to provide new information. |
11:34:41 | * | xet7_ joined #nim |
11:35:21 | Araq | Arrrr, make a suggestion |
11:36:09 | FromGitter | <alehander42> is it possible to sometimes use e.g. `<>` for clarifications (`'true' <bool>` instead of `'true' (bool)`, `<type1, type2>` instead of `(type1, type2)`) ? the braces seem a bit ambigious to me considering tuple types (but maybe that's just me) |
11:36:17 | Arrrr | Yes, in my pastebin there is one. |
11:36:55 | Araq | hmm more () |
11:37:19 | * | xet7_ quit (Read error: Connection reset by peer) |
11:37:44 | Araq | but it's better than currently |
11:37:47 | * | xet7 quit (Ping timeout: 260 seconds) |
11:38:02 | PMunch | So use alehander42's suggestion and swap some for <> :) |
11:38:40 | * | xet7_ joined #nim |
11:39:05 | Araq | ok |
11:45:58 | * | MJCaley joined #nim |
11:47:51 | * | xet7_ quit (Read error: Connection reset by peer) |
11:49:33 | Arrrr | Quality of life improvement. |
11:49:35 | * | miran quit (Quit: Page closed) |
11:50:55 | * | xet7 joined #nim |
11:50:57 | PMunch | But I'm happy with the information that got added, makes it a bit easier to find mismatches :) |
11:55:20 | * | miran joined #nim |
11:55:57 | * | MJCaley quit (Quit: MJCaley) |
11:57:07 | * | kier quit (Ping timeout: 268 seconds) |
11:57:39 | FromGitter | <alehander42> yeah, very nice improvement! (the only other thing is to maybe colorize/underline the erroneous args, but maybe that's a bit too far) |
12:01:45 | Araq | not everybody likes [e340foobar in the redirected outputs |
12:05:20 | * | xet7 quit (Ping timeout: 260 seconds) |
12:05:34 | * | rockcavera joined #nim |
12:06:29 | Arrrr | But it can be disabled |
12:07:15 | * | kier joined #nim |
12:10:52 | Araq | it's "friction" |
12:19:51 | * | xet7 joined #nim |
12:32:52 | FromGitter | <alehander42> hm, nim already produces a lot of colored '[Hint]' and warnings for me |
12:33:45 | * | rokups joined #nim |
12:39:30 | FromGitter | <alehander42> maybe ⏎ ⏎ ```(a, b + 2, x()) ⏎ ^``` [https://gitter.im/nim-lang/Nim?at=5a79a20193be87284d815a11] |
12:40:58 | FromGitter | <alehander42> ```(a, b + 2, x()) ⏎ ^``` [https://gitter.im/nim-lang/Nim?at=5a79a25a36de78850cfa187b] |
12:40:59 | FromGitter | <alehander42> (gitter's code blocks are weird ugh) |
12:44:26 | dom96 | Just copy how clang does it |
12:44:33 | dom96 | Rust does it the same way IIRC |
12:44:40 | dom96 | Some ASCII art goes a long way |
12:45:03 | dom96 | ^----- Should be an `int`, got a `bool`. |
12:45:33 | dom96 | Also please change "expression: ..." to "in expression: ...", small change but an important one I think |
12:45:50 | dom96 | but overall, very nice improvement. |
13:04:01 | arnetheduck | would be nice with some json or something based error messages that can be parsed easily by editors |
13:04:08 | arnetheduck | as an option |
13:06:35 | * | solitudesf quit (Ping timeout: 276 seconds) |
13:06:53 | * | solitudesf joined #nim |
13:09:02 | dom96 | yep |
13:09:07 | Araq | I would prefer HTML over JSON |
13:09:14 | dom96 | but let's not try to make the default error messages both human and machine readable |
13:09:17 | Araq | it's semi structured data |
13:09:26 | Araq | HTML makes more sense for that IMO |
13:11:28 | dom96 | Can't tell if you're serious or not |
13:11:57 | Araq | I am. |
13:12:17 | Araq | the json would have no structure |
13:12:31 | Araq | or let's see inconsistent structure |
13:12:44 | dom96 | You can define a JSON structure |
13:12:50 | Araq | some error messages have more than one line information, for example |
13:12:55 | dom96 | but surely XML would be a better choice than HTML |
13:13:35 | Araq | XML/HTML, where is the difference. :P |
13:13:49 | Araq | markup for the text, not putting the text into quotes |
13:14:22 | dom96 | HTML has a structure for the display of various multimedia |
13:14:48 | dom96 | I guess it could be useful for error messages, if you want to bold certain parts |
13:15:35 | dom96 | but you may as well just separate the data and allow anyone to format it whatever way they want |
13:15:55 | dom96 | Maybe what you want is SGML? :P |
13:16:06 | Araq | ? you can always format <b> any way you want anyway |
13:16:32 | Araq | the point is that people will draw wrong conclusions from |
13:16:46 | Araq | [23, 2, "filename.nim", "error message"] |
13:17:50 | dom96 | { "line": 23, "col": 2, msg: "message" } is better than <span><i>Line: 23 Col: 2</i> Message</span> |
13:17:57 | Araq | [23, 2, "filename.nim", ["error message", [1, 1, "different file", "more information]]] |
13:19:32 | Araq | { "line": 23, "col": 2, msg: "message" } is better than <span><i>Line: 23 Col: 2</i> Message</span> misses the point |
13:19:51 | Araq | the point is, it is *not* msg: "message" |
13:20:38 | dom96 | I don't get your point then |
13:20:41 | Araq | the message itself is semi structured. xml was designed for this and json wasn't. |
13:23:05 | dom96 | I don't think so, JSON is structured too if you use json objects. |
13:23:09 | dom96 | No? |
13:23:57 | dom96 | <errors><error line=23 msg="asd"></errors> vs. {errors: [ {line: 23, msg: "asd"} ]} |
13:24:43 | FromGitter | <andreaferretti> @Araq of course using only the array part of JSON will be inefficient and clumsy |
13:24:57 | FromGitter | <andreaferretti> I don't think anyone ever argued for this |
13:27:20 | Araq | not sure how I can get my point accross. |
13:28:23 | Araq | the concept of "semi structured" data seems to be lost on you. write the next HTML page in JSON instead then. |
13:29:29 | FromGitter | <andreaferretti> the concept is pretty clear, is just that JSON seems suitable for it |
13:29:30 | * | dddddd joined #nim |
13:29:48 | FromGitter | <andreaferretti> I mean, if I had to write my next page by hand, by all means I would write HTML |
13:30:08 | FromGitter | <andreaferretti> but if I have to generate it programmatically, HTML is not any easier that JSON |
13:31:05 | FromGitter | <andreaferretti> and JSON allows for arbitrary object keys, making it much easier to convey meaning without having to resort to a limited set of div, b, i and so on |
13:31:29 | Araq | yeah I give up. just try it. |
13:31:42 | Araq | it's not about syntax or named object keys. |
13:31:57 | FromGitter | <andreaferretti> maybe you can give an example which would be simple HTML but clumsy to express in JSON? |
13:32:44 | FromGitter | <alehander42> but why not xml then :? |
13:33:23 | Araq | <error line="3" file="stuff.nim" >some error message with <b>important</b> pieces</error> |
13:35:42 | FromGitter | <andreaferretti> I see what you mean |
13:35:45 | PMunch | {"level": "error", "data": { "line": 3, "file":"stuff.nim", "message": "some error message with <b>important</b> pieces"}} |
13:35:56 | PMunch | That's how a typical JSON API would do it |
13:36:14 | PMunch | The data field would be defined in terms of the level value |
13:36:17 | federico3 | Araq: I might be mistaken but that is XML but not valid HTML (HTML being a subset of XML) |
13:36:19 | Araq | PMunch, yes indeed. so it's at best a hybrid. |
13:36:37 | FromGitter | <andreaferretti> I think it would be a pain to inflict that to a tool author, though |
13:36:40 | * | Snircle joined #nim |
13:37:08 | FromGitter | <andreaferretti> as anyone who has tried to parse custom HTML has realized |
13:37:26 | Araq | federico3, yeah sure, so it's xml |
13:37:45 | dom96 | {"level": "error", "data": { "line": 3, "file":"stuff.nim", "message": ["some error message with ", {kind: "important", msg: "important"}, "pieces"]}} |
13:37:52 | FromGitter | <alehander42> well you can have ⏎ 'message':.. |
13:37:57 | FromGitter | <alehander42> yeah, the dom96 snippet |
13:38:00 | PMunch | Araq, well yeah. If you want human readable error messages then adding some kind of formatting options would be a good idea. But I think the idea was to have something like that without the error message |
13:38:02 | Araq | dom96, that's the solution I've been waiting for. |
13:38:27 | PMunch | So all the information that went into the error message would be available but no actual human-readable error message was included |
13:38:34 | PMunch | Or at least optional |
13:38:34 | * | xet7_ joined #nim |
13:39:12 | PMunch | dom96, that's of course another way you could do the formatting |
13:39:14 | dom96 | The only reason tools would embed HTML in JSON is if they are going to be run in a browser anyway |
13:39:24 | PMunch | Yeah, I was just being lazy :P |
13:39:35 | dom96 | html.append(json.message) // voila |
13:39:37 | Araq | so now your 'message' is a list of stuff and this stuff is nested and the nesting is not part of the data model |
13:39:44 | Araq | but it's instead markup. |
13:40:19 | dom96 | That's fine. There is no trouble with checking whether 'message' is a string or an array |
13:40:22 | PMunch | I think the original idea was to have error messages exposed in a purely computer-readable format. So I could write a tool that translated the error messages to whale sounds if I wanted to |
13:40:44 | * | xet7 quit (Ping timeout: 265 seconds) |
13:40:56 | FromGitter | <alehander42> well you can have {'kind': 'normal', msg: 'stuff'}, {'kind': 'important', msg: 'stuff'} |
13:41:31 | Araq | dom96, it's not fine, the idea of "this is semi structured" is part of xml and an alien concept for JSON |
13:42:05 | dom96 | Araq: It's the exact same thing |
13:42:08 | Araq | besides, the JSON is likely transformed into XML/HTML anyway so that the editor can render it |
13:42:13 | dom96 | I'll have to handle the possibility of a <b> inside a message |
13:42:36 | FromGitter | <alehander42> you don't need it to be semi structured, you can map it to a strict schema |
13:42:55 | PMunch | So all messages with "level": "error" would have line and file. But then it would have another object within it that contain "errorKind": "TypeError" for example and have the fields "got": [{"fieldName": "name1", "type": "bool"}] and "expected": [{"fieldName": "name2", "type": "string"}] |
13:44:02 | PMunch | This way whatever tool that interfaces with the error could create the error message as it wanted to |
13:44:07 | PMunch | Or turn it into whale-sounds |
13:45:13 | Araq | oh the tool author has nothing to better to do to re-ensemble this mess into english |
13:46:29 | dom96 | The tool author might need this information in a structure like that |
13:46:45 | dom96 | otherwise why not just grab the compiler output? |
13:46:52 | FromGitter | <alehander42> well what if the tool author doesn't want to render html |
13:47:15 | FromGitter | <alehander42> if html is so important, you can just have a flag to output the html |
13:47:24 | PMunch | My point is that english is unstructured, so parsing any information out of the english error messages would be a mess if they needed that data (not to mention it could break my someone rewording an error message. You could of course also include a "message" field on all errors if that is all they wanted |
13:47:56 | PMunch | Say I wanted to write a tool to output the error messages in Norwegian |
13:48:29 | PMunch | Or if my editor supported hyperlinks in error messages and I wanted to link specifically to a field? |
13:48:35 | FromGitter | <survivorm> I'd say json is more flexible |
13:50:22 | FromGitter | <survivorm> Yeah, @PMunch have a point. With json structure you may display error however you want, not just in one way error author deems "the right one" |
13:51:42 | FromGitter | <survivorm> And if you want to provide html, you may as well support msg and plainMsg in json as plain text |
13:51:50 | PMunch | I do feel the original error should be added as well though, in a "message" field. If all you wanted was the line and column numbers for example but keep the original message |
13:52:27 | FromGitter | <survivorm> because dom's variant is not looking good too |
13:53:28 | FromGitter | <alehander42> I think dom's variant is almost perfect if you wrap all the tokens in {kind: <kind>, token: <token>} form |
13:53:57 | FromGitter | <survivorm> I think it's a bit too verboose |
13:54:19 | FromGitter | <survivorm> imagine you're to raise such an error |
13:54:38 | FromGitter | <survivorm> information doesn't come from nowere |
13:55:55 | PMunch | I feel the most important part is to split the dynamic content (what made the error), and the static content (how the error is presented) |
13:56:47 | PMunch | So the tool author is able to change the presentation without having to parse out the information |
13:57:00 | PMunch | Hmm, do you get IRC formatting on Gitter? |
13:57:15 | dom96 | My bet is no |
13:57:39 | FromGitter | <survivorm> Yeah, error author may play with several optional fields with "formatted" error representation |
13:57:39 | dom96 | Bold? |
13:57:46 | FromGitter | <survivorm> Which ones? |
13:57:48 | FromGitter | <survivorm> yj |
13:57:49 | dom96 | hrm, I think I failed there |
13:57:52 | dom96 | There we go |
13:58:02 | FromGitter | <survivorm> still no |
13:58:13 | dom96 | Yeah, FromGitter doesn't support it |
13:58:14 | FromGitter | dom96, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
13:58:20 | survivorm[m] | and here - yes |
13:58:41 | dom96 | would be nice to get support for it in irclogs https://irclogs.nim-lang.org/ |
13:59:08 | FromGitter | <survivorm> for the formatting? |
13:59:11 | dom96 | I have some nightmare memories trying to parse mIRC formatting before I knew how to properly parse things |
13:59:36 | FromGitter | <survivorm> Yeah, parsing is not an easy task |
14:00:06 | PMunch | The IRC codes are pretty easy though. Just a byte that can't mean anything else |
14:00:17 | FromGitter | <survivorm> Btw, @PMunch - article's finished, care to help improving it? |
14:00:39 | PMunch | The clear byte might be a bit of a pain though, you would need to keep track of all the current styles to properly end them in HTML |
14:00:40 | dom96 | that was when I was parsing using `split` until Araq taught me The Way (TM) |
14:00:52 | PMunch | survivorm[m], sure, link? |
14:00:58 | survivorm[m] | t upset |
14:01:05 | FromGitter | <survivorm> Because as i've read english version againm i've got upset |
14:01:15 | PMunch | upset? |
14:01:21 | PMunch | About your own text? :P |
14:01:34 | FromGitter | <survivorm> https://docs.google.com/document/d/109ITPXUi1ywUHkEb7K_FMv6sMjBAXZgcrE2CuFPnWGA/edit?usp=sharing |
14:01:45 | FromGitter | <survivorm> About my translation |
14:01:57 | PMunch | dom96, I have to say thanks for setting me onto parsers. These combinational parsers are really cool and powerful |
14:02:04 | PMunch | Or whatever you want to call them.. |
14:02:18 | FromGitter | <survivorm> or the google's, with some hand tweaks... |
14:03:00 | FromGitter | <survivorm> And anyone with skills in English is welcome to comment on the article too |
14:03:13 | FromGitter | <survivorm> it's even open for editing |
14:03:25 | PMunch | I'm at work right now, but I'll try to at least read through it tonight :) |
14:03:40 | floppydh | iterators aren't allowed to be recursive? |
14:03:47 | FromGitter | <survivorm> 'Cause I'm really-really upset about the text quality |
14:04:55 | * | Arrrr quit (Ping timeout: 256 seconds) |
14:07:09 | FromGitter | <survivorm> And, btw, what's the most popular english site, there programmers are posting big articles? I've found only dzone |
14:10:56 | shashlick | @honewatson: got airline color working on ubuntu, had to set t_Co=256. that doesn't work on windows though, makes the whole screen grey. using vim on msys |
14:15:21 | * | Arrrr joined #nim |
14:19:06 | shashlick | are there any good examples of using the pegs module? I'm using it (it works) but am sure it could be done better |
14:22:13 | FromGitter | <survivorm> And it would, hopefully. For me, now it's almost broken as it doesn't support nor AST, nor grammar construction to procs binding. I'll come to it eventually, but i plan to start on porting some BNF parser to nim (D-parser, maybe? or parglare from python, as it's decent tool too) |
14:26:02 | PMunch | survivorm[m], hackernews is pretty big |
14:26:09 | PMunch | And reddit.com/r/programming |
14:26:18 | PMunch | But if you mean were to publish I have no idea :P |
14:29:25 | FromGitter | <survivorm> As far as i can see, reddit is for sharing and discussing |
14:29:34 | FromGitter | <survivorm> not for posting |
14:30:47 | federico3 | survivorm: you mean a service to host articles/blogs like medium & co? GitHub or GH pages works |
14:30:49 | FromGitter | <survivorm> All of it's "posts" are essentially, links to foreign resources |
14:31:28 | PMunch | Yeah, that's what I meant |
14:31:39 | FromGitter | <survivorm> Yeah, @federico3 something like that |
14:31:41 | PMunch | Both hackernows an reddit are just linking to the actual article |
14:31:50 | PMunch | A nice way to let people know about it |
14:32:39 | PMunch | But yeah for posting you would need to go somewhere else. If you want I could of course also guest-post it on my own page and you could share the link to that |
14:36:49 | FromGitter | <survivorm> That's interesting offer, and i may take it, but first i'll try to use somethere else. You see, russian community has https://habrahabr.ru/ as a well-known base for article sharing. It's programmer's site, it has ranking, posting is free, it's auditorium is big and it consists of the people you (as programmer) target. Benefits only |
14:37:36 | FromGitter | <survivorm> So' i've been looking for something similar in english web segment |
14:38:16 | FromGitter | <survivorm> So far - looks like to no avail. You have it, but not in one place |
14:39:00 | FromGitter | <survivorm> Like - post it on gh, link it to reddit, and see what happens |
14:39:14 | federico3 | interesting how there aren't platforms to do that |
14:39:25 | FromGitter | <alehander42> posting on medium or your own blog and linking this on hacker news / reddit seems to be exactly the same, it's more flexible |
14:39:54 | FromGitter | <survivorm> May be. But flexible in exactly what? |
14:40:02 | FromGitter | <survivorm> Page setup? |
14:40:46 | dom96 | wow, Rust is going to pay $100/hr to someone to design a new website: https://gist.github.com/ashleygwilliams/01f8a94a0c7627a796e223415b4404d2 |
14:42:33 | FromGitter | <survivorm> looks like it's more about mentorship then of design |
14:42:44 | * | craigger quit (Quit: bye) |
14:42:46 | PMunch | Do you think they would like it if you did it in Nim? :P |
14:42:53 | * | craigger joined #nim |
14:43:05 | * | rokups quit (Quit: Connection closed for inactivity) |
14:43:26 | miran | @survivorm - post it on your github, and link it when posting on reddit/HN |
14:43:49 | PMunch | Well with your own site you have full control and are sure that your content is not taken down without your consent. It also means that you can take it down yourself at any time should you want to. |
14:43:56 | federico3 | "your javascript looks machine generated" "nah, I just like weird variable names..." |
14:43:59 | FromGitter | <survivorm> They want someone to rule them all :) (One Ring to rule them all, One Ring to find them, ⏎ One Ring to bring them all and in the darkness bind them :D) |
14:44:03 | PMunch | federico3, haha :P |
14:44:37 | FromGitter | <alehander42> @survivorm flexible, your content doesn't depend on some platform, it's just in your own blog, and it's separate from the places were it's posted, and each platform has different communities with different focuses which can lead to different discussions |
14:46:42 | * | endragor quit (Remote host closed the connection) |
14:47:49 | FromGitter | <survivorm> @alehander42 I need to think on it. Or more likely - to try all cycle myself and see, how it works. Because i like the idea, but don't know how it'll work out |
14:50:34 | * | gokr quit (Ping timeout: 256 seconds) |
14:54:30 | * | endragor joined #nim |
14:59:41 | * | endragor quit (Ping timeout: 276 seconds) |
15:19:01 | * | xet7_ is now known as xet7 |
15:25:57 | * | arnetheduck quit (Remote host closed the connection) |
15:32:32 | * | arnetheduck joined #nim |
15:41:09 | * | fvs joined #nim |
15:47:33 | fvs | Over the years I've gotten into the habit of declaring my variables up front. Some languages enforce this (fortran, javascript?). With nim, this doesn't seem to matter and I can declare the variable if and when i need it. It impacts readability somewhat with vars and lets dispersed throughout the code, but so what. |
15:48:33 | PMunch | fvs, you are still free to declare them at the beginning |
15:48:46 | PMunch | But you're right, Nim doesn't force it on you |
15:49:23 | PMunch | IMO it helps keep the definition close to the usage. Worst thing is having to scroll up through a 100 line long function looking for a variable just to figure out what type it is |
15:49:58 | PMunch | But I guess it depends on what you're used to |
16:04:05 | shashlick | https://www.youtube.com/watch?v=48X4PeHxkNg |
16:07:14 | PMunch | Oh yeah, I saw a guide explaining how to do that a while back |
16:18:36 | * | PMunch quit (Quit: Leaving) |
16:20:30 | * | yglukhov quit (Remote host closed the connection) |
16:21:03 | * | yglukhov joined #nim |
16:21:53 | * | miran_ joined #nim |
16:28:02 | * | yglukhov quit (Ping timeout: 256 seconds) |
16:30:34 | * | gokr joined #nim |
16:40:27 | * | natrys joined #nim |
16:42:33 | Araq | fvs: top level vars have real objective downsides. they are more error prone (use before definition, use of the wrong variable) |
16:43:39 | Araq | and readability is worse too, IMO. and in Nim you cannot use 'let' then. |
16:43:47 | Araq | just say no. ;-) |
16:47:36 | * | gokr quit (Read error: No route to host) |
16:47:47 | FromGitter | <barcharcraz> That was an old optimization to make compilers simpler to write |
16:48:21 | * | floppydh quit (Quit: WeeChat 2.0.1) |
16:51:06 | * | rokups joined #nim |
16:52:13 | * | NimBot joined #nim |
16:52:25 | FromGitter | <krux02> well it's not hart for a compiler to determine all variable declarations within a block. So when a compiler thinks all variables should be declared at the top. The compiler can do that on it's own. I don't feel the need to help the compiler there. |
16:54:02 | dom96 | unlike many languages, in Nim you can easily define all variables at the top of functions inside a single 'var' block |
16:54:17 | dom96 | but I agree that doing so impacts readability considerably |
16:55:22 | FromGitter | <andreaferretti> it can do it on its own, but early compilers were pretty primitive |
16:55:27 | FromGitter | <andreaferretti> often one pass |
16:55:34 | FromGitter | <andreaferretti> not much ram to spare |
16:55:46 | ieatnerds | If I have a long module I'll put vars inside functions, but when its just a short one I tend to put them on top. |
16:55:57 | * | Trustable joined #nim |
16:56:16 | FromGitter | <krux02> yea but we don't need to compile on computers with just a few kilobytes of ram anymore |
16:56:20 | * | rockcavera quit (Remote host closed the connection) |
16:56:48 | FromGitter | <krux02> I make vars as local as possible |
16:57:04 | FromGitter | <krux02> sometimes I have global vars, but I try to keep them to an absolute minimum |
16:57:52 | FromGitter | <andreaferretti> yeah of course I agree, I was just explaining why it used to be a common restriction on early ompilers |
16:58:19 | FromGitter | <krux02> when I see that I have a single instance of something and I pass it down to every function but it's always the same instance. Then I often think, 'ah screw it, make it global' |
16:59:40 | FromGitter | <krux02> I do generalizations and abstractions like a compression algorithm. |
16:59:58 | FromGitter | <krux02> but sure. |
17:00:07 | FromGitter | <krux02> I am drifting away with the topic :P |
17:03:03 | euantor | Take the Ada route and have a section to declare all variables for a procedure before the procedure body ;) |
17:04:25 | * | rokups quit () |
17:04:58 | * | rokups joined #nim |
17:05:06 | * | endragor joined #nim |
17:26:48 | * | pydsigner quit (Ping timeout: 240 seconds) |
17:26:58 | * | pydsigner joined #nim |
17:27:34 | * | yglukhov joined #nim |
17:32:27 | * | yglukhov quit (Ping timeout: 260 seconds) |
17:39:54 | * | endragor quit (Remote host closed the connection) |
17:41:53 | FromGitter | <krux02> I found something in the Crystal documentation that the Nim Language could learn from: https://crystal-lang.org/docs/guides/performance.html |
17:42:17 | FromGitter | <krux02> "Don't create intermediate strings when writing to an IO" |
17:42:57 | ieatnerds | I'm liking the read so far, thank you |
17:43:22 | FromGitter | <krux02> In nim `echo` creates an intermediate string for each argument by default. |
17:43:43 | FromGitter | <krux02> I never liked that idea a lot |
17:44:38 | ieatnerds | are there any pros to creating an intermediate string? |
17:45:48 | FromGitter | <andreaferretti> it is conceptually simpler to create a custom stringify operator `$` for a custom type |
17:46:01 | FromGitter | <andreaferretti> rather than having to make the type interact with output |
17:46:28 | FromGitter | <andreaferretti> other than simplicity for beginners, I'd say no advantages |
17:47:37 | FromGitter | <andreaferretti> but it's a big one - you don't want to explain to someone who is just starting how to optimize and reduce string allocations just to print stuff |
17:48:43 | ieatnerds | fair |
17:53:35 | * | gokr joined #nim |
18:16:30 | * | Arrrr quit (Quit: Leaving.) |
18:28:28 | FromGitter | <krux02> well, when the only operation to implement would be `proc format(var output: sting; obj: MyType; form: string = "")` then this function could be used to implement writing to output, writing to strings, creating new strings, and formatting numbers. Even the form argument could be used to format the numbers in a vector for example. |
18:30:42 | subsetpark | How often are you using `echo` and optimizing for performance in the same code? |
18:30:47 | FromGitter | <krux02> `echo` could have one internal buffer string, that would be reused each time |
18:31:06 | FromGitter | <krux02> so no new allocation and no extra overload just for echo and stream operations necessary |
18:31:32 | FromGitter | <krux02> subsetpark: well to be fair not at all. But it is bugging me all the time |
18:32:00 | Demos[m] | wowah what's up with the std namespace? |
18:32:02 | FromGitter | <krux02> it's just in my head and it doesn't really matter to me |
18:32:18 | subsetpark | Sounds like the work is in your head, not the stdlib :) |
18:32:44 | FromGitter | <krux02> Demos[m]: this in Nim chat not c++ |
18:33:14 | FromGitter | <krux02> subsetpark: well to be fair I don't do string processing |
18:33:25 | Yardanico | krux02: this is nim |
18:33:32 | Yardanico | sha1 is now in std "namespace" |
18:33:50 | FromGitter | <krux02> I just do graphics programming and a little output |
18:33:51 | Demos[m] | yeah |
18:34:02 | FromGitter | <krux02> sha1? what is that? |
18:34:22 | Yardanico | https://github.com/nim-lang/Nim/commit/70e8640244e48e8d62c5af42101c9df2b57224d9 |
18:34:32 | Yardanico | renamed securehas |
18:34:53 | Yardanico | securehash* It makes much more sense with this name :) |
18:35:20 | Demos[m] | also securehash is a name that's asking for trouble down the road |
18:35:54 | Demos[m] | "secure_in_2017_hash" |
18:37:19 | * | vivus joined #nim |
18:37:20 | * | sleepyqt quit (Quit: Leaving) |
18:37:26 | FromGitter | <krux02> well security is relative |
18:46:17 | * | fvs left #nim ("ERC (IRC client for Emacs 25.3.1)") |
18:46:57 | FromGitter | <mratsim> @survivorm medium, dev.to or hackernoon to post stuff for dev |
18:47:06 | federico3 | krux02: securehash is opaque, securehash_md5 is explicit |
18:47:59 | * | yglukhov joined #nim |
18:49:44 | * | yglukhov quit (Read error: Connection reset by peer) |
18:50:19 | * | yglukhov joined #nim |
18:58:03 | FromGitter | <krux02> well I think just call it the algorithm's name is best |
18:58:18 | FromGitter | <krux02> calling it secure is like calling it new. |
18:58:32 | FromGitter | <krux02> At some point the adjective might become wrong |
18:58:53 | FromGitter | <krux02> but it could be is a security stuff subfolder |
18:59:10 | FromGitter | <krux02> meaning it has the goal to be used for security |
19:00:10 | federico3 | krux02 indeed "crypto[graphic]hash" would be more correct than "secure". Or just the name |
19:05:44 | FromGitter | <mratsim> md5 has been hackable in seconds for years |
19:23:25 | * | vivus quit (Quit: Leaving) |
19:24:01 | * | BitPuffin quit (Remote host closed the connection) |
19:26:43 | federico3 | mratsim: yep, that's why the algo name should be explicit |
19:48:27 | * | rockcavera joined #nim |
19:53:18 | * | PMunch joined #nim |
20:12:03 | * | fvs joined #nim |
20:13:31 | fvs | it it possible to pass parameters to gcc from nim compiler e.g. -pg |
20:16:13 | dom96 | --passC:-pg |
20:20:31 | * | Trustable quit (Remote host closed the connection) |
20:56:19 | FromGitter | <tim-st> I wouldnt call any of these functions *secure*. afaik none of these algorithms is proven to be secure |
20:56:24 | Araq | er, the advantage is that $ for types is generally useful and so 'echo' uses that |
20:57:05 | Araq | you can call it a "generic" solution and then your C++ brain might enjoy it |
21:04:32 | * | rokups quit (Quit: Connection closed for inactivity) |
21:07:39 | * | yglukhov quit (Ping timeout: 256 seconds) |
21:12:19 | * | yglukhov joined #nim |
21:26:56 | * | fvs left #nim ("ERC (IRC client for Emacs 25.3.1)") |
21:30:29 | * | Ven`` joined #nim |
21:39:22 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:42:40 | * | miran_ quit (Quit: Konversation terminated!) |
21:48:12 | * | Ven`` quit (Ping timeout: 256 seconds) |
21:56:15 | * | solitudesf quit (Ping timeout: 260 seconds) |
22:13:15 | * | natrys quit (Quit: natrys) |
22:13:32 | * | vlad1777d joined #nim |
22:15:06 | * | Vladar quit (Quit: Leaving) |
22:45:49 | * | PMunch quit (Quit: leaving) |
22:55:35 | * | vlad1777d quit (Ping timeout: 240 seconds) |
23:02:36 | * | xet7 quit (Remote host closed the connection) |
23:06:30 | * | xet7 joined #nim |
23:23:48 | * | rockcavera quit (Ping timeout: 240 seconds) |
23:25:47 | skrylar | i see you are having the SHA discussion |
23:26:12 | skrylar | i had a bit of a meh until i found out SHA is actually named "secure hash" which makes it.. odd |
23:26:29 | skrylar | there should be a github issue suggesting to rename it 'sha1' or something |
23:34:07 | * | xet7 quit (Ping timeout: 260 seconds) |
23:41:17 | * | xet7 joined #nim |
23:52:13 | FromGitter | <zetashift> damn while I wasn't looking Haxe went ahead and compiled to C: https://hashlink.haxe.org/ , wonder how it fares up against Nim |