ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
<whitequark> I want ungetc. this is for a horrible hack in OCaml lexer
<companion_cube> :/
<Drup> it sounds terrible
<companion_cube> that's doable but it woudl make clonable more complicated and ugly
<whitequark> basically on *) in bare code you want to emit a warning and roll back HALF a token
<Drup> X_X
MrScout has joined #ocaml
<Drup> can't you use "peak" instead, with a non-destructive gen
<Drup> I think it works
<whitequark> no, by the time I've matched I've already destroyed the gen
PM has joined #ocaml
<whitequark> since *) is a sedlex pattern
<Drup> :/
MrScout has quit [Remote host closed the connection]
<whitequark> I mean, this isn't even a problem with non-restartable gens
<companion_cube> ↑ this is a possible hack.
<companion_cube> (modulo small tweaks to make it work, I didn't try it)
<whitequark> I don't even want a method
<whitequark> I can just use an object literal
<companion_cube> well you can use a value if you prefer
<companion_cube> I mean type 'a prependable_gen = | Yield of 'a list * 'a gen | Fwd of 'a gen
<whitequark> no no
<whitequark> actually, that would basically work for me
<companion_cube> that's how Stream works on the inside, I think, somehow
<whitequark> spare the details please
<whitequark> i'm eating
<companion_cube> :D
<whitequark> uuuuugh the only place in Lexer that uses the named capture group syntax is ...
<whitequark> ...
<companion_cube> anyway. the clonable/prependable thingie is still less ugly than Stream imho
<whitequark> ... the # 1 "filename" thing
<whitequark> I'll just parse it with scanf okay
<chambart> o/ companion_cube, it's too late for hacking compiler... I think I'm adding bugs...
<companion_cube> don't :D
AltGr has joined #ocaml
<companion_cube> who's up to try to add unicode to Re, one of those days? by stealing code from sedlex
<whitequark> I can do it, but too lazy to actually do so
<whitequark> I can be a thought leader for whoever actually does the work.
<companion_cube> not now, but some of those days
<whitequark> I will provide motivational briefings.
<companion_cube> :D
<whitequark> such as: "work harder, the sun is still up"
<whitequark> and "work harder, it's not like you will be free during the day"
<companion_cube> "the sun is still up" isn't that simple a motivation when you live in Russia and me in France
<companion_cube> anyway, good night
<Drup> I can be picky reviewer too
<companion_cube> I will think more about it
<companion_cube> it's probably too much work, especially because the input should change from strings to streams of unicode points...
manud has joined #ocaml
<companion_cube> anyway,good night
bytbox has joined #ocaml
* lupine gets ocaml installed, starts working through this book
<whitequark> companion_cube: there is so little sun that it doesn't actually matter
<whitequark> also, it's only three hours of difference
<whitequark> *two, those assholes changed timezones AGAIN
<Drup> lupine: welcome :p
araujo has joined #ocaml
manud has quit [Ping timeout: 240 seconds]
MrScout has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
shinnya has joined #ocaml
manud has joined #ocaml
<lupine> hmm, ocamleditor requires 4.01.0
jwatzman|work has quit [Quit: jwatzman|work]
struktured__ has quit [Quit: No Ping reply in 180 seconds.]
struktured_ has joined #ocaml
badkins has quit [Remote host closed the connection]
samuel02 has joined #ocaml
samuel02 has quit [Ping timeout: 256 seconds]
badkins has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
chambart has quit [Ping timeout: 250 seconds]
<lupine> this syntax is going to take me a while :D
eyyub3 has quit [Quit: WeeChat 0.3.8]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
MrScout_ has joined #ocaml
MrScout has quit [Ping timeout: 258 seconds]
MrScout_ has quit [Ping timeout: 258 seconds]
kdef has joined #ocaml
ygrek has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
q66 has quit [Quit: Leaving]
manizzle has quit [Ping timeout: 258 seconds]
samuel02 has joined #ocaml
samuel02 has quit [Ping timeout: 265 seconds]
darkf has joined #ocaml
circ-user-TCLoG has joined #ocaml
<struktured> pretty happy with gen, it has like 50% of what I was about to write, such as chunks and nth
AlexRussia has quit [Ping timeout: 252 seconds]
Submarine has quit [Ping timeout: 264 seconds]
yomimono has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
raphaelss has joined #ocaml
AlexRussia has joined #ocaml
MrScout has joined #ocaml
manud has quit [Quit: Be back later ...]
MrScout has quit [Ping timeout: 252 seconds]
samrat has joined #ocaml
circ-user-TCLoG has quit [Ping timeout: 264 seconds]
badkins has quit []
rgrinberg has joined #ocaml
Submarine has joined #ocaml
j0sh_ has quit [Ping timeout: 245 seconds]
j0sh_ has joined #ocaml
pyon has quit [Quit: Cultura es todo... incluso Mastropiero.]
j0sh_ has quit [Ping timeout: 245 seconds]
j0sh_ has joined #ocaml
samuel02 has joined #ocaml
Submarine has quit [Remote host closed the connection]
samrat has quit [Quit: Computer has gone to sleep.]
prontotest has joined #ocaml
prontotest has left #ocaml [#ocaml]
samuel02 has quit [Ping timeout: 264 seconds]
kdef has quit [Ping timeout: 264 seconds]
kdef has joined #ocaml
samrat has joined #ocaml
pyon has joined #ocaml
manizzle has joined #ocaml
waneck has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
chinglish has joined #ocaml
AlexRussia has quit [Ping timeout: 252 seconds]
manizzle has quit [Ping timeout: 250 seconds]
AlexRussia has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
arj has joined #ocaml
ygrek has joined #ocaml
yomimono has quit [Ping timeout: 250 seconds]
AlexRussia has quit [Quit: WeeChat 1.1-dev]
deavidsedice has joined #ocaml
AlexRussia has joined #ocaml
deavid has quit [Read error: Connection reset by peer]
samuel02 has joined #ocaml
struktured has quit [Read error: Connection reset by peer]
struktured has joined #ocaml
samuel02 has quit [Ping timeout: 256 seconds]
mcc has joined #ocaml
keen__________ has quit [Read error: Connection reset by peer]
keen__________ has joined #ocaml
AlexRussia has quit [Ping timeout: 245 seconds]
mcc has quit [Ping timeout: 255 seconds]
kdef has quit [Quit: peace]
AlexRussia has joined #ocaml
<pgas> bas
AlexRussia has quit [Quit: WeeChat 1.1-dev]
ggole has joined #ocaml
arj has quit [Ping timeout: 240 seconds]
arj has joined #ocaml
manud has joined #ocaml
larhat has joined #ocaml
tom39291 has joined #ocaml
_5kg has quit [Read error: Connection reset by peer]
_5kg has joined #ocaml
milosn has quit [Remote host closed the connection]
samuel02 has joined #ocaml
samuel02 has quit [Ping timeout: 258 seconds]
matason has joined #ocaml
_5kg has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Quit: Leaving.]
samrat has quit [Quit: Computer has gone to sleep.]
rgrinberg has joined #ocaml
Kakadu has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
samrat has joined #ocaml
waneck has quit [Read error: Connection reset by peer]
marynate has joined #ocaml
rand000 has joined #ocaml
manizzle has joined #ocaml
milosn has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
def`1 has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
libertas has quit [Quit: Lost terminal]
claudiuc has quit [Remote host closed the connection]
teiresias has quit [Quit: leaving]
_5kg has joined #ocaml
oscar_toro has joined #ocaml
raphaelss has quit [Quit: leaving]
ingsoc has joined #ocaml
Kakadu has quit [Remote host closed the connection]
<gasche> <whitequark> compiler-libs is such a great idea, NOW MAKE IT USABLE OKAY
<gasche> sure, I'm waiting for your patches
<gasche> (also if you want to reuse Buffer from Lexing)
<gasche> at the very least (I mean assuming that you mentioned that for cathartic purposes but don't actually plan to take the time to write patches), a summary of the proposed changes in a format I can give to people in an compiler-hacking session would be neat
_5kg has quit [Ping timeout: 265 seconds]
oscar_toro has quit [Ping timeout: 250 seconds]
chambart has joined #ocaml
thomasga has joined #ocaml
eyyub has joined #ocaml
oscar_toro has joined #ocaml
piiii3 has joined #ocaml
<piiii3> Hey
arj has quit [Ping timeout: 244 seconds]
<piiii3> is there any different between ocaml pro vs ocaml ?
<companion_cube> ocamlpro is a company
<piiii3> you mean its with support !!
<piiii3> does it contain any special library/functionality by default in ocamlpro that not exists in ocaml
<companion_cube> ocamlpro releases some free software (in particular ocp-index and ocp-indent), if I understood correctly your question
manud has quit [Quit: Be back later ...]
<piiii3> i want to know the difference between ocaml and ocamlpro, you said ocaml pro is a company ,OK
<piiii3> but does it change anything in technical side?
<piiii3> any functionality, performance, library .... exist in ocamlpro which is not available in ocaml
<def`1> as you said ocamlpro is a company, not a product.
<def`1> ocaml is the language and its toolchain, independently of ocamlpro
<piiii3> what is ocaml pro in this picture ?
<def`1> a company providing professional support for commercial users of ocaml
<piiii3> ok
Kakadu has joined #ocaml
<def`1> (and they also release part of their work as free software)
samuel02 has joined #ocaml
arj has joined #ocaml
_5kg has joined #ocaml
eyyub1 has joined #ocaml
samuel02 has quit [Remote host closed the connection]
eyyub has quit [Ping timeout: 264 seconds]
def`1 has quit [Quit: def`1]
chambart has quit [Ping timeout: 245 seconds]
Simn has joined #ocaml
AltGr has left #ocaml [#ocaml]
marynate has quit [Ping timeout: 258 seconds]
samuel02 has joined #ocaml
raphaelss has joined #ocaml
Kakadu has quit [Ping timeout: 246 seconds]
_5kg has quit [Ping timeout: 260 seconds]
raphaelss has quit [Quit: leaving]
arj has quit [Ping timeout: 256 seconds]
oscar_toro has quit [Quit: Leaving.]
oscar_toro has joined #ocaml
dmiles has quit [Quit: Read error: 110 (Connection timed out)]
samuel02 has quit [Remote host closed the connection]
oscar_toro has quit [Ping timeout: 258 seconds]
thomasga has quit [Quit: Leaving.]
arj has joined #ocaml
_5kg has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
arj has quit [Ping timeout: 244 seconds]
dmiles_afk has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
arj has joined #ocaml
dmiles_afk has quit [Quit: Read error: 110 (Connection timed out)]
samuel02 has joined #ocaml
dmiles_afk has joined #ocaml
_5kg has quit [Ping timeout: 240 seconds]
<whitequark> gasche: on scale from 1 to 10, how likely are changes that cleanup the compiler-libs implementation and interface are to be merged?
<whitequark> I am in principle willing to spend time on that, given it will actually be used
ygrek has quit [Ping timeout: 255 seconds]
arj has quit [Ping timeout: 250 seconds]
<whitequark> gasche: so some examples of changes would be, say, make Lexer use buffer, remove things from Lexer that are not referenced elsewhere in the compiler and tools, and killing the parts which painstakingly collect the comment tokens and are then never ever used at all
<whitequark> (ocamldoc uses a separate comment lexer and associates them with parsetrees by position)
<whitequark> more complicated changes would export some other things potentially useful for external users and my favorite, making compiler-libs reentrant
milosn has quit [Remote host closed the connection]
Cody__ has joined #ocaml
<def`> whitequark: I am interested by work on reentrance
BitPuffin has joined #ocaml
<def`> while not making the typechecker reentrant, merlin isolate all the state in global references
<def`> so you can typecheck multiple piece of codes concurrently, but not in parallel :p
calrik has joined #ocaml
arj has joined #ocaml
<whitequark> right. I won't work on typechecker reentrance, I have seen that code and it is far too horrible for me to touch it successfully
<whitequark> but other things, why not
<whitequark> there is a lot of low-hanging fruit there
<ggole> def`: have you thought any more about the parsing stuff?
marynate has joined #ocaml
hugomg has joined #ocaml
<def`> I mean, I am ok, when given enough time, to work on typechecker reentrance
<def`> ggole: what do you mean? upstreaming part of the parser?
<ggole> No, I meant the issues I ran into trying to get merlin to be context sensitive.
<def`> ggole: yep sorry:)
klakplok has joined #ocaml
arj has quit [Ping timeout: 265 seconds]
<def`> mostly ok, I have some concerns about the browset navigation, but i'm a little too busy to give it the attention it deserves
<ggole> Yeah, that's the impression I got.
<ggole> No worries, we'll get there eventually.
<def`> cool :)
<ggole> I worked a bit on that new destruct feature (which is really neat, btw), and it suffers a bit from this problem too.
<chris2> sigh. why is there no identity nor infix composition in pervasives...
<mrvn> isn't there @-> there now?
chambart has joined #ocaml
<chambart> piiii3, by the way ocamlpro release some patched version of OCaml. mainly with better windows support: http://www.typerex.org/ocpwin.html
<companion_cube> chris2: use batteries or something similar
<chris2> yeah, i should just use core :|
<chris2> mrvn: not in 4.02 afaics
jonludlam has quit [Ping timeout: 260 seconds]
<mrvn> external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply"
<mrvn> external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply"
<chris2> but no @.
<mrvn> external ( ~+ ) : int -> int = "%identity"
<chris2> oh
<chris2> but that is for int only
<mrvn> That's your identity and composition operators
<chris2> and @@ is apply, not compose
<mrvn> external ( ~+. ) : float -> float = "%identity"
<ggole> Not the most useful type for identity :)
<chris2> i want 'a -> 'a
<ggole> ('a -> 'b is where it's at.)
<rks`> ggole: do you have an example of that problem?
<rks`> (with destruct I mean)
<rks`> nevermind
<rks`> I have some
<mrvn> no 'a -> 'a %identify in Pervasives
<ggole> rks`: I think that the one I mentioned in the issue thread is an example
<mrvn> Seems rather useless anyway.
<chris2> dunno. i need it quite often :P
JokerDoom has joined #ocaml
<ggole> The issue (as I see it) is that there's no way to tell whether the parse is a guess or reliable, so if you get given a result you have to take it at face value, with occasionally hilarious results.
<mrvn> then external id : 'a -> 'a = "%identity"
<ggole> The completion stuff I tried to get working had the same problem.
<chris2> mrvn: is that much better than let id x = x ?
<mrvn> chris2: might optimize better
<chris2> one would expect an optimizer to detect id in that definition :P
<mrvn> Who do you use id as an infix operator?
<chris2> not id. composition as infix
<chris2> let (@.) f g x = f (g x)
<mrvn> Ok. those it has. Those make sense.
_5kg has joined #ocaml
<chris2> it only has apply...
_JokerDoom has quit [Ping timeout: 265 seconds]
<rks`> ggole: these problems put aside, did you have a chance to retry using destruct with the few patches I pushed this morning (and the previous night)
<rks`> ?
<ggole> I haven't seen those, lemme have a look.
<rks`> ok :)
<mrvn> chris2: you seem to be right. Maybe I'm thinking of batteries.
<chris2> :)
<chris2> since we got @@ and |> recently, i wonder if asking for @. would simply work :P
<mrvn> chris2: does it have the right precedence?
<chris2> i think so
<mrvn> I've seen ( $ ) for composition before
<MercurialAlchemi> does anyone use @?
AltGr has joined #ocaml
<chris2> what is @?
<chris2> or do you mean '@' ?
<mrvn> chris2: would this work? f @. g @@ 2
<chris2> that is list concat
<ggole> rks`: ah, you've fixed up the immediate args thing
<mrvn> chris2: would this work? 1 |> f @. g @@ 2
<MercurialAlchemi> It's me typing @@
<chris2> ah. i use @@ sometimes
<MercurialAlchemi> Well, actually you do have @ to concatenate lists
<MercurialAlchemi> but nothing to do with the topic at hand
<mrvn> chris2: I would expect that to be (1 |> (f @. g)) @@ 2
<MercurialAlchemi> |> seems much more useful in practice
<Drup> MercurialAlchemi: I do, very often
<ggole> rks`: hmm, still some rough edges though
<chris2> well, $ is used a lot in haskell
klakplok has quit [Ping timeout: 250 seconds]
<rks`> ggole: I'm sure there are, I'd be happy to know what they are :)
<ggole> Try type t = Foo of int | Bar | Baz of t let test = function | Foo _ -> "fnorg" | Bar | Baz _
<ggole> With point right at the end
<chris2> f @. g @@ 2 parses as f @. (g @@ 2)...
<mrvn> using @@ other than as function argument '( @@ )' seems rather pointless.
arj has joined #ocaml
<mrvn> so maybe that is ok.
<chris2> mrvn: a @@ b @@ c d instead of a (b (c d))
<mrvn> chris2: what does f @. g 2 parse as?
<chris2> f @. (g 2)
<Drup> or rather "f x (very_long_multiline_expression)
<Drup> replaced by "f x @@ ...."
<chris2> yep
<Drup> to avoid the poor closing paranthesis at the end
<chris2> also nice is foo |> function ...
<rks`> ggole: oh wow :D
<mrvn> chris2: I find a (b (c d)) much easier to read
<rks`> that's... unexpected :D
<chris2> mrvn: not if you have to start counting parentheses ;)
<MercurialAlchemi> Drup: I see
<mrvn> chris2: then I have line breaks and indention
<chris2> 1 |> f @. g parses as 1 |> (f @. g)
<rks`> alright, I know where that comes from
<ggole> rks`: the first example I gave in the issue is fixed though, nice work
AltGr has left #ocaml [#ocaml]
<rks`> (it's gonna be a pain to fix though)
<MercurialAlchemi> I guess I tend to put 'very long stuff' into intermediate bindings
<MercurialAlchemi> makes it more readable
<mrvn> MercurialAlchemi: me too
arj has quit [Ping timeout: 240 seconds]
<MercurialAlchemi> the problem with functional languages is that it's very easy to write terse, hard to read code by chaining a billion of things
<chris2> we could make composition %. then it works with @@
_5kg has quit [Ping timeout: 256 seconds]
<mrvn> best not to encourage that
<ggole> rks`: oh one minor thing, sometimes unnecessary parens and spaces are printed
<MercurialAlchemi> composition only compounds the problem, because it's even more annoying when you have to work the code in your head in reverse
thomasga has joined #ocaml
<MercurialAlchemi> that's why I like |> :)
<ggole> eg | Baz (Baz _) | Baz (Bar ) | Baz (Foo _) -> ...
<rks`> ggole: yes I know
jonludlam has joined #ocaml
<rks`> that's some perfectible code in Pprintast
<rks`> (which is included in ocaml)
<rks`> it's on my TODO list
<ggole> Righto!
ollehar1 has quit [Ping timeout: 245 seconds]
<Drup> rks`: for holes, in the category "horrible, but works": [%]
<rks`> well you can redefine it
<Drup> no, this one, you can't
<Drup> (~) too, which is better, since it's parenthesis, so easy to replace
<rks`> # let (%) = 3;;
<rks`> val ( % ) : int = 3
<rks`> then of course
<Drup> I said "[%]"
<rks`> you cant just use "%" you need "(%)" in an expression context
<ggole> [%] is the ppx stuff?
<rks`> hmm, i thought you used [] to well, quote code.
<rks`> and [%] is just a list of % for me then.
jonludlam has quit [Quit: Coyote finally caught me]
<Drup> because ppx, no it's not :p
<Drup> but (~) is better imho
<Drup> it's nicer to modify to include real code
<rks`> right, ppx.
<companion_cube> {| hole |}
<MercurialAlchemi> What of (?)
<Drup> companion_cube: no, it's valid code
<rks`> but we still support 4.00 and 4.01
<companion_cube> oh ok, unvalid code
<Drup> rks`: it doesn't need ppx
<companion_cube> ::: ?
<Drup> rks`: I'm just trying to come up with something invalid (so you can use it without overlapping with something) and not too bad looking
<rks`> sure sure
pdewacht has quit [Ping timeout: 244 seconds]
<ggole> :?:
<Drup> If I was optimistic, I would say that things involving "::" are to be avoid because they could potentially become normal operators :>
jonludlam has joined #ocaml
pdewacht has joined #ocaml
<Drup> avoided*
<ggole> |?|, then
<MercurialAlchemi> Drup: your optimism is my pessimism
<Drup> and I personally would prefer to have something using parentheses, so that it's easy to transform it into a real expression
<Drup> for example, with (~)
arj has joined #ocaml
<Drup> the merlin mode would place the curser on "~" and you just need to type to replace.
psy_ has quit [Read error: No route to host]
psy_ has joined #ocaml
<rks`> q
<rks`> ... woops.
<whitequark> companion_cube: File "/home/whitequark/.opam/4.02.1/lib/containers/containers.cma", line 1:
<whitequark> Warning 31: files /home/whitequark/.opam/4.02.1/lib/containers/containers.cma and /home/whitequark/.opam/4.02.1/lib/gen/gen.cma both define a module named Gen_intf
<whitequark> there's something wrong with this.
<companion_cube> arf, yes
<companion_cube> I've been using git subtree to maintain the correspondence between gen and CCGen
<companion_cube> but I don't really know how to deal with this particular problem
<whitequark> -dontlink gen, maybe?
<companion_cube> you mean gen_intf?
<whitequark> no, it accepts a package
<companion_cube> oh, it's a command line option
<companion_cube> no idea
<companion_cube> man, -dontlink doesn't appear in ocamlopt --help
<whitequark> ocamlfind ocamlopt
<whitequark> it's an ocamlfind option
arj has quit [Quit: Leaving.]
<whitequark> is there *anything* I can read about the module aliases thing?
calrik has quit [Remote host closed the connection]
<companion_cube> I don't know :/
<whitequark> oh, it just needs a -no-alias-deps cmdline option
_5kg has joined #ocaml
<companion_cube> apparently
<companion_cube> (it's added to containers)
oscar_toro has joined #ocaml
dav has joined #ocaml
<companion_cube> oh, maybe no-alias-deps fixed this actually
<rks`> ggole: alright, I fixed the problem of "| Bar" appearing several times
dav_ has quit [Ping timeout: 258 seconds]
<rks`> and I modified the pretty printer to not output parentheses for constant constructor (subpatterns)
badkins has joined #ocaml
<ggole> rks`: nice, that didn't take long.
<ggole> Hmm, it seems to change the order
<ggole> Works though.
<ggole> rks`: hmm, do you think it would be nice to give the option of having newlines before each | (other than the first)?
<companion_cube> (including the first)
<ggole> That would leave a blank line?
<companion_cube> oh
<companion_cube> I thought you mean inserting a \n| before each case
<companion_cube> I misread, sorry.
<ggole> Maybe we mean different things by "first".
<rks`> ggole: it does indeed change the order, I don't really know why
<rks`> actually
<rks`> I do.
<rks`> this is fixable
<rks`> as for the \n before a | I would like that
<rks`> I'll see what I can do
<ggole> I'll do the emacs binding part if you like.
<rks`> well
<rks`> do you really think we need to leave the option to the user?
<rks`> disregarding the fact that I personaly would always like to have a \n
<rks`> in vim splitting on | is more working than joining lines
<ggole> Erm, you could always emit the \n and leave it to the editor to join lines
<rks`> I'm guessing it's the same in emacs
<ggole> Yeah, there's a command for that
<rks`> alright
<rks`> I'll try to always emit the \n then
<companion_cube> whitequark: strangely I don't have this warning anymore
<ggole> rks`: if we make sure to leave point at the end it should be very easy
dsheets has joined #ocaml
<ggole> Well, either way is fine really.
<rks`> ok :)
<rks`> anyway, I'll work on that later, for the moment, I'll eat
<rks`> cya
<rks`> (and thanks for the help ggole)
<ggole> My pleasure, thanks for working on merlin!
samrat has joined #ocaml
<companion_cube> +1
<MercurialAlchemi> sometimes #ocaml is like hanging around in the kitchen when a yummy chocolate cake is baking
<companion_cube> although the chocolate cake can sometimes take years to bake
<MercurialAlchemi> it's healthier this way
<mrvn> and now I'm hungry.
<mrvn> I want to eat the cake and have it too.
<daftluck> Life's short; eat dessert first.
bytbox has quit [Remote host closed the connection]
<Drup> whitequark: jacque guarigue's presentation on ocaml workshop ?
<companion_cube> oh, are there slides of this somewhere?
<companion_cube> https://ocaml.org/meetings/ocaml/2014/program.html <-- can't find the talk on this :/
<Drup> it was in the ML workshop
<Drup> apparently, no slides.
struktured has quit [Ping timeout: 258 seconds]
bytbox has joined #ocaml
bytbox has quit [Ping timeout: 256 seconds]
Denommus has quit [Quit: ZNC - http://znc.in]
Denommus has joined #ocaml
Denommus has quit [Remote host closed the connection]
circ-user-TCLoG has joined #ocaml
struktured has joined #ocaml
Denommus has joined #ocaml
<whitequark> I already figured it out
<whitequark> sadly you need .cmis :/
<whitequark> so the global namespace becomes rather polluted
<Drup> yes
<whitequark> companion_cube: so I invented a beautiful hack
Denommus has quit [Client Quit]
<whitequark> I can turn any Lexing.lexbuf into Sedlexing.lexbuf by doing Sedlexing.Utf8.from_gen, and wrapping lexbuf.refill in a generator
<whitequark> and then appropriately adjusting the positions after a token is emitted
Denommus has joined #ocaml
<companion_cube> sounds, hmmm, hackish
<Drup> hum, I disagree
<Drup> it's not that terrible
<companion_cube> I didn't say "terrible"
<whitequark> bonus points is that the refill function updates all the crappy insides of lexbuf
<whitequark> so if someone depends on that, it still works
<Drup> is that really needed ?
<Drup> I mean, the parser don't care.
<Drup> (more precisely: menhir doesn't care)
<whitequark> the underline thing in toploop does :]
<Drup> :<
milosn has joined #ocaml
<companion_cube> whitequark: did you measure performance yet?
<whitequark> no
<whitequark> haven't ported everything to MList yet, too
<companion_cube> things might move within Gen, before the next release
shinnya has joined #ocaml
<companion_cube> all this clonable stuff should go into their own module, I think
<MercurialAlchemi> whitequark: what are you trying to do?
<whitequark> MercurialAlchemi: [REDACTED]
<Drup> whitequark: I would like to take a look at your thing. We really need some little fix in sedlexing to simplify Lexing/menhir interop
<whitequark> Drup: it's available in [REDACTED]
<MercurialAlchemi> whitequark: uh, okay
<MercurialAlchemi> carry on, then
<Drup> aha
<whitequark> don't worry, you will learn in time
<Drup> so secret :D
<MercurialAlchemi> is it like chocolate cake?
<Drup> whitequark: not enough teasing
<whitequark> MercurialAlchemi: the cake is a lie
<MercurialAlchemi> not if there is chocolate in it
<MercurialAlchemi> chocolate doesn't lie
struktured has quit [Ping timeout: 258 seconds]
<whitequark> the cake is lye
<MercurialAlchemi> ok, that doesn't sound very appetizing
olauzon has joined #ocaml
circ-user-TCLoG_ has joined #ocaml
mfp has quit [Read error: Connection reset by peer]
circ-user-TCLoG has quit [Ping timeout: 244 seconds]
antinomy has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
arj has joined #ocaml
samrat has joined #ocaml
ivan\ has quit [Ping timeout: 252 seconds]
<def`> Drup: next menhir shouldn't require a lexbuf as input (well, there already is some converter available)
<Drup> def`: hum, more details ? :]
<Drup> about the next menhir, not the converter
<daftluck> So... I feel like this is a silly question, but if I have a recursive function that reads lines from stdin and conses them together (with the base case being an empty list), would that be tail recursive?
<daftluck> Because there's a cons operation in the recursive case, but nothing's really getting computed because lines are just read from stdin.
<Drup> daftluck: show the code :p
<Drup> (probable answer is no :p)
<Drup> no, it's not tail rec
<Drup> it could be if the compiler was more clever, but it's not
<ggole> Cons up an accumulator argument and reverse at the end.
<Drup> ^
* ggole mumbles something about tail-recursion-modulo-cons being around for decades
ivan\ has joined #ocaml
<mrvn> gcc actualy is clever enough in some cases for that
<daftluck> Cool, thanks. I had a feeling it wasn't, but I wasn't quite sure this time. :P
<ggole> gcc will handle some associative operators, yeah
<ggole> I can never remember exactly which ones.
<mrvn> ggole: all of them
<mrvn> gcc can make "return n * fac(n-1)" tail recursive.
<mrvn> That's not associativity
<ggole> It runs the multiplication first rather than waiting for the computation tree - that requires associativity of the operation, no?
<Drup> (multiplication is not associative on computers ...)
<mrvn> ggole: it requires inserting an accumulator to make it tail recursive
<mrvn> and yes, it needs a * (b * c) == (a * b) * c
<ggole> I wonder how many real programs this improves.
<mrvn> aparently enough for someone to implement it
<ggole> I have little doubt that somebody would implement it even if the answer were 'zero'.
thomasga has quit [Ping timeout: 265 seconds]
<ggole> Compiler people go funny in the head after a while.
<Drup> :D
Hannibal_Smith has joined #ocaml
<rks`> alright ggole, the branch should be in the right order, and separated by newlines
samrat has quit [Quit: Computer has gone to sleep.]
bytbox has joined #ocaml
<ggole> \o/
<ggole> rks`: seems to work pretty well
darkf has quit [Quit: Leaving]
<ggole> Hmm, actually it leaves a space after a nullary constructor
<ggole> Other than that, looks great
<rks`> :-'
<ggole> Heh, I'm so picky
<rks`> :)
<rks`> I'm actually really afraid of Format
<rks`> so I tried to do only minimal changes
<rks`> but I'll try and look for that
<ggole> I do like the newlines, that's a better way to do it.
samrat has joined #ocaml
maufred has joined #ocaml
marynate has quit [Quit: Leaving]
eyyub1 has quit [Ping timeout: 250 seconds]
samuel02 has quit [Remote host closed the connection]
ygrek has joined #ocaml
<hugomg> daftluck: as people already pointed out thats not tail recursive but if you were using Haskell instead of ocaml it would run in constant space because all recursive calls are nested inside a constructor (cons in this case)
<Drup> well, it would run in constant space because lazyness ...
<def`> well, with my trmc branch it would run in constant stack space without laziness ;')
<ggole> def`: ooh, shiny
<ggole> Do you get a write barrier hit though?
davine has joined #ocaml
<def`> ggole: yes, in practice it is negligible in most cases
<Drup> def`: where is the mantis ticket ?! :p
<def`> (first, the write barrier should get optimized, second if it is integrated it will be opt-in)
<ggole> I have a scheme for eliminating those (which I think I've discussed on this channel before)
<def`> Drup: hmm, github PR, and I wait for at_tailcall to get merged
<Drup> hum, ok
<ggole> But it involves adding some bits to frame tables
<def`> ggole: I don't think it is worth the effort
amirmc has joined #ocaml
<ggole> iirc it was brought up as an objection in the past
<ggole> Of course if measurements show it doesn't matter, then that's that.
<sol__> so the problem was that i didn't #include <algorithm> for std::find
<sol__> evidently there is another std::find with other signature or something
<sol__> wtf
<sol__> oops
bytbox has quit [Remote host closed the connection]
arj has quit [Quit: Leaving.]
samuel02 has joined #ocaml
rgrinberg has joined #ocaml
divyanshu has quit [Ping timeout: 258 seconds]
n1ftyn8 has quit [Ping timeout: 258 seconds]
msch has quit [Ping timeout: 258 seconds]
tom39291 has quit [Ping timeout: 258 seconds]
rfv has quit [Ping timeout: 244 seconds]
tane has joined #ocaml
superjudge has quit [Ping timeout: 258 seconds]
cojy has quit [Ping timeout: 265 seconds]
ivan\ has quit [Ping timeout: 240 seconds]
ivan\ has joined #ocaml
waneck has joined #ocaml
Kakadu has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
davine has left #ocaml ["Leaving"]
Kakadu has quit [Quit: Page closed]
bytbox has joined #ocaml
bytbox has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 255 seconds]
tharugrim has quit [Ping timeout: 250 seconds]
Hannibal_Smith has quit [Quit: Leaving]
tharugrim has joined #ocaml
<gasche> 13:07 < whitequark> gasche: on scale from 1 to 10, how likely are changes that cleanup the compiler-libs implementation and interface are to be merged?
<gasche> 8 if you don't break code, 6 if nobody relies on the broken interface, 4 if they do
<gasche> (it's only a guess of course)
<mrvn> with 1 being the most likely? :)
ygrek has quit [Ping timeout: 256 seconds]
<gasche> reentrancy would be a 8, but I predict that you'd have to refactor the patch at least once
q66 has joined #ocaml
<gasche> substract 2 for the things that can be easily implemented outside compiler-libs, add 1 if it really cannot be done outside
<gasche> whitequark: what's your issue with token_with_comments? I don't think it adds much complexity to the code, and I do remember using that on some occasions to experiment with stuff
tharugrim has quit [Ping timeout: 258 seconds]
tharugrim has joined #ocaml
bytbox has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
<ggole> "Generalized polymorphic #install_printer" in 4.03+dev \o/
superjudge has joined #ocaml
Hannibal_Smith has joined #ocaml
cojy has joined #ocaml
jwatzman|work has joined #ocaml
slash^ has joined #ocaml
Kakadu has joined #ocaml
ygrek has joined #ocaml
n1ftyn8 has joined #ocaml
<daftluck> hugomg: I'll have to remember that when I resume learning Haskell. :P
divyanshu has joined #ocaml
michipili has joined #ocaml
chambart has quit [Ping timeout: 245 seconds]
tom39291 has joined #ocaml
<flux> apparently it's a bit confusing that the form uses different terms than the configurator. in the configurator, cover == casing and keyboard == keyboard slider, right?-)
<flux> whoops, missed
msch has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
rfv has joined #ocaml
WraithM has joined #ocaml
Arsenik has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
mfp has joined #ocaml
ygrek has joined #ocaml
amirmc has quit [Quit: Leaving.]
teiresias has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
dsheets has quit [Ping timeout: 244 seconds]
bezirg has joined #ocaml
larhat has quit [Quit: Leaving.]
Anarchos has joined #ocaml
citrucel has joined #ocaml
ivan\ has quit [Ping timeout: 252 seconds]
jbalint has quit [Ping timeout: 258 seconds]
jbalint has joined #ocaml
jbalint has quit [Changing host]
jbalint has joined #ocaml
bezirg has quit [Quit: Leaving.]
dsheets has joined #ocaml
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
ygrek has quit [Ping timeout: 258 seconds]
myst|work has joined #ocaml
<myst|work> can anyone help me with generating C(n,k) in a functional way *fast*? I have an imperative solution that uses array of indices that works pretty fast, but it looks somewhat ugly
<myst|work> is it even possible to do?
chaptastic has quit []
<myst|work> I also have nice recursive way, but it's not tail-recursive and uses @ [...] so it's kinda slow and prone to explosions
<Drup> define fact and use it ? =')
slash^ has quit [Read error: Connection reset by peer]
<Drup> (fact as factorial)
manizzle has quit [Ping timeout: 244 seconds]
<mrvn> What is C?
<mrvn> for int or bignum?
<Drup> it doesn't really matter, the factorial formula is better anyway
<mrvn> But for int you simply make a lookup table for the factorial and then it is a / (b * c)
BitPuffin has quit [Ping timeout: 264 seconds]
circ-user-TCLoG has joined #ocaml
circ-user-TCLoG_ has quit [Read error: Connection reset by peer]
<companion_cube> o/
oscar_toro has quit [Ping timeout: 250 seconds]
citrucel has quit [Remote host closed the connection]
Cody__ has quit [Remote host closed the connection]
badkins has quit [Remote host closed the connection]
manizzle has joined #ocaml
<myst|work> sorry, i had to afk
manud has joined #ocaml
<myst|work> i don't want to count number of combinations
<myst|work> i want to generate combinations of a set (list)
manud has quit [Read error: Connection reset by peer]
manud has joined #ocaml
<Drup> ah, that's not at all C(n,k) =')
<myst|work> int -> a' list -> 'a list list
<myst|work> how's that?
<myst|work> all combinations of k from n
<Drup> well, C(n,k) is the number :p
<myst|work> i guess it depends from coutry to country
badkins has joined #ocaml
badkins has quit [Remote host closed the connection]
<myst|work> anyway, i meant generate all combinations of k elements of a set of n elements
struk|work has joined #ocaml
<Drup> what is your non functional solution ?
<mrvn> myst|work: start with simple recursion. you recurse till k == 0 and return [], otherwise you match the list with x::xs and recurse once for taking x and once for skipping it.
<struk|work> myst|work: you know there is a good analytical approximation function? How accurate does your counting function have to be?
<myst|work> there's a really nice way of doing it via C(n,x::xs) = map (fun ys -> x :: ys) C(n-1,xs) @ C(n-1,xs)
<myst|work> but it's horribly inefficient
<mrvn> myst|work: Then you transform that to use accumulators to make it tail recursive
<Drup> you can also use a data structure with O(1) append instead of lists
* Drup looks at companion_cube.
<struk|work> Drup: which data structure in containers supports O(1) append?
<Drup> gen, sequence
<struk|work> ah, cool. using those already
<flux> struk|work, I supose you evaluate C(n - 1, xs) only once?
<flux> instead of twice like in the simple formula
<struk|work> flux: nah, just approximate the factorial itself via stirling's approximation or something tighter. http://en.wikipedia.org/wiki/Stirling%27s_approximation
<Drup> struk|work: read the backlog :p
matason has quit [Quit: Later!]
larhat has joined #ocaml
hugomg has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
<myst|work> oh, there's an error in formula
<myst|work> C k x::xs = map (fun ys -> x :: ys) (C k-1 xs) @ C k xs
<myst|work> this should be more readable
<Drup> I must say, it's the kind of problem where I imediatly think "it would be so nice in prolog" :p
<myst|work> oh god no
<Drup> what ? :]
<myst|work> i'm not quite sure how to make this tail-recrusive
<myst|work> i'll continue trying, just wanted to check if maybe someone knows it from the top of his head
<Drup> myst|work: you could write a map_tail
<Drup> that maps, then add at the end
<Drup> (or use rev_map then red_append)
<myst|work> hm, on the other hand i don't care about order of the elements, there from i can get around of @
badkins has joined #ocaml
<myst|work> still on every turn i have to call C twice
<myst|work> and them somehow combine the results
<myst|work> so it doesn't look like tail recursion is possible
badkins has quit [Remote host closed the connection]
Thooms has joined #ocaml
<jbalint> hi, I wondering why I can't call this function with a string argument, but I can with string literal: http://pastebin.com/U8gHieLj
arj has joined #ocaml
<Drup> myst|work: the costly part is not the lack of tail-recursion anyway
<mrvn> jbalint: because a string literal can be a format while a string can't
<jbalint> mrvn: thanks
<myst|work> Drup w/o tail-recursion i get stack overflows at C(8,22) or so
badkins has joined #ocaml
<myst|work> and i want to do C(50,100) and above
<arj> can i tell _oasis somehow to have multiple src paths?
<Drup> myst|work: given the number, I'm pretty sure that it's not the tail rec of C the issue
<Drup> it's the map and the append
<Drup> so, do rev_map + rev_append.
<Drup> arj: you cannot, but you can say "src_foo/Foo" in the "Modules" list
<mrvn> myst|work: no append needed
<arj> Drup: Ah, ok, so I use the root path of all src directories as path and specify the modules with 'full' relative paths?
<Drup> arj: yes
<arj> thanks, I'll try that one.
<flux> Gg matrices etc no longer have 'to_string', how annoying :/
<mrvn> myst|work: making that fully tail recursive would mean passing continuations along.
<mrvn> myst|work: or a stack of (k, xs) values anyway
<Drup> flux: "Format.asprintf "%a" Gg.pp"
<Drup> (but I agree it's silly not to include it)
<flux> ah, forgot about that
<myst|work> mrvn: well, at least it's not system stack. can you give some pointers to where to look?
<flux> I already used the annoying way of Format.formatter_of_buffe retc
<Drup> mrvn: I was going to write something like that, but you beat me to it :p
<mrvn> myst|work: try my code. should run fine for C(50, 100)
<mrvn> fold_left was tail recursive or was fold_right?
<Drup> I checked, you used the right one
<Drup> (yes, I also confuse it all the time ...)
<companion_cube> fold_left is tail recursive
matason has joined #ocaml
matason has quit [Client Quit]
<Drup> (right as correct, not right as right :>)
<myst|work> mrvn: ah I see, thanks a lot, I'll play with it when I get home and come back if anything
pyon has quit [Quit: rcirc on GNU Emacs 24.4.1]
pyon has joined #ocaml
arj has quit [Quit: Leaving.]
matason has joined #ocaml
matason has quit [Client Quit]
matason has joined #ocaml
matason has quit [Client Quit]
samrat has quit [Quit: Computer has gone to sleep.]
arj has joined #ocaml
arj has quit [Client Quit]
ggole has quit []
matason has joined #ocaml
thetabyte has joined #ocaml
<thetabyte> How would one get the last character of an OCaml string? Neither String.sub "abc" 2 2;; or String.sub "abc" 2 3 work, both throwing an argument error.
<Drup> thetabyte: my_string.[String.length my_string - 1]
<mrvn> as char or string?
<mrvn> thetabyte: String.sub string start length, not start end
milosn has quit [Remote host closed the connection]
<MercurialAlchemi> well, at least if you want the last byte
<MercurialAlchemi> if you have multibyte characters...
<thetabyte> oh wow. I read that documentation a million times, and still missed it. thank you mrvn.
<def`> String.sub "abc" 2 1
<def`> but you get a string, not the last character
<def`> (otherwise, what Drup said)
Arsenik has quit [Remote host closed the connection]
<mrvn> fully tail-recursive C(k, n): http://paste.debian.net/135908/
<mrvn> outputs in reverse order
Hannibal_Smith has joined #ocaml
claudiuc has joined #ocaml
WraithM has quit [Ping timeout: 244 seconds]
axiles has quit [Ping timeout: 265 seconds]
WraithM has joined #ocaml
<mrvn> Small improvement and catching bad input: http://paste.debian.net/135913/
<mrvn> What's C(50, 100)? Any chance that would finish before the sun burns out?
thetabyte has left #ocaml [#ocaml]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
axiles has joined #ocaml
Simn has quit [Quit: Leaving]
milosn has joined #ocaml
Kakadu has quit [Remote host closed the connection]
michipili has left #ocaml [#ocaml]
MrScout_ has joined #ocaml
<S11001001> mrvn: 100891344545564193334812497256
<S11001001> |C(k,n)| = n!/k!(n-k)!
MrScout__ has joined #ocaml
MrScout has quit [Ping timeout: 258 seconds]
MrScout_ has quit [Ping timeout: 258 seconds]
fraggle_ has quit [Read error: Connection reset by peer]
<whitequark> gasche: so my issue with COMMENT thing was
<whitequark> I rewrote the lexer in sedlex and the control/data flow in comment-related things was particularly contrived
jcloud has quit [Ping timeout: 258 seconds]
<whitequark> which was rather frustrating especially after I realized that it is not used at all
jcloud has joined #ocaml
badkins has quit []
fraggle_ has joined #ocaml
<mrvn> S11001001: thx. so no chance. :)
samuel02 has quit [Remote host closed the connection]
nlucaroni has left #ocaml [#ocaml]
<whitequark> gasche: really, my concern about ocamlc stems most from the fact that it seems that ocamlc systemically can't get incremental improvement right
<whitequark> I *am* interested in improving it, I am not interested though in sending patches into the void and waiting for months for a resolution, which is also opaque on the reasoning
<whitequark> I see this in PRs, I see this in the code, and I see this in Alain's work, which took what, 2.5 years to merge?
<whitequark> (yes, it's a big change, it's not *that* big)
<Drup> whitequark: be careful, you are criticizing the developement model, which might lead you of being flag as "iritating" :>
<whitequark> that would only serve to prove my point, even if it's not something I aim to achieve
MrScout__ has quit [Remote host closed the connection]
<whitequark> look at, say, llvm. there is a process. assuming the patch you wrote makes sense and there is a broad consensus that it's an improvement, you generally harass maintainers until they LGTM you. done
MrScout has joined #ocaml
<whitequark> when I write one, I know my work will not be entirely wasted, and the feedback loop is reasonably quick
<whitequark> the oldest PR on github with no comments from maintainers or developers whatsoever is dated at Aug 2013
<whitequark> why, again, should I spend my time on something that doesn't fix my immediate problems?
Hannibal_Smith has quit [Quit: Leaving]
<whitequark> s/maintainers until/reviewers until/
Hannibal_Smith has joined #ocaml
<whitequark> gasche: (to finish talking about COMMENT, I'd be equally happy to rewrite it so that the code makes sense, I'm just not very keen on keeping known dead code in the codebase in general)
tane has quit [Quit: Verlassend]
matason has quit [Ping timeout: 245 seconds]
<whitequark> (I think it would make very good sense to move ocamldoc parsing to Parsetree, too, so it might well be useful in the future)
mort___ has joined #ocaml
<Drup> hum, whitequark, why was lwt.text deprecated ?
<whitequark> Drup: ummm
<Drup> there is a direct replacement for lwt.top
<Drup> but for lwt.text ....
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<whitequark> for example, because it did not actually build
<whitequark> I think
<Drup> really ?
<Drup> there is an opam thingy to enable it
<Drup> whitequark: also, it should be added to the readme that --enable-all will enable ppx and then will not build on < 4.02
<Drup> it doesn't matter for most, but it should be put somewhere regardless :)
<whitequark> hm, I can't quite find why text was killed
<whitequark> but it does not seem very useful to me anyway, use uutf :p
<whitequark> actually a reimplementation of lwt.text with uutf might even make sense, undeprecating that probably not
<Drup> There is nothing to "undeprecate", it's not deprecated ...
<Drup> http://ocsigen.org/lwt/dev/api/Lwt_text "deprecated" is not in this page
<Drup> you can't randomly remove some part of lwt because you don't like them :D
<whitequark> I'm certain I removed it because it was deprecated somehow
<Drup> it's not indicated as "deprecated" anywhere in the changelog either
<companion_cube> lwt.text is supposed to have been replaced by lambda-term, isn't it?
<Drup> it's not the same
<Drup> lwt.text is a reimplementation of Lwt_io, but with utf8 text instead of strings
myyst has quit [Quit: Leaving]
ingsoc has quit [Quit: Leaving.]
struktured has joined #ocaml
thomasga has joined #ocaml
Yoric has joined #ocaml
<Yoric> Hi
<struktured> hi
* Yoric waves around and doesn't recognize many nicknames.
<Yoric> rwmjones: npouillard: hi
<Yoric> I just realized that FlowType was written in OCaml and decided to drop by.
manud has quit [Quit: Be back later ...]
<companion_cube> o/ Yoric
<Yoric> companion_cube: Hi, long time no chat.
<companion_cube> indeed!
<Yoric> I guess I have been disconnected from OCaml for 3 years.
<Yoric> Does Rust count as OCaml? It's bootstrapped from a OCaml-built compiler :)
<whitequark> Rust is self-hosted for years
olauzon has quit [Quit: olauzon]
<Yoric> Indeed.
<companion_cube> Yoric: you've been writing rust for 3 years?
manud has joined #ocaml
<Yoric> Not at all.
<Yoric> Just a little Rust 2 years ago.
<Yoric> I've been writing JS and C++ code most of the time :/
<companion_cube> bad luck.
<Yoric> Well, the results are fun.
<Yoric> But the languages are not as cool as OCaml.
myyst has joined #ocaml
<Yoric> Although, tbh, I was a bit burnt out of OCaml (and might still be) when I switched language.
<companion_cube> I'm hoping rust will be as fun as ocaml
<Yoric> It's a bit more hardcore.
<Yoric> But it's in the top 3 most active github projects, so I have high hopes for the community.
<companion_cube> yes, the current community is extremely active
<Yoric> Plus we have decided that it's now mature enough that we should be able to start using it in Firefox within a few months.
<companion_cube> rust will have more libs than Ocaml soon, if it's not already the case
<companion_cube> you work in the firefox team? oO
<Yoric> Once we have figured out 1/ the build system and 2/ where.
<Yoric> Yes.
<companion_cube> that's amazing.
<companion_cube> 2/ everywhere
<Yoric> :)
<Yoric> 2/ where we start.
hannes has quit [Ping timeout: 244 seconds]
hannes has joined #ocaml
<Yoric> It's fun, two of my office mates, who had never even heard of functional programming, have had their mind completely blown out by Rust, and are now proselytising all over the place.
<Yoric> I have invited one of them to give a short presentation of Servo in a lecture I give.
<Hannibal_Smith> Yoric, sorry for entering the discussion...but what make Rust interesting for them? The cleaner sintax and fewer rules to remember, or the secuity that the type system give to them?
<Yoric> Well, wrt C++, the main reason is the type system, and the fact that memory management just works.
<Yoric> (region-based)
<Hannibal_Smith> When talking to a much younger friend of mine, the reason was principally because he feel that Rust is more approciable
<companion_cube> if I had a C++-only background, I'd be impressed by the safety and exprssivity of iterators
<Yoric> (well, region-based unless requested)
<Hannibal_Smith> He don't really understand the point of having a such type system, because all he do is js scripting
<whitequark> if you had a C++-only background, you'd scoff at all the useless safety
<Yoric> whitequark: Actually, not.
<whitequark> that is an attitude I overwhelmingly see.
<Yoric> Most people I have talked to have had enough of getting burnt by C++.
araujo has quit [Ping timeout: 240 seconds]
<Yoric> Anyway, time to call this a night.
<Yoric> bye everyone
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
<whitequark> companion_cube: gen is too eager :/
<whitequark> or rather, Gen.persistent
<whitequark> see, I have this generator that emits Unicode chars. it decodes them from a buffer while the buffer is full, and when it's empty, it requests a refill...
<whitequark> ... which entails a trip to "readline"
Yoric has quit [Ping timeout: 260 seconds]
<Drup> and ?
<whitequark> well, let's say I type "1;;"
Thooms has quit [Quit: WeeChat 1.0.1]
<whitequark> my Sedlexing_uutf is created with a generator, then sedlex instructs me to mark position for future backtracking
<whitequark> which means I immediately persistize the generator
<whitequark> which means next time I read from it, it will actually cache eight entries
libertas has joined #ocaml
<whitequark> which means I will need eight trips to "readline", i.e. eight lines entered, to get one char actually lexed by sedlex
<whitequark> it actually seems like I need two different generator implementations. one for reading from files, another for toplevel
<Drup> I see
<whitequark> for files, MList-based. for toplevel, just use a lazy list
<whitequark> making latter be Gen.clonable is trivial
<Drup> would the lazy list really help, given the interface of refill ?
<companion_cube> whitequark: Gen.persistent_lazy?
<whitequark> yes
<Drup> whitequark: you are rewriting sedlex with uutf ?
<whitequark> no
<Drup> "Sedlexing_uutf" ?
<whitequark> I'm using sedlex's existing support for providing your own Sedlexing
<Drup> ok
<whitequark> which I need, because I need some special capabilities from the lexbuf
<Drup> ok
<whitequark> companion_cube: I reviewed MList again and it is very useful, thanks
<companion_cube> no pb
<companion_cube> I wanted something more efficient than a regular mutable list
<companion_cube> (for persistent)
jonludlam has quit [Quit: Coyote finally caught me]
<whitequark> yeah, it is much better for *batch* processin
<whitequark> but not for interactive
thomasga has quit [Quit: Leaving.]
<companion_cube> because of too much buffering?
<whitequark> yeah
<whitequark> or rather, because it buffers at all
<companion_cube> it should be possible to have a regular lazy list as well
_JokerDoom has joined #ocaml
<companion_cube> but I feel like this stuff should go in Gen_*** modules
<companion_cube> rather than polluting the standard module
<whitequark> I don't have an opinion
thomasga has joined #ocaml
JokerDoom has quit [Ping timeout: 258 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml