adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
infinity0_ has joined #ocaml
infinity0 is now known as Guest56412
infinity0_ is now known as infinity0
infinity0 has joined #ocaml
infinity0 has quit [Changing host]
Guest56412 has quit [Killed (orwell.freenode.net (Nickname regained by services))]
jimmyrcom has joined #ocaml
Jesin has quit [Quit: Leaving]
sh0t has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
cbot has quit [Ping timeout: 240 seconds]
jimmyrcom has quit [Ping timeout: 240 seconds]
orbifx has quit [Ping timeout: 260 seconds]
sh0t has quit [Remote host closed the connection]
zmzm has joined #ocaml
cbot has joined #ocaml
cbot_ has joined #ocaml
cbot has quit [Ping timeout: 240 seconds]
mfp has quit [Ping timeout: 245 seconds]
zolk3ri has quit [Quit: leaving]
Pierpa has joined #ocaml
mbuf has joined #ocaml
tormen_ has joined #ocaml
argent_smith has joined #ocaml
tormen has quit [Ping timeout: 260 seconds]
argent_smith has quit [Ping timeout: 240 seconds]
cbot_ has quit [Read error: Connection reset by peer]
cbot has joined #ocaml
jimmyrcom has joined #ocaml
spew has quit []
govg has joined #ocaml
shakalaka has quit [Ping timeout: 240 seconds]
nore has quit [Ping timeout: 252 seconds]
nore has joined #ocaml
shakalaka has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
<_xvilka_> hi
<_xvilka_> anyone here tried https://github.com/dbousque/lymp ? Seems not working at all - cannot load the module
argent_smith has joined #ocaml
argent_smith has quit [Ping timeout: 264 seconds]
<_xvilka_> seems the problem in python part of it - __import__() doesn't work properly
Pierpa has quit [Quit: Page closed]
zmzm has quit [Quit: zmzm]
<whoman> whats python
_xvilka_ has quit [Changing host]
_xvilka_ has joined #ocaml
<_xvilka_> whoman: py 3.6
<whoman> less chars and more numbers help me sarcastically to clarify my question? =p
<whoman> what is the exact error or are you guessing ? maybe it cant find the 'module'
<whoman> so-called
<rgr[m]> companion_cube: join the dark side
<_xvilka_> whoman: it does import the module, if I modify that lymp.py to print module name after __import__(mod) it prints ok. But if you dir(mod) in that python script (lymp.py), is shows only standard stubs, without my arguments - e.g. simple function "def some(): return \"some\""
<_xvilka_> whoman: if I do same __import__(mod), dir(mod) in regular python3 REPL - everything works
<_xvilka_> here is pastebin with code https://pastebin.com/a9EQN0SM
<whoman> hmm that is strange. i dont know too much python, only from blender scripts. i cant guess what could be going on, unless the dir() is changed after __import__ somehow
<_xvilka_> sorry, previous one wasn't full https://pastebin.com/pYEyZYJr
argent_smith has joined #ocaml
cbot has quit [Quit: Leaving]
gentauro has quit [Ping timeout: 248 seconds]
gentauro has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
raphinou has joined #ocaml
moei has quit [Quit: Leaving...]
Haudegen has joined #ocaml
tarptaeya has joined #ocaml
dhil has joined #ocaml
moei has joined #ocaml
mfp has joined #ocaml
TarVanimelde has joined #ocaml
henrytill has quit [Ping timeout: 248 seconds]
henrytill has joined #ocaml
henrytill has quit [Ping timeout: 248 seconds]
ollehar has joined #ocaml
tarptaeya has quit [Quit: Leaving]
<ollehar> did anyone read the proposal about resource polymorphism?
<ollehar> combining gc with pointer ownership/borrowing.
<ollehar> I started to read it, but it doesn't really start with a string pitch.
henrytill has joined #ocaml
ygrek has joined #ocaml
AltGr has joined #ocaml
<ollehar> strong*
<flux[m]> url?
kakadu has joined #ocaml
Pierpa has joined #ocaml
mengu has joined #ocaml
<sspi> ollehar: where can I read more about that?
<ollehar> reddit
<ollehar> one sec
<ollehar> flux[m]: sspi https://arxiv.org/abs/1803.02796
<sspi> thanks!
<ollehar> (not PDF) (but PDF to download)
<ollehar> Also, 60 pages. :|
<flux[m]> long pdf is long :(
<ollehar> Yeah. X| That's why I wanted to ask here if anyone read it. :)
<ollehar> It's like a bottom-up description, too.
<ollehar> Start with technical and type-theoretic details.
<ollehar> Starts*
<Drup> ollehar: I schemed it
<sspi> no repo with an implementation?
<Drup> will read in details next week
<Drup> sspi: no implementation yet
<Drup> ollehar: we discussed it a little bit last week on this channel
TarVanimelde has quit [Quit: TarVanimelde]
<ollehar> Drup: OK.
trochdewei has joined #ocaml
<flux[m]> Drup: any keywords to grep for?-)
jimmyrcom has quit [Ping timeout: 264 seconds]
<Drup> (featuring: me, speaking actual french instead of my usual frenglish :D)
nicoo has quit [Remote host closed the connection]
am55 has quit [Quit: am55]
am55 has joined #ocaml
ziyourenxiang has joined #ocaml
Archaeron has joined #ocaml
BitPuffin has joined #ocaml
AltGr has left #ocaml [#ocaml]
tarptaeya has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
Haudegen has quit [Remote host closed the connection]
cow-orke1 is now known as cow-orker
bartholin has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 264 seconds]
zolk3ri has joined #ocaml
am55 has quit [Quit: am55]
am55 has joined #ocaml
Archaeron has quit [Ping timeout: 264 seconds]
MercurialAlchemi has quit [Ping timeout: 246 seconds]
shinnya has joined #ocaml
MercurialAlchemi has joined #ocaml
<ollehar> That won't help me.
dhil has joined #ocaml
sh0t has joined #ocaml
AltGr has joined #ocaml
trochdewei has quit [Quit: Leaving]
jao has joined #ocaml
Haudegen has joined #ocaml
malc_ has joined #ocaml
sh0t has quit [Remote host closed the connection]
Archaeron has joined #ocaml
al-damiri has joined #ocaml
spew has joined #ocaml
gtrak has joined #ocaml
tarptaeya has quit [Quit: Leaving]
Fardale has quit [Ping timeout: 268 seconds]
tobiasBora has quit [Ping timeout: 240 seconds]
Fardale has joined #ocaml
tobiasBora has joined #ocaml
mbuf has quit [Quit: Leaving]
dhil has quit [Ping timeout: 256 seconds]
<companion_cube> rgr[m]: meh, it still looks more painful to write :/
<rgr[m]> in which cases?
ygrek has joined #ocaml
<companion_cube> most operators, I'd say
<companion_cube> anyway
<companion_cube> I don't think I have the energy to rewrite my PR once again
nullifidian has quit [Remote host closed the connection]
<flux[m]> whatcha talking about?-)
<rgr[m]> companion_cube: i understand if you don't have the time, but I disagree lazy lists are simpler
<companion_cube> oh come on
<companion_cube> it's the same code as lists, with more closures
<rgr[m]> some opreations are actually far more straight forward with stream fusion
<rgr[m]> while the rest are about the same
<companion_cube> which ones??
inr has quit [Ping timeout: 240 seconds]
<rgr[m]> unfold and zip for example
<rgr[m]> this is why at least keeping the implementation abstract makes sense though
<companion_cube> zip is 4 lines for me
<companion_cube> I don't understand how it could be simpler
<rgr[m]> flux: stream fusion stream vs. lazy lists
<Drup> rgr[m]: It seems like I missed the beginning, what are you talking about ?
<Drup> I mean, what's the context
<flux[m]> (personally I think lazy lists is the non-surprising and functional option, if the performance isn't a killer)
<rgr[m]> I like base's sequence more than c-cube's lazy list
<Drup> rgr[m]: 1) It's a thunk list, not a lazy list
<Drup> lazy lists are slow as fuck
<flux[m]> I suppose thunk list is second best, but that already can bring a bit surprising functionality :)
<rgr[m]> companion_cube: where is your zip implementation?
<Drup> flux[m]: thunklist and lazy lists are pretty similar, functionality wise
<companion_cube> oseq
<Drup> the only real difference is the persistance
govg has quit [Quit: leaving]
<flux[m]> Drup: well, yes.. the performance way better with thunk lists then I guess?
<Drup> flux[m]: oh yeah
<Drup> like, one order of magnitude
<Drup> for transient transformations, which is most of the use cases for iterators, lazylists are so bad it's not even worth it
<Drup> you might as well use normal lists
sh0t has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
dhil has joined #ocaml
<Drup> rgr[m]: having recently writen functions doing fairly delicate stream manipulations, I assure you, you don't want to write them with Core's sequence
<companion_cube> that reminds me I should update the `product` combinator…
<Drup> (and even if gen is faster, you *really* don't want to write them with that easier, it's too painful)
<companion_cube> heh :D
<companion_cube> either*
<companion_cube> I wrote many combinators with gen, and it was ugly indeed
<rgr[m]> what's wrong with it?
<Drup> rgr[m]: it's painful
<Drup> you have to constantly deal with the current state of the iterator manually
<Drup> every time you would recurse in a non-tail-rec ways, you have to use a stack instead, etc
<Drup> god forbid if you want non-linear walks
<rgr[m]> Yes, Sequence.Generator cleans up a lot messes
<rgr[m]> Why "have"? Only if you're using the constructors. You can use it like a normal stream and never worry about the state
<Drup> rgr[m]: I was talking about "Gen"
kuwze has joined #ocaml
<Drup> rgr[m]: the question is "can you define your own walks easily"
<Drup> ie, the case where the provided functions are not sufficient
<rgr[m]> oh yeah, Gen's awful I agree
<companion_cube> how is it different, though? It's the same as base.sequence with the state in a ref, isn't it?
<companion_cube> (the weird thing is how fast it is nonetheless…)
<rgr[m]> Sure, why not? At least I don't see how oseq has the advantage there
<rgr[m]> Isn't recursion a problem for the inliner? Also, doing it with a ref introduces the write barrier, doesn't it?
<Drup> rgr[m]: defining a walk over oseq/iter is very easy: it's almost like for lists, except you sparkle with thunks where the typer tells you
<Drup> same for lazylists
<rgr[m]> Drup: same for Sequence. Use Sequence.next and it's basically oseq
<Drup> defining a walk over Base.Sequence.t doesn't seem easy at all
<companion_cube> rgr[m]: I'd like to know more about how the inliner works, honestly
<Drup> rgr[m]: that's only for construction, not deconstruction
<companion_cube> I'd hope it gets better on seq if seq become standard
<Drup> err, for deconstruction, not construction
malc_ has left #ocaml ["ERC (IRC client for Emacs 27.0.50)"]
<Drup> for construction, I guess you are supposed to use Base.Sequence.Generator and a monadic API ? so yeah, not nearly as easy
<Drup> and the perfs are very similar anyway ...
<companion_cube> does Base.Sequence.Generator incur perf overhead?
<rgr[m]> well you have `shift_right` for `cons`
<rgr[m]> but yeah, I'd recommend using Sequence.Generator
* rgr[m] sent a long message: rgr[m]_2018-03-14_14:02:01.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/TaJLwfSafeeHqvEWsBESMhat>
<rgr[m]> I'd like to see this done with oseq :P
<Drup> wait, what's the semantics of >>= for generator ?
<Drup> because, if that's just a depth-first, let rec traverse_bst = function | Empty -> return () |Branch (left, value, right) -> Oseq.append (traverse_bst left) @@ OSeq.cons value (traverse_bst right)
<Drup> there is nothing interesting about this
<Drup> You don't need a monadic interface or anything, you only need append
<companion_cube> Drup: except for perf
<companion_cube> append is a bit more expensive I think
<companion_cube> which is why I use a stack in the stdlib's PR
<Drup> companion_cube: compared to the Generator version ? That seems unlikely
<Drup> As we say: [reference needed]
<companion_cube> yeah, I don't know
<rgr[m]> Not only that but your example isn't as lazy. You have more traverse_bst calls than necessary just to yield 1 element
<companion_cube> anyway, here is the efficient version: https://paste.isomorphis.me/g0q
<companion_cube> (the handwritten one)
<rgr[m]> Sequence.Generator will not call traverse_bst right if you only take 1 element for example
<Drup> rgr[m]: the real version has the same property
<Drup> by real, I mean "the one I posted, but that actually typechecks)
<rgr[m]> Btw Drup it's definitely slower than >>= and yield. As those are constant time in Sequence.Generator.
<Drup> rgr[m]: but run isn't, isn't it ?
<rgr[m]> But there's no magic, I'm sure your'e paying for it elsewhere
<Drup> yeah, you are paying it all in run
<rgr[m]> Still, what you're doing looks fishier
Pierpa has quit [Ping timeout: 260 seconds]
<rgr[m]> I wonder if you're getting quadratic behavior from the recursive append
<Drup> No you don't =')
<Drup> That's the point of using lazy streams
<rgr[m]> Btw, still Sequence.Generator will be faster if you consume the stream partially
<companion_cube> I also wonder though, there are nested `append`
<rgr[m]> I don't think you will pay for `run` in the elements that you don't consume
<Drup> rgr[m]: but append is constant time as well
<companion_cube> you must pay for them somehow, rgr[m]
<rgr[m]> companion_cube: why? if you don't consume them you simply let the closure gc
gtrak has quit [Ping timeout: 256 seconds]
<rgr[m]> Drup: ah yes, that's true
<companion_cube> with Drup's version you should pay upfront for the traversal of the left branch of the tree, or something like that
<Drup> rgr[m]: I mean, if you were to give me *any* generator, I would use append/cons as well
<Drup> generator/iterator
<rgr[m]> companion_cube: nah sequence also traverses left eagerly
<Drup> depth-first tree traversal is a bit of a 101 thing ...
<companion_cube> rgr[m]: wait, how is it possible?
<Drup> companion_cube: if you do `take 1` it's going to unfold the left traversal
<rgr[m]> Drup: we can do something more coomplicated :P. I've written enough python generators
<companion_cube> ah yeah ok
<companion_cube> got to go to work
<Drup> rgr[m]: my point is the following: 1) perfs are so close that it doesn't matter (even tho oseq is not so well optimized) 2) OSeq's traversal are much easier to write, because you can write the naive list code with some additional "()", and in 90% of the cases, it's the right one
<Drup> no monad and other things
<Drup> you also have better control of where the lazyness lies, thanks to the thunks
<Drup> (and OSeq is *much* simpler)
<rgr[m]> Drup: Sequence has the same primtives
<rgr[m]> shift_right = cons, append = append
<rgr[m]> knock yourself out either way
<Drup> rgr[m]: I'm not talking about bst traversal, I'm talking in general
<Drup> if append/cons are all that you need, companion_cube's Sequence is going to blow everyone else ;)
<companion_cube> heh
<rgr[m]> Hmm, but why do you think the difference is so great? I actually think the 2 approaches are very similar
<rgr[m]> As companion_cube said, it's a matter of keeping the state in a ref or in your type
<rgr[m]> keeping it in your type seems to have practical advantages
<rgr[m]> I don't think the 2 approaches have any fundamental differences
<Drup> rgr[m]: eh, practical experience ? Manipulating state in the midle of multi-way traversals is ... not nice
<companion_cube> https://paste.isomorphis.me/86f I get sth like that for `Generator`, can probably be improved a lot
<companion_cube> I think this is more complicated than it needs to be
<companion_cube> anyway, got to work
gtrak has joined #ocaml
<rgr[m]> Drup: the state is always there. It's just a different approach to dealing with it.
<rgr[m]> e.g. consider the natural numbers in sequence
<rgr[m]> let naturals = Sequence (0, (fun s -> Step.Yield (s + 1, s + 1)))
<rgr[m]> With lazy lists the state is the same, just stored on the stack instead
jao has quit [Ping timeout: 246 seconds]
<companion_cube> duh, I can make it simpler
<companion_cube> rgr[m]: on the heap, rather
nullifidian has joined #ocaml
<companion_cube> rgr[m]: https://paste.isomorphis.me/8F8
<companion_cube> it's quite simple to write a `Generator` in the end
mengu has quit [Remote host closed the connection]
Bronsa has quit [Remote host closed the connection]
mengu has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
mengu has quit [Ping timeout: 240 seconds]
<companion_cube> and… added to OSeq
FreeBirdLjj has joined #ocaml
pierpa_ has joined #ocaml
Bronsa has joined #ocaml
zpe has joined #ocaml
gentauro has quit [Ping timeout: 264 seconds]
<rgr[m]> What's the point of Append? perf?
<rgr[m]> Note how your type has both Skip/Yield constructors, I think it's nice that Sequence avoid this by already having a Step.t handy ;)
FreeBirdLjj has quit [Remote host closed the connection]
gentauro has joined #ocaml
raphinou has quit [Ping timeout: 246 seconds]
ollehar has left #ocaml [#ocaml]
FreeBirdLjj has joined #ocaml
bruce_r has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
bruce_r has quit [Ping timeout: 240 seconds]
Bronsa has quit [Ping timeout: 256 seconds]
inr has joined #ocaml
<companion_cube> that's reaaaaally a detail
<companion_cube> what od you mean "waht's the point of Append"?
<companion_cube> that's how `>>=` is implemented, is all
jao has joined #ocaml
dtornabene has joined #ocaml
remix2000 has quit [Quit: WeeChat 1.6]
remix2000 has joined #ocaml
Archaeron has quit [Quit: Communi 3.5.0 - http://communi.github.com]
dhil has quit [Ping timeout: 246 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 276 seconds]
AltGr has left #ocaml [#ocaml]
tarptaeya has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
tane has joined #ocaml
cbot has joined #ocaml
SpiceGuid has joined #ocaml
SpiceGuid has quit [Client Quit]
dtornabene has quit [Remote host closed the connection]
Algebr has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
TheLemonMan has joined #ocaml
Haudegen has quit [Remote host closed the connection]
sh0t has quit [Read error: Connection reset by peer]
gpietro has joined #ocaml
pierpa_ has quit [Ping timeout: 260 seconds]
Algebr has quit [Remote host closed the connection]
mengu has joined #ocaml
cbot has quit [Ping timeout: 248 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
mengu_ has joined #ocaml
mengu has quit [Ping timeout: 264 seconds]
gpietro has quit [Ping timeout: 276 seconds]
gpietro has joined #ocaml
xutux has joined #ocaml
gtrak has quit [Ping timeout: 246 seconds]
xutux has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
cbot has joined #ocaml
am55 has quit [Quit: am55]
xutux has joined #ocaml
mengu has joined #ocaml
am55 has joined #ocaml
mengu_ has quit [Ping timeout: 264 seconds]
xutux has quit [Ping timeout: 240 seconds]
xutux has joined #ocaml
gtrak has joined #ocaml
orbifx has joined #ocaml
isd has joined #ocaml
Jesin has joined #ocaml
gpietro has quit [Remote host closed the connection]
sh0t has joined #ocaml
mengu has quit [Remote host closed the connection]
jbrown has quit [Ping timeout: 246 seconds]
bruce_r has joined #ocaml
gtrak has quit [Quit: WeeChat 2.0.1]
gtrak has joined #ocaml
jimmyrcom has joined #ocaml
jbrown has joined #ocaml
jimmyrcom has quit [Ping timeout: 240 seconds]
Jesin has quit [Quit: Leaving]
xutux has quit [Remote host closed the connection]
xutux has joined #ocaml
bruce_r has quit [Remote host closed the connection]
remix2000 has quit [Quit: The Lounge - https://thelounge.github.io]
remix2000 has joined #ocaml
remix2000 has quit [Changing host]
remix2000 has joined #ocaml
tarptaeya has quit [Quit: Leaving]
sh0t has left #ocaml ["Leaving"]
jimmyrcom has joined #ocaml
remix2000 has quit [Client Quit]
remix2000 has joined #ocaml
remix2000 has quit [Changing host]
remix2000 has joined #ocaml
gtrak has quit [Ping timeout: 246 seconds]
tane has quit [Quit: Leaving]
chatchatt has joined #ocaml
Haudegen has joined #ocaml
xutux has quit [Ping timeout: 264 seconds]
gtrak has joined #ocaml
remix2000 has quit [Quit: The Lounge - https://thelounge.github.io]
remix2000 has joined #ocaml
jimmyrcom has quit [Ping timeout: 276 seconds]
shinnya has joined #ocaml
cbot has quit [Ping timeout: 264 seconds]
gtrak has quit [Ping timeout: 246 seconds]
am55 has quit [Quit: am55]
jonh has quit [Quit: WeeChat 0.4.2]
kakadu has quit [Remote host closed the connection]
isd has quit [Quit: Leaving.]
jimmyrcom has joined #ocaml
am55 has joined #ocaml
zmt00 has quit [Ping timeout: 260 seconds]
zmt00 has joined #ocaml
cbot has joined #ocaml
<orbifx> Would this be too off-topic for discuss.ocaml? https://lists.orbitalfox.eu/archives/logarion/2018/000021.html
jimmyrcom has quit [Ping timeout: 263 seconds]
jimmyrcom has joined #ocaml