gl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list | http://icfpcontest.org/ !!
monotonom has quit ["Don't talk to those who talk to themselves."]
tautologico has joined #ocaml
ayrnieu has joined #ocaml
<platypus> hhola
CiscoKid has quit ["http://lice.codehack.com"]
det has quit [zelazny.freenode.net irc.freenode.net]
Hadaka has quit [zelazny.freenode.net irc.freenode.net]
kosmikus|away has quit [zelazny.freenode.net irc.freenode.net]
Riastradh has quit [zelazny.freenode.net irc.freenode.net]
det has joined #ocaml
Hadaka has joined #ocaml
kosmikus|away has joined #ocaml
Riastradh has joined #ocaml
<platypus> what is the main difference btwn imperial programming and functional programming
<mattam> don't know
<Riastradh> Imperial programming...sounds intimidating.
<mattam> what's imperial programming ?
<ayrnieu> imperial programming focuses on the 'Emperor', or the person that makes all the orders to bring about change, whereas function programming focuses on the 'functions', or the processes that bring about the change. Also, imperial programming systems tend to like to supress minority peoples as they extend the Empire.
* tautologico hears the imperial march from star wars
<mattam> so it's what's advocated by Antonio Negri in the eponym's book ?
* mattam really needs some sleep
<tautologico> so do I
<platypus> :)
<platypus> can someone explain to me the diff btwn recursion and tail recursion ?
CiscoKid has joined #ocaml
CosmicRay has joined #ocaml
<CosmicRay> Hi... I'm looking for the opposite function to String.escape
<CosmicRay> any ideas? :-)
vezenchio has joined #ocaml
gwe3`wats has joined #ocaml
gwe3`wats has quit [Remote closed the connection]
bk_ has joined #ocaml
<ayrnieu> platypus - a smart enough compiler can optimize a tail-recursive function call into a 'jump' -- e.g, if function A calls function B which tail-calls function C, C returns to A rather than B. Since machines have finite stack space, the absense or presence of tail-call optimization affects programming style.
<platypus> ayrnieu, so tail recursion is good right ?
<ayrnieu> platypus - tail recursion exists, good or bad. I like tail-call optimization, though =)
<tautologico> in short, a recursive tail call can be optimized to a jump (instead of a function call)
<ayrnieu> (not to confuse tail-call optimization with more specific tail-recursive-call optimization)
<platypus> could u guys umm give me like a simple example ?
<platypus> tautologico, is there a 'jump' in ocaml ?
<tautologico> platypus: no, I meant when the code is compiled
<platypus> right
<tautologico> platypus: have you read the tutorial mentioned in the topic ?
<platypus> where ?
<platypus> i am reading the oreily book but there are stuff i don understand
<platypus> eg tail-recursion
<platypus> tqs
<tautologico> it's a good read
<tautologico> I think it mentions tail recursion somewhere
kinners has joined #ocaml
CosmicRay has quit ["Leaving"]
<CiscoKid> Tail recursion makes me think of a dog chasing its tail. It uses energy, but doesn't really risk blowing the stack.
<CiscoKid> In each call, if there's more list, it process the rest of the list recursively, but it's tail recursion.
<CiscoKid> That match is a bit funny. I should fix that to get rid of the List.hd and tl
<CiscoKid> There, much clearer.
tautologico has quit ["Leaving"]
bzzbzz has joined #ocaml
bzzbzz has quit [Remote closed the connection]
<platypus> thanks CiscoKid
<CiscoKid> Is it clear what's happening there?
<polarType> CiscoKid: are function executions sharing their stack frame with recursion ?
<polarType> tail recursion I mean.
<CiscoKid> You can think of tail recursion as a goto. I'd say yes, but I've never implemented tail recursion in a programming language. ;)
samx has joined #ocaml
<platypus> yea except one
<platypus> what does one ';' mean
<ayrnieu> You don't really need to think of it as anything, really.
<platypus> i know that ';;' means end of command
<CiscoKid> It's covered there.
<CiscoKid> I wouldn't think of ;; as end of command.
Callidus has joined #ocaml
<platypus> CiscoKid, what would consider ';;' ?
<CiscoKid> Read that tutorial. It explains a lot. I've been programming ocaml for a while and I'm reading it now. :)
<platypus> yup doing that now :)
<platypus> ah ; is like bash's &&
<samx> bzzzt
<CiscoKid> Um, that's not bash, that's bourne shell. It's more like ; in bourne shell.
<CiscoKid> However, it's not quite there, either, since the last command's return value is returned from it.
* CiscoKid gets annoyed when people write ``bash'' scripts.
<bk_> ?
<samx> a;b would be like let _ = a in b
<CiscoKid> I think the tutorial's explanation of it as unit -> 'b -> 'b makes a lot of sense.
<samx> ;; is really mostly just for use with the toplevel, to indicate that you want to feed what you've written to it.. when writing code in a source file, i'd recommend not to ever use it
<platypus> CiscoKid, what do you use ocaml for ?
<CiscoKid> I solved one of the IPSC problems with it last night. :)
<platypus> CiscoKid, in ur work ?
<CiscoKid> I've got a mail server maintenance app that runs nightly on my SunOS 4.1.4 box. It reads through my ~100k email messages, figures out which ones are recent, but not in gzip format, and then gzips them (zlib binding).
<platypus> and u wrote that in ocaml ?
<CiscoKid> Oh, at work...I wrote a native CDB interface and a few utilities around it, along with an app that deals with all of our incoming manufacturing data (and data from our partners) and builds a big cdb with all of the information for all of the built devices we know about.
<platypus> all this in ocaml ?
<platypus> CiscoKid, umm one thing could u explain what is meant by unit() -> 'b -> 'b ?
<platypus> what is the diff btwn 'a and 'b ?
<platypus> 'a is the first value ?
<CiscoKid> Ooh, I've got this kick-ass backup thing I wrote. I pass my nightly DB dumps through it (about 2.2GB) and it chops them into blocks, md5s them, and compares them to the previous days' md5s to see if any blocks have changed. Any changed blocks get encrypted on the way to disk (via gpg). Anything that hasn't changed is hard linked as an individual block to the previous day's dumps. I basically get level 9 dumps with level 0 storage.
<CiscoKid> 'a and 'b are different types (but the types aren't specified, all you know about them is that they're different)
<CiscoKid> In fact, 'a and 'b may be the same type, but they don't have to be.
<CiscoKid> I'm pretty sure all of this is covered in that tutorial. It's very well written.
<CiscoKid> (even though it's from the perspective of a perl programmer).
<platypus> CiscoKid, do you do perl ?
<CiscoKid> I rather despise perl. I've had multi-million line perl codebases in the past. I threw it all away and haven't intentionally touched any since. I don't see the point.
<platypus> multi-million ? wow
<ayrnieu> I, by contrast, know and vague appreciate Perl (enough to find silly anti-Perl remarks annoying) -- I've just found it monumentally uninteresting for some time now.
<ayrnieu> also, vaguely.
<platypus> ayrnieu, ah u use erlang also ?
<ayrnieu> platypus - yes. Why do you ask?
<platypus> naw just saw u on #erlang
<platypus> and CiscoKid too :)
<CiscoKid> I can't imagine how anyone who has had to manage that much perl written by any number of developers would retain an appreciation for it.
ne1 has joined #ocaml
<ayrnieu> I've only ever had to manage what Perl I wrote myself. That probably helps.
<samx> perl has lots of advantages over ocaml.. like lots of 3rd party packages and actually a community that is alive :-)
<CiscoKid> Yeah. My last encounter with perl was helping a friend with a pretty bad bug in Digest::SHA1. It would give the incorrect answer if used incorrectly (as opposed to giving no answer). I had to explain to the author that the stuff he was saying you couldn't do could be done in a straightforward way).
<ne1> I prefer quality over quantity.
<Smerdyakov> samx, you say that in a channel with 47 people?
<samx> smerdy, yes
<Riastradh> ...#perl, by comparison, has six times that number...
<CiscoKid> I've rarely seen a perl program without a bug. The safety of ocaml is what really drew me in. By the time it compiles, it mostly runs.
<ayrnieu> and #perl, by comparison, has a huge community outside that number.
<ne1> There is no benefit in getting into the majority. Too much competition there.
<Smerdyakov> The average ML community member is much smarter than the average Perl community member.
<samx> smerdy, there is a difference between having some people on a channel, and having an active community that makes the language grow to be larger than it is.. but then again, ocaml dev team knowingly tries to kill any such community activity
<ayrnieu> Smerdyakov - an equivalent assertion to "Perl has more popularity than the average ML", AFAICT.
<CiscoKid> Kind of reminds me of a friend of mine who says he's going to learn C# when he gets out of college...apparently there's some appeal for people to learn the most diluted thing.
<ne1> The Law of Large Numbers assert that you cannot get both quantity and quality. Pick your poison.
<ayrnieu> samx - how do they knowingly try to do that?
<ne1> (I chose quality because I figured out how to work around the lack of quantity.)
<CiscoKid> I agree the ocaml team is really damaging the community by impeding the language growth. It seems like there are plenty of people wanting to fix up missing pieces of the language.
<ne1> (From the first day I put OS/2 on my computer, my fate had been determined.)
<samx> smerdy, i haven't seen any studies done on the smartnes of an average ml user versus an average perl user.. i'm sure an average ml user is much more knowledged about programming languages though
<CiscoKid> I wonder how many people have implemented Extlist.iteri :)
<ne1> What is Extlist?
<CiscoKid> Extra list stuff.
<Smerdyakov> There's a reasonable chance that Standard ML will grab almost all OCaml usage when MLton has a few more improvements made.
<samx> smerdy, ...and averages dont matter, because top 5% of best perl users are a LOT more people that the whole ml community :-)
<CiscoKid> My last company had over 100 perl programmers (I wasn't one of them). I had to fix all of their mistakes. I can assure you we had some of the bottom 5%. :) Having to explain to these people that stuff was processed in the order in which it appeared really lowered morale.
<ne1> Top 5% of Americans are a lot more people than IQ>150 people, too.
<samx> ne1, so, are uou implying that an average ml user has an IQ over 150?
<ne1> No, I am implying that the top 5% Americans are still very stupid.
* ayrnieu regrets contributing to this silliness, now.
<Riastradh> This whole argument is silly. That the average OCaml user is smarter than the average Perl user is a useless declaration; that Perl has sheer numbers is a useless declaration.
<Smerdyakov> ne1, as opposed to the top 5% of all people?
<ne1> But why am I arguing and letting you poke holes into my arguments? I should make you argue so I can poke holes into yours. If Perl is so nice, why is there no theorem prover written in it? Why is Perl not implemented in Perl itself?
<ayrnieu> ne1 - you don't poke holes in his argument, you make entirely new, unrelated arguments.
<ayrnieu> by which I mean 'questions'.
<samx> ne1, lets see.. perl is low on theorem provers, because perl is done by and for people who need to get small things done dirty, versus being done by theorists who have the luxery of not needing to get anything done on a timescale of under a couple of years, and not being forced to compromise
<ne1> Surely someone can get a small dirty theorem prover done?
<samx> ne1, and for perl not being implemented by perl.. because perl community doesnt care on the underlying implementation, but what the current implementation allows them to do
<ne1> not practising what one's preaching? even the C bigots know better.
<samx> ne1, surely. i'm sure you could go hack perl, and get a theorem prover done quick enough, in ocaml, perl, oz, erlang, whatever happens to melt your butter
<CiscoKid> I don't know, perl doesn't seem to make all that much easier for me. It certainly makes things harder to get right in my experience.
<ne1> But Perl is supposed to have the benefit of the Law of Large Numbers!
<ne1> There was a year during which I was thrilled about Perl. Then I found that I consistently wrote comments saying "this function takes parameters of type X and returns type Y". (I did that all the time with Lisp too.) After a while I got the point.
<samx> cisco, there's different level in programming language.. on a core language semantic level, surely ocaml is far stronger.. on a standard library, ocaml is surely much cleaner, but more limited.. on 3rd party extension level, ocaml totally dies against perl.. on an industry level.. ocaml?
<ayrnieu> ne1 - in what Lisp?
<ne1> On the industry level, perl is a toy and only sysadmins use it.
<CiscoKid> Industry's a bad metric. Personally, I've got deployed apps at my company in ocaml (more of mine are deployed in ocaml than perl or python). Industry mentality is the thing that has a lot of using java in inappropriate ways.
<samx> ne1, last i knew, sysadmins were a large stakeholder in the industry level
<ne1> Depends on which industry.
<ayrnieu> ne1 - in which Lisp did you write such comments all the time?
<ne1> Common Lisp.
<samx> cisco, noone is arguing about if industry choices are sane or not, but that they are important in the sense on being able to be employed using your language and being able to do business based on your language
<ayrnieu> ne1 - er, why didn't you just declare the types? Or do you mean that you always wrote comments on what your Lisp functions returned?
<CiscoKid> I'm trying to get our sysadmins off of perl. When they have a bug it keeps me from getting the data I need for reporting, or worse...they've deployed part of the wrong app before.
<ne1> sysadmins are worst when they are developers wannabe.
<platypus> CiscoKid, u got that right about java ... i bet if i wuz lookin' fer a job and i told them i knew ocaml vs java they wouldn't even bat an eyelid
<CiscoKid> The most successful programmer I've met to date was a smalltalk programmer. That's what frustrates me about the ``follow the industry'' crowd.
<ne1> I know of no Lisp that lets me declare types and checks them.
<CiscoKid> vs? Know both. erlang is *way* more suited to my group than java.
<platypus> CiscoKid, what do you define as 'successful' ?
<Riastradh> ne1, Common Lisp, and Python certainly performs static type analysis...
<Riastradh> (by Python I refer to the cmucl compiler)
<CiscoKid> Successful: Guy who works three months out of the year and just wanders around the rest.
<platypus> ah
<platypus> efficiency
<samx> cisco, i can tell you there are a lot more smalltalk programmers employed writing java, than smalltalk programmers employed writing smalltalk
<platypus> :)
<ne1> Last time I wrote in Lisp it was 10 years ago. Too late now.
<Riastradh> And, if I'm not mistaken, it was true with cmucl ten years ago.
<CiscoKid> Heh, that's the difference between being able to get a job and being able to get a good job. :)
<ne1> I had no cmucl.
<ayrnieu> ne1 - all Common Lisp systems allow you to declare types. I only know that the python (SBCL uses it as well) compiler makes extensive use of this information, though.
<CiscoKid> It's like I told my friend who said he was going to learn C# to get a job...``aim low.''
<Riastradh> 'Had no cmucl?'
<ayrnieu> ne1 - unfortunately, I think that Common Lisp systems used to treat type declarations as permission to do no type checking.
<ne1> There was not even a WWW 10 years ago. How was I supposed to hear about cmucl, if I were not in cmu?
<Riastradh> How were people supposed to year about UNIX if they weren't at Bell Labs...?
<ne1> Unix got sold and installed at every school. cmucl and ml didn't.
<Riastradh> I'm sure if you paid attention to relevant Lisp mailing lists or newsgroups you would have heard of cmucl.
<ne1> Why should I?
<Riastradh> Uh, because someone on such mailing lists or newsgroups would surely have mentioned it.
<ne1> Why should I care?
<Smerdyakov> ne1, you're at CMU now?
<ne1> No.
<Riastradh> ne1, uh, because you were writing Lisp code then.
<Smerdyakov> ne1, you were 10 years ago?
<samx> ...would've heard about cmucl, unless eric naggum ran them out before being able to listen long enough...
<ne1> Look, my school did not install it, my profs and TAs did not talk about it. End of story. Not my fault.
<Riastradh> It's not your fault you decided to be oblivious to the world outside your school?
<sundeep> Smerdyakov: why do you think mlton would take over ocaml?
<Smerdyakov> Responsiveness of the authors to the community
<sundeep> does it have an irc channel?
<ne1> You make it sound like every Windows user ought to read Windows newsgroups. Hilarious.
<Smerdyakov> No
<Smerdyakov> (Not that I know of, at any rate)
<CiscoKid> Hmm....mlton doesn't seem to support a lot of what I use.
<samx> smerdy, i've been on mlton mailing list for couple of years now, and i see mlton team respond to the community very quickly every time when the community sends their one or two montly emails to the list
<Riastradh> ne1, you make it sound like every Windows user ought to ignore every other Windows user. Equally hilarious.
<Riastradh> And every other OS while they're at it.
<Smerdyakov> samx, there is a very active (public) developers' list.
<Smerdyakov> CiscoKid, like?
<samx> smerdy, ahh.. i've been missing out
<ne1> I did not ignore every other Lisp user. I paid due attention to many Lisp users, namely my prof, my TA, and my classmates.
<CiscoKid> I've got deployed OCaml apps I rely on that are running native on OS X and SunOS 4.1.4.
<ne1> Look, do you know predicate logic?
<Riastradh> CiscoKid, native on OS X?
<CiscoKid> ocamlopt
<CiscoKid> runs like wind
<Riastradh> Er, wait, GUI apps?
<samx> smerdy, ..though i would not mind seeing mlton drive past ocaml.. the ocaml dev team is way too research oriented
<CiscoKid> No, no GUI apps.
<CiscoKid> Perhaps I should've said darwin. :)
<Riastradh> (sorry, the word 'GUI' mentally snuck into your message there, confusing me momentarily)
<ne1> Riastradh doesn't know basic predicate logic. He mixes up forall-not with not-forall.
<Smerdyakov> CiscoKid, this is why I said I think MLton can overtake OCaml, not that it is a dominating choice now.
<Smerdyakov> CiscoKid, you'll notice OS X on the MLton to-do list, for example. :)
<CiscoKid> Yeah, I'd like to fire it up, but it won't run on my computer right now, so I'll have to take your word for it. :)
<Smerdyakov> CiscoKid, AND it has a C back-end, which should work on OS X today.
<ayrnieu> Smerdyakov - GUI OS X? =)
<CiscoKid> I'll see what happens.
<Smerdyakov> ayrnieu, why not?
<CiscoKid> Heh, well, the LaTeX docs almost built.
kinners has quit ["leaving"]
<ne1> How do you write the type declaration "f : [(int,int,bool)] -> ((int,int),(int,int)) -> [(int,int,bool)]" in Lisp?
<ne1> I probably mean int*int*bool list -> (int*int)*(int*int) -> int*int*bool list
wmg has joined #ocaml
samx has left #ocaml []
<platypus> the type 'ref' means reference ?
<CiscoKid> A reference has to be a reference of something, much like a list has to be a list of something.
wmg has left #ocaml []
sundeep has quit ["Client exiting"]
sundeep has joined #ocaml
sundeep has quit [Client Quit]
sundeep has joined #ocaml
sundeep has quit ["Client exiting"]
sundeep has joined #ocaml
sundeep has quit [Client Quit]
sundeep has joined #ocaml
vezenchio has quit ["look at you, hacker, a pathetic creature of meat and bone, panting and sweating as you run through my corridors; how can you ]
ayrnieu has quit ["system"]
ayrnieu has joined #ocaml
sundeep has quit [Client Quit]
<CiscoKid> Tail recursion's covered very well here: http://www.merjis.com/developers/ocaml_tutorial/ch11/
<CiscoKid> Man, this is a very well written document.
Riastradh has quit [Remote closed the connection]
Riastradh has joined #ocaml
sundeep has joined #ocaml
fab__ has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
<platypus> CiscoKid, yeah it goes very indepth
ne1 has quit ["To understand recursion, you must first understand recursion."]
IRCMonkey has joined #ocaml
IRCMonkey has left #ocaml []
polarType has quit [Read error: 60 (Operation timed out)]
<skaller> is anyone here alive ..?
<CiscoKid> I'm a little alive.
<skaller> 40 ppl on list and 2 alives ones :)
<skaller> i'm looking for ppl interested in wrapper generator
<fab__> what kind of?
<skaller> my current program scans all /usr/include and makes FFI
<skaller> FFI is currently generated for Felix not Ocaml ..
<CiscoKid> That sounds incredibly cool.
<CiscoKid> I've not played with felix.
<skaller> so i see: common front end, shared annotation file, and hookable back end
<skaller> back end can be Felix, Ocaml, and perhaps other targets .. eg documentation
<fab__> yes, scanning /usr/include would be cool, but the generated wrappers wont be very "pretty"
kosmikus|away is now known as kosmikus
<skaller> / /usr/include/stdio.h
<skaller> /Raw Input file: config/usr_include.hhh
<skaller> /Generated by Felix Version 1.0.7
<skaller> /Timestamp: 2004/5/20 22:32:3 UTC
<skaller> /Timestamp: 2004/5/21 8:32:3 (local)
<skaller> include 'std';
<skaller> header '#include "/usr/include/stdio.h"';
<skaller> /INCLUDES
<skaller> include "_G_config_lib";
<skaller> include "features_lib";
<skaller> include "getopt_lib";
<skaller> include "libio_lib";
<skaller> include "stdarg_lib";
<skaller> include "stddef_lib";
<skaller> include "sys_types_lib";
<skaller> module stdio_h
<skaller> {
<skaller> open C_hack;
<skaller> open _G_config_h;
<skaller> open features_h;
<skaller> open getopt_h;
<skaller> open libio_h;
<skaller> open stdarg_h;
<skaller> open stddef_h;
<skaller> open sys_types_h;
<skaller>
<skaller> //EXTERNALLY COMPLETED TYPES
<skaller> //type _struct__IO_FILE defined in libio='/usr/include/libio.h';
<skaller>
<skaller> //TYPES WE CAN'T FIND
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller> //type size_t ??
<skaller>
<skaller> //STRUCT or UNION ALIASES
<skaller> typedef FILE = _struct__IO_FILE;
<skaller> typedef __FILE = _struct__IO_FILE;
<skaller>
<skaller> //TYPE ALIASES
<skaller> typedef fpos_t = _G_fpos_t;
<skaller>
<skaller> //VARIABLES
<skaller> const stdout: ptr[_struct__IO_FILE] = 'stdout';
<skaller> const stderr: ptr[_struct__IO_FILE] = 'stderr';
<skaller> const stdin: ptr[_struct__IO_FILE] = 'stdin';
<skaller> const sys_nerr: int = 'sys_nerr';
<skaller> const sys_errlist: cptr[cptr[char]] = 'sys_errlist';
<skaller>
<skaller> //PROCEDURES
<skaller> proc clearerr: ptr[FILE] = 'clearerr($a);';
<skaller> proc perror: cptr[char] = 'perror($a);';
<skaller> proc setlinebuf: ptr[FILE] = 'setlinebuf($a);';
<skaller> proc flockfile: ptr[FILE] = 'flockfile($a);';
<skaller> proc rewind: ptr[FILE] = 'rewind($a);';
<skaller> proc setbuf: ptr[FILE] * ptr[char] = 'setbuf($a);';
<skaller> proc clearerr_unlocked: ptr[FILE] = 'clearerr_unlocked($a);';
<skaller> proc setbuffer: ptr[FILE] * ptr[char] * size = 'setbuffer($a);';
<skaller> proc funlockfile: ptr[FILE] = 'funlockfile($a);';
<skaller>
<skaller> //FUNCTIONS
<skaller> fun puts: cptr[char] -> int = 'puts($a)';
<skaller> fun sscanf[t]: t -> int = 'sscanf($a)';
<skaller> fun putw: int * ptr[FILE] -> int = 'putw($a)';
<skaller> fun gets: ptr[char] ->
<skaller> that's the top of the Felix one for stdio.h
<skaller> It seems easy to make an Ocaml equivalent
<skaller> just need an *.mli file instead plus a C wrapper for the RHS parts in quotes
gim has joined #ocaml
<fab__> what does the generator do with things like enums or #defined flags or'ed together in a call to open?
platypus_ has quit [Read error: 54 (Connection reset by peer)]
<skaller> enums are ints
<skaller> macros are not visible at the moment
<skaller> to use it at the moment you have to produce a preprocessed C file
<skaller> so all the macros are gone
<skaller> that could be fixed if i had a C preprocessor written in Ocaml
Snark has joined #ocaml
<skaller> or just cheat, and scan the files for all #defines, which i what i will do first
<Snark> slt
<skaller> 270 headers processed at the moment
<fab__> what i meant is, you cant see from the header files, what the #defined constants are for, only from additional documentation. a hand crafted wrapper would allow the flags only at the right places
<skaller> indeed
<skaller> that applies to lots of things
<skaller> which functions are real?
<skaller> which structure members really need accessors?
<fab__> yes
<skaller> which enums are enumerations and which are bitstrings?
<platypus> is there a date module for ocaml ?
fab__ is now known as _fab
<skaller> at present flxcc is just a single program built as part of Felix
<skaller> there is no clean division between the front and back end
<skaller> there are global constants
<skaller> it doesn't work properly yet either -- the front end is MUCH harder
<skaller> the basic idea is that the lowest possible level wrapper is the best to start with
<skaller> so no typemaps
<skaller> it is actually possible to make very good guesses about intent
<_fab> maybe the could be some kind of "hint language" for flxcc, which lets it restrict the generated wrapper
<skaller> yeah, there is a crude one
<skaller> i'm moving all the hard coded hacks into it :)
shammah has quit ["Leaving"]
<_fab> where can i find information about flxcc?
<skaller> the source code?
<skaller> there is a cursorary explanation on the web
<skaller> argg .. redhat 9 .. so badly built ..
<platypus> skaller, ah i agree !!
<skaller> damn
<skaller> i have to kill my X server to fix up stupid GTK crap .. back in a second
<skaller> how can those morons designed such garbage
<skaller> I would execute them for deliberate fraud
<skaller> designing a new system like gtk which isn't reentrant should be capital offense
<skaller> brb
skaller has quit ["Client Exiting"]
skaller has joined #ocaml
<skaller> hmm
<skaller> this is just some notes
<skaller> since I'm working on it 24/7 things are changing quite fast .. :)
<Snark> skaller, _fab: are you working on a automatic ocaml wrapper generator?
<_fab> i'm not
<_fab> just find the idea interesting, could save a lot of work if it generates good interfaces
<skaller> i'm working on an automatic wrapper generator
<skaller> at present, there are two logically distinct semantics:
<skaller> scanning the inputs and generating outputs
<skaller> but the code is all mixed up together
<skaller> in a single program
<skaller> and the program only generates *Felix* wrappers
<Snark> skaller: you may be interested in EWG, then
<skaller> not Ocaml ones
<Snark> EWG stands for Eiffel Wrapper Generator
<skaller> EWG?
<skaller> i used SWIG before
<Snark> they have the same problems as you, I think: wrapping C code in a type-strict language
<skaller> SWIG also handles C++
<skaller> there are two distinct problems really:
<skaller> (1) input automation
<skaller> (2) type mapping -- stub function generation
<skaller> (1) basically means 'making sense of C headers'
<skaller> (2) basically requires two things:
<skaller> (a) some smart heuristics
<skaller> (b) annotations
<skaller> At present, my main concern is (1)
<skaller> My solution to (2) for Ocaml would be: in the first instance NO TYPEMAPS
<skaller> so a generated FFI is simply isomorphic to the underlying C
<skaller> that can be done completely reliably I think
<skaller> provided the front end works properly
<skaller> for example: malloc works like:
<skaller> extern malloc: c_int -> c_address
<skaller> you cannot call this malloc with an Ocaml int
<skaller> you must use a C int
<skaller> you get back a C pointer
<skaller> which is an abstract type
<skaller> to make pointers work for Ocaml we need:
<skaller> type 'a ptr
<skaller> and
<skaller> type 'a const_ptr
<skaller> so if you see this function:
<skaller> extern strcpy: c_char ptr * c_char ptr -> c_char ptr
<skaller> you CANNOT call it with an Ocaml string
<skaller> you have to use C char *
<skaller> so there is no typing problem
<skaller> the low level FFI doesn't interact with Ocaml types at all
<skaller> if you want it to do so you can use some library functions:
<Snark> still, it would be nice if at some point the wrapped library becomes usable ;-)
<skaller> it is usable, just clumbsy
<skaller> for example: strcpy(target, c_ptr_of_string ("Blah"))
<skaller> where c_ptr_of_string provides the type conversion
<skaller> given such conversions, you can always hand write a higher level wrapper
<skaller> once you know how to do that, we can add automation to the generator
<_fab> but then you have to handwrite the wrapper again...
<skaller> yes, in the first instance
<skaller> but the low level wrapper does do one important thing:
<skaller> it provides a *guarranteed* isomorphism
<skaller> you call C from Ocaml *exactly* as if you were writing C
<skaller> so you know *exactly* what happens in terms of semantics, memory management, performance, etc
<skaller> I agree this is not enough
<_fab> and you are finally able to get segfaults in ocaml ;)
<skaller> so we can add heuristics and annotations
<skaller> indeed, you are promised to get segfaults !
<_fab> what ideas do you have for the heuristics?
<skaller> there is an obvious correspondence between C int32_t and Ocaml int32 for example
<skaller> and Ocaml guarrantees that's an isomorphism
<skaller> same for C double and Ocaml float
<skaller> all C enums can be considered ints
<skaller> strings are harder of course ..
<skaller> the low level wrapper will work 'for sure' because C only allows pass by value
<skaller> but when you lift 'char *' to string you break the isomorphism
<skaller> so one will probably need annotations to tell which char* are input strings, for example
<skaller> as in IDL or Swig annotations
<skaller> however note that the low level wrappers don't have a problem with that
<skaller> since you can manually call the conversions in Ocaml code
<skaller> that is less reliable in the sense that you can call the wrong one (and segfault)
<skaller> but hey, being able to call every C function on you system *at all* is a major step forward isn't it?
<_fab> yes it would be great
<skaller> 90% of the hard work at the moment is done by frontc/Cil
<skaller> it does all the parsing and half the 'cleaning up' of the C code
<skaller> parses all of gtk for example .. :)
<skaller> and it's reputed to handle MSVC source as well
<skaller> knows about both GNU and Microsoft language extensions
<_fab> is flexcc written in ocaml or felix?
<skaller> ocaml
<_fab> err, flxcc
<skaller> one day i may rewrite the Felix compiler in Felix ..
<skaller> booting is fun :)
<skaller> but for the moment I use Ocaml and Python and a couple of bash scripts to do almost everything
<skaller> and the bash scripts probably have to go
<skaller> since they will not work on native Windows
<skaller> .. and don't work half the time on Unix either :))
<_fab> what do you use the shell scripts for?
<skaller> oh, for example I run man2html and some sed scripts to make nice Html versions of man pages
<skaller> also the scripting harnes for Felix is a bash script
<skaller> it just grabs some command line options and does some nice things
<skaller> like choose between dlopen linkage and static linkage based on a single option
<skaller> I also do silly things like copy files inside the Python build script like this:
<skaller> os.system('cp inp out')
<skaller> which actually calls 'sh' not bash :)
<skaller> obviously that won't work on Windows .. :)
<_fab> did you design the complete language felix?
<_fab> i am reading the tutorial right now..
<skaller> well, I stole many ideas from Ocaml :)
<skaller> I was a member is ISO/IEC SC22/WG21 for 15 years or so
<skaller> thats the 'C++ Standardisation Committee' :)
<skaller> Felix is something like "What C++ should have been"
<skaller> and something like:
<skaller> "What you should use to replace Java"
<skaller> The idea is retain C/C++ compatibility
<skaller> but provide a migration path to FP
<_fab> i havent read very much, but it looks like a very nice language...
<skaller> you can always try a download :)
<_fab> but why did you include a preprocessor?
<skaller> the tarball isn't very big
<_fab> yes, i will definitly try it out
<skaller> the preprocessor is needed to provide conditional compilation and include files
<skaller> note it is NOT a C preprocessor
<skaller> There are actuall TWO preprocessors
<skaller> well, i mean there is a *preprocessor* and a *syntax macro processor*
<skaller> the preprocessor is very strict
<skaller> NO MACROS
<skaller> i mean, preprocessor macros ONLY expand in preprocessor statements
<skaller> they have no effect at all on source text
<skaller> also, preprocessing is fully scoped by file boundaries
<skaller> so by default macros cannot either be exported to the containing file NOR imported from th containing file
<_fab> so the conditional compilation is a high level construct and does not modify the source text?
<skaller> ie: the macros lexically visible in your text editor are the only ones that exist
<skaller> ones in other files don't do anything to the current file
<skaller> exception: there is an #import directive
<_fab> yes, thats a nice restriction, which allows precompiled headers i suppose?
<skaller> there are precompiled headers
<skaller> but they're NOT handled at the preprocessing level
<skaller> there is a separate statement 'include "fred";'
<skaller> for including code
<_fab> what is the difference between include and #import?
<skaller> this is not the same as #include "fred"
<skaller> #include is line by line inclusion
<skaller> like in C
<skaller> include literally parses the include file recursively
<skaller> again with total isolation between files
<skaller> #include is a hack :)
<skaller> #import is like #include except that it yanks the macros out of the file
<skaller> so you can use it to write files of common macros
<skaller> for example config.h style macros to share around configuration data
<skaller> heh .. I actually have this as well:
<skaller> #divert unix
<skaller> ...
<skaller> #undivert unix
<skaller> same as M4 diversions
<_fab> ok, but i dont understand how preprocessing has no effect on source text then? it replaces strings in the source file, doesn't it?
<skaller> yeah: each line is either included or not
<_fab> i don't know M4, what does #divert do?
<skaller> if the line is included it is included 'as is'
<skaller> includes: so, #define can't modify a line
<skaller> except to set it to itself or to null :)
<skaller> also of course #include is replaced by a list of lines .. :)
<skaller> ..
<skaller> divert changes the output to go to a named location
<skaller> undivert then injects all the output from a named location 'right now'
<skaller> so you can use it to reorder lines in your file
<_fab> why would i want to do this?
<skaller> good question :)
<skaller> one thing you might do is generate an interface for 6 platforms
<skaller> #divert unix
<skaller> unix stuff here ......
<skaller> #divert windows
kosmikus is now known as kosmikus|away
<skaller> windows stuff here ...
<skaller> and then you say:
<skaller> #ifdef _UNIX
<skaller> #undivert unix
<skaller> #elif defined(_WINDOWS)
<skaller> #undivert windows
<skaller> #endif
<skaller> [hmm .. need #elifdef and #elifndef .. :]
dobrek_ has joined #ocaml
<_fab> hhm, so it would keep the conditional statement small, instead of including the source between ifdef and endif
<skaller> that is, you can first *unconditionally* generate some headers for different platforms
<skaller> then choose the one you want
<skaller> instead of threading the conditionals throughout a single piece of code
<skaller> whether this is useful I don't know
<skaller> m4 people seem to like it :)
<_fab> i thing it is confusing... maybe better then goto, but you could write nice spaghetti code with it
<skaller> yes
<skaller> but sometimes you need to
<skaller> Felix tries to make it possible to avoid that kind of thing
<skaller> but I can't afford to end up like Ocaml
<skaller> where you CANNOT do conditional compilation
<skaller> the fact is sometimes you need to
<skaller> especially in a language like Felix *designed* to work with C/C++
dobrek has quit [Read error: 60 (Operation timed out)]
Hipo has joined #ocaml
<skaller> link to source code of flxcc (browsable)
<skaller> sorry this is a VERY large file ..
<_fab> wow, does it parse usr_include.h.default? it must be huge after preprocessing...
<skaller> yes
<skaller> -rw-rw-r-- 1 skaller skaller 1050603 May 21 17:23 usr_include.hhh
<skaller> only 1 meg
<skaller> that's after preprocessing
<_fab> but how does it seperate it into modules? you can't call most things without linking to some library
<skaller> the h file is run through gcc -E to make the hhh file
<skaller> by default, each include file is a module
platypus_ has joined #ocaml
<skaller> however the control file can merge definitions from one file into another
<skaller> merge /usr/include/bits/sigset.h /usr/include/signal.h
<skaller> merge /usr/include/bits/sigaction.h /usr/include/signal.h
<_fab> do you use the "# lineno filename" lines after preprocessing for seperation into modules?
<skaller> yeah partly
<skaller> the parser tracks the location of every definition
<skaller> it outputs a list of definitions
<skaller> each one is a typedef, function, or whatever
CiscoKid has quit ["'night everyone"]
<skaller> so i just make a hashtable of definitions keyed by the filename it came from :)
<skaller> and provide a 'merge' statement in the control file to cheat
<skaller> by remapping some filenames into other
<skaller> this is NOT ENOUGH
<_fab> what is the advantage of processing all files together instead of the files required for each library
<_fab> ?
<skaller> well, if you use the C preprocessor, you know for sure that provided the header files
<skaller> are actually sane ...
<skaller> you will get closure
<skaller> every type used will actually be defines
<skaller> er .. 'defined'
<skaller> however, it would be nice to do it incrementally
<skaller> the problem is that C doesn't
<skaller> and C programmers, being hackers, use every stupid preprocessing trick in the book
<skaller> so you *could* just do the input processing and only write certain things out
<skaller> but then you'd be generating dependencies on things that might not exist
<skaller> or might be different to what you think
<skaller> SWIG can do this
<skaller> but .. have a look at math.h on your system :)
<skaller> hmm .. :)
<skaller> ..
__DL__ has joined #ocaml
<skaller> another answer to your question is 'aliasing'
<skaller> if C says "typedef X Y" then X and Y can both be used in a function prototype
<skaller> in the target language, we need ONE abstract type and a type alias
<skaller> not two abstract types
<_fab> yes, in math.h the preprocessor is used a lot... imho a language should make the preprocessor superfluous by providing language constructs
<skaller> I agree
<skaller> Felix tries
<skaller> the constant folder can already fold conditionals over constant expression
<_fab> maybe even conditional compilation could be solved this way
<skaller> see last comment
<skaller> but it isn't enough
<skaller> you can write this in Felix:
<skaller> val x = if 1 then 1 else fred endif;
<skaller> woops, actually this:
<skaller> val x = if true then 1 else fred endif;
<skaller> notice 'fred' is undefined
<skaller> no problem
<skaller> the constant folder rewrites the term to be
<skaller> val x = 1;
<skaller> so when it comes to binding and typing, 'fred' isn't there to mess it up
<skaller> so you can do 'well structured conditional compilation'
<skaller> without using the preprocessor
<skaller> but of course the arguments of the conditional must be syntactically properly formed expressions ..
<skaller> they cannot be *definitions*
<skaller> and they can't be arbitrary code fragments
<skaller> this *reduces* the need for a preprocessor but it doesn't eliminate it
<_fab> hhm, but doesnt it solve conditional compilation without #ifdef? or are there some cases where it doesn't work?
<skaller> it won't handle definitions
<skaller> for example:
<skaller> #ifdef UNIX
<skaller> fun dlopen : string -> library = "dlopen($1)";
<skaller> #elifdef WINDOWS
<skaller> fun dlopen : string -> library = "load_library($1)';
<skaller> #endif
<skaller> I can't use a conditional expression here, because the arguments are *statements*
<skaller> not expressions ..
<_fab> ok
<skaller> A possible workaround ....
<skaller> if WINDOWS goto windows;
<skaller> fun dlopen ....
<skaller> goto done_dlopen;
<skaller> windows:>
<skaller> fun dlopen ...
<skaller> done_dlopen:>;
<skaller> this is executable code in theory
<skaller> even though it happens to jump around definitions
<skaller> so I *could* make the compiler execute it
<skaller> right now I can do this using the syntax macro processor
<skaller> macro if WINDOWS goto windows
<skaller> fun dlopen ...
<skaller> macro goto done_dlopen;
<skaller> ....
<skaller> the syntax macro processor is Turing complete -- it has a goto
<skaller> syntax macros respect scopes
<_fab> so you never know if a compilation will finish ;)
<skaller> they manipulate parts of the already parsed parse tree, not strings
<skaller> there is an execution limit :)
<skaller> it was 10,000 lines
<skaller> heh .. but some of the flxcc generate interfaces were longer than that
<skaller> and it broke the compiler so i had to increase it to 100,000 lines :)
<skaller> BTW: the idea with Felix is to provide TWO levels of abstraction:
<skaller> (a) allow the programmer to nuke himself
<skaller> (b) try to stop the programming tripping over on a banana skin
<skaller> So for example: an Academic Teacher can prepare a system for students
<skaller> by binding some nice C libraries
<skaller> and then turn off the ability to make bindings
<skaller> so the Student is locked into only using high level stuff
<_fab> how can he do this?
<skaller> the simplest dirty way is to add a pragma that makes certain words not keywords
<skaller> for example if I make 'goto' no longer a keyword, you can't parse goto statements :)
<_fab> hhm, what more "cleaner" ways have you in mind?
<skaller> since the lexer uses a table of keywords this can be done easily
<skaller> I have advertised on sourceforge for a Security Guru to assist in designing that
<skaller> one also wants to restricy execution environments, for example for an Apache module
<skaller> eg: stop 'open(f,"w")' working: don't allow any way to open files to write
<skaller> so the answer to your question is: I don't know
<skaller> felix is potentially highly secure
<_fab> i started porting a subset of prevayler to ocaml, it would be very useful there if you could restrict the user of the library in which ways he can access data structures
<skaller> what's prevayler?
<_fab> prevayler is some kind of in memory database using snapshots and logs
<skaller> ok
<_fab> but the coder has to define the transactions himself and make sure they are deterministic etc.
<skaller> checkpoint/restart model ..
<_fab> yes
<skaller> the oldest and simplest
<skaller> if you're wrapping by hand you can always use functional abstraction
<skaller> that's the idea behind Felix binding technology
<_fab> what do you mean by functional abstraction? at least in ocaml there is no way i am aware of to restrict side-effects
<skaller> make each data type abstract
<skaller> and then provide accessors
<skaller> ah
<skaller> yeah, that's a design problem in Ocaml
<_fab> the data types are defined by the user of the library himself... so i can't restrict him
<skaller> how does the user define them?
<skaller> directly in Ocaml?
<_fab> yes, using a functorial interface
<skaller> ah, so not 'directy'
<skaller> yu have data type constructors
<_fab> yes
<_fab> well, if i understand you correctly...
<skaller> so there are some constraints on what the user can build ..
<skaller> but they're just those enforced by Ocaml static typing
<_fab> it uses a functor and an input signature
<skaller> yeah
<_fab> but the input signature contains a function, which the module calls, and i cant express that this function must be purely functional
<_fab> or at least deterministic
<skaller> sure you can -- in the documentation :)
<skaller> what you mean is you can't make the Ocam compiler enforce that constraint
<skaller> :(
<_fab> yes
<skaller> Felix enforces it
<skaller> functions can't have side effects
<_fab> i thought felix is imperative?
<skaller> It has procedures as well as functions :(
<skaller> procedures can have side effects
<skaller> i mean, they MUST have side effects or they're useless :)
<_fab> can procedures have return values?
<skaller> no
<_fab> ok
<skaller> the result is a bit clumbsy to use though
<skaller> syntactically
<_fab> why?
<skaller> var result: int;
mattam has quit [Read error: 60 (Operation timed out)]
<skaller> operation(&result, other_data);
<skaller> you have to make a variable to hold outputs
<skaller> it can't even be a value
<skaller> Felix has vars and vals:
<skaller> val x = 1; // immutable
<skaller> var x = 1; // mutable
<skaller> obviously val's a better :)
<_fab> :)
<skaller> vals can't be addressed
<skaller> so they're subject to heavy optimisation :)
<skaller> var's don't need to be initialised ..
<skaller> so they're subject to core dumpings and worse .. :(
<_fab> so felix is able to segfault without interfacing c?
<_fab> does it use automatic memory management?
<skaller> Ocaml can infinitely recurse too?
<skaller> Yeah, Felix has a garbage collectr
<skaller> Functions are called like in C: using the machine stack
<skaller> Procedures use continuation passing
<_fab> what is continuation passing?
<skaller> oh, a procedure is a C++ class with a 'resume()' method
<skaller> to execute a procedure you do this in C++:
<skaller> while(p) p=p->resume();
<skaller> each 'resume()' call does a bit of the procedure and then yields
<skaller> the reason is control inversion ..
<skaller> there is a primitive 'read x'
<skaller> this gets the next event from the input queue
<skaller> it does that by yielding control to the driver
<skaller> the stack has to be empty when you yield control
<skaller> Felix is a procedural language designed to implement ultra lightweight threads.
<skaller> ....
<_fab> what is exactly meant by "ultra lightweigt"?
<_fab> no kernel threads?
<skaller> yup
<skaller> no premption
<skaller> uggg .. preemption
<skaller> you write ordinary code that 'read event;'
<skaller> you can read events in deeply nested parts of the program
<skaller> you can have millions of threads doing this
<skaller> without blocking
<skaller> because actually the code is control inverted
<skaller> and is event driven
<skaller> so you can switch between 1 million threads in O(1) time
<skaller> For example Felix was actually designed to manage telephony services
<_fab> i think i have to learn some felix first... else the only thing i say will be "what is" questions ;)
karryall has joined #ocaml
<skaller> we're talking 600 phone calls per second lasting say 3 minutes
<skaller> i think that's around 100K threads needed
<skaller> most of the thread do nothing
<skaller> they just wait for the 'I'm hanging up now' signal
<skaller> but sometimes they have to do database lookups
<skaller> which has to be asynchronous == event driven
<_fab> but you can implement events and something like "read events" in most languages, or how does felix support this model?
<skaller> built-in sugar for it
<skaller> you just try to do it in C .. :)
<skaller> without using setjump/longjump
<skaller> I will save you the trouble .. to do it, just examine the output of Felix
<skaller> that's C++ code that does it
<skaller> you will soon agree it isn't a good idea to do it by hand :)
<skaller> If you use setjump/longjump yu can do it in C
<skaller> but the problem is Unix is a stupid brain dead OS
<skaller> it has no idea what stack frames are
<skaller> and only supports moronic tiny address spaces
<_fab> i never used setjump longjump...
<skaller> so if you need 1 million threads you need 1 million stacks
<skaller> and if you use C functions to swap stacks about
<_fab> yes
<_fab> would be very slow
<skaller> nah, its not slow
<skaller> the problem is 1 million stacks of what size???
<skaller> each stack needs to be a few meag
<skaller> because these stacks cannot be extended in size
<skaller> so you have to allocate a huge address space for each one ..
<skaller> 64 bits is WAY too small
<skaller> forget 32 bit machines ..
<skaller> So in Felix, I just use malloced stack frames chained together with pointers
<_fab> and how is it solved using setjump and longjump?
<skaller> oh, with setjump and longjump you write some assembler to fiddle the jumpbuf
<skaller> to modify the stack pointer
<skaller> then you use malloced memory for stacks
<skaller> or some equivalent hack :)
<skaller> this does not work in C++ though
<skaller> because of exception handling ..
<skaller> Note: the Kernel does *exacty* this for switching thread/processes
<skaller> it swaps stacks around
<skaller> itr can manage address space efficiently using Virtual Memory
<skaller> but it cannot switch fast enough
<skaller> because Unix has a really bad interrupt architecture
<skaller> based on signals ..
<skaller> unix scheduler has to deal with very complex conditions to decide which process to run
<skaller> at best, it would be O(n) scheduling time
<skaller> Linux is much worse :((((((
<Hipo> What would you prefer?
<skaller> User threading can schedule in O(1)
<skaller> because it deals only with simplified conditions
<skaller> prefer?
<Hipo> Mm... What would be better system than unix?
<_fab> what other kinds of interrupt achitecure exist that don't use signals?
<skaller> There are real time Linux kernels
<skaller> You can also have priority levels
<skaller> Linux doesn't
<Hipo> There is 'nice'? :)
<skaller> its just an extremely archaic time sharing system + some hacks :)
<skaller> really good for batch processing
<skaller> example: in Win32, the mouse has a higher priorty
<skaller> in Linux it doesn't
<skaller> so: when i have a rogue process on Linux running X .. I have to reboot
<skaller> so my Linux box crashes heaps more than my Windows box
<skaller> I can't kill the rogue process because the stupid mouse won't move
<skaller> because linux is too brain dead to give the mouse a suitable priority
<skaller> At least in windows the mouse ALWAYS moves
<_fab> i heard that linux 2.6 can distinguish between interactive processes and non-interactive processes
<skaller> because the motion is programmed directly in the device driver on the interrupt
<skaller> yeah .. linux IS getting better
<skaller> but the design was never intended to support real-time operations
<skaller> the worse problem is TCP/IP
<skaller> in Linux, its in the kernel
<skaller> because the OS itself is too brain dead to schedule it
<skaller> in Solaris it runs separately
<skaller> AFAIK :)
<skaller> same in windows
<skaller> Windows kernel doesn't know anything about networking
<skaller> Linux is of course very fast at networking because the kernel does do the TCP/IP
may has joined #ocaml
mattam has joined #ocaml
Boojum has joined #ocaml
Snark has quit [Nick collision from services.]
Boojum is now known as Snark
<may> question about static semantic of system F :
<may> T C (included in) TheTypeContext ; ForAll alpha.U => e[T] : U [ T / Alpha]
<may> I know its about specialisation, but im not sure about the exact meaning of U
<may> because its syntax seems to infer that it is a type
<may> and the meaning of the semantic seems to infer that it is an expression abstracted to its type
<may> anyone can confirm / infirm ?
<may> Im sure there is someone aware of system F around
<may> ;)
Shammah has joined #ocaml
cjohnson has quit [Read error: 60 (Operation timed out)]
vezenchio has joined #ocaml
gwe3`wats has joined #ocaml
vezenchio has quit [Client Quit]
cjohnson has joined #ocaml
Submarine has joined #ocaml
gwe3`wats is now known as vezenchio
slashvar[lri] is now known as slashvar[ejcp]
mmc has quit [Read error: 60 (Operation timed out)]
<platypus_> how do i get Unix.times ?
<platypus_> i try that and i get : Reference to undefined global `Unix'
<Submarine> Compile with -custom
<platypus_> Submarine, thanks
mmc has joined #ocaml
<platypus_> Unknown option "-custom".
<platypus_> is that a problem ?
<Submarine> ocamlc -custom foo.ml -o foo
<Submarine> If this is for the ocaml toplevel: generate another toplevel with ocamlmktop -custom unix.cma -o toplevel
<platypus_> Submarine, is there anywhere i can read about this ?
sproctor has joined #ocaml
sproctor has left #ocaml []
<Submarine> The OCaml documentation!
<platypus_> hehe thanks mate
<platypus_> Submarine, u use ocaml at work ?
<Submarine> Yes I do.
<platypus_> Submarine, what kind of scripts do you do with it
<platypus_> Submarine, i am looking to do a log rotator with it
<Submarine> No scripts.
<Submarine> www.astree.ens.fr is what I do at work. :-)
<platypus_> wow
<platypus_> so you do full ocaml programs :)
<platypus_> ummm just curious ... why ocaml ?
Risk has joined #ocaml
Risk has left #ocaml []
<Submarine> platypus: Which other language do you suggest?
<Submarine> C is out of the question, we cannot afford to spend time chasing pointers; besides the code size would probably be multiplied by 10.
<Submarine> Java is slow and limited.
<Submarine> C++ is very complex, but except if we coded in very strict style using the STL we'd have the same problems as with C.
<mellum> Submarine: but if you wrote it in C, it could prove its own correctness ;)
<Submarine> No, because we handle only a subset of C. :-)
<Submarine> And we don't prove correctness, only absence of RTE.
<platypus_> hmmm
<mellum> Not to mention it's pretty easy to write a program that successfully verifies its own correctnes :)
<platypus_> is ocaml in the haskell family ?
<mellum> platypus: no
<Submarine> No. Haskell is lazy, OCaml is eager.
<platypus_> Submarine, =)
<platypus_> but both belong to the functional programming languages family ?
<Submarine> Yes.
<Submarine> Strongly typed functional languages.
<Submarine> As opposed to Lisp and variants.
<vegai> though Haskell can be eager and ocaml can be lazy =)
<Submarine> Yes, but fundamentally OCaml is designed for eager evaluation and has no big, efficient support for lazy computations.
sproctor has joined #ocaml
sproctor has left #ocaml []
sproctor has joined #ocaml
sproctor has left #ocaml []
<vegai> Submarine: what do you mean by efficient?
<Submarine> I mean, OCaml has no builtin hash-consing and other similar facilities for avoiding recomputations.
<vegai> aye
ne1 has joined #ocaml
CiscoKid has joined #ocaml
karryall has quit ["go"]
malc_ has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
gzl has joined #ocaml
malc_ has quit ["leaving"]
<Riastradh> _Statically_ typed, Submarine.
<Snark> when I think xchat highlights Submarine in blue...
<Submarine> Riastradh: Staticall and strongly.
<Snark> yellow would be so much more appropriate
may has quit ["Fermeture du client"]
Snark has quit ["Parti"]
tyler has joined #ocaml
platypus has quit [Nick collision from services.]
[1]platypus has joined #ocaml
Snark has joined #ocaml
Snark has quit ["Parti"]
vezenchio has quit ["look at you, hacker, a pathetic creature of meat and bone, panting and sweating as you run through my corridors; how can you c"]
Submarine has left #ocaml []
noss has joined #ocaml
gim has quit []
__DL__ has quit ["Bye Bye"]
nidos has joined #ocaml
<nidos> hallo