kaustuv changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
blue_prawn has joined #ocaml
tar_ has quit []
hkBst has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
ertai has quit [Read error: 60 (Operation timed out)]
ertai has joined #ocaml
blue_prawn has quit ["Client exiting"]
alexyk has joined #ocaml
ched_ has joined #ocaml
Ched has quit [Read error: 110 (Connection timed out)]
ccasin has quit ["Leaving"]
<thelema> hmm, I'm thinking about tar_'s request, and it does make sense.
<thelema> He wanted type x = int | float (without constructors)
<komar_> Hello. Yet another question about camlp4.
<thelema> I doubt I'll be able to help, but ask - maybe someone can
<komar_> Is there any way to set symbol in EXTEND like [ "a-zA-Z" -> ... ] ?
<thelema> That's above my camlp4 pay grade. anyone else?
<komar_> No yet. Thanks. :)
<julm> komar_: you mean to match all letters from 'a' to 'z' and from 'A' to 'Z'?
<komar_> Right.
<komar_> May be I must to make `<caml-pattern>, but I can't find how to do it.
<thelema> komar_: can you use the identifier pattern?
<thelema> oops, you just want to match one letter?
<komar_> No, not one.
<komar_> thelema, what pattern to use?
winsmith has quit ["Leaving"]
<thelema> would matching an ocaml identifier work for you?
<thelema> [A-Za-z'_]+
<komar_> Well, [ a_LIDENT -> ... ] | [ a_UIDENT -> ... ] works.
<komar_> But looks not well.
<komar_> (the better way for learning camlp4 is reading sources)
<julm> Camlp4/Struct/Lexer.mll has the patterns for LIDENT or FLOAT, I'm looking forward to see if we can use our own patterns without modifing Lexer.mll
maskd has quit ["leaving"]
maskd- is now known as maskd
<thelema> I think you have to change the lexer, as when identifiers are lexed, they get categorized as lident or uident
<thelema> and you'd have to handle both in your parser if you wanted to handle both.
<julm> yep, you can use another lexer with Camlp4.PreCast.MakeGram
<julm> but how can we extend Lexer.mll without copy/pasting it?
<thelema> it's a module, you can include it in your new lexer module, no?
<julm> and how can we extend Lexer.mll's tokens since it uses Sig.camlp4_token which is a fixed sum type?
<thelema> type ext_token = Old of Sig.camlp4_token | ...
<thelema> more boxing
<thelema> (just an idea - I've never done this before)
<julm> could be possible if we have a way to call a lexer into another lexer, which is likely
<thelema> google to the rescue?
<julm> sure, it's my old friend :P
<thelema> nice - it looks like the work on functorizing camlp4 does someone some good
<julm> komar_: well, ulexer.ml doesn't seem to reuse Camlp4's Lexer.mll, but you may be able to do it for your own lexer if you're more used to ocamllex than me.
<komar_> Oh, thank you men.
ccasin has joined #ocaml
jeddhaberstro has joined #ocaml
Associat0r has quit []
seafood has quit []
yziquel has quit [Read error: 110 (Connection timed out)]
mattam has quit [hubbard.freenode.net irc.freenode.net]
Demitar has quit [hubbard.freenode.net irc.freenode.net]
mattam has joined #ocaml
Demitar has joined #ocaml
ccasin has quit ["Leaving"]
jeddhaberstro has quit []
seafood has joined #ocaml
maskd has quit [Read error: 113 (No route to host)]
alexyk has quit []
Lomono_ has quit ["Don't even think about saying Candlejack or else you wi"]
Camarade_Tux has joined #ocaml
Lomono has joined #ocaml
* julm is away: "Terminator trees, genetically engineered never to flower, could ensure a silent spring in the forests of the future" -- London Daily Telegraph, July 1999
_zack has joined #ocaml
jeanbon has joined #ocaml
_zack has quit ["Leaving."]
seafood has quit [Read error: 110 (Connection timed out)]
jeanbon has quit ["EOF"]
schmx has joined #ocaml
BiDOrD has quit [Read error: 60 (Operation timed out)]
ikaros has joined #ocaml
BiDOrD has joined #ocaml
_zack has joined #ocaml
_zack has quit ["Leaving."]
julm has quit [Read error: 110 (Connection timed out)]
ikaros_ has joined #ocaml
ikaros has quit [Read error: 104 (Connection reset by peer)]
julm has joined #ocaml
Associat0r has joined #ocaml
Jedai has quit [Read error: 110 (Connection timed out)]
Jedai has joined #ocaml
youscef has joined #ocaml
ulfdoz has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
ChristopheT has joined #ocaml
maskd has joined #ocaml
ChristopheT has left #ocaml []
sporkmonger_ has quit []
Associat0r has quit []
spez has joined #ocaml
schme has joined #ocaml
schme has quit ["Lost terminal"]
schme has joined #ocaml
lde has joined #ocaml
spez has quit [Read error: 104 (Connection reset by peer)]
ikaros_ has quit [Read error: 110 (Connection timed out)]
ched_ has quit [Read error: 101 (Network is unreachable)]
ccasin has joined #ocaml
authentic has joined #ocaml
hkBst has joined #ocaml
Associat0r has joined #ocaml
<thelema> is anyone here interested in starting an OCaml evangelism team?
<Camarade_Tux> hmm, what do you mean by "evangelism" and by "team" ?
<Smerdyakov> Camarade_Tux, don't forget: question marks don't get spaces before them in English!
<thelema> well, the thing that got me thinking about this was a conference organizer talkin about how he didn't have to arrange speakers on jquery because their evangelism team took care of that.
<Camarade_Tux> Smerdyakov, I know but it's my hands' fault ! (that space was on purpose ;) )
<Smerdyakov> thelema, which conferences would have non-OCamlers looking for speakers about OCaml?
<thelema> Smerdyakov: it's exactly that kind of thinking that keeps us outside the mainstream
<thelema> maybe think about it this way: which conferences would benefit from someone presenting on OCaml?
<Smerdyakov> thelema, OK. I genuinely don't know the answer. Do _you_ have an answer?
<thelema> no, I don't. I end up organizing conferences in a totally different sphere, and don't go to computer conferences
<Smerdyakov> So what leads you to believe an evangelism team would be worthwhile?
<Smerdyakov> Do you have any evidence that that presentation was worth the effort?
<thelema> no
<thelema> but I do think that ocaml could do with more outreach
<Camarade_Tux> it probably had almost no influence but it's like a single ad somewhere, it has no influence either
<thelema> yup.
<thelema> I also find a lot of value in the reasons given by the speaker on "what rubyers can contribute to the ocaml community"
<Smerdyakov> I have deep doubts about the chance that many members of general Ruby audiences will want to use OCaml.
<thelema> Many rubyists won't want to use OCaml. Many perlists won't want to use OCaml. Many .net-dudes won't want to use OCaml. Many Java-drinkers won't want to use OCaml. But some will, and the community can benefit.
<thelema> Don't forget there's conferences that aren't PL themed... postgresql has great OCaml bindings - they have conferences, no?
<thelema> oscigen would likely be interesting to some web designers
<Smerdyakov> I think people who would like OCaml tend to learn about it already.
<Smerdyakov> The language is pretty visible in today's savvy-hacker community.
<flux> smerdyakov, I believe there is a group of people that at times looks for other tools in their application domain, not just for other tools in written in their language
<Smerdyakov> flux, yes, and those who would use an OCaml solution are already aware of the language, for the most part.
<flux> smerdyakov, well, I'm not sure. if that would be true, I would have been aware of ocaml possibly 10 years ago. but I wasn't :)
<Smerdyakov> flux, I'm not making a statement about arbitrary times in the past.
<thelema> flux: I think Smerdyakov would say you weren't in the "savvy-hacker" community
<flux> (well, of course it doesn't say it doesn't hold for "most part", but this discussion is hand waving - for the most part :))
<Smerdyakov> thelema, no, see last line.
<Smerdyakov> OCaml is hot today. It's one of the top 10 hottest programming languages among the real "hacker" crowd, I think.
<Camarade_Tux> I know several people who have heard about ocaml and think it would be nice to code in it, but don't and evangelism could be just enought to make them actually try ocaml
<Smerdyakov> Camarade_Tux, people who think a tool might be useful but choose to ignore it are unlikely to have the fortitude to learn and use OCaml.
<thelema> Can we all agree that ocaml isn't just a niche language for ... whatever its niche would be?
<Smerdyakov> thelema, yes, and you've now met your preaching-to-the-choir quota for the day. ;)
<flux> I believe one big reason why people don't try less-mainstream tools is that they think "well, I doubt it can be useful for me, afte rall, tools in my domain are pretty sophisticated already"
<Smerdyakov> thelema, on the other hand, I might answer "no," depending on how we define "niche."
<flux> advocacy can help there
<thelema> Smerdyakov :)
<Smerdyakov> thelema, I think OCaml is a general-purpose language that has a steep learning curve.
<Smerdyakov> thelema, so it works in many situations, but most programmers won't ever be productive with it.
<thelema> Smerdyakov: really? What's a language with a shallow learning curve?
<Smerdyakov> thelema, PHP, Ruby, Python, ...
<thelema> because you can do useful things with them without learning much of the language?
<Smerdyakov> My notion of "steepness" is the average of how hard the language is to learn, considering all people who call themselves programmers.
<Camarade_Tux> hmm, ruby operators and python indentation-based syntax are quite annoying for beginners
<thelema> and I deny the concept of "how hard the language is to learn" -- people don't learn an entire language.
<flux> I'm off for a walk, have a good talk ->
<Smerdyakov> thelema, most people find the basic control idioms of imperative languages easier to apply.
<thelema> and ocaml allows people to use them.
<Smerdyakov> Most people also find static type systems confusing.
<Smerdyakov> I'm pretty close to convinced that dynamic typing and imperative/OO are the right settings of the language design knobs for The Masses.
<thelema> I disagree - static type systems (can) make for great compiler error messages. It's a shame we don't have that in ocaml.
<Smerdyakov> You don't appreciate how abnormally talented at programming you are. Most programmers prefer to find bugs by testing; they find it easier.
<thelema> they think it's easier.
<Smerdyakov> I think it really is easier for a majority of them.
<thelema> the ruby community does TDD more than anyone else - they can be convinced of the usefulness of static typing exactly because they understand the weaknesses in TDD
<Camarade_Tux> I'm not sure it's a matter of being or looking easier, mostly a matter of being lazy and not willing to think about what the compilers tells you
<Smerdyakov> Camarade_Tux, again, you, too, don't appreciate how high on the Programmer IQ bell curve you fall. I think the level of abstract thinking needed to work with fancy types is beyond the comfort zones of most programmers.
* thelema thinks the compiler can go above and beyond just compiling correct code and offer great help to people going off the track.
<maxote> what means TDD?
<thelema> most programmers work with fancy types all the time - it's just that their compilers don't check that they're doing it right.
<thelema> TDD = Test Driven Development
<Smerdyakov> thelema, I did mean to imply static typing.
<Smerdyakov> (BTW, it's hilarious that I'm the one playing the role of the populist in this discussion. :D)
<thelema> TDD is one (kinda extreme) methodology of using testing during development
<thelema> yes, even in the other major lands of static typing (java, C#), the types the compiler uses only barely capture how values are being used.
<Camarade_Tux> Smerdyakov, you usually don't start with terribly complicated types and among the people I know who could try ocaml, there are some very talented developpers (and bad ones too)
<thelema> I agree that the masses won't write ocaml libraries with incredibly complex internals to solve difficult problems.
<Camarade_Tux> and a C++ template look worse than any ocaml type
<Smerdyakov> Camarade_Tux, there is a mysterious X factor that determines who will like using statically-typed FP. It's hard to predict who has it.
<thelema> But I think the masses are more than capable of using such a library, presented to them.
<Smerdyakov> And now I get to provide some assurance that I'm not too much of a popular, by repeating my usual position: Most people who are programming today shouldn't be, in anything but very restricted DSLs.
<thelema> and that's where they'll start - that's where everyone starts to get something done.
<Camarade_Tux> Smerdyakov, right, but I think people who experienced type-unsafety are more likely to enjoy it :)
<Smerdyakov> The people who should be programming are all equipped to learn OCaml and will tend to explore it on their own.
* thelema used to hate static typing
<thelema> but I only had languages like Ada, Java, C, etc. as examples
alexyk has joined #ocaml
<thelema> if you like, divide programmers into layers: "capable of writing hello-world", "capable of using a simple library", "capable of working around bugs in libraries", "capable of developing libraries", ...
<thelema> You're right that the people at the bottom will need almost none of the power of ocaml
<thelema> but I suggest that OCaml can provide them what they need, while allowing others to advance
<thelema> OCaml makes a great DSL, no?
<Smerdyakov> I strongly disagree.
<Smerdyakov> The type system is more or less a toy compared to what we know how to do today.
<thelema> and?
<Smerdyakov> And the good thing about DSLs is that you can enforce rich domain-specific properties.
<thelema> isn't it simple enough to do what you need to do while being understandable?
<Smerdyakov> OCaml also lacks the features needed to implement expressive enough metaprogramming.
<Smerdyakov> (To save enough effort for the people outside the elite)
_zack has joined #ocaml
<Smerdyakov> I don't think OCaml has much of a future among informed programmers, for those reasons.
<thelema> ocaml does miss compiler pragmas in the source code
<thelema> which makes compilation difficult
<Smerdyakov> Can you be more specific about what problem you are pointing out?
<thelema> perl, python and ruby have what I call compiler pragmas - instructions to the compiler that change how the rest of the source file is parsed.
<thelema> It's a bit more than defining functions, but it's internal to the source file
<thelema> not like camlp4 which is compile-time
<thelema> err
<thelema> pre-compile time
<thelema> http://www.modernperlbooks.com/mt/2009/06/take-advantage-of-modern-perl-links-from-the-yapc-talk.html <- replicating these in ocaml (the ones it doesn't already have) would be... problematic
<thelema> for example: http://search.cpan.org/~mschwern/Method-Signatures-20090620/lib/Method/Signatures.pm -- adding method signatures to a language that doesn't really have them.
ikaros_ has joined #ocaml
<thelema> maybe what I really want is this: Devel::Declare can install subroutines called declarators which locally take over Perl's parser, allowing the creation of new syntax.
Ched has joined #ocaml
<Camarade_Tux> hmmm, when interfacing C, a char takes a much space as an int ? :o
<thelema> yes.
<thelema> everything's word sized. otherwise the GC would have problems.
<Camarade_Tux> right
<Camarade_Tux> it's just a bit surprising, especially on 64bit
<mrvn> Camarade_Tux: it takes one register. :)
<Camarade_Tux> my previous registers ='(
<Camarade_Tux> next, how to automatically find how to handle t*, t**, t*** from the given type t?
<Camarade_Tux> (yeah, t***, it's a real example)
<mrvn> It could. But what if the conversion breaks the package and I upload ia32-apt-get 20 which fixes the problem. How would people get the fixed package installed? By adding ~19 (or then ~20) the package version changes and the package gets reinstalled and fixed.
<mrvn> ups
<hcarty> thelema: Method::Signatures looks pretty cool.
<mrvn> Camarade_Tux: All three would be abstract.
<thelema> I'm impressed that it's done at all, much less without source filtering.
<flux> regarding the previous discussion: I wonder how a DOM library as neat as jQuery would be written in O'Caml..
<flux> (or rather: how would one port jQuery to O'Caml)
<thelema> flux: jQuery is pretty straightforward to implement - doing it efficiently in terms of bytes of code and speed - that's the trick.
<thelema> but it seems that browsers are adopting the missing functionality anyway.
<flux> thelema, I'm thinking more about the type-safety side
<flux> for example its $()-function
<flux> I suppose that part would be implemented in camlp4
<flux> I've found - with the few javascript hacks I've done - that it is quite a nice library for manipulating tree documents
<Smerdyakov> flux, I'm against DOM programming. I prefer higher-level abstractions, as I've used in Ur/Web.
alexyk has quit []
jeanbon has joined #ocaml
alexyk has joined #ocaml
<thelema> flux: what's the problem - type safety wise?
<thelema> $() would take a string and return a jquery object - same as in javascript
<flux> thelema, well, I was hoping for better type safety guarantees. such as when I look for A-elements, I get A-elements etc.
<flux> and now off to sauna -> (yes, a busy evening here!)
<thelema> you want a type for A elements? You can have it, but it'll have to be wrapped in an enum
<thelema> and yes, you wouldn't be able to have that easily
<flux> print_endline $("a")#href
<flux> #attrib "href" would work..
<thelema> 51% of use is selecting by id. another 13% is by class
<thelema> about another 10 % are tag or tag.class
<thelema> and then you hit the tail
spez has joined #ocaml
spez has quit [Client Quit]
<thelema> #attrib "href" would be late enough binding to do that, yes. but don't forget that $(foo) can return a list of elements, or even no element.
<thelema> jquery basically handles this monadically.
_zack has quit ["Leaving."]
<thelema> and once you have that infrastructure, the types don't matter much.
<thelema> to the user, at least
schme has quit ["Lost terminal"]
schme has joined #ocaml
slash_ has joined #ocaml
tar_ has joined #ocaml
schme has quit ["Lost terminal"]
* julm is back (gone 07:45:51)
<flux> julm, btw, public away/gone-messages are considered bad netiquette, and their primary use is in small channels where everyone knows each other (ie. someone might actually care a person has gone/arrived)
schme has joined #ocaml
* thelema used to use nick changes (thelema/thelema_) to indicate presence
<flux> pft, same thing :)
<thelema> but even that is probably pushing it - there's an away bit for a reason.
<julm> flux: ok
<thelema> nick changes aren't the same - they're metadata, not in-channel data
* julm is away: nothing
<tar_> haha
<thelema> julm: is that what your client does on /away?
<julm> hum
<julm> ok, that was a new option I tried yesterday in XChat's conf
<julm> which announced away messages
<thelema> n/p. (that link is just an example of someone a bit rabid about away)
<Camarade_Tux> that page just makes me realize irc netiquette amounts to 'irc isn't twitter'...
<thelema> yes, twitter allows/encourages most things IRC discourages
schme has quit ["Lost terminal"]
ikaros_ is now known as ikaros
schme has joined #ocaml
schme has quit ["Lost terminal"]
<tar_> jocamlopt mine.ml -- should use system threads, right? but if I spawn two workers I still only seem to use 1 CPU.
<Camarade_Tux> it will always use only one CPU due to limitations in the garbage collector
<tar_> oh, darn
julm has quit [Read error: 110 (Connection timed out)]
julm has joined #ocaml
<Camarade_Tux> with processes, you could use several CPUs
<flux> and with jocaml that's trivial, no? (I haven't used it)
<tar_> I am now moving on to the "distributed" chapter.
komar_ has quit [Read error: 60 (Operation timed out)]
komar_ has joined #ocaml
awwaiid has joined #ocaml
<awwaiid> Greetings! I would like to use Extlib's Std.dump to do some debugging, but am having a hard time getting it to comple.
<awwaiid> I installed extlib from debian, and a testing ona simple hello.ml file containing only: Printf.printf "%s\n" (Std.dump [a;b;c])
<awwaiid> And am trying to compile with: ocamlopt extlib/std.cmx hello.ml
<awwaiid> but get "Unbound value Std.dump"
<awwaiid> any help would be appreciated
<flux> this works for me: ocamlfind ocamlopt -linkpkg -o hello -package extlib hello.ml
<flux> actually I think I know what the problem was
<flux> you need -I extlib
<flux> in any case, just use ocamlfind :)
<flux> (of course, my version requires installing the package too)
<awwaiid> ah, that helps. thanks flux!
<tar_> 160% CPU, great.
<Camarade_Tux> :)
<komar_> Hello. I receive that: Error while linking camlp4/camlp4of.cma(Top): Reference to undefined global `Topdirs'
<komar_> But there are only topdirs.cmi and topdirs.mli files in ocaml distribution.
<komar_> How to resolve it?
<julm> komar_: have you tried to add a -I /where/is/the/cmi ?
<komar_> Command what I use to build: ocamlc -I +camlp4 -I +sqlite3 dynlink.cma camlp4of.cma sqlite3.cma -o test sqltree.cmo pa_sql.cmo test.cmo
Alpounet has joined #ocaml
<julm> hum, toplevellib.cma
<komar_> julm, yes, I have.
<julm> toplevellib.cma has Unit name: Topdirs
<komar_> Oh, great.
<komar_> How can you find it?
<julm> ocamlobjinfo /usr/local/lib/ocaml/toplevellib.cma | grep Top
schme has joined #ocaml
schme has quit ["Lost terminal"]
schme has joined #ocaml
_zack has joined #ocaml
sporkmonger has joined #ocaml
_zack has quit ["Leaving."]
schme has quit [Read error: 113 (No route to host)]
blue_prawn has joined #ocaml
sporkmonger_ has joined #ocaml
alexyk has quit []
sporkmonger has quit [Read error: 110 (Connection timed out)]
schmx has quit [Read error: 113 (No route to host)]
ccasin has quit ["Leaving"]
oriba has joined #ocaml
oriba has left #ocaml []
Yoric[DT] has joined #ocaml
alexyk has joined #ocaml
_zack has joined #ocaml
alexyk has quit []
Associat0r has quit []
alexyk has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux> oh, from reddit : http://felix-lang.org/blog/2009/jun/27/announcing-fbuild-0-1/ , felix not dead :o
alexyk_ has joined #ocaml
<blue_prawn> there's no felix sample on rosettacode http://rosettacode.org/wiki/Category:Solutions_by_Programming_Language
Yoric[DT] has quit ["Ex-Chat"]
<julm> Camarade_Tux: it's just skaller who does not post on the caml-list anymore.
<Camarade_Tux> julm, yeah, exactly ;)
<Camarade_Tux> python rules : gobject-introspection tells me a parameter that should be char* is char :)
alexyk has quit [Read error: 110 (Connection timed out)]
alexyk_ has quit []
<Camarade_Tux> hmm, my fault actually...
alexyk has joined #ocaml
jeddhaberstro has joined #ocaml
_zack has quit ["Leaving."]
ikaros has quit [Remote closed the connection]
Alpounet has quit ["Ex-Chat"]
ertai_ has joined #ocaml
jeanbon has quit [Read error: 110 (Connection timed out)]
eevar2 has joined #ocaml
Lomono_ has joined #ocaml
Lomono has quit [Read error: 60 (Operation timed out)]
hkBst has quit [Remote closed the connection]
Lomono_ has quit ["Don't even think about saying Candlejack or else you wi"]
Lomono has joined #ocaml
BiDOrD has quit [Remote closed the connection]
youscef has quit ["KVIrc 3.4.0 Virgo http://www.kvirc.net/"]
thelema has joined #ocaml
Camarade_Tux has quit ["Leaving"]
Camarade_Tux has joined #ocaml
lde has quit [Remote closed the connection]
slash__ has joined #ocaml
Camarade_Tux has quit [Client Quit]
slash__ has quit [Client Quit]
slash_ has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
C_Tux has joined #ocaml
Christop` has joined #ocaml
Christop` has left #ocaml []
alexyk has joined #ocaml
<alexyk> how do you check a file exists? Unix.stat/ catch Unix_error?