00:02:53 | * | donlzx joined #nim |
00:10:40 | * | hogeland quit (Ping timeout: 245 seconds) |
00:29:55 | * | stefanos82 quit (Quit: Quitting for now...) |
00:31:55 | skrylar | on the glib front, we can't use the _ and _T functions :| |
00:32:03 | skrylar | i still have no idea what the nim equivalent of those for gettext is |
00:38:08 | * | brainpro1 is now known as brainproxy |
00:43:33 | * | dddddd quit (Remote host closed the connection) |
01:47:25 | * | hogeland joined #nim |
01:47:56 | * | hogeland quit (Remote host closed the connection) |
02:37:20 | * | Tanger quit (Quit: Leaving) |
03:06:04 | skrylar | Araq, so you're trying to rustify nim? lol |
03:06:46 | skrylar | only troulbe i had with their memory model was that the weak box type would crash the program, so you couldn't have GUI scene graphs in 0.8.0 :\ |
03:08:23 | * | Tanger joined #nim |
03:11:26 | skrylar | i wonder why some things in glib respond to `destroy` and others to `free` |
03:35:45 | skrylar | I kind of want to go through and remove all the "G" prefixes, too. |
03:36:10 | skrylar | did so from the functions but not the types |
03:41:33 | shashlick | skrylar: are you doing this manually? |
03:41:53 | skrylar | shashlick, for glib i did |
03:44:31 | skrylar | as much of it as i care to /currently know how to do, has been done. needs to be whacked with the mole hammer a few times until it all builds and i can shovel it on to github, but it's all there minus a couple strange macros and deep internal stuff |
03:51:12 | skrylar | I probably won't do this, but was pondering if releasing module docs as a tiddlywiki file would be worthwhile |
03:51:56 | skrylar | played around with it a little again and it has that whole thing where it 1) has a local search built in and 2) shows elements as cards, so you can open up and move just the parts you need right now |
04:02:05 | * | endragor joined #nim |
04:02:05 | * | endragor quit (Remote host closed the connection) |
04:04:18 | * | endragor joined #nim |
04:04:40 | shashlick | i liked tiddlywiki, used it years ago to document one of my projects |
04:05:11 | shashlick | but that was an application |
04:05:17 | shashlick | did you use nim doc? i use it for all the wrappers i do |
04:05:37 | shashlick | http://nimgen.genotrance.com/nimarchive for example |
04:06:41 | skrylar | shashlick, i have used nim doc before |
04:06:49 | skrylar | I don't particularly enjoy it. |
04:07:17 | skrylar | what i did for the firebird binding is i think there's a very terse description in nim doc, and then there is a texinfo file for it. it's probably the most documented nim module we have lol |
04:07:46 | skrylar | https://github.com/Skrylar/firebird/tree/master/docs |
04:07:58 | shashlick | ya took a while to figure it out, along with the nimdoc.cfg changes required |
04:08:06 | shashlick | but i like the result - https://github.com/genotrance/nimgen/blob/master/tests/nimgentest.nims#L50 |
04:08:20 | skrylar | well its mostly that nim doc isn't designed to make manuals |
04:08:24 | shashlick | i have the .nim file posted syntax highlighted and the nim doc points to the source file |
04:08:48 | shashlick | no doubt, just the API docs doesn't make documentation, but it's a start |
04:09:06 | skrylar | will probably ahve to have a deep think on keeping texinfo or using asciidoc going forward |
04:09:50 | skrylar | asciidoc[tor.rb] has modern clout and is pretty by default (it's a faceplate over docbook), texinfo is actually not that bad (the syntax is very regular, unlike asciidoc's sigil soup) |
04:11:33 | skrylar | But unfortunately, if you do not set up the whole docbook chain then asciidoc will not ex. paginate, or generate indexes. I actually do bother to use all the tags and whatnot, so the docs for nfirebird are close to a real manual (including breakdowns on how shit works, and then indices, and then per-function docs,...) which had to be cobbled from embarcadero wikis and old-ass search results |
04:14:09 | FromGitter | <kaushalmodi> skrylar: texinfo! Emacs user? |
04:14:11 | FromGitter | <kaushalmodi> :) |
04:14:16 | skrylar | i was at the time yea |
04:14:31 | FromGitter | <kaushalmodi> I love the Info mode |
04:14:34 | skrylar | but i also did some deep searches at the time, and while a lot of people like markdown, its simply not the right tool for a tech manual |
04:15:21 | FromGitter | <kaushalmodi> I document (started with just one Nim module right now) in Org. |
04:15:24 | FromGitter | <kaushalmodi> https://github.com/kaushalmodi/strfmt/blob/master/docs/strfmt.org |
04:15:37 | skrylar | org is formidable |
04:15:46 | FromGitter | <kaushalmodi> :( |
04:15:54 | FromGitter | <kaushalmodi> Oh well |
04:16:02 | skrylar | why frown? formidable is usually a complement lol |
04:16:30 | FromGitter | <kaushalmodi> https://www.google.com/search?q=formidable&ie=utf-8&oe=utf-8&client=firefox-b-1-ab |
04:16:40 | FromGitter | <kaushalmodi> sorry for that garbage link |
04:16:54 | FromGitter | <kaushalmodi> synonyms.. disturbind, forbidding, etc. |
04:17:15 | FromGitter | <kaushalmodi> I've only read formidable in negative context.. that's why the frown :) |
04:17:28 | FromGitter | <kaushalmodi> so.. |
04:17:29 | shashlick | you guys in north/south america? |
04:17:40 | skrylar | i am |
04:17:50 | FromGitter | <kaushalmodi> I am in US, why? |
04:18:11 | shashlick | just curious - at this hour 🙂 |
04:18:37 | FromGitter | <kaushalmodi> so, completing my Org documentation comment.. using the docs task in https://github.com/kaushalmodi/strfmt/blob/master/strfmt.nimble, I get https://kaushalmodi.github.io/strfmt/ |
04:19:02 | FromGitter | <kaushalmodi> I was stuck on debugging something else.. couldn't sleep |
04:19:02 | skrylar | exporting it to reST? |
04:19:14 | FromGitter | <kaushalmodi> yes as nim docs likes only that |
04:19:28 | skrylar | rest is okay. tried it with sphinx once |
04:19:40 | * | donlzx quit (Remote host closed the connection) |
04:20:06 | * | donlzx joined #nim |
04:21:44 | skrylar | xslt is aggravating however |
04:22:14 | skrylar | i almost feel like trying to cope with xslt 1.0 is not worthwhile because ruby+nokogiri is less mysterious |
04:22:32 | FromGitter | <kaushalmodi> hmm, never heard of xslt |
04:22:43 | skrylar | you need it to transform docbooks to html |
04:23:28 | FromGitter | <kaushalmodi> ah yes.. I think I have heard the name.. when installing docbook2x binary or something like that |
04:23:33 | shashlick | I have not so fond memories of xslt |
04:23:43 | FromGitter | <kaushalmodi> it was a dependency for building git man pages |
04:23:44 | shashlick | the days when XML ruled the land |
04:24:25 | shashlick | that looks good @kaushalmodi |
04:24:46 | skrylar | kaushalmodi git uses asciidoc :) |
04:24:58 | skrylar | it's just that asciidoc requires a docbook pipeline if you want pagination/indices/etc |
04:26:05 | FromGitter | <kaushalmodi> ok.. here's what was needed, from my script: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46d85dd1428e5aefdf8bb4] |
04:26:44 | FromGitter | <kaushalmodi> As I mentioned earlier, couldn't leave without Info manuals :) |
04:26:50 | FromGitter | <kaushalmodi> *live |
04:28:05 | skrylar | info is not a bad format, really. |
04:28:19 | skrylar | the browsers for it tend to be crap (thinking of the cli app here) but with a better faceplate nobody would be complaining |
04:28:54 | FromGitter | <kaushalmodi> yeah, I think the best browser is the Emacs Info mode |
04:30:07 | FromGitter | <kaushalmodi> A single `C-s` binding allows searching through the whole manual incrementally, allows jumping to any random node using fuzzy completion of your choice, etc. |
04:32:29 | ldlework | hail emacs |
04:33:19 | skrylar | emacs wouldn't give me fuzzy autocomplete a la sublime |
04:33:21 | * | lompik joined #nim |
04:33:30 | skrylar | (or kokune, apparently) |
04:34:07 | ldlework | fuzzy autocomplete for what |
04:35:44 | skrylar | typing regular identifiers/snippets |
04:38:42 | FromGitter | <kaushalmodi> `hippie-expand` works pretty well for me for autocompleting identifiers |
04:38:55 | FromGitter | <kaushalmodi> Haven't yet needed to auto-complete snippets |
04:39:38 | FromGitter | <kaushalmodi> There are auto-complete and company-mode packages for auto-completion suggestions but they come more in my way than help. |
04:40:08 | skrylar | i know they have some auto completers, but they weren't doing automatic fuzzy matching like sublime and kokune do |
04:40:34 | skrylar | there were a lot of complaints because trying to do constant flx matching is too slow in elisp and contributing a C native for it is a pain |
04:40:46 | skrylar | also firefox keeps crashing the tab i attempt to open a texi2html file with :concern: |
04:41:54 | skrylar | I guess asciidoctor it is then? |
04:55:02 | FromGitter | <kaushalmodi> I believe asciidoc is fine too.. I think there are many Adoc fans here |
04:55:21 | skrylar | i use the ruby rewrite because the other is written in python2 |
04:55:30 | skrylar | supporting continued use of dead snakes is :E |
04:55:57 | skrylar | although that means i have to port the firebird docs (because texi2html is crashing firefox), and thats :\ |
04:56:45 | skrylar | Texi actually has multiple indices (adoc does not), so you can have one just for functions and one for concepts |
04:57:12 | FromGitter | <kaushalmodi> @Quelklef Can you try visiting that same link (https://scripter.co/notes/nim/#writing-files) again on mobile Safari.. looks like it's fixed this time around for realz (it was this issue: https://github.com/fonttools/fonttools/issues/1294) |
04:58:03 | FromGitter | <kaushalmodi> skrylar: I am not a texi expert.. but did you ask the texi user group (there should be a mailing list) for help? |
04:58:21 | skrylar | no, i just discovered this problem ten minutes ago |
04:58:30 | FromGitter | <Quelklef> Sure send the link again @kaushalmodi |
04:58:57 | FromGitter | <kaushalmodi> I hyperlinked the "link" in my previous message |
04:59:16 | FromGitter | <Quelklef> Oh yeah fancy |
04:59:28 | FromGitter | <kaushalmodi> Gitter supports markdown |
04:59:37 | FromGitter | <Quelklef> Yeah I know |
04:59:42 | FromGitter | <Quelklef> my eyes just glazed over it |
04:59:48 | FromGitter | <Quelklef> appears to be fixed now 👍 |
04:59:51 | FromGitter | <kaushalmodi> oh ok :) |
04:59:52 | FromGitter | <kaushalmodi> phew |
04:59:53 | FromGitter | <kaushalmodi> thanks |
05:00:02 | FromGitter | <Quelklef> np |
05:00:05 | FromGitter | <Quelklef> also looks nice |
05:00:08 | FromGitter | <Quelklef> is this your personal site? |
05:00:15 | FromGitter | <kaushalmodi> yep |
05:00:32 | FromGitter | <Quelklef> It looks like something I wish I could design :) |
05:00:45 | FromGitter | <kaushalmodi> It's my coding/scripting blog and notes collection |
05:00:48 | FromGitter | <Quelklef> Which i realize is a bit of an odd compliment |
05:00:54 | FromGitter | <Quelklef> It looks nice either way |
05:01:19 | FromGitter | <kaushalmodi> Thanks :) Slowly and gradually that site is turning into exactly how I like |
05:01:52 | FromGitter | <kaushalmodi> Issues like these (WOFF2 not working on Safari) helps in learn more about CSS, fonts, etc. |
05:02:56 | FromGitter | <Quelklef> Is this how you primary learned web frontend? |
05:03:25 | FromGitter | <kaushalmodi> If you call that "web frontend", then yes :) |
05:03:38 | FromGitter | <kaushalmodi> That blog is the only web thing I have done.. my day time job is something else |
05:03:47 | FromGitter | <Quelklef> I mean... what else would web frontend be |
05:03:54 | FromGitter | <Quelklef> Damn, it looks really well done |
05:04:09 | FromGitter | <Quelklef> Although I see you've been working on it since 2014, so I suppose there's been time to perfect |
05:04:19 | skrylar | nvm fixed |
05:04:30 | FromGitter | <Quelklef> `<article>` instead of `<div class="article">` |
05:04:31 | FromGitter | <kaushalmodi> I had no idea what web frontend is and so looked up https://en.wikipedia.org/wiki/Front-end_web_development |
05:04:43 | FromGitter | <kaushalmodi> I know probably 5% of all that :P |
05:04:51 | FromGitter | <Quelklef> Lol |
05:04:53 | FromGitter | <kaushalmodi> I don't know JS, webassembly, etc etc |
05:05:05 | FromGitter | <Quelklef> Learn JS! |
05:05:15 | FromGitter | <Quelklef> Learn JS so that you can avoid it at all costs :^) |
05:05:21 | FromGitter | <kaushalmodi> I am learning Nim |
05:05:29 | FromGitter | <kaushalmodi> hoping to export Nim to JS if ever I need it :P |
05:05:42 | FromGitter | <Quelklef> True |
05:05:57 | FromGitter | <Quelklef> But you'll probably need to know JS in order to do the interpolating |
05:06:14 | FromGitter | <Quelklef> besides JS is kinda fun |
05:06:32 | FromGitter | <Quelklef> until you worry about actual things like browser support and whatnot |
05:06:37 | FromGitter | <kaushalmodi> I like lisp (emacs-lisp) for fun, and Nim is getting close to that |
05:06:38 | FromGitter | <Quelklef> but otherwise it's kinda like play-doh |
05:06:51 | FromGitter | <Quelklef> wym it's getting close? |
05:07:12 | FromGitter | <kaushalmodi> emacs-lisp is extremely flexible.. I can override anything, introspect anything |
05:07:30 | FromGitter | <Quelklef> yeah lisp is a very flexible language |
05:07:36 | FromGitter | <kaushalmodi> The inbuilt Emacs help system is super awesome |
05:08:06 | FromGitter | <kaushalmodi> I can down to any level into the rabbithole (until I reach the Emacs-Lisp/C boundary :)) |
05:08:48 | skrylar | apparently gitbook went all corporate :( |
05:08:57 | FromGitter | <Quelklef> I always found Lisp (Common Lisp) annoying though because of a weird and inconsistent stdlib. Is Emacs-Lisp better? |
05:09:12 | FromGitter | <Quelklef> I wonder if I should learn it. I was thinking about maybe learning Scheme/Clojure in hopes that they're what Lisp should be |
05:09:28 | FromGitter | <kaushalmodi> Emacs-Lisp is worth learning only if you use Emacs |
05:09:35 | FromGitter | <Quelklef> that's a no from me then |
05:09:45 | FromGitter | <kaushalmodi> Emacs-Lisp ties the lisp with the buffer/window system of Emacs |
05:09:54 | FromGitter | <Quelklef> Huh |
05:10:31 | FromGitter | <Quelklef> that reminds me |
05:10:46 | FromGitter | <Quelklef> of a wild idea I had and I want someone to tell me if it's just dumb before I put any time into it |
05:10:57 | FromGitter | <kaushalmodi> to give a little bit of taste of what I said above: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46e2e0897d514b3c45d4cd] |
05:11:21 | FromGitter | <kaushalmodi> I was once reading pdf in one window in emacs while typing notes in the other window |
05:11:34 | FromGitter | <Quelklef> ech different namespaces for functions and vars still |
05:11:35 | FromGitter | <kaushalmodi> and I wanted to scroll the other window while *being* in the current window |
05:11:40 | FromGitter | <kaushalmodi> so I just wrote that up |
05:11:46 | FromGitter | <Quelklef> Oh! That's cool though |
05:11:52 | FromGitter | <Quelklef> huh |
05:12:03 | FromGitter | <Quelklef> I use Kakoune, I wonder if its scripting is as powerful |
05:12:05 | FromGitter | <kaushalmodi> emacs-lisp basically allow you to do anything you can think of |
05:12:07 | FromGitter | <Quelklef> I never learned any |
05:14:58 | FromGitter | <Quelklef> oh cool you just taught me that `fmt` from `strformat` exists |
05:15:56 | FromGitter | <kaushalmodi> ooh.. now that you know about `fmt`, you might now start to always import `strformat`.. you'll see that pattern in my Nim notes :) |
05:16:00 | FromGitter | <kaushalmodi> .. and `typetraits` |
05:17:03 | FromGitter | <kaushalmodi> I have separate set of notes dedicated to just `fmt`: https://scripter.co/notes/nim-fmt/ |
05:19:07 | FromGitter | <kaushalmodi> btw if anyone knows Pygmentize/Go, can they help fix the syntax highlighting of standalone `_` in Nim code blocks: https://github.com/alecthomas/chroma/issues/146 |
05:20:25 | * | nsf joined #nim |
05:20:46 | FromGitter | <Quelklef> Agh I wish we had compiler warnings on unused imports |
05:20:59 | FromGitter | <Quelklef> I always end up with like 12 because I add some, remove any uses, and forget to remove them |
05:21:25 | FromGitter | <Quelklef> but this goes back to what I was saying before (the crazy idea): what if the compiler didn't just warn on them, but could optionally remove unused imports for you |
05:21:54 | FromGitter | <Quelklef> i.e. spit out a modified version of the source correctly formatted, without superfluous imports, et.c |
05:22:01 | FromGitter | <Quelklef> Like an IDE, but without an IDE |
05:22:50 | FromGitter | <Quelklef> Additionally! Note that there's a kind of a conflict when coding: You want to *write* the least amount possible to code what you need to, but later when you're *reading* the code, you want more (type annotations, for instance) |
05:24:34 | FromGitter | <Quelklef> For example consider `throws` in Java. It's a pain to manage, and I know Eclipse can do it for you. Similarly, in Nim, we have `{.throws: [...].}` (not actually quite the same, but I'm ignoring that for now). What if the compiler checked the exceptions it could raise and documented that in the code for you so you got more information when reading without having to write anything more |
05:24:45 | FromGitter | <Quelklef> It's a bit of a crazy idea but I wonder if there's real merit to it... |
05:34:09 | * | Perkol joined #nim |
05:45:41 | skrylar | i think the exceptions tags are supposed to be there to warn you if something is going to throw exceptions you had not anticipated |
05:46:03 | skrylar | ex. an API change happens and now there is a new error you don't handle |
05:46:14 | FromGitter | <Quelklef> Yeah |
05:46:19 | FromGitter | <Quelklef> I was just using it for example |
05:46:42 | FromGitter | <Quelklef> In reality it'd be more like: exception tags that are noops and are placed there by the compiler for documentation purposes only |
05:47:14 | FromGitter | <Quelklef> 'd probably be wise to just use comments, come to think of it... |
06:23:51 | * | jamesroseman joined #nim |
06:28:47 | * | jamesroseman quit (Ping timeout: 276 seconds) |
06:39:10 | * | donlzx quit (Remote host closed the connection) |
06:43:03 | * | noonien joined #nim |
06:54:50 | * | Vladar joined #nim |
07:03:54 | Perkol | Is there a proc in standart library to get list of dirs in some directory? |
07:08:55 | * | leorize quit (Quit: WeeChat 2.1) |
07:09:11 | * | yglukhov[i] joined #nim |
07:09:47 | FromGitter | <tim-st> Perkol: maybe this: https://nim-lang.org/docs/os.html#walkPattern.i,string |
07:10:08 | FromGitter | <tim-st> or one of these below |
07:13:25 | FromGitter | <Bennyelg> nice site!! @kaushalmodi ⏎ https://scripter.co/notes/nim-fmt/ |
07:14:14 | * | avsej quit (Ping timeout: 256 seconds) |
07:22:42 | * | PMunch joined #nim |
07:24:36 | * | jamesroseman joined #nim |
07:29:05 | * | jamesroseman quit (Ping timeout: 256 seconds) |
07:33:51 | FromGitter | <gogolxdong> How to link libvixAllProducts.so ? |
07:37:35 | * | dddddd joined #nim |
07:42:07 | FromGitter | <gogolxdong> nim c --passL:libvixAllProducts.so -r powerOn.nim |
08:18:46 | * | jamesroseman joined #nim |
08:23:42 | * | jamesroseman quit (Ping timeout: 268 seconds) |
08:42:29 | * | avsej joined #nim |
08:42:30 | * | avsej quit (Changing host) |
08:42:30 | * | avsej joined #nim |
08:55:28 | * | BitPuffin joined #nim |
09:19:31 | * | donlzx joined #nim |
09:24:30 | * | skrylar quit (Remote host closed the connection) |
09:32:06 | * | craigger_ quit (Read error: Connection reset by peer) |
09:33:33 | * | craigger joined #nim |
09:38:01 | * | rockcavera quit (Remote host closed the connection) |
10:07:06 | * | jamesroseman joined #nim |
10:11:43 | * | jamesroseman quit (Ping timeout: 256 seconds) |
10:47:51 | * | NamPNQ joined #nim |
10:57:24 | * | jamesroseman joined #nim |
11:01:35 | * | jamesroseman quit (Ping timeout: 240 seconds) |
11:13:39 | * | stefanos82 joined #nim |
11:19:17 | * | NamPNQ quit (Remote host closed the connection) |
11:19:37 | Yardanico | how do I call a proc like "proc GetParamW*(st: DWord, value: pointer, size: DWord, outLength: var DWord): bool" with "value" being a string? |
11:20:08 | Yardanico | I know how to get the pointer to the string/cstring, but how to use outLength to set the length of the string after calling this proc? |
11:22:16 | Araq | setLen? |
11:22:55 | Yardanico | Araq, it works only for string, right? |
11:23:42 | Araq | you pass the Nim string as a cstring and setLen it afterwards. |
11:24:02 | Araq | that's what I do, but maybe GetParamW is special |
11:28:35 | * | yglukhov[i] quit (Ping timeout: 265 seconds) |
11:30:55 | * | skrylar joined #nim |
11:32:35 | * | Perkol quit (Remote host closed the connection) |
11:39:28 | FromGitter | <tim-st> does this work without a cast? |
11:42:05 | * | yglukhov[i] joined #nim |
11:43:46 | FromGitter | <tim-st> I currently do it like this: |
11:43:53 | FromGitter | <tim-st> result = $castcstring (val.mv_data) ⏎ result.setLen(val.mv_size) |
11:44:21 | FromGitter | <tim-st> `result = $castcstring (val.mv_data)` |
11:44:43 | FromGitter | <tim-st> I think this does a copy |
11:45:27 | * | jamesroseman joined #nim |
11:55:24 | * | def- quit (Quit: -) |
11:58:52 | * | def- joined #nim |
12:02:09 | * | jamesroseman quit (Ping timeout: 248 seconds) |
12:06:49 | * | Vladar quit (Quit: Leaving) |
12:13:57 | * | nsf quit (Quit: WeeChat 2.1) |
12:23:12 | * | tzekid joined #nim |
12:40:21 | * | tzekid quit (Quit: Page closed) |
13:07:32 | * | jamesroseman joined #nim |
13:10:50 | * | endragor quit (Remote host closed the connection) |
13:12:54 | FromGitter | <Varriount> @tim-st `$` on a cstring performs a copy |
13:13:04 | * | leorize joined #nim |
13:41:45 | skrylar | Huh. Kak already has some basic nim support |
13:47:04 | zacharycarter | I really want to learn Kakoune |
13:47:10 | zacharycarter | I've heard it's sweet |
13:47:33 | skrylar | trying it out right now. it's uh.. weird but neat |
13:47:53 | skrylar | no snippets though :\ |
13:48:23 | FromGitter | <tim-st> @Varriount Thanks, no copy does only work when staying at type `cstring` or can I achieve no copy with nims `string` too? |
13:48:35 | skrylar | multiselections are basically the big deal. you can do things like select huge chunks, then split each line or subsections, keep only lines that have certain letters, etc |
13:48:36 | zacharycarter | I'm not used to using snippets anyway so that's fine w/ me :P |
13:48:45 | skrylar | snippets are great when your language is shit |
13:48:57 | zacharycarter | like java? |
13:49:05 | zacharycarter | or c++? |
13:49:21 | zacharycarter | gotcha |
13:49:25 | skrylar | had some anti-strain stuff in emacs for C++ back in the day. custom elisp so typing ;; would emit :: |
13:49:35 | skrylar | -. became -> |
13:49:56 | zacharycarter | nice |
13:50:41 | skrylar | elisp in yasnippet is also nice because if you do the whole "one file one class" thing, you just slurp the buffer's filename as the default, so "void SomeStupidClass::ThingDo {..}" is f<tab> |
13:55:47 | skrylar | turns out skeasing 1) is badly named, it HAS to be imported as 'skEasing' on nix and 2) never worked |
13:59:22 | * | nsf joined #nim |
14:07:55 | * | PMunch quit (Quit: Leaving) |
14:13:29 | skrylar | kak is being annoying in that i can't figure out how to do things like shimmy just one line in or out of a selection |
14:22:02 | Araq | kak is a funny name |
14:22:32 | * | Vladar joined #nim |
14:25:56 | subsetpark | skrylar: use K and J |
14:27:25 | skrylar | subsetpark, thankies |
14:39:17 | * | donlzx quit (Remote host closed the connection) |
14:39:40 | * | donlzx joined #nim |
14:40:42 | stefanos82 | I wonder people don't use or like Vim 8 :/ |
14:40:52 | stefanos82 | *why people |
14:41:52 | dom96 | Because it's inconsistent with the rest of my OS |
14:42:25 | dom96 | I've spent a month trying to work in vim (even printed a cheatsheet) and I just couldn't get into it |
14:45:21 | skrylar | i stopped using vim and went to evil-mode basically until RSI gave me issues again |
14:46:12 | skrylar | only reason i've been using sublime so much lately is multicaret is fluid and makes a lot of the wrapping easier |
14:51:40 | * | donzx joined #nim |
14:54:29 | * | donlzx quit (Ping timeout: 276 seconds) |
14:59:06 | stefanos82 | dom96: for how long have you been using it? |
15:06:24 | * | smt quit (Read error: Connection reset by peer) |
15:07:11 | * | smt joined #nim |
15:07:47 | skrylar | https://github.com/Skrylar/skEasing/blob/master/docs/preview.adoc our easing lib is no longer a broken piece of crap \o/ |
15:18:15 | * | miran joined #nim |
15:24:13 | zacharycarter | hrm - I'm compiling with the -d:nodejs define and trying to echo |
15:24:19 | zacharycarter | when I do - `echo(fs.statSync(fullpath).isDirectory())` |
15:24:30 | zacharycarter | I get - `echo(fs.statSync(fullpath).isDirectory())` |
15:24:37 | zacharycarter | sorry |
15:24:40 | zacharycarter | `type mismatch: got <JsObject>` |
15:24:53 | dom96 | stefanos82: A month |
15:25:38 | zacharycarter | even - `echo((fs.statSync(fullpath).isDirectory()).bool)` - fails with the same error |
15:27:48 | Araq | stefanos82: do you use a mouse? |
15:30:40 | zacharycarter | nm I found the to proc in jsffi |
15:32:30 | * | PMunch joined #nim |
15:47:27 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
15:48:03 | * | yglukhov[i] joined #nim |
15:51:59 | * | Trustable joined #nim |
15:55:34 | * | rockcavera joined #nim |
15:55:46 | * | zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/KOtDwmtqdkixRqNdMlFHYNeK > |
15:55:53 | zacharycarter | I'm getting invalid indentation inside the arrow proc |
15:55:55 | zacharycarter | at the conditional |
15:56:05 | zacharycarter | `if name == "package.json":` |
16:02:38 | zacharycarter | semicolons seem to be helping |
16:07:06 | * | jamesroseman quit (Ping timeout: 244 seconds) |
16:09:06 | * | Trustable quit (Remote host closed the connection) |
16:11:05 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
16:23:04 | * | yglukhov[i] joined #nim |
16:28:07 | FromGitter | <tim-st> this example has wrong proc name: https://github.com/nim-lang/Nim/blob/master/lib/pure/strutils.nim#L1057 |
16:28:59 | FromGitter | <Quelklef> @tim-st then make a PR |
16:29:45 | FromGitter | <tim-st> dont have the things installed to make it tbh |
16:30:05 | FromGitter | <Quelklef> ? |
16:30:07 | FromGitter | <Quelklef> No git? |
16:30:22 | FromGitter | <tim-st> dont think so |
16:30:33 | FromGitter | <Quelklef> oh |
16:30:38 | FromGitter | <tim-st> well I have, but I dont use it |
16:30:56 | FromGitter | <Quelklef> You should learn it |
16:30:58 | FromGitter | <Quelklef> Git's great |
16:31:14 | FromGitter | <tim-st> dont need it currently |
16:31:31 | FromGitter | <Quelklef> Do you use something else instead |
16:31:35 | FromGitter | <Quelklef> or just no vcs |
16:31:53 | FromGitter | <tim-st> for my own project I dont need version control |
16:32:04 | FromGitter | <kayabaNerve> ... |
16:32:41 | * | donzx quit (Remote host closed the connection) |
16:33:16 | FromGitter | <kayabaNerve> https://www.hackread.com/developer-deletes-work-files-with-visual-studio-code/ |
16:33:20 | FromGitter | <kayabaNerve> Don't be that guy. |
16:33:37 | miran | i was that guy before that guy |
16:33:58 | miran | but i didn't write about it, just kicked myself quite hard few times |
16:34:04 | * | jamesroseman joined #nim |
16:34:05 | FromGitter | <Quelklef> ouch |
16:35:12 | FromGitter | <tim-st> I make zip backups on each milestone, and I think If I delete accidently this files are not real deleted |
16:35:23 | FromGitter | <Quelklef> uh |
16:35:24 | FromGitter | <Quelklef> hmmmm |
16:35:32 | FromGitter | <Quelklef> why not just... use git |
16:35:40 | FromGitter | <tim-st> too much time goes in it |
16:35:45 | FromGitter | <Quelklef> im pretty sure it'd be less effort once you learn it |
16:36:05 | FromGitter | <Quelklef> well, perhaps more effort, but with a much higher payoff |
16:36:19 | FromGitter | <Quelklef> i.e. instead of getting things locally, you can put it on the cloud, as well, for free, if you'd like |
16:36:28 | FromGitter | <tim-st> maybe I use it later when I reached a alpha status |
16:36:33 | FromGitter | <Quelklef> a what? |
16:36:38 | FromGitter | <tim-st> *my version |
16:36:40 | PMunch | "Why you have three months of work not under source control is the bigger question." - The real question here |
16:36:42 | FromGitter | <tim-st> alpha version |
16:36:43 | FromGitter | <Quelklef> Ah |
16:36:53 | FromGitter | <kaushalmodi> I never get that.. learning git is a life skill.. just learn it once |
16:37:16 | CodeVance | zachary carter: It's cause you used the arrow syntax. That one is only for one liners. use the old proc syntax. remove the (). That's only my opinion. But if you prefer the arrow syntax then just add semicolons between statements. |
16:37:21 | FromGitter | <tim-st> well it just looks so ugly, the commands seem designed like the task was "make it as ugly as possible" |
16:37:40 | FromGitter | <Quelklef> ?? |
16:37:42 | FromGitter | <kaushalmodi> try out some porcelains (git wrappers) |
16:37:46 | FromGitter | <kaushalmodi> I use Magit on Emacs |
16:38:12 | miran | git in vscode is quite straightforward |
16:38:12 | FromGitter | <tim-st> I've seen there is a good integration in vscode, but I dont feel the use for it tbh |
16:38:19 | FromGitter | <tim-st> *the need |
16:38:57 | * | jamesroseman quit (Ping timeout: 240 seconds) |
16:39:04 | * | Perkol joined #nim |
16:39:44 | Perkol | What is the keyword for doing nothing? Like pass in python |
16:39:52 | miran | Perkol: discard |
16:39:54 | FromGitter | <Quelklef> discard |
16:40:18 | FromGitter | <Quelklef> alternatively, `(proc: void = return)()` |
16:40:28 | Perkol | Yeah thanks |
16:40:38 | PMunch | tim-st, once you learn it you will wonder how you ever did without :P |
16:40:43 | FromGitter | <kayabaNerve> Use Github Desktop |
16:40:46 | FromGitter | <kayabaNerve> Easy as hell |
16:40:48 | FromGitter | <kayabaNerve> No cli |
16:41:07 | FromGitter | <tim-st> PMunch: I already used it in university, but dont need it currently |
16:41:47 | PMunch | Pfft, you always need version control |
16:42:22 | FromGitter | <Quelklef> I mean he has version control |
16:42:25 | FromGitter | <Quelklef> just not git |
16:42:48 | PMunch | Haha, yeah I guess zip files of project state technically is version control |
16:42:49 | FromGitter | <tim-st> I have version control in my head |
16:43:11 | FromGitter | <Quelklef> yoooo |
16:43:25 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve |
16:43:28 | FromGitter | <kayabaNerve> This is my GitHub |
16:43:29 | FromGitter | <Quelklef> this mans in 3018 |
16:43:32 | FromGitter | <kayabaNerve> I use version control with it |
16:43:35 | FromGitter | <kayabaNerve> It has my projects |
16:43:36 | FromGitter | <tim-st> ^^ |
16:43:38 | FromGitter | <kayabaNerve> Employers see it |
16:43:43 | FromGitter | <kayabaNerve> If needed, I can grab code from it |
16:43:48 | FromGitter | <kayabaNerve> If my desktop dies, I can grab code |
16:43:54 | FromGitter | <kayabaNerve> If their servers die, I can grad code |
16:43:59 | FromGitter | <Quelklef> sorry, Ember is a cryptocurrency? |
16:44:10 | FromGitter | <kayabaNerve> @Quelklef Did you just find that out? |
16:44:22 | FromGitter | <kayabaNerve> If I make a bad edit, I can revert it |
16:44:22 | FromGitter | <Quelklef> Yeah I knew you had something called Ember but I hadn't looked at it |
16:44:29 | FromGitter | <Quelklef> Are you in uni? |
16:44:32 | FromGitter | <kayabaNerve> No |
16:44:35 | FromGitter | <kayabaNerve> Just graduated HS |
16:44:46 | FromGitter | <Quelklef> ah |
16:44:49 | FromGitter | <Quelklef> So about to be |
16:44:53 | FromGitter | <kayabaNerve> 16 yr old; out of the formal set of schooling; not going to college |
16:45:00 | FromGitter | <kayabaNerve> Nah it's 170k after my college fund |
16:45:02 | PMunch | kayabaNerve, my GitHub is also full of stuff. But I also have a private server with a lot more stuff |
16:45:05 | miran | wow, i thought you're older @kayabaNerve! |
16:45:11 | FromGitter | <Quelklef> Same, miran |
16:45:16 | FromGitter | <kayabaNerve> That's a lot of debt to take |
16:45:22 | FromGitter | <kayabaNerve> Eh. It shows in my behavior |
16:45:40 | FromGitter | <Quelklef> Ages are always fun online |
16:45:50 | FromGitter | <kayabaNerve> But I rather go to work then take the 170k in debt. I have enough connections where I don't need a degree to get a job. |
16:45:54 | PMunch | kayabaNerve, move to a country that has a proper educational system and you'll get it for close to free |
16:46:02 | FromGitter | <kayabaNerve> Currently working for a crypto group, my own crypto, and an insurance group |
16:46:03 | FromGitter | <Quelklef> ouch |
16:46:14 | FromGitter | <Quelklef> ouch @ PMuch, oops |
16:46:15 | FromGitter | <kayabaNerve> PMunch I should tbh lol |
16:46:20 | FromGitter | <Quelklef> So you're set then |
16:46:21 | FromGitter | <kayabaNerve> @Quelklef How old are you/ |
16:46:23 | FromGitter | <Quelklef> you don't even need Uni |
16:46:27 | PMunch | I'm just done with my masters thesis, and I've only got about $6k in debt |
16:46:28 | FromGitter | <Quelklef> I'm also 16! |
16:46:45 | miran | omg, i just figured out i'm twice your age! jesus, i'm old! |
16:46:54 | FromGitter | <Quelklef> Holy moly |
16:46:55 | FromGitter | <kayabaNerve> Yeah. Don't need it. It would be good if it wasn't so expensive though... |
16:47:02 | FromGitter | <kayabaNerve> @Quelklef Are you my twin? |
16:47:08 | PMunch | miran, yeah I was also starting to feel old here :P |
16:47:11 | FromGitter | <kayabaNerve> miran: I think you have to leave now... |
16:47:25 | FromGitter | <kayabaNerve> I thought Quelkef was 20 something |
16:47:33 | FromGitter | <Quelklef> no @miran you count as two 16 year olds |
16:47:35 | miran | boy, when i was your age, we respected elders!!! :P :D |
16:48:01 | FromGitter | <kayabaNerve> miran: You're not an elder. :P |
16:48:09 | FromGitter | <Quelklef> Not yet... |
16:48:17 | miran | eh, if only i took programming more seriously at your age.... |
16:48:21 | FromGitter | <kayabaNerve> Elder is... IDK. 40+ for adulthood advice, 60+ for societal advice |
16:48:42 | miran | ok ok, you don't have to respect me then, fine! :P :D |
16:48:52 | FromGitter | <kayabaNerve> Yeah you're in the old but not elder spot :P |
16:50:15 | FromGitter | <citycide> dom96: is there an issue for this or can we open one? it would feel much better: https://github.com/nim-lang/Nim/issues/8237#issuecomment-403225755 |
16:50:22 | FromGitter | <kayabaNerve> @Quelklef You interested in crypto? |
16:50:27 | FromGitter | <tim-st> anyone has a guess about the sentence here reagarding "dupsort": https://www.openldap.org/lists/openldap-technical/201410/msg00011.html |
16:50:34 | FromGitter | <tim-st> that sounds really expensive |
16:50:38 | FromGitter | <Quelklef> Not really @kayabaNerve |
16:51:02 | FromGitter | <Quelklef> My current interests are programming languages and language design |
16:51:20 | FromGitter | <Quelklef> So it's really cool to be around Nim as it's developed |
16:51:24 | FromGitter | <kayabaNerve> Got it |
16:51:35 | FromGitter | <Quelklef> Although I did learn about /r/memeeconomy today, if that counts... |
16:51:51 | FromGitter | <kayabaNerve> 1) make an esoteric lang ⏎ 2) make a smart contract lang |
16:52:14 | stefanos82 | Araq: mouse with Vim? Nope. Why should I? |
16:52:19 | FromGitter | <Quelklef> That's a crypto concept, yeah? |
16:52:29 | miran | stefanos82: because it is 2018? ;) |
16:52:54 | stefanos82 | miran: why should I use my mouse with my editor if I can use some keys to do my job? |
16:53:08 | FromGitter | <kayabaNerve> @Quelklef Smart Contract = App published to a decentralized network run by nodes on the decentralized network. Absolute and verifiable. All inputs and outputs may not be transparent but are logged and the actions taken are reproducible. |
16:53:21 | FromGitter | <kayabaNerve> Ethereum is the biggest. |
16:53:39 | FromGitter | <kayabaNerve> the Ethereum Virtual Machine is coded in... Solidity, Vyper, Flynt IIRC |
16:53:43 | miran | stefanos82: well, i use vim keybindings in vscode and i prefer keyboard shortcuts, but sometimes for some stuff, using the mouse is easier and more elegant |
16:53:44 | FromGitter | <kayabaNerve> But Solidity 99% of the time |
16:54:00 | FromGitter | <kayabaNerve> *Flint |
16:54:13 | stefanos82 | miran: I never felt the need to use my mouse with Vim. |
16:54:18 | FromGitter | <Quelklef> THen not a cryptocurrency concept, but used heavily in cryptocurrencies |
16:54:23 | FromGitter | <Quelklef> Sounds more like the domain of a library to me |
16:54:56 | FromGitter | <kayabaNerve> Well. Technically a smart contract is a digital and absolute contract |
16:54:59 | FromGitter | <kayabaNerve> AKA a vending machine |
16:55:19 | FromGitter | <kayabaNerve> But then they're used now-a-days on decentralized networks which include the verifiable properties |
16:55:30 | FromGitter | <kayabaNerve> And then you use Cryptocurrency to pay for one to be run |
16:55:39 | FromGitter | <kayabaNerve> That's what Ether is. Gas for contracts. |
16:55:50 | FromGitter | <kayabaNerve> I would love Nim syntax for smart contracts |
16:55:58 | FromGitter | <Quelklef> do it |
16:56:00 | FromGitter | <kayabaNerve> Not Nim; it wouldn't work. Just Nim syntax |
16:56:06 | FromGitter | <Quelklef> Oh |
16:56:38 | FromGitter | <Quelklef> Git says Ember is C/Nim, though? |
16:57:16 | FromGitter | <kayabaNerve> It's Nim but I have a couple C libs in there |
16:57:48 | FromGitter | <kayabaNerve> Smart Contracts are run on VMs and have limited features |
16:57:51 | FromGitter | <Quelklef> I mean, Nim is designed to interface well with C.. |
16:57:57 | FromGitter | <Quelklef> hmm |
16:58:15 | FromGitter | <kayabaNerve> There's no console output on Ethereum. Instead, there's events and arguments supplied to the events. |
16:58:25 | FromGitter | <kayabaNerve> There's no message passing. There's child TXs. |
16:58:30 | FromGitter | <kayabaNerve> There are still function calls ofc |
16:58:56 | FromGitter | <Quelklef> We're getting way out of my domain of understanding here |
16:59:37 | skrylar | quelklef: springs! |
16:59:38 | FromGitter | <kayabaNerve> Yeah. Lyra2 + BigNumbers are in C. Rest is Nim. |
17:00:11 | FromGitter | <Quelklef> @skrylar Come again? |
17:01:20 | FromGitter | <Quelklef> @kayabaNerve "#Hash *exponent*. Used to generate SHA512 Squared and Cubed hashes." |
17:01:35 | FromGitter | <Quelklef> Were you the one asking for `f^3(x)` before? |
17:01:50 | skrylar | https://github.com/Skrylar/skEasing/blob/master/docs/spring.png boing! |
17:02:47 | FromGitter | <kayabaNerve> @Quelklef Yes. I'm working with (sha512^3)(x) |
17:02:56 | FromGitter | <Quelklef> hah, I remember that |
17:03:41 | FromGitter | <kayabaNerve> I just wanted SHA512 cubed :P |
17:03:46 | FromGitter | <kayabaNerve> And now I have it |
17:04:05 | FromGitter | <Quelklef> You could make the proc general |
17:04:07 | FromGitter | <kayabaNerve> And I wouldn't mind using SHA512^ and hardcoding it to sha512 except you can't name a function like that |
17:04:17 | FromGitter | <kayabaNerve> What do you mean? |
17:04:33 | FromGitter | <Quelklef> I mean it could be a generic func |
17:04:41 | FromGitter | <Quelklef> can I make it generic in a `util.nim` and make a PR? |
17:04:51 | FromGitter | <kayabaNerve> Someone posted a 30 to 50 line macro that did it like that SHA512^3(x) IIRC |
17:05:03 | FromGitter | <kayabaNerve> Sure. I edited this based on an idea from someone else |
17:05:08 | FromGitter | <Quelklef> Yeah with the syntax you wanted |
17:05:30 | FromGitter | <kayabaNerve> They suggested something like that and I got it up and running. Feel free to do what you want with it. |
17:05:52 | FromGitter | <kayabaNerve> If it allows me to get closer to my syntax without a 30 to 50 line macro (I'm not that devoted to it), I'll be happy |
17:06:48 | FromGitter | <Quelklef> I'm pretty sure it was me :) |
17:08:04 | FromGitter | <kayabaNerve> Lol. Thanks if so :D |
17:08:07 | zacharycarter | thanks codevance |
17:09:21 | Araq | please keep in mind that compiler/parser is usable as a library |
17:09:33 | Araq | especially in devel where the APIs got a cleanup |
17:14:54 | FromGitter | <Quelklef> @kayabaNerve Where's `secp256k1` from? |
17:15:02 | FromGitter | <Quelklef> Can't compile because of the `import secp256k1`. |
17:16:57 | FromGitter | <Quelklef> Is it a C lib |
17:18:29 | * | jamesroseman joined #nim |
17:18:46 | * | krux02 joined #nim |
17:19:10 | krux02 | Araq: I am currently renaming all the files like you suggested. But I can't say that I like it, because it is now not clear what to do to invoke the test. |
17:20:00 | Araq | it matters that I like it. |
17:38:30 | shashlick | haha, I guess I'm almost an elder |
17:39:29 | * | smt quit (Ping timeout: 260 seconds) |
17:44:59 | FromGitter | <kayabaNerve> @Quelklef You're the second or third other to compile this and I wasn't there for you |
17:45:01 | FromGitter | <kayabaNerve> I'm sorry |
17:45:05 | FromGitter | <kayabaNerve> I've failed you |
17:45:26 | FromGitter | <kayabaNerve> That said, it's a nimble lib actually. The Nimble lib doesn't have the lib included, but instead a... pointer? |
17:45:31 | FromGitter | <kayabaNerve> I don't know the git term |
17:45:38 | FromGitter | <Quelklef> Hahah well I made the PR anyway |
17:45:45 | FromGitter | <Quelklef> Pointer? |
17:45:52 | FromGitter | <Quelklef> Like a nested project? |
17:45:59 | FromGitter | <kayabaNerve> Submodule |
17:46:00 | FromGitter | <kayabaNerve> https://github.com/status-im/nim-secp256k1/tree/master/secp256k1_wrapper |
17:47:19 | krux02 | I now officially hate git |
17:47:28 | FromGitter | <kayabaNerve> kux02 Sup |
17:47:45 | krux02 | on my own brach I on my own fork I made `git pull` |
17:47:48 | krux02 | Everything up to date |
17:48:05 | krux02 | then I made changes |
17:48:08 | krux02 | now I want to push |
17:48:15 | krux02 | non fast forward |
17:48:32 | krux02 | conflics |
17:48:37 | krux02 | git officially lied to be |
17:48:39 | krux02 | me |
17:48:47 | krux02 | I still have the log |
17:49:04 | krux02 | http://ix.io/1gZM |
17:49:40 | miran | renault? :) |
17:50:41 | def- | miran: your car doesn't run Nim? |
17:51:31 | miran | def-: eh, it's time to replace my car, i guess.... :) |
17:52:03 | FromGitter | <kayabaNerve> @Quelklef Yay! First PR! That said, can't we import util into SHA512 and export it? |
17:52:23 | krux02 | no it's not my car it is this university computer that is called renault. |
17:52:32 | krux02 | has nothing to do with the car |
17:52:44 | FromGitter | <Quelklef> @kayabaNerve I mean, yeah, but why not just import and use the general proc instead? |
17:53:01 | miran | krux02, no need to lie, it's ok to run nim while you're driving |
17:53:19 | FromGitter | <kayabaNerve> Single place edit :P But I'll do it your way for right now |
17:54:19 | FromGitter | <Quelklef> Ah, yeah. Hmmm. |
17:55:08 | krux02 | (I don't have a car) |
17:56:31 | FromGitter | <kayabaNerve> @Quelklef I also can't get [T] to work |
17:56:43 | FromGitter | <kayabaNerve> Without it, it tries to match template ^ (int) |
17:57:23 | FromGitter | <Quelklef> Come again? |
17:58:08 | FromGitter | <kayabaNerve> Wallet\PublicKey.nim(20, 27) Error: type mismatch: got <proc (hex: string): string{.gcsafe, locks: 0.}, int literal(2)> ⏎ but expected one of: ⏎ template `^`(x: int): BackwardsIndex ⏎ first type mismatch at position: 1 ⏎ required type: int ... [https://gitter.im/nim-lang/Nim?at=5b4796af1c0f906b144c7f7f] |
17:58:24 | FromGitter | <Quelklef> It's not imported properly |
17:58:36 | FromGitter | <kayabaNerve> import ../lib/util |
17:58:38 | FromGitter | <Quelklef> hmmm |
17:58:51 | FromGitter | <kayabaNerve> I removed the [T] and set to string and it worked |
17:58:56 | FromGitter | <kayabaNerve> But then this has no value :P |
17:59:05 | FromGitter | <Quelklef> Thats... odd |
17:59:12 | FromGitter | <Quelklef> That feels like a bug tbh |
17:59:27 | FromGitter | <kayabaNerve> So we have to do untyped + typeinfo or nothing as far as I can tell... assuming untyped will even work with these proc pointers/vars |
17:59:36 | FromGitter | <kayabaNerve> TBH proc vars are basically function pointers |
17:59:48 | FromGitter | <Quelklef> woah slow down |
18:00:24 | FromGitter | <kayabaNerve> I will slow down but first I want to say I found a compiler crash |
18:00:38 | FromGitter | <Quelklef> uh oh |
18:00:58 | FromGitter | <kayabaNerve> https://gist.github.com/kayabaNerve/f60955b18b9aa01137195e88c6fa7cd0 |
18:01:00 | FromGitter | <Quelklef> yeah i installed secp256k1 and compiling main is giving a gcc error |
18:01:12 | FromGitter | <kayabaNerve> Nim Compiler Version 0.18.1 [Windows: amd64] ⏎ Compiled at 2018-07-11 |
18:01:17 | FromGitter | <Quelklef> `untyped` should only be used in macros |
18:01:29 | FromGitter | <Quelklef> iirc |
18:01:31 | FromGitter | <kayabaNerve> Got it. I'm not saying it should work. I'm saying the compiler crashed |
18:01:36 | FromGitter | <Quelklef> Ah yeah |
18:02:16 | FromGitter | <Quelklef> Compiling `PublicKey.nim` works for me... |
18:02:19 | FromGitter | <Quelklef> with the generic proc |
18:03:06 | * | krux02 quit (Quit: Leaving) |
18:03:31 | FromGitter | <kayabaNerve> What's your version? |
18:03:38 | FromGitter | <Quelklef> recompiled today |
18:03:47 | FromGitter | <kayabaNerve> And let me get a zip of your code instead of copy/pasting it |
18:03:55 | FromGitter | <Quelklef> It's the same as in the PR |
18:03:57 | zacharycarter | I'm looking through the karax source code - I guess {.compact.} is the annotation macro for creating a component with Karax |
18:03:59 | * | jamesroseman quit (Ping timeout: 260 seconds) |
18:04:12 | zacharycarter | do components have any advantages? I don't see any lifecycle methods or anything like that |
18:04:20 | FromGitter | <Quelklef> although the other ones fail with a gcc error |
18:04:39 | FromGitter | <kayabaNerve> Yeah. I'm downloading from there. |
18:04:42 | FromGitter | <kayabaNerve> What other ones? |
18:05:20 | FromGitter | <Quelklef> e.g. `Address.nim` |
18:05:23 | FromGitter | <Quelklef> trying to figure it out |
18:05:28 | FromGitter | <kayabaNerve> Ah |
18:05:32 | FromGitter | <Quelklef> it's complaining that `BN/imath.h` doesn't exist |
18:05:37 | FromGitter | <Quelklef> but it do |
18:06:08 | FromGitter | <kayabaNerve> Lol. It's probably a path error. |
18:06:22 | FromGitter | <Quelklef> i mean the import is correct |
18:06:22 | FromGitter | <kayabaNerve> Because GCC is relative to the nimcache files in the build directory IIRC |
18:06:28 | FromGitter | <Quelklef> ah hold on |
18:06:33 | zacharycarter | they don't think it be like it is but it do |
18:06:39 | FromGitter | <kayabaNerve> This is my issue with relative paths! |
18:06:45 | FromGitter | <Quelklef> compiling from src/ didn't fix it |
18:06:46 | * | jamesroseman joined #nim |
18:06:51 | FromGitter | <Quelklef> Wait |
18:06:51 | FromGitter | <kayabaNerve> Compile from the Git root |
18:07:11 | FromGitter | <kayabaNerve> This is why I wanted to start adding support for project paths btw. Because Nim is relative to the module, C libs are relative to the nimcache IIRC |
18:07:25 | FromGitter | <Quelklef> Yup, worked |
18:07:26 | FromGitter | <Quelklef> I see |
18:07:40 | FromGitter | <kayabaNerve> So ../ versus ~ isn't that big |
18:07:48 | FromGitter | <Quelklef> I still don't like that design |
18:07:48 | FromGitter | <kayabaNerve> Nor ../../ versus ~ |
18:07:53 | FromGitter | <Quelklef> also `main.nim` compiles fine for me |
18:07:57 | FromGitter | <kayabaNerve> Great |
18:08:22 | FromGitter | <kayabaNerve> I just want a way to support project relative paths |
18:08:45 | FromGitter | <kayabaNerve> I did a quick edit based on compiler location because I compile from my project root and I know how to |
18:08:54 | FromGitter | <kayabaNerve> I don't know how to do what I'm suggesting |
18:09:03 | FromGitter | <kayabaNerve> I don't care if it's in a nim.cfg where the project path is |
18:09:31 | FromGitter | <kayabaNerve> But relative to the module and then the nimcache is iffy |
18:09:59 | FromGitter | <kayabaNerve> BN/imath becomes ../../src/lib/BN/imath.c |
18:10:02 | zacharycarter | Araq: I could use some help here - how would you recommend I initialize components if they need extra javascript run on them after they are added to the vdom? |
18:10:22 | zacharycarter | I think react accomplishes this through lifecycle methods - so like, when a component is created, a certain lifecycle event is invoked |
18:23:21 | * | nsf quit (Quit: WeeChat 2.1) |
18:35:43 | dom96 | zacharycarter: save a `bool` state somewhere called `initialised`, check it on each render. |
18:37:23 | dom96 | https://news.ycombinator.com/item?id=17515492 :o |
18:37:51 | miran | dom96: heh, i waited for you to come online to send you the link :) |
18:39:38 | miran | PEP 572 has ruined python |
18:40:44 | dom96 | That explains the fact that it was accepted despite the majority voting against it |
18:41:57 | zacharycarter | dom96: do you mean in the post render callback? |
18:42:05 | dom96 | zacharycarter: no |
18:42:08 | zacharycarter | kind of ugly :/ |
18:42:28 | zacharycarter | oh |
18:43:04 | dom96 | proc render(component: Component): VDom = if not component.codeEditorInitialised: component.codeEditorInitialised = true; init() |
18:43:17 | dom96 | https://forum.nim-lang.org/t/4035 |
18:44:22 | zacharycarter | gotcha, thank you |
18:44:22 | * | amosbird quit (Quit: ZNC 1.6.5 - http://znc.in) |
18:44:29 | zacharycarter | very much! that helps immensely! |
18:44:35 | * | amosbird joined #nim |
18:48:43 | * | vivus joined #nim |
18:58:09 | * | dorelix joined #nim |
19:00:02 | * | krux02 joined #nim |
19:02:09 | FromGitter | <kaushalmodi> Looks like the `bignum` library (nimble package) now breaks on devel |
19:02:12 | FromGitter | <kaushalmodi> > /home/kmodi/.nimble/pkgs/bignum-1.0.0/bignum/private/int.nim(415, 28) Error: undeclared identifier: 'stmt' |
19:02:15 | FromGitter | <kaushalmodi> Any hints? |
19:02:21 | Yardanico | use "typed" or "untyped" |
19:02:43 | Yardanico | stmt was recently removed from devel (it was deprecated a long time ago) |
19:03:02 | FromGitter | <kaushalmodi> Yardanico: That was quick! |
19:03:08 | * | gangstacat quit (Ping timeout: 256 seconds) |
19:03:19 | FromGitter | <kaushalmodi> It was as if you were already expecting my question |
19:03:22 | FromGitter | <kaushalmodi> :) |
19:03:56 | FromGitter | <kaushalmodi> I am so new, that it's the first time I am seeing a `stmt` type :P |
19:04:15 | Yardanico | well, I'm "new" too - when I started learning nim "stmt" was already deprecated :) |
19:05:51 | FromGitter | <kaushalmodi> Sadly that library doesn't seem to be maintained anymore: https://github.com/FedeOmoto/bignum |
19:06:11 | FromGitter | <kaushalmodi> No activity in last 3 years, OP is inactive for the last year at least |
19:06:20 | FromGitter | <kaushalmodi> s/OP/bignum dev |
19:06:50 | Yardanico | .you can fork it and change URL in nim-lang/packages |
19:07:08 | FromGitter | <kaushalmodi> I can fork it.. but I don't have experience/knowledge to lead that fork |
19:07:19 | Yardanico | well, you can at least fix errors with devel |
19:07:29 | Yardanico | I hope there's not a lot of them |
19:07:56 | FromGitter | <kaushalmodi> I ended up on this error because of a toy snippet in my notes |
19:08:12 | FromGitter | <kaushalmodi> I reevaluate all code blocks in my notes about once a week or so |
19:08:32 | FromGitter | <kaushalmodi> So I am not a prime bignum user |
19:08:57 | FromGitter | <kaushalmodi> May be @mratsim can look into forking that? Don't know |
19:09:14 | * | Sembei joined #nim |
19:09:22 | FromGitter | <kaushalmodi> .. or have it become part of Nim std libs? |
19:10:05 | def- | nope |
19:10:13 | FromGitter | <kaushalmodi> I'm surprised I am the first person to fork that repo.. how do people deal with bignums? |
19:10:42 | * | skrylar quit (Remote host closed the connection) |
19:11:08 | * | skrylar joined #nim |
19:11:36 | FromGitter | <kayabaNerve> Can I yield an iterator? |
19:11:47 | FromGitter | <kayabaNerve> @kaushalmodi I use my own lib |
19:11:53 | FromGitter | <kayabaNerve> Well. My own wrapper |
19:11:57 | FromGitter | <kayabaNerve> It's of imath IIRC |
19:12:41 | Yardanico | hmm, what happens if I call "spawn" and number of threads in pool is already 256? will spawn wait until one of threads completes? |
19:12:50 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/BN.nim ⏎ https://github.com/kayabaNerve/Ember/tree/master/src/lib/BN ⏎ https://github.com/creachadair/imath |
19:13:00 | FromGitter | <kayabaNerve> There's the Nim file, my copy of the C, and details of the lib; |
19:13:09 | FromGitter | <kayabaNerve> I've been meaning to Nimble-fy it |
19:13:39 | * | Trustable joined #nim |
19:14:54 | FromGitter | <kaushalmodi> It would be nice to have a Nim std lib support big nums |
19:15:10 | FromGitter | <kaushalmodi> I ended up needing it for a very simply toy snippet |
19:15:43 | def- | there's a bug for that already btw: https://github.com/nim-lang/Nim/issues/2725 |
19:15:59 | FromGitter | <kaushalmodi> I know.. |
19:16:06 | FromGitter | <kaushalmodi> I am the only person to "like" that |
19:16:08 | FromGitter | <kaushalmodi> :P |
19:16:19 | FromGitter | <kayabaNerve> Again. |
19:16:45 | FromGitter | <kayabaNerve> IMath. Nim wrapper. Right there if you need it. Cross platform. 32 and 64 bits. No need to declare the bit size in advance. |
19:17:36 | FromGitter | <kayabaNerve> TBH, I just like it because it's simple as hell |
19:17:38 | FromGitter | <kayabaNerve> Wraps easily |
19:17:40 | FromGitter | <kayabaNerve> Does what you need |
19:17:41 | FromGitter | <kayabaNerve> Etc |
19:17:56 | Yardanico | @kayabaNerve how many bits in numbers do you need? |
19:17:59 | FromGitter | <kayabaNerve> I think it supports negatives... but I may have disabled those in my wrapper or something |
19:18:00 | FromGitter | <kaushalmodi> I don't know what imath is.. I'll put it on my todo list |
19:18:09 | FromGitter | <kayabaNerve> https://github.com/creachadair/imath |
19:18:13 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/BN.nim |
19:18:18 | FromGitter | <kaushalmodi> Yes.. I got that |
19:18:27 | FromGitter | <kaushalmodi> But I need to understand the API, etc. |
19:18:28 | FromGitter | <kayabaNerve> Just sending it again :P I'll stop now |
19:18:35 | FromGitter | <kaushalmodi> so putting it to my todo list |
19:18:36 | FromGitter | <kayabaNerve> Yardanico: Ethereum uses 256 bit private keys |
19:18:41 | Yardanico | what about https://github.com/status-im/nim-stint ? |
19:18:44 | FromGitter | <kayabaNerve> i use the same algo as Ethereum |
19:18:47 | Yardanico | it's made for ethereum too |
19:18:49 | FromGitter | <kayabaNerve> That requires a compiler fork |
19:18:58 | FromGitter | <kayabaNerve> And you must declare the bit size in advance |
19:19:10 | FromGitter | <kayabaNerve> So if you only need 256 bit keys... yeah. That works. |
19:19:20 | FromGitter | <kayabaNerve> But the second you go to 257, it doesn't handle it for you. |
19:19:32 | Yardanico | but why do you need 257 if ethereum uses 256? |
19:19:35 | FromGitter | <kayabaNerve> Actually, it might work on devel |
19:19:41 | FromGitter | <kayabaNerve> Because I'm not working with Ethereum |
19:19:44 | FromGitter | <kayabaNerve> Just the same algo |
19:19:51 | FromGitter | <kayabaNerve> And I actually use 32 int8s for that |
19:20:03 | FromGitter | <kayabaNerve> I'm using BNs for other stuff |
19:20:50 | FromGitter | <kayabaNerve> In cryptocurrency, a lot of the time, decimals just don't effing exist. You can say they do, you can display they do... but all network interactions use the lowest unit |
19:21:02 | FromGitter | <kayabaNerve> So 1 BTC != 1. It's 100000000 |
19:21:07 | FromGitter | <kayabaNerve> Ethereum is that with 16 zeros |
19:21:16 | FromGitter | <kayabaNerve> So you run out of space pretty quickly without BNs |
19:21:35 | FromGitter | <kayabaNerve> Oh. And hash operations |
19:21:40 | FromGitter | <kayabaNerve> Address encoding |
19:22:54 | * | Perkol quit (Quit: Leaving) |
19:23:19 | shashlick | how do you detect unused imports? |
19:23:43 | def- | shashlick: try removing them, see if it still compiles and passes tests? |
19:23:51 | FromGitter | <kayabaNerve> if import == unused |
19:23:52 | FromGitter | <kaushalmodi> hehe |
19:23:54 | FromGitter | <kayabaNerve> IDE warnings |
19:24:15 | shashlick | hmm |
19:24:17 | FromGitter | <kaushalmodi> shashlick: +1 I wish Nim errored out on detecting unused import like Go |
19:24:20 | shashlick | https://github.com/nim-lang/Nim/issues/251 |
19:24:28 | Yardanico | why error on unused imports? |
19:24:38 | shashlick | not error, hint will help |
19:24:46 | shashlick | probably speed up compile time |
19:25:06 | FromGitter | <kaushalmodi> Yardanico: Make people do the Right Thing |
19:25:15 | FromGitter | <kaushalmodi> Just as erroring out on tabs |
19:25:26 | Yardanico | that will actually be bad for developers |
19:25:40 | bozaloshtsh | erroring on unused imports is dumb, a warning suffices. |
19:25:52 | Yardanico | e.g. you're in process of writing something and you make a new file, add like 10-15 imports and start implementing functionality |
19:26:00 | Yardanico | so you don't need to go back to the start of the file to add imports |
19:26:05 | bozaloshtsh | during development, I don't give a rats butt cheek whether I have unused imports, so please don't bother me about it. |
19:26:06 | FromGitter | <kaushalmodi> May be error on release builds |
19:26:10 | Yardanico | why tho? |
19:26:15 | bozaloshtsh | kaushalmodi: that's reasonable |
19:26:29 | FromGitter | <kaushalmodi> why not have the releases as compact as possible? |
19:26:46 | bozaloshtsh | whatever it is, it should be configurable |
19:26:49 | Yardanico | https://github.com/nim-lang/Nim/issues/6134 |
19:26:50 | FromGitter | <kaushalmodi> But all this discussion seems moot |
19:27:51 | * | lompik quit (Ping timeout: 240 seconds) |
19:28:33 | Yardanico | if you want compact releases you would use "strip -s" and "opt: size" |
19:29:26 | FromGitter | <tim-st> is there a reason that strip is not the default in release mode? |
19:29:43 | Yardanico | well, not all developers have "strip" installed probably :) |
19:29:56 | FromGitter | <tim-st> I think it's an option of gcc |
19:30:07 | FromGitter | <tim-st> at least it worked for me on windows sometime ago |
19:30:14 | FromGitter | <kaushalmodi> Yardanico: I didn't even know that strip is a separate thing to install |
19:30:19 | FromGitter | <kaushalmodi> .. going to my todo list |
19:30:23 | FromGitter | <tim-st> it's not afaik |
19:30:27 | Yardanico | well it's not raelly |
19:30:29 | Yardanico | *really |
19:30:34 | bozaloshtsh | Yardanico: I think it's reasonable to assume people have binutils installed... |
19:30:58 | FromGitter | <kaushalmodi> OK, I have `strip` installed |
19:31:04 | shashlick | strip is a separate tool |
19:31:05 | FromGitter | <tim-st> ah, it worked because I have mingw |
19:31:40 | FromGitter | <tim-st> but something like: if release mode and if found strip: then strip |
19:32:20 | FromGitter | <kaushalmodi> Looks like this would start going to my nimble tasks if Nim doesn't support it directly |
19:32:40 | Yardanico | do you *really* need these kilobytes? |
19:32:58 | Yardanico | I mean yeah, sure, if you're compiling for an environment where ROM is limited |
19:33:11 | FromGitter | <kaushalmodi> I don't right now.. but I'll at least document it as a nimble task |
19:33:17 | FromGitter | <tim-st> it's not just kilobytes, there was an article about it with nim |
19:33:19 | * | gangstacat joined #nim |
19:33:24 | * | gangstacat quit (Remote host closed the connection) |
19:33:30 | FromGitter | <tim-st> it stripped like 90% on hello world release bin |
19:33:35 | FromGitter | <kaushalmodi> When building `hugo`.. symbol stripping cuts down 30MB binary to 18MB |
19:33:40 | Yardanico | but that's a hello world binary |
19:33:41 | FromGitter | <kaushalmodi> Go |
19:34:10 | bozaloshtsh | The necessity to strip binaries narrows with every passing day |
19:34:12 | FromGitter | <tim-st> other binaries also ship much shit like windows file paths from users who compiled mingw |
19:34:13 | * | tiorock joined #nim |
19:34:14 | * | rockcavera quit (Killed (verne.freenode.net (Nickname regained by services))) |
19:34:14 | * | tiorock is now known as rockcavera |
19:34:14 | * | rockcavera quit (Changing host) |
19:34:14 | * | rockcavera joined #nim |
19:34:16 | shashlick | okay manually verified every import - happy? |
19:34:37 | FromGitter | <tim-st> so strip by default would good |
19:34:45 | FromGitter | <tim-st> *be good |
19:35:04 | Yardanico | by the way, does anyone know how can I implement this: I have a lot of entries in a seq and I want to call `scan(entry, index)` for every one of them. And I want to do that with like 100 threads. How can I implement this (threadpool?) so it always uses 100 threads and if one thread completes, that thread will process another entry? |
19:36:05 | FromGitter | <tim-st> dunno I never use those things which highly depend on sync |
19:36:39 | FromGitter | <tim-st> I have the feeling plain nim is often quicker than multiprocessed golang |
19:37:01 | shashlick | yardanico: perfect case for parallel |
19:37:23 | FromGitter | <tim-st> btw can nim easily be multiprocessed? |
19:37:39 | Yardanico | with "parallel" and "spawn" probably, it depends on your code |
19:37:45 | FromGitter | <kindlychung> how do you extract CERN out of `<A HREF="CERN`">http://www.w3.org/">CERN</A>` with htmlparser? |
19:37:51 | * | gangstacat joined #nim |
19:37:54 | FromGitter | <data-man> gcc has ```-s``` switch: "Remove all symbol table and relocation information from the executable." ⏎ Is the strip running? ;-) |
19:38:36 | FromGitter | <kindlychung> I tried `a.innerText` but it gives an error. |
19:38:46 | FromGitter | <kindlychung> Error: unhandled exception: contains({xnText, xnComment, xnCData, xnEntity}, n.k) [AssertionError] |
19:39:07 | FromGitter | <kindlychung> Full script: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47ae5a66c1e833a9e25e3e] |
19:40:11 | FromGitter | <tim-st> @data-man yes, good to know, that should be default in release mode |
19:40:21 | FromGitter | <xDotDash> concepts are lovely but matching them is the bane of my existence |
19:40:53 | FromGitter | <Yardanico> what do you mean by that? |
19:41:23 | FromGitter | <xDotDash> It took me a full day to get one matched up with a concrete type |
19:41:39 | FromGitter | <Yardanico> well you can turn on hints for concepts |
19:41:55 | FromGitter | <xDotDash> Hadn't been working for me, for whatever reason |
19:42:36 | dom96 | kindlychung: try a[0].innertext |
19:42:42 | Yardanico | well you could've asked for help here, I don't understand how you wasted a full day :) |
19:43:43 | FromGitter | <xDotDash> Wanted to see if I could get it all figured out myself |
19:44:02 | FromGitter | <kindlychung> @dom96 that doesn't make a diff. |
19:44:15 | Yardanico | shashlick, it seems that for some reason spawn/parallel both hang |
19:44:33 | dom96 | kindlychung: check the kind of the node element you've got and its children |
19:44:40 | dom96 | should help you figure out what's going on |
19:44:41 | Yardanico | with the simple code https://gist.github.com/Yardanico/ff4d423d1a34e1b8b0ed052b61f95b99 (that's part of it, and ips is just a seq of strings) |
19:46:02 | FromGitter | <kindlychung> @dom96 they are all xnElement nodes |
19:46:36 | dom96 | the children of `a`? |
19:47:44 | shashlick | yardanico: what's in scan() |
19:48:13 | Yardanico | shashlick, a bit of text parsing (splitting ip:port in ip and port; and calls to a .so library) |
19:48:19 | Yardanico | but this .so library supports multithreading |
19:48:43 | shashlick | try eliminating calls to the lib and see if it works |
19:49:33 | FromGitter | <tim-st> I tried this example: https://nim-lang.org/docs/manual.html#parallel-spawn-parallel-statement |
19:49:39 | Yardanico | shashlick, well yes it does work |
19:49:41 | FromGitter | <tim-st> this is not multiprocessed |
19:49:46 | FromGitter | <tim-st> is it possible in nim? |
19:49:57 | Yardanico | @tim-st ah, you meant multiprocessing |
19:50:04 | Yardanico | i don't really know if it's possible |
19:50:19 | FromGitter | <tim-st> otherwise it's not needed to have multiple cpus... |
19:50:28 | dom96 | Is what possible? |
19:50:30 | Yardanico | nim threads are real system threads |
19:50:31 | dom96 | Parsing in parallel? |
19:50:37 | Yardanico | so you can easily use all CPUs |
19:50:57 | FromGitter | <tim-st> so if I have 10 cpus nim uses all of them? |
19:51:00 | FromGitter | <kindlychung> @dom96 I did something like this: ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5b47b1239a612333aa5afc97] |
19:51:07 | FromGitter | <kindlychung> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47b12ac02eb83d7c6da2a7] |
19:51:08 | FromGitter | <tim-st> my tasmgr says only one is used at 100% |
19:51:17 | Yardanico | @tim-st if you use threads - depends on number of threads |
19:51:21 | FromGitter | <kindlychung> Some of the children are xnText |
19:51:25 | Yardanico | one thread can't run on two CPU cores :) |
19:51:27 | FromGitter | <kindlychung> Some xnElement |
19:51:53 | dom96 | kindlychung: so it must be something like <a href="..."><b>blah</b> foo</a> |
19:52:06 | FromGitter | <tim-st> yardanico: well I know how threads work, because of this I asked if multiprocessing works, multithreading is quite easy |
19:52:21 | FromGitter | <kindlychung> ok. |
19:52:44 | FromGitter | <kindlychung> Would be nice to have a .text method to recursively extract text. |
19:52:46 | dom96 | kindlychung: it would indeed be nice to have a function that goes through such elements and returns a single string |
19:52:46 | FromGitter | <tim-st> tbh I didnt saw a multiprocessed nim program yet |
19:53:00 | dom96 | kindlychung: great minds think alike :) |
19:53:03 | Yardanico | but what are the advantages of multiprocessing over multithreading? :) |
19:53:19 | FromGitter | <kindlychung> :) |
19:53:41 | FromGitter | <tim-st> Yardanico: If my server has 10 cpus and my nim program runs, it can only uses one of these 10, although I pay for 10/10 |
19:53:57 | Yardanico | but why won't you use multithreading then? I don't understand |
19:54:11 | FromGitter | <tim-st> multithreading uses only one |
19:54:15 | Yardanico | wat |
19:54:15 | dom96 | What even is multiprocessing? |
19:54:34 | FromGitter | <tim-st> multithreading = multiple threads in one process? |
19:54:40 | dom96 | yes |
19:54:50 | dom96 | Each thread can run on a separate CPU |
19:54:54 | dom96 | (or CPU core) |
19:55:00 | FromGitter | <tim-st> multiprocessing = data of one master process is shared betwenn multiple process |
19:55:04 | FromGitter | <tim-st> that all run at 100% |
19:55:07 | FromGitter | <tim-st> on different cpus |
19:55:28 | FromGitter | <tim-st> that's a giant difference |
19:55:30 | dom96 | Multiprocessing sounds like a term for parsing data in parallel |
19:55:53 | dom96 | Multiprocessing can be implemented using threads |
19:55:57 | FromGitter | <tim-st> not only, it's also good for server tasks |
19:56:07 | FromGitter | <tim-st> yes, it can |
19:56:14 | FromGitter | <tim-st> but the hard task is sync these |
19:56:22 | FromGitter | <tim-st> python does via TCP socket |
19:56:29 | FromGitter | <tim-st> that's obviously very bad |
19:56:44 | FromGitter | <tim-st> I hoped nim can sync via shared ram |
19:56:45 | Yardanico | Python doesn't support real multithreading (on different CPUs), that's true |
19:56:46 | dom96 | Indeed, there is no library that does it for you in Nim |
19:56:56 | dom96 | So you need to handle this yourself |
19:56:57 | FromGitter | <tim-st> ok, that's not good |
19:56:59 | dom96 | But it's not that hard |
19:57:13 | dom96 | Chapter 6 of Nim in Action describes exactly how to do it |
19:57:26 | FromGitter | <tim-st> how is data shared? |
19:57:34 | FromGitter | <tim-st> between multiple processes? |
19:57:39 | FromGitter | <tim-st> ram or tcp |
19:57:57 | dom96 | ram |
19:57:58 | dom96 | https://github.com/dom96/nim-in-action-code/blob/master/Chapter6/WikipediaStats/parallel_counts.nim |
19:58:16 | FromGitter | <tim-st> that sounds good, this is needed for stdlib |
19:59:00 | Yardanico | dom96, that's one process though, no? |
19:59:04 | Yardanico | and multiple threads |
19:59:08 | FromGitter | <tim-st> yes, I think so too |
19:59:16 | shashlick | you can use a variety of ipc methods |
19:59:21 | dom96 | yes |
19:59:22 | FromGitter | <tim-st> multiprocessing = process1.exe, process2.exe,... |
19:59:32 | FromGitter | <tim-st> gcc does it like cc1.exe, cc2.exe,.. |
19:59:35 | dom96 | You don't need multiple processes |
19:59:44 | dom96 | Python does because it sucks :P |
19:59:47 | FromGitter | <tim-st> I need, otherwise I cant use my cpu power |
19:59:49 | shashlick | i think that's an artifact of Python's GIL |
19:59:53 | FromGitter | <tim-st> yes |
19:59:54 | dom96 | You don't |
19:59:58 | dom96 | Not in Nim |
20:00:02 | FromGitter | <tim-st> ? |
20:00:07 | shashlick | you can saturate your CPU(s) with just one Nim process |
20:00:18 | FromGitter | <tim-st> how? |
20:00:19 | shashlick | i've done it before with multiple threads |
20:00:25 | dom96 | By using multiple threads |
20:00:31 | shashlick | each thread runs in a separate CPU core |
20:00:43 | FromGitter | <tim-st> is there a proof? |
20:00:46 | shashlick | a Python thread is actually running on the same core to my knowledge |
20:00:51 | FromGitter | <tim-st> yes |
20:01:03 | Yardanico | @tim-st all normal languages can run on multiple CPUs |
20:01:06 | Yardanico | using real system threads |
20:01:12 | shashlick | sorry, every Python thread in a given process runs on the same core |
20:01:22 | Yardanico | and yeah, python can't because it has GIL |
20:01:32 | shashlick | i believe that's what Nim does @tim-st |
20:01:44 | Yardanico | nim doesn't have GIL so you can just use 10 threads if you have 10 cpu cores |
20:01:45 | shashlick | we don't have coroutines, green threads or whatever |
20:01:47 | Yardanico | (or more threads) |
20:02:01 | FromGitter | <tim-st> shashlick: you mean nim is like python? |
20:02:10 | FromGitter | <tim-st> I think go can do it |
20:02:17 | Yardanico | @tim-st are you trolling or what? :D |
20:02:39 | Yardanico | a separate thread in Nim program doesn't need to run on the same CPU core as main thread |
20:03:01 | shashlick | no Nim is not like Python |
20:03:07 | skrylar | shashlick, we do have coroutines! of the bullshit kind |
20:03:19 | skrylar | thats what continuation iterators and async do |
20:03:34 | skrylar | its similar to the ienumerable abuse in c# |
20:03:38 | shashlick | Python has no real multi-threading, there's a GIL that prevents more than one thread running at a time |
20:03:59 | FromGitter | <tim-st> So when I rune this example: https://nim-lang.org/docs/manual.html#parallel-spawn-parallel-statement |
20:04:00 | * | PMunch quit (Quit: leaving) |
20:04:10 | shashlick | that's why you have to multiprocess and use more cores |
20:04:11 | skrylar | there is always erlang/elixir/beamvm.. i hear those are quite good at parallel things :3 |
20:04:12 | FromGitter | <tim-st> it uses less equal 25% cpu |
20:04:16 | FromGitter | <tim-st> I have 4 cores |
20:04:20 | dom96 | Try this: https://gist.github.com/dom96/34bf9d814438ebb84f0c0a316eed0d3f |
20:04:42 | skrylar | hum. i actually do have code which uses spawn (but not parallel) and it maxes out my hexcore |
20:04:44 | dom96 | Compile with --threads:on |
20:04:49 | shashlick | skrylar: i've used spawn and async so far, not continuation iterators |
20:05:44 | FromGitter | <tim-st> @dom96 thanks, it works! |
20:06:10 | Yardanico | @tim-st this program is too small to run for a considerable amount of time |
20:06:15 | FromGitter | <tim-st> I need to have a deeper look into, what allows going at 100% |
20:06:36 | FromGitter | <tim-st> Yardanico: no, I increased the number by a few zeros |
20:06:40 | Yardanico | make it "1000000" |
20:06:43 | shashlick | also, threads are isolated, cannot share data, which is a pain but you avoid locking and related |
20:06:45 | FromGitter | <tim-st> it runs more than a minute |
20:07:03 | FromGitter | <tim-st> no sharing of data? |
20:07:19 | Yardanico | yes, GC'd memory is thread-local |
20:07:31 | Yardanico | you can use raw pointers and guards, locks |
20:07:39 | shashlick | so if you want to exchange data, you'd use channels |
20:07:48 | FromGitter | <tim-st> so, I can only use parallelism in cases where sharing data isnt needed? |
20:07:54 | Yardanico | or channels, yeah, but I heard that channels are inefficient |
20:08:17 | shashlick | you can use ipc right |
20:08:21 | shashlick | nanomsg, etc. |
20:09:00 | FromGitter | <tim-st> well, at least I now know that it works, and I think for my server app I can isolate all users and dont need to share data, so everything will work :) |
20:09:07 | skrylar | i did this but it was with beanstalkd and not nanomsg |
20:09:18 | dom96 | You should look at httpbeast, it's parallel |
20:09:28 | skrylar | partly because the worker process sometimes died for mysterious reasons and shunting the job list outside of nim protected it |
20:09:41 | FromGitter | <tim-st> @dom96 does jester is 100% parallel too? |
20:09:49 | Yardanico | it's async |
20:09:51 | skrylar | isn't jester just a routing middleware? |
20:10:09 | dom96 | yes, it's parallel now |
20:10:18 | Yardanico | dom96, wait, it can use multiple cpu's now? |
20:10:18 | dom96 | because it depends on httpbeast |
20:10:22 | dom96 | yes |
20:10:33 | FromGitter | <tim-st> ok, very good to know, that's perfect for my system |
20:11:05 | skrylar | and with the power of that easing library you can have nim-js animation thingerdoos |
20:11:24 | FromGitter | <tim-st> lol, I dont use js, it's complete backend |
20:12:24 | skrylar | well it will waste cpu cycles on the backend if you ask it to :E |
20:14:54 | FromGitter | <Vindaar> (https://files.gitter.im/nim-lang/Nim/dCXo/multithreading.png) |
20:15:00 | FromGitter | <Vindaar> @tim-st ^ :) |
20:15:39 | FromGitter | <Vindaar> just needed to find a proper screenshot tool, haha :D |
20:16:01 | FromGitter | <tim-st> I dont see it there |
20:16:07 | skrylar | make a clone of the old screensteps in nim :o |
20:16:28 | dom96 | Vindaar: 🔥🔥🔥🔥 |
20:17:31 | FromGitter | <kindlychung> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47b75b66c1e833a9e27c28] |
20:17:46 | FromGitter | <kindlychung> seems to solve the problem. |
20:19:00 | FromGitter | <tim-st> but the example of dom already showed me that it works indeed, just wasnt sure, why the example of the page I linked seems to fill only one core |
20:21:22 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
20:21:56 | * | yglukhov[i] joined #nim |
20:23:32 | * | yglukhov[i] quit (Read error: Connection reset by peer) |
20:24:15 | * | yglukhov[i] joined #nim |
20:24:24 | FromGitter | <tim-st> @dom96 just had a look at httpbeast https://github.com/dom96/httpbeast/blob/master/src/httpbeast/parser.nim |
20:24:50 | FromGitter | <tim-st> I think checking data.len is needed when zero byte is not avaialble? |
20:25:24 | dom96 | yes, likely |
20:25:46 | dom96 | I focused on speed 100% for this project |
20:25:52 | FromGitter | <tim-st> or try except for speed |
20:25:53 | dom96 | These kinds of fixes can come later |
20:26:09 | dom96 | try except is the slowest thing you can use |
20:26:22 | FromGitter | <tim-st> I think it's only slow on failure |
20:26:22 | FromGitter | <kayabaNerve> Really? |
20:26:27 | FromGitter | <tim-st> and no loss if not |
20:26:41 | dom96 | yes, really |
20:26:53 | dom96 | For the C++ backend perhaps, but not the C backend |
20:27:10 | FromGitter | <tim-st> so it uses setjmp, longjmp always? |
20:27:14 | FromGitter | <tim-st> also if not raised? |
20:27:24 | dom96 | I'm not familiar with the details |
20:27:31 | FromGitter | <kayabaNerve> dom96: if I need to check data validity, but the function is expected to return not a bool or int, but rather an object, what would you do? Return nil? |
20:27:35 | dom96 | But I'm 99% it's not zero cost for the C backend |
20:27:49 | FromGitter | <tim-st> ok |
20:28:06 | dom96 | kayabaNerve: Either Option[T] or `var T` param and return `bool` |
20:28:21 | dom96 | or just use an exception |
20:29:59 | stefanos82 | dom96, question: I'm on Chapter where you show how to wrap C code and you show about SDL. On my Debian I have this file: libSDL2-2.0.so.0.8.0 |
20:30:04 | stefanos82 | dom96: will it work with this one? |
20:30:19 | dom96 | should do |
20:30:23 | stefanos82 | cheers |
20:30:34 | FromGitter | <kayabaNerve> All my functions for data validity return bools, and the ones who require data validity don't always. check myself and only throw an exception if the data is invalid but I still passed it. Therefore, the code should never hit an exception. I'm just checking with you for a better way since you seemed opinionated. |
20:30:35 | FromGitter | <kayabaNerve> I |
20:30:55 | FromGitter | <kayabaNerve> *I check myself. Gitter mobile mangles messages damn it |
20:33:23 | FromGitter | <rayman22201> @tim-st I have talked to @Araq about this subject in some depth. The C backend always uses setjmp for exceptions. C++ does not. This is why Araq wants the C++ backend to be default. But for now, yeah, it's slow in C. |
20:33:44 | FromGitter | <rayman22201> C++ uses well, C++ exceptions lol |
20:34:14 | FromGitter | <tim-st> ok, thank you! I think I remove exception where possible and replace by explicit error and likely templates |
20:34:32 | FromGitter | <Quelklef> ```code paste, see link``` ⏎ ⏎ ^ Can anyone tell my why this is? Shouldn't it be fine since `hello` is being taken as an untyped parameter? [https://gitter.im/nim-lang/Nim?at=5b47bb5866c1e833a9e28c1e] |
20:34:34 | FromGitter | <kayabaNerve> My code got 9% speed ups when I tried C++ |
20:34:47 | FromGitter | <kayabaNerve> I'm going to do another test in a bit |
20:35:04 | FromGitter | <kayabaNerve> Is there a line for a cfg to force c+(? |
20:35:16 | FromGitter | <kayabaNerve> Or do people have to use Nim cpp? |
20:35:20 | FromGitter | <tim-st> is there code I can only compile with a c compiler and not with c++ compiler? |
20:35:25 | FromGitter | <tim-st> *nim code |
20:35:26 | FromGitter | <kayabaNerve> Yes |
20:35:30 | FromGitter | <kayabaNerve> Probably not |
20:35:36 | * | Jesin joined #nim |
20:35:44 | FromGitter | <kaushalmodi> @kayabaNerve One style I have seen is to have a proc signature like `proc foo(inp: int; var ret: Object): bool =` |
20:35:50 | FromGitter | <kayabaNerve> If there is, it's a bug (AFAIK) |
20:36:08 | FromGitter | <tim-st> ok, good to know, so I can test in the end which is better :) |
20:36:10 | FromGitter | <kayabaNerve> C does that a lot |
20:36:26 | FromGitter | <kaushalmodi> `foo` is then used as `if foo(in, out):` .. |
20:36:27 | FromGitter | <kaushalmodi> OK |
20:36:46 | FromGitter | <data-man> @kayabaNerve there is nim-result (WIP) https://github.com/arnetheduck/nim-result/pull/1 |
20:37:03 | FromGitter | <kayabaNerve> Thanks for the uses |
20:37:06 | FromGitter | <kayabaNerve> *idea |
20:37:30 | * | Vladar quit (Quit: Leaving) |
20:37:58 | CodeVance | how to reset a set |
20:38:23 | FromGitter | <kayabaNerve> That's smart |
20:39:00 | FromGitter | <Quelklef> @CodeVance `x = {}`? |
20:39:03 | FromGitter | <tim-st> it seems c++ exception are only zero cost if it doesnt happen, and if it is very expensive |
20:39:19 | FromGitter | <tim-st> this isnt directly better than the c model |
20:39:49 | CodeVance | @quelklef thanks |
20:39:51 | Araq | it is tremendously better because the C model introduces pervasive 'if' statements everywhere |
20:40:32 | FromGitter | <tim-st> ok^^ just read a few lines here: https://mortoray.com/2013/09/12/the-true-cost-of-zero-cost-exceptions/ |
20:40:50 | Araq | mortoray is full of bullshit |
20:41:01 | FromGitter | <tim-st> hahaha ok^^ |
20:43:20 | * | krux02_ joined #nim |
20:44:10 | krux02_ | how do I get the directory of a nimscript file. |
20:44:13 | * | yglukhov[i] quit (Remote host closed the connection) |
20:44:19 | zacharycarter | dom96: I was trying to apply your suggestion, looking at the nimforum code, but I don't think it will work |
20:44:32 | zacharycarter | I need to intiailize the component after the DOM has already been created from the VDOM |
20:44:39 | zacharycarter | and render isn't called again unless the VDOM changes right? |
20:44:57 | zacharycarter | it's trying to keep the intialization logic encapsulated within the component but being able to execute it after the DOM is created |
20:45:06 | zacharycarter | and not having to do it all in the post callback |
20:45:10 | krux02_ | I have a nimscript file on the path, and I would like to use paths relative to the location of the script file |
20:45:17 | zacharycarter | *post render callback - but I guess i may end up having to do it that way |
20:45:19 | krux02_ | this means symbolic links should be resolved |
20:45:28 | shashlick | Looking at working on the next nimgen based wrapper, any votes for a good candidate? |
20:45:33 | dom96 | zacharycarter: Hrm, IIRC I had problems with this too. I solved it by using a timer (hackish and not ideal but it works) |
20:45:41 | * | krux02_ quit (Client Quit) |
20:45:57 | zacharycarter | yeah |
20:46:05 | zacharycarter | I really don't want to do that because dom rendering times can vary |
20:46:19 | zacharycarter | I really think karax could use some kind of lifecycle event system you could hook into |
20:46:35 | zacharycarter | so once the dom is established - you can do things with it |
20:46:47 | zacharycarter | for now I'm going to do the global post render callback thing |
20:47:08 | * | Lord_Nightmare quit (Ping timeout: 244 seconds) |
20:48:06 | zacharycarter | other than that I'm loving karax - like I'd use this any day over react at work |
20:48:13 | zacharycarter | the new nim playground is going to be baller |
20:48:22 | ldlework | is there a karax tutorial |
20:48:24 | FromGitter | <tim-st> krux02: isnt `getCurrentDir` available? |
20:48:29 | FromGitter | <tim-st> https://github.com/nim-lang/Nim/blob/devel/compiler/scriptconfig.nim |
20:48:41 | krux02 | tim-st: I never wrote nimscript |
20:48:41 | Araq | zacharycarter: karax is pretty hackable, consider creating a PR |
20:48:43 | krux02 | only macros |
20:48:50 | zacharycarter | Araq - I will |
20:48:54 | krux02 | I don't know where to look for functions |
20:49:04 | Araq | that adds an afterFirstRender callback |
20:49:19 | zacharycarter | yeah - that would be very useful - I'll look into that tonight - I'm about to leave work now |
20:49:21 | FromGitter | <tim-st> krux02: you can implement every single nim stdlib proc exactly how it's shown in this file |
20:49:36 | FromGitter | <tim-st> this will allow nealy 100% pure nim interpretion |
20:49:43 | FromGitter | <tim-st> and would skip all compile times |
20:51:03 | krux02 | tim-st: getCurrentDir returns the working directory that is exactly what I don't need |
20:51:16 | krux02 | because paths are automatically relative to the working directory |
20:51:40 | FromGitter | <tim-st> when it's available in nim you can in worst case implement the proc like shown in the file |
20:52:33 | FromGitter | <tim-st> maybe `thisDir` |
20:52:46 | krux02 | getAppFilename is what I was looking for |
20:52:49 | krux02 | I found it |
20:53:33 | FromGitter | <tim-st> seems mapped to `selfExe` |
20:54:15 | Araq | ldlework: https://github.com/pragmagic/karax the readme contains a short tutorial |
20:54:27 | Araq | and I blogged about it too: https://nim-lang.org/araq/karax.html |
20:54:51 | Araq | unfortunately the Ormin thing never was finished to my liking |
20:55:49 | Araq | and of course we have to boring todo app, https://github.com/pragmagic/karax/blob/master/examples/todoapp/todoapp.nim |
20:55:59 | Araq | *we have the |
20:57:12 | Araq | and I think I finally figured out how "components" need to be designed. only took a year of thinking, lol |
20:58:08 | * | Trustable quit (Remote host closed the connection) |
21:04:18 | * | Lord_Nightmare joined #nim |
21:06:58 | krux02 | I never used arguments to a program in nim, how do I forward arguments to a subprocess in nimscript? |
21:07:36 | CodeVance | os.argv gets the arguments |
21:07:54 | CodeVance | then call the subprocess with the arguments |
21:08:28 | CodeVance | wht tye of subprocess? |
21:09:35 | Araq | huh? forward arguments? os.paramStr(i) |
21:09:55 | krux02 | Araq: I am doing what you suggested |
21:10:03 | Araq | but are you sure you want to write this in nimscript? |
21:10:03 | krux02 | port nim-gdb run script to nim-script |
21:10:18 | krux02 | and the arguments to nim-gdb need to be forwarded to gdb |
21:10:26 | Araq | I suggested to write a Nim program. |
21:10:53 | Araq | in fact, I would just patch 'koch' to support 'koch gdb' |
21:11:14 | * | rockcavera quit (Ping timeout: 260 seconds) |
21:11:46 | krux02 | a nim program just to forward a single argument to gdb that loads the pretty printer module? |
21:12:32 | Araq | in fact, I would just patch 'koch' to support 'koch gdb' |
21:12:49 | krux02 | and koch gdb builds nim-gdb? |
21:13:40 | krux02 | honestly I prefer my batch script over that |
21:15:06 | * | rockcavera joined #nim |
21:15:06 | * | rockcavera quit (Changing host) |
21:15:06 | * | rockcavera joined #nim |
21:17:08 | Araq | it doesn't build nim-gdb, it *is* nim-gdb |
21:18:04 | krux02 | but koch is not on the path it is the local build system for the nim compiler |
21:18:43 | krux02 | nim-gdb should not just be the debugger for the nim compiler, but for all nim programs |
21:18:51 | Araq | if it's not on the path, make it on the path. nim-gdb is not on the path either. |
21:19:13 | krux02 | well it is in the bin directory, so it is on (my) path |
21:19:28 | stefanos82 | off-topic: lol, no more BDFL for Python! |
21:19:36 | stefanos82 | https://mail.python.org/pipermail/python-committers/2018-July/005664.html |
21:20:11 | stefanos82 | I have a feeling this will be a very bumpy summer for some! |
21:21:33 | * | xet7 joined #nim |
21:22:20 | krux02 | what is BDFL? |
21:22:58 | Araq | stefanos82: gah, this := is terrible :-( |
21:23:03 | Yardanico | krux02, benevolent dictator for life |
21:23:21 | Araq | and it made Guido abandon his BDFL status? interesting |
21:23:24 | stefanos82 | Araq: who am I to judge though :/ |
21:23:51 | Yardanico | Araq, this PEP did :( |
21:23:55 | stefanos82 | Araq: imagine how much pressure they put on Guido to make him say "enough is enough!" |
21:23:56 | Yardanico | PEP 572 |
21:24:03 | krux02 | Araq: nim-gdb is the file that can be put on the path, so that starting the debugger with nim support gets easy. |
21:24:11 | krux02 | just replace gdb with nim-gdb and done |
21:24:39 | krux02 | alternatively one can always source the nim-gdb.py module munually from the gdb command interpreter |
21:24:52 | dom96 | Araq: Note that he wanted this change |
21:24:56 | dom96 | and the community didn't |
21:25:01 | dom96 | or rather, the other core devs |
21:25:09 | * | noonien quit (Quit: Connection closed for inactivity) |
21:25:20 | krux02 | I have no idea what was going on there. |
21:25:41 | Yardanico | dom96, wait really? |
21:25:45 | Yardanico | guido wanted this PEP? |
21:25:53 | dom96 | yes |
21:26:00 | Yardanico | lol |
21:26:09 | FromGitter | <kaushalmodi> I see him as the author.. so he should have proposed it, right? |
21:26:14 | FromGitter | <kaushalmodi> the PEP |
21:26:20 | dom96 | https://lwn.net/Articles/757713/ |
21:26:30 | dom96 | This goes into more detail about this PEP |
21:27:27 | dom96 | The way Nim handles this is superior IMO |
21:27:45 | dom96 | if x = 1: # error |
21:27:54 | dom96 | if (let x = 1; x == 1): # Perfectly clear |
21:28:36 | Yardanico | I hope Araq won't end (as BDFL) as Guido van Rossum did :/ |
21:30:49 | FromGitter | <Varriount> dom96: I dislike the added mental overhead. |
21:31:16 | krux02 | dom96: python really misses the let/var keyword |
21:32:49 | dom96 | actually hrm |
21:33:09 | dom96 | The Python `:=` also injects the var into the scope of the if/while/etc statement |
21:35:20 | dom96 | !eval if (let x = 5; x == 5): echo x |
21:35:21 | FromGitter | <kaushalmodi> The new Python `:=` is like `if-let*` in Lisps.. the latter which I like: |
21:35:22 | NimBot | 5 |
21:35:25 | dom96 | :D |
21:35:29 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47c9a0897d514b3c48c7e2] |
21:35:46 | dom96 | Nice to see Araq considered this |
21:36:28 | Araq | if regex() as x |
21:36:40 | Araq | would have been the Pythonic solution for Python. |
21:36:54 | Araq | I don't understand how := ever made it into an accepted PEP. |
21:37:26 | Araq | no wonder he got letter bombs because of this proposal. |
21:37:58 | dom96 | Yeah, a keyword solution is the Pythonic solution |
21:39:01 | stefanos82 | Araq: please...keep the language small as it is already, stabilize it to version 1 and keep it there as long as possible and stay the BDFL as long as you breathe |
21:39:04 | stefanos82 | ..please? |
21:40:25 | FromGitter | <metasyn> @kaushalmodi I guess he wasn't the author, according to that lwn article: ⏎ ⏎ > Chris Angelico, who is the author of the PEP, could not be at the summit, but Van Rossum suggested that he stop responding in the threads to try to tamp things down. |
21:40:49 | dom96 | Hope this doesn't backfire: https://twitter.com/nim_lang/status/1017524154348855296 |
21:41:53 | Yardanico | dom96, :P |
21:41:58 | CodeVance | In nim you can test all of the different syntax |
21:42:02 | FromGitter | <kaushalmodi> @metasyn .. or the coauthor ⏎ ⏎ > Author: Chris Angelico <rosuav at gmail.com>, Tim Peters <tim.peters at gmail.com>, Guido van Rossum <guido at python.org> |
21:42:06 | Yardanico | imagine if this will become a popular tweet :) |
21:42:10 | FromGitter | <metasyn> Oh interesting |
21:42:10 | stefanos82 | dom96: "I set fire...to the rain..." |
21:42:13 | Araq | dom96: lol |
21:42:22 | Araq | stefanos82: don't you worry about that. |
21:42:28 | Araq | but thank you :-) |
21:42:36 | FromGitter | <metasyn> @dom96 how do you do that styling of the window image? |
21:42:42 | CodeVance | dom96: the answer to life? |
21:42:43 | Yardanico | @metasyn that's a special app |
21:42:49 | dom96 | CodeVance: http://carbon.now.sh/ |
21:42:51 | FromGitter | <metasyn> looks cool |
21:43:09 | Araq | a little bit more support in my desire to remove features would be nice though. |
21:43:23 | stefanos82 | dom96: don't worry people, in case of backfire my boyz have everything under control http://darkroom-cdn.s3.amazonaws.com/2012/04/TE.GALLERY23P5.jpg |
21:43:24 | Yardanico | Araq, what features? |
21:43:28 | FromGitter | <kaushalmodi> @dom96 Do you use `carbon-now-cli` for such code pics? |
21:43:30 | Araq | 'defer'. |
21:43:33 | FromGitter | <kaushalmodi> I just read about it recently |
21:43:39 | dom96 | kaushalmodi: nope |
21:43:44 | stefanos82 | Araq: remove or replace with better idea(s)? |
21:43:44 | dom96 | Let me guess, it's a node CLI? |
21:43:46 | Yardanico | well, I don't use it so I don't care :P |
21:44:00 | Araq | if we all want a small language, removing features helps in this goal |
21:44:01 | FromGitter | <kaushalmodi> .. yes |
21:44:02 | dom96 | Of course it is |
21:44:11 | Araq | stefanos82: we're getting destructors instead |
21:44:27 | stefanos82 | Araq: why destructors should be used explicitly though? |
21:44:34 | Yardanico | they shouldn't, no? |
21:44:38 | dom96 | Don't worry, I'll be writing an RFC for some removals soon |
21:44:43 | FromGitter | <kaushalmodi> dom96: Because it looks so similar: https://github.com/mixn/carbon-now-cli#basic |
21:44:44 | miran | Araq: you have my support for removing defer, it that means anything to anybody..... |
21:44:50 | FromGitter | <kaushalmodi> so how did you create that? :) |
21:45:11 | stefanos82 | even the name will confuse some |
21:45:12 | * | brainpro1 joined #nim |
21:45:16 | stefanos82 | are there any constructors? |
21:45:17 | * | brainproxy quit (Read error: Connection reset by peer) |
21:45:20 | stefanos82 | they will start comparing it to C++ |
21:45:43 | stefanos82 | instead of calling it destructor, call it eliminator |
21:46:33 | stefanos82 | Araq: elim(objName) or eliminate(objName) |
21:47:12 | stefanos82 | also, you don't like defer. you don't like how it's named or how it's implemented? |
21:47:18 | Yardanico | but I heard that new destructors will be able to called implicitly? |
21:47:37 | Yardanico | so you don't need to write destroy(myobj) everywhere (well, maybe only for optimizations), no? |
21:47:41 | dom96 | Why not call it the Terminator instead? :P |
21:48:04 | stefanos82 | because there's a chance that it'll come back! |
21:48:05 | dom96 | Yardanico: That's literally the whole point of destructors |
21:48:11 | FromGitter | <rayman22201> Nim: "Come with me if you want your code to live" lol |
21:49:56 | Yardanico | for me syntax in PEP 572 feels non-pythonic, really |
21:49:57 | stefanos82 | dom96: if we add destructors and let them be in use behind the scenes, then no worries |
21:50:03 | stefanos82 | I'm more than happy to see them in use |
21:50:09 | stefanos82 | but to exclusively use them... |
21:50:43 | stefanos82 | personally I never used Foo::~Foo() with C++ ever before |
21:51:01 | stefanos82 | I mean to direct call it |
21:51:21 | * | miran quit (Ping timeout: 240 seconds) |
21:53:47 | stefanos82 | Araq: this might interests you; I have just found it via HN http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1105r0.html |
21:59:51 | Araq | stefanos82, it's terrible. :-) |
22:00:16 | stefanos82 | I know, but see it from the code emission's perspective |
22:00:21 | stefanos82 | less headaches IMHO |
22:00:38 | Araq | "Thread local storage requires cooperation from the operating system." no, it doesn't. you grab the stack pointer, you mask it to the start of the stack |
22:00:42 | Araq | done. |
22:01:02 | Araq | alternatively pass a hidden TLS parameter to every function |
22:01:40 | Araq | same holds for exceptions, map it to 'if' statements if you don't have OS support or cannot "afford" the compressed exception tables |
22:02:20 | stefanos82 | you sure know more than 2 lifetimes of mine |
22:02:25 | Araq | you don't have to butcher the language, you can embrace the idea that you are using a compiler. |
22:02:27 | stefanos82 | therefore I will trust you with your statements |
22:02:51 | stefanos82 | you mean the C++ committee? |
22:03:51 | Araq | well the author is Ben Craig, he lists the "alternatives" but misses my suggestions |
22:04:24 | stefanos82 | well, you could email him your suggestions. |
22:04:50 | Araq | fair, I'll do it. |
22:05:20 | stefanos82 | very nice. now, back to destructor discussion |
22:05:42 | stefanos82 | how about adding destructor's mechanism as part of object's creation? |
22:06:01 | stefanos82 | then you could call it explicitly if you want it to get destroyed |
22:06:11 | Araq | how about you read my "spec" first |
22:06:29 | stefanos82 | I read it, but my brain-cells are fried already -_- |
22:06:43 | stefanos82 | you mentioned it and didn't see it? |
22:06:45 | stefanos82 | I don't remember |
22:06:54 | stefanos82 | I'm getting older -_- :S |
22:12:36 | FromGitter | <kayabaNerve> I love := |
22:12:52 | FromGitter | <kayabaNerve> I remember trying to do that in Nim a long time ago... I think before I last joined here two months all |
22:13:02 | FromGitter | <kayabaNerve> *ago? I go on/off Gitter... |
22:13:20 | FromGitter | <kayabaNerve> But it's absolute, not accidental, and allows better iterating. |
22:13:51 | FromGitter | <kayabaNerve> With Nim, we have iterators from before 1.0 (when were they added?) So there's less of a need if we use them in the standard lib |
22:14:13 | FromGitter | <kayabaNerve> I do wish we had do while though |
22:14:22 | Araq | stefanos82, I don't understand your sentence and need to work, sorry. |
22:14:30 | FromGitter | <kayabaNerve> Or "loop and a half" |
22:15:35 | FromGitter | <kayabaNerve> The use cases have overlap but they are the same |
22:15:49 | stefanos82 | Araq: I read your RFC, but I don't remember it exactly how it should behave. I will read it again. |
22:16:29 | FromGitter | <kayabaNerve> https://github.com/kayabaNerve/Ember/commit/7349eae507eb5630c51688618ad598109960b61e |
22:17:42 | FromGitter | <kayabaNerve> There's a do-while with a limit I had. Since it's limited, a for loop works, which is what I used. I'm also going to change it to resulterror over valueerror. It does demonstrate a non iterable case for do while though... |
22:21:05 | FromGitter | <kayabaNerve> Also, Araq, don't need an OS for thread local storage if you write the all the functionality you needed from the OS into the program. 🤔 |
22:21:14 | * | Lord_Nightmare quit (Ping timeout: 260 seconds) |
22:21:47 | CodeVance | is there a way to set float32 as the default float |
22:22:32 | FromGitter | <kayabaNerve> Finally, I don't hate what Nim has with while (let x = a(); x == something) but it feels clunky and it's the same as just putting the line inside the loop *minus the initialization so I guess not* |
22:23:14 | FromGitter | <kayabaNerve> Compile for a 32 bit target? |
22:23:20 | FromGitter | <kayabaNerve> Not even joking tbh. |
22:30:13 | FromDiscord | <exelotl> just wrapped some functions from the sunvox dll and got one of my songs playing in about 10 minutes |
22:30:37 | FromDiscord | <exelotl> (after reading some pages from the nim book to clear things up) |
22:30:45 | FromDiscord | <exelotl> this language is so amazing |
22:31:16 | CodeVance | sunvox nive |
22:31:17 | CodeVance | nive |
22:31:18 | CodeVance | nice |
22:31:35 | * | Jesin quit (Ping timeout: 240 seconds) |
22:32:20 | krux02 | exelotl: what is your background? |
22:32:57 | krux02 | Araq: I made some changes to nim-gdb, but in general I kept it is a shell script |
22:33:16 | krux02 | it just runs gdb with arguments prepended |
22:33:27 | * | Jesin joined #nim |
22:33:50 | krux02 | I don't want that script to be a dependency on koch or similar. |
22:34:19 | krux02 | the shell script isn't very useful for windows |
22:34:41 | krux02 | at least I think it isn't. I don't know how usable the linux shell for windows is. |
22:35:30 | FromGitter | <kayabaNerve> Amazingly usable for what it is |
22:35:44 | krux02 | I really am done with the gdb support for Nim. I am tired. This is as good as I can make it, I also have other things to implement. |
22:35:49 | FromGitter | <kayabaNerve> It's no full replacement but if you don't want to reboot or use all your resources in a VM? |
22:36:07 | FromGitter | <kayabaNerve> I used it on a laptop for a year before I setup a Lubuntu VM on the side |
22:36:19 | krux02 | the only thing that I would like to have is that the gdb test run is invoked automatically by the integration test |
22:36:32 | krux02 | I wrote the test as a shell script |
22:37:11 | * | jamesroseman quit (Ping timeout: 244 seconds) |
22:39:04 | FromGitter | <data-man> @krux02 what for Windows users? bash & sh must be installed? |
22:39:27 | krux02 | well I don't know how much gdb is used on windows in the first place |
22:40:21 | krux02 | but `source <X:path\to\nim-gdb.py>` should work the equally well |
22:40:29 | krux02 | I just don't have windows |
22:40:40 | FromGitter | <Varriount> @dom96 What time zone do the IRC logs use? |
22:40:52 | krux02 | putting that command on the startup of gdb is all the shell script does |
22:41:13 | krux02 | so whoever is able to write bat files can port that script to windows as well. |
22:42:46 | FromGitter | <kaushalmodi> @data-man Hello! Are you working on the rst grid table support? https://github.com/nim-lang/Nim/issues/6429 |
22:43:33 | krux02 | Varriount: what time is it in the IRC logs? |
22:43:56 | FromGitter | <data-man> @kaushalmodi No. |
22:45:29 | FromGitter | <kaushalmodi> Hmm, ok. Just asked because you had self assigned that issue. In that case, I'll look into creating an intermediate script for grid table to simple table conversion. |
22:47:08 | FromGitter | <Varriount> krux02: Ah, looks like the logs use UTC |
22:47:22 | * | Lord_Nightmare joined #nim |
22:50:25 | FromDiscord | <exelotl> krux02: I recently changed my username from geckojsc. I make music and games. Previously I've made games in a language called ooc which has a similar approach to Nim but it's fallen behind in recent years. |
22:50:53 | FromDiscord | <exelotl> here's my site if you're interested :) https://exelo.tl/ |
22:50:54 | krux02 | ooc? never heard about that |
22:51:26 | FromDiscord | <exelotl> https://ooc-lang.org/ |
22:51:29 | krux02 | I see some high quality game art |
22:53:30 | FromDiscord | <exelotl> haha I can't tell if you're joking; some of my art is okay I guess xD |
22:53:34 | krux02 | exelotl: I see map and I see method calls without dot |
22:54:07 | FromGitter | <Quelklef> I see `|x| body` :( |
22:54:48 | krux02 | exelotl: This is a picture that instantly gets my attention https://exelo.tl/cards/museum-city-boat.png |
22:55:23 | FromDiscord | <exelotl> lolol |
22:55:25 | FromGitter | <kayabaNerve> Last 2015? |
22:57:33 | FromGitter | <kayabaNerve> When was Nim first publicized/usable/Turing complete/had a release? |
22:57:39 | FromGitter | <kayabaNerve> I guess the last is best |
22:58:38 | * | BitPuffin quit (Remote host closed the connection) |
22:59:40 | FromGitter | <kayabaNerve> Also, does Nim confirm to a certain c variant? |
22:59:51 | FromGitter | <kayabaNerve> Or is just 'C'? |
23:01:57 | krux02 | what do you mean with confirm? |
23:03:26 | krux02 | well I have to go for today, I wish you all a good night. |
23:03:27 | * | tiorock joined #nim |
23:03:27 | * | tiorock quit (Changing host) |
23:03:27 | * | tiorock joined #nim |
23:03:27 | * | rockcavera quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
23:03:27 | * | tiorock is now known as rockcavera |
23:03:34 | * | krux02 quit (Quit: Leaving) |
23:12:38 | FromGitter | <kayabaNerve> krux02: conform |
23:12:54 | FromGitter | <kayabaNerve> Sorry. Is all Nim guaranteed to be C99 or what? |
23:14:30 | stefanos82 | krux02 left |
23:14:56 | FromGitter | <kayabaNerve> Yeah. I saw. |
23:31:59 | stefanos82 | @kayabaNerve: the problem is that even though the code can be C99 compliant, the gcc std version that is used can vary from version to version. |
23:32:22 | stefanos82 | if you open your nimcache/<file>.json, you can see that it's using "gcc ..." |
23:33:12 | stefanos82 | it does not say anything about -std=c99 or -std=gnu99 |
23:33:20 | FromGitter | <Varriount> Anyone want to take a crack at reviewing https://github.com/nim-lang/Nim/pull/8260/files ? |
23:33:27 | FromGitter | <Varriount> Specifically fuzzymatch.nim |
23:33:53 | stefanos82 | @kayabaNerve: which means, if your GCC is version 7.x.x it defaults to gnu11 |
23:34:36 | FromGitter | <kayabaNerve> stefanos82: But it could output C99 and force -std=c99 |
23:34:58 | stefanos82 | if you force it, yes |
23:35:09 | stefanos82 | but the default Nim chooses it's plain gcc |
23:35:23 | stefanos82 | check your .json file to see what I mean |
23:35:50 | FromGitter | <kayabaNerve> If I do alias gcc to gcc -std=c99 to force it to always be used, will all Nim code be guaranteed to work? |
23:35:55 | FromGitter | <kayabaNerve> As intended |
23:38:30 | stefanos82 | use --passC:"-std=c99" |
23:38:35 | stefanos82 | I think that's the code |
23:38:50 | stefanos82 | let me check it myself and let you know |
23:40:26 | stefanos82 | hmm, it throws an error and complains about assembly code |
23:40:37 | stefanos82 | Araq: is this behavior normal or should it get reported as an issue? |
23:41:59 | stefanos82 | ah I was using the wrong flag |
23:42:03 | stefanos82 | false alarm Araq |
23:42:30 | stefanos82 | kayabaNerve: replace "-std=c99" with "-std=gnu99" and it should work |
23:42:46 | stefanos82 | even with gnu89 should compile as expected |
23:43:24 | stefanos82 | I guess the use of asm behind the scenes needs GCC's extensions to compile successfully |
23:45:20 | FromGitter | <kayabaNerve> Then how does it work on non-GNU compilers lol. I wouldn't be surprised if clang had GNU support but I doubt MSVC does... |
23:45:36 | Araq | Nim targets the C that Visual C++ understands. that's pretty much C89 |
23:45:37 | FromGitter | <kayabaNerve> Maybe it's C99 on Windows and GNU99 on Linux? |
23:45:44 | FromGitter | <kayabaNerve> Got it |
23:45:51 | FromGitter | <kayabaNerve> So it depends on whatever compiler it's working with? |
23:46:03 | Araq | and C99 is not a language standard for me. ;-) |
23:46:10 | FromGitter | <kayabaNerve> Because? |
23:46:23 | Araq | because it's a crime. |
23:46:31 | CodeVance | Too much undefined behaviour |
23:46:47 | CodeVance | is what araq said |
23:47:11 | Araq | it adds stuff nobody asked for and yet STILL lacks artihmetic ops that can tell you if an overflow happened. |
23:47:43 | FromGitter | <kayabaNerve> It was adopted by both ANSI and ISO |
23:47:46 | Araq | and is deliberately made incompatible with C++, with its own shitty idea of how to implement overloading |
23:47:54 | FromGitter | <kayabaNerve> i think the real crime is making a 2011/2017 C standard |
23:48:18 | stefanos82 | Araq: I can hear some ancient C geeks shouting from their caves: BLASPHEMY! BURN THE WITCH! |
23:48:49 | Araq | they should just adopt C++. at least C++ is improving and its problems are recognized and worked on |
23:48:57 | FromGitter | <kayabaNerve> Also, I use C99 and know it just because it's the most recent before some idiot made 11/17 versions |
23:49:00 | stefanos82 | Araq: agreed |
23:49:02 | FromGitter | <kayabaNerve> Also has the best support with the internet |
23:49:16 | stefanos82 | C17 it's just bug fixes, nothing new |
23:49:31 | FromGitter | <kayabaNerve> I agree with C++, not the C89 cutoff, but I don't know enough to really say |
23:50:50 | * | dddddd quit (Remote host closed the connection) |
23:51:44 | stefanos82 | I haven't touched C++ for nearly 6 months now and feel homesick LOL! |
23:52:49 | FromGitter | <kayabaNerve> Also, pretty sure I can write C89 that isn't valid C++ Araq |
23:53:18 | Araq | yes, and that's called "bad C" code. |
23:53:23 | FromGitter | <kayabaNerve> C doesn't require function definitions IIRC. int main(){a();} void a(){return;} |
23:53:26 | FromGitter | <kayabaNerve> That should compile |
23:53:42 | FromGitter | <kayabaNerve> C++ requires me to define void() a; |
23:53:48 | FromGitter | <kayabaNerve> or void a(); |
23:53:49 | FromGitter | <kayabaNerve> Sorry |
23:54:04 | stefanos82 | did you mean function prototype? |
23:54:09 | Araq | yeah C is bad design that turned into a religion, so it's unfixable. Exactly like Unix. |
23:54:26 | FromGitter | <kayabaNerve> So why the hell did we get a 2011 version lol |
23:54:31 | FromGitter | <kayabaNerve> Not asking you |
23:54:37 | FromGitter | <kayabaNerve> Asking the idiots who made/ratified C11 |
23:54:40 | stefanos82 | vendors need it |
23:54:42 | stefanos82 | $$$ |
23:55:33 | Araq | C11 added a threading model incompatible with Posix's :D |
23:55:56 | Araq | they just added some random stuff nobody ever could try out first. |
23:55:58 | stefanos82 | if I'm not mistaken, it's using it behind the scenes |
23:56:06 | stefanos82 | I have seen it somewhere in their header files |
23:56:18 | stefanos82 | like _Generic? |
23:56:26 | Araq | sure, but what's the point? just adopt Posix's API |
23:56:35 | stefanos82 | yep, my thoughts exactly |
23:57:27 | stefanos82 | I'm really disappointed by the whole programming community to be honest with you Araq |
23:58:14 | stefanos82 | I remember the days where they were competing who's going to squeeze out juice of a program and produce a safe code and be as fast as a bullet |
23:58:41 | Araq | yeah... people could at least read some scientific studies about the effectiveness of using a mouse and a keyboard... :P |
23:59:12 | Araq | hint: not using a mouse makes you more unproductive, but makes you feel more productive. |
23:59:28 | stefanos82 | I use my mouse where is necessary |