mattam has quit [Read error: 110 (Connection timed out)]
Skal has quit [Remote closed the connection]
* tsume
chuckles
paganini_ has joined #ocaml
humasect has quit ["Leaving.."]
senko has quit ["Leaving"]
senko has joined #ocaml
paganini__ has joined #ocaml
Sonarman has quit [Read error: 60 (Operation timed out)]
det is now known as PenguinOfDoom
paganini_ has quit [Read error: 113 (No route to host)]
PenguinOfDoom is now known as det
paganini__ has quit [Read error: 110 (Connection timed out)]
monochrom has joined #ocaml
Sonarman has joined #ocaml
Sonarman has quit ["leaving"]
_fab has quit [Read error: 113 (No route to host)]
zzorn has joined #ocaml
Submarine has joined #ocaml
vezenchio has joined #ocaml
a-zwei has joined #ocaml
<a-zwei>
does anyone know if there exists a jed mode for ocaml?
mlh has quit [Client Quit]
zzorn is now known as zzorn_away
Msandin has joined #ocaml
monochrom has quit ["Few people understand "understanding"."]
mlh has joined #ocaml
__DL__ has joined #ocaml
<nlv11757_>
morning
<nlv11757_>
does ocaml have a kind of read function ; read :: string -> a which can be used to coerce a string into a certain value?
Submarine has quit ["Leaving"]
<mellum>
nlv11757_: no.
<mellum>
It wouldn't be possible to implement such a function with standard language tools.
pango has quit ["bbl"]
<nlv11757_>
darn, i have this problem.
<nlv11757_>
i have a syntax tree in ocaml which i want to import in a haskell program
<nlv11757_>
im doing this by pretty printing the ocaml syntax tree in a format such that i can do "read foo :: AstType" in haskell
<nlv11757_>
no problem yet
<nlv11757_>
but, then i do something and want to put the syntax tree back in a ocaml program again
<nlv11757_>
ocaml hasnt got that "read" feature which means i would have to write a parser to parse the abstract data type.....and im not sure thats a good idea
Herrchen has joined #ocaml
<Msandin>
hum, that's would be a useful addition to my lib, generate a reader from a data type, ahhhhh well, for the future...
<mellum>
nlv11757_: why not?
<nlv11757_>
well im not sure if parsing something acoording to an abstract syntax is really going to work smoothly
<Msandin>
works for lisp=)
<nlv11757_>
but you know what I am aiming for msandin? these grammars that define an abstract syntax tree are usually not very fit for parsing.
<Msandin>
well, if they are printed unambigiously, why shouldn't they be easier to parse than say, a standard pl grammar? no operator precedence and such nastiness, for example... in fact, lots of asts has no operators at all... but i don't know your particular grammar for sure=)
pango has joined #ocaml
<Msandin>
it obviously depends heavily (exclusively?) on the printer...
<nlv11757_>
i see your point, my concern is exactly that an abstract grammar describing a syntax tree that represents a C program is bound to be ambiguous
Snark has joined #ocaml
<Msandin>
well, the ast might be ambigious with regards to c semantics (ie it needs to be further resolved along with type resolution and such things) but why the grammar of the printed ast should be, i can't see, but as i said, i don't know... if it can be read by haskell's read function it should be unambigious no?
<nlv11757_>
yep, but then again, who knows how this read is implemented :D
<Herrchen>
after applying type checks it would be very feasable that the AST is unambiguous ...
<nlv11757_>
this tree is processed to a great extent to resolve all kinds of C ambigiouties, so the AST is nice
<nlv11757_>
im using CIL
<Msandin>
i sort of figured cil was what you wanted in the ocaml world=)
<nlv11757_>
:) it's quite the masterpiece if you want to manipulate C in a functional setting. It's just that the analysis part in Cil is very weak. Im going to use attribute grammars for that...in those are in haskell.
<nlv11757_>
so im using the CIL frontend, and then process it further in attribute grammars in haskell, but i need to put out C again, so thats why i needed to go back to the CIL/OCaml world again
* Msandin
made an oo RAG tool for OCaml, but I'm back on the drawing board for the next version:)
<det>
RAG?
<Msandin>
reference attributed grammars, extension of the ag formalism
<Msandin>
does anyone ever have any desire for list comprehensions in ocaml?
<nlv11757_>
the real problem is the scheduling in OCaml msandin, you need lazyness
<nlv11757_>
badly
<Msandin>
nlv: for what? ags or list comprehensions? (obviously, both benefit from lazyness, but your intended meaning was?)
_fab has joined #ocaml
<nlv11757_>
ags
<Msandin>
well, with a rag perfect scheduling is impossible, so lazy on-demand evaluatin is what you get, and it's highly desirable to detect circularities at runtime...
<nlv11757_>
you mean real circularities? or just circular dependencies for which a static evaluation order exist?
<Msandin>
either kind, really
<nlv11757_>
cause if there is a static evaluation order of evaluating the attributes, lazyness is mandatory
<nlv11757_>
real circularities remains a problem i think, because it has to stop sometime
<Msandin>
well, my tool doesn't actually support circular rags, but i have a thesis on my bookshelf describing a possible approach, but Im not terribly fond of it
<nlv11757_>
aha, my professor developed the UUAG system in Haskell
<nlv11757_>
it's very sophisticated
<Msandin>
mmm, I did my diploma thesis using the Java-based JastAdd system
<Msandin>
there are various extended version, for higher-order rags (which i used), circular rags, rewritable rags (those are sort of neat)
<nlv11757_>
interesting stuff
<Msandin>
I thought so, but Java isn't terribly=)
* Msandin
has a link to the UUAG somewhere, does it support circular attributes?
<Msandin>
yups, that was a delicious link i already had, thanks:)
<nlv11757_>
np
<Msandin>
it uses a weaver... as does jastadd, i sort of strive to eliminate that in my tool, allowing separate compilation
<nlv11757_>
you mean the translation to the host language or what?
_fab has quit [Read error: 110 (Connection timed out)]
<Msandin>
yeah, my tool is a pure camlp4 extension, so it can't do any global grammar analysis, i hope(d) to avoid that by using inheritance, parametrized classes, variants and functors, i've not been clever enough so far:)
<nlv11757_>
i dont really see the translation to haskell as a problem in UUAG
<nlv11757_>
although pure integration into Haskell may be nice, It will never happen since the Haskell standard is holy
<Msandin>
Well, camlp4 is only syntax...
<nlv11757_>
ow
<Msandin>
But macros are a lot less important in a lazy language...:)
<nlv11757_>
:)
slashvar[lri] has left #ocaml []
mattam has joined #ocaml
whee has joined #ocaml
<vincenz>
Msandin: is your type_of lib avaliable?
<Msandin>
vinc: nope, but I just cut the code in half, made it more readable, and way easier to add a fold_<type> function generator
<Msandin>
so things look hopeful=)
<vincenz>
but it's not available
<Msandin>
well... nope, possibly later today... atm im going for a haircut
Msandin has quit ["hair needs attention"]
<vincenz>
ok
Skal has joined #ocaml
mlh has quit ["Chatzilla 0.9.66e [Firefox 1.0/20041107]"]
mlh has joined #ocaml
hexreel has joined #ocaml
<nlv11757_>
how can you assign associativity to infix operators?
hexreel has quit ["quit"]
<__DL__>
You can't. The only way is to use camlp4.
<__DL__>
associativity of infix opertors are determined only by ther first letter
<vincenz>
too bad ocaml doesn't allow infix type-constructors
<vincenz>
:(
mlh has quit [Client Quit]
<senko>
hi, can i have cyclic module dependency?
<vincenz>
no
<senko>
mm :/
hexreel has joined #ocaml
<Msandin>
well, you can, if they are declared in the same file..
<mflux>
is there a library for ocaml, that would extract a jpeg from memory?
<mflux>
camlimages seems to do only on-disk-loading, or atleast 2.0
CosmicRay has joined #ocaml
hexreel has quit ["quit"]
Herrchen has quit ["bye"]
Snark has quit [Read error: 110 (Connection timed out)]
MartinS has joined #ocaml
Msandin has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
<MartinS>
Well, vincenz, or anyone else who wants to try an early version, tywith can be had from http://www.guldheden.com/~sandin/files/tywith.zip, afaik it works decently generating map and string_of functions for a limited set of types, but those include many interesting ones. This version is only for comments otherwise=)
smt has quit [Remote closed the connection]
CoolPops has joined #ocaml
<CoolPops>
I'm trying to get Ocaml to work properly on NetBsd 2.0. Ocaml seems to be working fine, but now I am installing additional packages (many of which use findlib). Installing findlib went just fine, but when running it I get: $ ocamlfind
<CoolPops>
Fatal error: exception Stream.Error("Expected a '=' or a '(arguments,...)=' clause at line 1 position 2")
<CoolPops>
Any ideas?
<CoolPops>
findlib v1.0.4
<CoolPops>
hm. I've been working on this for a few hours now, finally figured it out. -config should be a directory location but a direct file name.
Submarine_ has joined #ocaml
Msandin has joined #ocaml
CoolPops has left #ocaml []
MartinS has quit [Read error: 110 (Connection timed out)]
<vincenz>
ths mflux
<vincenz>
I meant martins
<Msandin>
vinc: any feeback is appreciated, should u try it
<vincenz>
sure thing
pango has quit ["Leaving"]
Msandin has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
Snark has joined #ocaml
Msandin has joined #ocaml
Submarine_ has quit ["Leaving"]
Submarine has quit [Remote closed the connection]
monochrom has joined #ocaml
Snark has quit [Read error: 104 (Connection reset by peer)]
int80_h has joined #ocaml
<int80_h>
hello :)
<int80_h>
caml came to my attention when I was looking around for OS projects in lisp. On the same page an OS project in caml was mentioned
<int80_h>
so now I am curious
<int80_h>
first lisp, then haskell, now caml.
<mellum>
an OS in caml? Seems like a terrible idea to me.
<int80_h>
really? why?
<mellum>
The GC is in the way, and generally mechanisms aren't transparent enough.
<int80_h>
I know nothing except it is a FP language
<mellum>
And there's no HW access.
<mellum>
And the strengths of functional programming aren;t really useful in the domain.
<int80_h>
ahhh
<int80_h>
well part of the learning process for me
<int80_h>
could you give me an overview of the problem domain for FP?
Submarine has joined #ocaml
<mellum>
Uh. I was just going to eat ;)
<int80_h>
nuts
Submarine_ has joined #ocaml
Submarine_ has left #ocaml []
<Riastradh>
Why would the GC, lack of hardware access _built-in_ to the language, & functional paradigm be a barrier to the construction of an OS?
<int80_h>
that's what I want to know
vezenchio has quit ["I live in a yurt on the steppes of Sheepfuckistan. That's why."]
Snark has joined #ocaml
zzorn_away is now known as zzorn
zzorn is now known as zzorn_WoW
Snark has quit ["Leaving"]
whee has quit []
Msandin has quit [Read error: 104 (Connection reset by peer)]
booyaa has joined #ocaml
booyaa has left #ocaml []
m3ga has joined #ocaml
m3ga has quit ["Client exiting"]
Zaius has joined #ocaml
<Zaius>
greetings; ive got another unsolvable problem
<Zaius>
how do you pass Printf.printf as parameter to a function?
<mauke>
I don't think you can
<Riastradh>
You don't.
<Riastradh>
Printf is magical.
<Zaius>
you mean its hacked?
<Riastradh>
Hacked, magical, special case -- whatever you want to call it.
<Zaius>
:(
<Zaius>
that doesnt help my case, but its nice to know that "magical" is a legitimate euphemism for "hacked" :D
<mauke>
heh, do you know perl?
<mauke>
perl is highly magical
<Zaius>
:) its even fancier to be called an "advanced magician" than just software engineer
Submarine_ has joined #ocaml
smimou has quit ["?"]
Submarine has quit [Remote closed the connection]
<pango>
let apply2 f x y = f x y in apply2 Printf.printf "Hello %s\n" "world"
<pango>
did I miss something ?
<Smerdyakov>
Format strings are special. Uses of printf without constants strings applied immediately will not work.
<mauke>
wouldn't that print "Hello " first?
<pango>
Smerdyakov: but that was not his question
<Smerdyakov>
"His" question? Whose question? What question?
<pango>
<Zaius> how do you pass Printf.printf as parameter to a function?
<Smerdyakov>
I see.
<Zaius>
pango: it will work, but i printf will not adapt to another signature if i reuse it
<Zaius>
i hoped to keep its magicalness somehow
<Submarine_>
pango, don't do that :-)
<pango>
I wonder if printf is still "magical" in gcaml, or if it was reimplemented to use adhoc polymorphism
<Submarine_>
partial applications of printf don't work
<Submarine_>
BUT
<Submarine_>
essentially, the first param to printf is not a string
<Submarine_>
it's a format
<pango>
Submarine_: I know
<Submarine_>
so if you want to use it in hairy ways, you have to cast your strings to format appropriately
<Submarine_>
I *think* you can achieve what you attempted by explicitly casting your string to a format
<Submarine_>
("foobar" : (....) format)
<pango>
I'm not attempting anything, just replying to a question
<Zaius>
i would have to cast the string to an appropriate format that matches the additional parameters - and i can do this in only one way for the printf i received as parameter
<Zaius>
of course i could 'preprocess' all other cases with Printf.sprintf and pass the result to printf