<mfp>
rgrinberg1: I've got a hack to find closure leaks (e.g. listeners being attached to a Lwt thread) by scanning the heap and collecting the Code_val values from closure blocks
ril is now known as ril[away]
ril[away] is now known as ril
ril is now known as ril[away]
ril[away] is now known as ril
andrew has joined #ocaml
AltGr has joined #ocaml
andrew has quit [Client Quit]
mcclurmc_ has joined #ocaml
yaewa has joined #ocaml
iZsh has quit [Ping timeout: 252 seconds]
iZsh has joined #ocaml
empyrean has joined #ocaml
companion_cube has quit [Ping timeout: 268 seconds]
mcclurmc has quit [Read error: Connection reset by peer]
clog has quit [Ping timeout: 264 seconds]
companion_square has joined #ocaml
rwmjones has quit [Ping timeout: 240 seconds]
rwmjones has joined #ocaml
iZsh has quit [Ping timeout: 244 seconds]
Sorella_ has joined #ocaml
JuggleTu1 has joined #ocaml
destrius_ has joined #ocaml
Maelan_ has joined #ocaml
bernardo1pc has joined #ocaml
companion_cube has joined #ocaml
johnelse_ has joined #ocaml
pollux_ has joined #ocaml
flx has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
jeroud_ has joined #ocaml
julienXX_ has joined #ocaml
stux|RC has joined #ocaml
iZsh has joined #ocaml
pyon is now known as nyon
companion_square has quit [*.net *.split]
w1gz has quit [*.net *.split]
oriba has quit [*.net *.split]
Maelan has quit [*.net *.split]
jeroud has quit [*.net *.split]
flux has quit [*.net *.split]
pollux has quit [*.net *.split]
julienXX has quit [*.net *.split]
empyrean has quit [*.net *.split]
JuggleTux has quit [*.net *.split]
cball has quit [*.net *.split]
Sorella has quit [*.net *.split]
welterde has quit [*.net *.split]
jpdeplaix has quit [*.net *.split]
stux|RC-only has quit [*.net *.split]
johnelse has quit [*.net *.split]
Enjolras has quit [*.net *.split]
destrius has quit [*.net *.split]
bernardofpc has quit [*.net *.split]
pollux_ is now known as pollux
julienXX_ is now known as julienXX
julienXX has quit [Changing host]
julienXX has joined #ocaml
<rgrinberg1>
mfp: Ha. I'm pretty sure I have something more tame than that.
flx is now known as flux
ril is now known as ril[away]
jeroud_ is now known as jeroud
<rgrinberg1>
mfp: but i'm curious about the hack
empyrean has joined #ocaml
clog has joined #ocaml
Sorella_ is now known as Sorella
cball has joined #ocaml
oriba has joined #ocaml
w1gz has joined #ocaml
Enjolras has joined #ocaml
segmond has joined #ocaml
ril[away] is now known as ril
welterde has joined #ocaml
<oriba>
(buffer 1
<oriba>
ooops
jpdeplaix has joined #ocaml
ril is now known as ril[away]
ril[away] is now known as ril
ril is now known as ril[away]
ontologiae has quit [Ping timeout: 240 seconds]
ril[away] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
oriba has quit [Quit: WeeChat 1.3]
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
antkong_ has joined #ocaml
mort___ has quit [Quit: Leaving.]
keen__________21 has joined #ocaml
rgrinberg1 has quit [Ping timeout: 246 seconds]
keen__________20 has quit [Ping timeout: 260 seconds]
tennix has joined #ocaml
samrat has joined #ocaml
igoroliveira has joined #ocaml
igoroliveira has joined #ocaml
rgrinberg1 has joined #ocaml
mal``` has quit [K-Lined]
mal`` has joined #ocaml
browncodes has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 252 seconds]
rgrinberg1 is now known as rgrinberg
tmtwd has joined #ocaml
enjolras_ has joined #ocaml
antkong_ has quit [*.net *.split]
Enjolras has quit [*.net *.split]
igoroliveira has quit [*.net *.split]
w1gz has quit [*.net *.split]
antkong has joined #ocaml
w1gz has joined #ocaml
Denommus has quit [Ping timeout: 255 seconds]
igoroliveira has joined #ocaml
samrat has quit [Ping timeout: 250 seconds]
samrat has joined #ocaml
mac10688 has quit [Ping timeout: 264 seconds]
darkf has joined #ocaml
tmtwd has quit [Quit: Leaving]
tmtwd has joined #ocaml
tmtwd_ has joined #ocaml
<tmtwd_>
hello
tmtwd_ has quit [Remote host closed the connection]
yaewa has quit [Read error: Connection reset by peer]
moei has joined #ocaml
MercurialAlchemi has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
segmond has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 246 seconds]
esden has joined #ocaml
tnguyen has joined #ocaml
samrat has quit [Ping timeout: 265 seconds]
MercurialAlchemi has quit [Ping timeout: 265 seconds]
tmtwd has joined #ocaml
oscar_toro has joined #ocaml
tmtwd has quit [Ping timeout: 244 seconds]
oscar_toro has left #ocaml [#ocaml]
kushal has joined #ocaml
maufred_ has joined #ocaml
maufred has quit [Quit: leaving]
maufred_ has quit [Client Quit]
maufred has joined #ocaml
jun has quit [K-Lined]
noplamodo_ has quit [K-Lined]
jun_ has joined #ocaml
jun_ has quit [K-Lined]
noplamodo has joined #ocaml
noplamodo has quit [K-Lined]
noplamodo has joined #ocaml
tmtwd has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
shinnya has quit [Ping timeout: 250 seconds]
circ-user-ZLh45_ has joined #ocaml
circ-user-ZLh45 has quit [Ping timeout: 240 seconds]
mea-culpa has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
ely-se has joined #ocaml
oscar_toro has joined #ocaml
KDr2 has joined #ocaml
seliopou has quit [Ping timeout: 256 seconds]
antkong has quit [Quit: antkong]
maufred has quit [*.net *.split]
tmtwd has quit [Ping timeout: 250 seconds]
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
maufred has joined #ocaml
seliopou has joined #ocaml
ygrek has joined #ocaml
sh0t has joined #ocaml
beginner has joined #ocaml
<beginner>
what are currently available librarys to check line coverage of unit tests?
<companion_cube>
there is bisect
<beginner>
does it support ocaml 4.02?
freehck has joined #ocaml
<companion_cube>
I think so
<ely-se>
line coverage is kinda meh
<ely-se>
branch coverage would be more interesting
<beginner>
i guess there is nothing that tests branch coverage?
<companion_cube>
not that I'm aware of
<companion_cube>
OCaml programmers don't usually have a strong focus on tests
<companion_cube>
(which is kind of bad)
<ely-se>
the only project I know of that measures branch coverage is SQLite
<flux>
"Bisect performs statement and condition coverage". isn't condition coverage a name for branch coverage?
<flux>
apparently not quite
<ely-se>
put every branch on its own line :D
<flux>
hm, some refer to "condition/decision" coverage making it weaker than branch coverage
<flux>
but I think only reading docs or trying it out will give out the answer :)
<flux>
"condition coverage" seems like a rare term
<ely-se>
some say tests are completely useless and you need to prove your algorithms correct instead
<ely-se>
then they go on not getting stuff done :P
<flux>
there was recently an old comment by bjarne stroustrup that tests are quite needed even in presence of formal tests
<flux>
as there's always a part that you haven't modeled correctly
<ely-se>
also integration with external entities
<ely-se>
which may be very buggy
<flux>
or, perhaps, an attribute that would be useful to prove, but you didn't realize to do that and failing that criteria renders the app useless in real world..
jun_ has joined #ocaml
<flux>
ely-se, well, that's exactly it, you didn't then model the external entity correctly
<flux>
it would be nice if (ie.) operating systems provided Coq-compatible interface descriptions, then it would be quite clear where the bug is.. :)
<ely-se>
I want to try contract programming but there are so few tools to do it
<ely-se>
e.g. put assertions in .mli files, like you can do with interfaces in D and Eiffel
oscar_toro has left #ocaml [#ocaml]
<flux>
I guess implementing that wouldn't be an easy fit in ocaml syntax extension systems
kushal has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
Oh_Camel has quit [Ping timeout: 246 seconds]
kushal has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
freehck has quit [Ping timeout: 246 seconds]
KDr2 has quit [Remote host closed the connection]
ely-se has joined #ocaml
ely-se has quit [Client Quit]
Kakadu has quit [Ping timeout: 246 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
ely-se has joined #ocaml
<ely-se>
1 + 2 * 3 is 9 in Smalltalk. I like that.
<zozozo>
ely-se: that's some weird operators priority
<ely-se>
simple left to right
<ely-se>
like 1.+(2).*(3)
oscar_toro has joined #ocaml
oscar_toro has quit [Read error: Connection reset by peer]
<zozozo>
seems strange but understandable
<zozozo>
anyway, the nice way to write that would be * + 1 2 3, ^^
<ely-se>
I like * (+ 1 2) 3
<zozozo>
the nice thing about polish reverse notation is that it doesn't need parenthesis as it is unambiguous (and without operator priority)
Haudegen has joined #ocaml
rand__ has joined #ocaml
<ely-se>
that's true
<ely-se>
I like it better the other way around though, 3 2 1 + *
antkong has quit [Quit: antkong]
roelof_ has joined #ocaml
<roelof_>
Hello, I like to learn ocaml. Does anyone knows a good online cloud enviroment which I can use ?
<dmbaturin>
roelof_: Use for what?
<roelof_>
learning and making programms. I think Win 10 is not the right OS for such a job
<dmbaturin>
roelof_: OPAM, the de facto standard package manager, doesn't work on windows, so yeah, that's not so handy. However, it works on any UNIX platform, so any linux or BSD VPS will do.
rand__ has quit [Quit: leaving]
<roelof_>
oke, I looked at nitrious.io but it seems they do not have things like syntax highlighting
<dmbaturin>
Or install virtualbox and make a UNIX VM locally.
<roelof_>
I will look at that. Is ocaml from the very beginning a good book for a absolute beginner
rand__ has joined #ocaml
<dmbaturin>
Yes, that's a nice book.
<roelof_>
thanks, for the info
<dmbaturin>
zozozo: I think the thing is that smalltalk has no operator precedence at all, so any sequence is evaluated left to right.
<ely-se>
1 + 3 sends the message "+ 3" to 1
ely-se has quit [Quit: leaving]
antkong has joined #ocaml
roelof_ has quit [Quit: Page closed]
<dmbaturin>
roelof_: Note that OPAM authors distribute binaries, and it can be used for installing ocaml itself (and can keep multiple versions and switch between them), so the best way to setup the environment is to first setup OPAM and then use it to setup ocaml.
_andre has joined #ocaml
zpe has quit [Remote host closed the connection]
LnL has joined #ocaml
<flux>
re. operator precedency: I like being copy'n paste formulas from maxima/octave. I still need to search/replace * / . and literals but it's less risky I think :)
<flux>
(or maybe I could just open some FloatOps module)
antkong has quit [Quit: antkong]
slash^ has joined #ocaml
zpe has joined #ocaml
ollehar has joined #ocaml
ely-se has joined #ocaml
tennix has quit [Ping timeout: 252 seconds]
ontologiae has joined #ocaml
BitPuffin has joined #ocaml
mort___1 has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
mort___1 has quit [Read error: Connection reset by peer]
mort___1 has joined #ocaml
ggole has joined #ocaml
mcclurmc_ has quit [Remote host closed the connection]
ely-se has quit [Quit: leaving]
ontologiae has joined #ocaml
ely-se has joined #ocaml
ontologiae has quit [Ping timeout: 250 seconds]
native_killer has joined #ocaml
obadz- is now known as obadz
samrat has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
lopex has quit [Read error: Connection reset by peer]
lopex has joined #ocaml
sepp2k has joined #ocaml
_obad_ has quit [Ping timeout: 240 seconds]
johnelse_ is now known as johnelse
zpe has quit [Remote host closed the connection]
native_killer has quit [Quit: Leaving]
mort___1 has quit [Quit: Leaving.]
mort___ has joined #ocaml
JuggleTux has joined #ocaml
<dinosaure>
hello, it's possible to merge ocaml-base64 with ocaml-nocrypto ?
<dinosaure>
because we have two library for the same way (just ocaml-base64 handles a uri safe alphabet)
<dinosaure>
or I can change nocrypto to handle a b64 with uri safe alphabet
tennix has joined #ocaml
demonimin has quit [Remote host closed the connection]
travisbrady has joined #ocaml
demonimin has joined #ocaml
ontologiae has joined #ocaml
boegel has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
tennix has quit [Ping timeout: 252 seconds]
travisbrady has quit [Client Quit]
ollehar has quit [Quit: ollehar]
travisbrady has joined #ocaml
circ-user-ZLh45_ has quit [Ping timeout: 240 seconds]
JuggleTux has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
ely-se is now known as ^elyse^
^elyse^ has quit [Quit: leaving]
NingaLeaf has joined #ocaml
AltGr has left #ocaml [#ocaml]
rand__ has quit [Ping timeout: 252 seconds]
tennix has joined #ocaml
tennix has quit [Changing host]
tennix has joined #ocaml
ontologiae has quit [Read error: Connection reset by peer]
JuggleTux has joined #ocaml
tennix has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 264 seconds]
ely-se has joined #ocaml
ely-se has quit [Client Quit]
ely-se has joined #ocaml
travisbrady has quit [Quit: travisbrady]
freehck has joined #ocaml
empyrean has quit [Ping timeout: 265 seconds]
octachron has joined #ocaml
travisbrady has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 260 seconds]
mcclurmc has joined #ocaml
MercurialAlchemi has joined #ocaml
tennix has joined #ocaml
tane has joined #ocaml
freehck has quit [Ping timeout: 246 seconds]
tennix has quit [Ping timeout: 240 seconds]
snyp has joined #ocaml
tennix has joined #ocaml
jeffmo has joined #ocaml
tennix has quit [Ping timeout: 250 seconds]
Denommus has joined #ocaml
ely-se has quit [Quit: leaving]
BitPuffin has quit [Ping timeout: 265 seconds]
snyp has quit [Quit: WeeChat 1.3]
arjunguha has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 240 seconds]
tennix has joined #ocaml
shinnya has joined #ocaml
mort___ has quit [Ping timeout: 246 seconds]
tennix has quit [Ping timeout: 255 seconds]
BitPuffin has joined #ocaml
samrat has quit [Ping timeout: 265 seconds]
jwatzman|work has joined #ocaml
ncthom91 has joined #ocaml
Denommus` has joined #ocaml
empyrean has joined #ocaml
Denommus has quit [Ping timeout: 255 seconds]
Simn has quit [Quit: Leaving]
empyrean has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
Denommus` is now known as Denommus
rand__ has joined #ocaml
inr has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Remote host closed the connection]
inr has joined #ocaml
travisbrady has quit [Ping timeout: 260 seconds]
ggole has quit [Ping timeout: 246 seconds]
native_killer has joined #ocaml
antkong has joined #ocaml
rand__ has quit [Ping timeout: 250 seconds]
darkf has quit [Quit: Leaving]
kushal has quit [Ping timeout: 246 seconds]
kushal has joined #ocaml
Kakadu has joined #ocaml
native_killer has quit [Quit: Leaving]
BitPuffin has quit [Ping timeout: 240 seconds]
antkong has quit [Quit: antkong]
lobo has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
shinnya has joined #ocaml
boegel has joined #ocaml
rgrinberg has joined #ocaml
sgeisenh has quit [Quit: WeeChat 1.2]
breadmonster has joined #ocaml
<breadmonster>
Hey everyone.
<breadmonster>
Why can't I implement the fix function in OCaml?
<breadmonster>
In Haskell it's `fix f = let x = f x in x`
sgeisenh has joined #ocaml
samrat has joined #ocaml
<def`>
let rec fix f x = f (fix f) x
<def`>
you need to eta-expand to delay evaluation (ocaml being strict)
<def`>
eta-expand is adding this x argument
<breadmonster>
Aaah okay.
rgrinberg has quit [Ping timeout: 265 seconds]
<dmbaturin>
breadmonster: On a bright side, the need for eta expansion inhibits excessive use of point-free style. ;)
<def`>
+1 :D
samrat has quit [Ping timeout: 250 seconds]
<breadmonster>
dmbaturin: You make it sound like a bad thing :P
sh0t has joined #ocaml
samrat has joined #ocaml
jeffmo has quit [Ping timeout: 255 seconds]
<dmbaturin>
Well, I'm only against its excessive use, not point-free style itself. :)
<Maelan_>
I have a .polyml directory in my home, the origin of I do not know.
samrat has quit [Ping timeout: 240 seconds]
<Maelan_>
Could it be related to any OPAM package?
jeffmo has joined #ocaml
samrat has joined #ocaml
<dmbaturin>
Maelan_: It stores some runtime information stats there. If you had to kill your Poly/ML REPL process or made it crash, the file remain. They are safe to remove.
<Drup>
poly/ML is another language of the ML family
<Drup>
so, I doubt it's opam related
<Maelan_>
Yeah, but I see no other explanation.
<dmbaturin>
And no, there is no way to install anything Poly/ML-related from opam. :)
breadmonster has left #ocaml [#ocaml]
<Maelan_>
I thought that maybe some package could make something with poly/ML at compile-time.
<dmbaturin>
I think nothing in opam has any SML dependencies. That would be rather odd.
<Maelan_>
I do not remember having ever installed or tried Poly/ML.
<Maelan_>
I continue investigating then.
tennix has joined #ocaml
<dmbaturin>
Run 'which poly'.
<Maelan_>
I do not have such an executable in my path.
<Maelan_>
Ohoh, I bet the culprit is Isabelle.
lobo has quit [Ping timeout: 240 seconds]
<dmbaturin>
Yeah, Isabelle is normally built with Poly/ML I think.
rand__ has joined #ocaml
<dmbaturin>
Anyway, Poly/ML is a rather nice SML implementation, I use it for the interactive toplevel.
LnL has quit [Ping timeout: 272 seconds]
tennix has quit [Ping timeout: 255 seconds]
<Maelan_>
I did not thought that SML was really used nowadays. I was in the belief that (O)Caml remained the only ML descendant with significant use.
<dmbaturin>
Unlike SML/NJ, it does work on 64-bit platforms natively.
<dmbaturin>
Well, there's also F#.
<Maelan_>
Oh, right.
<dmbaturin>
Isabelle is not the only prover written in SML. Twelf also uses it, although I'm still to try it out.
rand__ has quit [Ping timeout: 250 seconds]
ousado has quit [Read error: Connection reset by peer]
<Maelan_>
So does SML have features not present in OCaml? What are the important differences?
<rks`>
Orange.
<dmbaturin>
Maelan_: First class constructors (fun toOpt xs = List.map SOME xs). Magically overloaded arithmetics. Transparent signature ascription in addition to opaque ascription. Fully formalized definition.
<Drup>
Maelan_: eh, as soon as the 4th point, it's already wrong
<Maelan_>
Yes, it is a bit outdated too.
<Maelan_>
And about type annotation, the guy says they do not allow to enforce polymorphism, which is not true anymore with the “: 'a. 'a -> 'a” syntax.
<Drup>
it's a bit more complicated than that, because this type annotation is not available everywhere
moei has quit [Quit: Leaving...]
<Maelan_>
Yes, and I’m still trying to understand how type annotation and type inference work in OCaml. I thought I knew, then I got some weird results with “:'a. blabla” and “:type a. blabla”.
<dmbaturin>
SML also uses a very strict form of value restriction, so it needs a lot more eta expansions.
<Maelan_>
By the way, how arithmetic overloading works i
<Maelan_>
By the way, how arithmetic overloading works with type inference in SML?
<mrvn>
Maelan_: 'a. 'a -> 'a is allowed in records, but not normal functions
<mrvn>
Maelan_: doesn't SML have type classes?
<Maelan_>
rks`, … ? Openness?
<dmbaturin>
I didn't check how implementations do it, but overloading is not reflected in the typing rules in any way, so it's essentially a hack.
<dmbaturin>
There is no overloading as language feature exposed to the user.
rgrinberg has joined #ocaml
<mrvn>
I want: a M.+ b
slash^ has quit [Read error: Connection reset by peer]
<dmbaturin>
Maelan_: Ah, yes, there are also "equality types". (=) only works for certain predefined types, otherwise it doesn't typecheck.
<Maelan_>
dmbaturin, isn’t that another occurence of overloading?
<Maelan_>
mrvn, is that a question? I am the one asking questions, so I do not know. :-)
Maelan_ has quit [Quit: Reconnecting]
Maelan has joined #ocaml
<dmbaturin>
* It works with sum and product types though, as long as their members have an eqtype.
<dmbaturin>
Maelan: Pretty much, but there is no way to provide your own implementation of equality that will work with built-in (=) function.
rand__ has joined #ocaml
<dmbaturin>
In other words, the amount of ad-hocery in SML standard library compensates for the fully formalized language. :)
iosys has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 250 seconds]
ousado has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
samrat has quit [Ping timeout: 272 seconds]
<dmbaturin>
Maelan: http://baturin.org/code/mlton-overload/ My theory is that it first replaces the operator with its particular implementation like Int.(+) based on types of arguments, and then runs it through the normal overload-unaware type checker. But I never read that code and thus can be wrong about details.
tennix has joined #ocaml
sepp2k has quit [Quit: Leaving.]
tennix has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
uris77 has joined #ocaml
ncthom91 has joined #ocaml
ontologiae has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
sh0t has quit [Ping timeout: 240 seconds]
<Maelan>
hmm, okay
<dmbaturin>
Maelan: What are you proving with Isabelle, by the way?
mea-culpa has joined #ocaml
_andre has quit [Quit: leaving]
<Maelan>
dmbaturin, nothing, just trying it.
Haudegen has joined #ocaml
<sgeisenh>
Everyone in here dissing on SML ='(
<sgeisenh>
At least SML has a type safe module language =P
<sgeisenh>
Oops, I meant abstraction safe.
mea-culpa has quit [Ping timeout: 265 seconds]
<Denommus>
SML is proven, OCaml is not, it's just a pragmatic, engineer-oriented ML variation
<dmbaturin>
sgeisenh: I like SML and I'm a big fan of its maintainer.
<Denommus>
I wonder how a newer pragmatic ML would look like with the most recent research
<Denommus>
something that is for OCaml like Rust is for C++
<dmbaturin>
...which doesn't prevent me from routinely making fun of particular features of languages I like. :)
<dmbaturin>
Denommus: Not sure if Rust really should be seen as an evolution of C++.
<sgeisenh>
dmbaturin: It was, in many ways, developed as a safe alternative to C++.
moei has joined #ocaml
<dmbaturin>
Denommus: Have you seen 1ML?
<sgeisenh>
1ML isn't exactly more practical. It makes optimization of abstractions MUCH harder.
<dmbaturin>
sgeisenh: Safe alternative to C++ designed with imperative mindset precedes C++, it's called Ada. :)
<Denommus>
dmbaturin: I have not
<dmbaturin>
What I mean is that Rust is more of a qualitative change compared to C++.
ollehar has joined #ocaml
<dmbaturin>
Denommus: It has some ideas about module system. There's also eff-lang.org that has new ideas about handling effects.
mea-culpa has joined #ocaml
<Denommus>
dmbaturin: I thought Ada variants with dynamically allocated memory allowed use-after-free, unlike safe Rust (that is, Rust without unsafe blocks)
larhat1 has joined #ocaml
<Denommus>
dmbaturin: and nevertheless, Rust doesn't have only the imperative mindset. In that regard, it's somewhat similar to OCaml - except for the mut variables
empyrean has joined #ocaml
rpg has joined #ocaml
<dmbaturin>
Denommus: Yeah, that's what I mean. Rust is more of a qualitative change.
<dmbaturin>
However, I might have misinterpreted your statement and you meant a qualitative change from ocaml. I think I need some sleep.
<ollehar>
does ocaml gc do realloc?
<ollehar>
of string, e.g.
<ollehar>
because string concat is slower in ocaml than in php
<Denommus>
ollehar: which version?
<ollehar>
Denommus: 4.02.1
<ollehar>
php 5.5
<Denommus>
ollehar: String.concat?
<ollehar>
Denommus: no, ^
<ollehar>
same?
<Denommus>
ollehar: I mean, what function are you using for concatenation?
<ollehar>
^
<ollehar>
so, a ^ b
<ollehar>
:)
<Denommus>
ollehar: ah, I usually expect one to say (^) XD
<ollehar>
haha ok
<ollehar>
is String.concat in str.c, byterun?
<Denommus>
ollehar: the module String deals with a immutable data structure, the module Bytes is almost the same data structure, but mutable
<Denommus>
ollehar: (^) actually works with Bytes.t, not String.t
<Denommus>
ollehar: I'm not an specialist, so I don't know if that's resulting in poor performance
nullcatxxx_ has joined #ocaml
<ollehar>
ah
<Maelan>
Denommus, really?
<Maelan>
(about (^) working with Bytes.t)
<Denommus>
Maelan: testing it now I'm actually kinda confused
<Maelan>
The toplevel with ocaml 4.02.3 says me it is still of type string -> string -> string.
<dmbaturin>
Maelan, Denommus: It depends on whether you use -safe-string option.
<Denommus>
ah
<Denommus>
dmbaturin: so utop is probably using unsafe strings, right?
<dmbaturin>
In 4.02.1 at least, later versions could make the immutable string the default.
<ollehar>
god
<ollehar>
complex
<dmbaturin>
Immutable string distinct from bytes is the future.
<ollehar>
so no way to realloc a gc block, then...
<Maelan>
ollehar, « bytes » and « string » are really the same under the hood.
<ollehar>
can't find any realloc in alloc.h, anyway.
<ollehar>
Maelan: char, that is? ^^
<ollehar>
well, char = byte, so.
<dmbaturin>
(^^) is format -> format -> format :)
<Maelan>
ollehar, an « array » of chars, but not a regular OCaml’s array (for space-efficiency and, I guess, interaction with C).
<ollehar>
yeah, char*
<ollehar>
ending with nul
<ollehar>
which is not the same as null
<Maelan>
Well, not really.
<Maelan>
You also have the length stored so you can access it in constant time (like for OCaml’s arrays).
<Maelan>
And OCaml’s strings can store null bytes.
<ollehar>
yeah, I read that.
uris77 has quit [Quit: leaving]
<ollehar>
but caml_str_concat uses strlen ><
<ollehar>
but that's only internal, I think
<Maelan>
dmbaturin, (^) is string -> string -> string for me with or without -safe-string.
<Maelan>
By the way, when will this flag be the default?
ely-se has joined #ocaml
<ely-se>
totally forgot to add this channel on my home computer!
<dmbaturin>
Maelan: If it's string -> string -> string for you and you are using the latest version, I think it already is. :)
<Denommus>
somehow utop has bytes -> bytes -> bytes, though
<Denommus>
unless I use -safe-string
<Maelan>
dmbaturin, in fact I had Batteries enabled in my .ocamlinit, when removing it I get string -> string -> string with -safe-string and bytes -> bytes -> bytes without.
<Maelan>
So it was Batteries redefining standard functions…
<companion_cube>
batteries tends to put lots of stuff in its Pervasives module :/
<Maelan>
(tried with String.concat too, so it’s not only Pervasives)
tane has quit [Quit: Verlassend]
<companion_cube>
you can use batteries without opening it, btw
<shastacen>
How can I load zarith into my ocaml toplevel?
<companion_cube>
#require "zarith"
<companion_cube>
if you have ocamlfind installed
<ollehar>
#use topfind?
<shastacen>
Wront type of argument for directive 'use' ?
<companion_cube>
#use "topfind";;
<companion_cube>
#require "zarith";;
esden has left #ocaml [#ocaml]
<shastacen>
sweet you guys are awesome
<companion_cube>
bonus tip: with Zarith you can write things like Z.(a + b * c) using the Z.( ) local open
<Maelan>
companion_cube, yes, but I often find it more convenient, and as I’m willing it will be more or less standardized some day, I treat it as such and try to get used to it.
Kakadu has quit [Remote host closed the connection]
<companion_cube>
as you want :-)
<shastacen>
Can I write toplevel directives in the file?
<Maelan>
I am not afraid of depending on Batteries even if it is only for List.init.
<shastacen>
appears not
<Maelan>
But I know than not everyone agrees on whether we should augment the standard lib and whether Batteries is a good candidate.
<companion_cube>
many people want to extend the stdlib, but it's a complicated topic
mea-culpa has quit [Ping timeout: 244 seconds]
<ely-se>
I want an AWK-Eiffel-OCaml hybrid.
<ely-se>
my three favourite programming languages
<Maelan>
However, most of the time I only use Batteries for simple functions missing in the standard lib with no good reason, like missing analogous (eg. List.init which is the missing analogous to Array.init).
<companion_cube>
you could give containers a try 0:-)
<Maelan>
I was sure you’ll say that. :-)
<companion_cube>
:P
<companion_cube>
well if it's only for a few functions
<Maelan>
Does containers define general-purpose functions of this kind?
<companion_cube>
sure
<Maelan>
The other Batteries’ feature that I find of great interest (although I do not use it for now) is the unified interface for dealing with containers (the Enum stuff).
<companion_cube>
sure, there are iterators in most stdlibs now
<Maelan>
Again, I believe you have something similar in your containers library?
<companion_cube>
yes, mostly Sequence
<companion_cube>
less powerful but much faster than Enum
<Maelan>
What are the differences?
<companion_cube>
Enum can implement merge/zip/map2 (lock step iteration on several iterators)