<< 12-07-2018 >>

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:55skrylaron the glib front, we can't use the _ and _T functions :|
00:32:03skrylari 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:04skrylarAraq, so you're trying to rustify nim? lol
03:06:46skrylaronly 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:26skrylari wonder why some things in glib respond to `destroy` and others to `free`
03:35:45skrylarI kind of want to go through and remove all the "G" prefixes, too.
03:36:10skrylardid so from the functions but not the types
03:41:33shashlickskrylar: are you doing this manually?
03:41:53skrylarshashlick, for glib i did
03:44:31skrylaras 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:12skrylarI probably won't do this, but was pondering if releasing module docs as a tiddlywiki file would be worthwhile
03:51:56skrylarplayed 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:40shashlicki liked tiddlywiki, used it years ago to document one of my projects
04:05:11shashlickbut that was an application
04:05:17shashlickdid you use nim doc? i use it for all the wrappers i do
04:05:37shashlickhttp://nimgen.genotrance.com/nimarchive for example
04:06:41skrylarshashlick, i have used nim doc before
04:06:49skrylarI don't particularly enjoy it.
04:07:17skrylarwhat 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:46skrylarhttps://github.com/Skrylar/firebird/tree/master/docs
04:07:58shashlickya took a while to figure it out, along with the nimdoc.cfg changes required
04:08:06shashlickbut i like the result - https://github.com/genotrance/nimgen/blob/master/tests/nimgentest.nims#L50
04:08:20skrylarwell its mostly that nim doc isn't designed to make manuals
04:08:24shashlicki have the .nim file posted syntax highlighted and the nim doc points to the source file
04:08:48shashlickno doubt, just the API docs doesn't make documentation, but it's a start
04:09:06skrylarwill probably ahve to have a deep think on keeping texinfo or using asciidoc going forward
04:09:50skrylarasciidoc[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:33skrylarBut 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:09FromGitter<kaushalmodi> skrylar: texinfo! Emacs user?
04:14:11FromGitter<kaushalmodi> :)
04:14:16skrylari was at the time yea
04:14:31FromGitter<kaushalmodi> I love the Info mode
04:14:34skrylarbut 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:21FromGitter<kaushalmodi> I document (started with just one Nim module right now) in Org.
04:15:24FromGitter<kaushalmodi> https://github.com/kaushalmodi/strfmt/blob/master/docs/strfmt.org
04:15:37skrylarorg is formidable
04:15:46FromGitter<kaushalmodi> :(
04:15:54FromGitter<kaushalmodi> Oh well
04:16:02skrylarwhy frown? formidable is usually a complement lol
04:16:30FromGitter<kaushalmodi> https://www.google.com/search?q=formidable&ie=utf-8&oe=utf-8&client=firefox-b-1-ab
04:16:40FromGitter<kaushalmodi> sorry for that garbage link
04:16:54FromGitter<kaushalmodi> synonyms.. disturbind, forbidding, etc.
04:17:15FromGitter<kaushalmodi> I've only read formidable in negative context.. that's why the frown :)
04:17:28FromGitter<kaushalmodi> so..
04:17:29shashlickyou guys in north/south america?
04:17:40skrylari am
04:17:50FromGitter<kaushalmodi> I am in US, why?
04:18:11shashlickjust curious - at this hour 🙂
04:18:37FromGitter<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:02FromGitter<kaushalmodi> I was stuck on debugging something else.. couldn't sleep
04:19:02skrylarexporting it to reST?
04:19:14FromGitter<kaushalmodi> yes as nim docs likes only that
04:19:28skrylarrest 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:44skrylarxslt is aggravating however
04:22:14skrylari almost feel like trying to cope with xslt 1.0 is not worthwhile because ruby+nokogiri is less mysterious
04:22:32FromGitter<kaushalmodi> hmm, never heard of xslt
04:22:43skrylaryou need it to transform docbooks to html
04:23:28FromGitter<kaushalmodi> ah yes.. I think I have heard the name.. when installing docbook2x binary or something like that
04:23:33shashlickI have not so fond memories of xslt
04:23:43FromGitter<kaushalmodi> it was a dependency for building git man pages
04:23:44shashlickthe days when XML ruled the land
04:24:25shashlickthat looks good @kaushalmodi
04:24:46skrylarkaushalmodi git uses asciidoc :)
04:24:58skrylarit's just that asciidoc requires a docbook pipeline if you want pagination/indices/etc
04:26:05FromGitter<kaushalmodi> ok.. here's what was needed, from my script: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b46d85dd1428e5aefdf8bb4]
04:26:44FromGitter<kaushalmodi> As I mentioned earlier, couldn't leave without Info manuals :)
04:26:50FromGitter<kaushalmodi> *live
04:28:05skrylarinfo is not a bad format, really.
04:28:19skrylarthe browsers for it tend to be crap (thinking of the cli app here) but with a better faceplate nobody would be complaining
04:28:54FromGitter<kaushalmodi> yeah, I think the best browser is the Emacs Info mode
04:30:07FromGitter<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:29ldleworkhail emacs
04:33:19skrylaremacs wouldn't give me fuzzy autocomplete a la sublime
04:33:21*lompik joined #nim
04:33:30skrylar(or kokune, apparently)
04:34:07ldleworkfuzzy autocomplete for what
04:35:44skrylartyping regular identifiers/snippets
04:38:42FromGitter<kaushalmodi> `hippie-expand` works pretty well for me for autocompleting identifiers
04:38:55FromGitter<kaushalmodi> Haven't yet needed to auto-complete snippets
04:39:38FromGitter<kaushalmodi> There are auto-complete and company-mode packages for auto-completion suggestions but they come more in my way than help.
04:40:08skrylari know they have some auto completers, but they weren't doing automatic fuzzy matching like sublime and kokune do
04:40:34skrylarthere 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:46skrylaralso firefox keeps crashing the tab i attempt to open a texi2html file with :concern:
04:41:54skrylarI guess asciidoctor it is then?
04:55:02FromGitter<kaushalmodi> I believe asciidoc is fine too.. I think there are many Adoc fans here
04:55:21skrylari use the ruby rewrite because the other is written in python2
04:55:30skrylarsupporting continued use of dead snakes is :E
04:55:57skrylaralthough that means i have to port the firebird docs (because texi2html is crashing firefox), and thats :\
04:56:45skrylarTexi actually has multiple indices (adoc does not), so you can have one just for functions and one for concepts
04:57:12FromGitter<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:03FromGitter<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:21skrylarno, i just discovered this problem ten minutes ago
04:58:30FromGitter<Quelklef> Sure send the link again @kaushalmodi
04:58:57FromGitter<kaushalmodi> I hyperlinked the "link" in my previous message
04:59:16FromGitter<Quelklef> Oh yeah fancy
04:59:28FromGitter<kaushalmodi> Gitter supports markdown
04:59:37FromGitter<Quelklef> Yeah I know
04:59:42FromGitter<Quelklef> my eyes just glazed over it
04:59:48FromGitter<Quelklef> appears to be fixed now 👍
04:59:51FromGitter<kaushalmodi> oh ok :)
04:59:52FromGitter<kaushalmodi> phew
04:59:53FromGitter<kaushalmodi> thanks
05:00:02FromGitter<Quelklef> np
05:00:05FromGitter<Quelklef> also looks nice
05:00:08FromGitter<Quelklef> is this your personal site?
05:00:15FromGitter<kaushalmodi> yep
05:00:32FromGitter<Quelklef> It looks like something I wish I could design :)
05:00:45FromGitter<kaushalmodi> It's my coding/scripting blog and notes collection
05:00:48FromGitter<Quelklef> Which i realize is a bit of an odd compliment
05:00:54FromGitter<Quelklef> It looks nice either way
05:01:19FromGitter<kaushalmodi> Thanks :) Slowly and gradually that site is turning into exactly how I like
05:01:52FromGitter<kaushalmodi> Issues like these (WOFF2 not working on Safari) helps in learn more about CSS, fonts, etc.
05:02:56FromGitter<Quelklef> Is this how you primary learned web frontend?
05:03:25FromGitter<kaushalmodi> If you call that "web frontend", then yes :)
05:03:38FromGitter<kaushalmodi> That blog is the only web thing I have done.. my day time job is something else
05:03:47FromGitter<Quelklef> I mean... what else would web frontend be
05:03:54FromGitter<Quelklef> Damn, it looks really well done
05:04:09FromGitter<Quelklef> Although I see you've been working on it since 2014, so I suppose there's been time to perfect
05:04:19skrylarnvm fixed
05:04:30FromGitter<Quelklef> `<article>` instead of `<div class="article">`
05:04:31FromGitter<kaushalmodi> I had no idea what web frontend is and so looked up https://en.wikipedia.org/wiki/Front-end_web_development
05:04:43FromGitter<kaushalmodi> I know probably 5% of all that :P
05:04:51FromGitter<Quelklef> Lol
05:04:53FromGitter<kaushalmodi> I don't know JS, webassembly, etc etc
05:05:05FromGitter<Quelklef> Learn JS!
05:05:15FromGitter<Quelklef> Learn JS so that you can avoid it at all costs :^)
05:05:21FromGitter<kaushalmodi> I am learning Nim
05:05:29FromGitter<kaushalmodi> hoping to export Nim to JS if ever I need it :P
05:05:42FromGitter<Quelklef> True
05:05:57FromGitter<Quelklef> But you'll probably need to know JS in order to do the interpolating
05:06:14FromGitter<Quelklef> besides JS is kinda fun
05:06:32FromGitter<Quelklef> until you worry about actual things like browser support and whatnot
05:06:37FromGitter<kaushalmodi> I like lisp (emacs-lisp) for fun, and Nim is getting close to that
05:06:38FromGitter<Quelklef> but otherwise it's kinda like play-doh
05:06:51FromGitter<Quelklef> wym it's getting close?
05:07:12FromGitter<kaushalmodi> emacs-lisp is extremely flexible.. I can override anything, introspect anything
05:07:30FromGitter<Quelklef> yeah lisp is a very flexible language
05:07:36FromGitter<kaushalmodi> The inbuilt Emacs help system is super awesome
05:08:06FromGitter<kaushalmodi> I can down to any level into the rabbithole (until I reach the Emacs-Lisp/C boundary :))
05:08:48skrylarapparently gitbook went all corporate :(
05:08:57FromGitter<Quelklef> I always found Lisp (Common Lisp) annoying though because of a weird and inconsistent stdlib. Is Emacs-Lisp better?
05:09:12FromGitter<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:28FromGitter<kaushalmodi> Emacs-Lisp is worth learning only if you use Emacs
05:09:35FromGitter<Quelklef> that's a no from me then
05:09:45FromGitter<kaushalmodi> Emacs-Lisp ties the lisp with the buffer/window system of Emacs
05:09:54FromGitter<Quelklef> Huh
05:10:31FromGitter<Quelklef> that reminds me
05:10:46FromGitter<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:57FromGitter<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:21FromGitter<kaushalmodi> I was once reading pdf in one window in emacs while typing notes in the other window
05:11:34FromGitter<Quelklef> ech different namespaces for functions and vars still
05:11:35FromGitter<kaushalmodi> and I wanted to scroll the other window while *being* in the current window
05:11:40FromGitter<kaushalmodi> so I just wrote that up
05:11:46FromGitter<Quelklef> Oh! That's cool though
05:11:52FromGitter<Quelklef> huh
05:12:03FromGitter<Quelklef> I use Kakoune, I wonder if its scripting is as powerful
05:12:05FromGitter<kaushalmodi> emacs-lisp basically allow you to do anything you can think of
05:12:07FromGitter<Quelklef> I never learned any
05:14:58FromGitter<Quelklef> oh cool you just taught me that `fmt` from `strformat` exists
05:15:56FromGitter<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:00FromGitter<kaushalmodi> .. and `typetraits`
05:17:03FromGitter<kaushalmodi> I have separate set of notes dedicated to just `fmt`: https://scripter.co/notes/nim-fmt/
05:19:07FromGitter<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:46FromGitter<Quelklef> Agh I wish we had compiler warnings on unused imports
05:20:59FromGitter<Quelklef> I always end up with like 12 because I add some, remove any uses, and forget to remove them
05:21:25FromGitter<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:54FromGitter<Quelklef> i.e. spit out a modified version of the source correctly formatted, without superfluous imports, et.c
05:22:01FromGitter<Quelklef> Like an IDE, but without an IDE
05:22:50FromGitter<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:34FromGitter<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:45FromGitter<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:41skrylari 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:03skrylarex. an API change happens and now there is a new error you don't handle
05:46:14FromGitter<Quelklef> Yeah
05:46:19FromGitter<Quelklef> I was just using it for example
05:46:42FromGitter<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:14FromGitter<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:54PerkolIs 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:47FromGitter<tim-st> Perkol: maybe this: https://nim-lang.org/docs/os.html#walkPattern.i,string
07:10:08FromGitter<tim-st> or one of these below
07:13:25FromGitter<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:51FromGitter<gogolxdong> How to link libvixAllProducts.so ?
07:37:35*dddddd joined #nim
07:42:07FromGitter<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:37Yardanicohow 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:08YardanicoI 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:16AraqsetLen?
11:22:55YardanicoAraq, it works only for string, right?
11:23:42Araqyou pass the Nim string as a cstring and setLen it afterwards.
11:24:02Araqthat'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:28FromGitter<tim-st> does this work without a cast?
11:42:05*yglukhov[i] joined #nim
11:43:46FromGitter<tim-st> I currently do it like this:
11:43:53FromGitter<tim-st> result = $castcstring (val.mv_data) ⏎ result.setLen(val.mv_size)
11:44:21FromGitter<tim-st> `result = $castcstring (val.mv_data)`
11:44:43FromGitter<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:54FromGitter<Varriount> @tim-st `$` on a cstring performs a copy
13:13:04*leorize joined #nim
13:41:45skrylarHuh. Kak already has some basic nim support
13:47:04zacharycarterI really want to learn Kakoune
13:47:10zacharycarterI've heard it's sweet
13:47:33skrylartrying it out right now. it's uh.. weird but neat
13:47:53skrylarno snippets though :\
13:48:23FromGitter<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:35skrylarmultiselections 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:36zacharycarterI'm not used to using snippets anyway so that's fine w/ me :P
13:48:45skrylarsnippets are great when your language is shit
13:48:57zacharycarterlike java?
13:49:05zacharycarteror c++?
13:49:21zacharycartergotcha
13:49:25skrylarhad some anti-strain stuff in emacs for C++ back in the day. custom elisp so typing ;; would emit ::
13:49:35skrylar-. became ->
13:49:56zacharycarternice
13:50:41skrylarelisp 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:47skrylarturns 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:29skrylarkak 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:02Araqkak is a funny name
14:22:32*Vladar joined #nim
14:25:56subsetparkskrylar: use K and J
14:27:25skrylarsubsetpark, thankies
14:39:17*donlzx quit (Remote host closed the connection)
14:39:40*donlzx joined #nim
14:40:42stefanos82I wonder people don't use or like Vim 8 :/
14:40:52stefanos82*why people
14:41:52dom96Because it's inconsistent with the rest of my OS
14:42:25dom96I've spent a month trying to work in vim (even printed a cheatsheet) and I just couldn't get into it
14:45:21skrylari stopped using vim and went to evil-mode basically until RSI gave me issues again
14:46:12skrylaronly 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:06stefanos82dom96: 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:47skrylarhttps://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:13zacharycarterhrm - I'm compiling with the -d:nodejs define and trying to echo
15:24:19zacharycarterwhen I do - `echo(fs.statSync(fullpath).isDirectory())`
15:24:30zacharycarterI get - `echo(fs.statSync(fullpath).isDirectory())`
15:24:37zacharycartersorry
15:24:40zacharycarter`type mismatch: got <JsObject>`
15:24:53dom96stefanos82: A month
15:25:38zacharycartereven - `echo((fs.statSync(fullpath).isDirectory()).bool)` - fails with the same error
15:27:48Araqstefanos82: do you use a mouse?
15:30:40zacharycarternm 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:53zacharycarterI'm getting invalid indentation inside the arrow proc
15:55:55zacharycarterat the conditional
15:56:05zacharycarter`if name == "package.json":`
16:02:38zacharycartersemicolons 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:07FromGitter<tim-st> this example has wrong proc name: https://github.com/nim-lang/Nim/blob/master/lib/pure/strutils.nim#L1057
16:28:59FromGitter<Quelklef> @tim-st then make a PR
16:29:45FromGitter<tim-st> dont have the things installed to make it tbh
16:30:05FromGitter<Quelklef> ?
16:30:07FromGitter<Quelklef> No git?
16:30:22FromGitter<tim-st> dont think so
16:30:33FromGitter<Quelklef> oh
16:30:38FromGitter<tim-st> well I have, but I dont use it
16:30:56FromGitter<Quelklef> You should learn it
16:30:58FromGitter<Quelklef> Git's great
16:31:14FromGitter<tim-st> dont need it currently
16:31:31FromGitter<Quelklef> Do you use something else instead
16:31:35FromGitter<Quelklef> or just no vcs
16:31:53FromGitter<tim-st> for my own project I dont need version control
16:32:04FromGitter<kayabaNerve> ...
16:32:41*donzx quit (Remote host closed the connection)
16:33:16FromGitter<kayabaNerve> https://www.hackread.com/developer-deletes-work-files-with-visual-studio-code/
16:33:20FromGitter<kayabaNerve> Don't be that guy.
16:33:37mirani was that guy before that guy
16:33:58miranbut i didn't write about it, just kicked myself quite hard few times
16:34:04*jamesroseman joined #nim
16:34:05FromGitter<Quelklef> ouch
16:35:12FromGitter<tim-st> I make zip backups on each milestone, and I think If I delete accidently this files are not real deleted
16:35:23FromGitter<Quelklef> uh
16:35:24FromGitter<Quelklef> hmmmm
16:35:32FromGitter<Quelklef> why not just... use git
16:35:40FromGitter<tim-st> too much time goes in it
16:35:45FromGitter<Quelklef> im pretty sure it'd be less effort once you learn it
16:36:05FromGitter<Quelklef> well, perhaps more effort, but with a much higher payoff
16:36:19FromGitter<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:28FromGitter<tim-st> maybe I use it later when I reached a alpha status
16:36:33FromGitter<Quelklef> a what?
16:36:38FromGitter<tim-st> *my version
16:36:40PMunch"Why you have three months of work not under source control is the bigger question." - The real question here
16:36:42FromGitter<tim-st> alpha version
16:36:43FromGitter<Quelklef> Ah
16:36:53FromGitter<kaushalmodi> I never get that.. learning git is a life skill.. just learn it once
16:37:16CodeVancezachary 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:21FromGitter<tim-st> well it just looks so ugly, the commands seem designed like the task was "make it as ugly as possible"
16:37:40FromGitter<Quelklef> ??
16:37:42FromGitter<kaushalmodi> try out some porcelains (git wrappers)
16:37:46FromGitter<kaushalmodi> I use Magit on Emacs
16:38:12mirangit in vscode is quite straightforward
16:38:12FromGitter<tim-st> I've seen there is a good integration in vscode, but I dont feel the use for it tbh
16:38:19FromGitter<tim-st> *the need
16:38:57*jamesroseman quit (Ping timeout: 240 seconds)
16:39:04*Perkol joined #nim
16:39:44PerkolWhat is the keyword for doing nothing? Like pass in python
16:39:52miranPerkol: discard
16:39:54FromGitter<Quelklef> discard
16:40:18FromGitter<Quelklef> alternatively, `(proc: void = return)()`
16:40:28PerkolYeah thanks
16:40:38PMunchtim-st, once you learn it you will wonder how you ever did without :P
16:40:43FromGitter<kayabaNerve> Use Github Desktop
16:40:46FromGitter<kayabaNerve> Easy as hell
16:40:48FromGitter<kayabaNerve> No cli
16:41:07FromGitter<tim-st> PMunch: I already used it in university, but dont need it currently
16:41:47PMunchPfft, you always need version control
16:42:22FromGitter<Quelklef> I mean he has version control
16:42:25FromGitter<Quelklef> just not git
16:42:48PMunchHaha, yeah I guess zip files of project state technically is version control
16:42:49FromGitter<tim-st> I have version control in my head
16:43:11FromGitter<Quelklef> yoooo
16:43:25FromGitter<kayabaNerve> https://github.com/kayabaNerve
16:43:28FromGitter<kayabaNerve> This is my GitHub
16:43:29FromGitter<Quelklef> this mans in 3018
16:43:32FromGitter<kayabaNerve> I use version control with it
16:43:35FromGitter<kayabaNerve> It has my projects
16:43:36FromGitter<tim-st> ^^
16:43:38FromGitter<kayabaNerve> Employers see it
16:43:43FromGitter<kayabaNerve> If needed, I can grab code from it
16:43:48FromGitter<kayabaNerve> If my desktop dies, I can grab code
16:43:54FromGitter<kayabaNerve> If their servers die, I can grad code
16:43:59FromGitter<Quelklef> sorry, Ember is a cryptocurrency?
16:44:10FromGitter<kayabaNerve> @Quelklef Did you just find that out?
16:44:22FromGitter<kayabaNerve> If I make a bad edit, I can revert it
16:44:22FromGitter<Quelklef> Yeah I knew you had something called Ember but I hadn't looked at it
16:44:29FromGitter<Quelklef> Are you in uni?
16:44:32FromGitter<kayabaNerve> No
16:44:35FromGitter<kayabaNerve> Just graduated HS
16:44:46FromGitter<Quelklef> ah
16:44:49FromGitter<Quelklef> So about to be
16:44:53FromGitter<kayabaNerve> 16 yr old; out of the formal set of schooling; not going to college
16:45:00FromGitter<kayabaNerve> Nah it's 170k after my college fund
16:45:02PMunchkayabaNerve, my GitHub is also full of stuff. But I also have a private server with a lot more stuff
16:45:05miranwow, i thought you're older @kayabaNerve!
16:45:11FromGitter<Quelklef> Same, miran
16:45:16FromGitter<kayabaNerve> That's a lot of debt to take
16:45:22FromGitter<kayabaNerve> Eh. It shows in my behavior
16:45:40FromGitter<Quelklef> Ages are always fun online
16:45:50FromGitter<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:54PMunchkayabaNerve, move to a country that has a proper educational system and you'll get it for close to free
16:46:02FromGitter<kayabaNerve> Currently working for a crypto group, my own crypto, and an insurance group
16:46:03FromGitter<Quelklef> ouch
16:46:14FromGitter<Quelklef> ouch @ PMuch, oops
16:46:15FromGitter<kayabaNerve> PMunch I should tbh lol
16:46:20FromGitter<Quelklef> So you're set then
16:46:21FromGitter<kayabaNerve> @Quelklef How old are you/
16:46:23FromGitter<Quelklef> you don't even need Uni
16:46:27PMunchI'm just done with my masters thesis, and I've only got about $6k in debt
16:46:28FromGitter<Quelklef> I'm also 16!
16:46:45miranomg, i just figured out i'm twice your age! jesus, i'm old!
16:46:54FromGitter<Quelklef> Holy moly
16:46:55FromGitter<kayabaNerve> Yeah. Don't need it. It would be good if it wasn't so expensive though...
16:47:02FromGitter<kayabaNerve> @Quelklef Are you my twin?
16:47:08PMunchmiran, yeah I was also starting to feel old here :P
16:47:11FromGitter<kayabaNerve> miran: I think you have to leave now...
16:47:25FromGitter<kayabaNerve> I thought Quelkef was 20 something
16:47:33FromGitter<Quelklef> no @miran you count as two 16 year olds
16:47:35miranboy, when i was your age, we respected elders!!! :P :D
16:48:01FromGitter<kayabaNerve> miran: You're not an elder. :P
16:48:09FromGitter<Quelklef> Not yet...
16:48:17miraneh, if only i took programming more seriously at your age....
16:48:21FromGitter<kayabaNerve> Elder is... IDK. 40+ for adulthood advice, 60+ for societal advice
16:48:42miranok ok, you don't have to respect me then, fine! :P :D
16:48:52FromGitter<kayabaNerve> Yeah you're in the old but not elder spot :P
16:50:15FromGitter<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:22FromGitter<kayabaNerve> @Quelklef You interested in crypto?
16:50:27FromGitter<tim-st> anyone has a guess about the sentence here reagarding "dupsort": https://www.openldap.org/lists/openldap-technical/201410/msg00011.html
16:50:34FromGitter<tim-st> that sounds really expensive
16:50:38FromGitter<Quelklef> Not really @kayabaNerve
16:51:02FromGitter<Quelklef> My current interests are programming languages and language design
16:51:20FromGitter<Quelklef> So it's really cool to be around Nim as it's developed
16:51:24FromGitter<kayabaNerve> Got it
16:51:35FromGitter<Quelklef> Although I did learn about /r/memeeconomy today, if that counts...
16:51:51FromGitter<kayabaNerve> 1) make an esoteric lang ⏎ 2) make a smart contract lang
16:52:14stefanos82Araq: mouse with Vim? Nope. Why should I?
16:52:19FromGitter<Quelklef> That's a crypto concept, yeah?
16:52:29miranstefanos82: because it is 2018? ;)
16:52:54stefanos82miran: why should I use my mouse with my editor if I can use some keys to do my job?
16:53:08FromGitter<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:21FromGitter<kayabaNerve> Ethereum is the biggest.
16:53:39FromGitter<kayabaNerve> the Ethereum Virtual Machine is coded in... Solidity, Vyper, Flynt IIRC
16:53:43miranstefanos82: 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:44FromGitter<kayabaNerve> But Solidity 99% of the time
16:54:00FromGitter<kayabaNerve> *Flint
16:54:13stefanos82miran: I never felt the need to use my mouse with Vim.
16:54:18FromGitter<Quelklef> THen not a cryptocurrency concept, but used heavily in cryptocurrencies
16:54:23FromGitter<Quelklef> Sounds more like the domain of a library to me
16:54:56FromGitter<kayabaNerve> Well. Technically a smart contract is a digital and absolute contract
16:54:59FromGitter<kayabaNerve> AKA a vending machine
16:55:19FromGitter<kayabaNerve> But then they're used now-a-days on decentralized networks which include the verifiable properties
16:55:30FromGitter<kayabaNerve> And then you use Cryptocurrency to pay for one to be run
16:55:39FromGitter<kayabaNerve> That's what Ether is. Gas for contracts.
16:55:50FromGitter<kayabaNerve> I would love Nim syntax for smart contracts
16:55:58FromGitter<Quelklef> do it
16:56:00FromGitter<kayabaNerve> Not Nim; it wouldn't work. Just Nim syntax
16:56:06FromGitter<Quelklef> Oh
16:56:38FromGitter<Quelklef> Git says Ember is C/Nim, though?
16:57:16FromGitter<kayabaNerve> It's Nim but I have a couple C libs in there
16:57:48FromGitter<kayabaNerve> Smart Contracts are run on VMs and have limited features
16:57:51FromGitter<Quelklef> I mean, Nim is designed to interface well with C..
16:57:57FromGitter<Quelklef> hmm
16:58:15FromGitter<kayabaNerve> There's no console output on Ethereum. Instead, there's events and arguments supplied to the events.
16:58:25FromGitter<kayabaNerve> There's no message passing. There's child TXs.
16:58:30FromGitter<kayabaNerve> There are still function calls ofc
16:58:56FromGitter<Quelklef> We're getting way out of my domain of understanding here
16:59:37skrylarquelklef: springs!
16:59:38FromGitter<kayabaNerve> Yeah. Lyra2 + BigNumbers are in C. Rest is Nim.
17:00:11FromGitter<Quelklef> @skrylar Come again?
17:01:20FromGitter<Quelklef> @kayabaNerve "#Hash *exponent*. Used to generate SHA512 Squared and Cubed hashes."
17:01:35FromGitter<Quelklef> Were you the one asking for `f^3(x)` before?
17:01:50skrylarhttps://github.com/Skrylar/skEasing/blob/master/docs/spring.png boing!
17:02:47FromGitter<kayabaNerve> @Quelklef Yes. I'm working with (sha512^3)(x)
17:02:56FromGitter<Quelklef> hah, I remember that
17:03:41FromGitter<kayabaNerve> I just wanted SHA512 cubed :P
17:03:46FromGitter<kayabaNerve> And now I have it
17:04:05FromGitter<Quelklef> You could make the proc general
17:04:07FromGitter<kayabaNerve> And I wouldn't mind using SHA512^ and hardcoding it to sha512 except you can't name a function like that
17:04:17FromGitter<kayabaNerve> What do you mean?
17:04:33FromGitter<Quelklef> I mean it could be a generic func
17:04:41FromGitter<Quelklef> can I make it generic in a `util.nim` and make a PR?
17:04:51FromGitter<kayabaNerve> Someone posted a 30 to 50 line macro that did it like that SHA512^3(x) IIRC
17:05:03FromGitter<kayabaNerve> Sure. I edited this based on an idea from someone else
17:05:08FromGitter<Quelklef> Yeah with the syntax you wanted
17:05:30FromGitter<kayabaNerve> They suggested something like that and I got it up and running. Feel free to do what you want with it.
17:05:52FromGitter<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:48FromGitter<Quelklef> I'm pretty sure it was me :)
17:08:04FromGitter<kayabaNerve> Lol. Thanks if so :D
17:08:07zacharycarterthanks codevance
17:09:21Araqplease keep in mind that compiler/parser is usable as a library
17:09:33Araqespecially in devel where the APIs got a cleanup
17:14:54FromGitter<Quelklef> @kayabaNerve Where's `secp256k1` from?
17:15:02FromGitter<Quelklef> Can't compile because of the `import secp256k1`.
17:16:57FromGitter<Quelklef> Is it a C lib
17:18:29*jamesroseman joined #nim
17:18:46*krux02 joined #nim
17:19:10krux02Araq: 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:00Araqit matters that I like it.
17:38:30shashlickhaha, I guess I'm almost an elder
17:39:29*smt quit (Ping timeout: 260 seconds)
17:44:59FromGitter<kayabaNerve> @Quelklef You're the second or third other to compile this and I wasn't there for you
17:45:01FromGitter<kayabaNerve> I'm sorry
17:45:05FromGitter<kayabaNerve> I've failed you
17:45:26FromGitter<kayabaNerve> That said, it's a nimble lib actually. The Nimble lib doesn't have the lib included, but instead a... pointer?
17:45:31FromGitter<kayabaNerve> I don't know the git term
17:45:38FromGitter<Quelklef> Hahah well I made the PR anyway
17:45:45FromGitter<Quelklef> Pointer?
17:45:52FromGitter<Quelklef> Like a nested project?
17:45:59FromGitter<kayabaNerve> Submodule
17:46:00FromGitter<kayabaNerve> https://github.com/status-im/nim-secp256k1/tree/master/secp256k1_wrapper
17:47:19krux02I now officially hate git
17:47:28FromGitter<kayabaNerve> kux02 Sup
17:47:45krux02on my own brach I on my own fork I made `git pull`
17:47:48krux02Everything up to date
17:48:05krux02then I made changes
17:48:08krux02now I want to push
17:48:15krux02non fast forward
17:48:32krux02conflics
17:48:37krux02git officially lied to be
17:48:39krux02me
17:48:47krux02I still have the log
17:49:04krux02http://ix.io/1gZM
17:49:40miranrenault? :)
17:50:41def-miran: your car doesn't run Nim?
17:51:31mirandef-: eh, it's time to replace my car, i guess.... :)
17:52:03FromGitter<kayabaNerve> @Quelklef Yay! First PR! That said, can't we import util into SHA512 and export it?
17:52:23krux02no it's not my car it is this university computer that is called renault.
17:52:32krux02has nothing to do with the car
17:52:44FromGitter<Quelklef> @kayabaNerve I mean, yeah, but why not just import and use the general proc instead?
17:53:01mirankrux02, no need to lie, it's ok to run nim while you're driving
17:53:19FromGitter<kayabaNerve> Single place edit :P But I'll do it your way for right now
17:54:19FromGitter<Quelklef> Ah, yeah. Hmmm.
17:55:08krux02(I don't have a car)
17:56:31FromGitter<kayabaNerve> @Quelklef I also can't get [T] to work
17:56:43FromGitter<kayabaNerve> Without it, it tries to match template ^ (int)
17:57:23FromGitter<Quelklef> Come again?
17:58:08FromGitter<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:24FromGitter<Quelklef> It's not imported properly
17:58:36FromGitter<kayabaNerve> import ../lib/util
17:58:38FromGitter<Quelklef> hmmm
17:58:51FromGitter<kayabaNerve> I removed the [T] and set to string and it worked
17:58:56FromGitter<kayabaNerve> But then this has no value :P
17:59:05FromGitter<Quelklef> Thats... odd
17:59:12FromGitter<Quelklef> That feels like a bug tbh
17:59:27FromGitter<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:36FromGitter<kayabaNerve> TBH proc vars are basically function pointers
17:59:48FromGitter<Quelklef> woah slow down
18:00:24FromGitter<kayabaNerve> I will slow down but first I want to say I found a compiler crash
18:00:38FromGitter<Quelklef> uh oh
18:00:58FromGitter<kayabaNerve> https://gist.github.com/kayabaNerve/f60955b18b9aa01137195e88c6fa7cd0
18:01:00FromGitter<Quelklef> yeah i installed secp256k1 and compiling main is giving a gcc error
18:01:12FromGitter<kayabaNerve> Nim Compiler Version 0.18.1 [Windows: amd64] ⏎ Compiled at 2018-07-11
18:01:17FromGitter<Quelklef> `untyped` should only be used in macros
18:01:29FromGitter<Quelklef> iirc
18:01:31FromGitter<kayabaNerve> Got it. I'm not saying it should work. I'm saying the compiler crashed
18:01:36FromGitter<Quelklef> Ah yeah
18:02:16FromGitter<Quelklef> Compiling `PublicKey.nim` works for me...
18:02:19FromGitter<Quelklef> with the generic proc
18:03:06*krux02 quit (Quit: Leaving)
18:03:31FromGitter<kayabaNerve> What's your version?
18:03:38FromGitter<Quelklef> recompiled today
18:03:47FromGitter<kayabaNerve> And let me get a zip of your code instead of copy/pasting it
18:03:55FromGitter<Quelklef> It's the same as in the PR
18:03:57zacharycarterI'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:12zacharycarterdo components have any advantages? I don't see any lifecycle methods or anything like that
18:04:20FromGitter<Quelklef> although the other ones fail with a gcc error
18:04:39FromGitter<kayabaNerve> Yeah. I'm downloading from there.
18:04:42FromGitter<kayabaNerve> What other ones?
18:05:20FromGitter<Quelklef> e.g. `Address.nim`
18:05:23FromGitter<Quelklef> trying to figure it out
18:05:28FromGitter<kayabaNerve> Ah
18:05:32FromGitter<Quelklef> it's complaining that `BN/imath.h` doesn't exist
18:05:37FromGitter<Quelklef> but it do
18:06:08FromGitter<kayabaNerve> Lol. It's probably a path error.
18:06:22FromGitter<Quelklef> i mean the import is correct
18:06:22FromGitter<kayabaNerve> Because GCC is relative to the nimcache files in the build directory IIRC
18:06:28FromGitter<Quelklef> ah hold on
18:06:33zacharycarterthey don't think it be like it is but it do
18:06:39FromGitter<kayabaNerve> This is my issue with relative paths!
18:06:45FromGitter<Quelklef> compiling from src/ didn't fix it
18:06:46*jamesroseman joined #nim
18:06:51FromGitter<Quelklef> Wait
18:06:51FromGitter<kayabaNerve> Compile from the Git root
18:07:11FromGitter<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:25FromGitter<Quelklef> Yup, worked
18:07:26FromGitter<Quelklef> I see
18:07:40FromGitter<kayabaNerve> So ../ versus ~ isn't that big
18:07:48FromGitter<Quelklef> I still don't like that design
18:07:48FromGitter<kayabaNerve> Nor ../../ versus ~
18:07:53FromGitter<Quelklef> also `main.nim` compiles fine for me
18:07:57FromGitter<kayabaNerve> Great
18:08:22FromGitter<kayabaNerve> I just want a way to support project relative paths
18:08:45FromGitter<kayabaNerve> I did a quick edit based on compiler location because I compile from my project root and I know how to
18:08:54FromGitter<kayabaNerve> I don't know how to do what I'm suggesting
18:09:03FromGitter<kayabaNerve> I don't care if it's in a nim.cfg where the project path is
18:09:31FromGitter<kayabaNerve> But relative to the module and then the nimcache is iffy
18:09:59FromGitter<kayabaNerve> BN/imath becomes ../../src/lib/BN/imath.c
18:10:02zacharycarterAraq: 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:22zacharycarterI 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:43dom96zacharycarter: save a `bool` state somewhere called `initialised`, check it on each render.
18:37:23dom96https://news.ycombinator.com/item?id=17515492 :o
18:37:51mirandom96: heh, i waited for you to come online to send you the link :)
18:39:38miranPEP 572 has ruined python
18:40:44dom96That explains the fact that it was accepted despite the majority voting against it
18:41:57zacharycarterdom96: do you mean in the post render callback?
18:42:05dom96zacharycarter: no
18:42:08zacharycarterkind of ugly :/
18:42:28zacharycarteroh
18:43:04dom96proc render(component: Component): VDom = if not component.codeEditorInitialised: component.codeEditorInitialised = true; init()
18:43:17dom96https://forum.nim-lang.org/t/4035
18:44:22zacharycartergotcha, thank you
18:44:22*amosbird quit (Quit: ZNC 1.6.5 - http://znc.in)
18:44:29zacharycartervery 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:09FromGitter<kaushalmodi> Looks like the `bignum` library (nimble package) now breaks on devel
19:02:12FromGitter<kaushalmodi> > /home/kmodi/.nimble/pkgs/bignum-1.0.0/bignum/private/int.nim(415, 28) Error: undeclared identifier: 'stmt'
19:02:15FromGitter<kaushalmodi> Any hints?
19:02:21Yardanicouse "typed" or "untyped"
19:02:43Yardanicostmt was recently removed from devel (it was deprecated a long time ago)
19:03:02FromGitter<kaushalmodi> Yardanico: That was quick!
19:03:08*gangstacat quit (Ping timeout: 256 seconds)
19:03:19FromGitter<kaushalmodi> It was as if you were already expecting my question
19:03:22FromGitter<kaushalmodi> :)
19:03:56FromGitter<kaushalmodi> I am so new, that it's the first time I am seeing a `stmt` type :P
19:04:15Yardanicowell, I'm "new" too - when I started learning nim "stmt" was already deprecated :)
19:05:51FromGitter<kaushalmodi> Sadly that library doesn't seem to be maintained anymore: https://github.com/FedeOmoto/bignum
19:06:11FromGitter<kaushalmodi> No activity in last 3 years, OP is inactive for the last year at least
19:06:20FromGitter<kaushalmodi> s/OP/bignum dev
19:06:50Yardanico.you can fork it and change URL in nim-lang/packages
19:07:08FromGitter<kaushalmodi> I can fork it.. but I don't have experience/knowledge to lead that fork
19:07:19Yardanicowell, you can at least fix errors with devel
19:07:29YardanicoI hope there's not a lot of them
19:07:56FromGitter<kaushalmodi> I ended up on this error because of a toy snippet in my notes
19:08:12FromGitter<kaushalmodi> I reevaluate all code blocks in my notes about once a week or so
19:08:32FromGitter<kaushalmodi> So I am not a prime bignum user
19:08:57FromGitter<kaushalmodi> May be @mratsim can look into forking that? Don't know
19:09:14*Sembei joined #nim
19:09:22FromGitter<kaushalmodi> .. or have it become part of Nim std libs?
19:10:05def-nope
19:10:13FromGitter<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:36FromGitter<kayabaNerve> Can I yield an iterator?
19:11:47FromGitter<kayabaNerve> @kaushalmodi I use my own lib
19:11:53FromGitter<kayabaNerve> Well. My own wrapper
19:11:57FromGitter<kayabaNerve> It's of imath IIRC
19:12:41Yardanicohmm, 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:50FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/BN.nimhttps://github.com/kayabaNerve/Ember/tree/master/src/lib/BNhttps://github.com/creachadair/imath
19:13:00FromGitter<kayabaNerve> There's the Nim file, my copy of the C, and details of the lib;
19:13:09FromGitter<kayabaNerve> I've been meaning to Nimble-fy it
19:13:39*Trustable joined #nim
19:14:54FromGitter<kaushalmodi> It would be nice to have a Nim std lib support big nums
19:15:10FromGitter<kaushalmodi> I ended up needing it for a very simply toy snippet
19:15:43def-there's a bug for that already btw: https://github.com/nim-lang/Nim/issues/2725
19:15:59FromGitter<kaushalmodi> I know..
19:16:06FromGitter<kaushalmodi> I am the only person to "like" that
19:16:08FromGitter<kaushalmodi> :P
19:16:19FromGitter<kayabaNerve> Again.
19:16:45FromGitter<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:36FromGitter<kayabaNerve> TBH, I just like it because it's simple as hell
19:17:38FromGitter<kayabaNerve> Wraps easily
19:17:40FromGitter<kayabaNerve> Does what you need
19:17:41FromGitter<kayabaNerve> Etc
19:17:56Yardanico@kayabaNerve how many bits in numbers do you need?
19:17:59FromGitter<kayabaNerve> I think it supports negatives... but I may have disabled those in my wrapper or something
19:18:00FromGitter<kaushalmodi> I don't know what imath is.. I'll put it on my todo list
19:18:09FromGitter<kayabaNerve> https://github.com/creachadair/imath
19:18:13FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/BN.nim
19:18:18FromGitter<kaushalmodi> Yes.. I got that
19:18:27FromGitter<kaushalmodi> But I need to understand the API, etc.
19:18:28FromGitter<kayabaNerve> Just sending it again :P I'll stop now
19:18:35FromGitter<kaushalmodi> so putting it to my todo list
19:18:36FromGitter<kayabaNerve> Yardanico: Ethereum uses 256 bit private keys
19:18:41Yardanicowhat about https://github.com/status-im/nim-stint ?
19:18:44FromGitter<kayabaNerve> i use the same algo as Ethereum
19:18:47Yardanicoit's made for ethereum too
19:18:49FromGitter<kayabaNerve> That requires a compiler fork
19:18:58FromGitter<kayabaNerve> And you must declare the bit size in advance
19:19:10FromGitter<kayabaNerve> So if you only need 256 bit keys... yeah. That works.
19:19:20FromGitter<kayabaNerve> But the second you go to 257, it doesn't handle it for you.
19:19:32Yardanicobut why do you need 257 if ethereum uses 256?
19:19:35FromGitter<kayabaNerve> Actually, it might work on devel
19:19:41FromGitter<kayabaNerve> Because I'm not working with Ethereum
19:19:44FromGitter<kayabaNerve> Just the same algo
19:19:51FromGitter<kayabaNerve> And I actually use 32 int8s for that
19:20:03FromGitter<kayabaNerve> I'm using BNs for other stuff
19:20:50FromGitter<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:02FromGitter<kayabaNerve> So 1 BTC != 1. It's 100000000
19:21:07FromGitter<kayabaNerve> Ethereum is that with 16 zeros
19:21:16FromGitter<kayabaNerve> So you run out of space pretty quickly without BNs
19:21:35FromGitter<kayabaNerve> Oh. And hash operations
19:21:40FromGitter<kayabaNerve> Address encoding
19:22:54*Perkol quit (Quit: Leaving)
19:23:19shashlickhow do you detect unused imports?
19:23:43def-shashlick: try removing them, see if it still compiles and passes tests?
19:23:51FromGitter<kayabaNerve> if import == unused
19:23:52FromGitter<kaushalmodi> hehe
19:23:54FromGitter<kayabaNerve> IDE warnings
19:24:15shashlickhmm
19:24:17FromGitter<kaushalmodi> shashlick: +1 I wish Nim errored out on detecting unused import like Go
19:24:20shashlickhttps://github.com/nim-lang/Nim/issues/251
19:24:28Yardanicowhy error on unused imports?
19:24:38shashlicknot error, hint will help
19:24:46shashlickprobably speed up compile time
19:25:06FromGitter<kaushalmodi> Yardanico: Make people do the Right Thing
19:25:15FromGitter<kaushalmodi> Just as erroring out on tabs
19:25:26Yardanicothat will actually be bad for developers
19:25:40bozaloshtsherroring on unused imports is dumb, a warning suffices.
19:25:52Yardanicoe.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:00Yardanicoso you don't need to go back to the start of the file to add imports
19:26:05bozaloshtshduring development, I don't give a rats butt cheek whether I have unused imports, so please don't bother me about it.
19:26:06FromGitter<kaushalmodi> May be error on release builds
19:26:10Yardanicowhy tho?
19:26:15bozaloshtshkaushalmodi: that's reasonable
19:26:29FromGitter<kaushalmodi> why not have the releases as compact as possible?
19:26:46bozaloshtshwhatever it is, it should be configurable
19:26:49Yardanicohttps://github.com/nim-lang/Nim/issues/6134
19:26:50FromGitter<kaushalmodi> But all this discussion seems moot
19:27:51*lompik quit (Ping timeout: 240 seconds)
19:28:33Yardanicoif you want compact releases you would use "strip -s" and "opt: size"
19:29:26FromGitter<tim-st> is there a reason that strip is not the default in release mode?
19:29:43Yardanicowell, not all developers have "strip" installed probably :)
19:29:56FromGitter<tim-st> I think it's an option of gcc
19:30:07FromGitter<tim-st> at least it worked for me on windows sometime ago
19:30:14FromGitter<kaushalmodi> Yardanico: I didn't even know that strip is a separate thing to install
19:30:19FromGitter<kaushalmodi> .. going to my todo list
19:30:23FromGitter<tim-st> it's not afaik
19:30:27Yardanicowell it's not raelly
19:30:29Yardanico*really
19:30:34bozaloshtshYardanico: I think it's reasonable to assume people have binutils installed...
19:30:58FromGitter<kaushalmodi> OK, I have `strip` installed
19:31:04shashlickstrip is a separate tool
19:31:05FromGitter<tim-st> ah, it worked because I have mingw
19:31:40FromGitter<tim-st> but something like: if release mode and if found strip: then strip
19:32:20FromGitter<kaushalmodi> Looks like this would start going to my nimble tasks if Nim doesn't support it directly
19:32:40Yardanicodo you *really* need these kilobytes?
19:32:58YardanicoI mean yeah, sure, if you're compiling for an environment where ROM is limited
19:33:11FromGitter<kaushalmodi> I don't right now.. but I'll at least document it as a nimble task
19:33:17FromGitter<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:30FromGitter<tim-st> it stripped like 90% on hello world release bin
19:33:35FromGitter<kaushalmodi> When building `hugo`.. symbol stripping cuts down 30MB binary to 18MB
19:33:40Yardanicobut that's a hello world binary
19:33:41FromGitter<kaushalmodi> Go
19:34:10bozaloshtshThe necessity to strip binaries narrows with every passing day
19:34:12FromGitter<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:16shashlickokay manually verified every import - happy?
19:34:37FromGitter<tim-st> so strip by default would good
19:34:45FromGitter<tim-st> *be good
19:35:04Yardanicoby 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:05FromGitter<tim-st> dunno I never use those things which highly depend on sync
19:36:39FromGitter<tim-st> I have the feeling plain nim is often quicker than multiprocessed golang
19:37:01shashlickyardanico: perfect case for parallel
19:37:23FromGitter<tim-st> btw can nim easily be multiprocessed?
19:37:39Yardanicowith "parallel" and "spawn" probably, it depends on your code
19:37:45FromGitter<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:54FromGitter<data-man> gcc has ```-s``` switch: "Remove all symbol table and relocation information from the executable." ⏎ Is the strip running? ;-)
19:38:36FromGitter<kindlychung> I tried `a.innerText` but it gives an error.
19:38:46FromGitter<kindlychung> Error: unhandled exception: contains({xnText, xnComment, xnCData, xnEntity}, n.k) [AssertionError]
19:39:07FromGitter<kindlychung> Full script: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47ae5a66c1e833a9e25e3e]
19:40:11FromGitter<tim-st> @data-man yes, good to know, that should be default in release mode
19:40:21FromGitter<xDotDash> concepts are lovely but matching them is the bane of my existence
19:40:53FromGitter<Yardanico> what do you mean by that?
19:41:23FromGitter<xDotDash> It took me a full day to get one matched up with a concrete type
19:41:39FromGitter<Yardanico> well you can turn on hints for concepts
19:41:55FromGitter<xDotDash> Hadn't been working for me, for whatever reason
19:42:36dom96kindlychung: try a[0].innertext
19:42:42Yardanicowell you could've asked for help here, I don't understand how you wasted a full day :)
19:43:43FromGitter<xDotDash> Wanted to see if I could get it all figured out myself
19:44:02FromGitter<kindlychung> @dom96 that doesn't make a diff.
19:44:15Yardanicoshashlick, it seems that for some reason spawn/parallel both hang
19:44:33dom96kindlychung: check the kind of the node element you've got and its children
19:44:40dom96should help you figure out what's going on
19:44:41Yardanicowith the simple code https://gist.github.com/Yardanico/ff4d423d1a34e1b8b0ed052b61f95b99 (that's part of it, and ips is just a seq of strings)
19:46:02FromGitter<kindlychung> @dom96 they are all xnElement nodes
19:46:36dom96the children of `a`?
19:47:44shashlickyardanico: what's in scan()
19:48:13Yardanicoshashlick, a bit of text parsing (splitting ip:port in ip and port; and calls to a .so library)
19:48:19Yardanicobut this .so library supports multithreading
19:48:43shashlicktry eliminating calls to the lib and see if it works
19:49:33FromGitter<tim-st> I tried this example: https://nim-lang.org/docs/manual.html#parallel-spawn-parallel-statement
19:49:39Yardanicoshashlick, well yes it does work
19:49:41FromGitter<tim-st> this is not multiprocessed
19:49:46FromGitter<tim-st> is it possible in nim?
19:49:57Yardanico@tim-st ah, you meant multiprocessing
19:50:04Yardanicoi don't really know if it's possible
19:50:19FromGitter<tim-st> otherwise it's not needed to have multiple cpus...
19:50:28dom96Is what possible?
19:50:30Yardaniconim threads are real system threads
19:50:31dom96Parsing in parallel?
19:50:37Yardanicoso you can easily use all CPUs
19:50:57FromGitter<tim-st> so if I have 10 cpus nim uses all of them?
19:51:00FromGitter<kindlychung> @dom96 I did something like this: ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5b47b1239a612333aa5afc97]
19:51:07FromGitter<kindlychung> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47b12ac02eb83d7c6da2a7]
19:51:08FromGitter<tim-st> my tasmgr says only one is used at 100%
19:51:17Yardanico@tim-st if you use threads - depends on number of threads
19:51:21FromGitter<kindlychung> Some of the children are xnText
19:51:25Yardanicoone thread can't run on two CPU cores :)
19:51:27FromGitter<kindlychung> Some xnElement
19:51:53dom96kindlychung: so it must be something like <a href="..."><b>blah</b> foo</a>
19:52:06FromGitter<tim-st> yardanico: well I know how threads work, because of this I asked if multiprocessing works, multithreading is quite easy
19:52:21FromGitter<kindlychung> ok.
19:52:44FromGitter<kindlychung> Would be nice to have a .text method to recursively extract text.
19:52:46dom96kindlychung: it would indeed be nice to have a function that goes through such elements and returns a single string
19:52:46FromGitter<tim-st> tbh I didnt saw a multiprocessed nim program yet
19:53:00dom96kindlychung: great minds think alike :)
19:53:03Yardanicobut what are the advantages of multiprocessing over multithreading? :)
19:53:19FromGitter<kindlychung> :)
19:53:41FromGitter<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:57Yardanicobut why won't you use multithreading then? I don't understand
19:54:11FromGitter<tim-st> multithreading uses only one
19:54:15Yardanicowat
19:54:15dom96What even is multiprocessing?
19:54:34FromGitter<tim-st> multithreading = multiple threads in one process?
19:54:40dom96yes
19:54:50dom96Each thread can run on a separate CPU
19:54:54dom96(or CPU core)
19:55:00FromGitter<tim-st> multiprocessing = data of one master process is shared betwenn multiple process
19:55:04FromGitter<tim-st> that all run at 100%
19:55:07FromGitter<tim-st> on different cpus
19:55:28FromGitter<tim-st> that's a giant difference
19:55:30dom96Multiprocessing sounds like a term for parsing data in parallel
19:55:53dom96Multiprocessing can be implemented using threads
19:55:57FromGitter<tim-st> not only, it's also good for server tasks
19:56:07FromGitter<tim-st> yes, it can
19:56:14FromGitter<tim-st> but the hard task is sync these
19:56:22FromGitter<tim-st> python does via TCP socket
19:56:29FromGitter<tim-st> that's obviously very bad
19:56:44FromGitter<tim-st> I hoped nim can sync via shared ram
19:56:45YardanicoPython doesn't support real multithreading (on different CPUs), that's true
19:56:46dom96Indeed, there is no library that does it for you in Nim
19:56:56dom96So you need to handle this yourself
19:56:57FromGitter<tim-st> ok, that's not good
19:56:59dom96But it's not that hard
19:57:13dom96Chapter 6 of Nim in Action describes exactly how to do it
19:57:26FromGitter<tim-st> how is data shared?
19:57:34FromGitter<tim-st> between multiple processes?
19:57:39FromGitter<tim-st> ram or tcp
19:57:57dom96ram
19:57:58dom96https://github.com/dom96/nim-in-action-code/blob/master/Chapter6/WikipediaStats/parallel_counts.nim
19:58:16FromGitter<tim-st> that sounds good, this is needed for stdlib
19:59:00Yardanicodom96, that's one process though, no?
19:59:04Yardanicoand multiple threads
19:59:08FromGitter<tim-st> yes, I think so too
19:59:16shashlickyou can use a variety of ipc methods
19:59:21dom96yes
19:59:22FromGitter<tim-st> multiprocessing = process1.exe, process2.exe,...
19:59:32FromGitter<tim-st> gcc does it like cc1.exe, cc2.exe,..
19:59:35dom96You don't need multiple processes
19:59:44dom96Python does because it sucks :P
19:59:47FromGitter<tim-st> I need, otherwise I cant use my cpu power
19:59:49shashlicki think that's an artifact of Python's GIL
19:59:53FromGitter<tim-st> yes
19:59:54dom96You don't
19:59:58dom96Not in Nim
20:00:02FromGitter<tim-st> ?
20:00:07shashlickyou can saturate your CPU(s) with just one Nim process
20:00:18FromGitter<tim-st> how?
20:00:19shashlicki've done it before with multiple threads
20:00:25dom96By using multiple threads
20:00:31shashlickeach thread runs in a separate CPU core
20:00:43FromGitter<tim-st> is there a proof?
20:00:46shashlicka Python thread is actually running on the same core to my knowledge
20:00:51FromGitter<tim-st> yes
20:01:03Yardanico@tim-st all normal languages can run on multiple CPUs
20:01:06Yardanicousing real system threads
20:01:12shashlicksorry, every Python thread in a given process runs on the same core
20:01:22Yardanicoand yeah, python can't because it has GIL
20:01:32shashlicki believe that's what Nim does @tim-st
20:01:44Yardaniconim doesn't have GIL so you can just use 10 threads if you have 10 cpu cores
20:01:45shashlickwe don't have coroutines, green threads or whatever
20:01:47Yardanico(or more threads)
20:02:01FromGitter<tim-st> shashlick: you mean nim is like python?
20:02:10FromGitter<tim-st> I think go can do it
20:02:17Yardanico@tim-st are you trolling or what? :D
20:02:39Yardanicoa separate thread in Nim program doesn't need to run on the same CPU core as main thread
20:03:01shashlickno Nim is not like Python
20:03:07skrylarshashlick, we do have coroutines! of the bullshit kind
20:03:19skrylarthats what continuation iterators and async do
20:03:34skrylarits similar to the ienumerable abuse in c#
20:03:38shashlickPython has no real multi-threading, there's a GIL that prevents more than one thread running at a time
20:03:59FromGitter<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:10shashlickthat's why you have to multiprocess and use more cores
20:04:11skrylarthere is always erlang/elixir/beamvm.. i hear those are quite good at parallel things :3
20:04:12FromGitter<tim-st> it uses less equal 25% cpu
20:04:16FromGitter<tim-st> I have 4 cores
20:04:20dom96Try this: https://gist.github.com/dom96/34bf9d814438ebb84f0c0a316eed0d3f
20:04:42skrylarhum. i actually do have code which uses spawn (but not parallel) and it maxes out my hexcore
20:04:44dom96Compile with --threads:on
20:04:49shashlickskrylar: i've used spawn and async so far, not continuation iterators
20:05:44FromGitter<tim-st> @dom96 thanks, it works!
20:06:10Yardanico@tim-st this program is too small to run for a considerable amount of time
20:06:15FromGitter<tim-st> I need to have a deeper look into, what allows going at 100%
20:06:36FromGitter<tim-st> Yardanico: no, I increased the number by a few zeros
20:06:40Yardanicomake it "1000000"
20:06:43shashlickalso, threads are isolated, cannot share data, which is a pain but you avoid locking and related
20:06:45FromGitter<tim-st> it runs more than a minute
20:07:03FromGitter<tim-st> no sharing of data?
20:07:19Yardanicoyes, GC'd memory is thread-local
20:07:31Yardanicoyou can use raw pointers and guards, locks
20:07:39shashlickso if you want to exchange data, you'd use channels
20:07:48FromGitter<tim-st> so, I can only use parallelism in cases where sharing data isnt needed?
20:07:54Yardanicoor channels, yeah, but I heard that channels are inefficient
20:08:17shashlickyou can use ipc right
20:08:21shashlicknanomsg, etc.
20:09:00FromGitter<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:07skrylari did this but it was with beanstalkd and not nanomsg
20:09:18dom96You should look at httpbeast, it's parallel
20:09:28skrylarpartly because the worker process sometimes died for mysterious reasons and shunting the job list outside of nim protected it
20:09:41FromGitter<tim-st> @dom96 does jester is 100% parallel too?
20:09:49Yardanicoit's async
20:09:51skrylarisn't jester just a routing middleware?
20:10:09dom96yes, it's parallel now
20:10:18Yardanicodom96, wait, it can use multiple cpu's now?
20:10:18dom96because it depends on httpbeast
20:10:22dom96yes
20:10:33FromGitter<tim-st> ok, very good to know, that's perfect for my system
20:11:05skrylarand with the power of that easing library you can have nim-js animation thingerdoos
20:11:24FromGitter<tim-st> lol, I dont use js, it's complete backend
20:12:24skrylarwell it will waste cpu cycles on the backend if you ask it to :E
20:14:54FromGitter<Vindaar> (https://files.gitter.im/nim-lang/Nim/dCXo/multithreading.png)
20:15:00FromGitter<Vindaar> @tim-st ^ :)
20:15:39FromGitter<Vindaar> just needed to find a proper screenshot tool, haha :D
20:16:01FromGitter<tim-st> I dont see it there
20:16:07skrylarmake a clone of the old screensteps in nim :o
20:16:28dom96Vindaar: 🔥🔥🔥🔥
20:17:31FromGitter<kindlychung> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47b75b66c1e833a9e27c28]
20:17:46FromGitter<kindlychung> seems to solve the problem.
20:19:00FromGitter<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:24FromGitter<tim-st> @dom96 just had a look at httpbeast https://github.com/dom96/httpbeast/blob/master/src/httpbeast/parser.nim
20:24:50FromGitter<tim-st> I think checking data.len is needed when zero byte is not avaialble?
20:25:24dom96yes, likely
20:25:46dom96I focused on speed 100% for this project
20:25:52FromGitter<tim-st> or try except for speed
20:25:53dom96These kinds of fixes can come later
20:26:09dom96try except is the slowest thing you can use
20:26:22FromGitter<tim-st> I think it's only slow on failure
20:26:22FromGitter<kayabaNerve> Really?
20:26:27FromGitter<tim-st> and no loss if not
20:26:41dom96yes, really
20:26:53dom96For the C++ backend perhaps, but not the C backend
20:27:10FromGitter<tim-st> so it uses setjmp, longjmp always?
20:27:14FromGitter<tim-st> also if not raised?
20:27:24dom96I'm not familiar with the details
20:27:31FromGitter<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:35dom96But I'm 99% it's not zero cost for the C backend
20:27:49FromGitter<tim-st> ok
20:28:06dom96kayabaNerve: Either Option[T] or `var T` param and return `bool`
20:28:21dom96or just use an exception
20:29:59stefanos82dom96, 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:04stefanos82dom96: will it work with this one?
20:30:19dom96should do
20:30:23stefanos82cheers
20:30:34FromGitter<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:35FromGitter<kayabaNerve> I
20:30:55FromGitter<kayabaNerve> *I check myself. Gitter mobile mangles messages damn it
20:33:23FromGitter<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:44FromGitter<rayman22201> C++ uses well, C++ exceptions lol
20:34:14FromGitter<tim-st> ok, thank you! I think I remove exception where possible and replace by explicit error and likely templates
20:34:32FromGitter<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:34FromGitter<kayabaNerve> My code got 9% speed ups when I tried C++
20:34:47FromGitter<kayabaNerve> I'm going to do another test in a bit
20:35:04FromGitter<kayabaNerve> Is there a line for a cfg to force c+(?
20:35:16FromGitter<kayabaNerve> Or do people have to use Nim cpp?
20:35:20FromGitter<tim-st> is there code I can only compile with a c compiler and not with c++ compiler?
20:35:25FromGitter<tim-st> *nim code
20:35:26FromGitter<kayabaNerve> Yes
20:35:30FromGitter<kayabaNerve> Probably not
20:35:36*Jesin joined #nim
20:35:44FromGitter<kaushalmodi> @kayabaNerve One style I have seen is to have a proc signature like `proc foo(inp: int; var ret: Object): bool =`
20:35:50FromGitter<kayabaNerve> If there is, it's a bug (AFAIK)
20:36:08FromGitter<tim-st> ok, good to know, so I can test in the end which is better :)
20:36:10FromGitter<kayabaNerve> C does that a lot
20:36:26FromGitter<kaushalmodi> `foo` is then used as `if foo(in, out):` ..
20:36:27FromGitter<kaushalmodi> OK
20:36:46FromGitter<data-man> @kayabaNerve there is nim-result (WIP) https://github.com/arnetheduck/nim-result/pull/1
20:37:03FromGitter<kayabaNerve> Thanks for the uses
20:37:06FromGitter<kayabaNerve> *idea
20:37:30*Vladar quit (Quit: Leaving)
20:37:58CodeVancehow to reset a set
20:38:23FromGitter<kayabaNerve> That's smart
20:39:00FromGitter<Quelklef> @CodeVance `x = {}`?
20:39:03FromGitter<tim-st> it seems c++ exception are only zero cost if it doesnt happen, and if it is very expensive
20:39:19FromGitter<tim-st> this isnt directly better than the c model
20:39:49CodeVance@quelklef thanks
20:39:51Araqit is tremendously better because the C model introduces pervasive 'if' statements everywhere
20:40:32FromGitter<tim-st> ok^^ just read a few lines here: https://mortoray.com/2013/09/12/the-true-cost-of-zero-cost-exceptions/
20:40:50Araqmortoray is full of bullshit
20:41:01FromGitter<tim-st> hahaha ok^^
20:43:20*krux02_ joined #nim
20:44:10krux02_how do I get the directory of a nimscript file.
20:44:13*yglukhov[i] quit (Remote host closed the connection)
20:44:19zacharycarterdom96: I was trying to apply your suggestion, looking at the nimforum code, but I don't think it will work
20:44:32zacharycarterI need to intiailize the component after the DOM has already been created from the VDOM
20:44:39zacharycarterand render isn't called again unless the VDOM changes right?
20:44:57zacharycarterit's trying to keep the intialization logic encapsulated within the component but being able to execute it after the DOM is created
20:45:06zacharycarterand not having to do it all in the post callback
20:45:10krux02_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:17zacharycarter*post render callback - but I guess i may end up having to do it that way
20:45:19krux02_this means symbolic links should be resolved
20:45:28shashlickLooking at working on the next nimgen based wrapper, any votes for a good candidate?
20:45:33dom96zacharycarter: 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:57zacharycarteryeah
20:46:05zacharycarterI really don't want to do that because dom rendering times can vary
20:46:19zacharycarterI really think karax could use some kind of lifecycle event system you could hook into
20:46:35zacharycarterso once the dom is established - you can do things with it
20:46:47zacharycarterfor now I'm going to do the global post render callback thing
20:47:08*Lord_Nightmare quit (Ping timeout: 244 seconds)
20:48:06zacharycarterother than that I'm loving karax - like I'd use this any day over react at work
20:48:13zacharycarterthe new nim playground is going to be baller
20:48:22ldleworkis there a karax tutorial
20:48:24FromGitter<tim-st> krux02: isnt `getCurrentDir` available?
20:48:29FromGitter<tim-st> https://github.com/nim-lang/Nim/blob/devel/compiler/scriptconfig.nim
20:48:41krux02tim-st: I never wrote nimscript
20:48:41Araqzacharycarter: karax is pretty hackable, consider creating a PR
20:48:43krux02only macros
20:48:50zacharycarterAraq - I will
20:48:54krux02I don't know where to look for functions
20:49:04Araqthat adds an afterFirstRender callback
20:49:19zacharycarteryeah - that would be very useful - I'll look into that tonight - I'm about to leave work now
20:49:21FromGitter<tim-st> krux02: you can implement every single nim stdlib proc exactly how it's shown in this file
20:49:36FromGitter<tim-st> this will allow nealy 100% pure nim interpretion
20:49:43FromGitter<tim-st> and would skip all compile times
20:51:03krux02tim-st: getCurrentDir returns the working directory that is exactly what I don't need
20:51:16krux02because paths are automatically relative to the working directory
20:51:40FromGitter<tim-st> when it's available in nim you can in worst case implement the proc like shown in the file
20:52:33FromGitter<tim-st> maybe `thisDir`
20:52:46krux02getAppFilename is what I was looking for
20:52:49krux02I found it
20:53:33FromGitter<tim-st> seems mapped to `selfExe`
20:54:15Araqldlework: https://github.com/pragmagic/karax the readme contains a short tutorial
20:54:27Araqand I blogged about it too: https://nim-lang.org/araq/karax.html
20:54:51Araqunfortunately the Ormin thing never was finished to my liking
20:55:49Araqand of course we have to boring todo app, https://github.com/pragmagic/karax/blob/master/examples/todoapp/todoapp.nim
20:55:59Araq*we have the
20:57:12Araqand 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:58krux02I never used arguments to a program in nim, how do I forward arguments to a subprocess in nimscript?
21:07:36CodeVanceos.argv gets the arguments
21:07:54CodeVancethen call the subprocess with the arguments
21:08:28CodeVancewht tye of subprocess?
21:09:35Araqhuh? forward arguments? os.paramStr(i)
21:09:55krux02Araq: I am doing what you suggested
21:10:03Araqbut are you sure you want to write this in nimscript?
21:10:03krux02port nim-gdb run script to nim-script
21:10:18krux02and the arguments to nim-gdb need to be forwarded to gdb
21:10:26AraqI suggested to write a Nim program.
21:10:53Araqin fact, I would just patch 'koch' to support 'koch gdb'
21:11:14*rockcavera quit (Ping timeout: 260 seconds)
21:11:46krux02a nim program just to forward a single argument to gdb that loads the pretty printer module?
21:12:32Araqin fact, I would just patch 'koch' to support 'koch gdb'
21:12:49krux02and koch gdb builds nim-gdb?
21:13:40krux02honestly 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:08Araqit doesn't build nim-gdb, it *is* nim-gdb
21:18:04krux02but koch is not on the path it is the local build system for the nim compiler
21:18:43krux02nim-gdb should not just be the debugger for the nim compiler, but for all nim programs
21:18:51Araqif it's not on the path, make it on the path. nim-gdb is not on the path either.
21:19:13krux02well it is in the bin directory, so it is on (my) path
21:19:28stefanos82off-topic: lol, no more BDFL for Python!
21:19:36stefanos82https://mail.python.org/pipermail/python-committers/2018-July/005664.html
21:20:11stefanos82I have a feeling this will be a very bumpy summer for some!
21:21:33*xet7 joined #nim
21:22:20krux02what is BDFL?
21:22:58Araqstefanos82: gah, this := is terrible :-(
21:23:03Yardanicokrux02, benevolent dictator for life
21:23:21Araqand it made Guido abandon his BDFL status? interesting
21:23:24stefanos82Araq: who am I to judge though :/
21:23:51YardanicoAraq, this PEP did :(
21:23:55stefanos82Araq: imagine how much pressure they put on Guido to make him say "enough is enough!"
21:23:56YardanicoPEP 572
21:24:03krux02Araq: nim-gdb is the file that can be put on the path, so that starting the debugger with nim support gets easy.
21:24:11krux02just replace gdb with nim-gdb and done
21:24:39krux02alternatively one can always source the nim-gdb.py module munually from the gdb command interpreter
21:24:52dom96Araq: Note that he wanted this change
21:24:56dom96and the community didn't
21:25:01dom96or rather, the other core devs
21:25:09*noonien quit (Quit: Connection closed for inactivity)
21:25:20krux02I have no idea what was going on there.
21:25:41Yardanicodom96, wait really?
21:25:45Yardanicoguido wanted this PEP?
21:25:53dom96yes
21:26:00Yardanicolol
21:26:09FromGitter<kaushalmodi> I see him as the author.. so he should have proposed it, right?
21:26:14FromGitter<kaushalmodi> the PEP
21:26:20dom96https://lwn.net/Articles/757713/
21:26:30dom96This goes into more detail about this PEP
21:27:27dom96The way Nim handles this is superior IMO
21:27:45dom96if x = 1: # error
21:27:54dom96if (let x = 1; x == 1): # Perfectly clear
21:28:36YardanicoI hope Araq won't end (as BDFL) as Guido van Rossum did :/
21:30:49FromGitter<Varriount> dom96: I dislike the added mental overhead.
21:31:16krux02dom96: python really misses the let/var keyword
21:32:49dom96actually hrm
21:33:09dom96The Python `:=` also injects the var into the scope of the if/while/etc statement
21:35:20dom96!eval if (let x = 5; x == 5): echo x
21:35:21FromGitter<kaushalmodi> The new Python `:=` is like `if-let*` in Lisps.. the latter which I like:
21:35:22NimBot5
21:35:25dom96:D
21:35:29FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b47c9a0897d514b3c48c7e2]
21:35:46dom96Nice to see Araq considered this
21:36:28Araqif regex() as x
21:36:40Araqwould have been the Pythonic solution for Python.
21:36:54AraqI don't understand how := ever made it into an accepted PEP.
21:37:26Araqno wonder he got letter bombs because of this proposal.
21:37:58dom96Yeah, a keyword solution is the Pythonic solution
21:39:01stefanos82Araq: 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:04stefanos82..please?
21:40:25FromGitter<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:49dom96Hope this doesn't backfire: https://twitter.com/nim_lang/status/1017524154348855296
21:41:53Yardanicodom96, :P
21:41:58CodeVanceIn nim you can test all of the different syntax
21:42:02FromGitter<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:06Yardanicoimagine if this will become a popular tweet :)
21:42:10FromGitter<metasyn> Oh interesting
21:42:10stefanos82dom96: "I set fire...to the rain..."
21:42:13Araqdom96: lol
21:42:22Araqstefanos82: don't you worry about that.
21:42:28Araqbut thank you :-)
21:42:36FromGitter<metasyn> @dom96 how do you do that styling of the window image?
21:42:42CodeVancedom96: the answer to life?
21:42:43Yardanico@metasyn that's a special app
21:42:49dom96CodeVance: http://carbon.now.sh/
21:42:51FromGitter<metasyn> looks cool
21:43:09Araqa little bit more support in my desire to remove features would be nice though.
21:43:23stefanos82dom96: 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:24YardanicoAraq, what features?
21:43:28FromGitter<kaushalmodi> @dom96 Do you use `carbon-now-cli` for such code pics?
21:43:30Araq'defer'.
21:43:33FromGitter<kaushalmodi> I just read about it recently
21:43:39dom96kaushalmodi: nope
21:43:44stefanos82Araq: remove or replace with better idea(s)?
21:43:44dom96Let me guess, it's a node CLI?
21:43:46Yardanicowell, I don't use it so I don't care :P
21:44:00Araqif we all want a small language, removing features helps in this goal
21:44:01FromGitter<kaushalmodi> .. yes
21:44:02dom96Of course it is
21:44:11Araqstefanos82: we're getting destructors instead
21:44:27stefanos82Araq: why destructors should be used explicitly though?
21:44:34Yardanicothey shouldn't, no?
21:44:38dom96Don't worry, I'll be writing an RFC for some removals soon
21:44:43FromGitter<kaushalmodi> dom96: Because it looks so similar: https://github.com/mixn/carbon-now-cli#basic
21:44:44miranAraq: you have my support for removing defer, it that means anything to anybody.....
21:44:50FromGitter<kaushalmodi> so how did you create that? :)
21:45:11stefanos82even the name will confuse some
21:45:12*brainpro1 joined #nim
21:45:16stefanos82are there any constructors?
21:45:17*brainproxy quit (Read error: Connection reset by peer)
21:45:20stefanos82they will start comparing it to C++
21:45:43stefanos82instead of calling it destructor, call it eliminator
21:46:33stefanos82Araq: elim(objName) or eliminate(objName)
21:47:12stefanos82also, you don't like defer. you don't like how it's named or how it's implemented?
21:47:18Yardanicobut I heard that new destructors will be able to called implicitly?
21:47:37Yardanicoso you don't need to write destroy(myobj) everywhere (well, maybe only for optimizations), no?
21:47:41dom96Why not call it the Terminator instead? :P
21:48:04stefanos82because there's a chance that it'll come back!
21:48:05dom96Yardanico: That's literally the whole point of destructors
21:48:11FromGitter<rayman22201> Nim: "Come with me if you want your code to live" lol
21:49:56Yardanicofor me syntax in PEP 572 feels non-pythonic, really
21:49:57stefanos82dom96: if we add destructors and let them be in use behind the scenes, then no worries
21:50:03stefanos82I'm more than happy to see them in use
21:50:09stefanos82but to exclusively use them...
21:50:43stefanos82personally I never used Foo::~Foo() with C++ ever before
21:51:01stefanos82I mean to direct call it
21:51:21*miran quit (Ping timeout: 240 seconds)
21:53:47stefanos82Araq: 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:51Araqstefanos82, it's terrible. :-)
22:00:16stefanos82I know, but see it from the code emission's perspective
22:00:21stefanos82less headaches IMHO
22:00:38Araq"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:42Araqdone.
22:01:02Araqalternatively pass a hidden TLS parameter to every function
22:01:40Araqsame holds for exceptions, map it to 'if' statements if you don't have OS support or cannot "afford" the compressed exception tables
22:02:20stefanos82you sure know more than 2 lifetimes of mine
22:02:25Araqyou don't have to butcher the language, you can embrace the idea that you are using a compiler.
22:02:27stefanos82therefore I will trust you with your statements
22:02:51stefanos82you mean the C++ committee?
22:03:51Araqwell the author is Ben Craig, he lists the "alternatives" but misses my suggestions
22:04:24stefanos82well, you could email him your suggestions.
22:04:50Araqfair, I'll do it.
22:05:20stefanos82very nice. now, back to destructor discussion
22:05:42stefanos82how about adding destructor's mechanism as part of object's creation?
22:06:01stefanos82then you could call it explicitly if you want it to get destroyed
22:06:11Araqhow about you read my "spec" first
22:06:29stefanos82I read it, but my brain-cells are fried already -_-
22:06:43stefanos82you mentioned it and didn't see it?
22:06:45stefanos82I don't remember
22:06:54stefanos82I'm getting older -_- :S
22:12:36FromGitter<kayabaNerve> I love :=
22:12:52FromGitter<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:02FromGitter<kayabaNerve> *ago? I go on/off Gitter...
22:13:20FromGitter<kayabaNerve> But it's absolute, not accidental, and allows better iterating.
22:13:51FromGitter<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:13FromGitter<kayabaNerve> I do wish we had do while though
22:14:22Araqstefanos82, I don't understand your sentence and need to work, sorry.
22:14:30FromGitter<kayabaNerve> Or "loop and a half"
22:15:35FromGitter<kayabaNerve> The use cases have overlap but they are the same
22:15:49stefanos82Araq: I read your RFC, but I don't remember it exactly how it should behave. I will read it again.
22:16:29FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/commit/7349eae507eb5630c51688618ad598109960b61e
22:17:42FromGitter<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:05FromGitter<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:47CodeVanceis there a way to set float32 as the default float
22:22:32FromGitter<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:14FromGitter<kayabaNerve> Compile for a 32 bit target?
22:23:20FromGitter<kayabaNerve> Not even joking tbh.
22:30:13FromDiscord<exelotl> just wrapped some functions from the sunvox dll and got one of my songs playing in about 10 minutes
22:30:37FromDiscord<exelotl> (after reading some pages from the nim book to clear things up)
22:30:45FromDiscord<exelotl> this language is so amazing
22:31:16CodeVancesunvox nive
22:31:17CodeVancenive
22:31:18CodeVancenice
22:31:35*Jesin quit (Ping timeout: 240 seconds)
22:32:20krux02exelotl: what is your background?
22:32:57krux02Araq: I made some changes to nim-gdb, but in general I kept it is a shell script
22:33:16krux02it just runs gdb with arguments prepended
22:33:27*Jesin joined #nim
22:33:50krux02I don't want that script to be a dependency on koch or similar.
22:34:19krux02the shell script isn't very useful for windows
22:34:41krux02at least I think it isn't. I don't know how usable the linux shell for windows is.
22:35:30FromGitter<kayabaNerve> Amazingly usable for what it is
22:35:44krux02I 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:49FromGitter<kayabaNerve> It's no full replacement but if you don't want to reboot or use all your resources in a VM?
22:36:07FromGitter<kayabaNerve> I used it on a laptop for a year before I setup a Lubuntu VM on the side
22:36:19krux02the only thing that I would like to have is that the gdb test run is invoked automatically by the integration test
22:36:32krux02I wrote the test as a shell script
22:37:11*jamesroseman quit (Ping timeout: 244 seconds)
22:39:04FromGitter<data-man> @krux02 what for Windows users? bash & sh must be installed?
22:39:27krux02well I don't know how much gdb is used on windows in the first place
22:40:21krux02but `source <X:path\to\nim-gdb.py>` should work the equally well
22:40:29krux02I just don't have windows
22:40:40FromGitter<Varriount> @dom96 What time zone do the IRC logs use?
22:40:52krux02putting that command on the startup of gdb is all the shell script does
22:41:13krux02so whoever is able to write bat files can port that script to windows as well.
22:42:46FromGitter<kaushalmodi> @data-man Hello! Are you working on the rst grid table support? https://github.com/nim-lang/Nim/issues/6429
22:43:33krux02Varriount: what time is it in the IRC logs?
22:43:56FromGitter<data-man> @kaushalmodi No.
22:45:29FromGitter<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:08FromGitter<Varriount> krux02: Ah, looks like the logs use UTC
22:47:22*Lord_Nightmare joined #nim
22:50:25FromDiscord<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:53FromDiscord<exelotl> here's my site if you're interested :) https://exelo.tl/
22:50:54krux02ooc? never heard about that
22:51:26FromDiscord<exelotl> https://ooc-lang.org/
22:51:29krux02I see some high quality game art
22:53:30FromDiscord<exelotl> haha I can't tell if you're joking; some of my art is okay I guess xD
22:53:34krux02exelotl: I see map and I see method calls without dot
22:54:07FromGitter<Quelklef> I see `|x| body` :(
22:54:48krux02exelotl: This is a picture that instantly gets my attention https://exelo.tl/cards/museum-city-boat.png
22:55:23FromDiscord<exelotl> lolol
22:55:25FromGitter<kayabaNerve> Last 2015?
22:57:33FromGitter<kayabaNerve> When was Nim first publicized/usable/Turing complete/had a release?
22:57:39FromGitter<kayabaNerve> I guess the last is best
22:58:38*BitPuffin quit (Remote host closed the connection)
22:59:40FromGitter<kayabaNerve> Also, does Nim confirm to a certain c variant?
22:59:51FromGitter<kayabaNerve> Or is just 'C'?
23:01:57krux02what do you mean with confirm?
23:03:26krux02well 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:38FromGitter<kayabaNerve> krux02: conform
23:12:54FromGitter<kayabaNerve> Sorry. Is all Nim guaranteed to be C99 or what?
23:14:30stefanos82krux02 left
23:14:56FromGitter<kayabaNerve> Yeah. I saw.
23:31:59stefanos82@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:22stefanos82if you open your nimcache/<file>.json, you can see that it's using "gcc ..."
23:33:12stefanos82it does not say anything about -std=c99 or -std=gnu99
23:33:20FromGitter<Varriount> Anyone want to take a crack at reviewing https://github.com/nim-lang/Nim/pull/8260/files ?
23:33:27FromGitter<Varriount> Specifically fuzzymatch.nim
23:33:53stefanos82@kayabaNerve: which means, if your GCC is version 7.x.x it defaults to gnu11
23:34:36FromGitter<kayabaNerve> stefanos82: But it could output C99 and force -std=c99
23:34:58stefanos82if you force it, yes
23:35:09stefanos82but the default Nim chooses it's plain gcc
23:35:23stefanos82check your .json file to see what I mean
23:35:50FromGitter<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:55FromGitter<kayabaNerve> As intended
23:38:30stefanos82use --passC:"-std=c99"
23:38:35stefanos82I think that's the code
23:38:50stefanos82let me check it myself and let you know
23:40:26stefanos82hmm, it throws an error and complains about assembly code
23:40:37stefanos82Araq: is this behavior normal or should it get reported as an issue?
23:41:59stefanos82ah I was using the wrong flag
23:42:03stefanos82false alarm Araq
23:42:30stefanos82kayabaNerve: replace "-std=c99" with "-std=gnu99" and it should work
23:42:46stefanos82even with gnu89 should compile as expected
23:43:24stefanos82I guess the use of asm behind the scenes needs GCC's extensions to compile successfully
23:45:20FromGitter<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:36AraqNim targets the C that Visual C++ understands. that's pretty much C89
23:45:37FromGitter<kayabaNerve> Maybe it's C99 on Windows and GNU99 on Linux?
23:45:44FromGitter<kayabaNerve> Got it
23:45:51FromGitter<kayabaNerve> So it depends on whatever compiler it's working with?
23:46:03Araqand C99 is not a language standard for me. ;-)
23:46:10FromGitter<kayabaNerve> Because?
23:46:23Araqbecause it's a crime.
23:46:31CodeVanceToo much undefined behaviour
23:46:47CodeVanceis what araq said
23:47:11Araqit adds stuff nobody asked for and yet STILL lacks artihmetic ops that can tell you if an overflow happened.
23:47:43FromGitter<kayabaNerve> It was adopted by both ANSI and ISO
23:47:46Araqand is deliberately made incompatible with C++, with its own shitty idea of how to implement overloading
23:47:54FromGitter<kayabaNerve> i think the real crime is making a 2011/2017 C standard
23:48:18stefanos82Araq: I can hear some ancient C geeks shouting from their caves: BLASPHEMY! BURN THE WITCH!
23:48:49Araqthey should just adopt C++. at least C++ is improving and its problems are recognized and worked on
23:48:57FromGitter<kayabaNerve> Also, I use C99 and know it just because it's the most recent before some idiot made 11/17 versions
23:49:00stefanos82Araq: agreed
23:49:02FromGitter<kayabaNerve> Also has the best support with the internet
23:49:16stefanos82C17 it's just bug fixes, nothing new
23:49:31FromGitter<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:44stefanos82I haven't touched C++ for nearly 6 months now and feel homesick LOL!
23:52:49FromGitter<kayabaNerve> Also, pretty sure I can write C89 that isn't valid C++ Araq
23:53:18Araqyes, and that's called "bad C" code.
23:53:23FromGitter<kayabaNerve> C doesn't require function definitions IIRC. int main(){a();} void a(){return;}
23:53:26FromGitter<kayabaNerve> That should compile
23:53:42FromGitter<kayabaNerve> C++ requires me to define void() a;
23:53:48FromGitter<kayabaNerve> or void a();
23:53:49FromGitter<kayabaNerve> Sorry
23:54:04stefanos82did you mean function prototype?
23:54:09Araqyeah C is bad design that turned into a religion, so it's unfixable. Exactly like Unix.
23:54:26FromGitter<kayabaNerve> So why the hell did we get a 2011 version lol
23:54:31FromGitter<kayabaNerve> Not asking you
23:54:37FromGitter<kayabaNerve> Asking the idiots who made/ratified C11
23:54:40stefanos82vendors need it
23:54:42stefanos82$$$
23:55:33AraqC11 added a threading model incompatible with Posix's :D
23:55:56Araqthey just added some random stuff nobody ever could try out first.
23:55:58stefanos82if I'm not mistaken, it's using it behind the scenes
23:56:06stefanos82I have seen it somewhere in their header files
23:56:18stefanos82like _Generic?
23:56:26Araqsure, but what's the point? just adopt Posix's API
23:56:35stefanos82yep, my thoughts exactly
23:57:27stefanos82I'm really disappointed by the whole programming community to be honest with you Araq
23:58:14stefanos82I 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:41Araqyeah... people could at least read some scientific studies about the effectiveness of using a mouse and a keyboard... :P
23:59:12Araqhint: not using a mouse makes you more unproductive, but makes you feel more productive.
23:59:28stefanos82I use my mouse where is necessary