00:05:27 | * | sz0 quit (Quit: Connection closed for inactivity) |
00:16:25 | shashlick | nimgen <= c2nim helper - https://github.com/genotrance/nimgen |
00:16:26 | shashlick | reviews, 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:12 | federico3 | shashlick: an example input and output at the top of the README could help |
00:35:40 | shashlick | federico3: thanks, I'm trying to get the openssl wrapper on github as well since it serves as a good example |
00:36:14 | shashlick | as 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:03 | FromGitter | <data-man> @shashlick: Thanks! ⏎ And why not replace a Regex on PEG or scanf? Say "no dependencies!" |
01:00:37 | shashlick | data-man: I'm yet to figure out how PEG works but ya |
01:03:19 | * | yglukhov joined #nim |
01:04:35 | shashlick | i'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:59 | FromGitter | <data-man> No, I'm *nixman currently :) |
01:07:33 | * | yglukhov quit (Ping timeout: 250 seconds) |
01:08:17 | shashlick | isn't PCRE available by default? |
01:14:39 | * | marenz_ quit (Ping timeout: 268 seconds) |
01:15:13 | FromGitter | <data-man> Is available, but I like apps without external dependencies. |
01:16:42 | FromGitter | <data-man> I guess I'm not alone. |
01:18:07 | shashlick | I'm on Windows and I feel that way 100% |
01:18:22 | shashlick | here's nimssl - wrapper for the OpenSSL library using nimgen to generate the wrappers |
01:18:23 | shashlick | https://github.com/genotrance/nimssl |
01:19:09 | shashlick | right now, it only covers SHA and AES (which isn't really tested yet) but more as the demand grows |
01:21:19 | shashlick | federico3: 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:07 | FromGitter | <Varriount> shashlick: What about libressl? |
02:58:07 | shashlick | varriount: I can take a look, sure |
03:00:28 | shashlick | but 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:32 | shashlick | will have to expand step by step |
03:00:34 | * | endragor joined #nim |
03:07:41 | * | xkapastel quit (Quit: Connection closed for inactivity) |
03:24:31 | Tanger | Hey guys, what's the workaround for when people name their libraries the same as one in the stdlib... |
03:25:14 | Tanger | i.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:52 | FromGitter | <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:53 | Tanger | data-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:51 | skrylar | boop |
04:41:11 | * | yglukhov quit (Ping timeout: 250 seconds) |
04:45:38 | * | SenasOzys joined #nim |
04:56:47 | FromGitter | <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:25 | FromGitter | <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:45 | skrylar | i wonder if there is a flag to show how long a module takes to process. hmm |
07:33:04 | skrylar | i remember nico had some imports that slowed compiling down and i wasn't sure particularly why |
07:38:30 | shashlick | gogolxdong: what wrapper are you using for libvirt |
07:39:25 | FromGitter | <gogolxdong> libvirt-php for now |
07:41:10 | Arrrr | converters |
07:41:19 | Arrrr | Araq said they weren't optimized |
07:44:01 | FromGitter | <gogolxdong> Do you have any recommendation? |
07:47:46 | Arrrr | what's the issue? |
07:48:03 | * | vlad1777d joined #nim |
07:53:32 | shashlick | gogolxdong: I just wrapped all of libvirt (converted .h files into .nim) using nimgen |
07:53:36 | shashlick | took 20 minutes to setup the cfg file |
07:54:26 | shashlick | let me know if you need them to bind to the dll/so |
07:54:37 | FromGitter | <gogolxdong> great ,will you create a repository? |
07:56:33 | shashlick | I can eventually, but windows/linux? |
07:56:46 | FromGitter | <gogolxdong> What are you going to do with your nim wrapper? |
07:57:18 | shashlick | nothing 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:54 | FromGitter | <gogolxdong> wow, quick mind. |
08:00:20 | shashlick | so windows/linux? what's hte name of the DLL/so files |
08:01:44 | FromGitter | <gogolxdong> linux first, how about libvirt-nim.so? |
08:02:59 | shashlick | i'll just put libvirt.so for now, you can always change it however |
08:05:39 | FromGitter | <gogolxdong> alright. |
08:09:41 | FromGitter | <gogolxdong> I think I will finish the rest part as long as I have time. ;) |
08:12:09 | shashlick | ok so first install nimgen - https://github.com/genotrance/nimgen for steps, requires c2nim |
08:12:33 | shashlick | next clone libvirt from https://github.com/libvirt/libvirt |
08:12:38 | * | claudiuinberlin joined #nim |
08:13:59 | shashlick | copy libvirt.cfg from this gist as a sibling to the libvirt directory - https://gist.github.com/genotrance/bb5787c79f6cd2bf7043e4e36e9ed964 |
08:14:11 | shashlick | run > nimgen libvirt.cfg |
08:14:32 | shashlick | you should get a bunch of .nim files in the libvirt root directory |
08:15:37 | shashlick | import libvirt/libvirt |
08:15:45 | shashlick | hmm - does Nim not like - in module names? |
08:15:56 | skrylar | i should probably look in to c2nim someday |
08:16:09 | skrylar | i still just do it by hand, albeit with some regexps and stuff |
08:17:16 | FromGitter | <gogolxdong> got it, got a problem when nimble install c2nim |
08:17:52 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a02bdb0614889d475539224] |
08:18:33 | shashlick | nimble remove compiler |
08:18:34 | shashlick | nimble install compiler@#head |
08:18:42 | shashlick | then nimble install c2nim@#head |
08:18:51 | skrylar | i wonder if there would be a point in porting (loop) to nim |
08:19:40 | FromGitter | <gogolxdong> helpful. |
08:19:44 | FromGitter | <gogolxdong> thanks |
08:20:13 | skrylar | reminds me. debian backports has nim 0.17. have not seen if it works though |
08:20:19 | skrylar | arch also has 17, but its a broken one |
08:20:50 | * | gokr joined #nim |
08:21:53 | FromGitter | <gogolxdong> ```code paste, see link``` |
08:22:47 | * | endragor joined #nim |
08:23:16 | shashlick | nim -v? |
08:24:11 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a02bf2ae44c43700acf9b87] |
08:25:20 | shashlick | no idea I just compiled nim #head, then compiler #head then c2nim on Ubuntu |
08:26:25 | shashlick | anyway, looks like c2nim has generated a bunch of .nim files with _ in identifiers even tho nim doesn't like that |
08:26:34 | shashlick | so the code generated isn't quite useful yet |
08:27:27 | Araq | shashlick: you need to play with #prefix to tell c2nim what to do |
08:27:49 | Araq | though I can see a default of "produce wrong Nim code" is bad |
08:28:16 | skrylar | shashlick, well they can be IN an identifier, just not like.. on the edges |
08:28:19 | skrylar | which is sort of weird |
08:28:38 | skrylar | I'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:00 | Araq | well the idea here is that '_' is a word separator |
08:29:09 | shashlick | Araq: thanks - looking into it |
08:29:16 | shashlick | libvirt has _vir all over the place |
08:29:33 | skrylar | replacing _ with x and then renaming it back via importc[pp] works |
08:29:43 | skrylar | fltk has a couple semi-private vars that i had to do that with |
08:29:51 | shashlick | the other thing is that file names have - in them, and nim doesn't like that either in import statements |
08:30:39 | Araq | well yes, the filenames need to be valid Nim module names / identifiers |
08:30:53 | shashlick | nimbass is out by the way, works on WIndows, still some issues on Linux with LD path though |
08:30:54 | shashlick | https://github.com/genotrance/nimbass |
08:31:48 | Araq | gogolxdong: your nim is outdated :-) |
08:32:15 | FromGitter | <gogolxdong> haha, ok ,I am updating . |
08:34:44 | * | benoliver999 quit (Changing host) |
08:34:44 | * | benoliver999 joined #nim |
08:34:55 | shashlick | Araq: that's a complaint have for c2nim, you need nim on #head to get it working |
08:35:21 | Araq | I know, unfortunately the code wasn't patched via 'when compiles' |
08:35:45 | FromGitter | <mratsim> so Nimgen is a better c2nim? |
08:35:58 | Araq | yes, what's nimgen? |
08:36:55 | skrylar | last three headers for fltk, whee |
08:37:52 | shashlick | nimgen is a tool I've written to help automate wrapping libraries |
08:38:00 | shashlick | it uses c2nim behind the scenes |
08:38:07 | shashlick | https://github.com/genotrance/nimgen |
08:38:30 | shashlick | check out nimssl and nimbass which have been wrapped with nimgen |
08:38:35 | shashlick | c2nim still does all the heavy lifting |
08:42:33 | Araq | shashlick: seems nice but you have the 'nimgen' binary in your repo |
08:42:42 | Araq | don't do that :-) |
08:43:30 | shashlick | whoops :) |
08:43:31 | shashlick | didn't add it to the .gitignore looks like |
08:45:39 | PMunch | Yeah, adding Nim binaries to .gitignore is a bit of a pain |
08:46:13 | PMunch | .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:07 | Araq | I think Unix should finally get an '.exe' file extension |
08:52:40 | Araq | or maybe '.elf' if you hate Microsoft so much that you can't copy a single good idea from it |
08:53:24 | skrylar | or just don't add the binary in the first place >.< |
08:53:44 | Araq | filenames without extension are barbaric like dynamic typing |
08:53:58 | FromGitter | <alehander42> well .gitignore should be able to easily detect executables anywya |
08:55:23 | skrylar | https://stackoverflow.com/questions/5711120/gitignore-without-binary-files there appears to also be a means of ignoring all but a whitelist |
08:55:48 | skrylar | don'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:12 | skrylar | or just be more vigilant :f |
08:58:10 | Araq | kind of ironic that not even git properly deals with Unix's legacy |
08:58:32 | FromGitter | <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:57 | skrylar | probably because people tend to shove bins in a bin directory |
08:59:00 | Araq | nah that's wrong but I don't want to have this dicussion again |
08:59:02 | skrylar | which they just put in the gitignore |
08:59:50 | Araq | besides, an .exe is generated, a .py file is not |
09:00:08 | * | jjido joined #nim |
09:00:08 | FromGitter | <alehander42> :D I think some kind of wrapper around .gitignore is the only foolproof solution currently |
09:00:09 | Araq | so .exe would definitely would be an improvement for the whole Unix ecosystem |
09:00:23 | * | floppydh joined #nim |
09:00:29 | FromGitter | <alehander42> well a .py or .sh file can be generated as well |
09:00:45 | Araq | but usually it isn't and that's all that matters |
09:00:58 | skrylar | wondering if it would be a good or bad idea to dump evil-mode and also unbind cursor nav keys |
09:01:11 | Araq | an .exe is always generated. |
09:01:24 | FromGitter | <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:28 | FromGitter | <alehander42> not if it's executable |
09:01:47 | FromGitter | <alehander42> e.g. binary files are usually generated, huge and you don't need them, in vcs |
09:01:51 | Araq | so which other "binary" files lack an extension to filter against? |
09:01:52 | skrylar | with easymotion/avy/ace-jump in vimacs, its actually faster to use that (~4 keystrokes to go any location) for almost everything |
09:02:29 | Araq | lib*.so has .so |
09:02:33 | Araq | file.o has an .o |
09:02:42 | Araq | image.jpg has a .jpg |
09:03:09 | Araq | which one fails to work with filters? executables / elf binaries. |
09:03:24 | FromGitter | <alehander42> actually in this case one could just assume [x] is file && [x] has no ext |
09:03:30 | FromGitter | <alehander42> to be a good check for binary |
09:03:36 | Araq | CHANGELOG |
09:03:38 | Araq | README |
09:03:40 | FromGitter | <alehander42> but many text files have no extension too |
09:03:41 | Araq | LICENSE |
09:03:50 | Araq | yup. |
09:03:53 | FromGitter | <alehander42> I think that's the real weird thing :D |
09:06:07 | FromGitter | <alehander42> yep the text file thing sucks |
09:09:13 | Araq | it all sucks ;-) go to /usr/lib and try to read anything, all I see is the 'lib' prefix |
09:10:11 | Araq | my /usr/bin has files like 'w' or 'true' or 'what' |
09:10:56 | FromGitter | <alehander42> well true is a very useful program :D |
09:11:17 | * | chemist69 quit (Quit: WeeChat 1.9.1) |
09:11:27 | Araq | or '2to3' or 'a2p' |
09:11:49 | * | chemist69 joined #nim |
09:12:02 | FromGitter | <alehander42> well what's the problem with those (except no .exe) |
09:12:15 | * | chemist69 quit (Client Quit) |
09:12:35 | Araq | they are "polluting" my "global namespace" and I have no idea what they do |
09:13:18 | FromGitter | <alehander42> well surely you installed e.g. python's 2to3 |
09:13:48 | FromGitter | <alehander42> you have the freedom to augment your /usr/bin in "modules" |
09:14:07 | Araq | ha ha ha ha, I don't have the freedom to do anything |
09:14:25 | Araq | every tool relies on this bullshit structure that is forced on me |
09:15:27 | FromGitter | <alehander42> well world be hell if there was no convention as this |
09:15:45 | FromGitter | <alehander42> it's so much better on windows where every new program comes with e,g, packaged python interpreter |
09:15:51 | FromGitter | <alehander42> and 10 other things |
09:16:01 | * | chemist69 joined #nim |
09:16:31 | Araq | well at some point you can consider to improve your "conventions" or else computing will never have any progress. |
09:16:45 | shashlick | calling it, just too late to sit up, will remove the -_ from module names with nimgen tomorrow |
09:16:45 | FromGitter | <alehander42> ok, so what would be your solution for e.g. installing package binaries ? |
09:17:06 | Araq | it's 2017 now and I don't even want to look at my /usr/lib |
09:17:14 | shashlick | also need to figure out how to remove _ from variables in c2nim, will check that out later |
09:17:30 | FromGitter | <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:34 | Araq | when should I look again? in 2080? never? |
09:19:12 | PMunch | Hmm, should a named blocks be breakable without a named break? |
09:21:24 | Araq | PMunch: good question. probably not for the sake of Nim's macro system |
09:21:47 | PMunch | Currently it does, I was just wondering if this was on purpose |
09:22:06 | PMunch | And that's a good point |
09:22:10 | Araq | yes it's done on purpose but it's yet another minor thing we should change |
09:23:50 | Araq | alehander42: 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:02 | Araq | you 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:22 | Araq | it's easier to ignore C++'s misfeatures than Unix's. |
09:26:30 | Araq | that's the cold harsh truth you will never accept and so it lives on like a zombie eating your brain. ;-) |
09:28:35 | skrylar | Araq's new operating system, Nim 9. |
09:28:42 | FromGitter | <alehander42> but it's the same for other os-s each one has very annoying con-s |
09:29:02 | Araq | the other OSes have a real compatibility story |
09:29:26 | skrylar | admittedly plan 9 would have been neat. it did fix a lot of unix's stupidity |
09:29:26 | Araq | Linux really hasn't and so it free to innovate. |
09:30:09 | skrylar | p9 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:11 | skrylar | :| |
09:30:13 | FromGitter | <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:21 | FromGitter | <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:22 | FromGitter | <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:27 | skrylar | for me it was the random killshot updates, mratsim |
09:31:41 | * | jjido quit (Ping timeout: 268 seconds) |
09:32:07 | FromGitter | <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:35 | skrylar | linux doesn't innovate though |
09:32:45 | skrylar | they just clone stuff other clever people already made |
09:34:01 | skrylar | my 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:17 | FromGitter | <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:17 | FromGitter | <mratsim> They innovated on the package manager and signatures side ;) |
09:34:26 | skrylar | "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:42 | FromGitter | <data-man> Has anyone tried NixOS? https://nixos.org |
09:35:14 | Araq | alehander42: 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:14 | skrylar | nixos' concept is neat |
09:35:18 | FromGitter | <mratsim> In 20 years you will be able to say the same about Nim/D/Crystal/Pony vs Go :D |
09:35:27 | skrylar | Araq, appimages and fat binaries |
09:36:17 | * | obadz joined #nim |
09:37:22 | * | vlad1777d quit (Remote host closed the connection) |
09:37:39 | FromGitter | <alehander42> well you can use "containers" on existing windows/linux, that's the killer feature |
09:38:16 | PMunch | Hmm, is there a Salsa20 implementation for Nim out there somewhere? |
09:38:40 | skrylar | is there a reason you can't use one of sodium/nacls |
09:39:06 | * | xkapastel quit (Quit: Connection closed for inactivity) |
09:39:52 | FromGitter | <mratsim> My killer feature is having several independent containers + host sharing the same GPU simultaneously. |
09:40:14 | skrylar | containers are neat, i don't deny that |
09:40:54 | skrylar | i 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:22 | Araq | skrylar: Plan 9 still hasn't learned from Lisp though, I think something like S-expressions for program interoperability is a no-brainer |
09:41:31 | FromGitter | <mratsim> Btw @Araq whatever happened to OpenCL future support in Nim? Is that still planned? |
09:41:41 | floppydh | skrylar: ? cgroups are exactly that and Docker etc. rely on them? |
09:41:53 | PMunch | skrylar, yes. I'm implementing an existing file format |
09:42:01 | PMunch | Which uses Salsa20 |
09:42:17 | * | yglukhov joined #nim |
09:42:52 | skrylar | https://download.libsodium.org/libsodium/content/advanced/salsa20.html but... sodium has that ._. |
09:43:18 | PMunch | Oh 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:36 | Araq | mratsim: I'm waiting for ideas |
09:44:10 | skrylar | PMunch, a very good one, though. |
09:44:29 | skrylar | there is also tweenacl but i don't recall if it does salsa |
09:44:35 | Araq | I'd like to map Nim's "parallel" construct to OpenCL, but I never figured out the details |
09:44:51 | skrylar | i would like to understand opencl. it seems .. archaic, though |
09:44:53 | Araq | and 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:14 | PMunch | skrylar, hmm. Seems like the sodium bindings in nimble doesn't have Salsa20 |
09:57:06 | skrylar | isn't it like.. two functions |
09:58:28 | * | Jipok[m] joined #nim |
09:59:02 | PMunch | To do salsa20? |
09:59:24 | PMunch | Could be.. |
10:00:37 | * | Sentreen joined #nim |
10:01:06 | livcd | I 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:15 | PMunch | livcd, well, half of that is being able to make good defaults |
10:09:23 | PMunch | Which isn't always trivial |
10:10:04 | skrylar | PMunch, well i sent you the link to the doc page. it's literally 1 function, and no type definitions |
10:10:06 | floppydh | livcd: check in a dev-env in a Dockerfile, presto |
10:10:22 | skrylar | you don't even need a wrapper, you can just shove it in your project |
10:10:34 | skrylar | afaict |
10:10:50 | * | FromGitter joined #nim |
10:11:32 | PMunch | Yeah I guess I could importc it, but that's no fun :P |
10:11:48 | oprypin | last 30 minutes of messages were not bridged :( |
10:11:58 | oprypin | mratsim, might wanna check out IRC logs |
10:12:10 | oprypin | @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:08 | Arrrr | Does 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:04 | Araq | Arrrr: I doubt it |
10:58:35 | FromGitter | <mratsim> @oprypin thanks. |
11:01:12 | FromGitter | <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:48 | federico3 | PMunch: 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:34 | skrylar | Judy arrays were pretty awesome apparently |
11:11:52 | skrylar | I recall seeing a mention that on 64 bit systems they are a bit less of a major win |
11:12:28 | skrylar | their patent should be expiring Soon(tm), though if they're still relevant? no idea |
11:13:52 | * | dddddd joined #nim |
11:19:31 | skrylar | did manage to get tanh curve neurons working in nim earlier today, that was neat. |
11:19:44 | skrylar | haven't looked in to the training algorithms for SVMs |
11:20:49 | jjido | I suppose you use a table for "tanh curve" right? |
11:21:51 | * | endragor joined #nim |
11:26:53 | skrylar | I use a ghetto version of tensors, which in my case are just seqs of floats. |
11:28:13 | skrylar | i 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:13 | FromGitter | <mratsim> Just use Arraymancer ;). I'm pretty sure it's the fastest ndarray lib in any language. |
11:51:28 | PMunch | federico3, that would be nice. I'm currently implementing it in pure Nim just for fun |
11:54:24 | floppydh | mratsim that's one edgy README y ou wrote there |
12:05:22 | FromGitter | <mratsim> edgy? why? |
12:06:54 | floppydh | mratsim YOLO? :) |
12:08:33 | FromGitter | <mratsim> yes, because of this ;) : https://pjreddie.com/darknet/yolo/ |
12:09:23 | FromGitter | <mratsim> And his new real-time object detection paper: "YOLO9000: Better, Faster, Stronger” https://arxiv.org/abs/1612.08242 |
12:09:56 | skrylar | You Only Look Once |
12:10:06 | skrylar | that's being used in spy drones now ._. |
12:10:18 | FromGitter | <mratsim> The resume of this guy is impressive: https://pjreddie.com/static/Redmon%20Resume.pdf |
12:14:31 | * | elrood joined #nim |
12:20:59 | floppydh | mratsim incredible |
12:24:56 | FromGitter | <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:12 | yglukhov | mratsim: haha, it appears i do =) |
12:30:00 | skrylar | its a shame the parallela guy sold out to darpa |
12:30:09 | skrylar | those chips were interesting |
12:35:38 | skrylar | hmm. wonder if there are any simple resources on rich text rendering :x |
12:35:47 | skrylar | i know there is that online book "The Craft of Text Editing" for regular text |
12:43:21 | floppydh | skrylar: is it worthwhile a read? |
12:44:30 | jjido | Rich 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:13 | skrylar | floppydh, https://www.finseth.com/craft/ its alright |
13:01:20 | skrylar | if you want to know about the intestines of text editors |
13:07:20 | * | xet7 joined #nim |
13:07:25 | FromGitter | <data-man> http://antirez.com/news/108 - Writing an editor in less than 1000 lines of code |
13:07:35 | FromGitter | <data-man> |
13:11:20 | PMunch | Hmm, in Nim I want to define a uint8 array by char values. How would I do that? |
13:14:23 | Araq | PMunch: there is a new macro for that as a PR |
13:19:04 | arnetheduck | > <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:56 | PMunch | Araq, I just went for a char->uint8 converter for now. Works well enough |
13:20:23 | arnetheduck | I 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:11 | Araq | arnetheduck: 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:25 | Araq | if you need to attach things to the PSym use its ID mechanism |
13:29:44 | Araq | a TLoc doesn't need an ID |
13:31:35 | arnetheduck | Araq, 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:00 | Araq | ha, yeah it's a bitch but consider this |
13:33:33 | Araq | x = foo() # needs to end up in 'x' |
13:33:57 | Araq | g(foo()) # need to put into a temp |
13:34:44 | Araq | the 'dest: var TLoc' idea was the best I could come up with to model this constraint |
13:35:50 | Araq | but in retrospect I would have used an AST to AST transformation and then render the AST as C |
13:36:30 | arnetheduck | yes, 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:45 | Araq | that's with its own set of problems though, plenty of these things have no real Nim AST representation |
13:36:59 | Araq | C's rules for 'typedef' for example |
13:37:05 | Araq | or how we emit RTTI |
13:37:36 | * | SenasOzys quit (Remote host closed the connection) |
13:38:00 | arnetheduck | rtti 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:31 | Araq | back then not every C compiler could deal with my consts :-) |
13:39:32 | arnetheduck | not 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:00 | Araq | huh? you need to emit C types so that its optimizer can do its job |
13:40:43 | Araq | aliasing information for example depends on the types |
13:43:38 | arnetheduck | c types, yeah.. typedefs/type aliases? not sure what you mean |
13:44:27 | Araq | types are hard, they can be recursive and then you need a forward declaration like typedef struct x x; |
13:44:43 | Araq | and you need to ensure you only access *x before x is resolved completely |
13:46:27 | arnetheduck | speaking 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:02 | Araq | the conversions are just there to make C behave |
13:47:10 | Araq | LLVM doesn't need them |
13:47:28 | Araq | I don't want C's integer promotion rules, Nim has its own |
13:47:42 | * | endragor joined #nim |
13:47:46 | Araq | this 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:12 | arnetheduck | llvm 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:17 | jjido | Araq: see comments on this on OSNews |
13:51:22 | Araq | arnetheduck: yeah, we have nkHiddenConv for these but that's more annoying than helpful and so it's also often "skipped" |
13:51:30 | FromGitter | <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:55 | arnetheduck | the 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:10 | FromGitter | <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:26 | arnetheduck | same 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:12 | arnetheduck | instead, I have to cast every bool to a char to get the same behavior |
13:56:38 | arnetheduck | mratsim, 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:59 | GitDisc | <crem> Sorry, just a test. :) 10 blah |
13:57:00 | GitDisc | <crem> JOIN #testtest |
13:57:01 | * | Senketsu_ joined #nim |
13:57:56 | arnetheduck | Araq, I'd love consistent and correct nkHiddenConv's - would be so much easier to generate good code ;) |
13:58:22 | Araq | mratsim: yes, with --newruntime |
13:58:23 | arnetheduck | being there only sometimes, they suck indeed |
14:02:11 | * | Senketsu_ quit (Remote host closed the connection) |
14:03:48 | couven92 | Araq, 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:31 | gokr | Btw, the little arduinobot thing I wrote has been demoed twice and people like it. So a small win for Nim ;) |
14:04:32 | TjYoco | Anyone 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:43 | couven92 | I 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:48 | couven92 | But I am also okay with having `asArray` in the new `sugar` module as Araq suggested... |
14:07:02 | Araq | couven92: I like 'sugar' and want to add more to it :-) |
14:07:18 | couven92 | yeah, I though you might :D |
14:07:46 | couven92 | is `asArray` sugar, og rather a sequence utility macro? |
14:08:04 | couven92 | or: sequence/array utility macro? |
14:08:53 | * | xet7 quit (Ping timeout: 258 seconds) |
14:10:11 | PMunch | Hmm, given an array[32, uint8] can I pass a section of that to a procedure taking an array[4, uint8] |
14:10:24 | PMunch | Similar to what you could do with pointers in C |
14:13:03 | Araq | couven92: but ok, dom96 want it in sequtils, so move it to sequtils please so that we all can move on |
14:13:19 | couven92 | okay! :D |
14:14:05 | dom96 | TjYoco: did you try `nimble install ttf@#head`? |
14:16:55 | TjYoco | dom96 ttf I guess the problem is ttf isnt on nimble packages |
14:18:39 | yglukhov | TjYoco: just remove ttf from .nimble/pkgs, and `nimble install nimx` again |
14:19:04 | TjYoco | dom96 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:07 | couven92 | Araq, done. running tests now |
14:21:32 | * | xet7 joined #nim |
14:22:02 | PMunch | Hmm, it appears I can cast to an `array[4, uint8]` but not a `var array[4, uint8]` |
14:23:15 | PMunch | Just 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:11 | PMunch | Worked 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:10 | Araq | arrays are not pointers and you likely got your cast expression wrong |
14:34:17 | PMunch | So 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:37 | FromGitter | <couven92> cast[array4, uint8 (array) maybe? |
14:35:42 | * | endragor quit (Remote host closed the connection) |
14:36:20 | Arrrr | cast[ptr array[4, uint8]](addr(eight[4])) perhaps |
14:37:28 | Araq | Arrrr is correct, you need to deref this pointer then |
14:38:36 | * | endragor joined #nim |
14:38:57 | PMunch | But wouldn't that get my an array and not a var array? |
14:39:17 | PMunch | Or are dereferenced ptr things always assumed to be var? |
14:41:26 | Araq | you need the deref to please the type system |
14:41:55 | Araq | later the hidden & * cancel each other |
14:43:42 | * | endragor quit (Ping timeout: 260 seconds) |
14:47:27 | FromGitter | <dandevelo> Can a macro or template be used for this? https://gist.github.com/anonymous/9a185b706998d8df53f132ebb9f4d39e |
14:52:08 | Araq | yes |
14:52:41 | * | gokr quit (Ping timeout: 252 seconds) |
14:53:23 | * | endragor joined #nim |
14:53:53 | FromGitter | <dandevelo> @Araq: do you have any tips on where can I start? |
14:54:07 | TjYoco | https://nim-lang.org/docs/macros.html#statements-case-statement @dandevelo, here's the docs for case statement AST |
14:54:29 | PMunch | Try to wrap your output in a dumpAstGen call |
14:54:41 | PMunch | That will give you the Nim code needed to create that tree |
14:54:54 | couven92 | Araq, what happened here? It happened because I `import macros` in `sequtils` |
14:55:10 | Arrrr | you can do that with simple procs, unless you really want that syntax |
14:55:19 | Arrrr | use arrays |
14:56:12 | FromGitter | <dandevelo> Thank you @TjYoco @PMunch how would I parse the key:procname list? |
14:57:11 | PMunch | Use the dumpTree macro too see what it produces. Then simply traverse it as any other tree |
14:57:11 | couven92 | Araq, 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:49 | Araq | couven92: recursive dependency between macros and sequtils? |
14:59:14 | Arrrr | dandevelo https://gist.github.com/anonymous/297645188383c035366ffe45211a1df5 |
14:59:29 | couven92 | Araq, oh? Why only in nimscript? |
15:00:02 | couven92 | And is the right way to resolve this to put it into a `when not defined(nimscript)` block? because then it works |
15:01:52 | Araq | couven92: I'm wrong, macros.nim doesn't import anything |
15:05:11 | shashlick | Just curious from the survey, what library binding was most requested? |
15:05:13 | * | tefter joined #nim |
15:06:25 | couven92 | Araq, okay, what is wrong then? (I have no idea!) |
15:08:06 | Araq | couven92: me neither, will investigate later |
15:08:15 | * | Senketsu_ joined #nim |
15:10:49 | FromGitter | <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:42 | PMunch | shashlick, I think one of the ones that were mentioned in the survey summary post dom96 did was AWS |
15:23:40 | PMunch | https://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html |
15:24:10 | PMunch | That'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:14 | Arrrr | Is this a good idea? https://github.com/nim-lang/Nim/blob/devel/todo.txt#L5 |
16:57:22 | jjido | I think that is less surprising |
16:59:03 | * | chemist69 quit (Quit: WeeChat 1.9.1) |
16:59:31 | * | chemist69 joined #nim |
17:03:05 | shashlick | PMunch: I saw that but nothing stood out as must have |
17:03:39 | shashlick | nimbass 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:44 | planetis[m] | Has anyone used ormin? |
18:42:52 | dom96 | Araq: Another thing to add to your todo: a way for thread-local vars to be initialised by libraries |
18:43:26 | dom96 | ideally: 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:33 | dom96 | Turns 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:20 | planetis[m] | lol |
19:08:45 | * | JappleAck joined #nim |
19:10:16 | dom96 | Getting 1m req/s by just doing that... |
19:23:22 | * | Ven joined #nim |
19:23:33 | Arrrr | welcome to volkswagen |
19:23:45 | * | Ven is now known as Guest86124 |
19:24:31 | dom96 | haha |
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:41 | PMunch | Can I pass a Nim string to a function that takes an array of uint8? |
19:39:53 | PMunch | Or a seq[uint8] for that matter |
19:42:49 | PMunch | Apparently 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:52 | GitDisc | <treeform> hey dom96, there does seem to be a time zone library for nim? |
19:51:33 | GitDisc | <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:00 | PMunch | I'd be happy to have a quick look at it :) |
19:55:55 | * | miran joined #nim |
19:57:18 | * | Snircle joined #nim |
20:00:29 | GitDisc | <treeform> thanks PMunch, I am still working on it, but I will have some thing to show soon. |
20:01:38 | GitDisc | <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:48 | PMunch | As someone who just hade a TZ related bug I'm looking forward to what you come up with :) |
20:03:20 | PMunch | Not quite sure what the bug even was, but when we switches from DST it turned an hour in the wrong direction :P |
20:05:47 | shashlick | dom96: 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:27 | shashlick | I'm not asking to write to the space across threads, just read the value that was written |
20:07:31 | dom96 | treeform: might want to coordinate with the person that's making lots of stdlib times module PRs |
20:08:03 | dom96 | shashlick: That's basically what I want |
20:10:45 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:11:25 | shashlick | perhaps 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:02 | jjido | How is it a threadvar if it is written in one thread and read in other threads? |
20:26:22 | oprypin | jjido, who said it's read in other threads |
20:28:09 | GitDisc | <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:42 | PMunch | Mmm, pre-1970 would be a problem :P |
20:28:55 | GitDisc | <treeform> Morocco switches DST randomly 4 times in 2012! |
20:29:22 | PMunch | What? :P |
20:29:42 | GitDisc | <treeform> They do it with observance with the religious holidays so they don't have to fast as much, i believe. |
20:31:36 | PMunch | Aah, tricksy |
20:31:59 | GitDisc | <treeform> My time zone was -7:52:58 off from UTC until 1883 |
20:32:41 | GitDisc | <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:37 | GitDisc | <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:34 | PMunch | J2000? |
20:39:07 | GitDisc | <treeform> On some years leap seconds are added to account for the fact that Earth orbit is a little random. |
20:39:40 | GitDisc | <treeform> What computers do is just slow down the clock. |
20:39:46 | PMunch | Oh right, never heard the term J2000 |
20:39:53 | PMunch | Leap seconds I'm familiar with |
20:39:55 | * | Vladar quit (Quit: Leaving) |
20:40:07 | GitDisc | <treeform> J2000 is like unix 1970 |
20:40:28 | GitDisc | <treeform> but its time stamps are in real seconds not unix stretchy seconds. |
20:40:47 | GitDisc | <treeform> They matched on year 2000 but have been drifting ever sense |
20:41:07 | planetis[m] | ormin is nice btw although I haven't used a ORM before |
20:41:13 | PMunch | Huh, that I didn't know |
20:43:38 | GitDisc | <treeform> if you have leap seconds table, which is known, you can convert between them by stretching unix seconds a bit. |
20:44:24 | GitDisc | <treeform> may nim-powered spacecrafts never crash. |
20:47:29 | PMunch | Very interesting indeed |
20:48:15 | PMunch | I'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:35 | GitDisc | <treeform> Oh really? Are you using nim for this? |
20:49:55 | PMunch | Unfortunately not :( |
20:50:05 | PMunch | But I hope I might convert some people as time goes by |
20:50:17 | PMunch | Currently we use C++ and Ruby, so Nim would be a great candidate |
20:50:25 | GitDisc | <treeform> maybe if nim had support for J2000 it would be easier? |
20:51:24 | * | martinium joined #nim |
20:51:26 | GitDisc | <treeform> I bet though, such level of accuracy might not be required. |
20:52:00 | GitDisc | <treeform> Its just programmers thing trying to be, fastest, most accurate etc... |
20:55:17 | PMunch | Well, I think all of that is neatly packed away in some module no-one touches any longer :P |
20:55:39 | PMunch | But showing that Nim has support for it would definitely be a plus |
20:56:45 | * | Ven_ joined #nim |
20:58:34 | FromGitter | <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:46 | FromGitter | <jdhorwitz> I assume I would use an empty sequence and add to it? |
20:58:59 | FromGitter | <jdhorwitz> but in context I'm not sure, any help would be much appreciated |
21:02:32 | FromGitter | <mratsim> ping @dom96 |
21:02:42 | dom96 | yes? |
21:02:44 | FromGitter | <mratsim> He is the author ;) |
21:03:21 | * | Ven_ quit (Ping timeout: 240 seconds) |
21:03:29 | GitDisc | <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:32 | PMunch | Hmm, 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:49 | dom96 | jdhorwitz: 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:25 | shashlick | jjido: 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:27 | shashlick | Ideally, a var type that can be read by all threads but owned by only one thread |
21:44:55 | * | vlad1777d joined #nim |
21:45:16 | shashlick | especially 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:39 | shashlick | (with changes propagating to the child threads that is) |
21:49:57 | * | xkapastel joined #nim |
21:50:16 | PMunch | Hmm, 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:50 | GitDisc | <awr> mapIt(toSeq(myString.items), cast[it](uint8)) |
21:56:59 | GitDisc | <awr> whoops |
21:57:05 | GitDisc | <awr> cast[uint8](it) |
22:02:16 | * | ketralni` quit (Quit: Coyote finally caught me) |
22:02:55 | GitDisc | <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:59 | GitDisc | <awr> actually you don't need to use toseq on items at all |
22:08:07 | * | martinium joined #nim |
22:08:22 | GitDisc | <awr> var x = "blah blah here's a cool string" |
22:08:24 | * | martinium quit (Client Quit) |
22:08:37 | GitDisc | <awr> var n = x.mapIt(cast[uint8](it)) |
22:08:58 | GitDisc | <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:35 | PMunch | Ah, mapIt would work of course |
22:20:53 | PMunch | This doesn't have to be terribly efficient |
22:25:55 | * | xet7 quit (Read error: Connection reset by peer) |
22:29:45 | FromGitter | <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:16 | jjido | shashlick: 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:26 | elrood | PMunch, 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:59 | PMunch | Hmm, I think you'd get some extra stuff if you did that |
22:40:07 | PMunch | Nim strings aren't C char arrays |
22:42:32 | FromGitter | <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:50 | FromGitter | <Varriount> Why not just convert to a cstring? |
22:42:59 | * | xet7 joined #nim |
22:45:14 | PMunch | Yeah I've found a workaround |
22:45:43 | PMunch | Creating 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:46 | elrood | PMunch, 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:51 | elrood | they'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:56 | dom96 | Nim strings are a length + char pointer AFAIK |
23:06:23 | dom96 | You 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:37 | bkerin | hmm what's wrong with this declaration: var typeTable: TableRef[string, string] = newTable[string, string] |
23:54:07 | bkerin | nim says newTable has no type or is ambiguous |
23:57:19 | bkerin | ah nm i got it missing parens |
23:57:48 | GitDisc | <awr> if i'm compiling to emscripten should i set the cpu to "js" in the compiler options |