Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-lwp-gsoc, 2014-07-08

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:45 FROGGS_ joined #perl6-lwp-gsoc
06:09 sergot o/
06:40 FROGGS_ morning
07:30 FROGGS_ joined #perl6-lwp-gsoc
11:29 dalek io-socket-ssl: 9d03690 | sergot++ | / (3 files):
11:29 dalek io-socket-ssl: empty project
11:29 dalek io-socket-ssl: review: https://github.com/sergot/io-socket-ssl/commit/9d03690a7b
11:32 sergot FROGGS_: is it a good idea to create new, OpenSSL module instead of using grondilu's fork? Does it make sense?
11:38 FROGGS_ sergot: yes, start afresh
11:39 sergot good :)
11:44 sergot Ok, I named it OpenSSL
11:44 dalek openssl: 870151a | sergot++ | / (3 files):
11:44 dalek openssl: empty project
11:44 dalek openssl: review: https://github.com/sergot/openssl/commit/870151ac31
11:45 FROGGS_ +1
11:46 FROGGS_ I'd recommend that the C bindings should be as low level as possible
11:46 FROGGS_ and then make a sugar lager somewhere else
11:47 sergot My frist idea was to do the bindings in OpenSSL::* and write a nice wrapper in OpenSSL.pm6
12:46 sergot but, we'll see
12:47 dalek openssl: a8b7102 | sergot++ | lib/OpenSSL.pm6:
12:47 dalek openssl: ssl bidings moved
12:47 dalek openssl: review: https://github.com/sergot/openssl/commit/a8b710230b
12:50 dalek openssl: f7c690f | sergot++ | / (2 files):
12:50 dalek openssl: dependency added
12:50 dalek openssl: review: https://github.com/sergot/openssl/commit/f7c690ff91
12:51 FROGGS_ I also wanna do that for SDL...
12:51 sergot When pre-compiling a module, its dependencies must be pre-compiled first.
12:51 sergot hmmm
12:51 sergot a problem with NativeCall
12:52 FROGGS_ bindings to the C struct SDL_surface as a CStruct repr called SDL_surface, and then have a Perl 6 level class SDL::Surface that the user will use
12:52 FROGGS_ sergot: pull reakudo
12:52 FROGGS_ rakudo*
12:52 sergot ok
12:52 sergot I'll try to wrap it nicely :)
12:52 FROGGS_ :o)
13:09 sergot FROGGS_: how to write a destructor in p6?
13:11 FROGGS_ sergot: you dont
13:11 sergot why so?
13:12 FROGGS_ because our GC does not guarantee to call your destructor
13:12 sergot hmm, ok
13:15 dalek io-socket-ssl: f311e60 | sergot++ | lib/IO/Socket/SSL.pm6:
13:15 dalek io-socket-ssl: IO::Socket::SSL prototype
13:15 dalek io-socket-ssl: review: https://github.com/sergot/io-socket-ssl/commit/f311e60299
13:16 dalek io-socket-ssl: e01655a | sergot++ | client.c:
13:16 dalek io-socket-ssl: client.c added
13:16 dalek io-socket-ssl: review: https://github.com/sergot/io-socket-ssl/commit/e01655a747
13:30 sergot FROGGS_: is it better to writer proto and multi sub, or sub with is native and is export?
13:31 sergot 2 subs (proto and multi) look better I think
13:32 FROGGS_ a multi for what?
13:32 sergot e.g. SSL_librabry_init
13:32 sergot can be:
13:32 sergot sub SSL_library_init() is native(...) is export { * }
13:32 sergot or:
13:33 sergot proto SSL_library_init($) { * };
13:33 sergot multi SSL_library_init() is native(...) { * }
13:33 FROGGS_ why is it a multi?
13:33 FROGGS_ (besides that the prototype is wrong)
13:34 sergot (|) should be therE?
13:34 FROGGS_ you only need multis when you have several candidates
13:34 FROGGS_ in case that sub never takes arguments then () would do
13:34 sergot I guess proto and sub wont work, the second one have to be multi
13:34 FROGGS_ why do you want a proto at all?
13:35 sergot to avoid is .. is .. twice
13:35 sergot is export in proto, is native in sub
13:35 FROGGS_ ahh
13:35 sergot Just wanted to know if there is a standard for that
13:35 FROGGS_ no, do not misuse a proto for that
13:37 sergot okk
13:37 FROGGS_ apply both traits, or in case it is alreay implemented define the libname globally
13:37 FROGGS_ and you don't even have to export the subs
13:37 FROGGS_ make them our subs and access them via the package name
13:38 FROGGS_ I meant, that low level stuff is low level after all, you only need it in the sugary class
13:39 sergot okok
13:44 dalek io-socket-ssl: 574b58a | sergot++ | lib/IO/Socket/SSL.pm6:
13:44 dalek io-socket-ssl: IO::Socket::SSL prototype added
13:44 dalek io-socket-ssl: review: https://github.com/sergot/io-socket-ssl/commit/574b58ab20
13:45 dalek openssl: 4fd5c92 | sergot++ | lib/OpenSSL.pm6:
13:45 dalek openssl: our added
13:45 dalek openssl: review: https://github.com/sergot/openssl/commit/4fd5c9213e
13:50 dalek openssl: e515269 | sergot++ | t/01-basic.t:
13:50 dalek openssl: first test added
13:50 dalek openssl: review: https://github.com/sergot/openssl/commit/e5152693bd
13:52 sergot I should definitely write a wrapper for OpenSSL bindings
13:52 sergot FROGGS_: can I write it as a class?
13:52 sergot It sounds nice.
13:52 FROGGS_ it can be a class yes
13:52 FROGGS_ but the mapped C functions must be subs
13:52 sergot my $ssl = OpenSSL.new(); $ssl.set-v23-client-method; $ssl.connect(); $ssl.something.
13:53 sergot yes yes
13:54 FROGGS_ sergot: you'd have to map the method to the sub call
13:54 FROGGS_ but that is the job of the sugar class IMO
13:57 sergot that's what I want to do in class OpenSSL {}
14:16 FROGGS_ ahh
14:17 FROGGS_ yes, create a class that has nicely named methods that either map to nativecall subs or that do a specific task (i.e. map to a bunch of subs)
14:17 FROGGS_ bbiab
14:40 FROGGS joined #perl6-lwp-gsoc

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary