walter has quit [Quit: This computer has gone to sleep]
wagle has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
walter has joined #ocaml
amaloz has quit [Remote host closed the connection]
Icarot has joined #ocaml
Icarot has quit [Ping timeout: 255 seconds]
walter has quit [Quit: This computer has gone to sleep]
yacks has joined #ocaml
derek_c has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
cdidd has joined #ocaml
pango_ has joined #ocaml
pango has quit [Ping timeout: 245 seconds]
q66 has quit [Remote host closed the connection]
walter has joined #ocaml
pango_ is now known as pango
Icarot has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
gustav_ has quit [Ping timeout: 258 seconds]
gustav_ has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 240 seconds]
emmanuelux has quit [Remote host closed the connection]
darkf_ is now known as darkf
ontologiae has quit [Ping timeout: 264 seconds]
tautologico has quit [Quit: tautologico]
ggole has joined #ocaml
<darkf>
what would be the best way to go about doing C FFI at runtime? (I'm implementing a programming language, and I'd like to be able to bind libraries like SDL within it)
Icarot has quit [Ping timeout: 252 seconds]
mapf has quit [Read error: Connection reset by peer]
<ggole>
Take a look at how lua does it
<ggole>
It has a superb, and very usable ffi interface
<darkf>
ggole: well in that case I'd have to write a C bridge, is there nothing in the OCaml stdlib? (probably not, heh)
<ggole>
How are you going to avoid that? Fundamentally you need logic to map C structures into your structures.
<ggole>
Of course it's a lot of work to write by hand, or to write a generator
<darkf>
yep, that's true, I just wished ocaml-ffi worked at runtime too instead of just generating static bindings :) oh well, if I did it myself it wouldn't be cross-platform (dlsym vs GetProcAddress etc)
derek_c has quit [Read error: Operation timed out]
Yoric has quit [Ping timeout: 256 seconds]
gnuvince has quit [Ping timeout: 252 seconds]
Yoric has joined #ocaml
mye has joined #ocaml
<adrien>
lua might have a simple ffi, it probably doesn't apply to your language
<adrien>
the first question is how close the memory representation of your compiled code will be to C's
<adrien>
how's the memory management
<orbitz>
Do you just need to install .cmx's or also .cmo's?
<adrien>
cmx
<adrien>
they contain inlining information; cmo don't
<orbitz>
ok
<adrien>
for native code, the code is in the .o files (later on, .a files)
<orbitz>
so cmxa, cma, and mcx
<orbitz>
cmx
<adrien>
for bytecode, you only have the code in .cmo and later on .cma
<adrien>
cmxs possibly
<adrien>
and .a and .cmi
<orbitz>
I don't seem to have cmxs files, whatare they
Snark has joined #ocaml
wwilly has joined #ocaml
<pippijn>
orbitz: plugins
<pippijn>
orbitz: .so files for ocaml
yacks has quit [Quit: Leaving]
<orbitz>
ok
ontologiae has joined #ocaml
<adrien>
my ocaml .exe files on windows are really shrunk with upx
<adrien>
I had one that was 1.8MB; stripped it got down to 1.2MB
BiDOrD has quit [Ping timeout: 260 seconds]
<adrien>
non-stripped but upx got it to a bit less than 1.2MB
BiDOrD has joined #ocaml
<adrien>
stripped and upx got it to less than 400K
<adrien>
but it gets even better results for wget
<adrien>
but it really hampers compression with 7zip (and probably xz)
<adrien>
after upx compression, I get things down to 1.18MB
<adrien>
without it, the 7zip archive is 850K
Anarchos has joined #ocaml
belaid has joined #ocaml
contempt has quit [Ping timeout: 248 seconds]
contempt has joined #ocaml
mye has quit [Quit: mye]
ollehar has joined #ocaml
<wmeyer>
adrien: hey
<adrien>
o/
<wmeyer>
\o
<adrien>
oh, btw, lost my gmail account and that's where I was getting all the ocaml-related stuff
<wmeyer>
you lost your gmail account?!
<wmeyer>
damn it
<adrien>
I need to try a few passwords but I had had to reauthenticate several times since the last time I had changed it so...
<adrien>
anyway, I was moved away from it but I'm losing the history and I wasn't fully done yet
<wmeyer>
i strongly rely on gmail :-)
<wmeyer>
just changed password yesterday
<adrien>
well, notk.org is a safe place with many features so I tend to prefer it ;-)
<wmeyer>
i mean i rely, because i have tons of emails
ulfdoz has joined #ocaml
<adrien>
annoying thin is with accounts: change your password? confirm by mail...
<wmeyer>
i didn't see this, at least when i changed it last day
<adrien>
I mean, on several websites
<wmeyer>
however message immediatelly popped up in mobile
<adrien>
basically all of them actually
<wmeyer>
if the gmail is the dead end
<wmeyer>
you have troubles
<adrien>
it should be fine; I'll probably have to take some time
<wmeyer>
yes, you should not worry
<adrien>
like on the ocaml forge, I'm not sure I won't need the email but I can put my new email address in commits which should be enough
<wmeyer>
but in general this security faff is funny, actually helps
<adrien>
(actually it's already there)
<adrien>
it's true the email stuff is really bad; you ought to be able to put several mailboxes
<adrien>
it's actually 0 redundancy
<wmeyer>
yeah, it's bad
<wmeyer>
but that's how this works
<adrien>
I have no idea whether the issue is google or I; if it's because of me, maybe I don't remember having changed it or I don't remember a couple characters or I've simply forgotten it like you can forget anything
<adrien>
anyway, not a big issue but I'll still try to login again
<wmeyer>
it's crazy isn't it ..
<wmeyer>
well do your best if not go directly
<wmeyer>
it happens sometimes
<adrien>
it's already been 3 days, I still can't login (although I haven't tried yesterday) :P
<adrien>
this reminds me I need to backup my SSH keys :D
<orbitz>
backing up SSH keys, doesn't that defeat the purpose? :)
<adrien>
hard disk failures...
<adrien>
I had to rescue my HD something like one month ago
<adrien>
my _only_ concern was cryptographic keys ;-)
sysopfb has joined #ocaml
<orbitz>
i usualy setup multiple ssh keys so I don't have to back up and can kill ech one individaully
<adrien>
I don't backup anything explicitely but everything valuable I have is on git :D
<orbitz>
hah, git! you backup solution of choice!
<orbitz>
the benefits of being popular!
<adrien>
or having several servers that are usable
<wmeyer>
not everything can be kept on git though ....
<adrien>
yeah, music... ='(
<wmeyer>
:(
sysop_fb has quit [Ping timeout: 260 seconds]
<adrien>
but I know how to rescue hard drives so music isn't a huge issue
<orbitz>
i have 4 backusp of music, sadly they are all physcailly in the same place, so they help for hardware failure, but not fire
<adrien>
I mean, everything won't be unrecoverable, only some
<adrien>
as long as the data can be obtained again, I'm fine with it :-)
<wmeyer>
did you add directory with .cmi? are you using #require?
<wmeyer>
ah works via repl sorry
<orbitz>
wmeyer: no it works in one place wit hrepl but not inthe install location
<orbitz>
looks like it can't find my cmi..
mcclurmc has joined #ocaml
<orbitz>
yep, i'm being a doofu!
<orbitz>
doofus
<adrien>
it's something _very_ annoying and _very_ error-prone in ocaml
<orbitz>
success!
<adrien>
I'm not sure why it doesn't say "hey, can't find the .cmi file; I'll pretend I've succeeded but I won't actually work properly!"
<orbitz>
well, I should be a good boy and use oasis
<orbitz>
but then I'd miss out on all this fun
<adrien>
:-)
<adrien>
btw, oasis vs. ocp-build might be an annoying fight since their features overlap
<adrien>
and ocp-build might well reduce the use of oasis (since oasis is a sanity layer between you and ocamlbuild)
<orbitz>
All I want is for a tool to make me a Makefile :)
<orbitz>
thank god for opam pinning btw
awm22 has joined #ocaml
<Anarchos>
something is broken in trunk revision of ocaml...
<Anarchos>
Have someone sucessfully compiled revision 13397 ?
<adrien>
that's not trunk btw
<adrien>
it's 4.00.1
<adrien>
+
awm22 has quit [Quit: Leaving.]
<Anarchos>
adrien no the last trunk revision is 13397
<adrien>
13396 :P
<Anarchos>
adrien but did you succeed to compile it ?
<adrien>
haven't tried; I'm a bit earlier than that
<adrien>
Damien Doligez has commited a huge whitespace patch that has completely destroyed some of my patchs and I haven't updated them yet
<Anarchos>
adrien do you know how i can got earlier revs but still keep my local changes ?
<adrien>
nope
<adrien>
well, I know with git but not svn
<Anarchos>
i hate those control sources tools
<Anarchos>
never understand how they work with branches and all that stuff..
<adrien>
well, git's concept of branch is very simple (more than svn's)
<adrien>
a branch is list of commits
<adrien>
that's it :P
<adrien>
and no need to keep the various lists synchronized: as many as you want and in any place you want (several computers, several directories, ...)
ontologi1e has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 240 seconds]
darkf_ is now known as darkf
ollehar has quit [Ping timeout: 264 seconds]
ottbot has joined #ocaml
ontologiae has joined #ocaml
ontologi1e has quit [Ping timeout: 252 seconds]
<wmeyer>
adrien: please do submit patches, I'll have time this week.
<adrien>
I'm busy with a few adjustements for yypkg and the packages on windows currently
<adrien>
not much left but I'm aiming for release early next week
<wmeyer>
adrien: the three patches are pending, I checked them, have feedback, and probably fix them myself. But before that want to make sure it's going to cross compile on anything else than mingw.
<wmeyer>
adrien: yeah, and your gmail and hdd failure ;/
<wmeyer>
:(
<wmeyer>
adrien: so no rush then, I'll try to make a sweep over rest, so at least you will have a chance to look at it later.
<adrien>
only a few things left to do: sfx installer and a script to automate its creation, fixup gcc's specs file (almost done), minimal bsdtar to bundle with, an issue when linking
<adrien>
that's not too much so I'll be updating the patches soon ;-)
<wmeyer>
adrien: Ok
<wmeyer>
adrien: sounds good.
<wmeyer>
we can pipe the communication to to email if you prefer, like previously
<wmeyer>
is it ok to post music here, or I'll be harrased by gasche ;-)
<adrien>
did I meantion my laptop's sound chipset had burnt? :D
<wmeyer>
adrien: nope, but you have still your headphones - use it in this situation! :P
<adrien>
the sound card, not the speakers :-)
<adrien>
s/)/(/
<wmeyer>
ah yes
<adrien>
but I'll get it and play it in the living room
<wmeyer>
sorry, i thougt it's less serious
<adrien>
(people are surprised when you control music over the network...)
<adrien>
oh, laptop was fairly inexpensive, I knew I'd kill it
* adrien
afk, f00d!
metasyntax has joined #ocaml
ottbot has quit [Ping timeout: 240 seconds]
<Anarchos>
adrien how do you send music from laptop to living room ?
<orbitz>
Bluetooth!
ulfdoz has quit [Read error: Operation timed out]
<rks_>
Anarchos: you need a nexus Q for that ;)
eikke has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
<Anarchos>
rks_ ok... I thought i could send files to my box through local network
<rks_>
.. I was trolling :p
ottbot has joined #ocaml
ontologiae has joined #ocaml
<orbitz>
Helo, anyone know how i can tell opam "for THIS package version pin to THIS dir"?
<wmeyer>
orbitz: I believe it's not possible; many times in case of opam I was proved wrong however.
<orbitz>
hrm that's a bummer
<orbitz>
the version of async I want doesn't build properly on NixOS
<orbitz>
so I just want to force it to a dir i have modified
<wmeyer>
orbitz: ask Thomas, if it does not appear but is a useful feature, then maybe you will have it later. I believe this would be fairly hairy feature, breaking some abstractions, so better not, but maybe there is a solid reason.
<wmeyer>
maybe just dirty shell script would do the math
<orbitz>
yeah probably
<orbitz>
pull request sent, whooohaw
ollehar has joined #ocaml
<wmeyer>
:-)
ottbot has quit [Ping timeout: 264 seconds]
bernardofpc has joined #ocaml
<orbitz>
thomas is so fast!
<avsm>
what's with the 0.0.0?
<bernardofpc>
Is there a reason to tag/untag/tag int's inside a function ?
<wmeyer>
bernardofpc: when you pass it around to other builtin or function or closure it needs to be value. Maybe we can do better with a proper inliner etc.
<companion_cube>
I think someone at ocamlpro is working on inlining
<bernardofpc>
(It has two "asm problems", the hardest being not capturing mod and quotient in one instruction
<wmeyer>
companion_cube: I think Pierre Chambart mentioned when OCamlPro were visiting CB it's being worked on.
<adrien>
Anarchos: I rsync my music to another computer which is in the living room
<adrien>
this computers does a couple thing: play music and videos
<adrien>
and compile and package ;-)
<wmeyer>
adrien: and then MPD with your mobile? :-)
<wmeyer>
sounds good to me
<adrien>
mplayer actually
<adrien>
mplayer + zsh
<adrien>
it plays more formats
<wmeyer>
I think mpd does not need rsync, or you can use liquid soap for streaming from URL.
<adrien>
basically: cd /some/place; mplayer **/*
<adrien>
heheh
<companion_cube>
wmeyer: CB?
<wmeyer>
companion_cube: Cambridge
<companion_cube>
oh, ok
<eikke>
is there any primop in the compiler ('%foo' function) which takes a string from source all the way to asm generation?
<wmeyer>
I will let go the rest of the improvement patches Adrien, but not today
<adrien>
eikke: what do you mean? something that would let you write your own asm inside ocaml?
<adrien>
wmeyer: ok, no problem
<adrien>
yypkg runs fine on windows right now so the patches at least aren't completely bad
<eikke>
adrien: no, adding a new primop which needs compile-time strings from the ml source
<adrien>
I have a couple more things which are less important too; I'll add them for the next round
<adrien>
eikke: I don't understand =/
<companion_cube>
something I wish OCaml had, also, is unboxed types (or "value types", iirc)
<companion_cube>
like, for binary tuples, for instance
ulfdoz has joined #ocaml
<eikke>
adrien: well, if I write in ocaml source %myfun "
<eikke>
adrien: well, if I write in ocaml source '%myfun "abc"', I can add the %myfun primop up to asm generation, but I dont see how to pass the string with it all the way down
<adrien>
the string is an argument?
<avsm>
eikke: best to add your own primop to lambda.mli
<eikke>
sorta... it's a constant at compile time
<eikke>
avsm: that's what I did: "Pmyfun of string"
Neros has joined #ocaml
<eikke>
but then I'm stuck in translcore
<avsm>
eikke: you could hack primitive.ml and Pccall
notk0 has joined #ocaml
<avsm>
it's already got a "noalloc" decorator, for example
<eikke>
aha, interesting
<notk0>
hello, if I know I have a certain sum type that is of a type, how can I "cast" it in that type? sort of a match to assign it to the type I want
<notk0>
?
<bernardofpc>
other question, is why OCaml makes 2%register + 1 and compares to 1, instead of comparing simply to zero...
<eikke>
bernardofpc: because of integer tagging?
rwmjones has quit [Ping timeout: 264 seconds]
<bernardofpc>
if it wants to compare the result of an int operation to an int literal, shouldn't it do that before tagging ?
<bernardofpc>
case in point, compare the result of a mod b to zero
<bernardofpc>
it untags, idivs, retags and compares to 1
<ggole>
My guess, if the div raises an exception registers will contain unexpected values, which may be a GC problem
<bernardofpc>
ggole: but then the div will raise an exception before the retag, wouldn't it ?
<bernardofpc>
(and the "test for zero" is there to avoid at least the simplest one)
<ggole>
Yes, and that may not play nice with OCaml's exception machinery
<orbitz>
avsm: When fixing opam packages, we do thsoe in-place right? It's just if version of the package changes we bump?
<ggole>
I don't actually know the answer though
<ggole>
This is just speculation
<mfp>
I'm surprised it has raised seemingly no attention so far, inlining in HOFs is quite a big deal
<eikke>
avsm: using the Primitive thing, looks like I'd need a parser extension etc as well, that ain't nice :(
<companion_cube>
orbitz: I see you're using Core, how do you compare it to batteries?
martin__ has joined #ocaml
<wmeyer>
eikke: maybe you can use new mechanism once we got that on trunk, and completed.
<wmeyer>
(meant extension points + attributes)
<eikke>
wmeyer: any place with more info?
<orbitz>
companion_cube: I have not used batteries so I can't say. Howeer I feel core is very clean and I appreciate their lack of compatibility with stdlib
<orbitz>
sicne I think stdlib has a poor interface
<companion_cube>
aw
<ggole>
The stdlib is pretty poor
<ggole>
Inconsistent, missing bits everywhere, and some things are just poorly thought out
cdidd has quit [Remote host closed the connection]
ttamttam has left #ocaml []
<notk0>
hello, is it possible to have a anonymous function that has a state?
<notk0>
a variable? like static in C?
<notk0>
or similar?
<notk0>
for example a function that has a counter and everytime it's called returns a higher number
<notk0>
but anonymous
<wmeyer>
sure, you look for a closure with reference cell
derek_c has quit [Ping timeout: 248 seconds]
<wmeyer>
like this: let make_counter = let count = ref 0 in fun () -> count := count + 1; !count;; let count0 = make_counter();; let count1 = make_counter();; let _ = count1(); count1(); count0(); count0();
<notk0>
oh I Wanted to ask this in another channel sorry
<notk0>
in #scala I know how to do this in ocaml
<wmeyer>
in Scala: def makeCounter() : () => int = { var count = 0; {() => count = count + 1; count } }
<wmeyer>
(same)
<notk0>
hm let me try that
<notk0>
wmeyer: thank you, that seems to work, but your example needs to be applied twice
<notk0>
wait I think I copied it wrong
<notk0>
wmeyer: thank you , In ocaml I used to know to do it using let, in a function do let ref etc, I didnt know you could write it like that
ggole has quit [Quit: Ex-Chat]
<wmeyer>
notk0: you are welcome. Keep in mind that Scala *is* a functional language with pattern matching etc.
<wmeyer>
some people in Scala community forget about this notk0
<notk0>
wmeyer: I have some experience with functional languages but don't have the functional mentality
djcoin has joined #ocaml
<wmeyer>
it's not too difficult, but may take some time. Unfortunately Scala does not enforce the functional style as much as OCaml.
<wmeyer>
my advice notk0 is to try always first functional way
<notk0>
I don't mean as lack of knowledge, I mean my way of thinking is not function centered...
<wmeyer>
and then if that fails, try other means of abstraction
<wmeyer>
then first try to do it using functions and closures and forget about objects - resort to them when you need it. Use objects as modules, or for interfacing with JVM.
<wmeyer>
Scala does work out the integration quite well
<wmeyer>
so it's easy to write just Java in Scala
<wmeyer>
in your case, the counter with closure I'd hesistate to use closure the same way as hesistating to use object for that
<wmeyer>
closure is more lightweight
<notk0>
don't closures cost more performance wise?
<wmeyer>
the answer is probably not, as they get compiled the same way as classes and objects
Cyanure has quit [Remote host closed the connection]
<wmeyer>
closures will not cost here, you are creating the closure once per your "counter object" not with every invokation of bind like in Haskell
derek_c has joined #ocaml
zbroyar has left #ocaml []
notk0 has quit [Remote host closed the connection]
<orbitz>
don't worry about cost until it's a problem unless you're really smart
manud has joined #ocaml
Snark has quit [Quit: Quitte]
watermind has joined #ocaml
Anarchos has joined #ocaml
adotbrown has joined #ocaml
ottbot has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 256 seconds]
eikke has quit [Read error: Operation timed out]
<wmeyer>
orbitz: I've never experienced bad performance in OCaml apart from obvious mistakes with algorithms, but mistakes that type level does not catch happen unfortunately
<adrien>
the type system should forbid nested loops
<wmeyer>
nested loops are fine, worse when you call something like fibonanci
<wmeyer>
because you permute too much
<wmeyer>
but nesting > 4 is also not fun :-)
<adrien>
if only you could explain that to the curl developpers
<Anarchos>
let a = [],[] and b = a,a and c= b,b and ...
<adrien>
6 nested loops in their ./configure; a few thousands possibilities; each one spawns a GCC process
<wmeyer>
curl developpers perhaps are not proper lone Caml riders like we
<wmeyer>
adrien: Jesus.
<wmeyer>
and it's not native code, and each one spawns gcc
<adrien>
they have a list of possible parameter types to select (plus the return one) and try each combination until they find the one that matches the system's select()
Kakadu has quit []
<adrien>
it's also awful because from one run to another, the error message is very close and when you read the logs, it looks like it's always the same
eikke has joined #ocaml
ottbot has joined #ocaml
<wmeyer>
adrien: sounds like they configure script should be written in OCaml
<wmeyer>
they do compliacted trickery
alkabetz has joined #ocaml
Yoric has joined #ocaml
ottbot has quit [Read error: Connection reset by peer]
adotbrown has quit [Ping timeout: 258 seconds]
djcoin has quit [Ping timeout: 256 seconds]
<adrien>
well, easiest thing would be to sort the parameters they try so the most common cases are tried first
<wmeyer>
yes, so sort them in Bash
<adrien>
and they could probably do it linearly
<wmeyer>
is it M4 generated?
<adrien>
instead of n*m*p*q*r*s tries, n+m+p+q+r+s
<wmeyer>
means autoconf?
<adrien>
written by hand in the script
<adrien>
well, not sure about the source but that's how it looks like
<wmeyer>
but why Curl has such highed requirments
<adrien>
when I saw it, I closed the file quite quickly
<adrien>
you should see how many tests wget has ;-)
<wmeyer>
;-)
<adrien>
770 lines of "checking ..." in my build :-)
<wmeyer>
they are polishing this scripts whole life, just to make sure it works with outdated technology
* adrien
bed, good nighg
<adrien>
tnight*
<adrien>
:-)
<wmeyer>
good night!
adotbrown has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
derek_c has quit [Ping timeout: 256 seconds]
anderse has quit [Quit: anderse]
flx_ has joined #ocaml
manud has quit [Quit: Leaving]
flux has quit [Ping timeout: 256 seconds]
flx_ is now known as flux
tane has quit [Quit: Verlassend]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]