ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml-lang.org
Tobu has joined #ocaml
Anarchos is now known as HaikuUser
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
ulfdoz_ is now known as ulfdoz
tufisi has quit [Ping timeout: 248 seconds]
avsm has quit [Quit: Leaving.]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
TDJACR has quit [Ping timeout: 276 seconds]
Yoric has quit [Ping timeout: 264 seconds]
TDJACR has joined #ocaml
bobzhang has joined #ocaml
tac has joined #ocaml
<tac> Ocaml quesiton. Can you define data Stream = Stream Int Stream in Ocaml?
<tac> I know it would be an empty type, obviously
<tac> but is it legal Ocaml code?
Progster has quit [Ping timeout: 264 seconds]
<_habnabit> That's Haskell, not ocaml
<tac> _habnabit: so... is it syntactically legal?
<tac> like I sai
<tac> d
<tac> I know it would be an empty type
<_habnabit> I don't know Haskell
<tac> I didn't ask a thing about Haskell
<tac> I asked about Ocaml
<_habnabit> But this is #ocaml
<_habnabit> Then no, it's not legal because data isn't a keyword and type names can't start with uppercase letters
<tac> oops
<tac> In that case, type stream = stream of int * stream... I believe....?
<tac> It's not a syntax question, though. It's a semantics question.
<tac> Must all algebraic data types have a constructor which isn't recursive?
<_habnabit> You asked if it was syntactically legal. Offhand I don't know. Try it?
<tac> -.-;;
<_habnabit> You probably have a toplevel handy; I don't
<tac> I don't have Ocaml installed
<tac> I'm writing an article about some of the differences, based on my rough knowledge of the language.
tac has quit [Quit: Page closed]
Yoric has joined #ocaml
Snark has joined #ocaml
sepp2k has joined #ocaml
answer_42 has joined #ocaml
Neros has quit [Ping timeout: 264 seconds]
HaikuUser has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
wormphlegm has quit [Read error: Connection reset by peer]
wormphlegm has joined #ocaml
Neros has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
everyonemines has joined #ocaml
hkBst has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
bobzhang has quit [Ping timeout: 248 seconds]
djcoin has joined #ocaml
ontologiae has joined #ocaml
GnomeStoleMyBike has joined #ocaml
<f[x]> > I'm writing an article about some of the differences, based on my rough knowledge of the language.
<f[x]> that's hilarious
<f[x]> I just adore such articels
<olasd> and now that he has wroten an article, he can be considered an expert
<olasd> :)
mcclurmc1 has joined #ocaml
<djcoin> which article ?
ftrvxmtrx has joined #ocaml
tufisi has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
beckerb has joined #ocaml
Kakadu has joined #ocaml
mathieui has joined #ocaml
Zerker has joined #ocaml
testcocoon has joined #ocaml
<Zerker> What would be the idiomatic way to generate a list of successive function application values?
<Zerker> I think the type would be int -> (a' -> a') -> a' -> list a'
<Zerker> And I'm trying to get (repeat 5 (fun (a, b) -> (b, a+b)) (0,1)) to be [(0,1);(1,1);(1,2);(2,3);(3,5)]
<Zerker> Unfortunately, stuff like:
<Zerker> let repeat n f x = if n==1 then f x else f (repeat (n - 1) f x) in List.rev (repeat ntimes function [initval])
<Zerker> Isn't tail-recursive and blows out the stack
<Zerker> Am I supposed to trampoline this, or is there an ocaml way?
<Zerker> Halp
<f[x]> use accumulator param
<Zerker> repeat n f l = repeat (n-1) f (f List.hd l)::l ?
<f[x]> compute step, add it to accumulator, call recursive next step with updated accumulator
<f[x]> reverse the accumulator in the end
<Zerker> Oh right, just bring the list inside. Thank you!
everyonemines has left #ocaml []
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 256 seconds]
Zerker has quit [Remote host closed the connection]
thomasga has joined #ocaml
Progster has joined #ocaml
cdidd has quit [Ping timeout: 246 seconds]
Cyanure has joined #ocaml
Cyanure has quit [Ping timeout: 246 seconds]
Cyanure has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
Progster has quit [Ping timeout: 246 seconds]
ontologiae has quit [Ping timeout: 245 seconds]
_andre has joined #ocaml
ontologiae has joined #ocaml
beckerb has quit [Read error: Connection reset by peer]
vincentbalat has quit [Ping timeout: 245 seconds]
ontologiae has quit [Read error: Operation timed out]
mcclurmc is now known as mcclurmc_away
beckerb has joined #ocaml
mcclurmc1 has quit [Ping timeout: 246 seconds]
chambart has joined #ocaml
cago has joined #ocaml
ontologiae has joined #ocaml
rixed_ is now known as rixed
mjonsson has quit [Remote host closed the connection]
<fasta> How can I select stderror and stdout of a command as two strings?
<fasta> Similar to Unix.open_process, but the second argument specifies the environment passed to the command. The result is a triple of channels connected respectively to the standard output, standard input, and standard error of the command.
<fasta> I am sorry, but this only looks like documentation.
<fasta> How am I supposed to know what subset of string array variables are valid environments?
<hcarty> fasta: It may be explained elsewhere in the Unix module documentation
<fasta> It was considered too useful to put in the API?
<fasta> Sorry, but Haskell has runInteractiveProcess and it's completely obvious how to use it from the documentation.
<hcarty> fasta: Unix.environment's documentation - "Return the process environment, as an array of strings with the format ``variable=value''."
hkBst has quit [Read error: Connection reset by peer]
<hcarty> fasta: You could submit a bug report with or without a patch to the bug tracker
<hcarty> fasta: I agree that it's unclear. I had the same question about open_process_full.
<fasta> hcarty: and also in this case, I don't care about the environment, but I do care about stderr and stdout.
<fasta> hcarty: the API doesn't seem to provide something for that case, because it simply enumerates some combinations.
<hcarty> fasta: My guess is that either passing an empty array or then result of Unix.environment ()
<hcarty> fasta: would work
<fasta> If it would just have had one function returning a triplet, there wouldn't be a problem.
<fasta> hcarty: yes, I know.
chambart has quit [Ping timeout: 260 seconds]
<fasta> hcarty: thanks for your useful replies.
<hcarty> fasta: If the function didn't take an environment argument then someone who did care about the environment would be out of luck
<hcarty> Lwt arguably provides a better API for handling external processes - http://ocsigen.org/lwt/api/Lwt_process
<hcarty> The documentation is fairly sparse though.
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
<fasta> hcarty: what do you use to edit OCaml code?
<fasta> hcarty: or did you build something yourself?
<hcarty> fasta: vim usually
<fasta> hcarty: and do you have stuff like completion working with 100% accuracy?
<hcarty> fasta: Sometimes another editor like Komodo Edit if I need to edit remove files
<hcarty> fasta: Sadly no
<hcarty> fasta: I haven't put much effort into being able to have completion like that, but it's something I would love to have.
<hcarty> The only place I have mostly-complete completion support is in the toplevel with utop.
<fasta> How do I create an empty array?
<fasta> I found Array.make 0 "omg"
<fasta> But that seems rather wordy.
<hcarty> fasta: [||]
<hcarty> [| a; b; c |] is the array literal syntax
<fasta> hcarty: do I have to read everything from stdout if I only care about stderr?
<hcarty> fasta: I don't remember. I don't think so, but it's been a while since I wrote code using this.
<thelema> fasta: depends on how much output to stdout; if small enough, it'll be buffered and no problem. if very large, not reading from it may block.
<thelema> may block the writer
<hcarty> thelema: That makes sense
<thelema> there's a constant somewhere that sets the size of this buffer
<fasta> So, I would have to use 'select'?
<fasta> Unix.select, that is.
<hcarty> fasta: The second version there should give something close to what you're looking for if you ignore the stdout return value
<hcarty> let _, stderr = syscall "my command" in ...
<fasta> hcarty: thanks
<fasta> And how can I grep for things?
<fasta> Or search in a string for a given regular expressions.
<thelema> fasta: the Str module or ocaml-re
<hcarty> fasta: Or the PCRE bindings
chambart has joined #ocaml
beckerb has quit [Quit: Konversation terminated!]
mcclurmc has joined #ocaml
<fasta> If I use a reference with some index in it in some loop, can multiple threads call that code without any problems?
hkBst has quit [Remote host closed the connection]
hkBst has joined #ocaml
<fasta> It seems that Str basically is as thread-unsafe as it can be.
<adrien> yes
smondet has joined #ocaml
answer_421 has joined #ocaml
answer_42 has quit [Ping timeout: 276 seconds]
mcclurmc has quit [Ping timeout: 264 seconds]
<fasta> There is no way out of all of the let foo in line noise, right?
<adrien> ocaml-pcre (possibly through mikmatch)
<adrien> "twt"
<adrien> the whitespace thing
<fasta> adrien: by 'yes', did you mean to answer my question or the thread-unsafe remark?
<adrien> yes
<adrien> as for references, if the variable is inside a function, it won't be shared but if it's a global variable, you'll have an issue
<orbitz> I generally haven't found let's to be much of a problem
<orbitz> if they don't depend on each othe ryou can use 'and'
<fasta> How does x a = x_imp 0 where x_imp = ... translate to Ocaml?
<fasta> That is, the basic hide the accumulator idiom.
<ansx> fasta: nothing in ocaml is thread-safe
<ansx> and if it happen to be, its by mistake
<fasta> Also, why don't you try to correct mistakes in the language?
<fasta> Like the whole interpretation language != compiled language mistake for example.
mcclurmc has joined #ocaml
<ansx> it would be way too hard :p
<ansx> btw I'm not an ocaml user, so I don't really know
Yoric has joined #ocaml
<hcarty> fasta: The toplevel has a few toplevel-specific directives. Beyond that, which differences are you asking about?
<fasta> hcarty: those are used for libraries.
<hcarty> fasta: Libraries, loading compiled code/reading source code, changing warning/error settings
<fasta> hcarty: it seems a rather important feature that it's easy to switch between interpretation and compilation mode.
<fasta> hcarty: can you see why this loops forever? http://paste.kde.org/574280/
brendan has quit [Ping timeout: 260 seconds]
cago has quit [Quit: Leaving.]
<fasta> Either I made a mistake or the documentation is wrong.
<hcarty> fasta: You need to add the length of the matched string the index of the first matched character
<fasta> hcarty: right, how silly of me.
<hcarty> s/the/string the/string to the/
<hcarty> ack... can't even type the correction properly...
hkBst has quit [Quit: Konversation terminated!]
<fasta> hcarty: there was another bug, but now it works.
<fasta> Can I run some ocamldebugger on my #!/usr/bin/ocaml file?
<fasta> Just to see whether it would then have been easier to find.
<thelema> no, camldebugger only works on compiled ocaml programs
avsm has joined #ocaml
<fasta> thelema: and nobody thinks that's inconvenient, but me?
<thelema> in fact, ocaml scripts have particularly poor error reporting; I can't get a backtrace
<thelema> fasta: I agree it's inconvenient. I'm not willing/able to do the work needed to fix it at the moment, so I deal.
<fasta> Or is compilation so fast, that I should just always compile?
<thelema> compilation is generally quite fast, just compile
ccasin has quit [Remote host closed the connection]
<thelema> if native code compilation is too slow for you, you can do bytecode compilation, which is noticeably faster for large programs
<adrien> s/programs/files/
cdidd has joined #ocaml
<adrien> it scales linearly with the number of files but not always linearly with the complexity of files :-)
<adrien> (but if it's too complex for ocaml to compile fast, it's probably too complex for a human to comprehend)
Kakadu has quit [Quit: Konversation terminated!]
ccasin has joined #ocaml
mcclurmc has quit [Ping timeout: 245 seconds]
jamii has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
tac[home] is now known as tac
Xizor has joined #ocaml
sirmy has joined #ocaml
mehdid_ has quit [Ping timeout: 246 seconds]
<sirmy> hi, i try to do a functor in this code http://pastebin.com/T8N2XnkS that get a Stack... but ocamlc give me this error
<sirmy> Error: Unbound module type Stack
ttm has joined #ocaml
The_third_man has quit [Ping timeout: 246 seconds]
<sirmy> how can i solve this problem? thanks
mehdid has joined #ocaml
<ontologiae> sirmy: Stack is a module from a library ?
avsm has quit [Ping timeout: 244 seconds]
<sirmy> ontologiae: yes, i try to get the standard Stack module of ocaml
<ontologiae> sirmy: in fact he's looking for a module type, but Stack is a module. Not sure, but certainly something like that
brendan has joined #ocaml
<thelema> sirmy: module PolishCalculator ( S : module type of Stack) = ...
<thelema> or `module type Stack = sig <values and types here> end`
<thelema> yes, it is showing you the type of the module Stack
<thelema> but this type isn't bound to the identifier Stack anywhere
<thelema> you could do `module type Stack = <that text>` to bind it to that name
<sirmy> ok, thanks
Kakadu has joined #ocaml
avsm has joined #ocaml
brendan has quit [Ping timeout: 244 seconds]
<sirmy> i do that, but now ocamlc give me this: File "Stack.mli", line 1, characters 11-15: Error: Syntax error
<thelema> actually, maybe one change...
<thelema> Line 5 has `-> 'a Stack.t`
<thelema> I would have `-> 'a t` to indicate the 't' in this signature
<thelema> an a .ml file, you declare module types to be equal to something
<thelema> hmm, n/m, I thought there was a syntax difference for module types
<thelema> there isn't... `module type Foo = sig ... end` is valid in both .ml and .mli
<thelema> and unfortunately has to be repeated in both if it's to be public
avsm has quit [Quit: Leaving.]
<sirmy> mmm so, the code written in the manual is not correct...
<thelema> it probably is
<thelema> it's just too specific for what you want
<thelema> you want a module type that any stack implementation would satisfy
<thelema> right?
<sirmy> yes
<thelema> so you don't want the specific signature of Stack, as it's got the Stack module name as part of its type...
<thelema> that said, it's odd that this is included. Maybe an oddity of ocamldoc
<sirmy> mmm ok i think i understand
<sirmy> thank you !
<thelema> also, it's generally bad practice to name files the same as the stdlib modules
<thelema> doing this can cause problems
<thelema> this compiles for me.
jamii has quit [Ping timeout: 246 seconds]
<sirmy> yes also for me
answer_421 has quit [Remote host closed the connection]
answer_421 has joined #ocaml
kmels has joined #ocaml
thomasga has quit [Quit: Leaving.]
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
GnomeStoleMyBike has quit [Ping timeout: 244 seconds]
fraggle_laptop has quit [Remote host closed the connection]
<wieczyk> It is hard to understand for me.
<wieczyk> How french can do Coq, Ocaml, good type theory
<wieczyk> and have weird opinion about education
<thelema> wieczyk: I imagine some people are able to learn on their own, and go on to great things
<wieczyk> Yes, but how it is related to punishing homeworks?
<thizanne> wieczyk: our president is definitely not a type-theory expert, if you were wondering
<wieczyk> hehe
thomasga has joined #ocaml
tac is now known as tac-tics-dead
tac-tics-dead is now known as tac-tics
<adrien> wieczyk: the homework ban is from the 60s
<adrien> it might not be bad if you consider other differences
<adrien> i.e. how many hours of courses per day
<wieczyk> I dont understand the idea of punishing homeworks. It is natural for me that to achieve something someone need to work.
<wieczyk> Or, if you get good education then you can help your children to learn it faster etc.
<wieczyk> "He doesn’t think it is fair that some kids get help from their parents at home"
<wieczyk> I do not understand this motivation.
<wieczyk> Working at home is better for me, you can organize your time by your self. Someone can do work after school, someone wants to take long rest.
<adrien> no, the actual motivation is that you quite often get pretty long days in France
<wieczyk> How long?
<adrien> also, the law has existed since the 60s but is pretty much never followed even though it is restated every few years
<adrien> wieczyk: too long for you to want to work again when you get home
<adrien> more than you work while getting paid
<wieczyk> In Poland sometime people are 8h at school.
<adrien> remove the "sometime" and you get france
<adrien> well, around 7 iirc but 8 possible
<wieczyk> Every day?
<adrien> and you obviously get the work for exams, presentations, ...
<adrien> I thionk I used to have 8 hours a day, and 5 days a week
<wieczyk> [I have checked - At high-school I was mostly 7-8h at school].
<adrien> that was after 12 I think
<adrien> before that, 4.5 days I think
<adrien> but I was in a school that made us do a bit more I guess, but not that much more
<wieczyk> in school*
<adrien> you get home at 6pm, you've had enough
sepp2k has quit [Ping timeout: 246 seconds]
sepp2k has joined #ocaml
<sirmy> anyway... the stack module of the std library doesn't work... i only do a Stack.create ();; and ocaml give me "Error: The files /usr/bin/ocaml and Stack.cmi make inconsistent assumptions over interface Stack"
<sirmy> i don't understand...
<sirmy> does anyone have some answer?
<adrien> that's the exact error message?
<sirmy> adrien: yes
<adrien> do you have a "stack.ml" file?
<sirmy> -.-
<sirmy> sorry, i have a stack.ml file in the working directory and it loads it anyway
<adrien> :-)
jamii has joined #ocaml
ImAlsoGreg has quit [Ping timeout: 252 seconds]
chambart has quit [Read error: Operation timed out]
<sirmy> adrien: thank you!
<adrien> you're welcome
sepp2k has quit [Ping timeout: 260 seconds]
sepp2k has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
ftrvxmtrx has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 256 seconds]
ImAlsoGreg has joined #ocaml
brendan has joined #ocaml
sirmy has quit [Ping timeout: 246 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
elixey has quit [Remote host closed the connection]
answer_421 has quit [Ping timeout: 276 seconds]
tlockney has quit [Excess Flood]
<wieczyk> What oes mean 'type +'a t' ?
<Kakadu> covariant
tlockney has joined #ocaml
answer_421 has joined #ocaml
ng__ has joined #ocaml
sepp2k1 has quit [Quit: Leaving.]
sepp2k has joined #ocaml
Snark has quit [Quit: Quitte]
GnomeStoleMyBike has joined #ocaml
<wmeyer> hi
hto has quit [Read error: Connection reset by peer]
<ng__> what's wrong?
<ng__> syntax error...
<thelema> http://pastebin.com/UugJGt2Yremove the ; on line 13
<thelema> and replace the ;; on L19 and 20 with ;
<wieczyk> I am trying to use Lwt, is anywhere a syntax sugar for Lwt.bind operator available?
<wieczyk> ah, something is in library
<wieczyk> Sorry.
<thelema> ;; ends a toplevel phrase, ; separates "statement"-expressions
<ng__> thanks, thelema :D... one more doubt...
<wmeyer> wieczyk: use lwt.syntax
hto has joined #ocaml
<ng__> line 26
<ng__> how to do it "rec(4,1)" in ocaml??
<wmeyer> ng__: rec is a keyword
<thelema> use a different identifier
<ng__> no, recu
<wmeyer> ng__: f 4 1
<ng__> sorry
<thelema> also, function application doesn't need ()
<ng__> recu(4,1)
<thelema> recu 4 1
<wieczyk> wmeyer: could you help me to pass correct arguments to ocamlbuild to enable lwt.syntax?
<wmeyer> wieczyk: <src/{mainFrame,connection,server,indigo}.ml>: syntax(camlp4o), package(lwt.syntax), package(lwt), package(lwt.unix)
<wmeyer>
<wmeyer> that should be enough
<wieczyk> Thanks
<wmeyer> apart from that you want native, and byte depend on lwt
<ng__> thanks thelema and wmeyer :D
<wieczyk> Yeah, they are very helpfull
<wieczyk> helpful*
Anarchos has joined #ocaml
<wmeyer> wieczyk: it seems like one haskell programmer in pub yesterday admitted that lazinness in haskell is no' good :) BTW: Greetings Steve, if you are with us here.
<wieczyk> Hehehe
<wmeyer> what we need is an inliner ....
<wieczyk> What I need is to finish my master thesis.
<wieczyk> Then I will focus more on Ocaml
<wieczyk> I have one crazy idea about popularizing this language...
<wieczyk> At work we are writing a server for LTE signaling (radio technology).. very big project
<wmeyer> wieczyk: make sure you work on an a fairly decent (svn) branch a small advise before you will do the job ;)
<wieczyk> splited into system components [subprojects]
<wieczyk> which communicates each other and with the world
<wieczyk> System components are splitted into services, no threads
<wieczyk> event-driven applications
<wieczyk> but.. those state machines are big.. and hard to maintain and understand.
<wieczyk> I think that better concept is to use ,,coroutines''
<wieczyk> where I can write easy to understand sequential code and then it will be run as sleep-able coroutine.
<wieczyk> And
<wieczyk> I think that
<wieczyk> If we could write a SIPserver
<wieczyk> in Ocaml Lwt
<wieczyk> then would could see how ocaml is good
<wmeyer> wieczyk: one OpenMPI researcher admitted he thinks that co-operative threading is a future, I wouldn't expect it.
<wieczyk> Why?
<arsatiki> wieczyk: where do you work?
<wieczyk> arsatiki: Nokia Siemens Networks
<arsatiki> ...
<arsatiki> we must get in touch :)
<wieczyk> You work at Poland, Wroclaw?
<arsatiki> Espoo, Säteri :)
<wieczyk> Far away ;]
<wieczyk> I am working on Cplane for LTE
<wmeyer> wieczyk: we had a chat in the kitchen about HPC and general stuff, I told him about concurrency we do in OCaml (quite carefuly to not make him turn away) after a stint about OpenMPI and other stuff like semaphores and Erlang.
<wieczyk> mhm
<wieczyk> wmeyer: and what they said?
<ng__> first programmed in C, why is not working in ocaml ? -.-
<wmeyer> normally I try to not mention about how superior FP is (at work), because people understand this, just the learning curve is often too steep to justify it's negligible existence in the industry and the gain they think is to justify learning it (and that's given fact that companies do also research). Fortunately I have some plugs; and he is on a really dark side. We both know what to do.
<wmeyer> wieczyk: I'm implying that you have to develop in sync with trunk, but on branch if you decide and want to push it forward. :-)
<wmeyer> wieczyk: just ask
<wieczyk> I am interested in trying to something in ocaml
<wieczyk> but give me two months of freedom, to finish my mt
<wmeyer> wieczyk: inliner is extremely important
<wieczyk> I understand.
<wmeyer> wieczyk: yeah, first make sure you are done with MT
<wieczyk> After two months
<wieczyk> we will start ocaml expansion.
<wieczyk> Conquer other tribes.
<wieczyk> And start to fight against the industry empire.
<wieczyk> [Yes, I am crazy]
thomasga has quit [Quit: Leaving.]
<wmeyer> wieczyk: I agree; it's fun but be careful industry needs bugs :-)
<wieczyk> hehe
<wieczyk> We will implement the BugMonad
<wieczyk> where some people could be hired.
<wieczyk> btw:
<wmeyer> I think it would be good to show the value first of FP, usually people are still resistant even when you show them, and on completey other hand, they are seeing how much better it is
<wmeyer> wieczyk: lol
<Anarchos> wmeyer i just need to see a better support of concurrency in ocaml
<wieczyk> What do you understand of better support of concurrency.
<wieczyk> wmeyer: I think we need to do some achievements for ocaml before trying to show how cool it is.
<Anarchos> wieczyk i want to interface ocaml with the BeOS API in C++, which is heavily multithreaded
<wieczyk> wmeyer: For industry it is very important to do tests, unit tests, modul tests, etc.
<Anarchos> wieczyk i want to avoid a master lock around the GC
<ng__> why is failing?
<wieczyk> Anarchos: Ocaml runtime is not parallelized, you can run Ocaml code in one thread.
<wmeyer> Anarchos: yes it would be welcome; but actually is not most important to me right now.
<wieczyk> Anarchos: But you can use multithreaded code via Lwt, see ,,jobs'' in manual.
<wieczyk> wmeyer: I saw the OUnit framework
<wieczyk> wmeyer: cool, but what we need also is a ,,mocking''
<Anarchos> wieczyk the better way would be to reintroduce the multithreaded GC from Damien Doligez as was in caml light
<wieczyk> wmeyer: It would be nice to have something like camlp4 but after typing. Then we could do nice feature with auto-mocking.
<wieczyk> Anarchos: Yeah, I am also fan of SMP
<wmeyer> wieczyk: as for the inliner look also at the inline-more branch by ocp. They have done some work on it. Once you are free. If you are unsure where to start just ask I might have some good link to a paper
<wieczyk> THanks
<wieczyk> wmeyer: Something similar for ocaml could be interesting for industry.
Yoric has quit [Ping timeout: 260 seconds]
_andre has quit [Quit: leaving]
<wieczyk> wmeyer: syntax extension for Lwt is nice
<wieczyk> wmeyer: dont need to think about bind operator
<wieczyk> wmeyer: What do you think about coroutines builtin into language?
<wieczyk> wmeyer: Because now as I understand the LWT is something similar to monad, so it need a lot of inlining etc.
<wmeyer> wieczyk: exactly! (camlp4 idea) look at this: https://sympa.inria.fr/sympa/arc/caml-list/2012-05/msg00184.html
<wmeyer> i refer often to it
<wmeyer> wieczyk: better have the inliner or monads inside the langugage
<wieczyk> instead of couroutines?
<wmeyer> wieczyk: yes, and the co-routines on top of that
<wieczyk> Maybe you have right, I have no idea.
<wieczyk> But I am worrying about overhead
<wieczyk> btw: what is a difference between Thread module and Lwt
<wieczyk> ?
<ng__> sorry again, but someone who understands c,can see what is failing?
<wmeyer> wieczyk: overhead with a good inliner is negligible; at all you would otherwise compile to the same code usually in a presence of GHC quality inliner
<wieczyk> ng__: could you give us code again?
<wieczyk> ng__: and tell how do you recognize it as failing?
<ng__> yes ... wait a moment please ;D
<wmeyer> wieczyk: inliner promotes good code and that's a biggest advantage
<wmeyer> wieczyk: ghc is really good at this (concat . map)
<wmeyer> wieczyk: it's cheap in ghc
<wieczyk> ng__: and how do you recognize it as failing (I dont have interprter in my head... yet)
<wieczyk> wmeyer: mhmh
<wmeyer> in OCaml usually we need to resort to hacks, and none of them are good code
<wmeyer> like
<wmeyer> BatList.concat_map
<wieczyk> Could you tell me one about one of thos ehacks?
<wieczyk> I do not know any.
<wmeyer> I wish i could use batteries like this instead List.(concat -| map)
<wmeyer> specialising function?
<wmeyer> instead of compising them?
<wieczyk> Tell me more.
<wieczyk> ng__: I see error
<ng__> should print 12 stars
<ng__> -.-
<wieczyk> ng__: in ocaml the 'if' binds .. correct english word? higher? more?
<wieczyk> but
<wieczyk> ah no
<wieczyk> sorry
<ng__> ok :D
<wieczyk> ng__: does it print antyhing?
<ng__> yes
<wieczyk> do the 'begin .. end' after each if
<ng__> in the 2 codes
<wieczyk> if n > 1 then
<ng__> but in c
<wieczyk> recu (n/2) (c) ;
<wmeyer> I mean in particular you want monadic code to be flying at 80% of the speed of imperative code. You want this List.map (fun y -> y + 2) (List.map (fun x -> 2 * x) lst) to be turn into List.map (fun x -> 2 * x + 2) lst
<ng__> print 12 starts
<wieczyk> I never remember how it is parsed. do here 'if n > 1 then begin ... end'
<ng__> and ocaml print 19 stars
<wmeyer> ng__: fflush stdout ?
<wmeyer> or rather flush(stdout)
uselpa has joined #ocaml
<wieczyk> ng__: also
<wieczyk> ng__: in C code desu prints one eol
<wieczyk> ng__: in Ocaml code you print eol in each iteration of second loop
<wieczyk> wmeyer: Yeah, I do understand this need of
<wieczyk> map f . map g ~ map (f.g)
<wieczyk> etc
<wieczyk> inlining blesses
<ng__> how I use the list??
<ng__> never did
<wieczyk> ng__: I think you should write some declarative code, not translating yuur imperative code into the imperative code in ocaml
<wmeyer> wieczyk: yes, and you want projects like Planck http://camlspotter.blogspot.co.uk/2011/05/planck-small-parser-combinator-library.html to shine
<wmeyer> rather look at the end of the article if you prefer to skip it
<wieczyk> Mhmhmh
<wmeyer> I think the time is up to start thinking about this
<wieczyk> Yeah
<wieczyk> we need to work on onliner.
<wieczyk> I think that camlp4 could be nice feature for industry also.
<ng__> I will see the lists...
<ng__> but never seen it...
<ng__> is a bit strange
<wieczyk> First, it is not like pseudo parametric-polymorphism [more builtin macros] template in C++, it is more hard to use, you cannot write fast syntax extension in each file. You need to prepare it and add for build system.
<wieczyk> Second, in projects people do some convension
<wieczyk> how we are writing state machines
<wieczyk> how we handle this
<wieczyk> etc
<wieczyk> Those convension could be telled as syntax extension
<wieczyk> I am telling crazy stuff? I hope no, it seems very pragmatic for me.
<wieczyk> Instead of telling people 'in this project we write this with this style and this conversion etc etc' we could just provide some helping syntax, where camlp4 translates more declarative code into desired convension in ocaml.
<wieczyk> I see thes usefull due to 'lwt' syntax extension, it seems better than do-notation in ocaml
Drakken has quit [Ping timeout: 252 seconds]
<wmeyer> wieczyk: you need to talk to Hongbo :-)
<wmeyer> looking at the Planck what is striking this:
<wmeyer> method core_type2_nonleftrec = (
<wmeyer> case "core_type2_nonleftrec_0" (perform
<wmeyer>
<wmeyer> ...
<wmeyer> because then you can inherit the whole Caml parser, and override one rule.
<wmeyer> and that's surely not using a destructive update or custom LALR parser
<wmeyer> parser generator in particular
<wieczyk> Advanced stuff.
<wmeyer> wieczyk: yep. I actually quite like objects from time to time
<wieczyk> btw: I told you that I am trying to convert one programmer in my work.
<wieczyk> ?
<wmeyer> in this particular case, they are extremely useful
<wmeyer> inhertiance is just nicer than records
<wmeyer> and first class modules are nice but then you don't have the dynamic dispatch
<wieczyk> wmeyer: The chosen one seems to be interested, I have send him Pierce's book 'types and programming languages'.
<wieczyk> wmeyer: We will see how it end.
<wmeyer> unless you pass a module - but that's now what you want
<wieczyk> mhmh
<wieczyk> But modules we see as one instance of something
<wieczyk> objects are nice because we have class/object concepts.
<wieczyk> many instances of some class.
<wmeyer> wieczyk: modules in most cases are superior to objects, that's for sure.
<wieczyk> I will see, I dont have big expreience in fp.
<wmeyer> wieczyk: it's just this few cases where there are convenient
<wmeyer> the biggest user
<wmeyer> :
<wieczyk> ?
<wmeyer> a lot of different functions, that are recursive and do the same thing
<wmeyer> (pretty print, parse)
<wmeyer> customer #2:
<wmeyer> a GUI library
<wmeyer> so clearly they are really nice! of course they need to be used properly
<wmeyer> no state involved
* wmeyer thinks nap is a good idea now
<wieczyk> nap?
<wmeyer> s/thinks/thinking/g.
<wmeyer> drzemka
<wieczyk> aah
<wieczyk> thanks ;]
<wieczyk> hehe
<wieczyk> Do you study in Poalnd? No..
<wieczyk> But I forgot where.
<wmeyer> I studied yes, in Gdańsk
<wieczyk> PG, UG?
<wmeyer> PG
<wieczyk> I am studying at UWR.
<wieczyk> Well
<wieczyk> Only master thesis.
Drakken has joined #ocaml
<wieczyk> Ok
<wieczyk> thanks for discussion about Ocaml
<wmeyer> wieczyk: good luck, so you can start a new year with something new :-)
<wmeyer> wieczyk: you are welcome, in fact there are so few people in pl I know that do OCaml.
<wieczyk> ;[
<wieczyk> Dont worry
<wieczyk> when we conquer other tribes
<wieczyk> then everybody will speak in Ocaml.
<wmeyer> wieczyk: sure! `\o
<tac-tics> there's no way I'm going to use underscores and *_of_* naming conventions! Never, ever!
<tac-tics> :P
<wieczyk> wmeyer: Is the Lwt much affected by lack of good inliner?
chambart has joined #ocaml
<wmeyer> not really as lwt stores the closures
<wmeyer> so inlining will not help too much
<wmeyer> (side effects)
uselpa has quit [Remote host closed the connection]
<wmeyer> and also becuase lwt programs are mostly dominated by IO (system calls)
<wmeyer> but other stuff benefits!
<wmeyer> even simple code that does not use monads
<wmeyer> in a tight loop will exhibit the gain
<wmeyer> and since most of the haskell code will run in a monad anyway, you know how much they need that
<wmeyer> combinators in general
sepp2k has quit [Remote host closed the connection]
hto has quit [Quit: Lost terminal]
<wieczyk> mhmh
<wieczyk> I have run utop....
<wieczyk> ....why this program is not popularized...
<wieczyk> hm
<wieczyk> the Alt+Tab is not working for me ;]
Xizor has quit [Ping timeout: 260 seconds]
RichN has joined #ocaml
hto has joined #ocaml
ng__ has quit [Quit: Leaving]
answer_421 has quit [Ping timeout: 276 seconds]
Jeaye has quit [Ping timeout: 276 seconds]
hto has quit [Quit: Lost terminal]
sivoais has quit [Ping timeout: 260 seconds]
hto has joined #ocaml
Vinnipeg has joined #ocaml
Vinnipeg has left #ocaml []
tac-tics has quit [Ping timeout: 245 seconds]
Yoric has joined #ocaml
Jeaye has joined #ocaml
smondet has quit [Ping timeout: 260 seconds]
Kakadu has quit [Quit: Konversation terminated!]
jamii has quit [Ping timeout: 246 seconds]
Cyanure has quit [Remote host closed the connection]
sivoais has joined #ocaml
mjonsson has joined #ocaml
Developper has joined #ocaml
<Developper> hi , anyone can tell me how can get the source code of this applet http://ocamljava.x9c.fr/toplevel/toplevel.html ?
sirmy has joined #ocaml
othiym23 has quit [Ping timeout: 240 seconds]
kmels_ has joined #ocaml
kmels has quit [Ping timeout: 260 seconds]
othiym23 has joined #ocaml
sirmy has quit [Quit: Leaving]
avsm has joined #ocaml
avsm has quit [Client Quit]
chambart has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 246 seconds]
avsm has joined #ocaml
GnomeStoleMyBike has quit [Ping timeout: 260 seconds]