gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
f[x] has quit [Ping timeout: 276 seconds]
f[x] has joined #ocaml
<PascalHunger> I wonder how much of a productive loss Iwould take by switching to ocaml from python
<PascalHunger> anyone else ever use Python for pretty much everything now use ocaml?
<PascalHunger> Like to hear your experience
elehack has joined #ocaml
Edward has quit []
<thelema> hcarty: very interested. I've wanted this for a long time
ccasin has quit [Quit: Leaving]
valross has quit [Remote host closed the connection]
LionMadeOfLions has quit [Ping timeout: 272 seconds]
orbitz_ has joined #ocaml
fremo___ has joined #ocaml
rudi_s_ has joined #ocaml
haelix_ has joined #ocaml
rudi_s has quit [Ping timeout: 272 seconds]
fremo__ has quit [Remote host closed the connection]
haelix has quit [Ping timeout: 272 seconds]
hyperboreean has quit [Ping timeout: 272 seconds]
hyperboreean has joined #ocaml
hyperboreean has quit [Changing host]
hyperboreean has joined #ocaml
orbitz has quit [Remote host closed the connection]
orbitz_ has quit [Client Quit]
orbitz has joined #ocaml
grettke has joined #ocaml
wuj has quit [Ping timeout: 265 seconds]
elehack has quit [Quit: not a typewriter]
valross has joined #ocaml
mjonsson has quit [Ping timeout: 265 seconds]
PascalHu` has joined #ocaml
PascalHunger has quit [Ping timeout: 255 seconds]
Yoric has joined #ocaml
PascalHu` has quit [Remote host closed the connection]
LionMadeOfLions has joined #ocaml
PascalHunger has joined #ocaml
<PascalHunger> is the performance of ocaml still something they optimize and try to improve as a gradual process?
<thelema> not so much - it's pretty stationary. Further optimization would make the compiler harder to modify in other ways.
<thelema> That said, each release there are minor improvements, but nothing like GCC's attempt to find *all* patterns that can be optimized and write special case code to handle them
<PascalHunger> thelema: I mean they are not adopting a speed dont matter way of thinking either are they?
<PascalHunger> where it just keeps getting slower and slower?
<thelema> no, they're not adopting that strategy - speed still matters, and ocaml doesn't get any slower for its new features
<thelema> which means that new features have to be pretty minimally invasive
<thelema> that said, we might make a transition to an ocaml 4.0 someday a novel so he could use Ender as a main character in another novel, Speaker for the Dead. That novel takes place three thousand years after Ender's Game, although due to relativistic space travel Ender himself (now using his own name, Andrew) is only 36, making him only 25 years older than he was at the end of the Formic Wars.
<thelema> [edit]Shadow saga
<thelema> While the first novel concerned itself with armies and space warfare, Speaker for the Dead and its two sequels Xenocide and Children of the Mind are more philosophical in nature. They deal with the difficult relationship between the humans and the "Piggies" (or "Pequeninos"), and Andrew's attempts to stop another xenocide from happening (after the one he unwittingly committed in the Bugger War).
<thelema> oops. my apologies all.
<thelema> A War of Gifts: An Ender Story was released in October 2007.[4] It is set during Ender's first year in Battle School.
<thelema> A prequel to Speaker for the Dead named Ender in Exile was released in November 2008. It involves Ender's journey to the first colony, as well as his meeting a character from the Shadow saga, effectively wrapping up the final plotline of the parallel series.
<PascalHunger> thelema: whats going on here heheh
<flux> teh paste master?-)
<PascalHunger> Either my boss will think I am nuts or fire me on the spot when I say we should use ocaml for future projects ......
<mbac> well, ocaml's not a bad idea
<mbac> but good luck hiring anyone who knows ocaml
<mbac> and even more luck if you also want people who are any good at programming with types :)
<mbac> i've been programming ocaml for two years and think i basically suck at representing my problems with the proper types
<PascalHunger> mbac: I think one of the programmers has been using PHP the whole time and has no idea what a "type" is
<PascalHunger> you do mean data types right? int float etc?
<mbac> well, for starters yeah
<mbac> but mostly i feel like every time i think of using a functor i start writing it and then decide i'm better off using something else
<mbac> so i haven't written an actual functor in deployed code ever which is a bit unusual
<mbac> like Map, for instance
<PascalHunger> I am a big OO fan so its cool that ocaml has OO capabilities although I'm sure must use functional all the way down
<ulfdoz> No you don't have to, ocaml support impeerative paradigms, too.
<PascalHunger> Yea I know but most people seem to go the functional right for everything
<thelema> Not a big fan of OO, but functors are good, even if they need to be used sparingly
<ulfdoz> Imho because it is compact and elegant.
<PascalHunger> yea i like functional to
<PascalHunger> but i do like smalltalk >>
<mbac> you're kind of misusing the language if you use imperative constructs but in a few cases the expressions are clearer
<mbac> they're rather unavoidable in lightweight threading
<PascalHunger> I plan to use purely ocaml for web dev, which is a place where the language does not have to much support yet it still has enough
<ulfdoz> But from my experience, I feel, that the OO-style does not really fit well to other features of the language. It's some kind of isolated system, which has nothing in common with modules or the like.
<thelema> agreed - functional is usually a bit more elegant because it allows decomposition along crooked lines
<mbac> i'm not sure OO-style fits anything very well
<PascalHunger> oh come on :)
<mbac> i find OO code really hard to read even though i've had 10 years of experience with it
* PascalHunger loves smalltalk
<ulfdoz> It must!</java-dev>
<PascalHunger> smalltalk's OO system is very much different then java's
<mbac> since you're never really sure what the state of the world is when you say foo->bar() and which bar is ultimately dispatched
<ulfdoz> That's a feature.
<mbac> haha
<ulfdoz> The thing is, that you define the pre- and post-conditions of bar(), what happens inbetween is not the problem of the caller.
<mbac> what kind of feature, a job-security feature?
<mbac> well *maybe* you define them
<mbac> but in practice nobody does
<mbac> OO may work if everyone on your team and everyone who built your libraries is extraordinarily disciplined but i've never seen that in my career
<mbac> i dunno, maybe you're in a better environment
<mbac> :)
<ulfdoz> There are very good libraries and apis out there, where this works perfectly, but there are also the others. It is mainly a problem of design and code quality. If the implementor does not obey the interface contract, you are indeed lost.
<mbac> well, that's what's so neat about ocaml
<mbac> if you don't obey the interface contract you won't get a binary
<mbac> whereas in other languages the contract says one thing but you might get back a null and now you have a runtime bug
<ulfdoz> An interface contract is also, e.g. "the hash code of an object does not change during its lifetime".
<thelema> mbac: the kinds of "interface contract"s specifiable by types are limited, by necessity
<mbac> see i think you should be able to make that a static requirement so you don't even need to write anything about whether the hash code can change
<mbac> maybe you can do it in ocaml types right now, i have no idea
<mbac> i suck at types :)
<mbac> thelema, why by necessity?
<mbac> or are you talking about exceptions?
<thelema> mbac: there are more expressive type systems than ocaml's, but they're undecidable, meaning the compiler can't examine the code and determine if the types are correct.
<thelema> Of course it's possible to require annotations to help the compiler, but these can 1) lie, and 2) add programming confusion (why do I need to explain this to the compiler) and 3) cause problems with multiple implementations of the same language requiring different annotations
<mbac> aside from exceptions i'm pretty happy with ocaml's balance
<mbac> but that's probably because i don't know enough about a dozen other research projects to argue ferociously about all of the things ocaml does wrong
<thelema> mbac: you'd not have exceptions in ocaml?
<mbac> well, i'd rather never have to think about exceptions which is just a tantrum i throw once in awhile
<thelema> they do make all sorts of reasoning more complex
<mbac> the cures to exceptions always seem way worse than the disease :)
<ulfdoz> They are a good "null-replacement" in java.
<ulfdoz> You have to declare them in the methods signature, which means, that they must be handled by the caller, but you can specify "never returns null".
<mbac> how do you say that in java?
<mbac> (never returns null)
<ulfdoz> Documentation.
<mbac> oh
xcthulhu has quit [Ping timeout: 240 seconds]
<ulfdoz> Because null is part of every non-primitive type's domain, there is no other way to specify that interface contract.
<mbac> yeah
<mbac> i thought you were mentioning a new feature
|marius| has joined #ocaml
ikaros has joined #ocaml
xcthulhu has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
<ulfdoz> For many developers, documentation is a new feature. ;)
ikaros has joined #ocaml
<adrien> can take a lot of time
gildor has quit [Ping timeout: 272 seconds]
gildor has joined #ocaml
valross has quit [Quit: Ex-Chat]
ygrek has joined #ocaml
coucou747 has quit [Ping timeout: 255 seconds]
ftrvxmtrx has quit [Quit: Leaving]
<PascalHunger> anyone here actually ever use mod_caml?
yezariaely has joined #ocaml
<yezariaely> I want to apply a function to each pair i,j of elements of a list (excluding i=j). Is there something predefined or easy?
<rwmjones> yup
<yezariaely> rwmjones: would you be so kind to inform me of that? ;)
<rwmjones> however these days I'd recommend you use something like ocamlnet
<yezariaely> ok :( no answer to my question I expect :(
<rwmjones> yezariaely: List.map?
<yezariaely> rwmjones: for pairs?
<rwmjones> sure .. is this a homework question?
<yezariaely> nope
<yezariaely> two nested List.map ?
ftrvxmtrx has joined #ocaml
<rwmjones> oh I see, you want to apply it to adjacent list members
<rwmjones> there is no function for that, you'll have to write your own
<rwmjones> however it's still very simple
<yezariaely> I wanted to nest two List.maps however I cannot exclude i = j then
<Axioplase> yezariaely: hum, with list.map2, no?
<Axioplase> You pass [1;2;...;length l1] and [1;2;...;length l2] as extra parameter.
<Axioplase> Then, your inner map2 will have i and j in its scope, and you can choose to process differently.
<yezariaely> Axioplase: seems to be a good idea. I will try that. thank you!
<Axioplase> Or, if you use pure functions and don't care about little extra work, it's even either to compute f(i,i) anyway, and *then* to remove them from the results, since you can easily find out at what positions they are…
<yezariaely> extra work is no problem. It should only be fast ;)
<Axioplase> (I'd do that. Both for ease of maintenance and clarity. It shouldn't be much slower, and might even be faster, who knows)
<yezariaely> Axioplase: hmm I still do not come up with the power set of the list using List.map2 maybe I really have to write my own function and it does not work for with map2
ygrek has quit [Ping timeout: 245 seconds]
Yoric has quit [Quit: Yoric]
<yezariaely> ok thx. problem solved using something like that: List.rev_map (fun x -> (List.rev_map (fun y -> (x,y)) [1;2;3;4;5;6])) [1;2;3;4;5;6];;
<yezariaely> (the fun is not that simple in my impl...)
<Axioplase> And then, you remove the diagonals.
<yezariaely> Axioplase: exactly
<PascalHunger> I feel like I'm the only one who wants to use ocaml on the web :\
<yezariaely> just curious: what do you want to do with it on the web?
<PascalHunger> use it for web development
dimitrykakadu has joined #ocaml
<PascalHunger> yezariaely: more or less just general web dev
<yezariaely> PascalHunger: ah I see. Is there an existing framework for that or do you start from scratch?
<PascalHunger> in what ocaml?
<PascalHunger> or php/python etc?
<yezariaely> PascalHunger: ocaml based web dev ;)
<flux> pascalhunger, I tried using mod_caml, but I've ended up using ocamlnet and its Netcgi_scgi connector with a corresponding Apache module
<Axioplase> yezariaely: http://ocaml.pastebin.com/E5vQ3kBy
<Axioplase> That should be it.
<flux> pascalhunger, and in my opinoin, unless you need to interface with apache internals, mod_caml isn't worth the trouble
<flux> (and you won't be bound to using apache either, if you go the fcgi/scgi route)
<flux> of course, performance cannot be as great, but it isn't bad either..
<PascalHunger> flux: i did not even know a fcgi interface existed
<PascalHunger> flux: is db connections and html templates all covered in that? or how exactly does it work with the solution you mentioned?
<PascalHunger> I honestly dont even want to use apache
<yezariaely> Axioplase: a big thx to you!
<Axioplase> Don't thank me. Thank my paypal account :)
<PascalHunger> I invest quite a bit of the companies time into web dev so a solid solution is needed sometime here
<yezariaely> looks quite nice. my code is much more complex (still works...)
<gildor> Axioplase: you are out of date, yezariaely should thank your flattr account ;-)
<yezariaely> Axioplase: Isn't the pleasure of teaching someone ocaml worth much more than bucks ;)
<Axioplase> yezariaely: well, if my job gives me bucks in exanche for caml code, I might do such free work from times to times
<flux> pascalhunger, it does only the CGI interface: no db, no html
<flux> pascalhunger, for a more complete solution you might want to take a look at ocsigen
<gildor> cd
<flux> ~%
<gildor> flux: don't fake me I know you are a terminal
<gildor> ;-)
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
Yoric has joined #ocaml
th5 has joined #ocaml
avsm has quit [Quit: Leaving.]
hyperboreean has quit [Quit: leaving]
ikaros has quit [Quit: Leave the magic to Houdini]
Axioplase is now known as Axioplase_
ttamttam has joined #ocaml
avsm has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
Amorphous has quit [Ping timeout: 245 seconds]
Amorphous has joined #ocaml
ccasin has joined #ocaml
sgnb has quit [Remote host closed the connection]
ygrek has joined #ocaml
hyperboreean has joined #ocaml
hyperboreean has quit [Changing host]
hyperboreean has joined #ocaml
sgnb has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
boscop has joined #ocaml
ttamttam has quit [Remote host closed the connection]
dimitrykakadu has quit [Quit: Page closed]
<hcarty> thelema: Does that basic structure look ok to you (the Limited module example)? If so I'll try to get it more fleshed out and properly submitted for inclusion over the next few weeks.
yezariaely has quit [Quit: Leaving.]
ftrvxmtrx has quit [Quit: Leaving]
mal`` has quit [Quit: Coyote finally caught me]
mal`` has joined #ocaml
xcthulhu has quit [Read error: Connection reset by peer]
ikaros has joined #ocaml
th5 has quit [Quit: th5]
rudi_s_ is now known as rudi_s
avsm has quit [Quit: Leaving.]
init1 has joined #ocaml
Associat0r has joined #ocaml
wuj has joined #ocaml
lpereira has joined #ocaml
lluvia has joined #ocaml
wuj has quit [Ping timeout: 265 seconds]
joewilliams is now known as joewilliams_away
itewsh has joined #ocaml
Yoric has quit [Quit: Yoric]
joewilliams_away is now known as joewilliams
Tobu has quit [Read error: Operation timed out]
ccasin has quit [Ping timeout: 264 seconds]
ccasin has joined #ocaml
ccasin has quit [Ping timeout: 264 seconds]
ccasin has joined #ocaml
ftrvxmtrx has joined #ocaml
ulfdoz has quit [Ping timeout: 265 seconds]
ulfdoz has joined #ocaml
itewsh has quit [Read error: Connection reset by peer]
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
<lluvia> I am having problems sharing a deb file with ocaml bytecode because it links C libraries. I though a solution would be to compile it at installation time, but I'd like it has a gui for no experience users. some one can give any adie of another solution?
<lluvia> idea or another solution*
Associat0r has quit [Quit: Associat0r]
<flux> why is linking against C libraries a problem?
<lluvia> flux: I obtain: Fatal_error: Unknown C primitive
<flux> well, not sure what the issue is, but would using natively compiled binaries resolve it?
<flux> or possibly ocamlc -custom
<adrien> lluvia: are you compiling with -custom?
<lluvia> I am compiling with ocamlopt
<adrien> ocamlopt doesn't produce bytecode
<lluvia> hmm, I ned to check which compiler i use, but I had in mind that it made bytecode, un s
<adrien> ocamlc* produce bytecode, ocamlopt* produce native code
<flux> possibly confusingly ocamlc.opt does produce byte code ;)
<lluvia> I used ocamlc, sorry
_unK has joined #ocaml
<lluvia> I though to make byte code was more portable than the native option
<adrien> you're making a deb, but for which distribution? and what is the missing primitive?
<adrien> how big is your executable?
<lluvia> it is very small
<lluvia> the primitive is: caml_onj_add_bffset
<lluvia> obj*
<lluvia> caml_obj_add_offset*
<lluvia> I am making a deb for ubuntu
<adrien> as flux suggested, you could try using native code and ocamlc
<adrien> also, do you have libcamlrun_shared.so on the target system?
<lluvia> I fixd the dependence of the package was "ocaml"
<adrien> ocaml-base maybe
<adrien> ocaml-base should be enough for runtime, ocaml is the full (big) package afaik
<lluvia> thank you vey much for that comment!
<lluvia> but the native code was portable for most of i386?
<lluvia> will be*
init1 has quit [Quit: Quitte]
<adrien> yeah, it should be as portable as any other program (which means that you might have troubles if you try to use it with older *software* : like an old (g)libc, maybe an old kernel...)
lpereira has quit [Quit: Leaving.]
<lluvia> aha
<adrien> I actually had the pleasure of being told my glibc was too old to run a binary a few months ago: the newer glibc version had been released two weeks earlier...
coucou747 has joined #ocaml
srcerer_ has joined #ocaml
_2x2l_ has joined #ocaml
orbitz_ has joined #ocaml
_2x2l has quit [Ping timeout: 240 seconds]
mbac has quit [Ping timeout: 252 seconds]
mbac has joined #ocaml
ccasin has quit [*.net *.split]
orbitz has quit [*.net *.split]
Obfuscate has quit [*.net *.split]
easy4 has quit [*.net *.split]
diml has quit [*.net *.split]
srcerer has quit [*.net *.split]
diml has joined #ocaml
ccasin has joined #ocaml
Tobu has joined #ocaml
goncalo has joined #ocaml
yezariaely has joined #ocaml
grettke has quit []
<hcarty> gildor: ping
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
<gildor> hcarty: pong
ygrek has quit [Remote host closed the connection]
<hcarty> gildor: I've wrapped a new function for ocamlmpi (iprobe, a non-blocking probe)
<hcarty> gildor: I may end up wrapping a few others as well. Would you prefer patches as I go, or a single patch with the final result?
<gildor> hcarty: send me patches and tell me when you want a release
<gildor> (smaller are better)
<gildor> hcarty: do you want to have commit rights ?
<gildor> (maybe it will be simpler)
ulfdoz has quit [Ping timeout: 265 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
<hcarty> gildor: I'll send the patches to you for now. If I end up making any more changes I'll request commit rights.
<gildor> hcarty: ok
<hcarty> gildor: Send the patch that is. Does that sound reasonable?
<gildor> yes
yezariaely has quit [Quit: Leaving.]
Obfuscate has joined #ocaml
PascalHu` has joined #ocaml
PascalHunger has quit [Read error: Connection reset by peer]
joewilliams is now known as joewilliams_away
srcerer_ is now known as srcerer
valross has joined #ocaml
valross has quit [Client Quit]
valross has joined #ocaml
dark has joined #ocaml
valross has quit [Quit: Ex-Chat]
Edward__ has joined #ocaml
valross has joined #ocaml
ccasin has quit [Quit: Leaving]