<Drup>
This question has been treated many times. I suggest you ask more specific questions if you want meaningful answers. ;)
<banjamine>
That covers it
<companion_cube>
:D
<banjamine>
So it's not really for embedded systems programming either
<Drup>
Depends what you mean by embedded
<banjamine>
Like at a car factory
<banjamine>
Or any kind of industrial factory
<Drup>
I don't think anyone has put OCaml in a car yet :D
mattcode has joined #ocaml
<companion_cube>
there's ocapic but I really don't think it's "industrial strength"
<banjamine>
What would be considered industrial strength?
<dmbaturin>
The real issue with elevator controller programming is hard realtime requirement, which is very hard to reconcile with garbage collection.
Jesin has quit [Quit: Leaving]
<dmbaturin>
Then again, in spacecraft controllers, the most common guideline is to not use any dynamic memory at all; and in washing machines etc., well, people get away with techniques so bad for RT that they could as well be using a GC.
<companion_cube>
industrial strength for that would be Ada
<dmbaturin>
In any case, it depends on what exactly it's doing at a car factory. SCADA applications only need soft RT, which in many cases is relaxed to "doesn't hang". ;)
<banjamine>
What is RT?
<dmbaturin>
banjamine: Realtime.
<banjamine>
And go?
<banjamine>
Gc?
<dmbaturin>
Go is mandatorily garbage collected, so no hard RT ever.
<dmbaturin>
Then again, programs aren't hard RT by themselves... systems are. Running a program written with hard RT in mind on a non-RT OS is pointless.
<dmbaturin>
(Go also has a type safety that is a joke, but that's another story)
<dmbaturin>
aantron: In Lwt, is there a way to get a complete exception trace from a thread?
<dmbaturin>
I.e. if we have Lwt.on_failure (Some_module.some_fun ()) ..., and some_fun raises an exception, how can I know where exactly it comes from?
Haudegen has quit [Remote host closed the connection]
orbifx1 has joined #ocaml
Guest74448 has joined #ocaml
silver has joined #ocaml
Guest74448 is now known as Haudegen
<bartholin>
When coding on the interpreter, is there a way to refer to the previous result? Like, on the first line I type 1+1;;, then on the second line I type ?? + 5;;, and it returns 7?
<companion_cube>
not that I know of
<companion_cube>
it's a bit sad
<tarptaeya>
Why does let (+) a b = a * b works but let (.) a b = a*b give error "operated expected"?
<orbifx1>
bartholin: so long you are writing pure expressions you can hit up (arrow) then replace ; with ` |> your expression here `
<bartholin>
tarptaeya: (.) is not an operator.
<tarptaeya>
ohh, where can I find a list of operators ?
<octachron>
I am starting to wonder if Caml Light documentation should be moved elsewhere now that French CPGEs are switching to OCaml
<bartholin>
oh
* bartholin
remembers that thing exists
<Drup>
octachron: they are ???
maattdd_ has joined #ocaml
nomicflux has joined #ocaml
maattdd_ has quit [Ping timeout: 276 seconds]
<octachron>
Drup, yes the only language recommended starting from this year is OCaml, no longer Caml Light nor (Caml Light or Pascal)
<Drup>
Alleluia.
mengu has joined #ocaml
maattdd_ has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
mengu has quit [Ping timeout: 240 seconds]
maattdd_ has quit [Ping timeout: 256 seconds]
<Fardale>
bartholin: utop -implicit-bindings
Deknos has joined #ocaml
nadako has joined #ocaml
jnavila has joined #ocaml
maattdd_ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
maattdd_ has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
min has joined #ocaml
maattdd_ has joined #ocaml
barcabuona has quit [Quit: WeeChat 2.0.1]
maattdd_ has quit [Ping timeout: 276 seconds]
maattdd_ has joined #ocaml
spew has quit [Ping timeout: 248 seconds]
maattdd_ has quit [Ping timeout: 260 seconds]
min has left #ocaml ["Leaving"]
maattdd_ has joined #ocaml
barcabuona has joined #ocaml
maattdd_ has quit [Ping timeout: 252 seconds]
maattdd_ has joined #ocaml
maattdd_ has quit [Ping timeout: 260 seconds]
seangrove has joined #ocaml
ygrek has joined #ocaml
<madroach>
I'm giving a try to containers right now and am wondering how I am supposed to compare custom types like simple zero-argument variants.
<companion_cube>
Pervasives.compare
<companion_cube>
or Pervasives.(=)
maattdd_ has joined #ocaml
<companion_cube>
(but ideally you'd provide an `equal` function in your module along these custom types, even if internally it's just Pervasives.(=))
bmgxc9 has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
<thizanne>
use Obj.magic and then you can have ( = )
<companion_cube>
:D
<companion_cube>
you monster
maattdd_ has quit [Ping timeout: 276 seconds]
sh0t has quit [Remote host closed the connection]
<madroach>
hmm, I'm not convinced by dogmatically prohibiting polymorphic comparison. In most cases it will be optimized away in any case.
<companion_cube>
it's not a question of optimisation, but safety
<madroach>
huh? why that?
jimmyrcom has joined #ocaml
<companion_cube>
polymoprhic comparison is a common source of bugs
bmgxc9 has quit [Remote host closed the connection]
maattdd_ has joined #ocaml
bmgxc9 has joined #ocaml
<madroach>
Is that because it may yield false non-equal results?
<madroach>
nevermind, I'll use google...
<thizanne>
it could also yield false equal results
dejanr has joined #ocaml
maattdd_ has quit [Ping timeout: 264 seconds]
dejanr has quit [Client Quit]
<companion_cube>
also, it will fail if the values contain closures
<malc_>
companion_cube: as will (=)
dejanr has joined #ocaml
<companion_cube>
that's what I meant
<malc_>
companion_cube: (=) is not a comparison function though
maattdd_ has joined #ocaml
<thizanne>
madroach: rather than "dogmatically prohibiting polymorphic comparison", would you be more comfortable with "prevents you from inadvertently using ( = ) when you actually wanted M.equal" ?
<companion_cube>
yeah yeah, I mean the poltmorphic operators in general
dejanr has quit [Client Quit]
dejanr has joined #ocaml
maattdd_ has quit [Ping timeout: 256 seconds]
isd has joined #ocaml
bmgxc9 has quit [Remote host closed the connection]
nomicflux has quit [Quit: nomicflux]
spew has joined #ocaml
ewanas has quit [Quit: Leaving]
maattdd_ has joined #ocaml
spew has quit [Ping timeout: 248 seconds]
<madroach>
It seems to me that completely removing polymorphic comparison is like throwing out the baby with the bath water. I use (=) only for non-structured types or very simple types like tuples and zero-argument variant types.
<madroach>
I don't know how to implement this in a library, but a sensible compromise could be to forbid polymorphic comparison for abstract types.
<companion_cube>
but we can't really do that… that would require compiler support
<companion_cube>
(=) is still there, it's just under Pervasives
<madroach>
I'll probably prepend let (=) = Pervasives.(=);; to my code.
<madroach>
Otherwise my code needs to change from
<madroach>
if ctx.in_len > 0 || flush = Finish
<companion_cube>
or `open Pervasives` at the beginning if you prefer it
<madroach>
to
<madroach>
if ctx.in_len > 0 || (match flush with Finish -> true |_ -> false)
<theblatte>
(compiler support for removing unsafe (=) would be really nice)
<theblatte>
(=) is such a footgun that forbidding it entirely is kind of worth it
maattdd_ has quit [Ping timeout: 240 seconds]
<companion_cube>
also, List.mem, List.assoc, all that :/
malc_ has quit [Remote host closed the connection]
<theblatte>
yes, that's the actual footgun as it's more hidden
<theblatte>
better stdlib that force you to specify the equality function help
<companion_cube>
yeah…
<thizanne>
I'm not sure there is a single opam package that wouldnt be broken by forbidding (=)
<thizanne>
apart from containers ;)
<companion_cube>
you kidding, I'm sure a lot of packages use polymorphic ueqality
<thizanne>
and I guess the "let's emit a warning first and deprecate it" wouldnt be faster than "let's juste wait for modular implicits to fix this"
<thizanne>
(I want to believe it at least)
<companion_cube>
haahahah :D
<companion_cube>
the deprecation + warning has the advantage that modifications to packages can be backported, though
<companion_cube>
same as safe-string
<isd>
thizanne: is actually merging modular implicits likely to happen? The paper and initial implementation was years ago, and the last I checked the branch hadn't been touched in a while.
<companion_cube>
they're reworking on the theory I think
<companion_cube>
but it'll be years, at best, I think
tarptaeya has quit [Quit: Leaving]
<isd>
I'm honestly not sure how I feel about modular implicits. It's an elegant solution, but coming from Haskell I actually really don't miss the massive pile of abstraction that type classes permit.
<companion_cube>
:D
<companion_cube>
well it would enable a lot of good things, too
<companion_cube>
e.g. make it much easier to write random tests
<companion_cube>
debug printing would be more convenient, too
shinnya has quit [Ping timeout: 276 seconds]
<theblatte>
thizanne: well I know at least one project that completely forbids (=) so that one wouldn't be broken ;)