IRC logs of #shogun for Thursday, 2019-04-18

--- Log opened Thu Apr 18 00:00:41 2019
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun01:21
-!- mode/#shogun [+o wiking] by ChanServ01:21
-!- wiking [~wiking@huwico/staff/wiking] has quit [Ping timeout: 255 seconds]01:26
-!- wiking_ [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun07:49
-!- wiking_ [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection]07:56
-!- wiking_ [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun07:57
-!- wiking_ [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection]08:15
-!- wiking_ [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun08:48
-!- gf712 [905208d0@gateway/web/freenode/ip.144.82.8.208] has joined #shogun09:14
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has joined #shogun09:36
-!- wiking_ [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection]10:28
-!- gf712 [905208d0@gateway/web/freenode/ip.144.82.8.208] has quit [Ping timeout: 256 seconds]10:32
-!- wiking_ [~wiking@ict-networks-195-176-113-192.fwd-v4.ethz.ch] has joined #shogun10:47
wiking_ /msg nickserv ghost wiking kitscHme11:02
wiking_haha11:02
wiking_that one is gone then11:02
-!- wiking_ is now known as wiking11:02
-!- wiking [~wiking@ict-networks-195-176-113-192.fwd-v4.ethz.ch] has quit [Changing host]11:02
-!- wiking [~wiking@huwico/staff/wiking] has joined #shogun11:02
-!- mode/#shogun [+o wiking] by ChanServ11:03
@wikinggeektoni: around?11:12
geektoniwiking: yup11:13
@wikingok so swig q11:14
@wikingare you up for it? :)11:14
@wikingbecause i'm like gonna give up on this project soon if i dont find a neet solution11:14
@wiking:)11:14
geektonilol i will try11:15
@wikingok so i have this problem11:15
@wikingthat we used to have a java code11:15
@wikingin SWIG11:15
@wikingto support java object externalization11:15
@wikingbasically it's an SGO extension11:15
@wiking(class extension)11:15
@wikingfor supporting https://docs.oracle.com/javase/7/docs/api/java/io/Externalizable.html11:16
@wikingbasically this is to be able to do in java11:16
@wikingserialization11:16
@wikingusing java framework11:16
@wikinginstead of going knee deep into shogun stuff11:17
@wikingwhich is great i think11:17
@wikingwe do have this for pickle in python11:17
@wikinganyhow11:17
@wikingi'm having problems with swig mappings because11:17
@wikingi export json serialization objects11:17
@wikingto swig... so i can create those in jvm as well. those inherit from CSerializer/CDeserializer11:18
@wikingand there's an interface in sgo: SGO::serializer(CSerializer*) and the deserilizer part as well11:18
@wikingbut say now i create JsonDeserizlizer in JVM11:18
@wikingand do sgo.deserilize(jsonDeserializer)11:19
@wikingthe java complains that it cannot convert jsonDeserializer to CDeserializer11:19
@wikingas if inheritence is being ignored11:19
geektoniI see I see11:19
@wikingnow of course we can say that yeey cool it's because i have not added CDeserializer to swig11:19
@wikingbut and here comes the shitty part11:19
@wikingi haven't added those because all these things are working with Some<Class>11:20
@wikingand now i'm like either i drop Some so that there's a chance (as inheritance should work in swig see Features etc)11:20
@wikingor that somehow i add Some support11:20
geektoniso11:20
geektonifrom my experience11:20
@wikingdropping some is not a good idea because then i'm back to the same asdf with SG_REF and so on11:20
geektoniyou should avoid to expose Some from SWIG11:21
geektoniyes yes, I know11:21
@wiking:<11:21
@wikingbut imo there should be a way11:21
@wikingto support some in swig no?11:21
@wikingi mean in the first place having Some instead of std::shared_ptr11:21
@wikingis because we wanna be able to use that one day11:21
@wikingotherwise we could just use std::shared_ptr in the first place no? :)11:22
@wiking(there's no need to have some as we have already c++14 required)11:22
geektoniyes, exactly. I mean, SWIG should already support shared_ptr natively11:22
geektoniI didn't look into it yet11:22
geektonibut I guess it will be much easier to use11:22
@wikingit does11:22
@wikingbut not for all targets11:23
@wikingi mean maybe this is fixed in the upcoming 4.0 release11:23
@wiking(there's already an rc1 released from that)11:23
geektonithan to come up with our version of shared_ptr and with out version of the interface mapping11:23
@wikingmmm on the other hand11:24
@wikingi've just checked swig master11:24
@wikingall the target langs we are interested in11:24
@wikinghas boost_shared_ptr.i11:25
@wikingwhich is basically the support for std::shared_ptr11:25
@wikingso11:26
@wikingmaaaaybe11:26
@wikingits' actually better to start doing some->shared_ptr11:26
@wiking?11:26
@wikingand finally have all things in the c++ interface use shared_ptr as well?11:26
@wikinglemme ping lisitsyn11:26
lisitsynhello11:27
@wikingok so lisitsyn^11:27
lisitsynyes11:27
geektoniif we want to drop SG_REF/SG_UNREF some day I guess we need to start from somewhere ;)11:27
@wikingis there any specific reason why we wanna have Some instead of shared_ptr11:27
lisitsynah you want to get rid of pointer in swig?11:27
@wikinglisitsyn: at least wanna be able to have either Some or shared_ptr11:28
lisitsynthe only reason is sg_ref11:28
@wikingdont care what11:28
@wikingok but11:28
@wikingif all swig supports11:28
@wiking(the languages we use) shared_ptr11:28
lisitsynapart from that you can do using shared_ptr<T> = Some<T>11:28
lisitsynor typedef whatever :)11:28
@wikingyeah i get what you mean11:28
@wikingbut i mean what is the blocker11:28
@wikingfrom us using shared_ptr ?11:28
@wikingwe could just drop sg_ref right?11:28
@wikingif we use shared_ptr/some11:29
@wiking(i mean with current some not as that relies on sg_ref)11:29
@wikingbut see what i mean?11:29
lisitsynnot yet11:29
@wikingok so11:29
@wikingsay we start porting everything11:29
@wikingwhere we pass PTRs in c++ api11:29
@wikingto shared_ptr11:29
@wikingand say swig supports its (as it does 3.0.12)11:30
lisitsynoh that sounds like a great endeavour :)11:30
lisitsynbut ok11:30
@wikingyeye it's crazy11:30
@wikingbut lets say that we do this11:30
@wikingbut what is the thing11:30
lisitsynthen I don't see any problem11:30
@wikingthat would be shooting our leg?11:30
@wikinglisitsyn: currently for example i have this problem11:30
@wikingthat either i drop11:30
@wikingSome11:30
lisitsynI think there is none but the complexity of transforming all the stuff11:30
@wikingin serialization11:30
@wikingor somehow make Some work in SWIG11:31
lisitsynit doesn't matter if you have Some or shared_ptr they are jjust the same :)11:31
@wikingyeye11:31
@wikingindeed11:31
@wikingso i was just wondering11:31
@wikingsince we could use shared_ptr11:31
@wiking(apparently)11:31
@wikingfrom the developer point of view11:31
@wikingmaybe it's easier to name as is11:31
@wikingand use std:: instead of sg_ref et al?11:32
@wikingbecause if we use std::shared_ptr11:32
@wikingwe pretty much can drop m_refcount11:32
@wikingright?11:32
@wikingin sgo11:32
lisitsynyeah sure11:32
@wikingand then all the SG_REF/UNREF11:32
@wikingis gone as well11:32
@wikingfrom c++11:32
@wikingokey11:32
@wikingi mean with libtooling11:32
@wikingto replace all the fucking place11:33
@wikingof creating objects11:33
@wikingwhere object is an SGO-like11:33
@wikingshould not be more than 80 lines11:33
@wikingand replace the code with shared_ptr11:33
lisitsynI like your bravery! :)11:33
@wikingi mean i've done this11:33
@wikingwith SHOGUN_EXPORT11:33
@wikingfor windows11:33
lisitsyngeneralmente yes, you can do that and it should work11:33
@wikingso i have the codebase there for libtooling11:33
@wikingand we dont wanna have11:34
@wikingstd::unique_ptr11:34
@wikingat least not that is exposed to swig11:34
@wikingas that's anyways would be tricky11:34
@wikingwith passing ownership around11:34
lisitsynsure, unique_ptr has no place in the interface11:34
@wikingok11:34
@wikingso11:34
lisitsynit is all shared_ptr11:34
@wikingsay i start a feature branch :)11:34
@wikingand first replace things with libtooling11:35
@wikingto shared_ptr11:35
@wikingi'm just wondering11:35
lisitsynyeah if you're in a psycho killer mood then you might want to try11:35
lisitsyn:)11:35
@wikingabout inhertiance shit11:35
lisitsynwhat inheritance?11:35
@wikingi mean11:35
@wikingsomehow something tells me11:35
@wikingthat we had some problems with inherited objs11:35
@wikingbut i'm just maybe dreaming here11:35
@wikingbut it should work that say11:35
@wikingtrain(std::shared_ptr<CFeatures> data)11:36
lisitsynah this thing11:36
@wikingand then i pass a std::shared_ptr<DenseFeatures<float64_t>>11:36
@wikingoooor?11:36
@wikinggeektoni: ^11:36
@wikinghttps://stackoverflow.com/questions/1358143/downcasting-shared-ptrbase-to-shared-ptrderived11:36
@wikingapparently works the downcasting11:37
@wiking(we do this a lot)11:37
lisitsynI think this should work yeah11:37
@wikingand upcasting should be automagic?11:37
@wikingjust as usual ptr?11:37
lisitsynuhmm?11:37
lisitsynit's only one way ticket11:37
lisitsynwhat do you mean?11:37
@wikingso say i get a shared_ptr<LibLinear>11:38
@wikingand then i wanna do11:38
@wikingobj.put("machine", shared_ptr<LibLinear>)11:38
@wikingright?11:38
@wikingor the same like11:38
lisitsynoh that's a tricky thing actually11:39
lisitsynI think put/get is suited for pointers now11:39
@wikingwhere we have obj.set_machine(CMachine*)11:39
@wikingyes11:39
@wikingthat is for sure11:39
@wikingand there needs to be some crazy hacking11:39
@wikingi'm just wondering11:39
@wikingwhether there's a blocker11:39
@wikingthat goes super crazy11:39
@wikingor it's managable11:39
@wikingi mean currently anyways there's a dispatch code right?11:39
lisitsynI can't see any clearly but there might be some (whoknows)11:39
lisitsynyeah11:40
@wikingi mean the thing is of course11:40
@wikingnow the put11:40
@wikingis expecting an SGOPtr11:40
lisitsynyeah you just get the raw pointer and dispatch it11:40
@wikingthe right change of this will be11:40
@wikingshared_ptr<SGO>11:40
@wikingbut then11:40
@wikingwhat if i try to use that interface11:40
@wikingand i have a shared_ptr<LibLinear>11:41
@wikingi mean the caller should do the typecasting unfortunately11:41
@wikingor this is supported out of box?11:41
@wiking(upcasting that is)11:41
lisitsynit is in a copy constructor11:41
lisitsyn(at least in Some)11:41
@wikingi mean i'm quite sure tha tactualy11:42
@wikingthis quite of casting is not automagic11:42
@wikingbut godbolt will tell me i guess :)11:42
lisitsynthat is the copy constructor I was fixing in beograd :D :D11:42
@wikinghttps://stackoverflow.com/a/21019216/279887511:42
@wikingok since we cannot hax0r shared_ptr11:43
@wikingmaybe this is the reason we wanna have some?11:43
@wikingok i gotta run now11:43
lisitsynSG_REF was the main reason11:43
lisitsynbut having your own (but compatible) class might be of some benifit11:43
@wikingwill leave the console here11:43
lisitsynmaybe some leaking memory tracking or etc11:43
@wikingso it'll log shit11:43
@wikingbut i gotta run11:44
lisitsynyeah I have to run too11:44
lisitsyn:)11:44
@wikingttyl11:44
@wikingthnx11:44
-!- HeikoS [~heiko@69.pool85-48-187.static.orange.es] has joined #shogun12:00
-!- mode/#shogun [+o HeikoS] by ChanServ12:00
@HeikoSwiking: yo!12:00
@HeikoSgeektoni: hi!12:00
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has quit [Ping timeout: 256 seconds]12:01
@HeikoSlisitsyn:12:19
-!- HeikoS [~heiko@69.pool85-48-187.static.orange.es] has quit [Ping timeout: 246 seconds]13:07
-!- HeikoS [~heiko@112.pool85-48-187.static.orange.es] has joined #shogun13:10
-!- mode/#shogun [+o HeikoS] by ChanServ13:10
-!- HeikoS [~heiko@112.pool85-48-187.static.orange.es] has quit [Ping timeout: 255 seconds]13:28
-!- gf712 [1f0ef8ff@gateway/web/freenode/ip.31.14.248.255] has joined #shogun14:27
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has joined #shogun15:15
@wikingok15:39
@wikingso lisitsyn with all that in mind15:39
@wikinglisitsyn: seems we should be good to go15:40
@wikinghttps://godbolt.org/z/TXYQdm15:40
@wikinggf712: here we go15:40
@wikinggit checkout -b feature/smart_ptr :)15:40
@wikinggeektoni: ^15:40
@wikingseems like a good plan to waste easter holidays15:40
@wiking:D15:40
geektoniwiking: ahah we don't need holidays15:45
@wiking:>15:46
@wikingaaha man doxygen of llvm15:48
@wikingnow that is a blackhole for time :)15:48
-!- durovo [~durovo@a3.c8.2fa9.ip4.static.sl-reverse.com] has quit [Read error: Connection reset by peer]16:08
-!- durovo [~durovo@a3.c8.2fa9.ip4.static.sl-reverse.com] has joined #shogun16:09
@wikingahhahaha16:09
@wikinggeektoni: can you believe that this is the class def in doxygen of llvm16:10
@wiking"Engages in a tight little dance with the lexer to efficiently preprocess tokens. More..."16:10
geektoniwiking: they do have a sense of humor LoL16:11
@wiking:)16:11
geektoniwiking: you know, I tried to work with LLVM once, but, as you saw, I was quickly brought to desperation by their docs.16:12
geektoniI hope they improved them a bit in the last few years.16:12
@wikinghehehe yeah16:12
@wikingnoup16:12
@wiking:)16:12
@wikingits doxygen16:12
@wikingand most of the things are not actually doxygenized16:12
@wikingso you go to src16:12
@wikingand then check wtf is actually doing16:12
geektoniehehe thought so16:13
@wikinggf712: here?16:13
geektonibtw is it still a pain to compile it from source?16:13
@wikinggeektoni: not daring to try16:14
@wiking:)16:14
@wikingso dunno16:14
geektoniahaha fair enough16:14
gf712wiking: yup im here16:19
@wikinggf712: okey so....16:19
@wikingwatch_param/SG_ADD16:19
@wikingwhat's your thought on being able to support std::shared_ptr :P16:20
@wikinglike a guesstimate how hard that'd be16:20
gf712you mean pass around shared_ptr instead of references?16:21
gf712or?16:21
@wikingyeah since in case of switching to shared_ptr that'd mean that obj properties that are sgo-like16:22
@wikingwould all become shared_ptrs16:22
@wikingi mean that's the point16:25
@wikingthat i'm wondering adding things to the tags framework16:25
@wikingshared_ptr16:25
@wikinghow complicated/crazy that'd be16:25
@wikingas passing around those is one thing... it's just a lot of code replacement and that's all16:26
@wiking+ removing all the SG_REF/UNREF pairs16:26
@wikingit's almost as if it's regex job16:26
gf712I guess its time to pay the tech debt :D16:26
gf712hmm, I am just thinking if its that simple/.16:26
@wikingbut the q is more about how crazy will it be to do16:26
gf712yea16:26
@wikingSG_ADD(shared_ptr....)16:26
gf712it'll be pretty insane16:27
@wikingas everything that is sgo-like will be wrapped into a shared_ptr16:27
gf712is any compatible with shared_ptr?16:27
@wikingnot yet i would say16:27
@wiking:)16:27
gf712or would there have to be a workaround16:27
gf712can always have a shared_ptr<Any>16:28
gf712right>16:28
@wikingah16:28
@wikingyeah that is possible16:28
@wikingi see where you are goin :)16:28
@wiking:P16:28
gf712hmm but then there could be dangling references no?16:28
gf712actually maybe not16:29
gf712would have to try16:29
@wikingyep yep16:29
@wikingok so basically all the sg_add will go haywire16:29
@wikingas soon as i do the libtooling job16:30
@wikingto replace SGOPtr -> shared_ptr<SGO-like>16:30
@wikingwhich is fine for the time being16:30
@wikingnamely see how the c++ part would act16:30
@wikingwithout serialization/put/get16:30
@wikingand then would come swig with shared_ptr16:30
@wikingand any haxors16:30
@wikingbut models should work on c++ level16:31
@wikingespecially with the ones where we dont use tags fw :P16:31
gf712so for shared_ptr swig do you have to release the pointer?16:32
gf712and then make shared in type map in?16:32
@wikingno16:35
@wikingthere's a typemap for shared_ptr in swig for the langs we are interested in16:35
@wikingso swig takes care of that just as for std::string and std::vector16:35
gf712even R?16:35
gf712I thought it used boost pointer for that?16:35
@wikinghttp://www.swig.org/Doc3.0/Library.html#Library_std_shared_ptr16:35
@wikingyes16:36
@wikingbut boost_ptr = shared_ptr16:36
gf712ah ok16:36
gf712cool!16:36
gf712and unique_ptr?16:36
gf712I guess it doesn't make sense16:36
@wikingthat doesn't make sense16:36
@wikingah wait16:37
@wikingmaybe i'm now a bit asdf16:37
@wikinglemme check the repo again16:37
@wikingi mean gf712 https://github.com/swig/swig/blob/master/Lib/r/std_shared_ptr.i16:37
gf712https://github.com/swig/swig/blob/31b3b782a15bd4752b93193019dde85528443db5/Lib/r/boost_shared_ptr.i#L116:39
gf712ah wait thats a different "header"16:39
@wikingso lua is kind of out16:39
@wikingand in R if we rely on 3.0.1216:40
gf712I wonder how difficult it is to implement these things?16:40
@wikingwe need to do a hack that i added16:40
@wikingwhat exactly?16:40
gf712add for example lua16:40
gf712write the std_shared_ptr.i ourselves16:40
@wikingah16:42
@wikingdunno16:42
gf712I guess you have to know that language c api well16:42
@wikingye16:44
@wikinganyhow it would be super good16:44
@wikingto get shared_ptr support in c++ and most of the swig interfaces16:44
@wikingthe any part will be interesting i guess :)))16:44
@wikingbut most of the things could be ported w/o that already16:45
gf712can you paste bin the lib tooling thing you have for shared ptr btw?16:46
gf712just so I can see how it works16:46
gf712pls :)16:46
@wikingwill do16:47
@wikingi've just started to hack it16:47
@wikingi either work my way up from SG_UNREF/REF pairs16:47
@wikingor work my way down from fucntion args16:47
@wikingoooooor maybe the best is to catch this from the object properties16:48
@wikingand then go up along the way16:48
@wikingchange the property to shared_ptr if it's sgolike16:48
@wikingand then wherever that property is being used16:48
@wikingchange shit around :)16:48
@wikinglol hardware_destructive_interference_size16:54
gf712what kind of error is that?17:01
@wikingnono new c++17 feature17:08
@wikingnice one actually17:08
-!- wiking [~wiking@huwico/staff/wiking] has quit [Remote host closed the connection]17:52
-!- gf712 [1f0ef8ff@gateway/web/freenode/ip.31.14.248.255] has quit [Ping timeout: 256 seconds]18:50
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has quit [Ping timeout: 256 seconds]18:57
-!- sighingnow [~sighingno@2001:da8:203:81:1c3a:5657:47d3:aafb] has quit [Read error: Connection reset by peer]21:10
-!- HeikoS [~heiko@134.red-81-47-28.dynamicip.rima-tde.net] has joined #shogun22:00
-!- mode/#shogun [+o HeikoS] by ChanServ22:00
-!- HeikoS [~heiko@134.red-81-47-28.dynamicip.rima-tde.net] has quit [Quit: Leaving.]22:39
-!- HeikoS [~heiko@134.red-81-47-28.dynamicip.rima-tde.net] has joined #shogun22:39
-!- mode/#shogun [+o HeikoS] by ChanServ22:39
-!- HeikoS [~heiko@134.red-81-47-28.dynamicip.rima-tde.net] has quit [Ping timeout: 246 seconds]22:45
--- Log closed Fri Apr 19 00:00:42 2019

Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!