<sdegutis>
I forgot how to program. I can't write a simple budget app. Wth.
<Drup>
AltGr: and on top of r/programming too
<Drup>
I don't know what's happening.
shinnya has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
<tokenrove>
if i have tests in a subdirectory tests/, and my source (on which the tests depend) in src/; is there any way for me to craft a suitable oasis file that will find the modules in src/ when the tests are compiled? or do i have to build a library?
kcking has joined #ocaml
<whitequark>
sdegutis: yea, poorly executed trolling is more of your schtick
<sdegutis>
whitequark: what the hell are you talking about?
jleroux` has quit [Remote host closed the connection]
<sdegutis>
whitequark: fwiw my wife is very likely having a miscarriage so please be kind.
struktured has joined #ocaml
bytbox has joined #ocaml
<tokenrove>
sdegutis: you might not be aware that the tone of your interactions on this channel has been impolite. fyi.
<struktured>
companion_cube: ring buffer PR made, I tested the hell out of it so I think it's in good shape
<sdegutis>
tokenrove: today?
<sdegutis>
tokenrove: or in general?
<Drup>
not today
reem has quit [Remote host closed the connection]
reem has joined #ocaml
q66 has quit [Quit: Leaving]
yminsky has joined #ocaml
Algebr has joined #ocaml
<struktured>
AltGr: that's pretty cool, although I don't quite get why
jao has quit [Ping timeout: 250 seconds]
hilquias has quit [Ping timeout: 256 seconds]
reem has quit [Remote host closed the connection]
sdegutis has quit [Quit: Leaving...]
ghostpl_ has joined #ocaml
sdegutis has joined #ocaml
<sdegutis>
Drup, tokenrove: So what I'm hearing is that some people here have thought I was being rude, and didn't it to my attention in any way until the context was far gone, leaving me no chance to learn from the experience in any way.
<sdegutis>
I think that says more about the people in #ocaml.
sdegutis has quit [Client Quit]
<struktured>
well that was unnecessarily dramatic
reem has joined #ocaml
ghostpl_ has quit [Ping timeout: 246 seconds]
Algebr has quit [Ping timeout: 264 seconds]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
hilquias has joined #ocaml
<ousado>
:/
ptc has joined #ocaml
ptc is now known as Guest66252
yminsky has quit [Quit: yminsky]
kapil___ has joined #ocaml
Guest66252 has quit [Ping timeout: 245 seconds]
monoprotic_2 has joined #ocaml
monoprotic has quit [Ping timeout: 255 seconds]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
manud has quit [Quit: manud]
reem has quit [Remote host closed the connection]
monoprotic_2 is now known as monoprotic
reem has joined #ocaml
mjw56 has quit [Remote host closed the connection]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
reem has quit [Ping timeout: 265 seconds]
mcclurmc has joined #ocaml
reem has joined #ocaml
fyolnish has joined #ocaml
ghostpl_ has joined #ocaml
mabino-pyon is now known as pyon
ghostpl_ has quit [Ping timeout: 250 seconds]
skinkitten has joined #ocaml
skinkitten has quit [Remote host closed the connection]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
kbp has joined #ocaml
kbp has quit [Remote host closed the connection]
kbp has joined #ocaml
<kbp>
does anyone here make music with ocaml? does anyone know of a package or a technique to get started making music with ocaml?
psy_ has quit [Quit: Leaving]
mcclurmc has quit [Remote host closed the connection]
kbp has quit [Remote host closed the connection]
swgillespie has joined #ocaml
pyon has quit [Quit: Fantaisie Im-pyon-ptu...]
mabino-pyon has joined #ocaml
kcking has quit [Quit: kcking]
ygrek has quit [Ping timeout: 250 seconds]
prsn has quit [Ping timeout: 245 seconds]
reem has quit [Remote host closed the connection]
prsn has joined #ocaml
reem has joined #ocaml
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 256 seconds]
MercurialAlchemi has joined #ocaml
lyxia has quit [Ping timeout: 240 seconds]
lyxia has joined #ocaml
manud has joined #ocaml
ebzzry has quit [Remote host closed the connection]
avsm has joined #ocaml
Kakadu has joined #ocaml
psy_ has joined #ocaml
axiles has quit [Ping timeout: 252 seconds]
Submarine has quit [Remote host closed the connection]
MercurialAlchemi has quit [Remote host closed the connection]
hilquias` has joined #ocaml
MercurialAlchemi has joined #ocaml
hilquias has quit [Ping timeout: 244 seconds]
ygrek has joined #ocaml
axiles has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
contempt has quit [Ping timeout: 252 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
avsm has quit [Ping timeout: 265 seconds]
tane has joined #ocaml
contempt has joined #ocaml
Haudegen has joined #ocaml
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 245 seconds]
<tane>
morning
manud has quit [Quit: manud]
<tane>
are there special requirements or hidden steps the manual doesn't mention in setting up ppx_deriving?
<tane>
i always get "Unrecognized [@@deriving] annotation syntax" in the toplevel. And when i don't it's just ignore
manud has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
reem has quit [Remote host closed the connection]
Simn has joined #ocaml
Haudegen has joined #ocaml
manud has quit [Quit: manud]
<tane>
ok, my mistake, opam version was too old to install the newest release packages
manud has joined #ocaml
avsm has joined #ocaml
avsm has quit [Client Quit]
keen__________71 has joined #ocaml
keen__________70 has quit [Ping timeout: 256 seconds]
manud has quit [Quit: manud]
MrScout has quit [Remote host closed the connection]
matason has joined #ocaml
manud has joined #ocaml
huza has joined #ocaml
larhat has joined #ocaml
zpe has joined #ocaml
rand000 has joined #ocaml
aubergines has joined #ocaml
ghostpl_ has joined #ocaml
captain_furious has joined #ocaml
avsm1 has joined #ocaml
octachron has joined #ocaml
manud has quit [Quit: manud]
marynate has joined #ocaml
mort___ has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
madroach has quit [Quit: leaving]
dav_ has joined #ocaml
dav has quit [Ping timeout: 255 seconds]
madroach has joined #ocaml
Nahra has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
axiles has quit [Ping timeout: 250 seconds]
keen__________72 has joined #ocaml
axiles has joined #ocaml
AltGr has left #ocaml [#ocaml]
keen__________71 has quit [Ping timeout: 252 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
marynate has quit [Quit: Leaving]
Haudegen has joined #ocaml
matason has quit [Quit: Later!]
octachron has quit [Ping timeout: 264 seconds]
darkf_ has joined #ocaml
mort___ has quit [Ping timeout: 250 seconds]
oscar_toro has joined #ocaml
matason has joined #ocaml
darkf has quit [Ping timeout: 264 seconds]
dsheets has quit [Ping timeout: 264 seconds]
psy_ has quit [Ping timeout: 255 seconds]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
ggole has joined #ocaml
darkf_ is now known as darkf
dsheets has joined #ocaml
reem has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
reem has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
madroach has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
yminsky has joined #ocaml
yminsky has quit [Client Quit]
yminsky has joined #ocaml
avsm1 has quit [Quit: Leaving.]
octachron has joined #ocaml
avsm has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
<dmbaturin>
adrien: >it may be a good idea to go to c:\Gtk\bin and run chmod +x *.dll as some of the exta DLL's do not have the execution flag set.
mint has joined #ocaml
<dmbaturin>
What exactly does it mean? Why would .dll's need +x? Is chmod in question is chmod from cygwin?
captain_furious has quit [Quit: Leaving.]
mint has quit [Client Quit]
oscar_toro has quit [Quit: Lost terminal]
bytbox has quit [Remote host closed the connection]
ollehar has joined #ocaml
Thooms has joined #ocaml
shinnya has joined #ocaml
<adrien_znc>
morning! (I'm actually mostly emptying my znc backlog)
avsm has joined #ocaml
<dmbaturin>
adrien_znc: Well, I assumed that you will see the highlights. :)
matason has joined #ocaml
mort___ has joined #ocaml
bytbox has joined #ocaml
freling has joined #ocaml
<freling>
Hi, I have a question about file handling: I want to read a file and fill a structure along the way. If there is an error (if a read fails), I want to close the file descriptor and return None. Otherwise I want to return Some struct. I wonder if there is a proper way to do it
The_Mad_Pirate has quit [Quit: Konversation terminated!]
<freling>
For now I have a bunch of if.. then but there is a lot of duplicated code
<MercurialAlchemi>
freling: try/catch
darkf has quit [Quit: Leaving]
<freling>
MercurialAlchemi: thanks, I didn't think about this one actually :)
<MercurialAlchemi>
:)
<MercurialAlchemi>
(unfortunately, there is no finally in ocaml, unless you use lwt)
<freling>
It seems like I can't access the file descriptor in the "catch"
<Drup>
obviously you can't, since it's declared inside the try =)
<Drup>
the catch is outside the scope
<Drup>
Algebr: btw, what are you doing with lambda-term ?
<freling>
Yeah, so should I make the fd a reference?
<Drup>
freling: no
<Drup>
freling: just imbricate two try/with
<Drup>
one for opening, one for manipulations
<freling>
Ok
ptc has joined #ocaml
badkins has joined #ocaml
ptc is now known as Guest52890
<freling>
Thanks, the code is much cleaner
shinnya has quit [Ping timeout: 264 seconds]
<Algebr>
Drup: I really like htop and was thinking it would be nice to have something like that but for networking, like netstat/ss but showing you which ports are most active and whatnot. Also, I'm not sure if last time you answered my question about why the event handler function in lambda term give back a bool. Not if your answer about like DOM events was directed at me.
<Drup>
it was directed at you
<flux>
top combined with trafshow and iotop ;)
<Drup>
basically, the bool will tell lambda-term to propagate or not the event to handlers of other widgets
ygrek has joined #ocaml
<Drup>
(children, in particular)
<Drup>
events are top to bottom, iirc
<Algebr>
Ah, much appreciated.
<Algebr>
flux: nice, hadn't seen those before.
Guest52890 has quit [Ping timeout: 264 seconds]
zozozo has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
ptc_ has joined #ocaml
zozozo has joined #ocaml
<flux>
something that I could run on all my computers and it would tell not only which host but also which program is consuming bandwidth could be useful.
<flux>
bonus points for working with iptables to allow per-program bandwidth tuning/access lists ;)
avsm has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
bytbox has quit [Ping timeout: 245 seconds]
psy_ has joined #ocaml
BitPuffin has joined #ocaml
mcclurmc has joined #ocaml
avsm1 has quit [Quit: Leaving.]
fraggle-boate__ has joined #ocaml
fraggle_ has quit [Ping timeout: 252 seconds]
captain_furious has joined #ocaml
fraggle-boate_ has quit [Ping timeout: 264 seconds]
fraggle_ has joined #ocaml
psy_ has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
kcking has joined #ocaml
ptc_ has quit [Ping timeout: 252 seconds]
Algebr has quit [Ping timeout: 256 seconds]
ollehar has quit [Remote host closed the connection]
ollehar has joined #ocaml
ebzzry has joined #ocaml
<Leonidas>
iptables supports per program limiting?
<dmbaturin>
Leonidas: Well, it supports matching PIDs and other process information (including security context).
<Leonidas>
oh, didn't know that. neat.
jneen|afk is now known as jneen
axiles has quit [Ping timeout: 255 seconds]
<flux>
actually I was thinking using the UQUEUE target and generating firewall rules on the fly
<flux>
oh, actually just plain QUEUE
<dmbaturin>
flux: So you are writing a process-aware bandwidth monitor?
<flux>
no, but I could toy with one!
<dmbaturin>
I missed substantial part of related conversation it seems.
<flux>
and algebr, now gone, is writing some enhanced top in ocaml, apparently, with networking features
<flux>
actually I've been hoping to have a system that shows connections from computer to computer, from process to process. and in fact, I have one, supporting unix domain sockets, and producing graphviz graphs
<flux>
but the unix domain socket thingy required either a kernel patch or running GDB on kernel image..
sigrlami has joined #ocaml
<flux>
and it wasn't a live image, but rather an inconsistent snapshot
ollehar has quit [Remote host closed the connection]
<dmbaturin>
What I find annoying about most of OSes is how little you can do in a machine-friendly way.
<sigrlami>
Hi everyone! I stuck with json parsing. How can I get list of all keys in json file? Can't find any access mechanism in docs.
<dmbaturin>
sigrlami: Which JSON library are you using?
<sigrlami>
yojson
<dmbaturin>
What exactly you mean by list of all keys?
<dmbaturin>
Keys at the top level, or every key in every node?
<sigrlami>
Typical json is smth like {key: value, key:value} i don't have clear structure where I now key, they can be change all the time, so I can't access them by name
<ggole>
A schema?
<sigrlami>
I want to get list of keys first, it any part of json, maybe subnods
<flux>
meh, it _still_ appears it's not possible to find out which processes are connected to a certain unix domain socket :/
<sigrlami>
schema smth like {key1:["", ""], key2:{}, key3:"" ..} no clear structure, I need to derive values based on what it is string, array or object
<dmbaturin>
Well, in the simplest case, you match the JSON with `Assoc. `Assoc is list of string * json.
kcking has quit [Quit: kcking]
<MercurialAlchemi>
yeah, basically pattern-match your way to something you can work with
<dmbaturin>
flux: Yeah, I don't think there's a way to find out when they are already connected.
<flux>
I actually posted a patch to do it on the linux-net mailing list, but it was rejected due to a similar one already being in the pipeline, doesn't seem to guarantee anything :)
<sigrlami>
dmbaturin: thanks, this is very helpful
kcking has joined #ocaml
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
<freling>
If I don't write any .mli, I suppose the whole module is exposed. I have a record in a module A, and when I use it in a module B, I get a warning whenever I try to access a field
<freling>
"It is not visible in the current scope, and will not
<freling>
be selected if the type becomes unknown."
<freling>
The warning goes away if I open module A, but I'd like to understand what is going on
Txin has joined #ocaml
<ggole>
This is type directed disambiguation
Txin has quit [Client Quit]
Txin has joined #ocaml
<ggole>
The way record types were inferred was changed recently to ease the handling of record field names
<freling>
I get my record from a function, so its type is already defined, no?
TheCommieDuck has left #ocaml ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
<freling>
Can I disambiguate without opening module A?
<flux>
you can use foo.A.field
<ggole>
Essentially you will get the warning when only the type results in the field being known
<freling>
flux: Thanks
<ggole>
The alternative is what flux said
<ggole>
(Or turning the warning off.)
<freling>
Ok, so the warning is here to tell me the compiler found the correct type but that might not be the case everytime
Txin has quit [Remote host closed the connection]
<ggole>
The warning indicates that *only* the type allows the field to be known
<freling>
Oh ok
<ggole>
If you open the module, the field is in scope
<ggole>
Or if you qualify, you are referring to an explicit scope
<ggole>
If you rely on the type, the thing is not in scope - which is a warning
<freling>
Is this is a bad thing? To rely on the type?
<ggole>
Opinions vary
<ggole>
I personally think it's fine
slash^ has joined #ocaml
<freling>
Is there any documentation of the inference of record types?
<freling>
I'd like to read a bit about it
bytbox has joined #ocaml
_obad_ has quit [Remote host closed the connection]
<freling>
If the behavior changed with a specific release of ocaml for instance
<sigrlami>
dmbaturin: where can I read more about `Assoc ?
<ggole>
Hmm, there was a bunch of discussion as the feature went in... not sure what to point to about the final arrangement
Algebr has joined #ocaml
<freling>
It seems that all the record fields in a module live in the same namespace, regardless of the type
<Drup>
for example : type t = Foo ;; type t2 = Foo ;; type t3 = Foo of t ;; Foo Foo
<sigrlami>
dmbaturin: thanks
<freling>
And the warning is here to say that if you rely on the type, old compilers might not be able to resolve the field
<Drup>
and new compilers may or may not resolve it differently
<freling>
Drup: Ok, it feels a bit weird, but why not
<ggole>
Wait, how would they resolve it differently?
<freling>
Just to be clear, it's not duck typing, right? Not every record with a field 'foo' will be accepted.
<Drup>
(personally, I think the usefulness outweigh the potential fragility and I disable the warning)
<freling>
I like this behavior as well, I might disable it
<ggole>
freling: no, you need to use objects for that
<Drup>
it's not duck typing, it will always pick a safe choice (but sometimes it will not be able to pick any)
<Drup>
(there is always exactly one type safe choice anyway)
<freling>
ggole: Ok, I have yet to use objects, I'll see that later
<freling>
Thanks for the explanation.
<Drup>
ggole: it might be resolve differently if the typechecker changes a bit and the way information are propagated change, which is the case in almost every release, in a very minor way
badkins has quit [Read error: Connection reset by peer]
<freling>
It seems that the feature appeared in 4.01
uris77 has joined #ocaml
<dmbaturin>
In ocaml, every new release brings some interesting language features it seems.
sdegutis has joined #ocaml
<ggole>
Constructor records in 4.03 <3
jao has joined #ocaml
ptc has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ptc is now known as Guest15233
<Drup>
inlining, inlining everywhere \o/
dario_ has joined #ocaml
<freling>
Drup: how do I know which warning to disable for the record field inference?
avsm has joined #ocaml
<dario_>
Drup: You're referring to the flambda stuff from Chambart et al, right? Is that really on track to be merged for 4.03?
<tokenrove>
freling: they're listed in the ocamlc manpage.
<freling>
tokenrove: Thanks
<tokenrove>
(and the compiler usually gives you the number when it prints the warning)
_obad_ has joined #ocaml
<tokenrove>
related to this, is there a way to set warning flags only for a specific target in an oasis file? it seems that setting ByteOpt on one target causes it to be used by all of them, at least in my case.
<Algebr>
does method! mean this is overriding a method?
<ggole>
It silences a warning about overriding, iirc
<ggole>
(The idea being that you use method! when you want that, and observe the warning when you do not.)
<sdegutis>
Is OCaml 4.03 out?
<dario_>
sdegutis: No, it's not even in beta yet.
<sdegutis>
is there an ETA?
<dario_>
I don't know. However, for the past few years there's been a summer(ish) release every year
<freling>
I can't find in the ocamlbuild doc how to disable warnings
<freling>
Can't I just use _tags for that?
<ggole>
Pass the right stuff to -cflags
<sdegutis>
ggole: how did you find out about 4.03 feature?
<ggole>
sdegutis: it's been discussed here and there. I also tried out the branch.
<Drup>
freling: the tags is "w(..)" iirc
<ggole>
opam switch makes it very easy.
<Algebr>
Drup: high level, what does resources mean to Lterm?
<Drup>
sdegutis: as already said, very probably this summer
<Drup>
(end of summer)
<Drup>
Algebr: I always found this part of lterm weird
<Drup>
Algebr: basically, thing .Xressources
<Drup>
but for lambda-term applications
<Drup>
think
<freling>
Drup: it doesn't work, not sure how to pass the option to -cflags neither
<Algebr>
I see. Another question, is there an easy way to colorize something like LTerm_widget.label "this should be blue colored"
<Drup>
defined a colored label widget :p
<Drup>
It's very easy, look at the code of label
<Algebr>
k
<freling>
got it, ocamlbuild -cflags "-w -40"
<Drup>
freling: the tag is "warn(...)"
<Algebr>
Drup: oh jeez, it looks pretty straightforward.
<Drup>
yep
zpe has quit [Remote host closed the connection]
<Drup>
don't hesitate to define new widgets, or inherit widgets
<Algebr>
I can't tell if ocaml objects are clunky or are just really explicit in forcing to recognize potential OO issues.
<Drup>
?
<Algebr>
Like casting looks weird.
<freling>
Drup: ah, thanks, I was getting lost, the documentation doesn't help much
<Drup>
Algebr: explicit casting is a feature. :p
<Algebr>
Drup: ha. Last bother with lterm, I want to manually control the sizing of widgets, I thought that allocation would do the trick since it takes a geometry record , but frame#set_allocation (some geometry record) didn't change the sizing. Is there like some force repainting needed?
<Drup>
huum, that's not how you should do it
rand000 has joined #ocaml
octachron has quit [Quit: Leaving]
<Drup>
inherit the class and overwrite "allocation"
<Drup>
hum, no, not allocation, size_request
<Drup>
I think it's the right one
badkins has joined #ocaml
<Algebr>
i see, so no changing sizes at run time i guess.
<Drup>
just add a method to change some internal state and make size_request look that state up :p
<Drup>
and do a queue_draw, of course, to redraw everything
<Algebr>
Awesome, thank you!!
<Drup>
Algebr: to be more precise
dario_ has quit [Remote host closed the connection]
<Drup>
size_request is the method called by the parent to decide how much the widget want
<Drup>
allocation is the size given by the parent
<Drup>
I never used set_allocation myself, I don't think you should
tianon has quit [Quit: ugh Docker memory usage again]
kcking has quit [Quit: kcking]
sigrlami has quit [Quit: Page closed]
swgillespie has joined #ocaml
kcking has joined #ocaml
jwatzman|work has joined #ocaml
aubergines has quit [Remote host closed the connection]
swgillespie has quit [Client Quit]
tianon has joined #ocaml
Guest15233 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
olauzon has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
Haudegen has joined #ocaml
dsheets has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 240 seconds]
kcking has quit [Quit: kcking]
ghostpl_ has quit [Remote host closed the connection]
sdegutis has left #ocaml ["Leaving..."]
Algebr has quit [Ping timeout: 245 seconds]
q66 has joined #ocaml
moei has quit [Quit: Leaving...]
TheCommieDuck has joined #ocaml
<TheCommieDuck>
Hey. Is there some kind of conditional I can use with pattern matching? I've got http://pastebin.com/QgcZPz5x but the whole match x with foo -> true, _ -> false seems iffy.
<TheCommieDuck>
or rather, conditional with variant types
<_obad_>
TheCommieDuck: match x with foo when blah -> 33 | baz -> 55
moei has joined #ocaml
<TheCommieDuck>
_obad_: so..I could have some kind of | "Set" when (varType = Any | varType = Set) -> ?
antegallya has joined #ocaml
ptc has joined #ocaml
<_obad_>
actually if you're using variants, you can also use #typename as a pattern
<_obad_>
type fruit = `Apple | `Orange; type grain = `Wheat | `Soy;
ptc is now known as Guest44342
<_obad_>
then match food with #fruit -> something | #grain -> something_else
<_obad_>
I don't know if that's what you're asking for. the "when" construct is a separate thing called a guard clause
<TheCommieDuck>
I just felt that the match x -> match y -> true, false seemed like I was missing a different construct; I think a guard is what I'm after
Thooms has quit [Quit: WeeChat 1.0.1]
<TheCommieDuck>
thanks :)
<smondet>
TheCommieDuck: guar are fine, you can also match on the tuple (ty, varType)
<smondet>
*guards
<_obad_>
smondet: right, I just looked at the pastebin and it would be more appropriate in this case
<TheCommieDuck>
matching on tuple I forgot about; I imagine that'd be much cleaner
<_obad_>
here's a montreal job offer where ocaml would be appreciated: http://bit.ly/1D41klM
destrius_ has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
<Drup>
"Comme ingénieur senior de Linux embarqué, vous nous aiderez à envoyer Linux au-delà de l'atmosphère terrestre et possiblement sur les surfaces d'autres mondes. " Oh my.
<Drup>
:space:
destrius has joined #ocaml
<_obad_>
et aussi ocaml
<Drup>
that reminds me of one of the track in icfp's workshops
<dmbaturin>
I only speak ocaml, could you translate?
<Drup>
"Functional programming in space"
<_obad_>
drup: was it ocaml or the other language that shall not be named?
<Drup>
it was general FP, in practice, not OCaml
<_obad_>
I see, they give their examples in generic ML though
<_obad_>
dmbaturin: you mean the ad was in french? sorry, you can click in the english tab. direct link: http://bit.ly/18g9nEr
ontologiae has quit [Ping timeout: 265 seconds]
<dmbaturin>
_obad_: No, I was talking about Drup's quote. The link doesn't work.
<dmbaturin>
>Oops!, An accessibility problem has been detected.
<Drup>
"As a senior embedded Linux engineer, you will help take Linux beyond the earth's atmosphere and possibly to the surface of other worlds."
<ggole>
I've never done safety critical stuff, but wouldn't OCaml be poorly suited for that?
<_obad_>
ggole: it's not realtime. we use FPGA logic for hard real-time stuff.
<dmbaturin>
ggole: A lot of safety critical stuff is done in C++.
<ggole>
I was thinking of eg applying = to the wrong thing
<def`>
makes sense :). Sounds cool, sadly I'm not canadian
<_obad_>
safety critical in c++? *gouges eyes out*
<Drup>
ggole: well, you can do like jst
<dmbaturin>
C is also popular, with varying degrees of compliance with MISRA or similar guidelines.
<Drup>
overwrite Pervasive and remove the unwanted functions, like =
<dmbaturin>
(By the way, MISRA 2012 is very good and if everyone who writes C followed it, the world would be a better place)
<ggole>
Well, = is a bit indispensable
<_obad_>
drup: what's the deal with = anyway?
<Drup>
_obad_: it's slow
<Drup>
ggole: not really, with ppx_deriving in particular
<ggole>
It falls over on functions
<_obad_>
it's *undecidable* over functions
<Drup>
well, that's another question entirely
<def`>
for some notion of functions and equality
<dmbaturin>
Are there static analyzers that catch using = on wrong things?
<Drup>
it could use ==
<ggole>
Yes, but = doesn't decide that until runtime
<Drup>
but it doesn not
<def`>
physical equality for codepointers would suit me well... bettee than some exceptions
<_obad_>
for functions use ==
<smondet>
I used to `` let (=) x y = `dont_use_poly_equal `` it is far from impossible
<dmbaturin>
If something can catch using = on floats, that would be nice too. :)
<ggole>
It's still present in things like List.assoc
<_obad_>
if the call is not polymorphic then the compiler does the right thing, doesn't it? e.g. if x : float and y : float then it's the float eq that's called?
<Drup>
yes
<Drup>
it would be better with implicits anyway
<def`>
+1 :)
<Drup>
(there is the issue with React.S too)
<Drup>
(you must be very careful when you are doing signal of functional values)
<Drup>
(like, for example .. signals)
<dmbaturin>
_obad_: For realtime stuff there's Ada 95/2005/2012. 2012 has a provable subset and the prover included.
<Drup>
_obad_: btw, OCaml is barely mentioned, what it is used for ?
<TheCommieDuck>
woah, it compiled
<_obad_>
drup: earth observation satellite and ground segment/science data processing
<_obad_>
it's basically to reduce my bus factor
<Drup>
reducing bus factor is always a good thing
MrScout has joined #ocaml
<dmbaturin>
Isn't it _increasing_ bus factor? Or you mean 1/busfactor? :)
<_obad_>
dmbaturin: that's what I was wondering
octachron has joined #ocaml
<Drup>
well, no, the bus factor is how much the bus as an impact on your software
<_obad_>
"In software development, the bus factor is the number of key developers who would need to be incapacitated to make a project unable to proceed."
<dmbaturin>
_obad_: Well, I think of bus factor as a number of people who can be hit by a bus and the project still can continue.
<Drup>
hum.
<_obad_>
dmbaturin: re ada. etc, yes but we're using embedded linux. using ada instead of ocaml in that environment wouldn't make much of a difference imho.
shinnya has joined #ocaml
kcking has joined #ocaml
<dmbaturin>
_obad_: Hhm, difference of what kind?
<_obad_>
it's not a nuclear reactor or fighter jet controller
<_obad_>
well if a process crashes or misbehaves we restart the thing
<_obad_>
and there are many many more places in linux where you could have a crash or malfunction
<ggole>
Mmm, guess so
<dmbaturin>
Well, I'm not saying one should use one instead of another. I was saying for realtime (or interfacing with hardware) Ada is a nicer alternative to C and C++.
<_obad_>
dmbaturin: I agree, although I am not very familiar with ada.
<_obad_>
we use vhdl for the real-time stuff.
<dmbaturin>
There's module system almost as good as that of ML.
<_obad_>
I mean, you can't get more real-time than talking to a LPDDR chip.
<_obad_>
no functors I think?
<dmbaturin>
No functors, but there are generic modules that can be instantiated with a type.
<dmbaturin>
They also can be instantiated with functions.
uris77 has quit [Quit: leaving]
MrScout has quit [Remote host closed the connection]
nullcat has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<dmbaturin>
I wouldn't use it where I can use ML though, but it's analogous to that I would rather use ML than say C# where both are technically suitable for the task. :)
<Drup>
the absence of sum types would personally kill me
<dmbaturin>
Drup: I'm not sure how I used to live without sum types anymore.
<dmbaturin>
Now I miss them in every language that doesn't have them.
<Drup>
Now I refuse to do serious stuff in language that don't have them :D
<_obad_>
I have a question about type_conv and sexplib. how is that thing evolving with the ppx business?
<Drup>
jst said they were going to move to ppx at some point, but no ETA afaik
<dmbaturin>
Which is why I was looking into ocaml.org implementation—I'm going to reuse it.
<Drup>
how do you think lambda are done in last java ? :]
<dmbaturin>
Wait, seriously?
<Drup>
:]
<struk|work>
Drup: if you saw what my functional style code looks like in java you'd probably gouge out your eyeballs with the nearest blunt object
<Drup>
struk|work: you assume I didn't wrote the same
<dmbaturin>
I've been looking into functional JVM languages lately. They all feel, uhm, strange. Except Frege.
<struk|work>
dmbaturin: cool, didn't know someone wrote haskell ontop of the jvm.
octachron has quit [Quit: Leaving]
nullcat has quit [Read error: Connection reset by peer]
Thooms has joined #ocaml
<dmbaturin>
Actually, I've been looking into options for writing cross-platform GUI stuff. This is how I ended up installing lablgtk on windows.
manud has joined #ocaml
<struk|work>
dmbaturin: functional languages and cross platform guis? pick one
emias has quit [Quit: Bye]
emias has joined #ocaml
<dmbaturin>
struk|work: Well, I could get lablgtk to work.
matason has quit [Ping timeout: 250 seconds]
Guest53844 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
slash^ has quit [Read error: Connection reset by peer]
The_Mad_Pirate has joined #ocaml
paolooo has quit [Ping timeout: 246 seconds]
<struk|work>
dmbaturin: I'm still going to try out lablqt once I get a chance (familiar with qt already not so muc hgtk)
kcking has quit [Quit: kcking]
avsm has joined #ocaml
<TheCommieDuck>
One more question: I'm getting a syntax error on the final bracket of the set module..what have I messed up? http://pastebin.com/WDzMy5Mf
<struk|work>
TheCommieDuck: I'd help but pastebin is blocked at work. if you use https://gist.github.com/ I can view it
<struk|work>
TheCommieDuck: your missing an "end" for the struct definition, no?
<TheCommieDuck>
that'd be it, thanks :)
<TheCommieDuck>
the fact it doesn't work is another matter I'll go fix, heh
ptc has joined #ocaml
ptc is now known as Guest9344
captain_furious has quit [Quit: Leaving.]
Thooms has quit [Read error: No route to host]
manizzle has joined #ocaml
Thooms has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
ontologiae has joined #ocaml
paolooo has joined #ocaml
The_Mad_Pirate has quit [Quit: Konversation terminated!]
The_Mad_Pirate has joined #ocaml
paolooo has quit [Ping timeout: 246 seconds]
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 245 seconds]
manud has quit [Quit: manud]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
<dmbaturin>
Is there a way to have ounit execute next tests if a test fails?
Haudegen has quit [Ping timeout: 246 seconds]
Nahra has joined #ocaml
Anarchos has joined #ocaml
<tokenrove>
dmbaturin: have you tried yeti? i thought it was pretty nice, as alternate jvm languages go.
<dmbaturin>
tokenrove: Yeti the ML-like language for JVM?
<tokenrove>
indeed
lyxia has quit [Ping timeout: 250 seconds]
<dmbaturin>
I think I looked into its docs some time ago but found the syntax not so appealing. I don't remember what exactly I didn't like though.
<dmbaturin>
tokenrove: Are there swing bindings?
madroach has quit [Quit: reboot for testing patched vr(4) without HW tagging.]
<tokenrove>
there are, although you don't really need bindings for a lot of things; i have not tried doing swing with it yet.
Algebr has joined #ocaml
<tokenrove>
"bindings" might be a bit misleading. it's very easy to interface with java stuff with it, so you don't need an FFI-like binding.
<dmbaturin>
Also, I need some sleep. My ounit problem was that I forgot to add a case to the testsuit after writing it.
Haudegen has joined #ocaml
<dmbaturin>
tokenrove: Well, "wrappers" could be a better word.
manud has joined #ocaml
reem has joined #ocaml
<Anarchos>
if i have a struct of the shape «struct type a = blabla ;; let compare = blibli end», is it possible to transform it into an entry structure for Set.Make(), say renaming the type a into "type t" ?
<_obad_>
anarchos: Set.Make(struct type t = Mymodule.a let compare Mymodule.compare end)
hilquias` has quit [Remote host closed the connection]
<Anarchos>
_obad_ ok i knew about this one. But why can't i use a "with type t = a" somewhere ?
<Simn>
Is there a way to allow == and != only for specific types?
madroach has joined #ocaml
<Anarchos>
Simn let f (a ; typ) (b:typ) = a==b
<Anarchos>
or (==) : t->t->bool
<dmbaturin>
Anarchos: Well, it will restrict it to a single type.
<Simn>
But I can only define that for one type, right?
hannes has quit [Read error: Connection reset by peer]
hannes has joined #ocaml
<dmbaturin>
Which can be fixed by fallback to dynamic typing, but I doubt it's what Simn wants. :)
<Simn>
What I actually want is to find all places where == is used on a specific type in our codebase.
<Simn>
Because it used to be fine to use physical equality but now it's not anymore. :)
<Anarchos>
Simn i would just compile a version of Pervasives without (==) , and then look what doesn't compile anymore in my code base.
<Simn>
I see, thank you.
Haudegen has quit [Ping timeout: 264 seconds]
<smondet>
Simn: let (==) (x: int) y = x == y → then any non-int use will be an error
<_obad_>
simn: maybe you can use -annot and then grep the .annot file for Pervasives.( == ) and the surrounding types?
<Simn>
Ah, that sounds like a good idea. Thank you all!
<Drup>
Simn: why was it fine and not anymore ?
<Anarchos>
_obad_ i never used -annot ! i must give it a try !
moei has joined #ocaml
MrScout has joined #ocaml
<_obad_>
anarchos: it's also used by editor ocaml modes to display type annotations; very useful
<Simn>
Drup, we added a marshalling-like operation which loses the identity.
<Drup>
right
<Drup>
and why did you used == to begin with ?
<dmbaturin>
_obad_: Is merlin using it too, or it uses a different approach?
<Drup>
merlin is not using .annot
<Drup>
and anyway, .annot are not much used anymore, .cmt are prefered
<dmbaturin>
.cmt?
<Drup>
the -bin-annot option
Haudegen has joined #ocaml
<Simn>
Drup, well, because it worked I suppose. :)
Guest9344 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Drup>
Simn: sure, but why == compared to = ?
<_obad_>
dmbaturin: I'm not using merlin, I don't know
<Drup>
I mean, it's almost always the wrong choice
<Simn>
Drup, I remember having some problems with recursive values and =.
hilquias has joined #ocaml
<dmbaturin>
Drup: What are .cmt files supposed to be viewed with?
badon has quit [Ping timeout: 250 seconds]
<Drup>
hum, compiler-libs ? :D
<dmbaturin>
Where do I read about it?
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
<Anarchos>
dmbaturin the ocaml manual i think.
<dmbaturin>
_obad_: Merlin is pretty cool, it can display types of expressions under the cursor, detect tail positions etc.
<Drup>
and it works with partially correct files
myyst is now known as myst
ptc has joined #ocaml
<_obad_>
dmbaturin: I gave it a try last year and it wasn't working with sexplib etc. so I dropped it. maybe it works now.
<_obad_>
the syntax extensions I mean
ptc is now known as Guest49524
<Drup>
I think they added a special case for sexplib
<Drup>
(one more reason to switch to ppx !)
<smondet>
_obad_: yes simple syntaxes like sexplib should work with Merlin
<_obad_>
dmbaturin: I would tend to go with the simpler solution first.
<manud>
Drup: thanks !
<dmbaturin>
_obad_: Like pass string_of_data function to the pretty printer etc.?
<Drup>
dmbaturin: you need functor when you want to parametrize over functions
<Drup>
well, values
<Drup>
if it's only over types, just do polymorphism
<_obad_>
dmbaturin: depends how many of those you have. if you have more than 2-3 then indeed a functor may be more economical
<dmbaturin>
I would explain why I expect it to be exactly 2, but it's quite a long story. :)
bytbox has quit [Ping timeout: 255 seconds]
<dmbaturin>
In a nutshell, the first tree represents configuration of an appliance, and the second tree describes the constraints on nodes and their data.
<dmbaturin>
As in "the value of node system->name_server must be an IPv4 or IPv6 address".
<pippijn>
Last but not the least, using camlp4 prevents OCaml compiler from printing useful suggestions in error messages like File "ifdef.ml", line 17: This '(' might be unmatched. Personally, I find that very annoying.
<pippijn>
well
<pippijn>
ocaml 3.12 just said "syntax error"
<pippijn>
camlp4 had *vastly* better syntax error messages than ocamlc
<_obad_>
I'm opening a process with Lwt_process.pread ; after I get an EOF (0-length read) do I have to close the channel to wait for the process?
<Drup>
pippijn: just use merlin :D
rand000 has quit [Quit: leaving]
<whitequark>
pippijn: now try it on 4.02
<pippijn>
"operator expected"
<smondet>
_obad_: I think you need indeed to call the `process#close`
<pippijn>
I don't know what code you used to get that error message
<whitequark>
hm
<_obad_>
smondet: you're right, I think I'll use the process_in class anyway, I need a channel
<pippijn>
anyway
<pippijn>
I think this article is unfair to camlp4
<pippijn>
it had good diagnostics when ocamlc didn't, and ocamlc only very recently got sort-of useful syntax errors
MrScout has quit [Remote host closed the connection]
<whitequark>
that doesn't really absolve it of every other problem (and the diagnostic that I mentioned was indeed quite annoying)
<pippijn>
*shrug*
<pippijn>
camlp4 is/was an awesome piece of software
<whitequark>
uh, no
<whitequark>
camlp4 is a disaster
<whitequark>
at the very least, it's not composable and its interface is completely undocumented and incredibly arcane
<whitequark>
syntax extensions written with it are not composable, rather
Algebr has quit [Ping timeout: 250 seconds]
<pippijn>
I'm not going to argue
<pippijn>
good night
TheCommieDuck has left #ocaml ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
Riviera_ has left #ocaml [#ocaml]
lnr has joined #ocaml
kcking has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
psy_ has quit [Ping timeout: 256 seconds]
zpe has quit [Remote host closed the connection]
Guest49524 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kcking has quit [Quit: kcking]
lnr has left #ocaml [#ocaml]
The_Mad_Pirate has quit [Ping timeout: 255 seconds]