<mk270>
oh ffs, macaque thinks i want a syntax extension too. i don't
<smondet>
but the project has no moved much in years
<mk270>
smondet: yes, i know
<mk270>
but i didn't get the impression galax was still maintained
<Drup>
mk270: well, why don't you want a syntax extension if that allow you to have typesafe queries ? =)
<mk270>
though that could just because it's on sourceforge ;)
<mk270>
drup: no, i dont
<mk270>
i am happy enough with the existing typesafety in postgres and ocaml
<Drup>
basic "typesafety" in a sql library in ocaml without syntax extension is just "using printf to put a string together"
<Drup>
(that's "none")
<Drup>
if you're happy with that, go on. personnally I wouldn't be :D
<mk270>
really, i can cope
<mk270>
we are trying to replace python here
<smondet>
but yes, PGOCaml supports calling the queries without syntax extension
<mk270>
if we can't compile this crap, because oasis doesn't want to fuck around with undocumented _tags files for syntax extensions, then we can't do that
<mk270>
smondet: well yes, that's why i want to use it
<mk270>
but i couldn't find the docs
<mk270>
markus mottl's thing is all OO classes, and its example programmes don't contain an example of a select query (iirc)
<Drup>
mk270: it's quite easy to use syntax extensions in oasis
comacat has quit [Quit: leaving]
<Drup>
just add "true: syntax_camlp4o" and the relevant "foo.syntax" as dependecies in the _oasis, and it should work
<Drup>
anyway
ollehar has joined #ocaml
<Drup>
if you don't want syntax extensions, unsafe pgocaml works, as does the other less featureful pg binding
<Drup>
("true: syntax_camlp4o" should be add at the end of the generated _tag)
adrien_o1w has joined #ocaml
RMacy is now known as RMacy|Away
<mk270>
drup: do you check the _tags file into revision control?
RMacy|Away has quit []
<Drup>
yes
<mk270>
smondet: thanks
testcocoon has quit [Ping timeout: 252 seconds]
<Drup>
especially since I modify them, sometimes
<mk270>
drup: but it's generated by oasis
<Drup>
it's partially generated by oasis
<mk270>
that's even worse
RMacy has joined #ocaml
<Drup>
no it's not, there is a specific zone clearly delimited when oasis put his stuff
<mk270>
anyway
<Drup>
where*
<mk270>
i am trying not trying to protect ocaml from postgres
<mk270>
i am trying to protect postgres from python
<Drup>
:D
testcocoon has joined #ocaml
<Drup>
just use the unsafe stuff then
<mk270>
yes, i am happy to use the unsafe stuff
<mk270>
very happy indeed
<mk270>
if i wanted my compiler to log into my database, i'd use F#
adrien_oww has quit [Ping timeout: 264 seconds]
<Drup>
(note that macaque doesn't require it)
<Drup>
(but macaque has different quirks)
<Drup>
anyway, I'm sure you will be progressively convince not to use unsafe stuff :D
willb1 has joined #ocaml
<Drup>
convinced*
<smondet>
Drup: BTW, with PGOCaml the syntax extension is not "complete"
<Drup>
yeah, I know
<mk270>
:)
<mk270>
drup: thanks for warning me
<Drup>
but my experience is that it's added quite quickly if you ask the maintainer about it.
<Drup>
(as stated in the homepage)
zpe has quit [Remote host closed the connection]
yellowfish_ has joined #ocaml
zpe has joined #ocaml
<Drup>
aslo, mk270, pgocaml doesn't really need an access to your database
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<Drup>
it only want an access to some database with the same schema :p
talzeus has quit [Read error: Connection reset by peer]
<mk270>
drup: no shit
<mk270>
i am all for type providers, and doing things statically, and getting rich guarantees at compile time
<mk270>
but i want to be able to switch this crap off sometimes, and do it lightweight, and not rely on it before it's mature, and do it in a way that doesn't surprise developers with its weirdness
<mk270>
currently, to do "SELECT 1;" from a postgres db on ocaml requires half an hour of pain
<mk270>
grovelling around installing potsgrees server, finding right homepage of right ocaml package, tyring to get oasis to play ball
<mk270>
it really is nut
<mk270>
and your splitting hairs and trying to pedantically get your point across really is not helping your cause
<mk270>
i agree with you that these syntax things are nice
zpe has quit [Ping timeout: 244 seconds]
<mk270>
but this one isn't ready for prime time
<mk270>
and it should be obvious how to switch it off
<mk270>
rather than the whole docs being some 7 page pdf on some unrelated website
jwatzman|work has quit [Quit: jwatzman|work]
ygrek_ has joined #ocaml
boogie has quit [Remote host closed the connection]
<Drup>
you are being slightly over critical, trough. git clone the main repo, cd "pgocaml", make && make doc. Add "pgocaml" in the dependency array. Use the functions "connect" and "execute" and here you are for the unsafe interface.
<Drup>
sure, I know a bit my way in the ocaml ecosystem, so I'm used to this stuff, but still, it's not *that* complicated.
<smondet>
Drup: by not complete I mean that the typing is not complete and some queries generate runtime errors (a join can make a non-null field null)
<smondet>
then you need to add the "nullable" thing
<Drup>
smondet: oh, that. yeah
<Drup>
(I though you were talking about pg datatypes)
<SrPx>
OK noobish question. Seems like I finally managed to install everything I needed. Yay! But js_of_ocaml is not on path. So where it is? [NOTE] Package js_of_ocaml is already installed (current version is 1.4.0).
yellowfish_ has quit [Ping timeout: 246 seconds]
<Drup>
how did you installed it ?
<SrPx>
Drup: with opam
<Drup>
did you do "eval `opam config env`" ?
<SrPx>
I had to even reinstall xcode ... that was hard
<SrPx>
hmm no?
<SrPx>
I did opam config env. Not eval?
<Drup>
you need to eval it
<Drup>
"opam config env" just return a string
<SrPx>
Okay (:
<SrPx>
makes sense
<SrPx>
dona, ty
<Drup>
then it should be in path
taylorj5 has joined #ocaml
taylorj5 has left #ocaml []
struktured has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 264 seconds]
RMacy is now known as RMacy|Away
RMacy|Away has quit []
talzeus has joined #ocaml
RMacy has joined #ocaml
<mk270>
drup: yeah, i am just alarmed at how much has to go into things which take just an apt-get or a pip install in other languages
<Drup>
mk270: if you are just bothered by the install part, use opam
<SrPx>
OK how do I create a factorial and export it? Just including a factorial function in the file, compiling it to bytecode and then calling js_of_ocaml doesn't produce anything that resembles a factorial inside the .js file. I have to export it somehow, right?
<SrPx>
Just a square, for example: "let square x = x * x;;" ... how do I export it, now?
<Drup>
apt/pip are not going to help you to use libraries, anyway
<mk270>
drup: i do, but it doesn't have all the stuff (no galax, for instance)
<Drup>
well, packages are proposed in opam by maintainer, as with debian/ubuntu repository, there is no magic about that
<Drup>
if it's not in opam, there is a good amount of chance that it's abandoned :/
<Drup>
SrPx: oh, you want to use the js generated by js_of_ocaml in js ? :D
<mk270>
yes, i guess it's a better quality filter than pip!
aurynj has joined #ocaml
<SrPx>
Drup: oh, I can't?!
<SrPx>
that was the purpose...
<Drup>
SrPx: because, the approach used by js_of_ocaml is to treat js as an assembly, corollary : the js output is unreadable.
<Drup>
oh, you can
<Drup>
but it's just not "nice" (for a webdev definition of nice) js.
<Drup>
the point is to build your whole webpage in ocaml :)
<Drup>
SrPx: look at the examples in the js_of_ocaml website
<SrPx>
I did... I know... at first all I wanted was to generate a few pure JS functions, though. If that worked well enough I'd try understanding the dom modules etc
<SrPx>
after all I will need to write javascript anyway, for webgl etc
<Drup>
no you wont :)
dsheets has joined #ocaml
<Drup>
well, maybe, a very little bit
<Drup>
but not a lot
<Drup>
I don't think trying to look at the generated js is the right approach
aurynj has quit [Remote host closed the connection]
<Drup>
It's like trying to learn ocaml by looking at the generated asm
<Drup>
I think my firefox is not very happy with webgl, I have random red dots on the border of the screen
<smondet>
no they are normal
<smondet>
it was to show the bounding box
<Drup>
oh, ok
<Drup>
then it's working fine :D
<smondet>
the code was a talk at NYC-OCaml
<SrPx>
... I just don't understand what I do with the resulting .js file, then. Compiled a Hello World but I don't see a Hello World on the file. Including it in an HTML file and opening = nothing happens. And trying to compile the examples with the command on the manual gives an error message.
q66 has quit [Ping timeout: 252 seconds]
<SrPx>
Sorry if I'm being annoying...
<Drup>
SrPx: what do you expect from a pure js function embended in a html file ?
<Drup>
SrPx: it's not going to do anything anyway
<Drup>
be it js_of_ocaml stuff or not
<SrPx>
Drup: a Hello World was my attempt... with print_string
<Drup>
print_string don't print in the html
<SrPx>
OK I guessed it did. My bad
<Drup>
no, you need the dom stuff for that
<Drup>
but you can open the debug console for your browser
<Drup>
it should print in it
<Drup>
not sure
<Drup>
at least, there is a js_of_ocaml function to print in it
yellowfish_ has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
<Drup>
smondet: it's quite nice, and not even very heavy in ressources.
<smondet>
Drup: yes there is a Lwt_js.sleep to calm everything down :)
<smondet>
let debug f = Printf.ksprintf (fun s -> Firebug.console##log(Js.string s)) f
<smondet>
this creates a printf-like function for the JS console
<SrPx>
Using -syntax, but no package is selected specifying a preprocessor as required for -syntax
<SrPx>
:( ok nevermind guys
<SrPx>
thanks
<Drup>
SrPx: where does this syntax errors comes from ?
<SrPx>
The problem is with the "-syntax camlp4o" option on the command "ocamlfind ocamlc -package js_of_ocaml -syntax camlp4o -linkpkg -o test.byte test.ml". Removing it works, but then it only compiles code without special javascript syntax (i guess?)
<Drup>
add "-package js_of_ocaml.syntax"
<Drup>
the syntax is not loaded by default, you need to add the right package for it
ygrek_ has joined #ocaml
<SrPx>
Yay! I managed to do it. I get it all now. Thank you (:
mcclurmc has joined #ocaml
philtor has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Drup>
SrPx: I must say, js_of_ocaml is not really designed for ocaml noobs ;)
<Drup>
it's not overly complicated, but it uses some feature that are not super simple, like the object system
<SrPx>
uh huh, I noticed it. the thing I really need is a simple, very simple functional language that compiles to fast javascript. :/ I like the project, though. I should probably invest some time in ocaml when I have it
mcclurmc has quit [Ping timeout: 244 seconds]
RMacy is now known as RMacy|Away
<SrPx>
if I understood it, by the way, performance is almost a non-issue with js_of_ocaml? as opposed to haskell->js compilers around, it seems.
RMacy|Away has quit []
<Drup>
performance is always an issue :p
<Drup>
(in js, I mean)
<Drup>
but at least, js_of_ocaml is not terrible from this point of view
<SrPx>
it would be nice to see some toy benchmarks such as a foldl sum over a very big list
angerman has quit [Read error: Connection reset by peer]
skchrko has joined #ocaml
angerman has joined #ocaml
arj has joined #ocaml
teiresias has quit [Ping timeout: 245 seconds]
csakatoku has quit [Remote host closed the connection]
teiresias has joined #ocaml
avsm has joined #ocaml
csakatoku has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
cago has joined #ocaml
milosn has joined #ocaml
rand000 has quit [Ping timeout: 244 seconds]
q66 has quit [Quit: Leaving]
sw1nn has joined #ocaml
ontologiae has joined #ocaml
cago has quit [Ping timeout: 249 seconds]
cago has joined #ocaml
mika1 has joined #ocaml
<mk270>
gday - does anyone here know how to use ctypes to represent a cyclic data structure in C, such as a linked list?
<mk270>
if you have e.g. struct elt { struct elt *next ; ... }; ?
ontologiae has quit [Ping timeout: 272 seconds]
hyperbor1ean is now known as hyperboreean
cago has quit [Ping timeout: 272 seconds]
q66 has joined #ocaml
angerman has quit [Write error: Connection reset by peer]
q66 has quit [Ping timeout: 252 seconds]
ygrek_ has quit [Ping timeout: 256 seconds]
aurynj has joined #ocaml
mye has joined #ocaml
tobiasBora has joined #ocaml
<tobiasBora>
Hello,
<tobiasBora>
I need to compute huge numbers on 32bits computers. However the numbers are greater than 2^31 so I need to use another structure : int64 or BigInt
mcclurmc has joined #ocaml
<bernardofpc>
tobiasBora: zArith
<bernardofpc>
I have a bug report pending on it (it seems not to dealloc properly) but I have not produced a minimal version of it
<tobiasBora>
I can see that Bigint are 20 times slower on my computer than int64 (I think it's a really huge difference...), but my computer is a 64bit computer so it's hard to know what would be the real time on 32bits computers. Any idea ?
<bernardofpc>
zArith is fast (because it uses gmp, which has been long optimized)
<tobiasBora>
bernardofpc: You wrote zArith ?
<bernardofpc>
no no
<bernardofpc>
people in INRIA did
<bernardofpc>
but I have used it ok
<bernardofpc>
IF your only problem is benchmarking Bigint vs int64 in x86 @ 32 bits, I can run your code
<bernardofpc>
I have a VERY LAME x32 at work
<tobiasBora>
Ok. And I think it's not in the default installed libraries ?
amirmc has joined #ocaml
<bernardofpc>
(no, it's not, but there are packages around, and there's opam)
mcclurmc has quit [Ping timeout: 244 seconds]
ontologiae has joined #ocaml
_andre has joined #ocaml
<bernardofpc>
(but mind you that int64 will only go as far as 2^63 - 1, which might be enough or not ; if it is, probably int64 should do ; if it's not, zArith might be the way to go)
<tobiasBora>
bernardofpc: Oh it doesn't bother you it would be very kind ! Here is my code : http://paste.ubuntu.com/6993991
siddharthv is now known as siddharthv_away
<tobiasBora>
In fact I think that it would be hard to go up to int64, but after some size it can be... So a great solution would be an efficient compute for numbers in the int64 interval, but no bugs if it goes after int64 bundary.
csakatoku has quit [Remote host closed the connection]
yacks has quit [Ping timeout: 272 seconds]
<tobiasBora>
Amazing...
<tobiasBora>
zArith is quite good... Only two times slower than Int64
<bernardofpc>
adrien_oww: well, if the proc is 64bit, but used in 32bit mode, maybe its 32bit operations are not as efficient as they would have been if it were a native 32bit proc
<tobiasBora>
But I find that a 8 factor is quite important, so I'll see if I can't build my own mini-lib (I only need the +1 operation)
<bernardofpc>
well, +1 is simple with a 2-word if you're using < 2^62 - 2
<adrien_oww>
tobiasBora: I meant, in order to switch from x32 to x86, you only need tha x86 ld.so file from libc so you can do it on the fly
<adrien_oww>
errr
<adrien_oww>
I mixed up people
<adrien_oww>
bernardofpc: no, it's at least as efficient
avsm has quit [Quit: Leaving.]
<adrien_oww>
but when you said x32, did you have in mind the ABI that uses 64b ints but 32b pointers? (i.e. a mix of x86_64 and x86)
<bernardofpc>
no, no
<bernardofpc>
The computer has a 64bit processor, but its kernel and OS are 32bit
<bernardofpc>
linux-i686 if you see
<bernardofpc>
(and as it has only 512 M of RAM, I'm not trying anything fancy with it)
<bernardofpc>
(because doubling pointer size will probably make firefox not fit in RAM)
<bernardofpc>
anyway
amirmc has joined #ocaml
mcclurmc has joined #ocaml
<adrien_oww>
right, so not what is called the "x32 ABI" (which is, imho, complete crap)
<tobiasBora>
I can't manage to beat zarith, even with a very simple array n-words, so I will use it... Thank you !
<adrien_oww>
(including its naming)
<adrien_oww>
zarith is really made with performance in mind :)
ygrek_ has joined #ocaml
skchrko has quit [Ping timeout: 264 seconds]
mcclurmc has quit [Ping timeout: 244 seconds]
skchrko has joined #ocaml
<tobiasBora>
That's what I see ^^ Thank you !
yacks has joined #ocaml
mye has left #ocaml []
tobiasBora has quit [Ping timeout: 246 seconds]
cago has joined #ocaml
angerman has quit [Read error: Connection reset by peer]
michael_lee has quit [Ping timeout: 244 seconds]
angerman has joined #ocaml
talzeus has quit [Remote host closed the connection]
Thooms has joined #ocaml
kaustuv has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
hto has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
hto has joined #ocaml
jonludlam has quit [Remote host closed the connection]
jonludlam has joined #ocaml
<kaustuv>
any authors of stog on this channel?
<adrien_oww>
zoggy is the main one iirc and he's not on the channel
Gu_______ has quit [Quit: Computer has gone to sleep.]
darkf has quit [Quit: Leaving]
ygrek_ has quit [Ping timeout: 264 seconds]
ontologiae has quit [Ping timeout: 246 seconds]
rand000 has quit [Ping timeout: 244 seconds]
sorethroat has joined #ocaml
nikki93 has joined #ocaml
amirmc has quit [Read error: Connection reset by peer]
amirmc has joined #ocaml
angerman has quit [Read error: Connection reset by peer]
talzeus has joined #ocaml
nikki93 has quit [Ping timeout: 244 seconds]
angerman has joined #ocaml
tobiasBora has joined #ocaml
angerman has quit [Read error: Connection reset by peer]
angerman has joined #ocaml
struktured has quit [Ping timeout: 272 seconds]
<kaustuv>
I'm a complete camlp4 noob. What is the reason for the syntax error here? http://pastebin.com/AJKx7s4k
<hcarty>
kaustuv: I think you need #camlp4o before the .syntax line
<hcarty>
kaustuv: Swap lines 4 and 5
tobiasBora has quit [Write error: Broken pipe]
<kaustuv>
no change regardless of how early I put the #camlp4o
<hcarty>
kaustuv: Maybe there is an issue with using the toplevel in a non-interactive way? Does the same code work if you copy and paste into a running toplevel?
<kaustuv>
Nops, same error in interactive use as well. That's how I discovered it anyway
<adrien_oww>
EmilPer: I'm mostly worried it might require knowledge of the ocaml runtime (I haven't checked though)
<adrien_oww>
seems simple enough
<hcarty>
adrien_oww: Using something which requires knowledge of the OCaml runtime is a wonderful way to learn OCaml :-)
<hcarty>
Tricky at times perhaps, but very effective
<kaustuv>
hcarty: I get that "error" as well
<hcarty>
kaustuv: The syntax extension works for me in utop
mgodshall has joined #ocaml
<kaustuv>
It works for me in the standard interactive top-level too, but I am completely mystified as to why it should matter whether I am interactive or not
<kaustuv>
But my patience with Camlp4 has run out for now and I'm off to do more productive things.
tobiasBora_ has quit [Write error: Broken pipe]
lostcuaz has joined #ocaml
<flux>
oh, opam doesn't have perl4caml.. it should, it's a great package :)
mcclurmc has joined #ocaml
<adrien_oww>
hcarty: definitely but at first it might be difficult :P
<adrien_oww>
kaustuv: have you looked at "ocamlscript"?
tobiasBora_ has joined #ocaml
Amanite has joined #ocaml
<hcarty>
adrien_oww: Indeed!
<Amanite>
god damnit my code won't run
<hcarty>
ocamlscript is quite nice. I find myself using it less and less as ocamlbuild improves.
<Amanite>
and I get a super ugly error message that's not helping
RMacy has quit []
kaustuv has left #ocaml []
<ggole>
Amanite: more info?
<Amanite>
fixed
<Amanite>
I was being stupid
<ggole>
...
<ggole>
Works for me.
<ggole>
(Probably a bit of rubber duck effect there.)
Zwify has joined #ocaml
<Amanite>
not really
<Amanite>
I just tried some stuff in the toplevel
<Amanite>
turns out you need to use parenthesis when using printf and char_of_int
<Amanite>
my algorithm was legit
nikki93 has joined #ocaml
<ggole>
As in, printf "%c" (char_of_int foo)?
<Amanite>
yeah
<Amanite>
printf "La lettre %c est présente %d fois. \n" (char_of_int(i+97)) t1.(i)
cago has quit [Quit: Leaving.]
Amanite has quit [Read error: Connection reset by peer]
cago has joined #ocaml
nikki93 has quit [Ping timeout: 246 seconds]
<Zwify>
Hello, I have a question about the internal behaviour of Ocaml :
tlockney_away is now known as tlockney
amirmc has joined #ocaml
nikki93 has joined #ocaml
<ggole>
Zwify: ?
amirmc has quit [Ping timeout: 244 seconds]
<Zwify>
Sorry, I'm not used to IRC channel, I write in notepad then coming back to you
<seliopou>
hey can anybody point me to a good resource on error handling in async?
<seliopou>
I've been coming across either deadlocks or silent failures in some code i'm writing, and am a bit stuck
NoNNaN has quit [Remote host closed the connection]
Kakadu has quit [Ping timeout: 245 seconds]
tobiasBora_ has quit [Write error: Broken pipe]
tobiasBora_ has joined #ocaml
mika1 has quit [Quit: Leaving.]
nikki93 has quit [Remote host closed the connection]
amirmc has joined #ocaml
cago has left #ocaml []
<Zwify>
Hello, I have a question about the internal behaviour of Ocaml : If I type : let t = ref [|a1;a2;a3|];; let taux = [|(!t).(0);(!t).(0);(!t).(0)|];; t:= taux;; Are the pointers a2 and a3 (and the data thay contain) automatically deleted ? Because unused after. Otherwise, is it possible to delete them manually ?
<Zwify>
thank you
<|jbrown|>
it depends when t goes out of scope
<ggole>
Yes, the GC eats anything which is unreachable in that way. There's no way for you to recover storage manually.
<|jbrown|>
oh, straight away. Missed a bit :-).
<adrien_oww>
unreachable implies out-of-scope
<adrien_oww>
(but not only)
r0b2 has quit [Ping timeout: 264 seconds]
<tobiasBora_>
And the whole array will be deleted and a1 will be copied again, or only a1 will stay alive in the array ?
<ggole>
Whatever is still reachable survives: whether anything is copied is an implementation detail
AdmiralBumbleBee has left #ocaml []
<Zwify>
And when we redifine t, is the first instance of t and his content unreachable?
<ggole>
The ref is still reachable, but now it points to something else
<ggole>
So the array that it was pointing to is gone.
mmachenry has joined #ocaml
<Zwify>
And Ocaml understands by itself that some of the content it was pointing to is now unreachable ? (if I understand)
<ggole>
Yes.
ygrek_ has quit [Ping timeout: 264 seconds]
<Zwify>
ok it is perfectly clear ! Thank you a lot.
<ggole>
No worries.
<adrien_oww>
Zwify: it starts with a set of "roots" and it will free everything that is not reachable through these roots
<mmachenry>
I am trying to overcome a design issue that in a object-oriented problem that would be made a lot easier if OCaml allowed for down casting or narrowing. I understand OCaml has a principled stance against down casting and I understand the stance. Still I'm wondering how an OCaml programmer would solve this problem since I don't like my solution.
<mmachenry>
Basically my design is for a MUD and the object hierarchy in question is for tangible objects. When modeling the real world without restrictions of programming language, I would say that all objects in the world are tangible, and some tangible objects are containers.
nikki93 has joined #ocaml
<mmachenry>
When a character in the MUD goes looking for an object, I have a list of top-level objects that are contained in the room. All of these are tangible objects. If the tangible is a container, I would like to call it's get_contents method to get a list of other tangibles.
<Zwify>
If it often (the GC) follows the children of the initial roots in order to delete unreachable pointers, it will cause a major cpu blow no ?
<mmachenry>
Thinking of this from a tree perspective, containers and tangibles form a tree where the leaves of the tree are tangibles that are not containers.
avsm has joined #ocaml
<mmachenry>
So my search algorithm in a dynamic language or a language with "instance of" would just List.iter over the items and check to see if 1) it was the item I'm looking for and if not 2) check if it's and instance of container and if so recur on the item's get_contents, which is a list of tangibles.
* adrien_oww
bets on :>
tobiasBora_ has quit [Write error: Connection reset by peer]
<ggole>
Zwify: GC can be a bit of a hit, but it isn't too bad
<mmachenry>
But naturally, since this program is written in OCaml, I cannot downcast container.
tobiasBora_ has joined #ocaml
<ggole>
Have everything provide get_contents, returning an empty list if it isn't a container?
<mmachenry>
So what I've done, sadly, is make all tangibles be containers, with simple tangible objects like a nail or a ball have an empty get_contents method. Whereas a backpack has a more interesting get_contents method.
<ggole>
Or maybe a list option if you don't like that
<ggole>
Right.
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
angerman has quit [Read error: Connection reset by peer]
<mmachenry>
ggole I do that now, yes.
<Zwify>
ggole : ok thanks
<mmachenry>
But… every tangible is a container? That's bothering me in my current implementation.
<ggole>
You could put a container option inside each tangible: non-container things would just have None.
RMacy has joined #ocaml
<ggole>
Or you could expose an "iterate contained things" function and implement the storage however you like.
angerman has joined #ocaml
<bitbckt>
mmachenry: why don't you use a tree-like ADT for this?
<bitbckt>
then recurse down the tree, instead of iterating over a list.
<mmachenry>
bitbckt: Object-orient programming seems like a natural fit for this project since there will be some many different tangibles and containers but only a small set of methods. The data will grow without bound but the functions are limited in space
<bitbckt>
I don't particuarly see the problem, there.
<bitbckt>
+l
<mmachenry>
+1?
<bitbckt>
the letter "l" - I misspelled "particularly"
<bitbckt>
use a better font ;-)
<mmachenry>
I see the difference, I just read it wrong because +l made even less sense to me and I read too quickly.
nikki93 has quit [Remote host closed the connection]
wolfnn has joined #ocaml
Dongyancai has quit [Ping timeout: 252 seconds]
r0b2 has joined #ocaml
Dongyancai has joined #ocaml
avsm has quit [Quit: Leaving.]
jwatzman|work has joined #ocaml
zpe has joined #ocaml
willb1 has quit [Ping timeout: 244 seconds]
mmachenry has quit [Quit: Leaving.]
sw1nn` has joined #ocaml
sw1nn` is now known as Guest21989
sw1nn has quit [Ping timeout: 264 seconds]
nikki93 has joined #ocaml
RMacy is now known as RMacy|Away
RMacy|Away is now known as RMacy
mmachenry has joined #ocaml
RMacy is now known as RMacy|Away
willb1 has joined #ocaml
RMacy|Away has quit []
lostcuaz has joined #ocaml
tristero has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
Kakadu has joined #ocaml
madroach has joined #ocaml
tobiasBora_ has quit [Write error: Broken pipe]
tobiasBora_ has joined #ocaml
skchrko has quit [Quit: Leaving]
boogie has joined #ocaml
nikki93 has quit [Remote host closed the connection]
RMacy has joined #ocaml
angerman has quit [Quit: Gone]
RMacy is now known as RMacy|Away
RMacy|Away has quit [Client Quit]
zpe has quit [Remote host closed the connection]
pango has quit [Quit: Client exiting]
zpe has joined #ocaml
tobiasBora_ has quit [Ping timeout: 246 seconds]
Guest21989 has quit [Ping timeout: 264 seconds]
rwmjones has quit [Read error: Operation timed out]
rwmjones has joined #ocaml
jwatzman|wor has joined #ocaml
dsheets has quit [Remote host closed the connection]
amirmc has quit [Quit: Leaving.]
mmachenry1 has joined #ocaml
mmachenry has quit [Quit: Leaving.]
mmachenry1 has quit [Client Quit]
jwatzman|work has quit [Ping timeout: 244 seconds]
adrien_o1w has joined #ocaml
demonimin_ has joined #ocaml
hto_ has joined #ocaml
nicoo_ has joined #ocaml
pango has joined #ocaml
demonimin has quit [Remote host closed the connection]
rand000_ has joined #ocaml
uggwar has quit [Write error: Broken pipe]
rand000 has quit [Write error: Broken pipe]
hto has quit [Write error: Broken pipe]
lostcuaz has quit [Ping timeout: 279 seconds]
saarin has quit [Ping timeout: 279 seconds]
lostcuaz has joined #ocaml
adrien_oww has quit [Remote host closed the connection]
nicoo has quit [Remote host closed the connection]
Simn has quit [Excess Flood]
jonludlam has quit [Excess Flood]
Simn has joined #ocaml
jonludlam has joined #ocaml
saarin has joined #ocaml
uggwar has joined #ocaml
mmachenry has joined #ocaml
rand000_ has quit [Quit: leaving]
dsheets has joined #ocaml
nikki93 has joined #ocaml
RMacy has joined #ocaml
Arsenik has joined #ocaml
nikki93 has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 264 seconds]
nikki93 has joined #ocaml
uggwar has quit [Ping timeout: 244 seconds]
nlucaroni has joined #ocaml
jzelinskie has quit [Ping timeout: 245 seconds]
RMacy is now known as RMacy|Away
RMacy|Away has quit []
jzelinskie_ has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ggole has quit []
tobiasBora_ has joined #ocaml
njcomsec has joined #ocaml
nikki93 has quit [Read error: Connection reset by peer]
jzelinskie_ has quit [Ping timeout: 245 seconds]
nikki93 has joined #ocaml
jzelinskie_ has joined #ocaml
jzelinskie_ is now known as jzelinskie
nikki93_ has joined #ocaml
nikki93 has quit [Read error: Connection reset by peer]
RMacy has joined #ocaml
smerz_ has joined #ocaml
smerz has joined #ocaml
lostcuaz has joined #ocaml
pango has quit [Ping timeout: 244 seconds]
ikaros has quit [Quit: Ex-Chat]
Guest21989 has joined #ocaml
Anarchos has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest21989 has left #ocaml []
pango has joined #ocaml
claudiuc has joined #ocaml
dsheets has joined #ocaml
claudiuc has quit [Read error: Connection reset by peer]
ontologiae has quit [Ping timeout: 244 seconds]
claudiuc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
Eyyub has joined #ocaml
mcclurmc has joined #ocaml
mmachenry has quit [Quit: Leaving.]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
pango has quit [Ping timeout: 246 seconds]
pango has joined #ocaml
mmachenry has joined #ocaml
mmachenry has quit [Client Quit]
rand000 has joined #ocaml
lostcuaz has joined #ocaml
lostcuaz has quit [Read error: Connection reset by peer]
lostcuaz has joined #ocaml
WraithM has quit [Quit: Lost terminal]
lostcuaz has quit [Client Quit]
WraithM has joined #ocaml
lostcuaz has joined #ocaml
comacat has joined #ocaml
aurynj has quit [Ping timeout: 272 seconds]
<Anarchos>
i am looking for a presentation about ocaml to show at my work
_andre has quit [Quit: leaving]
<bernardofpc>
what kind of ?
nikki93_ has quit [Read error: Connection reset by peer]
nikki93 has joined #ocaml
mmachenry has joined #ocaml
<Anarchos>
bernardofpc to show them benefit over java (type, speed, concision, fancyness, ...)
Arsenik has quit [Remote host closed the connection]
<bernardofpc>
there are two videos, and both are nice
<bernardofpc>
In one (or even maybe both) Yaron stresses "type-guided coding" (using Sum / Algebraic types for better describing your variables) which has been a truly rewarding mindset
mmachenry has quit [Quit: Leaving.]
mmachenry has joined #ocaml
nikki93 has quit [Remote host closed the connection]
rz has joined #ocaml
ontologiae has joined #ocaml
nikki93 has joined #ocaml
<bernardofpc>
Anarchos: from min 18 up in the first video
<Anarchos>
bernardofpc ok i will look
mmachenry has quit [Quit: Leaving.]
rz has quit [Ping timeout: 290 seconds]
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #ocaml
jwatzman|wor has quit [Quit: jwatzman|wor]
<bernardofpc>
(the part at 43' about "people don't read dull code" seems sooooo in time for the Apple bug :p)
mmachenry has joined #ocaml
ollehar has quit [Quit: ollehar]
Kakadu has quit [Quit: Konversation terminated!]
RMacy has quit []
mcclurmc has quit [Remote host closed the connection]
mmachenry has quit [Quit: Leaving.]
shinnya has joined #ocaml
axiles has quit [Remote host closed the connection]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<def-lkb>
This reminds me of the underhanded C contest.
<emias>
adrien: But every static analyzer would've cried out loud. The thing I don't understand is why Apple's build setup doesn't seem to have an analyzer abort the build in such a case (until it isn't explicitly acknowledged). Failing that, proof-reading should've cought it, yes.
Zerker has joined #ocaml
<def-lkb>
It could almost be an intentional flaw disguised as a mistake to innocently weaken the whole ssl stack.
tobiasBora_ has quit [Quit: Konversation terminated!]
jwatzman|work has joined #ocaml
jao has quit [Ping timeout: 244 seconds]
comacat has quit [Quit: Lost terminal]
mmachenry has quit [Quit: Leaving.]
Zerker has quit [Quit: Colloquy for iPad - Timeout (10 minutes)]
tautologico has joined #ocaml
tlockney is now known as tlockney_away
comacat has joined #ocaml
Eyyub has quit [Ping timeout: 246 seconds]
tlockney_away is now known as tlockney
_5kg_ has joined #ocaml
mmachenry has joined #ocaml
Eyyub has joined #ocaml
arjunguha has joined #ocaml
smerz has quit [Ping timeout: 245 seconds]
smerz_ has quit [Ping timeout: 245 seconds]
<nlucaroni>
bitbckt: that makes sense why it isn't included.
rand000 has quit [Quit: leaving]
nlucaroni has quit [Quit: leaving]
mmachenry has quit [Quit: Leaving.]
struktured has joined #ocaml
mmachenry has joined #ocaml
mmachenry has quit [Client Quit]
Thooms has quit [Quit: WeeChat 0.3.8]
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkf has joined #ocaml
mmachenry has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
hto has joined #ocaml
jwatzman|work has joined #ocaml
madroach has quit [Ping timeout: 252 seconds]
everyonemines has joined #ocaml
arjunguha has joined #ocaml
madroach has joined #ocaml
Eyyub has quit [Ping timeout: 244 seconds]
mmachenry has quit [Quit: Leaving.]
ontologiae has quit [Ping timeout: 244 seconds]
NoNNaN has quit [Remote host closed the connection]
csakatoku has joined #ocaml
Simn has quit [Quit: Leaving]
q66 has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
wolfnn has quit [Ping timeout: 272 seconds]
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]