00:04
eikke_ has quit [Ping timeout: 240 seconds]
00:05
rand000 has quit [Quit: leaving]
00:12
eikke_ has joined #ocaml
00:20
dapz has joined #ocaml
00:20
penglingbo has joined #ocaml
00:25
penglingbo has quit [Ping timeout: 240 seconds]
00:30
hhugo has quit [Quit: Leaving.]
00:35
zarul has quit [Read error: Connection reset by peer]
00:36
zarul has joined #ocaml
00:36
zarul has quit [Changing host]
00:36
zarul has joined #ocaml
00:38
hhugo has joined #ocaml
00:39
eikke_ has quit [Ping timeout: 255 seconds]
00:39
jwatzman|work has quit [Quit: jwatzman|work]
00:40
eikke_ has joined #ocaml
00:46
hhugo has quit [Ping timeout: 240 seconds]
00:47
racycle has quit [Quit: ZZZzzz…]
00:57
oriba has quit [Quit: Verlassend]
01:01
alpounet has joined #ocaml
01:06
alpounet has quit [Ping timeout: 245 seconds]
01:06
thomasga has joined #ocaml
01:08
q66 has quit [Quit: Leaving]
01:18
hhugo has joined #ocaml
01:18
araujo has joined #ocaml
01:18
araujo has joined #ocaml
01:20
ygrek has joined #ocaml
01:21
<
aggelos_ >
hmm, forkwork seems to exhibit some very weird behavior
01:22
<
aggelos_ >
the heap blows up in some of the worker processes, /before any of my computation takes place/
01:22
thomasga has quit [Quit: Leaving.]
01:22
<
aggelos_ >
that's according to one debug statement, which I'm fairly sure is not delayed due to buffering
01:23
<
aggelos_ >
yet when I add debugging statements at every program point up to that original statement, allocation behavior changes: now the workers don't all start with the same heap_words, instead I observe that heap_words remains steady throughout their lifetime
01:24
<
aggelos_ >
(this is through Gc.alert)
01:24
<
aggelos_ >
sorta stumped here, any ideas?
01:25
<
aggelos_ >
(I have verified the correlation of the debug statements to the change in allocations by going back and forth)
01:26
eikke_ has quit [Ping timeout: 240 seconds]
01:27
<
aggelos_ >
heap_words blowup seems exponential btw
01:29
araujo has quit [Quit: Leaving]
01:31
ontologiae has quit [Ping timeout: 245 seconds]
01:49
Eyyub has quit [Ping timeout: 240 seconds]
02:01
rgrinberg has quit [Quit: Leaving.]
02:01
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
02:03
jknick has quit [Quit: Lost terminal]
02:07
ygrek has quit [Ping timeout: 255 seconds]
02:17
ebzzry_ is now known as ebzzry
02:18
manizzle has quit [Ping timeout: 272 seconds]
02:20
penglingbo has joined #ocaml
02:22
hhugo has quit [Quit: Leaving.]
02:27
ygrek has joined #ocaml
02:30
studybot_ has joined #ocaml
02:33
shinnya has quit [Ping timeout: 255 seconds]
02:36
rgrinberg has joined #ocaml
02:40
hhugo has joined #ocaml
02:40
hhugo has quit [Client Quit]
02:49
hhugo has joined #ocaml
02:53
ousado has quit [Remote host closed the connection]
02:56
WraithM has quit [Quit: leaving]
02:56
philtor_ has joined #ocaml
03:02
alpounet has joined #ocaml
03:04
parcs has quit [Remote host closed the connection]
03:07
alpounet has quit [Ping timeout: 255 seconds]
03:08
philtor_ has quit [Ping timeout: 272 seconds]
03:10
parcs has joined #ocaml
03:17
racycle has joined #ocaml
03:17
hhugo has quit [Quit: Leaving.]
03:18
manizzle has joined #ocaml
03:48
divyanshu has joined #ocaml
03:57
racycle has quit [Quit: ZZZzzz…]
03:57
samebchase has quit [Ping timeout: 240 seconds]
03:59
xaimus has quit [Ping timeout: 276 seconds]
04:00
xaimus has joined #ocaml
04:05
divyanshu has quit [Quit: Computer has gone to sleep.]
04:08
samebchase has joined #ocaml
04:11
rgrinberg1 has joined #ocaml
04:11
rgrinberg has quit [Ping timeout: 244 seconds]
04:19
rgrinberg1 has quit [Quit: Leaving.]
04:21
dapz has joined #ocaml
04:24
dapz has quit [Client Quit]
04:24
dapz has joined #ocaml
04:27
divyanshu has joined #ocaml
04:36
boogie has joined #ocaml
04:40
rgrinberg has joined #ocaml
04:41
claudiuc_ has quit [Remote host closed the connection]
05:00
ggole has joined #ocaml
05:03
racycle has joined #ocaml
05:09
WraithM has joined #ocaml
05:21
racycle has quit [Quit: ZZZzzz…]
05:28
ddosia has quit [Remote host closed the connection]
05:31
boogie has quit [Remote host closed the connection]
05:45
WraithM has quit [Ping timeout: 272 seconds]
05:45
ygrek_ has joined #ocaml
05:46
ygrek_ has quit [Remote host closed the connection]
05:46
ygrek has quit [Remote host closed the connection]
05:47
ygrek_ has joined #ocaml
05:49
f[x] has joined #ocaml
05:52
ygrek_ has quit [Ping timeout: 244 seconds]
06:04
rgrinberg has quit [Quit: Leaving.]
06:05
Hannibal_Smith has joined #ocaml
06:06
jao has quit [Ping timeout: 245 seconds]
06:08
rgrinberg has joined #ocaml
06:10
f[x] has quit [Remote host closed the connection]
06:10
rgrinberg has quit [Client Quit]
06:13
ygrek has joined #ocaml
06:16
ygrek has quit [Remote host closed the connection]
06:18
Arsenik has joined #ocaml
06:18
WraithM has joined #ocaml
06:20
rgrinberg has joined #ocaml
06:23
NoNNaN has quit [Remote host closed the connection]
06:24
weykent has quit [Ping timeout: 240 seconds]
06:28
Arsenik has quit [Remote host closed the connection]
06:28
weykent has joined #ocaml
06:29
NoNNaN has joined #ocaml
06:35
pyon has quit [Read error: Connection reset by peer]
06:38
BitPuffin has joined #ocaml
07:00
parcs has quit [Read error: Connection reset by peer]
07:00
octachron has joined #ocaml
07:04
Averell has quit [Ping timeout: 245 seconds]
07:05
ddosia has joined #ocaml
07:06
manizzle has quit [Ping timeout: 245 seconds]
07:06
Simn has joined #ocaml
07:17
manizzle has joined #ocaml
07:17
parcs has joined #ocaml
07:18
manizzle has quit [Remote host closed the connection]
07:18
manizzle has joined #ocaml
07:20
ygrek has joined #ocaml
07:20
ygrek has quit [Remote host closed the connection]
07:21
axiles has joined #ocaml
07:28
pyx has joined #ocaml
07:29
alpounet has joined #ocaml
07:31
dapz has quit [Read error: No route to host]
07:39
manizzle has quit [Ping timeout: 255 seconds]
07:40
rgrinberg has quit [Quit: Leaving.]
07:41
eikke_ has joined #ocaml
07:45
Averell has joined #ocaml
07:45
Hannibal_Smith has quit [Ping timeout: 264 seconds]
07:50
dapz has joined #ocaml
07:53
ygrek has joined #ocaml
07:55
<
BitPuffin >
you wouldn't expect a functional language like ocaml to have better oop than oop languages but it does
07:55
<
companion_cube >
that's the 'O' in 'OCaml'
07:55
<
companion_cube >
:D
07:55
<
BitPuffin >
yeah I know :D
07:56
yacks has quit [Ping timeout: 245 seconds]
07:56
<
BitPuffin >
but I'm still surprised how good it is
07:56
<
BitPuffin >
I expected the standard stuff
07:57
<
companion_cube >
ahah :D
07:57
<
companion_cube >
it's pretty much the opposite of most other OO systems
07:58
<
BitPuffin >
well it's pretty much the good of other OO systems, without the crap, and with more goodies
07:58
<
BitPuffin >
like, no narrowing: good!
07:58
<
BitPuffin >
and then the object types eliminate the need for interfages
07:59
<
BitPuffin >
and makes things a lot more flexible
07:59
<
BitPuffin >
basically I think it might remove the OO "wall"
08:00
<
companion_cube >
it's quite complicated though
08:00
<
BitPuffin >
caught me by surprise, I was expecting just reading the syntax and being familiar with what it will say
08:00
<
BitPuffin >
but nope
08:01
<
companion_cube >
do you know inheritance doesn't imply subtyping? ;)
08:01
<
BitPuffin >
yeah I think so
08:01
<
BitPuffin >
doesn't it only become subtyping once you use :> ?
08:03
<
companion_cube >
no, it's not always true, because of self-types
08:04
sagotch has joined #ocaml
08:04
<
BitPuffin >
oh wait no :> just causes information loss or whatever, it's a one way street
08:05
<
BitPuffin >
well what do you mean by not being subtyping?
08:06
rgrinberg has joined #ocaml
08:06
<
BitPuffin >
oh I think I know what you mean, I just got to that part
08:07
<
BitPuffin >
if I define a method that takes self type, it isn't compatible with a parent method that takes itself as a type
08:07
AltGr has joined #ocaml
08:08
<
companion_cube >
yes
08:11
ddosia has quit [Quit: Leaving.]
08:13
ddosia has joined #ocaml
08:19
<
BitPuffin >
would be nice if it was possible to do static dispatch
08:21
<
BitPuffin >
that said if you don't need dynamic dispatch maybe you aren't using objects anyway
08:22
<
mrvn >
In c++ you can have both
08:22
<
BitPuffin >
eah I know
08:22
<
def` >
… but it's unsound
08:23
<
companion_cube >
indeed, in OCaml objects are primarily for dynamic dispatch
08:23
<
def` >
it might be conceptually pleasing but it's plain wrong to conflate inheritance and subtyping
08:24
<
companion_cube >
is it unsound if you only have nominal subtyping?
08:24
<
BitPuffin >
method on_click ?start ?stop f =
08:24
<
BitPuffin >
on_click ?start ?stop
08:24
<
BitPuffin >
(fun ev ->
08:24
<
BitPuffin >
does it call itself?
08:25
<
mrvn >
BitPuffin: aren't you missing a self# or super#?
08:25
<
BitPuffin >
mrvn: excerpt from real world ocaml
08:25
<
BitPuffin >
so I don't understand why it repeats
08:26
<
ggole >
It's a function call, not a method call
08:26
<
ggole >
Function calls look like f a b zonk
08:26
<
ggole >
Method calls look like obj#f b zonk
08:27
<
BitPuffin >
yeah I know it's not a method call, I'm just confused where the function comes from
08:27
<
BitPuffin >
perhaps the library
08:27
<
ggole >
Probably from the opened module
08:27
<
ggole >
(This is why you should use module F = Foo instead of open.)
08:27
<
BitPuffin >
either that or Foo(...)
08:28
<
BitPuffin >
or was the syntax Foo{...} ?
08:28
<
ggole >
Foo.(...) and Foo.{...}
08:28
<
ggole >
You need the .
08:28
<
BitPuffin >
what you can use either of them?
08:28
<
ggole >
Otherwise it's a constructor application
08:29
<
ggole >
The second is introduced in the latest OCaml iirc
08:29
<
BitPuffin >
is there a difference?
08:29
<
ggole >
It's basically short for Foo.({ module_specific_record = ...})
08:29
<
ggole >
Yes, the second is for records only
08:30
<
BitPuffin >
so you'd do Foo.{record = {foo: 3}} ?
08:30
<
companion_cube >
\o/
08:30
<
BitPuffin >
but I guess it makes sense
08:31
<
mrvn >
That makes no sense
08:31
<
ggole >
It's a bit nicer than { Foo.field1 = ...; field2 = ...; }
08:31
<
mrvn >
Foo.{foo = 3} would make sense
08:32
<
BitPuffin >
mrvn: if foo is a ref in module Foo maybe, and if you used <-
08:32
<
mrvn >
BitPuffin: no, foo is a label
08:32
<
BitPuffin >
a label?
08:32
<
mrvn >
short for Foo.({foo = 3})
08:32
<
BitPuffin >
yeah but that doesn't make sense
08:33
<
BitPuffin >
wouldn't it have to be Foo.t.({foo = 3})
08:33
<
mrvn >
What is Foo.{record = {foo: 3}} supposed to do?
08:33
<
BitPuffin >
mrvn: record is a record in module Foo, and that would assign it, although records aren't mutable
08:34
<
BitPuffin >
so I dunno
08:34
<
mrvn >
a value or a type?
08:34
<
mrvn >
and why would that need Foo.{} instead of Foo.()?
08:34
<
BitPuffin >
well that's what I am wondering
08:34
<
BitPuffin >
how does Foo.{bla = 4} know which record in Foo to set
08:35
<
BitPuffin >
inference?
08:35
<
mrvn >
BitPuffin: same way that {bla=4} does
08:35
<
mrvn >
it looks up the lable bla in the current "namespace"
08:35
<
BitPuffin >
but what's a label
08:35
<
mrvn >
BitPuffin: a field of a record
08:35
<
BitPuffin >
thought so maybe
08:36
<
BitPuffin >
so it finds a record thot consists of the label bla and creates a record value with 4 and returns it?
08:37
<
mrvn >
BitPuffin: yes. The Foo. only temporarily opens the module
08:37
<
BitPuffin >
well alright
08:37
<
mrvn >
Only way it makes sense
08:37
<
BitPuffin >
it kinda does now
08:38
<
mrvn >
Module.<single expression> or Module.(<expr> <expr> <expr>)
08:39
<
BitPuffin >
oh didn't know about M.<..>
08:41
<
mrvn >
BitPuffin: never used M.foo?
08:42
<
ggole >
BitPuffin: <...> is "meta syntax", not concrete syntax
08:42
<
ggole >
Ie, it stands for M.foo, M.Foo, etc
08:42
<
BitPuffin >
what advantage is there with M.<foo a b> over M.foo a b though
08:43
<
ggole >
That isn't valid syntax.
08:43
<
BitPuffin >
well I guess mabye it's better than (M.foo a b)
08:43
<
mrvn >
BitPuffin: there is no such thing as M.<foo a b>
08:43
<
mrvn >
10:42 < ggole> BitPuffin: <...> is "meta syntax", not concrete syntax
08:43
<
BitPuffin >
I read that
08:43
rgrinberg has quit [Quit: Leaving.]
08:44
<
BitPuffin >
could you type an example usage of M.<...>
08:44
<
ggole >
There is no OCaml syntax M.<...>
08:44
<
ggole >
mrvn was using <...> to stand in for the set of actual expressions that can be there.
08:45
<
BitPuffin >
well of course
08:45
<
mrvn >
Although, if Module.'{' <record fields> '}' works then Module.'<' <object definition> '>' should also work.
08:45
<
mrvn >
'<' <object definition> '>' being the <single expression> in this case
08:45
<
BitPuffin >
mrvn: yeah I was thinking M.<....> would be weird syntax unless it had to do with objects
08:46
<
ggole >
Eh? <> isn't used for object defintions?
08:46
<
BitPuffin >
it's used for object tyes
08:47
<
ggole >
The module qualifications go on the "inside", though
08:48
<
ggole >
Like they do in , say, 'a Foo.t
08:49
toto__ has joined #ocaml
08:50
<
mrvn >
ggole: If M.{...} is a shortcut for M.({...}) then M.<...> should be a shortcut for M.(<...>)
08:51
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
08:51
<
mrvn >
IN what version was M.{} added anyway? Doesn't work on my 4.01
08:51
<
BitPuffin >
what wolud M.(<...>) mean?
08:51
<
mrvn >
BitPuffin: same as <...> but with M opened.
08:52
<
BitPuffin >
well what would <..._ mean
08:52
<
BitPuffin >
I mean <...>
08:52
<
mrvn >
BitPuffin: So you don't have to use M.t all the time inside the <>
08:52
<
BitPuffin >
and this works?
08:53
<
mrvn >
Can't say. M.{} doesn't even work here
08:53
<
BitPuffin >
well I mean
08:53
<
BitPuffin >
opem Foo;; <...> works?
08:53
<
mrvn >
BitPuffin: for the right value of ...
08:54
<
BitPuffin >
so you put method definitions inside <...> ?
08:54
<
BitPuffin >
well you don't need to open a module to write the type
08:55
Kakadu has joined #ocaml
08:56
<
mrvn >
let f (x : < foo : M.t; bar : M.t; baz : M.t >) = x
08:58
<
BitPuffin >
and you want let f (x: M.< foo : t; bar : t; baz : t >) = x?
08:59
<
BitPuffin >
kinda makes sense I guess
09:03
jludlam has joined #ocaml
09:03
<
BitPuffin >
wouldn't it be better if the inherit keyword was include? since it isn't subtyping, and it works just like include
09:03
<
BitPuffin >
I guess mabye they live in differente namespaces?
09:09
<
def` >
… but inheritance isn't subtyping :D
09:09
<
BitPuffin >
no but it's what you generally think in other languages? :P
09:10
<
BitPuffin >
name one language that normal people use where inheritance != subtying :)
09:10
<
def` >
I prefer when it's the typechecker that reminds me that inheritance isn't subtyping rather thann the debugger
09:10
<
def` >
Java? C# ? C++ ? …
09:11
<
BitPuffin >
well it's subtying in those no?
09:11
<
def` >
Not in a logical sense.
09:11
Kakadu has quit [Ping timeout: 246 seconds]
09:11
<
BitPuffin >
well I mean a method that takes B that inherits from A can't take A
09:11
<
BitPuffin >
if thta's what you mean
09:12
<
NoNNaN >
really difficult: "We observe the various interpretations of overriding and overloading in object oriented languages. With the description of an intend, represented as the following UML diagram, we have "naively" implemented in 15 different languages the same piece of code... and obtenained 11 different results."
09:13
<
Drup >
regardless of the content, the geocity like "NEW" icons strike me the most x)
09:13
Kakadu has joined #ocaml
09:14
arj has joined #ocaml
09:14
<
ggole >
mrvn: is M.(<...>) actually a valid expression?
09:14
<
BitPuffin >
maybe it should be
09:17
<
def` >
ggole: what would this mean?
09:17
<
def` >
M.{< >} is valid in 4.02
09:18
adrien_o1w is now known as adrien_oww
09:18
<
def` >
M.( M.[ M.[| M.{ M.{< … it's getting scary :P
09:19
<
Drup >
def`: in this case, it's not crazy, it's consistent
09:19
<
Drup >
"works for all delimiters"
09:20
<
def` >
Drup: yeah, I mean, all syntactic "hacks" for delimiters are getting scary, not this :)
09:21
<
Drup >
I have on my todo list "first class literals", to unify all those delimiters x)
09:21
* Drup
like syntactic stuffs
09:21
<
BitPuffin >
ocaml has a lot of syntax
09:22
<
BitPuffin >
it's probably the most daunting thing about it
09:22
* def`
give a Perl6 book to Drup
09:22
<
Drup >
well, the issue is not that it has a lot of syntax
09:22
<
BitPuffin >
it's worth learning though
09:22
<
BitPuffin >
and fun
09:22
<
Drup >
the issue is that it grew quite organically
09:22
<
Drup >
so there are lot's of inconsistencies and corner cases
09:23
<
BitPuffin >
I think the issue is that it refuses to break backwards compatibility
09:23
<
BitPuffin >
like the compare "pattern" silly to return an int when there is variant types
09:23
oriba has joined #ocaml
09:23
<
BitPuffin >
maybe we need to do a python 2 -> 3 period :P
09:24
<
Drup >
I would say the issue is the early mistake. being backward compatible is not a bad thing a tall
09:24
<
Drup >
and no, python 3 is an epic fail
09:24
<
BitPuffin >
being backwards compatible forces you to keep ugly things
09:24
<
def` >
or… a revised syntax!!! tadada
09:25
<
BitPuffin >
it's better than 2
09:25
<
BitPuffin >
def`: same thing :P
09:25
<
Drup >
there is a revised syntax for ocaml
09:26
<
Drup >
well, the revised syntax is crap anyway, so bad example
09:26
<
BitPuffin >
well I just mean that you should clean up the stuff where the answer to the question "why is it like that? It's weird." is "historical reasons"
09:27
<
Drup >
but you can't really clean this kind of things
09:27
<
BitPuffin >
why not?
09:28
<
Drup >
just an exemple
09:28
<
def` >
Drup: the mutable string issue might be cleanup properly
09:28
<
Drup >
(:=) is the only function operator starting with a ":"
09:28
rgrinberg has joined #ocaml
09:28
<
Drup >
it's hardcoded like that
09:28
<
Drup >
most other operators are fairly general
09:29
<
BitPuffin >
Drup: and you can't clean that u because
09:29
<
Drup >
should we remove it because it doesn't make sens, but loose the possibility to have a relatively intuitive operator for ref assignment ?
09:30
<
Drup >
(and break backward compat)
09:30
<
def` >
Drup: it's easy to redefine it in the local scope of a module
09:30
<
BitPuffin >
so you can't create an operator that contains :?
09:31
<
Drup >
def`: you still need the possibility for it to be an operator.
09:31
<
Drup >
that's the hardcoded part, the fact that ":=" is a valid operator
09:31
<
Drup >
BitPuffin: nope
09:32
<
BitPuffin >
well can't you fix that part?
09:32
<
Drup >
that start with*
09:32
<
BitPuffin >
it makes it harder to parse I guess
09:32
<
BitPuffin >
because type annotation
09:32
<
BitPuffin >
but it should be possible to separate no?
09:32
<
def` >
Drup: that's a different issue, because you would like :.* names to be reserved for value constructors
09:33
<
Drup >
def`: I picked the examples just because I stumble upon it during the night, you can find lot's of other stuff
09:33
<
def` >
Drup: yes, a few specific case have been hardcoded, but with some work can be generalized
09:33
<
Drup >
almost generalized :p
09:36
<
octachron >
The organic multiplication of the different type of parenthesis lexems is also a little ...unwieldy at times
09:37
pyx has quit [Quit: WeeChat 0.4.3]
09:38
<
Drup >
don't forget [@ ], [@@ ], [@@@ ], [% ], [%% ]
09:38
ggole has quit [Read error: Connection reset by peer]
09:40
BitPuffin has quit [Ping timeout: 240 seconds]
09:41
oriba has quit [Quit: oriba]
09:42
hhugo has joined #ocaml
09:48
dsheets has joined #ocaml
09:49
lordkryss has joined #ocaml
09:52
<
octachron >
If I am not mistaken, I count 12 different lexems for left parenthesis variation ( and the "(*)" ... thing ) . I don't like to count to integer that big.
09:54
avsm has joined #ocaml
09:55
ggole has joined #ocaml
09:57
hhugo has quit [Quit: Leaving.]
09:58
thomasga has joined #ocaml
10:03
ontologiae has joined #ocaml
10:06
dapz has joined #ocaml
10:19
hhugo has joined #ocaml
10:19
rgrinberg has quit [Quit: Leaving.]
10:29
_andre has joined #ocaml
10:36
hhugo has quit [Quit: Leaving.]
10:40
cdidd_ has quit [Ping timeout: 255 seconds]
10:42
remyzorg has joined #ocaml
10:43
avsm has quit [Quit: Leaving.]
10:45
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
10:45
penglingbo has quit [Ping timeout: 240 seconds]
10:47
dapz has joined #ocaml
10:47
dapz has quit [Client Quit]
10:49
hcarty has joined #ocaml
10:50
penglingbo has joined #ocaml
10:51
<
hcarty >
I'm using Ctypes and need to pass a char ** value. So something along the lines of (ptr string -> returning void).
10:52
<
hcarty >
The C function being called expects the last value in the 'string array' to be NULL
10:52
<
hcarty >
How would I do this with Ctypes? Do I need to drop the use of ptr string and use ptr void with manual casts?
10:55
<
hcarty >
I effectively need a way of saying the equivalent of: CArray.set carray (n - 1) null
10:55
ebzzry has quit [Remote host closed the connection]
10:56
penglingbo has quit [Ping timeout: 272 seconds]
11:01
sagotch has quit [Remote host closed the connection]
11:04
<
Drup >
doesn't ctypes handle this automatically already ?
11:06
hhugo has joined #ocaml
11:08
penglingbo has joined #ocaml
11:08
BitPuffin has joined #ocaml
11:12
penglingbo has quit [Ping timeout: 255 seconds]
11:25
avsm has joined #ocaml
11:30
penglingbo has joined #ocaml
11:33
divyanshu has quit [Quit: Computer has gone to sleep.]
11:35
divyanshu has joined #ocaml
11:40
avsm has quit [Quit: Leaving.]
11:44
divyanshu has quit [Quit: Computer has gone to sleep.]
11:51
remyzorg has quit [Quit: WeeChat 0.4.3]
11:53
<
hcarty >
Drup: I don't think so, unless Ctypes initializes the array elements to NULL
11:53
divyanshu has joined #ocaml
11:54
<
hcarty >
Drup: Given a list of N strings, I need an N+1 element array to pass to the C library
11:54
<
Armael >
just use null and coerce it to ptr string
11:54
<
hcarty >
Armael: Indeed, but how?
11:55
<
hcarty >
Armael: CArray.set requires a string argument for the value being set
11:55
<
Armael >
Ctypes.coerce ?
11:56
<
Armael >
maybe string is coercible from/to ptr char_t
11:56
penglingbo has quit [Ping timeout: 245 seconds]
11:56
<
Armael >
(something like that)
12:00
segmond has quit [Ping timeout: 255 seconds]
12:06
<
hcarty >
Armael: Thanks - I'll try: CArray.set ca (n - 1) (coerce void string ())
12:06
<
hcarty >
Not sure if that's the right approach... but it may work.
12:09
<
hcarty >
Or... make the array a string_opt array
12:09
<
hcarty >
That seems more promising
12:13
<
hcarty >
And it fixes the segfault!
12:13
<
hcarty >
Armael: Thank you for your suggestions
12:13
<
mrvn >
is string_opt a string | NULL or string option?
12:16
<
hcarty >
mrvn: None maps to null, Some s maps to the string s
12:17
<
mrvn >
hcarty: then that is what you should use
12:18
ygrek has quit [Ping timeout: 255 seconds]
12:19
<
mrvn >
pretty sure its physical
12:20
hhugo has quit [Quit: Leaving.]
12:25
<
hcarty >
mrvn: Yes, that's what fixed it for me
12:26
<
hcarty >
I'd used it before but initially didn't think to use it here.
12:27
<
Armael >
hcarty: just check that coerce doesn't raise an exception at runtime
12:28
<
companion_cube >
o/
12:28
ousado has joined #ocaml
12:28
<
hcarty >
companion_cube: Hello
12:28
<
mrvn >
let coerce _ = raise YouAreAnIdiotToBreakTypeSafety
12:28
<
companion_cube >
hi hcarty
12:29
<
Armael >
well it's C so pff
12:29
<
hcarty >
Armael: I went with string_opt as the array element type to avoid extra super type unsafety
12:30
<
mrvn >
is there a null_t type? struct { char *args[n]; null_t null; }
12:40
<
hcarty >
Ctypes gives a wonderful feeling of type safety right up until the segfaults start. Though I suppose That really could apply to C in general.
12:40
<
hcarty >
To be clear, I really like Ctypes
12:40
<
mrvn >
like every binding it depends on correct information by the user
12:40
parcs has quit [Read error: Connection reset by peer]
12:41
parcs has joined #ocaml
12:41
parcs has quit [Client Quit]
12:42
<
hcarty >
mrvn: Yep. And Ctypes makes it very easy to experiment on the fly which is wonderful.
12:42
ebzzry has joined #ocaml
12:43
<
hcarty >
It makes ocaml/utop/ocaml-top into easy C API exploration tools.
12:43
parcs has joined #ocaml
12:44
<
mrvn >
does Ctypes have a way to make custom blocks with finalizer?
12:45
cago has joined #ocaml
12:47
<
hcarty >
mrvn: I don't think so in 0.3.0. The included finalization support uses Gc.finalise.
12:48
<
hcarty >
mrvn: It may support something with its code generation backend. I've only used the libffi-based interface so far.
12:49
<
mrvn >
I guess you could make the struct yourself and call the ocaml GC C interface directly.
12:53
darkf has quit [Quit: Leaving]
12:55
Nahra has joined #ocaml
12:55
divyanshu has quit [Quit: Computer has gone to sleep.]
13:00
araujo has joined #ocaml
13:01
jludlam has quit [Ping timeout: 264 seconds]
13:02
avsm has joined #ocaml
13:03
penglingbo has joined #ocaml
13:13
jludlam has joined #ocaml
13:22
hhugo has joined #ocaml
13:30
bjorkintosh has quit [Ping timeout: 240 seconds]
13:41
divyanshu has joined #ocaml
13:43
sagotch has joined #ocaml
13:44
penglingbo has quit [Quit: Leaving]
13:44
ontologiae has quit [Ping timeout: 264 seconds]
13:44
chris2 has quit [Ping timeout: 272 seconds]
13:50
cago has quit [Remote host closed the connection]
13:54
slash^ has joined #ocaml
13:55
hhugo has quit [Quit: Leaving.]
13:56
Hannibal_Smith has joined #ocaml
14:02
avsm has quit [Quit: Leaving.]
14:04
tane has joined #ocaml
14:05
ontologiae has joined #ocaml
14:10
avsm has joined #ocaml
14:13
ontologiae has quit [Ping timeout: 272 seconds]
14:14
Nahra has quit [Remote host closed the connection]
14:16
avsm has quit [Quit: Leaving.]
14:23
shinnya has joined #ocaml
14:37
ontologiae has joined #ocaml
14:37
shinnya has quit [Ping timeout: 240 seconds]
14:39
nlucaroni has joined #ocaml
14:44
shinnya has joined #ocaml
14:46
Averell has quit [Remote host closed the connection]
14:46
chris2 has joined #ocaml
14:49
shinnya has quit [Ping timeout: 240 seconds]
14:54
shinnya has joined #ocaml
15:01
divyanshu has quit [Ping timeout: 240 seconds]
15:02
SethTisue has joined #ocaml
15:03
sagotch has quit [Remote host closed the connection]
15:04
divyanshu has joined #ocaml
15:09
nlucaroni has quit [Quit: leaving]
15:13
yacks has joined #ocaml
15:13
philtor_ has joined #ocaml
15:18
divyanshu has quit [Quit: Computer has gone to sleep.]
15:24
avsm has joined #ocaml
15:25
Eyyub has joined #ocaml
15:31
philtor_ has quit [Ping timeout: 255 seconds]
15:59
racycle has joined #ocaml
15:59
shinnya has quit [Ping timeout: 245 seconds]
16:03
ontologiae has quit [Ping timeout: 245 seconds]
16:11
ygrek has joined #ocaml
16:11
toto__ has quit [Read error: Connection reset by peer]
16:11
boogie has joined #ocaml
16:14
Arsenik has joined #ocaml
16:15
ontologiae has joined #ocaml
16:17
lordkryss has quit [Ping timeout: 255 seconds]
16:17
dsheets has quit [Ping timeout: 244 seconds]
16:24
octachron has quit [Quit: Page closed]
16:25
jwatzman|work has joined #ocaml
16:25
jwatzman|work has quit [Client Quit]
16:25
jwatzman|work has joined #ocaml
16:30
rgrinberg has joined #ocaml
16:31
avsm has quit [Quit: Leaving.]
16:32
philtor_ has joined #ocaml
16:38
dsheets has joined #ocaml
16:38
studybot_ has quit [Remote host closed the connection]
16:39
studybot_ has joined #ocaml
16:40
avsm has joined #ocaml
16:40
jludlam has quit [Remote host closed the connection]
16:46
SethTisue has quit [Ping timeout: 244 seconds]
16:48
SethTisue has joined #ocaml
16:54
lordkryss has joined #ocaml
16:56
manizzle has joined #ocaml
17:03
__JokerDoom has joined #ocaml
17:04
avsm has quit [Quit: Leaving.]
17:07
_JokerDoom has quit [Ping timeout: 264 seconds]
17:07
AltGr has left #ocaml [#ocaml]
17:12
q66 has joined #ocaml
17:15
philtor_ has quit [Ping timeout: 240 seconds]
17:20
jao has joined #ocaml
17:20
jao has quit [Changing host]
17:20
jao has joined #ocaml
17:27
paddymahoney has joined #ocaml
17:28
alpounet has quit [Remote host closed the connection]
17:29
manizzle has quit [Ping timeout: 264 seconds]
17:30
divyanshu has joined #ocaml
17:30
ygrek has quit [Ping timeout: 240 seconds]
17:37
philtor_ has joined #ocaml
17:42
eikke_ has quit [Ping timeout: 240 seconds]
17:44
Averell has joined #ocaml
17:45
ygrek has joined #ocaml
17:46
Averell is now known as Averell
17:47
Kakadu has quit [Quit: Page closed]
17:55
philtor_ has quit [Ping timeout: 264 seconds]
17:58
Nahra has joined #ocaml
17:59
avsm has joined #ocaml
18:04
yomimono has joined #ocaml
18:05
thomasga has quit [Quit: Leaving.]
18:07
bjorkintosh has joined #ocaml
18:08
alpounet has joined #ocaml
18:11
thomasga has joined #ocaml
18:11
Sim_n has joined #ocaml
18:14
Simn has quit [Ping timeout: 240 seconds]
18:16
dsheets has quit [Ping timeout: 240 seconds]
18:17
rgrinberg has quit [Quit: Leaving.]
18:19
pyx has joined #ocaml
18:20
thomasga has quit [Quit: Leaving.]
18:28
manizzle has joined #ocaml
18:29
Kakadu has joined #ocaml
18:35
rgrinberg has joined #ocaml
18:35
avsm has quit [Quit: Leaving.]
18:44
ygrek has quit [Ping timeout: 244 seconds]
18:55
<
whitequark >
huh, neat
18:56
<
whitequark >
neat! will it get merged?
18:56
<
whitequark >
also, will you review my lwt ppx thingies? :]
18:57
SethTisue has quit [Quit: SethTisue]
18:58
<
NoNNaN >
it looks like llvm 3.4.2 ocaml binding is buggy, or I forget something: dllllvm_executionengine.so: undefined symbol: llvm_alloc_data_layout
18:58
<
Drup >
whitequark: I did a pre-review. Will do a more in depth review when I have my internship report out of the way (or when I'm too annoyed by latex)
18:58
<
whitequark >
Drup: I see. thanks!
18:58
<
whitequark >
NoNNaN: do the functions in Llvm module work?
18:59
<
Drup >
whitequark: on the "will it get merged ?" .... I have no idea.
18:59
<
whitequark >
if yes, it's indeed a bug. I didn't really work with executionengine all that closely, since I never needed it.
18:59
<
Drup >
I just hacked it out of "hell, why not"
18:59
<
Drup >
(it works perfectly fine and the patch set is trivial)
19:01
cdidd has joined #ocaml
19:02
<
def` >
whitequark: if you can't be physically present, just be there, discuss on IRC and all'll be fine :)
19:02
<
Drup >
(that's what I plan to do :D)
19:04
<
Drup >
hum, just looked at yallop's version
19:04
<
Drup >
mine is cleaner =°
19:07
manizzle has quit [Remote host closed the connection]
19:07
manizzle has joined #ocaml
19:14
alpounet has quit [Read error: Connection reset by peer]
19:15
alpounet has joined #ocaml
19:16
claudiuc has joined #ocaml
19:19
metasyntax has quit [Quit: Leaving]
19:20
claudiuc has quit [Remote host closed the connection]
19:21
claudiuc has joined #ocaml
19:22
avsm has joined #ocaml
19:27
seanmcl has joined #ocaml
19:51
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
19:52
seanmcl has joined #ocaml
20:06
mort___ has joined #ocaml
20:07
dapz has joined #ocaml
20:10
rgrinberg has quit [Quit: Leaving.]
20:13
_andre has quit [Quit: leaving]
20:21
<
chris2 >
companion_cube: i converted the code to plain maps and it takes a third of the time now. yay :)
20:22
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
20:26
mreca has joined #ocaml
20:36
yomimono has quit [Ping timeout: 240 seconds]
20:37
rgrinberg has joined #ocaml
20:38
mort___ has quit [Quit: Leaving.]
20:40
seanmcl has joined #ocaml
20:47
philtor_ has joined #ocaml
20:56
WraithM has quit [Quit: Lost terminal]
20:57
WraithM has joined #ocaml
21:10
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
21:18
<
baz_ >
hi, got a ocamlopt related question
21:18
<
baz_ >
i'm building a project that makes use of piqi and therefore requires easy-format
21:19
<
baz_ >
however, ocamlopt (3.12.1) calls gcc with -leasy_format
21:19
<
baz_ >
how does it deduce that it has to use -leasy_format
21:20
<
baz_ >
since this is actually wrong
21:20
axiles has quit [Remote host closed the connection]
21:20
<
baz_ >
it errors out with /usr/bin/ld: cannot find -leasy_format
21:20
<
baz_ >
running ocamlopt in verbose mode outputs the gcc command
21:21
<
baz_ >
running this exact command without leasy_format actually builds the project
21:21
<
baz_ >
both ocaml 3.12.1 and the packages are installed with opam
21:22
<
Drup >
can you provide a bit more information on the build system ?
21:22
<
baz_ >
I'm using ocp-build
21:23
<
baz_ >
which calls ocamlopt for a native build
21:23
<
Drup >
link to the build script ?
21:24
<
baz_ >
can't provide that atm
21:24
seanmcl has joined #ocaml
21:24
<
Drup >
it's going to be hard to debug without looking exactly at how you're using the build system :)
21:25
<
baz_ >
well, I just wondered if anyone could give a hint on how ocamlopt.opt decides on the fact that gcc needs todo an -leasy_format
21:25
<
baz_ >
since it doesn't do it for all my libraries
21:26
<
baz_ >
and ocp-build doesn't special case the library
21:26
seanmcl has quit [Client Quit]
21:27
ontologiae has quit [Ping timeout: 255 seconds]
21:27
<
baz_ >
it calls ocamlopt with -I<path to easy_format> and easy_format.cmxa
21:27
<
baz_ >
like all the other libraries
21:27
<
baz_ >
such as piqi, batteries, etc
21:27
<
Drup >
when you build ocaml with C files as a library, ocaml encapsulate everything (including C flags) in an ocaml object
21:27
<
Drup >
and ocamlopt will use this flags at link time
21:27
<
baz_ >
ah k, that is interesting
21:28
<
baz_ >
so I have to look at how easy_format is build
21:28
<
Drup >
probably, yes
21:28
<
baz_ >
k many thanks :)
21:28
<
Drup >
(I didn't knew piqi, it's interesting)
21:33
thomasga has joined #ocaml
21:35
seanmcl has joined #ocaml
21:36
seanmcl has quit [Client Quit]
21:38
alpounet has quit [Remote host closed the connection]
21:41
<
baz_ >
definitely interesting, not using it directly though
21:41
<
baz_ >
there seems to be no mixing of c and ml files in easy-format
21:44
<
baz_ >
mmm starts to get annoying :P
21:44
<
baz_ >
been at for almost 2 days now :S
21:45
pyx has quit [Quit: WeeChat 0.4.3]
21:46
Moataz-E has joined #ocaml
21:47
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
21:47
<
Drup >
show your build script :p
21:47
dapz has joined #ocaml
21:52
Moataz-E has quit [Quit: Leaving]
21:52
seanmcl has joined #ocaml
21:56
Hannibal_Smith has quit [Quit: Sto andando via]
22:03
Kakadu has quit [Quit: Konversation terminated!]
22:06
tane has quit [Quit: Verlassend]
22:13
alpounet has joined #ocaml
22:14
shinnya has joined #ocaml
22:15
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
22:19
dant3 has quit [Remote host closed the connection]
22:21
SethTisue has joined #ocaml
22:21
hhugo has joined #ocaml
22:27
<
baz_ >
so trying to build program X
22:28
<
baz_ >
it is an ocp
22:32
<
baz_ >
but given that it is very high-level, it seems that something else is going wrong
22:37
<
baz_ >
mmm, it seems to be related to ocamlmklib or something
22:38
<
baz_ >
so opam applies patches to easy-format to create a cma and cmxa
22:38
<
baz_ >
if I do this directly with ocamlopt -a -o ...
22:38
<
baz_ >
it seems to be fine
22:40
<
Drup >
baz_: which version of easy-format are you using ?
22:40
<
Drup >
there is no patches anymore in 1.2
22:40
rgrinberg has quit [Quit: Leaving.]
22:41
<
baz_ >
I guess that is the latest supported for 3.12.1
22:42
<
Drup >
I see no version constraint, so no, you just need to update
22:42
<
baz_ >
alreay up-to-date according to opam :/
22:42
<
Drup >
"opam upgrade" ?
22:42
boogie has quit [Remote host closed the connection]
22:43
<
Drup >
hum, easy-format is not even used anymore in more recent version of piqi
22:43
boogie has joined #ocaml
22:43
boogie has quit [Remote host closed the connection]
22:43
Sim_n has quit [Quit: Leaving]
22:43
<
baz_ >
same message
22:43
<
baz_ >
already up-to-date
22:43
<
Drup >
which version of opam are you using ?
22:45
<
baz_ >
opam --versions shows 1.0.1
22:45
<
baz_ >
but I installed Version: 1.1.1-1 form Ubuntu
22:45
<
Drup >
odd indeed, maybe you have a left over version on your path somewhere
22:46
<
Drup >
1.0.1 is outdated and I think it uses old servers (not completely sure)
22:47
<
baz_ >
/usr/local/bin/opam --version
22:47
<
baz_ >
return 1.0.1
22:47
hhugo has quit [Quit: Leaving.]
22:47
<
baz_ >
so I used have 1.0.1
22:48
<
Drup >
are you using avsm's ppa ?
22:48
<
baz_ >
but then I removed my $HOME/.opam and did a apt-get install opam
22:48
<
Drup >
maybe you should, ubuntu is not very reactive.
22:51
Arsenik has quit [Remote host closed the connection]
22:52
slash^ has quit [Read error: Connection reset by peer]
22:52
<
baz_ >
but given the changes to easy-formats 1.0.2 Makefile
22:52
<
baz_ >
this will still go wrong when using ocp-build
22:52
<
baz_ >
since it is not including the cma and cmxa files
22:52
<
baz_ >
which ocp-build looks for in the META
22:54
<
baz_ >
which is weird, because METAs of other libs also include the cma and cmxa instead of cmo and cmx
22:54
<
Drup >
you should try it
22:56
<
baz_ >
so I changed this
22:56
<
baz_ >
and then I got the -leasy_format error
22:56
<
baz_ >
since the opam patch created the cmxa with ocamlmklib
22:57
<
baz_ >
so changing that to ocamlopt -a -o easy_format.cmxa ...
22:57
<
Drup >
please try with easy-formats 1.0.2 before going on :)
22:57
<
baz_ >
fixed that for some reason
22:57
<
baz_ >
well got it working now
22:57
<
baz_ >
so changing the META + how the cmxa is build does the trick
22:58
<
baz_ >
so it used to do ocamlmklib -o easy_format -linkall easy_format.cmx
22:58
<
baz_ >
but I changed that to
22:59
<
baz_ >
ocamlopt -a -o easy_format.cmxa -dtypes easy_format.mli easy_format.ml
22:59
<
baz_ >
and it all magically works :P
22:59
<
baz_ >
anyways, calling it a day
22:59
<
baz_ >
will chase this goose another day :P
23:01
<
baz_ >
so looking at the verbose output of ocamlopt
23:01
<
baz_ >
it no longer generates the gcc ... -leasy_format
23:06
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
23:06
<
baz_ >
which seems to be caused by ocamlmklib.ml at line 259
23:07
<
baz_ >
if !native_objs <> [] then
23:07
<
baz_ >
(sprintf "%s -a -o %s.cmxa %s %s -cclib -l%s %s %s %s %s"
23:07
<
baz_ >
(transl_path !ocamlopt)
23:07
<
baz_ >
(String.concat " " !caml_opts)
23:07
<
baz_ >
(String.concat " " !native_objs)
23:07
<
baz_ >
(Filename.basename !output_c)
23:07
<
baz_ >
(String.concat " " (prefix_list "-ccopt " !c_opts))
23:07
<
baz_ >
(make_rpath_ccopt nativeccrpath)
23:07
<
baz_ >
(String.concat " " (prefix_list "-cclib " !c_libs))
23:07
<
baz_ >
(String.concat " " !caml_libs))
23:08
<
baz_ >
so the -l%s will result in -leasy_format if we call ocamlmklib -o easy_format easy_format.cmx
23:08
<
baz_ >
well anyways
23:08
<
baz_ >
time to get some sleep
23:09
<
baz_ >
@Drup thanks for the input
23:10
avsm has quit [Quit: Leaving.]
23:11
eikke_ has joined #ocaml
23:14
boogie has joined #ocaml
23:20
BitPuffin has quit [Ping timeout: 264 seconds]
23:22
darkf has joined #ocaml
23:23
ontologiae has joined #ocaml
23:27
ontologiae has quit [Ping timeout: 240 seconds]
23:30
SethTisue has quit [Quit: SethTisue]
23:32
philtor_ has quit [Ping timeout: 255 seconds]
23:32
Nahra has quit [Ping timeout: 255 seconds]
23:33
madroach has quit [Ping timeout: 252 seconds]
23:35
madroach has joined #ocaml
23:38
Eyyub has quit [Ping timeout: 245 seconds]
23:40
Eyyub has joined #ocaml
23:40
NoNNaN has quit [Remote host closed the connection]
23:40
NoNNaN has joined #ocaml
23:41
jao has quit [Ping timeout: 240 seconds]
23:45
thomasga has quit [Quit: Leaving.]
23:47
racycle_ has joined #ocaml
23:48
racycle has quit [Read error: No route to host]