Proteus has quit [Read error: 104 (Connection reset by peer)]
Proteus_ has joined #ocaml
seafood has quit [Read error: 60 (Operation timed out)]
marmotine has joined #ocaml
seafood has joined #ocaml
redocdam has quit [Remote closed the connection]
seafood has quit []
seafood has joined #ocaml
seafood has quit [Client Quit]
seafood has joined #ocaml
RobertFischer has quit []
rogo has quit [Remote closed the connection]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
mxc has joined #ocaml
<mxc>
who *janest*
<mxc>
oops
jeddhaberstro has quit []
thelema has joined #ocaml
jeffwheeler has joined #ocaml
jeffwheeler has left #ocaml []
Proteus_ has quit [Read error: 104 (Connection reset by peer)]
Proteus__ has joined #ocaml
bluestorm has quit [Remote closed the connection]
Associat0r has quit []
rogo has joined #ocaml
shortc|desk has joined #ocaml
mikezackles has quit [Connection timed out]
fremo_ has joined #ocaml
vixey has quit [Read error: 54 (Connection reset by peer)]
vixey has joined #ocaml
rstites has left #ocaml []
haelix_ has quit [Read error: 104 (Connection reset by peer)]
haelix has joined #ocaml
fremo has quit [Read error: 111 (Connection refused)]
haelix_ has joined #ocaml
haelix has quit [Read error: 104 (Connection reset by peer)]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
sbok has quit [Read error: 60 (Operation timed out)]
sbok has joined #ocaml
haelix_ has quit [Read error: 104 (Connection reset by peer)]
haelix has joined #ocaml
haelix has quit [Read error: 104 (Connection reset by peer)]
haelix has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
marmotine has quit ["mv marmotine Laurie"]
gaja has joined #ocaml
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Client Quit]
det has quit [Remote closed the connection]
ygrek has joined #ocaml
vixey has quit []
ygrek has quit [Remote closed the connection]
mishok13 has joined #ocaml
filp has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
asmanur has joined #ocaml
Yoric[DT] has joined #ocaml
ygrek has joined #ocaml
GustNG has joined #ocaml
Linktim has joined #ocaml
Proteus__ has quit [Read error: 104 (Connection reset by peer)]
Proteus_ has joined #ocaml
pango_ has quit [Remote closed the connection]
ygrek has quit [Remote closed the connection]
pango_ has joined #ocaml
guillem has joined #ocaml
rwmjones has joined #ocaml
det has joined #ocaml
Jedai has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
asmanur has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
Associat0r has joined #ocaml
vixey has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
netx has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
Associat0r has quit []
seafood has joined #ocaml
seafood has quit [Connection reset by peer]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
<vixey>
I want to be employed to hack ocaml
Linktim has joined #ocaml
bluestorm has joined #ocaml
Linktim_ has quit [Connection timed out]
Linktim_ has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 54 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Client Quit]
<Smerdyakov>
vixey, best option is Jane Street, IMO.
filp has quit [Read error: 110 (Connection timed out)]
<vixey>
I would love that
<vixey>
Wouldn't I have to move location though?
<Smerdyakov>
What's your current location?
<vixey>
scotland
<vixey>
I don't think there's any jane st. here
<Smerdyakov>
Correct. Closest is London.
<Smerdyakov>
But at least there would be no citizenship problems for you to work there.
<vixey>
yeah I guess so
<Smerdyakov>
Jane Street can generally only get PhDs from outside the USA to work at the New York office, I think. I'm not sure what the UK situation is.
<vixey>
oh I don't have a PhD
RobertFischer has joined #ocaml
<Smerdyakov>
Right, but it's not a problem if you work in a country where you have full rights to work already.
<Smerdyakov>
BTW, you might also want to reconsider the idea that you want to be employed, instead of starting your own business.
Linktim has quit [Read error: 110 (Connection timed out)]
Linktim has joined #ocaml
filp has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
stshow has joined #ocaml
<jynxzero>
Does anyone know the requirements for Janest, do you need commercial O'Caml experience?
<jynxzero>
I've been using it for years in my hobby coding, but don't have anything CV worthy.
<rwmjones>
jynxzero, based in the UK? we (Red Hat) may have an intern position available, but it requires very specific ocaml skills
<jynxzero>
Yeh, I'm in Bristol.
<jynxzero>
I'd be interested in details if there are more, is it on the Redhat website?
<vixey>
rwmjones: What do you mean specific?
<rwmjones>
no I'm still writing a spec & getting it signed off up & down the hierarchy
<rwmjones>
the skills required will be in camlp4
<rwmjones>
but it's a research project for an intern or student
<Smerdyakov>
jynxzero, Jane St. hires awesome people who fit in with something that needs doing. There are no more specific requirements than that.
<jynxzero>
Ah, shame. I have fairly strong camlp4 skills but I guess it'd be hard to live like a student again, I've got too comfy.
<jynxzero>
Smerdyakov: Thanks, maybe I'll chuck a CV their way and see if I'm sufficiently awesome.
<Smerdyakov>
jynxzero, if you just think about it, it would be absurd to require "commercial OCaml experience." Almost everyone in that category works at Jane Street.
<jynxzero>
I see a reasonably number of O'Caml jobs in other countries, but yeh... I didn't think it was likely they would, I was just checking really.
mikezackles has joined #ocaml
<Smerdyakov>
You might think you see a reasonable number, but the total number of OCaml hackers in the commercial world is at least half at Jane Street, I think. ;)
<jynxzero>
Ah, OK I didn't realise it was stacked quite that far towards them. :)
<Smerdyakov>
It's getting close to 30 people at Jane Street who write OCaml code regularly.
<vixey>
and this is all geared toward writing programs that trade ?
Linktim has quit [Read error: 113 (No route to host)]
<Smerdyakov>
It's a little more complicated than that, but that's a rough picture.
<Smerdyakov>
You can read the article about Jane St. in the latest Journal of Functional Programming for more information.
<vixey>
I don't think I could start a buisness
<vixey>
I've written software before that publishers were interested in but I don't think I could deal with that end myself, I have no idea what's involved
<Smerdyakov>
I'm pretty sure that you're thinking of the wrong model if you would choose the word "publisher" for anyone involved in your business plan.
<Smerdyakov>
"Wrong" meaning "bad idea for you to work that way."
<vixey>
oh well I was just referring to what happened in the past
<vixey>
I don't really have any idea about the future
<Smerdyakov>
Just be sure to read that essay.
<Smerdyakov>
Everyone studying anything technical should read it.
<jynxzero>
He doesn't want to start a business, so we can't criticise his business plan :)
<Smerdyakov>
jynxzero, I think we're disagreeing on valid uses of subjunctive language.
<Smerdyakov>
And most people are wrong when they say that they don't want to start companies.
thelema has joined #ocaml
<jynxzero>
lol, I see :)
<RobertFischer>
Smerdyakov: They amount "I think this will..." and "They should be able tos..." in that essay really undermine the points he's trying to make. If you look at what he's really saying, he's saying that in the way *he* thinks reality should work, hiring should be obsolete.
<RobertFischer>
Which I'm more than willing to grant. :)
<Smerdyakov>
You think that isn't the way things really work today for smart people?
* Smerdyakov
leaves.
Linktim has joined #ocaml
<vixey>
"Grad school makes a good launch pad for startups, because you're collected together with a lot of smart people"
<vixey>
no not really
<RobertFischer>
And I think he'd undermining the importance of business sense, probably because it comes naturally to him.
<vixey>
I think there's 1% smart people
<vixey>
the rest just want to get an A on the final exam
<Yoric[DT]>
The ones I know just want a C on the final exam...
<bluestorm>
yeah, getting an A when a C is enough to pass is not that smart :-'
Linktim_ has quit [Read error: 110 (Connection timed out)]
<RobertFischer>
bluestorm: That was my undergraduate theory, and I paid for it when I went back to grad school. :P
Linktim_ has joined #ocaml
marmotine has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
bluestorm has quit [Remote closed the connection]
Linktim_ has quit [Read error: 104 (Connection reset by peer)]
tomh- has joined #ocaml
jlouis has joined #ocaml
rstites has joined #ocaml
Tankado has joined #ocaml
guillem has quit [Read error: 104 (Connection reset by peer)]
mikezackles has quit [Connection timed out]
asmanur has quit [Remote closed the connection]
<Tankado>
Hello, i am tring to do my first work in ml so please bare with me, can anyone have alook at this and tell me what is wrong : http://rafb.net/p/BjmeFd96.html
mikezackles has joined #ocaml
<rwmjones>
Tankado, that's actually ML, not ocaml ...
asmanur has joined #ocaml
<vixey>
SML
<Tankado>
I am not so familiar with the diffrences
<vixey>
Tankado: the problem is you have written replace_with_binary(f,g,tail)
<vixey>
now tail is a list of 'a n_tree
<vixey>
but the third parameter to replace_with_binary should be a single 'a n_tree
<vixey>
You'll probably want to use map here to do this
<Tankado>
ahh ok got the problem now
<Tankado>
thanks vixey
<Tankado>
vixey : would you mind if i pm you about something ?
<vixey>
if you like
pango_ has quit [Remote closed the connection]
<Tankado>
vixey : cant i solve it by adding another pattern match for (f,g,list)
asmanur has quit [Remote closed the connection]
<vixey>
no you could not do that because it would not typecheck
<vixey>
but you could define a new function which does the replace on a list of trees
<vixey>
which is similar to what you are suggesting, just with one difference
Associat0r has joined #ocaml
pango_ has joined #ocaml
Axioplase has quit ["brb"]
<Tankado>
what that syntac to use 2 recursive functions that use each other one after another? (i need to add an "and" something)
<Tankado>
so i wont get unbounded var
Axioplase has joined #ocaml
<jlouis>
Tankado, right. Check the manual for the BNF grammar and syntax.
<vixey>
one of the few languages which has a really good comprehensive manual
Linktim has joined #ocaml
<Tankado>
yeah seems like it, i will have a look
<Tankado>
i dunno why "and" doesnt work thought and i still get unbounded var it should be val rec name1=... and val rec name2=...
<Tankado>
i will try to put them both in a let structure
jeremiah has joined #ocaml
<Axioplase>
Tankado: val rec ?
<Tankado>
recursive?
<Axioplase>
let rec foo = ... and bar = ...
mishok13 has quit [Read error: 104 (Connection reset by peer)]
<Tankado>
i am using SML so i guess its diffrent then Ocaml
<vixey>
very
<Axioplase>
unless OCaml has changed a lot since I last used it, I don't remember that one uses val to declare anything like that
<vixey>
actually not that different :/
<Axioplase>
Oh. My knowledge of SML is limited to the Tiger Book and Compiling with Continuations (both by A.Appel). And I keep thinking "dude, I prefer OCaml's syntax" :D
<Axioplase>
(eventhough I don't like OCaml's syntax that much actually)
<vixey>
Axioplase: A great book!
<Axioplase>
Paradoxically, I think that C/C is a better compilation book than the Tiger
<Axioplase>
Though the formalism (both theoretical and "graphical", ie: fonts and symbols) isn't very reader friendly
Jedai has quit [Read error: 104 (Connection reset by peer)]
Tankado has quit ["Leaving"]
Jedai has joined #ocaml
ocram has joined #ocaml
lasts has joined #ocaml
lasts has quit [Remote closed the connection]
ocram has quit ["Ex-Chat"]
filp has quit ["Bye"]
<FoolOfSoul>
Tankado, SML perfomes better than Ocaml, the weakness of Ocaml is the OO-nature
landonf has quit []
<rwmjones>
heh, nonsense is alive & well I see
<jlouis>
FoolOfSoul, that is a moot argument since Standard ML usually refers to a specification and Ocaml refers both to a specific implementation and a "specification" at the same time
<jlouis>
Some of the SML implementations are quite miserable when it comes to evaluation speed
rwmjones has quit ["Leaving"]
filp has joined #ocaml
filp has quit [Client Quit]
rstites has quit ["using sirc version 2.211+KSIRC/1.3.12"]
<jeddhaberstro>
How would one implement List.filter without recursion?
<asmanur>
jeddhaberstro: with List.fold_left ?
<jeddhaberstro>
not with List.fold_right?
<flux>
jeddhaberstro, with a while-loop and mutation, but why bother..
<flux>
I suppose with List.reverse and List.fold_left; List.fold_right isn't tail recursive, is it?
<blue_prawn>
with a ref list initialised with ref [] as accumulator, and for i=0 to pred List.length li do let this = List.nth li i if predicate this then acc := this :: !acc done;
<flux>
that would be a horribly inefficient implementation, however
<flux>
but yes, in theory, that way
<jeddhaberstro>
Well, I'm reading some lecture slides from a college I found online, and they're purposely ignoring all non-functional features of Ocaml, and in the "activity" from the course, it says to implement filter without recursion optionally using fold_right, map and zip
<blue_prawn>
instead of List.nth, use a second ref list with the tail at each iteration
<flux>
jeddhaberstro, List.fold_right is a better fit for the problem
<jeddhaberstro>
so, I don't think using any mutable variable or loops is what the teacher wanted his students to do.
<flux>
stated that way
<jeddhaberstro>
But, I don't know how to use it well enough yet
<flux>
hmm..
<jeddhaberstro>
the best I could come up with was... let filter2 f xx = List.fold_right (fun x -> if f x then x) xx [];;
<jeddhaberstro>
but that doesn't compile either
<flux>
right
<blue_prawn>
it's stupid to say "without recursion" if it's allowed to use a fold function which does recursion
<flux>
why doesn't it?
<jeddhaberstro>
This expression has type unit but is here used with type 'a -> 'a
<flux>
blue_prawn, perhaps it does, perhaps it doesn't -)
<jeddhaberstro>
referring to the if statement
<flux>
:-) even
<flux>
jeddhaberstro, do you know why it says that?
<jeddhaberstro>
not really...
guillem has joined #ocaml
<flux>
first of all, List.fold_right's first argument is a function that accepts two arguments, not one
<jeddhaberstro>
i kinda do, but not enough to fix it
<flux>
second, if must return the same type in both of its branches
<jeddhaberstro>
yes, i knew i needed an else statement
<jeddhaberstro>
but I didn't know what to return in the else clause
<flux>
I suppose this is way too much help, but here it goes: instead of trying to return single elements in the function you pass to fold, return the whole resulting list
<flux>
if you don't know what List.fold_right does, look up the documentation and perhaps the implementation
<flux>
and perhaps play around with it
<jeddhaberstro>
hmm
<flux>
another perhaps too helpful hint: how do you produce a list that is a version of another list prepended with an element..
<Jedai>
blue_prawn: if you use a fold, you don't use explicit recursion ("explicit" being the key term here)
<jeddhaberstro>
new :: oldList
<Jedai>
In Haskell : filter p = foldr (\x xs -> if p x then x:xs else xs) []
<flux>
spoiler ;)
<Jedai>
flux: It's in Haskell though... ^^
<jeddhaberstro>
heh
<flux>
atleast there's one trivial difference
<flux>
(beyond syntax)
<Jedai>
jeddhaberstro: So your translation of that ?
<jeddhaberstro>
hang on, working on it :)
<Jedai>
flux: The arg order you mean ?
<blue_prawn>
let filter p li = List.fold_right (fun this acc -> if p this then this::acc else acc) li [] ;;
<jeddhaberstro>
i think I'm closer, but still not right
<jeddhaberstro>
let filter2 f xx = List.fold_right (fun f x -> match x with h::t -> if f h then x else t) xx [];;
<flux>
hmm..
<flux>
why do you think that doesn't work?
<flux>
oh, right, blue_prawn gave the whole solution already
<jeddhaberstro>
yeah , there it is :p
<jeddhaberstro>
thanks guys
<Jedai>
jeddhaberstro: You should really try to understand why your solution doesn't work though
<blue_prawn>
but maybe we should prefer a fold_left and reverse the result, because the manual says that fold_left is tail recursive while the right is not
<jeddhaberstro>
i am truing
<Jedai>
jeddhaberstro: understanding the folds is really important in my opinion
redocdam has joined #ocaml
<jeddhaberstro>
is the second argument in the function you need to pass to fold_right always have to be a list?
<jeddhaberstro>
hmm, no
<Jedai>
blue_prawn: You're right as far as OCaml is concerned (though I thing the fold_right solution should be a bit faster when it works), but in Haskell the foldr solution is much better..
<Jedai>
blue_prawn: It works on infinite list, won't stack overflow and can be fused away
<blue_prawn>
the fold_right version of the ExtLib is tail recursive
<jeddhaberstro>
i just don't understand why acc is actually accumulated
<blue_prawn>
this::acc pushes an element on acc
<Jedai>
jeddhaberstro: try to work on a small example, doing the reduction by hand
<jeddhaberstro>
kk
<Jedai>
blue_prawn: This is the wrong way to look at it
<blue_prawn>
Jedai: to look at what ?
<Jedai>
blue_prawn: acc doesn't change contrary to what would happen if you "pushed" an element on a list in an imperative language, it's just that the next call to the function will be done with a longer list
<blue_prawn>
Jedai: I was using the functional version of the word push, which means give a longer list to the next call :-)
<palomer>
how can I tell if a process is finished when I open something with open_process_full ?
psnively has joined #ocaml
<flux>
I _think_ by reading hteir output and finding out that it has EOFed
<flux>
however without too much trouble you can use your own meachism in place of open_process_full altogether, but it does require some unix programming knowledge
<palomer>
but... it also EOFs if there's no output left
<palomer>
no?
<flux>
yes, it might have just closed its output
<flux>
but it's unlikely to do that unless it has terminated
<flux>
but correct, it's not a 100% guarantee
<palomer>
so what does it do if there's nothing to output?
<palomer>
it blocks?
<flux>
yes
<palomer>
input_line will block?
<flux>
that's the problem with the in_channel etc interfaces, they block and non-blocking them can be a bit complex
<flux>
yes
<palomer>
maybe I'm using the wrong function
<flux>
until the process exits
<flux>
you could use another thread to do the blocking though
<flux>
what are you actually doing?
<palomer>
I wrote an ide
<palomer>
IDE
<palomer>
and now I want to compile and put the output in a new window
<flux>
I suppose you could do all the process manipulation in a sperate thread to avoid blocking the main user interface
<palomer>
there's also a do not block function in Unix
* palomer
goes to find the name
<flux>
or you could do all that manually, with fork, pipe/socket and dup2
<palomer>
val set_nonblock : file_descr -> unit
<flux>
I would expect the standard io routines not work well with channels that are in non-blocking mode
<palomer>
since I'm using lablgtk
<palomer>
I use Glib.timeout.add
<palomer>
and I just poll
<palomer>
let _ = set_nonblock (descr_of_out_channel some_out_channel) <--this would take my out_channel and make it non_blocking, right?
<palomer>
for input_line
<palomer>
and Unix.select is pretty useless for my purposes, right?
psnively has quit []
<flux>
I think if you use nonblocking, you must give in using Pervasives.* and ouy must use Unix.read/select/etc
<flux>
s/give in/give up/
<palomer>
yeah, doesn't work with input_line
<palomer>
why would I use select?
GustNG has quit [Read error: 104 (Connection reset by peer)]
* palomer
doesn't really get select
<flux>
well
<flux>
perhaps you would instead register it with glib
<flux>
because it provides the select for you
<flux>
so: it issues a callback when you are able to read from a file descriptor and retrieve atleast one byte from it (that is: you won't block)
psnively has joined #ocaml
<flux>
and when you _do_ read from it, you want to use Unix.read, not input_line
<flux>
because due to buffering issues it will not work properly.
<flux>
(it might even appear to work correctly, but it won't)
BipedMan_ has joined #ocaml
BipedMan_ has quit [Connection reset by peer]
<palomer>
Wait until some input/output operations become possible on some channels. The three list arguments are, respectively, a set of descriptors to check for reading (first argument), for writing (second argument), or for exceptional conditions (third argument). The fourth argument is the maximal timeout, in seconds; a negative fourth argument means no timeout (unbounded wait). The result is composed of three sets of descriptors: those
<palomer>
ready for reading (first component), ready for writing (second component), and over which an exceptional condition is pending (third component).
ygrek has quit [Remote closed the connection]
<flux>
what's unclear about that?
<palomer>
you said it reads a character
<palomer>
and issues a callback
<flux>
_atleast_
<flux>
so: more than nothing is readable
<palomer>
where's the callback?
Linktim has joined #ocaml
<flux>
wasn't Glib a callback library?
<flux>
it's been a lot since I've used it
<flux>
didn't une make calls to Glib and say "call this function when fd 42 is readable"
<flux>
Glib.Io.add_watch [`IN] (fun f -> ..) (Glib.Io.channel_of_descr foo) etc