<urz>
i get a segfault associated with garbage collection.. i'm passing a channel to ocaml and teh ocaml code is not useing it..
<urz>
it happens in an oldify_local_nodes function
<urz>
or something like that
<urz>
would the ocaml code try to close the file? and if it did, could that really lead to a segfault?
<urz>
not ocaml code, i mean garbage collection code
<mattam>
nope, files used to be closed during finalization, but i believe not anymore
<urz>
well any idea on what oldify means and what kind of error could make it segfault?
<mattam>
this should not lead to a segfault anyway
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
GreyLensman has quit ["Leaving"]
<mattam>
if you're passing some malformed data to ocaml
<mattam>
oldify probably means classify for the second pass of garbage collection
<urz>
hm
<urz>
is that definately it? malformed data?
<urz>
heh
<mattam>
i'm no expert at this :)
<urz>
should i use dup on the file descripter before i turn it into a channel and pass it back?
<urz>
the c routine actually wants to call a callback with a FILE* and i'm using fileno to turn it into a file descripter and then a function in the caml source to convert it into a channel and then returning it
<urz>
c = alloc_channel(open_descriptor_in(fd));
<mattam>
maybe there's some error you're missing ? can't open_desc_in fail for example ?
gim has quit []
<urz>
i could jsut use this function:
<urz>
CAMLprim value caml_open_descriptor_in(value fd)
<wolfman8k>
how does one add types to the language?
<Banana>
you mean user defined type ?
<wolfman8k>
yes
<Banana>
type my_type = type-expression
<simon->
type atype = A | B ;;
<Banana>
(it's a bit simplified).
<ayrnieu>
also, you read the O'Caml book.
<wolfman8k>
hm... ok thanks guys
<simon->
wolfman8k, if you're reading a tutorial, I'm sure it will get to it
<wolfman8k>
no, i just read this paragrah from a mailing list archive:
<wolfman8k>
I will say- there is a way to get both the ease of development of operator overloading *and* the performance of BLAS. Make matricies first class types known to the compiler, like ints, floats, and strings (vectors can be considered m-by-1 matricies). Now the compiler knows what substitutions are legal or not- it can easily replace a = b + c + d; with a = b; a += c; a += d;, or even a = d; a += c; a += b; if it feels like it.
* simon-
reconsiders that he uses pronouns a lot
<Banana>
hum...
<Banana>
these is another kind of type definition.
<Banana>
in this case one want to extend the type system to add a first class type...
<Banana>
you need to hack the ocaml compiler to do that...
* wolfman8k
cries
<wolfman8k>
he goes on to say:
<simon->
wolfman8k becomes wolfman7999
<wolfman8k>
The compiler would then produce code which would call out to a library which would have to be linked in (rather like you have to add -lm to your command line to use sin() in C). So programs which don't use matricies don't have to suffer the "code bloat" associated with them.
<Banana>
he is talking about ocaml ?
<simon->
what code bloat? isn't that just a matter of how fast the compiler compiles?
<Banana>
i think people should be aware that ocaml is meant as a generic language which needs a small and well defined kernel so that you don't run into bootstraping issues.
<wolfman8k>
the problem is that syntax can get very ugly for numerical stuff
<Banana>
then use camlp4 to beautify it.
<Banana>
or any preprocessor you want.
<wolfman8k>
i read that camlp4 isn't powerful enough
<Banana>
...
<wolfman8k>
this was back in 2002 though
<Banana>
if it's a syntactic problem only then camlp4 should be more than enough.
<ayrnieu>
I read that camlp4 has astonishing power, before 2002 even. I guess that one of us will just have to try it and see -- and I've other things to do right now.
<Banana>
if it involves typing and optimising of cours camlp4 cannot do this.
<wolfman8k>
i think it does involve typing
<wolfman8k>
anyway, i'll just live with the syntax for now. thanks guys
cedricshock has joined #ocaml
karryall has quit ["tcho"]
mrsolo has quit ["Leaving"]
<cedricshock>
I'm new to OCaml. Is there any way to do something like an eval?
gim has quit []
<mellum>
cedricshock: no
<ayrnieu>
cedric - if you enjoy Haskell and O'Caml, as you seem to, and you also want a dynamic language (e.g., with eval, runtime code update, program's-own-extension-language, etc), please consider Q (http://q-lang.sf.net/) and Erlang.
<cedricshock>
ayrnieu: I've been playing with Erlang. Perhaps it has made me a little biased.
<ayrnieu>
cedric - the first time you develop a complex server from 'ooh, it listens to a port!' to 'ooh, it has 500 users right now!' (for an extreme case =) without ever stopping your initial server process, it will bias you very very much.
urz has quit ["."]
<cedricshock>
ayrnieu: All I really want is one tiny little feature. Most languages have some way to take a text representation of an integer and turn it into a full fledged working integer. All of these functional languages say they treat functions as first class objects. I want the direct analog - taking a text representation of a function and using it as the full useful object. It seems necessary in order to say that functions are treated on par w
<cedricshock>
ith other objects.
* ayrnieu
shrugs. Not an uncommon desire, nor an uncommon feature.
<cedricshock>
Great. Must I look to a dynamic language to find it?
<ayrnieu>
Yes, of course.
<cedricshock>
Ok. I give up. Eventually, when I am in control of billions of dollars of assets (working on open source stuff is going to take me there, right?), I will have the resources to hire people to solve all these small little problems that I don't have the interest in to do myself.
<ayrnieu>
Give up on what?
<cedricshock>
Actually the hs-plugins thing is pretty close - it is exactly what would be needed for a non-"dynamic language", a compiler. It could be quite a few steps shorter though, and all wrapped up in one or two functions.
<cedricshock>
Maybe I need new words to direct my searching. "Run-time compilation" sounds good. I'll try that.
<ayrnieu>
O'Caml also has something, apparently, given its Emacs-like 'efuns' and toplevel building.
<ayrnieu>
cedric - or you could just ask me what you look for.
<cedricshock>
Here is what I look for:
gl has left #ocaml []
gl has joined #ocaml
<cedricshock>
A language with:
<cedricshock>
A whole bunch of data types, each of which can be converted back and forth between some meaningful string representation, and optionally may also be converted into some other more efficient serialized representation. This set of data types needs to include a function or some other sort of procedural object.
<cedricshock>
Bindings to some nice, simple, powerful gui system, in some manner consistent with the design of the language
<ayrnieu>
and also with an open-source implementation?
<cedricshock>
Prefferably, or something I can afford.
<ayrnieu>
cedric - you may want to consider REBOL, then.
<cedricshock>
And also be reasonably small, and reasonably fast
<cedricshock>
Erlang actually fits this description pretty well, but its kind of big.
<ayrnieu>
REBOL has a considerably simpler graphical system, and a much much smaller system. I wouldn't call Erlang 'big' as I would call it 'an operating system'.
<ayrnieu>
and I wouldn't call it that to slight it; you just have to recognize that 'erl' boots up an operating system if you want to avoid the madness of trying to treat it like a normal unix program.
<cedricshock>
ayrnieu: exactly. Erlang is an operating system. That's what I meant by big. I should have said any programming language that needs you to write bootup scripts at some point ...
<ayrnieu>
well, Erlang's operating-system-ness doesn't really mean 'big'. It means that it has unusually big points and unusually small points -- for instance, most people compile a C 'hello world' to 3K and think they have something really small and quick-loading, when they in fact just have a gigantic support system (ld.so, libc.so, kernel magic, innumerable 'OS' setup) to support that binary.
<cedricshock>
I didn't mean to slight Erlang. I think, at the moment, it is my favorite programming language. I should probably stop poking around for something else, bite the bullet, and tackle the real problem that is keeping me from getting anywhere on this poject - the architecture of the program.
<vezenchio>
you could write a really small hello world program in C that does NOT rely on any external library support at all, depending on the target platform
<ayrnieu>
vezen - sure, and you could write a tiny OS.
<vezenchio>
well im just saying, in response to the "people think a C hello world is really small" comment
<vezenchio>
because really a hello world program in ANY language is pretty much just going to consist of a stack-push of the adress of a string followed by a call to a library "print" routine
<ayrnieu>
vezen - just pointing at the oft-unlooked C Runtime Environment =)
<ayrnieu>
also, overlooked.
<vezenchio>
yeah but that was not a very good example, because any programming language is going to have a print function in a default library somewhere
<ayrnieu>
but I don't think of Erlang programs as so, big, anyway, because I always have at least two nodes running at any time.
<cedricshock>
I havn't gotten past one node. Really, what's the difference? Erlang makes tow nodes behave almost exactly like they're one.
<ayrnieu>
cedric - I didn't read you as slighting Erlang. I've just thought some about this, already =) er, no difference -- one node runs as a different unix user and manages services such as Yaws; the other runs as my casual user and connects with distel, hosts normal programs, and so on. I sometimes like, for no particular reason, to have a 'developing' node and a 'services' node.
<ayrnieu>
not by those names =)
<ayrnieu>
anyway, please don't forget to consider Q.
mattam_ has joined #ocaml
<cedricshock>
My project is a programming language (sort of), so it is primarily a user interface problem. However the user interface problem also involves the conceptual problem of how to present data and algorithms. The idea is to have objects mapped to each other through some sort of morphisms. The most basic object would be some space that is the cartesian product of a bunch of categories, and a morphism being some definition of a new space someh
<cedricshock>
ow based on a previous one.
<cedricshock>
I guess some sort of meta object would be necessary to do things like combine data from multiple source objects.
<cedricshock>
Borrowing terms from my recently aquired touch of category theory and arrows, and using them to describe what I had concieved)
kinners has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
<cedricshock>
Then plus all the goodies of higher order functions, symbol manipulation, unit conversions, anova statistics, and many different types of data displays. At least, thats the idea.
_fab has quit []
kinners_ has joined #ocaml
kinners has quit [Read error: 60 (Operation timed out)]
mij has quit [Read error: 104 (Connection reset by peer)]
bk_ has joined #ocaml
maihem has joined #ocaml
cedricshock has quit ["Leaving"]
_fab has joined #ocaml
maihem has quit ["Read error: 54 (Connection reset by chocolate)"]
_fab has quit [Read error: 60 (Operation timed out)]
_fab has joined #ocaml
mij has joined #ocaml
<p0lartype>
is there arithmetic in lambda calculus, except church integers ?
cjohnson has joined #ocaml
Smerdyakov has quit ["go airplane"]
kinners_ has quit [Read error: 113 (No route to host)]
mattam_ is now known as mattam
<Banana>
p0lartype: you can encode any decidable arithmetic in lambda calculus but there is no arithmetic 'in se' in the lambda calculus.
<mellum>
in se?
<Banana>
in itself
<p0lartype>
Banana: are you kim nguyen ?
<Banana>
i am.
<p0lartype>
you're a crypto guy right
<mellum>
you mean "per se"?
<Banana>
HA HA HA.
<Banana>
not at all.
<Banana>
there are like bilions of kim nguyen on earth you know ?
<Banana>
;)
<p0lartype>
;)
<Banana>
I'm a french graduate student.
<Banana>
mellum: yes my latin is worst than my english.
<Banana>
:)
<gl>
"crypto guy"
<gl>
haha
<wolfman8k>
is F# any good?
<simon->
heh
<simon->
I'd say it depends on how much they continue to copy from ocaml, but I haven't tried it :)
<vegai>
if you have to do .net, it probably is quite good
<wolfman8k>
and if not?
<vegai>
well, why bother
<simon->
then why bother using a .net component?
<wolfman8k>
eaiser to work with other languages?
<simon->
it probably has its integration into windows so you may have some beneg
<simon->
fits
<simon->
(I'm learning dvorak, bear with me :-)
<wolfman8k>
guess i'll just stick with plain OCaml then
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
<wolfman8k>
hm... what is the best way to work with loading/saving with OCaml? XML?
<Lemmih>
It depends on what you wanna load/save.
<wolfman8k>
custom data structures
<Banana>
then use the marshalling functions of ocaml.
<Banana>
(with care).
maym has joined #ocaml
<wolfman8k>
hm... are the file compatible between architecturse?
monotonom has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
mrsolo has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
<Demitar>
wolfman8k, Marshal is good for caching, not real storage. You might want to check out the camlp4 extension for generating xml writers and readers for data structures.
cedricshock has joined #ocaml
Submarine has joined #ocaml
bk_ 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 ]
<wolfman8k>
...challenge a perfect, immortal machine?"
fox___^ has joined #ocaml
<buggs>
run ???
<wolfman8k>
hm?
fox___^ has left #ocaml []
Lemmih has quit [Remote closed the connection]
foxster has joined #ocaml
maym has left #ocaml []
Iter has joined #ocaml
monotonom has quit ["Don't talk to those who talk to themselves."]
cjohnson has quit [Read error: 60 (Operation timed out)]
<wolfman8k>
what is a .cmx file?
<wolfman8k>
and .cmo?
<ayrnieu>
native-compiled and byte-compiled, respectively, IIRC. I probably don't RC.
<Submarine>
Indeed.
<Submarine>
.cmi is compiled module interface
<wolfman8k>
compiled what?
<wolfman8k>
hm...
<Submarine>
.cmo is compiled module object
<Submarine>
.cmx is compiled module object, native code
<wolfman8k>
i'm getting this error:
<wolfman8k>
No implementations provided for the following modules:
<wolfman8k>
IoXML referenced from foo.cmx
<wolfman8k>
problem is there is no ioXML.cmx file
<Submarine>
Well, what is IoXML supposed to be?
<Submarine>
Certainly not a standard module. :-)
<Submarine>
.cmx files can be grouped in .cmxa files
<wolfman8k>
i only have ioXML.* : cmi cmo cmx mli o