noteventime has quit [Remote closed the connection]
noteventime has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
smimou has quit ["bli"]
reilly has joined #ocaml
EliasAmaral has joined #ocaml
postalchris has joined #ocaml
postalchris has quit [Client Quit]
bluestorm_ has quit ["Konversation terminated!"]
oxylin has joined #ocaml
david_koontz has quit ["Leaving"]
descender has quit [Remote closed the connection]
kelaouch1 has joined #ocaml
oxylin has quit ["Ex-Chat"]
reilly has quit []
fy__ has joined #ocaml
kelaouchi has quit [Connection timed out]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
fy__ has quit [Read error: 110 (Connection timed out)]
screwt8 has quit [Remote closed the connection]
pango_ has quit [Remote closed the connection]
tsuyoshi has quit [anthony.freenode.net irc.freenode.net]
mattam has quit [anthony.freenode.net irc.freenode.net]
bebui has quit [anthony.freenode.net irc.freenode.net]
pango_ has joined #ocaml
bebui has joined #ocaml
tsuyoshi has joined #ocaml
mattam has joined #ocaml
pango_ has quit [Remote closed the connection]
thesoko has quit [Remote closed the connection]
slipstream has quit [anthony.freenode.net irc.freenode.net]
lde has quit [anthony.freenode.net irc.freenode.net]
haelix has quit [anthony.freenode.net irc.freenode.net]
Amorphous has quit [anthony.freenode.net irc.freenode.net]
buluca is now known as nonsonoio
pango_ has joined #ocaml
nonsonoio is now known as Samandro
haelix has joined #ocaml
slipstream has joined #ocaml
lde has joined #ocaml
Amorphous has joined #ocaml
thesoko has joined #ocaml
thesoko has quit [anthony.freenode.net irc.freenode.net]
pango_ has quit [anthony.freenode.net irc.freenode.net]
thesoko has joined #ocaml
pango_ has joined #ocaml
screwt8 has joined #ocaml
screwt8 has quit [Remote closed the connection]
pango_ has quit [Remote closed the connection]
thesoko has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
pango_ has joined #ocaml
Samandro has quit ["Leaving."]
buluc1 has joined #ocaml
buluc1 is now known as buluca
noteventime has quit [Remote closed the connection]
screwt8 has quit [Remote closed the connection]
screwt8 has joined #ocaml
Nutssh has joined #ocaml
buluca has quit [Read error: 113 (No route to host)]
twobitsprite has quit [Read error: 110 (Connection timed out)]
Submarine has joined #ocaml
pantsd has joined #ocaml
fy__ has joined #ocaml
bluestorm_ has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
minciue has joined #ocaml
robyonrails has joined #ocaml
Mr_Awesome has quit ["time to impregnate a moth"]
smimou has joined #ocaml
robyonrails has quit [Read error: 110 (Connection timed out)]
robyonrails has joined #ocaml
<rwmjones>
G, ping
bluestorm_ has joined #ocaml
krumms has joined #ocaml
<krumms>
hey all :)
Tychom has joined #ocaml
robyonrails has quit [Read error: 110 (Connection timed out)]
leo037 has joined #ocaml
<G>
rwmjones: pong?
<G>
rwmjones: I can't talk for long
<rwmjones>
G hey ... I'm getting quite frustrated by the speed with which packages are (or rather aren't) being reviewed for Fedora ... (this is not to blame you or anyone else) ... what can I do to speed up the process?
<G>
rwmjones: well, until Xavier decided to jump into all the reviews, I was prepared to review them
<G>
the issue was you weren't sponsored, and tbh, I havn't been tracking the review process lately as a result (that and I've been extremely busy)
<rwmjones>
the trouble is that few people use OCaml + Fedora (because there is virtually no support for it), but no one is going to start using it until we get these packages in, particularly ocamlfind for example
<rwmjones>
but also packages like extlib are really crucial
<rwmjones>
& ocamlnet
<rwmjones>
& pcre
<G>
which is why I was prepared to review, as apart from gemi, I'm the only other people with ocaml packages
<rwmjones>
those are the really important ones
ppsmimou has quit [anthony.freenode.net irc.freenode.net]
flux has quit [anthony.freenode.net irc.freenode.net]
<rwmjones>
so if I "get sponsored" that will help?
ppsmimou has joined #ocaml
<G>
as I said, I have no idea what the status is now
flux has joined #ocaml
<flux>
soo, I was saying.. did any of it come through?
<bluestorm_>
i find it strange to present that Sys.interactive thing for a first time
<bluestorm_>
hm
<bluestorm_>
my problem is that the whole content of the article looks strange to me :p
<krumms>
bluestorm_: how exactly? :)
<bluestorm_>
i don't really understand why you choose to introduce references so soon, and why you don't use them to actually modify a reference
<bluestorm_>
what i don't really know is wich side of OCaml you're trying to describe
<krumms>
bluestorm_: you're probably right, you're the second person to say so. Maybe another revision is in order. :)
<bluestorm_>
reading this post, it seems like an odd imperative scripting language
<krumms>
bluestorm_: that's probably just how I'm using it, coming from a C++/Java background
<bluestorm_>
hm
<krumms>
are you asking why somebody would be interested in Ocaml if I make it out to look like an imperative language with weird syntax? or am I misunderstanding?
<bluestorm_>
yes, it is one of the questions here
<bluestorm_>
in your first post you talked about your Haskell knowledge
<bluestorm_>
couldn't you use it to do a little more functional things ?
<krumms>
bluestorm_: my very limited, antiquated Haskell knowledge :)
<bluestorm_>
Compiler development sounds like ok. :p
<krumms>
like another fibonacci sequence? no, that's exactly what I was trying to avoid
<krumms>
bluestorm_: not as glamorous as it sounds. Simplified parsing framework with a simple source language. It was fun though. :)
<krumms>
I guess what I'm thinking of with this stuff is ... how can I teach people Ocaml without burdening them down with complex algorithms? Not to say that fibonacci et al are all necessarily complex. Just that to learn the basics, it shouldn't IMHO require any more than a quick glance to work out what the code is *supposed* to do.
<krumms>
and then the explanations break that simple example down, so that any questions about weird syntax or semantics can be answered with a skim.
<Ycros>
krumms, choose something practical then
<krumms>
rwmjones: yup. It was actually the inspiration for trying to start the series :)
<krumms>
rwmjones: it contains a lot of useful information, just needs to be distilled a little.
<krumms>
Ycros: what would you suggest?
<Ycros>
krumms, some sort of simple app
<bluestorm_>
involving list manipulations, because it's fun ^^
<Ycros>
hehe
<bluestorm_>
what about a command line todo-list ?
<krumms>
brb - phone
bluestorm_ has quit ["Konversation terminated!"]
bluestorm_ has joined #ocaml
<krumms>
okay, removed references from the first tutorial entirely. Added a brief discussion of why we have "let main () =" and not just "let main =".
<krumms>
I agree that a small application would be a good idea at a later point, but really just trying to introduce the fundamentals right now.
minciue has quit [Read error: 110 (Connection timed out)]
bluestorm_ has quit ["Konversation terminated!"]
piggybox has quit [Connection timed out]
Submarine has quit [Read error: 113 (No route to host)]
minciue has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
noteventime has joined #ocaml
<EliasAmaral>
krumms, I really prefer let _ = ...
<EliasAmaral>
or, at most, let _ = main () in the very end
<krumms>
what's the rationale?
<krumms>
don't doubt you're right, would just like to be able to explain it if I'm going to include it :)
<rwmjones>
why have the main function at all?
<rwmjones>
just do let () = ... list of statements ...
<krumms>
well I'd like to cover functions
buluca has joined #ocaml
screwt8 has quit [Read error: 104 (Connection reset by peer)]
krumms has quit ["Ex-Chat"]
screwt8 has joined #ocaml
noteventime has quit [Remote closed the connection]
noteventime has joined #ocaml
piggybox has joined #ocaml
pantsd has quit [Read error: 110 (Connection timed out)]
<flux>
I personally always have a main-function too.. but sometimes I might call it with preprocessed arguments, such as type setup = { s_file : string; s_opt : operation }, or List.tl (Array.to_list Sys.argv)
EliasAmaral has quit [Success]
munga has joined #ocaml
<munga>
I'm trying to use dynlink to load a cmo that depends by big_int, but there is not big_int.cmo ... Assuming that is in the stdlib, how can I convince dynlink that is avalaible ?
<flux>
have you compiled your executable with nums.cma?
<munga>
I'm using this cmd to create my cmo that is the dynlinked with loadfile ...
<munga>
apache and cduce are respectively mod-caml e cduce (the xml based language)
<rwmjones>
munga, you may need to dynlink nums.cma first
<rwmjones>
actually, ignore that advice ...
<rwmjones>
munga, do you get an error message when you do the Dynlink?
<munga>
rwmjones: I wrote you an email this morning... I'm trying to make mod-caml to dynlink other modules that depend from the main cmo... I've a patch and now I'm trying to link everything with cduce that requires big_int
<flux>
munga, works for me
<munga>
rwmjones: actually I think I can force dynlink to load big_int, but I was wondering a better way then to load the whole stdlib every time I invoke a cgi
<rwmjones>
munga, the solution there is to CamlLoad all the modules you require
<flux>
but perhaps you're doing something different
<munga>
rwmjones: I setup mod-caml with userdir for few selected users and I don't want to add all their modules to my apache.conf
<flux>
from the sound of it :)
<munga>
flux: yep, but thank you for your help !
buluc1 has joined #ocaml
buluca has quit [Nick collision from services.]
buluc1 is now known as buluca
pantsd has joined #ocaml
pango_- has joined #ocaml
pantsd has quit ["Leaving."]
leo037 has quit ["Leaving"]
Smerdyakov has joined #ocaml
gunark has quit [Read error: 110 (Connection timed out)]
gunark has joined #ocaml
Submarine has joined #ocaml
psnively has joined #ocaml
buluca has quit [Read error: 104 (Connection reset by peer)]
robyonrails has quit [Read error: 110 (Connection timed out)]
robyonrails has joined #ocaml
xavierbot has quit [Remote closed the connection]
xavierbot has joined #ocaml
minciue has quit ["Ex-Chat"]
noteventime has quit [Remote closed the connection]
pango_ has quit [Nick collision from services.]
pango_- is now known as pango
bluestorm_ has joined #ocaml
bebui has quit [Read error: 110 (Connection timed out)]
descender has joined #ocaml
buluca has joined #ocaml
noteventime has joined #ocaml
z__z has quit [Read error: 104 (Connection reset by peer)]
bebui has joined #ocaml
love-pingoo has joined #ocaml
screwt8 has quit [Remote closed the connection]
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
smimram has joined #ocaml
screwt8 has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
EliasAmaral has joined #ocaml
beterraba has joined #ocaml
beterraba has left #ocaml []
Smerdyakov has quit [Read error: 104 (Connection reset by peer)]
robyonrails has quit ["me ne vo'"]
Smerdyakov has joined #ocaml
<EliasAmaral>
Who asked about the rationale for let _ = .. instead of let main () = ..?
<EliasAmaral>
let _ = .. is more-or-less a standard for a "entry point" in an ocaml program. any constant defined in global scope works, eg. let main = ..., but _ is a special name that can't be used in anywhere but in a constant declaration
<EliasAmaral>
defining the entry point using constants is useful for getting rid of ;; in the end of declarations. well, i think this is suficient for a tutorial (but maybe my wording isn't much clear)
smimou has joined #ocaml
smimram has quit [Read error: 110 (Connection timed out)]
<bluestorm_>
hm EliasAmaral
<bluestorm_>
why would you use let _ over let () ?
<bluestorm_>
i use let () because it seems me the type restriction is a good thing, but maybe i'm missing something here
<EliasAmaral>
because it's pleasant, beautiful, and nice. and i didn't know i could use let () =
<bluestorm_>
hm
<bluestorm_>
that's pattern matching
<EliasAmaral>
ahhh.
<EliasAmaral>
so let _ = didn't create any binding?
<bluestorm_>
(and you will notice that as _ isn't a "special name" actually, it's even more pleasant and beautiful)
<bluestorm_>
you're right, let _ (and let ()) don't create bindings
<EliasAmaral>
that's nice. maybe it's a good standard to create a "just do a side effect" in the middle of a usually side effects-free function
<EliasAmaral>
but, hmm... side-effect; b just do this, too :)
<bluestorm_>
hm
<bluestorm_>
a; b and let _ = a in b actually are the same thing
<bluestorm_>
hm
<EliasAmaral>
yeah. i like the syntax of ocaml. (the exception is the static namespace-based record)
<flux>
except let x = .. in .. is an expression
<flux>
well, hm
<bluestorm_>
a; b is, too
<flux>
actually so is a; b :-)
<flux>
the context was top-level statements, confused me
<bluestorm_>
hm
<bluestorm_>
camlp4 pa_o.cmo pr_o.cmo transform a;; into let _ = a :p
<psnively>
Neat. I keep forgetting about pr_o.
dark_light has joined #ocaml
<dark_light>
bluestorm_, so ;; actually is a macro?
love-pingoo has quit ["zz"]
EliasAmaral has quit [Read error: 110 (Connection timed out)]
<psnively>
dark_light: More like "
<dark_light>
hmmm? didn't got it
<psnively>
Er, more like: "'a' in and of itself isn't an expression, so we'll make one out of it."
<dark_light>
i was thinking that ;; actually was part of 'native' syntax from ocaml
<dark_light>
but i don't know how ocaml is parsed
<psnively>
Yeah. It's interesting to look at the grammar that camlp4, either classic or revised, actually uses.
joshcryer has quit [Client Quit]
<bluestorm_>
dark_light:
<bluestorm_>
they're not a macro
<bluestorm_>
but pr_o use non-;; style
<bluestorm_>
so it got converted automatically
<bluestorm_>
hm
<bluestorm_>
actually, let _ = at toplevel get parsed exactly the same way as ;;
<xavierbot>
Characters 60-63:
<xavierbot>
Parse error: "in" expected after [binding] (in [expr])
<xavierbot>
actually, let _ = at toplevel get parsed exactly the same way as ;;
<xavierbot>
^^^
<bluestorm_>
:p
<psnively>
It's kind of interesting that OCaml doesn't have "THE syntax."
<bluestorm_>
and it's a shame i don't know camlp4 :p
<psnively>
It
<psnively>
It's worth forming a working knowledge of.
piggybox has quit [Read error: 110 (Connection timed out)]
robyonrails has joined #ocaml
buluca is now known as Quarker
Quarker is now known as buluca
<dark_light>
I would like to have a type like <a, b> that is like 'a but accepts only types a and b
<dark_light>
(could be another syntax, but having a 'limited polymorphism' seems a big win)
<pango>
see gcaml
<dark_light>
okay :)
<dark_light>
... because that way i could have a thing like.. (+) : <float, int> number as 'a -> 'a -> 'a
<dark_light>
i really liked the arithmetic of scheme and its 'ints degrades to bigints automatically' approach, in ocaml this seems to be impossible without explicit variant types
<dark_light>
Ah. actually someone (maybe you) said about this to me already
<bluestorm_>
hm
<psnively>
Oleg Kiselyov wrote something about bounded polymorphism in OCaml as well. But gcaml is really what you're looking for.
<pango>
nov 14 09:14:51 <flux__> dark_light, have you checked out gcaml?
<dark_light>
i have cyclic toughts sometimes:)
<dark_light>
that "[| int -> int -> int | float -> float -> float |]" seemed a bit limited, but maybe it could be integrated in regular ocaml without much disruption! *imagining*
xavierbot has quit [Remote closed the connection]
<psnively>
Or you can build your own subtyping relation around polymorphic variants.
<dark_light>
psnively, but this adds a syntax overhead
<dark_light>
ah, no: the gcaml really does what i was thinking
<dark_light>
[| types |] seems to be just a regular type (and maybe i can build a [| int | float |] list..)
<psnively>
Yeah. I've given it a lot of thought, and I just don't see the value, in general, of that kind of overloading.
<psnively>
But if you do, gcaml it is.
<dark_light>
one value is to treat a number as.. a number. i am used with the number type system of ocaml, but i would prefer that a number is just a number (and some numbers are also ints, floats, etc)
<psnively>
It's not transparently obvious what the subtyping relationships among different kinds of numbers should be, however.
<dark_light>
more generally, i would like to treat things "as it is". a bit like OO inheritance, but without classes, just with types
<psnively>
Well, that's why we have structural typing. :-)
<dark_light>
psnively, that's what i was talking about, i don't know much about the implications of different approaches but the scheme one is just a big win: a number is.. a number, and could be a integer, rational, float(real?), or complex, just plain like this (well, there are also exact vs. inexact numbers, but that's it)
<pango>
it has a runtime cost, can hide bugs, and when it doesn't hides expensive operations from the programmer
<psnively>
I guess my point is that even if you accept the proposition that numbers have "obvious" subtyping relationships (and I don't), that doesn't imply (to me) that general overloaded functions are a good idea.
<psnively>
But hey... gcaml exists. Enjoy. :-)
piggybox has joined #ocaml
<pango>
psnively: such relations between ints, floats, complex, etc. have a mathematical existence (immersions? Not sure of english term for that)
<psnively>
That's the problem: they have many of them. Picking the "right" one isn't trivial. I mean, heck, to me, they're all surreal numbers. ;-)
<psnively>
Not really. They're arbitrary and some perfectly reasonable applications would benefit from different choices. We have an existence proof of this in both Common Lisp and Scheme's choices. They're extremely good, but they're not right for every application.
pango is now known as pangoafk
Mr_Awesome has joined #ocaml
noteventime has quit ["Leaving"]
buluca has quit [Remote closed the connection]
buluca has joined #ocaml
pangoafk is now known as pango
<pango>
psnively: I agree that in the context of a programming language, situation is not so clear... Implementation considerations require different types of integers, etc.
<pango>
Lifting ambiguities may require type annotations... And by that time the "syntactical" benefit is gone
<psnively>
Yes. The moment performance matters, the very nice move from machine integers to bignums, for example, becomes problematic.
<psnively>
Quite.
david_koontz has joined #ocaml
<pango>
dark_light: I'd bet the cost of supporting ints that get automatically "upgraded" to floats of bigints is quite high... It may be just as efficient to use floats or bigints from the start...
<dark_light>
well: in my POV efficiency isn't an issue, auto promoting to bigint just make me never consider the int vs. bigint issue and still get ints without overflow..
pango has quit [Remote closed the connection]
<dark_light>
i am going to sleep, farewell
pango has joined #ocaml
screwt8 has quit [Remote closed the connection]
<pango>
dark_light: so does using bigints everywhere
<dark_light>
<dark_light> well: in my POV efficiency isn't an issue, auto promoting to bigint just make me never consider the int vs. bigint issue and still get ints without overflow..
<pango>
yep, was replying to this
<dark_light>
pango, the problem with bigints in ocaml is that bigints are not nice to type
<dark_light>
just it, even with some syntax sugar typing constants isn't nice
<dark_light>
i have always to remember i am using bigints etc
<pango>
well, there's no specific syntax for bigint litterals, so you have to use big_int_of_int
<dark_light>
in theory i could just forget the limitations of hardware and all ints i type would be bigints, i would be happy with that. (but, ok, ocaml semantics must be tractable because who uses ocaml cares about performance ;-;)
<pango>
supporting extensional polymorphism requires a much heavier runtime machinery than what OCaml uses now
<pango>
for example you need runtime types (currently types don't survive compilation phase)