<< 08-11-2017 >>

00:05:27*sz0 quit (Quit: Connection closed for inactivity)
00:16:25shashlicknimgen <= c2nim helper - https://github.com/genotrance/nimgen
00:16:26shashlickreviews, feedback appreciated
00:27:54*xkapastel joined #nim
00:29:04*yglukhov joined #nim
00:33:19*yglukhov quit (Ping timeout: 250 seconds)
00:34:12federico3shashlick: an example input and output at the top of the README could help
00:35:40shashlickfederico3: thanks, I'm trying to get the openssl wrapper on github as well since it serves as a good example
00:36:14shashlickas such, the tool isn't useful for anything c2nim supports out of the box
00:41:53*JappleAck quit (Quit: Leaving)
00:43:33*FromGitter quit (Remote host closed the connection)
00:43:41*FromGitter joined #nim
00:50:03FromGitter<data-man> @shashlick: Thanks! ⏎ And why not replace a Regex on PEG or scanf? Say "no dependencies!" 
01:00:37shashlickdata-man: I'm yet to figure out how PEG works  but ya
01:03:19*yglukhov joined #nim
01:04:35shashlicki'll post a binary version with pcre compiled in for the near term, I presume you're talking about Windows for no deps?
01:05:59FromGitter<data-man> No, I'm *nixman currently :)
01:07:33*yglukhov quit (Ping timeout: 250 seconds)
01:08:17shashlickisn't PCRE available by default?
01:14:39*marenz_ quit (Ping timeout: 268 seconds)
01:15:13FromGitter<data-man> Is available, but I like apps without external dependencies.
01:16:42FromGitter<data-man> I guess I'm not alone. 
01:18:07shashlickI'm on Windows and I feel that way 100%
01:18:22shashlickhere's nimssl - wrapper for the OpenSSL library using nimgen to generate the wrappers
01:18:23shashlickhttps://github.com/genotrance/nimssl
01:19:09shashlickright now, it only covers SHA and AES (which isn't really tested yet) but more as the demand grows
01:21:19shashlickfederico3: when you say example input/output for nimgen, what would help? I'm not sure what to put into the README besides a link to nimssl. There's already the nimgen package.cfg though that doesn't say much
01:25:05*gokr quit (Ping timeout: 240 seconds)
01:28:31*SunDwarf quit (Ping timeout: 248 seconds)
01:29:38*SunDwarf joined #nim
01:33:00*voice_ftp quit (Quit: Leaving)
01:43:20*Jesin quit (Quit: brb)
01:43:25*vivus quit (Quit: Leaving)
01:52:21*Jesin joined #nim
01:52:40*kalkin-- joined #nim
01:56:05*kalkin--- quit (Ping timeout: 250 seconds)
01:58:33*SusWombat joined #nim
02:12:07*yglukhov joined #nim
02:17:35*yglukhov quit (Ping timeout: 240 seconds)
02:20:10*chemist69 quit (Ping timeout: 264 seconds)
02:33:25*chemist69 joined #nim
02:53:07FromGitter<Varriount> shashlick: What about libressl?
02:58:07shashlickvarriount: I can take a look, sure
03:00:28shashlickbut again, I've only wrapped the SHA portion of openssl. i've also wrapped the AES functions but am yet to test it
03:00:32shashlickwill have to expand step by step
03:00:34*endragor joined #nim
03:07:41*xkapastel quit (Quit: Connection closed for inactivity)
03:24:31TangerHey guys, what's the workaround for when people name their libraries the same as one in the stdlib...
03:25:14Tangeri.e the nim-random package is called random, which is the same as the standard random lib
03:25:58*yglukhov joined #nim
03:29:53*ipjk quit (Read error: Connection reset by peer)
03:30:27*yglukhov quit (Ping timeout: 240 seconds)
03:33:56*dddddd quit (Remote host closed the connection)
03:50:52FromGitter<data-man> @Tanger: I not trying, but you can put nim-random to your project source dir and importing as nim-random/src/random
04:00:53Tangerdata-man, Cheers mate. Wanted to try and not do that but that will do it
04:23:57*rauss quit (Read error: Connection reset by peer)
04:25:31*rauss joined #nim
04:36:34*yglukhov joined #nim
04:38:49*skrylar joined #nim
04:38:51skrylarboop
04:41:11*yglukhov quit (Ping timeout: 250 seconds)
04:45:38*SenasOzys joined #nim
04:56:47FromGitter<Varriount> Tanger: "import x/y/z as a"
05:32:19*endragor quit (Remote host closed the connection)
05:32:47*endragor joined #nim
05:39:12*endragor quit (Ping timeout: 268 seconds)
05:59:24*SenasOzys quit (Remote host closed the connection)
06:13:30*yglukhov joined #nim
06:13:33*SenasOzys joined #nim
06:16:21*ftsf quit (Ping timeout: 240 seconds)
06:18:03*yglukhov quit (Ping timeout: 268 seconds)
06:20:27*xkapastel joined #nim
06:29:34*nsf joined #nim
06:30:48*endragor joined #nim
06:46:08*obadz quit (Ping timeout: 258 seconds)
06:46:34*obadz joined #nim
06:48:25FromGitter<gogolxdong> How can I get this right https://gist.github.com/gogolxdong/2e810e8b21753210cdabfa72a13b98be
06:59:05*endragor quit (Remote host closed the connection)
06:59:13*rauss quit (Quit: WeeChat 1.9.1)
06:59:13*endragor joined #nim
07:00:49*sleepyqt joined #nim
07:25:55*yglukhov joined #nim
07:27:28*arecaceae quit (Remote host closed the connection)
07:27:47*arecaceae joined #nim
07:28:22*Arrrr joined #nim
07:28:22*Arrrr quit (Changing host)
07:28:22*Arrrr joined #nim
07:30:36*yglukhov quit (Ping timeout: 258 seconds)
07:32:45skrylari wonder if there is a flag to show how long a module takes to process. hmm
07:33:04skrylari remember nico had some imports that slowed compiling down and i wasn't sure particularly why
07:38:30shashlickgogolxdong: what wrapper are you using for libvirt
07:39:25FromGitter<gogolxdong> libvirt-php for now
07:41:10Arrrrconverters
07:41:19ArrrrAraq said they weren't optimized
07:44:01FromGitter<gogolxdong> Do you have any recommendation?
07:47:46Arrrr what's the issue?
07:48:03*vlad1777d joined #nim
07:53:32shashlickgogolxdong: I just wrapped all of libvirt (converted .h files into .nim) using nimgen
07:53:36shashlicktook 20 minutes to setup the cfg file
07:54:26shashlicklet me know if you need them to bind to the dll/so
07:54:37FromGitter<gogolxdong> great ,will you create a repository?
07:56:33shashlickI can eventually, but windows/linux?
07:56:46FromGitter<gogolxdong> What are you going to do with your nim wrapper?
07:57:18shashlicknothing really, I just released nimgen so when you mentioned libvirt, I felt like testing nimgen's capabilities
07:57:27*endragor quit (Remote host closed the connection)
07:57:54FromGitter<gogolxdong> wow, quick mind.
08:00:20shashlickso windows/linux? what's hte name of the DLL/so files
08:01:44FromGitter<gogolxdong> linux first, how about libvirt-nim.so?
08:02:59shashlicki'll just put libvirt.so for now, you can always change it however
08:05:39FromGitter<gogolxdong> alright.
08:09:41FromGitter<gogolxdong> I think I will finish the rest part as long as I have time. ;)
08:12:09shashlickok so first install nimgen - https://github.com/genotrance/nimgen for steps, requires c2nim
08:12:33shashlicknext clone libvirt from https://github.com/libvirt/libvirt
08:12:38*claudiuinberlin joined #nim
08:13:59shashlickcopy libvirt.cfg from this gist as a sibling to the libvirt directory - https://gist.github.com/genotrance/bb5787c79f6cd2bf7043e4e36e9ed964
08:14:11shashlickrun > nimgen libvirt.cfg
08:14:32shashlickyou should get a bunch of .nim files in the libvirt root directory
08:15:37shashlickimport libvirt/libvirt
08:15:45shashlickhmm - does Nim not like - in module names?
08:15:56skrylari should probably look in to c2nim someday
08:16:09skrylari still just do it by hand, albeit with some regexps and stuff
08:17:16FromGitter<gogolxdong> got it, got a problem when nimble install c2nim
08:17:52FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a02bdb0614889d475539224]
08:18:33shashlicknimble remove compiler
08:18:34shashlicknimble install compiler@#head
08:18:42shashlickthen nimble install c2nim@#head
08:18:51skrylari wonder if there would be a point in porting (loop) to nim
08:19:40FromGitter<gogolxdong> helpful.
08:19:44FromGitter<gogolxdong> thanks
08:20:13skrylarreminds me. debian backports has nim 0.17. have not seen if it works though
08:20:19skrylararch also has 17, but its a broken one
08:20:50*gokr joined #nim
08:21:53FromGitter<gogolxdong> ```code paste, see link```
08:22:47*endragor joined #nim
08:23:16shashlicknim -v?
08:24:11FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a02bf2ae44c43700acf9b87]
08:25:20shashlickno idea  I just compiled nim #head, then compiler #head then c2nim on Ubuntu
08:26:25shashlickanyway, looks like c2nim has generated a bunch of .nim files with _ in identifiers even tho nim doesn't like that
08:26:34shashlickso the code generated isn't quite useful yet
08:27:27Araqshashlick: you need to play with #prefix to tell c2nim what to do
08:27:49Araqthough I can see a default of "produce wrong Nim code" is bad
08:28:16skrylarshashlick, well they can be IN an identifier, just not like.. on the edges
08:28:19skrylarwhich is sort of weird
08:28:38skrylarI'm not sure why "foo_" errors, shouldn't it just silently become foo? or is that just to prevent misconceptions.
08:28:44*PMunch joined #nim
08:29:00Araqwell the idea here is that '_' is a word separator
08:29:09shashlickAraq: thanks - looking into it
08:29:16shashlicklibvirt has _vir all over the place
08:29:33skrylarreplacing _ with x and then renaming it back via importc[pp] works
08:29:43skrylarfltk has a couple semi-private vars that i had to do that with
08:29:51shashlickthe other thing is that file names have - in them, and nim doesn't like that either in import statements
08:30:39Araqwell yes, the filenames need to be valid Nim module names / identifiers
08:30:53shashlicknimbass is out by the way, works on WIndows, still some issues on Linux with LD path though
08:30:54shashlickhttps://github.com/genotrance/nimbass
08:31:48Araqgogolxdong: your nim is outdated :-)
08:32:15FromGitter<gogolxdong> haha, ok ,I am updating .
08:34:44*benoliver999 quit (Changing host)
08:34:44*benoliver999 joined #nim
08:34:55shashlickAraq: that's a complaint have for c2nim, you need nim on #head to get it working
08:35:21AraqI know, unfortunately the code wasn't patched via 'when compiles'
08:35:45FromGitter<mratsim> so Nimgen is a better c2nim?
08:35:58Araqyes, what's nimgen?
08:36:55skrylarlast three headers for fltk, whee
08:37:52shashlicknimgen is a tool I've written to help automate wrapping libraries
08:38:00shashlickit uses c2nim behind the scenes
08:38:07shashlickhttps://github.com/genotrance/nimgen
08:38:30shashlickcheck out nimssl and nimbass which have been wrapped with nimgen
08:38:35shashlickc2nim still does all the heavy lifting
08:42:33Araqshashlick: seems nice but you have the 'nimgen' binary in your repo
08:42:42Araqdon't do that :-)
08:43:30shashlickwhoops :)
08:43:31shashlickdidn't add it to the .gitignore looks like
08:45:39PMunchYeah, adding Nim binaries to .gitignore is a bit of a pain
08:46:13PMunch.gitignore should really support a "don't add executables with same name as another file" option
08:48:54*Vladar joined #nim
08:50:19*livcd joined #nim
08:52:07AraqI think Unix should finally get an '.exe' file extension
08:52:40Araqor maybe '.elf' if you hate Microsoft so much that you can't copy a single good idea from it
08:53:24skrylaror just don't add the binary in the first place >.<
08:53:44Araqfilenames without extension are barbaric like dynamic typing
08:53:58FromGitter<alehander42> well .gitignore should be able to easily detect executables anywya
08:55:23skrylarhttps://stackoverflow.com/questions/5711120/gitignore-without-binary-files there appears to also be a means of ignoring all but a whitelist
08:55:48skrylardon't know if there are global smudge filters (i think there are?) but you could use one to run `file` and panic if its an executable
08:56:12skrylaror just be more vigilant :f
08:58:10Araqkind of ironic that not even git properly deals with Unix's legacy
08:58:32FromGitter<alehander42> also in unix an executable is determined by its perm metadata, so various a.py e.sh etc files are totally executable, the extension and executableness are orthogonal concepts so adding an .exe wouldn't fix anything :(
08:58:57skrylarprobably because people tend to shove bins in a bin directory
08:59:00Araqnah that's wrong but I don't want to have this dicussion again
08:59:02skrylarwhich they just put in the gitignore
08:59:50Araqbesides, an .exe is generated, a .py file is not
09:00:08*jjido joined #nim
09:00:08FromGitter<alehander42> :D I think some kind of wrapper around .gitignore is the only foolproof solution currently
09:00:09Araqso .exe would definitely would be an improvement for the whole Unix ecosystem
09:00:23*floppydh joined #nim
09:00:29FromGitter<alehander42> well a .py or .sh file can be generated as well
09:00:45Araqbut usually it isn't and that's all that matters
09:00:58skrylarwondering if it would be a good or bad idea to dump evil-mode and also unbind cursor nav keys
09:01:11Araqan .exe is always generated.
09:01:24FromGitter<alehander42> well it depends on what your goal is, I think people care if a file is some kind of "binary file" or not
09:01:28FromGitter<alehander42> not if it's executable
09:01:47FromGitter<alehander42> e.g. binary files are usually generated, huge and you don't need them, in vcs
09:01:51Araqso which other "binary" files lack an extension to filter against?
09:01:52skrylarwith easymotion/avy/ace-jump in vimacs, its actually faster to use that (~4 keystrokes to go any location) for almost everything
09:02:29Araqlib*.so has .so
09:02:33Araqfile.o has an .o
09:02:42Araqimage.jpg has a .jpg
09:03:09Araqwhich one fails to work with filters? executables / elf binaries.
09:03:24FromGitter<alehander42> actually in this case one could just assume [x] is file && [x] has no ext
09:03:30FromGitter<alehander42> to be a good check for binary
09:03:36AraqCHANGELOG
09:03:38AraqREADME
09:03:40FromGitter<alehander42> but many text files have no extension too
09:03:41AraqLICENSE
09:03:50Araqyup.
09:03:53FromGitter<alehander42> I think that's the real weird thing :D
09:06:07FromGitter<alehander42> yep the text file thing sucks
09:09:13Araqit all sucks ;-) go to /usr/lib and try to read anything, all I see is the 'lib' prefix
09:10:11Araqmy /usr/bin has files like 'w' or 'true' or 'what'
09:10:56FromGitter<alehander42> well true is a very useful program :D
09:11:17*chemist69 quit (Quit: WeeChat 1.9.1)
09:11:27Araqor '2to3' or 'a2p'
09:11:49*chemist69 joined #nim
09:12:02FromGitter<alehander42> well what's the problem with those (except no .exe)
09:12:15*chemist69 quit (Client Quit)
09:12:35Araqthey are "polluting" my "global namespace" and I have no idea what they do
09:13:18FromGitter<alehander42> well surely you installed e.g. python's 2to3
09:13:48FromGitter<alehander42> you have the freedom to augment your /usr/bin in "modules"
09:14:07Araqha ha ha ha, I don't have the freedom to do anything
09:14:25Araqevery tool relies on this bullshit structure that is forced on me
09:15:27FromGitter<alehander42> well world be hell if there was no convention as this
09:15:45FromGitter<alehander42> it's so much better on windows where every new program comes with e,g, packaged python interpreter
09:15:51FromGitter<alehander42> and 10 other things
09:16:01*chemist69 joined #nim
09:16:31Araqwell at some point you can consider to improve your "conventions" or else computing will never have any progress.
09:16:45shashlickcalling it, just too late to sit up, will remove the -_ from module names with nimgen tomorrow
09:16:45FromGitter<alehander42> ok, so what would be your solution for e.g. installing package binaries ?
09:17:06Araqit's 2017 now and I don't even want to look at my /usr/lib
09:17:14shashlickalso need to figure out how to remove _ from variables in c2nim, will check that out later
09:17:30FromGitter<alehander42> how would one be able to invoke them? `package/binary` then you can ask why packages are in a global namespace
09:17:30*claudiuinberlin quit (Ping timeout: 268 seconds)
09:17:34Araqwhen should I look again? in 2080? never?
09:19:12PMunchHmm, should a named blocks be breakable without a named break?
09:21:24AraqPMunch: good question. probably not for the sake of Nim's macro system
09:21:47PMunchCurrently it does, I was just wondering if this was on purpose
09:22:06PMunchAnd that's a good point
09:22:10Araqyes it's done on purpose but it's yet another minor thing we should change
09:23:50Araqalehander42: Improving things is not particularly hard but it's made impossible by people who think that a design from the 70ies doesn't need improvements
09:25:02Araqyou think Unix is a simple and elegant system, it's not. it's full of features and warts and when you are not aware of them, you introduce bugs
09:25:22Araqit's easier to ignore C++'s misfeatures than Unix's.
09:26:30Araqthat's the cold harsh truth you will never accept and so it lives on like a zombie eating your brain. ;-)
09:28:35skrylarAraq's new operating system, Nim 9.
09:28:42FromGitter<alehander42> but it's the same for other os-s each one has very annoying con-s
09:29:02Araqthe other OSes have a real compatibility story
09:29:26skrylaradmittedly plan 9 would have been neat. it did fix a lot of unix's stupidity
09:29:26AraqLinux really hasn't and so it free to innovate.
09:30:09skrylarp9 also more or less had containering, in a way, which people now bolt on to linux. yay millions of man hours to recreate what rob and ken already did in a basement.
09:30:11skrylar:|
09:30:13FromGitter<alehander42> and sadly it's much harder to "disrupt" os market with a new os (than e.g. language stage with a new language)
09:30:21FromGitter<mratsim> I was helping newbies on the Archlinux forum at the time ( 200+ posts a year) it was often the things people took for granted (plugging a projector, having multiple audio sources, sleeping/hibernating, bringing up dhcp) that were the most arcane
09:31:22FromGitter<alehander42> so many somewhat actively used newer languages grant a good evolutionary story for PL, they can constantly take good ideas from each other etc
09:31:27skrylarfor me it was the random killshot updates, mratsim
09:31:41*jjido quit (Ping timeout: 268 seconds)
09:32:07FromGitter<alehander42> linux compatibility might not be as radical as windows one but "it hasn't and so it is free to innovate" is just not true come on :D
09:32:35skrylarlinux doesn't innovate though
09:32:45skrylarthey just clone stuff other clever people already made
09:34:01skrylarmy biggest gripe with the FOSS world is that the BSD guys basically are those clever people, Linux is more or less a pathetic hack job, but for no particular reason we're using it instead of freebsd.
09:34:17FromGitter<mratsim> Regarding container I'm quite impressed with what Joyent did with smartOS (now Trident). In the end I choose Proxmox for containering because Nvidia driver on Solaris hum.
09:34:17FromGitter<mratsim> They innovated on the package manager and signatures side ;)
09:34:26skrylar"Oh guys, containers!" You mean, like any regular Plan 9 session. Or a BSD jail. It just took you five f'king years to badly copy.
09:34:35*obadz quit (Ping timeout: 240 seconds)
09:34:42FromGitter<data-man> Has anyone tried NixOS? https://nixos.org
09:35:14Araqalehander42: it's debatable but given the state of the "distro hell" I cannot see how to produce a binary that works on "Linux, x86_64". I could target "Ubuntu" instead.
09:35:14skrylarnixos' concept is neat
09:35:18FromGitter<mratsim> In 20 years you will be able to say the same about Nim/D/Crystal/Pony vs Go :D
09:35:27skrylarAraq, appimages and fat binaries
09:36:17*obadz joined #nim
09:37:22*vlad1777d quit (Remote host closed the connection)
09:37:39FromGitter<alehander42> well you can use "containers" on existing windows/linux, that's the killer feature
09:38:16PMunchHmm, is there a Salsa20 implementation for Nim out there somewhere?
09:38:40skrylaris there a reason you can't use one of sodium/nacls
09:39:06*xkapastel quit (Quit: Connection closed for inactivity)
09:39:52FromGitter<mratsim> My killer feature is having several independent containers + host sharing the same GPU simultaneously.
09:40:14skrylarcontainers are neat, i don't deny that
09:40:54skrylari just find it incredibly ARGH that FBSD jails and Plan 9 namespaces already been-there-did-that, and everyone was like "We hate fun, lets come back in 17 years and install a clusterfuck of kernels in images instead of using this good idea."
09:41:22Araqskrylar: Plan 9 still hasn't learned from Lisp though, I think something like S-expressions for program interoperability is a no-brainer
09:41:31FromGitter<mratsim> Btw @Araq whatever happened to OpenCL future support in Nim? Is that still planned?
09:41:41floppydhskrylar: ? cgroups are exactly that and Docker etc. rely on them?
09:41:53PMunchskrylar, yes. I'm implementing an existing file format
09:42:01PMunchWhich uses Salsa20
09:42:17*yglukhov joined #nim
09:42:52skrylarhttps://download.libsodium.org/libsodium/content/advanced/salsa20.html but... sodium has that ._.
09:43:18PMunchOh Sodium is a suite :P
09:43:23*gokr quit (*.net *.split)
09:43:25*dyce[m] quit (*.net *.split)
09:43:25*StarBrilliant quit (*.net *.split)
09:43:25*qwertfisch quit (*.net *.split)
09:43:25*zielmicha_ quit (*.net *.split)
09:43:26*euantor quit (*.net *.split)
09:43:27*huonw quit (*.net *.split)
09:43:27*EastByte quit (*.net *.split)
09:43:27*AlexMax quit (*.net *.split)
09:43:36Araqmratsim: I'm waiting for ideas
09:44:10skrylarPMunch, a very good one, though.
09:44:29skrylarthere is also tweenacl but i don't recall if it does salsa
09:44:35AraqI'd like to map Nim's "parallel" construct to OpenCL, but I never figured out the details
09:44:51skrylari would like to understand opencl. it seems .. archaic, though
09:44:53Araqand maybe I'm wrong and it can't work
09:45:49*FromGitter quit (Ping timeout: 250 seconds)
09:46:48*hohlerde quit (Ping timeout: 240 seconds)
09:46:49*Demos[m] quit (Ping timeout: 240 seconds)
09:46:52*byteflame quit (Ping timeout: 240 seconds)
09:46:52*planetis[m] quit (Ping timeout: 240 seconds)
09:47:02*unclechu quit (Ping timeout: 255 seconds)
09:47:06*Sentreen quit (Ping timeout: 268 seconds)
09:47:08*jivank[m] quit (Ping timeout: 250 seconds)
09:47:08*TheManiac quit (Ping timeout: 250 seconds)
09:47:10*ehmry quit (Ping timeout: 241 seconds)
09:47:10*notdekka[m] quit (Ping timeout: 264 seconds)
09:47:34*watzon quit (Ping timeout: 250 seconds)
09:47:39*Jipok[m] quit (Ping timeout: 248 seconds)
09:47:46*shashlick quit (Ping timeout: 264 seconds)
09:47:46*MrAxilus[m] quit (Ping timeout: 264 seconds)
09:47:51*mindB quit (Ping timeout: 255 seconds)
09:49:04*gokr joined #nim
09:49:05*StarBrilliant joined #nim
09:49:05*qwertfisch joined #nim
09:49:05*zielmicha_ joined #nim
09:49:05*euantor joined #nim
09:49:05*huonw joined #nim
09:49:05*AlexMax joined #nim
09:49:05*EastByte joined #nim
09:53:03*couven92 joined #nim
09:53:27*Pisuke joined #nim
09:53:53*MyMind quit (Ping timeout: 268 seconds)
09:56:14PMunchskrylar, hmm. Seems like the sodium bindings in nimble doesn't have Salsa20
09:57:06skrylarisn't it like.. two functions
09:58:28*Jipok[m] joined #nim
09:59:02PMunchTo do salsa20?
09:59:24PMunchCould be..
10:00:37*Sentreen joined #nim
10:01:06livcdI wish software in general not only OSs would be less demanding when it comes to setup and configuration. We spend so much time configuring and fighting incompatibilities and what not :). I mean I wish the default would be just plug and play instead of "muh freedom and muh features"
10:07:57*SenasOzys quit (Ping timeout: 240 seconds)
10:08:47*MrAxilus[m] joined #nim
10:08:48*unclechu joined #nim
10:08:48*ehmry joined #nim
10:08:48*dyce[m] joined #nim
10:08:48*Demos[m] joined #nim
10:08:49*watzon joined #nim
10:08:55*TheManiac joined #nim
10:08:55*jivank[m] joined #nim
10:08:55*notdekka[m] joined #nim
10:08:55*hohlerde joined #nim
10:08:56*mindB joined #nim
10:08:56*planetis[m] joined #nim
10:08:56*byteflame joined #nim
10:08:56*shashlick joined #nim
10:09:15PMunchlivcd, well, half of that is being able to make good defaults
10:09:23PMunchWhich isn't always trivial
10:10:04skrylarPMunch, well i sent you the link to the doc page. it's literally 1 function, and no type definitions
10:10:06floppydhlivcd: check in a dev-env in a Dockerfile, presto
10:10:22skrylaryou don't even need a wrapper, you can just shove it in your project
10:10:34skrylarafaict
10:10:50*FromGitter joined #nim
10:11:32PMunchYeah I guess I could importc it, but that's no fun :P
10:11:48oprypinlast 30 minutes of messages were not bridged :(
10:11:58oprypinmratsim, might wanna check out IRC logs
10:12:10oprypin@mratsim
10:17:52*FromGitter quit (Remote host closed the connection)
10:18:04*FromGitter joined #nim
10:19:07*FromGitter quit (Remote host closed the connection)
10:19:16*FromGitter joined #nim
10:19:18*SenasOzys joined #nim
10:20:15*FromGitter quit (Remote host closed the connection)
10:20:23*FromGitter joined #nim
10:28:12*endragor quit (Remote host closed the connection)
10:43:13*Guest7186 joined #nim
10:46:08*marenz_ joined #nim
10:47:08ArrrrDoes nim implement this? https://msdn.microsoft.com/en-us/library/windows/desktop/dd757624(v=vs.85).aspx
10:57:46*Guest7186 quit (Remote host closed the connection)
10:58:04AraqArrrr: I doubt it
10:58:35FromGitter<mratsim> @oprypin thanks.
11:01:12FromGitter<mratsim> Btw how is Nim tables perf? Did someone benchmark it? Seems like there is a lot of various competing C implementations between JudyArray, Nedtries, redblack trees, uthash, Google libs: http://www.tommyds.it/doc/benchmark
11:01:48federico3PMunch: I can add the bindings to Salsa20
11:03:38*endragor joined #nim
11:07:25*jjido joined #nim
11:07:36*SenasOzys quit (Remote host closed the connection)
11:07:49*SenasOzys joined #nim
11:09:02*endragor quit (Ping timeout: 260 seconds)
11:11:34skrylarJudy arrays were pretty awesome apparently
11:11:52skrylarI recall seeing a mention that on 64 bit systems they are a bit less of a major win
11:12:28skrylartheir patent should be expiring Soon(tm), though if they're still relevant? no idea
11:13:52*dddddd joined #nim
11:19:31skrylardid manage to get tanh curve neurons working in nim earlier today, that was neat.
11:19:44skrylarhaven't looked in to the training algorithms for SVMs
11:20:49jjidoI suppose you use a table for "tanh curve" right?
11:21:51*endragor joined #nim
11:26:53skrylarI use a ghetto version of tensors, which in my case are just seqs of floats.
11:28:13skrylari don't know how much overhead nim adds, or what the C looks like, but when i tried this approach in straight C you can get gcc to speed up a lot of the basic maths with avx flags and loop unrolling flgs
11:34:08*chemist69 quit (Ping timeout: 240 seconds)
11:36:28*SenasOzys quit (Read error: Connection reset by peer)
11:37:14*SenasOzys joined #nim
11:37:46*arnetheduck joined #nim
11:48:00*chemist69 joined #nim
11:50:13FromGitter<mratsim> Just use Arraymancer ;). I'm pretty sure it's the fastest ndarray lib in any language.
11:51:28PMunchfederico3, that would be nice. I'm currently implementing it in pure Nim just for fun
11:54:24floppydhmratsim that's one edgy README y ou wrote there
12:05:22FromGitter<mratsim> edgy? why?
12:06:54floppydhmratsim YOLO? :)
12:08:33FromGitter<mratsim> yes, because of this ;) : https://pjreddie.com/darknet/yolo/
12:09:23FromGitter<mratsim> And his new real-time object detection paper: "YOLO9000: Better, Faster, Stronger” https://arxiv.org/abs/1612.08242
12:09:56skrylarYou Only Look Once
12:10:06skrylarthat's being used in spy drones now ._.
12:10:18FromGitter<mratsim> The resume of this guy is impressive: https://pjreddie.com/static/Redmon%20Resume.pdf
12:14:31*elrood joined #nim
12:20:59floppydhmratsim incredible
12:24:56FromGitter<mratsim> @yglukhov Do you have an alter-ego working at Nvidia? https://blogs.nvidia.com/blog/2011/07/01/fight-global-warming-with-gpu-computing-and-c/ vs https://yglukhov.github.io/Choose-The-Right-Language-To-Save-The-Planet/
12:26:12yglukhovmratsim: haha, it appears i do =)
12:30:00skrylarits a shame the parallela guy sold out to darpa
12:30:09skrylarthose chips were interesting
12:35:38skrylarhmm. wonder if there are any simple resources on rich text rendering :x
12:35:47skrylari know there is that online book "The Craft of Text Editing" for regular text
12:43:21floppydhskrylar: is it worthwhile a read?
12:44:30jjidoRich text rendering is nowhere simple
12:47:17*endragor quit (Remote host closed the connection)
12:55:11*xet7 quit (Ping timeout: 250 seconds)
13:00:41*Arrrr quit (Ping timeout: 240 seconds)
13:01:13skrylarfloppydh, https://www.finseth.com/craft/ its alright
13:01:20skrylarif you want to know about the intestines of text editors
13:07:20*xet7 joined #nim
13:07:25FromGitter<data-man> http://antirez.com/news/108 - Writing an editor in less than 1000 lines of code
13:07:35FromGitter<data-man>
13:11:20PMunchHmm, in Nim I want to define a uint8 array by char values. How would I do that?
13:14:23AraqPMunch: there is a new macro for that as a PR
13:19:04arnetheduck> <Araq> what do you use instead? - I don't, which causes some unnecessary copying and some nasty refcounting bug somewhere that I'm finding hard to track down.. it's a problem to be solved but I'm not sure how yet. llvm itself uses a `Value` type to track references to things.. I've been thinking about attaching llvm metadata to it to track locations which optimizers could use at a later stage, but still need a way to x-ref that with the nim AST
13:19:56PMunchAraq, I just went for a char->uint8 converter for now. Works well enough
13:20:23arnetheduckI guess the ability to attach arbitrary things to TLoc, or TLoc having a unique id would help some
13:22:11*TjYoco joined #nim
13:23:34*Arrrr joined #nim
13:23:35*Arrrr quit (Changing host)
13:23:35*Arrrr joined #nim
13:23:39*xet7 quit (Ping timeout: 258 seconds)
13:28:11Araqarnetheduck: don't need the TLoc really I think, you need your own TLoc that contains the rope for external names, the original nim AST for onstack/onheap and the LLVM value
13:29:25Araqif you need to attach things to the PSym use its ID mechanism
13:29:44Araqa TLoc doesn't need an ID
13:31:35arnetheduckAraq, the only reason I'm looking at TLoc is to make the code look more similar to the c backend (aka "the official specficiation").. while it can be made to work without, it's almost impossible to follow how certain assignments happen due to how TLoc is mutated as it travels across the expr/ast handling
13:33:00Araqha, yeah it's a bitch but consider this
13:33:33Araqx = foo() # needs to end up in 'x'
13:33:57Araqg(foo()) # need to put into a temp
13:34:44Araqthe 'dest: var TLoc' idea was the best I could come up with to model this constraint
13:35:50Araqbut in retrospect I would have used an AST to AST transformation and then render the AST as C
13:36:30arnetheduckyes, that would have been nice! then the semantics would be encoded in the ast and the backend could be dumber
13:36:31*xet7 joined #nim
13:36:45Araqthat's with its own set of problems though, plenty of these things have no real Nim AST representation
13:36:59AraqC's rules for 'typedef' for example
13:37:05Araqor how we emit RTTI
13:37:36*SenasOzys quit (Remote host closed the connection)
13:38:00arnetheduckrtti is a bit puzzling in the c backend, why is it inited dynamically? it's all known at compile time - nlvm writes consts for it
13:38:31Araqback then not every C compiler could deal with my consts :-)
13:39:32arnetheducknot sure why typedefs matter - c backend could spit out the most primitive of types available - llvm certainly has no such magic
13:39:43*SenasOzys joined #nim
13:40:00Araqhuh? you need to emit C types so that its optimizer can do its job
13:40:43Araqaliasing information for example depends on the types
13:43:38arnetheduckc types, yeah.. typedefs/type aliases? not sure what you mean
13:44:27Araqtypes are hard, they can be recursive and then you need a forward declaration like typedef struct x x;
13:44:43Araqand you need to ensure you only access *x before x is resolved completely
13:46:27arnetheduckspeaking of types, that's another thing that's tricky in the ast - there are lots of extra casts in the c backend because types are not accurate (all those NI casts for example).. I'm guessing there's some kind of plan behind explicit and implict int conversions, but it shoudln't be the job of the backend to figure that out
13:47:02Araqthe conversions are just there to make C behave
13:47:10AraqLLVM doesn't need them
13:47:28AraqI don't want C's integer promotion rules, Nim has its own
13:47:42*endragor joined #nim
13:47:46Araqthis is #offtopic but huge, so I'm posting it here https://www.networkworld.com/article/3236064/servers/minix-the-most-popular-os-in-the-world-thanks-to-intel.html
13:47:49*Jesin quit (Quit: Leaving)
13:50:12arnetheduckllvm does need them because the ast types don't always match (on assignment for example, the src and destination types can be ints of different sizes or pointers to different types).. llvm is actually very strict about it, much more so than c, and because casts are used so freely in the c backend, lots of these inconsistencies go unnoticed
13:50:17jjidoAraq: see comments on this on OSNews
13:51:22Araqarnetheduck: yeah, we have nkHiddenConv for these but that's more annoying than helpful and so it's also often "skipped"
13:51:30FromGitter<mratsim> The most surprising thing in the C backend is the (NI) foo - 0, that are produced just about everywhere.
13:51:59*endragor quit (Ping timeout: 248 seconds)
13:52:55arnetheduckthe fact that it's missing means lots of unnecessary casting happens from smaller types to int64 and back again (or I have to write what amounts to an optimizer pass to get rid of them when it's safe to do so)
13:54:10FromGitter<mratsim> Btw Araq, can we already use `=sink` on master? That would be awesome for Arraymancer, currently I have to provide foo\[0,1..2,3..10\] and foo.unsafeSlice(0,1..2,3..10) for both copy and move.
13:54:26arnetheducksame thing happens for bool vs char - in c they're the same, in nim they're not.. if the types were correct in the ast llvm could optimize based on that but because the c backend doesn't care, small inconsistencies like this go unnoticed
13:55:12arnetheduckinstead, I have to cast every bool to a char to get the same behavior
13:56:38arnetheduckmratsim, the foo-0 is mostly harmless actually, it's easy for the compiler to optimize away.. they're unfortunately not as smart about extending and truncating int sizes leading to poor code
13:56:59GitDisc<crem> Sorry, just a test. :) 10 blah
13:57:00GitDisc<crem> JOIN #testtest
13:57:01*Senketsu_ joined #nim
13:57:56arnetheduckAraq, I'd love consistent and correct nkHiddenConv's - would be so much easier to generate good code ;)
13:58:22Araqmratsim: yes, with --newruntime
13:58:23arnetheduckbeing there only sometimes, they suck indeed
14:02:11*Senketsu_ quit (Remote host closed the connection)
14:03:48couven92Araq, dom96: placement of asArray macro? I don't really have a preference. I understand why dom96 wants it in `sequtils`, but I can understand why people think that `asArray` is oddly placed there.
14:04:31gokrBtw, the little arduinobot thing I wrote has been demoed twice and people like it. So a small win for Nim ;)
14:04:32TjYocoAnyone know what the issue was here: Nimx was giving me this error -> .nimble\pkgs\ttf-0.2.3\ttf.nim(1439, 33) Error: type mismatch: got (None) but expected 'cint = int32' <- so I tried nimble install nimx, I tried nake build, and the only thing that worked was cloning his ttf from GitHub. I thought nimble was supposed to take care of that stuff.
14:04:43couven92I like the idea to have it in `future` with the hope of promoting it to `system` some time, but I don't see it evolving much now, as it pretty much does its job as it is now, so theoretically we could just put it into `system` now as well...
14:05:48couven92But I am also okay with having `asArray` in the new `sugar` module as Araq suggested...
14:07:02Araqcouven92: I like 'sugar' and want to add more to it :-)
14:07:18couven92yeah, I though you might :D
14:07:46couven92is `asArray` sugar, og rather a sequence utility macro?
14:08:04couven92or: sequence/array utility macro?
14:08:53*xet7 quit (Ping timeout: 258 seconds)
14:10:11PMunchHmm, given an array[32, uint8] can I pass a section of that to a procedure taking an array[4, uint8]
14:10:24PMunchSimilar to what you could do with pointers in C
14:13:03Araqcouven92: but ok, dom96 want it in sequtils, so move it to sequtils please so that we all can move on
14:13:19couven92okay! :D
14:14:05dom96TjYoco: did you try `nimble install ttf@#head`?
14:16:55TjYocodom96 ttf I guess the problem is ttf isnt on nimble packages
14:18:39yglukhovTjYoco: just remove ttf from .nimble/pkgs, and `nimble install nimx` again
14:19:04TjYocodom96 Oh, maybe this is why. `requires "https://github.com/yglukhov/ttf >= 0.2.3 & < 0.3"` in the nimx.nimble file, but maybe he didnt increase the numbers when he bug fixed it so nimble thought it was updated?
14:19:06*endragor joined #nim
14:20:07couven92Araq, done. running tests now
14:21:32*xet7 joined #nim
14:22:02PMunchHmm, it appears I can cast to an `array[4, uint8]` but not a `var array[4, uint8]`
14:23:15PMunchJust gives me a SIGSEGV: Illegal storage access. (Attempt to read from nil?) when I try to read an element from it
14:25:47*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:27:29*endragor quit (Ping timeout: 250 seconds)
14:31:11PMunchWorked around it by using a generic type and an offset. But I would still like to know if this doesn't work
14:32:20*endragor joined #nim
14:33:10Araqarrays are not pointers and you likely got your cast expression wrong
14:34:17PMunchSo what should the cast expression be if I wanted to pass the last 4 bytes of an array[8, uint8] to a proc like proc modify(buf: var array[4, uint8])
14:35:37FromGitter<couven92> cast[array4, uint8 (array) maybe?
14:35:42*endragor quit (Remote host closed the connection)
14:36:20Arrrrcast[ptr array[4, uint8]](addr(eight[4])) perhaps
14:37:28AraqArrrr is correct, you need to deref this pointer then
14:38:36*endragor joined #nim
14:38:57PMunchBut wouldn't that get my an array and not a var array?
14:39:17PMunchOr are dereferenced ptr things always assumed to be var?
14:41:26Araqyou need the deref to please the type system
14:41:55Araqlater the hidden & * cancel each other
14:43:42*endragor quit (Ping timeout: 260 seconds)
14:47:27FromGitter<dandevelo> Can a macro or template be used for this? https://gist.github.com/anonymous/9a185b706998d8df53f132ebb9f4d39e
14:52:08Araqyes
14:52:41*gokr quit (Ping timeout: 252 seconds)
14:53:23*endragor joined #nim
14:53:53FromGitter<dandevelo> @Araq: do you have any tips on where can I start?
14:54:07TjYocohttps://nim-lang.org/docs/macros.html#statements-case-statement @dandevelo, here's the docs for case statement AST
14:54:29PMunchTry to wrap your output in a dumpAstGen call
14:54:41PMunchThat will give you the Nim code needed to create that tree
14:54:54couven92Araq, what happened here? It happened because I `import macros` in `sequtils`
14:55:10Arrrryou can do that with simple procs, unless you really want that syntax
14:55:19Arrrruse arrays
14:56:12FromGitter<dandevelo> Thank you @TjYoco @PMunch how would I parse the key:procname list?
14:57:11PMunchUse the dumpTree macro too see what it produces. Then simply traverse it as any other tree
14:57:11couven92Araq, https://ci.appveyor.com/project/dom96/nim/build/852#L1230 (sorry forgot the link)
14:57:27*endragor quit (Ping timeout: 240 seconds)
14:57:39*Jesin joined #nim
14:58:49Araqcouven92: recursive dependency between macros and sequtils?
14:59:14Arrrrdandevelo https://gist.github.com/anonymous/297645188383c035366ffe45211a1df5
14:59:29couven92Araq, oh? Why only in nimscript?
15:00:02couven92And is the right way to resolve this to put it into a `when not defined(nimscript)` block? because then it works
15:01:52Araqcouven92: I'm wrong, macros.nim doesn't import anything
15:05:11shashlickJust curious from the survey, what library binding was most requested?
15:05:13*tefter joined #nim
15:06:25couven92Araq, okay, what is wrong then? (I have no idea!)
15:08:06Araqcouven92: me neither, will investigate later
15:08:15*Senketsu_ joined #nim
15:10:49FromGitter<dandevelo> Thanks @Arrrr that is a good alternative. I would like to learn more about macros and that is why I wanted the other syntax
15:22:42PMunchshashlick, I think one of the ones that were mentioned in the survey summary post dom96 did was AWS
15:23:40PMunchhttps://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html
15:24:10PMunchThat's the full survey. He lists some of the common library requests under "What critical libraries are missing in the Nim ecosystem?"
15:32:42*jjido quit (Ping timeout: 260 seconds)
15:38:48*SenasOzys quit (Ping timeout: 240 seconds)
15:41:46*rauss joined #nim
15:43:12*Senketsu_ quit (Remote host closed the connection)
15:46:21*SenasOzys joined #nim
15:52:07*couven92 quit (Quit: Client disconnecting)
15:55:59*awal is now known as backslash
15:56:02*backslash is now known as awal
16:00:20*Senketsu_ joined #nim
16:11:18*Senketsu_ quit (Remote host closed the connection)
16:14:46*Senketsu_ joined #nim
16:15:51*nsf quit (Quit: WeeChat 1.9.1)
16:17:10*floppydh quit (Quit: WeeChat 1.9.1)
16:17:33*Senketsu_ quit (Remote host closed the connection)
16:26:26*PMunch quit (Quit: Leaving)
16:31:38*yglukhov quit (Remote host closed the connection)
16:33:34*yglukhov joined #nim
16:39:39*yglukhov quit (Ping timeout: 268 seconds)
16:41:26*jjido joined #nim
16:43:36*Senketsu_ joined #nim
16:43:57*Senketsu_ quit (Client Quit)
16:50:27*sleepyqt quit (Quit: Leaving)
16:53:02*TjYoco quit (Quit: Leaving)
16:55:53*JappleAck joined #nim
16:56:14ArrrrIs this a good idea? https://github.com/nim-lang/Nim/blob/devel/todo.txt#L5
16:57:22jjidoI think that is less surprising
16:59:03*chemist69 quit (Quit: WeeChat 1.9.1)
16:59:31*chemist69 joined #nim
17:03:05shashlickPMunch: I saw that but nothing stood out as must have
17:03:39shashlicknimbass covers the BASS request
17:19:05*JappleAck quit (Ping timeout: 240 seconds)
17:19:20*Senketsu_ joined #nim
17:25:12*PMunch joined #nim
17:31:15*yglukhov joined #nim
17:35:27*yglukhov quit (Ping timeout: 248 seconds)
17:36:16*yglukhov joined #nim
17:36:40*JappleAck joined #nim
17:37:38*yglukhov quit (Read error: Connection reset by peer)
17:38:11*yglukhov joined #nim
18:03:19*Senketsu_ quit (Quit: Lost terminal)
18:06:20*Senketsu_ joined #nim
18:06:30*Senketsu_ quit (Remote host closed the connection)
18:07:07*claudiuinberlin joined #nim
18:35:17*Trustable joined #nim
18:39:44planetis[m]Has anyone used ormin?
18:42:52dom96Araq: Another thing to add to your todo: a way for thread-local vars to be initialised by libraries
18:43:26dom96ideally: var x {.threadvar.} = 52 # x is initialised with `52` in each new thread automatically when this module is imported
18:47:32*jjido quit (Ping timeout: 260 seconds)
18:48:05*jjido joined #nim
18:55:17*JappleAck quit (Ping timeout: 250 seconds)
18:56:09*nsf joined #nim
19:07:33dom96Turns out you can trick the http benchmark tool wrk by just writing HTTP replies as fast as possible, without parsing the request :O
19:08:20planetis[m]lol
19:08:45*JappleAck joined #nim
19:10:16dom96Getting 1m req/s by just doing that...
19:23:22*Ven joined #nim
19:23:33Arrrrwelcome to volkswagen
19:23:45*Ven is now known as Guest86124
19:24:31dom96haha
19:24:31*Guest86124 quit (Read error: Connection reset by peer)
19:25:00*Ven_ joined #nim
19:37:52*Trustable quit (Remote host closed the connection)
19:38:41PMunchCan I pass a Nim string to a function that takes an array of uint8?
19:39:53PMunchOr a seq[uint8] for that matter
19:42:49PMunchApparently cast[ptr array[5, uint8]](s.cstring) works
19:44:21*Jesin quit (Ping timeout: 240 seconds)
19:47:04*Jesin joined #nim
19:49:52GitDisc<treeform> hey dom96, there does seem to be a time zone library for nim?
19:51:33GitDisc<treeform> I have started writing one myself, could you help me with making sure it follows nim standards and works for you guys?
19:55:00PMunchI'd be happy to have a quick look at it :)
19:55:55*miran joined #nim
19:57:18*Snircle joined #nim
20:00:29GitDisc<treeform> thanks PMunch, I am still working on it, but I will have some thing to show soon.
20:01:38GitDisc<treeform> I feel like there is a big hole with TZ support. Many languages have very bad TZ support. I work with TZs a ton. I think I can make it work well.
20:02:48PMunchAs someone who just hade a TZ related bug I'm looking forward to what you come up with :)
20:03:20PMunchNot quite sure what the bug even was, but when we switches from DST it turned an hour in the wrong direction :P
20:05:47shashlickdom96: regarding threadvars, why cannot you initialize the var in the main thread and then all child threads inherit it? for example, I read a config file in the main process and the data goes to all kids
20:06:27shashlickI'm not asking to write to the space across threads, just read the value that was written
20:07:31dom96treeform: might want to coordinate with the person that's making lots of stdlib times module PRs
20:08:03dom96shashlick: That's basically what I want
20:10:45*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:11:25shashlickperhaps it is a different pragma altogether, where threadvar means each thread has it's own copy of a var it can initialize and set, we want another pragma for a var that is initialized once and is read only in all threads
20:16:35*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
20:17:16*claudiuinberlin joined #nim
20:19:00*Arrrr quit (Quit: Leaving.)
20:25:02jjidoHow is it a threadvar if it is written in one thread and read in other threads?
20:26:22oprypinjjido, who said it's read in other threads
20:28:09GitDisc<treeform> PMunch, so far my project is feels like its 90% test cases, 10% actual code. DST stuff is complex. It gets really wired for stuff before 1970.
20:28:42PMunchMmm, pre-1970 would be a problem :P
20:28:55GitDisc<treeform> Morocco switches DST randomly 4 times in 2012!
20:29:22PMunchWhat? :P
20:29:42GitDisc<treeform> They do it with observance with the religious holidays so they don't have to fast as much, i believe.
20:31:36PMunchAah, tricksy
20:31:59GitDisc<treeform> My time zone was -7:52:58 off from UTC until 1883
20:32:41GitDisc<treeform> How did they even count 2 seconds off in 1883? Telegraph?
20:33:35*Ven_ quit (Ping timeout: 248 seconds)
20:34:32*ipjk joined #nim
20:37:12*Ven joined #nim
20:37:37*Ven is now known as Guest53140
20:37:37GitDisc<treeform> I kind of want to include J2000 stuff, but it would probably be to much and should be a separate module. You only need J2000 for astronomical and space stuff. You can fool computers by ignoring leap seconds, but not planets they don't care!
20:38:34PMunchJ2000?
20:39:07GitDisc<treeform> On some years leap seconds are added to account for the fact that Earth orbit is a little random.
20:39:40GitDisc<treeform> What computers do is just slow down the clock.
20:39:46PMunchOh right, never heard the term J2000
20:39:53PMunchLeap seconds I'm familiar with
20:39:55*Vladar quit (Quit: Leaving)
20:40:07GitDisc<treeform> J2000 is like unix 1970
20:40:28GitDisc<treeform> but its time stamps are in real seconds not unix stretchy seconds.
20:40:47GitDisc<treeform> They matched on year 2000 but have been drifting ever sense
20:41:07planetis[m]ormin is nice btw although I haven't used a ORM before
20:41:13PMunchHuh, that I didn't know
20:43:38GitDisc<treeform> if you have leap seconds table, which is known, you can convert between them by stretching unix seconds a bit.
20:44:24GitDisc<treeform> may nim-powered spacecrafts never crash.
20:47:29PMunchVery interesting indeed
20:48:15PMunchI'm working with satellite reception and have to work with leap seconds (just started, hence my limited knowledge)
20:49:24*Guest53140 quit (Ping timeout: 268 seconds)
20:49:35GitDisc<treeform> Oh really? Are you using nim for this?
20:49:55PMunchUnfortunately not :(
20:50:05PMunchBut I hope I might convert some people as time goes by
20:50:17PMunchCurrently we use C++ and Ruby, so Nim would be a great candidate
20:50:25GitDisc<treeform> maybe if nim had support for J2000 it would be easier?
20:51:24*martinium joined #nim
20:51:26GitDisc<treeform> I bet though, such level of accuracy might not be required.
20:52:00GitDisc<treeform> Its just programmers thing trying to be, fastest, most accurate etc...
20:55:17PMunchWell, I think all of that is neatly packed away in some module no-one touches any longer :P
20:55:39PMunchBut showing that Nim has support for it would definitely be a plus
20:56:45*Ven_ joined #nim
20:58:34FromGitter<jdhorwitz> Hey all, I'm working through Nim into Action and I am working on the parsing chapter and I am trying to find the top 10 most popular pages, but I am having a tough time figuring out how to procede in Nim to accomplish that.
20:58:46FromGitter<jdhorwitz> I assume I would use an empty sequence and add to it?
20:58:59FromGitter<jdhorwitz> but in context I'm not sure, any help would be much appreciated
21:02:32FromGitter<mratsim> ping @dom96
21:02:42dom96yes?
21:02:44FromGitter<mratsim> He is the author ;)
21:03:21*Ven_ quit (Ping timeout: 240 seconds)
21:03:29GitDisc<awr> does nake provide anything for parsing additional arguments along with the task or do i need to use parseopt2/etc.
21:19:13*Jesin quit (Quit: rebooting)
21:19:32PMunchHmm, is there a non-recursive version of findAll for xmltree
21:20:34*miran quit (Quit: Konversation terminated!)
21:21:36*miran joined #nim
21:21:49dom96jdhorwitz: Easiest way would be to keep adding to a sequence, sort it based on the views and trim the sequence to 10
21:24:34*miran quit (Client Quit)
21:36:22*Ven joined #nim
21:36:47*Ven is now known as Guest76170
21:43:25shashlickjjido: ya, it could probably be a globalvar or something, it's not thread specific. Right now only a const can do that and that obviously doesn't work for all scenarios. You have to pass objects via channels or duplicate loading the data, etc. (oprypin)
21:44:27shashlickIdeally, a var type that can be read by all threads but owned by only one thread
21:44:55*vlad1777d joined #nim
21:45:16shashlickespecially good if the main thread can continue to write to that location even after the child threads are spawned but that might be a dream :)
21:45:39shashlick(with changes propagating to the child threads that is)
21:49:57*xkapastel joined #nim
21:50:16PMunchHmm, I've got a string and I need a seq[uint8]. Now I can convert it to a seq[char] by using toSeq(myString.items) but is there a way to get a seq[uint8]?
21:51:04*Guest76170 quit (Ping timeout: 268 seconds)
21:55:46*JappleAck quit (Quit: Leaving)
21:56:43*Ven_ joined #nim
21:56:50GitDisc<awr> mapIt(toSeq(myString.items), cast[it](uint8))
21:56:59GitDisc<awr> whoops
21:57:05GitDisc<awr> cast[uint8](it)
22:02:16*ketralni` quit (Quit: Coyote finally caught me)
22:02:55GitDisc<awr> probably inefficent though
22:06:49*Ven_ quit (Read error: Connection reset by peer)
22:07:37*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:07:47*ketralnis joined #nim
22:07:59GitDisc<awr> actually you don't need to use toseq on items at all
22:08:07*martinium joined #nim
22:08:22GitDisc<awr> var x = "blah blah here's a cool string"
22:08:24*martinium quit (Client Quit)
22:08:37GitDisc<awr> var n = x.mapIt(cast[uint8](it))
22:08:58GitDisc<awr> @PMunch
22:09:00*martinium joined #nim
22:09:11*martinium quit (Client Quit)
22:09:47*martinium joined #nim
22:09:59*martinium quit (Client Quit)
22:10:27*martinium joined #nim
22:10:45*martinium quit (Client Quit)
22:11:15*martinium joined #nim
22:11:33*martinium quit (Client Quit)
22:16:30*Ven_ joined #nim
22:17:49*Ven_ quit (Read error: Connection reset by peer)
22:19:41*SenasOzys quit (Ping timeout: 240 seconds)
22:20:35PMunchAh, mapIt would work of course
22:20:53PMunchThis doesn't have to be terribly efficient
22:25:55*xet7 quit (Read error: Connection reset by peer)
22:29:45FromGitter<data-man> @PMunch: You can to use low-lewel method: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a03855886d308b755c55007]
22:31:01*Jesin joined #nim
22:32:16jjidoshashlick: pony language has this kind of notion
22:35:22*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:36:27*Ven joined #nim
22:36:52*Ven is now known as Guest54836
22:39:17*gokr joined #nim
22:39:26elroodPMunch, you could also just cast, without making redundant copies or mapping, couldn't you? the data is right there in memory, you just want a different representation, so cast[seq[uint8]](yourString)
22:39:59PMunchHmm, I think you'd get some extra stuff if you did that
22:40:07PMunchNim strings aren't C char arrays
22:42:32FromGitter<Varriount> PMunch: It would technically work, since sequences and strings share the same underlying data type. But it would be exploiting undefined behavior.
22:42:50FromGitter<Varriount> Why not just convert to a cstring?
22:42:59*xet7 joined #nim
22:45:14PMunchYeah I've found a workaround
22:45:43PMunchCreating a newSeq[uint8](mystring.len) and then traversing the string and adding each character
22:51:30*Guest54836 quit (Ping timeout: 268 seconds)
22:51:44*couven92 joined #nim
22:54:46elroodPMunch, very efficient ;) not that it mattered for the use case, but still. actually, afaict, nim strings aren't that different from a c zero-terminated char array
22:55:10*nsf quit (Quit: WeeChat 1.9.1)
22:55:51elroodthey're just a sequence of chars, with a length field, and can trivially alternatively be viewed as a sequence of uint8, with a length field. thus just a cast is enough
22:56:27*Ven_ joined #nim
23:05:03*Ven_ quit (Ping timeout: 248 seconds)
23:05:56dom96Nim strings are a length + char pointer AFAIK
23:06:23dom96You don't need to copy the string for this
23:16:55*Ven_ joined #nim
23:20:09*PMunch quit (Quit: leaving)
23:21:42*Ven_ quit (Ping timeout: 260 seconds)
23:30:05*elrood quit (Quit: Leaving)
23:32:46*tyler569 quit (Quit: leaving)
23:36:21*Ven joined #nim
23:36:45*Ven is now known as Guest31726
23:37:56*Guest31726 quit (Client Quit)
23:40:00*yglukhov quit (Remote host closed the connection)
23:41:32*jjido quit (Ping timeout: 260 seconds)
23:41:32*niv quit (Read error: Connection reset by peer)
23:42:43*niv joined #nim
23:45:49*niv quit (Remote host closed the connection)
23:46:08*niv joined #nim
23:48:21*yglukhov joined #nim
23:50:06*erry_ joined #nim
23:50:42*erry_ quit (Client Quit)
23:52:59*bkerin joined #nim
23:53:37bkerinhmm what's wrong with this declaration: var typeTable: TableRef[string, string] = newTable[string, string]
23:54:07bkerinnim says newTable has no type or is ambiguous
23:57:19bkerinah nm i got it missing parens
23:57:48GitDisc<awr> if i'm compiling to emscripten should i set the cpu to "js" in the compiler options