jemfinch` changed the topic of #ocaml to: nob: it's not an option keyword. It's a datatype. 'a option. It can be either "None" or "Some data" -- it represents either data that's not there (None) or data that's there (Some data)
<MegaWatS>
hi is someone there?
<MegaWatS>
:/
<Taaus>
Yeah ;)
<MegaWatS>
ah
<MegaWatS>
hm
<MegaWatS>
you dont happen to know if the integer's in the Bigarray.int formatted big arrays are stored flat
<MegaWatS>
or with the type-bit that normal unboxed integers have?
<MegaWatS>
ie
<malc>
MegaWatS: bigarrays are stored 'as is'
<MegaWatS>
well my problem is
<MegaWatS>
its not clear from the documentation
<MegaWatS>
it says for all the types
<MegaWatS>
int16, int32 etc
<MegaWatS>
except for the
<MegaWatS>
(int,Bigarray.int,'a) Bigarray.Array1.t and the like
<MegaWatS>
I want to know
<MegaWatS>
if the int's in that format
<MegaWatS>
are still stored as
<MegaWatS>
(val << 1) | 1
<MegaWatS>
or simply as
<MegaWatS>
val
<MegaWatS>
i know the int32's are simply a continuous block of 32-bit integers
<MegaWatS>
but are the ints, too?
<MegaWatS>
in bigarray format
<MegaWatS>
ive been looking through the online documentation
<MegaWatS>
and it doesnt say :\
<malc>
let's see
<malc>
i would vote for shifted version
<MegaWatS>
:/
<MegaWatS>
well then ill have to use int32 or nativeint bigarrays
<MegaWatS>
thanks^^
<MegaWatS>
why cant one make a int, int32_elt bigarray B[
<malc>
no actually it seems like this is not the case
<malc>
movl $10, (%eax, %ebx, 4)
<malc>
movl Big, %eax
<malc>
movl 20(%eax), %eax
<malc>
cmpl $0, %eax
<malc>
jbe .L102
<malc>
xorl %ebx, %ebx
<malc>
movl Big, %eax
<malc>
movl 4(%eax), %eax
<malc>
movl (%eax, %ebx, 4), %eax
<malc>
sall $1, %eax
<malc>
orl $1, %eax
<malc>
call Pervasives_string_of_int_151
<malc>
let a = Array1.create Bigarray.int c_layout 10
<malc>
let _ =
<malc>
a.{0} <- 10;
<malc>
print_int a.{0}
<MegaWatS>
ahh
<MegaWatS>
ok i did the same now, i cant read this gas style assembly code :), but it seems youre right
<MegaWatS>
movDWORD PTR [eax+ebx*4],10
<malc>
its not gas style assembly. at&t style rather
<malc>
yep thats it
<malc>
i would use more aestetically pleasing mov [dword ptr eax+ebx*4], 10 Ideal version though >B)
<MegaWatS>
well whatever style it is, i cant read it :]
<malc>
good old Tasm habbits
<MegaWatS>
:p
<MegaWatS>
well that was what ocamlopt produced
<MegaWatS>
not me :]
<malc>
windows.. sigh
<MegaWatS>
:/
<MegaWatS>
i bow my head in shame :(
<malc>
no need too, really. windows is in general superior and better supported(whatever this means) thingie
<MegaWatS>
:]
<MegaWatS>
well i use it mainly because of games ...
<MegaWatS>
but anyways HOORAY I can use the Bigarray.int Bigarray type :]
<malc>
i dont play games. my athlon overheats
<malc>
congratulations
<MegaWatS>
well its for the glXXXv() functions
<MegaWatS>
i provide several versions of those
<MegaWatS>
glXXXvi() takes an int and a caml array -> starting from index i in the array
<malc>
i know
<MegaWatS>
how?
<MegaWatS>
im just now implementing it that way :)
<malc>
my own ocaml gl code use good old gl..[^v][ifvg] versions ;)
<MegaWatS>
glXXXv() maps to glXXXv() maps to glXXXvi() with i = 0
<MegaWatS>
and now
<MegaWatS>
ill add glXXXva() for bigarray versions^^
<MegaWatS>
there i can then use the opengl datatypes directly :>
<malc>
good.
* malc
own gl code allways segfaulted on windows for some reason (lablgl labltk)
<MegaWatS>
:|
<MegaWatS>
hmm
<MegaWatS>
thats strange
<malc>
it is
<malc>
it segfaulted somewhere in tk.dll or something
<malc>
i never cared enough to debug it
<MegaWatS>
usually thats a sign the primitives are not carefully implemented using all the gc necessary CAMLxxx() macros in my experience so far :(
<MegaWatS>
if its not a typical C error like an array overflow or the like, in the C part of the code
<MegaWatS>
or a stack overflow ... it doesnt catch stack overflows if they happen to happen just in the C code
<MegaWatS>
those are the three cases if encountered so far
<malc>
nah, it was just a problem of particular labltk and particular version of tcl/tk installed on my computer at the time
<malc>
again i never cared enough about windows port. just ported the code to C++ (much more simplified version) to make it run on winie computers
<MegaWatS>
heh :]
<MegaWatS>
ahh yes... back at stubber1.ml - prolly some of the worst-looking worst-organized ml code ive produced so far :] - but it works and it creates my opengl stub files JUST the way i want them :]
<malc>
you dont use lablgl do you?
<MegaWatS>
nope
<MegaWatS>
thats the whole point
<MegaWatS>
i currently do my own opengl binding
<MegaWatS>
more direct
<MegaWatS>
ie
<MegaWatS>
glVertex2f is available, under exactly that name, as an ocaml primitive
<MegaWatS>
and so on
<malc>
i guess you are in 'pedal to metal' mood ;)
<MegaWatS>
?
<malc>
well the only justification for your work would be speed gain
<MegaWatS>
:)
<MegaWatS>
well i dont want to use lablgl for several reasons
<malc>
im all ears
* Taaus
hands malc a nose, for the sake of variety
<Taaus>
;)
<MegaWatS>
?
<MegaWatS>
well i want to be bale to use all the opengl primitives i want in the way i want
<MegaWatS>
lablgl is not so much a direct binding as more an indirection
<malc>
that is one reason
<malc>
Taaus: why thank you very much
<MegaWatS>
a vaguely opengl-like graphics api in ocaml that sits on top of opengl
<Taaus>
malc: Anytime ;)
<MegaWatS>
well the other is obviously performance as you said
<MegaWatS>
and third, i dont know HOW deeply lablgl is intertwined with tcl/tk
<MegaWatS>
but i want a 'just an opengl binding' binding that is just that
<MegaWatS>
a direct, opengl-only binding that doesnt concern itself with outside-of-opengl scope thigns like gl contexts and the like
<malc>
MegaWatS: lablgl is not interwined with tcl/tk at all
<MegaWatS>
from the readme:
<MegaWatS>
2. Requisites
<MegaWatS>
* Objective Caml 3.01
<MegaWatS>
* LablTk (included in Objective Caml, requires Tcl/Tk)
<MegaWatS>
* OpenGL version 1.0 or 1.1
<MegaWatS>
either way its just too indirect for me
<malc>
i repeat: lablGL does not contain a single line of tcl/tk dependant code
<malc>
labltk is in requisites for the sole reason that otherwise you wont see anything
<malc>
it could have been replaced with lablgtk
<malc>
or glut/glaux bindings library
<malc>
or glx or whatnot
<malc>
and examples in lablgl distribution use labltk
<malc>
so there
<MegaWatS>
hmm
<MegaWatS>
well i didnt look all THAT thoroughly through it
comatoast has quit ["zzz..."]
<MegaWatS>
it was just that it threw me off - it didnt offer all the opengl commands but hid some behind its own way to do things, and the readme said it required tcl / tk and there was no windows support out of the box ...
<MegaWatS>
also, NIH :]
<MegaWatS>
:p
<malc>
lablgl doesnt even have glBindTexture
<malc>
in any case i salute you for what you do right now
<MegaWatS>
:\
<MegaWatS>
thx
<MegaWatS>
well im pretty far already
<MegaWatS>
its not that hard
<MegaWatS>
i only just started .. what... three days ago or so
<MegaWatS>
ive got now about 90% of the opengl 1.0 commands
<MegaWatS>
next i do the 1.1 and 1.2 and some extensions
<MegaWatS>
most of the work is done via my stubber
<MegaWatS>
a gl_light_enum should be either a `GL_LIGHTi
<MegaWatS>
or `GL_LIGHT of int
<MegaWatS>
then the int is added to the base index GL_LIGHT0
<MegaWatS>
ie
<MegaWatS>
several opengl specific idl features in my stub generator :)
jemfinch has quit [Remote closed the connection]
jemfinch has joined #ocaml
<MegaWatS>
yay it works :>
<GnuVince>
MegaWatS: what does?
<MegaWatS>
the bigarray functions
<MegaWatS>
in my opengl binding
<GnuVince>
in O'Caml?
<MegaWatS>
yep
<GnuVince>
Very nice!
<GnuVince>
Speaking of which, how are arrays formed?
<MegaWatS>
?
<GnuVince>
lists are: element 1 :: element 2 :: element 3 :: ... :: element n :: []
<MegaWatS>
normal arrays in ocaml?
<MegaWatS>
[| a; b; c |] for literals
<MegaWatS>
or
<GnuVince>
yes
<MegaWatS>
Array.make length init
<MegaWatS>
ie
<MegaWatS>
Array.make 10 ""
<MegaWatS>
for an array of ten empty strings
<GnuVince>
ok
<MegaWatS>
then you access the items with a.(i) and put something in them with a.(i) <- expr
<GnuVince>
OK
<GnuVince>
something like push and pop and append?
<MegaWatS>
umm
<MegaWatS>
i think lists would be better for that
<MegaWatS>
for append i guess there is a primitive
<MegaWatS>
Array.append a b
<GnuVince>
I'll check the ref
<MegaWatS>
yes you do that :)
<GnuVince>
Can you make a big decision for me?
<GnuVince>
What do I get to drink?
<MegaWatS>
hm i dunno
<GnuVince>
Milk, water, beer or pepsi?
<MegaWatS>
i dont drink any alcohol
<MegaWatS>
so drin pepsi :)
<GnuVince>
All righty then
<malc>
gee. you sound almost like this dork from Sling Blade
<MegaWatS>
@malc: yep it works - the ints in a (int, Bigarray.int_elt, 'a) Bigarray.Array1.t , at least, are stored simply as native integers, not in the shifted ocaml format
<GnuVince>
malc: who?
<malc>
GnuVince: retarded man from a movie 'Sling Blade'
<malc>
MegaWatS: assembly output prooved it half an hour ago
<MegaWatS>
:]
<GnuVince>
malc: errrr.
<MegaWatS>
yes your right of course its just nice to see it working now
<malc>
MegaWatS: indeed
<MegaWatS>
now i introduce a new datatype into my stub generator - the skip :)
<MegaWatS>
it is an offset into the next following Bigarray argument :)
wazze has joined #ocaml
<jemfinch>
is anyone here subscribed to the O'Caml mailing list?
<jemfinch>
Linux debian 2.4.17 #6 Fri Feb 1 18:33:12 EST 2002 i686 unknown
<jemfinch>
I was getting a bit tired of freebsd ports.
<GnuVince>
Linux vincent 2.4.17 #4 Wed Jan 16 20:17:15 EST 2002 i686 unknown
<GnuVince>
and I'm using the testing tree
<jemfinch>
of course, now I have to deal with kernel crashes, X crashes, stupid meta keys, lacking my beloved gtk theme, etc.
<jemfinch>
maybe I should downgrade to testing.
<GnuVince>
testing is really fine
<jemfinch>
I'm on unstable.
<GnuVince>
well unstable's been pretty unstable these last few weeks
<jemfinch>
well, that's what pushed me over the edge.
<jemfinch>
I'm downgrading now.
<GnuVince>
OK
samx has joined #ocaml
whee- has joined #ocaml
whee has quit [Read error: 104 (Connection reset by peer)]
whee- is now known as whee
JGibson has joined #ocaml
MegaWatS has quit ["oyasumi nasai"]
samx has quit [Remote closed the connection]
<jemfinch>
GnuVince: you there?
whee has quit [Read error: 113 (No route to host)]
whee- has joined #ocaml
JGibson_ has joined #ocaml
whee has joined #ocaml
JGibson has quit [Read error: 110 (Connection timed out)]
jemfinch has quit [Read error: 104 (Connection reset by peer)]
jemfinch has joined #ocaml
whee- has quit [Read error: 113 (No route to host)]
whee- has joined #ocaml
engstad has joined #ocaml
whee has quit [Read error: 113 (No route to host)]
comatoast has joined #ocaml
engstad has quit [Read error: 113 (No route to host)]
whee has joined #ocaml
whee- has quit [Read error: 104 (Connection reset by peer)]
comatoast has left #ocaml []
Cryptor has joined #ocaml
whee has quit []
whee has joined #ocaml
<whee>
:|
Cryptor has quit [Success]
malc has joined #ocaml
mellum has joined #ocaml
malc has quit ["no reason"]
JGibson_ has quit ["WHAT, CLOWN?!"]
awwaiid has quit [Read error: 104 (Connection reset by peer)]
nob has joined #ocaml
<nob>
hi
<nob>
what does this error mean:
<nob>
the implementation table.ml does not match the interface table.cmi:
<nob>
values do not match:
<nob>
val enter: ('_a, 'b) t -> '_a -> 'b -> unit
<nob>
is not included in
<nob>
val enter : ('a,'b) t -> 'a -> 'b -> unit
<nob>
In table.mli I have the following definitions:
<nob>
type ('a,'b) t
<nob>
val enter : ('a,'b) t -> 'a -> 'b -> unit
<nob>
and in table.ml,
<nob>
type ('a,'b) t = ('a, ('a,'b) binder) Hashtbl.t
<nob>
where binder type is defined by :
<nob>
type ('a, 'b) binder = {value:'b; prevtop:'a option}
<smkl>
how is enter defined? this is a case of value restriction
<nob>
in table.ml, I have
<nob>
let enter tbl key value = Hashtbl.add tbl key {value=value; prevtop: !top};;
<nob>
where top is defined by
<nob>
let top = ref None;;
<smkl>
that doesn't work. if you set top := Some 1, then enter would become val enter: (int, 'b) t -> int -> 'b -> unit
<nob>
Well, that's how it's supposed to work, more or less ... top maintains the last inserted key into the table ... so...
<smkl>
if you have two tables, one for ints and other for strings, wouldn't ints and strings get mixed?
<nob>
mmm... yes ... you are right ... Suppose I keep the top pointer local to each table ...
<nob>
I was just sketching an idea .. I hadn't tested it ... Was a stupid mistake
<nob>
that solved my problems!!
<smkl>
anyways, sometimes when you define a polymorphic function without specifying arguments like "let id2 = id id", you get that kind of types. then you need to eta-expand ie. "let id2 x = (id id) x"
<nob>
I love this language ... it really saves me from writing bad code !
<smkl>
that restriction is a bit too strict but it is needed to catch errors like yours
<nob>
ok .. I'll keep that in mind... thanks a lot!
clog has joined #ocaml
clog has joined #ocaml
awwaiid has joined #ocaml
awwaiid has quit [Read error: 104 (Connection reset by peer)]
<nob>
see ya.. Thanks!
nob has quit []
mellum has quit ["Leaving"]
mellum has joined #ocaml
comatoast has joined #ocaml
graydon has joined #ocaml
<GnuVince>
jemfinch: I am now
<Taaus>
?
<GnuVince>
[02:51:16] <jemfinch> GnuVince: you there?
<Taaus>
lol
<Taaus>
I just saw that in my backlog.
<Taaus>
So... What's new? :)
<Taaus>
Not a lot, eh? ;)
graydon has quit []
samx has joined #ocaml
malc has joined #ocaml
<GnuVince>
back
<Taaus>
You were away? :)
<GnuVince>
I went to eat
<Taaus>
Ah.
<GnuVince>
So what's up?
<GnuVince>
(and don't say your dick, I heard it twice today)
<Taaus>
That's what I asked you! ;)
<GnuVince>
In my case
<GnuVince>
I installed OpenBSD 3.0 at school on a test box
<GnuVince>
made an install guide
<Taaus>
(FYI, my dick is completely flaccid... Chatting on IRC isn't very exciting ;)
<Taaus>
NEat.
<GnuVince>
I made YAUOCP
<Taaus>
Yet Another Unfinished O'Caml Program? :)
<GnuVince>
Useless
<Taaus>
Ahh.
<GnuVince>
but it works
<Taaus>
So close, and yet so far away ;)
<Taaus>
What does it do?
<GnuVince>
prepare to be blown away by the unusefulness