Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2015-06-26

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:51 vicash sivoais: this reddit post needs some IPerl love https://www.reddit.com/r/perl/comments/3b3ie6/is_there_anything_out_there_for_learning_perl_via/
01:05 * sivoais nods... I have stuff planned. Mostly for data science things, but jberger has shown me that Mojolicious might be a good target for IPerl too
01:06 sivoais turning the book "Data Munging with Perl" into notebooks might be useful
01:09 * sivoais is currently building all previous version of PDL... or at least... attempting to
02:55 jberger sivoais: just say the word
15:25 sivoais TIL: C11 has a feature called _Generic() that lets you do switches on types
15:25 sivoais <http://www.robertgamble.net/2012/01/c11-generic-selections.html>
15:30 sivoais what compilers besides gcc and clang does PDL support?
15:30 sivoais ah, MSVC...
15:31 sivoais keep forgetting about that since they botched up certain standard library functions quite badly
15:33 vicash sivoais: which ones ?
15:35 sivoais I remember snprintf()
15:35 sivoais it doesn't return the number of characters that would have been written given enough space
15:37 vicash maybe you can switch to the String Safe variants that are MSFT only but are more safe and secure and work the way you expect it to. They also handle unicode and non-unicode correctly.
15:37 vicash #include <strsafe.h>
15:37 vicash so Snprintf would be StringCchPrintf
15:43 sivoais unicode :-) Nice. I haven't dealt too much with Unicode in C
15:43 sivoais I'd probably go with libicu for that
15:44 vicash yes, StringCchPrintf prints characters which could be multiple bytes, but StringCbPrintf prints bytes. If you compile the code in ANSI mode then StringCchPrintf is the same as StringCbPrintf but if you compile in UNICODE mode then it automatically handles multiple bytes of characters such as in UTF8
15:46 sivoais vicash: I suppose Unicode mode is not meant to be used in cmd.exe?
15:46 vicash not really. cmd.exe can run Unicode compiled software
15:47 vicash by default now MSFT recommends you use Unicode mode so that your software works in all locales
15:47 * sivoais nods
15:47 vicash the Unicode mode is just for automated string handling by the Win32 API
15:48 sivoais ah, I see. That's good. It is 2015 after all!
15:48 sivoais now... IPv6...
15:48 vicash its been around for more than 10 years now
15:49 vicash yea if a socket library can do both IPv4 and v6 together that would be better.. or automatically backport the IPv4 to IPv6 calls
15:49 sivoais it looks like MSVC won't be support C11's _Generic()
15:49 sivoais *supporting
15:49 vicash MSVC is slower in supporting C/C++ standards
15:49 vicash it has to coincide with their Visual Studio offerings
15:50 vicash plus fancy features are not used by most folks anyway.. so it makes sense to postpone the support and wait for gcc to do it first
15:51 vicash even then the LTS systems like RedHat and Debian do not support the Cxx11 standards
15:52 sivoais both gcc and clang already support it
15:52 sivoais don't know about on LTS
15:52 sivoais I'm actually thinking that it might simplify work on PDL3
15:55 vicash i run Debian 7 and could not build libbitcoin because they use gcc4.9 which Debian 7 doesn't support since it has gcc 4.7 and no backports of gcc 4.9 which does the C++11 standard.. Debian 8.1 which released in April supports gcc4.9 by default
15:55 vicash but i guess if PDL3 comes out in 2 years then it may make sense.. something to see
15:55 vicash you could use Perl to auto-generate the C code. i mean that's what Perl is good at..
15:56 sivoais I think it might take that long to iterate. You make very good point...
15:57 sivoais with a C parser, Perl can be used to generate the code for different types, just as PDL::PP does now
15:57 vicash yea mohawk had asked me to work on PDL::BadValues a few months back and i did do some minor work, but PDL is a lot of work
15:57 vicash yea and you could use the Inline::C parser if it is a module
15:58 sivoais and with a C parser, perhaps _Generic() can be backported to older compilers
15:58 vicash yea that's the way i would go about it...
15:59 vicash you could also use C Macros to do it but using Perl to do it will be more maintainable
15:59 * sivoais has read C code generated by awk
16:01 vicash some years ago we used to generate high speed serialization code for C/C++ classes using Perl.. used special comments to markup a C/C++ header file and used perl to read it and auto-generate serialization code that would then be unit-tested also using perl
16:05 sivoais nice!
16:07 vicash writing unit tests is annoying, so auto-generating at least most of them is more fun
16:08 vicash like i am writing this simple Mojo app with about 5-10 routes, and i have to manually add each route to the Unit test to make sure they work.. i would think Test::Mojo can just detect all the routes from the Controller class on its own and auto-test each route
16:08 vicash i shouldn't have to add it
16:14 sivoais yeah, generating test stubs is something that I need to incorporate into my workflow
16:17 jberger vicash: you can iterate over the routes, but what would the placeholder values be?
16:20 vicash jberger : hmm... i have to try iterating over the routes first to see what you mean by placeholder value
16:31 jberger '/path/:placeholder/thing'
16:31 sivoais I have to admit, if a tool could look at a route /route/to/:id and realise that points at a id column in a database then autogenerate tests... I'd be impressed
16:32 jberger plus the router is a tree, so you have to handle nesting
16:32 jberger sivoais: you could try
16:32 jberger vicash: this is a place to start
16:32 jberger https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Command/routes.pm
16:33 jberger the routes command iterates over the route tree in order to display it
16:33 vicash jberger: yes, i need to read more but i am not using the placeholder format currently..  if and when i get to that, maybe i will have a better idea of how to do it
20:19 jberger joined #pdl
22:16 opkick [devops] zmughal pushed 4 new commits to master: http://git.io/vt8bw
22:16 opkick devops/master edf3ec5 Zakariyya Mughal: regression VM: also download old version of ExtUtils::ParseXS...
22:16 opkick devops/master 29f3138 Zakariyya Mughal: regression VM: sort the versions of PDL for running tests
22:16 opkick devops/master 6906ee2 Zakariyya Mughal: regression VM: use the version order when dumping versions
23:15 opkick [devops] zmughal pushed 4 new commits to master: http://git.io/vt4IF
23:15 opkick devops/master caf1b9f Zakariyya Mughal: regression VM: install git in VM
23:15 opkick devops/master 3263ebb Zakariyya Mughal: regression VM: set up git user config
23:15 opkick devops/master 017c9ec Zakariyya Mughal: regression VM: update gitignore
23:29 sivoais is this an easy way to see that there are no regressions : <https://github.com/zmughal/pdl-regression-logs/blame/sf390/log>
23:31 sivoais since 2008 (7 years), the tests have had the same results
23:31 sivoais and sometime before that, bad value support was not the default

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary