flux 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.org | Public logs at http://tunes.org/~nef/logs/ocaml/
<ousado> sure, I'm looking at what's there
<ousado> but fan is very powerful - it's not obvious to me where the ocaml grammar is extended
sivoais has quit [Ping timeout: 240 seconds]
<ousado> for now I'm just trying to use ocaml syntax (as above). the prolog example is nice and all, but for now my goal is to tweak the ocaml AST, not to replace it.
<ousado> s/it/the parser
<wmeyer> one thing to note that is that Fan ast is not the OCaml AST
<wmeyer> effectively Fan replaces the frontend
eikke has quit [Ping timeout: 245 seconds]
<ousado> well, it's a superset
<ousado> syntax-wise, no?
<wmeyer> sort of, really what it is is very lousy AST
<wmeyer> that allows incomplete fragments of ast and also extending the syntax a bit
<wmeyer> so it's not a very "tight" syntax tree
<wmeyer> it's rather rough approximation that allows to express OCaml grammar
<wmeyer> because then you can say like in type-conv:
<wmeyer> type t = Foo | Bar with sexp;;
<wmeyer> this would not be possible with OCaml syntax tree
sivoais has joined #ocaml
<wmeyer> so Fan consumes the textual program, parser it with a custom parser (encoded in Fan btw) to Fan lousy AST, then expands it as possible with registered plugins, and finally the resulting Fan AST is pretty-printed or marshaled, and then OCaml consumes that AST to parse, type check, and compile your expanded program
<wmeyer> so everything happens in the Fan frontend
<wmeyer> also Fan ast also contains way of encoding the named quotations
<wmeyer> quasi quoutes actually
eikke has joined #ocaml
<ousado> yes, and in the paper he says there are (at least) two options to present the expansion to ocaml
<wmeyer> which are only different in such way, that quasi quotes can contain other quotes and anti-quotes, that contain fragments that belong to the environment of the language surrounding quotes (that can be spliced_
<ousado> one is that stuff above, the other is readable code
<ousado> which I'd highly prefer
<wmeyer> you mean just developing "extension points" in the OCaml AST?
<wmeyer> this is the other way, simplier, but maybe not that powerful
<ousado> my main use of macros currently is to analyse types, and to generate code based on their structure
<wmeyer> (and BTW: it's being done at the moment, by Alain Frisch: extension_points branch in SVN)
<wmeyer> yes, so you want a classical type driven code generators
<ousado> yes
<wmeyer> so then use extension_points and attributes instead
<wmeyer> Fan is much more powerful tool
<wmeyer> it's for embedding DSLs and static code generators, still you can use it for your purpose
<ousado> well, it should be easy to do that in fan then, no?
<wmeyer> it should be easy, and i think it is, but Fan have perhaps more steep learning curve
<ousado> ok, yes. well, there's many applications for DSLs combined with type driven code generators
<wmeyer> I need to try Fan this weekend too
sivoais has quit [Ping timeout: 255 seconds]
<wmeyer> you actually encouraged me, because this is futuristic Camlp4 for me
sivoais has joined #ocaml
<wmeyer> it's maybe slightly rough to use, but it was used to embed prolog so hey, it should be working, and also I think there is some type drive stuff too
<ousado> yes, a lot IIUC
<ousado> much more fine-grained than in camlp4, the paper says
ollehar has quit [Read error: Operation timed out]
<ousado> I usually have no issue with steep learning curves - the problem with fan is that I don't know at what language I'm looking at when reading the code
<ousado> s/at//
<ousado> anyway, I'm not complaining, I should wait for the blog post to get started though, I think
<wmeyer> ousado: I should thank you for this effort, and you have a huge container of beer
<ousado> haha ;)
<wmeyer> to be honest I was considering writing such framework in past, but never got enough time and courage
sivoais has quit [Ping timeout: 246 seconds]
<wmeyer> :-)
<ousado> wmeyer: I'm sure you can help improve it
<wmeyer> looking forward the blog posts too!
sivoais has joined #ocaml
tootooroo has quit [Quit: +1 (Yes). -1 (No). i (What I have been trying to tell you all along).]
tootooroo has joined #ocaml
<wmeyer> ousado: and my promise is to tackle Fan this weekend
<wmeyer> and let you know
<ousado> wmeyer: nice
<wmeyer> it will be long and busy weekend I am sure
<wmeyer> but nevertheless I'll enjoy it :-)
<wmeyer> (and I do have some rudimentary experience with Camlp4)
sivoais has quit [Ping timeout: 246 seconds]
<ousado> hm.. for what you call rudimentary, many people would consider themselves experts I guess
<ousado> though the ocaml community is very special
sivoais has joined #ocaml
<ousado> so maybe everyone using camlp4 is nice to start with :)
<wmeyer> my main workflow with Camlp4 was always just code generators
<wmeyer> so I learned how to use the toolchain and how to use quasi-quotes
<wmeyer> and maybe how to write Camlp4 parser, and how to pretty print that code inside Camlp4 to stdout
<wmeyer> but actually rarely I use even parser, and just used Menhir for parsing
<wmeyer> and at the very last stage use Camlp4 to generate program i wanted
<ousado> now that really sounds very rudimentary to me
<ousado> :P
<wmeyer> it's true
sivoais has quit [Ping timeout: 252 seconds]
<wmeyer> it's not an expert Camlp4 knowledge
<wmeyer> I didn't do even quotes on the left hand side of match to ensure :-)
sivoais has joined #ocaml
<wmeyer> I didn't (sadly) do any embedded DSLs too
<ousado> I'm really curious
<ousado> .. to see how Fan, camlp4 and haxe macros relate to each other, that is
<ousado> I'm not yet in the position to have an opinion on that so far
<wmeyer> ousado: so I'd hope that in Fan you could emulate Camlp4 :-)
<ousado> wmeyer: for better adoption?
<wmeyer> it'd be a great idea, to use Camlp4 style quotes and reuse the Camlp4 ASTs
<ousado> yes
ollehar has joined #ocaml
<wmeyer> (but not as a backend - just for experimenting of embedding Camlp4/5 inside Fan)
sivoais has quit [Ping timeout: 248 seconds]
<Leonidas> oh, I didn't know Fan. Only as the language that is now known as Fantom
gustav_ has quit [Read error: Operation timed out]
sivoais has joined #ocaml
<ousado> wmeyer: being able to reuse the existing camlp4 code bases should certainly be a strong selling point for fan
gustav_ has joined #ocaml
<wmeyer> it might be difficult, it sounds like writing Camlp4 in Fan :-)
<wmeyer> but maybe worthwhile
<wmeyer> but somewhat the goal of Fan is to just make something better than Camlp4
<wmeyer> I feel that
<ousado> I thought you meant that
<wmeyer> yes, I meant, but I am not volountouring to do this, that's my point
<ousado> :)
<wmeyer> ousado: sorry 2 AM here and i am still being up, despite not drinking coffee just tea and having another night like this :-)
<ousado> oh yes.. 3 am here O_O
<wmeyer> ousado: where are you at, I thought states?
<ousado> germany
<wmeyer> oh, i see, i was sure it's the other part of world actually
<wmeyer> i am in UK
<wmeyer> but not a native speaker too
<ousado> yes, cambridge :)
<wmeyer> yep!
<wmeyer> where exactly in Germany?
<ousado> in hamburg
<wmeyer> oh i were in Hamburg, remember the smell of the harbor, once in a while I was taken by my grandpa onto the ship, really long time ago
<ousado> and you're from poland originally?
<wmeyer> yes
<wmeyer> I'm polish
<wmeyer> from the north
<wmeyer> another harbor :-)
<ousado> ah nice
sivoais has quit [Ping timeout: 245 seconds]
<wmeyer> but i admit i fell in love in CB
karswell` has joined #ocaml
<wmeyer> river is enough for me
<ousado> haha :)
karswell has quit [Remote host closed the connection]
<wmeyer> actually newton i think was walking along that river too
jbrown has quit [Ping timeout: 245 seconds]
sivoais has joined #ocaml
<ousado> I've never been there
<wmeyer> try
<wmeyer> it's good
<wmeyer> OCaml Labs, makespace.org, cosmopolitan but yet small city :-)
<ousado> I might actually - I can take my dog with me to england, they lifted some restrictions WRT that
<Leonidas> wmeyer: Gdańsk?
<wmeyer> Gdynia
<Leonidas> ah
<wmeyer> it's easier to take dog out of England though
<Leonidas> been there quite many years ago. But I rarely visit poland.
<wmeyer> can hear you are long time english speaker
<wmeyer> me too actually
<ousado> i only visited wroclaw and rzeszow
<Leonidas> me? nah, mostly just handing out on IRC.
<wmeyer> i've been to wrocław but not rzeszów
<ousado> .. and krakow, but for a short time only
<ousado> my ex is from there
<wmeyer> Leonidas: at least you try :-)
<Leonidas> wrocław is nice
<wmeyer> (hanging on IRC and talking to people)
<Leonidas> wmeyer: but probably I have a *really* bad german accent
<Leonidas> kind of ironic
<wmeyer> I wish more people would be here!
<wmeyer> Leonidas: i wasn't ironic, means that it's rarely seen anybody on IRC here, if you say about accents however, my accent is beautiful in mind, but when recorded and heard by me, terrible
<wmeyer> s/more/more Polish/
madroach has quit [Ping timeout: 248 seconds]
<Leonidas> ah, I just wanted to protest, because #ocaml is quite a good size
<wmeyer> Leonidas: accents is good, it makes up your identity
<wmeyer> correctnes and clarity is perhaps more important
sivoais has quit [Ping timeout: 264 seconds]
<Leonidas> wmeyer: you never heard a person from bavaria speak english, I presume. it is just painful :>
<wmeyer> strangely when I say Poland to people when they ask where I am from, they hear Holland
* Leonidas :D
madroach has joined #ocaml
<wmeyer> :D
sivoais has joined #ocaml
seanmcl has left #ocaml []
<wmeyer> Leonidas: I'd hope it does not matter when some English person is introduce to good lagger
<ollehar> gdynia? ever been to karlskrona in sweden? that's my hometown :)
<wmeyer> and btw: here it's quite normal to hear strong accents everywhere
watermind has quit [Quit: Konversation terminated!]
<wmeyer> ollehar: sadly, never ever happen to take the farry :(
<wmeyer> but i do like Sweden, never been to actually
<wmeyer> had a recent friend at work, who was swedish
<Leonidas> so we are all people from somewhere, living somewhere else and speaking english which is not a native language of any of us? Awesome.
<wmeyer> lol
<wmeyer> yes, it's I feel good about it, and btw I propose to switch to this :> : http://en.wikipedia.org/wiki/Lojban
<Leonidas> oh, I met quite a lot of swedish people, most of them are quite unique. In a good way for the most part
<ollehar> hehe
<ollehar> esperanto made by polish guy...
<wmeyer> then actually our buzzlogs can generate knowledge!
<wmeyer> ollehar: Leonidas: correct!
<wmeyer> ollehar: In fact we generated a lot of good things ;-)
<ollehar> ;)
<Leonidas> even speaking english.
<wmeyer> yes, even that
<wmeyer> so sadly you are just another OCaml Polish emmigrant :(
<Leonidas> for a swedish fun-fact, look up Snus in Wikipedia.
<wmeyer> oh i love tobacco snuff
<Leonidas> (my swedish friends were importing that from Sweden)
eikke has quit [Ping timeout: 248 seconds]
<wmeyer> but i don't like to get it here
<wmeyer> and actually haven't taken that for long
<wmeyer> it's a good nicotine :-) not destroying lungs at least
<Leonidas> I don't really, I just tried it once. But the fact that sale is illegal in the EU extept for Sweden is kinda funny.
<wmeyer> really?
<wmeyer> not longer I think
<wmeyer> it was prohibiten in Poland back in days
<ollehar> never tried that
<wmeyer> it's good, just tobacco though!
<Leonidas> wmeyer: as far as I know sweden got an exception for it prior to joining the EU, as a kind-of condition.
sivoais has quit [Ping timeout: 264 seconds]
<wmeyer> must be a strong culture behind it
<Leonidas> => they take this stuff seriously :)
sivoais has joined #ocaml
<wmeyer> I can understand why, that's although I like it, I never get it here, the quality might be very bad
<Leonidas> they were importing it from Sweden to Japan. And I suppose Japanese officials had no idea what it was so they didn't care.
<wmeyer> but you know that, tobacco is awful habbit, but tobacco snuff is way better healthier than smoking
derek_c has quit [Quit: leaving]
<wmeyer> the worst form of tobacco is actually chewing
<Leonidas> I'm already addicted to internet and Club Mate, no time for more addictions.
<wmeyer> club mate looks interesting, I think I've heard the name, but didn't know up till now what it is
<Leonidas> wmeyer: by the way, when did you leave Poland?
<wmeyer> but i don't consume any caffeinated beverages
<wmeyer> at the moment
<wmeyer> about 5 years ago
<Leonidas> it's a kind-of crossover between red bull and mate tea. I can't stand the sweetness of energy drinks, so club mate is great.
<Leonidas> just so hard to get.
<wmeyer> i dropped very recently caffeine from my menu
<wmeyer> i am naturally energetic ;-)
<Leonidas> I'm a student, so sleeping most part of the day is normal behaviour.
<wmeyer> lucky you
<wmeyer> i am working so lack of sleep, is my favourite hobby
<wmeyer> not nesercaily very healthy
sivoais has quit [Ping timeout: 260 seconds]
<Leonidas> nope. I react quite terribly to sleep deprivation and wonder how people can cope with even less sleep
<wmeyer> the answer is they don't cope, at lest to limited extent, I can cope up to the time where I look like zombie and behave like zombie
sivoais has joined #ocaml
cdidd has quit [Remote host closed the connection]
<Leonidas> *cue scenes from fight club*
<ousado> :D
<wmeyer> means, shaky posture, hands on my neck, sleepy eyes, and half understanding what's going on
<wmeyer> yeah!
<wmeyer> but i don't try it again actually
<wmeyer> but todya will be a tough day
<ousado> oh nice .. I have a meaningful compiler error
cdidd has joined #ocaml
<wmeyer> I think, I have plan to switch off all the nice and pleasant interactive internet mediums for the rest of the week just to get sleep and some work done
<wmeyer> ousado: cool
<wmeyer> :-)
<Leonidas> yeah, sometimes I really wish for an internet killswitch to shield me from distractions
<wmeyer> ousado: looks good, I understand you wanted that error message
<Leonidas> problem: lack of IRC, stackoverflow or google make programming suck
<wmeyer> "{:expr| 2 * 4} = 8" <- this would do
<wmeyer> some really influential to me coders say (but they never do it theirselves), just download the cos, papers, source code and unplug the cable
<wmeyer> it's actually true, my best coding times where in aeroplanes
sivoais has quit [Ping timeout: 240 seconds]
sivoais has joined #ocaml
<Leonidas> I do my best programming when not at the computer. sometimes a piece of paper and a pen are just the right tool to organize my thoughts.
<wmeyer> I envy
<wmeyer> I never use paper
<wmeyer> but what to learn to use it
<Leonidas> usually I figure out later that I reinvented some wheel someone else already had ready but that's nice too.
<wmeyer> true
<wmeyer> knowledges gives birth to more knowledge
<wmeyer> more general stuff you learn more free minded you are
<wmeyer> (and diversity matters)
<wmeyer> unfortunately I hardly can say I get into depth with piece of paper trying to write down what i learned
<wmeyer> what can work for me is perhaps, writing Polish articles on wikipedia
<Leonidas> my polish is just too awful for that and while I like the concept of Wikipedia I never feel like I have enough knowledge to contribute in a meaningful way to Wikipedia.
ollehar has quit [Ping timeout: 246 seconds]
<Leonidas> Most likely an attitude thing, fortunately there are others who feel otherwise.
<ousado> fans bootstrapping mechanism looks most appealing
<ousado> I wonder if it's reusable
sivoais has quit [Read error: Connection reset by peer]
<wmeyer> Leonidas: if paper works for you, that's already a big win
<wmeyer> so much stuff can be done on paper
sivoais has joined #ocaml
<wmeyer> really.
<Leonidas> hmm, I should probably go to sleep soon-ish. was fun talking to you, wmeyer, thanks :)
<wmeyer> thank you :)
<wmeyer> sleep well, and see you maybe tomorrow Leonidas
<Leonidas> yeah, I'll definitely be around. good night
* wmeyer wishes good night
<ousado> good night
<wmeyer> ousado: but i am here :-) i really need to know continue with CPDT
<wmeyer> yes
<wmeyer> hard to follow
<wmeyer> but very good lecture
<wmeyer> I got several attempts. Eventually I started to digest that
<ousado> it looks very good
<wmeyer> yes I like it, if you want some easy to read stuff about Coq: http://www.cis.upenn.edu/~bcpierce/sf/
<wmeyer> I like it too, but now I use CPDT and cherry pick chapters
<wmeyer> Software Foundations is basically SICP in Coq :-)
<ousado> pierce is really good
<wmeyer> it's brilliant isn't it?
<ousado> I bought TAPL and the follow up
<wmeyer> and I think this book has big didactic future, it's a luxury knowledge given in easy way
<wmeyer> yes, I also want this, I've heard it's a very good book
<ousado> yes
<ousado> if you like types you'll like it I assume :)
<ousado> have you seen Boomerang?
<wmeyer> I like type checkers! and I've seen Boomerang and like
<ousado> he's an incredibly productive guy
<wmeyer> yep, unison is his work too
<wmeyer> actually Boomerant is quite close to what I've been trying to do, but in domain specific setting
<ousado> I need something like that for schema evolution
<wmeyer> write your bi-directional language, surprisingly many applications
<ousado> fan is one of them
<wmeyer> even very specific sometimes
<wmeyer> yes
<wmeyer> parsing-unparsing
<ousado> and it can adopt to new ocaml versions somehow
<ousado> that bootstrapping thing..
<wmeyer> actually one way to do this, is to define types enriched with addtional meta information
<wmeyer> it's great to have ADTs that define the AST but at the same time parsers and pretty printer
<ousado> indeed
<wmeyer> it also applies to transformations
<wmeyer> you can derive one AST from another, and then generate the code that will "fill the gap" just by providing declarative meta information inside the new AST.
<wmeyer> if the rewrite is gradual, you can do it, easily, with an overhead of defining some new ASTs
<wmeyer> that's why OCaml has several intermediate languages, because it's much easier to write compilers in such way
<wmeyer> compare with LLVM :-)
<ousado> :)
<ousado> yes, that's the goal for this database thingy I'm writing
<wmeyer> what kind of databse is that? you are talking about DSL for queries possibly?
<ousado> no, I'm writing a kind of database generator
<wmeyer> yes, you told me that I think
<wmeyer> it's a good idea
<wmeyer> can you elaborate more the idea?
<ousado> sure
<wmeyer> i remember it had different backends
<wmeyer> to generate bindings for different languages?
<wmeyer> it was few months ago, so i don;t know if i recall correctly ...
<ousado> instead of using a DBMS+query language, I have a DSL in haxe syntax to describe types and relations etc.
<wmeyer> cool, did you see Macaque?
<wmeyer> it;s similar but misses the point of being declarative
<wmeyer> well it's as far as SQL goes
<ousado> .. which is used to generate serializer/deserializer code, type ids, database interface code with CRUD semantics etc.
<ousado> and provides hooks for custom code
<ousado> so there's no giant database, but a single-purpose db
<wmeyer> so one DSL, and from that you generate both the bindings and the SQLs or noSQLs
<ousado> exactly one schema
<ousado> well, there's no sql involved
<wmeyer> ah!
<ousado> it's all just code
<wmeyer> ok, so you generate your DB
<ousado> yes
<wmeyer> that's really nice idea
<ousado> and some useful APIs
<wmeyer> it will be fast
<wmeyer> i see only problem with upgrades
<ousado> that's why I need this schema evolution stuff
<wmeyer> so it's the same stuff as opa and generated servers
<ousado> I have trivial versions working, but I need a bullet-proof way
<wmeyer> i like it! Keep it going
<ousado> .. and that way is to just provide functions that take the data to the next version
<ousado> I'd like to show it to ou
<wmeyer> you have to generate the transformation code, from one schema to another, that's it
<ousado> *you
<ousado> well, yes, but that's an interactive process, of course
<wmeyer> ok, maybe URL?
<ousado> for non-trivial transformations
<ousado> oh it-s not public currently
<ousado> as in online
<wmeyer> that's fine, so far I think it's quite plausible
<wmeyer> so please keep me informed
<ousado> I have several more or less messy versions
<wmeyer> :)
<ousado> I will :)
<wmeyer> that's how to develo DSLs actually
<wmeyer> I do the same trick
<wmeyer> keep changing syntax until new ideas come
<wmeyer> and then keep experimenting
<wmeyer> the biggest pain is implementation always
<ousado> yes
<ousado> well, haxe makes it remarkably easy
<wmeyer> (because then I did the hard part, and i will be lazy)
<wmeyer> you would think so ousado but when you need to write 2 KLOC of code in Haxe or OCaml it feels painful
<ousado> yes, sometimes
<ousado> but that's all I do at the moment
<wmeyer> in principle: 'like' (R)
walter has joined #ocaml
<wmeyer> and I think it will not be too difficult to write the language specification too, neither implementing code generators, but the idea is unique
<ousado> there's some ACID thing in haskell which is similar
<wmeyer> yeah, apart that Haskell is not very good for code generation
<ousado> they use template haskell for that
walter|r has quit [Read error: Operation timed out]
awm22 has joined #ocaml
weie has quit [Quit: Leaving...]
<wmeyer> for me it sufficies to just use camlp4, really, and it saved my life
<wmeyer> I think template haskell might be fine
<ousado> anyway, I like the idea a lot, and OI have further plans
<ousado> s/OI/I
<wmeyer> push it :-)
<ousado> I think I've told you
<wmeyer> looking forward it
<ousado> to embed that thing into a VM
<wmeyer> yes, so that's future
<wmeyer> domain specific stacks, whole operating systems with pre-generated stuff
<wmeyer> did you hear about Mirage?
<ousado> yes
<ousado> very cool project
<wmeyer> yeah
<ousado> similar to mine, just waybigger in scope, and bolder
<ousado> I just settled for linux, he went for a XEN guest OS
<ousado> but it's great I admire that a lot
<wmeyer> maybe you can put that together
<ousado> yes, should be possible.. I'm using the same code for remote communication
<ousado> so there's quite an overlap, but it really doesn't matter if you can just adopt the code generator
<wmeyer> it's easy to tweak code generators
<ousado> yes - and so productive
<wmeyer> that's also an advantage
<wmeyer> and not error prone
<ousado> I love to generate some 20K lines of C, have 3000 errors, change one line, and all are gone :)
<wmeyer> yeah
<ousado> and I'm not really generating any fancy stuff, it's all trivial
<wmeyer> I think you got the same mindset
<wmeyer> nope
<wmeyer> I do micro DSLs and from that generate a lot of code
<wmeyer> that's what I do :-)
<wmeyer> yes, the code is usually very trivial
<wmeyer> more dumb it is, compiler can optimise better
<wmeyer> :D
<ousado> which is great - I hope to be able to let ATS prove it's correct
<wmeyer> and usually, it is, suprisingly
<wmeyer> but that's not that surprising
<wmeyer> if you think that
<wmeyer> natural arithmetic although not decidable is defined by few axioms
<wmeyer> so yep, thumbs up for your stuff
<ousado> I'd like to rewrite it in fan
<wmeyer> I really would like to see it!!!
<wmeyer> so keep nagging Hongbo
<ousado> yes I will
<ousado> urgh. .man it's really late
<wmeyer> I agree bootstrapping of Fan obeys the principles I like :-)
<wmeyer> I need to read the paper
awm22 has quit [Ping timeout: 252 seconds]
<ousado> something tells me that fan might become a big thing
<ousado> he's really thinking about the details
<ousado> like having an ast version with all the locs removed etc.
<wmeyer> I heard some time ago when I was thinking about my stuff from somebody: "You know, I'm sceptical"
awm22 has joined #ocaml
<wmeyer> I have some spare ideas still, but these days one needs to be careful with the concepts. I'm glad I did that, and maybe that's future.
<wmeyer> Fan is great, and bootstrapping is awesome. I remember when it was growing.
<wmeyer> So I wish you good luck ousado, your approach is the right one, and I feel you will get your stuff done.
tootooroo has quit [Quit: +1 (Yes). -1 (No). i (What I have been trying to tell you all along).]
<ousado> well it's working quite well
<ousado> I'm using it in production
<ousado> I shouldn't tell anyone, but I do ;)
<wmeyer> if you use in production I am full of really good feellings.
<wmeyer> but as I say, somewhat, I'd choose Fan as the platform
<ousado> yes.. it looks like it will turn out that way
cdidd has quit [Ping timeout: 276 seconds]
<ousado> and since haxe is written in ocaml. that doesn't mean I have to abandon the platform
<wmeyer> it's tough to work with Fan at the moment
<wmeyer> but it has some benefits - can you see, how it's well thought now?
<wmeyer> it's get this through bootstrap
<wmeyer> it wouldn't bootstrap as a small core, if that was not good one
<ousado> yes, it's radically well designed it seems
<wmeyer> Camlp4 was the first iteration
<ousado> I admire the rigor required to keep all those aspects in mind
<wmeyer> now we have immediately Fan after maybe one year
<wmeyer> because we all like beauty in the solutions
<wmeyer> meta programming might be for some ugly
<ousado> I'm too lazy for not doing it
<wmeyer> but actually it's as beautiful as Haskellers claim their monadic stuff is
awm22 has quit [Ping timeout: 240 seconds]
weie has joined #ocaml
<ousado> yes, I'm writing special-purpose monads all the time
<ousado> it's just more flexible to be able to inject arbitrary code
<ousado> that monadic stuff is some very elegant art form, though
<wmeyer> monads and combinators do the same work at runtime
<wmeyer> but without depedent types they are not able to do everything what code generators can do
<ousado> indeed
tootooroo has joined #ocaml
<wmeyer> but then with dependent types, you need type annotations, blablah
<ousado> and with dependent types it's still very hard to do everything
<ousado> yes
<wmeyer> but you can see that meta programming didn't got that attention right, don't ask why this is a digression ;-)
yacks has joined #ocaml
<wmeyer> that's why I do Coq at the moment too, I found my world there too
<ousado> :)
<wmeyer> but WE I'll do a bit of Fan
<ousado> \o/
<wmeyer> :)
<ousado> I'm looking forward to that
<ousado> maybe if metaprogramming is more pleasant, more people start using it
<wmeyer> so if I want a nice break, I just drop down Coq, and do some DSL stuff of you want to know exactly what I prefer
<wmeyer> the downside is that the next day I barely want to do types :)
<ousado> hehe
<ousado> but they go hand in hand, really
<wmeyer> they do, on a different level
awm22 has joined #ocaml
<ousado> on a very practical one, too
<ousado> e.g. generating ATS code
<wmeyer> so the idea with ATS is that you have rich tool for defining different constraints on the type level.
<ousado> yes, well, it also supports proofs
<wmeyer> but once you got linear types, there is rarely a way out
<wmeyer> but optimisations are possible
<ousado> you can do a lot to linear types
<wmeyer> you see, how it affected the runtime!
<wmeyer> just complex type system
<wmeyer> based on simple concepts
cdidd has joined #ocaml
<ousado> more or less simple, yes
<ousado> that's one way to look at it
<wmeyer> one can say that dependent types type checker is way simplier than for full OCaml
<wmeyer> because the concept is simple
<wmeyer> and ML type checker is really rather engineering problem but with a lot of good research and science around it
<ousado> ah I see, OK
<ousado> yes, the type checker has surprising implications, though
<wmeyer> type inference is the key thing here :-)
<wmeyer> it's a difficult problem with a lot of corner cases, and heuristics
<wmeyer> and making it robust with good error messages and performance is so hard!
<ousado> indeed
<ousado> error messages are the most problematic part in ATS
<ousado> I think it needs a configurable error reporting
<wmeyer> so the basic ML type inference is simple, it blindly unifies variables
<wmeyer> simple as this
<wmeyer> adding imperative constructs is harder, but can be done using heuristics
<wmeyer> of course case by case
<wmeyer> but the approach I love is that you don't need annotations
<ousado> yes
<wmeyer> some people say no good - the function level annotations are not pain but yet bring benefit
<wmeyer> but now look at Fan
<wmeyer> it combines perfectly
<wmeyer> man: 4 AM
<wmeyer> up time
<ousado> honestly?
<wmeyer> to finish up CPDT chapter and possibly go to bed
<ousado> alright.. that was pleasure
<wmeyer> yes it was nice talk to you as always
<wmeyer> btw, i really think Fan is quite optimal macro system for ML
willy_ has joined #ocaml
<wmeyer> i might be a bit dodgy, as i say drop down coq to 4AM and i start to think about Fan and Coq ;)
<ousado> that almost promises frightening powers :)
<ousado> "optimal macro system for ML"
<wmeyer> ousado: it does, but it's just a premise, in fact it does require a lot of work :-)
<wmeyer> I was one of the "lucky" that followed Fan from the begining
wwilly has quit [Ping timeout: 256 seconds]
<ousado> yes
<wmeyer> not my work, but I wish it will at least be good.
<wmeyer> which means just good.
<ousado> he seems to be extremely thorough
<ousado> and thoughtful
<wmeyer> definitely he wanted best
<wmeyer> and squeeze everything
<wmeyer> experiment
<ousado> yes, and he wasn't lazy
<wmeyer> you know, he was fast.
<ousado> those are all very promising aspects
<wmeyer> I think Hongbo is a Common Lisper actually
<ousado> he discusses the shortcomings of CL macros as if he were, at least
<wmeyer> yes
<wmeyer> he prefers CL over Scheme AFAIK
<wmeyer> for hygiene I suppose
awm22 has quit [Ping timeout: 264 seconds]
<wmeyer> and maybe CL is just different mind set
<ousado> I don't know enough about lisp ..
<ousado> but that ship has sailed for me
<ousado> life is short and ther's so much I have to learn
<wmeyer> no, it hasn't, but yes better think like this
<wmeyer> sorry you mean not sunk of course :-)
<ousado> well, it's just not among the top 100 on my priority list
<wmeyer> it's enligthening
<wmeyer> but yes, i'd stay away
<ousado> if I had a year or two to exclusively learn, I'd take a look maybe
<wmeyer> I use just StumpWM
<ousado> but that's not likely to happen soon
<ousado> is that a tiling WM?
<wmeyer> 231 lines of macros and customisations in CL
<wmeyer> yep
<wmeyer> + usual 5 HLOC of Elisp in .emacs
<wmeyer> so I am fine with Lisp i think
ousado has quit [Read error: Connection reset by peer]
ousado has joined #ocaml
<ousado> woops
<ousado> I used awesome wm
<wmeyer> actually it's probably 1KLOC of Elisp
<wmeyer> awesome is fine, but it's lua
<ousado> yes
<ousado> I'm looking for a customizable one
<ousado> I mean, it is, but lua is a bit esoteric
<wmeyer> xmonad
<wmeyer> but I can't discard my StumpWM, it's too much configuration
awm22 has joined #ocaml
<wmeyer> StumpWM is maybe Ok, but only if you want some customisations
<wmeyer> I don't even know how much time I spent on it
<wmeyer> i really don't know ;-)
<wmeyer> I just asked myself for a best environment
<ousado> it looks good
<wmeyer> Lua is not esoterci at any means, it's quite pragmatic, Gamedev loves it, because it has tiny core. Maybe it's a good scripting language, and gives some flexibility.
<wmeyer> this is *after* lisp was admitted as the best scripting language though
<wmeyer> so maybe just Lua is the right balance
<wmeyer> it's painful to use for me however.
<ousado> I couldn't really make a lot of sense of it
<wmeyer> me either
<wmeyer> most people don't
<ousado> I mean it's basically C
<wmeyer> they like python
<ousado> I come from python, too
<ousado> but I use it as calculator mostly, or for quick and dirty xml parsing now
<ousado> I'm not someone who can write N*10 lines of tests for N lines of code
<ousado> I need types
<ousado> haxe is a nice hydrid there
<ousado> *hybrid
<wmeyer> some people like to write tests
<ousado> but ocaml too
<ousado> do you know a tiling wm written in ocaml?
<wmeyer> haxe is ocaml in different cloth
<ousado> yes :)
<wmeyer> there was one, back around 2000 by Fabrice Le Fessant
<wmeyer> and I wish it was on my plate
<wmeyer> at the moment
<wmeyer> do the xmonad in O'Caml way'
<ousado> I'm thinking about using gnome shell to write one
<ousado> via haxe or js_of_ocaml
<wmeyer> sounds good
<wmeyer> :-)
<wmeyer> btw: my browser is conkeror
<wmeyer> and i use M-q prefix for WM
<ousado> oh wow
<ousado> I didn't know that one
<wmeyer> M-qog asks me for google term :-)
<wmeyer> M-qow for Wikipedia
<wmeyer> and also, M-1 M-2 M-3 etc. gets me to different screens
<ousado> does it use gecko?
<wmeyer> it's xul
<wmeyer> yes gecko
<ousado> nice
<wmeyer> but it's Emacs in a browserland
<ousado> yes, I got that
<ousado> :)
<ousado> I often tried emacs and failed
<wmeyer> it even uses numbered links, or just type in first word of the link and enter here you go
<wmeyer> I don't use mouse at all (almost)
<wmeyer> try again
<wmeyer> it's a powerful environment
<wmeyer> my pdf browser is llpp :-)
<wmeyer> M-q:docs opens WM menu to pick paper
<wmeyer> and very important: my mail client is Gnus
<wmeyer> this all just works in such way i am able to work on several threads and do whateve i feel so in a second
<wmeyer> and now tell me to use Windows or even Mac OS X.
<ousado> haha :)
<ousado> well, you've found your environment it seems
<ousado> what I want is project-specific everything
<ousado> browser-history, mails, command-line history, all in one context
<wmeyer> yes, and your approach works for you
<ousado> well, not yet
<ousado> I hope it will
<wmeyer> you see i know many things but breadt first, you probably spend more time on single project, which has it's own merits
<ousado> not sure about that
<wmeyer> the power is just power each power user
<wmeyer> there are some very efficient windows power users, I use to be one.
<ousado> yes, power users, that's possible
<ousado> I can't believe people are productive developers on win, although I know some
<wmeyer> ok i will stop advertising my environment it works, but I need I think in short terme: "focus mode" too
<ousado> do you use that environment at work, too?
<wmeyer> they are, but asymptotically less efficient. Also I know some extremely good coders on windows, that are way faster than me, staying clearly on VS
<wmeyer> yes, i have a pleasure to use almost the same scripts
<wmeyer> well they are the same actually, even I insisted on IMAP, which is sort of forbidden
<wmeyer> i think i asked the right person at right time ;-)
<ousado> hehe I se
<ousado> e
<wmeyer> so yes, gnus just works
<wmeyer> StumpWM works
<wmeyer> conkeror works
<wmeyer> but actually I don;t know how i could live with outlook
<ousado> I can't remember the last time I've seen it
<wmeyer> before I got IMAP
<ousado> ok man..
awm22 has quit [Ping timeout: 260 seconds]
<ousado> my dog want's to take a walk
<wmeyer> enjoy :-)
<wmeyer> and it will be a good walk, sun will come soon
<wmeyer> i love morning sun rise
<wmeyer> your dog will be enjoying too
<ousado> me too, but I like it more when I have slept
<wmeyer> it never happens to me actually
<wmeyer> well i know what you mean
<wmeyer> ;)
<ousado> yes, she slept the whole night now
<ousado> yes, very rarely it happens to me
<wmeyer> fingers crosse for your project, I will delve into depedent types now
<ousado> cool, have fun there
<wmeyer> if i am not here, means i am in bed
<ousado> I gotta sleep too
<ousado> see you later
<ousado> very nice talking, again
<wmeyer> yeah, pleasure to talk, see you *tomorrow*
<ousado> M-qnext-day
<wmeyer> ha cool almost :-)
<wmeyer> i have to think about this binding
awm22 has joined #ocaml
<bernardofpc> Ctrl-Alt-Del
<bernardofpc> (or in fact rtcwake -m mem -l -s 28800 && sleep 60 && mplayer2 /home/bernardofpc/wakeup.mp3)
<bernardofpc> Perr Gynt's sunrise by Grieg, is a nice tune to wake up ;-)
<wmeyer> lucky man
<wmeyer> ;)
beckerb has joined #ocaml
frogfoodeater has joined #ocaml
mattrepl has quit [Quit: mattrepl]
yacks has quit [Read error: Operation timed out]
yacks has joined #ocaml
LeNsTR|away has quit [Ping timeout: 256 seconds]
LeNsTR has joined #ocaml
tootooroo has quit [Quit: +1 (Yes). -1 (No). i (What I have been trying to tell you all along).]
frogfoodeater has quit [Ping timeout: 258 seconds]
yacks has quit [Ping timeout: 260 seconds]
yacks has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
ontologiae has joined #ocaml
osa1 has joined #ocaml
<osa1> is there a way to apply a function in ocamldebug ?
ontologiae has quit [Ping timeout: 252 seconds]
tootooroo has joined #ocaml
Kakadu has joined #ocaml
answer_42 has joined #ocaml
<Kakadu> good morning
<wmeyer> Kakadu: morning
* Kakadu found crash in caml_string_compare function yesterday, have slept on it and now it is gone
Snark has joined #ocaml
ggole has joined #ocaml
BiDOrD_ has quit [Remote host closed the connection]
thomasga has joined #ocaml
thomasga has quit [Quit: Leaving.]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
djcoin has joined #ocaml
thomasga has joined #ocaml
Uvs has joined #ocaml
mika1 has joined #ocaml
cago has joined #ocaml
<osa1> how can I split modules into subfolders ? I tried opening a module with FolderName.ModuleName but didn't work
<ggole> Just ModuleName, and -I to tell it about the directory.
<osa1> ggole: isn't -I for just mli files ?
<osa1> ggole: doesn't work for this case: http://hpaste.org/85076
<ggole> .cmo and friends too
<ggole> Where someModule is a directory name?
<ggole> No, wait, nevermind
<ggole> Works fine for me
<ggole> I'm using ocamlbuild
<osa1> yeah ocamlbuild works for me too
<osa1> but I can't use ocamlbuild for the real project so I need to know how ocamlfind calls ocamlc
<osa1> with what parameteres
<ggole> Hmm, I'm not familiar with ocamlfind
<osa1> I'm not using ocamlfind :-) I only use ocamlc for this project
<ggole> In that case, it should be easy to add the -I
<ggole> Compile the files in the subdir first
<ggole> Then ocamlc -I someModule printer.cmo whatever.ml
<ggole> Or whatever the actual filenames are
Yoric has joined #ocaml
eikke has joined #ocaml
<orbitz> ahh, conveniently I think the super simple IRC client I wrot in Ocaml will be a great tool to give Ocaml tutorials with
ulfdoz has joined #ocaml
ontologiae has joined #ocaml
<osa1> orbitz: link ?
<orbitz> it's super tirvial, an ocalm version of ii
<orbitz> but the useful feature is it creates a named pipe ofr ocmmands, and writes to a file for output
<orbitz> so building stuff that does stuff on IRC with it is easy
<orbitz> you can have people write stuff that interacts on IRC that doesn't need to deal with concurrency issues at all
<orbitz> For example: https://github.com/orbitz/forbin
<orbitz> The code is super ugly, I'm refactoring it now that it works
<companion_cube> so, the API for sending stuff on IRC is asynchronous?
<orbitz> but basically I want to give people an easy way to do something halfway interesting without forcing them to learn async monad
<orbitz> companion_cube: the API for communicating on IRC is just a unix fifo and a file, so you can build blocking programs that read/write to those
<companion_cube> no, I mean, the functions in https://github.com/orbitz/osic/blob/master/lib/osic/irc.mli
<osa1> orbitz: what is this syntax: [> ...] ?
<companion_cube> I suppose it spawns a lightweight thread for each sent message
<orbitz> companion_cube: oh, that is Async from Core
<companion_cube> orbitz: it's a polymorphic variant
<orbitz> osa1: it's an open polymorphic variant
<companion_cube> orbitz: I only know a bit Lwt
<osa1> ohh, never heard of it
<orbitz> companion_cube: same idea
<companion_cube> yeah, I see
<orbitz> companion_cube: So the reason I want to use it to help people learn Ocaml, is the logicthey add is a seperate process that reads/writes to the fiels osic creates, that way they can build an irc bot with just blocking functions but still do fun things
mort___ has joined #ocaml
answer_42 has quit [Ping timeout: 245 seconds]
tane has joined #ocaml
ttamttam has joined #ocaml
osa1 has quit [Ping timeout: 245 seconds]
<orbitz> OUD is during CUFP this time right?
<companion_cube> oh, I see
<companion_cube> you can plug a regular, stdin/stdout program to your bot :)
<orbitz> yes
<orbitz> :)
<companion_cube> so unix
<orbitz> yep
<orbitz> osic is a rip offof 'sic' which is the same thing in C, and sic is a layer on top of ii, same thing
<orbitz> osic provides an interface i like better though
<willy_> \o
cago has quit [Read error: Connection reset by peer]
ttamttam has quit [Quit: ttamttam]
cago has joined #ocaml
<companion_cube> are there some comparisons between Async and Lwt?
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
osa1 has joined #ocaml
<osa1> I'm having trouble using a .cma file in my project
<osa1> let's say I have an executable ocaml program and I compiled it to .cma
<osa1> by adding -a parameter
<osa1> now can I use it in some other program as a library? I want to use modules in it
<companion_cube> yes, you should be able to do it
<osa1> I'm getting unbound module error for some reason
<companion_cube> from bytecode, that is
<companion_cube> you need to link against the .cma
<osa1> I'm linking it too, let me check one more time
<osa1> ok ok
<osa1> now it works, sorry. I forgot to link it (Make was putting an empty string because there was a typo in variable)
<companion_cube> :)
mcclurmc has quit [Ping timeout: 258 seconds]
ttamttam has joined #ocaml
<orbitz> companion_cube: They are mostly the same, Async is mostly Ocaml code thoguh where Lwt has a lot of C AFAIK. Asyn also falls into teh Core paradigm
cdidd has quit [Ping timeout: 252 seconds]
Uvs has quit [Ping timeout: 252 seconds]
osa1 has quit [Quit: Page closed]
def-lkb has joined #ocaml
wmeyer` has joined #ocaml
<wmeyer`> hi
ollehar has joined #ocaml
mcclurmc has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
yacks has joined #ocaml
<Kakadu> hey
<companion_cube> ho
alang_ has quit [Remote host closed the connection]
<wmeyer`> companion_cube: Kakadu hello
leoncamel1 has joined #ocaml
leoncamel has quit [Ping timeout: 255 seconds]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
ulfdoz_ is now known as ulfdoz
jbrown has joined #ocaml
ollehar has quit [Ping timeout: 260 seconds]
jonafan has quit [Ping timeout: 264 seconds]
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
ontologiae has quit [Ping timeout: 276 seconds]
jonafan has joined #ocaml
Kakadu has quit [Ping timeout: 260 seconds]
tane has quit [Quit: Verlassend]
cago has left #ocaml []
_andre has joined #ocaml
<ousado> wmeyer`: no sleep at all?
<wmeyer`> ousado: nope
<wmeyer`> and I might take a half of day
<wmeyer`> looks like I am tired
<orbitz> manly man
smondet has joined #ocaml
<orbitz> Shame, even really simple Core app i can only get down to ~5megs
Kakadu has joined #ocaml
ontologiae has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
cago has joined #ocaml
<ousado> "The man that never sleeps", performed by W. Meyer
<adrien_oww> :-)
<adrien_oww> he's training for the IFCP contest
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
<ousado> haha, the ICFP prizes are nice
<ousado> [Language 3] is also not too shabby.
Neros has quit [Ping timeout: 245 seconds]
<wmeyer`> i did mistake to come to work today i think ;-)
<wmeyer`> taking half of day
<wmeyer`> ousado: don't know about ICFP at all
<ousado> me neither, I just looked it up
wmeyer` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ocp has joined #ocaml
Uvs has joined #ocaml
Neros has joined #ocaml
Uvs is now known as UncleVasya
ousado has quit [Ping timeout: 248 seconds]
leoncamel2 has joined #ocaml
ousado has joined #ocaml
leoncamel1 has quit [Ping timeout: 240 seconds]
dezzy has quit [Remote host closed the connection]
<wmeyer> adrien_oww: ousado: thanks, for the hint for ICFP sounds good indeed ;-) I might have a look actually.
<adrien_oww> :-)
<adrien_oww> now, sleep!
<ousado> it looks like a half-serious thing
<ousado> which is good
<ousado> such contests are not for me though
<Leonidas> what is the URL of the 2013 one?
mort___ has quit [Ping timeout: 245 seconds]
<Leonidas> oh, someone won using D once. Nice
awm22 has quit [Ping timeout: 246 seconds]
dezzy has joined #ocaml
dezzy has quit [Changing host]
dezzy has joined #ocaml
Neros has quit [Ping timeout: 252 seconds]
sepp2k has joined #ocaml
Neros has joined #ocaml
<wmeyer> Leonidas: but how D is a functional language
<adrien_oww> s/a functiona language/everything at the same time/
<wmeyer> yeah, and LOGO is functional too
<wmeyer> still functional, still you can do things.
<Leonidas> wmeyer: D2 is actually quite functional. They take immutable data structures seriously, they have proper closures…
<wmeyer> some languages are dis-functional, like Java
<Leonidas> I suppose you can write decently functional code in D. It is no Haskell to be sure, but from what I saw it is really well thought-out
<wmeyer> Leonidas: I trust it's true, but I'd think that you need more than closures and immutability. At the moment I think I need sleep however, and stop this never ending rant :-)
<Leonidas> or turn it into a criminal story like in "Insomnia" ;-)
<Leonidas> wmeyer: well, I write functional-style code in Python and I think Python is even less functional :D
<wmeyer> lol, I trust it can happen today. Today = bad day.
<Leonidas> Winning the ICFP with a program written in bash, on the other hand, is quite an achivement.
<wmeyer> Leonidas: I tried these tricks with python, i was brave enough to start implementing a monadic console interface.
walter|r has joined #ocaml
<wmeyer> Leonidas: auto generated by Haskell!
<Leonidas> hahaha :)
Neros has quit [Ping timeout: 240 seconds]
walter has quit [Ping timeout: 264 seconds]
<wmeyer> just a shameless guess :-)
<wmeyer> sed would be a better VM
<ggole> I wanna write a C compiler in sed someday
<wmeyer> With the Python monadic interface, I endend up to take 100% of my time debugging, and the development stop completely at asome point of complexity
<wmeyer> i was just trying to get it working
<ggole> Due to lack of typing?
<wmeyer> and then I reasured myself that Python is *not* a functional language
<wmeyer> ggole: yes, and lack of coherent syntax
<Leonidas> I have a horrible fear of breaking my ocaml code, because debugging it would exceed my abilities.
* Leonidas likes Python.
<ggole> People claim that Python is a really clean language, but it doesn't seem that well designed to me
<Leonidas> after 10 years of using it, you grow fond of it.
<ggole> On the other hand, it isn't hard to work with and there are many libraries.
<wmeyer> ggole: agreed in full.
<Leonidas> ggole: what is not well designed?
<ggole> Scope discipline, some of the syntax (if expressions, blurgh), default parameters
<Leonidas> well, I might agree that early Python design decisions are not perfect, but 2.2-2.7 are actually fine, IMHO.
<wmeyer> Leonidas: lack of consistency, bloat, bad implementation, slow and bad runtime, rewritten every year std library
<ggole> It allows monkey patching :/
<wmeyer> that's what i call bad language
<ggole> The GIL
<ggole> And yeah, bad implementation
<Leonidas> wmeyer: the stdlib hasn't changed in years. I wish it would.
<bernardofpc> print has changed 2 -> 3 in syntax
<ggole> If you have to write the majority of your stdlib in C because of bad performance, that's pretty damning
<wmeyer> Leonidas: what is wrong in current version of stdlib
<wmeyer> we rewrite libraries not because life is boring
<Leonidas> I also prefer the if expressions to the awful ?: operator where I can never remember what to put where
<wmeyer> Python developers change the Args interface 3 times, and each time making different set of serious mistakes
<ggole> It would make more sense to just have if be an expression imo
<Leonidas> wmeyer: it is written in a style that wouldn't pass for inclusion these days (aka really wacky) and has a lot of pointless and/or broken libraries.
<Leonidas> HTMLParser for example is an utter useless thing
<Leonidas> wmeyer: well, you can continue to use the argument parser modules, because they are all in the stdlib still. No need to change your code.
<wmeyer> stdlib covers 80% of the needed tasks and it's rather fairly designed and bugless
<wmeyer> Leonidas: the question remains: Y.
<ggole> And there are weird things like checking the module name to see if you are __main__
<Leonidas> the split between os, os.path and shutil is completely meaningless.
<Leonidas> the unittest module is awful.
<Leonidas> it is essentially java, so is the logging module.
<Leonidas> for each of those, there are now wrapper modules.
<wmeyer> Leonidas: you see yourself, you cherry pick with pleasure the worst modules with passion
<Leonidas> and the ocaml Args module does not allow for GNU-style arguments, which doesn't impress me either :p
<wmeyer> and mark them "developers now you have to rewrite them this year again"
<Leonidas> wmeyer: I think these modules are those that were hastily added to the stdlib without really considering.
<wmeyer> Leonidas: that's what i call continual improvements, once it's improved they find a serious design flaw, to break things, and be able to write it again
<Leonidas> that's why I was hoping for Python 3 to fix it
<avsm> the mistake here is calling it the stdlib
<wmeyer> Python 3 fixed that?
<avsm> it's actually the compiler stdlib, and has only what's needed for it to compile
<Leonidas> wmeyer: yeah, maybe that shouldn't be in the stdlib in the first place.
<avsm> for example, cmdliner is an awesome command line handler (auto man page generation!). better than anything I've seen in Python
<wmeyer> exactly, stdlib is just for the compiler to bootstrap
<Leonidas> see httplib/httplib2, urllib/urllib2/requests
<wmeyer> I love cmdliner too
awm22 has joined #ocaml
<Leonidas> wmeyer: no, Python 3 didn't fix anything. they just renamed some things.
<wmeyer> and made it so incompatible that people are scared to switch over
<wmeyer> it's not sane Leonidas
<Leonidas> and I don't have issues with the scoping in Python. Writing to outer scopes from closures is not what I'd consider a great idea in any case.
<wmeyer> and pip, pip, pip disapointed me many times
<Leonidas> wmeyer: well, the string handling is sane
<ggole> The ugly transition from 2 to 3 remains a shining example of the huge importance of backwards compatibility
<Leonidas> wmeyer: there is a conversion tool that can take care of the renaming stuff
Neros has joined #ocaml
<Leonidas> the biggest issue is that they did strings more-or-less right.
<wmeyer> + I also don't believe that Python 3 is significantly worth switching from python 2.7
<wmeyer> but it's tempting.
<Leonidas> possibly not, thats the thing
<ggole> 3 would have been better than 2 if they had done it that way from the start
<adrien_oww> just like the dark force
<ggole> But you can't just break existing code, that's a dumb way to move forward
<Leonidas> Python 2 is good enough so Python 3 is not going to get adopted
<wmeyer> 3 just sounds good.
<wmeyer> 2.7 is not enough
<Leonidas> if 2.7 is not enough, 3.3 is not enought either.
<ggole> They should have just deprecated the dumb old stuff and left it in
<wmeyer> So there will be Python 4. Like OCaml 4.01 and maybe that will succeed
<Leonidas> it's not like string handling, nonlocal and renamed stdlib make that much of an interface.
<ggole> That's an acceptable model
<ggole> People like to bitch about it, but they will accept it
<Leonidas> wmeyer: more like python 5, like winamp 2 + winamp 3 = winamp 5 :)
<wmeyer> also there is diversity between developers
<wmeyer> some write Pythonic code
<wmeyer> which is well formed 2d spaghetti
<wmeyer> others not.
<wmeyer> on stackoverflow these who don't write OOP pythonic code will be crucified
<Leonidas> I am not really sure on the future of Python. It has been stagnating for quite some time.
<Leonidas> no idea about stackoverflow, I never need to look up python stuff there.
<wmeyer> still the Python curse stands :-)
<Leonidas> I just know that stackoverflow loves to close interesting discussions.
<wmeyer> there are hundreds more Pythonic developers than lonely Caml riders.
<Leonidas> §$%&$% stackoverflow!
<wmeyer> actually there is lot of *high* quality potst about OCaml there
q66 has joined #ocaml
<wmeyer> :)
<Leonidas> wmeyer: at least the Caml riders can spell the language name properly, lately there's a lot of people who can't even be bothered to properly spell Python.
<wmeyer> ok we proved that python sucks :-)
<Leonidas> "Pyhton" -.-
<Leonidas> and the Raspberry Pi community is busy writing the most godawful code I have ever seen.
<Leonidas> well, to Python's rescue, I have to say that monkey patching rocks
<wmeyer> Leonidas: lol
<wmeyer> (spelling python - i like this comment)
<wmeyer> how about spelling "Pythonic".
<Leonidas> I was once writing on an awful piece of Python code inherited from someone and was monkey-patching all the terrible things.
<wmeyer> I am not sure some spell it aggressively like: Pitonic.
<Leonidas> so in the end we shipped a software that cracked itself, because I monkey-patched out the code for checking the license file.
<wmeyer> Leonidas: it's not surprise, there is no other way to write Python.
<Leonidas> wmeyer: well, there is, I can assure you of that :)
<ggole> I've never got the idea of calling things 'Pythonic'. Doesn't it just mean 'good'?
<Leonidas> ggole: it means idiomatic python.
<adrien_oww> tbh, "pythonic" sounds a lot like "moronic"
<ggole> And if not, wouldn't you rather work on good code than Pythonic code?
<Leonidas> wouldn't the ocaml equivalent be "camltastic" or something?
<wmeyer> Leonidas: the biggest programming compliment I ever received was not about OCaml code.
<wmeyer> It was Python code.
* ggole ponders the distinction between idiomatic code and high quality code
<wmeyer> My collegue from work, a big false functional programming opponent reviewed my code behind my back and said: "This Python code looks like Haskell, actually I like it."
<adrien_oww> ggole: idiomatic code in haskell is unreadable
<Leonidas> I think I am currently on the run from popular languages, because the more popular a language, the more idiots write moronic code. So far, clojure seems safe, haskell too, ocaml as well
<Leonidas> well, unless it is university ocaml code, then it is an amazing mess
<ggole> adrien_oww: I find certain kinds of Haskell pretty tough to swallow, yeah
<adrien_oww> it's true you somehow get shielded with ocaml
<adrien_oww> it's more difficult to find bad libraries
<Leonidas> the code that some students came up with was so crazy convoluted that I couldn't even decipher what it was doing.
<adrien_oww> ggole: I should have said "read-only" rather than "unreadable" actually
<ggole> Actually I find C one of the more readable languages.
<ggole> But you lose anyway since you have to talk about so many low level things.
<Leonidas> ggole: I find Java quite readable
<Leonidas> and tedious. like reading a phone book.
<ggole> Same.
<wmeyer> try Forth
<Leonidas> wmeyer: I write PostScript.
<ggole> I can never keep track of the stack.
* ggole likes names for things
<Leonidas> recursive drawings in PostScript <3
<Leonidas> actually, I think Factor is quite amazing
<wmeyer> Factor is Ok
<wmeyer> It's a good language
<Leonidas> because Factor uses combinators heavily which compare kind of like foldl to raw recursion.
<wmeyer> Forth is also best low level language ever created
<wmeyer> did you try Joy?
<Leonidas> though I haven't been able to wrap my head around it.
<wmeyer> or Cat
<Leonidas> wmeyer: yeah, a bit. I have a Joy1 distribution on my github
<Leonidas> because the author of joy couldn't be bothered to provide something that works out of the box
<wmeyer> Joy is nice, however it's academic language
<wmeyer> not practical
<adrien_oww> ggole: I believe C is very readable by nature; mostly because it's low-level
<ggole> I played with Joy once, several years ago
<Leonidas> Yeah, I haven't had much time to play with it. I definietely plan to. Either Joy or Factor.
<wmeyer> Cat is nice attempt to do impossible in my opinion
<adrien_oww> if you do GTK+ code, you'll create a window, give it a size, show it, add a callback for when it's deleted
<Leonidas> both seem to be quite dead these days.
<adrien_oww> each on one line
<adrien_oww> that's readable
<ggole> It had a lovely clean structure and I couldn't seem to figure out how to do anything with it
<adrien_oww> with lablgtk, you do it all on one line; that's much more compact
hkBst has quit [Read error: Connection reset by peer]
<wmeyer> GTK+ is a nice example what to do with toolkits
<Leonidas> ggole: yeah, that's exactly how my first experience with scheme was.
<ggole> adrien_oww: yeah. It's quite easy to figure out what C code is doing: less easy to figure out if that's what the code should be doing, though.
hkBst has joined #ocaml
<adrien_oww> :-)
<Leonidas> or my first functional programming: "what do you mean I can't MODIFY variables‽"
<ggole> I would really enjoy a low level unsafe language with decent types.
<ggole> Of course there would be no safety.
<wmeyer> Of course you are not serious! It's pure code!
<Leonidas> ggole: there was an attempt of this, let me search the googles
<ggole> But you could make it easier to use interfaces without screwing everything up by mistake.
<ggole> BitC?
<Leonidas> ggole: bingo.
<ggole> It died :(
<ggole> Shame.
<Leonidas> thanks, I couldn't figure out the name
<wmeyer> I think I have heard abou it :-)
<Leonidas> ggole: that's why I said "was".
<ggole> The author was an experimental OS guy, I think
tane has joined #ocaml
<ggole> And he got tired of buggy C code
<Leonidas> I think the author is now off to Microsoft, that's why it died
<Leonidas> I think he was from CoyotOS
<ggole> That rings a bell.
<ggole> Shapiro?
<ggole> Jon Shapiro or something
<Leonidas> Jonathan Shapiro
<ggole> Yeah
<Leonidas> oh, BitC has its own WP article
<wmeyer> You've beaten me down :(
<Leonidas> but yeah, it sounded really good on paper
<ggole> "One answer is that work on Coyotos stopped when I joined Microsoft, and the work that I am focused on *now *doesn't really require (or seem to benefit from) BitC."
<wmeyer> I've heard about BitC, I think I feel it was one of these good languages, but i don't remember i was reading about it or trying it
<Leonidas> ggole: Microsoft has its own BitC, Sing# and friends.
<ggole> Interesting project.
<Leonidas> yeah, Microsoft Research does some cool projects.
<wmeyer> Microsoft do a lot of interesting projects
<wmeyer> GHC
<ggole> It seems to recapitulate the Burroughs machines in some ways: eliminating context switch costs by memory safety
<wmeyer> or Terminator
<ggole> I'm not sure how existing software would be made to work with such a scheme though
<wmeyer> Z3 SMT solver
<ggole> MS Research has a ton of good people
<wmeyer> ggole: Leonidas: I massively cross post, I think it's my time to bed :-)
<ggole> Shame the parent company seems to lack direction at the moment
<ggole> wmeyer: good night then
<wmeyer> yep, thanks
<Leonidas> wmeyer: good night :-)
<wmeyer> i am really tired, apologises for being rude and picky on Pythonists
<Leonidas> ggole: yeah, they do. I wonder how that happened, because MSR is not at all what you'd expect from MSFT.
<Leonidas> its not like Microsoft ever had any tradition in research.
<ggole> Yeah, dunno
<Leonidas> for once, they seem to be the only ones at Microsoft that actually use C# :D
<ggole> It's not like Bell Labs at AT&T
<ggole> It's more like an entirely separate division that only happens to be inside a huge software company
<Leonidas> this has bugged me for quite some time how Microsoft managed to push C# successfully without investing it it themselves.
<ggole> And most of what they do is irrelevant to the business
<Leonidas> they made a vectorizing algorithm for 16-bit era sprites!
<ggole> Totally practical!
<wmeyer> Ok, so my two cents, now very serious and calm.
deavidsedice has quit [Read error: Connection reset by peer]
<ggole> Well, that's research. You get a bunch of that kind of thing along with the good stuff.
deavid has joined #ocaml
<wmeyer> Microsoft does good things
<Leonidas> no idea who approved the funds, but the outcome was quite impressive.
dwmw2_gone has joined #ocaml
<wmeyer> but that's mostly MSR, and some ideas sneak into production
<wmeyer> .NET VM is better than JVM
<Leonidas> for now that's only F#
<wmeyer> I am sure John Harrop will appear from nowhere in cloud of smoke :)
<wmeyer> now
<Leonidas> the VM propably not, but .NET is a better environment than the JVM.
<Leonidas> ohnoes!
wmeyer is now known as JohnH
<companion_cube> Z3 is impressive
JohnH is now known as wmeyer
<wmeyer> and it's written in C++
<wmeyer> Leonidas: VM is better than JVM there are no doubts
<wmeyer> one single thing make this statement true, tail recursion
<Leonidas> wmeyer: when it comes to performance, HotSpot is hard to beat
<wmeyer> how could they not do it in JVM
<wmeyer> maybe, but .NET is not too bad too
<Leonidas> because nobody cared at languages != Java at Sun
<ggole> The JVM lacks real arrays and value types
<ggole> It does seem to implement what it does provide pretty well though
<wmeyer> companion_cube: I've heard Z3 is good, but it's good to hear it from domain expert
<Leonidas> mapping Java to the JVM bytecode is quite simple
<adrien_oww> after 20 years and god knows how many billions of dollars, it better do
<adrien_oww> (being at least ok)
<wmeyer> adrien_oww: you scared me.
<companion_cube> wmeyer: it's not exactly my domain, but well, it's powerful and fast
<ggole> But in a world where a cache miss is ~500 cycles, I don't see how you could possibly describe something with Java's memory model as "hard to beat"
<adrien_oww> wmeyer: how? :o
<ggole> s/memory model/value model/
<companion_cube> that's a problem that also applies to ocaml
* ggole thinks OCaml does poorly along those lines too
<ggole> Yeah :(
<companion_cube> having flat memory layout is what makes C or C++ really efficient
<ggole> But you need to change the language semantics to allow for it
<adrien_oww> one big issue here at work is that our C app gets slower after 1 day of continuous use
<adrien_oww> memory usage isn't that much higher but certainly caused by that
<ben_zen> I was explaining the way memory in a functional language works, and how variables can have different values and retain those values later-that's something that C, etc. aren't exactly good at.
<ben_zen> (explaining to a friend)
<companion_cube> ggole: it's not the language semantic, it's the GC
<companion_cube> adrien_oww: memory fragmentation?
<companion_cube> (well, ok, you need to have a distinction between 'by value' and 'by reference' in the language)
<ben_zen> companion_cube: yes, exactly.
<ben_zen> companion_cube: but you also need a memory model that allows for history.
<adrien_oww> companion_cube: currently it's a guess game; no idea
<ben_zen> adrien_oww: have you been able to run it under valgrind?
* wmeyer thinks he had enough today, definitely going to bed. :-)
<ggole> companion_cube: no, it's very much the semantics. If you stash a.(i) and then change a.(i), then you need certain semantics in order to allow the storage to be contained within the array.
<adrien_oww> ben_zen: after 1 day of continuous use; that's going to be much harder to do with valgrind
<companion_cube> ggole: you mean, you need to pass by reference to modify fields? right
<adrien_oww> and the automated *GUI* tests would have to be udpated
<adrien_oww> updated*
<ben_zen> adrien_oww: yeah ... that seems like a slow-moving disaster type situation.
ollehar has joined #ocaml
<ben_zen> adrien_oww: considered throwing some static code analysis at it?
<companion_cube> so yeah, you need to be able to call by value or by reference
<adrien_oww> and maybe that C is 10 to 20% faster at first but it slowly becomes 500% slower
<ben_zen> Might run clang-analyzer over it and see what it returns.
<adrien_oww> ben_zen: haven't had much time for that yet tbh
<adrien_oww> you have anything particular in mind?
<ggole> companion_cube: consider what happens if you have modifiable fields. You do a.(i).some_field <- foo, and then some time later a.(i) <- new_record.
<ben_zen> adrien_oww: well, if it's something that takes a while to develop, there might be some creeping logic error-is there a data structure with a slow search time that you're not emptying out properly?
<adrien_oww> that sounds pretty unlikely
<ggole> Does the assignment of new_record overwrite the field that you accessed, or does it create a new struct and change a.(i) to reference that? OCaml says it is the latter.
<companion_cube> ggole: you mean, if values are inlined in a?
<adrien_oww> the first candidate currently is memory fragmentation
<ggole> companion_cube: yeah
<companion_cube> so yeah, I mean, you need to have the choice
<adrien_oww> it's a GUI, we don't have big data structures
<companion_cube> because maybe a is an array of floats, in which case by-value is extremely important
<ggole> companion_cube: yes, you need to be able to choose different semantics
<companion_cube> or it's an array of big structures
<companion_cube> I'm all in favor of choice :)
<ggole> companion_cube: mutable fields aren't the only issue, there's also identity
<companion_cube> (==) ?
<ggole> OCaml allows you to observe it with ==
<ggole> Yes
<ggole> So you need to address that kind of thing. It's perfectly possible to do it and keep GC and safety, but you need some machinery to make it all work.
<ggole> Like value types in C#.
<ggole> Or in D, say.
<companion_cube> I'd really like OCaml to have this
<companion_cube> how does it work in C#?
<companion_cube> you have kind of pointers?
<companion_cube> or something like & in C++?
<ggole> You have to pick certain types which behave that way
<ggole> Then if you want to pass one by reference
<ggole> I think you have to say 'ref'
<companion_cube> I see
* ggole isn't a C# guy
<companion_cube> in ocaml, I think it should be the opposite, you would have 'a and 'a unboxed
<companion_cube> the latter being by value
<ben_zen> adrien_oww: If your problem is memory fragmentation, then you're possibly being overzealous with allocating structures and deallocating them
<companion_cube> so array of complex = Complex.t unboxed array
ollehar1 has joined #ocaml
<ben_zen> adrien_oww: I know that there's a Kyocera phone that memory-maps the graphics card and then unmaps it every time it goes to draw
<ggole> companion_cube, and passing values to functions? By value or by reference?
* ggole thinks you need both
<ben_zen> adrien_oww: which is, of course, a bit over the top (especially because it's drawing a lot) ... so are you allocating and de-allocating something far too frequently?
<companion_cube> ggole: hmm, so you need a mechanism to access a field (resp array slot) by value or reference
<adrien_oww> ben_zen: the typical choice when doing C:
<adrien_oww> 1- crash, leak lots of memory, ...
<ben_zen> I can't really say much more without seeing the code/knowing more about the project :P
<ggole> companion_cube: yeah
<companion_cube> I guess putting an 'a into a 'a unboxed copies, but one can use a 'a unboxed as an 'a if needed
<adrien_oww> 2- slowly fragment memory and see issues 10 times later than with 1-
<adrien_oww> ;-)
<adrien_oww> but, yeah
<companion_cube> like, a.(i) returns a 'a
<companion_cube> not a 'a unboxed
<ggole> Which gets quite complicated
<companion_cube> but a.(i) <- x copies x
<adrien_oww> we're going through a memory pool also; I've been wondering whether it's a good idea
<adrien_oww> so I'll probably bench that first and see the differenc
awm22 has quit [Quit: Leaving.]
<companion_cube> means that the language needs to know how to copy values
<companion_cube> (C++, here we come!)
<ggole> Yes, you need either specialisation or some other trickery
<companion_cube> ggole: it's complicated, but otoh if OCaml had a mechanism for this it would remove the need for all the hacks around floats/float arrays
<ggole> I have a whole rant about specialisation versus canonicalisation in language design
<companion_cube> oh, for generic arrays?
<companion_cube> right, you need to specialize arrays of unboxed values
<ggole> Well, the problem is that you need to treat varying things in some uniform way
<ggole> There are two main approaches
<ggole> You can make everything look the same
<ggole> Like ocaml does with int-or-pointer representation stuff
<ggole> That's canonicalisation
<ggole> Or you can specialise
<ggole> Like C++ templates
<ggole> I think both of them suck, but in different ways.
<ggole> Templates require information to be present in inconvenient places
<companion_cube> yeah
<ggole> You get code duplication and other issues that require attention, or support, or hacks
<companion_cube> and to do unboxed arrays, you need to specialize for sizeof(values)
<companion_cube> if you have different sizes of values
<ggole> Yes
<companion_cube> which is the point of unboxing anyway
<ggole> And higher order functions means that you may need to pass the size/align information around at runtime, and dispatch on it
<ggole> If you choose a canonical representation
<ggole> :(
<ggole> I can understand why the OCaml developers chose their nice clean data model.
<companion_cube> or... since unboxing is to be used for high perfs parts of the code, maybe one could forbid polymorphism on unboxed stuff?
<bernardofpc> or just write in C
<companion_cube> hmm, but still need it for containers
<ggole> And for things like < and =
<ggole> Maybe you could special case those, though
<companion_cube> < and = are a hack anyway
<ggole> Yeah
<companion_cube> bernardofpc: life is too short for that ;)
<ggole> D does a lot of this: on the other hand, D is rather complicated.
<companion_cube> (I mean, the point here is to get a nice tradeoff between expressiveness and speed, whereas C is all about speed)
<ggole> It goes down the C++ path.
<ggole> There are some other questions like how exactly you deal with algebraic types.
<ggole> Does it make sense for an ADT to be a value type?
<ggole> type value = Value int sure seems like a reasonable value type
<ggole> But type intlist = Nil | Cons of int * intlist does not
<ggole> Lots of interesting questions here.
<ggole> I gotta go, back in half an hour or so. \o
<bernardofpc> companion_cube: I meant something like FFI
<companion_cube> bernardofpc: that's another possibility
<bernardofpc> no silver bullet, and all that jazz
<companion_cube> but C sucks for things like algebraic datatypes, so one could wish to keep ocaml for them
<companion_cube> hmm, should have read ggole before
<bernardofpc> ;)
<companion_cube> ggole: well, obviously, recursive constructors cannot be value types :)
<companion_cube> but final constructors can be
<companion_cube> (exactly like Cons/Nil)
<companion_cube> and for stuff like Some 42, it makes sense to have a by-value semantic
mort___ has joined #ocaml
<companion_cube> well, I guess Ocaml will never have value types anyway
<orbitz> like C#?
<companion_cube> yep, that's what we were talking about
ollehar1 has quit [Ping timeout: 245 seconds]
hkBst has quit [Quit: Konversation terminated!]
* ggole back
<companion_cube> you missed so many things we said
<ggole> Speaking of ADTs by value
<ggole> There's a paper by Wadler about making pattern matching programmable
<companion_cube> like in Scala?
<ggole> That is, you can have whatever representation you want, and then write some code that determines how the compiler tells that it is a Foo (int, int) or whatever
<ggole> I think it would allow "value ADTs", at least in some sense
<ggole> Not sure what Scala does there
<ggole> I should probably try Scala out some time
<companion_cube> they allow some special method that deconstruct the value
<companion_cube> but it looks like it can be slow
<ggole> Sounds similar
<orbitz> wheee functors
<companion_cube> noooes /o\
<orbitz> are value types just for performance or do they provide another useful thing?
<ggole> Just for performance
<ggole> But the difference can be large in some circumstances
<orbitz> yeah
<ggole> And the problem nests
<ggole> So it can get pretty bad
<ggole> Language designers love indirection because it allows for nice semantics, but CPUs hate it :(
<orbitz> does ocamlopt do any autoboxing for you, for like native ints?
<ggole> I think it will specialise floats that are passed to functions in some cases
<ggole> It will pass them in registers instead of on the heap
<orbitz> k
<ggole> It helps but it is a far cry from control everywhere
<ggole> Well, I guess C is right over there if I want it.
<orbitz> :)
Neros has quit [Ping timeout: 245 seconds]
dwmw2_gone has quit [Quit: Coyote finally caught me]
dwmw2_gone has joined #ocaml
caj has joined #ocaml
dwmw2_gone is now known as dwmw2
Yoric has quit [Ping timeout: 264 seconds]
mika1 has quit [Quit: Leaving.]
cago has left #ocaml []
Fnar has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
thomasga has quit [Quit: Leaving.]
darkf has quit [Quit: Leaving]
Neros has joined #ocaml
ocp has quit [Ping timeout: 245 seconds]
ttamttam has quit [Quit: ttamttam]
mattrepl has joined #ocaml
pango has quit [Quit: kernel update]
sepp2k has quit [Remote host closed the connection]
<Leonidas> is it possible to read the values of Unix.file_kinds from C?
<Leonidas> I currently just made an enum S_REG, S_DIR, etc. that happens to be equal, but maybe the values are stored somewhere
<ggole> They're numbered from 0 iirc
<ggole> In the source order
<Leonidas> ggole: yes, I know. but if someone were to add S_WHATEVER between S_REG and S_DIR my C stubs would break
<ggole> Indeed. :(
<Leonidas> it is not that it doesn't work, I just want it to be future-proof if possible :)
<ggole> I don't know of a way to do it automatically
<Leonidas> alright, then I'll just leave it as-is.
<Leonidas> I don't really expect breakage there, it would be just nice to have.
Kakadu has quit []
adahlberg has joined #ocaml
pango has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
adahlberg has quit [Read error: Connection reset by peer]
adahlberg has joined #ocaml
asmanur has joined #ocaml
adahlberg has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
thomasga has joined #ocaml
tootooroo has quit [Quit: +1 (Yes). -1 (No). i (What I have been trying to tell you all along).]
tootooroo has joined #ocaml
UncleVasya has quit [Ping timeout: 255 seconds]
mcclurmc has quit [Ping timeout: 245 seconds]
UncleVasya has joined #ocaml
weie has quit [Quit: Leaving...]
caj has left #ocaml []
cthuluh has quit [Ping timeout: 260 seconds]
ollehar has joined #ocaml
adahlberg has joined #ocaml
cthuluh has joined #ocaml
eikke has quit [Ping timeout: 255 seconds]
tootooroo has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
cdidd has joined #ocaml
tootooroo has joined #ocaml
ontologiae has joined #ocaml
sargeras_ has joined #ocaml
<sargeras_> bonsoir, c'est la 1er fois que j'utilise irc et je ne connais pas trop la démarche pour demander de l'aide :/
<thelema> sargeras_: en englais ici, ou #ocaml-fr
<sargeras_> okay
sargeras_ has left #ocaml []
<companion_cube> he stayed like 5s :/
Yoric has joined #ocaml
ttamttam has joined #ocaml
ttamttam has left #ocaml []
beckerb has quit [Quit: Konversation terminated!]
ggole has quit []
awm22 has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
answer_42 has joined #ocaml
<ben_zen> I would imagine he went to #ocaml-fr instead
<companion_cube> he did ^^
mattrepl has quit [Quit: mattrepl]
milosn has quit [Ping timeout: 252 seconds]
milosn has joined #ocaml
adahlberg has left #ocaml []
murdoc has joined #ocaml
ulfdoz has quit [Ping timeout: 255 seconds]
<murdoc> Hello. I am learning about Ocaml and have a quick, and probably simple question about types. When I enter: fun x y -> [(y, y)];; I get: 'a -> 'b -> ('b * 'b) list = <fun>. I was curious as to why 'b and how to make it 'a -> 'a -> ('a * 'a)
tautologico has joined #ocaml
tobiasBora has joined #ocaml
<thelema> fun x y -> [x,x]
<thelema> oh, misread
<tobiasBora> Hello !
<thelema> fun (x: 'a) (y: 'a) -> [x,y]
UncleVasya has quit [Read error: Connection reset by peer]
<thelema> but you probably want what I first typed, as it will work everywhere the 'a -> 'a -> ('a * 'a) version you want will.
<tobiasBora> I've a little question about the tuareg mode in emacs : is it possible to display the prototype of a function we are writting to know what are the parameters ? (my function is in the same ocaml file)
<thelema> tobiasBora: after you've compiled, C-c C-t will show the type of whatever's under the point
ocp has joined #ocaml
Kakadu has joined #ocaml
murdoc has quit [Remote host closed the connection]
<tobiasBora> thelema: thanks, but there is a strange behaviour : I can check the type only if functions arguments are already given, if not I've the message "Point is not within a typechecked expression or pattern
<tobiasBora> "
<thelema> tobiasBora: `let f _ = assert false`, compile, then get the type of f.
lopexx has joined #ocaml
<thelema> but getting the type of a function you haven't written yet isn't well supported by the infrastructure.
<thelema> this is just stubbing it out and then getting the type of the stub
<tobiasBora> thelema: if I go on the definition of f it works, but If I do it with an other "f", no...
<tobiasBora> So it's not really usefull to remember what are the argument no ?
<thelema> oh, yes it is useful, but you have to compile before it knows which f you're hovering over.
<thelema> and the compile has to succeed at giving the f you're hovering over a type.
<thelema> syntax errors can prevent this.
<thelema> I guess in the end, it's not more useful than the compiler error message
mattrepl has joined #ocaml
<tobiasBora> thelema: yes I understand it's usefull, but not is my case isn't it ?
<thelema> tobiasBora: yes, to find out the type of the function you've just typed in, the 'get type at point' isn't useful.
<thelema> iirc, there is something like what you want in typerex, but I've never gotten it to work.
<thelema> maybe someone else here has
<tobiasBora> thelema: Ok thanks for your help. And do you know if there is a simple way to do so ?
tootooroo has quit [Quit: +1 (Yes). -1 (No). i (What I have been trying to tell you all along).]
pkrnj has joined #ocaml
* Kakadu is too lazy to move part of pathed Qt5 Quick sources to his own lablqt repo but it seems that he can't avoid it
mattrepl has quit [Quit: mattrepl]
mattrepl has joined #ocaml
_andre has quit [Quit: leaving]
<wmeyer> hi
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
tane has quit [Quit: Verlassend]
lopexx has quit []
mattrepl has quit [Quit: mattrepl]
<ousado> wmeyer: hi!
<ousado> hope you slept well
<wmeyer> ousado: Yes I did sleep weel
<wmeyer> well*
tootooroo has joined #ocaml
<bernardofpc> you seem like a friend of mine that was working with japanese guys in France
<bernardofpc> (not much sleep, completly strange hours, etc)
murdoc has joined #ocaml
<wmeyer> yes, but that's not healthy actually. I had my hard time today
<wmeyer> I use to do it more often though
answer_42 has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 246 seconds]
ocp has quit [Quit: Leaving.]
Snark has quit [Quit: Quitte]
ollehar1 has joined #ocaml
<tobiasBora> I've a little question about global variables : I'd like to modify a global variable in a function, but it doesn't work...
<tobiasBora> This is the code I tried : http://paste.ubuntu.com/5674774
<tobiasBora> and glob1 is equal to 0 at the end (the only moment where glob1 = 123 is... just after the evaluation of the function !! (it's strange no ?=
<tautologico> in this code fglob is not a function, is it?
<tautologico> fglob will be ()
<tautologico> and why would you want to do this, aren't you mixing your compilers? this is C stuff :)
ollehar has quit [Ping timeout: 264 seconds]
awm22 has quit [Read error: Connection reset by peer]
awm22 has joined #ocaml
<tobiasBora> tautologico: oh yes, thanks !
<Leonidas> welcome back wmeyer :)
gustav_ has quit [Quit: pulse sob]
thomasga has quit [Quit: Leaving.]
gustav_ has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.9.2]
ulfdoz has joined #ocaml
mort___ has joined #ocaml
ocp has joined #ocaml
buddyholly has quit [Quit: WeeChat 0.3.9.2]
murdoc has quit [Remote host closed the connection]
Kakadu has quit [Quit: Page closed]
frogfoodeater has joined #ocaml
<pippijn> I'm back in germany
<companion_cube> where do you study in Germany?
<pippijn> karlsruhe
<companion_cube> it's close from France, neat
<companion_cube> have you had a good trip?
<pippijn> yeah, I was in paris a few hours ago
<pippijn> my trip was good
<pippijn> very good
<pippijn> I didn't sleep for 25 hours now
<pippijn> so I should go
<companion_cube> indeed.
<companion_cube> see you tomorrow then :p
<adrien> YOU WERE IN PARIS AND YOU DIDN'T TELL ANYONE?!
<companion_cube> +1
pkrnj has quit [Quit: Computer has gone to sleep.]
pkrnj has joined #ocaml
<tobiasBora> I'd like to do a function debug_print with this behaviour : if the global variable debug_mode is true, then execute the function in parameter (which is unit type). However I've a problem : the function in parameter is run when the big function is call... So it print the text event if we are not in debug_mode.
<tobiasBora> This is my code :http://paste.ubuntu.com/5674971
<adrien> not exactly sober nor not tired
frogfoodeater has quit [Ping timeout: 255 seconds]
<adrien> basically, you seem to be calling the print function and passing the result as argument to your debug_print
<adrien> if you do :
<adrien> f (foo 3)
<adrien> and foo only takes one argument, it will be evaluated
<adrien> however
<adrien> if your foo takes 2 arguments, it won't
<adrien> what you could do is something like:
<adrien> if (!debug)
<adrien> f ()
<adrien> with f :
<adrien> let f some_int () =
<adrien> Printf.printf "integer!!!! %d\n" some_int
<adrien> f 3 will return another function of type unit -> unit
<adrien> when you call that function with (), its side-effect gets triggered
<adrien> hope that made sense, I'm going to bed
<tobiasBora> Thanks adrien, I'll try !
<tobiasBora> Good night ;-)
<tobiasBora> adrien: (if you don't sleep again) : It works !!! Thanks a lot !
<adrien> \o/
tautologico has quit [Quit: tautologico]
anderse has quit [Quit: anderse]
<tobiasBora> (It's just a bit annoying to add () after each function wich is not in debug mode ^^)
<adrien> yeah, another possibility is that you turn the function into something like
<adrien> debug_print f arg1
<adrien> and the
<adrien> n
<adrien> if (!debug)
<adrien> f arg1
<adrien> i.e. you apply the arguments inside debug_print
smondet has quit [Ping timeout: 245 seconds]
frogfoodeater has joined #ocaml
ontologiae has joined #ocaml
smerz has joined #ocaml
emmanuelux has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
ocp has quit [Quit: Leaving.]
fraggle_ has joined #ocaml
awm22 has quit [Quit: Leaving.]
ontologiae has quit [Ping timeout: 252 seconds]
<tobiasBora> adrien: it's a good Idea... I would work hovewer only with one argument, but that's often enought.
<tobiasBora> Goodbye, I go to bed !
tobiasBora has quit [Quit: Konversation terminated!]
ulfdoz has quit [Ping timeout: 245 seconds]
lopex has quit [Ping timeout: 240 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
fasta has quit [Read error: Connection reset by peer]
fasta has joined #ocaml
<dtg> wow. i didnt know printf curried...
<dtg> does the compiler know about the %d and %s
<companion_cube> yes
<companion_cube> printf is type-safe
<dtg> excellent
<dtg> oh, i can't pass a string to printf
<companion_cube> a dynamic string? I dont' thing so, because it would break type-safety
<companion_cube> think*
<companion_cube> there is actually a special kind of string that the compiler knows is an argument of printf
<dtg> something called an ('a, out_channel, unit) format
<dtg> all this type safety is really cool
<dtg> coming from c++ this blows my mind
<bernardofpc> ;-)
<bernardofpc> it's cool though to have variable strings in printf
eikke has joined #ocaml
<bernardofpc> but I suppose in OCaml there's another way of doing the same thing
<companion_cube> I'm not sure there is as generic a mechanism, because it's not type safe
<companion_cube> what if you give a format string that does not match the list of arguments?
lopex has joined #ocaml
<bernardofpc> I have two basic uses of dynamic string printf
<bernardofpc> first, to setup algnment
<bernardofpc> (this is perfectly trivial to type-check)
<companion_cube> what do you mean?
<dtg> ah there we go
<dtg> you can make a format from a string
<dtg> format_of_string
<bernardofpc> something like you want to print "%42d"
<dtg> that makes this big type
<bernardofpc> but you calculate 42 at compile time
<bernardofpc> you could use %*d or something like that
<companion_cube> oh.
<bernardofpc> but this rapidly inflates, so I want to generate my print string dynamically
<dtg> oh i dont think the 42 in %42d matters
<dtg> it still ends up accepting an int
<bernardofpc> the second one, of course, is to provide (42 * "%d" )
<bernardofpc> (or 43, or 41, according to how much I want to print)
<bernardofpc> printf(n-ds, d1, d2, d3, d4)
<bernardofpc> this, I guess, is probably handled with continuations in OCaml
<bernardofpc> (oh, and a third one, which is to flip %f, %lf and %llf, which is much more dangereous :D)
<companion_cube> Printf uses continuations, indeed
<ousado> well, at some point, when everything is determined at runtime, there's no real reason to use printf
sivoais has quit [Ping timeout: 246 seconds]
sivoais has joined #ocaml
q66 has quit [Remote host closed the connection]
gustav_ has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]