M-martinklepsch has quit [Ping timeout: 244 seconds]
M-martinklepsch has joined #ocaml
srenatus[m] has quit [Ping timeout: 244 seconds]
srenatus[m] has joined #ocaml
f[x] has joined #ocaml
Denommus has joined #ocaml
silver has quit [Quit: rakede]
pierpa has quit [Ping timeout: 240 seconds]
fraggle_ has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 240 seconds]
struk|desk has quit [Quit: Konversation terminated!]
fluter has quit [Ping timeout: 250 seconds]
fraggle_ has joined #ocaml
rgrinberg has joined #ocaml
fluter has joined #ocaml
Denommus has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
tmtwd has quit [Ping timeout: 252 seconds]
napis has joined #ocaml
<napis>
I'm using 4.03 and core library. When adding [@@deriving show] to some types, corebuild will show errors like this `ppx_type_conv: 'show' is not a supported type type-conv generator`
<napis>
how to fix this?
fluter has quit [Ping timeout: 264 seconds]
Denommus has joined #ocaml
<napis>
I've already add `<*>: package(ppx_deriving.std)` to the _tags file
pyon has quit [Ping timeout: 244 seconds]
<copy`>
Try adding ppx_deriving.show
fluter has joined #ocaml
<napis>
copy`: did you mean `[@@deriving ppx_deriving.show]`?
<copy`>
No, add -pkg ppx_deriving.show to the corebuild command
<napis>
$ corebuild -pkg ppx_deriving.show main.byte + ocamlfind ocamldep -package ppx_deriving.show -package core -ppx 'ppx-jane -as-ppx' -modules main.ml > main.ml.depends File "main.ml", line 1, characters 59-63: ppx_type_conv: 'show' is not a supported type type-conv generator Command exited with code 2. Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
ggherdov has quit [Ping timeout: 260 seconds]
<copy`>
Try ocamlbuild instead of corebuild
Denommus has quit [Quit: Bye]
<napis>
ocamlbuild woks write
<napis>
works right
adelbertc has quit [Quit: Connection closed for inactivity]
ggherdov has joined #ocaml
<napis>
so how to fix this under corebuild?
<copy`>
Copy the contents of the corebuild script (it just calls ocamlbuild with some extra arguments)
<napis>
how to print the complete corebuild script?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<copy`>
cat `which corebuild`
<copy`>
And remove the ppx line, since it seems to be causing trouble
seangrove has quit [Ping timeout: 244 seconds]
sdothum has joined #ocaml
<napis>
-tag "ppx(ppx-jane -as-ppx)" \
<napis>
you mean this line?
<copy`>
Yeah
<napis>
It will cause `Error: Unbound value pp`
<copy`>
It works for me, are you compiling more code now?
<napis>
yes, is there any generic print method for general type struct variables?
<napis>
without deriving
<napis>
I just want to show the structure of some variables with type like `list option` or something
<copy`>
I'm using ppx_derving.show for that
<napis>
even in utop, it will display `utop # let b = {x=1; y= "gg"; z= None};; val b : a = {x = 1; y = "gg"; z = None} `
<napis>
in ocamldebug, the `print` command can also show the struct
<copy`>
I'm not sure how that works, to be honest
<copy`>
Many library also have printing combinators, for example using containers, you can write `CCOpt.pp (CCList.pp CCInt.pp)` to print int list option
<napis>
[NOTE] Package ppx_deriving is already installed (current version is 3.3).
<napis>
Package ppx_type_conv is already installed (current version is 113.33.01+4.03).
<napis>
this works, but when adding `open Core.Std` to the first line, it can't build
<napis>
wait a minute..
<napis>
it works, but my code will use menhir, when adding -use-menhir it breaks as `Error: Unbound value pp`
<napis>
`Error: Unbound value pp` point to position of [@@deriving show]
<copy`>
Huh
<copy`>
I don't think I can help you with that, I've never used menhir
<napis>
before 4.02 version, how did programmers print the structure? writing own print function for each type?
<copy`>
Yep, that works for many people
<napis>
fine, i will go with that approch..
<napis>
thanks~
<copy`>
Sure. Build problems are quite common for beginners. Don't get discouraged, OCaml is a great language
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
rgrinberg has quit [Ping timeout: 260 seconds]
tmtwd has quit [Ping timeout: 244 seconds]
tmtwd has joined #ocaml
rgrinberg has joined #ocaml
adelbertc has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
govg has joined #ocaml
MercurialAlchemi has joined #ocaml
govg has quit [Ping timeout: 244 seconds]
govg has joined #ocaml
<napis>
copy`: I fix the deriving problem, `Error: Unbound value pp` means more types need to be deriving show...OCaml is the great...I just need to learn more about it.
govg has quit [Ping timeout: 258 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Ping timeout: 264 seconds]
tmtwd has quit [Ping timeout: 244 seconds]
Muzer has quit [Ping timeout: 244 seconds]
MercurialAlchemi has joined #ocaml
zxygentoo has joined #ocaml
napis has quit [Quit: Page closed]
zxygentoo has quit [Remote host closed the connection]
zxygentoo has joined #ocaml
zxygentoo has quit [Client Quit]
Muzer has joined #ocaml
Muzer has quit [Ping timeout: 258 seconds]
nichola__ is now known as nicholasf
Muzer has joined #ocaml
d0nn1e has quit [Ping timeout: 250 seconds]
d0nn1e has joined #ocaml
govg has joined #ocaml
kushal has quit [Quit: Leaving]
adelbertc has quit [Quit: Connection closed for inactivity]
copy` has quit [Quit: Connection closed for inactivity]
Simn has joined #ocaml
Algebr` has joined #ocaml
bruce_r has quit [Ping timeout: 258 seconds]
qdwang has joined #ocaml
<qdwang>
How to set multiple break hints to a formatter? I can't find the interface in doc.
jimt has quit [Ping timeout: 264 seconds]
jimt has joined #ocaml
<qdwang>
When I use pp_set_margin to set a large number like 999 to a formatter, the formatter output will has no line break, how can I force line break just like when the margin in small.
<Algebr`>
Is there anyway to get some kind of reflection in OCaml's runtime?
<companion_cube>
not that I know of
<Algebr`>
Is there any sneaky way to create values in compiled OCaml code, abuse the runtime somehow?
<Algebr`>
like make a new function without it being previously defined as an external
<companion_cube>
dynamic linking?
<Algebr`>
Goal: Write a C program that instantiates an OCaml object and runs a method on it.
<companion_cube>
sounds... difficult
<Algebr`>
Why is it difficult
<Algebr`>
What would be needed to make this happen
<companion_cube>
because OCaml is totally compiled, nothing from the language remains at runtime
<companion_cube>
I mean it's as difficult as making a C function on the fly and call it
<Algebr`>
I thought objects had some extra runtime information
<companion_cube>
they are represented by a dispatch table at runtime, but the methods' code is normal code
<companion_cube>
it's not interpreted
<Algebr`>
Hack: Use compiler-libs to do it on the fly
<companion_cube>
maybe if you integrate the bytecode interpreter, you can generate an OCaml file, compile it and load it
<companion_cube>
but it sounds far too ugly to anything I would do
<companion_cube>
oh, or generate a OCaml file, compile it to native, dynlink it
freusque has joined #ocaml
<companion_cube>
but really, it's a weird design that requires this kind of tricks
qdwang has quit [Quit: Page closed]
<Algebr`>
darn
AltGr has joined #ocaml
mcc has quit [Quit: Connection closed for inactivity]
<brab>
qdwang: I think you want "@ "
<companion_cube>
Algebr`: what are you actually trying to do? ^^
<Algebr`>
Goal: Write a C program that instantiates an OCaml object and runs a method on it.
<companion_cube>
no, but why
<companion_cube>
what for
<Algebr`>
cool tools in iOS reverse engineering that I use, wanted to add OCaml as a first class citizen
<companion_cube>
so is normal dynlink out of question?
<Algebr`>
but that's still objects that were defined ahead of time
<companion_cube>
(I mean, compile the OCaml part "normally" and dynlink it later)
<Algebr`>
yea
<Algebr`>
I need reflection, being able to ad-hoc make an OCaml object
<companion_cube>
I think you're doomed
<Algebr`>
I think so too, mostly.
<flux>
how would you use it?
<Algebr`>
to get an OCaml object automagically bridged from an Objective-C object.
<flux>
does the interface need to be dynamically generated?
<Algebr`>
yes
trevorriles has quit [Ping timeout: 276 seconds]
<flux>
so you want foo#bar to work so that bar is checked runtime?
<Algebr`>
I want to automagically make a foo, which is some objc object, and bar which is some objc method
<flux>
I think you could perhaps use some javascript/ppx-approach..
<Algebr`>
let ocaml_object_widget = [[UIButton alloc] init]
<flux>
use foo##bar and then convert that into a helluva unsafe piece of code
<companion_cube>
use lua :p
<flux>
in fact, whatever javascript does probably should fit, js is even more dynamic than ObjC
<Algebr`>
lol
<Algebr`>
yea, JS already does this
<Algebr`>
does this bridge, I wanted to add OCaml as another option
<companion_cube>
flux might have the right idea with jsoo
<flux>
\o/
<Algebr`>
I would prefer not to touch/use jsoo
<Algebr`>
Okay, this seems like too much work, too many hacks.
trevorriles has joined #ocaml
<companion_cube>
jsoo or bucklescript, anyway
<Algebr`>
rite
infinity0 has quit [Ping timeout: 250 seconds]
infinity0 has joined #ocaml
<Algebr`>
#MakeReflectionGreatAgain
<companion_cube>
meh, reflection has a runtime cost :p
<companion_cube>
have you considered F# ?
<Algebr`>
wait a sec, what about ocamldebug
<companion_cube>
bytecode
<Algebr`>
can't ocamldebug create ocaml values on the fly
<companion_cube>
I don't think so
<companion_cube>
and it cannot typecheck on the fly either, afaik
<Algebr`>
nah, no f# in my game.
<Algebr`>
one day a hero will arise and make ocamldebug amazing.
<companion_cube>
heh
<companion_cube>
I'd rather have a good gdb compatibility story
<mpenet>
(I am trying to submit a patch, but I want to include tests for it)
sepp2k has quit [Quit: Leaving.]
<mpenet>
I am just trying to run the current tests but I am hitting a wall with ounit dependency, and I can't find a clear explaination on how to achieve that.
ski has quit [Ping timeout: 276 seconds]
maufred has quit [Ping timeout: 250 seconds]
maufred has joined #ocaml
ski has joined #ocaml
aggelos_ has quit [Ping timeout: 244 seconds]
aggelos_ has joined #ocaml
al-damiri has joined #ocaml
<flux>
mpenet, hmm, do you mean installing ounit?
<mpenet>
it's installed, I did "opam install ounit" and it's listed if I "opam list"
<mpenet>
I just want to understand how to compile the tests for this project
<mpenet>
since there's no makefile/_oasis etc, it's not really whay I am used to (newbie here)
<flux>
mpenet, the opam file suggests this would work: ocaml pkg/pkg.ml build --tests true; ocaml pkg/pkg.ml test
<flux>
I don't know what the "%{pinned}%" expands to, though